1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7446],{5710:(e,t,n)=>{n.d(t,{R:()=>c});var s=n(37876),l=n(7369);n(3084);var o=n(34197);let a=n(9906).tw.theme({slots:{base:["flex","flex-col","gap-y-4","px-8","md:px-24","lg:px-64"]}}),i=(0,o.S)({theme:a})({as:"div",slot:"base"}),r=e=>{let{content:t,...n}=e;return(0,s.jsx)(i,{...n,children:t})},c=(0,l.Qj)(e=>(0,s.jsx)(r,{...e}))},18832:(e,t,n)=>{n.d(t,{N:()=>A});var s=n(37876),l=n(7369),o=n(3084),a=n(20855),i=n(9317),r=n(56685),c=n(61248),d=n(15965),u=n(13810),m=n(95831),x=n(14232),h=n(88992),p=n(60513),f=n(10954),b=n(48314),g=n(56102),v=n(8593),j=n(61330),k=n(91535),y=n(89597);let w=Object.assign(n(9906).tw.theme({slots:{base:[],policy:[],error:["flex","flex-row","items-center","justify-center","mb-5","gap-1","text-error-700"]}}),{Button:v.O,Checkbox:j.p,FrisbiiPayment:k.i,TextField:y.l});var F=n(30781),C=n(1334),T=n(34197);let N=(0,T.S)({theme:w}),D=N({as:"form",slot:"base"}),$=N({as:"p",slot:"policy"}),S=N({as:"div",slot:"error"}),L=(0,T.Q)({as:b.$,theme:w.Button}),Q=(0,T.Q)({as:g.S,theme:w.Checkbox}),z=(0,T.Q)({as:F.f,theme:w.FrisbiiPayment}),P=Object.assign(D,{Policy:$,TextField:(0,T.Q)({as:C.A,theme:w.TextField}),Checkbox:Q,Button:L,FrisbiiPayment:z,Error:S}),_=p.z.object({firstName:p.z.string().nonempty("* Detta f\xe4lt \xe4r obligatoriskt").min(2,"* F\xe4ltet ska inneh\xe5lla minst 2 tecken och h\xf6gst 255 tecken").max(255,"* F\xe4ltet ska inneh\xe5lla minst 2 tecken och h\xf6gst 255 tecken"),lastName:p.z.string().nonempty("* Detta f\xe4lt \xe4r obligatoriskt").min(2,"* F\xe4ltet ska inneh\xe5lla minst 2 tecken och h\xf6gst 255 tecken").max(255,"* F\xe4ltet ska inneh\xe5lla minst 2 tecken och h\xf6gst 255 tecken"),email:p.z.string().nonempty("* Var v\xe4nlig ange din e-postadress").email("* V\xe4nligen ange en giltig e-postadress"),newsletter:p.z.boolean().default(!1),consent:p.z.boolean().refine(e=>!0===e,{message:"* Detta f\xe4lt \xe4r obligatoriskt"})}),B=e=>{var t,n,l,p,b,g,v,j,k,y,w,F;let{errorContent:C,labels:T,policy:N,submitButtonContent:D,returnTo:$,...S}=e,L=(0,x.useRef)(null),[Q,z]=(0,x.useState)(null),[{paymentConfig:B}]=(0,i.A)(),{isUserLoggedIn:A}=(0,c.A)(),{createFrisbiiSession:E,frisbiiSession:O}=(0,r.g)(),{handleSubmit:I,register:G,formState:R}=(0,h.mN)({resolver:(0,u.u)(_)}),V=A||!!O,M=(0,x.useMemo)(()=>{if(!B||!("plan"in B))return;let e=B.data.amount/100;return{currency:B.data.currency,value:e,items:[{item_id:B.plan,item_name:B.data.name,price:e}]}},[B]),K=(0,x.useCallback)(async(e,t)=>{var n;z(t instanceof m.f&&(null==C?void 0:C(t.code))||e||"F\xf6rl\xe5t, ett fel har uppst\xe5tt. V\xe4nligen f\xf6rs\xf6k igen om en stund."),null==(n=L.current)||n.scrollIntoView({block:"center",inline:"nearest"})},[C]),Y=async e=>{z(null);let{firstName:t,lastName:n,email:s}=e,l=!!e.newsletter,o=(0,f.Y)($);try{await E({email:s,firstName:t,lastName:n,newsletter:l,returnTo:o})}catch(e){d.v.error(e),K(void 0,e)}},q=(0,x.useCallback)(async e=>{(null==e?void 0:e.redirect_to)&&(window.location.href=e.redirect_to)},[]);return(0,s.jsxs)(P,{ref:L,onSubmit:I(Y),...S,children:[Q&&(0,s.jsxs)(P.Error,{children:[(0,s.jsx)(a.I,{name:"error"}),Q]}),!V&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(P.TextField,{caption:null==(t=R.errors.email)?void 0:t.message,label:null==T?void 0:T.email,placeholder:"E-post",status:R.errors.email?"error":void 0,options:(0,o.lL)({$input:{...G("email")}},null==(n=S.options)?void 0:n.$textField)}),(0,s.jsx)(P.TextField,{caption:null==(l=R.errors.firstName)?void 0:l.message,label:null==T?void 0:T.firstName,placeholder:"F\xf6rnamn",status:R.errors.firstName?"error":void 0,options:(0,o.lL)({$input:{...G("firstName")}},null==(p=S.options)?void 0:p.$textField)}),(0,s.jsx)(P.TextField,{caption:null==(b=R.errors.lastName)?void 0:b.message,label:null==T?void 0:T.lastName,placeholder:"Efternamn",status:R.errors.lastName?"error":void 0,options:(0,o.lL)({$input:{...G("lastName")}},null==(g=S.options)?void 0:g.$textField)}),(0,s.jsx)(P.Checkbox,{status:R.errors.consent?"error":"default",caption:null==(v=R.errors.consent)?void 0:v.message,label:null==T?void 0:T.consent,options:(0,o.lL)({$input:{...G("consent")}},null==(j=S.options)?void 0:j.$checkbox)}),(null==T?void 0:T.newsletter)&&(0,s.jsx)(P.Checkbox,{caption:null==(k=R.errors.newsletter)?void 0:k.message,label:null==T?void 0:T.newsletter,options:(0,o.lL)({$input:{...G("newsletter")}},null==(y=S.options)?void 0:y.$checkbox)}),N&&(0,s.jsx)(P.Policy,{children:N}),D&&(0,s.jsx)(P.Button,{content:D,options:(0,o.lL)({type:"submit",size:"large",disabled:R.isSubmitting},null==(w=S.options)?void 0:w.$button)})]}),V&&(0,s.jsx)(P.FrisbiiPayment,{autoTrigger:!A,button:{content:"Betala",options:{size:"large"}},handleFailure:K,handleSuccess:q,returnTo:$,tracking:M,options:null==(F=S.options)?void 0:F.$frisbiiPayment})]})},A=(0,l.Qj)(e=>(0,s.jsx)(B,{...e}))},27446:(e,t,n)=>{n.d(t,{R:()=>p});var s=n(37876),l=n(7369);n(3084);var o=n(5710),a=n(65897),i=n(18832),r=n(59613),c=n(9317),d=n(14232);let u=n(9906).tw.theme({slots:{base:["flex","flex-col","gap-y-10"],closed:[]}}),m=(0,n(34197).S)({theme:u}),x=Object.assign(m({as:"section",slot:"base"}),{Closed:m({as:"div",slot:"closed"})}),h=e=>{var t;let{header:n,body:l,footer:u,form:m,closed:h,disabledContent:p,...f}=e,[{paymentConfig:b}]=(0,c.A)(),{copy:g}=null!=h?h:{},v=(e=>{let[t,n]=(0,d.useState)(!!e&&Date.parse(e)<Date.now());return(0,d.useEffect)(()=>
1{if(!e)return;n(!!e&&Date.parse(e)<Date.now());let t=function e(t,n){return setTimeout(()=>{if(n>0x7fffffff)return e(t,n-0x7fffffff);t()},Math.min(0x7fffffff,n))}(()=>{n(!0)},Math.max(Date.parse(e)-Date.now(),0));return()=>clearTimeout(t)},[e]),t})(null==b||null==(t=b.data)?void 0:t.closeTime),j=!(null==b?void 0:b.enabled)||v;return(null==b?void 0:b.enabled)||!p?(0,s.jsxs)(x,{...f,children:[(0,s.jsx)(r.K,{...n}),(0,s.jsx)(o.R,{...l}),(0,s.jsx)(a.A,{...u}),j?(0,s.jsx)(x.Closed,{children:g}):(0,s.jsx)(i.N,{...m})]}):p},p=(0,l.Qj)(e=>(0,s.jsx)(h,{...e}))},59613:(e,t,n)=>{n.d(t,{K:()=>x});var s=n(37876),l=n(7369);n(3084);let o=n(9906).tw.theme({slots:{base:"flex flex-col items-center bg-slate-200 px-20 py-10",background:"",content:"",contentImage:"",contentTitle:"text-headline-lg",contentDescription:""}}),a=(0,n(34197).S)({theme:o}),i=a({as:"div",slot:"base"}),r=a({as:"picture",slot:"background"}),c=a({as:"div",slot:"content"}),d=a({as:"picture",slot:"contentImage"}),u=Object.assign(i,{Background:r,Content:c,ContentImage:d,ContentTitle:a({as:"h1",slot:"contentTitle"}),ContentDescription:a({as:"div",slot:"contentDescription"})}),m=e=>{let{background:t,image:n,title:l,description:o,...a}=e;return(0,s.jsxs)(u,{...a,children:[t&&(0,s.jsx)(u.Background,{children:t}),(0,s.jsxs)(u.Content,{children:[n&&(0,s.jsx)(u.ContentImage,{children:n}),l&&(0,s.jsx)(u.ContentTitle,{children:l}),o&&(0,s.jsx)(u.ContentDescription,{children:o})]})]})},x=(0,l.Qj)(e=>(0,s.jsx)(m,{...e}))},65897:(e,t,n)=>{n.d(t,{A:()=>m});var s=n(37876),l=n(7369);n(3084);let o=n(9906).tw.theme({slots:{base:"flex flex-col items-center bg-slate-200",title:"",background:"",content:"bg-slate-900",paymentGatewayLogo:""}}),a=(0,n(34197).S)({theme:o}),i=a({as:"div",slot:"base"}),r=a({as:"h2",slot:"title"}),c=a({as:"picture",slot:"background"}),d=Object.assign(i,{Background:c,Title:r,Content:a({as:"div",slot:"content"}),PaymentGatewayLogo:a({as:"div",slot:"paymentGatewayLogo"})}),u=e=>{let{title:t,background:n,content:l,paymentGatewayLogo:o,...a}=e;return(0,s.jsxs)(d,{id:"checkout-footer",...a,children:[n&&(0,s.jsx)(d.Backgroun
1d,{children:n}),t&&(0,s.jsx)(d.Title,{children:t}),(0,s.jsx)(d.Content,{children:l}),o&&(0,s.jsx)(d.PaymentGatewayLogo,{children:o})]})},m=(0,l.Qj)(e=>(0,s.jsx)(u,{...e}))}}]); 2//# sourceMappingURL=7446-40227829d9cb93a3.js.map
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.