1import{inject as w}from"vue";const t={INVALID_ENVIRONMENT:0,EXPIRED_TOKEN:1,CLOSED_BY_USER:2,UNKNOWN:3,SCRIPT_LOADING_FAILED:4},D={[t.INVALID_ENVIRONMENT]:"InvalidEnvironmentError",[t.EXPIRED_TOKEN]:"ExpiredTokenError",[t.CLOSED_BY_USER]:"ClosedByUserError",[t.UNKNOWN]:"UnknownError",[t.SCRIPT_LOADING_FAILED]:"ScriptLoadingFailedError"},N={[t.INVALID_ENVIRONMENT]:"Google ReCAPTCHA client API can only work in a browser environment",[t.EXPIRED_TOKEN]:"Goggle reCAPTCHA token has expired",[t.CLOSED_BY_USER]:"Google reCAPTCHA widget was closed by the user",[t.UNKNOWN]:"An unknown error has occurred while using the Google reCAPTCHA client",[t.SCRIPT_LOADING_FAILED]:"Unable to load recaptcha script"};class h extends Error{code;constructor(r,n){super(r),this.name=D[n],this.code=n}}var T={};let i,E,R,o,l;const g=e=>e.message,L=e=>r=>{const n=N[r],d=e({code:r,message:n});return new h(d,r)};let I=!1;const P=()=>{I||(I=!0,window.addEventListener("unhandledrejection",e=>{e.reason==="Timeout"&&e.preventDefault()}))},u=()=>(E||(E=new Promise((e,r)=>{const n=document.createElement("script");n.src="//www.google.com/recaptcha/api.js",n.addEventListener("load",()=>{i=window.grecaptcha,i.ready(()=>{e()})}),n.addEventListener("error",()=>{E=void 0,n.remove(),r(new h(N[t.SCRIPT_LOADING_FAILED],t.SCRIPT_LOADING_FAILED))}),document.body.append(n),P()})),E),s=()=>{try{l&&l.disconnect(),i?.reset(R),o.remove()}catch(e){console.error(e)}},v=(e={})=>new Promise((r,n)=>{const{sitekey:d=T.RECAPTCHA_KEY,onError:A=g}=typeof e=="string"?{sitekey:e}:{...e},C=L(A),c=p=>{n(C(p))};window||c(t.INVALID_ENVIRONMENT);const m=()=>{o=document.createElement("div"),o.hidden=!0,document.body.append(o),R=i.render(o,{sitekey:d,size:"invisible",callback:a=>{s(),r(a)},expiredCallback:()=>{s(),c(t.EXPIRED_TOKEN)},errorCallback:()=>{s(),c(t.UNKNOWN)}});const p=setInterval(()=>{const a=o.nextElementSibling;a&&(clearInterval(p),l=new MutationObserver(()=>{window.getComputedStyle(a).visibility==="hidden"&&(s(),c(t.CLOSED_BY_USER))}),l.observe(a,{attributes:!0}),i.execute(R))},16)};u().then(()=>{m()}).catch(()=>{c(t.SCRIPT_LOADING_FAILED)})}),_=Symbol("recaptcha"),O=e=>({getRecaptcha:()=>v({sitekey:e.recaptchaKey}),resetRecaptcha:s,initRecaptcha:u}),b={install:(e,r)=>{e.provide(_,O(r))}},f=()=>{const e=w(_);if(!e)throw new Error("It appears the RecaptchaPlugin is missing. Make sure to install it.");return e};export{D as R,t as a,b,f 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.