1import{b as te}from"./chunk-TBV4UZNX.js";import"./chunk-G3NM4LJ6.js";import{a as Z,b as Y}from"./chunk-ORG6X553.js";import{b as ee}from"./chunk-OLHHGXZN.js";import"./chunk-DBA44QWQ.js";import"./chunk-T4ZSFXYG.js";import"./chunk-QMZE6H57.js";import{e as T,m as A,o as z}from"./chunk-3XIPWIBB.js";import{e as G}from"./chunk-WAWFYPMX.js";import{a as Q,b as X}from"./chunk-7MQTEMAJ.js";import"./chunk-HTCLQCOU.js";import"./chunk-6XPI5QYW.js";import{B as q,x as R}from"./chunk-YWMD53KQ.js";import{b as N}from"./chunk-A6AWQOXQ.js";import{B as J,D as $,b as D,c as U,e as g,h as V,i as j,m as B,q as H,r as K,s as W}from"./chunk-PJ5GV7IK.js";import{g as S,h as L,i as F,x as E}from"./chunk-EDUSMAQY.js";import{Ab as u,Bb as k,Da as p,Nb as C,Xa as a,Ya as i,Za as o,_a as m,da as M,fb as P,gc as I,ia as r,jb as O,k as f,lb as d,p as b,q as v,wb as w,xa as y,zb as c}from"./chunk-FFQQO7O7.js";import"./chunk-ID4WHIPA.js";import"./chunk-QUA7QOZA.js";import{a as _}from"./chunk-C6Q5SG76.js";var oe=t=>({"half-width":t});function ie(t,n){if(t&1&&m(0,"img",6),t&2){let e=d();a("src",e.config.logoUrl,M)}}function re(t,n){if(t&1&&(i(0,"div",7)(1,"div",8)(2,"mat-icon",9),c(3,"check_circle"),o()(),i(4,"h3"),c(5,"Request Received"),o(),i(6,"p"),c(7),o()()),t&2){let e=d();r(7),u(e.config.successMessage)}}function ae(t,n){t&1&&(i(0,"div",26),c(1,"Name is required "),o())}function ce(t,n){t&1&&(i(0,"div",26),c(1,"Valid email is required"),o())}function le(t,n){t&1&&(i(0,"div",28)(1,"label"),c(2,"Company Name"),o(),m(3,"input",29),o())}function se(t,n){t&1&&(i(0,"div",28)(1,"label"),c(2,"Phone Number"),o(),m(3,"input",30),o())}function me(t,n){if(t&1&&(i(0,"div",11),p(1,le,4,0,"div",27)(2,se,4,0,"div",27),o()),t&2){let e=d(2);r(),a("ngIf",e.config.fields.company),r(),a("ngIf",e.config.fields.phone)}}function de(t,n){if(t&1&&(i(0,"div",32)(1,"label"),c(2,"Amazon Store Link or ASIN"),o(),m(3,"input",33),o()),t&2){let e=d(3);a("ngClass",C(1,oe,e.config.fields.username))}}function pe(t,n){if(t&1&&(i(0,"div",32)(1,"label"),c(2,"Marketplace Username (Optional)"),o(),m(3,"input",34),o()),t&2){let e=d(3);a("ngClass",C(1,oe,e.config.fields.storeLink))}}function fe(t,n){if(t&1&&(i(0,"div",11),p(1,de,4,3,"div",31)(2,pe,4,3,"div",31),o()),t&2){let e=d(2);r(),a("ngIf",e.config.fields.storeLink),r(),a("ngIf",e.config.fields.username)}}function ge(t,n){if(t&1&&(i(0,"label",39),m(1,"input",40)(2,"span",41),i(3,"span",42),c(4),o()()),t&2){let e=n.$implicit;r(),a("formControlName",e),r(3),u(e)}}function ue(t,n){if(t&1&&(i(0,"div",35)(1,"label",36),c(2,"What services are you interested in?"),o(),i(3,"div",37),p(4,ge,5,2,"label",38),o()()),t&2){let e=d(2);r(4),a("ngForOf",e.availableServices)}}function he(t,n){t&1&&(i(0,"div",11)(1,"div",12)(2,"label"),c(3,"How can we help you? (Optional)"),o(),m(4,"textarea",43),o()())}function xe(t,n){if(t&1&&(i(0,"div",44)(1,"mat-icon"),c(2,"error_outline"),o(),c(3),o()),t&2){let e=d(2);r(3),k(" ",e.errorMsg," ")}}function _e(t,n){t&1&&(i(0,"span"),c(1,"Submit Request"),o())}function Ce(t,n){t&1&&m(0,"mat-spinner",45)}function be(t,n){if(t&1){let e=P();i(0,"form",10),O("ngSubmit",function(){b(e);let l=d();return v(l.onSubmit())}),i(1,"div",11)(2,"div",12)(3,"label"),c(4,"Full Name *"),o(),m(5,"input",13),p(6,ae,2,0,"div",14),o()(),i(7,"div",11)(8,"div",12)(9,"label"),c(10,"Email Address *"),o(),m(11,"input",15),p(12,ce,2,0,"div",14),o()(),p(13,me,3,2,"div",16)(14,fe,3,2,"div",16)(15,ue,5,1,"div",17)(16,he,5,0,"div",16)(17,xe,4,1,"div",18),i(18,"div",19)(19,"button",20),p(20,_e,2,0,"span",21)(21,Ce,1,0,"mat-spinner",22),o()(),i(22,"div",23),c(23," This site is protected by reCAPTCHA and the Google "),i(24,"a",24),c(25,"Privacy Policy"),o(),c(26," and "),i(27,"a",25),c(28,"Terms of Service"),o(),c(29," apply. "),o()()}if(t&2){let e,s,l=d();a("formGroup",l.form),r(6),a("ngIf",((e=l.form.get("name"))==null?null:e.touched)&&((e=l.form.get("name"))==null?null:e.invalid)),r(6),a("ngIf",((s=l.form.get("email"))==null?null:s.touched)&&((s=l.form.get("email"))==null?null:s.invalid)),r(),a("ngIf",l.config.fields.company||l.config.fields.phone),r(),a("ngIf",l.config.fields.storeLink||l.config.fields.username),r(),a("ngIf",l.config.fields.services),r(),a("ngIf",l.config.fields.message),r(),a("ngIf",l.errorMsg),r(2),a("disabled",l.form.invali
1d||l.loading),r(),a("ngIf",!l.loading),r(),a("ngIf",l.loading)}}var ne=class t{route=f(N);fb=f(J);functions=f(R);firestore=f(T);cdr=f(I);orgId="";form;loading=!1;submitted=!1;errorMsg="";config={orgId:"",title:"Work With Us",themeColor:"#6366f1",logoUrl:"",fields:{company:!0,phone:!0,storeLink:!0,services:!0,username:!1,message:!0},successMessage:"Thank you for your interest! We will be in touch shortly."};availableServices=["PPC Management","DSP Advertising","SEO & Listing Optimization","Creative Services","Full Account Management","Consulting"];ngOnInit(){this.orgId=this.route.snapshot.paramMap.get("orgId")||"",this.config.orgId=this.orgId,this.route.queryParams.subscribe(n=>{if(n.logo)this.config.logoUrl=n.logo;else if(n.draftLogo){let e=localStorage.getItem(`draft_logo_${this.orgId}`);e&&(this.config.logoUrl=e)}}),this.initForm(),this.loadConfig(),this.loadReCaptcha()}async loadConfig(){if(this.orgId)try{let n=A(this.firestore,`organizations/${this.orgId}/lead_forms/default`),e=await z(n);e.exists()&&(this.config=_(_({},this.config),e.data()),this.cdr.detectChanges())}catch(n){console.warn("Failed to load lead form config, using defaults",n)}}initForm(){this.form=this.fb.group({name:["",[g.required]],email:["",[g.required,g.email]],companyName:[""],phone:[""],storeLink:[""],username:[""],notes:["",[g.maxLength(1e4)]]});let n={};this.availableServices.forEach(e=>{n[e]=[!1]}),this.form.addControl("services",this.fb.group(n))}loadReCaptcha(){if(window.grecaptchaScriptLoaded)return;let n=document.createElement("script");n.src="https://www.google.com/recaptcha/api.js?render=6LdZXK4sAAAAAIdLl6Jqr4ivCaQI8TN3BRKrqCLI",n.async=!0,n.onload=()=>{window.grecaptchaScriptLoaded=!0,console.log("reCAPTCHA script loaded")},document.head.appendChild(n)}async onSubmit(){if(this.form.invalid||!this.orgId){this.form.get("notes")?.errors?.maxlength&&(this.errorMsg="Message is too long. Please shorten it to under 1,000 words.");return}this.loading=!0,this.errorMsg="";try{let n="";if(window.grecaptcha)try{n=await window.grecaptcha.execute("6LdZXK4sAAAAAIdLl6Jqr4ivCaQI8TN3BRKrqCLI",{action:"submit_lead"})}catch(x){console.error("reCAPTCHA execution failed",x),n="error-fallback"}else console.warn("reCAPTCHA not loaded, using fallback"),n="test-token";let e=this.form.value,s=Object.keys(e.services).filter(x=>e.services[x]),l={orgId:this.orgId,recaptchaToken:n,leadData:{name:e.name,email:e.email,companyName:e.companyName,phone:e.phone,storeLink:e.storeLink,username:e.username,notes:e.notes,servicesNeeded:s}},h=await q(this.functions,"captureLead")(l);if(console.log("CaptureLead Response:",h.data),h.data.success===!1)throw new Error(h.data.error||"Submission failed");this.submitted=!0,this.cdr.detectChanges()}catch(n){console.error("Lead capture error",n),this.errorMsg=n.message?.includes("SUSPECTED_BOT")?"Verification failed. Please refresh the page and try again.":"Sorry, there was an error submitting your request. Please ensure the message is not too long.",this.cdr.detectChanges()}finally{this.loading=!1,this.cdr.detectChanges()}}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=y({type:t,selectors:[["app-lead-capture-form"]],decls:8,vars:6,consts:[[1,"embed-container"],[1,"form-wrapper"],[1,"form-header"],["class","form-logo","alt","Company Logo",3,"src",4,"ngIf"],["class","success-state",4,"ngIf"],[3,"formGroup","ngSubmit",4,"ngIf"],["alt","Company Logo",1,"form-logo",3,"src"],[1,"success-state"],[1,"success-icon-wrap"],[1,"success-icon"],[3,"ngSubmit","formGroup"],[1,"form-row"],[1,"form-field","full-width"],["type","text","formControlName","name","placeholder","John Doe"],["class","error",4,"ngIf"],["type","email","formControlName","email","placeholder","[email protected]"],["class","form-row",4,"ngIf"],["class","form-row services-row","formGroupName","services",4,"ngIf"],["class","error-banner",4,"ngIf"],[1,"form-actions"],["type","submit",1,"submit-btn",3,"disabled"],[4,"ngIf"],["diameter","20","color","accent",4,"ngIf"],[1,"recaptcha-disclaimer"],["href","https://policies.google.com/privacy","target","_blank"],["href","https://policies.google.com/terms","target","_blank"],[1,"error"],["class","form-field half-width",4,"ngIf"],[1,"form-field","half-width"],["type","text","formControlName","companyName","placeholder","Acme Corp"],["type","tel","formControlName","phone","placeholder","+1 (555) 000-0000"],["class","form-field full-width",3,"ngClass",4,"ngIf"],[1,"form-field","full-width",3,"ngClass"],["type","text","formControlName","storeLink","placeholder","https://amazon.com/..."],["type","text","formControlName","username","placeholder","Fiverr/Upwork handle"],["formGroupName","services",1,"form-row","services-row"],[1,"section-label"],[1,"checkbox-grid"],["class","custom-checkbox",4,"ngFor","ngForOf"],[1,"custom-checkbox"],["type","checkbox",3,"formControlName"],[1,"checkmark"],[1,"lbl"],["formControlName","notes","rows","4","placeholder","Tell us about your brand goals..."],[1,"error-banner"],["diameter","20","color","accent"]],template:function(e,s){e&1&&(i(0,"div",0)(1,"div",1)(2,"div",2),p(3,ie,1,1,"img",3),i(4,"h2"),c(5),o()(),p(6,re,8,1,"div",4)(7,be,30,11,"form",5),o()()),e&2&&(w("--theme-color",s.config.themeColor),r(3),a("ngIf",s.config.logoUrl),r(2),u(s.config.title),r(),a("ngIf",s.submitted),r(),a("ngIf",!s.submitted))},dependencies:[E,S,L,F,$,B,U,D,V,j,W,K,H,te,G,ee,Y,Z,X,Q],styles:['.embed-container[_ngcontent-%COMP%]{padding:24px;font-family:Inter,system-ui,-apple-system,sans-serif;color:#1e293b;background:transparent;min-height:100vh;box-sizing:border-box}.form-wrapper[_ngcontent-%COMP%]{max-width:600px;margin:0 auto;background:#fff;border-radius:12px;box-shadow:0 4px 20px #0000000d,0 1px 3px #00000005;padding:32px 40px;border:1px solid #f1f5f9}.form-header[_ngcontent-%COMP%]{margin-bottom:28px;text-align:center}.form-header[_ngcontent-%COMP%] .form-logo[_ngcontent-%COMP%]{max-width:200
1px;max-height:80px;margin-bottom:16px;object-fit:contain}.form-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:24px;font-weight:700;color:#0f172a;letter-spacing:-.5px}.form-row[_ngcontent-%COMP%]{display:flex;gap:16px;margin-bottom:20px;flex-wrap:wrap}.form-field[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-field.full-width[_ngcontent-%COMP%]{width:100%;flex:1 1 100%}.form-field.half-width[_ngcontent-%COMP%]{flex:1 1 calc(50% - 8px);min-width:200px}.form-field[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:#475569;margin-bottom:8px}.form-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{padding:12px 16px;border:1px solid #cbd5e1;border-radius:8px;font-size:15px;color:#0f172a;background:#f8fafc;transition:all .2s ease;font-family:inherit}.form-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder, .form-field[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::placeholder{color:#94a3b8}.form-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, .form-field[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--theme-color);background:#fff;box-shadow:0 0 0 3px #6366f126}.form-field[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px}.form-field[_ngcontent-%COMP%] .error[_ngcontent-%COMP%]{color:#ef4444;font-size:12px;margin-top:6px;font-weight:500}.services-row[_ngcontent-%COMP%]{flex-direction:column;gap:12px;margin-top:24px}.services-row[_ngcontent-%COMP%] .section-label[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:#475569}.checkbox-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px}.custom-checkbox[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;cursor:pointer;-webkit-user-select:none;user-select:none}.custom-checkbox[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.custom-checkbox[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ .checkmark[_ngcontent-%COMP%]{background-color:var(--theme-color);border-color:var(--theme-color)}.custom-checkbox[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ .checkmark[_ngcontent-%COMP%]:after{display:block}.custom-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]{height:18px;width:18px;background-color:#f8fafc;border:1px solid #cbd5e1;border-radius:4px;position:relative;transition:all .2s ease}.custom-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{content:"";position:absolute;display:none;left:5px;top:2px;width:4px;height:8px;border:solid white;border-width:0 2px 2px 0;transform:rotate(45deg)}.custom-checkbox[_ngcontent-%COMP%] .lbl[_ngcontent-%COMP%]{font-size:14px;color:#1e293b}.custom-checkbox[_ngcontent-%COMP%]:hover .checkmark[_ngcontent-%COMP%]{border-color:var(--theme-color)}.form-actions[_ngcontent-%COMP%]{margin-top:32px}.submit-btn[_ngcontent-%COMP%]{width:100%;padding:14px 24px;background:var(--theme-color, #6366f1);color:#fff;border:none;border-radius:8px;font-size:16px;font-weight:600;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #6366f140}.submit-btn[_ngcontent-%COMP%]:hover:not(:disabled){transform:translateY(-1px);filter:brightness(1.1);box-shadow:0 6px 16px #6366f159}.submit-btn[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed;transform:none;box-shadow:none}.submit-btn[_ngcontent-%COMP%] .mat-mdc-progress-spinner circle{stroke:#fff!important}.error-banner[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:12px 16px;background:#fef2f2;color:#b91c1c;border-radius:8px;font-size:14px;font-weight:500;margin-bottom:20px}.error-banner[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.recaptcha-disclaimer[_ngcontent-%COMP%]{margin-top:16px;text-align:center;font-size:11px;color:#94a3b8;line-height:1.5}.recaptcha-disclaimer[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#64748b;text-decoration:none}.recaptcha-disclaimer[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline;color:#475569}.success-state[_ngcontent-%COMP%]{text-align:center;padding:40px 20px;animation:_ngcontent-%COMP%_scaleIn .3s ease-out}.success-state[_ngcontent-%COMP%] .success-icon-wrap[_ngcontent-%COMP%]{display:inline-flex;border-radius:50%;background:#dcfce7;padding:16px;margin-bottom:20px}.success-state[_ngcontent-%COMP%] .success-icon-wrap[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px;color:#16a34a}.success-state[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:24px;font-weight:700;color:#0f172a;margin:0 0 12px}.success-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:15px;color:#475569;line-height:1.6}@keyframes _ngcontent-%COMP%_scaleIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@media(max-width:600px){.embed-container[_ngcontent-%COMP%]{padding:16px}.form-wrapper[_ngcontent-%COMP%]{padding:24px 20px}.form-field.half-width[_ngcontent-%COMP%]{flex:1 1 100%;min-width:100%}}']})};export{ne as LeadCaptureFormComponent};
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.