PageSourceSearch

https://stcdn.leadconnectorhq.com/_preview/Dn13Awm7.js

js leadconnectorhq.com collected 2026-09-24 07:26:36 UTC 10,090 bytes, 1 lines download raw bytes

1import{a1 as Le,ae as Se,a2 as Fe,af as Ie,c as T,r as g,a as we,aw as Ee,ax as J,Y as Z,a4 as Pe,ay as j,az as z,ah as s,M as v,N as m,ai as k,a5 as c,aj as Te,ak as ee,al as L,ag as p,am as Ne,an as $,aA as Ve,ao as te,aB as xe,aC as Oe,aD as le,aE as Me,ap as $e,aF as He,aG as Re,aH as oe,av as ae}from"./CqWH0BZP.js";import{a as Ue,g as qe}from"./DJfpirVv.js";import{R as je,D as ze,j as Ae,O as Be,N as ne,A as De,H as Ye}from"./C3QUmC4Q.js";import{p as Ke}from"./DLVtykdp.js";const Je=Le({__name:"PhoneElement",props:{kind:{type:String},item:{type:Object},formLabelVisible:{type:Boolean},formLabelAlignment:{type:String},phoneCountryIncluded:{type:Object},phoneCountryCode:{type:Object},formattedPhone:{type:Object},locationCountry:{type:String,default:"us"},formFieldsValue:{type:Object},phoneFields:{type:Object},phoneCountryDerived:{type:String},layoutType:{type:[Number,Boolean]},checkFullWidthPosition:{type:Boolean},fontSize:{type:[Number,String]},locationId:{type:String},mediumId:{type:String},errors:{type:Object,default:()=>({})}},emits:["addOrUpdateError","isSlideMovable","customFieldPhoneNumberUpdate","updatePhoneCountryDerived","verifyPhone","updateToken","updateFormFieldsValue","updatePhoneCountryIncluded","updatePhoneCountryCode","updateFormattedPhone"],setup(o,{expose:ie,emit:ue}){const A=Se(),B=Fe(),{t:u}=Ie(),re=t=>t?u("common.phone.your_verification_code_has_been_sent_to",{phone:`<b>${t}</b>`})+"<br />"+u("common.phone.kindly_review"):"",e=o,F=T(()=>{var t;return((t=e.item)==null?void 0:t.enableCountryPicker)!==!1}),b=g(),_=g(),I=g(!1),N=g(!1),C=g(),S=g(0),w=g(""),de=(t,l)=>{w.value="",C.value=t,typeof l=="number"&&(S.value=l)},se=t=>{w.value=u(oe.CHALLENGE_AUTO_RETRY)};we(je(F,{intlTelFunc:()=>{F.value&&_.value&&!b.value&&ne(R)}}));const ve=()=>{Be(),F.value&&_.value&&!b.value&&ne(R)},h=ue;ze(Ye(e,h));const me=t=>{var l,a,n;const i=t.target.value;h("updatePhoneCountryIncluded",{tag:(l=e.item)==null?void 0:l.tag,value:i}),h("updateFormattedPhone",{tag:(a=e.item)==null?void 0:a.tag,value:i}),h("updateFormFieldsValue",{tag:(n=e.item)==null?void 0:n.tag,value:i}),he()},V=T(()=>e.kind=="survey"),ce=Ee.VERIFY_PHONE,D=T(()=>{var t;return e.errors[(t=e.item)==null?void 0:t.tag]}),Y=t=>{h("customFieldPhoneNumberUpdate",t)},pe=t=>{V.value&&h("isSlideMovable",t)};let H=!1;const K=()=>{if(!b.value||H)return;const t=_.value;if(!t)return;const l=b.value.getNumber(),a=b.value.getSelectedCountryData().iso2;h("updatePhoneCountryIncluded",{tag:t.name,value:l}),h("updatePhoneCountryCode",{tag:t.name,value:a?a.toUpperCase():"US"}),Y({tag:t.name})},W=()=>De(_.value),R=()=>{var t,l,a,n;const i=_.value;if(i){const r=(l=e.phoneCountryCode)==null?void 0:l[(t=e.item)==null?void 0:t.tag];b.value=(n=window?.intlTelInput)==null?void 0:n.call(window,i,{preferredCountries:["us","gb","ca","au"],initialCountry:r?.toLowerCase()||((a=e.locationCountry)==null?void 0:a.toLowerCase())||"us"}),i.addEventListener("countrychange",K),i.addEventListener("open:countrydropdown",W)}},he=()=>{var t,l,a;if(!e.item)return;const n=(l=e.phoneCountryIncluded)==null?void 0:l[(t=e.item)==null?void 0:t.tag];(a=e.item)!=null&&a.required&&ae(n)?y(e.item.tag,e.item.error??u("is_required",{label:e.item.label})):y(e.item.tag,null)},ye=()=>{var t,l,a,n,i,r,f;try{if(V.value||!e.item)return;const d=(t=e.phoneCountryIncluded)==null?void 0:t[e.item.tag];e.item.required&&ae(d)?y(e.item.tag,((l=e.item)==null?void 0:l.error)??u("is_required",{label:e.item.label})):d&&!J(d,(n=e.phoneCountryCode)!=null&&n[(a=e.item)==null?void 0:a.tag]?(r=e.phoneCountryCode)==null?void 0:r[(i=e.item)==null?void 0:i.tag]:e.locationCountry)?y(e.item.tag,u("invalid_phone_no")):e.item.enableValidatePhone&&!((f=e.item)!=null&&f.hidden)&&!O.value&&d?y(e.item.tag,u("common.phone.phone_not_verified")):y(e.item.tag,null)}catch{}},x=g(""),U=g(null),E=g(!1),O=g(!1),fe=T(()=>{var t,l,a,n,i,r,f,d,M;return(l=e.formFieldsValue)!=null&&l[(t=e.item)==null?void 0:t.tag]?((a=e.item)==null?void 0:a.enableValidatePhone)&&J((i=e.formFieldsValue)==null?void 0:i[(n=e.item)==null?void 0:n.tag],(f=e.phoneCountryCode)!=null&&f[(r=e.item)==null?void 0:r.tag]?(M=e.phoneCountryCode)==null?void 0:M[(d=e.item)==null?void 0:d.tag]:e.locationCountry):!1}),ge=()=>{var t,l,a,n,i,r,f,d;I.value=!0;const M=(d=(f=window.libphonenumber)==null?void 0:f.parsePhoneNumberFromString((l=e.formFieldsValue)==null?void 0:l[(t=e.item)==null?void 0:t.tag],(n=e.phoneCountryCode)!=null&&n[(a=e.item)==null?void 0:a.tag]?(r=e.phoneCountryCode)==null?void 0:r[(i=e.item)==null?void 0:i.tag]:e.locationCountry))==null?void 0:d.number,_e={locationId:e.locationId,phone:M,type:e.kind,mediumId:e.mediumId,challengeToken:C.value};$fetch(`${B.public.FORMS_SERVICE_URL}
1/forms/verify-phone`,{headers:C.value?{"x-turnstile-visible-wait-ms":String(S.value)}:{},method:"POST",body:_e}).then(q=>{var X;I.value=!1,E.value=!0,U.value=q.token,y((X=e.item)==null?void 0:X.tag,null),Q()}).catch(q=>{I.value=!1,G(q)})},be=()=>{var t,l;const a={locationId:e.locationId,phone:(l=e.formFieldsValue)==null?void 0:l[(t=e.item)==null?void 0:t.tag],type:e.kind,token:U.value,otp:x.value,mediumId:e.mediumId,challengeToken:C.value};$fetch(`${B.public.FORMS_SERVICE_URL}/forms/verify-phone`,{headers:C.value?{"x-turnstile-visible-wait-ms":String(S.value)}:{},method:"POST",body:a}).then(n=>{var i,r;n!=null&&n.ok&&(O.value=!0,E.value=!1,y((i=e.item)==null?void 0:i.tag,null),Q(),h("verifyPhone","Yes"),h("updateToken",{value:U.value,type:"phone",id:(r=e?.item)==null?void 0:r.id}))}).catch(n=>{G(n)})},G=t=>{var l,a;if(t.status===400&&(C.value=void 0,S.value=0,N.value=!1),[429].includes(t.status))C.value=void 0,S.value=0,N.value=!0,y((l=e.item)==null?void 0:l.tag,null);else{const n=qe(t,u)||u("common.errors.verification_failed");y((a=e.item)==null?void 0:a.tag,n)}},Ce=()=>{w.value=u(oe.CHALLENGE_RETRY)},Q=()=>{C.value=void 0,S.value=0,N.value=!1},ke=()=>{var t;x.value="",E.value=!1,y((t=e.item)==null?void 0:t.tag,null)},y=(t,l)=>{h("addOrUpdateError",{tag:t,error:l})};Z(()=>e.phoneCountryDerived,(t,l)=>{t!==l&&F.value&&R()}),Z(()=>{var t,l;return(l=e.phoneCountryCode)==null?void 0:l[(t=e.item)==null?void 0:t.tag]},t=>{t&&b.value&&(H=!0,b.value.setCountry(t.toLowerCase()),H=!1)}),Pe(()=>{try{const t=_.value;b.value&&t!=null&&t.parentNode&&b.value.destroy(),t&&(t.removeEventListener("countrychange",K),t.removeEventListener("open:countrydropdown",W))}catch{}});const P=T(()=>{var t,l;const a=e.layoutType;return typeof a=="number"&&[j.ONE_COLUMN,j.TWO_COLUMN,j.SINGLE_LINE].includes(a)?(t=e.item)!=null&&t.fieldWidthPercentage?((l=e.item)==null?void 0:l.fieldWidthPercentage)<=50:!0:e.layoutType===!0&&e.checkFullWidthPosition});return ie({validate:ye,item:e.item}),(t,l)=>{var a,n,i,r,f;return z((v(),m("div",null,[o.item?(v(),m("div",{key:0,class:k(["form-builder--item field-container",{"d-none":o.item.hidden,"form-builder--item-input":V.value}])},[V.value&&o.item.description!==void 0?(v(),m("label",{innerHTML:o.item.description,class:"item-description",key:"phone-description-"+s(A),for:o.item.tag},null,8,["innerHTML","for"])):c("",!0),o.formLabelVisible?(v(),m("label",{key:1,class:k([s(Te)(o.item.labelAlignment,o.formLabelAlignment),"field-label"]),for:o.item.tag},[ee(L(o.item.label)+" ",1),o.item.required?(v(),m("span",{key:0},"*")):c("",!0)],10,["for"])):c("",!0),p("div",{class:"flex-col"},[z(p("div",{class:k(["phone-input",P.value?"block":"flex"])},[(v(),m("input",{type:"tel",value:(a=o.formattedPhone)==null?void 0:a[o.item.tag],onInput:me,name:o.item.tag,placeholder:!o.formLabelVisible&&o.item.required?o.item.placeholder+"*":o.item.placeholder,key:"phone-input-"+s(A),autocomplete:"off",class:k(F.value?"countryphone":"form-control"),ref:d=>_.value=d,onKeyup:l[0]||(l[0]=d=>Y(o.item)),onKeydown:l[1]||(l[1]=Ne($(d=>pe({}),["prevent"]),["enter"])),"data-q":o.item.hiddenFieldQueryKey,"data-required":o.item.required,id:o.item.tag,disabled:(n=o.item)==null?void 0:n.disabled},null,42,["value","name","placeholder","data-q","data-required","id","disabled"])),fe.value?(v(),m("button",{key:0,onClick:$(ge,["prevent"]),class:k(["verify-phone-btn",P.value?"mt-3":""]),style:Ve({fontSize:`${o.fontSize}px`})},[p("div",{class:"flex"},[I.value?(v(),te(xe,{key:0,style:{"padding-right":"5px","padding-top":"2px","margin-left":"-16px"},loading:I.value,color:"#188bf6",size:"15px"},null,8,["loading"])):c("",!0),p("div",null,L(s(u)("common.phone.verify_phone")),1)])],6)):c("",!0)],2),[[Oe,!E.value&&!O.value]]),O.value?(v(),m("div",{key:0,class:"verified-text"},[p("img",{src:s(Ue),height:"18",width:"18",alt:s(u)("common.phone.verified"),class:"mr-3"},null,8,["src","alt"]),p("span",{innerHTML:s(u)("common.phone.your_phone_has_been_successfully_verified",{phone:`<b>${(i=o.formFieldsValue)==null?void 0:i[o.item.tag]}</b>`})},null,8,["innerHTML"])])):c("",!0),E.value?(v(),m("div",{key:1,class:"verification-container"},[p("p",{innerHTML:re((f=o.formFieldsValue)==null?void 0:f[(r=o.item)==null?void 0:r.tag])}
1,null,8,["innerHTML"]),p("div",{class:k(["phone-input mt-3",P.value||s(le)()?"block":"flex"])},[z(p("input",{type:"text","onUpdate:modelValue":l[2]||(l[2]=d=>x.value=d),maxlength:"6",class:"otp",placeholder:s(u)("common.phone.enter_otp"),"aria-label":s(u)("common.phone.enter_otp")},null,8,["placeholder","aria-label"]),[[Me,x.value]]),p("div",{class:k(P.value||s(le)()?"mt-3 block":"flex")},[p("button",{onClick:$(be,["prevent"]),class:k(["confirm-btn",P.value?"mb-3":""])},L(s(u)("common.phone.confirm_code")),3),p("button",{onClick:$(ke,["prevent"]),class:"reset-btn"},L(s(u)("common.phone.edit_phone")),1)],2)],2)])):c("",!0),o.item.shortLabel?(v(),te(Ke,{key:2},{default:$e(()=>[ee(L(o.item.shortLabel),1)]),_:1})):c("",!0)]),N.value?(v(),m("section",{key:2,class:"recaptcha-container recaptch-top-margin"},[He(s(Re),{mode:"visible",action:s(ce),onSuccess:de,onError:se,onBeforeInteractive:Ce},null,8,["action"]),w.value?(v(),m("p",{key:0},L(w.value),1)):c("",!0)])):c("",!0),D.value?(v(),m("div",{key:3,id:"error-container",class:"error"},L(D.value),1)):c("",!0)],2)):c("",!0)])),[[s(Ae),ve]])}}});export{Je as default};

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.