PageSourceSearch

https://assets.kaartje2go.nl/assets/js/modern/calculatePriceModal.03c9b1bab54c5023392.js

js kaartje2go.nl collected 2026-09-24 22:00:40 UTC 49,127 bytes, 2 lines download raw bytes

1/*! For license information please see calculatePriceModal.03c9b1bab54c5023392.js.LICENSE.txt */
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"[email protected]"},e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];if(null!=r)for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:react-frontend":!0});var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="322ab964-c06a-4303-a9e1-65035baa8e72",e._sentryDebugIdIdentifier="sentry-dbid-322ab964-c06a-4303-a9e1-65035baa8e72")}catch(e){}}(),(globalThis.__LOADABLE_LOADED_CHUNKS__||=[]).push([[899],{39588(e,t,r){r(85068),r(19843),r(62758),r(75522),r(48),r(13489);var i=r(92990),n=r(52742),s=r(32889),o=r.n(s),a=r(38303),l=r(12040),d=r(80816),c=r(13526),u=r(94686);const p=["enableButtons","enableUpdateOnButtonClick","maxQuantity","minQuantity","quantity","maxWidth","onChange","setQuantity","testId","className"];function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach(function(t){v(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function v(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,s,o,a=[],l=!0,d=!1;try{if(s=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=s.call(r)).done)&&(a.push(i.value),a.length!==t);l=!0);}catch(e){d=!0,n=e}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}const g=e=>{let t=e.enableButtons,r=e.enableUpdateOnButtonClick,s=e.maxQuantity,h=void 0===s?5e3:s,v=e.minQuantity,y=void 0===v?1:v,g=e.quantity,b=e.maxWidth,x=e.onChange,j=e.setQuantity,O=(e.testId,e.className),P=function(e,t){if(null==e)return{};var r,i,n=function(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,p);const w=f((0,i.useState)(()=>g||y),2),N=w[0],I=w[1],A=(0,i.useCallback)(o()(e=>!!e&&(j(e),null===x||void 0===x||x(e),!0),750),[x,j]);(0,i.useEffect)(()=>{I(g)},[g]);const S=N<=y,E=N>=h,C=t?(0,u.jsx)(n.jC,{style:{width:"44px"},children:(0,u.jsx)(n.Ho,{disabled:S,size:"small",onClick:()=>{A.cancel();const e=Math.max(N-1,y);(0,a.flushSync)(()=>I(e)),r&&A(e)}
2,icon:(0,u.jsx)(l.A,{className:(0,c.A)("size-6 shrink-0",S?"text--grey-300":"text--grey-700")}),as:"button"})}):void 0,T=t?(0,u.jsx)(n.jC,{style:{width:"44px"},children:(0,u.jsx)(n.Ho,{disabled:E,size:"small",onClick:()=>{A.cancel();const e=Math.min(N+1,h);(0,a.flushSync)(()=>I(e)),r&&A(e)},icon:(0,u.jsx)(d.A,{className:(0,c.A)("size-6 shrink-0",E?"text--grey-300":"text--grey-700")}),as:"button"})}):void 0;return(0,u.jsx)("div",{style:b?{maxWidth:b}:void 0,children:(0,u.jsx)(n.pd,m({type:"number",beforeAdornment:C,afterAdornment:T,id:"quantity",min:y,max:h,value:N,validation:!1,onChange:e=>{const t=Math.abs(parseInt(e.target.value,10));(0,a.flushSync)(()=>I(t)),A(t)},inputStyle:t?{textAlign:"center",fontWeight:600}:void 0,className:(0,c.A)({"quantity-input--buttons":t},O),inputMode:"numeric"},P))})};r.d(t,["A",0,g])},40038(e,t,r){r.d(t,{$:()=>o,Y:()=>a});var i=r(92990),n=r(94686);const s=(0,i.createContext)({});function o(e){let t=e.children,r=e.name,i=e.onChange,o=e.value;return(0,n.jsx)(s,{value:{name:r,onChange:i,value:o},children:t})}function a(){const e=(0,i.use)(s);if(!e)throw new Error("useCardRadioGroup must be used within the CardRadioGroup");return e}},13443(e,t,r){r.d(t,{U:()=>d});var i=r(13526),n=r(68183),s=r(94686);const o=["className"];function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function l(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e){let t=e.className,r=function(e,t){if(null==e)return{};var r,i,n=function(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,o);const d=(0,n.R)().checked,c=(0,i.A)("rounded-md overflow-hidden border-2 border-solid bg-gray-25",{"border-magenta-700":d,"border-transparent":!d},t);return(0,s.jsx)("div",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){l(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({className:c},r))}},68183(e,t,r){r.d(t,{Q:()=>p,R:()=>h});var i=r(92990),n=r(13526),s=r(40038),o=r(94686);const a=["children","className","disabled","htmlFor","required","value"];function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach(function(t){c(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function c(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const u=(0,i.createContext)({checked:!1});function p(e){let t=e.children,r=e.className,l=e.disabled,c=e.htmlFor,p=e.required,h=e.value,m=function(e,t){if(null==e)return{};var r,i,n=function(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;
2r[i]=e[i]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,a);const v=(0,s.Y)(),f=v.onChange,y=v.name,g=v.value,b=(0,i.useId)(),x=h===g;return(0,o.jsx)(u,{value:{checked:x},children:(0,o.jsxs)("label",d(d({className:(0,n.A)("block cursor-pointer relative card-radio-group-item",r),htmlFor:c||b},m),{},{children:[(0,o.jsx)("input",{checked:x,className:"sr-only",disabled:l,id:c||b,name:y,onChange:f,required:p,type:"radio",value:h}),t]}))})}function h(){const e=(0,i.use)(u);if(!e)throw new Error("useCardRadioGroupItem must be used within the CardRadioGroupItem");return e}},29797(e,t,r){var i=r(13526),n=r(94686);const s=["children","className","color","visual","size","testId"];function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){l(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function l(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const d=e=>{let t=e.children,r=e.className,o=e.color,l=e.visual,d=e.size,c=(e.testId,function(e,t){if(null==e)return{};var r,i,n=function(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,s));const u=(0,i.A)("notification",{[`is--${o}`]:o,[`is--${d}`]:d,"text-sm":"small"===d},r);return(0,n.jsxs)("div",a(a({className:u},c),{},{children:[l&&(0,n.jsx)("div",{className:"notification__visual",children:l}),(0,n.jsx)("div",{className:"notification__content",children:t})]}))};r.d(t,["A",0,d])},79717(e,t,r){r(97700),r(19843),r(48);var i=r(95633),n=r(12278);const s=[n.gM.SEPARATE_ENVELOPES,n.gM.ENVELOPE_SEALS,n.gM.ROUNDED_CORNERS],o=[n.gM.SEPARATE_ENVELOPES,n.gM.WINDOW_ENVELOPES];r.d(t,["H",0,e=>{let t=e.cardFormat,r=e.pagesAmount,a=e.hasEditedBack,l=void 0!==a&&a,d=e.allowFoilPrint,c=void 0!==d&&d,u=e.allowPaperType,p=void 0!==u&&u,h=e.allowWindowEnvelope,m=void 0!==h&&h;const v=[...s,...c?[n.gM.FOIL_PRINT]:[],...p?[n.gM.PAPER]:[],...m?[n.gM.WINDOW_ENVELOPES]:[]],f=i.Y.isSingleRectangleCard(r,t)&&!l;return v.filter(e=>!(f&&o.includes(e)))||[]}])},92327(e,t,r){var i=r(79159),n=r(91986);r.d(t,["T",0,(e,t)=>{const r=t||i.M.t;switch((0,n.S)(e)){case"small":return r("Small");case"normal":return r("Normal");case"large":return r("Large");case"super":return r("Super");default:return null}}])},59554(e,t,r){r.d(t,{z:()=>n});r(97700),r(41882);var i=r(74032);function n(e,t,r){let i;return e.forEach(e=>{const n=t[e.id];n.attributes.shipping.find(e=>r.includes(e.alias))&&(i=n)}),i}r.d(t,["C",0,function(e,t,r,s){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"totalAmount";return e.map(e=>{var a,l;const d=((null===e||void 0===e||null===(a=e.relationships)||void 0===a?void 0:a.pricingOverviews)||{}).data;if(!d)return e;const c=s?n(d,t,s):t[d[0].id];if(!c||!e.attributes)return e;return!1===(null===(l=Object.getOwnPropertyDescriptor(e.attributes,"price"))||void 0===l?void 0:l.writable)||(e.attributes.price=c?(0,i.S)(c,r,o,e.id):""),e})}])},74032(e,t,r){r(62758),r(6667);var i=r(22179);r.d(t,["S",0,function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"totalAmount",n=arguments.length>3?arguments[3]:void 0;try{return e.attributes.prices[t?"loggedIn":"loggedOut"][r].replace(",00",",-")}catch(s){return i.q.captureException(s,{extra:{pricingOverview:e,loggedIn:t,key:r,productId:n}}),""}}])},81571(e,t,r){var i=r(20787),n=r(93056),s=r(13526),o=r(29797),a=r(75334),l=r(59365),d=r(94686);const c=["productId","quantity","card","category","className"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?u(Object(r),!0).forEach(function(t){h(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function h(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const m=e=>{let t=e.productId,r=e.quantity,u=e.card,h=e.category,m=e.className,v=function(e,t){if(null==e)return{};var r,i,n=function(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,c);const f=(0,(0,a.A)({slug:u.attributes.slug||"",url:u.attributes.url||"",category:(null===h||void 0===h?void 0:h.attributes.slug)||"",shipType:l.zN.BOX},{isSample:!1,enabled:!!u}).getNextCardTierStep)(t,r),y=null===f||void 0===f?void 0:f.attributes.quantity,g=null===f||void 0===f?void 0:f.attributes.discount;return g||y?(0,d.jsx)(o.A,p(p({visual:(0,d.jsx)(i.A,{}),color:"green",className:(0,s.$)("w-full",m),size:"small"},v),{},{children:y?(0,d.jsxs)(n.x,{i18nKey:"DISCOUNT_QUANTITY_INFO",values:{nextDiscountQuantity:y,nextDiscountAmount:g},children:["Order ",(0,d.jsx)("span",{children:{nextDiscountQuantity:y}})," cards and directly receive ",(0,d.jsxs)("strong",{children:[{nextDiscountAmount:g}," discount!"]})]}):(0,d.jsxs)(n.x,{i18nKey:"DISCOUNT_QUANTITY_INFO_200",values:{nextDiscountAmount:g},children:["Directly receive ",(0,d.jsxs)("strong",{children:[{nextDiscountAmount:g}," discount!"]})]})})):null};r.d(t,["A",0,m])},3050(e,t,r){r.r(t),r.d(t,{CalculatePriceModal:()=>ve});r(85068),r(19843),r(62758),r(75522),r(48);var i=r(92990),n=r(80821),s=r(61568),o=r(84166),a=r(59365),l=r(85334),d=r(75966),c=r(25458),u=r(24247),p=r(57028),h=r(65611),m=r(30717),v=r(12278),f=r(6968),y=r(79717),g=r(66534),b=r(78062),x=r(96020),j=r(61902),O=r(39203);r(21323);const P=(0,r(27009).Ay)({resolved:{},chunkName:()=>"DiscountTableModal",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!r.m[t]},importAsync:()=>r.e(9345).then(()=>r(53737)),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then(e=>(this.resolved[t]=!0,e))},requireSync(e){const t=this.resolve(e);return r(t)},resolve:()=>53737},{resolveComponent:e=>e.DiscountTableModal});P.displayName="DiscountTableModal";const w=P;var N=r(96629),I=r(48544),A=r(21184),S=r(30268),E=r(42193),C=r(82493),T=r(64437),_=r(68183),D=r(13443),F=r(40038),R=r(40042),$=r(93212),M=r.n($),k=r(94686);const q=e=>{let t=e.keyModifier,r=e.cols,i=void 0===r?3:r,n=e.options,s=void 0===n?3:n,o=e.orientation,a=void 0===o?"vertical":o;return(0,k.jsx)("div",{className:`grid grid-cols-${i} gap-x-2 gap-y-4`,children:Array.from({length:s}).map((e,r)=>(e=>"horizontal"===a?(0,k.jsx)("div",{children:(0,k.jsx)("div",{className:"flex mb-2 rounded-md overflow-hidden",children:(0,k.jsx)(R.Ay,{style:{height:123,width:"100%",display:"inline"},uniqueKey:`option-skeleton-${e}`,children:(0,k.jsx)("rect",{x:"0",y:"0",rx:"6",ry:"6",width:"100%",height:"100%"})})})},e):(0,k.jsxs)("div",{children:[(0,k.jsx)("div",{className:"aspect-square flex mb-2 rounded-md overflow-hidden",children:(0,k.jsx)(R.Ay,{style:{display:"inline"},uniqueKey:`option-skeleton-${e}`,children:(0,k.jsx)("rect",{x:"0",y:"0",rx:"6",ry:"6",width:"100%",height:"100%"})})}),(0,k.jsx)(R.Ay,{style:{height:40,width:"100%",display:"inline"},uniqueKey:`option-skeleton-${e}__title`,children:(0,k.jsx)("rect",{x:"0",y:"0",rx:"6",ry:"6",width:"100%",height:40})})]},e))(`${t}-${r}`))})},L=(0,i.memo)(q,M());var B=r(85747);function U(e){var t;let r=e.envelopeProducts,s=e.foilTypeProducts,o=e.handleFormChange,a=e.paperTypeProducts,l=e.roundedCornerProducts,d=e.formData,c=e.isFetching;const u=(0,n.B)().t,p=(0,m.A)(),h=p.card,f=p.finishingProducts,y=null===f||void 0===f?void 0:f[v.gM.FOIL_PRINT],b=s.find(e=>e.attributes.slug===(null===y||void 0===y?void 0:y.attributes.slug));return(0,k.jsxs)(i.Fragment,{children:[!(null===h||void 0===h||!h.attributes.spotColor)&&(0,k.jsxs)("div",{className:"mb-12",children:[(0,k.jsx)("div",{className:"font-bold text-lg mb-2",children:u("Foilprint")}),c?(0,k.jsx)(L,{keyModifier:"foilprint",cols:3,options:2}):(0,k.jsx)(F.$,{name:"foilPrintTypeId",onChange:e=>o({foilPrintTypeId:e.target.value}),value:null===d||void 0===d?void 0:d.foilPrintTypeId,children:(0,k.jsxs)("div",{className:"grid grid-cols-3 gap-x-2 gap-y-4",children:[(0,k.jsxs)(_.Q,{value:"0",children:[(0,k.jsx)(D.U,{className:"mb-2",children:(0,k.jsx)("div",{className:"aspect-square flex items-center justify-center",children:(0,k.jsx)(I.A,{})})}),(0,k.jsxs)("div",{className:"leading-5",children:[(0,k.jsx)("div",{className:"font-semibold",children:u("No foil print")}),(0,k.jsx)(g.A,{prefix:"+",price:"0",suffix:u("p/pc")})]})]}),b&&(0,k.jsxs)(_.Q,{value:b.id,children:[(0,k.jsx)(D.U,{className:"mb-2",children:(0,k.jsx)("div",{className:"aspect-square flex",children:(0,k.jsx)(E.A,{foilType:null===b||void 0===b||null===(t=b.meta)||void 0===t?void 0:t.color,size:"100%"})})}),(0,k.jsxs)("div",{className:"leading-5",children:[(0,k.jsx)("div",{className:"font-semibold",children:null===b||void 0===b?void 0:b.attributes.title}),(0,k.jsx)(g.A,{prefix:"+",price:null===b||void 0===b?void 0:b.attributes.price,suffix:u("p/pc")})]})]})]})})]}),c?(0,k.jsxs)("div",{className:"mb-12",children:[(0,k.jsx)("div",{className:"font-bold text-lg mb-2",children:u("Cho
2ose a papertype")}),(0,k.jsx)(L,{keyModifier:"paperType",cols:1,options:6,orientation:"horizontal"})]}):(0,k.jsxs)("div",{className:"mb-12",children:[(0,k.jsx)("div",{className:"font-bold text-lg mb-2",children:u("Choose a papertype")}),1===a.length&&(0,k.jsx)(B.F,{className:"mb-4",variant:"info",filled:!1,children:u("CONFIGURATOR_ONE_PAPERTYPE_AVAILABLE")}),(0,k.jsx)("div",{className:"grid gap-2",children:(0,k.jsx)(F.$,{name:"paperTypeId",onChange:e=>o({paperTypeId:e.target.value}),value:null===d||void 0===d?void 0:d.paperTypeId,children:a.map(e=>{const t={height:92,src:e.attributes.image,width:150};return(0,k.jsx)(_.Q,{value:e.id,children:(0,k.jsxs)(D.U,{className:"flex",children:[(0,k.jsx)("div",{className:"shrink-0 aspect-5/4",children:(0,k.jsx)("img",{alt:"",className:"object-cover h-full",height:t.height,src:(0,C._)(t.src,t.width,t.height,!0),srcSet:`\n                                                        ${(0,C._)(t.src,t.width,t.height,!0)} 1x,\n                                                        ${(0,C._)(t.src,2*t.width,2*t.height,!0)} 2x\n                                                    `,width:t.width})}),(0,k.jsxs)("div",{className:"grid gap-1 leading-5 p-4",children:[(0,k.jsx)("div",{className:"font-semibold",children:e.attributes.title}),(0,k.jsx)("div",{children:e.attributes.description}),(0,k.jsx)(g.A,{prefix:"+",price:e.attributes.price,suffix:u("p/pc")})]})]})},`card-paper-type-${e.id}`)})})})]}),l.length>0&&h&&(0,k.jsxs)("div",{className:"mb-12",children:[(0,k.jsx)("div",{className:"font-bold text-lg mb-2",children:u("Choose a card corner")}),c?(0,k.jsx)(L,{keyModifier:"roundedCorners",cols:3,options:2}):(0,k.jsx)(F.$,{name:"roundedCornerTypeId",onChange:e=>o({roundedCornerTypeId:e.target.value}),value:null===d||void 0===d?void 0:d.roundedCornerTypeId,children:(0,k.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,k.jsxs)(_.Q,{value:"0",children:[(0,k.jsx)(D.U,{className:"mb-2",children:(0,k.jsx)("div",{className:"aspect-square",children:(0,k.jsx)(A.h,{cardFormat:h.attributes.cardFormat,images:h.attributes.images,isRounded:!1,pagesAmount:S.RG.SINGLE,sizeMultiplier:3,title:u("Your card")})})}),(0,k.jsxs)("div",{className:"leading-5",children:[(0,k.jsx)("div",{className:"font-semibold",children:u("No rounded corners")}),(0,k.jsx)(g.A,{prefix:"+",price:"0",suffix:u("p/pc")})]})]}),l.map(e=>{var t;return(0,k.jsxs)(_.Q,{value:e.id,children:[(0,k.jsx)(D.U,{className:"mb-2",children:(0,k.jsx)("div",{className:"aspect-square",children:(0,k.jsx)(A.h,{cardFormat:h.attributes.cardFormat,images:h.attributes.images,isRounded:Number(null===(t=e.relationships)||void 0===t||null===(t=t.productSubtypes)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.id)===v.gM.ROUNDED_CORNERS,pagesAmount:S.RG.SINGLE,sizeMultiplier:3,title:u("Your card")})})}),(0,k.jsxs)("div",{className:"leading-5",children:[(0,k.jsx)("div",{className:"font-semibold",children:e.attributes.title}),(0,k.jsx)(g.A,{prefix:"+",price:e.attributes.price,suffix:u("p/pc")})]})]},`card-rounded-corner-${e.id}`)})]})})]}),c?(0,k.jsxs)("div",{className:"mb-12",children:[(0,k.jsx)("div",{className:"font-bold text-lg mb-2",children:u("Choose an envelope")}),(0,k.jsx)(L,{keyModifier:"envelopes",cols:3,options:12})]}):h&&(0,k.jsxs)("div",{className:"mb-12",children:[(0,k.jsx)("div",{className:"font-bold text-lg mb-2",children:u("Choose an envelope")}),(0,k.jsx)(F.$,{name:"envelopeId",onChange:e=>o({envelopeId:e.target.value}),value:null===d||void 0===d?void 0:d.envelopeId,children:(0,k.jsxs)("div",{className:"grid grid-cols-3 gap-x-2 gap-y-4",children:[(0,k.jsxs)(_.Q,{value:"0",children:[(0,k.jsx)(D.U,{className:"mb-2",children:(0,k.jsx)("div",{className:"aspect-square flex items-center justify-center",children:(0,k.jsx)(I.A,{})})}),(0,k.jsxs)("div",{className:"leading-5",children:[(0,k.jsx)("div",{className:"font-semibold",children:u("No envelopes")}),(0,k.jsx)(g.A,{prefix:"+",price:"0",suffix:u("p/pc")})]})]}),r.map(e=>(0,k.jsxs)(_.Q,{value:e.id,children:[(0,k.jsx)(D.U,{className:"mb-2",children:(0,k.jsx)("div",{className:"p-3",children:(0,k.jsx)("div",{className:"aspect-square flex items-center justify-center",children:(0,k.jsx)(T.A,{cardFormat:h.attributes.cardFormat,src:e.attributes.image,className:"drop-shadow-light"})})})}),(0,k.jsxs)("div",{className:"leading-5",children:[(0,k.jsx)("div",{className:"font-semibold",children:e.attributes.title}),(0,k.jsx)(g.A,{prefix:"+",price:e.attributes.price,suffix:u("p/pc")})]})]}
2,`card-envelope-${e.id}`))]})})]})]})}r(13489);var z=r(54603),W=r(49136),Q=r(38170),G=r(92327),V=r(77890),K=r(91986),Y=r(95633);function H(e){let t=e.handleFormChange,r=e.formData,s=e.subtypeId,o=e.hasRoundedCorners;const l=(0,n.B)().t,d=(0,m.A)(),c=d.card,u=d.hasCardPagesOption,p=d.isLoading,h=d.pdpDefaultCardProducts,v=(0,z.A)({includeTierPrices:!0,productId:null===r||void 0===r?void 0:r.productId,quantity:"number"===typeof(null===r||void 0===r?void 0:r.quantity)?r.quantity:parseInt((null===r||void 0===r?void 0:r.quantity)||"0",10),subtypeId:s,shipType:a.zL[a.oW.BOX]}),f=v.isLoading,y=v.isFetching,b=v.pricingOverviews,x=v.sortedCardProducts,j=[{value:S.RG.SINGLE,label:l("Single card",{count:1})},{value:S.RG.DOUBLE,label:l("Double card",{count:1})}];return(0,k.jsxs)(i.Fragment,{children:[p?(0,k.jsxs)("div",{className:"mb-12",children:[(0,k.jsx)("div",{className:"font-bold text-lg mb-2",children:l("Choose a card type")}),(0,k.jsx)(L,{keyModifier:"cardProduct",cols:3,options:2})]}):u&&c&&(0,k.jsxs)("div",{className:"mb-12",children:[(0,k.jsx)("div",{className:"font-bold text-lg mb-2",children:l("Choose a card type")}),(0,k.jsx)(F.$,{name:"pagesAmount",onChange:e=>{var r;const i=e.target.value;t({pagesAmount:i,productId:null===h||void 0===h||null===(r=h[i])||void 0===r?void 0:r.cardproduct.id})},value:null===r||void 0===r?void 0:r.pagesAmount,children:(0,k.jsx)("div",{className:"grid grid-cols-3 gap-2",children:j.map(e=>{const t=Y.Y.hasFoldTop(e.value,c.attributes.cardFormat)?"top":Y.Y.hasFoldLeft(e.value,c.attributes.cardFormat)?"left":void 0,r=o?"left"===t?"right":"top"===t?"bottom":"all":void 0,i=S.HI[c.attributes.cardFormat],n=i.width,s=i.height;return(0,k.jsxs)(_.Q,{value:e.value,children:[(0,k.jsx)(D.U,{className:"mb-2",children:(0,k.jsx)("div",{className:"p-4",children:(0,k.jsx)("div",{className:"aspect-square",children:(0,k.jsxs)(W.u,{cardFormat:c.attributes.cardFormat,fold:t,height:s,rounded:r,view:"front",width:n,children:[(0,k.jsx)(Q.B,{height:s,src:c.attributes.images.front,variant:"primary",width:n}),Y.Y.isDoubleCard(e.value)&&c.attributes.images.inner&&(0,k.jsx)(Q.B,{height:s,quality:"10",src:c.attributes.images.inner,variant:"secondary",width:n})]})})})}),(0,k.jsx)("div",{className:"leading-5",children:(0,k.jsx)("div",{className:"font-semibold",children:e.label})})]},`card-pages-${e.value}`)})})})]}),f||y&&!x?(0,k.jsxs)("div",{className:"mb-12",children:[(0,k.jsx)("div",{className:"font-bold text-lg mb-2",children:l("Choose a size")}),(0,k.jsx)(L,{keyModifier:"cardProduct",cols:3,options:3})]}):c&&x&&(0,k.jsxs)("div",{className:"mb-12",children:[(0,k.jsx)("div",{className:"font-bold text-lg mb-2",children:l("Choose a size")}),(0,k.jsx)(F.$,{name:"productId",onChange:e=>t({productId:e.target.value}),value:null===r||void 0===r?void 0:r.productId,children:(0,k.jsx)("div",{className:"grid grid-cols-3 gap-2",children:x.map(e=>{var t;const r=null===(t=e.relationships)||void 0===t||null===(t=t.pricingOverviews.data)||void 0===t?void 0:t[0].id,i=r&&b&&b[r]||void 0,n=i?i.attributes.prices.loggedIn.cardPricePerUnit:"";return(0,k.jsxs)(_.Q,{value:e.id,children:[(0,k.jsx)(D.U,{className:"mb-2 aspect-square",children:Y.Y.isSpecialShapeCard(c.attributes.cardFormat)&&c.attributes.images.front?(0,k.jsx)("div",{className:"p-2",children:(0,k.jsx)("div",{className:"aspect-square",children:(0,k.jsx)("img",{alt:e.attributes.sizeDescription,className:"object-scale-down size-full drop-shadow-light",height:S.We[c.attributes.cardFormat].height,src:(0,C._)(c.attributes.images.front,S.We[c.attributes.cardFormat].width,"auto",!0),srcSet:`\n                                                                ${(0,C._)(c.attributes.images.front,S.We[c.attributes.cardFormat].width,"auto",!0)} 1x,\n                                                                ${(0,C._)(c.attributes.images.front,2*S.We[c.attributes.cardFormat].width,"auto",!0)} 2x\n                                                            `,width:S.We[c.attributes.cardFormat].width})})}):(0,k.jsx)(V.default,{alt:e.attributes.sizeDescription,cardFormat:c.attributes.cardFormat,pagesAmount:S.RG.SINGLE,className:"card-sizes__image",imageUrl:c.attributes.images.front||"",size:(0,K.S)(e.attributes.currentCardDimensions),isRounded:o,showRelativeSize:!0,gateWayDimension:S.We[c.attributes.cardFormat].width})}),(0,k.jsxs)("div",{className:"leading-5",children:[(0,k.jsx)("div",{className:"font-semibold",children:(0,G.T)(e.attributes.currentCardDimensions)}),(0,k.jsx)("div",{className:"text--grey-500",children:e.attributes.sizeDescription}),(0,k.jsx)(g.A,{price:n,suffix:l("p/pc")})]})]},`card-product-${e.id}`)})})})]})]})}var X=r(39588);function Z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,s,o,a=[],l=!0,d=!1;try{if(s=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=s.call(r)).done)&&(a.push(i.value),a.length!==t);l=!0);}catch(e){d=!0,n=e}
2finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return J(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?J(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}const ee=5e3,te=e=>{let t=e.onQuantityChange,r=e.quantity;const s=(0,n.B)().t,o=Z((0,i.useState)(r||20),2),a=o[0],l=o[1],d=Z((0,i.useState)(!1),2),c=d[0],u=d[1];return(0,i.useEffect)(()=>{r&&l(r)},[r]),(0,k.jsxs)(i.Fragment,{children:[(0,k.jsx)(X.A,{onChange:e=>{const r=(e=>(u(!1),Number.isNaN&&Number.isNaN(e)||"number"!==typeof e?(u("invalid"),0):e<1?1:e>ee?(u("maxExceeded"),ee):e))(e);l(r),t(r)},quantity:a,setQuantity:l,minQuantity:1,maxQuantity:ee,maxWidth:200,enableButtons:!0,enableUpdateOnButtonClick:!0,className:"mb-0",name:"quantity"}),c?(0,k.jsx)(B.F,{variant:"warning",filled:!1,className:"mt-2",children:"invalid"===c?s("Please fill in a valid quantity"):s("Sorry! The maximum amount of cards you can order is {{maxQuantity}}.",{maxQuantity:ee})}):null]})};var re=r(81571);function ie(e){let t=e.envelopeProducts,r=e.formData,s=e.isFetching,o=e.handleFormChange,d=e.paperTypeProducts,c=e.foilTypeProducts,u=e.roundedCornerProducts,p=e.subtypeId;const h=(0,n.B)().t,v=(0,m.A)(),f=v.category,y=v.card,g=v.shipType,b=v.isSample,P=g===a.zN.BOX&&!b,I=(0,N.A)(469,{enabled:P,assign:!1});return y?(0,k.jsxs)("form",{method:"post",className:"form",onSubmit:e=>e.preventDefault(),children:[(0,k.jsxs)("div",{className:"mb-8",children:[(0,k.jsx)("div",{className:"font-bold text-lg mb-2",children:h("Choose the amount of cards")}),(0,k.jsxs)("div",{className:"flex justify-between items-end",children:[(0,k.jsx)(te,{quantity:null===r||void 0===r?void 0:r.quantity,onQuantityChange:e=>o({quantity:e})}),(null===r||void 0===r?void 0:r.pagesAmount)&&(0,k.jsxs)(i.Fragment,{children:[(0,k.jsx)(j.A,{className:"bg-gray-25 py-2 px-4 rounded-4xl text-sm",icon:(0,k.jsx)(x.A,{className:"size-3 sm:size-4 shrink-0"}),iconAlignment:"left",underline:!1,modal:l.Zj,variant:"link",closeOtherModals:!1,onClick:()=>{null===I||void 0===I||I.sendUIEvent("Open discount table price calculator")},children:h("Open discount table")}),(0,k.jsx)(O.A,{modalName:l.Zj,children:(0,k.jsx)(w,{selectedPagesAmount:null===r||void 0===r?void 0:r.pagesAmount,selectedCardProductId:null===r||void 0===r?void 0:r.productId,card:y,category:f,onTabValueChange:()=>{null===I||void 0===I||I.sendUIEvent("Price table tab change - price calculator")}})})]})]}),(0,k.jsx)(re.A,{productId:null===r||void 0===r?void 0:r.productId,quantity:null===r||void 0===r?void 0:r.quantity,card:y,category:f,className:"mt-4"})]}),(0,k.jsx)(H,{handleFormChange:o,formData:r,subtypeId:p,hasRoundedCorners:!(null===r||void 0===r||!r.roundedCornerTypeId||"0"===(null===r||void 0===r?void 0:r.roundedCornerTypeId))}),(0,k.jsx)(U,{envelopeProducts:t,foilTypeProducts:c,roundedCornerProducts:u,paperTypeProducts:d,handleFormChange:o,isFetching:s,formData:r})]}):null}var ne=r(93056),se=r(42218),oe=r(37281),ae=r(29797),le=r(57597);const de=e=>{let t=e.addonIds,r=e.isFetching,i=e.cardId,s=e.quantity,o=e.subtypeId,l=e.pagesAmount,d=e.productId;const c=(0,n.B)().t,u=(0,oe.D)(),h=c("double"===l?"Double card":"Single card",{count:1}),m=(0,p.A)({cardId:i,quantity:s,productId:d,productSubtypeId:o,addons:t,shipTypeId:String(a.oW.BOX)}),f=m.cardAddons,y=m.prices;function b(e){return e.attributes.productSubtypeId===v.gM.FOIL_PRINT?c("Foilprint"):e.attributes.productSubtypeId===v.gM.SEPARATE_ENVELOPES?c("Envelope",{count:2}):e.attributes.productSubtypeId===v.gM.PAPER?c("Papertype"):e.attributes.title}return(0,k.jsxs)("div",{className:"mb-8",children:[(0,k.jsxs)("div",{className:"p-4 rounded-md bg-gray-25",children:[(0,k.jsxs)("div",{className:"text-md md:text-lg font-bold flex items-center gap-2 mb-4",children:[" ",c("Price calculation")]}),(0,k.jsx)(le.XI,{children:(0,k.jsxs)(le.BF,{children:[(0,k.jsxs)(le.Hj,{children:[(0,k.jsx)(le.nA,{className:"font-semibold whitespace-nowrap p-0",children:`${s} x`}),(0,k.jsx)(le.nA,{className:"font-semibold",width:"100%",children:h}),(0,k.jsx)(le.nA,{className:"font-semibold",align:"right",children:(0,k.jsx)(g.A,{price:null===y||void 0===y?void 0:y.loggedInProduct,isLoading:r})})]}),null===f||void 0===f?void 0:f.map(e=>(0,k.jsxs)(le.Hj,{children:[(0,k.jsx)(le.nA,{className:"whitespace-nowrap p-0"}),(0,k.jsx)(le.nA,{width:"100%",children:b(e)}),(0,k.jsx)(le.nA,{align:"right",children:(0,k.jsx)(g.A,{price:e.attributes.price,isLoading:r})})]},e.id))]})}),(0,k.jsx)("hr",{className:"my-4 border-gray-200"}),(0,k.jsxs)("div",{className:"flex justify-between mt-4 text-md",children:[(0,k.jsx)("div",{className:"font-semibold",children:c("Total")}),(0,k.jsx)("div",{children:(0,k.jsx)(g.A,{prefix:null===y||void 0===y?void 0:y.loggedOutProductAndAddOns,prefixClassName:"text--line-through text-sm font-normal",price:null===y||void 0===y?void 0:y.loggedInProductAndAddOns,isLoading:r,className:"font-semibold"})})]})]}),!u&&(0,k.jsx)(ae.A,{visual:(0,k.jsx)(se.A,{}),color:"green",className:"mt-4",size:"small",children:(0,k.jsxs)(ne.x,{i18nKey:"REGISTER_FOR_MEMBER_DISCOUNT_PRICE_CALCULATOR",children:["The shown discount is only available for registered users.\xa0",(0,k.jsx)(j.A,{closeOtherModals:!1,modal:"login",variant:"linkPrimary",children:"Register or log in"})," and receive immediate member discount."]})}),(0,k.jsxs)("div",{className:"text-sm mt-8",children:[" ",c("SHIPPING_CALCULATION_BASKET")]})]})};function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?ce(Object(r),!0).forEach(function(t){pe(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function pe(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function he(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,s,o,a=[],l=!0,d=!1;try{if(s=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=s.call(r)).done)&&(a.push(i.value),a.length!==t);l=!0);}catch(e){d=!0,n=e}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return me(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?me(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function ve(e){var t,r;let x=e.cardId,j=e.cardProductId,O=e.forceOpened,P=void 0!==O&&O,w=e.initialQuantity,N=e.subtypeId;(0,h.A)(c.PL.all,u.NB.all);const I=(0,n.B)().t,A=(0,m.A)(),S=A.hasFoilPrint,E=A.hasRoundedCorners,C=A.finishingProducts,T=A.selectedFinishingProducts,_=A.selectedPagesAmount,D=A.pdpDefaultCardProducts,F=A.category,R=A.card,$=he((0,i.useState)(),2),M=$[0],q=$[1],L=M||{},B=L.envelopeId,U=L.paperTypeId,z=L.foilPrintTypeId,W=L.roundedCornerTypeId,Q=L.productId,G=L.quantity,V=L.pagesAmount,K=null!==(t=V&&(null===D||void 0===D||null===(r=D[V])||void 0===r?void 0:r.productSubtypeId))&&void 0!==t?t:N,Y=((null===R||void 0===R?void 0:R.attributes)||{}).cardFormat,H=void 0!==(null===C||void 0===C?void 0:C[v.gM.FOIL_PRINT]),X=(0,i.useMemo)(()=>Y&&V?(0,y.H)({cardFormat:Y,pagesAmount:V,hasEditedBack:!0,allowPaperType:!0,allowFoilPrint:H}):[],[Y,V,H]),Z=(0,f.A)({hasFoilPrint:"0"!==z,productId:Q||j,shipTypeId:a.oW.BOX,cardCategoryId:null===F||void 0===F?void 0:F.id,subtypeIds:X,pricePerUnit:!0}),J=Z.availableProducts,ee=Z.envelopeProducts,te=Z.foilTypeProducts,re=Z.roundedCornerProducts,ne=Z.isFetching,se=Z.paperTypeProducts;function oe(){const e=[];return B&&"0"!==B&&e.push(B),W&&"0"!==W&&e.push(W),z&&"0"!==z&&e.push(z),U&&e.push(U),e}const ae=(0,p.A)({cardId:x,quantity:G||w,productId:Q||j,productSubtypeId:K,addons:oe(),shipTypeId:String(a.oW.BOX)}),le=ae.isFetching,ce=ae.prices,pe=ae.refetch;(0,i.useEffect)(()=>{if(!ne&&J.length)if(M){const r=!(null===ee||void 0===ee||!ee.find(e=>e.id===(null===M||void 0===M?void 0:M.envelopeId))),i=!(null===se||void 0===se||!se.find(e=>e.id===(null===M||void 0===M?void 0:M.paperTypeId))),n=!(null===te||void 0===te||!te.find(e=>e.id===(null===M||void 0===M?void 0:M.foilPrintTypeId))),s=!(null===re||void 0===re||!re.find(e=>e.id===(null===M||void 0===M?void 0:M.roundedCornerTypeId)));var e,t;if(!r||!i||!n||!s)q(ue(ue({},M),{},{envelopeId:r?M.envelopeId:null===(e=ee[0])||void 0===e?void 0:e.id,paperTypeId:i?M.paperTypeId:null===(t=se[0])||void 0===t?void 0:t.id,foilPrintTypeId:n?M.foilPrintTypeId:"0",roundedCornerTypeId:s?M.roundedCornerTypeId:"0"}))}else!function(e,t){var r,i;q({envelopeId:null===(r=e[0])||void 0===r?void 0:r.id,paperTypeId:null===(i=t[0])||void 0===i?void 0:i.id,quantity:w,productId:j,foilPrintTypeId:S&&(null===T||void 0===T?void 0:T[v.gM.FOIL_PRINT])||"0",roundedCornerTypeId:E&&(null===T||void 0===T?void 0:T[v.gM.ROUNDED_CORNERS])||"0",pagesAmount:_})}(ee,se)},[ne,J]),(0,i.useEffect)(()=>{!ne&&M&&pe()},[ne,M]);const me=(0,k.jsx)("div",{className:"flex items-center",children:(0,k.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[le?(0,k.jsx)(b.A,{width:100,height:24,display:"inline"}):(0,k.jsx)(g.A,{className:"font-bold text-xl leading-none",price:null===ce||void 0===ce?void 0:ce.loggedInPricePerUnitIncludingAddOns,suffix:I("p/pc"),suffixClassName:"font-semibold text-md"}),le?(0,k.jsx)(b.A,{width:100,height:16,display:"inline"}):(0,k.jsx)(g.A,{className:"text-base leading-none",price:null===ce||void 0===ce?void 0:ce.loggedInProductAndAddOns,prefix:`${I("Total")} `})]})});return(0,k.jsx)(o.A,{modalName:l.zK,contentLabel:I("PRICE_CALCULATOR_TITLE"),size:"medium",forceOpened:P,side:"right",title:I("PRICE_CALCULATOR_TITLE"),footerContent:me,children:(0,k.jsx)(d.A,{children:(0,k.jsxs)(s.A,{xs:12,children:[(0,k.jsx)(ie,{isFetching:ne,envelopeProducts:ee,formData:M,handleFormChange:e=>{q(t=>t?ue(ue({},t),e):t)},paperTypeProducts:se,foilTypeProducts:te,roundedCornerProducts:re,subtypeId:K}),(0,k.jsx)(de,{addonIds:oe(),cardId:x,isFetching:le,quantity:G||1,subtypeId:K,pagesAmount:V,productId:Q||j})]})})})}},64437(e,t,r){r(97700);var i=r(30268),n=r(82493),s=r(62683),o=r(94686);const a=e=>{let t=e.className,r=e.cardFormat,a=e.src;return r&&[i.IP.LANDSCAPE,i.IP.PORTRAIT,i.IP.OBLONG,i.IP.ARCH,i.IP.PILL,i.IP.TICKET,i.IP.WAVE,i.IP.WAVE_PORTRAIT].includes(r)?(0,o.jsxs)(s.V,{className:t,height:"127",loading:"lazy",src:(0,n._)(a,180,127),width:"180",children:[(0,o.jsx)("source",{width:169,he
2ight:119,srcSet:`${(0,n._)(a,169,119,!0)} 1x, ${(0,n._)(a,338,238,!0)} 2x`,type:"image/webp",media:"(min-width: 1200px)"}),(0,o.jsx)("source",{width:136,height:96,srcSet:`${(0,n._)(a,136,96,!0)} 1x, ${(0,n._)(a,272,192,!0)} 2x`,type:"image/webp",media:"(min-width: 992px)"}),(0,o.jsx)("source",{width:162,height:114,srcSet:`${(0,n._)(a,162,114,!0)} 1x, ${(0,n._)(a,324,228,!0)} 2x`,type:"image/webp",media:"(min-width: 768px)"}),(0,o.jsx)("source",{width:180,height:127,srcSet:(0,n._)(a,360,254,!0),type:"image/webp"}),(0,o.jsx)("source",{width:169,height:119,srcSet:`${(0,n._)(a,169,119)} 1x, ${(0,n._)(a,338,238)} 2x`,media:"(min-width: 1200px)"}),(0,o.jsx)("source",{width:136,height:96,srcSet:`${(0,n._)(a,136,96)} 1x, ${(0,n._)(a,272,192)} 2x`,media:"(min-width: 992px)"}),(0,o.jsx)("source",{width:162,height:114,srcSet:`${(0,n._)(a,162,114)} 1x, ${(0,n._)(a,324,228)} 2x`,media:"(min-width: 768px)"}),(0,o.jsx)("source",{width:180,height:127,srcSet:(0,n._)(a,360,254)})]}):r===i.IP.SKYSCRAPER?(0,o.jsxs)(s.V,{className:t,height:"91",loading:"lazy",src:(0,n._)(a,180,91),width:"180",children:[(0,o.jsx)("source",{width:169,height:86,srcSet:`${(0,n._)(a,169,86,!0)} 1x, ${(0,n._)(a,338,172,!0)} 2x`,media:"(min-width: 1200px)"}),(0,o.jsx)("source",{width:136,height:69,srcSet:`${(0,n._)(a,136,69,!0)} 1x, ${(0,n._)(a,272,138,!0)} 2x`,media:"(min-width: 992px)"}),(0,o.jsx)("source",{width:162,height:82,srcSet:`${(0,n._)(a,162,82,!0)} 1x, ${(0,n._)(a,324,164,!0)} 2x`,media:"(min-width: 768px)"}),(0,o.jsx)("source",{width:180,height:91,srcSet:(0,n._)(a,360,182,!0)}),(0,o.jsx)("source",{width:169,height:86,srcSet:`${(0,n._)(a,169,86)} 1x, ${(0,n._)(a,338,172)} 2x`,media:"(min-width: 1200px)"}),(0,o.jsx)("source",{width:136,height:69,srcSet:`${(0,n._)(a,136,69)} 1x, ${(0,n._)(a,272,138)} 2x`,media:"(min-width: 992px)"}),(0,o.jsx)("source",{width:162,height:82,srcSet:`${(0,n._)(a,162,82)} 1x, ${(0,n._)(a,324,164)} 2x`,media:"(min-width: 768px)"}),(0,o.jsx)("source",{width:180,height:91,srcSet:(0,n._)(a,360,182)})]}):(0,o.jsxs)(s.V,{className:t,height:"180",loading:"lazy",src:(0,n._)(a,180,180),width:"180",children:[(0,o.jsx)("source",{width:169,height:169,srcSet:`${(0,n._)(a,169,169,!0)} 1x, ${(0,n._)(a,338,338,!0)} 2x`,media:"(min-width: 1200px)"}),(0,o.jsx)("source",{width:140,height:140,srcSet:`${(0,n._)(a,140,140,!0)} 1x, ${(0,n._)(a,270,270,!0)} 2x`,media:"(min-width: 992px)"}),(0,o.jsx)("source",{width:166,height:166,srcSet:`${(0,n._)(a,166,166,!0)} 1x, ${(0,n._)(a,332,332,!0)} 2x`,media:"(min-width: 768px)"}),(0,o.jsx)("source",{width:180,height:180,srcSet:(0,n._)(a,360,360,!0)}),(0,o.jsx)("source",{width:169,height:169,srcSet:`${(0,n._)(a,169,169)} 1x, ${(0,n._)(a,338,338)} 2x`,media:"(min-width: 1200px)"}),(0,o.jsx)("source",{width:140,height:140,srcSet:`${(0,n._)(a,140,140)} 1x, ${(0,n._)(a,270,270)} 2x`,media:"(min-width: 992px)"}),(0,o.jsx)("source",{width:166,height:166,srcSet:`${(0,n._)(a,166,166)} 1x, ${(0,n._)(a,332,332)} 2x`,media:"(min-width: 768px)"}),(0,o.jsx)("source",{width:180,height:180,srcSet:(0,n._)(a,360,360)})]})};r.d(t,["A",0,a])},6968(e,t,r){r.d(t,{A:()=>p});r(19843),r(75522),r(48);var i=r(92990),n=r(4113),s=r(56014),o=r(12278),a=r(59554),l=r(81748),d=r(59365);const c=(e,t)=>t.filter(t=>{var r;return(null===(r=t.relationships)||void 0===r||null===(r=r.productSubtypes)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.id)===e});var u=r(25458);const p=function(e){const t=e.includeUnavailable,r=void 0!==t&&t,p=e.productId,h=e.shipTypeId,m=e.hasFoilPrint,v=e.subtypeIds,f=e.cardCategoryId,y=e.cardWithCustomSealId,g=e.isProcessedByPrintApi,b=void 0!==g&&g,x=e.isProcessedByBloomGift,j=void 0!==x&&x,O=e.isSingleRectangleWithoutEditedBack,P=e.pricePerUnit,w=void 0!==P&&P,N=(0,n.I)({queryKey:u.PL.withFilters(e),queryFn:e=>{let t=e.signal;return l.b.getAvailableAddOnsForProduct({productId:p,shipTypeId:h,hasFoilPrint:m,subtypeIds:v,cardCategoryId:f,cardWithCustomSealId:y,includeUnavailable:r,isProcessedByPrintApi:b,isProcessedByBloomGift:j,isSingleRectangleWithoutEditedBack:O},t)},staleTime:3e5,retry:1}),I=N.data,A=N.isFetching,S=N.refetch,E=N.isSuccess,C=(0,i.useMemo)(()=>{var e;const t=(0,s.$0)((null===I||void 0===I?void 0:I.products)||{},(null===I||void 0===I||null===(e=I.meta)||void 0===e?void 0:e.sorted_collection)||[]);return(0,a.C)(t,(null===I||void 0===I?void 0:I.pricingOverviews)||{},!0,void 0,w?"pricePerUnit":void 0)},[I,w]),T=c(o.gM.SEPARATE_ENVELOPES.toString(),C),_=c(o.gM.ENVELOPE_SEALS.toString(),C),D=c(o.gM.FOIL_PRINT.toString(),C),F=c(o.gM.PAPER.toString(),C),R=c(o.gM.WINDOW_ENVELOPES.toString(),C),$=c(o.gM.ROUNDED_CORNERS.toString(),C);return{availableProducts:C,combinedEnvelopeProducts:h===d.oW.DIRECT?[...R,...T]:[...T,...R],envelopeProducts:T,envelopeSealProducts:_,foilTypeProducts:D,roundedCornerProducts:$,isFetching:A,isSuccess:E,paperTypeProducts:F,refetch:S,windowEnvelopeProducts:R}}},57028(e,t,r){var i=r(92990),n=r(64140),s=r(4113),o=r(80821),a=r(530),l=r(55713),d=r(41987),c=r(19277),u=r(35478),p=r(24247),h=r(22887);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?m(Object(r),!0).forEach(function(t){f(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function f(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const y=function(e){const t=(0,o.B)().t,r=(0,u.w)(),m=e.cardId,f=e.enabled,y=void 0!==f&&f,g=e.foilPrint,b=e.productId,x=e.productSubtypeId,j=e.quantity,O=e.addons,P=e.shipTypeId,w=(0,s.I)({queryKey:p.NB.withFilters(v(v({},e),{},{userId:r})),queryFn:e=>{let i=e.signal;try{return l.a.getQuoteForNonExistingSuborder({cardId:m,foilPrint:g,quantity:j,productId:b,productSubtypeId:x,addons:O,shipTypeId:P,userId:r},i)}catch(n){throw a.G.isCancelled(n)||((0,d.A)(n),c.e0.error(t("Something went wrong. Please try again"),null===A||void 0===A?void 0:A.message).catch(()=>{})),n}},enabled:y,placeholderData:n.rX,staleTime:3e5,retry:1}),N=w.data,I=w.isFetching,A=w.error,S=w.refetch,E=(0,i.useMemo)(()=>{var e,t;if(!N)return{};const r=N.cardSuborders[""],i=v({},r.attributes.price),n=null===(e=r.relationships)||void 0===e||null===(e=e.pricingOverviews)||void 0===e||null===(e=e.data)||void 0===e?void 0:e[0].id,s=n?N.pricingOverviews[n]:void 0,o=null!==(t=r.relationships)&&void 0!==t&&t.addOns?(0,h.qB)(r.relationships.addOns,N.cardAddOns):{};return{cardAddOns:Object.values(o||{}).filter(Boolean),prices:i,pricingOverview:s}},[N]);return{cardAddons:E.cardAddOns,isFetching:I,pricingOverview:E.pricingOverview,prices:E.prices,refetch:S}};r.d(t,["A",0,y])},20787(e,t,r){const i={name:"percent",size:24,node:[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]},n=(0,r(11306).A)(i);r.d(t,["A",0,n])},80816(e,t,r){const i={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]},n=(0,r(11306).A)(i);r.d(t,["A",0,n])},96020(e,t,r){const i={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]},n=(0,r(11306).A)(i);r.d(t,["A",0,n])},42218(e,t,r){const i={name:"user-round",size:24,node:[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],aliases:["user-2"]},n=(0,r(11306).A)(i);r.d(t,["A",0,n])}}]);

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.