PageSourceSearch

https://macosicons.com/_nuxt/Nl_ojO17.js

js macosicons.com collected 2026-10-04 00:26:28 UTC 8,770 bytes, 1 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`2c181b49-10d3-4fde-a686-38cfa9c24d22`,e._sentryDebugIdIdentifier=`sentry-dbid-2c181b49-10d3-4fde-a686-38cfa9c24d22`)}catch{}})();import{O as e}from"./BNWMsBwf.js";import{C as t}from"./CyU4sjus.js";import{g as n}from"./Dxi30lUR.js";import{t as r}from"./mae8fuSy.js";import{t as i}from"./CYuiUEJU.js";import"./CNySwjlF.js";import{n as a}from"./DeFb3Kdw.js";import{i as o,n as s,o as c,t as l}from"./BcsTi7fm.js";var u=/^\[[A-Z]+\]\s+"[^"]+":\s+\d{3}\s+.+$/,d=new Set([`server error`,`internal server error`,`unauthorized`,`forbidden`,`bad request`,`true`,`false`]);function f(e){if(typeof e!=`string`)return!1;let t=e.trim();return!(!t||u.test(t)||d.has(t.toLowerCase()))}function p(e){if(!e||typeof e!=`object`)return;let t=e;return t.statusCode||t.response?.status}function m(e){if(!e||typeof e!=`object`)return;let t=e;return t.data||t.response?._data}function h(e){if(!e||typeof e!=`object`)return;let t=e,n=m(e);return[n?.statusMessage,n?.message,n?.error,t.statusMessage,t.message].find(f)}function g(e,t,n){let r=p(e),i=h(e),a=i?.toLowerCase(),o=m(e)?.data?.code;return o===`APPLE_EMAIL_IN_USE`?n(`auth.messages.appleEmailInUse`):o===`APPLE_ALREADY_LINKED`?n(`auth.messages.appleAlreadyLinked`):a?.includes(`invalid`)&&a.includes(`token`)?n(`auth.messages.resetLinkInvalid`):a?.includes(`expired`)&&a.includes(`token`)?n(`auth.messages.resetLinkExpired`):a?.includes(`email already`)||a?.includes(`account already`)?n(`auth.messages.emailExists`):a?.includes(`username already`)||a?.includes(`username taken`)?n(`auth.messages.usernameTaken`):a?.includes(`invalid login`)||a?.includes(`invalid credential`)||a?.includes(`incorrect password`)||a?.includes(`wrong password`)?n(`auth.messages.invalidCredentials`):a?.includes(`user not found`)||a?.includes(`account not found`)?n(`auth.messages.accountNotFound`):i||(r===401?n(`auth.messages.invalidCredentials`):r===403?n(`auth.messages.noPermission`):r&&r>=500?n(`auth.messages.serverError`):t)}function _(){let u=a(),{$i18n:d}=e(),f=e=>d.t(e),p=i(`auth_user`,()=>null),m=i(`auth_token`,()=>null),h=i(`auth_authenticated`,()=>!1),_=t(!1),v=t(null),y=n(()=>h.value||!!m.value);async function b(e={}){let t=p.value?.apiKey||p.value?.api_key||null,n=m.value||null;try{await c(t,n,e)}catch(e){console.error(`Failed to sync session cookies:`,e)}}async function x(e={}){try{_.value=!0;let t=localStorage.getItem(`auth_user`),n=localStorage.getItem(`auth_token`);p.value=t?JSON.parse(t):null,n?(m.value=n,h.value=!0):e.preserveAuthenticated||(h.value=!1),s(!n&&h.value),e.syncCookies&&await b()}catch(e){v.value=g(e,d.t(`auth.messages.restoreSessionFailed`),f)}finally{_.value=!1}}async function S(e){v.value=null,_.value=!0;try{return await r(`/api/auth/does-account-exist`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:{email:e}})}catch(e){throw v.value=g(e,d.t(`auth.messages.checkEmailFailed`),f),e}finally{_.value=!1}}async function C(e,t,n,i){v.value=null,_.value=!0;let a=localStorage.getItem(`pending_invite_code`)||void 0;try{let o=await r(`/api/auth/sign-up`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:{email:e,password:t,nameToShow:n,username:i,inviteCode:a}});return p.value=o.user,m.value=o.sessionToken,h.value=!0,localStorage.setItem(`auth_user`,JSON.stringify(o.user)),localStorage.setItem(`auth_token`,o.sessionToken),localStorage.removeItem(`pending_invite_code`),await b(),o}catch(e){throw v.value=g(e,d.t(`auth.messages.signUpFailed`),f),e}finally{_.value=!1}}async function w(e,t){v.value=null,_.value=!0;try{let n=await r(`/api/auth/log-in`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:{email:e,password:t}});return p.value=n.user,m.value=n.sessionToken,h.value=!0,localStorage.setItem(`auth_user`,JSON.stringify(n.user)),localStorage.setItem(`auth_token`,n.sessionToken),await b(),u.add({title:d.t(`auth.messages.loggedIn`)}),n}catch(e){throw v.value=g(e,d.t(`auth.messages.logInFailed`),f),e}finally{_.value=!1}}async function T(){let e=window.AppleID;if(!e)throw Error(`Apple Sign In SDK not loaded`);return e.auth.init({clientId:`com.macOSicons.client`,scope:`email name`,redirectURI:`https://macosicons.com`,usePopup:!0}),e.auth.signIn()}async function E(){v.value=null,_.value=!0;try{let e=await T(),t=await r(`/api/auth/log-in-with-apple`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:e});return p.value=t.user,m.value=t.sessionToken,h.value=!0,localStorage.setItem(`auth_user`,JSON.stringify(t.user)),localStorage.setItem(`auth_token`,t.sessionToken),await b(),t}catch(e){throw v.value=g(e,d.t(`auth.messages.appleSignInFailed`),f),e}finally{_.value=!1}}async function D(){v.value=null,_.value=!0;try{p.value=null,m.value=null,h.value=!1,localStorage.removeItem(`auth_user`),localStorage.removeItem(`auth_token`),l(),o(),await b(),u.add({title:d.t(`auth.messages.loggedOut`)})}catch(e){throw v.value=g(e,d.t(`auth.messages.logOutFailed`),f),e}finally{_.value=!1}}async function O(e){v.value=null,_.value=!0;try{await r(`/api/auth/request-password-reset`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:{email:e.trim()}})}catch(e){throw v.value=g(e,d.t(`auth.messages.resetEmailFailed`),f),e}finally{_.value=!1}}async function k(e){v.value=null,_.value=!0;try{await r(`/api/auth/confirm-password-reset`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:{token:e.token,newPassword:e.newPassword}})}catch(e){throw v.value=g(e,d.t(`auth.messages.passwordResetFailed`),f),e}finally{_.value=!1}}function A(e,t={}){if(!e)return;let n={...t,username:e.username,email:e.email,emailVerified:e.emailVerified,pendingEmail:e.pendingEmail,pendingEmailExpiresAt:e.pendingEmailExpiresAt},r={...p.value||{},...n};p.value=r;try{let e=localStorage.getItem(`auth_user`);e&&localStorage.setItem(`auth_user`,JSON.stringify({...JSON.parse(e),...n}))}catch(e){console.error(`Failed to persist account identity:`,e)}}async function j(e){v.value=null,_.value=!0;try{let t=await r(`/api/user-profile/username`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:{username:e.trim()}});return A(t.user),t.user}catch(e){throw v.value=g(e,d.t(`auth.messages.usernameUpdateFailed`),f),e}finally{_.value=!1}}async function M(e,t){v.value=null,_.value=!0;try{let n=await r(`/api/auth/request-email-change`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:{email:e.trim(),...t?{password:t}:{}}});return A(n.user),{pendingEmail:n.pendingEmail,expiresAt:n.expiresAt}}catch(e){throw v.value=g(e,d.t(`auth.messages.emailChangeRequestFailed`),f),e}finally{_.value=!1}}async function N(){v.value=null,_.value=!0;try{A((await r(`/api/auth/cancel-email-change`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:{}})).user)}catch(e){throw v.value=g(e,d.t(`auth.messages.emailChangeCancelFailed`),f),e}finally{_.value=!1}}async function P(e){v.value=null,_.value=!0;try{let t=await r(`/api/auth/confirm-email-change`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:{token:e}});return p.value&&t.user&&(p.value.objectId||p.value.id)===t.user.id&&A(t.user),{email:t.email,username:t.username}}catch(e){throw v.value=g(e,d.t(`auth.messages.emailChangeConfirmFailed`),f),e}finally{_.value=!1}}async function F(){v.value=null,_.value=!0;try{let e=await T(),t=await r(`/api/auth/link-apple`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:e});A(t.user,{authData:{...p.value?.authData||{},apple:{linked:!0}},passwordLogin:t.user.hasPassword})}catch(e){throw v.value=g(e,d.t(`auth.messages.appleConnectFailed`),f),e}finally{_.value=!1}}async function I(e,t){v.value=null,_.value=!0;try{let n=await r(`/api/auth/change-password`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:{currentPassword:e,newPassword:t}});m.value=n.sessionToken,localStorage.setItem(`auth_token`,n.sessionToken),await b()}catch(e){throw v.value=g(e,d.t(`auth.messages.passwordChangeFailed`),f),e}finally{_.value=!1}}return{user:p,token:m,loading:_,error:v,isAuthenticated:y,syncSessionCookies:b,restoreSession:x,checkAccountExists:S,signUp:C,logIn:w,logInWithApple:E,
1connectApple:F,logOut:D,requestPasswordReset:O,confirmPasswordReset:k,updateUsername:j,requestEmailChange:M,cancelEmailChange:N,confirmEmailChange:P,changePassword:I}}export{_ as t};

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.