(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3735,5633],{43735:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return ey}});var n=a(85893),i=a(67294),r=a(47013),o=a(52738),s=a(32752),l=a(96576),c=a(22943),d=a(21320),u=a(11163),m=a(35614),h=a(147),p=a(69496),v=a(72095),b=a(83884),f=a(33919),g=a(41207),y=a(31955);let x=async(e,t,a)=>{try{var n,i;let r;let o=(await (0,v.d)(e.homeAddress.zip||"",!1)).dealers[0];if(!o)throw Error("No dealers found in your area. Please check your zip code.");let s="".concat(window.location.origin).concat(window.location.pathname).concat(t),l=(0,h.Z)(JSON.stringify(o.data.companyID),s),c=(0,f.Z)("STAGING"),d=(n={...e.homeAddress,firstName:e.contactInfo.firstName,lastName:e.contactInfo.lastName,email:e.contactInfo.email,phone:e.contactInfo.phone,comments:l},i=JSON.stringify(o.data.companyID),r=parseInt(i,10),isNaN(r)&&(r=0),{companyID:r,mtaAnonymousID:y.Z.get("_mta_aid")||"",mtaSessionID:y.Z.get("_mta_sid")||"",url:window.location.href,fields:n,kind:"CONTACT_DEALER",brand:"Trane",source:"System Recommendation Flow",htmlId:"system-recommendation-flow",tcpa:{consentText:"By pressing the Continue button, I consent to receive a phone call about products and services from a dealer at the phone number(s) provided. I understand these calls may be generated using automated technology and my consent does not imply or require that a purchase be made.",accepted:!0}}),u=await fetch("https://".concat("dev"===c?"stg":c,".irapis.com/forms"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}),m=await u.json();if(!1===m.success)throw Error(m.error);let x=m.id;a("leadId",x),a("dealerId",JSON.stringify(o.data.companyID));try{await (0,p.z)({leadID:x,homeowner:{firstName:e.contactInfo.firstName,lastName:e.contactInfo.lastName,email:e.contactInfo.email},dealer:{companyID:o.data.companyID||0,name:o.data.name||"",phone:o.data.phone1||""}})}catch(e){(0,g.N)(e instanceof Error?e:Error("System rec email failed to send"),{leadId:x})}(0,b.p)({event:"dealer_form_success",formId:"contact-your-local-dealer",zipcode:e.homeAddress.zip||void 0,vwo:{experience_number:"151",variant:"flow4"}})}catch(e){throw console.error("Error during submission:",e),Error(e instanceof Error?e.message:"An unexpected error occurred. Please check your information and try again.")}},S=e=>({"0 - 1,200":"2.0","1,200 - 1,500":"2.5","1,500 - 1,800":"3.0","1,800 - 2,100":"3.5","2,100 - 2,400":"4.0","2,400 - 2,700":"4.0","2,700 - 3,000":"5.0","3,000+":"5.0"})[e]||"2.0",w=(e,t,a)=>{var n,i,r;let o=S(null!==(r=null==e?void 0:e.homeSize)&&void 0!==r?r:""),s=new URLSearchParams;s.set("tonnage",o),t&&s.set("zipCode",t),a&&(a=(a=a.toLowerCase()).replaceAll(" ","_"),s.set("location",a));let l=null==e?void 0:null===(n=e.buyingFactors)||void 0===n?void 0:n.includes("Eco-friendly"),c=null==e?void 0:null===(i=e.buyingFactors)||void 0===i?void 0:i.includes("Lowest cost");return l&&!c&&s.set("eco","true"),"results/?".concat(s.toString())};var _=a(1604);let j=_.z.object({firstName:_.z.string().min(1,"First name is required"),lastName:_.z.string().min(1,"Last name is required"),email:_.z.string().min(1).email("Invalid email address"),phone:_.z.string().length(10,"Phone number must be exactly 10 characters"),callTime:_.z.string()}),C=e=>j.safeParse(e),N=_.z.object({addressLine1:_.z.string().min(1,"Address line 1 is required"),city:_.z.string().min(1,"City is required"),state:_.z.string().min(2,"State is required"),zip:_.z.string().min(5,"Zip code must be at least 5 characters").regex(/^\d{5}(-\d{4})?$/,"Zip code must be a valid format")}),k=e=>N.safeParse(e);var z=a(72367),I=a(70855),F=a(97631),A=e=>{let t=e.trim().toLowerCase(),a=F.Z.find(e=>e.name.toLowerCase()===t);return a?a.abbreviation:e};let R=(0,i.createContext)(void 0),E=e=>{let{children:t,flowVariant:a="default"}=e,r=(0,u.useRouter)(),[,o]=(0,m.ZP)(),[s,l]=(0,i.useState)({homeSize:"",buyingFactors:[],homeAddress:{addressLine1:"",city:"",state:"",zip:""},contactInfo:{firstName:"",lastName:"",email:"",phone:"",callTime:""}}),[c,d]=(0,i.useState)(!1),[h,p]=(0,i.useState)(!0),[v,b]=(0,i.useState)(""),[f,g]=(0,i.useState)(!1),[y,S]=(0,i.useState)({}),j=(0,i.useCallback)(()=>w(s,y.zip,y.region),[s,y]);(0,i.useEffect)(()=>{let e=sessionStorage.getItem("systemRecFormData");if(e)try{l(JSON.parse(e))}catch(e){console.error("Error parsing saved form data:",e)}},[]);let N=(0,i.useCallback)(async e=>{if(!_.z.string().min(5).safeParse(e).success)return d(!1),S({}),{inServiceArea:!1,location:null};let t=await (0,z.t)(e);if(!(null==t?void 0:t.location))return d(!1),S({}),{inServiceArea:!1,location:null};let a=t.location.region.toString();t.location.region.length>2&&(a=A(t.location.region));let n=I.v.includes(a);return d(n),S({zip:e,region:t.location.region}),{inServiceArea:n,location:t.location}},[]),F=(0,i.useCallback)(e=>{var t,a;p(null!==(a=({homeSize:!!(null==s?void 0:s.homeSize),buyingFactors:(null==s?void 0:null===(t=s.buyingFactors)||void 0===t?void 0:t.length)>0,homeAddress:k(s.homeAddress).success,contactInfo:C(s.contactInfo).success})[e])&&void 0!==a&&a)},[s]),E=(0,i.useCallback)(e=>{b(""),l(t=>{let a={...t,...e};return sessionStorage.setItem("systemRecFormData",JSON.stringify(a)),a})},[]),T=async e=>{e.preventDefault(),g(!0);try{let{inServiceArea:e}=await N(s.homeAddress.zip);if(!e){r.push("/residential/en/dealer-locator");return}let t=j();await x(s,t,o);let a=localStorage.getItem("zipcode"),n=s.homeAddress.zip;a!==n&&localStorage.setItem("zipcode",n),r.push("".concat(r.asPath).concat(t))}catch(e){b(e instanceof Error?e.message.charAt(0).toUpperCase()+e.message.slice(1):"An unexpected error occurred. Please check your information and try again."),g(!1)}};return(0,n.jsx)(R.Provider,{value:{formData:s,setFormData:E,submitForm:T,canContinue:h,setCanContinue:p,updateContinue:F,errorMessage:v,isSubmitting:f,flowVariant:a,isServiceArea:c,checkServiceArea:N},children:t})},T=()=>{let e=(0,i.useContext)(R);if(!e)throw Error("useFormContext must be used within a FormProvider");return e};var M=a(98388),Z=e=>{let{label:t,type:a,checked:i,description:r,icon:o,onChange:s,testId:l="SRTWizardBox",name:c,value:d,id:u,className:m}=e;return(0,n.jsxs)("div",{"data-testid":l,className:(0,M.dV)("relative",m),children:[(0,n.jsx)("input",{id:u,type:a,name:c,value:d,className:"peer sr-only",checked:i,onChange:s}),(0,n.jsxs)("label",{htmlFor:u,className:(0,M.dV)("flex h-full flex-row items-center gap-3 rounded-xl border-2 bg-white p-4 md:flex-col md:items-start md:justify-center md:p-6 lg:min-h-36","hover:cursor-pointer hover:border-2 hover:border-black peer-checked:border-black peer-focus:border-sky-600","peer-focus:peer-checked:border-black peer-focus:peer-checked:outline peer-focus:peer-checked:outline-black/40"),children:[o&&(0,n.jsx)("div",{"aria-hidden":"true",className:"",children:o}),(0,n.jsxs)("p",{className:(0,M.dV)("m-0 font-Inter text-sm text-black lg:text-base"),children:[(0,n.jsx)("span",{className:(0,M.dV)("block pb-1 text-16 font-600 md:text-20"),children:t}),r]})]})]})},L=a(93967),O=a.n(L),D=e=>{let{className:t,...a}=e;return(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 32",className:O()("inline-block",t),"aria-label":"Wallet","data-testid":"SRTIconWallet",...a,children:(0,n.jsx)("path",{d:"M7 5.5h18c.797 0 1.5.703 1.5 1.5 0 .844-.703 1.5-1.5 1.5H7.75c-.422 0-.75.375-.75.75 0 .422.328.75.75.75H25c1.64 0 3 1.36 3 3v10.5c0 1.688-1.36 3-3 3H7c-1.688 0-3-1.313-3-3v-15c0-1.64 1.313-3 3-3Zm16.5 11.25c-.844 0-1.5.703-1.5 1.5 0 .844.656 1.5 1.5 1.5.797 0 1.5-.656 1.5-1.5 0-.797-.703-1.5-1.5-1.5Z"})})},P=e=>{let{className:t,...a}=e;return(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 32",className:O()("inline-block",t),"aria-label":"Cogs","data-testid":"SRTIconCogs",...a,children:(0,n.jsx)("path",{d:"m15.438 10.375-1.032.89c.047.329.047.657.047.985 0 .328 0 .656-.047.984l1.031.938c.329.281.47.75.282 1.172a5.611 5.611 0 0 1-.375.75l-.14.234-.423.703a1.1 1.1 0 0 1-1.172.328l-1.312-.468a5.746 5.746 0 0 1-1.735.984l-.28 1.36c-.095.468-.423.796-.845.843-.328.047-.656.047-.984.047-.281 0-.61 0-.937-.047a.948.948 0 0 1-.844-.844l-.328-1.359a6.12 6.12 0 0 1-1.688-.984l-1.312.468a1.1 1.1 0 0 1-1.172-.328c-.14-.234-.328-.468-.469-.703l-.14-.234c-.094-.235-.235-.516-.329-.75a1.006 1.006 0 0 1 .282-1.172l1.03-.938c-.046-.28-.046-.609-.046-.984 0-.328 0-.656.047-.938l-1.031-.937c-.329-.328-.47-.75-.282-1.172.094-.281.235-.515.329-.75l.14-.234c.188-.235.328-.469.469-.703.281-.329.75-.47 1.172-.329l1.312.422a6.831 6.831 0 0 1 1.735-.937l.28-1.406c.095-.422.423-.75.845-.797.328-.047.609-.094.937-.094H8.5c.328 0 .61.047.938.094.421.047.796.375.89.843l.281 1.36c.61.187 1.172.562 1.688.937l1.312-.421c.422-.141.891 0 1.172.328.14.234.328.468.469.703l.14.234c.094.235.235.469.329.75.187.422.047.844-.281 1.172ZM6.25 12.25c0 .844.422 1.547 1.125 1.969.656.422 1.547.422 2.25 0 .656-.422 1.125-1.125 1.125-1.969 0-.797-.469-1.5-1.125-1.922-.703-.422-1.594-.422-2.25 0-.703.422-1.125 1.125-1.125 1.922Zm18.375 15.234-.89-1.03c-.329.046-.657.046-.985.046-.328 0-.656 0-.984-.047l-.938 1.031c-.281.328-.75.47-1.172.282a5.599 5.599 0 0 1-.75-.375l-.234-.141a6.083 6.083 0 0 1-.703-.469c-.328-.234-.469-.703-.328-1.125l.468-1.312a5.747 5.747 0 0 1-.984-1.735l-1.36-.28c-.468-.095-.796-.423-.843-.845-.047-.328-.047-.656-.047-.984 0-.328 0-.61.047-.938.047-.421.375-.796.844-.89l1.359-.281c.234-.61.563-1.172.984-1.688l-.468-1.312a1.1 1.1 0 0 1 .328-1.172c.234-.14.468-.328.703-.469l.234-.14c.235-.094.516-.235.75-.329.422-.187.89-.047 1.172.281l.938 1.032c.28-.047.609-.047.984-.047.328 0 .656 0 .938.047l.937-1.031c.328-.329.797-.47 1.172-.282.281.094.515.235.75.328l.234.141c.235.188.469.328.703.469a1.1 1.1 0 0 1 .328 1.172l-.421 1.312c.375.516.703 1.078.937 1.688l1.406.328c.422.093.75.422.797.843.047.329.094.657.094.985 0 .281-.047.61-.094.937-.047.422-.375.797-.797.844l-1.406.328c-.187.61-.562 1.172-.937 1.688l.422 1.312c.14.422 0 .89-.329 1.172l-.703.422-.234.188c-.235.093-.469.234-.75.328-.422.187-.844.047-1.172-.282ZM22.75 18.25c-.844 0-1.547.469-1.969 1.125-.422.703-.422 1.594 0 2.25.422.703 1.125 1.125 1.969 1.125.797 0 1.5-.422 1.922-1.125.422-.656.422-1.547 0-2.25-.422-.656-1.125-1.125-1.922-1.125Z"})})},B=e=>{let{className:t,...a}=e;return(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 32",className:O()("inline-block",t),"aria-label":"Money Bag","data-testid":"SRTIconMoneyBag",...a,children:(0,n.jsx)("path",{d:"M19 8.5h-6l-2.25-3.328c-.328-.469.047-1.172.61-1.172h9.234c.562 0 .937.703.61 1.172L19 8.5ZM13 10h6c.14.14.375.281.61.422C22.233 12.109 28 15.766 28 23.5c0 2.484-2.016 4.5-4.5 4.5h-15A4.501 4.501 0 0 1 4 23.5c0-7.734 5.719-11.39 8.39-13.078.188-.14.422-.281.61-.422Zm3.938 4.125a.94.94 0 0 0-.938-.938.94.94 0 0 0-.938.938v.656a4.3 4.3 0 0 0-1.078.422c-.656.375-1.218 1.078-1.171 2.063 0 .937.562 1.547 1.124 1.922.516.28 1.172.468 1.688.656h.094c.562.187.984.328 1.312.515.235.141.235.235.235.375.047.235-.047.375-.235.47-.234.187-.61.233-1.031.233-.516 0-.984-.187-1.64-.375-.094-.046-.235-.093-.329-.14-.515-.14-1.031.094-1.172.61a.905.905 0 0 0 .563 1.171c.094.047.187.047.281.094.422.14.844.281 1.313.422v.656a.94.94 0 0 0 .937.938.94.94 0 0 0 .938-.938v-.656a2.77 2.77 0 0 0 1.125-.422c.656-.375 1.172-1.125 1.125-2.11 0-.937-.516-1.546-1.125-1.921-.563-.328-1.22-.563-1.735-.703h-.047c-.609-.188-1.03-.329-1.312-.516-.235-.14-.281-.235-.281-.328 0-.14.093-.282.328-.422.234-.14.61-.235.984-.235.469 0 .938.094 1.453.235a.937.937 0 0 0 1.172-.656c.14-.516-.187-.985-.656-1.125-.328-.094-.656-.188-.985-.235v-.656Z"})})},q=e=>{let{className:t,...a}=e;return(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 32",className:O()("inline-block",t),"aria-label":"Clock","data-testid":"SRTIconClock",...a,children:(0,n.jsx)("path",{d:"M16 4c4.266 0 8.203 2.297 10.36 6 2.156 3.75 2.156 8.297 0 12A11.91 11.91 0 0 1 16 28c-4.313 0-8.25-2.25-10.406-6-2.157-3.703-2.157-8.25 0-12C7.75 6.297 11.687 4 16 4Zm-1.125 5.625V16c0 .375.188.75.469.938l4.5 3c.515.375 1.218.234 1.593-.282.329-.515.188-1.218-.328-1.593l-3.984-2.625V9.625A1.14 1.14 0 0 0 16 8.5a1.11 1.11 0 0 0-1.125 1.125Z"})})},W=e=>{let{className:t,...a}=e;return(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 32",className:O()("inline-block",t),"aria-label":"Shield","data-testid":"SRTIconShield",...a,children:(0,n.jsx)("path",{d:"m16.61 4.14 8.812 3.75c1.031.47 1.828 1.454 1.828 2.673-.047 4.687-1.969 13.171-10.031 17.062a2.884 2.884 0 0 1-2.485 0C6.672 23.735 4.75 15.25 4.75 10.562c-.047-1.218.75-2.203 1.781-2.671l8.813-3.75a1.497 1.497 0 0 1 1.265 0Zm4.687 9.657h-.047c.469-.422.469-1.125 0-1.594a1.103 1.103 0 0 0-1.547 0l-5.203 5.25-2.203-2.203c-.469-.469-1.172-.469-1.594 0a1.027 1.027 0 0 0 0 1.547l3 3c.422.469 1.125.469 1.594 0l6-6Z"})})},V=a(46157),G=e=>{var t,a,i,r,o,s,l,u,m,h,p,v;let{insideModalChanged:b,setInsideModalChanged:f}=e,{formData:g,setFormData:y,canContinue:x,setCanContinue:S}=T(),w=e=>{var t,a;if(null==g?void 0:null===(t=g.buyingFactors)||void 0===t?void 0:t.includes(e.target.value)){let t=g.buyingFactors.filter(t=>t!==e.target.value);y({buyingFactors:t}),t.length>0&&!x&&S(!0),0===t.length&&S(!1)}else y({buyingFactors:[...null!==(a=null==g?void 0:g.buyingFactors)&&void 0!==a?a:[],e.target.value]}),S(!0);!1===b&&f&&f(!0)};return(0,n.jsxs)("div",{children:[(0,n.jsx)(d.Z,{children:"Which of these are most important to you?"}),(0,n.jsx)(c.Z,{children:"Select all that apply to you"}),(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-4 px-1 md:grid-cols-2 md:gap-6",children:[(0,n.jsx)(Z,{type:"checkbox",label:"Lowest cost",description:"Budget friendly",name:"Lowest cost",id:"lowest-cost",icon:(0,n.jsx)(D,{fill:"black",height:32,width:32}),value:"Lowest cost",onChange:w,checked:null!==(l=null==g?void 0:null===(t=g.buyingFactors)||void 0===t?void 0:t.includes("Lowest cost"))&&void 0!==l&&l}),(0,n.jsx)(Z,{type:"checkbox",label:"Efficiency",description:"System efficiency",name:"Efficiency",id:"efficiency",icon:(0,n.jsx)(P,{fill:"black",height:32,width:32}),value:"Efficiency",onChange:w,checked:null!==(u=null==g?void 0:null===(a=g.buyingFactors)||void 0===a?void 0:a.includes("Efficiency"))&&void 0!==u&&u}),(0,n.jsx)(Z,{type:"checkbox",label:"Financing",description:"Monthly payments",name:"Financing",id:"financing",icon:(0,n.jsx)(B,{fill:"black",height:32,width:32}),value:"Financing",onChange:w,checked:null!==(m=null==g?void 0:null===(i=g.buyingFactors)||void 0===i?void 0:i.includes("Financing"))&&void 0!==m&&m}),(0,n.jsx)(Z,{type:"checkbox",label:"Availability",description:"First system available",name:"Availability",id:"availability",icon:(0,n.jsx)(q,{fill:"black",height:32,width:32}),value:"Availability",onChange:w,checked:null!==(h=null==g?void 0:null===(r=g.buyingFactors)||void 0===r?void 0:r.includes("Availability"))&&void 0!==h&&h}),(0,n.jsx)(Z,{type:"checkbox",label:"Reliability",description:"Made to last",name:"Reliability",id:"reliability",icon:(0,n.jsx)(W,{fill:"black",height:32,width:32}),value:"Reliability",onChange:w,checked:null!==(p=null==g?void 0:null===(o=g.buyingFactors)||void 0===o?void 0:o.includes("Reliability"))&&void 0!==p&&p}),(0,n.jsx)(Z,{type:"checkbox",label:"Eco-friendly",description:"Green systems",name:"Eco-friendly",id:"eco-friendly",icon:(0,n.jsx)(V.y,{fill:"black",height:32,width:32}),value:"Eco-friendly",onChange:w,checked:null!==(v=null==g?void 0:null===(s=g.buyingFactors)||void 0===s?void 0:s.includes("Eco-friendly"))&&void 0!==v&&v})]})]})},H=a(48170),K=a.n(H),Y=e=>{let{value:t,onChange:a,min:i,max:r,step:o,id:s="input-slider",label:l}=e;return(0,n.jsxs)("div",{className:"flex h-max justify-center","data-testid":"SRTInputSlider",children:[(0,n.jsx)("label",{htmlFor:s,className:"sr-only",children:l}),(0,n.jsx)("input",{id:s,type:"range",min:i,max:r,step:o,value:t,onChange:a,className:"".concat(K().traneSlider," flex h-4 w-full cursor-pointer appearance-none bg-none")})]})},J=()=>{var e;let{formData:t,setFormData:a,setCanContinue:r}=T(),[o,s]=(0,i.useState)("1200"),l=(0,i.useMemo)(()=>({1200:"0 - 1,200",1500:"1,200 - 1,500",1800:"1,500 - 1,800",2100:"1,800 - 2,100",2400:"2,100 - 2,400",2700:"2,400 - 2,700",3e3:"2,700 - 3,000",3300:"3,000+"}),[]);return(0,i.useEffect)(()=>{if(null==t?void 0:t.homeSize){var e;s(null!==(e=Object.keys(l).find(e=>l[e]===t.homeSize))&&void 0!==e?e:"1200")}},[null==t?void 0:t.homeSize,l]),(null==t?void 0:t.homeSize)||(a({homeSize:l["1200"]}),r(!0)),(0,n.jsxs)("div",{children:[(0,n.jsx)(d.Z,{children:"What size is your home?"}),(0,n.jsx)(c.Z,{children:"This helps us properly size your system"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-center font-Inter text-20 font-700",children:null!==(e=null==t?void 0:t.homeSize)&&void 0!==e?e:"0 - 1,200"}),(0,n.jsx)(Y,{id:"home-size-slider",label:"How big is your home?",value:o,onChange:e=>{let t=e.target.value;s(t),r(!!t),a({homeSize:l[t]})},min:"1200",max:"3300",step:"300"}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("label",{htmlFor:"home-size-slider",className:"font-Inter text-12 text-dim-gray",children:"Square feet"}),(0,n.jsx)("span",{className:"font-Inter text-12 text-dim-gray",children:"3,000+"})]})]})]})};let U=O()("relative w-full"),Q=O()("peer min-h-14 w-full rounded-xl border border-slate-300 px-3 pb-2 pt-6 text-base font-normal text-slate-500 outline-none focus:border-sky-600 focus:text-black disabled:bg-slate-100 disabled:text-slate-400 [&:not(:focus):not(:placeholder-shown)]:invalid:border-pink-600"),X=O()("absolute left-3 top-0 block origin-top-left translate-y-2 scale-75 transform text-base font-normal text-slate-500 transition-transform duration-200 peer-placeholder-shown:translate-x-0 peer-placeholder-shown:translate-y-4 peer-placeholder-shown:scale-100 peer-focus:translate-y-2 peer-focus:scale-75 peer-disabled:text-slate-400"),$=O()("mt-2 flex justify-between px-3"),ee=O()("text-xs font-normal text-slate-500"),et=O()("shrink-0 text-xs font-normal text-slate-500");var ea=e=>{let{message:t,errorClassName:a,messageClassName:i,messageNode:r,id:o}=e;return t||r?void 0!==r?(0,n.jsx)("div",{role:"alert","data-testid":"SRTErrorMessage",className:a,id:o,children:r}):(0,n.jsx)("div",{className:a,"data-testid":"SRTErrorMessage",children:(0,n.jsxs)("p",{role:"alert",className:i,id:o,children:["❗ ",t]})}):null},en=e=>{let{testId:t="SRTInputText",autoComplete:a="off",id:r,label:o,maxLength:s,minLength:l,name:c,onBlur:d,onChange:u,onKeyDown:m,disabled:h=!1,pattern:p,helperText:v,error:b,required:f=!1,value:g,fieldsetProps:y,inputProps:x,labelProps:S,contextRowProps:w,fieldsetClassName:_,labelClassName:j,inputClassName:C,contextRowClassName:N,...k}=e,[z,I]=(0,i.useState)(0),F=p?p.toString():void 0,A=(0,i.useCallback)(e=>{I(e.target.value.length),u&&u(e)},[u]);return(0,n.jsxs)("fieldset",{...y,className:O()(_,U),"data-testid":t+"-FieldSet",...k,children:[(0,n.jsx)("input",{...x,className:O()(C,Q,{"!border-pink-600":b}),autoComplete:a,id:r,name:c,onBlur:d,onChange:A,onKeyDown:m,placeholder:" ",type:"text",value:g,disabled:h,required:f,"aria-required":f,pattern:F,minLength:l,maxLength:s,"data-testid":t,"aria-describedby":"".concat(r,"-error-tool-tip")}),(0,n.jsx)("label",{...S,htmlFor:r,className:O()(j,X),children:o}),(v||s)&&(0,n.jsxs)("div",{...w,className:O()(N,$),children:[(0,n.jsx)("p",{className:O()(ee),children:v}),(0,n.jsxs)("p",{className:O()(et,{"ml-auto":!v,hidden:!s}),children:[z,"/",s]})]}),(0,n.jsx)(ea,{id:"".concat(r,"-error-tool-tip"),message:b})]})},ei=a(2945),er=e=>{let{insideModalChanged:t,setInsideModalChanged:a}=e,{formData:i,setFormData:r,setCanContinue:o}=T(),[,s]=(0,ei.Z)(),l=e=>{let n=e.target.value;"phone"===e.target.name&&((n=n.replace(/\D/g,"")).length>10&&n.startsWith("1")&&(n=n.substring(1)),n=n.substring(0,10));let l={...i.contactInfo,[e.target.name]:n};r({contactInfo:l}),"callTime"!==e.target.name&&s(e.target.name,n),o(C(l).success),!1===t&&a&&a(!0)};return(0,n.jsxs)("div",{children:[(0,n.jsx)(d.Z,{children:"Enter your contact info"}),(0,n.jsx)(c.Z,{children:"To view your recommendation, please provide your contact information. From here, your local pro will reach out to schedule a home consultation. You won't be signed up for anything."}),(0,n.jsxs)("div",{className:"mx-auto grid w-full max-w-411 gap-4",children:[(0,n.jsx)(en,{id:"firstName",label:"First name",name:"firstName",onChange:l,required:!0,inputClassName:"w-full text-slate-500",autoComplete:"given-name",value:i.contactInfo.firstName}),(0,n.jsx)(en,{id:"lastName",label:"Last name",name:"lastName",onChange:l,required:!0,inputClassName:"w-full text-slate-500",autoComplete:"family-name",value:i.contactInfo.lastName}),(0,n.jsx)(en,{id:"email",label:"Email",name:"email",onChange:l,required:!0,inputClassName:"w-full text-slate-500",autoComplete:"email",value:i.contactInfo.email}),(0,n.jsx)(en,{id:"phone",label:"Phone number",name:"phone",onChange:l,required:!0,inputClassName:"w-full text-slate-500",autoComplete:"tel",value:i.contactInfo.phone,minLength:10}),(0,n.jsx)(en,{id:"call-time",label:"Best time to call",name:"callTime",onChange:l,inputClassName:"w-full text-slate-500 mb-4",autoComplete:"off",value:i.contactInfo.callTime})]}),(0,n.jsx)("p",{className:"text-10 font-400 leading-4 text-dim-gray",children:'By pressing the "Continue" button, I consent to receive a phone call about products and services from a dealer at the phone number(s) provided. I understand these calls may be generated using automated technology and my consent does not imply or require that a purchase be made.'})]})};let eo=O()("relative w-full"),es=O()("peer min-h-14 w-full rounded-xl border border-slate-300 px-3 pb-2 pt-6 text-base font-normal text-slate-500 outline-none focus:border-sky-600 focus:text-black disabled:bg-slate-100 disabled:text-slate-400 [&:not(:focus):not(:placeholder-shown)]:invalid:border-pink-600"),el=O()("absolute left-3 top-0 block origin-top-left translate-y-2 scale-75 transform text-base font-normal text-slate-500 transition-transform duration-200 peer-placeholder-shown:translate-x-0 peer-placeholder-shown:translate-y-4 peer-placeholder-shown:scale-100 peer-focus:translate-y-2 peer-focus:scale-75 peer-disabled:text-slate-400"),ec=O()("mt-2 flex justify-between px-3"),ed=O()("text-xs font-normal text-slate-500");var eu=e=>{let{testId:t="SRTSelectInput",autoComplete:a="off",id:i,label:r,name:o,onBlur:s,onChange:l,onKeyDown:c,disabled:d=!1,helperText:u,error:m,required:h=!1,value:p,children:v,fieldsetProps:b,selectProps:f,labelProps:g,contextRowProps:y,fieldsetClassName:x,labelClassName:S,selectClassName:w,contextRowClassName:_,...j}=e;return(0,n.jsxs)("fieldset",{...b,className:O()(x,eo),"data-testid":t+"-FieldSet",...j,children:[(0,n.jsx)("select",{...f,className:O()(w,es,{"!border-pink-600":m}),autoComplete:a,id:i,name:o,value:p,disabled:d,required:h,"aria-required":h,"data-testid":t,"aria-describedby":"".concat(i,"-error-tool-tip"),onBlur:s,onChange:l,onKeyDown:c,children:v}),(0,n.jsx)("label",{...g,htmlFor:i,className:O()(S,el),children:r}),u&&(0,n.jsx)("div",{...y,className:O()(_,ec),children:(0,n.jsx)("p",{className:O()(ed),children:u})}),(0,n.jsx)(ea,{id:"".concat(i,"-error-tool-tip"),message:m})]})},em=a(1445),eh=e=>{let{insideModalChanged:t,setInsideModalChanged:a}=e,{formData:r,setFormData:o,setCanContinue:s,checkServiceArea:l}=T(),[,u]=(0,ei.Z)(),[m,h]=(0,i.useState)(r.homeAddress),{handleChange:p,setInputRef:v,GoogleMapsScript:b}=(0,em.Z)({externalSetState:h}),f=(0,i.useCallback)(e=>k(e).success,[]);(0,i.useEffect)(()=>{(m.addressLine1!==r.homeAddress.addressLine1||m.city!==r.homeAddress.city||m.state!==r.homeAddress.state||m.zip!==r.homeAddress.zip)&&(l(m.zip||""),o({homeAddress:m}),u("addressLine1",m.addressLine1||""),u("city",m.city||""),u("state",m.state||""),u("zip",m.zip||""),!1===t&&a&&a(!0),s(f(m)))},[m,r.homeAddress,o,u,l,t,a,f,s]);let g=e=>{p(e)};return(0,n.jsxs)("div",{children:[(0,n.jsx)(b,{}),(0,n.jsx)(d.Z,{children:"Enter your home address"}),(0,n.jsx)(c.Z,{children:"This helps us provide pricing for your area"}),(0,n.jsxs)("div",{className:"mx-auto w-full max-w-411",children:[(0,n.jsx)("div",{ref:e=>{let t=null==e?void 0:e.querySelector("input");t&&v(t)},children:(0,n.jsx)(en,{id:"address",label:"Street Address",name:"addressLine1",value:m.addressLine1,onChange:g,inputClassName:"w-full text-slate-500 mb-6",autoComplete:"address-line1"})}),(0,n.jsx)(en,{id:"city",label:"City",name:"city",value:m.city,onChange:g,inputClassName:"w-full text-slate-500 mb-6",autoComplete:"address-level2"}),(0,n.jsxs)(eu,{id:"state",label:"State",name:"state",value:m.state,onChange:g,selectClassName:"w-full text-slate-500 mb-6",children:[(0,n.jsx)("option",{value:"",disabled:!0,children:"Select a state"}),F.Z.map(e=>(0,n.jsx)("option",{value:e.abbreviation,children:e.name},e.abbreviation))]}),(0,n.jsx)(en,{id:"zip",label:"Zipcode",name:"zip",value:m.zip,autoComplete:"postal-code",onChange:g,fieldsetClassName:"grid",inputClassName:"w-full text-slate-500 mb-6"})]})]})},ep=a(14889),ev=a(25014);let eb={default:["homeSize","buyingFactors","homeAddress","contactInfo"]};var ef=a(16829),eg=e=>{let{setInsideModalChanged:t,insideModalChanged:a}=e,[r,o]=(0,i.useState)("homeSize"),[s,l]=(0,i.useState)(0),{formData:c,canContinue:d,setCanContinue:u,submitForm:m,updateContinue:h,errorMessage:p,isSubmitting:v,flowVariant:b,isServiceArea:f}=T(),g=eb[b].length;0!==s||d||u(!0);let y=e=>{if(window.dataLayer){let t={homeSize:{event:"sys_home_size",sys_selection:c.homeSize,vwo:{experience_number:"151",variant:b}},buyingFactors:{event:"sys_buying_factors",sys_selection:c.buyingFactors,vwo:{experience_number:"151",variant:b}},homeAddress:{event:"sys_home_address",sys_selection:c.homeAddress,vwo:{experience_number:"151",variant:b}},contactInfo:{event:"sys_contact_info",sys_selection:c.contactInfo,vwo:{experience_number:"151",variant:b}},isServiceArea:{event:"sys_service_area",sys_selection:f,vwo:{experience_number:"151",variant:b}}}[eb[b][e]];t&&(Array.isArray(t.sys_selection)?window.dataLayer.push({...t,sys_selection:[...t.sys_selection]}):window.dataLayer.push(t))}};return(0,n.jsxs)("form",{id:"system-recommendation-flow",onSubmit:e=>{e.preventDefault(),y(s),m(e)},"data-testid":"SRTSystemRecommendationFlow",children:[(0,n.jsxs)("div",{className:"h-[70vh] overflow-y-auto text-left",children:["homeSize"===r&&(0,n.jsx)(J,{}),"buyingFactors"===r&&(0,n.jsx)(G,{insideModalChanged:a,setInsideModalChanged:t}),"homeAddress"===r&&(0,n.jsx)(eh,{insideModalChanged:a,setInsideModalChanged:t}),"contactInfo"===r&&(0,n.jsx)(er,{insideModalChanged:a,setInsideModalChanged:t})]}),""!==p&&(0,n.jsx)("div",{className:"-mb-5 text-right text-red-700",children:p}),(0,n.jsxs)("div",{className:"sticky bottom-8 grid grid-cols-2 bg-gradient-to-t from-white from-60% pt-16 md:py-10",children:[0!==s&&(0,n.jsx)(ep.Z,{onClick:function(e){if(e.preventDefault(),s<1)return;let n=s-1;l(n),o(eb[b][n]),h(eb[b][n]),!1===a&&t&&t(!0)},variant:"secondary",position:"left",className:"w-max","data-position":"body","data-location":"popup","data-action":"form entry","data-text":"Back","data-type":"button","data-text-grouping":"System Recommendation Flow",children:"Back"}),(0,n.jsx)(ep.Z,{type:s=g-1)return;let n=s+1;l(n),o(eb[b][n]),h(eb[b][n]),!1===a&&t&&t(!0)}:void 0,disabled:!d||v,position:"right",className:(0,ef.Z)("col-start-2 w-max place-self-end",d?"flex":"hidden"),"data-position":"body","data-location":"popup","data-action":"form entry","data-text":"Continue","data-type":"button","data-text-grouping":"System Recommendation Flow",children:v?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ev.Z,{smallVersion:!0,noText:!0}),"Submitting..."]}):"Continue"}),(0,n.jsxs)("span",{className:"col-start-2 row-start-2 mt-2 flex justify-end",children:["Step ",s+1," / ",g]})]})]})};function ey(e){var t,a;let[c,d]=(0,i.useState)(!1),[u,m]=(0,i.useState)(!0),{trackingPosition:h,buttonClass:p,button_variant:v="",button_size:b,buttonTitle:f,modal_design:g,modalTitle:y,disableBase:x,dataTrackingProps:S}=null!==(a=null===(t=e.attributes)||void 0===t?void 0:t.data)&&void 0!==a?a:{},w=(0,i.useMemo)(()=>({blocks:e.innerBlocks}),[e.innerBlocks]);return(0,n.jsxs)("div",{children:["normal"===g&&(0,n.jsx)(o.Z,{onClose:()=>d(!1),show:c,title:y,customDimensions:"px-4 pb-14 rounded-lg sm:px-16",modalWidth:"w-[95vw] sm:w-max",modalHeight:"h-max",children:(0,n.jsx)("div",{children:(0,n.jsx)(s.Z,{...w})})}),"bottom"===g&&(0,n.jsx)(l.Z,{show:c,onClose:()=>d(!1),title:y,children:(0,n.jsx)(s.Z,{...w})}),"system"===g&&(0,n.jsx)(l.Z,{show:c,onClose:()=>d(!1),title:y||"Find Your Perfect System",insideModalChanged:u,setInsideModalChanged:m,systemRecommendation:!0,children:(0,n.jsx)(E,{children:(0,n.jsx)(eg,{insideModalChanged:u,setInsideModalChanged:m})})}),(0,n.jsx)("div",{children:(0,n.jsx)(r.Z,{trackingPosition:h,disableBase:!0===x,addClass:p,[v]:!0,size:b,onClick:()=>d(!0),dataTrackingProps:S,children:f})})]})}},85633:function(e,t,a){"use strict";var n=a(85893),i=a(40645),r=a.n(i),o=a(4298),s=a.n(o);t.Z=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s(),{src:"https://maps.googleapis.com/maps/api/js?key=".concat("AIzaSyC6moVjL3cGFX4KPeCqxNrGvLhFbMg2mJY","&libraries=places"),strategy:"lazyOnload",onError:e=>{console.error("Failed to load Google Maps script:",e)}}),(0,n.jsx)(r(),{id:"585f46826ef3bd87",children:".pac-container{z-index:10000!important;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 4px 6px -1px rgba(0,0,0,.1);-moz-box-shadow:0 4px 6px -1px rgba(0,0,0,.1);box-shadow:0 4px 6px -1px rgba(0,0,0,.1)}.pac-item{padding:8px 12px;cursor:pointer}.pac-item:hover{background-color:#f3f4f6}"})]})},1445:function(e,t,a){"use strict";a.d(t,{Z:function(){return u}});var n=a(67294);let i=()=>{var e,t,a;return!!(null===(a=window.google)||void 0===a?void 0:null===(t=a.maps)||void 0===t?void 0:null===(e=t.places)||void 0===e?void 0:e.Autocomplete)},r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return new Promise((t,a)=>{if(i()){t();return}let n=Date.now(),r=()=>{if(i()){t();return}if(Date.now()-n>=e){a(Error("Google Maps failed to load. Ensure GoogleMapsScript component is mounted."));return}setTimeout(r,100)};r()})},o=async(e,t,a,n)=>{let i=t.current;if(i)try{await r(),e.current=new google.maps.places.Autocomplete(i,{types:["address"],componentRestrictions:{country:["us","ca"]}});let t=s(e,a,n);return()=>{if(t)try{google.maps.event.removeListener(t)}catch(e){console.error("Error removing Google Maps listener:",e)}e.current=null}}catch(e){console.error("Failed to initialize Google Places Autocomplete:",e)}},s=(e,t,a)=>{if(!e.current)return null;let n=e=>{var n,i,r,o,s;if(!(null==e?void 0:e.address_components))return;let l=function(e){let t={};return e.address_components.forEach(e=>{e.types.forEach(a=>{"administrative_area_level_1"===a?t[a]=e.short_name:t[a]=e.long_name})}),t}(e),c={addressLine1:"".concat(null!==(n=l.street_number)&&void 0!==n?n:""," ").concat(null!==(i=l.route)&&void 0!==i?i:"").trim(),city:null!==(r=l.locality)&&void 0!==r?r:"",state:null!==(o=l.administrative_area_level_1)&&void 0!==o?o:"",zip:null!==(s=l.postal_code)&&void 0!==s?s:""};t(e=>({...e,...c})),null==a||a(c)};return e.current.addListener("place_changed",()=>{var t;n(null===(t=e.current)||void 0===t?void 0:t.getPlace())})},l=(e,t)=>{let{name:a,value:n}=e.currentTarget;t(e=>({...e,[a]:n}))};var c=a(85633);let d=e=>{setTimeout(()=>{e.forEach(e=>{let t=document.querySelector('[name="'.concat(e,'"]'));if(t){let e=new Event("change",{bubbles:!0});t.dispatchEvent(e)}})},100)};function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{enabled:t=!0,externalSetState:a,validationFieldNames:i}=e,[r,s]=(0,n.useState)({addressLine1:"",city:"",state:"",zip:""}),[u,m]=(0,n.useState)(null),h=(0,n.useMemo)(()=>null!=a?a:s,[a]),p=a?void 0:r,v=(0,n.useRef)(null),b=(0,n.useRef)(null),f=(0,n.useCallback)(e=>{b.current=e,m(e)},[]),g=(0,n.useCallback)(()=>{(null==i?void 0:i.length)&&d(i)},[i]);return(0,n.useEffect)(()=>{let e={current:void 0};return t&&u&&o(v,b,h,g).then(t=>{e.current=t}).catch(e=>{console.error("Failed to initialize autocomplete:",e)}),()=>{var t;null===(t=e.current)||void 0===t||t.call(e)}},[t,u,h,g]),{address:p,setAddress:h,handleChange:e=>{l(e,h)},setInputRef:f,autocompleteRef:v,GoogleMapsScript:c.Z}}},72367:function(e,t,a){"use strict";a.d(t,{t:function(){return n}});let n=e=>fetch("https://api.weatherapi.com/v1/current.json?key=f159ef9519104e88ac7173827233005&q=".concat(e,"&aqi=no")).then(e=>e.json()).catch(e=>(console.error&&console.error("Exception in fetchWeather: ".concat(e.message||e)),e))},97631:function(e,t){"use strict";t.Z=[{abbreviation:"AB",name:"Alberta"},{abbreviation:"AK",name:"Alaska"},{abbreviation:"AL",name:"Alabama"},{abbreviation:"AR",name:"Arkansas"},{abbreviation:"AZ",name:"Arizona"},{abbreviation:"BC",name:"British Columbia"},{abbreviation:"CA",name:"California"},{abbreviation:"CO",name:"Colorado"},{abbreviation:"CT",name:"Connecticut"},{abbreviation:"DC",name:"District Of Columbia"},{abbreviation:"DE",name:"Delaware"},{abbreviation:"FL",name:"Florida"},{abbreviation:"GA",name:"Georgia"},{abbreviation:"HI",name:"Hawaii"},{abbreviation:"IA",name:"Iowa"},{abbreviation:"ID",name:"Idaho"},{abbreviation:"IL",name:"Illinois"},{abbreviation:"IN",name:"Indiana"},{abbreviation:"KS",name:"Kansas"},{abbreviation:"KY",name:"Kentucky"},{abbreviation:"LA",name:"Louisiana"},{abbreviation:"MA",name:"Massachusetts"},{abbreviation:"MB",name:"Manitoba"},{abbreviation:"MD",name:"Maryland"},{abbreviation:"ME",name:"Maine"},{abbreviation:"MI",name:"Michigan"},{abbreviation:"MN",name:"Minnesota"},{abbreviation:"MO",name:"Missouri"},{abbreviation:"MS",name:"Mississippi"},{abbreviation:"MT",name:"Montana"},{abbreviation:"NB",name:"New Brunswick"},{abbreviation:"NC",name:"North Carolina"},{abbreviation:"ND",name:"North Dakota"},{abbreviation:"NE",name:"Nebraska"},{abbreviation:"NH",name:"New Hampshire"},{abbreviation:"NJ",name:"New Jersey"},{abbreviation:"NL",name:"Newfoundland and Labrador"},{abbreviation:"NM",name:"New Mexico"},{abbreviation:"NS",name:"Nova Scotia"},{abbreviation:"NT",name:"Northwest Territories"},{abbreviation:"NU",name:"Nunavut"},{abbreviation:"NV",name:"Nevada"},{abbreviation:"NY",name:"New York"},{abbreviation:"OH",name:"Ohio"},{abbreviation:"OK",name:"Oklahoma"},{abbreviation:"ON",name:"Ontario"},{abbreviation:"OR",name:"Oregon"},{abbreviation:"PA",name:"Pennsylvania"},{abbreviation:"PE",name:"Prince Edward Island"},{abbreviation:"QC",name:"Quebec"},{abbreviation:"RI",name:"Rhode Island"},{abbreviation:"SC",name:"South Carolina"},{abbreviation:"SD",name:"South Dakota"},{abbreviation:"SK",name:"Saskatchewan"},{abbreviation:"TN",name:"Tennessee"},{abbreviation:"TX",name:"Texas"},{abbreviation:"UT",name:"Utah"},{abbreviation:"VA",name:"Virginia"},{abbreviation:"VT",name:"Vermont"},{abbreviation:"WA",name:"Washington"},{abbreviation:"WI",name:"Wisconsin"},{abbreviation:"WV",name:"West Virginia"},{abbreviation:"WY",name:"Wyoming"},{abbreviation:"YT",name:"Yukon"}]},41207:function(e,t,a){"use strict";a.d(t,{N:function(){return n}});let n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};window&&window.NREUM&&window.NREUM.noticeError(e,{...t,noticed:!0})}},7443:function(e,t,a){"use strict";var n=a(34155);a(91479);var i=a(67294),r=i&&"object"==typeof i&&"default"in i?i:{default:i},o=void 0!==n&&n.env&&!0,s=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,a=t.name,n=void 0===a?"stylesheet":a,i=t.optimizeForSpeed,r=void 0===i?o:i;c(s(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",c("boolean"==typeof r,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=r,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l=document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t=e.prototype;return t.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(o||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,a){return"number"==typeof a?e._serverSheet.cssRules[a]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),a},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t>>0},u={};function m(e,t){if(!t)return"jsx-"+e;var a=String(t),n=e+a;return u[n]||(u[n]="jsx-"+d(e+"-"+a)),u[n]}function h(e,t){var a=e+t;return u[a]||(u[a]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[a]}var p=function(){function e(e){var t=void 0===e?{}:e,a=t.styleSheet,n=void 0===a?null:a,i=t.optimizeForSpeed,r=void 0!==i&&i;this._sheet=n||new l({name:"styled-jsx",optimizeForSpeed:r}),this._sheet.inject(),n&&"boolean"==typeof r&&(this._sheet.setOptimizeForSpeed(r),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var a=this.getIdAndRules(e),n=a.styleId,i=a.rules;if(n in this._instancesCounts){this._instancesCounts[n]+=1;return}var r=i.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[n]=r,this._instancesCounts[n]=1},t.remove=function(e){var t=this,a=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(a in this._instancesCounts,"styleId: `"+a+"` not found"),this._instancesCounts[a]-=1,this._instancesCounts[a]<1){var n=this._fromServer&&this._fromServer[a];n?(n.parentNode.removeChild(n),delete this._fromServer[a]):(this._indices[a].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[a]),delete this._instancesCounts[a]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],a=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return a[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,a;return t=this.cssRules(),void 0===(a=e)&&(a={}),t.map(function(e){var t=e[0],n=e[1];return r.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:a.nonce?a.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})},t.getIdAndRules=function(e){var t=e.children,a=e.dynamic,n=e.id;if(a){var i=m(n,a);return{styleId:i,rules:Array.isArray(t)?t.map(function(e){return h(i,e)}):[h(i,t)]}}return{styleId:m(n),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),v=i.createContext(null);v.displayName="StyleSheetContext";var b=r.default.useInsertionEffect||r.default.useLayoutEffect,f=new p;function g(e){var t=f||i.useContext(v);return t&&b(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)]),null}g.dynamic=function(e){return e.map(function(e){return m(e[0],e[1])}).join(" ")},t.style=g},40645:function(e,t,a){"use strict";e.exports=a(7443).style},91479:function(){},48170:function(e){e.exports={traneSlider:"InputSlider_traneSlider__Fk7KY"}}}]);