PageSourceSearch

https://www.finder.fi/_next/static/chunks/pages/tilaus/[customerType]-3f8f08a9e910d614.js

js finder.fi collected 2026-10-02 04:34:36 UTC 74,677 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2875],{86202:function(e,i,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/tilaus/[customerType]",function(){return t(601)}])},601:function(e,i,t){"use strict";t.r(i),t.d(i,{__N_SSP:function(){return iH},default:function(){return iz}});var n,r,o,l,s,a,c,d,u,p,v,m,h,x,f,g,j,y=t(52322),b="clover",Z="https://js.stripe.com",I="".concat(Z,"/").concat(b,"/stripe.js"),C=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,w=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,k=function(){for(var e=document.querySelectorAll('script[src^="'.concat(Z,'"]')),i=0;i<e.length;i++){var t,n=e[i];if(t=n.src,C.test(t)||w.test(t))return n}return null},_=function(e){var i=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src="".concat(I).concat(i);var n=document.head||document.body;if(!n)throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(t),t},S=function(e,i){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"8.6.1",startTime:i})},D=null,P=null,B=null,E=function(e,i,t){if(null===e)return null;var n,r=i[0].match(/^pk_test/),o=3===(n=e.version)?"v3":n;r&&o!==b&&console.warn("Stripe.js@".concat(o," was loaded on the page, but @stripe/stripe-js@").concat("8.6.1"," expected Stripe.js@").concat(b,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var l=e.apply(void 0,i);return S(l,t),l},F=!1,q=function(){return d||(d=(null!==D?D:(D=new Promise(function(e,i){if("undefined"==typeof window||"undefined"==typeof document){e(null);return}if(window.Stripe,window.Stripe){e(window.Stripe);return}try{var t,n=k();n?n&&null!==B&&null!==P&&(n.removeEventListener("load",B),n.removeEventListener("error",P),null===(t=n.parentNode)||void 0===t||t.removeChild(n),n=_(null)):n=_(null),B=function(){window.Stripe?e(window.Stripe):i(Error("Stripe.js not available"))},P=function(e){i(Error("Failed to load Stripe.js",{cause:e}))},n.addEventListener("load",B),n.addEventListener("error",P)}catch(e){i(e);return}})).catch(function(e){return D=null,Promise.reject(e)})).catch(function(e){return d=null,Promise.reject(e)}))};Promise.resolve().then(function(){return q()}).catch(function(e){F||console.warn(e)});var L=function(){for(var e=arguments.length,i=Array(e),t=0;t<e;t++)i[t]=arguments[t];F=!0;var n=Date.now();return q().then(function(e){return E(e,i,n)})},A=t(91118),M=t(13644);let T=L(M.Z.stripePk||"",{locale:"fi"});function R(e){let{children:i}=e;return(0,y.jsx)(A.eK,{stripe:T,children:i})}var O=t(2784),W=t(90463),N=t(17955),U=t(83112),K=t(5632),H=t(60890);let z=(0,O.createContext)({basePrices:null,cart:null,products:[],bundleConditions:null,addOrUpdateItem:async()=>null,removeItem:async()=>null,getLineItem:()=>({}),getCartLineItem:()=>null,getLineItemInfo:()=>({name:"",identifier:"",description:"",productDescription:"",hasInformation:!1}),applyPromotionCode:async()=>!0,removeCoupon:async()=>{},setCustomerId:()=>{},billingPeriodMonths:1,coupons:[],loading:!1,initialLoading:!0,hasTrackedViewItem:{current:!1},hasTrackedBeginCheckout:{current:!1}});function G(e){let{children:i,products:t,promotionCodes:n,intialCustomerId:r,additionalSessionData:o}=e,[l,s]=(0,O.useState)(null),[a,c]=(0,O.useState)(null),[d,u]=(0,O.useState)([]),[p,v]=(0,O.useState)(null),[m,h]=(0,O.useState)(!1),[x,f]=(0,O.useState)(!0),[g,j]=(0,O.useState)(1),[b,Z]=(0,O.useState)(!1),[I,C]=(0,O.useState)(r),w=(0,O.useRef)(!1),k=(0,O.useRef)(!1),{showNotification:_}=(0,N.Z)(),S=(0,U.Z)(),D=(0,K.useRouter)();(0,O.useEffect)(()=>{l&&D.query.cartId!==l.id&&D.replace({pathname:D.pathname,query:{...D.query,cartId:l.id}},void 0,{shallow:!0})},[l]),(0,O.useEffect)(()=>{(async function(){let e=[...new Set(t.flatMap(e=>{var i,t;let{data:n}=e;return[...n.prices.map(e=>e.priceId),...(null==n?void 0:null===(i=n.crossSells)||void 0===i?void 0:i.flatMap(e=>e.prices.map(e=>e.priceId)))||[],...(null==n?void 0:null===(t=n.upsells)||void 0===t?void 0:t.flatMap(e=>e.prices.map(e=>e.priceId)))||[]]}))];try{var i,r,l;let a=[],d=[],p=(0,H.FT)(t.map(e=>{let{data:i}=e;return i}));v(p),p&&(a.push(p.coupon),p.conditionsMet&&d.push(p.coupon));let m=await (0,W.p8)({recurringItems:e.map(e=>({priceId:e,quantity:1})),coupons:a,promotionCodes:n}),h=m.lines.data.find(e=>{var i,n;return(null===(n=e.pricing)||void 0===n?void 0:null===(i=n.price_details)||void 0===i?void 0:i.price)===(0,W.CY)(t[0].data).priceId}),x=(0,W.ik)(h),g=(null===(i=m.discounts)||void 0===i?void 0:i.filter(e=>{var i;return(null==e?void 0:null===(i=e.source)||void 0===i?void 0:i.coupon.id)!==(null==p?void 0:p.coupon)}).map(e=>{var i;return null==e?void 0:null===(i=e.source)||void 0===i?void 0:i.coupon.id}
1))||[],y={cartId:null==D?void 0:null===(r=D.query)||void 0===r?void 0:r.cartId,recurringItems:(0,H.Fu)(t.map(e=>{let{data:i,quantity:t}=e;return{productId:i.productId,quantity:t}}),m.lines.data,x),coupons:[...g,...d],customerId:I,additionalSessionData:o},{cart:b,newIntervalMonths:C}=await (0,H.gh)(y,m.lines.data);(null==D?void 0:null===(l=D.query)||void 0===l?void 0:l.cartId)&&(x=(0,W.ik)(b.lines.data[0])),j(C||x),Z(!!C||12!==x),s(b),c(m.lines.data),u(g),f(!1)}catch(e){console.error("Error initializing cart:",e),_(S.formatMessage({id:"checkout.genericError"}),"error",void 0,1e4,!0)}})()},[t,n]);let P=(0,O.useCallback)(async(e,i)=>{var t,n;h(!0);let r=(0,W.ik)(q(i.priceId)),o=(0,H.Fu)([{productId:e,quantity:i.quantity},...l?l.lines.data.filter(i=>{var t,n;return(null===(n=i.pricing)||void 0===n?void 0:null===(t=n.price_details)||void 0===t?void 0:t.product)!==e}).map(e=>{var i,t;return{productId:null===(t=e.pricing)||void 0===t?void 0:null===(i=t.price_details)||void 0===i?void 0:i.product,quantity:e.quantity}}):[]],a||[],r),s=[...d];null==p||!p.products||(null==p?void 0:null===(n=p.products)||void 0===n?void 0:null===(t=n.filter(i=>i!==e&&!L(i)))||void 0===t?void 0:t.length)?(null==p?void 0:p.coupon)&&v({...p,conditionsMet:!1}):(v({...p,conditionsMet:!0}),s.push(p.coupon));let c=await M(o,s,[]);return r!==g&&j(r),h(!1),c||null},[l]),B=(0,O.useCallback)(async e=>{var i,t;if(!l||!L(e)||0===l.lines.data.filter(i=>{var t,n;return(null===(n=i.pricing)||void 0===n?void 0:null===(t=n.price_details)||void 0===t?void 0:t.product)!==e}).length)return null;h(!0);let n=l.lines.data.filter(i=>{var t,n;return(null===(n=i.pricing)||void 0===n?void 0:null===(t=n.price_details)||void 0===t?void 0:t.product)!==e}).map(e=>(0,H.Dg)(e)),r=[...d];(null==p?void 0:null===(t=p.products)||void 0===t?void 0:null===(i=t.filter(i=>i!==e&&L(i)))||void 0===i?void 0:i.length)?v({...p,conditionsMet:!1}):(null==p?void 0:p.conditionsMet)&&(null==p?void 0:p.coupon)&&r.push(p.coupon);let o=await M(n,r,[]);return h(!1),o||null},[l]),E=(0,O.useCallback)(async e=>{var i;if(h(!0),!l)return h(!1),!1;let t=await M((0,H.aB)(l),[...d,...(null==p?void 0:p.conditionsMet)?[p.coupon]:[]],[e]);if(!t)return h(!1),!1;let n=null==t?void 0:null===(i=t.discounts)||void 0===i?void 0:i.find(i=>{var t;return((null==i?void 0:null===(t=i.promotion_code)||void 0===t?void 0:t.code)||"").toLowerCase()===e.toLowerCase()});return n&&u([...d,n.promotion_code.id]),h(!1),!0},[l]),F=(0,O.useCallback)(async e=>{if(h(!0),!l){h(!1);return}await M((0,H.aB)(l),d.filter(i=>i!==e),[]),u(d.filter(i=>i!==e)),h(!1)},[l,d]),q=e=>{var i,t;return(null==l?void 0:null===(t=l.lines)||void 0===t?void 0:null===(i=t.data)||void 0===i?void 0:i.find(i=>{var t,n;return(null===(n=i.pricing)||void 0===n?void 0:null===(t=n.price_details)||void 0===t?void 0:t.price)===e&&0!==i.amount}))||(null==a?void 0:a.find(i=>{var t,n;return(null===(n=i.pricing)||void 0===n?void 0:null===(t=n.price_details)||void 0===t?void 0:t.price)===e&&0!==i.amount}))},L=e=>{var i,t;return(null==l?void 0:null===(t=l.lines)||void 0===t?void 0:null===(i=t.data)||void 0===i?void 0:i.find(i=>{var t,n;return(null===(n=i.pricing)||void 0===n?void 0:null===(t=n.price_details)||void 0===t?void 0:t.product)===e&&0!==i.amount}))||null},A=(0,O.useMemo)(()=>{let e=t.flatMap(e=>{let{data:i}=e;return i.crossSells?i.crossSells.map(e=>e.productId):[]});return a?t.filter((i,t)=>{let{data:n}=i;return!e.includes(n.productId)||0===t}).map(e=>{var i;let{data:t}=e;return{...t,prices:t.prices.filter(e=>{var i,n,r;return(e.showInUi||(null===(r=L(t.productId))||void 0===r?void 0:null===(n=r.pricing)||void 0===n?void 0:null===(i=n.price_details)||void 0===i?void 0:i.price)===e.priceId)&&(!b||(0,W.ik)(q(e.priceId))===g)}),crossSells:null===(i=t.crossSells)||void 0===i?void 0:i.map(e=>({...e,prices:e.prices.filter(e=>e.showInUi&&(0,W.ik)(q(e.priceId))===g)})).filter(e=>e.prices.length>0)}}):[]},[t,a,g]),M=async(e,i,t)=>{try{let n=await (0,W.p8)({recurringItems:e,coupons:i,customerId:I,promotionCodes:t,additionalSessionData:o});return s(n),n}catch(e){return _(S.formatMessage({id:"checkout.genericError"}),"error",void 0,1e4,!0),!1}};return(0,y.jsx)(z.Provider,{value:{cart:l,basePrices:a,addOrUpdateItem:P,removeItem:B,loading:m,products:A,getLineItem:q,bundleConditions:p,getCartLineItem:L,getLineItemInfo:e=>{var i,n,r,o,l;let s;for(let i of t){if(i.data.productId===(null===(r=e.pricing)||void 0===r?void 0:null===(n=r.price_details)||void 0===n?void 0:n.product)){s=i.data;break}if(i.data.crossSells){for(let t of i.data.crossSells)if(t.productId===(null===(l=e.pricing)||void 0===l?void 0:null===(o=l.price_details)||void 0===o?void 0:o.product)){s=t;break}}}return{name:(null==s?void 0:s.name)||"",identifier:null==s?void 0:s.slug,description:(null==s?void 0:null===(i=s.prices.find(i=>{var t,n;return i.priceId===(null===(n=e.pricing)||void 0===n?void 0:null===(t=n.price_details)||void 0===t?void 0:t.price)}))||void 0===i?void 0:i.description)||"",productDescription:(null==s?void 0:s.description)||"",hasInformation:!!s}},initialLoading:x,billingPeriodMonths:g,coupons:d,applyPromotionCode:E,removeCoupon:F,setCustomerId:C,customerId:I,additionalSessionData:o,hasTrackedViewItem:w,hasTrackedBeginCheckout:k},children:i})}var Q=t(27149),$=t(78502),V=t(60218),Y=t(73569),X=t(59888),J=t(76385),ee=t(39097),ei=t.n(ee),et=t(42670),en=t(22211),er=t(96577),eo=t.n(er);function el(e){var i,t,n,r,o,l;let{uiSettings:s,customerType:a}=e,{products:c}=(0,O.useContext)(z),d=null==c?void 0:null===(t=c.find(e=>{var i;return null===(i=e.bullets)||void 0===i?void 0:i.image}))||void 0===t?void 0:null===(i=t.bullets)||void 0===i?void 0:i.image,u=null==c?void 0:null===(r=c.find(e=>e.bullets))||void 0===r?void 0:null===(n=r.bullets)||void 0===n?void 0:n.title,p=null==c?void 0:null===(l=c.find(e=>e.bullets))||void 0===l?void 0:null===(o=l.bullets)||void 0===o?void 0:o.items;return(0,y.jsx)(X.Z,{height:d?"100%":"100vh",bgcolor:M.Z.service===en.t6.Connect?"#D3DEFF":void 0,sx:{backgroundImage:d?void 0:"url(".concat(s.imageUrl,")"),backgroundSize:"cover",backgroundPositionX:"75%",backgroundPosition:"center"},children:(0,y.jsxs)(Y.Z,{padding:3,spacing:2,children:[(0,y.jsx)(ei(),{tabIndex:7,href:"/",shallow:!0,"aria-label":s.serviceName,children:(0,y.jsx)("img",{src:s.logoUrl,alt:s.serviceName})}),M.Z.service!==en.t6.Connect&&(0,y.jsx)(J.Z,{mt:1,variant:"body2",color:"white",fontWeight:"bold",children:(0,y.jsx)(et.Z,{id:"checkout.cart.subtitle.".concat(a)})}),d&&(0,y.jsx)(eo(),{src:d.url,alt:d.alt,width:d.width,height:d.height,style:{margin:"1rem auto",maxWidth:"100%",height:"auto"}}),u&&(0,y.jsx)(J.Z,{variant:"h4",textAlign:"center",children:u}),p&&(0,y.jsx)(X.Z,{display:"flex",gap:2,children:p.map((e,i)=>(0,y.jsxs)(X.Z,{textAlign:"center",width:"calc(100% / ".concat(p.length," - 1rem)"),
1children:[(0,y.jsx)(J.Z,{variant:"h5",children:e.top}),(0,y.jsx)(J.Z,{variant:"body3",children:e.bottom})]},i))})]})})}var es=t(28738),ea=t(44258),ec=t(16619),ed=t(6640),eu=t(14204),ep=t(98318),ev=t(86099),em=t(39283),eh=t(47476),ex=t(49177);function ef(e){let{priceId:i,productId:t}=e,{getLineItem:n,basePrices:r,products:o}=(0,O.useContext)(z),l=n(i),s=(0,W.m1)(l,1),a=(0,W.m1)(l,12),c=(0,H.so)(t,r,o),d=!1,u=a.priceWithoutDiscounts;return a.hasDiscounts?d=!0:M.Z.service!==en.t6.Connect&&c&&c.priceId===i&&(d=!0,u=c.mostExpensive.priceWithoutDiscounts),(0,y.jsxs)(Y.Z,{alignItems:"flex-end",children:[(0,y.jsx)(J.Z,{variant:"h5",children:(0,y.jsx)(et.Z,{id:l.quantity?"checkout.cart.linePrice.month":"checkout.cart.linePrice.month.noQty",values:{qty:l.quantity,price:(0,y.jsx)(ex.BK,{value:s.price,maximumFractionDigits:2,minimumFractionDigits:2})}})}),(0,y.jsxs)(Y.Z,{flexDirection:{xs:"column",sm:"row"},alignItems:"flex-end",children:[(0,y.jsx)(J.Z,{variant:"body2",color:d?"primary.main":"text.secondary",children:(0,y.jsx)(et.Z,{id:"checkout.cart.linePrice.year",values:{qty:l.quantity,price:(0,y.jsx)(ex.BK,{value:a.price,maximumFractionDigits:2,minimumFractionDigits:2})}})}),d&&(0,y.jsx)(J.Z,{variant:"body2",color:"text.disabled",ml:1,sx:{textDecoration:"line-through"},children:(0,y.jsx)(ex.BK,{value:u,maximumFractionDigits:2,style:"currency",currency:"EUR",currencyDisplay:"symbol"})})]})]})}var eg=t(36434),ej=t(68869),ey=t(26275),eb=t(85697),eZ=t(53130);let eI={[W.of.CallerPro]:"https://ucarecdn.com/cff86f50-cb44-48d7-b85e-e0de5e8184a1/-/format/auto/",[W.of.BusinessCard]:"https://ucarecdn.com/3d61c082-8998-40e3-bbc9-a0f3b3dfdfc5/-/format/auto/",[W.of.BusinessCardForService]:"https://ucarecdn.com/3d61c082-8998-40e3-bbc9-a0f3b3dfdfc5/-/format/auto/",[W.A3.FinderPro]:"https://ucarecdn.com/e4d1bef6-8a0a-44d2-baa4-13cc4b58ada2/-/format/auto/",[W.A3.FinderProConnect]:"https://ucarecdn.com/cc7341f7-1d30-45b9-9e6a-f32b86b5161f/-/format/auto/",[W.A3.FinderProCredit]:"https://ucarecdn.com/69352ba7-cd92-4b6d-8a4e-c7f900d799b1/-/format/auto/",[W.pB.ConnectMini]:"https://ucarecdn.com/ad35f9e5-d71b-4208-bf7f-97ff232110eb/-/format/auto/",[W.pB.ConnectStart]:"https://ucarecdn.com/bbe8c930-56d3-46e7-877d-0fa6aa64c56b/-/format/auto/",[W.pB.ConnectPlus]:"https://ucarecdn.com/8c506a91-5afe-4cfd-9155-76d4820d976d/-/format/auto/",[W.pB.ConnectEnterprise]:"",[W.pB.ConnectAiContent]:"",[W.pB.ConnectProfilelift]:"",[W.pB.ConnectKeywords]:"",[W.pB.ConnectMunicipality]:"",[W.pB.ConnectProvince]:"",[W.pB.ConnectLegacyKeywords]:""},eC={[W.of.CallerPro]:3,[W.of.BusinessCard]:0,[W.of.BusinessCardForService]:0,[W.A3.FinderPro]:4,[W.A3.FinderProConnect]:3,[W.A3.FinderProCredit]:3,[W.pB.ConnectMini]:3,[W.pB.ConnectStart]:1,[W.pB.ConnectPlus]:2,[W.pB.ConnectEnterprise]:0,[W.pB.ConnectAiContent]:0,[W.pB.ConnectProfilelift]:0,[W.pB.ConnectKeywords]:0,[W.pB.ConnectMunicipality]:0,[W.pB.ConnectProvince]:0,[W.pB.ConnectLegacyKeywords]:0};function ew(e){let{product:i}=e,[t,n]=(0,O.useState)(!1),r=i.slug;return r&&eI[r]?(0,y.jsxs)(X.Z,{onClick:e=>e.stopPropagation(),children:[(0,y.jsx)(ey.Z,{component:"a",href:"",onClick:e=>{e.preventDefault(),e.stopPropagation(),n(!0)},children:(0,y.jsx)(J.Z,{variant:"body2",children:(0,y.jsx)(et.Z,{id:"readMore"})})}),(0,y.jsx)(eZ.Z,{isOpen:t,toggle:e=>n(e),width:950,hasCloseButton:!0,children:(0,y.jsxs)(Y.Z,{columnGap:4,rowGap:3,pt:3,pb:1,width:"100%",flexDirection:{xs:"column",md:"row"},justifyContent:"space-evenly",alignItems:"center",px:{xs:0,md:3},children:[(0,y.jsxs)(Y.Z,{spacing:3,flexBasis:0,flexGrow:1,children:[(0,y.jsxs)(Y.Z,{children:[(0,y.jsx)(J.Z,{variant:"h3",component:"p",color:"primary",textAlign:{xs:"center",md:"left"},children:i.name}),(0,y.jsx)(J.Z,{variant:"h2",component:"p",textAlign:{xs:"center",md:"left"},children:(0,y.jsx)(et.Z,{id:"product.".concat(r,".subTitle")})})]}),(0,y.jsx)(J.Z,{variant:"body1",component:"p",textAlign:{xs:"center",md:"left"},children:(0,y.jsx)(et.Z,{id:"product.".concat(r,".description"),values:{br:(0,y.jsx)("br",{}),i:e=>(0,y.jsx)("i",{children:e})}})}),!!eC[r]&&(0,y.jsx)(J.Z,{variant:"body2",fontWeight:"bold",component:"p",children:(0,y.jsx)(et.Z,{id:"product.".concat(r,".featuresTitle")})}),(0,y.jsx)(Y.Z,{spacing:.5,children:Array(eC[r]).fill(0).map((e,i)=>(0,y.jsxs)(Y.Z,{direction:"row",spacing:1,children:[(0,y.jsx)(eb.Z,{style:{fontSize:14,marginTop:4},children:"check_outlined"}),(0,y.jsx)(J.Z,{variant:"body2",children:(0,y.jsx)(et.Z,{id:"product.".concat(r,".benefit.").concat(i)})})]},i))})]}),(0,y.jsx)(X.Z,{flexBasis:0,flexGrow:1,children:(0,y.jsx)("img",{src:eI[r],style:{width:"100%",borderRadius:8},alt:"Product image for ".concat(r)})})]})})]}):null}function ek(e){let{product:i}=e,{getCartLineItem:t}=(0,O.useContext)(z),n=t(i.productId),r=e=>{var i,t;return!!(e&&(null==n?void 0:null===(t=n.pricing)||void 0===t?void 0:null===(i=t.price_details)||void 0===i?void 0:i.price)===(null==e?void 0:e.priceId))};return(0,y.jsx)(Y.Z,{gap:3,flexDirection:"column",children:1===i.prices.length?(0,y.jsx)(eP,{price:i.prices[0],product:i,selected:r(i.prices[0]),cartLineItem:n}):(0,y.jsx)(eD,{product:i,priceSelected:r,cartLineItem:n})})}function e_(e){let{onClick:i,disabled:t,children:n}=e;return(0,y.jsx)(X.Z,{bgcolor:"background",color:"text.primary",children:(0,y.jsx)(ea.Z,{onClick:i,disabled:t,color:"inherit",children:n})})}function eS(e){let{priceId:i,productId:t}=e,{getLineItem:n,getCartLineItem:r,bundleConditions:o,basePrices:l,products:s}=(0,O.useContext)(z),a=r(t)||n(i),c=(0,H.UQ)(a),d=null,u=0,p=(0,H.so)(t,l,s);return((null==o?void 0:o.products.includes(t))&&c.hasDiscounts?(d="bundle",u=Math.round((c.priceWithoutDiscounts-c.price)/c.priceWithoutDiscounts*100)):M.Z.service!==en.t6.Connect&&p&&(null==p?void 0:p.priceId)===i&&(d="cheapestPrice",u=Math.round(p.discountPercentage)),d)?(0,y.jsx)(X.Z,{position:"absolute",left:0,top:0,bgcolor:"primary.main",borderRadius:"0px 0 8px 0",px:1,children:(0,y.jsx)(J.Z,{variant:"body3",color:"common.white",children:(0,y.jsx)(et.Z,{id:"checkout.cart.badge.".concat(d),values:{percentage:u}})})}):null}function eD(e){let{product:i,priceSelected:t,cartLineItem:n}=e;return(0,y.jsx)(ec.Z,{"aria-labelledby":"product-variation-group-label",name:"product-variation-group-".concat(i.productId),children:(0,y.jsx)(Y.Z,{gap:{xs:1.5,md:3},flexDirection:"column",children:i.prices.map((e,r)=>{let o=t(e);return(0,y.jsx)(eP,{controlComponent:(0,y.jsx)(ed.Z,{checked:o,sx:{p:0}}),price:e,product:i,selected:o,cartLineItem:n,hideControl:!o},r)})})})}function eP(e){let{price:i,product:t,selected:n,cartLineItem:r,controlComponent:o,hideControl:l=!1}=e,{addOrUpdateItem:s,removeItem:a,cart:c,products:d,coupons:u,bundleConditions:p,basePrices:v,billingPeriodMonths:m}=(0,O.useContext)(z),[h,x]=(0,O.useState)((null==r?void 0:r.quantity)||0),f=(0,eg.e)();(0,O.useEffect)(()=>{x((null==r?void 0:r.quantity)||0)},[r]);let g=(e,i)=>{var t,n,r;let o=(null===(t=e.prices)||void 0===t?void 0:t.map(e=>e.priceId))||[],l=e=>{var i,t;return o.includes(null===(t=e.pricing)||void 0===t?void 0:null===(i=t.price_details)||void 0===i?void 0:i.price)&&0!==e.amount},s=i.lines.data.find(l),a=s||(null==v?void 0:v.find(l));f("change_item",{items:{item_name:e.name,item_id:e.productId,item_value:(null==s?void 0:s.amount)||0,quantity:(null==s?void 0:s.quantity)||0,discount:null==s?void 0:null===(r=s.discount_amounts)||void 0===r?void 0:null===(n=r[0])||void 0===n?void 0:n.amount,price:a?a.amount/m
1:void 0}},{dataLayer:!1}),(0,ej.ec)("change_item",(0,ej.LU)(i,d,u))},j=M.Z.service===en.t6.Connect,b=[W.pB.ConnectKeywords,W.pB.ConnectMunicipality,W.pB.ConnectProvince].includes(t.slug);return(0,y.jsxs)(Y.Z,{onClick:async()=>{var e,n,o,l,d,u,p,v,m,h;let x=(null==r?void 0:null===(n=r.pricing)||void 0===n?void 0:null===(e=n.price_details)||void 0===e?void 0:e.price)===i.priceId?await a(t.productId):await s(t.productId,{priceId:i.priceId,quantity:(null==r?void 0:null===(l=r.pricing)||void 0===l?void 0:null===(o=l.price_details)||void 0===o?void 0:o.price)?(p=null==r?void 0:null===(u=r.pricing)||void 0===u?void 0:null===(d=u.price_details)||void 0===d?void 0:d.price,(null==c?void 0:null===(h=c.lines)||void 0===h?void 0:null===(m=h.data)||void 0===m?void 0:null===(v=m.find(e=>{var i,t;return(null===(t=e.pricing)||void 0===t?void 0:null===(i=t.price_details)||void 0===i?void 0:i.price)===p&&e.quantity}))||void 0===v?void 0:v.quantity)||1):1});x&&g(t,x)},sx:{cursor:"pointer"},flexDirection:"row",justifyContent:"space-between",alignItems:"center",border:n?3:2,borderColor:n?"primary.main":"divider10",bgcolor:n?"primary.light":l?"background.default":"background.paperLight",p:{xs:1.5,md:3},pt:{xs:!function(e,i,t,n,r){let o=(0,H.so)(i,n,r);return null!=t&&!!t.products.includes(i)||!!o&&(null==o?void 0:o.priceId)===e}(i.priceId,t.productId,p,v,d)?void 0:3},borderRadius:2,position:"relative",overflow:n?"visible":"hidden",children:[(0,y.jsx)(eS,{priceId:i.priceId,productId:t.productId}),(0,y.jsxs)(Y.Z,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:2,children:[j?null:o||(0,y.jsx)(eu.Z,{checked:n,sx:{p:0}}),(0,y.jsxs)(Y.Z,{alignItems:"flex-start",spacing:.5,children:[(0,y.jsxs)(Y.Z,{flexDirection:{xs:"column",lg:"row"},gap:{xs:0,md:1},alignItems:{xs:"flex-start",lg:"center"},children:[(0,y.jsx)(J.Z,{variant:"h3",children:t.name}),(0,y.jsx)(J.Z,{variant:"body1",sx:{display:{xs:"block",lg:"none"}},children:i.description}),(0,y.jsx)(ew,{product:t})]}),(0,y.jsx)(J.Z,{variant:"body1",sx:{display:{xs:"none",lg:"block"}},children:i.description})]})]}),(0,y.jsxs)(Y.Z,{alignItems:"flex-end",gap:1,children:[(!l&&!j||b)&&(0,y.jsx)(ep.Z,{sx:{backgroundColor:"background.default",maxWidth:130,borderRadius:2},children:(0,y.jsx)(ev.Z,{startAdornment:(0,y.jsx)(e_,{onClick:async e=>{e.stopPropagation();let n=await s(t.productId,{priceId:i.priceId,quantity:((null==r?void 0:r.quantity)||1)-1});n&&g(t,n)},disabled:!r||!(null==r?void 0:r.quantity)||(null==r?void 0:r.quantity)<=1,children:(0,y.jsx)(eh.Z,{color:"inherit"})}),endAdornment:(0,y.jsx)(e_,{onClick:async e=>{e.stopPropagation();let n=await s(t.productId,{priceId:i.priceId,quantity:((null==r?void 0:r.quantity)||0)+1});n&&g(t,n)},disabled:!r,children:(0,y.jsx)(em.Z,{})}),value:n?h!==(null==r?void 0:r.quantity)?h:null==r?void 0:r.quantity:0,onClick:e=>e.stopPropagation(),onChange:e=>x(isNaN(Number(e.target.value))?0:Number(e.target.value)),onBlur:()=>s(t.productId,{priceId:i.priceId,quantity:h}),sx:{"&:before":{display:"none"}},inputProps:{"aria-label":"quantity",style:{textAlign:"center",minHeight:50}}})}),(0,y.jsx)(ef,{priceId:i.priceId,productId:t.productId})]})]})}(n=u||(u={})).Bundle="bundle",n.CheapestPrice="cheapestPrice";var eB=t(94149),eE=t(97901),eF=t(22462),eq=t(1571),eL=t(13157);function eA(e){let{product:i}=e,{getLineItem:t}=(0,O.useContext)(z),n=(0,U.Z)(),r=(0,K.useRouter)(),o=(0,$.Z)(),l=(0,Q.Z)(o.breakpoints.down("md")),s=t((0,W.CY)(i,W.d2.B2B).priceId),a=(0,W.m1)(s,1);return i.description?(0,y.jsxs)(Y.Z,{flexDirection:"row",gap:2,bgcolor:"background.beige",p:{xs:2,md:4},alignItems:"center",position:"relative",boxShadow:"0 85px 24px 0 rgba(0, 0, 0, 0.00), 0 55px 22px 0 rgba(0, 0, 0, 0.01), 0 31px 18px 0 rgba(0, 0, 0, 0.03), 0 14px 14px 0 rgba(0, 0, 0, 0.04), 0 3px 8px 0 rgba(0, 0, 0, 0.05)",flexWrap:"wrap",children:[(0,y.jsx)(J.Z,{variant:"h4",flexBasis:0,flexGrow:1,zIndex:1,children:i.description.replace("{price}",n.formatMessage({id:"checkout.cart.add.upsell.price"},{price:n.formatNumber(a.price,{style:"currency",currency:"EUR",currencyDisplay:"symbol",minimumFractionDigits:2,maximumFractionDigits:2})}))}),(0,y.jsx)(X.Z,{flexBasis:{xs:void 0,md:0},flexGrow:{xs:1,md:.75},zIndex:1,children:(0,y.jsx)(eL.Z,{href:"".concat(r.basePath,"?").concat(i.slug),LinkComponent:ei(),size:"medium",variant:"contained",color:"primary",children:(0,y.jsx)(et.Z,{id:"checkout.cart.add.upsell",values:{product:i.name}})})}),i.image&&(0,y.jsx)(X.Z,{position:"absolute",right:0,top:0,height:"100%",maxWidth:"45%",children:(0,y.jsx)(eo(),{src:i.image.url,alt:i.image.alt,width:i.image.width,height:i.image.height,style:{objectFit:"contain",maxHeight:"100%",width:l?"100%":"auto",height:l?"auto":void 0}})})]}):null}var eM=t(53801);function eT(e){let{lineItem:i,variant:t="h4",noQuantity:n}=e,{getLineItemInfo:r}=(0,O.useContext)(z),[o,l]=(0,O.useState)(r(i));return((0,O.useEffect)(()=>{let e=async()=>{try{var e,t,n;let r=await fetch("".concat(M.Z.cmsApiRoot,"/wp-json/wp/v2/product/id/").concat(null===(t=i.pricing)||void 0===t?void 0:null===(e=t.price_details)||void 0===e?void 0:e.product));if(!r.ok)return null;let o=await r.json(),s={name:(null==o?void 0:o.name)||"",identifier:(null==o?void 0:o.slug)||"",description:(null==o?void 0:null===(n=o.prices.find(e=>{var t,n;return e.priceId===(null===(n=i.pricing)||void 0===n?void 0:null===(t=n.price_details)||void 0===t?void 0:t.price)}))||void 0===n?void 0:n.description)||"",productDescription:(null==o?void 0:o.description)||"",hasInformation:!0};l(s)}catch(e){return console.error("Error fetching product info:",e),null}};(null==o?void 0:o.hasInformation)||e()},[i,o]),null==o?void 0:o.hasInformation)?(0,y.jsxs)(J.Z,{variant:t,children:["".concat(o.name," - ").concat(o.description),!n&&" x ".concat(i.quantity)]}):(0,y.jsx)(eM.Z,{variant:"rectangular",height:"20px",width:"100%"})}function eR(e){let{fill:i,styles:t}=e;return(0,y.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:t,children:(0,y.jsx)("path",{d:"M8 1.33301C11.6819 1.33301 14.667 4.3
1181 14.667 8C14.667 11.6819 11.6819 14.667 8 14.667C4.3181 14.667 1.33301 11.6819 1.33301 8C1.33301 4.3181 4.3181 1.33301 8 1.33301ZM12.0596 5.00781C11.7529 4.72984 11.2783 4.75319 11 5.05957L7.05859 9.39844L4.9248 7.62109C4.6067 7.35621 4.13332 7.39893 3.86816 7.7168C3.6031 8.03487 3.64602 8.5082 3.96387 8.77344L6.65039 11.0117C6.95893 11.2688 7.41538 11.2375 7.68555 10.9404L12.1104 6.06738C12.3887 5.76074 12.3662 5.28624 12.0596 5.00781Z",fill:i||"#026455"})})}function eO(e){let{hasTrial:i}=e;return(0,y.jsx)(J.Z,{variant:"body2",color:"text.secondary",align:"center",maxWidth:480,alignSelf:"center",children:(0,y.jsx)(et.Z,{id:i?"checkout.step.cart.footer":"checkout.step.cart.footer.noTrial"})})}function eW(e){let{handleButtonClick:i,customerType:t,hasTrial:n,additionalSessionData:r,user:o,hideFooter:l=!1,setModalOpen:s}=e,a=(0,eg.e)();return(0,y.jsxs)(Y.Z,{spacing:2,width:"100%",children:[(0,y.jsx)(eL.Z,{sx:{maxWidth:{xs:"100%",md:480},width:"100%",alignSelf:"center"},variant:"contained",onClick:i,disabled:null==r?void 0:r.checkoutDisabled,children:(0,y.jsx)(et.Z,{id:n?"pro.tryForFree":o?"checkout.step.cart.nextButton":"checkout.step.cart.loginButton"})}),t===W.d2.B2C&&!l&&(0,y.jsx)(eO,{hasTrial:n}),t===W.d2.B2B&&!l&&s&&(0,y.jsx)(X.Z,{alignSelf:"center",children:(0,y.jsx)(eB.I,{id:"checkout.cart.contact.sales",onClick:()=>{s(!0),a("purchase_funnel_contact",{})}})})]})}let eN="proceedToPayment";function eU(e){var i,t;let{setStep:n,customerType:r,contactFormVariant:o}=e,{products:l,cart:s,initialLoading:a,loading:c,billingPeriodMonths:d,additionalSessionData:u,coupons:p,hasTrackedViewItem:v}=(0,O.useContext)(z),{data:m}=(0,eE.p)(),{openLoginPopup:h,isOpen:x}=(0,eF.m)(),f=(0,K.useRouter)(),[g,b]=(0,O.useState)(!1),Z=(0,O.useRef)(!1),[I,C]=(0,O.useState)(!1),w=(0,eg.e)(),k=(0,$.Z)(),_=(0,Q.Z)(k.breakpoints.down("md")),S=(0,O.useRef)(null),[D,P]=(0,O.useState)(0);(0,O.useEffect)(()=>{s&&!v.current&&(v.current=!0,w("view_item",(0,ej.LU)(s,l,p),{dataLayer:!0}))},[s]);let B="1"===f.query[eN],E=()=>{if(!B)return;let e={...f.query};delete e[eN],f.replace({pathname:f.pathname,query:e},void 0,{shallow:!0})};(0,O.useEffect)(()=>{m&&!c&&(g||B)&&(!B||s)&&(b(!1),E(),n(j.Payment))},[m,g,B,c,s]),(0,O.useEffect)(()=>{if(x){Z.current=!0;return}Z.current&&(Z.current=!1,b(!1),E())},[x]),(0,O.useLayoutEffect)(()=>{if(!S.current)return;let e=S.current,i=new ResizeObserver(()=>{P(e.getBoundingClientRect().height)});return i.observe(e),P(e.getBoundingClientRect().height),()=>i.disconnect()},[a]);let F=()=>{g||(b(!0),(0,ej.ec)("add_to_cart",(0,ej.LU)(s,l,p)),m?n(j.Payment):(f.replace({pathname:f.pathname,query:{...f.query,[eN]:"1"}},void 0,{shallow:!0}),h()))},q=(0,O.useMemo)(()=>{var e,i;return null==s?void 0:null===(i=s.lines)||void 0===i?void 0:null===(e=i.data)||void 0===e?void 0:e.every(e=>l.find(i=>i.prices.some(i=>{var t,n;return i.priceId===(null===(n=e.pricing)||void 0===n?void 0:null===(t=n.price_details)||void 0===t?void 0:t.price)&&i.trialDays>0})))},[s,l]);if(a)return(0,y.jsx)(X.Z,{height:"60vh",display:"flex",justifyContent:"center",alignItems:"center",children:(0,y.jsx)(es.Z,{color:"primary"})});M.Z.service,en.t6.Connect;let L=M.Z.service===en.t6.Caller,A=s&&(0,y.jsx)(et.Z,{id:"checkout.cart.total.price.month",values:{price:(0,y.jsx)(ex.BK,{value:((0,H.I3)(s,r)/d||0)/100,maximumFractionDigits:2,minimumFractionDigits:2})}}),T=s&&(0,y.jsx)(et.Z,{id:"checkout.cart.total.price.year",values:{price:(0,y.jsx)(ex.BK,{value:((0,H.I3)(s,r)/d*12||0)/100,maximumFractionDigits:2,minimumFractionDigits:2})}});return(0,y.jsxs)(Y.Z,{spacing:{xs:2,md:3},sx:{opacity:c?.5:1,pointerEvents:c?"none":"auto"},paddingBottom:{xs:"calc(".concat(D,"px + 2rem)"),md:void 0},children:[(0,y.jsx)(Y.Z,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:(0,y.jsx)(J.Z,{variant:"h3",children:(0,y.jsx)(et.Z,{id:"checkout.step.cart.".concat(r,".title")})})}),L&&!l.some(e=>e.slug===W.of.BusinessCard)&&(0,y.jsx)(eK,{customerType:r}),l.map((e,i)=>{var t,n;return(0,y.jsxs)(Y.Z,{spacing:3,children:[(0,y.jsx)(ek,{product:e},i),(null==e?void 0:e.benefits)&&e.benefits.length>0&&(0,y.jsx)(Y.Z,{spacing:1,children:e.benefits.map((e,i)=>(0,y.jsxs)(X.Z,{display:"flex",gap:1,children:[(0,y.jsx)(eR,{styles:{width:"100%",maxWidth:"1rem",marginTop:".25rem"}}),(0,y.jsx)(J.Z,{variant:"body2",children:e})]},i))}),null==e?void 0:null===(t=e.crossSells)||void 0===t?void 0:t.map((e,i)=>(0,y.jsx)(ek,{product:e},i)),null==e?void 0:null===(n=e.upsells)||void 0===n?void 0:n.map((e,i)=>(0,y.jsx)(eA,{product:e},i))]},i)}),s&&!_&&(0,y.jsxs)(Y.Z,{py:3,borderTop:1,borderBottom:1,borderColor:"divider10",flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[(0,y.jsx)(X.Z,{children:null==s?void 0:null===(t=s.lines)||void 0===t?void 0:null===(i=t.data)||void 0===i?void 0:i.filter(e=>e.quantity).map(e=>(0,y.jsx)(Y.Z,{flexDirection:"row",justifyContent:"space-between",gap:2,children:(0,y.jsx)(eT,{lineItem:e})},e.id))}),(0,y.jsxs)(Y.Z,{alignItems:"flex-end",children:[(0,y.jsx)(J.Z,{variant:"body2",color:"primary",children:(0,y.jsx)(et.Z,{id:"checkout.cart.total.title"})}),(0,y.jsx)(J.Z,{variant:"h3",color:"primary",children:A}),(0,y.jsx)(J.Z,{variant:"body2",color:"primary",children:T}),(0,y.jsx)(J.Z,{variant:"body2",color:"text.secondary",marginBottom:2,children:(0,y.jsx)(et.Z,{id:"checkout.cart.total.".concat(r,".vat")})})]})]}),s&&_&&(0,y.jsxs)(y.Fragment,{children:[r===W.d2.B2B&&(0,y.jsx)(X.Z,{alignSelf:"center",children:(0,y.jsx)(eB.I,{id:"checkout.cart.contact.sales",onClick:()=>{C(!0),w("purchase_funnel_contact",{})}})}),r===W.d2.B2C&&(0,y.jsx)(eO,{hasTrial:q}),(0,y.jsxs)(Y.Z,{ref:S,spacing:1.5,position:"fixed",bottom:16,left:16,right:16,zIndex:10,bgcolor:"#FFFFFF",borderRadius:3,padding:2,boxShadow:"0px 4px 24px rgba(0, 0, 0, 0.2)",children:[(0,y.jsxs)(Y.Z,{flexDirection:"row",justifyContent:"space-between",gap:2,children:[(0,y.jsxs)(Y.Z,{children:[(0,y.jsx)(J.Z,{variant:"body2",color:"primary",children:(0,y.jsx)(et.Z,{id:"checkout.cart.total.title"})}),(0,y.jsx)(J.Z,{variant:"h3",color:"primary",children:A})]}),(0,y.jsxs)(Y.Z,{alignItems:"flex-end",children:[(0,y.jsx)(J.Z,{variant:"body2",color:"primary",children:T}),(0,y.jsx)(J.Z,{variant:"body2",color:"text.secondary",textAlign:"right",children:(0,y.jsx)(et.Z,{id:"checkout.cart.total.".concat(r,".vat")})})]})]}),(0,y.jsx)(eW,{handleButtonClick:F,customerType:r,hasTrial:q,additionalSessionData:u,user:m,hideFooter:!0})]})]}),!_&&(0,y.jsx)(eW,{handleButtonClick:F,customerType:r,hasTrial:q,additionalSessionData:u,user:m,setModalOpen:C}),(0,y.jsx)(eq.h,{variant:o,isOpen:I,handleOnClose:()=>C(!1)})]})}function eK(e){let{customerType:i}=e;return(0,y.jsx)(eB.I,{id:"checkout.step.cart.".concat(i,".title.link"),href:"/tilaus/".concat(i===W.d2.B2B?W.d2.B2C:W.d2.B2B).concat((()=>{let e=new URLSearchParams(window.location.search);return e.delete("cartId"),e.delete(eN),e.toString()?"?".concat(e.toString()):""})())})}function eH(e){let{uiSettings:i,customerType:t,setStep:n,ContentHeader:r}=e,o=(0,Q.Z)((0,$.Z)().breakpoints.down("md")),l=i.serviceName;
1return(0,y.jsxs)(V.ZP,{container:!0,height:"100vh",children:[!o&&(0,y.jsx)(V.ZP,{item:!0,md:5,position:"relative",children:(0,y.jsx)(el,{uiSettings:i,customerType:t})}),(0,y.jsx)(V.ZP,{item:!0,xs:12,md:7,pt:{md:4,xs:2},children:(0,y.jsxs)(Y.Z,{gap:4,px:{md:10,xs:2},children:[o&&(0,y.jsx)(Y.Z,{flexDirection:"row",justifyContent:"space-between",children:(0,y.jsx)(ei(),{tabIndex:7,href:"/",shallow:!0,"aria-label":i.serviceName,children:(0,y.jsx)("img",{src:i.mobileLogoUrl,alt:i.serviceName})})}),r,(0,y.jsx)(eU,{contactFormVariant:l,customerType:t,setStep:n})]})})]})}var ez=t(72523),eG=t(62301),eQ=t(53269),e$=t(59568),eV=t(88896),eY=t(47367);function eX(e){let{customerType:i}=e,{cart:t,coupons:n,billingPeriodMonths:r}=(0,O.useContext)(z);if(!t)return null;let o=(null==t?void 0:t.discounts).find(e=>null==n?void 0:n.some(i=>{var t;return i===(null==e?void 0:null===(t=e.promotion_code)||void 0===t?void 0:t.id)}));if(!o)return null;let l=o.source.coupon,s=(0,y.jsx)(ex.BK,{value:((null==t?void 0:t.subtotal)||0)/100,maximumFractionDigits:2,minimumFractionDigits:2,currency:"EUR",currencyDisplay:"symbol",style:"currency"});return(0,y.jsx)(J.Z,{variant:"body2",children:"repeating"===l.duration?(0,y.jsx)(et.Z,{id:"checkout.cart.discount.repeating.".concat(i),values:{regularPrice:s,months:l.duration_in_months,billingMonths:r}}):"once"===l.duration?(0,y.jsx)(et.Z,{id:"checkout.cart.discount.once.".concat(i),values:{regularPrice:s,billingMonths:r}}):(0,y.jsx)(et.Z,{id:"checkout.cart.discount.forever"})})}(r=p||(p={})).Forever="forever",r.Once="once",r.Repeating="repeating";var eJ=t(8063),e0=t(63840),e1=t(63955),e2=t(55512),e3=t(12471);(v||(v={})).Custom="custom",(o=m||(m={})).EInvoice="verkkolasku",o.Email="email",o.Post="posti",(l=h||(h={})).Payment="payment",l.Setup="setup",l.Custom="custom",l.Scheduled="scheduled";let e4={card_declined:"subscription.status.failed.updateCard",authentication_required:"subscription.status.failed.3dSecure",expired_card:"subscription.status.failed.expiredCard",incorrect_cvc:"subscription.status.failed.incorrectCVC",invalid_cvc:"subscription.status.failed.invalidCVC",incorrect_number:"subscription.status.failed.incorrectNumber",coupon_expired:"subscription.status.failed.expiredCoupon",invalid_request:"checkout.genericError",invalid_cart_items:"checkout.genericError",invalid_invoice_parameters:"subscription.status.failed.invalidInvoiceParameters",business_id_required_for_b2b_customers:"subscription.status.failed.businessIdRequiredForB2BCustomers",customer_id_required:"subscription.status.failed.customerIdRequired",missing_permissions:"subscription.status.failed.missingPermissions",invalid_customer:"subscription.status.failed.invalidCustomer",invalid_payment_method:"subscription.status.failed.invalidPaymentMethod",failed_fetch_user:"subscription.status.failed.invalidUser",invalid_start_date:"subscription.status.failed.invalidStartDate"},e6=(0,O.createContext)({handlePurchase:async()=>{},loading:!1,canPurchase:!1,updateFormData:()=>{},disabled:!1,setDisabled:()=>{},error:void 0,session:{},formData:{customerType:W.d2.B2C,termsAccepted:!1,invoice:{method:"verkkolasku"}}});function e8(e){let{children:i,customerType:t,handleDone:n,session:r}=e,[o,l]=(0,O.useState)(!1),[s,a]=(0,O.useState)(void 0),[c,d]=(0,O.useState)(!1),[u,p]=(0,O.useState)(function(e,i){var t,n,r,o,l,s,a;let c={customerType:i,termsAccepted:!1,invoice:{method:"verkkolasku"}},d=e.customerData.invoice_settings.default_payment_method,u=e.customerData.metadata||{},p=(null==d?void 0:null===(t=d.metadata)||void 0===t?void 0:t.businessId)||u.businessId||"",v=u.mbsId||"";return p&&(c={...c,businessId:p,companyName:(null==d?void 0:d.billing_details.name)||e.customerData.name||"",mbsId:v}),(null==d?void 0:d.type)==="custom"&&(c={...c,invoice:{...c.invoice,method:(null===(n=d.metadata)||void 0===n?void 0:n.invoiceChannel)||"verkkolasku",eAddress:null===(r=d.metadata)||void 0===r?void 0:r.electronicAddressOVT,operatorId:null===(o=d.metadata)||void 0===o?void 0:o.electronicAddressIntermediator,address:(null===(l=d.billing_details.address)||void 0===l?void 0:l.line1)||"",postalCode:(null===(s=d.billing_details.address)||void 0===s?void 0:s.postal_code)||"",city:(null===(a=d.billing_details.address)||void 0===a?void 0:a.city)||"",email:d.billing_details.email||""}}),c}(r,t)),{cart:v,products:m,coupons:h,customerId:x,bundleConditions:f,additionalSessionData:g}=(0,O.useContext)(z),{}=(0,e1.cI)(),j=(0,A.MD)(),b=(0,A.lq)(),Z=(0,K.useRouter)(),{showNotification:I}=(0,N.Z)(),C=(0,eg.e)(),w=(0,e3.w)({customerId:x}),k=e=>{l(!1),I(e.message,"error",void 0,1e4,!0),a(e.message)},_=e=>{let i="subscription.error.subscription_failed";e4.hasOwnProperty(e)&&(i=e4[e]),I(i,"error",void 0,1e4,!0),l(!1),(0,ej.ec)("payment_failed",{...(0,ej.LU)(v,m,h),errorcode:"string"==typeof e?e:"unknown"})},S=(0,O.useCallback)(async e=>{var i,t,o,s,a,c,d,p,y,I;if(e.preventDefault(),!v)return;if(!j||!b){console.error("Stripe.js has not yet loaded.");return}(0,ej.ec)("add_payment_info",(0,ej.LU)(v,m,h)),l(!0);let{error:S,selectedPaymentMethod:D}=await b.submit();if(S){k(S);return}let P=(0,H.aB)(v,(null==g?void 0:g.location)&&m.map(e=>e.productId)),B=[];for(let e of P)B.find(i=>i.priceId===e.priceId&&i.quantity)||B.push(e);let E={endpoint:"/subscription",method:"POST",body:{...u,items:B,promotionCodes:h,...(null==f?void 0:f.conditionsMet)&&{coupons:[f.coupon]},...D===M.Z.invoicePaymentMethod?{customPaymentMethod:M.Z.invoicePaymentMethod,invoice:{...u.invoice,postalCode:null===(t=u.invoice)||void 0===t?void 0:null===(i=t.postalCode)||void 0===i?void 0:i.replace(/\s/g,"")}}:{invoice:void 0},businessId:null===(o=u.businessId)||void 0===o?void 0:o.replace("-",""),customerId:x,mbsId:null==u?void 0:u.mbsId,additionalSessionData:g}};r.existingSubscriptionId&&(E={...E,method:"PUT",body:{...E.body,subscriptionId:r.existingSubscriptionId}});let F=await (0,e0.Z)(E);if(F.error){_(F.error);return}(0,e2.bI)("accessCustomerId",M.Z.service)!==x&&(0,e2.Ru)({accessCustomerId:x},M.Z.service);let q=null===(a=w.data)||void 0===a?void 0:null===(s=a.find(e=>e.name.includes("Connect")))||void 0===s?void 0:s.name,{type:L,clientSecret:A}=F,T=M.Z.service===en.t6.Caller&&m.some(e=>
1"FREE"===e.productId),R=null===(c=m.find(e=>["connect-start","connect-plus"].includes(e.slug)))||void 0===c?void 0:c.name;if(["custom","scheduled"].includes(L)||!A){(0,ej.ec)("purchase",{...(0,ej.LU)(v,m,h),transaction_id:(null==v?void 0:v.id)||"unknown"}),!T&&R?(C("upgrade_subscription",{...(0,ej.qz)(v,m,h),original_plan:q,upgraded_plan:R},{}),(0,ej.ec)("upgrade_subscription",{...(0,ej.LU)(v,m,h),transaction_id:(null==v?void 0:v.id)||"unknown",original_plan:q,updated_plan:R})):T||(C("purchase",{...(0,ej.LU)(v,m,h),vatnumber:(null===(d=u.businessId)||void 0===d?void 0:d.replace("-",""))||"unknown",price_id:(null===(p=P[0])||void 0===p?void 0:p.priceId)||"unknown",transaction_id:(null==v?void 0:v.id)||"unknown",payment_method:M.Z.invoicePaymentMethod||"unknown"},{}),(0,ej.ec)("purchase",{...(0,ej.LU)(v,m,h),transaction_id:(null==v?void 0:v.id)||"unknown"})),n();return}let O="setup"===L?j.confirmSetup:j.confirmPayment,{error:W}=await O({elements:b,clientSecret:A,confirmParams:{return_url:"".concat(window.location.origin).concat(Z.asPath)},redirect:"if_required"});W?k(W):(!T&&R?(C("upgrade_subscription",{...(0,ej.qz)(v,m,h),original_plan:q,upgraded_plan:R},{}),(0,ej.ec)("upgrade_subscription",{...(0,ej.LU)(v,m,h),transaction_id:(null==v?void 0:v.id)||"unknown",original_plan:q,updated_plan:R})):T||(C("purchase",{...(0,ej.LU)(v,m,h),vatnumber:(null===(y=u.businessId)||void 0===y?void 0:y.replace("-",""))||"unknown",price_id:(null===(I=P[0])||void 0===I?void 0:I.priceId)||"unknown",transaction_id:(null==v?void 0:v.id)||"unknown",payment_method:M.Z.invoicePaymentMethod||"unknown"},{}),(0,ej.ec)("purchase",{...(0,ej.LU)(v,m,h),transaction_id:(null==v?void 0:v.id)||"unknown"})),n())},[v,h,j,b,u,x,Z,n]),D=(0,O.useMemo)(()=>u.termsAccepted&&(null==v?void 0:v.lines.data.length)>0&&!c,[u,c]);return(0,y.jsx)(e6.Provider,{value:{handlePurchase:S,loading:o,error:s,formData:u,updateFormData:e=>{p(i=>({...i,...e}))},canPurchase:D,disabled:c,setDisabled:d,session:r},children:i})}function e5(e){var i,t;let{customerType:n,setStep:r}=e,{cart:o,products:l}=(0,O.useContext)(z),s=(0,Q.Z)((0,$.Z)().breakpoints.down("md")),{session:a}=(0,O.useContext)(e6),c=(0,O.useMemo)(()=>{var e,i;return null!=a&&!!a.eligibleForTrial&&(null==o?void 0:null===(i=o.lines)||void 0===i?void 0:null===(e=i.data)||void 0===e?void 0:e.every(e=>l.find(i=>i.prices.some(i=>{var t,n;return i.priceId===(null===(n=e.pricing)||void 0===n?void 0:null===(t=n.price_details)||void 0===t?void 0:t.price)&&i.trialDays>0}))))},[o,l,a]);return o?(0,y.jsxs)(Y.Z,{spacing:4,children:[!s&&(0,y.jsx)(e7,{setStep:r}),(0,y.jsx)(J.Z,{variant:"h2",children:(0,y.jsx)(et.Z,{id:"subscribe.status.title"})}),(0,y.jsx)(Y.Z,{children:null==o?void 0:null===(i=o.lines.data)||void 0===i?void 0:i.filter(e=>e.quantity).map((e,i)=>(0,y.jsx)(e9,{lineItem:e,products:l},i))}),(0,y.jsxs)(Y.Z,{spacing:1,children:[(0,y.jsxs)(Y.Z,{flexDirection:"row",justifyContent:"space-between",children:[(0,y.jsx)(J.Z,{variant:"h5",children:(0,y.jsx)(et.Z,{id:c?"checkout.step.payment.youPayNow":"checkout.step.payment.total"})}),(0,y.jsxs)(Y.Z,{flexDirection:"row",gap:1,alignItems:"flex-end",children:[(0,y.jsx)(J.Z,{variant:"h5",color:"primary",children:(0,y.jsx)(ex.BK,{value:c?0:((0,H.I3)(o,n)||0)/100,maximumFractionDigits:2,minimumFractionDigits:2,currency:"EUR",currencyDisplay:"symbol",style:"currency"})}),(null==o?void 0:null===(t=o.total_discount_amounts)||void 0===t?void 0:t.length)?(0,y.jsx)(J.Z,{variant:"body2",color:"text.disabled",sx:{textDecoration:"line-through"},children:(0,y.jsx)(ex.BK,{value:o.subtotal/100,maximumFractionDigits:2,minimumFractionDigits:2,currency:"EUR",currencyDisplay:"symbol",style:"currency"})}):null]})]}),(0,y.jsx)(J.Z,{variant:"body3",color:"text.secondary",children:(0,y.jsx)(et.Z,{id:"checkout.cart.total.".concat(n,".vat")})}),(0,y.jsx)(eX,{customerType:n})]})]},o.id):null}function e7(e){let{setStep:i}=e,t=(0,U.Z)();return(0,y.jsx)(ea.Z,{onClick:()=>i(j.Cart),"aria-label":t.formatMessage({id:"close"}),sx:{alignSelf:"flex-start"},children:(0,y.jsx)(ez.Z,{sx:{color:"text.primary"},fontSize:"large",children:(0,y.jsx)(eY.Z,{})})})}function e9(e){var i,t,n,r;let{lineItem:o,products:l}=e,{cart:s}=(0,O.useContext)(z);if(!o)return null;let a=null==l?void 0:null===(i=l.find(e=>e.prices.find(e=>{var i,t;return e.priceId===(null===(t=o.pricing)||void 0===t?void 0:null===(i=t.price_details)||void 0===i?void 0:i.price)&&e.trialDays>0})))||void 0===i?void 0:i.prices,c=null,d=null;a&&(c=new Date(new Date().getTime()+864e5*((null==a?void 0:null===(r=a[0])||void 0===r?void 0:r.trialDays)||0)),d="".concat(new Date().toLocaleDateString("fi-FI")," - ").concat(c.toLocaleDateString("fi-FI"))),console.log("TRIAL: ",a);let u={...o},p=null==s?void 0:null===(n=s.lines)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.find(e=>{var i,t,n,r;return(null===(t=e.pricing)||void 0===t?void 0:null===(i=t.price_details)||void 0===i?void 0:i.price)===(null===(r=o.pricing)||void 0===r?void 0:null===(n=r.price_details)||void 0===n?void 0:n.price)&&e.amount});p&&o.id!==(null==p?void 0:p.id)&&(u=p={...p,quantity:1});let v=(0,H.UQ)(u),m=(0,W.m1)(u,1);return(0,y.jsxs)(Y.Z,{children:[(0,y.jsxs)(eG.Z,{disableGutters:!0,sx:{borderBottom:1,borderColor:"divider20","&:last-of-type":{borderRadius:0},"&::before":{display:"none"}},children:[(0,y.jsx)(eQ.Z,{sx:{minHeight:"64px"},expandIcon:(0,y.jsx)(eJ.Z,{sx:{color:"text.primary"}}),children:(0,y.jsxs)(Y.Z,{flexDirection:"row",justifyContent:"space-between",width:"100%",children:[(0,y.jsx)(eT,{lineItem:o,variant:"h5",noQuantity:!0}),(0,y.jsx)(J.Z,{variant:"h5",children:(0,y.jsx)(et.Z,{id:o.id===(null==p?void 0:p.id)?"checkout.step.payment.lineItem.price":"checkout.step.payment.lineItem.price.n
1oQty",values:{qty:u.quantity,price:(0,y.jsx)(ex.BK,{value:v.price,maximumFractionDigits:2,minimumFractionDigits:2}),months:(0,W.ik)(u)}})})]})}),(0,y.jsx)(e$.Z,{sx:{px:0},children:(0,y.jsxs)(Y.Z,{spacing:2,children:[(0,y.jsxs)(Y.Z,{flexDirection:"row",justifyContent:"space-between",children:[(0,y.jsx)(J.Z,{variant:"body1",children:(0,y.jsx)(et.Z,{id:"checkout.step.payment.lineItem.price.month"})}),(0,y.jsx)(J.Z,{variant:"body1",children:(0,y.jsx)(et.Z,{id:"checkout.step.payment.lineItem.price.highlight",values:{h:e=>(0,y.jsx)(J.Z,{component:"span",color:"primary",display:"inline",children:e}),price:(0,y.jsx)(ex.BK,{value:m.price,maximumFractionDigits:2,minimumFractionDigits:2})}})})]}),(0,y.jsx)(Y.Z,{flexDirection:"row",justifyContent:"space-between",children:(0,y.jsx)(J.Z,{variant:"body1",children:(0,y.jsx)(et.Z,{id:"checkout.step.payment.lineItem.price.period",values:{months:(0,W.ik)(o)}})})})]})})]}),!!a&&(0,y.jsxs)(Y.Z,{spacing:2,pt:2,children:[(0,y.jsxs)(Y.Z,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[(0,y.jsxs)(Y.Z,{children:[(0,y.jsx)(J.Z,{variant:"body2",color:"primary",fontWeight:"bold",children:(0,y.jsx)(et.Z,{id:"checkout.step.payment.freeTrial"})}),(0,y.jsx)(J.Z,{variant:"body2",color:"primary",children:d})]}),(0,y.jsx)(J.Z,{variant:"h4",color:"primary",children:(0,y.jsx)(ex.BK,{value:0,maximumFractionDigits:2,minimumFractionDigits:2,currency:"EUR",currencyDisplay:"symbol",style:"currency"})})]}),(0,y.jsx)(eV.Z,{sx:{my:2}}),(0,y.jsxs)(Y.Z,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[(0,y.jsxs)(Y.Z,{children:[(0,y.jsx)(J.Z,{variant:"body2",color:"text.primary",fontWeight:"bold",children:(0,y.jsx)(et.Z,{id:"checkout.step.payment.postFreeTrial"})}),(0,y.jsx)(J.Z,{variant:"body2",color:"text.primary",children:(0,y.jsx)(et.Z,{id:"checkout.step.payment.postFreeTrial.startingAt",values:{date:null==c?void 0:c.toLocaleDateString("fi-FI")}})})]}),(0,y.jsx)(J.Z,{variant:"h4",color:"text.primary",children:(0,y.jsx)(ex.BK,{value:v.price,maximumFractionDigits:2,minimumFractionDigits:2,currency:"EUR",currencyDisplay:"symbol",style:"currency"})})]})]})]})}let ie="https://tuki.fonecta.com/tietosuojaseloste";function ii(){let e=(0,eg.e)(),i=(0,U.Z)(),t=()=>{e("clicked_support_link",{click_url:ie,click_text:i.formatMessage({id:"subscription.poweredBy"})},{})};return(0,y.jsx)(J.Z,{variant:"body2",color:"text.secondary",children:(0,y.jsx)(et.Z,{id:"subscription.poweredBy",values:{b:e=>(0,y.jsx)("strong",{children:e}),l:e=>(0,y.jsx)(ey.Z,{href:ie,target:"_blank",color:"inherit",sx:{textDecoration:"none"},style:{fontSize:"inherit"},onClick:t,children:e})}})})}function it(e){let{customerType:i,setStep:t}=e;return(0,y.jsx)(X.Z,{height:"100vh",bgcolor:"background.paperLight",position:"sticky",top:0,children:(0,y.jsxs)(Y.Z,{p:3,justifyContent:"space-between",height:"100%",children:[(0,y.jsx)(e5,{customerType:i,setStep:t}),(0,y.jsx)(ii,{})]})})}var ir=t(99220),io=t(11955),il=t(50205),is=t(43311),ia=t(43590);function ic(e){let{initialCode:i}=e,[t,n]=(0,O.useState)(i||""),[r,o]=(0,O.useState)(!1),[l,s]=(0,O.useState)({messageId:null,isError:!1}),{coupons:a,applyPromotionCode:c,removeCoupon:d}=(0,O.useContext)(z),{setDisabled:u}=(0,O.useContext)(e6),{showNotification:p}=(0,N.Z)(),[v,m]=(0,O.useState)(null),h=(0,U.Z)(),x=null==a?void 0:a[0],f=async()=>{o(!0),u(!0),s({messageId:null,isError:!1}),await c(t)?((0,is.ec)("promocode_added",{promocode:t}),p("subscription.new.coupon.valid","success",void 0,5e3,!0,!1,void 0,"top")):s({messageId:"subscription.new.coupon.genericError",isError:!0}),o(!1),u(!1)},g=async()=>{o(!0),u(!0),await d(x),n(""),o(!1),u(!1)};return(0,y.jsxs)(X.Z,{border:1,sx:{mt:4},borderColor:"border.5",bgcolor:"background.paperLight",p:3,borderRadius:1,children:[(0,y.jsx)(J.Z,{variant:"h4",color:"primary.main",mb:2,children:(0,y.jsx)(et.Z,{id:"subscription.new.coupon"})}),(0,y.jsxs)(Y.Z,{gap:2,flexDirection:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"start",md:"center"},children:[x?(0,y.jsx)(J.Z,{variant:"body1",children:(0,y.jsx)(et.Z,{id:"subscription.new.coupon.applied",values:{code:t}})}):(0,y.jsx)(ep.Z,{fullWidth:!0,children:(0,y.jsx)(ir.Z,{id:"coupon",type:"text",variant:"standard",label:h.formatMessage({id:"subscription.new.coupon.placeholder"}),onChange:e=>{v&&clearTimeout(v),n(e.target.value),o(!1),e.target.value.length?(u(!0),m(setTimeout(()=>
1{s({messageId:"subscription.new.coupon.notApplied",isError:!1})},500))):(u(!1),s({messageId:null,isError:!1}))},error:!!l.isError,disabled:!!x,fullWidth:!0,sx:{display:"flex","input::placeholder":{fontSize:"body1.fontSize",color:"text.secondary",opacity:1},".MuiFormLabel-root":{"&:not(.Mui-error)":{color:"text.secondary"}},".MuiInputLabel-shrink":{transform:"translate(0, -1.5px) scale(.88)"},".MuiFormHelperText-root":{backgroundColor:"transparent"}},inputProps:{style:{backgroundColor:"transparent",paddingBottom:16}}})}),(0,y.jsx)(eL.Z,{variant:x?"outlined":"contained",color:x?"inherit":"primary",onClick:x?g:f,disabled:!t.length||r,sx:{flex:"none",alignSelf:"center",width:{xs:"100%",md:"auto"}},children:(0,y.jsx)(et.Z,{id:"subscription.new.".concat(x?"removeCoupon":"applyCoupon")})})]}),l.messageId&&(0,y.jsx)(io.Z,{severity:"error",icon:(0,y.jsx)(ia.Z,{color:"error",sx:{p:0}}),sx:{bgcolor:"transparent",p:0,minWidth:"auto",mt:1},children:(0,y.jsx)(il.Z,{sx:{m:0},children:(0,y.jsx)(J.Z,{variant:"body2",children:(0,y.jsx)(et.Z,{id:l.messageId})})})})]})}(s=x||(x={})).CouponMissing="coupon_missing",s.PlanMissing="plan_missing",s.CouponNotFound="coupon_not_found";var id=t(86781),iu=t(34758),ip=t(77749),iv=t(47661);function im(e){let{handleSubmit:i,initialValue:t,disabled:n}=e,r=(0,ip.Z)(),[o,l]=(0,O.useState)(""),{data:s}=(0,iv.a)({queryKey:["companies","search",o],queryFn:async()=>{if(!o||o.length<4)return null;let e=await (0,e0.Z)({endpoint:"/presence/search",queryParams:{what:o}});if(null==e?void 0:e.error)throw console.error("Error response:",e),Error("Network response was not ok");return delete e.responseStatus,Object.values(e)}});(0,O.useEffect)(()=>
1{l(t||"")},[]);let a=[...(s||[]).map(e=>({id:e.id,businessId:e.businessId,label:e.name,mbsId:e.id})),{id:"none",businessId:"",label:"Muu yritys, mik\xe4?"}],c=o&&a.find(e=>e.label!==o)&&s&&0==s.length;return(0,y.jsx)(X.Z,{bgcolor:"background.default",position:"relative",flex:1,flexGrow:0,sx:{borderRadius:2},width:"100%",children:(0,y.jsx)(id.Z,{disablePortal:!0,freeSolo:!0,disableClearable:!r,id:"search-input",value:o,forcePopupIcon:!1,options:a,filterOptions:e=>e,disabled:n,onChange:(e,t)=>{e.preventDefault(),t&&(l("string"==typeof t?t:t.label),"string"!=typeof t&&i(t))},isOptionEqualToValue:(e,i)=>e.id===i.id,renderOption:(e,i)=>(0,O.createElement)("li",{...e,key:i.id,children:[i.businessId.replace(/^FI/,"").replace(/(\d{7})(\d{1})$/,"$1-$2")," ",i.label]}),PaperComponent:e=>{let{children:i}=e;return(0,y.jsx)(iu.Z,{elevation:3,sx:{position:"absolute",bgcolor:"background.default",mt:.5,width:"100%"},children:i})},renderInput:e=>(0,y.jsxs)(Y.Z,{gap:.5,children:[(0,y.jsx)(ir.Z,{...e,error:!!c&&o!==t,onChange:e=>l(e.target.value),value:o,fullWidth:!0,autoComplete:"off",label:"Valitse yritys",sx:{bgcolor:"transparent"},variant:"outlined",required:0===o.length,disabled:n,inputProps:{...e.inputProps,style:{backgroundColor:"transparent"},required:!0,maxLength:500,enterKeyHint:"search"},onClick:e=>{e.stopPropagation(),l("")},InputProps:{...e.InputProps,sx:{}}}),c&&o!==t&&(0,y.jsx)(J.Z,{color:"error",ml:2,variant:"caption",children:"Yrityst\xe4 ei l\xf6ytynyt valitsemallasi haulla"})]})})})}(f||(f={})).None="none";var ih=t(41712),ix=t(60748);function ig(e){var i;let{customerType:t}=e,{data:n}=(0,eE.p)(),{loading:r,canPurchase:o,handlePurchase:l,updateFormData:s,formData:a,session:c}=(0,O.useContext)(e6),{loading:d,additionalSessionData:u}=(0,O.useContext)(z),[p,v]=(0,O.useState)(null),m={layout:"accordion",readOnly:!!(null==u?void 0:u.startDate)},h=c.roleInCustomer===en.$0.Owner&&!c.existingSubscriptionId;return(0,y.jsxs)(Y.Z,{spacing:4,component:"form",onSubmit:e=>{e.preventDefault(),l(e)},sx:{opacity:d?.5:1,pointerEvents:d?"none":"auto"},children:[(0,y.jsx)(Y.Z,{flexDirection:{xs:"column",md:"row"},justifyContent:"space-between",alignSelf:{xs:"center",md:"initial"},alignItems:"center",spacing:1,children:(0,y.jsx)(J.Z,{variant:"h3",children:(0,y.jsx)(et.Z,{id:"subscription.new.title"})})}),(0,y.jsxs)(Y.Z,{spacing:3,children:[(0,y.jsx)(J.Z,{variant:"h4",children:(0,y.jsx)(et.Z,{id:"subscription.new.contactInfo"})}),(0,y.jsx)(ep.Z,{variant:"outlined",fullWidth:!0,children:(0,y.jsx)(ir.Z,{id:"user-email",type:"text",label:(0,y.jsx)(et.Z,{id:"subscription.new.email"}),value:(null==c?void 0:null===(i=c.customerData)||void 0===i?void 0:i.email)||(null==n?void 0:n.email),fullWidth:!0,required:!0,disabled:!0})}),t===W.d2.B2B&&(0,y.jsx)(im,{handleSubmit:e=>{v(e),s({companyName:e.id!==f.None?e.label:"",businessId:e.id!==f.None?e.businessId:"",mbsId:e.id!==f.None?e.mbsId:""})},initialValue:null==a?void 0:a.companyName,disabled:!h}),(null==p?void 0:p.id)===f.None&&(0,y.jsxs)(Y.Z,{gap:2,flexDirection:{xs:"column",md:"row"},children:[(0,y.jsx)(ep.Z,{variant:"outlined",fullWidth:!0,children:(0,y.jsx)(ir.Z,{id:"company-name",type:"text",label:(0,y.jsx)(et.Z,{id:"subscription.new.companyName"}),value:a.companyName||"",onChange:e=>s({companyName:e.target.value}),fullWidth:!0,required:!0,disabled:!h})}),(0,y.jsx)(ep.Z,{variant:"outlined",fullWidth:!0,children:(0,y.jsx)(ir.Z,{id:"company-business-id",type:"text",label:(0,y.jsx)(et.Z,{id:"subscription.new.businessId"}),value:a.businessId||"",onChange:e=>s({businessId:e.target.value}),inputProps:{pattern:"^[0-9]{7}-[0-9]{1}$"},fullWidth:!0,required:!0,disabled:!h})})]})]}),(0,y.jsx)(ic,{}),(0,y.jsxs)(Y.Z,{spacing:3,children:[(0,y.jsx)(J.Z,{variant:"h4",children:(0,y.jsx)(et.Z,{id:"subscription.new.paymentMethod"})}),(0,y.jsx)(X.Z,{bgcolor:"background.paperLight",p:3,borderRadius:1,children:(0,y.jsx)(A.Hn,{id:"payment-element",options:m})})]}),(0,y.jsx)(ix.Z,{customerType:a.customerType===W.d2.B2B?en._$.B2B:en._$.B2C,concentChecked:a.termsAccepted,onConcentChange:e=>s({termsAccepted:e.target.checked}),sx:{mt:2}}),(0,y.jsx)(ih.Z,{loading:r,disabled:!o,variant:"contained",sx:{py:2,borderRadius:"8px",fontSize:"16px"},fullWidth:!0,type:"submit",children:(0,y.jsx)(et.Z,{id:"subscription.paymentmethod.submit"})})]})}var ij=t(80172);async function iy(e){let{cartProducts:i,customerId:t,additionalSessionData:n,user:r}=e;if(!(0,ij.hA)())return null;let o=[];for(let e of i)o.find(i=>i.priceId===e.priceId&&i.quantity)||o.push(e);let l=await (0,e0.Z)({method:"POST",endpoint:"/subscription/session",body:{customerId:t,cartProducts:o,additionalSessionData:n},includeStatus:!0});if(200!==l.status){if(409===l.status&&l.products)throw Error("ALREADY_PURCHASED",{cause:{errorCode:l.error,products:l.products,customerEmail:l.customerEmail}});throw Error("GENERIC_ERROR",{cause:{errorCode:l.error}})}return{...l,isSuperUser:null==r?void 0:r.isSuper}}(a=g||(g={})).AlreadyPurchased="ALREADY_PURCHASED",a.GenericError="GENERIC_ERROR";var ib=t(28316),iZ=t(37691),iI=t(61649),iC=t(15794),iw=t(12444);let ik=[{name:"Maventa",operatorId:"003721291126"}
1,{name:"Apix Messaging Oy",operatorId:"003723327487"},{name:"Basware Oy",operatorId:"BAWCFI22"},{name:"OP Osuuskunta",operatorId:"OKOYFIHH"},{name:"OpusCapita Solutions Oy",operatorId:"E204503"},{name:"Open Text Oy",operatorId:"003708599126"},{name:"CGI Suomi Oy",operatorId:"003703575029"},{name:"Pagero Oy",operatorId:"003723609900"},{name:"Nordea",operatorId:"NDEAFIHH"},{name:"Danske Bank A/S, Suomen sivuliike",operatorId:"DABAFIHH"},{name:"Netbox Finland Oy",operatorId:"003726044706"},{name:"Oma s\xe4\xe4st\xf6pankki Oyj",operatorId:"ITELFIHH"},{name:"POP Pankki",operatorId:"POPFFI22"},{name:"Ropo Suomi Oy",operatorId:"003714377140"},{name:"PostNord Str\xe5lfors Oy",operatorId:"003701150617"},{name:"Aktia Pankki Oyj",operatorId:"HELSFIHH"},{name:"S-Pankki",operatorId:"SBANFIHH"},{name:"Tietoevry Oyj",operatorId:"003701011385"},{name:"\xc5land Post Ab",operatorId:"003722207029"},{name:"Posti Messaging Oy",operatorId:"FI28768767"},{name:"S\xe4\xe4st\xf6pankit",operatorId:"ITELFIHH"},{name:"InExchange Factorum AB",operatorId:"INEXCHANGE"},{name:"Kofax Expert Systems",operatorId:"EXPSYS"},{name:"Crediflow AB",operatorId:"CREDIFLOW"},{name:"\xc5landsbanken Abp",operatorId:"AABAFI22"},{name:"Comarch",operatorId:"5909000716438"},{name:"Apper Systems AB",operatorId:"APPER"},{name:"LOGIQ AS",operatorId:"LO"},{name:"Orbyt AS",operatorId:"FI28768767"},{name:"Avalara Europe Ltd",operatorId:"993208446351"}];function i_(){var e,i,t,n,r,o,l;let{formData:s,updateFormData:a,session:c}=(0,O.useContext)(e6),d=e=>{let{name:i,value:t}=e.target;a({invoice:{...s.invoice,[i]:t}})},u=c.roleInCustomer===en.$0.Owner||c.isSuperUser;return(0,y.jsxs)(Y.Z,{spacing:2,children:[(0,y.jsxs)(ec.Z,{onChange:d,name:"method",value:(null===(e=s.invoice)||void 0===e?void 0:e.method)||m.EInvoice,children:[(0,y.jsx)(iZ.Z,{control:(0,y.jsx)(ed.Z,{disabled:!u}),value:m.EInvoice,label:(0,y.jsx)(J.Z,{variant:"body2",children:(0,y.jsx)(et.Z,{id:"subscription.new.invoice.einvoice.title"})})}),(0,y.jsx)(iZ.Z,{control:(0,y.jsx)(ed.Z,{disabled:!u}),value:m.Email,label:(0,y.jsx)(J.Z,{variant:"body2",children:(0,y.jsx)(et.Z,{id:"subscription.new.invoice.email.title"})})}),(0,y.jsx)(iZ.Z,{control:(0,y.jsx)(ed.Z,{disabled:!u}),value:m.Post,label:(0,y.jsx)(J.Z,{variant:"body2",children:(0,y.jsx)(et.Z,{id:"subscription.new.invoice.mail.title"})})})]}),(0,y.jsxs)(Y.Z,{spacing:2,children:[(0,y.jsx)(J.Z,{variant:"h4",children:(0,y.jsx)(et.Z,{id:"subscription.new.invoice.address"})}),(0,y.jsx)(ep.Z,{variant:"outlined",fullWidth:!0,children:(0,y.jsx)(ir.Z,{id:"invoice-address-line",name:"address",type:"text",label:(0,y.jsx)(et.Z,{id:"subscription.new.invoice.address.line.placeholder"}),value:(null===(i=s.invoice)||void 0===i?void 0:i.address)||"",onChange:d,fullWidth:!0,required:!0,disabled:!u})}),(0,y.jsxs)(Y.Z,{flexDirection:{xs:"column",md:"row"},gap:2,children:[(0,y.jsx)(ep.Z,{variant:"outlined",fullWidth:!0,children:(0,y.jsx)(ir.Z,{id:"invoice-postal-code",name:"postalCode",type:"text",label:(0,y.jsx)(et.Z,{id:"subscription.new.invoice.address.postalCode.placeholder"}),value:(null===(t=s.invoice)||void 0===t?void 0:t.postalCode)||"",onChange:d,fullWidth:!0,required:!0,disabled:!u})}),(0,y.jsx)(ep.Z,{variant:"outlined",fullWidth:!0,children:(0,y.jsx)(ir.Z,{id:"invoice-city",name:"city",type:"text",label:(0,y.jsx)(et.Z,{id:"subscription.new.invoice.address.city.placeholder"}),value:(null===(n=s.invoice)||void 0===n?void 0:n.city)||"",onChange:d,fullWidth:!0,required:!0,disabled:!u})})]})]}),[m.EInvoice,m.Email].includes(s.invoice.method)&&(0,y.jsxs)(Y.Z,{spacing:2,children:[(0,y.jsx)(J.Z,{variant:"h4",children:(0,y.jsx)(et.Z,{id:"subscription.new.invoice.email"})}),(0,y.jsx)(ep.Z,{variant:"outlined",fullWidth:!0,children:(0,y.jsx)(ir.Z,{id:"invoice-email",name:"email",type:"email",label:(0,y.jsx)(et.Z,{id:"subscription.new.invoice.email.placeholder"}),value:(null===(r=s.invoice)||void 0===r?void 0:r.email)||"",onChange:d,fullWidth:!0,required:!0,disabled:!u})})]}),s.invoice.method===m.EInvoice&&(0,y.jsxs)(Y.Z,{spacing:2,children:[(0,y.jsx)(J.Z,{variant:"h4",children:(0,y.jsx)(et.Z,{id:"subscription.new.invoice.operator"})}),(0,y.jsx)(ep.Z,{variant:"outlined",fullWidth:!0,children:(0,y.jsx)(ir.Z,{id:"invoice-eAddress",name:"eAddress",type:"text",label:(0,y.jsx)(et.Z,{id:"subscription.new.invoice.eAddress.placeholder"}),value:(null===(o=s.invoice)||void 0===o?void 0:o.eAddress)||"",onChange:d,fullWidth:!0,required:!0,disabled:!u})}),(0,y.jsxs)(ep.Z,{variant:"outlined",fullWidth:!0,children:[(0,y.jsx)(iI.Z,{id:"operatorId-select-label",children:(0,y.jsx)(et.Z,{id:"subscription.new.invoice.operator.placeholder"})}),(0,y.jsx)(iC.Z,{labelId:"operatorId-select-label",name:"operatorId",id:"operatorId-select",value:(null===(l=s.invoice)||void 0===l?void 0:l.operatorId)||"",label:(0,y.jsx)(et.Z,{id:"subscription.new.invoice.operator.placeholder"}),onChange:d,required:!0,disabled:!u,children:ik.map((e,i)=>(0,y.jsx)(iw.Z,{value:e.operatorId,children:e.name},i))})]})]})]})}let iS=L(M.Z.stripePk||"",{locale:"fi"}),iD={invalid_request:"checkout.genericError",invalid_customer:"checkout.invalidCustomer",missing_permissions:"checkout.missingPermissions",invali
1d_cart_items:"checkout.invalidCartItems"};function iP(e){var i,t;let{customerType:n}=e,{cart:r,billingPeriodMonths:o}=(0,O.useContext)(z);return r?(0,y.jsxs)(Y.Z,{spacing:2,children:[(0,y.jsx)(Y.Z,{children:null==r?void 0:r.lines.data.map(e=>(0,y.jsx)(Y.Z,{flexDirection:"row",justifyContent:"space-between",width:"100%",children:(0,y.jsx)(eT,{lineItem:e,variant:"h5"})}))}),(0,y.jsxs)(Y.Z,{spacing:1,children:[(0,y.jsxs)(Y.Z,{flexDirection:"row",gap:1,alignItems:"center",children:[(0,y.jsx)(J.Z,{component:"p",variant:"h2",color:(null==r?void 0:null===(i=r.total_discount_amounts)||void 0===i?void 0:i.length)?"primary":"text.primary",children:(0,y.jsx)(et.Z,{id:"subscription.priceWithMonths",values:{price:(0,y.jsx)(ex.BK,{value:((0,H.I3)(r,n)||0)/100,maximumFractionDigits:2,minimumFractionDigits:2,currency:"EUR",currencyDisplay:"symbol",style:"currency"}),months:o}})}),(null==r?void 0:null===(t=r.total_discount_amounts)||void 0===t?void 0:t.length)?(0,y.jsx)(Y.Z,{flexDirection:"row",gap:1,alignItems:"flex-end",children:(0,y.jsx)(J.Z,{variant:"body2",color:"text.disabled",sx:{textDecoration:"line-through"},children:(0,y.jsx)(ex.BK,{value:r.subtotal/100,maximumFractionDigits:2,minimumFractionDigits:2,currency:"EUR",currencyDisplay:"symbol",style:"currency"})})}):null,(0,y.jsx)(J.Z,{variant:"body3",color:"text.primary",children:(0,y.jsx)(et.Z,{id:"checkout.vat.".concat(n)})})]}),(0,y.jsx)(J.Z,{variant:"body3",color:"text.secondary",children:(0,y.jsx)(et.Z,{id:"checkout.cart.total.".concat(n,".vat")})}),(0,y.jsx)(eX,{customerType:n})]})]}):null}function iB(e){let{customerType:i}=e;return(0,y.jsx)(X.Z,{height:"100vh",bgcolor:"background.paperLight",position:"sticky",top:0,children:(0,y.jsxs)(Y.Z,{p:4,justifyContent:"space-between",height:"100%",children:[(0,y.jsx)(X.Z,{}),(0,y.jsx)(iP,{customerType:i}),(0,y.jsx)(ii,{})]})})}var iE=t(34084),iF=t(55830),iq=t(38158);let iL={[W.pB.ConnectAiContent]:{title:"subscription.new.thanks.title",desc:"sisaltokone.welcome_desc_1",button:"subscription.new.thanks.continue.aiContent",href:"/sisaltoapuri"}};function iA(){var e;let{cart:i,products:t,customerId:n}=(0,O.useContext)(z),r=(0,iF.NL)(),o=null==i?void 0:i.lines.data.some(e=>(e.quantity||0)>1),l=null==t?void 0:null===(e=t[0])||void 0===e?void 0:e.slug,s=null==iL?void 0:iL[l],a=M.Z.service===en.t6.Connect,c=()=>{r.invalidateQueries({queryKey:["user"]}),r.invalidateQueries({queryKey:(0,iq.v)(n)}),r.invalidateQueries({queryKey:["locationLicenses",n]}),r.invalidateQueries({queryKey:["selectedLocation"]})};return(0,y.jsxs)(Y.Z,{spacing:{md:4,xs:2},children:[(0,y.jsxs)(J.Z,{variant:"h2",component:"p",display:"flex",alignItems:"center",maxWidth:500,children:[(0,y.jsx)(et.Z,{id:(null==s?void 0:s.title)||"subscription.new.thanks.title"}),(0,y.jsx)(ez.Z,{component:iE.Z,sx:{ml:2},fontSize:"inherit",color:"primary"})]}),(0,y.jsx)(J.Z,{variant:"body1",children:s?(0,y.jsx)(et.Z,{id:s.desc,values:{br:(0,y.jsx)("br",{})}}):o?(0,y.jsx)(et.Z,{id:"subscription.new.thanks.subtitle.multiple"}):(0,y.jsx)(et.Z,{id:"subscription.new.thanks.subtitle.single",values:{br:(0,y.jsx)("br",{})}})}),(0,y.jsx)(eL.Z,{variant:"contained",component:ei(),endIcon:o?(0,y.jsx)(eb.Z,{children:"arrow_forward"}):void 0,onClick:c,href:s?s.href:o&&!a?"/palveluiden-hallinta/paasyoikeuksien-hallinta":a?"/editor":"/",
1sx:{alignSelf:"flex-start"},children:s?(0,y.jsx)(et.Z,{id:s.button}):o?(0,y.jsx)(et.Z,{id:"subscription.new.thanks.continue.multiple"}):(0,y.jsx)(et.Z,{id:"subscription.new.thanks.continue.single"})}),!!(o||a)&&(0,y.jsx)(ey.Z,{href:"/",onClick:c,sx:{alignSelf:"flex-start",fontSize:"subtitle2.fontSize"},children:(0,y.jsx)(et.Z,{id:"subscription.new.thanks.continue.frontPage"})})]})}function iM(e){let{step:i,steps:t}=e;return(0,y.jsx)(Y.Z,{direction:"row",justifyContent:"space-between",maxWidth:520,mx:"auto",width:"100%",children:t.map((e,t)=>(0,y.jsxs)(Y.Z,{alignItems:"center",gap:1,children:[(0,y.jsx)(J.Z,{color:i===t?"text.primary":"text.disabled",fontWeight:i===t?700:300,children:(0,y.jsx)(et.Z,{id:e})}),(0,y.jsx)(X.Z,{bgcolor:i>t?"primary.main":"white",border:"2px solid",borderColor:i>t?"primary.main":i===t?"text.primary":"text.disabled",borderRadius:"4px",height:"9px",width:"56px"})]},t))})}function iT(e){let{step:i,steps:t}=e;return(0,y.jsxs)(X.Z,{children:[(0,y.jsx)(iM,{steps:t,step:i}),(0,y.jsx)(iR,{})]})}function iR(){let e=(0,U.Z)(),i=(0,K.useRouter)(),t=(0,iF.NL)();return(0,y.jsx)(ea.Z,{onClick:()=>{t.invalidateQueries({queryKey:["user"]}),i.back()},sx:{backgroundColor:"background.paperDark",color:"text.primary",position:"absolute",top:16,right:16},"aria-label":e.formatMessage({id:"close"}),children:(0,y.jsx)(eb.Z,{children:"close"})})}let iO={[W.pB.ConnectAiContent]:{title:"checkout.conflictModal.aiContent.title",desc:"checkout.conflictModal.aiContent.description",button:"checkout.conflictModal.aiContent.button",href:"/sisaltoapuri"}};function iW(e){let{isOpen:i,toggle:t,modalData:n}=e,{basePrices:r,getLineItemInfo:o}=(0,O.useContext)(z),l=null==r?void 0:r.find(e=>{var i,t;return null==n?void 0:n.products.includes(null===(t=e.pricing)||void 0===t?void 0:null===(i=t.price_details)||void 0===i?void 0:i.product)}),s=l?o(l):null,a=s?null==iO?void 0:iO[s.identifier]:null;return(0,y.jsx)(eZ.Z,{isOpen:!!(n&&i),toggle:e=>t(e),hasCloseButton:!0,children:(0,y.jsxs)(Y.Z,{spacing:2,pt:2,px:2,children:[(0,y.jsx)(J.Z,{variant:"h5",gutterBottom:!0,children:(0,y.jsx)(et.Z,{id:(null==a?void 0:a.title)||"checkout.conflictModal.title",values:{email:(null==n?void 0:n.customerEmail)||"",e:e=>(0,y.jsx)(J.Z,{variant:"inherit",fontWeight:"normal",color:"primary",children:e})}})}),(0,y.jsx)(J.Z,{variant:"body1",children:(0,y.jsx)(et.Z,{id:(null==a?void 0:a.desc)||"checkout.conflictModal.description"})}),(0,y.jsx)(eL.Z,{variant:"contained",component:ei(),href:(null==a?void 0:a.href)||"/palveluiden-hallinta/paasyoikeuksien-hallinta?products=".concat((null==n?void 0:n.products.join(","))||""),sx:{alignSelf:"flex-start"},children:(0,y.jsx)(et.Z,{id:(null==a?void 0:a.button)||"checkout.conflictModal.button"})})]})})}(c=j||(j={})).Cart="cart",c.Login="login",c.Payment="payment",c.Confirmation="confirmation";let iN={cart:eH,login:eH,payment:function(e){var i,t,n;let{uiSettings:r,customerType:o,setStep:l,setConflictModal:s,ContentHeader:a}=e,{cart:c,setCustomerId:d,additionalSessionData:u,initialLoading:p,products:v,coupons:m,hasTrackedBeginCheckout:h}=(0,O.useContext)(z),[x,f]=(0,O.useState)(),b=(0,e2.bI)("accessCustomerId",M.Z.service),{data:Z,isLoading:I,isError:C,error:w}=function(e,i,t){let{data:n,isLoading:r}=(0,eE.p)();return(0,iv.a)({queryKey:["checkout-session",null==n?void 0:n.userId,i,e,t],queryFn:()=>iy({customerId:i,cartProducts:e,additionalSessionData:t,user:n}),enabled:!r&&!!n,keepPreviousData:!0,retry:!1,staleTime:9e5})}(c?(0,H.aB)(c,(null==u?void 0:u.location)&&v.map(e=>e.productId)):[],(null==u?void 0:u.customerId)||(null==u?void 0:null===(i=u.location)||void 0===i?void 0:i.companyId)||(b&&"NONE"!==b?b:void 0),u),{showNotification:k}=(0,N.Z)(),_=(0,eg.e)(),S=(0,Q.Z)((0,$.Z)().breakpoints.down("md")),D=(0,O.useMemo)(()=>o===W.d2.B2B?[{id:M.Z.invoicePaymentMethod||"",options:{type:"embedded",embedded:{handleRender:e=>f(e),handleDestroy:()=>f(null)}}}]:void 0,[o]),P=(0,O.useMemo)(()=>{var e;return{mode:"subscription",amount:(null==c?void 0:c.total)||0,currency:"eur",payment_method_configuration:M.Z.paymentConfiguration,customerSessionClientSecret:null==Z?void 0:null===(e=Z.customerSession)||void 0===e?void 0:e.client_secret,...D&&{customPaymentMethods:D}}},[null==c?void 0:c.total,null==Z?void 0:null===(t=Z.customerSession)||void 0===t?void 0:t.client_secret,D]);return((0,O.useEffect)(()=>{var e,i;if(null==Z?void 0:null===(e=Z.customerData)||void 0===e?void 0:e.id)d(null==Z?void 0:null===(i=Z.customerData)||void 0===i?void 0:i.id);else if(C){let e=w.cause;if(l(j.Cart),w.message===g.GenericError)return k(iD.hasOwnProperty(e.errorCode)?iD[e.errorCode]:"subscription.error.subscription_failed","error",void 0,5e3);s(e)}},[Z,C,w]),(0,O.useEffect)(()=>{h.current||(h.current=!0,_("begin_checkout",(0,ej.LU)(c,v,m),{dataLayer:!0}))},[c]),p||I||C||!Z)?(0,y.jsx)(X.Z,{height:"60vh",display:"flex",justifyContent:"center",alignItems:"center",children:(0,y.jsx)(es.Z,{color:"primary"})}):(0,y.jsx)(A.eK,{stripe:iS,options:P,children:(0,y.jsxs)(e8,{customerType:o,handleDone:()=>l(j.Confirmation),session:Z,children:[(0,y.jsxs)(V.ZP,{container:!0,height:"100vh",children:[!S&&(0,y.jsx)(V.ZP,{item:!0,xs:12,md:5,position:"relative",children:(0,y.jsx)(it,{uiSettings:r,customerType:o,setStep:l})}),(0,y.jsx)(V.ZP,{item:!0,xs:12,md:7,children:(0,y.jsxs)(Y.Z,{height:"100%",py:{md:4,xs:2},px:{md:4,xs:2},gap:4,children:[(0,y.jsxs)(Y.Z,{gap:4,sx:S?{bgcolor:"background.paperLight",mt:-2,mx:-2,pt:2,px:2,pb:4}:{},children:[S&&(0,y.jsx)(e7,{setStep:l}),a,S&&(0,y.jsx)(e5,{customerType:o,setStep:l})]}),(0,y.jsx)(ig,{customerType:o}),S&&(0,y.jsx)(ii,{})]})})]}),x&&(0,ib.createPortal)((0,y.jsx)(i_,{}),x)]})},null==Z?void 0:null===(n=Z.customerSession)||void 0===n?void 0:n.client_secret)},confirmation:function(e){let{uiSettings:i,customerType:t,ContentHeader:n}=e,r=(0,Q.Z)((0,$.Z)().breakpoints.down("md"));return(0,y.jsxs)(V.ZP,{container:!0,height:"100vh",children:[!r&&(0,y.jsx)(V.ZP,{item:!0,md:5,position:"relative",children:(0,y.jsx)(iB,{customerType:t,uiSettings:i})}),(0,y.jsx)(V.ZP,{item:!0,xs:12,md:7,children:(0,y.jsxs)(Y.Z,{height:"100%",py:{md:4,xs:2},px:4,justifyContent:{md:"space-between",xs:"flex-start"},gap:4,children:[n,r&&(0,y.jsx)(iP,{customerType:t}),(0,y.jsx)(iA,{}),r&&(0,y.jsx)(ii,{}),(0,y.jsx)(X.Z,{})]})})]})}};function iU(e){var i;let{products:t,customerType:n,uiSettings:r,HeaderOverride:o,additionalSessionData:l}=e,[s,a]=(0,O.useState)("cart"),[c,d]=(0,O.useState)(void 0),u="".concat(n,":").concat(t.map(e=>{let{data:i,quantity:t}=e;return"".concat(i.productId,"x").concat(t)}).join(","));return(0,y.jsxs)(G,{products:t,additionalSessionData:l,intialCustomerId:(null==l?void 0:l.customerId)||(null==l?void 0:null===(i=l.location)||void 0===i?void 0:i.companyId)||void 0,children:[O.createElement(iN[s],{key:s,uiSettings:{...r,serviceName:M.Z.service}
1,customerType:n,setStep:a,setConflictModal:d,ContentHeader:o?O.createElement(o,{currentStep:s,additionalSessionData:l}):(0,y.jsx)(iT,{steps:Object.values(j).map(e=>"checkout.step.".concat(e)),step:Object.values(j).findIndex(e=>e===s)})}),(0,y.jsx)(iW,{isOpen:!!c,toggle:()=>d(void 0),modalData:c})]},u)}var iK=t(24764),iH=!0;function iz(e){let{products:i,customerType:t}=e,n=(0,U.Z)();return(0,y.jsxs)(R,{children:[(0,y.jsx)(iK.Z,{title:n.formatMessage({id:"checkout.title"})}),(0,y.jsx)(iU,{products:i,customerType:t,uiSettings:{imageUrl:t===W.d2.B2B?"https://ucarecdn.com/549121d7-07a0-4a9f-b287-0b811147a2ad/-/format/auto/":"https://ucarecdn.com/27781acb-66dd-4671-95b9-8c78a237d6a3/-/format/auto/",logoUrl:"/finder-white.svg",mobileLogoUrl:"/finder-blue.svg"}})]})}},39283:function(e,i,t){"use strict";var n=t(71600);i.Z=void 0;var r=n(t(94834)),o=t(52322);i.Z=(0,r.default)((0,o.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add")},34084:function(e,i,t){"use strict";var n=t(71600);i.Z=void 0;var r=n(t(94834)),o=t(52322);i.Z=(0,r.default)((0,o.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"}),"CheckCircleOutlined")},47476:function(e,i,t){"use strict";var n=t(96374),r=t(52322);i.Z=(0,n.Z)((0,r.jsx)("path",{d:"M19 13H5v-2h14z"}),"Remove")},60748:function(e,i,t){"use strict";t.d(i,{Z:function(){return d}});var n=t(52322),r=t(37691),o=t(14204),l=t(76385),s=t(26275),a=t(42670),c=t(36434);function d(e){let{customerType:i,textVariant:t="body3",concentChecked:d,onConcentChange:u,registration:p,...v}=e,m=(0,c.e)(),h=e=>{m("clicked_support_link",{click_url:e.currentTarget.href||"",click_text:e.currentTarget.textContent||""},{})};return(0,n.jsx)(r.Z,{...v,...p,required:!0,control:(0,n.jsx)(o.Z,{sx:{alignSelf:"start",pt:"4px"},checked:d,onChange:u}),label:(0,n.jsx)(l.Z,{variant:t,component:"span",sx:{whiteSpace:"pre-line"},children:(0,n.jsx)(a.Z,{id:"terms.".concat(i,".concent"),values:{terms:e=>(0,n.jsx)(s.Z,{href:"https://tuki.fonecta.com/kayttoehdot",color:"inherit",target:"_blank",rel:"noopener noreferrer",onClick:h,children:(0,n.jsx)(l.Z,{variant:t,component:"span",children:e})}),data:e=>(0,n.jsx)(s.Z,{href:"https://tuki.fonecta.com/tietosuojaseloste",color:"inherit",target:"_blank",rel:"noopener noreferrer",onClick:h,children:(0,n.jsx)(l.Z,{variant:t,component:"span",children:e})}),br:(0,n.jsx)("br",{})}})})})}},94149:function(e,i,t){"use strict";t.d(i,{I:function(){return d}});var n=t(52322),r=t(26275),o=t(76385),l=t(85697),s=t(42670),a=t(39097),c=t.n(a);let d=e=>{let{id:i,href:t,onClick:a,target:d,sx:u={},loading:p,color:v,fontWeight:m}=e;return(0,n.jsxs)(r.Z,{component:t?c():r.Z,href:t,underline:"hover",display:"flex",alignItems:"center",target:d,color:v,sx:{...u,cursor:"pointer",opacity:p?.5:1,pointerEvents:p?"none":"auto"},onClick:a,children:[(0,n.jsx)(o.Z,{variant:"body2",fontWeight:m,children:(0,n.jsx)(s.Z,{id:i})}),(0,n.jsx)(l.Z,{sx:{ml:.5},style:{fontSize:18},children:"arrow_forward"})]})}},12471:function(e,i,t){"use strict";t.d(i,{w:function(){return a}});var n=t(47661),r=t(21806),o=t(80172),l=t(38158);async function s(e,i){if(!(0,o.hA)())throw Error("Invalid token");if(!e)throw Error("CustomerId is required to fetch licenses");let t={};return i&&i.length>0&&(t.products=i.join(",")),(await (0,r.S)({method:"GET",endpoint:"/license-access/customers/".concat(e,"/licenses"),queryParams:Object.keys(t).length>0?t:void 0,throwErrors:!0})).body}function a(e){let{customerId:i,products:t}=e;return(0,n.a)({queryFn:()=>s(i,t),queryKey:[...(0,l.v)(i),t&&t.join(",")]})}},38158:function(e,i,t){"use strict";function n(e){return["customerUsers",e]}function r(e){return["customerLicenses",e]}t.d(i,{K:function(){return n},v:function(){return r}})}},function(e){e.O(0,[5080,2888,9774,179],function(){return e(e.s=86202)}),_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.