1import{K as f,a as r,$ as u,c as g,a1 as p,a7 as h,ao as C,a2 as x,u as E,n as A}from"#entry";const y="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3csvg%20viewBox='0%200%2024%2024'%20width='24'%20height='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20transform='matrix(1,%200,%200,%201,%2027.009001,%20-39.238998)'%3e%3cpath%20fill='%234285F4'%20d='M%20-3.264%2051.509%20C%20-3.264%2050.719%20-3.334%2049.969%20-3.454%2049.239%20L%20-14.754%2049.239%20L%20-14.754%2053.749%20L%20-8.284%2053.749%20C%20-8.574%2055.229%20-9.424%2056.479%20-10.684%2057.329%20L%20-10.684%2060.329%20L%20-6.824%2060.329%20C%20-4.564%2058.239%20-3.264%2055.159%20-3.264%2051.509%20Z'/%3e%3cpath%20fill='%2334A853'%20d='M%20-14.754%2063.239%20C%20-11.514%2063.239%20-8.804%2062.159%20-6.824%2060.329%20L%20-10.684%2057.329%20C%20-11.764%2058.049%20-13.134%2058.489%20-14.754%2058.489%20C%20-17.884%2058.489%20-20.534%2056.379%20-21.484%2053.529%20L%20-25.464%2053.529%20L%20-25.464%2056.619%20C%20-23.494%2060.539%20-19.444%2063.239%20-14.754%2063.239%20Z'/%3e%3cpath%20fill='%23FBBC05'%20d='M%20-21.484%2053.529%20C%20-21.734%2052.809%20-21.864%2052.039%20-21.864%2051.239%20C%20-21.864%2
1050.439%20-21.724%2049.669%20-21.484%2048.949%20L%20-21.484%2045.859%20L%20-25.464%2045.859%20C%20-26.284%2047.479%20-26.754%2049.299%20-26.754%2051.239%20C%20-26.754%2053.179%20-26.284%2054.999%20-25.464%2056.619%20L%20-21.484%2053.529%20Z'/%3e%3cpath%20fill='%23EA4335'%20d='M%20-14.754%2043.989%20C%20-12.984%2043.989%20-11.404%2044.599%20-10.154%2045.789%20L%20-6.734%2042.369%20C%20-8.804%2040.429%20-11.514%2039.239%20-14.754%2039.239%20C%20-19.444%2039.239%20-23.494%2041.939%20-25.464%2045.859%20L%20-21.484%2048.949%20C%20-20.534%2046.099%20-17.884%2043.989%20-14.754%2043.989%20Z'/%3e%3c/g%3e%3c/svg%3e",F="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2015.0.0,%20SVG%20Export%20Plug-In%20--%3e%3c!DOCTYPE%20svg%20[%20%3c!ENTITY%20ns_flows%20'http://ns.adobe.com/Flows/1.0/'%3e%20]%3e%3csvg%20version='1.2'%20baseProfile='tiny'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns:a='http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/'%20x='0px'%20y='0px'%20width='36px'%20height='36px'%20viewBox='0%200%2036%2036'%20xml:space='preserve'%3e%3cdefs%3e%3c/defs%3e%3crect%20fill='%233B5998'%20width='36'%20height='36'/%3e%3cpath%20fill='%23FFFFFF'%20d='M30.895,16.535l-0.553,5.23h-4.181v15.176h-6.28V21.766H16.75v-5.23h3.131v-3.149%20c0-4.254,1.768-6.796,6.796-6.796h4.181v5.23h-2.615c-1.952,0-2.081,0.736-2.081,2.1v2.615H30.895z'/%3e%3c/svg%3e";class v{static SignIn(){document.cookie="g_state=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";const e=f();window.google?.accounts.id.prompt(t=>{(t.isNotDisplayed()||t.isSkippedMoment())&&window.google.accounts.oauth2.initTokenClient({client_id:e.public.gsiClientKey,itp_support:!0,scope:"openid",callback:s=>{s.error?w(s.error):this.handleCredentialResponse(null,s.access_token)}}).requestAccessToken()})}static loadGsiClient(){if(document.getElementById("gsiClient")==null){const t=f(),s=document.createElement("script");s.setAttribute("id","gsiClient"),s.src="https://accounts.google.com/gsi/client",s.onload=()=>{window.google.accounts.id.initialize({client_id:t.public.gsiClientKey,itp_support:!1,scope:"openid",callback:this.handleCredentialResponse}),this.SignIn()},document.head.appendChild(s)}}static async handleCredentialResponse(e=null,t=null){const s=r(),{$i18n:n}=s,i=await u("/apiVue/Google/Login",{method:"POST",body:{credential:e.credential,accessToken:t,language:n.locale.value},mode:"cors",credentials:"include",cache:"no-cache"}).catch(o=>w(o.data));if(i&&"success"in i&&i.success===!0){const o=g();o.initUser(i.data),o.apiLogin(o.isLoggedIn)}else if(i&&"success"in i&&i.success===!1){const o=p(),a=r(),{$i18n:c}=a;o.openAlert(h.Error,{text:c.t(i.messageKey)})}}}const w=d=>{new C().error("Google Login Error",[{errorMessage:d}]);const t=p(),s=r(),{$i18n:n}=s;t.openAlert(h.Error,{text:null,texts:[n.t("error.api.body")],customDetails:d},n.t("label.reloadPage"),!0,n.t("error.api.title"),"reloadPage",n.t("label.back")),t.$onAction(({name:i,after:o})=>{i=="closeAlert"&&o(a=>{a.cancelled==!1&&a.id=="reloadPage"&&window.location.reload()})})};window.handleGoogleCredentialResponse=v.handleCredentialResponse;class m{static GetUser(e,t,s){FB.api("/"+e,{access_token:t,fields:"name, email"},n=>
1{if(n&&!n.error)s(n);else throw n})}static RevokeUserAuthorization(e,t){FB.api("/me/permissions","DELETE",s=>{})}}class l{static async Exists(e){return!!await u("/apiVue/FacebookUsers/UserExists",{method:"GET",body:{facebookId:e},credentials:"include",cache:"no-cache"}).catch(s=>{const n=r(),{$logger:i}=n;i.error("Nuxt non Fatal Error",[s.data])})}static Throw_if_not_exists(e){if(!this.Exists(e))throw new Error("user with facebookId '"+e+"' does not exist");return!1}static async CreateAndLogin(e,t){const s=x();s.startLoading();const n=r(),{$i18n:i}=n,o=await u("/apiVue/FacebookUsers/CreateAndLogin",{method:"POST",body:{facebookUser:e,facebookAccessToken:t,language:i.locale.value},credentials:"include",cache:"no-cache"}).catch(a=>{s.stopLoading();const c=r(),{$logger:L}=c;L.error("Nuxt non Fatal Error",[a.data])});if(s.stopLoading(),o&&"success"in o&&o?.success==!0){const a=g();a.initUser(o.data),a.apiLogin(a.isLoggedIn)}else if(o&&"success"in o&&o?.success==!1){m.RevokeUserAuthorization(e.id,t);const a=p(),{t:c}=E();a.openAlert(h.Error,{text:c(o.messageKey)})}}static async Login(e,t,s=!0){const n=x();l.Throw_if_not_exists(e),n.startLoading();const i=await u("/apiVue/FacebookUsers/Login",{method:"POST",body:{facebookUserId:e,facebookAccessToken:t},credentials:"include",cache:"no-cache"}).catch(o=>{n.stopLoading()});if(n.stopLoading(),i&&"success"in i&&i?.success==!0){const o=g();o.initUser(i.data),o.apiLogin(o.isLoggedIn)}else if(i&&"success"in i&&i?.success==!1){const o=p(),a=r(),{$i18n:c}=a;o.openAlert(h.Error,{text:c.t(i.messageKey)})}}static LoginOrRegister(e=!1,t=!1){FB.getLoginStatus(s=>{this._LoginOrRegister(s,e,t)})}static _LoginOrRegister(e,t=!1,s=!1){e.status==="connected"?l.Login(e.authResponse.userID,e.authResponse.accessToken,t):(e.status==="not_authorized"||e.status==="unknown")&&FB.login(n=>{const i=n.authResponse.userID,o=n.authResponse.accessToken;if(n.status==="connected"){if(s){const a=r(),{$i18n:c}=a;A(`/${c.t("url.register")}`);return}this.handleResponse(i,o,t)}},{scope:"email"})}static async handleResponse(e,t,s){if(await l.Exists(e)){l.Login(e,t,s);return}else m.GetUser(e,t,n=>{l.CreateAndLogin(n,t)})}static Logout(e){FB.getLoginStatus(t=>{t.status==="connected"?FB.logout(n=>{e()}):e(),g().reset()})}}export{l as F,v as G,y as _,F as a};
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.