1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2957],{3161:(e,a,r)=>{"use strict";r.d(a,{A:()=>p});var i=r(49222),s=r(3638),o=r(99835),l=r(76994),t=r.n(l);let n=({label:e,subLabel:a,color:r="default",inactive:o,...l})=>{let n=(0,s.A)(t().wrapper,t()[r]);return(0,i.jsxs)("label",{className:n,children:[(0,i.jsx)("input",{type:"radio",...l,className:(0,s.A)(l.className,{[t().inactive]:o})}),(0,i.jsx)("span",{className:t().radio}),(e||a)&&(0,i.jsxs)("span",{className:t().labelContainer,children:[e&&(0,i.jsx)("span",{className:t().label,children:e}),a&&(0,i.jsx)("span",{className:t().subLabel,children:a})]})]})};var d=r(33318),u=r.n(d);let p=({items:e,name:a,onChange:r,errorMessage:l,value:t,color:d,className:p,label:c,errorMessageHasRelativePosition:m})=>(0,i.jsxs)("div",{className:u().wrapper,children:[c&&(0,i.jsx)("div",{className:u().label,children:c}),(0,i.jsx)("div",{className:(0,s.A)(u().base,p),children:e.map(({label:e,value:s,subLabel:o})=>{let l=!!t&&[e,s].includes(t);return(0,i.jsx)(n,{color:d,name:a,label:e||s,subLabel:o,value:s,onChange:r,checked:l,inactive:!l&&!!t},e||s)})}),l&&(0,i.jsx)("div",{className:u().errorMessageWrapper,children:(0,i.jsx)(o.A,{hasRelativePosition:m,children:l})})]})},33318:e=>{e.exports={wrapper:"FormFieldRadioGroup-module-wrapper",base:"FormFieldRadioGroup-module-base",label:"FormFieldRadioGroup-module-label",errorMessageWrapper:"FormFieldRadioGroup-module-error-message-wrapper"}},52572:e=>{e.exports={base:"StageBoxCalculatorFormFieldRadioGroupWrapper-module-base"}},52957:(e,a,r)=>{"use strict";r.r(a),r.d(a,{default:()=>R});var i=r(49222),s=r(22313),o=r(46730),l=r(3558),t=r(93897),n=r(91877),d=r(76651),u=r(36587),p=r(23806),c=r(3161),m=r(52572),b=r.n(m);let g=[{value:"private",label:"Privat"},{value:"business",label:"Gewerblich"}],h=({value:e,color:a,onChange:r})=>(0,i.jsx)("div",{className:b().base,children:(0,i.jsx)(c.A,{name:"customerType",items:g,color:a,onChange:r,value:e})});var v=r(67849),x=r(77766);let w={power:"user/lightning",gas:"user/energy-fire",combined:"user/calculator"},f=["combined","power","gas"];var j=r(82762),C=r(42355);let G=j.Ik({zipcode:C.PN}),N={gradient:"white",white:"default"},R=({title:e,titleTag:a,productFormType:r,productCustomerType:c,powerPagePath:m,gasPagePath:b,powerAndGasPagePath:g,powerPageGwKPath:j,gasPageGwKPath:C,powerAndGasPageGwKPath:R,powerGasCombinedDefault:k,tariffRestrictions:P,backgroundType:S="gradient"})=>{let{pushDataLayerEvent:I}=(0,l.A)(),L=(r.split("-")||[]).sort((e,a)=>f.indexOf(e)-f.indexOf(a)),z={power:{private:m,business:j},gas:{private:b,business:C},combined:{private:g,business:R}},[A,F]=(0,x.useState)(k??L.find(Boolean)??"power"),[M,T]=(0,x.useState)("business-customer"===c?"business":"private"),{handleSubmit:y,handleChange:B,handleBlur:O,getErrorByFieldName:$,formState:E}=(0,t.A)(e=>{let a=e.zipcode,r=e["consumption.gas"],i=e["consumption.power"],l=z[A][M];if(I({event:"customClick2",plz:a,isLeadingTo:"S&G-Konfigurator",isSgkModulePresent:"true",sgkProductSelection:s.G[A].radioLabel,sgkCustomerTypeSelection:"private"===M?"Privat":"Gewerbe"}),l){let e=new URLSearchParams;e.append("zipCode",a),r&&e.append("gasConsumption",r),i&&e.append("powerConsumption",i),(P??[]).length&&P?.forEach(({id:a})=>{e.append("productIds",a)}),window.location.href=(0,n.Z)(`${l}?${e}`,window.location.search)}else o.v.error(`'pagePath' for ${A} ${M} in CMS is not defined!`)},G,{zipcode:""}),_=L.map(e=>({label:s.G[e].radioLabel,value:e})),W=_.length>1;return(0,x.useEffect)(()=>{I({event:"sgkModuleUpdate",isSgkModulePresent:"true",sgkProductSelection:s.G[A].radioLabel,sgkCustomerTypeSelection:"private"===M?"Privat":"Gewerbe"})},[M,A,I]),(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("form",{onSubmit:y,children:(0,i.jsxs)(v.A,{title:e,titleTag:a,buttonText:s.G[A].buttonText,buttonIcon:w[A],backgroundType:S,children:["private-business-combined"===c&&(0,i.jsx)(h,{onChange:e=>{let{value:a}=e.target;T(a)},value:M,color:N[S||"gradient"]}),W&&(0,i.jsx)(p.A,{ariaLabel:`Tarife anzeigen f\xfcr ${s.G[A].radioLabel}`,options:_,label:"Tarife anzeigen f\xfcr",name:"productOption",value:A,isBoxOnGradient:"gradient"===S,onBlur:O,onChange:e=>{F(e?e.value:"")}}),(0,i.jsx)(d.A,{name:"zipcode",value:E.zipcode||"",label:"Ihre Postleitzahl",type:u.V.Number,autoComplete:"postal-code",inputMode:"numeric",maxLength:5,onChange:B,errorMessage:$("zipcode"),onBlur:O,restrictMaxLength:!0,isBoxOnGradient:"gradient"===S,errorMessageHasRelativePosition:!0})]})})})}},76994:e=>{e.exports={wrapper:"RadioInput-module-wrapper",radio:"RadioInput-module-radio",default:"RadioInput-module-default",label:"RadioInput-module-label",labelContainer:"RadioInput-module-label-container",inactive:"RadioInput-module-inactive",subLabel:"RadioInput-module-sub-label",white:"RadioInput-module-white"}}}]); 2//# sourceMappingURL=2957.473b07867632de2e.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.