1import{d as E,av as R,a as h,D as S,r as i,o as P,L as T,a2 as B,p as A,q as C,g as y,i as f,j as _,v as V,C as D}from"./mlHSftCV.js";const I={key:0,class:"smart-captcha-wrap"},M={key:0,class:"mt-2 text-[13px] leading-5 text-error"},j="https://smartcaptcha.yandexcloud.net/captcha.js",k="data-copybara-smartcaptcha",K=E({__name:"SmartCaptcha",props:{modelValue:{default:""},modelModifiers:{}},emits:["update:modelValue"],setup(o,{expose:u}){const r=R(o,"modelValue"),d=S(),c=h(()=>String(d.public.smartcaptchaSiteKey||"")),p=h(()=>!!c.value),m=i(null),a=i(null),l=i("");function g(){r.value="";const e=window.smartCaptcha;if(e&&a.value!==null)try{e.reset(a.value)}catch{}}u({reset:g,enabled:p});function x(e=8e3){const n=Date.now();return new Promise((s,t)=>{const w=()=>{if(window.smartCaptcha){s(window.smartCaptcha);return}if(Date.now()-n>e){t(new Error("SmartCaptcha API is not available"));return}window.setTimeout(w,50)};w()})}function b(){if(window.smartCaptcha)return Promise.resolve();const e=document.querySelector(`script[${k}]`);return e?new Promise((n,s)=>{e.addEventListener("load",()=>n(),{once:!0}),e.addEventListener("error",()=>s(new Error("SmartCaptcha script failed")),{once:!0})}):new Promise((n,s)=>{const t=document.createElement("script");t.src=j,t.async=!0,t.defer=!0,t.setAttribute(k,"1"),t.onload=()=>n(),t.onerror=()=>s(new Error("SmartCaptcha script failed")),document.head.appendChild(t)})}async function v(){if(!(!p.value||!m.value)){l.value="";try{await b();const e=await x();if(a.value!==null){try{e.destroy?.(a.value)}catch{}a.value=null}a.value=e.render(m.value,{sitekey:c.value,hl:"ru",callback:n=>{r.value=n},expiredCallback:()=>{r.value=""},errorCallback:()=>{r.value=""}})}catch{l.value="Ðе ÑдалоÑÑ Ð·Ð°Ð³ÑÑзиÑÑ ÐºÐ°Ð¿ÑÑ. ÐбновиÑе ÑÑÑаниÑÑ."}}}return P(async()=>{await T(),v()}),B(()=>{const e=window.smartCaptcha;if(e&&a.value!==null)try{e.destroy?.(a.value)}catch{}}),A(c,()=>{v()}),(e,n)=>f(p)?(_(),C("div",I,[V("div",{ref_key:"containerRef",ref:m,class:"smart-captcha-box min-h-[100px]"},null,512),f(l)?(_(),C("p",M,D(f(l)),1)):y("",!0)])):y("",!0)}}),q=Object.assign(K,{__name:"SmartCaptcha"});function N(){const o=i(""),u=i(null),r=h(()=>!!S().public.smartcaptchaSiteKey);function d(){return r.value&&!o.value.trim()?"ÐодÑвеÑдиÑе, ÑÑо Ð²Ñ Ð½Ðµ ÑобоÑ.":null}function c(){u.value?.reset(),o.value=""}return{token:o,captchaRef:u,enabled:r,missingTokenMessage:d,reset:c}}export{q as _,N as u};
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.