1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[214],{214:(e,t,n)=>{n.d(t,{AuthProvider:()=>b,A:()=>y});var a=n(5155),i=n(2115),r=n(7886),o=n(960),l=n(8537),s=n(756),c=n(4026);let d="https://api.apexcharts.com",u={"sales-review":{title:"Create an account to request a custom quote",body:"Sign up takes 10 seconds. We'll attach your quote to this account so you can view, pay, and download the PDF from one place."}};function m(){return(0,a.jsxs)("svg",{viewBox:"0 0 48 48",width:"20",height:"20","aria-hidden":"true",focusable:"false",children:[(0,a.jsx)("path",{fill:"#4285F4",d:"M45.12 24.5c0-1.56-.14-3.06-.4-4.5H24v8.51h11.84c-.51 2.75-2.06 5.08-4.39 6.64v5.52h7.11c4.16-3.83 6.56-9.47 6.56-16.17z"}),(0,a.jsx)("path",{fill:"#34A853",d:"M24 46c5.94 0 10.92-1.97 14.56-5.33l-7.11-5.52c-1.97 1.32-4.49 2.1-7.45 2.1-5.73 0-10.58-3.87-12.31-9.07H4.34v5.7C7.96 41.07 15.4 46 24 46z"}),(0,a.jsx)("path",{fill:"#FBBC05",d:"M11.69 28.18C11.25 26.86 11 25.45 11 24s.25-2.86.69-4.18v-5.7H4.34C2.85 17.09 2 20.45 2 24s.85 6.91 2.34 9.88l7.35-5.7z"}),(0,a.jsx)("path",{fill:"#EA4335",d:"M24 10.75c3.23 0 6.13 1.11 8.41 3.29l6.31-6.31C34.91 4.18 29.93 2 24 2 15.4 2 7.96 6.93 4.34 14.12l7.35 5.7c1.73-5.2 6.58-9.07 12.31-9.07z"})]})}function p(){return(0,a.jsxs)("svg",{viewBox:"0 0 21 21",width:"20",height:"20","aria-hidden":"true",focusable:"false",children:[(0,a.jsx)("rect",{x:"1",y:"1",width:"9",height:"9",fill:"#F25022"}),(0,a.jsx)("rect",{x:"11",y:"1",width:"9",height:"9",fill:"#7FBA00"}),(0,a.jsx)("rect",{x:"1",y:"11",width:"9",height:"9",fill:"#00A4EF"}),(0,a.jsx)("rect",{x:"11",y:"11",width:"9",height:"9",fill:"#FFB900"})]})}function h(e){let{onSocial:t}=e;return(0,a.jsxs)("div",{className:"social-buttons",children:[(0,a.jsxs)("button",{className:"social-btn google-btn",onClick:()=>t("google"),type:"button",children:[(0,a.jsx)(m,{}),"Continue with Google"]}),(0,a.jsxs)("button",{className:"social-btn microsoft-btn",onClick:()=>t("microsoft"),type:"button",children:[(0,a.jsx)(p,{}),"Continue with Microsoft"]})]})}function f(e){let{isOpen:t,onClose:n,initialTab:r="login",context:o}=e,[m,p]=(0,i.useState)(r),[f,g]=(0,i.useState)(!1);(0,i.useEffect)(()=>{t&&(p(r),g(!1))},[t,r]);let b=o?u[o]:null,[v,x]=(0,i.useState)(!1),[w,j]=(0,i.useState)(null),{loginWithToken:_}=y(),k=(0,i.useCallback)(e=>{if(e.origin!==d)return;let t=e.data;if((null==t?void 0:t.type)==="OAUTH_SUCCESS"&&t.token){let e=t.user||{};_(t.token,{email:e.email||"",displayName:e.display_name||e.email||"",display_name:e.display_name||e.email||"",is_admin:!!e.is_admin})}else(null==t?void 0:t.type)==="OAUTH_ERROR"&&j({text:t.message||"Social login failed",type:"error"})},[_]);async function S(e){e.preventDefault(),x(!0),j(null);let t=e.currentTarget,n=t.elements.namedItem("login-email").value,a=t.elements.namedItem("login-password").value;try{let e=await fetch("".concat(d,"/api/authenticate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:n,password:a,connected_social_account_type:"DIRECT",stripe_env:(0,c.jF)()})}),t=await e.json();if(e.ok&&t.token){let e=t.data||t.user||{};_(t.token,{email:e.email||n,displayName:e.display_name||n,display_name:e.display_name||n,is_admin:!!e.is_admin})}else j({text:t.message||"Login failed",type:"error"})}catch(e){j({text:"An error occurred. Please try again.",type:"error"})}finally{x(!1)}}async function N(e){var t,n;e.preventDefault(),x(!0),j(null);let a=e.currentTarget,i=a.elements.namedItem("register-name").value,r=a.elements.namedItem("register-email").value,o=a.elements.namedItem("register-password").value,l=null!=(n=null==(t=a.elements.namedItem("register-newsletter"))?void 0:t.checked)&&n;try{let e=await fetch("".concat(d,"/api/authenticate/register"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({display_name:i,email:r,password:o,stripe_env:(0,c.jF)()})}),t=await e.json();if(e.ok&&t.token){l&&fetch("".concat(d,"/api/subscribe"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r})}).catch(()=>{});let e=t.data||t.user||{};_(t.token,{email:e.email||r,displayName:e.display_name||i,display_name:e.display_name||i,is_admin:!!e.is_admin})}else j({text:t.message||"Registration failed",type:"error"})}catch(e){j({text:"An error occurred. Please try again.",type:"error"})}finally{x(!1)}}async function C(e){e.preventDefault(),x(!0),j(null);let t=e.currentTarget.elements.namedItem("forgot-email").value;try{let e=await fetch("".concat(d,"/api/authenticate/social/forgot-password"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t})}),n=await e.json().catch(()=>({}));e.ok?j({text:n.message||"If an account with that email exists, a reset link has been sent.",type:"success"}):j({text:n.message||"Failed to send reset link",type:"error"})}catch(e){j({text:"An error occurred. Please try again.",type:"error"})}finally{x(!1)}}async function E(e){try{let t,n=await fetch("".concat(d,"/api/authenticate/social/config"));if(!n.ok)return void j({text:"Failed to load OAuth configuration",type:"error"});let a=(await n.json())[e];if(!(null==a?void 0:a.client_id))return void j({text:"".concat(e," OAuth not configured"),type:"error"});let i=Math.random().toString(36).substring(2,15),r="".concat(i,"|").concat(window.location.origin);if("google"===e){let e=new URLSearchParams({client_id:a.client_id,redirect_uri:a.redirect_uri,scope:"openid email profile",response_type:"code",state:r});t="https://accounts.google.com/o/oauth2/v2/auth?".concat(e)}else{let e=a.tenant_id||"common",n=new URLSearchParams({client_id:a.client_id,redirect_uri:a.redirect_uri,scope:"https://graph.microsoft.com/User.Read openid email profile",response_type:"code",state:r});t="https://login.microsoftonline.com/".concat(e,"/oauth2/v2.0/authorize?").concat(n)}let o=window.open(t,"".concat(e,"_oauth"),"width=500,height=600,scrollbars=yes,resizable=yes"),l=setInterval(()=>{(null==o?void 0:o.closed)&&clearInterval(l)},500)}catch(e){j({text:"Failed to start social login",type:"error"})}}return(0,i.useEffect)(()=>
1{if(t)return window.addEventListener("message",k),()=>window.removeEventListener("message",k)},[t,k]),(0,a.jsxs)(s.a,{open:t,onClose:function(){g(!1),j(null),x(!1),n()},size:"md",className:"social-popup",ariaLabel:f?"Forgot password":"Sign in or register",children:[f?(0,a.jsxs)("form",{onSubmit:C,className:"wp-form",children:[(0,a.jsxs)("div",{className:"forgot-header",children:[(0,a.jsx)("h3",{children:"Reset Password"}),(0,a.jsx)("p",{className:"form-description",children:"Enter your email address and we'll send you a link to reset your password."})]}),(0,a.jsx)("input",{type:"email",name:"forgot-email",placeholder:"Email",required:!0}),(0,a.jsx)(l.Button,{type:"submit",variant:"filled",color:"brand",fullWidth:!0,disabled:v,loading:v,loadingText:"Please waitâ¦",children:"Send Reset Link"}),(0,a.jsx)("p",{className:"form-link",children:(0,a.jsx)("a",{href:"#",className:"back-to-login-link",onClick:e=>{e.preventDefault(),g(!1),j(null)},children:"Back to Login"})})]}):(0,a.jsxs)(a.Fragment,{children:[b&&(0,a.jsxs)("div",{className:"login-context-heading",children:[(0,a.jsx)("h3",{children:b.title}),(0,a.jsx)("p",{children:b.body})]}),(0,a.jsxs)("div",{className:"login-tabs",children:[(0,a.jsx)("button",{className:"tab-btn ".concat("login"===m?"active":""),onClick:()=>{p("login"),j(null)},type:"button",children:"Login"}),(0,a.jsx)("button",{className:"tab-btn ".concat("register"===m?"active":""),onClick:()=>{p("register"),j(null)},type:"button",children:"Register"})]}),"login"===m?(0,a.jsxs)("div",{className:"tab-content active",children:[(0,a.jsx)(h,{onSocial:E}),(0,a.jsx)("div",{className:"divider",children:(0,a.jsx)("span",{children:"or"})}),(0,a.jsxs)("form",{onSubmit:S,className:"wp-form",children:[(0,a.jsx)("input",{type:"email",name:"login-email",placeholder:"Email",required:!0}),(0,a.jsx)("input",{type:"password",name:"login-password",placeholder:"Password",required:!0}),(0,a.jsx)(l.Button,{type:"submit",variant:"filled",color:"brand",fullWidth:!0,disabled:v,loading:v,loadingText:"Please waitâ¦",children:"Login"}),(0,a.jsx)("p",{className:"form-link",children:(0,a.jsx)("a",{href:"#",className:"forgot-password-link",onClick:e=>{e.preventDefault(),g(!0),j(null)},children:"Forgot your password?"})})]})]}):(0,a.jsxs)("div",{className:"tab-content active",children:[(0,a.jsx)(h,{onSocial:E}),(0,a.jsx)("div",{className:"divider",children:(0,a.jsx)("span",{children:"or"})}),(0,a.jsxs)("form",{onSubmit:N,className:"wp-form",children:[(0,a.jsx)("input",{type:"text",name:"register-name",placeholder:"Full Name",required:!0}),(0,a.jsx)("input",{type:"email",name:"register-email",placeholder:"Email",required:!0}),(0,a.jsx)("input",{type:"password",name:"register-password",placeholder:"Password",required:!0}),(0,a.jsxs)("label",{className:"form-checkbox",children:[(0,a.jsx)("input",{type:"checkbox",name:"register-newsletter"}),(0,a.jsx)("span",{children:"Receive latest news, updates and what's coming next!"})]}),(0,a.jsx)(l.Button,{type:"submit",variant:"filled",color:"brand",fullWidth:!0,disabled:v,loading:v,loadingText:"Please waitâ¦",children:"Create Account"})]})]})]}),w&&(0,a.jsx)("div",{className:"message ".concat(w.type),children:w.text})]})}let g=(0,i.createContext)({user:null,isLoggedIn:!1,isLoading:!0,openLoginPopup:()=>{},closeLoginPopup:()=>{},logout:()=>{},loginWithToken:()=>{}});function y(){return(0,i.useContext)(g)}function b(e){let{children:t}=e,[n,l]=(0,i.useState)(null),[s,c]=(0,i.useState)(!0),[d,u]=(0,i.useState)(!1),[m,p]=(0,i.useState)({}),h=(0,i.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};p(e),u(!0)},[]),y=(0,i.useCallback)(()=>u(!1),[]),b=(0,i.useCallback)((e,t)=>{(0,r.JQ)(e),(0,r.sX)(t),l(t),u(!1),window.dispatchEvent(new CustomEvent("userLoggedIn",{detail:{token:e,user:t}}))},[]),v=(0,i.useCallback)(()=>{(0,r.f$)(),l(null),window.location.href="/"},[]);return(0,i.useEffect)(()=>{!async function(){if((0,r.x3)()){let e=(0,r.gL)();e&&l(e);let t=await (0,r._I)();t&&l(t)}c(!1)}()},[]),(0,i.useEffect)(()=>{(0,o.H7)(()=>new Promise(e=>{h(),window.addEventListener("userLoggedIn",function t(n){var a;window.removeEventListener("userLoggedIn",t),e({token:null==(a=n.detail)?void 0:a.token})})}))},[h]),(0,i.useEffect)(()=>{function e(e){var t;(null==(t=e.detail)?void 0:t.user)&&l(e.detail.user)}return window.addEventListener("userAuthUpdated",e),()=>window.removeEventListener("userAuthUpdated",e)},[]),(0,a.jsxs)(g.Provider,{value:{user:n,isLoggedIn:!!n,isLoading:s,openLoginPopup:h,closeLoginPopup:y,logout:v,loginWithToken:b},children:[t,(0,a.jsx)(f,{isOpen:d,onClose:y,initialTab:m.initialTab,context:m.context})]})}},756:(e,t,n)=>{n.d(t,{a:()=>c});var a=n(5155),i=n(7650),r=n(2115);function o(e,t){let[n]=(0,r.useState)(()=>(t.current+=1,"".concat(e,"-").concat(t.current)));return n}let l={current:0},s={current:0};function c(e){let{open:t,onClose:n,title:c,description:d,children:u,footer:m,size:p="md",showClose:h=!0,closeOnOverlayClick:f=!0,closeOnEscape:g=!0,ariaLabel:y,className:b}=e,v=(0,r.useRef)(null),x=(0,r.useRef)(null),w=o("modal-title",l),j=o("modal-desc",s),[_,k]=(0,r.useState)(!1);if((0,r.useEffect)(()=>{k(!0)},[]),(0,r.useEffect)(()=>
1{if(!t)return;x.current=document.activeElement;let e=document.body.style.overflow;return document.body.style.overflow="hidden",requestAnimationFrame(()=>{var e;null==(e=v.current)||e.focus()}),()=>{var t,n;document.body.style.overflow=e,null==(n=x.current)||null==(t=n.focus)||t.call(n)}},[t]),(0,r.useEffect)(()=>{if(t&&g)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e);function e(e){"Escape"===e.key&&n()}},[t,g,n]),!_||!t)return null;let S=["modal","modal--".concat(p),b].filter(Boolean).join(" ");return(0,i.createPortal)((0,a.jsx)("div",{className:"modal-overlay",onClick:function(e){f&&e.target===e.currentTarget&&n()},children:(0,a.jsxs)("div",{ref:v,className:S,role:"dialog","aria-modal":"true","aria-labelledby":c?w:void 0,"aria-label":c?void 0:y,"aria-describedby":d?j:void 0,tabIndex:-1,children:[(c||h)&&(0,a.jsxs)("header",{className:"modal__header",children:[c&&(0,a.jsx)("h2",{id:w,className:"modal__title",children:c}),h&&(0,a.jsx)("button",{type:"button",className:"modal__close",onClick:n,"aria-label":"Close dialog",children:"\xd7"})]}),d&&(0,a.jsx)("p",{id:j,className:"modal__description",children:d}),(0,a.jsx)("div",{className:"modal__body",children:u}),m&&(0,a.jsx)("footer",{className:"modal__footer",children:m})]})}),document.body)}},960:(e,t,n)=>{n.d(t,{$P:()=>d,Al:()=>m,H7:()=>o,Vg:()=>c,mu:()=>u,y0:()=>p});var a=n(7886);let i=null;window.addEventListener("userLoggedIn",e=>{var t;(null==(t=e.detail)?void 0:t.token)&&(i=e.detail.token)});let r=null;function o(e){r=e}async function l(){if(i=null,!r)throw Error("Login popup not available");let e=await r();if(e.token)return i=e.token,e.token;throw Error("No token received after login")}async function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Headers(t.headers),r=i||(0,a.bx)();r&&!n.has("Authorization")&&n.set("Authorization","Bearer "+r),t.body&&!n.has("Content-Type")&&n.set("Content-Type","application/json");let o=await fetch(e,{...t,headers:n});if(401===o.status)try{let n=await l(),a=new Headers(t.headers);return a.set("Authorization","Bearer "+n),t.body&&!a.has("Content-Type")&&a.set("Content-Type","application/json"),fetch(e,{...t,headers:a})}catch(e){throw Error("Authentication failed: "+(e instanceof Error?e.message:"Unknown error"))}return o}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(e,{...t,method:"GET"})}function d(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(e,{...n,method:"POST",body:t?JSON.stringify(t):void 0})}function u(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(e,{...n,method:"PUT",body:t?JSON.stringify(t):void 0})}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(e,{...t,method:"DELETE"})}function p(e){return"".concat("https://api.apexcharts.com","/api").concat(e)}},4026:(e,t,n)=>{n.d(t,{FC:()=>l,Jh:()=>c,NO:()=>o,OH:()=>s,jF:()=>r});let a={test:{community:"prod_SVdEQxKfwhbFxv",pro:"prod_SVdDnk0SFx4YKu",premium:"prod_SVdF3KTiiOPDWB",oem:"prod_SVdFJ8GTPOjoF4"},live:{community:"prod_SeJ1PRlFnQyUyD",pro:"prod_SRsEZXOanodwf0",premium:"prod_SRsHwcqCWzbpZp",oem:"prod_SeK3QgvmeFI4Om"}},i={test:{community:"price_1RabyCDC90G5aYJTtbHi5Ulu",pro:"price_1RabwqDC90G5aYJTCCS8hJH7",premium:"price_1RabyfDC90G5aYJT8NYyjyoe",oem:"price_1UFabyDC90G5aYJTjFK0lUhk"},live:{community:"price_1Rj0PeDu7Ez1mRA9xqYQ2zaI",pro:"price_1RWyThDu7Ez1mRA9fAHN96QB",premium:"price_1RqkZ7Du7Ez1mRA981z1pHm4",oem:"price_1Rj1P0Du7Ez1mRA9HEbgwU76"}};function r(){return"live"}function o(e){"test"===e?localStorage.setItem("stripe_env",e):localStorage.removeItem("stripe_env")}function l(){let e=r();return{productIds:a[e],priceIds:i[e],environment:e}}function s(e){return{productIds:a[e],priceIds:i[e],environment:e}}let c={community:{label:"Community",price:199,requiresSeats:!0},pro:{label:"Pro",price:349,requiresSeats:!0},premium:{label:"Premium",price:599,requiresSeats:!0},oem:{label:"OEM",price:14999,requiresSeats:!1}}},7886:(e,t,n)=>{function a(){if("undefined"==typeof document)return null;let e=("; "+document.cookie).split("; jwt_token=");return 2===e.length&&e.pop().split(";").shift()||null}function i(){return!!a()}function r(){if("undefined"==typeof sessionStorage)return null;let e=sessionStorage.getItem("recentLoginUser");if(!e)return null;try{return JSON.parse(e)}catch(e){return null}}function o(e){"undefined"!=typeof sessionStorage&&sessionStorage.setItem("recentLoginUser",JSON.stringify(e))}function l(){"undefined"!=typeof document&&(document.cookie="".concat("jwt_token","=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")),"undefined"!=typeof sessionStorage&&sessionStorage.removeItem("recentLoginUser")}function s(e){!function(e,t,n){if("undefined"==typeof document)return;let a=new Date(Date.now()+864e5*30).toUTCString(),i="https:"===window.location.protocol;document.cookie="".concat(e,"=").concat(t,"; expires=").concat(a,"; path=/; SameSite=Strict").concat(i?"; Secure":"")}("jwt_token",e,0)}async function c(){let e=a();if(!e)return null;try{var t;let n=await fetch("".concat("https://api.apexcharts.com","/api/authenticate/"),{method:"GET",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"}});if(!n.ok)return null;let a=await n.json();if(null==(t=a.data)?void 0:t.email){let e={email:a.data.email,displayName:a.data.display_name||a.data.email,display_name:a.data.display_name||a.data.email,is_admin:!!a.data.is_admin};return o(e),window.dispatchEvent(new CustomEvent("userAuthUpdated",{detail:{user:e,action:"refresh"}})),e}return null}catch(e){return console.error("Error refreshing user data:",e),null}}n.d(t,{JQ:()=>s,_I:()=>c,bx:()=>a,f$:()=>l,gL:()=>r,sX:()=>o,x3:()=>i})},8537:(e,t,n)=>{n.r(t),n.d(t,{Button:()=>l});var a=n(5155),i=n(2619),r=n.n(i);function o(e){let{loading:t,loadingText:n,leftIcon:i,rightIcon:r,children:o}=e;return t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"btn-spinner","aria-hidden":"true"}),(0,a.jsx)("span",{className:"btn-loading-text",children:null!=n?n:o})]}):(0,a.jsxs)(a.Fragment,{children:[i?(0,a.jsx)("span",{className:"btn__icon btn__icon--left",children:i}):null,(0,a.jsx)("span",{className:"btn__label",children:o}
1),r?(0,a.jsx)("span",{className:"btn__icon btn__icon--right",children:r}):null]})}let l=(0,n(2115).forwardRef)(function(e,t){let{variant:n="filled",color:i="brand",size:l="md",loading:s=!1,loadingText:c,fullWidth:d=!1,leftIcon:u,rightIcon:m,className:p,children:h,...f}=e,g=function(e){let{variant:t,color:n,size:a,loading:i,fullWidth:r,className:o}=e,l=["btn",...function(e,t){if("link"===e)return["btn--link"];if("filled"===e){if("brand"===t)return["btn--primary"];if("success"===t)return["btn--secondary"];if("danger"===t)return["btn--danger"];if("warning"===t)return["btn--orange"];if("neutral"===t)return["btn--tertiary"];if("inverse"===t)return["btn--white"]}return"outline"===e?"brand"===t?["btn--transparent"]:"success"===t?["btn--transparent-secondary"]:"inverse"===t?["btn--transparent-white"]:"danger"===t?["btn--outline-danger"]:["btn--transparent"]:"ghost"===e?"inverse"===t?["btn--ghost","btn--ghost-inverse"]:"danger"===t?["btn--ghost","btn--ghost-danger"]:["btn--ghost"]:["btn--primary"]}(t,n)],s="sm"===a?"btn-small":"lg"===a?"btn--wide":null;return s&&l.push(s),i&&l.push("btn-loading"),r&&l.push("btn--full-width"),o&&l.push(o),l.join(" ")}({variant:n,color:i,size:l,loading:s,fullWidth:d,className:p});if("href"in e&&void 0!==e.href){let{href:e,external:n,...i}=f,l={...i,className:g,"aria-busy":s||void 0};return n?(0,a.jsx)("a",{ref:t,href:e,target:"_blank",rel:"noopener noreferrer",...l,children:(0,a.jsx)(o,{loading:s,loadingText:c,leftIcon:u,rightIcon:m,children:h})}):(0,a.jsx)(r(),{ref:t,href:e,...l,children:(0,a.jsx)(o,{loading:s,loadingText:c,leftIcon:u,rightIcon:m,children:h})})}let{type:y="button",disabled:b,...v}=f;return(0,a.jsx)("button",{ref:t,type:y,className:g,disabled:b||s,"aria-busy":s||void 0,...v,children:(0,a.jsx)(o,{loading:s,loadingText:c,leftIcon:u,rightIcon:m,children:h})})});l.displayName="Button"}}]);
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.