PageSourceSearch

https://www.aiornot.com/_next/static/chunks/app/(public)/layout-139c64a6fba547ed.js

js aiornot.com collected 2026-09-25 18:42:27 UTC 10,029 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[58288],{58979:function(e,t,n){Promise.resolve().then(n.t.bind(n,65878,23)),Promise.resolve().then(n.t.bind(n,72972,23)),Promise.resolve().then(n.bind(n,27519)),Promise.resolve().then(n.bind(n,99170)),Promise.resolve().then(n.bind(n,3380))},650:function(e,t,n){"use strict";n.d(t,{NE:function(){return o},N_:function(){return r},f0:function(){return l},uD:function(){return i}});let r=()=>{if(window.localStorage){let e=localStorage.getItem("isAnnual");return null!==e&&JSON.parse(e)}return!1},l=e=>{localStorage.setItem("isAnnual",JSON.stringify(e))},i=e=>{"free"!==e&&localStorage.setItem("selectedProductId",e)},o=e=>{if(window.localStorage){let t=localStorage.getItem("selectedProductId");null!==t&&(localStorage.removeItem("selectedProductId"),e(t))}}},57342:function(e,t,n){"use strict";n.d(t,{H:function(){return c},O:function(){return s}});var r=n(57437),l=n(2265),i=n(10924);let o="impersonatedUserId",a="impersonatedUserEmail",u=(0,l.createContext)({isAdmin:!1,isLoading:!0,isImpersonating:!1,impersonatedUserId:null,impersonatedUserEmail:null,startImpersonation:()=>{},stopImpersonation:()=>{}}),s=()=>(0,l.useContext)(u),c=e=>{let{children:t}=e,[n,s]=(0,l.useState)(!1),[c,d]=(0,l.useState)(!0),[m,f]=(0,l.useState)(null),[v,p]=(0,l.useState)(null),g=(0,l.useCallback)(()=>{f(null),p(null),sessionStorage.removeItem(o),sessionStorage.removeItem(a)},[]),h=(0,l.useCallback)((e,t)=>{if(!n){console.warn("Only admins can impersonate users");return}f(e),p(t||null),sessionStorage.setItem(o,e),t?sessionStorage.setItem(a,t):sessionStorage.removeItem(a)},[n]);(0,l.useEffect)(()=>{(async()=>{try{var e,t;let n=await (0,i.y)(),r=null===(e=n.tokens)||void 0===e?void 0:e.idToken;if(r){let e=r.payload["cognito:groups"],n=null!==(t=null==e?void 0:e.includes("Admins"))&&void 0!==t&&t;s(n)}else s(!1)}catch(e){s(!1)}finally{d(!1)}})()},[]),(0,l.useEffect)(()=>{{let e=sessionStorage.getItem(o),t=sessionStorage.getItem(a);e&&(f(e),p(t))}},[]),(0,l.useEffect)(()=>{c||n||!m||g()},[m,n,c,g]);let _=null!==m;return(0,r.jsx)(u.Provider,{value:{isAdmin:n,isLoading:c,isImpersonating:_,impersonatedUserId:m,impersonatedUserEmail:v,startImpersonation:h,stopImpersonation:g},children:t})}},32731:function(e,t,n){"use strict";n.d(t,{X:function(){return i}});var r=n(2265),l=n(9979);let i=()=>(0,r.useContext)(l.J)},9979:function(e,t,n){"use strict";n.d(t,{J:function(){return f},D:function(){return h}});var r=n(57437),l=n(2265),i=n(28105),o=n(93306),a=n(37853),u=n(28853);let s=async()=>{try{var e,t,n,r,l,i;let o=await (0,a.W)({method:"get",url:"/billing/stat"}),s="data"in o?o.data:o;if(!s)return null;let c={name:(null==s?void 0:null===(e=s.plan)||void 0===e?void 0:e.name)?(0,u.m0)(s.plan.name):null==s?void 0:null===(t=s.plan)||void 0===t?void 0:t.name,type:null==s?void 0:null===(n=s.plan)||void 0===n?void 0:n.type,billing_cycle:null==s?void 0:null===(r=s.plan)||void 0===r?void 0:r.billing_cycle,plan_cost:null==s?void 0:null===(l=s.plan)||void 0===l?void 0:l.plan_cost,id:null==s?void 0:null===(i=s.plan)||void 0===i?void 0:i.id};return{usage:null==s?void 0:s.usage,plan:c,is_enterprise:null==s?void 0:s.is_enterprise,hide_wallet_balance:null==s?void 0:s.hide_wallet_balance,cancel_at_period_end:null==s?void 0:s.cancel_at_period_end,cancel_at:null==s?void 0:s.cancel_at}}catch(e){return console.error("Failed to fetch subscription:",e),null}},c=async()=>{try{return await (0,a.W)({method:"get",url:"/billing/credits"})}catch(e){return console.error("Failed to fetch credit balance:",e),null}},d=async()=>{let[e,t]=await Promise.all([s(),c()]);return{subscription:e,creditBalanceData:t}},m=()=>{let{authStatus:e}=(0,o.Z)(e=>[e.authStatus]),t="authenticated"===e,{data:n,isLoading:r,isValidating:a,mutate:u}=(0,i.ZP)(t?"subscription-data":null,d,{revalidateOnFocus:!1}),s=(0,l.useCallback)(()=>t?u():Promise.resolve(void 0),[t,u]);return{data:null!=n?n:null,isLoading:!!t&&(r||a),refresh:s,mutate:u}},f=l.createContext({data:null,isLoading:!1,refresh:()=>Promise.resolve(void 0),resolution:{status:"idle"},resolveCheckout:()=>{}}),v=[1e3,2e3,3e3,5e3];function p(e,t){var n;return!!e&&e.name===t.displayName&&("Enterprise Plan"===t.displayName||(null!==(n=e.billing_cycle)&&void 0!==n?n:"").toLowerCase()===t.billingCycle)}function g(){localStorage.setItem("show-upgrade-modal","true"),localStorage.removeItem("pendingPaymentProductId"),localStorage.removeItem("selectedProductId"),window.dispatchEvent(new Event("show-upgrade-modal"))}let h=e=>{let{children:t}=e,{data:n,isLoading:i,refresh:o,mutate:a}=m(),[u,s]=(0,l.useState)({status:"idle"}),c=(0,l.useRef)(n);(0,l.useEffect)(()=>{c.current=n},[n]);let d=(0,l.useRef)(null),h=(0,l.useRef)(null);(0,l.useEffect)(()=>()=>{var e;(null===(e=d.current)||void 0===e?void 0:e.timer)&&clearTimeout(d.current.timer),d.current&&(d.current.cancelled=!0)},[]);let _=(0,l.useCallback)((e,t)=>{var n,r,l;if(!e||h.current===e)return;h.current=e;let i=function(e){let t;let n=e.toLowerCase();if("free"===n)t="Free Plan";else if(n.includes("enterprise"))t="Enterprise Plan";else{if(!(n.includes("pro")||n.includes("base")))return null;t="Pro Plan"}return{displayName:t,billingCycle:n.includes("annual")||n.includes("year")?"annual"
1:"monthly"}}(e);if(!i){s({status:"failed",expectedProductId:e,reason:"unrecognised"});return}if((null===(n=d.current)||void 0===n?void 0:n.timer)&&clearTimeout(d.current.timer),d.current&&(d.current.cancelled=!0),p(null===(l=c.current)||void 0===l?void 0:null===(r=l.subscription)||void 0===r?void 0:r.plan,i)){s({status:"settled",expectedProductId:e}),g();return}let o=Date.now(),u={expectedProductId:e,timer:null,cancelled:!1};d.current=u;let m=0;s({status:"pending",expectedProductId:e,startedAt:o});let f=()=>{u.cancelled||(u.cancelled=!0,d.current===u&&(d.current=null),s({status:"settled",expectedProductId:e}),g())},_=()=>{u.cancelled||(u.cancelled=!0,d.current===u&&(d.current=null),s({status:"failed",expectedProductId:e,reason:"timeout"}))},I=async()=>{var e;let t;if(u.cancelled)return;try{t=await a()}catch(e){t=void 0}if(u.cancelled)return;if(p(null==t?void 0:null===(e=t.subscription)||void 0===e?void 0:e.plan,i)){f();return}if(Date.now()-o>=6e4){_();return}let n=v[Math.min(m,v.length-1)];m+=1,u.timer=setTimeout(I,n)};u.timer=setTimeout(I,v[0])},[a]);return(0,r.jsx)(f.Provider,{value:{data:n,isLoading:i,refresh:o,resolution:u,resolveCheckout:_},children:t})}},37853:function(e,t,n){"use strict";n.d(t,{W:function(){return u}});var r=n(83464),l=n(10924);let i=r.Z.create({baseURL:"https://api.aiornot.com/aion"});i.interceptors.request.use(async e=>(e.headers={...e.headers},e),e=>(console.error("response in interceptor line number 27",JSON.stringify(e)),Promise.reject(e)));let o=async(e,t)=>{var n;let r={headers:{Authorization:"",...e}},{accessToken:i}=null!==(n=(await (0,l.y)()).tokens)&&void 0!==n?n:{};i&&(null==i?void 0:i.toString())&&(r.headers.Authorization="Bearer ".concat(null==i?void 0:i.toString()));{let e=sessionStorage.getItem("impersonatedUserId");e&&(r.headers["X-Impersonate-User-Id"]=e)}return{...r,...t}},a=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,{method:n,url:r,data:l,config:a,headers:u}=e,s=await o(u,a);switch(n){case"get":return t.get(r,s);case"post":return t.post(r,l,s);case"put":return t.put(r,l,s);case"patch":return t.patch(r,l,s);case"delete":return t.delete(r,s);default:throw Error("Unsupported method: ".concat(n))}},u=async e=>{let t=await a(e);if(!t)throw Error("Request failed with no response.");return t.data}},28853:function(e,t,n){"use strict";n.d(t,{JK:function(){return u},Z0:function(){return o},_D:function(){return a},m0:function(){return i},mo:function(){return r}});let r="/billing/usage/current-period",l=new Set(["Hitachi ProjectF","Hitachi Internal Intelligence","VerifyLabs Enterprise","AIorNot Internal Service"]);function i(e){return e?e.startsWith("AIorNot Free")?"Free Plan":e.startsWith("AIorNot Pro")||"Dimensa Prepaid Image Pack"===e?"Pro Plan":l.has(e)?"Enterprise Plan":e:e}function o(e){let t=e/1e6;return 0===t?"$0.00":t<.01?"$".concat(t.toFixed(6).replace(/0+$/,"")):new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(t)}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Map(t.map(e=>[e.model_key,e]));return e.map(e=>{var t,r,l;let i=n.get(e.model_code);return{...e,total_calls:null!==(t=null==i?void 0:i.total_calls)&&void 0!==t?t:0,total_units:null!==(r=null==i?void 0:i.total_units)&&void 0!==r?r:0,total_cost_microusd:null!==(l=null==i?void 0:i.total_cost_microusd)&&void 0!==l?l:0,included_units:function(e){var t;let n=e.find(e=>e.threshold_units>0&&e.unit_price_microusd>0);return null!==(t=null==n?void 0:n.threshold_units)&&void 0!==t?t:null}(e.tiers)}})}function u(e){if(e.is_enterprise||e.hide_wallet_balance)return{showWallet:!1,showTopOff:!1,showAutoRecharge:!1};let t=!1!==e.top_offs_enabled,n=t&&!1!==e.auto_recharge_available;return{showWallet:!0,showTopOff:t,showAutoRecharge:n}}},34500:function(e,t,n){"use strict";n.d(t,{JI:function(){return o},SD:function(){return a},eF:function(){return i},j0:function(){return u}});let r="utm_params",l="utm_params_timestamp",i=e=>{let t={},n=!1;return(["utm_source","utm_medium","utm_campaign","utm_term","utm_content"].forEach(r=>{let l=e.get(r);l&&(t[r]=l,n=!0)}),n)?(localStorage.setItem(r,JSON.stringify(t)),localStorage.setItem(l,new Date().toISOString()),t):n?t:null},o=()=>{try{let e=localStorage.getItem(r),t=localStorage.getItem(l);if(!e)return null;if(t){let e=new Date(t);if((new Date().getTime()-e.getTime())/864e5>30)return u(),null}return JSON.parse(e)}catch(e){return console.error("Error retrieving UTM params:",e),null}},a=e=>{if(e){let t=i(e);if(t)return t}return o()||{}},u=()=>{localStorage.removeItem(r),localStorage.removeItem(l)}}},function(e){e.O(0,[72972,82957,65878,10924,83464,6137,93306,28105,13590,73542,29078,68265,27519,92971,96067,1744],function(){return e(e.s=58979)}),_N_E=e.O()}]);

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.