1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[454],{904:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var a=r(5155);r(2115);var n=r(9965);function s(){let{formData:e,updateField:t,nextStep:r,prevStep:s}=(0,n.V)();return(0,a.jsxs)("div",{className:"apple-step apple-step-form",children:[(0,a.jsx)("h2",{children:"Step 2: Client Details"}),(0,a.jsx)("p",{children:"Enter your company and contact information"}),(0,a.jsxs)("div",{className:"form-card",children:[(0,a.jsx)("h3",{children:"Client Details"}),(0,a.jsxs)("form",{onSubmit:e=>e.preventDefault(),children:[(0,a.jsx)("input",{type:"text",placeholder:"Company Name",value:e.companyName,onChange:e=>t("companyName",e.target.value),required:!0}),(0,a.jsx)("input",{type:"text",placeholder:"Name",value:e.clientName,onChange:e=>t("clientName",e.target.value),required:!0}),(0,a.jsx)("input",{type:"text",placeholder:"Phone Number",value:e.phoneNumber,onChange:e=>t("phoneNumber",e.target.value),required:!0}),(0,a.jsx)("input",{type:"text",placeholder:"Address",value:e.address,onChange:e=>t("address",e.target.value),required:!0}),(0,a.jsx)("input",{type:"text",placeholder:"City",value:e.city,onChange:e=>t("city",e.target.value),required:!0}),(0,a.jsx)("input",{type:"text",placeholder:"State",value:e.state,onChange:e=>t("state",e.target.value),required:!0}),(0,a.jsx)("input",{type:"text",placeholder:"Postal Code",value:e.postalCode,onChange:e=>t("postalCode",e.target.value),required:!0}),(0,a.jsxs)("select",{value:e.country,onChange:e=>t("country",e.target.value),required:!0,children:[(0,a.jsx)("option",{value:"AU",children:"AU"}),(0,a.jsx)("option",{value:"NZ",children:"NZ"})]}),(0,a.jsxs)("div",{className:"button-row-split",children:[(0,a.jsx)("button",{className:"form-button previous",type:"button",onClick:s,children:"Previous"}),(0,a.jsx)("button",{className:"form-button next",type:"button",onClick:()=>{for(let t of["companyName","clientName","phoneNumber","address","city","state","postalCode","country"])if(!e[t])return void alert("Please fill in all fields.");r()},children:"Next"})]})]})]})]})}},1514:(e,t,r)=>{Promise.resolve().then(r.bind(r,5612))},1585:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var a=r(5155);r(2115);var n=r(63);function s(){let e=(0,n.useRouter)();return(0,a.jsx)("div",{className:"success-container",children:(0,a.jsxs)("div",{className:"success-box",children:[(0,a.jsx)("h2",{children:"\uD83C\uDF89 Registration Successful"}),(0,a.jsx)("p",{children:"Please check your email for your login details."}),(0,a.jsx)("p",{children:"If you donât see it, check your spam/junk folder."}),(0,a.jsx)("button",{className:"home-button",onClick:()=>e.push("/"),children:"Go to Homepage"})]})})}},5612:(e,t,r)=>{"use strict";r.d(t,{default:()=>A});var a=r(5155),n=r(2115),s=r(6477);let o={src:"/_next/static/media/Appstore.bd35d8d1.png"},l={src:"/_next/static/media/Android-playstore.43e8a24e.png"};var i=r(9965),d=r(6743),c=r(904),p=r(9708),u=r(5973);function m(e){let{onGoSuccess:t}=e,{formData:r,updateField:s,nextStep:o,prevStep:l}=(0,i.V)(),[d,c]=(0,n.useState)(!1),m=async e=>{e.preventDefault();let{printerName:a,bdAddress:n}=r;if(!a||!n)return void alert("Please fill in both fields.");c(!0);try{let e=(0,p.P)((0,p.rJ)(u.db,"printers"),(0,p._M)("name","==",a),(0,p._M)("bd address","==",n));if((await (0,p.GG)(e)).empty){alert("Invalid Printer Name or BD Address."),c(!1);return}t?t():o()}catch(e){console.error("Error validating printer:",e),alert("Error checking printer. Please try again.")}finally{c(!1)}};return(0,a.jsxs)("div",{className:"apple-step apple-step-form",children:[(0,a.jsx)("h2",{children:"Step 3: Printer Info"}),(0,a.jsx)("p",{children:"Enter your printer name and Bluetooth address"}),(0,a.jsxs)("div",{className:"form-card",children:[(0,a.jsx)("h3",{children:"Printer Info"}),(0,a.jsxs)("form",{onSubmit:m,children:[(0,a.jsx)("input",{type:"text",placeholder:"Printer Name -- MP800xxxxxxx",value:r.printerName,onChange:e=>s("printerName",e.target.value),required:!0}),(0,a.jsx)("input",{type:"text",placeholder:"Printer BD Address -- XX:XX:XX:XX:XX:XX",value:r.bdAddress,onChange:e=>s("bdAddress",(e=>{let t=e.replace(/[^A-Fa-f0-9]/g,"").toUpperCase(),r="";for(let e=0;e<t.length;e+=2)r+=t.substr(e,2),e<10&&(r+=":");return r.slice(0,17)})(e.target.value)),required:!0}),(0,a.jsxs)("div",{className:"button-row-split",children:[(0,a.jsx)("button",{className:"form-button previous",type:"button",onClick:l,disabled:d,children:"Previous"}),(0,a.jsx)("button",{className:"form-button next",type:"submit",disabled:d,children:d?"Checking...":"Next"})]})]})]})]})}var h=r(2553),f=r(4511),x=r(2890);let g=(0,f.c)("pk_live_51JSMBVB0NDo4UE0zxfsL0po9EdvZK2y6QT6T9Q5frgegb0KDlx0URqzC1Pqd5eqLhT6svMHeCxQ8Q1IWI42sslcO0046ZyGkfa");function v(e){let{onPaymentSuccess:t}=e,{formData:r,updateField:s,prevStep:o}
1=(0,i.V)(),l=(0,x.t2)(),d=(0,x.HH)(),[c,m]=(0,n.useState)(!1),f=async e=>{e.preventDefault(),m(!0);try{let e,a=d.getElement(x.hA);if(!a){alert("Card not found."),m(!1);return}let{error:n,paymentMethod:o}=await l.createPaymentMethod({type:"card",card:a,billing_details:{name:r.clientName,email:r.email,phone:r.phoneNumber,address:{line1:r.address,city:r.city,state:r.state,postal_code:r.postalCode,country:r.country}}});if(n){alert(n.message),m(!1);return}try{e=(await (0,h.eJ)(u.j,r.email,r.password)).user.uid,s("uid",e)}catch(e){"auth/email-already-in-use"===e.code?alert("This email address is already registered. Please use another."):"auth/weak-password"===e.code?alert("Password is too weak. Please use at least 6 characters."):alert("Failed to create user: "+e.message),m(!1);return}if(!e){alert("Registration error: No UID found. Please try again."),m(!1);return}let i={uid:e,email:r.email,paymentMethodId:o.id,clientName:r.clientName,companyName:r.companyName,phoneNumber:r.phoneNumber,address:r.address,city:r.city,state:r.state,postalCode:r.postalCode,country:r.country,printerName:r.printerName,bdAddress:r.bdAddress,allowedDevices:r.allowedDevices},c=await fetch("".concat("https://api.clevermode.com.au","/create-customer"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!c.ok){let e=await c.text();throw Error("Backend error: ".concat(e))}await c.json();try{await (0,p.gS)((0,p.rJ)(u.db,"mail"),{to:[r.email],message:{from:"Clevermode <[email protected]>",subject:"Welcome to Clevermode",text:"Hi ".concat(r.clientName||"there",",\n\nWelcome to Clevermode â your account is now active.\n\nYou can now:\n- Sign into your app\n- Set up your Clevermode\n- Enjoy using Clevermode\n\nOpen Clevermode App: https://clevermode.com.au/open-app/\n\nNeed help? Email [email protected]\n\nThanks,\nClevermode Team"),html:'<!DOCTYPE html>\n<html>\n <head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <title>Welcome to Clevermode</title>\n </head>\n <body style="margin:0;padding:0;background-color:#fff5f5;font-family:Arial,Helvetica,sans-serif;color:#1f2937;">\n <div style="display:none;max-height:0;overflow:hidden;opacity:0;">Welcome to Clevermode. Your account is active and ready to use.</div>\n <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="background-color:#fff5f5;padding:24px 12px;">\n <tr>\n <td align="center">\n <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="max-width:620px;background:#ffffff;border-radius:14px;overflow:hidden;border:1px solid #ffe0e0;">\n <tr>\n <td style="background:#ffffff;border-bottom:4px solid #ff0000;padding:20px 28px;text-align:center;">\n <img src="https://clevermode.com.au/c-icon.png" alt="Clevermode Logo" width="56" height="56" style="display:block;margin:0 auto 10px auto;border:0;outline:none;text-decoration:none;" />\n <div style="color:#111111;font-size:24px;font-weight:800;letter-spacing:0.2px;">Clevermode</div>\n </td>\n </tr>\n <tr>\n <td style="padding:28px;">\n <p style="margin:0 0 12px 0;font-size:18px;line-height:1.5;"><strong>Hi '.concat(r.clientName||"there",',</strong></p>\n <p style="margin:0 0 16px 0;font-size:16px;line-height:1.6;">Welcome to Clevermode! Your registration is complete and your account is now active.</p>\n <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin:0 0 18px 0;background:#fff8f8;border:1px solid #ffd6d6;border-radius:10px;">\n <tr>\n <td style="padding:14px 16px;font-size:14px;line-height:1.7;">\n â
Sign into your app<br/>\n â
Set up your Clevermode<br/>\n â
Enjoy using Clevermode\n </td>\n </tr>\n </table>\n <table role="presentation" cellspacing="0" cellpadding="0" border="0" style="margin:0 0 18px 0;">\n <tr>\n <td style="border-radius:8px;background:#ff0000;">\n <a href="https://clevermode.com.au/open-app/" style="display:inline-block;padding:12px 18px;color:#ffffff;text-decoration:none;font-size:14px;font-weight:700;">
1Open Clevermode App</a>\n </td>\n </tr>\n </table>\n <p style="margin:0 0 8px 0;font-size:14px;line-height:1.6;">Need help? Reply to <a href="mailto:[email protected]" style="color:#ff0000;text-decoration:underline;">[email protected]</a>.</p>\n <p style="margin:0;font-size:14px;line-height:1.6;">Thanks,<br/><strong>Clevermode Team</strong></p>\n </td>\n </tr>\n <tr>\n <td style="padding:14px 28px;background:#fff5f5;border-top:1px solid #ffd6d6;color:#7a2727;font-size:12px;line-height:1.5;">Clevermode ⢠Test & Tag Software</td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </body>\n</html>')}})}catch(e){console.error("â ï¸ Failed to queue welcome email:",e)}t&&t()}catch(e){console.error("â Error during registration:",e),alert("An error occurred: "+e.message)}finally{m(!1)}};return(0,a.jsxs)("div",{className:"apple-step apple-step-form",children:[(0,a.jsx)("h2",{children:"Step 4: Credit Card Info"}),(0,a.jsx)("p",{children:"This will not charge you now. Your subscription will renew after 12 months."}),(0,a.jsx)("div",{className:"form-card",children:(0,a.jsxs)("form",{onSubmit:f,children:[(0,a.jsx)(x.hA,{}),(0,a.jsx)("div",{id:"card-errors",role:"alert"}),(0,a.jsxs)("div",{className:"button-row-split",children:[(0,a.jsx)("button",{className:"form-button previous",type:"button",onClick:o,disabled:c,children:"Previous"}),(0,a.jsx)("button",{className:"form-button next",type:"submit",disabled:c,children:c?"Processing...":"Next"})]})]})})]})}function b(e){return(0,a.jsx)(x.S8,{stripe:g,children:(0,a.jsx)(v,{...e})})}var y=r(1585);function j(){let{step:e,setStep:t}=(0,i.V)();switch(e){case 1:default:return(0,a.jsx)(d.A,{});case 2:return(0,a.jsx)(c.A,{});case 3:return(0,a.jsx)(m,{onGoSuccess:()=>t(4)});case 4:return(0,a.jsx)(b,{onPaymentSuccess:()=>t(5)});case 5:return(0,a.jsx)(y.default,{})}}function A(){return(0,n.useEffect)(()=>{let e=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.target.classList.add("visible")})},{threshold:.12});return document.querySelectorAll(".reveal, .reveal-left, .reveal-right").forEach(t=>e.observe(t)),()=>e.disconnect()},[]),(0,a.jsx)(i.l,{children:(0,a.jsxs)("div",{className:"apple-registration-container",children:[(0,a.jsxs)("div",{className:"apple-step reg-hero-left",children:[(0,a.jsx)("h2",{children:"Step 1: Download the Clevermode App"}),(0,a.jsx)("p",{children:"Click an option below to download"}),(0,a.jsx)("img",{src:s.A.src,alt:"Main Display",className:"main-download-image"}),(0,a.jsxs)("div",{className:"store-buttons",children:[(0,a.jsx)("a",{href:"https://apps.apple.com/au/app/clevermode/id6569243257",target:"_blank",rel:"noopener noreferrer",children:(0,a.jsx)("img",{src:o.src,alt:"Download on App Store",className:"store-image"})}),(0,a.jsx)("a",{href:"https://play.google.com/store/apps/details?id=com.clevermode.clevermode",target:"_blank",rel:"noopener noreferrer",children:(0,a.jsx)("img",{src:l.src,alt:"Download on Play Store",className:"store-image"})})]})]}),(0,a.jsx)("div",{className:"reg-hero-right",children:(0,a.jsx)(j,{})})]})})}},5973:(e,t,r)=>{"use strict";r.d(t,{db:()=>i,j:()=>l});var a=r(2078),n=r(2553),s=r(9708);let o=(0,a.Wp)({apiKey:"AIzaSyDqms_oY8IMxMBXwcgUnPhWe0kxPFfHV5A",authDomain:"clevermodeios.firebaseapp.com",projectId:"clevermodeios",storageBucket:"clevermodeios.appspot.com",messagingSenderId:"944052254123",appId:"1:944052254123:web:efbcdff9f24ffa11e18eee",measurementId:"G-1NEKQG08HY"}),l=(0,n.xI)(o),i=(0,s.aU)(o)},6477:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a={src:"/_next/static/media/appImage.89f81898.png",height:1280,width:853,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAICAMAAAAGL8UJAAAASFBMVEWDho16eoXU190AAACGrMbevLbSpZuJk53l39+hoKNVVVXb4OROTk6amp6ChomoqKzasan9///33Nf/x7ji3+L2qJT/9fHm5OVQt+OkAAAAEXRSTlMTLv4DFPX1LupwBukNT5iU9Sn88fcAAAAJcEhZcwAACxMAAAsTAQCanBgAAAA0SURBVHicFcTBEYAgDADBI0BCRGVQwP47ZdzHQrv9wL5VwOT5z29OmE5NBOkVwugFTvcrbiJMAV+bOd0xAAAAAElFTkSuQmCC",blurWidth:5,blurHeight:8}},6743:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var a=r(5155);r(2115);var n=r(9965);function s(){let{formData:e,updateField:t,nextStep:r}=(0,n.V)();return(0,a.jsxs)("div",{className:"apple-step apple-step-form",children:[(0,a.jsx)("h2",{children:"Step 2: Create Your Login"}),(0,a.jsx)("p",{children:"Please enter your email and password to begin"}),(0,a.jsxs)("div",{className:"form-card",children:[(0,a.jsx)("h3",{children:"Username and Password"}),(0,a.jsxs)("form",{onSubmit:t=>{if(t.preventDefault(),!e.email||!e.password)return void alert("Please fill in both email and password.");r()},children:[(0,a.jsx)("input",{type:"email",placeholder:"Email",value:e.email,onChange:e=>t("email",e.target.value),required:!0}),(0,a.jsx)("input",{type:"password",placeholder:"Password",value:e.password,onChange:e=>t("password",e.target.value),required:!0}),(0,a.jsx)("div",{className:"button-row-split",children:(0,a.jsx)("button",{type:"submit",className:"form-button-s1",children:"Next"})})]})]})]})}},9965:(e,t,r)=>{"use strict";r.d(t,{V:()=>l,l:()=>o});var a=r(5155),n=r(2115);let s=(0,n.createContext)(),o=e=>{let{children:t}
1=e,[r,o]=(0,n.useState)({email:"",password:"",companyName:"",clientName:"",phoneNumber:"",address:"",city:"",state:"",postalCode:"",country:"AU",printerName:"",bdAddress:"",allowedDevices:"1",uid:""}),[l,i]=(0,n.useState)(1);return(0,a.jsx)(s.Provider,{value:{formData:r,updateField:(e,t)=>o(r=>({...r,[e]:t})),step:l,nextStep:()=>i(e=>e+1),prevStep:()=>i(e=>e-1),setStep:i},children:t})},l=()=>(0,n.useContext)(s)}},e=>{e.O(0,[135,563,240,923,441,255,358],()=>e(e.s=1514)),_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.