PageSourceSearch

https://hellokrupet.com/_next/static/chunks/963c1362.3e7eaab4a6c80886.js

js hellokrupet.com collected 2026-10-02 22:20:55 UTC 158,408 bytes, 453 lines download raw bytes

1"use strict";(self.webpackChunkhhgDiscoverV1=self.webpackChunkhhgDiscoverV1||[]).push([[6260],{"6MGn":function(e,t,a){let l;a.r(t),a.d(t,{LeadGen:function(){return LeadGen},LeadGenSubscriptionBox:function(){return LeadGenSubscriptionBox}});var n,o,i,r,s,d,c=a("yabo"),u=a("+OUp"),m=a.n(u),p=a("vH4S"),g=a("sEfC"),h=a.n(g),v=a("U80/"),b=a("oguI"),f=a("8BcA"),y=a.n(f),k=a("eRuS"),E=a("27Mu"),C=a("zbWW"),w=a("C4n1"),x=a("Weom"),_=a("NaoI"),B=a("Kowz"),T=a("TjCH"),S=a("+b9V"),L=a("DtEE"),O=a("RrJ7"),N=a("4wSK"),P=a("B4jj"),I=a("Gsed"),A=a("e+p4"),F=a("YTWV"),j=a("zvUM"),D=a("xRwJ"),$=a("xX6O"),M=a("+PHJ"),z=a("xrdX"),R=a("A9bs"),G=a("rBCA"),W=a("iBNF"),H=a("+Vat"),V=a("xvLD"),U=a("ELYh"),q=a("8vro"),Z=a("6/zu"),Y=a("o6ax"),J=a("O1Tr"),K=a("xzYA"),Q=a("r+aP"),X=a("wBtA"),ee=a("ASXq"),et=a("AJQa"),ea=a("/xS4"),el=a("wC+G");a("xXM3"),a("gY0P"),a("JIJ2"),a("NmYn"),a("NDoz");let en=(0,u.createContext)({});(n=r||(r={})).LightBoxA="LightBoxA",n.LightBoxB="LightBoxB",n.SkinA="SkinA",n.SkinB="SkinB",n.Floating="Floating",n.Tab="Tab",n.InlineA="InlineA",n.InlineB="InlineB",n.CenterTab="CenterTab",n.Sidebar="Sidebar",n.Fullscreen="Fullscreen",n.Slider="Slider";let eo={TextBlock:"TextBlock",NumberBlock:"NumberBlock",DateBlock:"DateBlock",EmailBlock:"EmailBlock",PhoneBlock:"PhoneBlock",PhoneOtpBlock:"PhoneOtpBlock",WhatsappOtpBlock:"WhatsappOtpBlock",ZaloOtpBlock:"ZaloOtpBlock",LocationBlock:"LocationBlock",LinkButtonBlock:"LinkButtonBlock",RadioBlock:"RadioBlock",DropdownBlock:"DropdownBlock",CheckboxBlock:"CheckboxBlock",TncBlock:"TncBlock",TitleBlock:"TitleBlock",SubtitleBlock:"SubtitleBlock"},ei=[eo.TextBlock,eo.NumberBlock,eo.DateBlock,eo.EmailBlock,eo.PhoneBlock,eo.PhoneOtpBlock,eo.WhatsappOtpBlock,eo.ZaloOtpBlock,eo.LocationBlock,eo.RadioBlock,eo.DropdownBlock,eo.CheckboxBlock,eo.TncBlock],leadGenFieldNamePhone=e=>e.filter(({name:e})=>[eo.PhoneBlock,eo.PhoneOtpBlock,eo.WhatsappOtpBlock,eo.ZaloOtpBlock].includes(e)).map(({data:e})=>e.value),leadGenFieldRequired=e=>(null==e?void 0:e.length)?e.map(({data:e,name:t,id:a})=>{let{required:l,value:n}=e;return t===eo.TncBlock&&a&&l?`TNC-${a}`:l&&void 0===e.newtab?n:void 0}).filter(Boolean):[],er=["name","email","birthday","phone","gender"],es={"vi-VN":{popupLang:"vi",countryCode:"vn",countryCodeNumber:84},"id-ID":{popupLang:"id",countryCode:"id",countryCodeNumber:62},"th-TH":{popupLang:"th",countryCode:"th",countryCodeNumber:66},"ms-MY":{popupLang:"ms",countryCode:"my",countryCodeNumber:60},"zh-TW":{popupLang:"zh",countryCode:"tw",countryCodeNumber:886},"km-KH":{popupLang:"km",countryCode:"kh",countryCodeNumber:855},"my-MM":{popupLang:"my",countryCode:"mm",countryCodeNumber:95},"hi-IN":{popupLang:"hi",countryCode:"in",countryCodeNumber:91}},mappingSSOToLead=e=>{var t,a;try{let{id:l,area_code:n}=e;if(!e||!l)return;let o={};for(let t of er)if(t in e&&void 0!==(null==e?void 0:e[t])){let a=e[t];if("birthday"===t){let e=y()(a,"YYYY-MM-DD",!0);e.isValid()&&(o.birthday=e.toDate())}else"gender"===t?o.gender=a.toString():"phone"===t&&void 0!==n?o.phone=n+a:o[t]=a}return((null===(t=null==o?void 0:o.email)||void 0===t?void 0:t.includes("@hhg.com"))||(null===(a=null==o?void 0:o.email)||void 0===a?void 0:a.includes("@facebook.com")))&&delete o.email,Object.values(o).length?o:void 0}catch(e){return}},formatCampaignDetail=e=>{if(!e)return{};try{let{extra_fields:t,thank_you_image:a}=e||{},{textBlocks:l,imageBlocks:n,listBlockAdded:o,listBlockThankyou:i,actionBlocks:r}=t,s=JSON.parse(l),d=JSON.parse(n),c=JSON.parse(o),u=JSON.parse(i),m=JSON.parse(r),p={image:{src:a}};return u.forEach(e=>{let{name:t,data:a}=e||{},{value:l,align:n,newtab:o,url:i}=a||{};switch(t){case eo.TitleBlock:p.title={htmlText:l,align:n};case eo.SubtitleBlock:p.description={htmlText:l,align:n};case eo.LinkButtonBlock:p.button={htmlText:l,newtab:o,url:i}}}),Object.assign(Object.assign({},e),{extra_fields:Object.assign(Object.assign({},t),{textBlocks:s,imageBlocks:d,listBlockAdded:c,listBlockThankyou:u,actionBlocks:m}),ThankYouBlock:p})}catch(e){return{}}},ed={LINKS:1,TAGS:2},ec="https://dev.leadgen.hellobacsi.com/",eu={MOBILE:1,DESKTOP:2},em="";ec.includes("localhost")&&(ec="https://dev.leadgen.hellobacsi.com/"),location.hostname.includes("marrybaby.vn")&&(em="pink");let ep="https://"+location.hostname+location.pathname+location.search;ep=ep.toLowerCase(),sessionStorage.getItem("insider_object")&&(window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")));let eg=document.documentElement.lang,eh={"vi-VN":{popupLang:"vi",countryCode:"vn",countryCodeNumber:84},"id-ID":{popupLang:"id",countryCode:"id",countryCodeNumber:62},"th-TH":{popupLang:"th",countryCode:"th",countryCodeNumber:66},"ms-MY":{popupLang:"ms",countryCode:"my",countryCodeNumber:60},"zh-TW":{popupLang:"zh",countryCode:"tw",countryCodeNumber:886},"km-KH":{popupLang:"km",countryCode:"kh",countryCodeNumber:855},"my-MM":{popupLang:"my",countryCode:"mm",countryCodeNumber:95},"hi-IN":{popupLang:"hi",countryCode:"in",countryCodeNumber:91}},ev=eh[eg]||eh["vi-VN"],eb={1:"Asia/Ho_Chi_Minh",10:"Asia/Ho_Chi_Minh",11:"Asia/Ho_Chi_Minh",12:"Asia/Ho_Chi_Minh",2:"Asia/Jakarta",3:"Asia/Bangkok",4:"Asia/Phnom_Penh",5:"Asia/Kuala_Lumpur",6:"Asia/Taipei",7:"Asia/Yangon",8:"Asia/Kolkata",9:"Asia/Manila"},ef=[r.LightBoxA,r.LightBoxB,r.InlineA,r.InlineB,r.Slider,r.CenterTab],formatLeadGenFormValue=(e={},t)=>{let a={};for(let l of t){let{data:t}=l||{},{value:n}=t||{};n in e&&(a[n]=e[n])}return a},ey=new class{constructor(){this.apiSsoUrl="https://staging-id.hellobacsi.com/",this.apiLeadUrl="https://dev.leadgen.hellobacsi.com/",this.apiSubotUrl="https://staging-service-subot.hellohealthgroup.com/"}},ek={GET:"get",POST:"POST"},eE={UNAUTHORIZED:"UNAUTHORIZED"},eC={call(e){var{url:t,data:a}
1=e,l=(0,c.a)(e,["url","data"]);let n=(0,E.Ri)(k.B);return(l.body=JSON.stringify(a),l.headers={"Content-Type":"application/json",Authorization:`Bearer ${n}`},n)?fetch(`${ey.apiSsoUrl}${t}`,l).then(e=>e.json()).catch(()=>({})):Promise.reject({code:eE.UNAUTHORIZED,_data:""})}},ew={call(e){var{url:t,data:a}=e,l=(0,c.a)(e,["url","data"]);return l.body=JSON.stringify(a),l.headers={"Content-Type":"application/json"},fetch(`${ey.apiLeadUrl}${t}`,l).then(e=>e.json()).catch(()=>({}))}},ex={call(e){var{url:t,data:a}=e,l=(0,c.a)(e,["url","data"]);return l.body=JSON.stringify(a),l.headers={"Content-Type":"application/json"},fetch(`${ey.apiSubotUrl}${t}`,l).then(e=>e.json()).catch(()=>({}))}},e_={whatsapp:"api/sms/whatsapp_otp",phone:"api/sms/otp",zalo:"api/sms/zalo_otp"},eB={whatsapp:"api/sms/whatsapp_verify",phone:"api/sms/verify",zalo:"api/sms/zalo_verify"},eT={campaignGetById:e=>ew.call({url:`api/internal/campaign/${e}`,method:"get"}),getCampaignByCode:e=>ew.call({url:`api/v2/campaign/${e}`,method:ek.GET}),getSubscriptionBoxInfo:({category:e,site:t,slug:a})=>ew.call({url:`api/campaign/get-title?category=${e}&site=${t}&slug=${a}`,method:ek.GET}),postSubscriptionBoxLead:({data:e})=>ew.call({url:"api/v2/subscription-box",method:ek.POST,data:e}),postUserInfoFromLeadGen:({name:e})=>eC.call({url:"api/user/update",method:ek.POST,data:{name:e}}),campaignPostImpression:({code:e,action:t,title_article:a,ga_client_id:l,cookie_id:n,extra:o,url:i,referrer:r})=>ew.call({url:`api/campaign/${e}/impression`,method:ek.POST,data:{action:t,title_article:a,cookie_id:n,ga_client_id:l,url:i,extra:o,referrer:r}}),trackingSubscription:e=>ew.call({url:"api/collection/tracking-subscription",method:ek.POST,data:e}),validateEmailOrPhoneOnSubot:({bot_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),ex.call({url:"frontend/api/subot-campaign/check",method:"post",data:{bot_id:e,email:t,phone:l}})},validateEmailOrPhoneOnLeadGen:({campaign_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),ew.call({url:"api/subot-campaign/check",method:"post",data:{campaign_id:e,email:t,phone:l}})},validatePhoneNumberOnLeadGen:({campaign_id:e,phone:t})=>ew.call({url:"api/collection/log/check-phone-with-campaign",method:"post",data:{campaign_id:e,phone:t}}),sendSMSOtpLead:({phone:e,type:t})=>ew.call({url:e_[t],method:"post",data:{phone_number:"phone"===t?e.replace("+",""):e}}),verifyOtpLead:({phone:e,otp:t,type:a})=>ew.call({url:eB[a],method:"post",data:{otp_code:t,phone_number:"phone"===a?e.replace("+",""):e}}),postPhoneToCtaSubmit:({data:e})=>ew.call({url:"api/collection/cta-submit",method:ek.POST,data:e})},checkUsedEmailOrPhone=(e,t,a)=>(0,c._)(void 0,void 0,void 0,function*(){let l="email"in a?"email":"phone",n="email"in a?a.email:a.phone,o="email"in a?"validator.emailUsed":"validator.phoneUsed",i=yield eT.validateEmailOrPhoneOnLeadGen({campaign_id:[e],[l]:n});if("SubmitLeadWithBotId_ERR_001"===i._errorCode||"SubmitLeadWithBotId_ERR_002"===i._errorCode)return o;if(t.length){let e=yield eT.validateEmailOrPhoneOnSubot({bot_id:t,[l]:n});if("CheckSuBotLeadTool_ERR_001"===e._errorCode)return o}}),checkUsedPhoneOnly=(e,t)=>(0,c._)(void 0,void 0,void 0,function*(){var a;let l=yield eT.validatePhoneNumberOnLeadGen({campaign_id:e,phone:t});if((null===(a=null==l?void 0:l._messages)||void 0===a?void 0:a[0])==="Phone was exist")return"validator.phoneUsed"}),eS={email:{},phone:{},phoneOnly:{}},checkUsedEmailOrPhoneWithCache=(e,t,a)=>(0,c._)(void 0,void 0,void 0,function*(){let l="email"in a?"email":"phone",n="email"in a?a.email:a.phone,o="email"in a?"validator.emailUsed":"validator.phoneUsed";if(eS[l][n]){if(eS[l][n].value)return o;if(!eS[l][n].value&&eS[l][n].expire>Date.now())return""}let i=yield checkUsedEmailOrPhone(e,t,a);return i?eS[l][n]={value:!0}:eS[l][n]={value:!1,expire:Date.now()+6e4},i}),checkUsedPhoneOnlyWithCache=(e,t)=>(0,c._)(void 0,void 0,void 0,function*(){if(eS.phoneOnly[t]){if(eS.phoneOnly[t].value)return"validator.phoneUsed";if(!eS.phoneOnly[t].value&&eS.phoneOnly[t].expire>Date.now())return""}let a=yield checkUsedPhoneOnly(e,t);return a?eS.phoneOnly[t]={value:!0}:eS.phoneOnly[t]={value:!1,expire:Date.now()+6e4},a}),clearCacheUsedEmailOrPhone=()=>{eS.email={},eS.phone={},eS.phoneOnly={}};var eL={"validator.required":"This field is required.","validator.remote":"Please fix this field.","validator.email":"Please enter a valid email address.","validator.phone":"Please input correct phone number.","validator.url":"Please enter a valid URL.","validator.date":"Please enter a valid date.","validator.dateISO":"Please enter a valid date (ISO).","validator.number":"Please enter a valid number.","validator.digits":"Please enter only digits.","validator.creditcard":"Please enter a valid credit card number.","validator.equalTo":"Please enter the same value again.","validator.accept":"Please enter a value with a valid extension.","validator.maxlength":"jQuery.validator.format('Please enter no more than {0} characters.","validator.minlength":"jQuery.validator.format('Please enter at least {0} characters.","validator.rangelength":"jQuery.validator.format('Please enter a value between {0} and {1} characters long.","validator.range":"jQuery.validator.format('Please enter a value between {0} and {1}.","validator.max":"jQuery.validator.format('Please enter a value less than or equal to {0}.","validator.min":"jQuery.validator.format('Please enter a value greater than or equal to {0}.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","validator.dateInvalid":"This date is not val
1id, please update.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}","lead.otp.phoneLabel":"Phone OTP","lead.otp.phonePlaceholder":"Enter OTP","lead.empty.title":"Oops, seem your information is empty, do you want to submit the information again?","lead.empty.cancel":"Cancel","lead.empty.submitAgain":"Submit again","inlineFreebie.freeSample.title":"Free Sample","inlineFreebie.luckyDrawGift.title":"Lucky-draw Gift","inlineFreebie.value":"Value","common.day":"Day","common.month":"Month","common.year":"Year"},eO={"validator.required":"此為必填欄位","validator.email":"請填入有效的 email 地址","validator.number":"請填入有效的電話號碼","validator.digits":"此欄位僅能輸入數字","validator.maxlength":"請輸入少於 {0} 位數","validator.minlength":"請輸入至少 {0} 位數","validator.phone":"請填入有效的電話號碼","validator.emailUsed":"此電子郵件已被使用於此活動。","validator.phoneUsed":"您的手機號碼已被使用於此活動。","validator.dateInvalid":"此日期無效,請更新.","lead.otp.title":"輸入 OTP","lead.otp.desc":"我們已將 OTP 發送到您的手機號碼 {phone}","lead.otp.verify":"驗證","lead.otp.resend":"重新發送 OTP {timer}","lead.otp.phoneLabel":"電話 OTP","lead.otp.phonePlaceholder":"輸入 OTP","lead.empty.title":"哎呀,您的資訊似乎是空的,您想要重新提交資訊嗎?","lead.empty.cancel":"取消","lead.empty.submitAgain":"重新提交","inlineFreebie.freeSample.title":"免費試用","inlineFreebie.luckyDrawGift.title":"幸運抽獎禮品","inlineFreebie.value":"價值","common.day":"日","common.month":"月","common.year":"å¹´"};let eN={"en-PH":eL,"vi-VN":{"validator.required":"Vui l\xf2ng điền mục n\xe0y","validator.email":"Vui l\xf2ng điền email c\xf3 thật.","validator.number":"Vui l\xf2ng điền số c\xf3 thật","validator.digits":"Vui l\xf2ng chỉ điền số","validator.maxlength":"Vui l\xf2ng điền dưới {0} số","validator.minlength":"Vui l\xf2ng điền hÆ¡n {0} số","validator.remote":"H\xe3y sá»­a cho đ\xfang.","validator.url":"H\xe3y nhập URL.","validator.date":"H\xe3y nhập ng\xe0y.","validator.dateISO":"H\xe3y nhập ng\xe0y (ISO).","validator.creditcard":"H\xe3y nhập số thẻ t\xedn dụng.","validator.equalTo":"H\xe3y nhập th\xeam lần nữa.","validator.extension":"Phần mở rộng kh\xf4ng đ\xfang.","validator.rangelength":"H\xe3y nhập từ {0} đến {1} k\xed tá»±.","validator.range":"H\xe3y nhập từ {0} đến {1}.","validator.max":"H\xe3y nhập từ {0} trở xuống.","validator.min":"H\xe3y nhập từ {0} trở l\xean.","validator.phone":"Nhập đ\xfang định dạng số điện thoại","validator.emailUsed":"Email n\xe0y đ\xe3 được sá»­ dụng.","validator.phoneUsed":"Số điện thoại n\xe0y đ\xe3 được sá»­ dụng.","validator.dateInvalid":"Ng\xe0y n\xe0y kh\xf4ng hợp lệ, vui l\xf2ng cập nhật.","lead.otp.title":"Nhập OTP","lead.otp.desc":"Ch\xfang t\xf4i đ\xe3 gá»­i OTP đến số điện thoại cá»§a bạn {phone}","lead.otp.verify":"X\xe1c minh","lead.otp.resend":"Gá»­i lại OTP {timer}","lead.otp.phoneLabel":"Nhập OTP","lead.otp.phonePlaceholder":"Nhập OTP","lead.empty.title":"Oops, c\xf3 vẻ như th\xf4ng tin cá»
1§a bạn đang trống. Bạn c\xf3 muốn gá»­i lại th\xf4ng tin kh\xf4ng?","lead.empty.cancel":"Há»§y","lead.empty.submitAgain":"Gá»­i lại","inlineFreebie.freeSample.title":"D\xf9ng thá»­ miễn ph\xed","inlineFreebie.luckyDrawGift.title":"Phần thưởng may mắn","inlineFreebie.value":"Trị gi\xe1","common.day":"Ng\xe0y","common.month":"Th\xe1ng","common.year":"Năm"},"hi-IN":{"validator.required":"इस क्षेत्र की आवश्यकता है।","validator.email":"कृपया एक मान्य ईमेल पता दर्ज करें","validator.number":"कृपया एक वैध संख्या दर्ज करें","validator.digits":"कृपया केवल अंक दर्ज करें","validator.maxlength":"कृपया {0} अक्षर से अधिक दर्ज न करें","validator.minlength":"कृपया कम से कम {0} अक्षर दर्ज करें","validator.phone":"कृपया एक वैध संख्या दर्ज करें","validator.dateInvalid":"यह तिथि मान्य नहीं है, कृपया अपडेट करें।","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}","lead.empty.title":"ऊप्स! लगता है आपकी जानकारी खाली है। क्या आप जानकारी फिर से सबमिट करना चाहते हैं?","lead.empty.cancel":"रद्द करें","lead.empty.submitAgain":"फिर से सबमिट करें","inlineFreebie.freeSample.title":"मुफ्त नमूना","inlineFreebie.luckyDrawGift.title":"लकी-ड्रा गिफ्ट","inlineFreebie.value":"मूल्य","common.day":"साल","common.month":"महीना","common.year":""},"id-ID":{"validator.required":"Kolom ini wajib diisi","validator.email":"Tolong daftarkan email yang valid","validator.number":"Tolong daftarkan nomor telepon yang valid","validator.digits":"Tolong masukkan angka saja","validator.maxlength":"Jangan memasukkan lebih dari {0} karakter","validator.minlength":"Tolong ketik sedikitnya {0} karakter","validator.phone":"Tolong daftarkan nomor telepon yang valid","validator.emailUsed":"Email sudah digunakan untuk kampanye ini.","validator.phoneUsed":"Nomor telepon Anda sudah digunakan untuk kampanye ini.","validator.dateInvalid":"Tanggal ini tidak valid, silakan perbarui","lead.otp.title":"Masukkan OTP","lead.otp.desc":"Kami telah mengirimkan OTP ke nomor ponsel Anda {phone}","lead.otp.verify":"Verifikasi","lead.otp.resend":"Kirim Ulang OTP {timer}","lead.otp.phoneLabel":"OTP Telepon","lead.otp.phonePlaceholder":"Masukkan OTP","lead.empty.title":"Oops, sepertinya informasi Anda kosong. Apakah Anda ingin mengirimkan informasi lagi?","lead.empty.cancel":"Batal","lead.empty.submitAgain":"Kirim lagi","inlineFreebie.freeSample.title":"Sampel Gratis","inlineFreebie.luckyDrawGift.title":"Hadiah Undian","inlineFreebie.value":"Nilai","common.day":"Hari","common.month":"Bulan","common.year":"Tahun"},"ms-MY":{"validator.required":"Bahagian ini wajib diisi.","validator.email":"Sila masukkan alamat emel yang sah.","validator.number":"Sila masukkan no telefon yang sah.","validator.digits":"Sila masukkan nombor digit sahaja.","validator.maxlength":"Sila masukkan tidak lebih dari {0} aksara","validator.minlength":"Sila masukkan sekurang-kurangnya {0} aksara","validator.phone":"Sila masukkan no telefon yang sah.","validator.emailUsed":"Emel sudah digunakan untuk kempen ini.","validator.phoneUsed":"Nombor telefon anda sudah digunakan untuk kempen ini.","validator.dateInvalid":"Tarikh ini tidak sah, sila kemas kini","lead.otp.title":"Masukkan OTP","lead.otp.desc":"Kami telah menghantar OTP ke nombor telefon bimbit anda {phone}","lead.otp.verify":"Sahkan","lead.otp.resend":"Hantar semula OTP {timer}","lead.otp.phoneLabel":"OTP Telefon","lead.otp.phonePlaceholder":"Masukkan OTP","lead.empty.title":"Oops, nampaknya maklumat anda kosong. Adakah anda ingin menghantar maklumat semula?","lead.empty.cancel":"Batal","lead.empty.submitAgain":"Hantar semula","inlineFreebie.freeSample.title":"Sampel Percuma","inlineFreebie.luckyDrawGift.title":"Hadiah Undian","inlineFreebie.value":"Nilai","common.day":"Hari","common.month":"Bulan","common.year":"Tahun"},"my-MM":{"validator.required":"ဒီနေရာမှာ ဖြည့်ဖို့ လိုအပ်ပါတယ်","validator.email":"မှန်ကန်သော အီးမေးလ်လိပ်စာထည့်သွင်းပါ","validator.number":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.digits":"နံပါတ်များသာဖြည့်ပါ","validator.maxlength":"ကျေးဇူးပြု၍ {0} ထပ်မပိုသော ဂဏန်းများသာဖြည့်ပါ","validator.minlength":"ကျေးဇူးပြု၍ အနညá€
1ºá€¸á€†á€¯á€¶á€¸ {0} ဂဏန်းဖြည့်ပါ","validator.phone":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.emailUsed":"ဤအေကာင့်အတွက် အီးမေးလ်ကို အသုံးပြုပြီးဖြစ်ပါသည်။","validator.phoneUsed":"ဤအေကာင့်အတွက် သင့်ဖုန်းနံပါတ်ကို အသုံးပြုပြီးဖြစ်ပါသည်။","validator.dateInvalid":"ယနေ့စွဲမှားနေသည်၊ ကျေးဇူးပြု၍ ပြင်ဆင်ပါ။","lead.otp.title":"OTP ကိုထည့်ပါ","lead.otp.desc":"ကျွန်ုပ်တို့သည် OTP ကိုသင့်ဖုန်းနံပါတ် {phone} သို့ပို့ခဲ့သည်","lead.otp.verify":"အတည်ပြုပါ","lead.otp.resend":"OTP ကိုထပ်မံပို့ရန် {timer}","lead.otp.phoneLabel":"ဖုန်း OTP","lead.otp.phonePlaceholder":"OTP ကိုထည့်ပါ","lead.empty.title":"အုပ်စ်! သင့်အချက်အလက်သည် ဗလာဖြစ်နေသလိုဖြစ်သည်။ ထပ်မံတင်သွင်းလိုပါသလား?","lead.empty.cancel":"မလုပ်ဆောင်ပါ","lead.empty.submitAgain":"ထပ်မံတင်သွင်းပါ","inlineFreebie.freeSample.title":"အခမဲ့အစားအစာ","inlineFreebie.luckyDrawGift.title":"အခမဲ့အစားအစာ","inlineFreebie.value":"တန်ဖိုး","common.day":"ရက်","common.month":"လ","common.year":"နှစ်"},"km-KH":{"validator.required":"ព័ត៌មាន​ចាំបាច់​ដែល​ត្រូវ​បំពេញ","validator.email":"សូម​វាយ​អាសយដ្ឋាន​អ៊ីម៉ែល​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.number":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.digits":"វាយ​បញ្ចូល​បាន​តែ​លេខ​ប៉ុណ្ណោះ","validator.maxlength":"សូម​វាយ​បញ្ចូលកុំ​ឲ្យ​លើស {0} តួអក្សរ","validator.minlength":"សូម​វាយ​បញ្ចូល​តិច​បំផុត {0} តួអក្ស","validator.phone":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.emailUsed":"អ៊ីមែលត្រូវបានប្រើប្រាស់សម្រាប់យុទ្ធនាការនេះរួចហើយ។","validator.phoneUsed":"លេខទូរស័ព្ទរបស់អ្នកត្រូវបានប្រើប្រាស់សម្រាប់យុទ្ធនាការនេះរួចហើយ។","validator.dateInvalid":"កាលបរិច្ឆេទនេះមិនត្រឹមត្រូវទេ សូមធ្វើបច្ចុប្បន្នភាព។","lead.otp.title":"បញ្ចូល OTP","lead.otp.desc":"យើងបានផ្ញើ OTP ទៅកាន់លេខទូរសព្ទរបស់អ្នក {phone}","lead.otp.verify":"ផ្ទៀងផ្ទាត់","lead.otp.resend":"ផ្ញើ OTP ម្តងទៀត {timer}","lead.otp.phoneLabel":"OTP ទូរស័ព្ទ","lead.otp.phonePlaceholder":"បញ្ចូល OTP","lead.empty.title":"អូុបស! ហាក់ដូចជាព័ត៌មានរបស់អ្នកទទេ។ តើអ្នកចង់ដាក់ស្នើព័ត៌មានម្តងទៀតទេ?","lead.empty.cancel":"លុប​ចោល","lead.empty.submitAgain":"ដាក់ស្នើម្ដងទៀត","inlineFreebie.freeSample.title":"សំបុត្រស្រង់ពិន័យ","inlineFreebie.luckyDrawGift.title":"សំបុត្រស្រង់ពិន័យ","inlineFreebie.value":"តម្លៃ","common.day":"ឆ្នាំ","common.month":"ខែ","common.year":"ថ្ងៃ"},"zh-TW":eO,"zh-SG":eO,"th-TH":{"validator.required":"ต้องระบุข้อมูลในช่องนี้","validator.email":"กรุณาใส่อีเมล์ที่ถูกต้อง","validator.number":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.digits":"กรุณาส่เฉพาะตัวเลข","validator.maxlength":"กรุณาใส่ตัวเลขมากกว่า {0} หลัก","validator.minlength":"กรุณาใส่ตัวเลขอย่างน้อย {0} หลัก","validator.phone":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.emailUsed":"อีเมลนี้ถูกใช้สำหรับแคมเปญนี้แล้ว","validator.phoneUsed":"หมายเลขโทรศัพท์ของคุณถูกใช้สำหรับแคมเปญนี้แล้ว","validator.dateInvalid":"วันที่นี้ไม่ถูกต้อง โปรดอัปเดต","lead.otp.title":"ป้อน OTP","lead.otp.desc":"เราได้ส่ง OTP ไปยังหมายเลขโทรศัพท์มือถือของคุณ {phone}","lead.otp.verify":"ยืนยัน","lead.otp.resend":"ส่ง OTP อีกครั้ง {timer}","lead.otp.phoneLabel":"OTP โทรศัพท์","lead.otp.phonePlaceholder":"ป้อน OTP","lead.empty.title":"อุ๊ปส์! ดูเหมือนว่าข้อมูลของคุณว่างเปล่า คุณต้องการส่งข้อมูลอีกครั้งหรือไม่?","lead.empty.cancel":"ยกเลิก","lead.empty.submitAgain":"ส่งอีกครั้ง","inlineFreebie.freeSample.title":"ตัวอย่างฟรี","inlineFreebie.luckyDrawGift.title":"ของรางวัลที่ถูกรางวัล","inlineFreebie.value":"ค่า","common.day":"วัน","common.month":"เดือน","common.year":"ปี"},"tl-PH":eL},getTranslations=e=>{let t=Object.assign(Object.assign({},C.t[e]),eN[e]);return t||eN["en-PH"]},eP=(0,u.createContext)(null),LeadGenTranslationProvider=({locale:e,formatMessage:t,children:a})=>{let l=(0,u.useMemo)(()=>({locale:e,values:getTranslations(e)}),[e]);return m().createElement(eP.Provider,{value:t||null},t?a:m().createElement(x.T.Provider,{value:l},a))},useLeadGenTranslations=()=>{let e=(0,u.useContext)(eP),{t:t,locale:a}=(0,w.u)(),l=(0,u.useMemo)(()=>e?(t,a)=>e({id:t,defaultMessage:t},a):t,[e,t]);return{t:l,locale:a}},[eI,eA,eF]=(0,v.c)(),useLeadFormConfig$1=({listBlockAdded:e=[],validatingPhoneRef:t,validatingEmailRef:l,campaignId:n,campaign_subot_id:o=[],userInfo:i})=>{let{t:r}=useLeadGenTranslations(),s=(0,u.useMemo)(()=>formatLeadGenFormValue(mappingSSOToLead(i),e),[null==i?void 0:i.id]);(0,u.useEffect)(()=>{window.intlTelInputUtils||a("cfI3")},[]);let d=(0,u.useMemo)(()=>{let a=["TextBlock","NumberBlock","EmailBlock","PhoneBlock","DateBlock","CheckboxBlock","RadioBlock","DropdownBlock","PhoneOtpBlock","WhatsappOtpBlock","ZaloOtpBlock","LocationBlock","TncBlock"],withSharedCheck=(e,t,a)=>l=>{var n;let o=null===(n=null==a?void 0:a.data)||void 0===n?void 0:n.required;if(m.current.isTouched(e))return(void 0===l||""===l||Array.isArray(l)&&0===l.length)&&o?r("validator.required"):null==t?void 0:t(l)};return e.filter(e=>a.includes(e.name)).reduce((e,a)=>{var i;let s=null===(i=a.data.required)||void 0===i||i;return"NumberBlock"===a.name?Object.assign(Object.assign({},e),{[a.data.value]:withSharedCheck(a.data.value,e=>{if(e&&isNaN(Number(e)))return r("validator.number")},a)}):"EmailBlock"===a.name?Object.assign(Object.assign({},e),{[a.data.value]:withSharedCheck(a.data.value,e=>{if(e&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return r("validator.email");e&&(l.current=!0,setTimeout(()=>{m.current.setFieldError(a.data.value,"Validating..."),checkUsedEmailOrPhoneWithCache(n,o,{email:e}).then(e=>{e?m.current.setFieldError(a.data.value,r(e)):m.current.clearFieldError(a.data.value),l.current=!1}
1).catch(e=>{console.error(e),m.current.setFieldError(a.data.value,e.message||"Something went wrong"),l.current=!1})},200))},a)}):"PhoneBlock"===a.name||"PhoneOtpBlock"===a.name||"ZaloOtpBlock"===a.name||"WhatsappOtpBlock"===a.name?Object.assign(Object.assign({},e),{[a.data.value]:withSharedCheck(a.data.value,e=>{if(e&&window.intlTelInputUtils&&!window.intlTelInputUtils.isValidNumber(String(e),ev.countryCode))return r("validator.phone");e&&(t.current=!0,setTimeout(()=>{m.current.setFieldError(a.data.value,"Validating..."),a.data.singleSubmission?checkUsedPhoneOnlyWithCache(n,e).then(e=>{e?m.current.setFieldError(a.data.value,r(e)):m.current.clearFieldError(a.data.value),t.current=!1}).catch(e=>{console.error(e),m.current.setFieldError(a.data.value,e.message||"Something went wrong"),t.current=!1}):checkUsedEmailOrPhoneWithCache(n,o,{phone:e}).then(e=>{e?m.current.setFieldError(a.data.value,r(e)):m.current.clearFieldError(a.data.value),t.current=!1}).catch(e=>{console.error(e),m.current.setFieldError(a.data.value,e.message||"Something went wrong"),t.current=!1})},200))},a)}):"DateBlock"===a.name?Object.assign(Object.assign({},e),{[a.data.value]:withSharedCheck(a.data.value,e=>{if(e&&isNaN(Date.parse(e)))return r("validator.date")},a)}):"TncBlock"===a.name?Object.assign(Object.assign({},e),{["TNC-"+a.id]:withSharedCheck("TNC-"+a.id,e=>{if(s&&!e)return r("validator.required")},a)}):Object.assign(Object.assign({},e),{[a.data.value]:withSharedCheck(a.data.value,void 0,a)})},{})},[e.map(e=>e.name).join(",")]),c=eF({validateInputOnChange:!0,clearInputErrorOnChange:!0,validate:d,initialValues:s}),m=(0,u.useRef)(c);return m.current=c,{form:c,validateObj:d}},Component=({campaign:e,onClose:t,onOtherSubmit:a,onSubmit:l,showThankyou:n,setShowThankyou:o,locale:i,children:r,showEmpty:s,setShowEmpty:d,userInfo:c})=>{var p,g;let h=e.extra_fields,v=e.id,b=e.bot_id||[],f=JSON.parse(h.listBlockAdded),y=JSON.parse(h.actionBlocks),k=JSON.parse(h.textBlocks),E=(null===(g=null===(p=null==k?void 0:k.titleBlock)||void 0===p?void 0:p.data)||void 0===g?void 0:g.value)||"",C=k.subtitleBlock.data.value,w=(0,u.useRef)(!1),x=(0,u.useRef)(!1),_=useLeadFormConfig$1({listBlockAdded:f,validatingPhoneRef:w,validatingEmailRef:x,campaignId:v,campaign_subot_id:b,userInfo:c}),[B,T]=(0,u.useState)(null),[S,L]=(0,u.useState)(null);return(0,u.useEffect)(()=>{clearCacheUsedEmailOrPhone()},[]),e?m().createElement(en.Provider,{value:{campaignId:v,campaign_subot_id:b,heading:E,description:C,listBlockAdded:f,textBlocks:k,actionBlocks:y,leadFormConfig:_,validatingEmailRef:x,validatingPhoneRef:w,formRef:{current:S},setFormRef:L,locale:i,onClose:()=>{B?T(null):null==t||t()},onOtherSubmit:a,showOtpPhone:B,setShowOtpPhone:T,onSubmit:l,showThankyou:n,setShowThankyou:o,showEmpty:s,setShowEmpty:d}},r):null},Description=e=>{var t=(0,c.a)(e,[]);let{description:a}=(0,u.useContext)(en);return a?m().createElement(B.T,Object.assign({size:"p3"},t),a):null},ej=(0,u.createContext)({});var eD=(0,p.createStyles)(()=>({control:{}}));let e$=["places"],LocationBlock=({name:e,placeholder:t,locale:l,required:n=!0})=>{var o;let i=eA(),[r,s]=(0,u.useState)(""),[d,c]=(0,u.useState)(""),{predictions:p}=(0,j.u)(r,"","tl-PH"===l?"en":null===(o=null==l?void 0:l.split("-"))||void 0===o?void 0:o[0]),[g,h]=(0,u.useState)(null),[v,b]=(0,u.useState)(!1),f=(0,u.useRef)(Math.random().toString(36).substring(7)),y=(0,u.useMemo)(()=>{let e=p.map(e=>({value:e.description,label:e.description})),t=e.find(e=>e.value===d);return!d||t?e:[{value:d,label:d}].concat(e)},[p,d]);return((0,u.useEffect)(()=>{var e,t,l;(null===(l=null===(t=null===(e=null==window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.places)||void 0===l?void 0:l.AutocompleteService)?b(!0):a.e(3139).then(a.bind(a,"GcSG")).then(e=>{h(()=>e.LoadScript),setTimeout(()=>{b(!0)},200)})},[]),v)?m().createElement(m().Fragment,null,g&&m().createElement(g,{googleMapsApiKey:j.G,libraries:e$,loadingElement:m().createElement(m().Fragment,null)}),m().createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":e,"data-control":"text"}),m().createElement(T.S,Object.assign({className:"lead-modal__form-control",label:t,placeholder:t,withAsterisk:n,name:e,data:y,searchValue:r,onSearchChange:e=>{s(e)},filter:()=>!0,clearable:!0,searchable:!0,onChange:e=>c(e||""),icon:m().createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},m().createElement("path",{d:"M10 9.792q.605 0 1.032-.427.426-.428.426-1.032 0-.603-.426-1.031A1.4 1.4 0 0 0 10 6.875q-.604 0-1.032.427a1.4 1.4 0 0 0-.426 1.031q0 .604.426 1.032.428.426 1.032.427m0 8.083q-.145 0-.292-.042a.7.7 0 0 1-.27-.145Q6.478 15 5.01 12.708 3.54 10.418 3.54 8.5q0-3.021 1.949-4.823T10 1.875t4.51 1.802q1.95 1.802 1.949 4.823 0 1.917-1.468 4.208-1.47 2.292-4.427 4.98a.7.7 0 0 1-.271.145 1 1 0 0 1-.292.042",fill:"#8C8C8C"})),autoComplete:"no-auto-complete-"+f.current,rightSection:m().createElement(m().Fragment,null)},i.getInputProps(e)))):m().createElement("div",{style:{height:73}})},SubtitleBlock$1=({children:e,align:t})=>m().createElement("p",{className:`lead-modal__description ${"le-text-align-"+(t||"")} ${em}`},e),TitleBlock$1=({children:e,align:t})=>m().createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(t||"")} ${em}`},e),Fields=({listBlockAdded:e,popupId:t,locale:a,onClose:l,onOtherSubmit:n,styles:o,classNames:i,popoverProps:r})=>{let{primaryColor:s}=(0,u.useContext)(ej),{classes:d,cx:c}
1=eD(void 0,{name:"LeadGen__Field",styles:o,classNames:i}),p=eA();return m().createElement(m().Fragment,null,e.map((e,o)=>{var i;let{name:u="",data:g={}}=e||{},{placeholder:h,value:v,align:b,listQuestion:f,isSendMailChimp:y=!1,newtab:k,url:E}=g,C=null===(i=g.required)||void 0===i||i;switch(u){case"TitleBlock":return m().createElement(TitleBlock$1,{key:o,align:b},v);case"SubtitleBlock":return m().createElement(SubtitleBlock$1,{key:o,align:b},v);case"TextBlock":return m().createElement(T.I,Object.assign({key:o,withAsterisk:C,spellCheck:!1,type:"text",placeholder:h,className:c("leadgen-control",d.control),label:h,"data-control":"text","data-lead-control":u,"data-is-required":C,name:v},p.getInputProps(v)));case"NumberBlock":return m().createElement(T.N,Object.assign({key:o,withAsterisk:C,spellCheck:!1,type:"number",placeholder:h,className:c("leadgen-control",d.control),label:h,"data-control":"number","data-lead-control":u,"data-is-required":C,name:v},p.getInputProps(v)));case"EmailBlock":return m().createElement(T.I,Object.assign({key:o,withAsterisk:C,spellCheck:!1,placeholder:h,className:c("leadgen-control",d.control),label:h,"data-control":"email","data-lead-control":u,"data-is-required":C,name:v},p.getInputProps(v)));case"PhoneOtpBlock":case"WhatsappOtpBlock":case"ZaloOtpBlock":case"PhoneBlock":{let e=t+"-"+v+"-"+o;return m().createElement(T.I.Wrapper,Object.assign({size:"md",withAsterisk:C,key:o,label:h,className:c("leadgen-control",d.control),labelProps:{htmlFor:e}},p.getInputProps(v)),m().createElement(T.P,{name:v,spellCheck:!1,type:"tel",placeholder:h,value:p.getInputProps(v).value,onChange:e=>{p.setFieldValue(v,e)},id:e,defaultCountry:a&&P.M[a]||"VN","data-control":"tel","data-lead-control":u,"data-is-required":C}))}case"LocationBlock":return m().createElement(LocationBlock,{key:o,name:v,placeholder:h,locale:a,required:C});case"DateBlock":return m().createElement(m().Fragment,null,m().createElement(S.D,Object.assign({withAsterisk:C,key:o,type:"default",name:v,placeholder:h,className:c("leadgen-control",d.control),label:h,"data-control":"date","data-lead-control":u,"data-is-required":C,popoverProps:r},p.getInputProps(v))),m().createElement("input",{type:"hidden",name:v,"data-control":"date"}));case"LinkButtonBlock":return m().createElement("div",{key:o},m().createElement("a",{target:k?"blank":"parrent",href:E,style:{textDecoration:"none"}},m().createElement(L.B,{type:"button",size:"md",color:s,className:`lead-modal__btn ${em}`,onClick:()=>{null==l||l(),null==n||n()}},v)));case"CheckboxBlock":return m().createElement(m().Fragment,null,y&&m().createElement("div",{style:{display:"none"},"data-name":v+"-mailchimp"}),m().createElement(T.d.Group,Object.assign({withAsterisk:C,className:c("leadgen-control",d.control),key:o,label:h,size:"md",sx:{display:"flex",flexDirection:"column",gap:8}},p.getInputProps(v)),f.map((e,t)=>m().createElement(T.d,{name:v,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox","data-lead-control":u,"data-is-required":C}))));case"RadioBlock":return m().createElement(m().Fragment,null,y&&m().createElement(T.I,{type:"hidden",name:v+"-mailchimp",value:y}),m().createElement(T.R.Group,Object.assign({withAsterisk:C,className:c("leadgen-control",d.control),key:o,label:h,size:"md"},p.getInputProps(v)),f.map((e,t)=>m().createElement(T.R,{name:v,key:t,value:e.value,label:e.placeholder,"data-control":"radio","data-lead-control":u,"data-is-required":C}))));case"DropdownBlock":return m().createElement(m().Fragment,null,m().createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":v,"data-control":"dropdown","data-lead-control":u,"data-is-required":C}),m().createElement(T.S,Object.assign({key:o,className:c("leadgen-control",d.control),label:h,withAsterisk:C,name:v,data:f.map(e=>({value:e.value,label:e.placeholder}))},p.getInputProps(v))));case"TncBlock":let w=p.getInputProps("TNC-"+e.id);return m().createElement(m().Fragment,null,m().createElement(T.d,Object.assign({name:"TNC-"+e.id,key:e.id,label:m().createElement("p",{className:"lead-modal__tnc-link",dangerouslySetInnerHTML:{__html:g.valueHTML}}),className:"tnc-block","data-control":"checkbox","data-lead-control":u,"data-is-required":C},w,{error:w.error?w.error:void 0})))}return null}))};var eM=(0,p.createStyles)(e=>({root:{},header:{},heading:{},description:{},term:{a:{color:e.fn.primaryColor()}}
1,controlList:{},control:{},submitBtn:{},submitBtnWrapper:{}}));let Heading=e=>{var t=(0,c.a)(e,[]);let{heading:a}=(0,u.useContext)(en);return a?m().createElement(B.T,Object.assign({size:"h3"},t),a):null},FormComponent=({styles:e,className:t,classNames:a,fillInfo:l,popoverProps:n,submitProps:o})=>{var i;let{primaryColor:r}=(0,u.useContext)(ej),{listBlockAdded:s,leadFormConfig:{form:d,validateObj:c},validatingEmailRef:g,validatingPhoneRef:h,setFormRef:v,onClose:b,onOtherSubmit:f,actionBlocks:y,locale:k,setShowOtpPhone:E,onSubmit:C}=(0,u.useContext)(en),{classes:w,cx:x}=eM(void 0,{name:"LeadGen__FormComponent",styles:e,classNames:a}),[_,B]=(0,u.useState)(!1),T=y.submitBlock.data.value;return(0,u.useEffect)(()=>{null==d||d.setValues(l)},[l]),m().createElement(eI,{form:d},m().createElement(p.Box,{component:"form",ref:e=>e&&v(e),className:x(t,w.root),onSubmit:e=>{e.preventDefault(),d.setTouched(Object.keys(c).reduce((e,t)=>(e[t]=!0,e),{})),g.current||h.current||setTimeout(()=>{d.onSubmit(e=>{var t,a,l,n,o,i,r,c,u;if(Object.keys(d.errors).length)return;let m=null;if(s.findIndex(e=>"PhoneOtpBlock"===e.name)>-1){let n=null===(a=null===(t=s.find(e=>"PhoneOtpBlock"===e.name))||void 0===t?void 0:t.data)||void 0===a?void 0:a.value;(null===(l=e[n])||void 0===l?void 0:l.startsWith("+"))&&(m={phone:e[n],type:"phone"})}if(s.findIndex(e=>"WhatsappOtpBlock"===e.name)>-1){let t=null===(o=null===(n=s.find(e=>"WhatsappOtpBlock"===e.name))||void 0===n?void 0:n.data)||void 0===o?void 0:o.value;(null===(i=e[t])||void 0===i?void 0:i.startsWith("+"))&&(m={phone:e[t],type:"whatsapp"})}if(s.findIndex(e=>"ZaloOtpBlock"===e.name)>-1){let t=null===(c=null===(r=s.find(e=>"ZaloOtpBlock"===e.name))||void 0===r?void 0:r.data)||void 0===c?void 0:c.value;(null===(u=e[t])||void 0===u?void 0:u.startsWith("+"))&&(m={phone:e[t],type:"zalo"})}if(m){B(!0),eT.sendSMSOtpLead(m).then(e=>{var t;let a=null===(t=null==e?void 0:e._messages)||void 0===t?void 0:t[0];if("This phone number was verified"===a){null==C||C();return}E(m)}).finally(()=>{B(!1)});return}null==C||C()})(e)},100)},styles:e},m().createElement("div",{className:w.header},m().createElement(Heading,{className:w.heading}),m().createElement(Description,{className:w.description})),m().createElement("div",{className:w.controlList},m().createElement(Fields,{classNames:{control:w.control},listBlockAdded:s,locale:k,onClose:b,onOtherSubmit:f,popoverProps:n})),(null===(i=null==y?void 0:y.submitBlock)||void 0===i?void 0:i.isHide)?null:m().createElement("div",{className:w.submitBtnWrapper},m().createElement(L.B,Object.assign({size:"md",id:"lead-submit",type:"submit",className:w.submitBtn,loading:_,color:r},o),T))))};var ez=(0,p.createStyles)(()=>({root:{},header:{},heading:{},description:{},control:{},actions:{},submitBtn:{},resendOtp:{}}));let OtpBlockComponent=({otpData:e,onSuccess:t,autoSendWhenOpen:l,className:n,styles:o,classNames:i})=>{let{t:r}=useLeadGenTranslations(),s=e.phone,d=e.type,[g,h]=(0,u.useState)(""),[v,b]=(0,u.useState)(!1),[f,y]=(0,u.useState)(l?0:60),k=(0,u.useRef)(null),[E,C]=(0,u.useState)(),[w,x]=(0,u.useState)(""),_=(0,u.useRef)(),[S,O]=(0,u.useState)(!1),{classes:N,cx:P}=ez(void 0,{name:"LeadGen__OTP",styles:o,classNames:i});(0,u.useEffect)(()=>{(0,c._)(void 0,void 0,void 0,function*(){var e;if(!_.current){let e=yield Promise.resolve().then(a.bind(a,"A9bs"));_.current=e.formatPhoneNumberIntl}x((null===(e=_.current)||void 0===e?void 0:e.call(_,s))||s)})},[s]);let sendOtp=()=>(0,c._)(void 0,void 0,void 0,function*(){var e;if(!s)return;let a=yield eT.sendSMSOtpLead({phone:s,type:d}),l=null===(e=null==a?void 0:a._messages)||void 0===e?void 0:e[0];"Send sms successfully"===l||"Send WhatsApp successfully"===l||"Send Zalo successfully"===l?(y(60),setTimeout(()=>{k.current&&(k.current.focus(),k.current.scrollIntoView({block:"center"}))},100)):"This phone number was verified"===l?t():C(l||"Something went wrong!")}),submitOtp=()=>(0,c._)(void 0,void 0,void 0,function*(){if(!s||!g)return;O(!0);let e=yield eT.verifyOtpLead({phone:s,otp:g,type:d}),a=null==e?void 0:e._messages[0];"Verify successfully"===a||"Verify WhatsApp OTP sucess"===a||"Verify Zalo OTP sucess"===a?t():"This phone number was verified"===a?t():C(a||"something Wrong"),O(!1)});return(0,u.useEffect)(()=>{setTimeout(()=>{f>0&&y(e=>e-1)},1e3)},[f]),(0,u.useEffect)(()=>{l&&!f&&sendOtp()},[]),m().createElement(m().Fragment,null,m().createElement(p.Box,{component:"form",onSubmit:e=>{e.preventDefault(),submitOtp()},className:P(N.root,n)},m().createElement("div",{className:N.header},m().createElement(D.H,{tag:"h3",className:N.heading},r("lead.otp.title")),m().createElement(B.T,{size:"p3",className:N.description},r("lead.otp.desc",{phone:w}))),m().createElement(T.I,{ref:k,name:"_"+name+"-otp",spellCheck:!1,type:"number",placeholder:r("lead.otp.phonePlaceholder"),className:N.control,label:r("lead.otp.phoneLabel"),"data-control":"otp",withAsterisk:!0,pattern:"[0-9]*",value:g,maxLength:6,onChange:e=>{b(!0),h(e),v&&!e?C("OTP is required"):C(void 0)},error:v?E:void 0}),m().createElement("div",{className:N.actions},m().createElement(L.B,{type:"submit",size:"md",color:"primary",className:N.submitBtn,disabled:!g,loading:S},r("lead.otp.verify")),m().createElement(L.B,{type:"button",size:"md",color:"transparent",className:N.resendOtp,onClick:()=>{sendOtp()},disabled:!!f},r("lead.otp.resend",{timer:f?` (${f}s)`:""})))))},eR=[],eG=[],eW=[],eH=[],eV=[],eU=[],getShuffleArray=e=>{let t=[...e];for(let e=t.length-1;e>0;e--){let a=Math.floor(Math.random()*(e+1)),l=t[e];t[e]=t[a],t[a]=l}return t},getTimeByTimezone=(e="UTC")=>{let t=new Date;
1return new Date(t.toLocaleString("en-US",{timeZone:e}))},parseDateByCampaignTime=e=>{try{let[t,a]=e.split(" "),[l,n,o]=t.split("-").map(Number),[i,r,s]=a.split(":").map(Number);return new Date(l,n-1,o,i,r,s)}catch(e){return null}},checkCampaignNowInTimeframe=e=>{var t;let a=(null===(t=e.site)||void 0===t?void 0:t.id)||1,l=e.started_at,n=e.ended_at,o=parseDateByCampaignTime(l),i=parseDateByCampaignTime(n);if(!o||!i)return!1;let r=eb[a],s=getTimeByTimezone(r).getTime();return!!(s<=i.getTime()&&s>=o.getTime())&&(eG.push(e),!0)},filterFnCampaign=e=>!function(e){var t;let a=Number(null===(t=e.rules.find(e=>"exclude_sponsored"==e.rule))||void 0===t?void 0:t.value),l=!!document.querySelector(".hhg-disclaimer-text");return!!l&&!!a&&(eH.push(e),!0)}(e)&&!!function(e){var t,a;try{let l=null===(t=e.rules.find(e=>"exclude_sponsored_list"==e.rule))||void 0===t?void 0:t.value,n=l instanceof Array?l:JSON.parse(l),o=Number(null===(a=document.querySelector("[data-sponsored-id]"))||void 0===a?void 0:a.getAttribute("data-sponsored-id"));if(!o||o<=0||0===n.length)return!0;let i=n.find(e=>e.id==o);if(i)return!0;return eV.push({id:e.id,rules:e.rules}),!1}catch(e){return!0}}(e)&&(1===e.formatted_status?function(e){var t;if(1===e.forever)return!0;let a=e.started_at,l=e.ended_at,n=parseDateByCampaignTime(a),o=parseDateByCampaignTime(l);if(!n||!o)return!0;let i=(null===(t=e.site)||void 0===t?void 0:t.id)||1,r=eb[i],s=getTimeByTimezone(r).getTime();return!(s>o.getTime())||(eW.push(e),!1)}(e):0===e.formatted_status&&(eR.push(e),checkCampaignNowInTimeframe(e))),fillterApprearanceTimeCampaign=e=>{var t;try{let a=null===(t=e.rules.find(e=>"appearance_time"==e.rule))||void 0===t?void 0:t.value,l=a.startTime,n=a.endTime||"23:59";if(!l||((e,t,a)=>{let l=t.split(":"),n=a.split(":"),o=new Date;o.setHours(Number(l[0]),Number(l[1]),0,0);let i=new Date;return i.setHours(Number(n[0]),Number(n[1]),0,0),e>=o&&e<=i})(new Date,l,n))return!0;return eU.push(e),!1}catch(e){return!0}},eq=null,eZ=null;function clearPassiveEvent(){eq&&(clearTimeout(eq),eq=null),eZ&&(window.removeEventListener("scroll",eZ),eZ=null)}function checkShowPopup({leadApi:e,leadSiteId:t,leadDomain:a,onShowPopup:l,DEBUG_URL:n}){clearPassiveEvent();let o=n||("https://"+location.hostname+location.pathname+location.search).toLowerCase();fetch(e+"api/campaign/"+t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:o,ga_client_id:(0,E.Ri)("_ga")||null})}).then(e=>e.json()).then(e=>{var t,n,i,r;if(LeadLog("List campagin: ",e),ep="https://"+location.hostname+location.pathname+location.search,1==e._status){let s=((null===(n=null===(t=e._data)||void 0===t?void 0:t.campaigns)||void 0===n?void 0:n.filter(filterFnCampaign))||[]).filter(fillterApprearanceTimeCampaign);(0,E.Ri)("hhg-id")||((0,E.TV)("hhg-id",(0,M.A)(),{domain:"."+a,path:"/"}),LeadLog("\uD83D\uDE0D Set HHG ID cookie"));let d=[];LeadLog(`👓 campaignsDevice`,d=/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)?s.filter(e=>e.device_types.some(e=>e.id==eu.MOBILE)):s.filter(e=>e.device_types.some(e=>e.id==eu.DESKTOP))),LeadLog("--listCampaignScheduled",eR),LeadLog("--listCampaignScheduledToActivated",eG),LeadLog("--listCampaignActiveButExpired",eW),LeadLog("--listCampaignExcludeSonsored",eH),LeadLog("--listCampaignDifferentSponsor",eV),LeadLog("--listCampaignNotDisplayInRangeOfTime",eU);let c=d.map((e,t)=>e.targets.filter(e=>e.type==ed.LINKS).map(e=>Object.assign(Object.assign({},e),{campaignIndex:t}))).flat(1);c=c.filter(e=>{var t;let a=new URL(String(e.target).toLowerCase());if("exact_match"==e.option)return o===(null===(t=a.href)||void 0===t?void 0:t.toLowerCase());if("start_with"==e.option){if(!o.includes(String(e.target).toLowerCase()))return!1;{let t=e.sub_target.filter(e=>"excluding"==e.option).map(e=>{var t;return null===(t=e.value)||void 0===t?void 0:t.toLowerCase()});return!t.includes(o.split("?")[0])}}});let u=Array.from(document.getElementsByTagName("META")).filter(e=>"article:tag"==e.getAttribute("property")),m=u.map(e=>e.content),p=[];m&&m.length&&(p=d.map((e,t)=>e.targets.filter(e=>e.type==ed.TAGS).map(e=>Object.assign(Object.assign({},e),{campaignIndex:t}))).flat(1).filter(e=>m.includes(e.target)));let g=[...c,...p],h=document.cookie.split("; ").map(e=>e.split("=")[0]),v=h.filter(e=>e.includes("lead_submited"));LeadLog("--listCampaignCodeSubmited",v);let b=h.filter(e=>e.includes("lead_closed"));LeadLog("--listCampaignCodeClosed",b);let f=[...v,...b],y=g.filter(e=>{let t=f.some(t=>t.includes(d[e.campaignIndex].code));return!t}),k=getShuffleArray(y);if(LeadLog("--listCampaignValid : ",k),k&&k.length){let e=d[k[0].campaignIndex];LeadLog("CAMPAIGN_SHOW",e);let{rules:t}=e,a=Number(null===(i=t.find(e=>"time"==e.rule))||void 0===i?void 0:i.value);LeadLog("timeoutRule",a);let n=Number(null===(r=t.find(e=>"scroll"==e.rule))||void 0===r?void 0:r.value);LeadLog("scrollRule",n);let o="TIME";if(Number.isInteger(a)&&(o="TIME",LeadLog("✨ SHOW AWESOME POPUP AFTER: ",a," seconds"),eq=setTimeout(()=>{null==l||l(e,o)},1e3*a)),Number.isInteger(n)){o="SCROLL",LeadLog("✨ SHOW AWESOME AFTER: SCROLL",n," %");let t=document.querySelector(`[data-url="${location.pathname}"]`)||document.querySelector("body"),a=t.getBoundingClientRect().top,i=t.offsetHeight;LeadLog(`👓 Element check scroll: `,t),eZ=function(){let t=window.pageYOffset||document.documentElement.scrollTop,r
1=0;t>=a&&(r=Math.round((t-a)/(i-innerHeight)*100)),LeadLog("---Scroll",r,n),r>=n&&(window.removeEventListener("scroll",eZ),null==l||l(e,o))},window.addEventListener("scroll",eZ,{passive:!0})}}else LeadLog("\uD83D\uDEA7 No lead campaigns on current URL, tags")}}).catch(e=>{LeadLog("Lead error: ",e)})}let LeadLog=(...e)=>{"undefined"!=typeof localStorage&&"true"===localStorage.getItem("hhg_debug")&&console.log(...e)},eY=(0,u.createContext)({submit:e=>(LeadLog("** LeadGen Submit : ",e),Promise.reject(e)),submitSubscriptionBox:e=>(LeadLog("** LeadGen SubmitSubscriptionBox : ",e),Promise.reject(e)),impression:e=>(LeadLog("** LeadGen Impression : ",e),Promise.reject()),subscriptionIcon:"",subscriptionTitle:"",subscriptionPhoneType:"",desktopBanner:"",mobileBanner:"",buttonTextColor:"",buttonColor:""}),LeadGenContextProvider=e=>{let{campaign_code:t,apiSsoUrl:a,apiLeadUrl:l,apiSubotUrl:n,locale:o,forceCampaign:i,extraValues:r,articleId:s=1,categoryList:d,siteDomain:p,children:g,userInfo:h}=e,v=(0,c.a)(e,["campaign_code","apiSsoUrl","apiLeadUrl","apiSubotUrl","locale","forceCampaign","extraValues","articleId","categoryList","siteDomain","children","userInfo"]),[b,f]=(0,u.useState)(i),{t:y}=useLeadGenTranslations(),[k,C]=(0,u.useState)({subscriptionIcon:"",subscriptionTitle:"",subscriptionType:"TypeA",subscriptionPhoneType:"",subcriptionCateId:"",subcriptionCateName:"",desktopBanner:"",mobileBanner:"",buttonTextColor:"",buttonColor:""}),w=(0,u.useMemo)(()=>o||$.L.PhilippinesEnglish,[o]),{url:x,campaign_id:_,cookie_id:B,ga_client_id:T,category_list:S,article_id:L,article_title:O}=(0,u.useMemo)(()=>({url:location.href.toLowerCase()||"",cookie_id:(0,E.Ri)("hhg-id")||null,ga_client_id:(0,E.Ri)("_ga"),campaign_id:null==b?void 0:b.id,campaign_code:t||(null==b?void 0:b.code),category_list:d,article_id:s,article_title:(null==r?void 0:r.article_title)||document.title||""}),[t,s,d,null==b?void 0:b.id,null==r?void 0:r.article_title,null==k?void 0:k.subcriptionCateName]),N=(0,u.useCallback)(e=>eT.postSubscriptionBoxLead({data:e}),[]),I=(0,u.useCallback)(e=>(0,c._)(void 0,void 0,void 0,function*(){let{area_code:t,phone_number:a,subscription_title:l,name:n}=e;return yield Promise.all([eT.postSubscriptionBoxLead({data:Object.assign(Object.assign({},e),{site_domain:p,url:(null==e?void 0:e.url)||x,cookie_id:B,ga_client_id:(null==e?void 0:e.ga_client_id)||T,article_id:L,category_id:k.subcriptionCateId,category_name:k.subcriptionCateName,article_title:O})}),eT.postPhoneToCtaSubmit({data:{name:n,area_code:t,phone_number:a,widget_type:"subscription_box",subscription_headline:l,cta_text:"",source_url:(null==e?void 0:e.url)||x,source_type:"Article",article_id:L,article_name:O,category_name:k.subcriptionCateName,category_id:k.subcriptionCateId,messaging_app:"Zalo",country_code:(null===P.M||void 0===P.M?void 0:P.M[w])||"VN"}})])}),[r,p,_,L,O,k.subcriptionCateId,k.subcriptionCateName,x,B,T]),F=(0,u.useCallback)(e=>{let t=(0,E.Ri)("_ga")||null,a={subscription_title:k.subscriptionTitle,name:(null==h?void 0:h.name)||"",area_code:(null==h?void 0:h.area_code)||"",phone_number:(null==h?void 0:h.phone)||"",site_domain:z.y[w],url:location.href.toLowerCase(),cookie_id:(0,E.Ri)("hhg-id"),ga_client_id:t,article_title:O,article_id:L,category_id:k.subcriptionCateId,category_name:k.subcriptionCateName,type:e};return eT.trackingSubscription(a)},[_,x,O,B,T,k.subcriptionCateId,k.subcriptionCateName,k.subscriptionTitle,L,null==h?void 0:h.name,null==h?void 0:h.area_code,null==h?void 0:h.phone]);return((0,u.useEffect)(()=>{if(i){f(formatCampaignDetail(i));return}if(S){eT.getSubscriptionBoxInfo({category:S.map(e=>e.termId).join(","),site:p,slug:null==location?void 0:location.pathname}).then(e=>{var t;let{_data:a}=e||{},{item:l=[],btn_type:n="zalo"}=a||{},{icon:o,content:i,cate_id:r,desktop_banner:s,mobile_banner:d,button_text_color:c,background_color:u}=(null===(t=l.filter(e=>"default"!==e.cate_id))||void 0===t?void 0:t[0])||{};LeadLog("** LeadGen SubscriptionBox subscription_icon : ",o),LeadLog("** LeadGen SubscriptionBox subscription_title : ",i),C(e=>{var t,a;return Object.assign(Object.assign({},e),{subscriptionIcon:o,subscriptionTitle:i,subscriptionPhoneType:n,subcriptionCateId:r,subcriptionCateName:null===(a=null===(t=S.filter(e=>e.termId==r))||void 0===t?void 0:t[0])||void 0===a?void 0:a.name,desktopBanner:s||"",mobileBanner:d||"",buttonTextColor:c||"",buttonColor:u||""})}),f(formatCampaignDetail({id:6993,name:"",code:"49qvztwzzlfvmk6",site:{id:A.L[w].SITE_ID||1,name:z.y[w]},thank_you_image:"https://cdn-lead.hellohealthgroup.com/2025/05/1747009374_68213f5e5fa5a9.58533462.png",extra_fields:{actionBlocks:`{"submitBlock":{"data":{"value":"${y("subscriptionBox.ctaBtn")}"}},"linkButtonBlock":{"data":{"value":"Join now","url":"","newtab":true}}}`,currentLayout:"LightBoxB",imageBlocks:'{"imageMobile":{"data":{"url":"","newtab":true}},"imageDesktop":{"data":{"url":"","newtab":true}}
1,"imageBackground":{"data":{}},"imageOverlayMobile":{"data":{}},"imageOverlayDesktop":{"data":{}},"imageThankYou":{"data":{}}}',listBlockAdded:`[{"name":"TextBlock","id":"c9be7202-05af-4d62-94bb-0001f8ad50de","data":{"placeholder":"${y("subscriptionBox.name")}","value":"name","required":true, "requiredMessage": "${y("subscriptionBox.nameRequire")}"}},{"name":"PhoneBlock","id":1744087889773,"data":{"value":"phone","required":true,"requiredMessage": "${y("subscriptionBox.phoneRequire")}","placeholder":"${y("subscriptionBox.phone")}"}}]`,listBlockThankyou:`[{"name":"TitleBlock","id":"c74d5525-b7ae-4714-b5f1-552f50160ac1","data":{"value":"${y("subscriptionBox.thankyouTitle")}","align":"center"}},{"name":"SubtitleBlock","id":"f9a6ac63-b532-41d4-9c2e-3f3e71124e05","data":{"value":"${y("subscriptionBox.thankyou")}","align":"center"}}]`,textBlocks:'{"titleBlock":{"data":{"value":"VN - Campaign SUBSCRIPTION BOX "}},"subtitleBlock":{"data":{"value":"Sample description"}}}'},total_lead:0,total_submit:0,total_click:0,started_at:null,ended_at:null,created_at:"2025-04-08 04:54:32",updated_at:"2025-05-12 00:22:54",site_logo:"https://hhg-common.hellobacsi.com/common/logo/hellobacsi.png",custom_logo:null,status:1,formatted_status:1,creator:"[email protected]",total_impression:4237940,conversion_rate:0,total_visitor:0,total_habit_exit:0,total_intentional_exit:0,trigger_type:"on_landing",targets:[{is_import:0,option:"start_with",sub_target:[],target:"https://hellobacsi.com/sample",type:1}],forms:[{control:"TextBlock",default:null,name:"TextBlock",options:[],required:1},{control:"PhoneBlock",default:null,name:"PhoneBlock",options:[],required:1,requiredMessage:y("subscriptionBox.phoneRequire")}],rules:[{rule:"campaign_popup_exit",value:"7"},{rule:"site_popup_exit",value:"7"},{rule:"show_again_after_submit",value:"0"},{rule:"show_again_after_exit",value:"0"},{rule:"appearance_time",value:{endTime:null,startTime:null}},{rule:"exclude_sponsored",value:"1"},{rule:"exclude_sponsored_list",value:[]},{rule:"days_to_show_again",value:"7"},{rule:"time",value:"3"}],is_scheduled:!0,last_step:null,kpis:{lead:500},forever:1,is_target_import:0,is_expired:0,score:6,price:2.5,type:0,is_testing_running:0,campaign_group_id:0,bot_id:[]}))});return}},[i,t,S]),(0,u.useEffect)(()=>{ey.apiSsoUrl=a,ey.apiLeadUrl=l,ey.apiSubotUrl=n},[l,n,a]),b&&(null==b?void 0:b.id))?m().createElement(eY.Provider,{value:Object.assign(Object.assign(Object.assign({},v),k),{userInfo:h,campaign_code:t,apiSsoUrl:a,apiLeadUrl:l,apiSubotUrl:n,locale:o,articleId:s,categoryId:k.subcriptionCateId,siteDomain:p,forceCampaign:b,submit:N,submitSubscriptionBox:I,impression:F})},g):null},useLeadGenContext=()=>{let e=(0,u.useContext)(eY);return Object.assign(Object.assign({},e),{apiSsoUrl:e.apiSsoUrl||ey.apiSsoUrl,apiLeadUrl:e.apiLeadUrl||ey.apiLeadUrl,apiSubotUrl:e.apiSubotUrl||ey.apiSubotUrl})},ImpressionTrackingWrapper=({children:e,stayDuration:t=3,onImpression:a,dependency:l=""})=>{var n;let o=(0,u.useRef)(null),[i,r]=(0,u.useState)(100),{ref:s,entry:d}=(0,N.v)({threshold:i/100}),[c,g]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{let e=null,a=1;return(null==d?void 0:d.isIntersecting)&&!c&&(e=setInterval(()=>{console.log("Impression count: ",a),a>=t?g(!0):a+=1},1e3)),()=>clearInterval(e)},[null==d?void 0:d.isIntersecting,c]),(0,u.useEffect)(()=>{c&&(console.log("Impression call API"),a())},[c]),(0,u.useEffect)(()=>{g(!1)},[l]),(0,u.useEffect)(()=>{o.current.clientHeight>.8*window.innerHeight&&r(50)},[null===(n=o.current)||void 0===n?void 0:n.clientHeight]),m().createElement(p.Box,{"data-impression":!0,ref:s},m().createElement("div",{ref:o},e))},eJ=a("+QaA");y().extend(eJ);let[eK,eQ,eX]=(0,v.c)(),useLeadFormConfig=({listBlockAdded:e=[],validatingPhoneRef:t,validatingEmailRef:a,campaignId:l,campaign_subot_id:n=[],userInfo:o,format:i})=>{var r;let{t:s}=useLeadGenTranslations(),d=(0,u.useMemo)(()=>formatLeadGenFormValue(mappingSSOToLead(o),e),[null==o?void 0:o.id]),c=es[null===(r=null==document?void 0:document.documentElement)||void 0===r?void 0:r.lang]||es["vi-VN"],m=(0,u.useMemo)(()=>{let o=["TextBlock","NumberBlock","EmailBlock","PhoneBlock","DateBlock","CheckboxBlock","RadioBlock","DropdownBlock","PhoneOtpBlock","WhatsappOtpBlock","ZaloOtpBlock","LocationBlock","TncBlock"],withSharedCheck=(e,t,a)=>l=>{var n,o;let i=null===(n=null==a?void 0:a.data)||void 0===n?void 0:n.required;if(g.current.isTouched(e))return("string"==typeof l&&""===l.trim()||void 0===l||Array.isArray(l)&&0===l.length)&&i?(null===(o=null==a?void 0:a.data)||void 0===o?void 0:o.requiredMessage)||s("validator.required"):null==t?void 0:t(l)};return e.filter(e=>o.includes(e.name)).reduce((e,o)=>{let{name:r,data:d}=o||{},{value:u,required:m}=d||{},p=null==m||m;return"NumberBlock"===r?Object.assign(Object.assign({},e),{[u]:withSharedCheck(u,e=>{if(e&&isNaN(Number(e)))return s("validator.number")},o)}):"EmailBlock"===r?Object.assign(Object.assign({},e),{[u]:withSharedCheck(u,e=>{if(e&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return s("validator.email");e&&(a.current=!0,setTimeout(()=>{g.current.setFieldError(u,"Validating..."),checkUsedEmailOrPhoneWithCache(l,n,{email:e}).then(e=>{e?g.current.setFieldError(u,s(e)):g.current.clearFieldError(u),a.current=!1}
1).catch(e=>{console.error(e),g.current.setFieldError(u,e.message||"Something went wrong"),a.current=!1})},200))},o)}):"PhoneBlock"===r||"PhoneOtpBlock"===r||"ZaloOtpBlock"===r||"WhatsappOtpBlock"===r?Object.assign(Object.assign({},e),{[u]:withSharedCheck(u,e=>{if(e&&window.intlTelInputUtils&&!window.intlTelInputUtils.isValidNumber(String(e),c.countryCode))return s("validator.phone");e&&(t.current=!0,setTimeout(()=>{g.current.setFieldError(u,"Validating..."),o.data.singleSubmission?checkUsedPhoneOnlyWithCache(l,e).then(e=>{e?g.current.setFieldError(u,s(e)):g.current.clearFieldError(u),t.current=!1}).catch(e=>{console.error(e),g.current.setFieldError(u,e.message||"Something went wrong"),t.current=!1}):checkUsedEmailOrPhoneWithCache(l,n,{phone:e}).then(e=>{e?g.current.setFieldError(u,s(e)):g.current.clearFieldError(u),t.current=!1}).catch(e=>{console.error(e),g.current.setFieldError(u,e.message||"Something went wrong"),t.current=!1})},200))},o)}):"DateBlock"===r?Object.assign(Object.assign({},e),{[u]:withSharedCheck(u,e=>{if(!p&&!e)return;let t=s("validator.dateInvalid"),a="string"==typeof e?y()(e,i,!0):y()(e);if(!a.isValid())return t},o)}):"TncBlock"===r?Object.assign(Object.assign({},e),{["TNC-"+o.id]:withSharedCheck("TNC-"+o.id,e=>{if(p&&!e)return s("validator.required")},o)}):Object.assign(Object.assign({},e),{[u]:withSharedCheck(u,void 0,o)})},{})},[e.map(e=>e.name).join(","),i]),p=eX({validateInputOnChange:!1,validateInputOnBlur:!0,clearInputErrorOnChange:!0,validate:m,initialValues:d}),g=(0,u.useRef)(p);return g.current=p,{form:p,validateObj:m}},e0=G.A.div`
2  display: flex;
3  gap: 8px;
4  flex-direction: column;
5  padding-block: 24px;
6
7  .leadgen-image {
8    width: 120px;
9    height: 120px;
10    margin-inline: auto;
11    object-fit: contain;
12    object-position: center;
13    text-align: center;
14  }
15
16  .leadgen-title {
17    margin-block: 0;
18    color: ${W.w.colors.gray900};
19    font-weight: 700;
20    font-size: 18px;
21    line-height: 28px;
22    letter-spacing: -0.2px;
23  }
24
25  .leadgen-description {
26    margin-block: 0;
27    color: ${W.w.colors.gray600};
28    font-weight: 400;
29    font-size: 14px;
30    line-height: 22px;
31    letter-spacing: -0.2px;
32    text-align: center;
33  }
34
35  > [data-align] {
36    &[data-align='right'] {
37      text-align: right;
38    }
39    &[data-align='center'] {
40      text-align: center;
41    }
42  }
43`,LeadGenThankYou=({image:e,title:t,description:a,showButton:l=!1,button:n,className:o,style:i})=>{let{src:r}=e,{htmlText:s,align:d}=t,{htmlText:c,align:u}=a,{htmlText:g,newtab:h,url:v,onClick:b}=n,f=(0,p.useMantineTheme)();return m().createElement(e0,{className:o,style:i},m().createElement("img",{src:r,alt:"",className:"leadgen-thankyou_image leadgen-image"}),m().createElement(B.T,{size:"h4",weight:"bold","data-align":d,variant:"primary"},s),m().createElement(B.T,{size:"p2","data-align":u,color:f.colors.gray[6]},c),!!g&&l&&m().createElement(p.Button,{component:v?"a":"button",target:h?"_blank":void 0,href:v,size:"lg",variant:"filled",className:"leadgen-thankyoue_btn leadgen-btn",onClick:b},g))},e1=G.A.div`
44  margin-top: 16px;
45  .leadgen-btn {
46    margin-top: 16px;
47  }
48`,e2=G.A.div`
49  margin-left: 8px;
50  width: 80px;
51  height: 68px;
52
53  img {
54    width: 100%;
55    height: 100%;
56    object-fit: contain;
57    onject-position: center;
58  }
59
60  :has(img[src='']) {
61    display: none;
62  }
63`,e4=G.A.div`
64  display: flex;
65  align-items: start;
66  margin-bottom: 16px;
67  .leadgen-title {
68    margin-bottom: 0;
69    flex: 1;
70    min-width: 0;
71    color: ${W.w.colors.gray600};
72    b {
73      color: #111111;
74      font-weight: 700;
75    }
76    ${_.M.mbUp} {
77      b {
78        font-weight: 500;
79      }
80    }
81  }
82`,e3=G.A.div`
83  padding: 16px;
84  border: 1px solid ${W.w.colors.neutral100};
85  background: linear-gradient(
86    180.71deg,
87    rgba(44, 183, 66, 0.8) -18.54%,
88    rgba(44, 183, 66, 0.1) 17.12%,
89    rgba(44, 183, 66, 0) 99.25%
90  );
91  border-radius: 12px;
92  margin-inline: auto;
93
94  .leadgen-form_inputs {
95    .leadgen-form_input {
96      width: 100%;
97    }
98  }
99
100  .leadgen-form_input {
101    .mantine-Input-wrapper {
102      max-height: 56px;
103    }
104  }
105
106  ${_.M.mbUp} {
107    .leadgen-subscription_box_body {
108      display: flex;
109      > form {
110        flex: 1;
111        min-width: 0;
112
113        .leadgen-form_inputs {
114          .leadgen-form_input {
115            width: calc(50% - 4px);
116          }
117        }
118      }
119
120      .leadgen-btn {
121        margin-top: 0;
122        margin-left: 8px;
123        width: auto;
124        min-height: 56px;
125      }
126    }
127  }
128
129  ${_.M.smbDown} {
130    &[data-type='subscription_box_A'] {
131      border-inline: 0;
132      border-radius: 0;
133      margin-inline: -16px;
134      box-shadow: 0px 0px 1px 0px #0000000a, 0px 0px 2px 0px #0000000f,
135        0px 4px 8px 0px #0000000a;
136    }
137  }
138
139  ${e=>e.isBannerStyle?`
140      .leadgen-btn {
141        font-weight: 600;
142      }
143      ${_.M.mbUp} {
144        box-shadow: 0px 0px 1px 0px #0000000A, 0px 0px 2px 0px #0000000F, 0px 4px 8px 0px #0000000A;
145        border: 0;
146        background: linear-gradient(0deg, #FFFFFF, #FFFFFF),
147        linear-gradient(
148          180.71deg,
149          rgba(${(0,H.h)(e.buttonColor)}, 0.8) -18.54%,
150          rgba(${(0,H.h)(e.buttonColor)}, 0.1) 17.12%,
151          rgba(${(0,H.h)(e.buttonColor)}, 0) 99.25%
152        );
153        .leadgen-subscription_box_body {
154          flex-direction: column;
155          align-items: flex-end;
156          gap: 16px;
157          .leadgen-btn {
158            padding-left: 38px;
159            padding-right: 38px;
160            min-height: 48px;
161          }
162        }
163        .leadgen-subscription_box_form {
164          width: 100%; 
165        }
166      }
167    `:`
168      &[data-phone-type='zalo'] {
169        background: linear-gradient(
170          180.71deg,
171          #7bc2ff -18.54%,
172          #e3f2ff 17.12%,
173          #ffffff 99.25%
174        );
175      }
176      &[data-phone-type]:not([data-phone-type='zalo']) {
177        .leadgen-btn {
178          background-color: #2cb742 !important;
179        }
180      }`}
181`,e5=G.A.div`
182  .leadgen-form_input {
183    --phone-select: 65px;
184    .PhoneInput {
185      --phone-select: 65px;
186      .PhoneInputCountry {
187        margin-top: 1px;
188        pointer-events: none;
189        .PhoneInputArrowContainer {
190          display: none;
191        }
192      }
193    }
194  }
195`,e6=G.A.picture``,WhatsAppOutline=e=>{var{size:t}=e,a=(0,c.a)(e,["size"]);return m().createElement("svg",Object.assign({width:t,height:t,viewBox:"0 0 22 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),m().createElement("path",{d:"M11 .11a9.93 9.93 0 0 0-5.022 1.367A10.1 10.1 0 0 0 2.302 5.21 10.3 10.3 0 0 0 .96 10.305a10.3 10.3 0 0 0 1.352 5.093l-1.365 5.3 5.311-1.427a9.92 9.92 0 0 0 8.803.336 10.05 10.05 0 0 0 3.617-2.752 10.2 10.2 0 0 0 2.06-4.082c.371-1.501.4-3.07.085-4.584a10.25 10.25 0 0 0-1.906-4.158 10.1 10.1 0 0 0-3.512-2.888A9.9 9.9 0 0 0 11.001.11m5.906 16.173a8.264 8.264 0 0 1-10.42 1.139l-3.085.83.789-3.057a8.57 8.57 0 0 1-.441-9.102 8.4 8.4 0 0 1 3.366-3.297 8.25 8.25 0 0 1 8.954.766 8.46 8.46 0 0 1 2.775 3.823 8.6 8.6 0 0 1 .311 4.736 8.5 8.5 0 0 1-2.25 4.162",fill:"#25d366"}),m().createElement("path",{d:"M16.03 12.96q.001.25-.041.5a3 3 0 0 1-.122.491c-.124.357-.803.793-.803.793a2.56 2.56 0 0 1-2.041.365 5 5 0 0 1-.336-.083c-.11-.033-.392-.123-.392-.123a12 12 0 0 0-.347-.107 7 7 0 0 1-1.246-.515c-.918-.506-1.917-1.412-1.917-1.412a11.4 11.4 0 0 1-1.597-1.776 7.5 7.5 0 0 1-.643-1.198l-.144-.338a14 14 0 0 1-.164-.382c-.043-.107-.12-.328-.12-.328a3 3 0 0 1-.11-.4 3 3 0 0 1-.044-.369c-.035-.647.282-1.328.282-1.328.349-.732.687-.9.687-.9q.228-.104.467-.173.237-.075.485-.099.076-.007.147.013c.128.035.398.514.398.514.083.129.228.369.228.369.146.239.268.43.268.43.121.194.235.364.235.364.023.027.131.17.131.17a2 2 0 0 1 .163.24q.05.093.06.198c.008.14-.178.363-.178.363a4 4 0 0 1-.409.411 5 5 0 0 0-.41.397c-.186.208-.181.335-.181.335a.6.6 0 0 0 .043.156c.04.093.067.141.067.141.027.048.106.163.106.163.08.116.087.13.087.13.366.58.802 1.112 1.298 1.584.717.65 1.698 1.131 1.698 1.131.015.006.137.073.137.073.121.068.171.09.171.09.05.022.146.051.146.051q.076.027.158.027c.125-.007.308-.219.308-.219q.185-.218.343-.457a4 4 0 0 1 .357-.457c.198-.212.336-.22.336-.22q.105 0 .2.038.132.06.255.137l.182.113c.182.096.383.197.383.197.204.102.454.222.454.222.25.12.386.19.386.19.499.218.546.343.546.343q.027.07.034.145",fill:"#25d366"}))};WhatsAppOutline.defaultProps={size:24};let NoData=({className:e,style:t})=>m().createElement("svg",{width:"64",height:"55",viewBox:"0 0 64 55",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:t},m().createElement("path",{d:"M32.6226 54.0001C46.2852 54.0001 57.3652 43.0033 57.3652 29.4239C57.3652 15.8446 46.2852 4.84778 32.6226 4.84778C18.9599 4.84778 7.87988 15.8446 7.87988 29.4239C7.87988 43.0033 18.9599 54.0001 32.6226 54.0001Z",fill:"#E6EAF5"}),m().createElement("path",{d:"M51.5751 26.2165V41.2537C51.5751 44.3778 49.0342 46.9187 45.8684 46.9187H19.4596C16.3355 46.9187 13.7946 44.4195 13.7529 41.2954C13.7529 41.2537 13.7529 41.2537 13.7529 41.2121V26.2165C13.7529 26.1748 13.7529 26.1748 13.7529 26.1332C13.7529 26.0498 13.7529 25.9665 13.7946 25.8832C13.8362 25.7583 13.8779 25.675 13.9195 25.55L21.0008 12.0123C21.2507 11.4708 21.7922 11.1792 22.3754 11.1792H42.911C43.4941 11.1792 43.994 11.4708 44.2856 12.0123L51.3668 25.55C51.4085 25.6333 51.4501 25.7583 51.4918 25.8832C51.5751 25.9665 51.5751 26.0915 51.5751 26.2165Z",fill:"#D5DDEA"}),m().createElement("path",{d:"M51.5751 26.2164V42.7949C51.5751 45.0859 49.7423 46.9187 47.4096 46.9187H17.9184C15.6274 46.9187 13.7529 45.0859 13.7529 42.7949V26.1331C13.7529 26.0498 13.7529 25.9665 13.7946 25.8832H23.2918C24.708 25.8832 25.8743 27.0078 25.8743 28.4658C25.8743 29.1739 26.1659 29.8404 26.6241 30.2986C27.124 30.7984 27.7071 31.0483 28.4569 31.0483H36.9127C38.329 31.0483 39.4953 29.9237 39.4953 28.4658C39.4953 27.7576 39.7869 27.0912 40.2451 26.633C40.7449 26.1331 41.3281 25.8832 42.0362 25.8832H51.4918C51.5751 25.9665 51.5751 26.0915 51.5751 26.2164Z",fill:"url(#paint0_linear_2578_27197)"}),m().createElement("path",{d:"M56.7342 17.6773C57.6774 17.6773 58.442 16.9126 58.442 15.9694C58.442 15.0262 57.6774 14.2616 56.7342 14.2616C55.791 14.2616 55.0264 15.0262 55.0264 15.9694C55.0264 16.9126 55.791 17.6773 56.7342 17.6773Z",fill:"#EAEEF9"}),m().createElement("path",{d:"M55.0257 12.1373C55.6698 12.1373 56.192 11.6152 56.192 10.971C56.192 10.3269 55.6698 9.80469 55.0257 9.80469C54.3816 9.80469 53.8594 10.3269 53.8594 10.971C53.8594 
19511.6152 54.3816 12.1373 55.0257 12.1373Z",fill:"#EAEEF9"}),m().createElement("path",{d:"M7.79034 15.9694C8.43449 15.9694 8.95667 15.4472 8.95667 14.803C8.95667 14.1589 8.43449 13.6367 7.79034 13.6367C7.1462 13.6367 6.62402 14.1589 6.62402 14.803C6.62402 15.4472 7.1462 15.9694 7.79034 15.9694Z",fill:"#EAEEF9"}),m().createElement("path",{d:"M5.16603 41.6286C6.36229 41.6286 7.33205 40.6588 7.33205 39.4625C7.33205 38.2663 6.36229 37.2965 5.16603 37.2965C3.96976 37.2965 3 38.2663 3 39.4625C3 40.6588 3.96976 41.6286 5.16603 41.6286Z",fill:"#EAEEF9"}),m().createElement("path",{d:"M43.0864 6.16785C43.6301 12.1024 43.9019 13.4615 42.6711 18.8361C42.2708 20.0309 41.8705 21.3396 41.0128 22.25C39.812 23.6725 37.6392 24.2984 35.8666 23.8432C34.0368 23.388 32.5501 21.7948 32.2071 19.8602C31.9212 18.6654 32.3214 17.2429 33.3507 16.5032C34.4371 15.8204 35.981 15.9911 36.8958 16.8446C37.9251 17.6981 38.3254 19.0068 38.2682 20.2585C38.211 21.5103 37.7536 22.7621 37.1246 23.8432C35.7027 26.5014 35.1173 26.4916 32.2071 30.8575",stroke:"#ABB5CC",strokeMiterlimit:"10",strokeDasharray:"4 4"}),m().createElement("path",{d:"M46.2749 3.95757C46.0575 4.75059 45.1881 5.03896 44.3187 4.53431C43.3769 4.10176 42.7249 3.74129 42.8698 3.02037C43.0871 2.29945 43.9565 2.22735 44.9708 2.15526C46.2024 2.01108 46.4198 3.16455 46.2749 3.95757Z",fill:"#DAE2EB"}),m().createElement("path",{d:"M39.2479 4.67842C39.6102 5.32726 40.6245 5.75981 41.3489 5.11098C42.1459 4.39005 42.7979 3.88541 42.4357 3.16448C42.0734 2.51565 41.4938 2.73193 40.2622 2.87611C39.2479 3.09239 38.8132 3.9575 39.2479 4.67842Z",fill:"#DAE2EB"}),m().createElement("path",{d:"M42.4358 2.01104C42.9429 1.93895 43.4501 2.22732 43.595 2.65987C43.6674 2.80406 43.7399 3.02034 43.7399 3.16452C43.8848 4.17381 43.5225 5.03892 42.9429 5.11102C42.2909 5.2552 41.6389 4.53428 41.5664 3.59707C41.5664 3.3087 41.5664 3.16452 41.5664 2.94824C41.6389 2.4436 41.9286 2.08313 42.4358 2.01104C42.5082 2.01104 42.4358 2.01104 42.4358 2.01104Z",fill:"#989FB0"}),m().createElement("path",{d:"M27.9127 37.0298C28.4405 37.0298 28.8684 36.6019 28.8684 36.0741C28.8684 35.5463 28.4405 35.1184 27.9127 35.1184C27.3849 35.1184 26.957 35.5463 26.957 36.0741C26.957 36.6019 27.3849 37.0298 27.9127 37.0298Z",fill:"#989FB0"}),m().createElement("path",{d:"M37.4186 37.0298C37.9464 37.0298 38.3742 36.6019 38.3742 36.0741C38.3742 35.5463 37.9464 35.1184 37.4186 35.1184C36.8908 35.1184 36.4629 35.5463 36.4629 36.0741C36.4629 36.6019 36.8908 37.0298 37.4186 37.0298Z",fill:"#989FB0"}),m().createElement("path",{d:"M34.2147 43.3063H31.2186C30.7536 43.3063 30.3662 42.9188 30.3662 42.4539C30.3662 41.989 30.7536 41.6016 31.2186 41.6016H34.1889C34.6538 41.6016 35.0413 41.989 35.0413 42.4539C35.0671 42.9188 34.6797 43.3063 34.2147 43.3063Z",fill:"#989FB0"}),m().createElement("defs",null,m().createElement("linearGradient",{id:"paint0_linear_2578_27197",x1:"32.6517",y1:"25.3966",x2:"32.6517",y2:"47.1455",gradientUnits:"userSpaceOnUse"},m().createElement("stop",{stopColor:"#FDFEFF"}),m().createElement("stop",{offset:"0.9964",stopColor:"#ECF0F5"})))),e9=["places"],GoogleLocationBlock=e=>{var t;let{inputWrapperOrder:l=["label","input","description","error"],defaultValue:n,value:o,onChange:i,locale:r}=e,s=(0,c.a)(e,["inputWrapperOrder","defaultValue","value","onChange","locale"]),[d,g]=(0,u.useState)(null),[h,v]=(0,u.useState)(n||o),{predictions:b}=(0,j.u)(h,"","tl-PH"===r?"en":null===(t=null==r?void 0:r.split("-"))||void 0===t?void 0:t[0]),f=(0,u.useCallback)(e=>{v(e),null==i||i(e)},[]),y=(0,u.useCallback)(e=>{v(e.value);let t=null==b?void 0:b.find(({description:t})=>t===e.value);null==i||i(e.value,null==t?void 0:t.rawData)},[i,b]);return(0,u.useEffect)(()=>{v(o)},[o]),(0,u.useEffect)(()=>{var e,t,l;(null===(l=null===(t=null===(e=null==window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.places)||void 0===l?void 0:l.AutocompleteService)||d||a.e(3139).then(a.bind(a,"GcSG")).then(e=>{g(()=>e.LoadScript)})},[]),m().createElement(p.Autocomplete,Object.assign({defaultValue:n,value:h,onChange:f,data:b.map(e=>({value:e.description,label:e.description})),filter:()=>!0,onItemSubmit:y,inputWrapperOrder:l,zIndex:A.c-9e6+2,withinPortal:!0,styles:{dropdown:{pointerEvents:"auto"}},inputContainer:e=>m().createElement(m().Fragment,null,d&&m().createElement(d,{googleMapsApiKey:j.G,libraries:e9,loadingElement:m().createElement(m().Fragment,null),style:{width:"100%"}}),e)},s))},e8=G.A.div`
196  display: flex;
197  flex-wrap: wrap;
198  gap: 8px;
199  .leadgen-form_input {
200    width: calc(50% - 4px);
201  }
202
203  .leadgen-form_input_checkbox {
204    width: 100%;
205  }
206
207  .mantine-InputWrapper-error {
208    margin-top: 4px;
209    padding-top: 1px;
210    padding-bottom: 1px;
211    color: #f44d2c;
212    font-size: 12px;
213    line-height: 1.5;
214  }
215`,e7=(0,u.forwardRef)((e,t)=>{let{locale:l,blocks:n,scrollToErrorField:o=!0,form:i,rules:r,initialValues:s,onFinish:d,onFinishFailed:g,className:h,style:v}=e,f=(0,u.useRef)(null),y=i||(0,b.m)({initialValues:s,validate:r}),{classes:k}=(0,V.u)(),E=(0,u.useCallback)((e,t)=>{y.setTouched(n.reduce((e,{data:t})=>(e[t.value]=!0,e),{})),setTimeout(()=>{let{hasErrors:a}=y.validate();a||null==d||d(formatLeadGenFormValue(e,n),t)},100)},[y,n]),C=(0,u.useCallback)((e,t,a)=>{let l=a.target;if(o&&e){let t=Object.keys(e)[0],a=l.querySelector(`[name="${t}"]`);a&&(null==a?void 0:a.focus)&&setTimeout(()=>{null==a||a.focus(),a.scrollIntoView({behavior:"auto",block:"center",inline:"center"})},100)}null==g||g(e,t,a)},[o]);return((0,u.useEffect)(()=>{(0,c._)(void 0,void 0,void 0,function*(){window.intlTelInputUtils||(yield a("cfI3"))})},[]),(0,u.useImperativeHandle)(t,()=>Object.assign(Object.assign({},y),{submit:()=>{f.current.requestSubmit()}}),[y,f]),n&&n.length)?m().createElement("form",{ref:f,onSubmit:y.onSubmit(E,C),className:h,style:v},m().createElement(e8,{className:"leadgen-form_inputs"},n.map((e,t)=>{let{id:a,name:n,data:o}=e,{placeholder:i,value:r,required:s,listQuestion:d,valueHTML:c,isSendMailChimp:u=!1}=o,g=y.getInputProps(r),{value:h,error:v}=g,b=`${a}-${t}`;switch(n){case eo.TextBlock:return m().createElement(V.T,{key:b,shrink:!!h,className:"leadgen-form_input"},m().createElement(V.T.Control,null,({shrink:e})=>m().createElement(p.TextInput,Object.assign({name:r,spellCheck:!1,withAsterisk:s,label:m().createElement(B.T,{size:e?"p3":"p2",variant:"secondary",weight:"halfBold"},i),placeholder:" ",inputWrapperOrder:te,type:"text","data-control":"text"},g,{error:v&&m().createElement(p.Flex,{align:"center",gap:4},m().createElement(T.E,{size:12}),m().createElement(B.T,{size:"c1",variant:"error"},v)),styles:e=>({input:Object.assign(Object.assign({},(0,O.G)(e)[O.C.LEADGEN].p2),{color:e.colors.gray[9],fontWeight:O.F.halfBold}
215)})}))));case eo.NumberBlock:return m().createElement(V.T,{key:b,shrink:!!h,className:"leadgen-form_input"},m().createElement(V.T.Control,null,e=>m().createElement(p.NumberInput,Object.assign({name:h,spellCheck:!1,withAsterisk:s,label:m().createElement(B.T,{size:e?"p3":"p2",variant:"secondary",weight:"halfBold"},i),placeholder:" ",inputWrapperOrder:te,type:"number","data-control":"number"},g,{error:v&&m().createElement(p.Flex,{align:"center",gap:4},m().createElement(T.E,{size:12}),m().createElement(B.T,{size:"c1",variant:"error"},v))}))));case eo.EmailBlock:return m().createElement(V.T,{key:b,shrink:!!h,className:"leadgen-form_input"},m().createElement(V.T.Control,null,e=>m().createElement(p.TextInput,Object.assign({name:r,spellCheck:!1,withAsterisk:s,label:m().createElement(B.T,{size:e?"p3":"p2",variant:"secondary",weight:"halfBold"},i),placeholder:" ",inputWrapperOrder:te,"data-control":"email"},g,{error:v&&m().createElement(p.Flex,{align:"center",gap:4},m().createElement(T.E,{size:12}),m().createElement(B.T,{size:"c1",variant:"error"},v))}))));case eo.PhoneOtpBlock:case eo.WhatsappOtpBlock:case eo.ZaloOtpBlock:case eo.PhoneBlock:return m().createElement(V.T,{key:b,shrink:!!h,className:(0,p.clsx)("leadgen-form_input",{"leadgen-form_field_error":!!v})},m().createElement(V.T.Control,null,({shrink:e})=>m().createElement(p.Input.Wrapper,{withAsterisk:s,"data-invalid":!!v,label:m().createElement(B.T,{size:e?"p3":"p2",variant:"secondary",weight:"halfBold"},i),inputWrapperOrder:["label","input","description","error"],error:v&&m().createElement(p.Flex,{align:"center",gap:4},m().createElement(T.E,{size:12}),m().createElement(B.T,{size:"c1",variant:"error"},v))},m().createElement(p.Box,{className:"mantine-Input-wrapper",sx:e=>({".PhoneInput .PhoneInputInput":Object.assign(Object.assign({},(0,O.G)(e)[O.C.LEADGEN].p2),{color:e.colors.gray[9],fontWeight:O.F.halfBold})})},m().createElement(T.P,Object.assign({className:`mantine-Input-input ${k.p2}`,name:r,spellCheck:!1,placeholder:" ",defaultCountry:l&&P.M[l]||"VN",type:"text","data-control":"tel"},g))))));case eo.LocationBlock:return m().createElement(V.T,{key:b,shrink:!!h,className:"leadgen-form_input"},m().createElement(GoogleLocationBlock,Object.assign({name:r,withAsterisk:s,label:i,placeholder:" ",inputWrapperOrder:te,locale:l,"data-control":"text"},g,{error:v&&m().createElement(p.Flex,{align:"center",gap:4},m().createElement(T.E,{size:12}),m().createElement(B.T,{size:"c1",variant:"error"},v))})));case eo.DateBlock:return m().createElement(V.T,{key:b,shrink:!!h,className:"leadgen-form_input"},m().createElement(I.J,Object.assign({locale:(null===P.M||void 0===P.M?void 0:P.M[l])||P.M["vi-VN"],valueFormat:"DD/MM/YYYY",name:r,withAsterisk:s,label:i,placeholder:" ",inputWrapperOrder:te,type:"default","data-control":"date"},g)));case eo.DropdownBlock:return m().createElement(V.T,{key:b,shrink:!!h,className:"leadgen-form_input"},m().createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":h,"data-control":"dropdown"}),m().createElement(p.Select,Object.assign({name:r,withAsterisk:s,label:i,placeholder:" ",searchable:!0,data:d.map(e=>({value:e.value,label:e.placeholder})),nothingFound:m().createElement(NoData,null),styles:{item:{paddingBlock:12,paddingInline:10,fontSize:16,lineHeight:1.5},nothingFound:{fontSize:54,paddingBlock:30},itemsWrapper:{padding:6},dropdown:{'.mantine-ScrollArea-scrollbar[data-orientation="vertical"]':{"--radix-scroll-area-thumb-width":"6px",width:"var(--radix-scroll-area-thumb-width)",paddingInline:0}}},maxDropdownHeight:192},g)));case eo.CheckboxBlock:{let e=y.getInputProps(r,{type:"checkbox"});return m().createElement(V.C,{className:"leadgen-form_input leadgen-form_input_checkbox",key:b},u&&m().createElement("div",{style:{display:"none"},"data-name":r+"-mailchimp"}),m().createElement(p.Checkbox.Group,Object.assign({size:"md",withAsterisk:s,label:i,value:h,sx:{display:"flex",flexDirection:"column",flexWrap:"wrap",gap:8},inputWrapperOrder:te,inputContainer:e=>m().createElement("div",{className:"leadgen-choiceContainer"},e)},e),d.map((e,t)=>m().createElement(p.Checkbox,{name:r,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox"}))))}case eo.RadioBlock:return m().createElement(V.C,{className:"leadgen-form_input leadgen-form_input_checkbox",key:b},u&&m().createElement("div",{style:{display:"none"},"data-name":r+"-mailchimp"}),m().createElement(p.Radio.Group,Object.assign({size:"md",withAsterisk:s,label:i,value:h,spellCheck:!0,inputWrapperOrder:te,inputContainer:e=>m().createElement("div",{className:"leadgen-choiceContainer"},e)},g),d.map((e,t)=>m().createElement(p.Radio,{name:r,key:t,value:e.value,label:e.placeholder,"data-control":"radio"}))));case eo.TncBlock:return m().createElement(V.C,{className:"leadgen-form_input leadgen-form_input_checkbox",key:b},m().createElement(p.Input.Wrapper,{error:v},m().createElement(p.Checkbox,Object.assign({value:h,name:"TNC-"+a,label:m().createElement("p",{className:"lead-modal__tnc-link",dangerouslySetInnerHTML:{__html:c}}),className:"tnc-block","data-control":"checkbox"},g))));default:return null}}))):null}
215),te=["label","input","description","error"],LeadGenSubscriptionBoxA=e=>{let{loading:t,image:a,title:l,submitText:n,locale:o,blocks:i,form:r,rules:s,onFinish:d,isBannerStyle:c,buttonTextColor:g,buttonColor:h,desktopBanner:v,mobileBanner:b,subscriptionPhoneType:f}=e,y=(0,u.useRef)(),k=(0,u.useMemo)(()=>a?m().createElement(e2,null,m().createElement("img",{src:a,alt:""})):null,[a]),E=(0,u.useMemo)(()=>m().createElement(B.T,{size:"h4",weight:"regular",className:"leadgen-title",dangerouslySetInnerHTML:{__html:l}}),[l]);return m().createElement(e5,{className:"subcription_box_A"},c?m().createElement(p.AspectRatio,{ratio:375/213,sx:e=>({marginInline:-16,marginTop:-16,maxWidth:"none",[e.fn.largerThan("sm")]:{borderTopLeftRadius:12,borderTopRightRadius:12,overflow:"hidden","&:before":{paddingBottom:`${213/704*100}%`}}})},m().createElement(e6,null,m().createElement("source",{media:`(min-width: ${_.B.BREAK_POINT_TABLET}px)`,srcSet:v}),m().createElement("img",{loading:"lazy",src:b,alt:l,width:"100%",height:"auto"}))):m().createElement(e4,{className:"leadgen-subscription_box_header"},E,k),m().createElement(e1,{className:"leadgen-subscription_box_body"},m().createElement(e7,{ref:y,form:r,rules:s,blocks:i,locale:o,onFinish:d,className:"leadgen-subscription_box_form"}),m().createElement(L.B,{disabled:t,loading:t,size:"lg",color:h,onClick:()=>{y.current.submit()},className:"leadgen-btn leadgen-btn_action",fullWidth:!0,styles:{label:Object.assign({},g&&{color:g}),leftIcon:{marginRight:4}},leftIcon:c&&"whatsapp"===f&&m().createElement(WhatsAppOutline,{size:22,color:g})},n)))},tt=(0,u.memo)(({locale:e,userInfo:t,forceCampaign:a,categoryId:l})=>{var n,o,i;let{image:r,extra_fields:s,id:d,bot_id:p=[],ThankYouBlock:g}=a||{},{textBlocks:h,listBlockAdded:v,actionBlocks:b}=s||{},{submitBlock:f}=b||{},{apiLeadUrl:y,subscriptionIcon:k,subscriptionTitle:E,subscriptionPhoneType:C,desktopBanner:x,mobileBanner:_,buttonTextColor:B,buttonColor:T,submitSubscriptionBox:S,onFinish:L,impression:O}=useLeadGenContext(),{t:N}=(0,w.u)(),{action:{pushNotifications:P}}=(0,u.useContext)(U.T),[I,A]=(0,u.useState)(!1),[F,j]=(0,u.useState)(!1),D=(0,u.useRef)(!1),$=(0,u.useRef)(!1),{form:M,validateObj:z}=useLeadFormConfig({listBlockAdded:v,campaignId:d,campaign_subot_id:p,validatingEmailRef:D,validatingPhoneRef:$,userInfo:t}),G=(0,u.useMemo)(()=>{var e,t;return E||(null===(t=null===(e=null==h?void 0:h.titleBlock)||void 0===e?void 0:e.data)||void 0===t?void 0:t.value)||N("leadgen.message.title.default")},[E,null===(o=null===(n=null==h?void 0:h.titleBlock)||void 0===n?void 0:n.data)||void 0===o?void 0:o.value]),{image:W,title:H,description:V,button:q}=g||{},Z=!!x&&!!_,Y=(0,u.useCallback)(e=>(0,c._)(void 0,void 0,void 0,function*(){let a={subscription_title:G},l={sso_user_id:void 0,sso_uuid:void 0,sso_verified_profile:void 0},n=Object.keys(e);for(let o of n){let n=leadGenFieldNamePhone(v).some(e=>e===o);if(n){let n=(0,R.parsePhoneNumber)(e[o]);if(n.isValid()&&(a.area_code=`+${n.countryCallingCode}`,a.phone_number=n.nationalNumber,(null==t?void 0:t.id)&&(null==t?void 0:t.uid))){let e=(null==t?void 0:t.area_code)+(null==t?void 0:t.phone);l.sso_verified_profile=n.number===e?1:0,l.sso_user_id=null==t?void 0:t.id,l.sso_uuid=null==t?void 0:t.uid,LeadLog("** LeadGen SB userInfoPhone : ",e),LeadLog("** LeadGen SB userInfoPhoneInput : ",n.number)}continue}a[o]=e[o]}A(!0);try{let e=Object.assign(Object.assign({},a),l),[t]=yield Promise.all([S(e),O("submit_form")]),{_data:n}=(null==t?void 0:t[0])||{},{model:o}=n||{};if(o&&(null==o?void 0:o.id)){j(!0);let t={blocks:v||[],isUpdateSso:!1};if(null==a?void 0:a.name){eT.postUserInfoFromLeadGen({name:null==a?void 0:a.name}).then(a=>{let{_data:l,code:n}=a;!n&&l&&(t.isUpdateSso=!0,null==L||L(e,t))}).catch(()=>{null==L||L(e,t)});return}null==L||L(e,t)}}catch(e){LeadLog("** LeadGen SubscriptionBox error : ",e),P({message:N("leadgen.message.error.default"),type:"danger"})}A(!1)}),[G,v,null==t?void 0:t.id,null==t?void 0:t.uid,null==t?void 0:t.phone]);return m().createElement(ImpressionTrackingWrapper,{dependency:l,onImpression:()=>O("impression")},m().createElement(e3,{"data-phone-type":C,"data-type":"subscription_box_A",isBannerStyle:Z,buttonColor:T},F&&m().createElement(LeadGenThankYou,{image:Object.assign(Object.assign({},W),{src:W.src||`${y}admin/img/thanksyou.png`}),title:H,description:V,button:q}
215),!F&&m().createElement(LeadGenSubscriptionBoxA,{loading:I,image:k||r,title:G,submitText:null===(i=null==f?void 0:f.data)||void 0===i?void 0:i.value,blocks:v,locale:e,form:M,rules:z,onFinish:Y,isBannerStyle:Z,desktopBanner:x,mobileBanner:_,buttonTextColor:B,buttonColor:T,subscriptionPhoneType:C})))}),Container=()=>{let e=(0,u.useContext)(eY),{campaign_code:t,locale:a,siteId:l,siteDomain:n,userInfo:o,forceCampaign:i,subscriptionTitle:r}=e;return r?m().createElement(tt,{locale:a,siteId:l,siteDomain:n,userInfo:o,forceCampaign:i,campaign_code:t}):null};Container.displayName="LeadGenSubscriptionBox";let ta=[$.L.Vietnam,$.L.Malaysia,$.L.Indonesia],LeadGenSubscriptionBox=e=>{let{apiUrl:t,apiSubotUrl:a,locale:l}=e;return ta.includes(l)?m().createElement(q.M,{locale:l,customStyleType:O.C.LEADGEN},m().createElement(LeadGenTranslationProvider,{locale:l},m().createElement(LeadGenContextProvider,Object.assign({},e,{apiLeadUrl:t,apiSubotUrl:a}),m().createElement(Container,null)))):null},useImageSize=e=>{let[t,a]=(0,u.useState)(16),[l,n]=(0,u.useState)(9),[o,i]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{if(i(!1),e){let t=new Image;t.addEventListener("load",()=>{a(t.naturalWidth),n(t.naturalHeight),i(!0)}),t.addEventListener("error",()=>{a(16),n(9),i(!0)}),t.src=e}else a(16),n(9),i(!0)},[e]),{loaded:o,width:t,height:l}},CloseButton=({onClose:e,containerClassName:t,svgClassName:a})=>m().createElement("button",{onClick:e,className:`le-newbuilder-close-button js-modal__close ${t||""}`},m().createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:a},m().createElement("path",{d:"M9.99981 10.8432L14.0583 14.9017C14.1691 15.0125 14.3083 15.0691 14.476 15.0717C14.6437 15.0743 14.7854 15.0176 14.9013 14.9017C15.0172 14.7858 15.0752 14.6453 15.0752 14.4802C15.0752 14.3151 15.0172 14.1746 14.9013 14.0587L10.8429 10.0002L14.9013 5.9417C15.0121 5.83094 15.0688 5.69172 15.0713 5.52402C15.0739 5.35634 15.0172 5.21456 14.9013 5.09866C14.7854 4.98276 14.6449 4.9248 14.4798 4.9248C14.3147 4.9248 14.1742 4.98276 14.0583 5.09866L9.99981 9.15712L5.94133 5.09866C5.83057 4.98789 5.69135 4.93122 5.52365 4.92866C5.35598 4.92609 5.21419 4.98276 5.09829 5.09866C4.98239 5.21456 4.92444 5.35506 4.92444 5.52018C4.92444 5.6853 4.98239 5.82581 5.09829 5.9417L9.15675 10.0002L5.09829 14.0587C4.98752 14.1694 4.93085 14.3087 4.9283 14.4763C4.92572 14.644 4.98239 14.7858 5.09829 14.9017C5.21419 15.0176 5.3547 15.0756 5.51982 15.0756C5.68493 15.0756 5.82544 15.0176 5.94133 14.9017L9.99981 10.8432Z"}))),CenterTabLayout=({popupId:e,url:t,newTab:a,imageDestkop:l,imageMobile:n,onClose:o,onOtherSubmit:i,doImpression:r})=>{let{width:s,height:d,loaded:p}=useImageSize(n),{width:g,height:h,loaded:v}=useImageSize(l);return((0,u.useEffect)(()=>{(0,c._)(void 0,void 0,void 0,function*(){yield r()})},[]),(0,u.useEffect)(()=>(e&&p&&v&&document.body.classList.add("noscroll"),()=>{document.body.classList.remove("noscroll")}),[e,p,v]),p&&v)?m().createElement("div",{id:e,className:"leadgen lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"center_tab"},m().createElement("div",{className:"le-center-tab-popup"},m().createElement("div",{style:{position:"relative"}},m().createElement("a",{className:"js-popup-other-submit",href:t,target:a?"blank":"_parent",onClick:e=>(0,c._)(void 0,void 0,void 0,function*(){e.preventDefault(),i({type:"redirects",preventTrackingClose:!0}),yield r({type:"redirects"}),window.open(t,a?"blank":"_parent")})},(0,Z.i)(n)?m().createElement("video",{loop:!0,muted:!0,autoPlay:!0,className:"le-only-mobile"},m().createElement("source",{src:n})):m().createElement("img",{className:"le-only-mobile",src:n,style:{aspectRatio:`${s}/${d}`}}),(0,Z.i)(l)?m().createElement("video",{loop:!0,muted:!0,autoPlay:!0,className:"le-only-desktop"},m().createElement("source",{src:l})):m().createElement("img",{className:"le-only-desktop",src:l,style:{aspectRatio:`${g}/${h}`}})),m().createElement(CloseButton,{onClose:o,containerClassName:"close-button-top-right"})))):null},FloatingLayout=({popupId:e,url:t,title:a,urlText:l,titleAlign:n,subtitle:o,subtitleAlign:i,newTab:r,imageDesktop:s,imageMobile:d,onClose:c,onOtherSubmit:u})=>{let{width:p,height:g,loaded:h}=useImageSize(d),{width:v,height:b,loaded:f}=useImageSize(s);return h&&f?m().createElement("div",{id:e,className:"lead-modal-wrapper lead-floating-wrapper","data-popup-url":location.pathname,"data-
215popup-type":"floating"},m().createElement("aside",{className:"le-only-desktop"},m().createElement("div",{className:"le-floating-desktop"},m().createElement("div",{className:"le-floating-desktop-wrap",style:{position:"relative",background:"#fff"}},s?m().createElement("div",null,m().createElement("img",{style:{maxWidth:120,borderTopLeftRadius:5,borderBottomLeftRadius:5,aspectRatio:`${v}/${b}`},src:s})):null,m().createElement("div",{style:{padding:20}},m().createElement("div",{className:`le-floating-desktop-title le-text-align-${n}`},a),m().createElement("div",{className:`le-floating-desktop-desc le-text-align-${i}`},o)),m().createElement("a",{target:r?"blank":"_parent",style:{marginLeft:35,textDecoration:"none"},href:t},m().createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},l)),m().createElement(CloseButton,{onClose:c,containerClassName:"close-button-top-right"})))),m().createElement("aside",{className:"le-only-mobile"},m().createElement("div",{className:"le-floating-mobile"},m().createElement("div",{className:"le-floating-mobile-wrap",style:{position:"relative",background:"#fff"}},m().createElement("aside",{style:{display:"flex",justifyContent:"space-between"}},m().createElement("div",null,m().createElement("div",{className:`le-floating-mobile-title le-text-align-${n}`},a),m().createElement("div",{className:`le-floating-mobile-desc le-text-align-${i}`},o)),d?m().createElement("div",null,m().createElement("img",{style:{marginLeft:15,marginTop:4,maxWidth:100,aspectRatio:`${p}/${g}`},src:d})):null),m().createElement("div",{style:{textAlign:"center",marginTop:10}},m().createElement("a",{target:r?"blank":"_parent",href:t,style:{textDecoration:"none"}},m().createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},l))),m().createElement(CloseButton,{onClose:c,containerClassName:"close-button-top-right"}))))):null},useViewportDimensions=()=>{let e=(0,u.useRef)({width:0,height:0}),[t,a]=(0,u.useState)(()=>({width:window.screen.availWidth,height:window.screen.availHeight}));return(0,u.useEffect)(()=>{var t;function visualViewport(t){if(e.current.width===t.target.width&&e.current.height===t.target.height)return;let l={width:t.target.width,height:t.target.height};e.current=l,a(l)}return null===(t=window.visualViewport)||void 0===t||t.addEventListener("resize",visualVie
215wport),()=>{var e;null===(e=window.visualViewport)||void 0===e||e.removeEventListener("resize",visualViewport)}},[]),(0,u.useMemo)(()=>Object.assign({},t),[t.height,t.width])};function isIOS(){return testPlatform(/^iPhone/)||testPlatform(/^iPad/)||testPlatform(/^Mac/)&&navigator.maxTouchPoints>1}function testPlatform(e){return"undefined"!=typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}function chain(...e){return(...t)=>{for(let a of e)"function"==typeof a&&a(...t)}}let getParentScroll=e=>{if(e===document.documentElement||e===document.body)return e;let t=e.parentElement;return!function(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}(t)?getParentScroll(t):t},tl="undefined"!=typeof window?u.useLayoutEffect:u.useEffect,tn="undefined"!=typeof document&&window.visualViewport,to=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),ti=0;function addEvent(e,t,a,l){return e.addEventListener(t,a,l),()=>{e.removeEventListener(t,a,l)}}function scrollIntoView(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=getParentScroll(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let a=t.getBoundingClientRect().top,l=e.getBoundingClientRect().top,n=e.getBoundingClientRect().bottom,o=t.getBoundingClientRect().bottom+24;n>o&&(t.scrollTop+=l-a)}e=t.parentElement}}function isInput(e){return e instanceof HTMLInputElement&&!to.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}let tr=G.A.div`
216  padding-top: calc(var(--spacing-y, 20px) * 8 / 20);
217  padding-inline: var(--spacing-x, 20px);
218  padding-bottom: var(--spacing-y, 20px);
219`,ts=G.A.div`
220  flex: 1;
221  min-height: 0;
222  overflow: auto;
223  padding-inline: var(--spacing-y, 20px);
224  padding-block: calc(var(--spacing-x, 20px) * 8 / 20);
225  &::-webkit-scrollbar {
226    width: 6px;
227    height: 6px;
228  }
229
230  &::-webkit-scrollbar-track {
231    background-color: transparent;
232  }
233
234  &::-webkit-scrollbar-thumb {
235    background-color: rgba(0, 0, 0, 0.4);
236    border-radius: 6px;
237  }
238`,td=G.A.div`
239  display: flex;
240  padding-top: var(--spacing-y, 20px);
241  padding-inline: var(--spacing-x, 20px);
242  padding-bottom: calc(var(--spacing-y, 20px) * 8 / 20);
243`,tc=G.A.div`
244  height: 100%;
245  display: flex;
246  flex-direction: column;
247`,tu=G.A.div`
248  --spacing-x: 20px;
249  --spacing-y: 20px;
250  --close-width: 24px;
251  --close-height: 24px;
252
253  // For old version, Wrap every thing in children
254  &[data-type='LightBoxB_typeA'] {
255    height: 100%;
256    width: 100%;
257    .leadgen-wrapper,
258    .leadgen-inner,
259    .leadgen-form {
260      height: 100%;
261    }
262    .leadgen-content {
263      height: 100%;
264      display: flex;
265      flex-direction: column;
266    }
267    .leadgen-header {
268      display: none;
269    }
270    .leadgen-title {
271      padding-right: calc(var(--close-width, 24px) * 50 / 24);
272    }
273    .leadgen-description {
274      display: none;
275    }
276    .leadgen-body {
277      flex: 1;
278      min-height: 0;
279    }
280
281    .leadgen-close_btn {
282      top: var(--spacing-y, 20px);
283      right: var(--spacing-x, 20px);
284      width: var(--close-width, 24px) !important;
285      height: var(--close-height, 24px);
286      box-shadow: none;
287      font-size: 24px;
288    }
289
290    .leadgen-empty_footer {
291      .leadgen-btn {
292        flex: 1;
293        min-width: 0;
294      }
295    }
296
297    .leadgen-form_body {
298      overflow: auto;
299      animation: scrolling forwards;
300      animation-timeline: scroll(self);
301    }
302    @keyframes scrolling {
303      0%,
304      to {
305        border-bottom: 1px solid ${W.w.colors.neutral100};
306      }
307    }
308  }
309`,tm=(0,G.A)(J.P.div)`
310  position: fixed;
311  inset: 0;
312  z-index: ${A.c+1};
313  background-color: #fff;
314`,tp="LightBoxB_typeA",tg={visible:{opacity:1,translateY:"0px",transitionProperty:"translate",transitionDuration:"0.25s"},hidden:{opacity:0,translateY:"100%",transitionProperty:"translate",transitionDuration:"0.25s"}},LeadGenLightBoxBTypeA=e=>{let{visible:t,onVisible:a,icon:n,title:o,buttonText:i,blocks:r,children:s}=e,d=(0,c.a)(e,["visible","onVisible","icon","title","buttonText","blocks","children"]),p=(0,u.useRef)(),[g,h]=(0,u.useState)(t),{height:v}=useViewportDimensions();!function(e={}){let{isDisabled:t}=e;tl(()=>{if(!t)return 1==++ti&&isIOS()&&(l=function(){let e;let t=0,a=window.pageXOffset,l=window.pageYOffset,n=chain(function(e,t,a){let l=e.style[t];return e.style[t]=a,()=>{e.style[t]=l}}(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let o=chain(addEvent(document,"touchstart",a=>{((e=getParentScroll(a.target))!==document.documentElement||e!==document.body)&&(t=a.changedTouches[0].pageY)},{passive:!1,capture:!0}),addEvent(document,"touchmove",a=>{if(!e||e===document.documentElement||e===document.body){a.preventDefault();return}let l=a.changedTouches[0].pageY,n=e.scrollTop,o=e.scrollHeight-e.clientHeight;0!==o&&((n<=0&&l>t||n>=o&&l<t)&&a.preventDefault(),t=l)},{passive:!1,capture:!0}),addEvent(document,"touchend",e=>{let t=e.target;isInput(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},{passive:!1,capture:!0}),addEvent(document,"focus",e=>{let t=e.target;isInput(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",tn&&(tn.height<window.innerHeight?requestAnimationFrame(()=>{scrollIntoView(t)}):tn.addEventListener("resize",()=>scrollIntoView(t),{once:!0}))}))},!0),addEvent(window,"scroll",()=>{window.scrollTo(0,0)}));return()=>{n(),o(),window.scrollTo(a,l)}}()),()=>{0==--ti&&(null==l||l())}},[t])}();let b=(0,u.useCallback)(e=>{if(!e){setTimeout(()=>{null==a||a(e)},500);return}null==a||a(e)},[a]),f=(0,u.useMemo)(()=>n?m().createElement(m().Fragment,null):null,[n]),y=(0,u.useMemo)(()=>o||null,[o]),k=(0,u.useMemo)(()=>s||m().createElement(tc,{className:`${tp}_wrapper lightboxB_wrapper`},m().createElement(td,{className:`${tp}_header lightboxB_header`},m().createElement("div",{className:"lightBoxB_header_icon"},f),m().createElement("div",{className:"lightBoxB_header_title"},y),m().createElement("div",{className:"lightBoxB_header_close",onClick:()=>b(!1)},m().createElement(CloseButton,null))),m().createElement(ts,{className:`${tp}_body lightboxB_body`},m().createElement(e7,Object.assign({ref:p,blocks:r},d))),m().createElement(tr,{className:`${tp}_footer lightboxB_footer`},m().createElement(L.B,{onClick:()=>{var e;return null===(e=p.current)||void 0===e?void 0:e.submit()}},i))),[s,b]);return(0,u.useEffect)(()=>{h(t)},[t]),m().createElement(tm,{animate:g?"visible":"hidden",variants:tg},m().createElement(tu,{"data-type":"LightBoxB_typeA",style:v?{maxHeight:v}:void 0},k))},LeadGenLightBoxB=e=>m().createElement(LeadGenLightBoxBTypeA,Object.assign({},e)),ThankyouPopup=({title:e,titleAlign:t,subtitle:a,subtitleAlign:l,link:n,linkNewTab:o,linkText:i,image:r})=>{let{primaryColor:s}=(0,u.useContext)(ej),{width:d,height:c,loaded:p}=useImageSize(r);return p?m().createElement("div",{className:"lead-modal__thank-you leadgen-inner_thankyou"},m().createElement("div",{style:{width:"100%"}},m().createElement("img",{src:r,style:{maxHeight:162,objectFit:"cover",aspectRatio:`${d}/${c}`},loading:"lazy"}),e&&m().createElement(B.T,{size:"h4",weight:"semiBold",variant:"primary",as:"h3",className:`le-thankyou-title le-text-align-${t}`},e),a&&m().createElement(B.T,{size:"p2",variant:"secondary",className:`le-thankyou-subtitle le-text-align-${l}`},a.split("\n").map((e,t,a)=>{let l=t<a.length-1;return m().createElement(m().Fragment,null,e,l&&m().createElement("br",null))})),i&&m().createElement("div",null,m().createElement("a",{href:n,target:o?"_blank":"parrent",rel:"noreferrer"},m().createElement(L.B,{className:`lead-modal__btn ${em}`,color:s},i))))):null},InlineLayout=({content:e,inlinePosition:t,doImpression:a})=>{let l=(0,u.useMemo)(()=>
314{if(!t)return null;let e=document.querySelectorAll(`[data-url="${location.pathname}"] .body-content`),a=Array.from(e).reduce((e,t)=>[...e,...Array.from(t.children)],[]);if(null==a?void 0:a.length){let e=a.filter(e=>"P"===e.nodeName),l=a.filter(e=>"H2"===e.nodeName),n=null;switch(t){case"1th":n=e[0];break;case"2th":n=e[1];break;case"3th":n=e[2];break;case"4th":n=e[3];break;case"5th":n=e[4];break;case"6th":n=e[5];break;case"7th":n=e[6];break;case"8th":n=e[7];break;case"9th":n=e[8];break;case"10th":n=e[9];break;case"11th":n=e[10];break;case"12th":n=e[11];break;case"lastP":n=e[e.length-1];break;case"1thH2":n=l[0];break;case"2thH2":n=l[1];break;case"3thH2":n=l[2];break;case"4thH2":n=l[3];break;case"5thH2":n=l[4];break;case"6thH2":n=l[5];break;case"7thH2":n=l[6];break;case"8thH2":n=l[7];break;case"9thH2":n=l[8];break;case"10thH2":n=l[9];break;case"lastH2":n=l[l.length-1]}if(n){if(n.parentElement.querySelector(".inline-lead-wrapper"))return n.parentElement.querySelector(".inline-lead-wrapper");{let e=document.createElement("div");return e.classList.add("inline-lead-wrapper"),n.nextElementSibling?n.parentElement.insertBefore(e,n.nextElementSibling):n.parentElement.appendChild(e),e}}}},[t]);return t&&l?(0,K.createPortal)(m().createElement(ImpressionTrackingWrapper,{onImpression:()=>(0,c._)(void 0,void 0,void 0,function*(){return yield a()})},e),l):null},SideBarLayout=({content:e})=>{let t=(0,u.useMemo)(()=>{let e=Array.from(document.querySelectorAll(".hc2-sidebar-with-ads,.page-main-col .right-col.f-right,.hhg-lead-sidebar"));return e.forEach(e=>{if(e.querySelector(".sidebar-lead-modal-wrapper"))return;let t=document.createElement("div");t.classList.add("sidebar-lead-modal-wrapper"),e.prepend(t)}),e.map(e=>e.querySelector(".sidebar-lead-modal-wrapper"))},[]);return m().createElement(m().Fragment,null,t.map(t=>(0,K.createPortal)(e,(0,_.b)(t,"sidebar-lead-modal-wrapper"))))},EmptyIcon=e=>{let{className:t,style:a}=e;return m().createElement("svg",{width:"160",height:"160",viewBox:"0 0 160 160",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:a},m().createElement("path",{d:"M79.9974 113.333C98.4069 113.333 113.331 98.4096 113.331 80.0001C113.331 61.5906 98.4069 46.6667 79.9974 46.6667C61.5879 46.6667 46.6641 61.5906 46.6641 80.0001C46.6641 98.4096 61.5879 113.333 79.9974 113.333Z",fill:"#F44D2C"}),m().createElement("path",{d:"M92.434 95.0004C91.7771 95.0004 91.1213 94.7499 90.6194 94.249L65.7521 69.3807C64.7493 68.3779 64.7493 66.7542 65.7521 65.7524C66.7549 64.7507 68.3786 64.7497 69.3804 65.7524L94.2487 90.6208C95.2515 91.6235 95.2515 93.2473 94.2487 94.249C93.7468 94.7499 93.0909 95.0004 92.434 95.0004Z",fill:"white"}),m().createElement("path",{d:"M67.5648 95C66.9079 95 66.252 94.7496 65.7501 94.2487C64.7474 93.2459 64.7474 91.6222 65.7501 90.6204L90.6185 65.7521C91.6212 64.7493 93.245 64.7493 94.2467 65.7521C95.2485 66.7549 95.2495 68.3786 94.2467 69.3804L69.3794 94.2487C68.8786 94.7496 68.2217 95 67.5648 95Z",fill:"white"}))},EmptyComponent=({onClose:e,onContinue:t})=>{let{t:a}=useLeadGenTranslations();return m().createElement("div",{className:"leadgen-empty"},m().createElement("div",{className:"leadgen-empty_body"},m().createElement("div",{className:"leadgen-empty_wrapper"},m().createElement(EmptyIcon,{className:"leadgen-empty_image"}),m().createElement("h5",{className:"leadgen-empty_title"},a("lead.empty.title")))),m().createElement("div",{className:"leadgen-empty_footer"},m().createElement(p.Button,{onClick:e,size:"lg",variant:"default",fullWidth:!1,className:"leadgen-btn leadgen-btn_empty_cancel"},a("lead.empty.cancel")),m().createElement(p.Button,{onClick:t,size:"lg",variant:"filled",fullWidth:!1,className:"leadgen-btn leadgen-btn_empty_again"},a("lead.empty.submitAgain"))))},SubtitleBlock=({children:e,align:t})=>m().createElement("p",{className:`lead-modal__description ${"le-text-align-"+(t||"")} ${em}`},e),TitleBlock=({children:e,align:t})=>m().createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(t||"")} ${em}`},e),LightboxFields=({listBlockAdded:e,popupId:t,locale:a,hasSubmitBtn:l,isSubmitLoading:n,disabledButtonSubmit:o})=>{let{t:i}=useLeadGenTranslations(),{setRedirectUrl:r}=(0,u.useContext)(ej),s=eQ(),d=s.values,g=(0,u.useMemo)(()=>((null===A.I||void 0===A.I?void 0:A.I[a])||A.I["vi-VN"]).dateFormat.split("/").map(e=>{var t;return i(null===(t=null===F.C||void 0===F.C?void 0:F.C[e])||void 0===t?void 0:t.id)}),[a]);return m().createElement(m().Fragment,null,e.map((e,i)=>{var u;let{name:h="",data:v={},id:b}=e||{},{placeholder:f,value:y,align:k,listQuestion:E,isSendMailChimp:C=!1,newtab:w,url:x}=v,_=null===(u=v.required)||void 0===u||u,S=(null==d?void 0:d[y])||null;switch(h){case"TitleBlock":return m().createElement(TitleBlock,{key:i,align:k},y);case"SubtitleBlock":return m().createElement(SubtitleBlock,{key:i,align:k},y);case"TextBlock":return m().createElement(V.T,{key:i,shrink:!!S,className:"lead-modal__form-control leadgen-form_field"},m().createElement(V.T.Control,null,({shrink:e})=>m().createElement(p.TextInput,Object.assign({withAsterisk:_,spellCheck:!1,type:"text",placeholder:" ",label:m().createElement(B.T,{size:e?"p3":"p2",variant:"secondary",weight:"halfBold"},f),"data-control":"text","data-lead-control":h,"data-is-required":_,inputWrapperOrder:["label","input","description","error"]},s.getInputProps(y),{name:y,error:s.errors[y]&&m().createElement(p.Flex,{align:"center",gap:4},m().createElement(T.E,{size:12}),m().createElement(B.T,{size:"c1",variant:"error"},s.errors[y])),styles:e=>({input:Object.assign(Object.assign({},(0,O.G)(e)[O.C.LEADGEN].p2),{color:e.colors.gray[9],fontWeight:O.F.halfBold}
314)})}))));case"NumberBlock":return m().createElement(V.T,{key:i,shrink:!!S,className:"lead-modal__form-control leadgen-form_field"},m().createElement(V.T.Control,null,({shrink:e})=>m().createElement(p.NumberInput,Object.assign({withAsterisk:_,spellCheck:!1,type:"number",placeholder:" ",label:m().createElement(B.T,{size:e?"p3":"p2",variant:"secondary",weight:"halfBold"},f),"data-control":"number","data-lead-control":h,"data-is-required":_,name:y,inputWrapperOrder:["label","input","description","error"]},s.getInputProps(y),{error:s.errors[y]&&m().createElement(p.Flex,{align:"center",gap:4},m().createElement(T.E,{size:12}),m().createElement(B.T,{size:"c1",variant:"error"},s.errors[y])),styles:e=>({input:Object.assign(Object.assign({},(0,O.G)(e)[O.C.LEADGEN].p2),{color:e.colors.gray[9],fontWeight:O.F.halfBold})})}))));case"EmailBlock":return m().createElement(V.T,{key:i,shrink:!!S,className:"lead-modal__form-control leadgen-form_field"},m().createElement(V.T.Control,null,({shrink:e})=>m().createElement(p.TextInput,Object.assign({withAsterisk:_,spellCheck:!1,placeholder:" ",label:m().createElement(B.T,{size:e?"p3":"p2",variant:"secondary",weight:"halfBold"},f),"data-control":"email","data-lead-control":h,"data-is-required":_,name:y,inputWrapperOrder:["label","input","description","error"]},s.getInputProps(y),{error:s.errors[y]&&m().createElement(p.Flex,{align:"center",gap:4},m().createElement(T.E,{size:12}),m().createElement(B.T,{size:"c1",variant:"error"},s.errors[y])),styles:e=>({input:Object.assign(Object.assign({},(0,O.G)(e)[O.C.LEADGEN].p2),{color:e.colors.gray[9],fontWeight:O.F.halfBold})})}))));case"PhoneOtpBlock":case"WhatsappOtpBlock":case"ZaloOtpBlock":case"PhoneBlock":{let e=t+"-"+y+"-"+i,l=s.getInputProps(y),{error:n}=l,o=(0,c.a)(l,["error"]);return m().createElement(V.T,{key:i,shrink:!!S,className:(0,p.clsx)("lead-modal__form-control leadgen-form_field",{"leadgen-form_field_error":!!n})},m().createElement(V.T.Control,null,({shrink:t})=>m().createElement(p.Input.Wrapper,{size:"md",withAsterisk:_,label:m().createElement(B.T,{size:t?"p3":"p2",variant:"secondary",weight:"halfBold"},f),"data-invalid":!!n,labelProps:{htmlFor:e},inputWrapperOrder:["label","input","description","error"],error:s.errors[y]&&m().createElement(p.Flex,{align:"center",gap:4},m().createElement(T.E,{size:12}),m().createElement(B.T,{size:"c1",variant:"error"},s.errors[y]))},m().createElement(p.Box,{className:"mantine-Input-wrapper",sx:e=>({".PhoneInput .PhoneInputInput":Object.assign(Object.assign({},(0,O.G)(e)[O.C.LEADGEN].p2),{color:e.colors.gray[9],fontWeight:O.F.halfBold})})},m().createElement(T.P,Object.assign({className:"mantine-Input-input",name:y,spellCheck:!1,type:"tel",placeholder:" ",id:e,defaultCountry:a&&P.M[a]||"VN","data-control":"tel","data-lead-control":h,"data-is-required":_},o))))))}case"LocationBlock":return m().createElement(V.T,{key:i,shrink:!!S,className:"lead-modal__form-control leadgen-form_field"},m().createElement(V.T.Control,null,({shrink:e,hasIcon:t})=>m().createElement(GoogleLocationBlock,Object.assign({withAsterisk:_,name:y,placeholder:" ",label:m().createElement(B.T,{size:e?"p3":"p2",variant:"secondary",weight:"halfBold"},f),"data-control":"text","data-lead-control":h,"data-is-required":_,locale:a,inputWrapperOrder:["label","input","description","error"]},s.getInputProps(y),{error:s.errors[y]&&m().createElement(p.Flex,{align:"center",gap:4},m().createElement(T.E,{size:12}),m().createElement(B.T,{size:"c1",variant:"error"},s.errors[y])),styles:e=>({input:Object.assign(Object.assign(Object.assign({},(0,O.G)(e)[O.C.LEADGEN].p2),{color:e.colors.gray[9],fontWeight:O.F.halfBold}),t&&{paddingRight:`${(0,p.rem)(28)} !important`})})}))),m().createElement(V.T.Icon,{Icon:X.A}));case"DateBlock":{let e=s.getInputProps(y),{error:t}=e,l=(0,c.a)(e,["error"]);return m().createElement(p.Input.Wrapper,{key:i,size:"md",withAsterisk:_,label:m().createElement(B.T,{size:"p2",variant:"primary"},f),"data-invalid":!!t,inputWrapperOrder:["label","input","description","error"],error:s.errors[y]&&m().createElement(p.Flex,{align:"center",gap:4},m().createElement(T.E,{size:12}),m().createElement(B.T,{size:"c1",variant:"error"},s.errors[y])),className:"lead-modal__form-control leadgen-form_field"},m().createElement(ee.I,Object.assign({name:y,error:!!t,locale:a,"data-extra":!0,"data-name":y,"data-control":"date","data-lead-control":h,"data-is-required":_,className:"leadgen-form_field_date",labelTuples:g},l)))}case"LinkButtonBlock":return m().createElement("div",{key:i},m().createElement(L.B,Object.assign({type:l?"button":"submit",size:"md",className:`lead-modal__btn ${em}`},!l&&{loading:n,disabled:o},{onClick:()=>{l?window.open(x,w?"_blank":void 0):r({url:x,target:w?"_blank":void 0})}}),y));case"CheckboxBlock":return m().createElement(V.C,{className:"leadgen-form_checkbox",key:i},C&&m().createElement("div",{style:{display:"none"},"data-name":y+"-mailchimp"}),m().createElement(T.d.Group,Object.assign({withAsterisk:_,label:m().createElement(B.T,{size:"p2",variant:"primary"}
314,f),size:"md",sx:{display:"flex",flexDirection:"column",flexWrap:"wrap",gap:8},inputWrapperOrder:["label","input","description","error"],inputContainer:e=>m().createElement("div",{className:"leadgen-choiceContainer"},e)},s.getInputProps(y),{error:s.errors[y]&&m().createElement(p.Flex,{align:"center",gap:4},m().createElement(T.E,{size:12}),m().createElement(B.T,{size:"c1",variant:"error"},s.errors[y]))}),E.map((e,t)=>m().createElement(T.d,{name:y,key:t,value:e.value,label:m().createElement(B.T,{size:"p2",variant:"primary"},e.placeholder),"data-control":"checkbox","data-lead-control":h,"data-is-required":_}))));case"RadioBlock":return m().createElement(V.C,{className:"leadgen-form_radio",key:i},C&&m().createElement(p.Input,{type:"hidden",name:y+"-mailchimp",value:C}),m().createElement(T.R.Group,Object.assign({withAsterisk:_,label:m().createElement(B.T,{size:"p2",variant:"primary"},f),size:"md",inputWrapperOrder:["label","input","description","error"],inputContainer:e=>m().createElement("div",{className:"leadgen-choiceContainer"},e)},s.getInputProps(y),{error:s.errors[y]&&m().createElement(p.Flex,{align:"center",gap:4},m().createElement(T.E,{size:12}),m().createElement(B.T,{size:"c1",variant:"error"},s.errors[y]))}),E.map((e,t)=>m().createElement(T.R,{name:y,key:t,value:e.value,label:m().createElement(B.T,{size:"p2",variant:"primary"},e.placeholder),"data-control":"radio","data-lead-control":h,"data-is-required":_}))));case"DropdownBlock":return m().createElement(V.T,{shrink:!!S,className:"lead-modal__form-control leadgen-form_field DropdownBlock",key:i},m().createElement(V.T.Control,null,({shrink:e})=>m().createElement(m().Fragment,null,m().createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":y,"data-control":"dropdown","data-lead-control":h,"data-is-required":_}),m().createElement(T.S,Object.assign({label:m().createElement(B.T,{size:e?"p3":"p2",variant:"secondary",weight:"halfBold"},f),placeholder:" ",searchable:!0,withAsterisk:_,name:y,data:E.map(e=>({value:e.value,label:e.placeholder})),nothingFound:m().createElement(NoData,null),rightSection:m().createElement(V.T.Icon,{Icon:Q.A}),styles:e=>({wrapper:{input:Object.assign(Object.assign({},(0,O.G)(e)[O.C.LEADGEN].p2),{color:e.colors.gray[9],fontWeight:O.F.halfBold})},item:{paddingBlock:12,paddingInline:10,fontSize:16,lineHeight:1.5},nothingFound:{fontSize:54,paddingBlock:30},itemsWrapper:{padding:6},dropdown:{'.mantine-ScrollArea-scrollbar[data-orientation="vertical"]':{"--radix-scroll-area-thumb-width":"6px",width:"var(--radix-scroll-area-thumb-width)",paddingInline:0}}}),maxDropdownHeight:192},s.getInputProps(y),{error:s.errors[y]&&m().createElement(p.Flex,{align:"center",gap:4},m().createElement(T.E,{size:12}),m().createElement(B.T,{size:"c1",variant:"error"},s.errors[y]))})))));case"TncBlock":let N=s.getInputProps(`TNC-${b}`),{error:I}=N,A=(0,c.a)(N,["error"]);return m().createElement(V.C,{className:"leadgen-form_checkbox",key:b},m().createElement(p.Input.Wrapper,{error:I&&m().createElement(p.Flex,{align:"center",gap:4},m().createElement(T.E,{size:12}),m().createElement(B.T,{size:"c1",variant:"error"},I))},m().createElement(T.d,Object.assign({name:"TNC-"+b,label:m().createElement(B.T,{as:"span",size:"c1",variant:"secondary",dangerouslySetInnerHTML:{__html:v.valueHTML},styles:e=>({root:{a:{textDecoration:"underline !important",textUnderlineOffset:"3px",color:`${e.colors.gray[7]} !important`}}})}),className:"tnc-block","data-control":"checkbox","data-lead-control":h,"data-is-required":_},A))))}return null}))},th=G.A.div`
315  height: 100%;
316  .leadgen-form_wrapper {
317    height: 100%;
318    display: flex;
319    flex-direction: column;
320  }
321
322  .leadgen-form_inner {
323    flex: 1;
324    min-height: 0;
325    display: flex;
326
327    &:has(.leadgen-header) {
328      display: block;
329    }
330  }
331
332  .leadgen-form_body {
333    flex: 1;
334    min-height: 0;
335    ${_.M.mbUp} {
336      overflow: auto;
337    }
338
339    &::-webkit-scrollbar {
340      width: 6px;
341      height: 6px;
342    }
343
344    &::-webkit-scrollbar-track {
345      background-color: transparent;
346    }
347
348    &::-webkit-scrollbar-thumb {
349      background-color: rgba(0, 0, 0, 0.4);
350      border-radius: 6px;
351    }
352  }
353
354  &[data-hidden-form='true'] {
355    .leadgen-form_body {
356      display: none;
357    }
358  }
359
360  [data-align='right'] {
361    text-align: right;
362  }
363
364  [data-align='center'] {
365    text-align: center;
366  }
367`,FormContainer=e=>{var{iconComponent:t,title:a,titleAlign:l,description:n,descriptionAlign:o,className:i,style:r,children:s,header:d,footer:u}=e,g=(0,c.a)(e,["iconComponent","title","titleAlign","description","descriptionAlign","className","style","children","header","footer"]);let h=m().createElement("div",{className:"leadgen-form_header"},t,m().createElement(B.T,{as:"h2",size:"h4",variant:"primary",weight:"semiBold",className:"leadgen-title","data-align":l},a),!!n&&m().createElement(B.T,{size:"p2",variant:"secondary",title:n,className:"leadgen-description","data-align":o,dangerouslySetInnerHTML:{__html:n}}));return a||n?m().createElement(th,Object.assign({className:(0,p.clsx)(i,"leadgen-form_container"),style:r},g),m().createElement("div",{className:"leadgen-form_wrapper"},!!d&&m().createElement("div",{className:"leadgen-form_scrollable"},d,h,m().createElement("div",{className:"leadgen-form_body"},s)),!d&&m().createElement(m().Fragment,null,h,m().createElement("div",{className:"leadgen-form_body"},s)),m().createElement("div",{className:"leadgen-form_footer"},u))):null},tv=G.A.div`
368  position: relative;
369  overflow: hidden;
370  width: 100%;
371  height: 100%;
372  padding-top: ${({paddingTop:e})=>e}%;
373  .leadgen-header_image_feature {
374    position: absolute;
375    inset: 0;
376    min-width: 100%;
377    min-height: 100%;
378    max-width: 100%;
379    max-height: 100%;
380    object-fit: cover;
381    object-position: center;
382  }
383`,HeaderImage=({src:e,ratio:t=1.5,className:a,style:l})=>e?m().createElement(tv,{paddingTop:1/t*100,className:(0,p.clsx)(a,"leadgen-header_image"),style:l},(0,Z.i)(e)?m().createElement("video",{muted:!0,autoPlay:!0,loop:!0,className:"leadgen-header_image_feature leadgen-header_image_video",src:e}):m().createElement("img",{src:e,draggable:"false",alt:"",className:"leadgen-header_image_feature leadgen-header_image_image"})):null,OtpBlock=({otpData:e,onSuccess:t,autoSendWhenOpen:l})=>{let{primaryColor:n}=(0,u.useContext)(ej),{t:o}=useLeadGenTranslations(),i=e.phone,r=e.type,[s,d]=(0,u.useState)(""),[g,h]=(0,u.useState)(!1),[v,b]=(0,u.useState)(l?0:60),f=(0,u.useRef)(null),[y,k]=(0,u.useState)(),[E,C]=(0,u.useState)(""),w=(0,u.useRef)(),[x,_]=(0,u.useState)(!1);(0,u.useEffect)(()=>{(0,c._)(void 0,void 0,void 0,function*(){var e;if(!w.current){let e=yield Promise.resolve().then(a.bind(a,"A9bs"));w.current=e.formatPhoneNumberIntl}C((null===(e=w.current)||void 0===e?void 0:e.call(w,i))||i)})},[i]);let sendOtp=()=>(0,c._)(void 0,void 0,void 0,function*(){var e;if(!i)return;let a=yield eT.sendSMSOtpLead({phone:i,type:r}),l=null===(e=null==a?void 0:a._messages)||void 0===e?void 0:e[0];"Send sms successfully"===l||"Send WhatsApp successfully"===l||"Send Zalo successfully"===l?(b(60),setTimeout(()=>{f.current&&(f.current.focus(),f.current.scrollIntoView({block:"center"}))},100)):"This phone number was verified"===l?t():k(l||"Something went wrong!")}),submitOtp=()=>(0,c._)(void 0,void 0,void 0,function*(){if(!i||!s)return;_(!0);let e=yield eT.verifyOtpLead({phone:i,otp:s,type:r}),a=null==e?void 0:e._messages[0];"Verify successfully"===a||"Verify WhatsApp OTP sucess"===a||"Verify Zalo OTP sucess"===a?t():"This phone number was verified"===a?t():k(a||"something Wrong"),_(!1)});return(0,u.useEffect)(()=>{setTimeout(()=>{v>0&&b(e=>e-1)},1e3)},[v]),(0,u.useEffect)(()=>{l&&!v&&sendOtp()},[]),m().createElement("form",{onSubmit:e=>{e.preventDefault(),submitOtp()},className:"lead-phone-otp-form leadgen-form leadgen-form_otp"},m().createElement(FormContainer,{title:o("lead.otp.title"),description:o("lead.otp.desc",{phone:`<strong>${E}</strong>`}),footer:m().createElement(m().Fragment,null,m().createElement(p.Button,{type:"submit",size:"lg",variant:"filled",className:`lead-modal__btn leadgen-btn_action ${em}`,color:n,disabled:!s,loading:x},o("lead.otp.verify")),m().createElement(p.Button,{type:"button",size:"lg",variant:"light",className:`lead-modal__btn lead-phone-otp-button leadgen-btn_action ${em}`,color:n,onClick:()=>{sendOtp()},disabled:!!v},o("lead.otp.resend",{timer:v?` (${v}s)`:""})))},m().createElement("div",{className:"leadgen-form_inner"},m().createElement(T.I.Wrapper,{error:g?y:void 0,className:"leadgen-form_field"},m().createElement(T.O,{ref:f,name:"_"+name+"-otp",value:s,onChange:e=>{h(!0),d(e.toString()),g&&!e?k("OTP is required"):k(void 0)}})))))},Gift=({className:e,style:t})=>m().createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:t},m().createElement("path",{d:"M15.8337 9.16675V15.8334C15.8337 17.0612 14.8392 18.0556 13.6114 18.0556H6.38921C5.16144 18.0556 4.16699 17.0612 4.16699 15.8334V9.16675",fill:"#FEC7DC"}),m().createElement("path",{d:"M10 5.83337V18.0556",stroke:"#FC488D",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}
383),m().createElement("path",{d:"M4.16699 3.8889C4.16699 2.81557 5.0381 1.94446 6.11144 1.94446C8.9881 1.94446 10.0003 5.83335 10.0003 5.83335H6.11144C5.0381 5.83335 4.16699 4.96224 4.16699 3.8889Z",stroke:"#FC488D",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),m().createElement("path",{d:"M13.8889 5.83335H10C10 5.83335 11.0122 1.94446 13.8889 1.94446C14.9622 1.94446 15.8333 2.81557 15.8333 3.8889C15.8333 4.96224 14.9622 5.83335 13.8889 5.83335Z",stroke:"#FC488D",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),m().createElement("path",{d:"M15.8337 9.16675V15.8334C15.8337 17.0612 14.8392 18.0556 13.6114 18.0556H6.38921C5.16144 18.0556 4.16699 17.0612 4.16699 15.8334V9.16675",stroke:"#FC488D",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),m().createElement("path",{d:"M16.9443 5.83337H3.05545C2.4418 5.83337 1.94434 6.33084 1.94434 6.94449V8.0556C1.94434 8.66924 2.4418 9.16671 3.05545 9.16671H16.9443C17.558 9.16671 18.0554 8.66924 18.0554 8.0556V6.94449C18.0554 6.33084 17.558 5.83337 16.9443 5.83337Z",stroke:"#FC488D",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})),Star=({className:e,style:t})=>m().createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:t},m().createElement("path",{d:"M7.76093 1.94434L11.8267 4.92811L16.5893 3.27134L15.0077 8.05978L18.0553 12.0772L13.0127 12.0526L10.1339 16.1928L8.59882 11.3896L3.77148 9.93078L7.86504 6.98645L7.76093 1.94434Z",fill:"#91CAFF"}
383),m().createElement("path",{d:"M7.76093 1.94434L11.8267 4.92811L16.5893 3.27134L15.0077 8.05978L18.0553 12.0772L13.0127 12.0526L10.1339 16.1928L8.59882 11.3896L3.77148 9.93078L7.86504 6.98645L7.76093 1.94434Z",stroke:"#2D87F3",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),m().createElement("path",{d:"M2.22168 17.7777L5.55501 14.4443",stroke:"#2D87F3",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),m().createElement("path",{d:"M1.94434 13.611L2.49989 13.0554",stroke:"#2D87F3",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),m().createElement("path",{d:"M6.38867 18.0556L6.94423 17.5",stroke:"#2D87F3",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})),tb=G.A.div`
384  display: flex;
385  align-items: center;
386  gap: ${(0,p.rem)(8)};
387  margin-bottom: ${(0,p.rem)(16)};
388`;var tf=(0,p.createStyles)(e=>({indicators:{bottom:0,gap:(0,p.rem)(4)},indicator:{width:(0,p.rem)(5),height:(0,p.rem)(5),borderRadius:"100%",background:e.colors.neutral[2],opacity:1,"&[data-active]":{backgroundColor:e.fn.primaryColor()}},container:{padding:`0 0 ${(0,p.rem)(21)} 0`},root:{marginBottom:(0,p.rem)(16)}}));let ty=G.A.div`
389  display: flex;
390  flex-direction: column;
391  border-radius: ${(0,p.rem)(16)};
392  box-shadow: 0px 32px 32px -16px rgba(0, 0, 0, 0.04),
393    0px 6px 6px -3px rgba(0, 0, 0, 0.04), 0px 3px 3px -1.5px rgba(0, 0, 0, 0.04),
394    0px 1px 1px -0.5px rgba(0, 0, 0, 0.04);
395  background-color: ${W.w.colors.white};
396
397  .mantine-AspectRatio-root {
398    width: 100%;
399
400    img {
401      border-radius: ${(0,p.rem)(16)} ${(0,p.rem)(16)} 0 0;
402      margin: 0;
403    }
404  }
405
406  .mantine-Badge-root {
407    height: fit-content;
408    width: fit-content;
409    position: absolute;
410    padding: ${(0,p.rem)(4)} ${(0,p.rem)(8)};
411    border-radius: ${(0,p.rem)(8)};
412    bottom: ${(0,p.rem)(12)};
413    left: ${(0,p.rem)(12)};
414
415    .mantine-Text-root {
416      line-height: ${(0,p.rem)(12)};
417    }
418
419    background-color: #00000080;
420  }
421`,tk=G.A.div`
422  width: 100%;
423  height: 100%;
424  position: relative;
425`,FreebieLuckyGiftItem=({isHostedByClient:e,locale:t,data:{image:a,name:l,desc:n,prize_value:o,prize_unit:i,cta_button:r,winning_slot:s}})=>{let{t:d}=useLeadGenTranslations();console.log(o,i,t);let c=o&&i?(0,ea.c)(o,t,i):"";return m().createElement(ty,null,m().createElement(tk,null,m().createElement(p.AspectRatio,{ratio:1.5},m().createElement(Y.I,{src:a,alt:l||""})),s>0&&m().createElement(p.Badge,null,m().createElement(B.T,{size:"c2",color:W.w.colors.white},s," SLOTS"))),m().createElement(p.Box,{p:"12px"},m().createElement(p.Tooltip,{label:l,position:"top",withArrow:!0},m().createElement(B.T,{lineClamp:2,size:"title2",mb:(0,p.rem)(4),style:{height:(0,p.rem)(48)}},l)),m().createElement(p.Tooltip,{label:n,position:"top",withArrow:!0},m().createElement(B.T,{lineClamp:2,size:"p3",mb:(0,p.rem)(16),style:{height:(0,p.rem)(40)}},n)),m().createElement(B.T,{size:"p3",fw:500},m().createElement(B.T,{as:"span"},d("inlineFreebie.value")," "),m().createElement(B.T,{as:"span",color:W.w.colors.primaryBase},c)),e&&m().createElement(L.B,{className:"inline-freebie-button"},m().createElement(B.T,{size:"p2"},r))))},FreebieFreeSampleItem=({data:{image:e,name:t,desc:a,cta_button:l}})=>m().createElement(ty,null,m().createElement(p.AspectRatio,{ratio:1.5},m().createElement(Y.I,{src:e,alt:t||""})),m().createElement(p.Box,{p:"12px"},m().createElement(p.Tooltip,{label:t,position:"top",withArrow:!0},m().createElement(B.T,{lineClamp:2,size:"title2",mb:(0,p.rem)(4),style:{height:(0,p.rem)(48)}},t)),m().createElement(p.Tooltip,{label:a,position:"top",withArrow:!0},m().createElement(B.T,{lineClamp:3,size:"p3",style:{height:(0,p.rem)(60)}},a)),m().createElement(L.B,{className:"lucky-gift-button inline-freebie-button"},m().createElement(B.T,{size:"p2"},l))));(o=s||(s={})).CLIENT="CLIENT",o.HHG="HHG",(i=d||(d={})).SAMPLE="SAMPLE",i.LUCKY_DRAW="LUCKY_DRAW";let FreebieCarousel=({isHostedByClient:e,data:t,locale:a})=>{let{classes:l}=tf(void 0,{name:"Carousel"}),{t:n}=useLeadGenTranslations(),o=t.filter(e=>e.type===d.SAMPLE),i=t.filter(e=>e.type===d.LUCKY_DRAW),r=i.length>0,s=o.length>0,c=i.length>1,u=o.length>1,g=i[0].cta_button;
425return m().createElement(m().Fragment,null,r&&m().createElement(m().Fragment,null,m().createElement(tb,null,m().createElement(Gift,null),m().createElement(B.T,{size:"title2",color:W.w.colors.pink800},n("inlineFreebie.freeSample.title"))),m().createElement(et.F,{slideSize:u?(0,p.rem)(262):(0,p.rem)(355),slideGap:(0,p.rem)(12),align:"start",withControls:!1,withIndicators:u,classNames:Object.assign({},l)},o.map(e=>m().createElement(et.F.Slide,{key:`${e.type}-${e.product_code}`},m().createElement(FreebieFreeSampleItem,{data:e}))))),s&&m().createElement(m().Fragment,null,m().createElement(tb,null,m().createElement(Star,null),m().createElement(B.T,{size:"title2",color:W.w.colors.primaryBase},n("inlineFreebie.luckyDrawGift.title"))),m().createElement(et.F,{slideSize:c?(0,p.rem)(262):(0,p.rem)(355),slideGap:(0,p.rem)(12),align:"start",withControls:!1,withIndicators:c,classNames:Object.assign({},l)},i.map(t=>m().createElement(et.F.Slide,{key:`${t.type}-${t.product_code}`},m().createElement(FreebieLuckyGiftItem,{isHostedByClient:e,data:t,locale:a})))),!e&&m().createElement(L.B,{className:"inline-freebie-button"},m().createElement(B.T,{size:"p2"},g))))},tE=G.A.div`
426  margin-bottom: ${(0,p.rem)(4)};
427`,tC=(0,G.A)(B.T)`
428  margin-bottom: ${(0,p.rem)(16)};
429`,tw=G.A.img`
430  height: ${(0,p.rem)(32)};
431  width: auto;
432`,tx=G.A.div`
433  padding: ${(0,p.rem)(16)};
434  background-color: ${W.w.colors.neutral50};
435
436  .inline-freebie-button {
437    width: 100%;
438    margin-top: ${(0,p.rem)(12)};
439
440    .mantine-Text-root {
441      color: ${W.w.colors.white};
442      font-weight: 600;
443    }
444
445    &.lucky-gift-button {
446      background-color: ${W.w.colors.pink800};
447
448      &:hover {
449        background-color: ${W.w.colors.pink700};
450      }
451    }
452  }
453`,InlineFreebie=({campaign:e,locale:t})=>{let{hosted_by:a,brand_image:l,widget_title:n,data_freebies:o}=e;return m().createElement(tx,null,m().createElement(tE,null,m().createElement(tw,{src:l,alt:n||"",loading:"lazy",style:{height:"32px",width:"auto"}})),m().createElement(tC,{size:"title1"},n||""),m().createElement(FreebieCarousel,{isHostedByClient:"CLIENT"===a,data:o,locale:t}))},t_=[r.Fullscreen,r.Slider],tB=["LightBoxA","InlineA",r.Sidebar,r.Slider],tT=["ri3lkoxcetjoj39"],LightboxLayout=({popupId:e,extraFields:t,onClose:l,onOtherSubmit:n,imageMobile:o,imageDesktop:i,imageOverlayMobile:s,imageOverlayDesktop:d,imageBackground:g,currentLayout:h,title:v,onSubmit:b,onUnmount:f,doImpression:y,showThankyou:k,campaignId:E,campaignCode:C,campaign_subot_id:w,locale:x,showEmpty:_,setShowEmpty:B,userInfo:T,action:S,campaign:O})=>{var N,P;let{primaryColor:I}=(0,u.useContext)(ej),{isMobile:F}=(0,Y.u)(),[j,D]=(0,u.useState)(!!E),[$,M]=(0,u.useState)(null),[z,R]=(0,u.useState)(!1),[G,W]=(0,u.useState)(.8),H=(0,u.useRef)(!1),V=(0,u.useRef)(),[U,q]=(0,u.useState)(),onClose=(e=!1)=>{$?M(null):null==l||l({formValues:e_.values,formActiveTime:J.current,formRef:V.current,listBlockAdded:Q,preventTrackingClose:e})},{height:Z}=useViewportDimensions(),J=(0,u.useRef)(0),K=JSON.parse(t.textBlocks),Q=JSON.parse(t.listBlockAdded),X=JSON.parse(t.actionBlocks),ee=X.submitBlock.data.value,et=location.pathname,{align:ea,value:en}=K.subtitleBlock.data||{},{align:er}=K.titleBlock.data||{},es=h===r.Slider,ed=h===r.Sidebar,ec=h.includes("LightBox"),eu=h===r.LightBoxA,em=h===r.LightBoxB,ep=h.includes("Inline")||h.includes("Freebie"),eg=h.includes("Freebie"),eh=h===r.Fullscreen,ev=em&&F,eb=(0,u.useMemo)(()=>tT.includes(C),[C]),ef=em&&Q.length<=6,ey=!eu||Q.some(e=>ei.some(t=>t===(null==e?void 0:e.name))),ek=es||eu||eh,eE=!!o||!!i,eC=!v&&!en,ew=(0,u.useRef)(!1),ex=(0,u.useRef)(!1),{form:e_,validateObj:eB}=useLeadFormConfig({listBlockAdded:Q,validatingPhoneRef:ew,validatingEmailRef:ex,campaignId:E,campaign_subot_id:w,userInfo:T,format:null===(N=A.I[x]||A.I["vi-VN"])||void 0===N?void 0:N.dateFormat}),eS=(0,u.useRef)(null),eL=isIOS(),eO=function(e=!1){let[t,a]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{var e;let t=window.innerHeight,onResize=()=>{var e,l;let n=t-(null!==(l=null===(e=window.visualViewport)||void 0===e?void 0:e.height)&&void 0!==l?l:window.innerHeight);n>150?(console.log("\uD83D\uDFE1 Keyboard likely opened"),a(!0)):(console.log("⚪️ Keyboard likely closed"),a(!1))};
453return null===(e=window.visualViewport)||void 0===e||e.addEventListener("resize",onResize),()=>{var e;return null===(e=window.visualViewport)||void 0===e?void 0:e.removeEventListener("resize",onResize)}},[e]),t}(),{isPushed:eN,bottomRef:eP}=function(e=20){let t=(0,u.useRef)(null),[a,l]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{let check=()=>{if(!t.current)return;let a=t.current.getBoundingClientRect(),n=window.innerHeight-a.bottom;l(n>e)};window.addEventListener("resize",check);let a=setInterval(check,300);return()=>{window.removeEventListener("resize",check),clearInterval(a)}},[e]),{isPushed:a,bottomRef:t}}(),[eI,eA]=(0,u.useState)(0),eF=(0,u.useRef)(eI),eD=(0,u.useRef)(eN),e$=(0,u.useRef)(eO),[eM,ez]=(0,u.useState)(!1),eR=(0,u.useRef)(!1),eG=(0,u.useRef)(40),eW=(0,u.useRef)(0),eH=function(){let e=(0,u.useCallback)((e,t,a=500)=>{if(!e)return;let l=e.scrollTop,n=t-l,o=performance.now(),easeInOutQuad=e=>e<.5?2*e*e:-1+(4-2*e)*e,animateScroll=t=>{let i=Math.min((t-o)/a,1);e.scrollTop=l+n*easeInOutQuad(i),i<1&&requestAnimationFrame(animateScroll)};requestAnimationFrame(animateScroll)},[]);return e}(),eV=(0,u.useCallback)((e="impression")=>y({formValues:e_.values,formActiveTime:J.current,formRef:V.current,listBlockAdded:Q,type:e}),[e_]);if(window.innerWidth<769&&t_.includes(h))return console.log("\uD83D\uDE0E Not show fullscreen, slider on mobile "),null;(0,u.useEffect)(()=>{eW.current=window.innerHeight,(ec||es)&&eV(),(ec||eh)&&document.body.classList.add("noscroll"),window.intlTelInputUtils||a("cfI3"),clearCacheUsedEmailOrPhone()},[]),(0,u.useEffect)(()=>{eD.current=eN},[eN]),(0,u.useEffect)(()=>{e$.current=eO},[eO]),(0,u.useEffect)(()=>{eF.current=eI},[eI]),(0,u.useEffect)(()=>{eR.current=eM},[eM]),(0,u.useEffect)(()=>{V.current&&q(V.current)},[V.current]),(0,u.useEffect)(()=>{let handleBeforeUnload=()=>{H.current||k||null==f||f({formValues:e_.values,formActiveTime:J.current,formRef:U,listBlockAdded:Q})};return window.addEventListener("beforeunload",handleBeforeUnload),()=>window.removeEventListener("beforeunload",handleBeforeUnload)},[U,e_.values,k]),(0,u.useEffect)(()=>{let e=null;return ec&&!k&&(e=setInterval(()=>{J.current+=1},1e3)),()=>clearInterval(e)},[k]),(0,u.useEffect)(()=>{eA(F&&eL&&em&&!eN&&eO?(()=>{var e;let t=null===(e=window.visualViewport)||void 0===e?void 0:e.height,a=t===eW.current;return a?.4*window.innerHeight:t})():0)},[eN,eO,F,eL,em]);let eU=(0,u.useMemo)(()=>leadGenFieldRequired(Q),Q),eq=(0,u.useMemo)(()=>!!eU.length&&eU.some(e=>!e_.values[e]),[...eU.map(e=>e_.values[e])]),onOpenChange=e=>{D(e),e||setTimeout(()=>{onClose()},250)},{width:eZ,height:eY,loaded:eJ}=useImageSize(g),{loaded:eQ}=useImageSize(o),{loaded:eX}=useImageSize(i),e0=eQ&&eX&&(!eh||eJ),e1=(0,u.useMemo)(()=>{var e;return!(null===(e=null==X?void 0:X.submitBlock)||void 0===e?void 0:e.isHide)&&m().createElement(L.B,{size:"lg",id:"lead-submit",type:"submit",className:"leadgen-btn leadgen-btn_action",color:I,loading:z,disabled:eq},ee)},[ee,z,eq,null===(P=null==X?void 0:X.submitBlock)||void 0===P?void 0:P.isHide]),[e2,e4]=(0,u.useState)(!1),e3=Q.filter(({name:e})=>e==eo.LinkButtonBlock),e5=!!(null==e3?void 0:e3.length)&&m().createElement(m().Fragment,null,e3.map((e,t)=>{var a;return m().createElement(L.B,{key:`${e.name}-${t}`,size:"lg",className:"leadgen-btn leadgen-btn_action",color:I,loading:e2,onClick:t=>(0,c._)(void 0,void 0,void 0,function*(){var a,l;t.preventDefault(),null==onClose||onClose(!0),e4(!0),yield eV("redirects"),null==n||n(),window.open(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.url,(null===(l=null==e?void 0:e.data)||void 0===l?void 0:l.newtab)?"_blank":void 0)})},null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.value)})),e6=eE&&m().createElement("header",{className:(0,p.clsx)("leadgen-header",{"leadgen-header_only":eC})},tB.includes(h)?m().createElement(HeaderImage,{src:o,className:"lead-modal__image"}):m().createElement(m().Fragment,null,m().createElement(HeaderImage,{src:i,className:"le-only-desktop lead-modal__image"}),m().createElement(HeaderImage,{src:o,className:"le-only-mobile lead-modal__image"}))),e9=_&&m().createElement(EmptyComponent,{onClose:onClose,onContinue:()=>B(!1)}),e8=m().createElement(eK,{form:e_},m().createElement("form",{ref:V,className:"leadgen-form",onFocus:e=>{e.preventDefault(),F&&eL&&em&&setTimeout(()=>{var t,a;if(!eD.current&&e$.current){let l=e.target,n=l.getBoundingClientRect(),o=n.height,i=n.top,r=null===(t=window.visualVie
453wport)||void 0===t?void 0:t.height,s=r===eW.current,d=i+o+(s?0:eG.current),c=eS.current.scrollTop,u=s?.4*window.innerHeight:null===(a=window.visualViewport)||void 0===a?void 0:a.height;if(d>=u){let e=c+(d-u);isNaN(e)||(ez(!0),eH(eS.current,e,400),setTimeout(()=>{ez(!1)},500))}}},300)},onSubmit:e=>{e.preventDefault();let t=Object.keys(eB),a=t.reduce((e,t)=>(e[t]=!0,e),{});e_.setTouched(a),ex.current||ew.current||setTimeout(()=>{e_.onSubmit(e=>{var t,a,l,n,o,i,r,s,d;if(Object.keys(e_.errors).length)return;let c=null;if(Q.findIndex(e=>e.name===eo.PhoneOtpBlock)>-1){let n=null===(a=null===(t=Q.find(e=>e.name===eo.PhoneOtpBlock))||void 0===t?void 0:t.data)||void 0===a?void 0:a.value;(null===(l=e[n])||void 0===l?void 0:l.startsWith("+"))&&(c={phone:e[n],type:"phone"})}if(Q.findIndex(e=>e.name===eo.WhatsappOtpBlock)>-1){let t=null===(o=null===(n=Q.find(e=>e.name===eo.WhatsappOtpBlock))||void 0===n?void 0:n.data)||void 0===o?void 0:o.value;(null===(i=e[t])||void 0===i?void 0:i.startsWith("+"))&&(c={phone:e[t],type:"whatsapp"})}if(Q.findIndex(e=>e.name===eo.ZaloOtpBlock)>-1){let t=null===(s=null===(r=Q.find(e=>e.name===eo.ZaloOtpBlock))||void 0===r?void 0:r.data)||void 0===s?void 0:s.value;(null===(d=e[t])||void 0===d?void 0:d.startsWith("+"))&&(c={phone:e[t],type:"zalo"})}if(c){R(!0),eT.sendSMSOtpLead(c).then(t=>{var a;let l=null===(a=null==t?void 0:t._messages)||void 0===a?void 0:a[0];if("This phone number was verified"===l){null==b||b({formValues:e,formActiveTime:J.current,formRef:V.current,listBlockAdded:Q});return}M(c)}).finally(()=>{R(!1)});return}null==b||b({formValues:e,formActiveTime:J.current,formRef:V.current,listBlockAdded:Q})})(e)},100)}},m().createElement(FormContainer,{title:v,titleAlign:er,description:en,descriptionAlign:ea,header:ek&&e6,footer:ey?e1:e5,"data-hidden-form":!ey},m().createElement("div",{className:"leadgen-form_inner"},m().createElement(LightboxFields,{listBlockAdded:Q,popupId:e,locale:x,onClose:onClose,onOtherSubmit:n,hasSubmitBtn:!!e1,isSubmitLoading:z,disabledButtonSubmit:eq})))),m().createElement("div",{style:{height:`${eI}px`,width:"100%",transition:"height .2s ease"}})),e7=$&&m().createElement(OtpBlock,{otpData:$,autoSendWhenOpen:!1,onSuccess:()=>{M(null),null==b||b({formValues:e_.values,formActiveTime:J.current,formRef:V.current,listBlockAdded:Q})}}),te=k&&m().createElement(ThankyouPopup,{title:k.title,titleAlign:k.titleAlign,subtitle:k.subtitle,subtitleAlign:k.subtitleAlign,link:k.link,linkNewTab:k.linkNewTab,linkText:k.linkText,image:k.image}),tt=m().createElement("div",{ref:eS,className:(0,p.clsx)("leadgen-content",{"leadgen-content_small":ef}),onScroll:()=>{if(!eR.current){let e=document.activeElement;V.current&&V.current.contains(e)&&e.blur()}}},!ek&&e6,!eC&&m().createElement("div",{className:"leadgen-inner"},te,!k&&m().createElement(m().Fragment,null,e7,e9,!($||_)&&e8)),m().createElement("div",{ref:eP,style:{position:"fixed",bottom:0,left:0,height:1,width:"100%",pointerEvents:"none"}})),ta=(0,u.useMemo)(()=>{let e=".leadgen-inner {background-repeat: no-repeat;background-size: cover;background-position:center;}";return F&&s&&(e+=`.leadgen-inner {background-image: url(${s});}`),!F&&d&&(e+=`@media screen and (min-width:768px) {.leadgen-inner {background-image: url(${d});}}`),e},[F,d,s]),tl=m().createElement(m().Fragment,null,m().createElement("style",{dangerouslySetInnerHTML:{__html:ta}}),m().createElement("div",{className:(0,p.clsx)("leadgen-wrapper",{"leadgen-wrapper_small":ef})},!ep&&m().createElement(CloseButton,{onClose:()=>onOpenChange(!1),containerClassName:"leadgen-close_btn"}),tt)),tn=(0,p.clsx)("leadgen",`leadgen-${h}`,{"leadgen-lightbox":ec,"leadgen-inline":ep||ed,"leadgen-slider":es}),to=ev?eb?m().createElement(LeadGenLightBoxB,{form:e_,loading:z,visible:j,onVisible:()=>onOpenChange(!1)},tl):m().createElement(el.D,{fadeFromIndex:A.c-9e6,open:j,snapPoints:[.8,1],activeSnapPoint:G,setActiveSnapPoint:W,onOpenChange:onOpenChange,overlayClassName:tn,className:"leadgen-drawer"},tl,m().createElement("div",{style:{position:"absolute",inset:0,zIndex:1===G?-1:1},onClick:()=>W(1)})):m().createElement("div",{id:e,"data-popup-url":et,"data-popup-type":"lightbox-inline",className:tn,style:F?{maxHeight:Z}:void 0},eh?m().createElement("img",{className:"le-only-desktop le-fullscreen-img",draggable:!1,src:g||"",style:{aspectRatio:`${eZ}/${eY}`}}):null,tl);return e0?ec||eh||es?to:ed?m().createElement(SideBarLayout,{content:to}):ep?m().createElement(InlineLayout,{action:S,content:eg?m().createElement(InlineFreebie,{campaign:O.freebie[0],locale:x}):to,campaignCode:C,inlinePosition:t.popupInlinePosition,doImpression:eV}):null:null},SkinLayout=({popupId:e,link:t,linkText:a,linkNewTab:l,onClose:n,imageMobile:o,imageDesktop:i,currentLayout:r,onOtherSubmit:s})=>{let d=location.pathname,{width:c,height:u,loaded:p}=useImageSize(o),{width:g,height:h,loaded:v}=useImageSize(i);return p&&v?m().createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":d,"data-popup-type":"skin_ab"},"SkinA"==r?m().createElement("aside",{className:"le-only-desktop"},m().createElement("div",{className:"le-skin-a-desktop"},m().createElement("div",{style:{position:"relative"}}
453,m().createElement("img",{src:i,style:{aspectRatio:`${g}/${h}`}}),m().createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"calc(100% - 15px)"},href:t,target:l?"blank":"_parent"},m().createElement("button",{onClick:s,className:"le-joinbow-btn js-popup-other-submit"},a)),m().createElement(CloseButton,{onClose:n,containerClassName:"close-button-top-right"})))):"SkinB"==r?m().createElement("aside",{className:"le-only-desktop"},m().createElement("div",{className:""},m().createElement("div",{style:{position:"relative",zIndex:1e4}},m().createElement("img",{src:i,style:{width:"100%",aspectRatio:`${g}/${h}`}}),m().createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"100%"},href:t,target:l?"blank":"_parent"},m().createElement("button",{onClick:s,className:"le-joinbow-btn-mobile js-popup-other-submit"},a)),m().createElement(CloseButton,{containerClassName:"close-button-top-right",onClose:n})))):null,m().createElement("aside",{className:"le-only-mobile"},m().createElement("div",{className:"le-skin-mobile"},m().createElement("div",{style:{position:"relative"}},(0,Z.i)(o)?m().createElement("video",{muted:!0,autoPlay:!0,loop:!0},m().createElement("source",{src:o,type:"video/mp4"})):m().createElement("img",{src:o,style:{width:"100%",aspectRatio:`${c}/${u}`}}),m().createElement("a",{style:{position:"absolute",top:"82%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",maxWidth:"calc(100% - 15px)"},href:t,target:l?"blank":"_parent"},m().createElement("button",{onClick:s,className:"le-joinbow-btn-mobile js-popup-other-submit"},a)),m().createElement(CloseButton,{containerClassName:"close-button-top-right",svgClassName:"le-mobile-btn",onClose:n}))))):null},TabLayout=({popupId:e,url:t,newTab:a,image:l,onClose:n,onOtherSubmit:o})=>{let{width:i,height:r,loaded:s}=useImageSize(l);return s?m().createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"tab"},m().createElement("div",{className:"le-tab-popup"},m().createElement("div",{style:{position:"relative"}},m().createElement("a",{href:t,target:a?"blank":"_parent",onClick:o},m().createElement("img",{className:"js-popup-other-submit",src:l,style:{aspectRatio:`${i}/${r}`}})),m().createElement(CloseButton,{onClose:n,containerClassName:"close-button-top-right"})))):null},NewLeadPopup=({campaign:e,action:t,onSubmit:a,onClose:l,onUnmount:n,doImpression:o,showThankyou:i,locale:r,showEmpty:s,setShowEmpty:d,userInfo:c})=>{var p,g;let{apiUrl:h,siteDomain:v}=(0,u.useContext)(ej),{extra_fields:b,image:f,image_desktop:y,code:k,image_background:C,image_overlay_mobile:w,image_overlay_desktop:x}=e||{},{currentLayout:_}=b,B=b.imageBlocks?JSON.parse(b.imageBlocks):{},T=JSON.parse(b.actionBlocks),S=JSON.parse(b.textBlocks),L=(null===(g=null===(p=null==S?void 0:S.titleBlock)||void 0===p?void 0:p.data)||void 0===g?void 0:g.value)||"",O={1:{},2:{},3:{}},N=(0,u.useRef)("lead-modal-"+(0,M.A)()),P=function(e="Xin chao {{category_2}} extra"){if(!e.includes("{{category_"))return null;{let t=e.search("{{category_"),a=e.charAt(11+t);return+a}}(L);if(P){LeadLog("⚡️ Has categoryLevel",P);let e=Array.from(document.getElementsByTagName("META")),t=e.find(e=>e.name===`content_category_${P}`),a=e.find(e=>e.name===`content_category_en_${P}`);if(!t||!a)return LeadLog("⚡️ No META TAG for categoryLevel, not show popup",P),null;O[P]={value:t.content,value_en:a.content},L=L.replace(`{{category_${P}}}`,t.content),LeadLog("⚡️ Set categoryData ",P)}else LeadLog("⚡️ No categoryLevel",P);let onOtherSubmit=t=>{var a,n,o,i;if(LeadLog("\uD83D\uDC4C Other submit click"),document.body.classList.remove("noscroll"),_.includes("Skin")){let e=document.querySelector("#masthead");e&&(e.style.top="0px !important;")}let r=Number(null!==(n=null===(a=e.rules.find(e=>"days_to_show_again"==e.rule))||void 0===a?void 0:a.value)&&void 0!==n?n:7),s=Number(null!==(i=null===(o=e.rules.find(e=>"show_again_after_submit"==e.rule))||void 0===o?void 0:o.value)&&void 0!==i?i:0);0===s&&(LeadLog("⛔ Popup never show again!"),(0,E.TV)(`lead_submited_${
453k}`,`target_${b.popupVersion}`,{domain:"."+v,path:"/"})),1==s&&(LeadLog(`⌛ Popup will show again after ${r} days!`),(0,E.TV)(`lead_submited_${k}`,`target_${b.popupVersion}`,{domain:"."+v,days:r,path:"/"}));let d=(0,E.Ri)("_ga")||null,c={url:location.href.toLowerCase(),title_article:document.title,meta:[],cookie_id:(0,E.Ri)("hhg-id"),ga_client_id:d};P&&(c.category=O[P].value_en),fetch(`${h}api/campaign/${k}/lead`,{method:"POST",body:JSON.stringify(c),headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(e=>e.json()).then(e=>{"error"===e.status&&LeadLog(e)}).catch(e=>{LeadLog("Error:",e)}),null==l||l(t)};return"CenterTab"===_?m().createElement(CenterTabLayout,{popupId:N.current,url:B.imageMobile.data.url,newTab:B.imageMobile.data.newtab,imageMobile:f,imageDestkop:y,onClose:l,onOtherSubmit:onOtherSubmit,doImpression:o}):"Tab"===_?m().createElement(TabLayout,{popupId:N.current,url:B.imageMobile.data.url,newTab:B.imageMobile.data.newtab,image:f,onClose:l,onOtherSubmit:onOtherSubmit}):"Floating"===_?m().createElement(FloatingLayout,{popupId:N.current,title:L,titleAlign:S.titleBlock.data.align,subtitle:S.subtitleBlock.data.value,subtitleAlign:S.subtitleBlock.data.align,url:T.linkButtonBlock.data.url,urlText:T.linkButtonBlock.data.value,
453newTab:T.linkButtonBlock.data.newtab,imageMobile:f,imageDesktop:y,onClose:l,onOtherSubmit:onOtherSubmit}):_.includes("LightBox")||_.includes("Inline")||_.includes("Freebie")||"Fullscreen"==_||"Sidebar"==_||"Slider"==_?m().createElement(LightboxLayout,{popupId:N.current,extraFields:b,onClose:l,onOtherSubmit:onOtherSubmit,onUnmount:n,doImpression:o,imageMobile:f,imageDesktop:y,imageBackground:C,currentLayout:_,campaign:e,title:L,onSubmit:e=>a(e,P,O),key:_,imageOverlayDesktop:x,imageOverlayMobile:w,showThankyou:i,campaignId:e.id,campaignCode:e.code,campaign_subot_id:e.bot_id||[],locale:r,showEmpty:s,setShowEmpty:d,userInfo:c,action:t}):_.includes("Skin")?m().createElement(SkinLayout,{popupId:N.current,link:T.linkButtonBlock.data.url,linkNewTab:!!T.linkButtonBlock.data.newtab,linkText:T.linkButtonBlock.data.value,onClose:l,onOtherSubmit:onOtherSubmit,imageMobile:f,imageDesktop:y,currentLayout:_}):null},formatFormData=(e,t=[])=>Object.keys(t).filter(e=>!!t[e]).map(a=>{var l,n,o,i,r,s;let d=String(t[a]),c=(null===(l=e.querySelector(`*[name="${a}"][data-control]`))||void 0===l?void 0:l.getAttribute("data-control"))||(null===(n=e.querySelector(`*[data-extra][data-name="${a}"]`))||void 0===n?void 0:n.getAttribute("data-control"))||"text",u=(null===(o=e.querySelector(`*[name="${a}"][data-lead-control]`))||void 0===o?void 0:o.getAttribute("data-lead-control"))||(null===(i=e.querySelector(`*[data-extra][data-name="${a}"]`))||void 0===i?void 0:i.getAttribute("data-lead-control"))||"text",m=((null===(r=e.querySelector(`*[name="${a}"][data-is-required]`))||void 0===r?void 0:r.getAttribute("data-is-required"))||null===(s=e.querySelector(`*[data-extra][data-name="${a}"]`))||void 0===s||s.getAttribute("data-is-required"),!0),p="tel"===c?window.intlTelInputUtils.formatNumber(String(d),null==ev?void 0:ev.countryCodeNumber,2).replace(/\s+/g,""):"date"===c?y()(d).format("YYYY-MM-DD"):d;return{key:a,value:p,control:c,leadControl:u,isRequired:m}}),formatTrackingData=e=>{let{formParams:t={},currentLayout:a,commonData:l}=e,{formValues:n,formActiveTime:o,listBlockAdded:i}=t,s=[],d=Object.assign(Object.assign({template_type:a,time_on_form:[r.LightBoxA,r.LightBoxB].includes(a)?o:0},l),{data_input:n.map(e=>{let t=i.findIndex(t=>{let a=e.key.startsWith("TNC-")?`TNC-${t.id}`:t.data.value;return a==e.key});if(t>-1){let a=i[t];return s.push(a.data.value),{field_name:e.key,component_type:a.name,value:e.value,is_required:a.data.required}}}).filter(Boolean),data_not_input:i.map(e=>{if(!s.includes(e.data.value))return{field_name:e.data.value,component_type:e.name,is_required:e.data.required}}).filter(Boolean)});return d},LeadGen=({apiUrl:e,siteDomain:t,siteId:l,locale:n,primaryColor:o,apiSubotUrl:i,DEBUG_URL:r,forceCampaign:s,children:d,extraPayloadValues:g=[],excludeExitRulesHandler:v,userInfo:b,onClose:f,onSubmit:y,formatMessage:k})=>{var C,w;let x=(0,u.useRef)(),B=(0,u.useRef)(Date.now()),{apiUrl:T}=(0,u.useMemo)(()=>{let t=e;return t.includes("localhost")&&(t="https://dev.leadgen.hellobacsi.com/"),{apiUrl:t}},[e,t,l]),[S,L]=(0,u.useState)(s),[N,I]=(0,u.useState)(""),[F,j]=(0,u.useState)(null),[D,$]=(0,u.useState)(!1),[M,z]=(0,u.useState)(),R=(0,u.useMemo)(()=>null==S?void 0:S.extra_fields.currentLayout,[null==S?void 0:S.extra_fields.currentLayout]);(0,u.useEffect)(()=>{s&&(L(s),I("SHOW"))},[null==s?void 0:s.code]),(0,u.useEffect)(()=>{ey.apiLeadUrl=T,ey.apiSubotUrl=i},[T,i]);let onShowPopup=(e,t)=>{L(e),I(t)},onCloseBase=()=>{document.body.classList.remove("noscroll"),L(null),j(null),I("HIDE"),null==f||f()},onClose=e=>
453(0,c._)(void 0,void 0,void 0,function*(){var a,l;let{formRef:o,listBlockAdded:i=[],formValues:r}=e||{};if(S){if(LeadLog(`👋👋👋 CLOSE POPUP ${S.code} 👋👋👋`),!v){let e=Number(null===(a=S.rules.find(e=>"show_again_after_exit"==e.rule))||void 0===a?void 0:a.value),n=Number(null===(l=S.rules.find(e=>"days_to_show_again"==e.rule))||void 0===l?void 0:l.value);0==e&&(n?(0,E.TV)(`lead_closed_${S.code}`,`target_${null==S?void 0:S.extra_fields.popupVersion}`,{domain:"."+t,days:n,path:"/"}):(0,E.TV)(`lead_closed_${S.code}`,`target_${null==S?void 0:S.extra_fields.popupVersion}`,{domain:"."+t,path:"/"}))}yield Promise.all([fetch(`${T}api/campaign/${S.code}/popup_exit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"CLICK",url:location.href.toLowerCase(),title_article:document.title,cookie_id:(0,E.Ri)("hhg-id")||"",duration:Math.ceil((Date.now()-B.current)/1e3)})}),!F&&!(null==e?void 0:e.preventTrackingClose)&&G({commonData:{cookie_id:(0,E.Ri)("hhg-id")||"",ga_client_id:(0,E.Ri)("_ga")||null,country_code:n&&P.M[n]||"VN",status:"in_progress",campaign_id:null==S?void 0:S.id,total_fields:i.length,type:"close"},currentLayout:R,formParams:Object.assign(Object.assign({},e),{listBlockAdded:i,formValues:formatFormData(o,r)})})]),onCloseBase()}}),onUnmount=e=>(0,c._)(void 0,void 0,void 0,function*(){let{formRef:t,listBlockAdded:a,formValues:l}=e||{},o=formatTrackingData({commonData:{cookie_id:(0,E.Ri)("hhg-id")||"",ga_client_id:(0,E.Ri)("_ga")||null,country_code:n&&P.M[n]||"VN",status:"in_progress",campaign_id:null==S?void 0:S.id,total_fields:a.length,type:"close"},currentLayout:R,formParams:Object.assign(Object.assign({},e),{listBlockAdded:a,formValues:formatFormData(t,l)})}),i=new Blob([JSON.stringify(o)],{type:"application/json"});navigator.sendBeacon(`${T}api/collection/tracking-completion`,i)}),doImpression=e=>{let{listBlockAdded:t=[]}=e||{};if(!ef.includes(R))return;let a=(0,E.Ri)("_ga")||null,l=(0,E.Ri)("hhg-id")||"",o=formatTrackingData({commonData:{cookie_id:l,ga_client_id:a,country_code:(null===P.M||void 0===P.M?void 0:P.M[n])||"VN",status:"in_progress",campaign_id:null==S?void 0:S.id,total_fields:t.length,type:(null==e?void 0:e.type)||"impression"},currentLayout:R,formParams:Object.assign(Object.assign({},e),{listBlockAdded:t,formValues:[]})});return Promise.all([fetch(`${T}api/collection/tracking-completion`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}),fetch(`${T}api/campaign/${S.code}/impression`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:N,url:location.href.toLowerCase(),title_article:document.title,cookie_id:(0,E.Ri)("hhg-id"),ga_client_id:a})})])};(0,u.useEffect)(()=>{if(null==s||!s.code){if(window.next){let e=h()(e=>{LeadLog("--\uD83C\uDF3B routeChangeComplete",e,Date.now());let a=location.pathname;onClose(),clearPassiveEvent(),document.querySelectorAll(`[data-popup-url="${a}"]`).length?LeadLog("\uD83D\uDD25 This URL page has show popup!"):(LeadLog("--Process checkShowPopup"),checkShowPopup({leadApi:T,leadDomain:t,leadSiteId:l,onShowPopup,DEBUG_URL:r})),x.current&&window.removeEventListener("scroll",x.current)},500);window.next.router.events.on("routeChangeComplete",e)}checkShowPopup({leadApi:T,leadDomain:t,leadSiteId:l,onShowPopup,DEBUG_URL:r})}},[]);let G=(0,u.useCallback)(e=>(0,c._)(void 0,void 0,void 0,function*(){let t=formatTrackingData(e),{currentLayout:a}=e||{};if(ef.includes(a))return fetch(`${T}api/collection/tracking-completion`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}),[null===(C=null==S?void 0:S.extra_fields)||void 0===C?void 0:C.currentLayout]),onSubmit=(e,l,o)=>(0,c._)(void 0,void 0,void 0,function*(){var i,r,s,d,c,u,m,p,h,v,b;let{formRef:f,listBlockAdded:k=[],formValues:C}=e||{};if(!C||Object.values(C).every(e=>!e)){$(!0);return}LeadLog("submitHandler",l,o);let w=formatFormData(f,C),x=w.map(({key:e,value:t,control:a})=>({key:e,value:t,control:a}));console.log("** RYAN index.tsx 218 formData : ",x);let _=(0,E.Ri)("_ga")||null;window.intlTelInputUtils||(yield a("cfI3"));let B={cookie_id:(0,E.Ri)("hhg-id")||"",ga_client_id:_},L=Object.assign({url:location.href.toLowerCase(),title_article:document.title,meta:[...x,...g]},B);l&&o[l].value_en&&(L.category=o[l].value_en);let O=Number((null===(r=null===(i=S.rules)||void 0===i?void 0:i.find(e=>"days_to_show_again"===e.rule))||void 0===r?void 0:r.value)||7),N=Number((null===(d=null===(s=S.rules)||void 0===s?void 0:s.find(e=>"show_again_after_submit"===e.rule))||void 0===d?void 0:d.value)||0);if(0==N&&(LeadLog("⛔ Popup never show again!"),(0,E.TV)(`lead_submited_${S.code}`,`target_${null==S?void 0:S.extra_fields.targetType}`,{domain:"."+t,path:"/"})),1==N&&(LeadLog(`⌛ Popup will show again after ${O} days!`),(0,E.TV)(`lead_submited_${S.code}`,`target_${null==S?void 0:S.extra_fields.targetType}`,{domain:"."+t,days:O,path:"/"})),yield Promise.all([fetch(`${T}api/campaign/${S.code}/lead`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)}),k.length>0&&G({commonData:Object.assign(Object.assign({},B),{country_code:n&&P.M[n]||"VN",status:"complete",campaign_id:null==S?void 0:S.id,total_fields:k.length,type:"submit_form"}),currentLayout:R,formParams:Object.assign(Object.assign({},e),{listBlockAdded:k,formValues:w})})]),null==y||y(C),(null==M?void 0:M.url)&&(window.open(null==M?void 0:M.url,(null==M?void 0:M.target)||"_self"),onClose()),(null==S?void 0:S.extra_fields.popupS
453howThankYou)=="notshow"){onClose(),document.body.classList.remove("noscroll");return}let I=S.thank_you_image||`${T}admin/img/thanksyou.png`,A=(null==S?void 0:S.extra_fields.popupThankyouTitle)||"Thank you.",F=(null==S?void 0:S.extra_fields.popupThankyouDesc)||"We appreciate your time!",D="",z="",W,H,V="";if((null==S?void 0:S.extra_fields.popupVersion)=="2.1"){let e=S.extra_fields,t=JSON.parse(e.listBlockThankyou),a=t.find(e=>"TitleBlock"==e.name),l=t.find(e=>"SubtitleBlock"==e.name),n=t.find(e=>"LinkButtonBlock"==e.name);A=(null===(c=null==a?void 0:a.data)||void 0===c?void 0:c.value)||"",D=(null===(u=null==a?void 0:a.data)||void 0===u?void 0:u.align)||"",F=(null===(m=null==l?void 0:l.data)||void 0===m?void 0:m.value)||"",z=(null===(p=null==l?void 0:l.data)||void 0===p?void 0:p.align)||"",W=(null===(h=null==n?void 0:n.data)||void 0===h?void 0:h.value)||"",H=(null===(v=null==n?void 0:n.data)||void 0===v?void 0:v.newtab)||!1,V=(null===(b=null==n?void 0:n.data)||void 0===b?void 0:b.url)||""}j({title:A,titleAlign:D,subtitle:F,subtitleAlign:z,link:V,linkNewTab:H,linkText:W,image:I}),sessionStorage.getItem("insider_object")?window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")):window.insider_object={user:{email:"",phone_number:"",gdpr_optin:!0,sms_optin:!0,email_optin:!0}},x.map(e=>{let t=e.key,a=e.value;"tel"==t?window.insider_object.user.phone_number=a:"email"==t&&(window.insider_object.user.email=a)}),sessionStorage.setItem("insider_object",JSON.stringify(window.insider_object))});return(0,u.useEffect)(()=>{S&&(B.current=Date.now())},[S]),m().createElement(ej.Provider,{value:{primaryColor:o,apiUrl:T,siteDomain:t,siteId:l,locale:n,redirectUrl:M,setRedirectUrl:z}},m().createElement(LeadGenTranslationProvider,{locale:n,formatMessage:k},m().createElement(q.M,{locale:n,customStyleType:O.C.LEADGEN},d?m().createElement(Component,{campaign:S,onSubmit:onSubmit,onClose:onClose,showThankyou:F,setShowThankyou:j,locale:n,showEmpty:D,setShowEmpty:$,userInfo:b},d):m().createElement(p.Portal,{target:(0,_.a)()},m().createElement(p.Box,{sx:{position:"fixed",zIndex:A.c-9e6}},m().createElement(p.Transition,{mounted:(null===(w=null==S?void 0:S.extra_fields)||void 0===w?void 0:w.popupVersion)==="2.1",transition:"fade",duration:600,timingFunction:"ease",exitDuration:200},e=>{var t;return m().createElement(p.Box,{style:e},(null===(t=null==S?void 0:S.extra_fields)||void 0===t?void 0:t.popupVersion)==="2.1"&&m().createElement(m().Fragment,null,!!R&&!R.includes("Inline")&&!R.includes("Sidebar")&&!R.includes("Freebie")&&m().createElement(p.Overlay,{color:"#000",opacity:.6,center:!0,zIndex:400,pos:"fixed",onClick:()=>onClose()}),m().createElement(NewLeadPopup,{campaign:S,action:N,onSubmit:onSubmit,onClose:onClose,onUnmount:onUnmount,doImpression:doImpression,showThankyou:F,locale:n,showEmpty:D,setShowEmpty:$,userInfo:b})))}))))))};LeadGen.Heading=Heading,LeadGen.Description=Description,LeadGen.Form=e=>{let{showOtpPhone:t,showThankyou:a}=(0,u.useContext)(en);return a||t?null:m().createElement(FormComponent,Object.assign({},e))},LeadGen.Thankyou=({children:e})=>{let{showThankyou:t,setShowThankyou:a}=(0,u.useContext)(en);return t?e(t,()=>a(null)):null},LeadGen.OtpForm=e=>{var t=(0,c.a)(e,[]);let{showOtpPhone:a,setShowOtpPhone:l,onSubmit:n}=(0,u.useContext)(en);return a?m().createElement(OtpBlockComponent,Object.assign({otpData:a,autoSendWhenOpen:!1,onSuccess:()=>{l(null),null==n||n()}},t)):null},LeadGen.Close=el.C}}]);

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.