PageSourceSearch

https://cdn.hifer.ai/static/1791160896898/_next/static/chunks/3025-90a0ea7e0b146b39.js

js hifer.ai collected 2026-10-05 14:34:27 UTC 7,523 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3025],{3025:(e,t,n)=>{n.d(t,{A:()=>v,AuthProvider:()=>k});var r=n(95155),a=n(12115),o=n(93282),l=n(84604),u=n(82248);let i="HiferAuthToken",s="HiferConsoleToken",c="",d=()=>{if(c||"undefined"==typeof document)return c;let e=document.createElement("canvas");e.width=256,e.height=256;let t=e.getContext("2d");if(!t)return"";let n=t.createImageData(256,256),r=Math.hypot(128,128),a=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5],o=e=>e*e*(3-2*e);for(let e=0;e<256;e+=1)for(let t=0;t<256;t+=1){let l=Math.min(1,Math.hypot(t+.5-128,e+.5-128)/r),u=0;l<=.45?u=.075+(.025-.075)*o(l/.45):l<.82&&(u=.025*(1-o((l-.45)/.37)));let i=((a[Math.min(e,255-e)%4*4+Math.min(t,255-t)%4]+.5)/16-.5)*.7,s=(256*e+t)*4;n.data[s]=Math.round(37+218*u+i),n.data[s+1]=Math.round(37+218*u+i),n.data[s+2]=Math.round(38+217*u+i),n.data[s+3]=255}return t.putImageData(n,0,0),c=e.toDataURL("image/png")},f=e=>{document.cookie="".concat(i,"=").concat(encodeURIComponent(e),"; Path=/; SameSite=Lax; Max-Age=").concat(2592e3)},m=()=>{document.cookie="".concat(i,"=; Path=/; SameSite=Lax; Max-Age=0")},g=e=>{document.cookie="".concat(s,"=").concat(encodeURIComponent(e),"; Path=/hifer-console; SameSite=Lax; Max-Age=").concat(2592e3)},h=()=>{document.cookie="".concat(s,"=; Path=/hifer-console; SameSite=Lax; Max-Age=0")},p=e=>"string"!=typeof(null==e?void 0:e.id)||"string"!=typeof(null==e?void 0:e.title)||"string"!=typeof(null==e?void 0:e.content)?null:{id:e.id,title:e.title,prompt:e.content},y=(0,a.createContext)({isLoggedIn:!1,isAuthLoaded:!1,user:null,token:null,creditsMap:{},isAuthOpen:!1,openAuthModal:()=>{},closeAuthModal:()=>{},login:()=>{},logout:()=>{},setUser:()=>{},selectedNodeIds:[],setSelectedNodeIds:()=>{},refreshUserData:async()=>{},humanOkTopologyCacheRef:{current:{topologyCache:null,staticResources:null,
1staticResourcesPromise:null}},meshThumbnailBackdropDataUrl:"",getMeshThumbnailBackdropDataUrl:async()=>d(),customCommands:[],setCustomCommands:()=>{},loadCustomCommands:async()=>{}});function k(e){let{children:t}=e,[n,i]=(0,a.useState)(null),[s,c]=(0,a.useState)(null),[k,v]=(0,a.useState)(!1),[w,S]=(0,a.useState)(!1),[C,b]=(0,a.useState)({}),[A,I]=(0,a.useState)(!1),[R,M]=(0,a.useState)([]),[O,x]=(0,a.useState)([]),[L,N]=(0,a.useState)(""),P=(0,a.useRef)(!1),T=(0,a.useRef)(null),U=(0,a.useRef)(0),D=(0,a.useRef)(!1),j=(0,a.useRef)(!1),E=(0,a.useRef)(null),_=(0,a.useRef)({topologyCache:null,staticResources:null,staticResourcesPromise:null}),J=(0,a.useCallback)(async()=>{let e=d();return e&&N(t=>t||e),e},[]),G=(0,a.useCallback)(()=>I(!0),[]),H=(0,a.useCallback)(()=>I(!1),[]),Z=(0,a.useCallback)(async e=>{let t=++U.current,n=await (0,o.N)("/web/user/GetCreditsMap",{...e?{token:e}:{},...(()=>{var e;if("undefined"==typeof navigator)return{browserLanguage:"",timeZone:""};let t=(null==(e=navigator.languages)?void 0:e[0])||navigator.language||"",n="";try{n=Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch(e){}return{browserLanguage:t,timeZone:n}})()});n.isOk&&t===U.current&&b(n.data.result)},[]),$=(0,a.useCallback)(async()=>{if(P.current||!s)return;let e=T.current;if(e)return void await e;let t=(async()=>{let e=await (0,o.N)("/web/save/CustomGenerationCommandList",{token:s});e.isOk&&Array.isArray(e.data.result)&&(x(e.data.result.map(p).filter(e=>null!==e)),P.current=!0)})().finally(()=>{T.current===t&&(T.current=null)});T.current=t,await t},[s]),B=async()=>{let e=j.current,t=e?E.current:(0,u.$g)();Z(t),t?(0,o.N)("/web/user/GetUserInfo",{token:t}).then(n=>{let r=e?j.current&&E.current===t:!j.current&&(0,u.$g)()===t;n.isOk&&r?(c(t),i(n.data.result),v(!0),e||(f(t),g(t))):401===n.data.code&&r&&(e?(j.current=!1,E.current=null):((0,u.I1)(null),m(),h()),c(null),i(null),v(!1)),S(!0)}):(e||(m(),h()),S(!0))};return(0,a.useEffect)(()=>{var e;if(D.current)return;D.current=!0;let t=null==(e=new URLSearchParams(window.location.search).get("temporaryAccess"))?void 0:e.trim();if(!t)return void B();let n=new URL(window.location.href);n.searchParams.delete("temporaryAccess"),window.history.replaceState(window.history.state,"","".concat(n.pathname).concat(n.search).concat(n.hash));let r=!0;return(0,o.N)("/web/user/LoginWithTemporaryAccess",{temporaryAccess:t}).then(e=>{if(!r)return;let t=e.data.result,n="string"==typeof(null==t?void 0:t.token)?t.token:"";e.isOk&&n&&(null==t?void 0:t.user)?(j.current=!0,E.current=n,c(n),i(t.user),v(!0),Z(n)):(c(null),i(null),v(!1),Z(null)),S(!0)}),()=>{r=!1}},[]),(0,a.useEffect)(()=>{J()},[J]),(0,r.jsx)(l.G_,{clientId:"1063408244244-pmroo3fhci3pkm8vrrsk3rv9tgecshrj.apps.googleusercontent.com",children:(0,r.jsx)(y.Provider,{value:{isLoggedIn:k,isAuthLoaded:w,user:n,token:s,creditsMap:C,isAuthOpen:A,openAuthModal:G,closeAuthModal:H,login:(e,t)=>{j.current=!1,E.current=null,(0,u.I1)(t),c(t),i(e),v(!0),f(t),g(t),Z(t)},logout:()=>{if(j.current){j.current=!1,E.current=null,c(null),i(null),v(!1),Z(null);return}(0,u.I1)(null),m(),h(),c(null),i(null),v(!1),Z(null)},setUser:i,selectedNodeIds:R,setSelectedNodeIds:M,refreshUserData:B,humanOkTopologyCacheRef:_,meshThumbnailBackdropDataUrl:L,getMeshThumbnailBackdropDataUrl:J,customCommands:O,setCustomCommands:x,loadCustomCommands:$},children:t})})}function v(){return(0,a.useContext)(y)}}
1,82248:(e,t,n)=>{n.d(t,{$g:()=>s,I1:()=>c,Xg:()=>i,_R:()=>u});let r="HiferLocalStorage";function a(){return{image:{tab:"my",config:{}},humanok:{tab:"public",config:{}},mesh:{tab:"public",config:{}}}}function o(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function l(){try{let e=window.localStorage.getItem(r);if(!e)return null;let t=JSON.parse(e);if(!o(t))return null;if(2!==t.version||!o(t.preferences))return{version:2,token:"string"==typeof t.token&&t.token.trim()?t.token:null,preferences:a()};return t}catch(e){return null}}function u(e){var t,n;let r=null==(t=l())?void 0:t.preferences[e];return o(r)&&(n=r.tab,"image"===e?"my"===n:"public"===n||"my"===n)&&o(r.config)?r:null}function i(e,t){let n=l(),o={version:2,token:(null==n?void 0:n.token)||null,preferences:{...a(),...null==n?void 0:n.preferences,[e]:t}};try{window.localStorage.setItem(r,JSON.stringify(o))}catch(e){return}}function s(){var e;let t=null==(e=l())?void 0:e.token;return"string"==typeof t&&t.trim()?t:null}function c(e){let t=l(),n={version:2,token:e,preferences:{...a(),...null==t?void 0:t.preferences}};try{window.localStorage.setItem(r,JSON.stringify(n))}catch(e){return}}},93282:(e,t,n)=>{n.d(t,{N:()=>r});async function r(e,t){try{let{browserLanguage:n,timeZone:r}=function(){var e;if("undefined"==typeof navigator)return{browserLanguage:"",timeZone:""};let t=(null==(e=navigator.languages)?void 0:e[0])||navigator.language||"",n="";try{n=Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch(e){}return{browserLanguage:t,timeZone:n}}(),a=await fetch("/api"+e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t,browserLanguage:n,timeZone:r})});if(!a.ok)return{isOk:!1,msg:function(e,t){let n=t.trim();if(!n||n.startsWith("<"))return"服务器请求失败(HTTP ".concat(e,")");try{let e=JSON.parse(n);if("string"==typeof e.message&&e.message.trim())return e.message.trim();if("string"==typeof e.detail&&e.detail.trim())return e.detail.trim()}catch(e){}return n.slice(0,500)}(a.status,await a.text()),data:{}};let o=await a.json();return{isOk:200===o.code,msg:o.message,data:{code:o.code,result:o.result}}}catch(e){return{isOk:!1,msg:e instanceof Error&&e.message?"网络错误:".concat(e.message):"网络错误发生",data:{}}}}}}]);

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.