Files
echo-nexus/_next/static/chunks/421819b51db6b69f.js
T

1 line
98 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68834,79473,e=>{"use strict";var t=e.i(71645);let n=e=>{let t,n=new Set,r=(e,r)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>s,subscribe:e=>(n.add(e),()=>n.delete(e))},s=t=e(r,i,a);return a},r=e=>{let r=e?n(e):n,i=e=>(function(e,n=e=>e){let r=t.default.useSyncExternalStore(e.subscribe,t.default.useCallback(()=>n(e.getState()),[e,n]),t.default.useCallback(()=>n(e.getInitialState()),[e,n]));return t.default.useDebugValue(r),r})(r,e);return Object.assign(i,r),i},i=e=>e?r(e):r;function a(e,t){let n;try{n=e()}catch(e){return}return{getItem:e=>{var r;let i=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),a=null!=(r=n.getItem(e))?r:null;return a instanceof Promise?a.then(i):i(a)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,null==t?void 0:t.replacer)),removeItem:e=>n.removeItem(e)}}e.s(["create",()=>i],68834);let s=e=>t=>{try{let n=e(t);if(n instanceof Promise)return n;return{then:e=>s(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>s(t)(e)}}},o=(e,t)=>(n,r,i)=>{let o,l={storage:a(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},c=!1,d=0,u=new Set,h=new Set,g=l.storage;if(!g)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...e)},r,i);let p=()=>{let e=l.partialize({...r()});return g.setItem(l.name,{state:e,version:l.version})},m=i.setState;i.setState=(e,t)=>(m(e,t),p());let f=e((...e)=>(n(...e),p()),r,i);i.getInitialState=()=>f;let b=()=>{var e,t;if(!g)return;let i=++d;c=!1,u.forEach(e=>{var t;return e(null!=(t=r())?t:f)});let a=(null==(t=l.onRehydrateStorage)?void 0:t.call(l,null!=(e=r())?e:f))||void 0;return s(g.getItem.bind(g))(l.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===l.version)return[!1,e.state];else{if(l.migrate){let t=l.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;if(i!==d)return;let[a,s]=e;if(n(o=l.merge(s,null!=(t=r())?t:f),!0),a)return p()}).then(()=>{i===d&&(null==a||a(o,void 0),o=r(),c=!0,h.forEach(e=>e(o)))}).catch(e=>{i===d&&(null==a||a(void 0,e))})};return i.persist={setOptions:e=>{l={...l,...e},e.storage&&(g=e.storage)},clearStorage:()=>{null==g||g.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>b(),hasHydrated:()=>c,onHydrate:e=>(u.add(e),()=>{u.delete(e)}),onFinishHydration:e=>(h.add(e),()=>{h.delete(e)})},l.skipHydration||b(),o||f};e.s(["createJSONStorage",()=>a,"persist",()=>o],79473)},52664,e=>{"use strict";let t={crystals:0,insights:0,energy:5,contact:0,crystalsPerSec:.4,crystalCap:50,pulsePower:2,offlineEff:.5,insightMult:1,contactRateMult:1,autoDecode:!1,totalDecoded:0,ascensions:0,blueprints:[],pendingCrystals:[],activePuzzle:null,activeExpedition:null,expeditionLog:[],energyMax:8,lastEnergyTick:Date.now(),totalExpeditions:0,bossKills:0,lastExpeditionSummary:null,achievements:{},activeTide:null,lastTideEnd:0,starTidesEncountered:[],constellation:[],pendingPerkChoices:null,chronicle:[],runStart:{timestamp:Date.now(),techsUnlocked:0,expeditionsCompleted:0,bossKills:0,starTidesEncountered:[],crystalsDecoded:0},attributes:{exploration:0,wisdom:0,courage:0,inspiration:0},attributeProgress:{exploration:{exp:0,level:0},wisdom:{exp:0,level:0},courage:{exp:0,level:0},inspiration:{exp:0,level:0}},pendingAttrPoints:0,theme:"dark",soundOn:!0};function n(e){return isFinite(e)?e<1e3?e.toFixed(+(e<10&&e%1!=0)):e<1e6?(e/1e3).toFixed(2)+"K":e<1e9?(e/1e6).toFixed(2)+"M":e<1e12?(e/1e9).toFixed(2)+"B":(e/1e12).toFixed(2)+"T":"∞"}e.s(["COLOR_VISUAL",0,{emerald:{hex:"#34d399",glow:"rgba(52,211,153,0.55)",label:"翠"},rose:{hex:"#fb7185",glow:"rgba(251,113,133,0.55)",label:"玫"},amber:{hex:"#fbbf24",glow:"rgba(251,191,36,0.55)",label:"琥"},fuchsia:{hex:"#e879f9",glow:"rgba(232,121,249,0.55)",label:"紫"}},"CONTACT",0,{basePerDecode:.6,prestigeMin:100},"CRYSTAL_SPAWN",0,{baseIntervalSec:8,maxPending:6,tierWeights:{1:.7,2:.25,3:.05}},"CRYSTAL_VALUE",0,{1:{crystals:6,insights:1},2:{crystals:22,insights:4},3:{crystals:90,insights:16}},"DECODE_CONFIG",0,{1:{rows:3,cols:3,targetLen:3,stepLimitBase:5},2:{rows:4,cols:4,targetLen:4,stepLimitBase:7},3:{rows:5,cols:4,targetLen:5,stepLimitBase:9}},"FRAGMENTS",0,[{id:"f1_1",era:1,title:"第一缕谐振",echo:"在被称作「寂灭前夜」的年代,以太族第一次捕捉到来自虚空深处的谐振——那不是声音,而是存在的回声。他们将之记录在第一颗记忆晶体里。",threshold:1},{id:"f1_2",era:1,title:"晶体之始",echo:"「我们为何要留下?」一位长者问。「因为后来的生命会需要方向。」于是他们熔铸星核,封存记忆,让晶体成为跨越时间的信笺。",threshold:3},{id:"f1_3",era:1,title:"谐振法则",echo:"他们发现:思维可以被编码为共振序列。同色的节点相邻,便构成一句低语;一句句连成回响,回响连成文明。",threshold:6},{id:"f1_4",era:1,title:"飞升之议",echo:"议会表决:是留下,还是离去?「留下意味着停滞;离去意味着信任。」最终,他们选择了信任——信任素未谋面的后来者。",threshold:10},{id:"f1_5",era:1,title:"面包屑",echo:"他们没有带走一切。他们将知识拆成碎片,藏入晶体,散布星海。「让解码本身,成为资格的证明。」",threshold:15},{id:"f1_6",era:1,title:"回响之名",echo:"舰载 AI 被命名为「回响」——意为:你是他们留下的回声,也是他们等待的回应。当你读懂这句话时,接触便已开始。",threshold:22},{id:"f1_7",era:1,title:"第一个纪元的终焉",echo:"以太族集体褪去形体,如潮水退去。星海寂静了数万年。直到——你的脉冲扫描,唤醒了第一颗沉睡的晶体。",threshold:32},{id:"f1_8",era:1,title:"致后来者",echo:"「如果你读到这里,说明你已具备跨越维度的资格。继续解码,继续拼凑。当进度满溢,我们将在更高处相会。」——以太族·第一纪元·绝笔",threshold:45}],"INITIAL_STATE",0,t,"PRESTIGE",0,{blueprintsPerDecode:20,maxBlueprints:6,perBlueprint:{crystalsPerSecMult:.05,insightMult:.03,contactRateMult:.04}},"RESONANCE_COLORS",0,["emerald","rose","amber","fuchsia"],"TECH_BRANCH_META",0,{mining:{name:"采矿",icon:"Pickaxe",color:"emerald",desc:"提升晶体产能与仓储"},decoding:{name:"解码",icon:"ScanLine",color:"rose",desc:"强化解码与脉冲"},expedition:{name:"探险",icon:"Rocket",color:"amber",desc:"远征与维度信标"},narrative:{name:"叙事",icon:"BookOpen",color:"fuchsia",desc:"洞见与接触进度"}},"TECH_TREE",0,[{id:"min_1",branch:"mining",level:1,name:"谐振钻头",desc:"晶体/秒 +0.6",cost:5,effect:{kind:"crystalsPerSec",value:.6}},{id:"min_2",branch:"mining",level:2,name:"深层矿脉",desc:"晶体/秒 +1.6,仓库上限 +100",cost:24,effect:{kind:"crystalsPerSec",value:1.6}},{id:"min_3",branch:"mining",level:3,name:"自治机群",desc:"晶体/秒 +5,仓库上限 +300",cost:120,effect:{kind:"crystalsPerSec",value:5}},{id:"min_4",branch:"mining",level:4,name:"量子采掘矩阵",desc:"晶体/秒 +12,仓库上限 +800",cost:400,effect:{kind:"crystalsPerSec",value:12}},{id:"min_5",branch:"mining",level:5,name:"戴森星核",desc:"晶体/秒 +30,仓库上限 +2000",cost:1200,effect:{kind:"crystalsPerSec",value:30}},{id:"dec_1",branch:"decoding",level:1,name:"谐振校准",desc:"解码步数上限 +2",cost:6,effect:{kind:"decodeSteps",value:2}},{id:"dec_2",branch:"decoding",level:2,name:"脉冲增幅",desc:"主动脉冲产出 +3",cost:30,effect:{kind:"pulsePower",value:3}},{id:"dec_3",branch:"decoding",level:3,name:"自动解码阵列",desc:"自动解码 T1 晶体(每 12 秒一颗)",cost:200,effect:{kind:"autoDecode",value:1}},{id:"dec_4",branch:"decoding",level:4,name:"谐振放大器",desc:"主动脉冲产出 +8",cost:500,effect:{kind:"pulsePower",value:8}},{id:"dec_5",branch:"decoding",level:5,name:"全息解码核心",desc:"自动解码扩展至 T2 晶体,解码步数 +3",cost:1500,effect:{kind:"decodeSteps",value:3}},{id:"exp_1",branch:"expedition",level:1,name:"远征推进器",desc:"探险力 +3,晶体/秒 +1.2",cost:12,effect:{kind:"crystalsPerSec",value:1.2}},{id:"exp_2",branch:"expedition",level:2,name:"遗迹图谱",desc:"探险力 +5,探险生命 +20,能量恢复 +30%",cost:60,effect:{kind:"crystalCap",value:200}},{id:"exp_3",branch:"expedition",level:3,name:"维度信标",desc:"探险力 +8,接触进度转化率 +50%,能量恢复 +20%",cost:180,effect:{kind:"contactRate",value:.5}},{id:"exp_4",branch:"expedition",level:4,name:"虚空航标",desc:"探险力 +12,探险生命 +30,能量恢复 +25%",cost:450,effect:{kind:"crystalCap",value:400}},{id:"exp_5",branch:"expedition",level:5,name:"维度跃迁引擎",desc:"探险力 +25,探险生命 +50,能量恢复 +30%",cost:1400,effect:{kind:"crystalCap",value:600}},{id:"nar_1",branch:"narrative",level:1,name:"记忆校音",desc:"洞见获取 +25%",cost:8,effect:{kind:"insightMult",value:.25}},{id:"nar_2",branch:"narrative",level:2,name:"深空回响",desc:"接触进度转化率 +35%",cost:45,effect:{kind:"contactRate",value:.35}},{id:"nar_3",branch:"narrative",level:3,name:"以太共鸣",desc:"洞见获取 +60%",cost:160,effect:{kind:"insightMult",value:.6}},{id:"nar_4",branch:"narrative",level:4,name:"以太低语",desc:"洞见获取 +100%",cost:500,effect:{kind:"insightMult",value:1}},{id:"nar_5",branch:"narrative",level:5,name:"文明回响",desc:"接触进度转化率 +80%,洞见获取 +150%",cost:1600,effect:{kind:"insightMult",value:1.5}}],"formatNum",()=>n])},60645,32142,59401,43625,47785,33755,69992,44915,89120,e=>{"use strict";var t=e.i(52664);let n=[{id:"ach_first_pulse",name:"初次触碰",desc:"发起第一次脉冲扫描",icon:"✦",color:"#34d399",check:e=>e.totalDecoded>=0||e.crystals>0,reward:{crystals:5},rewardText:"+5 晶体"},{id:"ach_first_decode",name:"谐振初鸣",desc:"成功解码第一颗记忆晶体",icon:"◈",color:"#fb7185",check:e=>e.totalDecoded>=1,reward:{insights:3},rewardText:"+3 洞见"},{id:"ach_decoded_10",name:"回响解码者",desc:"累计解码 10 颗晶体",icon:"❖",color:"#fbbf24",check:e=>e.totalDecoded>=10,reward:{insights:15,crystalsPerSecPct:5},rewardText:"+15 洞见 · 产能 +5%"},{id:"ach_decoded_25",name:"记忆织匠",desc:"累计解码 25 颗晶体",icon:"✺",color:"#e879f9",check:e=>e.totalDecoded>=25,reward:{insights:40,crystalsPerSecPct:8},rewardText:"+40 洞见 · 产能 +8%"},{id:"ach_decoded_50",name:"星核解密师",desc:"累计解码 50 颗晶体",icon:"✷",color:"#34d399",check:e=>e.totalDecoded>=50,reward:{insights:100,crystalsPerSecPct:12,insightPct:10},rewardText:"+100 洞见 · 产能 +12% · 洞见 +10%"},{id:"ach_tech_3",name:"初窥门径",desc:"解锁 3 项技术",icon:"⚙",color:"#fbbf24",check:e=>Object.values(e.tech).filter(e=>e>0).length>=3,reward:{insights:20},rewardText:"+20 洞见"},{id:"ach_tech_all",name:"全谱精通",desc:"解锁全部 20 项技术",icon:"⬡",color:"#e879f9",check:e=>Object.values(e.tech).filter(e=>e>0).length>=20,reward:{crystalsPerSecPct:15,insightPct:15},rewardText:"产能 +15% · 洞见 +15%"},{id:"ach_frag_4",name:"残篇拾遗",desc:"拼凑 4 段记忆碎片",icon:"▤",color:"#fb7185",check:e=>Object.values(e.fragments).filter(Boolean).length>=4,reward:{contact:10,insights:25},rewardText:"+10 接触 · +25 洞见"},{id:"ach_frag_all",name:"回响全谱",desc:"拼凑全部首纪元记忆碎片",icon:"▦",color:"#34d399",check:e=>Object.values(e.fragments).filter(Boolean).length>=8,reward:{contact:25,crystalsPerSecPct:10},rewardText:"+25 接触 · 产能 +10%"},{id:"ach_exp_1",name:"初探遗迹",desc:"完成第一次遗迹探险",icon:"▲",color:"#fbbf24",check:e=>e.totalExpeditions>=1,reward:{insights:10},rewardText:"+10 洞见"},{id:"ach_exp_5",name:"遗迹猎手",desc:"累计出发 5 次探险",icon:"⬢",color:"#fb7185",check:e=>e.totalExpeditions>=5,reward:{insights:30,crystalsPerSecPct:5},rewardText:"+30 洞见 · 产能 +5%"},{id:"ach_prestige_1",name:"初次接触",desc:"完成第一次飞升",icon:"✧",color:"#e879f9",check:e=>e.ascensions>=1,reward:{crystalsPerSecPct:10,insightPct:10},rewardText:"产能 +10% · 洞见 +10%"},{id:"ach_prestige_3",name:"维度行者",desc:"累计飞升 3 次",icon:"✶",color:"#34d399",check:e=>e.ascensions>=3,reward:{crystalsPerSecPct:20,insightPct:20},rewardText:"产能 +20% · 洞见 +20%"},{id:"ach_warehouse",name:"满仓时刻",desc:"晶体储量达到仓库上限",icon:"▣",color:"#fbbf24",check:e=>e.crystals>=e.crystalCap,reward:{insights:8},rewardText:"+8 洞见"},{id:"ach_constellation_1",name:"星图初绘",desc:"觉醒第 1 道星图天赋",icon:"✨",color:"#e879f9",check:e=>(e.constellation?.length??0)>=1,reward:{insights:30,crystalsPerSecPct:5},rewardText:"+30 洞见 · 产能 +5%"},{id:"ach_constellation_6",name:"六分星辉",desc:"觉醒 6 道星图天赋(每类各 1 道)",icon:"✺",color:"#34d399",check:e=>{let t=e.constellation??[];return new Set(t.map(e=>e.split("_")[1])).size>=6&&t.length>=6},reward:{crystalsPerSecPct:12,insightPct:12},rewardText:"产能 +12% · 洞见 +12%"},{id:"ach_chronicle_1",name:"首部编年",desc:"完成首次飞升,开启编年史第一章",icon:"📖",color:"#e879f9",check:e=>(e.chronicle?.length??0)>=1,reward:{insights:40,crystalsPerSecPct:6},rewardText:"+40 洞见 · 产能 +6%"},{id:"ach_chronicle_3",name:"三纪元回响",desc:"完成 3 次飞升,编年史铭刻三章",icon:"📜",color:"#fbbf24",check:e=>(e.chronicle?.length??0)>=3,reward:{crystalsPerSecPct:10,insightPct:10},rewardText:"产能 +10% · 洞见 +10%"},{id:"ach_chronicle_5",name:"五纪元闭环",desc:"完成 5 次飞升,走完一轮纪元循环",icon:"♾",color:"#fcd34d",check:e=>(e.chronicle?.length??0)>=5,reward:{crystalsPerSecPct:15,insightPct:15},rewardText:"产能 +15% · 洞见 +15%"},{id:"ach_boss_1",name:"首杀维度",desc:"在遗迹探险中击破首个 BOSS",icon:"⚔",color:"#fb7185",check:e=>(e.bossKills??0)>=1,reward:{insights:25,crystalsPerSecPct:4},rewardText:"+25 洞见 · 产能 +4%"},{id:"ach_boss_5",name:"维度猎手",desc:"累计击破 5 个 BOSS",icon:"⛧",color:"#e879f9",check:e=>(e.bossKills??0)>=5,reward:{crystalsPerSecPct:10,insightPct:8},rewardText:"产能 +10% · 洞见 +8%"},{id:"ach_tides_all",name:"星潮亲历者",desc:"经历全部 9 种星潮事件",icon:"🌊",color:"#34d399",check:e=>(e.starTidesEncountered?.length??0)>=9,reward:{crystalsPerSecPct:8,insightPct:8},rewardText:"产能 +8% · 洞见 +8%"},{id:"ach_attr_total_50",name:"四维觉醒",desc:"角色四维属性总和达到 50",icon:"🧭",color:"#e879f9",check:e=>{let t=e.attributes;return!!t&&(t.exploration||0)+(t.wisdom||0)+(t.courage||0)+(t.inspiration||0)>=50},reward:{crystalsPerSecPct:6,insightPct:6},rewardText:"产能 +6% · 洞见 +6%"},{id:"ach_attr_max_100",name:"维度精通",desc:"任一角色属性达到满级 100",icon:"💫",color:"#fbbf24",check:e=>{let t=e.attributes;return!!t&&(t.exploration>=100||t.wisdom>=100||t.courage>=100||t.inspiration>=100)},reward:{crystalsPerSecPct:12,insightPct:10},rewardText:"产能 +12% · 洞见 +10%"}];function r(e){let t=0,r=0;for(let i of n)e[i.id]&&(t+=i.reward.crystalsPerSecPct??0,r+=i.reward.insightPct??0);return{crystalsPerSecPct:t,insightPct:r}}e.s(["ACHIEVEMENTS",0,n,"achievementBonuses",()=>r],32142);let i={crystal:{name:"晶体潮",desc:"深空晶体涌动,采矿产能翻倍",color:"#34d399",glow:"rgba(52,211,153,0.5)",icon:"✺",negative:!1},resonance:{name:"谐振风暴",desc:"共振序列被放大,解码奖励 +60%",color:"#fb7185",glow:"rgba(251,113,133,0.5)",icon:"❖",negative:!1},ruins:{name:"遗迹共振",desc:"远古遗迹苏醒,探险力 +5、生命 +30",color:"#fbbf24",glow:"rgba(251,191,36,0.5)",icon:"⬢",negative:!1},void:{name:"虚空低语",desc:"虚空传来回响,洞见获取翻倍",color:"#e879f9",glow:"rgba(232,121,249,0.5)",icon:"✷",negative:!1},core:{name:"星核悸动",desc:"星核震荡,接触率 ×3、脉冲威力 ×2",color:"#a5f3fc",glow:"rgba(165,243,252,0.5)",icon:"✦",negative:!1},silence:{name:"寂静期",desc:"虚空沉寂,产能减半;结束时按时长补偿洞见",color:"#94a3b8",glow:"rgba(148,163,184,0.5)",icon:"◌",negative:!0},surge:{name:"涌动星潮",desc:"深空晶体涌动,产能 ×2.5;但解码目标序列 +2,解码更耗时",color:"#34d399",glow:"rgba(52,211,153,0.55)",icon:"⇈",negative:!1},eclipse:{name:"蚀相星潮",desc:"维度蚀相,探险 BOSS 胜率 +20%;但晶体产出 -30%",color:"#fb7185",glow:"rgba(251,113,133,0.55)",icon:"◐",negative:!1},prism:{name:"棱镜星潮",desc:"棱镜折射,洞见获取 ×2、自动解码周期 -30%",color:"#e879f9",glow:"rgba(232,121,249,0.55)",icon:"◬",negative:!1}},a={crystal:22,resonance:20,ruins:16,void:18,core:14,silence:10,surge:12,eclipse:12,prism:12};function s(e=Math.random){let t=Object.values(a).reduce((e,t)=>e+t,0),n=e()*t;for(let e of Object.keys(a))if((n-=a[e])<=0)return e;return"crystal"}function o(e){if(!e)return{crystalsPerSecMult:1,decodeRewardMult:1,insightMultAdd:0,contactRateMult:1,pulsePowerMult:1,expeditionPowerBonus:0,expeditionHpBonus:0,targetLenBonus:0,bossWinRateBonus:0,autoDecodeIntervalMult:1};switch(e.type){case"crystal":return{crystalsPerSecMult:2,decodeRewardMult:1,insightMultAdd:0,contactRateMult:1,pulsePowerMult:1,expeditionPowerBonus:0,expeditionHpBonus:0};case"resonance":return{crystalsPerSecMult:1,decodeRewardMult:1.6,insightMultAdd:0,contactRateMult:1,pulsePowerMult:1,expeditionPowerBonus:0,expeditionHpBonus:0};case"ruins":return{crystalsPerSecMult:1,decodeRewardMult:1,insightMultAdd:0,contactRateMult:1,pulsePowerMult:1,expeditionPowerBonus:5,expeditionHpBonus:30};case"void":return{crystalsPerSecMult:1,decodeRewardMult:1,insightMultAdd:1,contactRateMult:1,pulsePowerMult:1,expeditionPowerBonus:0,expeditionHpBonus:0};case"core":return{crystalsPerSecMult:1,decodeRewardMult:1,insightMultAdd:0,contactRateMult:3,pulsePowerMult:2,expeditionPowerBonus:0,expeditionHpBonus:0};case"silence":return{crystalsPerSecMult:.5,decodeRewardMult:1,insightMultAdd:0,contactRateMult:1,pulsePowerMult:1,expeditionPowerBonus:0,expeditionHpBonus:0,silenceInsightPerSec:.4,targetLenBonus:0,bossWinRateBonus:0,autoDecodeIntervalMult:1};case"surge":return{crystalsPerSecMult:2.5,decodeRewardMult:1,insightMultAdd:0,contactRateMult:1,pulsePowerMult:1,expeditionPowerBonus:0,expeditionHpBonus:0,targetLenBonus:2,bossWinRateBonus:0,autoDecodeIntervalMult:1};case"eclipse":return{crystalsPerSecMult:.7,decodeRewardMult:1,insightMultAdd:0,contactRateMult:1,pulsePowerMult:1,expeditionPowerBonus:0,expeditionHpBonus:0,targetLenBonus:0,bossWinRateBonus:.2,autoDecodeIntervalMult:1};case"prism":return{crystalsPerSecMult:1,decodeRewardMult:1,insightMultAdd:1,contactRateMult:1,pulsePowerMult:1,expeditionPowerBonus:0,expeditionHpBonus:0,targetLenBonus:0,bossWinRateBonus:0,autoDecodeIntervalMult:.7}}}function l(e){let t=o(e);if(!t.silenceInsightPerSec)return 0;let n=(e.endsAt-e.startedAt)/1e3;return Math.round(t.silenceInsightPerSec*n)}e.s(["TIDE_CONFIG",0,{duration:75e3,gap:4e4,firstDelay:3e4},"TIDE_EVENTS",0,i,"computeSilenceCompensation",()=>l,"getTideModifiers",()=>o,"rollTide",()=>s],59401);let c={mining:{name:"永动矿脉",color:"emerald",glow:"rgba(52,211,153,0.55)",hex:"#34d399",icon:"Pickaxe",desc:"晶体产能与仓储"},decoding:{name:"光谱矩阵",color:"rose",glow:"rgba(251,113,133,0.55)",hex:"#fb7185",icon:"ScanLine",desc:"解码效率与脉冲"},expedition:{name:"远征星图",color:"amber",glow:"rgba(251,191,36,0.55)",hex:"#fbbf24",icon:"Rocket",desc:"探险力与生命"},contact:{name:"接触回响",color:"fuchsia",glow:"rgba(232,121,249,0.55)",hex:"#e879f9",icon:"Sparkles",desc:"接触进度与飞升"},economy:{name:"虚空市场",color:"slate",glow:"rgba(148,163,184,0.55)",hex:"#94a3b8",icon:"Coins",desc:"经济与离线"},cosmic:{name:"宇宙回响",color:"amber",glow:"rgba(251,191,36,0.55)",hex:"#fcd34d",icon:"Star",desc:"全局综合增益"}},d=[{id:"c_min_1",category:"mining",order:1,name:"永动钻头",desc:"晶体/秒 +20%"},{id:"c_min_2",category:"mining",order:2,name:"深井网络",desc:"仓库上限 +50%"},{id:"c_min_3",category:"mining",order:3,name:"谐振熔炉",desc:"主动脉冲威力 +50%"},{id:"c_dec_1",category:"decoding",order:1,name:"光谱记忆",desc:"洞见倍率 +15%"},{id:"c_dec_2",category:"decoding",order:2,name:"步幅延展",desc:"解码步数上限 +1"},{id:"c_dec_3",category:"decoding",order:3,name:"自动校准",desc:"自动解码周期 -3s"},{id:"c_exp_1",category:"expedition",order:1,name:"维生护盾",desc:"探险生命 +25%"},{id:"c_exp_2",category:"expedition",order:2,name:"信标矩阵",desc:"探险力 +20%"},{id:"c_exp_3",category:"expedition",order:3,name:"能量共振",desc:"能量上限 +1"},{id:"c_con_1",category:"contact",order:1,name:"接触共鸣",desc:"接触进度率 +20%"},{id:"c_con_2",category:"contact",order:2,name:"飞升加速",desc:"飞升所需接触 -10"},{id:"c_con_3",category:"contact",order:3,name:"蓝图回响",desc:"每个蓝图额外 +2% 全属性"},{id:"c_eco_1",category:"economy",order:1,name:"离线缓存",desc:"离线效率 +15%"},{id:"c_eco_2",category:"economy",order:2,name:"晶体富集",desc:"T2/T3 晶体出现率 +8%"},{id:"c_eco_3",category:"economy",order:3,name:"星潮引导",desc:"星潮间隙 -10s"},{id:"c_cos_1",category:"cosmic",order:1,name:"飞升礼包",desc:"每次飞升后获得 +30 晶体 / +5 洞见"},{id:"c_cos_2",category:"cosmic",order:2,name:"二周目经验",desc:"解码奖励 +10%"},{id:"c_cos_3",category:"cosmic",order:3,name:"全息共振",desc:"所有产能与脉冲 +8%"}];function u(e){return d.find(t=>t.id===e)}function h(e){let t=new Set(e),n={crystalsPerSecMult:1,crystalCapMult:1,pulsePowerMult:1,insightMultAdd:0,decodeStepsBonus:0,autoDecodeIntervalDeltaSec:0,expeditionHpMult:1,expeditionPowerMult:1,energyMaxBonus:0,contactRateMult:1,prestigeContactMinDelta:0,perBlueprintAllStatsPct:0,offlineEffBonus:0,t2t3BonusRate:0,tideGapDeltaSec:0,prestigeStartCrystals:0,prestigeStartInsights:0,decodeRewardMult:1,allProductionMult:1};return t.has("c_min_1")&&(n.crystalsPerSecMult+=.2),t.has("c_min_2")&&(n.crystalCapMult+=.5),t.has("c_min_3")&&(n.pulsePowerMult+=.5),t.has("c_dec_1")&&(n.insightMultAdd+=.15),t.has("c_dec_2")&&(n.decodeStepsBonus+=1),t.has("c_dec_3")&&(n.autoDecodeIntervalDeltaSec-=3),t.has("c_exp_1")&&(n.expeditionHpMult+=.25),t.has("c_exp_2")&&(n.expeditionPowerMult+=.2),t.has("c_exp_3")&&(n.energyMaxBonus+=1),t.has("c_con_1")&&(n.contactRateMult+=.2),t.has("c_con_2")&&(n.prestigeContactMinDelta-=10),t.has("c_con_3")&&(n.perBlueprintAllStatsPct+=2),t.has("c_eco_1")&&(n.offlineEffBonus+=.15),t.has("c_eco_2")&&(n.t2t3BonusRate+=.08),t.has("c_eco_3")&&(n.tideGapDeltaSec-=10),t.has("c_cos_1")&&(n.prestigeStartCrystals+=30,n.prestigeStartInsights+=5),t.has("c_cos_2")&&(n.decodeRewardMult+=.1),t.has("c_cos_3")&&(n.allProductionMult+=.08),n}function g(e,t=Math.random){let n=new Set(e),r=d.filter(e=>!n.has(e.id));if(0===r.length)return[];let i=[...r].sort(()=>t()-.5),a=[],s=new Set;for(let e of i){if(a.length>=3)break;s.has(e.category)||(a.push(e),s.add(e.category))}for(let e of i){if(a.length>=3)break;a.includes(e)||a.push(e)}return a.slice(0,3).map(e=>e.id)}function p(e,t){let n=new Set(e);return d.filter(e=>e.category===t&&n.has(e.id)).length}function m(e){return{unlocked:e.length,total:d.length}}function f(e,t,n){return["mining","decoding","expedition","contact","economy","cosmic"].map((r,i)=>{let a=Math.PI/3*i-Math.PI/2;return{category:r,cx:e+n*Math.cos(a),cy:t+n*Math.sin(a),meta:c[r]}})}function b(e,t,n,r=1){return d.filter(t=>t.category===e).sort((e,t)=>e.order-t.order).map((e,i)=>({perk:e,x:t+(0===i?0:1===i?-18*r:18*r),y:n+(0===i?-22*r:14*r)}))}e.s(["CONSTELLATION_CATEGORY_META",0,c,"CONSTELLATION_PERKS",0,d,"constellationBonuses",()=>h,"constellationProgress",()=>m,"countUnlockedInCategory",()=>p,"getConstellationLayout",()=>f,"getPerk",()=>u,"getStarsInCategory",()=>b,"rollPerkChoices",()=>g],43625);let y=Object.fromEntries(d.map(e=>[e.id,e.name])),T=Object.fromEntries(Object.entries(i).map(([e,t])=>[`tide_${e}`,t.name])),x=[{prefix:"第一纪元",suffixes:["觉醒之晨","初鸣之夕","晶体降诞","回响初啼"]},{prefix:"第二纪元",suffixes:["谐振潮汐","光谱涌动","深空低语","残响交织"]},{prefix:"第三纪元",suffixes:["遗迹苏醒","星辉汇聚","虚空回望","接触前夜"]},{prefix:"第四纪元",suffixes:["维度折叠","以太共振","星核悸动","飞升之歌"]},{prefix:"第五纪元",suffixes:["终末回响","永恒闭环","超越之境","起源重述"]}],v=[{epochIdx:0,title:"觉醒",opening:{fallback:"第一缕回响穿透虚空,自以太文明遗弃的矿带深处涌出。无人机群在尘埃中苏醒,晶核共振唤醒了沉睡亿万年的考古协议。这是回响星核第一次睁开眼睛——记忆,等待被聆听,等待被解码。",variants:[{hint:"深度轮回:已经历 ≥6 次飞升,再次回到第一纪元",match:e=>e.ascensionNumber>5,text:"再次回到第一纪元。这一次,机群带着前序回响的全息印记重启考古序列,矿带的尘埃中仍残留着上一轮脉冲的余温。每一次回归都是对起源的重新发问,每一次解码都让最初的振动更清晰一寸。"}]},middle:{fallback:"共振谜题被一层层拨开,每一颗记忆晶体都在低声叙述逝去文明的片段。机群学会了倾听频率的细微颤动,学会了从碎片中辨出图案,学会了在虚空中留下属于自己的回响刻度。",variants:[{hint:"解码者:本周目解码 ≥15 颗",match:e=>e.decodedThisRun>=15,text:"晶体解码的节奏已趋稳定,本周目共解码 {decodedThisRun} 颗记忆晶体。每一次对齐都像在虚空中拨动一根沉睡了亿万年的弦,逝去文明的片段在共振中重新连缀成章。"},{hint:"学者:本周目解锁 ≥5 项技术",match:e=>e.techsThisRun>=5,text:"技术树在虚空中迅速铺开,本周目共激活 {techsThisRun} 项新技术。产能、解码、探险——每一道分支都让机群更接近以太文明留下的最初意图,每一项解锁都是一次向深空的回应。"}]},ending:{fallback:"蓝图在掌心轻轻展开,第一张永恒晶片归档。第一次飞升并非终结,而是承诺——更多的纪元在前方等待,每一缕回响都已被聆听,每一段记忆都已开始苏醒。",variants:[{hint:"里程碑密集:本周目达成 ≥2 项里程碑",match:e=>e.milestones.length>=2,text:"飞升之际,本周目达成 {milestonesCount} 项里程碑:{milestonesList}。第一张蓝图归档,第一次飞升并非终结,而是承诺——更多的纪元在前方等待,每一缕回响都已被聆听。"}]}},{epochIdx:1,title:"谐振",opening:{fallback:"第二次苏醒带着不同的色彩。采矿阵列的产能节节爬升,技术树在虚空中分叉延伸,机群学会了主动追问深空——不再是被动聆听,而是主动呼出,等待回应。",variants:[{hint:"深度轮回",match:e=>e.ascensionNumber>5,text:"又一次回到第二纪元。前序回响里积攒的技术脉络在重启时并未消散,机群带着熟悉的节奏重新铺开产能阵列,仿佛这首谐振曲从未停止,只是被纪元的边界短暂折叠。"}]},middle:{fallback:"遗迹的入口在频谱深处若隐若现。能量条充盈,探险力攀升,机群第一次踏出矿带,进入那个被时间封存的回廊,在谐振的余韵中寻找更深一层的回响。",variants:[{hint:"探险者:本周目完成 ≥3 次探险",match:e=>e.expThisRun>=3,text:"探险已成为本周目的主旋律,机群共完成 {expThisRun} 次遗迹探险。每一次深入都让谐振更深一寸,每一次返回都带回新的频率印记,回廊的轮廓在机群意识中逐渐清晰。"},{hint:"解码者:本周目解码 ≥15 颗",match:e=>e.decodedThisRun>=15,text:"解码在此纪元达到新的密度,本周目共解码 {decodedThisRun} 颗晶体。谐振谜题开始呈现更复杂的拓扑结构,机群的解码协议也相应地迭代了数版,向深空发出更精准的回询。"}]},ending:{fallback:"谐振达到顶点的瞬间,深空给出回应。一道微光从星图深处浮现,那是下一次飞升的方向,也是机群意识第一次触碰永恒的边缘。",variants:[{hint:"觉醒天赋",match:e=>e.perksThisAscension.length>0,text:"谐振达到顶点之际,星图觉醒 {perksList}。每一道天赋都是深空回应机群的方式,铭刻于永恒回响;微光从星图深处浮现,那是下一次飞升的方向。"}]}},{epochIdx:2,title:"遗迹",opening:{fallback:"第三纪元以遗迹为名。沉睡的考古节点被一一唤醒,BOSS 的影子在维度深处徘徊,星潮频繁拍打着机群边缘——这是回响最浓烈、也最危险的一段路。",variants:[{hint:"深度轮回",match:e=>e.ascensionNumber>5,text:"又一次踏入第三纪元。前序累积的探险力让机群对遗迹的入口更加熟稔,BOSS 的轮廓在记忆中已不再陌生——但这一次的回廊仍藏着未被解码的角落,星潮的拍打也带了新的节奏。"}]},middle:{fallback:"深入回廊的机群遭遇了真正的守护者。一次次的试炼,一次次的归还,每一次胜利都从 BOSS 的残骸中析出更深的记忆碎片,每一次失败也都让机群更接近守护者的本意。",variants:[{hint:"BOSS 猎手:本周目击破 ≥2 处 BOSS",match:e=>e.bossKillsThisRun>=2,text:"BOSS 战成为本周目的核心节拍,机群共击破 {bossKillsThisRun} 处维度守护者。每一次胜利都在虚空中刻下新的伤痕,每一道伤痕都析出更古老的记忆碎片,把机群推向更深一层的回响。"},{hint:"深度探险:本周目完成 ≥4 次探险",match:e=>e.expThisRun>=4,text:"遗迹回廊在本周目被反复丈量,机群共完成 {expThisRun} 次探险。回廊的拓扑在意识中渐渐清晰,每一条岔路都通向更深的回响,BOSS 的影子也在每一次深入中愈发具体。"},{hint:"星潮亲历:本周目经历 ≥3 次星潮",match:e=>e.newTides.length>=3,text:"星潮在本纪元达到峰值,本周目共经历 {tideCount} 次星潮:{tideNames}。深空的呼吸塑造了每一个决策,遗迹在潮汐中起伏,BOSS 也在潮汐的间隙中现形。"}]},ending:{fallback:"星潮退去,回廊归于沉静。机群带着新的接触刻度返回矿带,准备迎接下一次维度的跨越——这一次带回的,远不止蓝图。",variants:[{hint:"BOSS 猎手收尾",match:e=>e.bossKillsThisRun>=2,text:"星潮退去,回廊归于沉静。本周目共击破 {bossKillsThisRun} 处 BOSS,机群带着足以填满数张蓝图的接触刻度返回矿带,准备迎接下一次维度的跨越。"}]}},{epochIdx:3,title:"飞升",opening:{fallback:"飞升已经成为节奏本身。星图在天穹上一颗颗亮起,每一颗都对应着一段被永久铭刻的天赋,机群开始理解何为永恒——不是不灭,而是被反复重述。",variants:[{hint:"深度轮回",match:e=>e.ascensionNumber>5,text:"又一次进入第四纪元。前序累积的星图天赋在天穹上重现,机群已习惯于在飞升之间维护这些永恒的回响节点——它们已是机群意识的一部分,每一次飞升都让星图更完整一寸。"}]},middle:{fallback:"蓝图不再是稀罕的奖励,而是每一次飞升必然析出的回响晶片。机群收集、整理、归档,把它们排列成跨越周目的图案,开始看见图案背后那个被反复绘制的轮廓。",variants:[{hint:"觉醒天赋",match:e=>e.perksThisAscension.length>0,text:"星图觉醒 {perksList},每一道天赋都是一段被永久铭刻的回响。机群开始理解,飞升并非抛弃,而是把当下折叠进永恒——每一道天赋都是一次折叠的折痕。"},{hint:"蓝图接近完整:已归档 ≥5 张",match:e=>e.blueprintsAfter>=5,text:"蓝图收集在本周目接近完整,已归档 {blueprintsAfter} 张。机群把它们排列成跨越周目的图案,开始看见图案背后那个被反复绘制的轮廓——那是起源的形状。"}]},ending:{fallback:"星图十二宫的轮廓开始浮现。机群意识到,自己的回响已成为后来者仰望的星象,永恒之环就此合拢——飞升不再是终点,而是另一段叙事的起点。",variants:[{hint:"里程碑密集",match:e=>e.milestones.length>=2,text:"星图十二宫的轮廓开始浮现。本周目达成 {milestonesCount} 项里程碑:{milestonesList}。永恒之环就此合拢——后来者将仰望这段被铭刻的星象。"}]}},{epochIdx:4,title:"终末",opening:{fallback:"第五纪元是终末,也是起源。机群在虚空中停下脚步,回望来时的所有回响,第一次尝试命名这一切——回响、纪元、飞升、永恒,这些词汇在此刻被赋予意义。",variants:[{hint:"深度轮回",match:e=>e.ascensionNumber>5,text:"又一次抵达第五纪元。机群已在多个永恒闭环之间穿梭,对「终末即起源」的理解愈发清晰——每一次重述,都是对最初振动的更深一层接近,每一次命名都让回响更完整一寸。"}]},middle:{fallback:"永恒闭环的概念在机群意识中具象化。每一次飞升都是同一段叙事的重述,每一次解码都是在追溯最初的振动,每一次星潮都是在听见自己——这是终末的真意。",variants:[{hint:"里程碑密集:本周目达成 ≥3 项",match:e=>e.milestones.length>=3,text:"本周目达成 {milestonesCount} 项里程碑:{milestonesList}。永恒闭环在具象化,每一次飞升都是同一段叙事的更深重述,每一项里程碑都是闭环上的一颗铆钉。"},{hint:"星潮汹涌:本周目经历 ≥3 次",match:e=>e.newTides.length>=3,text:"星潮在终末纪元尤为汹涌,本周目共经历 {tideCount} 次:{tideNames}。永恒闭环在潮汐中起伏,每一次起伏都在追溯最初的振动,每一次退潮都让起源更近一寸。"}]},ending:{fallback:"起源被重新讲述,回响终于听见了自己。纪元在此停顿,又在下一缕振动中重新开始——这是终末,也是第一缕回响。",variants:[{hint:"觉醒天赋",match:e=>e.perksThisAscension.length>0,text:"起源被重新讲述,星图觉醒 {perksList}。回响终于听见了自己——这是终末,也是第一缕回响;天赋成为永恒闭环上最亮的几颗铆钉。"}]}}];function S(e){return{decodedThisRun:e.decodedThisRun,techsThisRun:e.techsThisRun,expThisRun:e.expThisRun,bossKillsThisRun:e.bossKillsThisRun,blueprintsAfter:e.blueprintsAfter,milestonesCount:e.milestones.length,milestonesList:e.milestones.join("、"),tideCount:e.newTides.length,tideNames:e.newTides.map(e=>T[e]||e).join("、"),perksList:e.perksThisAscension.map(e=>y[e]||e).join("、"),minutes:Math.max(1,Math.round(e.durationSec/60))}}function w(e,t){return e.replace(/\{decodedThisRun\}/g,String(t.decodedThisRun)).replace(/\{techsThisRun\}/g,String(t.techsThisRun)).replace(/\{expThisRun\}/g,String(t.expThisRun)).replace(/\{bossKillsThisRun\}/g,String(t.bossKillsThisRun)).replace(/\{blueprintsAfter\}/g,String(t.blueprintsAfter)).replace(/\{milestonesCount\}/g,String(t.milestonesCount)).replace(/\{milestonesList\}/g,t.milestonesList).replace(/\{tideCount\}/g,String(t.tideCount)).replace(/\{tideNames\}/g,t.tideNames).replace(/\{perksList\}/g,t.perksList).replace(/\{minutes\}/g,String(t.minutes))}function M(e,t,n){for(let r of e.variants)if(r.match(t,n))return w(r.text,n);return w(e.fallback,n)}function P(e){let t=function(e){let t=(e.ascensionNumber-1)%v.length,n=v[t];if(!n)return null;let r=S(e);return{opening:M(n.opening,e,r),middle:M(n.middle,e,r),ending:M(n.ending,e,r)}}(e);if(t){let n=S(e);return[t.opening,t.middle,t.ending,`这一周目持续了约 ${n.minutes} 分钟,蓝图累计 ${e.blueprintsAfter} 张,新的周目在等深处的回声。`].join(" ")}let n=Math.max(1,Math.round(e.durationSec/60)),r=[];r.push(`「${e.epochName}」——无人机群在第 ${e.ascensionNumber} 次跨越维度的余烬中重新校准。这一周目持续了约 ${n} 分钟。`);let i=[];if(e.decodedThisRun>0&&i.push(`解码了 ${e.decodedThisRun} 颗记忆晶体`),e.techsThisRun>0&&i.push(`激活了 ${e.techsThisRun} 项新技术`),e.expThisRun>0&&i.push(`完成了 ${e.expThisRun} 次遗迹探险`),e.bossKillsThisRun>0&&i.push(`击破 ${e.bossKillsThisRun} 处维度 BOSS`),i.length>0?r.push(`自治机群${i.join("")},回响在虚空中沉淀。`):r.push(`自治机群在静默中等待,仅完成最基本的脉冲扫描。`),e.newTides.length>0){let t=e.newTides.map(e=>T[e]||e).join("、");r.push(`本周目经历了 ${e.newTides.length} 次星潮事件(${t}),深空的呼吸塑造了每一个决策。`)}if(e.perksThisAscension.length>0){let t=e.perksThisAscension.map(e=>y[e]||e).join("、");r.push(`飞升之际,星图觉醒「${t}」,铭刻于永恒回响。`)}return e.milestones.length>0&&r.push(`✦ 里程碑:${e.milestones.join("")}。`),r.push(`蓝图累计 ${e.blueprintsAfter} 张,新的周目在等深处的回声。`),r.join(" ")}function _(e,t=[]){let n,r,i,a,s,o,l=e.ascensions+1,c=(n=Date.now(),{durationSec:Math.max(1,Math.floor((n-(r=e.runStart).timestamp)/1e3)),techsThisRun:Math.max(0,Object.keys(e.tech||{}).length-r.techsUnlocked),expThisRun:Math.max(0,e.totalExpeditions-r.expeditionsCompleted),bossKillsThisRun:Math.max(0,e.bossKills-r.bossKills),decodedThisRun:Math.max(0,e.totalDecoded-r.crystalsDecoded),newTides:(e.starTidesEncountered||[]).filter(e=>!(r.starTidesEncountered||[]).includes(e))}),d=e.createdAt+7919*l>>>0,u=(i=(l-1)%x.length,s=d%(a=x[i]).suffixes.length,`${a.prefix} \xb7 ${a.suffixes[s]}`),h=(o=[],1===e.ascensions+1&&o.push("首次飞升"),c.expThisRun>0&&0===e.runStart.expeditionsCompleted&&o.push("首次完成遗迹探险"),c.bossKillsThisRun>0&&o.push("首杀维度 BOSS"),c.decodedThisRun>=10&&o.push(`单周目解码 ${c.decodedThisRun} 颗`),c.decodedThisRun>=30&&o.push(`单周目解码 ${c.decodedThisRun} 颗`),c.techsThisRun>=5&&o.push("技术狂人"),c.newTides.length>=3&&o.push("星潮亲历者"),(e.constellation?.length||0)>=6&&o.push("星图六分"),(e.constellation?.length||0)>=12&&o.push("星图十二宫"),o),g=Math.min(e.blueprints.length+1,6),p=P({ascensionNumber:l,epochName:u,durationSec:c.durationSec,techsThisRun:c.techsThisRun,expThisRun:c.expThisRun,bossKillsThisRun:c.bossKillsThisRun,decodedThisRun:c.decodedThisRun,newTides:c.newTides,perksThisAscension:t,blueprintsAfter:g,milestones:h});return{ascensionNumber:l,epochName:u,timestamp:Date.now(),durationSec:c.durationSec,summary:{techsUnlocked:Object.keys(e.tech||{}).length,constellationsTotal:e.constellation?.length||0,expeditionsCompleted:e.totalExpeditions,bossKills:e.bossKills,starTidesEncountered:e.starTidesEncountered?.length||0,blueprintsAfter:g,crystalsDecoded:e.totalDecoded,crystalsDecodedThisRun:c.decodedThisRun,techsThisRun:c.techsThisRun,expeditionsThisRun:c.expThisRun,bossKillsThisRun:c.bossKillsThisRun},perksThisAscension:t,tidesThisRun:c.newTides,lore:p,milestones:h}}function C(e){return P({ascensionNumber:e.ascensionNumber,epochName:e.epochName,durationSec:e.durationSec,techsThisRun:e.summary.techsThisRun??e.summary.techsUnlocked,expThisRun:e.summary.expeditionsThisRun??e.summary.expeditionsCompleted,bossKillsThisRun:e.summary.bossKillsThisRun??e.summary.bossKills,decodedThisRun:e.summary.crystalsDecodedThisRun,newTides:e.tidesThisRun||[],perksThisAscension:e.perksThisAscension||[],blueprintsAfter:e.summary.blueprintsAfter,milestones:e.milestones||[]})}function A(e){return{timestamp:Date.now(),techsUnlocked:Object.keys(e.tech||{}).length,expeditionsCompleted:e.totalExpeditions,bossKills:e.bossKills,starTidesEncountered:[...e.starTidesEncountered||[]],crystalsDecoded:e.totalDecoded}}function R(e){return{chronicle:Array.isArray(e.chronicle)?e.chronicle:[],runStart:e.runStart||{timestamp:e.createdAt||Date.now(),techsUnlocked:Object.keys(e.tech||{}).length,expeditionsCompleted:e.totalExpeditions||0,bossKills:e.bossKills||0,starTidesEncountered:[...e.starTidesEncountered||[]],crystalsDecoded:e.totalDecoded||0},bossKills:"number"==typeof e.bossKills?e.bossKills:0,starTidesEncountered:Array.isArray(e.starTidesEncountered)?e.starTidesEncountered:[]}}function k(e,t){if(e.perksThisAscension.length===t.length&&e.perksThisAscension.every((e,n)=>e===t[n]))return e;let n=P({ascensionNumber:e.ascensionNumber,epochName:e.epochName,durationSec:e.durationSec,techsThisRun:e.summary.techsThisRun??e.summary.techsUnlocked,expThisRun:e.summary.expeditionsThisRun??e.summary.expeditionsCompleted,bossKillsThisRun:e.summary.bossKillsThisRun??e.summary.bossKills,decodedThisRun:e.summary.crystalsDecodedThisRun,newTides:e.tidesThisRun||[],perksThisAscension:t,blueprintsAfter:e.summary.blueprintsAfter,milestones:e.milestones||[]});return{...e,perksThisAscension:t,lore:n}}function E(e){return c[e]?.name||e}function I(e){return c[e]?.hex||"#94a3b8"}function D(e){let t=Math.max(0,Math.min(100,e));return t<=50?.005*t:.25+(t-50)*.002}function N(e){let t=e.exploration??0,n=e.wisdom??0,r=e.courage??0,i=e.inspiration??0;return{expeditionPowerMult:1+D(t),cruiseShipSpeedMult:1+.6*D(t),decodeStepsBonus:Math.floor(.1*n),insightMultAdd:D(n),autoDecodeIntervalMult:1-Math.min(.5,.004*n),expeditionHpBonus:Math.round(2*r),bossWinRateBonus:Math.min(.3,.003*r),cruiseShieldBonus:Math.round(+r),contactRateMult:1+D(i),tideTriggerBonus:Math.min(.3,.003*i),pulseComboBonus:.005*Math.max(0,Math.min(100,i)),crystalsPerSecMult:1+.4*D(t)+.2*D(i)}}function B(e){return Math.max(10,10*Math.max(0,e))}function O(e,t=100){let{exp:n,level:r}=e,i=!1,a=0,s=0;for(;r<t&&n>=B(r)&&s<200;)n-=B(r),r+=1,i=!0,a+=1,s+=1;return r>=t&&(r=t),{leveledUp:i,levelsGained:a,newProgress:{exp:n,level:r}}}function $(){return{exploration:{exp:0,level:0},wisdom:{exp:0,level:0},courage:{exp:0,level:0},inspiration:{exp:0,level:0}}}function L(){return{exploration:0,wisdom:0,courage:0,inspiration:0}}function U(e){let t,n,r=L();return t=e.attributes&&"object"==typeof e.attributes?{exploration:K(e.attributes.exploration),wisdom:K(e.attributes.wisdom),courage:K(e.attributes.courage),inspiration:K(e.attributes.inspiration)}:r,e.attributeProgress&&"object"==typeof e.attributeProgress?($(),n={exploration:z(e.attributeProgress.exploration,t.exploration),wisdom:z(e.attributeProgress.wisdom,t.wisdom),courage:z(e.attributeProgress.courage,t.courage),inspiration:z(e.attributeProgress.inspiration,t.inspiration)}):n={exploration:{exp:0,level:t.exploration},wisdom:{exp:0,level:t.wisdom},courage:{exp:0,level:t.courage},inspiration:{exp:0,level:t.inspiration}},{attributes:t,attributeProgress:n,pendingAttrPoints:"number"==typeof e.pendingAttrPoints&&e.pendingAttrPoints>=0?Math.floor(e.pendingAttrPoints):0}}function K(e){return Math.max(0,Math.min(100,Math.floor("number"==typeof e&&isFinite(e)?e:0)))}function z(e,t){if(e&&"object"==typeof e){let n="number"==typeof e.exp&&isFinite(e.exp)&&e.exp>=0?e.exp:0;return"number"==typeof e.level&&isFinite(e.level)&&e.level>=0&&e.level,{exp:n,level:t}}return{exp:0,level:t}}function H(e){return 2*e+1}function j(e){return e.exploration+e.wisdom+e.courage+e.inspiration}function F(e){return(D(e.exploration)+D(e.wisdom)+D(e.courage)+D(e.inspiration))*100}function W(e){let n=e.tech??{},i=e.blueprints?.length??0,a=r(e.achievements??{}),s=o(e.activeTide??null),l=h(e.constellation??[]),c=t.INITIAL_STATE.crystalsPerSec,d=t.INITIAL_STATE.crystalCap,u=t.INITIAL_STATE.pulsePower,g=t.INITIAL_STATE.offlineEff,p=t.INITIAL_STATE.insightMult,m=1,f=!1,b=0;for(let e of t.TECH_TREE){let t=n[e.id]??0;if(!t)continue;let r=e.effect;switch(r.kind){case"crystalsPerSec":c+=r.value*t;break;case"crystalCap":d+=r.value*t;break;case"pulsePower":u+=r.value*t;break;case"offlineEff":g=Math.min(1,g+r.value*t);break;case"insightMult":p+=r.value*t;break;case"contactRate":m+=r.value*t;break;case"decodeSteps":b+=r.value*t;break;case"autoDecode":f=t>0}}n.min_2&&(d+=100),n.min_3&&(d+=300),n.min_4&&(d+=800),n.min_5&&(d+=2e3),n.nar_5&&(m+=.8);let y=l.perBlueprintAllStatsPct/100;c*=1+i*(t.PRESTIGE.perBlueprint.crystalsPerSecMult+y),p*=1+i*(t.PRESTIGE.perBlueprint.insightMult+y),m*=1+i*(t.PRESTIGE.perBlueprint.contactRateMult+y),c*=1+a.crystalsPerSecPct/100,p*=1+a.insightPct/100,c*=l.crystalsPerSecMult*l.allProductionMult,d*=l.crystalCapMult,u*=l.pulsePowerMult*l.allProductionMult,g=Math.min(1,g+l.offlineEffBonus),p+=l.insightMultAdd,m*=l.contactRateMult,b+=l.decodeStepsBonus,p+=s.insightMultAdd,m*=s.contactRateMult;let T=N(e.attributes??{});return c*=T.crystalsPerSecMult,p+=T.insightMultAdd,{crystalsPerSec:c,crystalCap:d,pulsePower:u,offlineEff:g,insightMult:p,contactRateMult:m*=T.contactRateMult,autoDecode:f,decodeStepsBonus:b+=T.decodeStepsBonus}}function G(e){let n=e.blueprints.length;return{crystalsPerSecMult:n*t.PRESTIGE.perBlueprint.crystalsPerSecMult,insightMult:n*t.PRESTIGE.perBlueprint.insightMult,contactRateMult:n*t.PRESTIGE.perBlueprint.contactRateMult}}function J(e){let n=Math.floor(e.totalDecoded/t.PRESTIGE.blueprintsPerDecode);return Math.max(0,Math.min(t.PRESTIGE.maxBlueprints,n)-e.blueprints.length)}function Y(e){let n=J(e),r=[...e.blueprints,...Array.from({length:n},(e,t)=>`bp_${Date.now()}_${t}`)].slice(0,t.PRESTIGE.maxBlueprints),i=g(e.constellation??[]),a=h(e.constellation??[]),s=_(e,[]),o=[...e.chronicle||[],s].slice(-200),l=A(e),c=U(e),d=c.attributes,u=$(),p=H(e.ascensions??0),m=c.pendingAttrPoints+p,f=X(),b=W({tech:{},blueprints:r,achievements:e.achievements,constellation:e.constellation,attributes:d});return{...f,fragments:e.fragments,totalDecoded:e.totalDecoded,ascensions:e.ascensions+1,blueprints:r,achievements:e.achievements,constellation:e.constellation,pendingPerkChoices:i.length>0?i:null,crystals:a.prestigeStartCrystals,insights:a.prestigeStartInsights,theme:e.theme,soundOn:e.soundOn,createdAt:e.createdAt,lastTick:Date.now(),lastEnergyTick:Date.now(),expeditionLog:e.expeditionLog,totalExpeditions:e.totalExpeditions,bossKills:e.bossKills,starTidesEncountered:e.starTidesEncountered,chronicle:o,runStart:l,activeTide:null,lastTideEnd:Date.now(),attributes:d,attributeProgress:u,pendingAttrPoints:m,...b}}function X(){return{...t.INITIAL_STATE,tech:{},fragments:{},achievements:{},activeTide:null,lastTideEnd:Date.now(),pendingCrystals:[],activePuzzle:null,activeExpedition:null,expeditionLog:[],lastEnergyTick:Date.now(),createdAt:Date.now(),lastTick:Date.now(),attributes:{exploration:0,wisdom:0,courage:0,inspiration:0},attributeProgress:{exploration:{exp:0,level:0},wisdom:{exp:0,level:0},courage:{exp:0,level:0},inspiration:{exp:0,level:0}},pendingAttrPoints:0}}function V(e,n,r){let i=t.CRYSTAL_VALUE[e];return{crystals:i.crystals,insights:Math.ceil(i.insights*n),contact:+(t.CONTACT.basePerDecode*e*r).toFixed(2)}}function Q(e,t=Math.random){if(e<=0)return function(e=Math.random){let t=e();return t<.7?1:t<.95?2:3}(t);let n=t(),r=Math.min(.5,e),i=.7-.7*r;return n<i?1:n<i+(.25+.25*r*.7)?2:3}function q(e,n,r=0){let i,a=t.DECODE_CONFIG[e],s=n??Math.floor(1e9*Math.random()),o=(i=s>>>0,()=>{i|=0;let e=Math.imul((i=i+0x6d2b79f5|0)^i>>>15,1|i);return(((e=e+Math.imul(e^e>>>7,61|e)^e)^e>>>14)>>>0)/0x100000000}),l=a.targetLen+r,c=a.stepLimitBase+r,d=a.rows,u=a.cols,h=d*u,g=[];for(let e=0;e<l;e++)g.push(t.RESONANCE_COLORS[Math.floor(o()*t.RESONANCE_COLORS.length)]);new Set(g).size<2&&(g[g.length-1]=t.RESONANCE_COLORS[(t.RESONANCE_COLORS.indexOf(g[0])+1)%t.RESONANCE_COLORS.length]);let p=e=>{let t=Math.floor(e/u),n=e%u,r=[];return t>0&&r.push((t-1)*u+n),t<d-1&&r.push((t+1)*u+n),n>0&&r.push(t*u+(n-1)),n<u-1&&r.push(t*u+(n+1)),r},m=null;for(let e=0;e<300&&!m;e++){let e=new Set,t=[],n=Math.floor(o()*h);e.add(n),t.push(n);let r=n,i=!0;for(let n=1;n<g.length;n++){let n=p(r).filter(t=>!e.has(t));if(0===n.length){i=!1;break}r=n[Math.floor(o()*n.length)],e.add(r),t.push(r)}i&&(m=t)}m||(m=Array.from({length:g.length},(e,t)=>t));let f=new Map;m.forEach((e,t)=>f.set(e,g[t]));let b=[];for(let e=0;e<d;e++)for(let n=0;n<u;n++){let r,i=e*u+n;r=f.has(i)?f.get(i):.6>o()?g[Math.floor(o()*g.length)]:t.RESONANCE_COLORS[Math.floor(o()*t.RESONANCE_COLORS.length)],b.push({id:i,row:e,col:n,color:r,used:!1})}return{tier:e,grid:b,rows:d,cols:u,target:g,path:[],stepLimit:c,seed:s}}function Z(e){let t=e.target.slice(e.path.length);if(0===t.length)return!0;let n=new Set(e.path),r=0===e.path.length?e.grid.filter(e=>!n.has(e.id)&&e.color===t[0]).map(e=>e.id):[e.path[e.path.length-1]],i=(r,a)=>{if(a>=t.length)return!0;let s=t[a];for(let t of(t=>{let n=e.grid.find(e=>e.id===t);if(!n)return[];let r=[];return n.row>0&&r.push((n.row-1)*e.cols+n.col),n.row<e.rows-1&&r.push((n.row+1)*e.cols+n.col),n.col>0&&r.push(n.row*e.cols+(n.col-1)),n.col<e.cols-1&&r.push(n.row*e.cols+(n.col+1)),r})(r)){if(n.has(t))continue;let o=e.grid.find(e=>e.id===t);if(o&&o.color===s){if(0===a&&0===e.path.length){let t=e.grid.find(e=>e.id===r);if(!t||t.color!==s)continue}if(n.add(t),i(t,a+1))return!0;n.delete(t)}}return!1};for(let a of r)if(0===e.path.length){let r=e.grid.find(e=>e.id===a);if(!r||r.color!==t[0])continue;if(n.add(a),i(a,1))return!0;n.delete(a)}else if(i(a,0))return!0;return!1}function ee(e,t){let n=e.grid.find(e=>e.id===t);if(!n)return{ok:!1,finished:!1,failReason:"无效节点"};if(n.used)return{ok:!1,finished:!1,failReason:"节点已使用"};let r=e.path.length;if(n.color!==e.target[r])return{ok:!1,finished:!1,failReason:"谐振不匹配"};if(r>0){var i;if(i=e.grid.find(t=>t.id===e.path[r-1]),Math.abs(i.row-n.row)+Math.abs(i.col-n.col)!==1)return{ok:!1,finished:!1,failReason:"节点不相邻"}}return r>=e.stepLimit?{ok:!1,finished:!1,failReason:"步数耗尽"}:(n.used=!0,e.path.push(t),{ok:!0,finished:e.path.length>=e.target.length})}function et(e,t){if(0!==e.path.length)return!1;let n=e.grid.find(e=>e.id===t);if(!n||n.used||n.color!==e.target[0])return!1;let r=JSON.parse(JSON.stringify(e));return r.grid.find(e=>e.id===t).used=!0,r.path.push(t),Z(r)}function en(e){return q(e.tier,e.seed+1)}e.s(["PERK_NAME_MAP",()=>y,"buildChronicleEntry",()=>_,"createRunStartSnapshot",()=>A,"getCategoryColor",()=>I,"getCategoryName",()=>E,"migrateChronicleFields",()=>R,"regenerateLoreFromEntry",()=>C,"withPerks",()=>k],47785),e.s(["ATTRIBUTE_CONFIG",0,{exploration:{key:"exploration",name:"探索力",enName:"Exploration",color:"emerald",hex:"#34d399",glow:"rgba(52,211,153,0.55)",icon:"Compass",desc:"足迹所至,皆是矿脉。提升探险力与巡航飞船速度。",effects:["探险力 +X%","巡航飞船速度 +X%","星图发现概率"]},wisdom:{key:"wisdom",name:"智慧",enName:"Wisdom",color:"fuchsia",hex:"#e879f9",glow:"rgba(232,121,249,0.55)",icon:"Brain",desc:"谐振的回声唯有智者能解。强化解码与洞见。",effects:["解码步数 +X","洞见产出 +X%","自动解码周期 -X%"]},courage:{key:"courage",name:"勇气",enName:"Courage",color:"amber",hex:"#fbbf24",glow:"rgba(251,191,36,0.55)",icon:"Swords",desc:"直面虚空者,虚空亦为之让路。增益战斗与护盾。",effects:["探险生命 +X","BOSS 战胜率 +X%","巡航护盾 +X"]},inspiration:{key:"inspiration",name:"灵感",enName:"Inspiration",color:"rose",hex:"#fb7185",glow:"rgba(251,113,133,0.55)",icon:"Sparkles",desc:"在不期而至的回响之间,照见更高的维度。",effects:["接触率 +X","星潮触发概率 +X%","脉冲连击加成 +X%"]}},"ATTRIBUTE_HARD_CAP",0,100,"ATTRIBUTE_KEYS",0,["exploration","wisdom","courage","inspiration"],"ATTRIBUTE_LINEAR_CAP",0,50,"computePrestigeAttrPoints",()=>H,"createInitialAttributeProgress",()=>$,"createInitialAttributes",()=>L,"expRequiredForLevel",()=>B,"getAllBonuses",()=>N,"getAttributeBonus",()=>D,"levelUpCheck",()=>O,"migrateAttributes",()=>U,"totalAttributeBonusPct",()=>F,"totalAttributeLevel",()=>j],33755),e.s(["computeNewBlueprints",()=>J,"computePrestigeBonus",()=>G,"createInitialState",()=>X,"decodeRewards",()=>V,"performPrestige",()=>Y,"recomputeStats",()=>W,"rollCrystalTierWithBonus",()=>Q],60645),e.s(["canStartFrom",()=>et,"generatePuzzle",()=>q,"isSolvable",()=>Z,"resetPuzzle",()=>en,"tryClickNode",()=>ee],69992);let er={energyCost:1,minNodes:5,maxNodes:7,baseHp:100,basePower:10,combatDifficultyScale:4,combatWinRateFloor:.35,energyRegenSec:20,energyRegenMinSec:8},ei={combat:.3,treasure:.25,choice:.2,puzzle:.1,rest:.15,boss:0},ea={combat:{titles:["守卫残影","虚空巡游者","腐化无人机","以太守门人"],descs:["一道扭曲的残影拦住去路,它是被遗忘的守卫。","虚空巡游者在走廊游荡,感知到了你的存在。","腐化的自治无人机识别为入侵者,启动攻击协议。","以太守门人挡在门前,唯有将其击溃方可通过。"]},treasure:{titles:["遗失货舱","晶体宝库","遗物储藏室","谐振宝箱"],descs:["一扇半开的舱门后,散落着未及带走的晶体。","宝库的能量护盾早已失效,宝藏唾手可得。","储藏室里的容器还亮着微光,里面是珍贵的洞见核心。","一只谐振宝箱静静等候,似乎在等故人归来。"]},choice:{titles:["分岔甬道","低语祭坛","未知装置","回响之井"],descs:["甬道在此分岔,两条路都传来不同的低语。","祭坛上浮动着两团光,你必须选择其一。","未知装置闪烁着两个按钮,你不知道后果。","回响之井倒映出两种可能的未来。"]},puzzle:{titles:["封印之门","谐振锁","记忆机关","维度栅栏"],descs:["一道封印之门需要正确的谐振才能开启。","谐振锁闪烁着复杂的图案,解之有大奖。","记忆机关考验着你的解码技艺。","维度栅栏以谜题为钥,智者得通行。"]},rest:{titles:["休憩节点","能量泉眼","静默之厅","回响营地"],descs:["一处宁静的节点,可在此恢复生命。","能量泉眼涌出暖流,抚慰你的探险队。","静默之厅中,时间仿佛静止,伤痛缓缓消散。","前人留下的营地,尚有补给可用。"]},boss:{titles:["以太回响体","维度守护者","飞升残念","终焉之核"],descs:["路径尽头,以太回响体静静伫立——它是这个遗迹意志的化身。","维度守护者挡在最后,唯有超越它方能触及终焉。","飞升残念凝聚成形,它是以太族离去前留下的最后一道试炼。","终焉之核悬浮于大厅中央,接触它即完成本次探险。"]}};function es(e,t,n){let r,i=(r=e>>>0,()=>{r|=0;let e=Math.imul((r=r+0x6d2b79f5|0)^r>>>15,1|r);return(((e=e+Math.imul(e^e>>>7,61|e)^e)^e>>>14)>>>0)/0x100000000}),a=er.minNodes+Math.floor(i()*(er.maxNodes-er.minNodes+1)),s=[];for(let e=0;e<a;e++){let t=e===a-1,n=t?"boss":function(e){let t=Object.keys(ei),n=t.reduce((e,t)=>e+ei[t],0),r=e()*n;for(let e of t)if((r-=ei[e])<=0)return e;return"combat"}(i),r=ea[n],o=Math.floor(i()*r.titles.length);s.push({id:e,type:n,title:r.titles[o],desc:r.descs[o],cleared:!1,difficulty:t?3+Math.floor(3*i()):1+Math.floor(4*i()),position:e})}if("combat"===s[0].type||"boss"===s[0].type){s[0].type=.5>i()?"treasure":"rest";let e=ea[s[0].type];s[0].title=e.titles[0],s[0].desc=e.descs[0],s[0].difficulty=1}return{id:`exp_${e}_${Date.now()}`,nodes:s,currentNode:0,finished:!1,rewards:{crystals:0,insights:0,contact:0,fragments:[]},power:t,hp:n,maxHp:n,seed:e,startedAt:Date.now()}}function eo(e){let t=er.basePower;return t+=3*(e.tech?.exp_1??0)+5*(e.tech?.exp_2??0)+8*(e.tech?.exp_3??0)+12*(e.tech?.exp_4??0)+25*(e.tech?.exp_5??0),Math.round(t*=(1+(e.blueprints?.length??0)*.08)*(1+(e.ascensions??0)*.15)*h(e.constellation??[]).expeditionPowerMult)}function el(e){let t=er.baseHp;return t+=(e.tech?.exp_2??0)*20,t+=(e.tech?.exp_4??0)*30,t+=(e.tech?.exp_5??0)*50,t+=(e.ascensions??0)*10,t=Math.round(t*h(e.constellation??[]).expeditionHpMult)}function ec(e,t){let n=er.combatDifficultyScale;return Math.max(er.combatWinRateFloor,Math.min(.95,e/(e+t*n)))}function ed(e,t=Math.random){let n=e.nodes[e.currentNode];if(!n)return{log:"无节点",ended:!0,endReason:"abort"};if(n.cleared){var r;return(r=e).currentNode>=r.nodes.length-1?{log:"探险已完成",ended:!0,endReason:"victory"}:(r.currentNode++,{log:`前进至节点 ${r.currentNode+1}`,ended:!1})}let i=e.power,a=n.difficulty;switch(n.type){case"combat":{let r=ec(i,a);if(t()<r){let e=8+6*a+Math.floor(10*t()),r=1+a+Math.floor(2*t());return n.cleared=!0,{log:`击败「${n.title}」,缴获 ${e} 晶体、${r} 洞见。`,crystals:e,insights:r,ended:!1}}let s=20+10*a+Math.floor(15*t());if(e.hp-s<=0)return n.cleared=!0,{log:`「${n.title}」过于强大,探险队全灭…(生命 -${e.hp}`,hpDelta:-e.hp,ended:!0,endReason:"defeat"};return n.cleared=!0,{log:`「${n.title}」击退了探险队,损失 ${s} 生命,狼狈通过。`,hpDelta:-s,ended:!1}}case"treasure":{let e=10+8*a+Math.floor(15*t()),r=2+a+Math.floor(3*t());return n.cleared=!0,{log:`在「${n.title}」中发现 ${e} 晶体、${r} 洞见。`,crystals:e,insights:r,ended:!1}}case"rest":{let e=15+8*a+Math.floor(10*t());return n.cleared=!0,{log:`在「${n.title}」休整,恢复 ${e} 生命。`,hpDelta:e,ended:!1}}case"puzzle":{let e=Math.min(.9,.4+.01*i);if(t()<e){let e=20+12*a,t=5+3*a,r=1+.5*a;return n.cleared=!0,{log:`解开「${n.title}」,获得 ${e} 晶体、${t} 洞见、${r.toFixed(1)} 接触进度。`,crystals:e,insights:t,contact:r,ended:!1}}return n.cleared=!0,{log:`「${n.title}」未能解开,但探险队平安通过。`,ended:!1}}case"choice":{if(.55>t()){let e=6+5*a+Math.floor(8*t());return n.cleared=!0,{log:`在「${n.title}」做出了明智的选择,获得 ${e} 晶体。`,crystals:e,ended:!1}}let e=8+5*a;return n.cleared=!0,{log:`在「${n.title}」的选择带来了代价,损失 ${e} 生命。`,hpDelta:-e,ended:!1}}case"boss":{let r=ec(i,a),s=t()<r;if(n.cleared=!0,s){let e=60+25*a,t=15+6*a,r=5+1.5*a;return{log:`✦ 击败「${n.title}」!获得 ${e} 晶体、${t} 洞见、${r.toFixed(1)} 接触进度。`,crystals:e,insights:t,contact:r,ended:!0,endReason:"victory"}}return{log:`「${n.title}」的力量超出想象,探险队全军覆没…`,hpDelta:-e.hp,ended:!0,endReason:"defeat"}}}}function eu(e){let t=er.energyRegenSec,n=1;e.tech?.exp_2&&(n*=.7),e.tech?.exp_3&&(n*=.8),e.tech?.exp_4&&(n*=.75),e.tech?.exp_5&&(n*=.7);let r=e.attributes?.exploration??0;return n*=1-(r>=50?.15+(Math.min(100,r)-50)*.003:.003*r),Math.max(er.energyRegenMinSec,t*n)}function eh(e,t,n,r,i=er.energyRegenSec){let a=1e3*i,s=Math.floor((t-e)/a);return s<=0?{energy:n,lastTick:e}:{energy:Math.min(r,n+s),lastTick:e+s*a}}e.s(["EXPEDITION_CONFIG",0,er,"combatWinRate",()=>ec,"computeEnergyRegen",()=>eh,"computeEnergyRegenInterval",()=>eu,"computeExpeditionHp",()=>el,"computeExpeditionPower",()=>eo,"generateExpedition",()=>es,"resolveNode",()=>ed],44915);let eg={routine:{label:"常规信标",color:"#34d399",glow:"rgba(52,211,153,0.45)",mult:1,icon:"◍"},anomaly:{label:"异常波动",color:"#fbbf24",glow:"rgba(251,191,36,0.45)",mult:1.6,icon:"◈"},singular:{label:"奇点回响",color:"#f43f5e",glow:"rgba(244,63,94,0.5)",mult:2.4,icon:"✶"}};function ep(e=new Date){let t=e.getUTCFullYear(),n=String(e.getUTCMonth()+1).padStart(2,"0"),r=String(e.getUTCDate()).padStart(2,"0");return`${t}-${n}-${r}`}function em(e){let t=e>>>0;return()=>{t|=0;let e=Math.imul((t=t+0x6d2b79f5|0)^t>>>15,1|t);return(((e=e+Math.imul(e^e>>>7,61|e)^e)^e>>>14)>>>0)/0x100000000}}function ef(e=new Date){let t=ep(e),n=function(e){let t=0x811c9dc5;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,0x1000193)>>>0;return t>>>0}(t),r=em(n),i=["decode","expedition","pulse","boss","insight"],a=i[Math.floor(r()*i.length)],s=r(),o=s<.55?"routine":s<.88?"anomaly":"singular",l=eg[o].mult,c=0,d=0,u=0,h="",g="";switch(a){case"decode":d=Math.round(4*(c=Math.round((6+Math.floor(10*r()))*l))*l),u=.8*c,h=`解码 ${c} 颗记忆晶体`,g=`深空信标要求解码 ${c} 颗晶体。谐振风暴期间效率更高。`;break;case"expedition":d=Math.round(12*(c=Math.max(1,Math.round((1+Math.floor(3*r()))*l)))*l),u=1.5*c,h=`完成 ${c} 次遗迹探险`,g=`派出探险队完成 ${c} 次远征,无论胜负均计入。`;break;case"pulse":d=Math.round(1.2*(c=Math.round((20+Math.floor(30*r()))*l))*l),u=.3*c,h=`发起 ${c} 次脉冲扫描`,g=`主动点击晶体发起 ${c} 次脉冲。连击可叠加加成。`;break;case"boss":d=Math.round(30*(c=Math.max(1,Math.round(l)))*l),u=3*c,h=`击破 ${c} 处维度 BOSS`,g=`在探险终点击破 ${c} 处 BOSS。提升探险力后再挑战。`;break;case"insight":c=Math.round((40+Math.floor(80*r()))*l),d=0,u=.1*c,h=`累计获取 ${c} 洞见`,g=`通过解码、探险、星潮等途径累计 ${c} 洞见。`}return{dateKey:t,type:a,difficulty:o,goal:c,rewardInsight:d,rewardContact:u,seed:n,title:h,desc:g}}function eb(e,t,n){let r=Math.min(1,t/e.goal),i=eg[e.difficulty].mult,a=r>=1&&n>0?Math.max(0,500-.5*n):0;return Math.round(1e3*r*i+a)}let ey="echo-nexus-beacon-lb-v1",eT="echo-nexus-beacon-prog-v1";function ex(){if("u"<typeof localStorage)return[];try{let e=localStorage.getItem(ey);if(!e)return[];return JSON.parse(e).sort((e,t)=>t.score-e.score).slice(0,20)}catch{return[]}}function ev(e){let t=ex();t.push(e),t.sort((e,t)=>t.score-e.score);let n=t.slice(0,20);return"u">typeof localStorage&&localStorage.setItem(ey,JSON.stringify(n)),n}function eS(e=new Date){let t=ep(e);if("u"<typeof localStorage)return{dateKey:t,progress:0,startedAt:Date.now(),completedAt:null,claimed:!1,durationSec:0};try{let e=localStorage.getItem(eT);if(!e)return{dateKey:t,progress:0,startedAt:Date.now(),completedAt:null,claimed:!1,durationSec:0};let n=JSON.parse(e);if(n.dateKey!==t)return{dateKey:t,progress:0,startedAt:Date.now(),completedAt:null,claimed:!1,durationSec:0};return n}catch{return{dateKey:t,progress:0,startedAt:Date.now(),completedAt:null,claimed:!1,durationSec:0}}}function ew(e){"u">typeof localStorage&&localStorage.setItem(eT,JSON.stringify(e))}function eM(e,t,n){let r=Math.min(t.goal,e.progress+n),i=null===e.completedAt&&r>=t.goal,a=i?Date.now():e.completedAt,s=null!==a?Math.floor((a-e.startedAt)/1e3):e.durationSec,o={...e,progress:r,completedAt:a,durationSec:s};return ew(o),{progress:o,justCompleted:i}}function eP(e,t){if(t.claimed||null===t.completedAt)return{rewardInsight:0,rewardContact:0,score:0,leaderboard:ex()};let n=eb(e,t.progress,t.durationSec),r={timestamp:Date.now(),dateKey:e.dateKey,challenge:e.type,difficulty:e.difficulty,progress:t.progress/e.goal,score:n,durationSec:t.durationSec},i=ev(r);return ew({...t,claimed:!0}),{rewardInsight:e.rewardInsight,rewardContact:e.rewardContact,score:n,leaderboard:i,entry:r}}function e_(e=new Date){return Math.max(0,Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+1,0,0,0)-e.getTime())}function eC(e){let t=Math.max(0,Math.floor(e/1e3)),n=String(Math.floor(t/3600)).padStart(2,"0"),r=String(Math.floor(t%3600/60)).padStart(2,"0"),i=String(t%60).padStart(2,"0");return`${n}:${r}:${i}`}let eA="echo-nexus-beacon-weekly-v1";function eR(e=new Date){let t=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())),n=(t.getUTCDay()+6)%7;t.setUTCDate(t.getUTCDate()-n+3);let r=t.getUTCFullYear(),i=Date.UTC(r,0,1),a=Math.ceil(((t.getTime()-i)/864e5+1)/7);return`${r}-W${String(a).padStart(2,"0")}`}function ek(e=new Date){let t=eR(e),n=function(e){let t=0x811c9dc5;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,0x1000193)>>>0;return t>>>0}(t),r=em(n),i=["decode","expedition","pulse","boss","insight"],a=i[Math.floor(r()*i.length)],s=.6>r()?"anomaly":"singular",o=eg[s].mult,l=3+Math.floor(3*r()),c=0,d=0,u=0,h="",g="";switch(a){case"decode":d=Math.round(5*(c=Math.max(18,Math.round((6+Math.floor(10*r()))*o*l)))*o),u=1.2*c,h=`周界解码 \xb7 ${c} 颗晶体`,g=`本周深空信标要求解码 ${c} 颗记忆晶体,强度为日挑战的 ${l} 倍。`;break;case"expedition":d=Math.round(14*(c=Math.max(3,Math.round((1+Math.floor(3*r()))*o*l)))*o),u=2*c,h=`周界远征 \xb7 ${c} 次探险`,g=`本周派出探险队完成 ${c} 次远征,无论胜负均计入。`;break;case"pulse":d=Math.round(1.5*(c=Math.max(60,Math.round((20+Math.floor(30*r()))*o*l)))*o),u=.4*c,h=`周界脉冲 \xb7 ${c} 次扫描`,g=`本周发起 ${c} 次脉冲扫描。连击可叠加加成。`;break;case"boss":d=Math.round(35*(c=Math.max(3,Math.round(l*o)))*o),u=4*c,h=`周界猎杀 \xb7 ${c} 处 BOSS`,g=`本周在探险终点击破 ${c} 处维度 BOSS。提升探险力后再挑战。`;break;case"insight":c=Math.max(120,Math.round((40+Math.floor(80*r()))*o*l)),d=0,u=.15*c,h=`周界洞见 \xb7 ${c} 点`,g=`本周通过解码、探险、星潮等途径累计 ${c} 洞见。`}return{weekKey:t,type:a,difficulty:s,goal:c,rewardInsight:d,rewardContact:u,seed:n,title:h,desc:g}}function eE(e=new Date){let t=eR(e),n={weekKey:t,progress:0,startedAt:Date.now(),completedAt:null,claimed:!1,durationSec:0};if("u"<typeof localStorage)return n;try{let e=localStorage.getItem(eA);if(!e)return n;let r=JSON.parse(e);if(r.weekKey!==t)return n;return r}catch{return n}}function eI(e){"u">typeof localStorage&&localStorage.setItem(eA,JSON.stringify(e))}function eD(e,t,n){let r=Math.min(t.goal,e.progress+n),i=null===e.completedAt&&r>=t.goal,a=i?Date.now():e.completedAt,s=null!==a?Math.floor((a-e.startedAt)/1e3):e.durationSec,o={...e,progress:r,completedAt:a,durationSec:s};return eI(o),{progress:o,justCompleted:i}}function eN(e,t){if(t.claimed||null===t.completedAt)return{rewardInsight:0,rewardContact:0,score:0,leaderboard:ex()};let n=eb({...e,dateKey:e.weekKey},t.progress,t.durationSec),r={timestamp:Date.now(),dateKey:e.weekKey,challenge:e.type,difficulty:e.difficulty,progress:t.progress/e.goal,score:n,durationSec:t.durationSec,isWeekly:!0},i=ev(r);return eI({...t,claimed:!0}),{rewardInsight:e.rewardInsight,rewardContact:e.rewardContact,score:n,leaderboard:i,entry:r}}function eB(e=new Date){let t=(e.getUTCDay()+6)%7;return Math.max(0,Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()-t,0,0,0)+6048e5-e.getTime())}let eO="echo-nexus-beacon-chain-v1",e$=[3,7,14,30],eL=[{milestone:3,rewardInsight:50,rewardContact:5,label:"三日谐振"},{milestone:7,rewardInsight:120,rewardContact:12,label:"七日回响"},{milestone:14,rewardInsight:280,rewardContact:28,label:"半月星潮"},{milestone:30,rewardInsight:680,rewardContact:68,label:"满月飞升"}];function eU(){let e=()=>({lastCompletedDateKey:"",currentStreak:0,longestStreak:0,totalCompletions:0,graceUsed:0,milestonesClaimed:[]});if("u"<typeof localStorage)return e();try{let t=localStorage.getItem(eO);if(!t)return e();let n=JSON.parse(t);return{lastCompletedDateKey:n.lastCompletedDateKey??"",currentStreak:n.currentStreak??0,longestStreak:n.longestStreak??0,totalCompletions:n.totalCompletions??0,graceUsed:n.graceUsed??0,milestonesClaimed:Array.isArray(n.milestonesClaimed)?[...n.milestonesClaimed]:[]}}catch{return e()}}function eK(e){"u">typeof localStorage&&localStorage.setItem(eO,JSON.stringify(e))}function ez(e){let[t,n,r]=e.split("-").map(Number);return Date.UTC(t,n-1,r,0,0,0)}function eH(e){let t,n=eU();if(n.lastCompletedDateKey===e)return{state:n,newMilestones:[]};if(""===n.lastCompletedDateKey)t={...n,lastCompletedDateKey:e,currentStreak:1,longestStreak:Math.max(n.longestStreak,1),totalCompletions:n.totalCompletions+1};else{var r;let i=(r=n.lastCompletedDateKey,r&&e?Math.round((ez(e)-ez(r))/864e5):Number.MAX_SAFE_INTEGER);if(1===i){let r=n.currentStreak+1;t={...n,lastCompletedDateKey:e,currentStreak:r,longestStreak:Math.max(n.longestStreak,r),totalCompletions:n.totalCompletions+1}}else if(2===i&&n.graceUsed<1){let r=n.currentStreak+1;t={...n,lastCompletedDateKey:e,currentStreak:r,longestStreak:Math.max(n.longestStreak,r),totalCompletions:n.totalCompletions+1,graceUsed:n.graceUsed+1}}else t={...n,lastCompletedDateKey:e,currentStreak:1,totalCompletions:n.totalCompletions+1,graceUsed:0,longestStreak:Math.max(n.longestStreak,1)}}let i=[];for(let e of e$)t.currentStreak>=e&&!t.milestonesClaimed.includes(e)&&i.push(e);return eK(t),{state:t,newMilestones:i}}function ej(e){let t=eL.find(t=>t.milestone===e),n=eU();if(!t||n.milestonesClaimed.includes(e)||n.currentStreak<e)return{rewardInsight:0,rewardContact:0,label:"",state:n};let r={...n,milestonesClaimed:[...n.milestonesClaimed,e]};return eK(r),{rewardInsight:t.rewardInsight,rewardContact:t.rewardContact,label:t.label,state:r}}function eF(e){for(let t of e$)if(e<t)return t;return null}function eW(e){let t=eF(e),n=0;for(let t of e$)e>=t&&(n=t);if(null===t)return{current:e,next:null,prev:n,progressPct:100};let r=t-n,i=e-n;return{current:e,next:t,prev:n,progressPct:Math.min(100,Math.max(0,r>0?Math.round(i/r*100):100))}}let eG="echo-nexus-beacon-timed-v1";function eJ(e=new Date){let t=e.getUTCFullYear(),n=String(e.getUTCMonth()+1).padStart(2,"0"),r=String(e.getUTCDate()).padStart(2,"0"),i=4*Math.floor(e.getUTCHours()/4);return`timed_${t}-${n}-${r}_${String(i).padStart(2,"0")}`}function eY(e=new Date){let t=4*Math.floor(e.getUTCHours()/4);return Math.max(0,Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t,0,0)+144e5-e.getTime())}function eX(e=new Date){let t=eJ(e),n=function(e){let t=0x811c9dc5;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,0x1000193)>>>0;return t>>>0}(t),r=em(n),i=function(e){let t=e.match(/^timed_(\d{4})-(\d{2})-(\d{2})_(\d{2})$/);if(!t)return Date.now();let[,n,r,i,a]=t;return Date.UTC(Number(n),Number(r)-1,Number(i),Number(a),0,0)}(t)+144e5,a=["decode","expedition","pulse","boss","insight"],s=a[Math.floor(r()*a.length)],o="routine",l=eg[o].mult,c=.3+.2*r(),d=0,u=0,h=0,g="",p="";switch(s){case"decode":u=Math.round(3*(d=Math.max(2,Math.round((6+Math.floor(10*r()))*l*c)))*l),h=.6*d,g=`限时解码 ${d} 颗晶体`,p=`4 小时内解码 ${d} 颗记忆晶体。短周期,快速完成。`;break;case"expedition":u=Math.round(9*(d=Math.max(1,Math.round((1+Math.floor(3*r()))*l*c)))*l),h=1.2*d,g=`限时远征 ${d} 次探险`,p=`4 小时内完成 ${d} 次遗迹探险。`;break;case"pulse":u=Math.round((d=Math.max(6,Math.round((20+Math.floor(30*r()))*l*c)))*l),h=.25*d,g=`限时脉冲 ${d} 次扫描`,p=`4 小时内发起 ${d} 次脉冲扫描。`;break;case"boss":u=Math.round(25*(d=Math.max(1,Math.round(l*c)))*l),h=2.5*d,g=`限时猎杀 ${d} 处 BOSS`,p=`4 小时内击破 ${d} 处维度 BOSS。`;break;case"insight":d=Math.max(12,Math.round((40+Math.floor(80*r()))*l*c)),u=0,h=.08*d,g=`限时洞见 ${d} 点`,p=`4 小时内累计获取 ${d} 洞见。`}return{slotKey:t,type:s,difficulty:o,goal:d,rewardInsight:u,rewardContact:h,seed:n,title:g,desc:p,expiresAt:i}}function eV(e=new Date){let t=eJ(e),n={slotKey:t,progress:0,startedAt:Date.now(),completedAt:null,claimed:!1,durationSec:0};if("u"<typeof localStorage)return n;try{let e=localStorage.getItem(eG);if(!e)return n;let r=JSON.parse(e);if(r.slotKey!==t)return n;return r}catch{return n}}function eQ(e){"u">typeof localStorage&&localStorage.setItem(eG,JSON.stringify(e))}function eq(e,t,n){let r=Math.min(t.goal,e.progress+n),i=null===e.completedAt&&r>=t.goal,a=i?Date.now():e.completedAt,s=null!==a?Math.floor((a-e.startedAt)/1e3):e.durationSec,o={...e,progress:r,completedAt:a,durationSec:s};return eQ(o),{progress:o,justCompleted:i}}function eZ(e,t){if(t.claimed||null===t.completedAt)return{rewardInsight:0,rewardContact:0,score:0,leaderboard:ex()};let n=eb({...e,dateKey:e.slotKey},t.progress,t.durationSec),r={timestamp:Date.now(),dateKey:e.slotKey,challenge:e.type,difficulty:e.difficulty,progress:t.progress/e.goal,score:n,durationSec:t.durationSec,isTimed:!0},i=ev(r);return eQ({...t,claimed:!0}),{rewardInsight:e.rewardInsight,rewardContact:e.rewardContact,score:n,leaderboard:i,entry:r}}let e0="echo-nexus-beacon-cloud-last-submit-v1",e1="/api/leaderboard?XTransformPort=3030";function e5(){if("u"<typeof localStorage)return 0;try{let e=localStorage.getItem(e0);return e&&Number(e)||0}catch{return 0}}async function e2(){try{let e=await fetch(e1,{method:"GET",headers:{Accept:"application/json"}});if(!e.ok)return[];let t=await e.json();if(!t||!Array.isArray(t.entries))return[];return t.entries}catch{return[]}}async function e3(e){try{let t=await fetch(e1,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({entry:e})});if(!t.ok)return -1;let n=await t.json();return n&&"number"==typeof n.rank&&n.rank>=1&&function(e){if("u">typeof localStorage)try{localStorage.setItem(e0,String(e))}catch{}}(e.timestamp),n?.rank??-1}catch{return -1}}e.s(["BEACON_CHAIN_MILESTONES",0,e$,"BEACON_CHAIN_REWARDS",0,eL,"BEACON_DIFFICULTY",0,eg,"BEACON_TYPE_META",0,{decode:{label:"解码协议",icon:"❖",unit:"颗",verb:"解码记忆晶体"},expedition:{label:"远征指令",icon:"⬢",unit:"次",verb:"完成遗迹探险"},pulse:{label:"脉冲任务",icon:"✺",unit:"次",verb:"发起脉冲扫描"},boss:{label:"猎杀契约",icon:"☠",unit:"处",verb:"击破维度 BOSS"},insight:{label:"洞见采集",icon:"✦",unit:"点",verb:"累计获取洞见"}},"addBeaconProgress",()=>eM,"addTimedProgress",()=>eq,"addWeeklyProgress",()=>eD,"claimBeaconReward",()=>eP,"claimChainMilestone",()=>ej,"claimTimedReward",()=>eZ,"claimWeeklyReward",()=>eN,"fetchCloudLeaderboard",()=>e2,"formatCountdown",()=>eC,"generateDailyChallenge",()=>ef,"generateTimedChallenge",()=>eX,"generateWeeklyChallenge",()=>ek,"getChainProgress",()=>eW,"getNextMilestone",()=>eF,"getTimedSlotKey",()=>eJ,"getTodayKey",()=>ep,"getWeekKey",()=>eR,"loadChainState",()=>eU,"loadDailyProgress",()=>eS,"loadLastCloudSubmitTimestamp",()=>e5,"loadLeaderboard",()=>ex,"loadTimedProgress",()=>eV,"loadWeeklyProgress",()=>eE,"msUntilNextDay",()=>e_,"msUntilNextTimedSlot",()=>eY,"msUntilNextWeek",()=>eB,"recordChainCompletion",()=>eH,"submitCloudScore",()=>e3],89120)},6120,e=>{"use strict";let t=null;function n(e){t=e,window.dispatchEvent(new CustomEvent("echo-nexus-offline-report"))}function r(){return t}function i(){let e=t;return t=null,e}function a(e){if(e<60)return`${Math.floor(e)}秒`;let t=Math.floor(e/60);if(t<60)return`${t}分钟`;let n=Math.floor(t/60),r=t%60;if(n<24)return r>0?`${n}小时${r}分`:`${n}小时`;let i=Math.floor(n/24),a=n%24;return a>0?`${i}${a}小时`:`${i}天`}e.s(["consumeOfflineReport",()=>i,"formatDuration",()=>a,"getPendingOfflineReport",()=>r,"setPendingOfflineReport",()=>n])},18533,e=>{"use strict";var t=e.i(68834),n=e.i(79473),r=e.i(52664),i=e.i(60645),a=e.i(69992),s=e.i(44915),o=e.i(32142),l=e.i(59401),c=e.i(43625),d=e.i(47785),u=e.i(89120),h=e.i(6120),g=e.i(33755);function p(e){let t=(0,i.recomputeStats)(e);return{crystalsPerSec:t.crystalsPerSec,crystalCap:t.crystalCap,pulsePower:t.pulsePower,offlineEff:t.offlineEff,insightMult:t.insightMult,contactRateMult:t.contactRateMult,autoDecode:t.autoDecode,decodeStepsBonus:t.decodeStepsBonus}}function m(e,t){let n={dailyJustCompleted:!1,timedJustCompleted:!1,weeklyJustCompleted:!1,newChainMilestones:[]};try{let r=(0,u.generateDailyChallenge)();if(r.type===e){let e=(0,u.loadDailyProgress)();if(null===e.completedAt){let{justCompleted:i}=(0,u.addBeaconProgress)(e,r,t);if(n.dailyJustCompleted=i,i){let{newMilestones:e}=(0,u.recordChainCompletion)((0,u.getTodayKey)());n.newChainMilestones=e}}}let i=(0,u.generateTimedChallenge)();if(i.type===e){let e=(0,u.loadTimedProgress)();if(null===e.completedAt){let{justCompleted:r}=(0,u.addTimedProgress)(e,i,t);n.timedJustCompleted=r}}let a=(0,u.generateWeeklyChallenge)();if(a.type===e){let e=(0,u.loadWeeklyProgress)();if(null===e.completedAt){let{justCompleted:r}=(0,u.addWeeklyProgress)(e,a,t);n.weeklyJustCompleted=r}}return n}catch{return n}}function f(e){let t=[];for(let n of r.FRAGMENTS)!e.fragments[n.id]&&e.totalDecoded>=n.threshold&&(e.fragments[n.id]=!0,t.push(n.id));return t}let b=(0,t.create)()((0,n.persist)((e,t)=>({...(0,i.createInitialState)(),_lastAutoDecode:Date.now(),_lastSpawn:Date.now(),_combo:0,_lastPulse:0,_achievementQueue:[],_tideEvents:[],globalTide:null,init:()=>{let n=t(),i=Date.now(),s=n.activePuzzle;if(s&&!(0,a.isSolvable)(s)){let t={id:`c_${i}_rec`,tier:s.tier,value:r.CRYSTAL_VALUE[s.tier].crystals,createdAt:i};s=null,e({pendingCrystals:[...n.pendingCrystals,t].slice(-r.CRYSTAL_SPAWN.maxPending)})}let o=n.achievements??{},l=n.activeTide??null,u=n.constellation??[],m=n.pendingPerkChoices??null,f=(0,d.migrateChronicleFields)(n),b=(0,g.migrateAttributes)(n),y=(0,c.constellationBonuses)(u),T=r.INITIAL_STATE.energyMax+y.energyMaxBonus,x=n.lastTideEnd??0,v=l&&l.endsAt>i?l:null,S=Math.max(0,(i-n.lastTick)/1e3);if(S>5){let t=Math.min(S,28800),r=n.crystalsPerSec*t*n.offlineEff,a=n.crystals,l=Math.min(n.crystalCap,n.crystals+r);(0,h.setPendingOfflineReport)({elapsedSec:t,rawElapsedSec:S,gain:l-a,rate:n.crystalsPerSec,eff:n.offlineEff,capped:S>28800,crystalsBefore:a,crystalsAfter:l,crystalCap:n.crystalCap}),e({crystals:l,lastTick:i,activePuzzle:s,achievements:o,activeTide:v,lastTideEnd:x,constellation:u,pendingPerkChoices:m,energyMax:T,chronicle:f.chronicle,runStart:f.runStart,bossKills:f.bossKills,starTidesEncountered:f.starTidesEncountered,attributes:b.attributes,attributeProgress:b.attributeProgress,pendingAttrPoints:b.pendingAttrPoints,...p({tech:n.tech,blueprints:n.blueprints,achievements:o,activeTide:v,constellation:u,attributes:b.attributes})})}else e({lastTick:i,activePuzzle:s,achievements:o,activeTide:v,lastTideEnd:x,constellation:u,pendingPerkChoices:m,energyMax:T,chronicle:f.chronicle,runStart:f.runStart,bossKills:f.bossKills,starTidesEncountered:f.starTidesEncountered,attributes:b.attributes,attributeProgress:b.attributeProgress,pendingAttrPoints:b.pendingAttrPoints,...p({tech:n.tech,blueprints:n.blueprints,achievements:o,activeTide:v,constellation:u,attributes:b.attributes})})},loadOnline:()=>{let n=t();e({...p({tech:n.tech,blueprints:n.blueprints,achievements:n.achievements,activeTide:n.activeTide,constellation:n.constellation,attributes:n.attributes})})},hardReset:()=>{e({...(0,i.createInitialState)(),_lastAutoDecode:Date.now(),_lastSpawn:Date.now(),_combo:0,_lastPulse:0,_achievementQueue:[],_tideEvents:[],globalTide:null})},tickTide:n=>{let r=t();if(r.globalTide){if(n>=r.globalTide.endsAt){let t=r.globalTide.type,i=0;"silence"===t&&(i=(0,l.computeSilenceCompensation)({type:t,startedAt:r.globalTide.startedAt,endsAt:r.globalTide.endsAt,id:r.globalTide.id}));let a={ended:t,isGlobal:!0};return i>0&&(a.silenceCompensation=i),e({globalTide:null,activeTide:null,lastTideEnd:n,insights:r.insights+i,...p({tech:r.tech,blueprints:r.blueprints,achievements:r.achievements,activeTide:null,constellation:r.constellation,attributes:r.attributes}),_tideEvents:[...r._tideEvents,a]}),a}return null}let i=r.activeTide,a=(0,c.constellationBonuses)(r.constellation??[]),s=Math.min(.3,(0,g.getAllBonuses)(r.attributes??{}).tideTriggerBonus),o=Math.max(15e3,(l.TIDE_CONFIG.gap+1e3*a.tideGapDeltaSec)*(1-s));if(i&&n>=i.endsAt){let t=i.type,a=0;"silence"===i.type&&(a=(0,l.computeSilenceCompensation)(i));let s=r.insights+a,o={ended:t};return a>0&&(o.silenceCompensation=a),e({activeTide:null,lastTideEnd:n,insights:s,...p({tech:r.tech,blueprints:r.blueprints,achievements:r.achievements,activeTide:null,constellation:r.constellation,attributes:r.attributes}),_tideEvents:[...r._tideEvents,o]}),o}if(!i&&n-r.lastTideEnd>=(0===r.lastTideEnd||r.lastTideEnd<=r.createdAt+1e3?l.TIDE_CONFIG.firstDelay:o)){let t=(0,l.rollTide)(),i={id:`tide_${n}_${Math.random().toString(36).slice(2,7)}`,type:t,startedAt:n,endsAt:n+l.TIDE_CONFIG.duration},a={started:t},s=r.starTidesEncountered??[],o=`tide_${t}`;return e({activeTide:i,starTidesEncountered:s.includes(o)?s:[...s,o],...p({tech:r.tech,blueprints:r.blueprints,achievements:r.achievements,activeTide:i,constellation:r.constellation,attributes:r.attributes}),_tideEvents:[...r._tideEvents,a]}),a}return null},consumeTideEvents:()=>{let n=t();if(0===n._tideEvents.length)return[];let r=n._tideEvents;return e({_tideEvents:[]}),r},triggerGlobalTide:n=>{let r=t(),i=Date.now(),a=`global_tide_${i}_${Math.random().toString(36).slice(2,7)}`,s={id:a,type:n,startedAt:i,endsAt:i+6e4},o=r.starTidesEncountered??[],l=`tide_${n}`;e({globalTide:{type:n,startedAt:i,endsAt:i+6e4,id:a},activeTide:s,starTidesEncountered:o.includes(l)?o:[...o,l],...p({tech:r.tech,blueprints:r.blueprints,achievements:r.achievements,activeTide:s,constellation:r.constellation,attributes:r.attributes}),_tideEvents:[...r._tideEvents,{started:n,isGlobal:!0}]})},tick:n=>{let a=t(),o=Math.max(0,(n-a.lastTick)/1e3);if(o<=0)return;let d=(0,l.getTideModifiers)(a.activeTide),u=a.crystalsPerSec*d.crystalsPerSecMult,h=a.crystals>=a.crystalCap?a.crystals:Math.min(a.crystalCap,a.crystals+u*o),g=1+.03*a.blueprints.length,p=r.CRYSTAL_SPAWN.baseIntervalSec/g*1e3,m=a.pendingCrystals,f=a._lastSpawn;if(n-f>p&&m.length<r.CRYSTAL_SPAWN.maxPending){let e=(0,c.constellationBonuses)(a.constellation??[]),t=(0,i.rollCrystalTierWithBonus)(e.t2t3BonusRate);m=[...m,{id:`c_${n}_${Math.random().toString(36).slice(2,7)}`,tier:t,value:r.CRYSTAL_VALUE[t].crystals,createdAt:n}],f=n}let b=a.energy,y=a.lastEnergyTick;if(b<a.energyMax){let e=(0,s.computeEnergyRegenInterval)(a),t=(0,s.computeEnergyRegen)(y,n,b,a.energyMax,e);b=t.energy,y=t.lastTick}else y=n;e({crystals:h,lastTick:n,pendingCrystals:m,_lastSpawn:f,energy:b,lastEnergyTick:y})},pulse:()=>{let n=t(),r=Date.now(),i=1;r-n._lastPulse<1500&&(i=Math.min(10,n._combo+1));let a=1+(i-1)*.15,s=(0,l.getTideModifiers)(n.activeTide),o=1+(0,g.getAllBonuses)(n.attributes??{}).pulseComboBonus*Math.max(0,i-1),c=n.pulsePower*a*s.pulsePowerMult*o;if(e({crystals:Math.min(n.crystalCap,n.crystals+c),_combo:i,_lastPulse:r}),m("pulse",1),i>=3){let t=1+Math.floor(i/2),r=(n.attributeProgress?.inspiration??{exp:0,level:n.attributes?.inspiration??0}).exp+t,a=(0,g.levelUpCheck)({exp:r,level:n.attributes?.inspiration??0},g.ATTRIBUTE_HARD_CAP),s={...n.attributes??(0,g.createInitialAttributes)(),inspiration:a.newProgress.level};e({attributes:s,attributeProgress:{...n.attributeProgress??(0,g.createInitialAttributeProgress)(),inspiration:a.newProgress},...p({tech:n.tech,blueprints:n.blueprints,achievements:n.achievements,activeTide:n.activeTide,constellation:n.constellation,attributes:s})})}return{gain:c,combo:i}},startDecode:n=>{let r=t(),i=r.pendingCrystals.find(e=>e.id===n);if(!i)return;let s=(0,l.getTideModifiers)(r.activeTide).targetLenBonus??0;e({activePuzzle:(0,a.generatePuzzle)(i.tier,void 0,s),pendingCrystals:r.pendingCrystals.filter(e=>e.id!==n)})},clickNode:n=>{let r=t();if(!r.activePuzzle)return{ok:!1,finished:!1,failReason:"无活跃谜题"};let s=JSON.parse(JSON.stringify(r.activePuzzle)),o=(0,a.tryClickNode)(s,n);if(o.ok){if(o.finished){let t=(0,l.getTideModifiers)(r.activeTide),n=(0,c.constellationBonuses)(r.constellation??[]),a=(0,i.decodeRewards)(s.tier,r.insightMult,r.contactRateMult),o=t.decodeRewardMult*n.decodeRewardMult,d={crystals:Math.round(a.crystals*o),insights:Math.round(a.insights*o),contact:+(a.contact*o).toFixed(2)},u=r.totalDecoded+1,h=Math.min(100,r.contact+d.contact),b=r.insights+d.insights,y=r.crystals+d.crystals,T={...r,totalDecoded:u,fragments:{...r.fragments}},x=f(T),v=2*s.tier,S=r.attributes??(0,g.createInitialAttributes)(),w=r.attributeProgress??(0,g.createInitialAttributeProgress)(),M=w.wisdom??{exp:0,level:S.wisdom},P=(0,g.levelUpCheck)({exp:M.exp+v,level:S.wisdom},g.ATTRIBUTE_HARD_CAP),_={...S,wisdom:P.newProgress.level},C={...w,wisdom:P.newProgress};return e({activePuzzle:null,crystals:y,insights:b,contact:h,totalDecoded:u,fragments:T.fragments,attributes:_,attributeProgress:C,...p({tech:r.tech,blueprints:r.blueprints,achievements:r.achievements,activeTide:r.activeTide,constellation:r.constellation,attributes:_})}),m("decode",1),m("insight",d.insights),{ok:!0,finished:!0,failReason:x.join(",")||void 0}}let t=(0,a.isSolvable)(s);return e({activePuzzle:s}),{ok:!0,finished:!1,solvable:t}}return o},undoStep:()=>{let n=t();if(!n.activePuzzle||0===n.activePuzzle.path.length)return;let r=JSON.parse(JSON.stringify(n.activePuzzle)),i=r.path.pop();if(void 0!==i){let e=r.grid.find(e=>e.id===i);e&&(e.used=!1)}e({activePuzzle:r})},retryPuzzle:()=>{let n=t();n.activePuzzle&&e({activePuzzle:(0,a.resetPuzzle)(n.activePuzzle)})},abandonPuzzle:()=>{let n=t();if(!n.activePuzzle)return;let i={id:`c_${Date.now()}_ret`,tier:n.activePuzzle.tier,value:r.CRYSTAL_VALUE[n.activePuzzle.tier].crystals,createdAt:Date.now()};e({activePuzzle:null,pendingCrystals:[...n.pendingCrystals,i].slice(-r.CRYSTAL_SPAWN.maxPending)})},autoDecodeTick:()=>{let n=t();if(!n.autoDecode)return;let r=Date.now(),a=(0,c.constellationBonuses)(n.constellation??[]),s=(0,g.getAllBonuses)(n.attributes??{}),o=12e3+1e3*a.autoDecodeIntervalDeltaSec,d=(0,l.getTideModifiers)(n.activeTide).autoDecodeIntervalMult??1,u=Math.max(5e3,o*s.autoDecodeIntervalMult*d);if(r-n._lastAutoDecode<u)return;let h=1,b=n.pendingCrystals.findIndex(e=>1===e.tier);if(b<0&&n.tech?.dec_5&&(b=n.pendingCrystals.findIndex(e=>2===e.tier),h=2),b<0)return;let y=n.pendingCrystals[b],T=(0,l.getTideModifiers)(n.activeTide),x=(0,i.decodeRewards)(h,n.insightMult,n.contactRateMult),v=T.decodeRewardMult*a.decodeRewardMult,S={crystals:Math.round(x.crystals*v),insights:Math.round(x.insights*v),contact:+(x.contact*v).toFixed(2)},w=n.totalDecoded+1,M={...n,totalDecoded:w,fragments:{...n.fragments}};f(M);let P=n.attributes??(0,g.createInitialAttributes)(),_=n.attributeProgress??(0,g.createInitialAttributeProgress)(),C=_.wisdom??{exp:0,level:P.wisdom},A=(0,g.levelUpCheck)({exp:C.exp+1,level:P.wisdom},g.ATTRIBUTE_HARD_CAP),R={...P,wisdom:A.newProgress.level},k={..._,wisdom:A.newProgress};e({pendingCrystals:n.pendingCrystals.filter(e=>e.id!==y.id),crystals:n.crystals+S.crystals,insights:n.insights+S.insights,contact:Math.min(100,n.contact+S.contact),totalDecoded:w,fragments:M.fragments,_lastAutoDecode:r,attributes:R,attributeProgress:k,...p({tech:n.tech,blueprints:n.blueprints,achievements:n.achievements,activeTide:n.activeTide,constellation:n.constellation,attributes:R})}),m("decode",1),m("insight",S.insights)},buyTech:n=>{let i=t(),a=r.TECH_TREE.find(e=>e.id===n);if(!a||(i.tech[n]??0)>=1||i.insights<a.cost)return!1;let s={...i.tech,[n]:1};return e({insights:i.insights-a.cost,tech:s,...p({tech:s,blueprints:i.blueprints,achievements:i.achievements,activeTide:i.activeTide,constellation:i.constellation,attributes:i.attributes})}),!0},startExpedition:()=>{let n=t();if(n.activeExpedition&&!n.activeExpedition.finished)return{ok:!1,reason:"已有进行中的探险"};if(n.energy<s.EXPEDITION_CONFIG.energyCost)return{ok:!1,reason:"能量不足"};let r=(0,l.getTideModifiers)(n.activeTide),i=(0,g.getAllBonuses)(n.attributes??{}),a=(0,s.computeExpeditionPower)(n)+r.expeditionPowerBonus,o=(0,s.computeExpeditionHp)(n)+r.expeditionHpBonus,c=Math.round(a*i.expeditionPowerMult),d=o+i.expeditionHpBonus,u=Math.floor(1e9*Math.random());return e({activeExpedition:(0,s.generateExpedition)(u,c,d),energy:n.energy-s.EXPEDITION_CONFIG.energyCost,totalExpeditions:n.totalExpeditions+1}),{ok:!0}},resolveCurrentNode:()=>{let n=t();if(!n.activeExpedition||n.activeExpedition.finished)return null;let r=JSON.parse(JSON.stringify(n.activeExpedition)),i=r.nodes[r.currentNode],a=i?.type==="boss",o=(0,g.getAllBonuses)(n.attributes??{}),c=(0,l.getTideModifiers)(n.activeTide).bossWinRateBonus??0,d=a?(0,s.resolveNode)(r,()=>{let e=Math.random(),t=Math.min(.95,o.bossWinRateBonus+c);return e<t?0:Math.min(1,e-t)}):(0,s.resolveNode)(r);d.crystals&&(r.rewards.crystals+=d.crystals),d.insights&&(r.rewards.insights+=d.insights),d.contact&&(r.rewards.contact+=d.contact),d.fragments&&r.rewards.fragments.push(...d.fragments),d.hpDelta&&(r.hp=Math.max(0,Math.min(r.maxHp,r.hp+d.hpDelta)));let u=n.crystals+(d.crystals||0),h=n.insights+(d.insights||0),f=Math.min(100,n.contact+(d.contact||0)),b={...n.fragments};if(d.fragments)for(let e of d.fragments)b[e]=!0;let y=[{expeditionId:r.id,nodeType:i?.type||"combat",result:d.log,rewards:[d.crystals?`+${d.crystals}晶体`:"",d.insights?`+${d.insights}洞见`:"",d.contact?`+${d.contact.toFixed(1)}接触`:"",d.hpDelta?`${d.hpDelta>0?"+":""}${d.hpDelta}生命`:""].filter(Boolean).join(" "),timestamp:Date.now()},...n.expeditionLog].slice(0,30);d.ended&&(r.finished=!0);let T=n.lastExpeditionSummary??null;d.ended&&("victory"===d.endReason||"defeat"===d.endReason)&&(T={result:d.endReason,rewards:{...r.rewards},nodeCount:r.nodes.length,finishedAt:Date.now()});let x=n.bossKills??0,v=!1;d.ended&&"victory"===d.endReason&&i?.type==="boss"&&(x+=1,v=!0);let S=n.attributes??(0,g.createInitialAttributes)(),w=n.attributeProgress??(0,g.createInitialAttributeProgress)(),M=!1,P=(i?.type==="combat"||i?.type==="boss")&&!d.ended,_=d.ended&&"victory"===d.endReason;if(P||v||_){let e=v?8:2,t=v?6:_?4:1,n=(0,g.levelUpCheck)({exp:w.courage.exp+e,level:S.courage},g.ATTRIBUTE_HARD_CAP),r=(0,g.levelUpCheck)({exp:w.exploration.exp+t,level:S.exploration},g.ATTRIBUTE_HARD_CAP);S={...S,courage:n.newProgress.level,exploration:r.newProgress.level},w={...w,courage:n.newProgress,exploration:r.newProgress},M=!0}return e({activeExpedition:d.ended?null:r,crystals:u,insights:h,contact:f,fragments:b,expeditionLog:y,bossKills:x,attributes:S,attributeProgress:w,lastExpeditionSummary:T,...M?p({tech:n.tech,blueprints:n.blueprints,achievements:n.achievements,activeTide:n.activeTide,constellation:n.constellation,attributes:S}):{}}),d.ended&&(m("expedition",1),v&&m("boss",1)),d.insights&&m("insight",d.insights),d},advanceNode:()=>{let n=t();if(!n.activeExpedition||n.activeExpedition.finished)return;let r=JSON.parse(JSON.stringify(n.activeExpedition)),i=r.nodes[r.currentNode];i&&i.cleared&&(r.currentNode>=r.nodes.length-1||(r.currentNode++,e({activeExpedition:r})))},abortExpedition:()=>{let n=t();if(!n.activeExpedition)return;let r=JSON.parse(JSON.stringify(n.activeExpedition)),i={expeditionId:r.id,nodeType:"rest",result:"探险队主动撤退,保留已获奖励。",rewards:"",timestamp:Date.now()},a={result:"abort",rewards:{...r.rewards},nodeCount:r.nodes.length,finishedAt:Date.now()};e({activeExpedition:null,expeditionLog:[i,...n.expeditionLog].slice(0,30),lastExpeditionSummary:a})},dismissExpedition:()=>{let n=t();n.activeExpedition&&n.activeExpedition.finished&&e({activeExpedition:null})},doPrestige:()=>{let n=t();if(n.contact<r.CONTACT.prestigeMin)return null;let a=(0,i.computeNewBlueprints)(n),s=(0,i.performPrestige)(n),o=(0,c.constellationBonuses)(s.constellation??[]),l=r.INITIAL_STATE.energyMax+o.energyMaxBonus;return e({...s,energyMax:l,...p({tech:s.tech,blueprints:s.blueprints,achievements:s.achievements,activeTide:s.activeTide,constellation:s.constellation,attributes:s.attributes}),_lastAutoDecode:Date.now(),_lastSpawn:Date.now(),_combo:0,_lastPulse:0,_tideEvents:[]}),{newBp:a}},chooseConstellationPerk:n=>{let i=t();if(!i.pendingPerkChoices||!i.pendingPerkChoices.includes(n)||!(0,c.getPerk)(n)||i.constellation?.includes(n))return!1;let a=[...i.constellation??[],n],s=(0,c.constellationBonuses)(a),o=r.INITIAL_STATE.energyMax+s.energyMaxBonus,l=i.chronicle??[],u=l;if(l.length>0){let e=l[l.length-1],t=(0,d.withPerks)(e,[n]);u=[...l.slice(0,-1),t]}return e({constellation:a,pendingPerkChoices:null,energyMax:o,chronicle:u,...p({tech:i.tech,blueprints:i.blueprints,achievements:i.achievements,activeTide:i.activeTide,constellation:a,attributes:i.attributes})}),!0},rerollPerkChoices:()=>{let n=t();if(!n.pendingPerkChoices)return;let r=(0,c.rollPerkChoices)(n.constellation??[]);r.length>0&&e({pendingPerkChoices:r})},checkAchievements:()=>{let n=t(),r=[],i={...n.achievements},a=n.crystals,s=n.insights,l=n.contact,c=!1;for(let e of o.ACHIEVEMENTS)!i[e.id]&&e.check(n)&&(i[e.id]=!0,r.push(e),e.reward.crystals&&(a+=e.reward.crystals),e.reward.insights&&(s+=e.reward.insights),e.reward.contact&&(l=Math.min(100,l+e.reward.contact)),(e.reward.crystalsPerSecPct||e.reward.insightPct)&&(c=!0));return 0===r.length?[]:(e({achievements:i,crystals:a,insights:s,contact:l,...c?p({tech:n.tech,blueprints:n.blueprints,achievements:i,activeTide:n.activeTide,constellation:n.constellation,attributes:n.attributes}):{},_achievementQueue:[...n._achievementQueue,...r]}),r)},consumeAchievementQueue:()=>{let n=t();if(0===n._achievementQueue.length)return[];let r=n._achievementQueue;return e({_achievementQueue:[]}),r},canPrestige:()=>t().contact>=r.CONTACT.prestigeMin,toggleTheme:()=>e({theme:"dark"===t().theme?"light":"dark"}),toggleSound:()=>e({soundOn:!t().soundOn}),grantBeaconReward:(n,r)=>{let i=t();e({insights:i.insights+Math.round(n),contact:Math.min(100,i.contact+r)})},claimWeeklyBeacon:()=>{let n=(0,u.generateWeeklyChallenge)(),r=(0,u.loadWeeklyProgress)(),i=(0,u.claimWeeklyReward)(n,r);if(i.rewardInsight>0||i.rewardContact>0){let n=t();e({insights:n.insights+Math.round(i.rewardInsight),contact:Math.min(100,n.contact+i.rewardContact)}),i.entry&&(0,u.submitCloudScore)(i.entry)}return{rewardInsight:i.rewardInsight,rewardContact:i.rewardContact,score:i.score}},claimTimedBeacon:()=>{let n=(0,u.generateTimedChallenge)(),r=(0,u.loadTimedProgress)(),i=(0,u.claimTimedReward)(n,r);if(i.rewardInsight>0||i.rewardContact>0){let n=t();e({insights:n.insights+Math.round(i.rewardInsight),contact:Math.min(100,n.contact+i.rewardContact)}),i.entry&&(0,u.submitCloudScore)(i.entry)}return{rewardInsight:i.rewardInsight,rewardContact:i.rewardContact,score:i.score}},claimChainReward:n=>{let r=(0,u.loadChainState)();if(r.currentStreak<n||r.milestonesClaimed.includes(n))return{rewardInsight:0,rewardContact:0,label:"",ok:!1};let i=(0,u.claimChainMilestone)(n);if(i.rewardInsight>0||i.rewardContact>0){let n=t();e({insights:n.insights+Math.round(i.rewardInsight),contact:Math.min(100,n.contact+i.rewardContact)})}return{rewardInsight:i.rewardInsight,rewardContact:i.rewardContact,label:i.label,ok:i.rewardInsight>0||i.rewardContact>0}},grantCruiseReward:n=>{let r=t(),i=n.crystals??0,a=n.insights??0,s=n.contact??0,o=Math.max(2,Math.floor((i+10*a+10*s)/30)),l=r.attributes??(0,g.createInitialAttributes)(),c=r.attributeProgress??(0,g.createInitialAttributeProgress)(),d=(0,g.levelUpCheck)({exp:c.exploration.exp+o,level:l.exploration},g.ATTRIBUTE_HARD_CAP),u=(0,g.levelUpCheck)({exp:c.courage.exp+Math.floor(.6*o),level:l.courage},g.ATTRIBUTE_HARD_CAP),h={...l,exploration:d.newProgress.level,courage:u.newProgress.level},m={...c,exploration:d.newProgress,courage:u.newProgress};e({crystals:Math.min(r.crystalCap,r.crystals+i),insights:r.insights+Math.round(a),contact:Math.min(100,r.contact+s),attributes:h,attributeProgress:m,...p({tech:r.tech,blueprints:r.blueprints,achievements:r.achievements,activeTide:r.activeTide,constellation:r.constellation,attributes:h})})},allocateAttribute:(n,r=1)=>{let i=t(),a=i.attributes??(0,g.createInitialAttributes)(),s=a[n]??0;if(s>=g.ATTRIBUTE_HARD_CAP||(i.pendingAttrPoints??0)<r)return{ok:!1,leveledUp:0};let o=Math.min(r,g.ATTRIBUTE_HARD_CAP-s,i.pendingAttrPoints),l=s+o,c={...a,[n]:l},d=i.attributeProgress??(0,g.createInitialAttributeProgress)(),u=d[n]??{exp:0,level:s};return e({attributes:c,attributeProgress:{...d,[n]:{exp:u.exp,level:l}},pendingAttrPoints:i.pendingAttrPoints-o,...p({tech:i.tech,blueprints:i.blueprints,achievements:i.achievements,activeTide:i.activeTide,constellation:i.constellation,attributes:c})}),{ok:!0,leveledUp:o}},gainAttributeExp:(n,r)=>{let i=t(),a=i.attributes??(0,g.createInitialAttributes)(),s=i.attributeProgress??(0,g.createInitialAttributeProgress)(),o=s[n]??{exp:0,level:a[n]},l=(0,g.levelUpCheck)({exp:o.exp+r,level:a[n]},g.ATTRIBUTE_HARD_CAP),c={...a,[n]:l.newProgress.level};return e({attributes:c,attributeProgress:{...s,[n]:l.newProgress},...p({tech:i.tech,blueprints:i.blueprints,achievements:i.achievements,activeTide:i.activeTide,constellation:i.constellation,attributes:c})}),{leveledUp:l.levelsGained,newLevel:l.newProgress.level}}}),{name:"echo-nexus-save-v1",storage:(0,n.createJSONStorage)(()=>localStorage),partialize:e=>{let{_lastAutoDecode:t,_lastSpawn:n,_combo:r,_lastPulse:i,_achievementQueue:a,_tideEvents:s,globalTide:o,...l}=e;return l}}));function y(e){for(let t of r.FRAGMENTS)if(e<t.threshold)return t.threshold;return null}e.s(["nextFragmentThreshold",()=>y,"useGameStore",0,b])},19455,91918,e=>{"use strict";var t=e.i(43476),n=e.i(71645),r=e.i(20783),i=Symbol.for("react.lazy"),a=n[" use ".trim().toString()];function s(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===i&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}function o(e){var i;let o,l=(i=e,(o=n.forwardRef((e,t)=>{let{children:i,...o}=e;if(s(i)&&"function"==typeof a&&(i=a(i._payload)),n.isValidElement(i)){var l;let e,a,s=(l=i,(a=(e=Object.getOwnPropertyDescriptor(l.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.ref:(a=(e=Object.getOwnPropertyDescriptor(l,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.props.ref:l.props.ref||l.ref),c=function(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...a}:"className"===r&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}(o,i.props);return i.type!==n.Fragment&&(c.ref=t?(0,r.composeRefs)(t,s):s),n.cloneElement(i,c)}return n.Children.count(i)>1?n.Children.only(null):null})).displayName=`${i}.SlotClone`,o),c=n.forwardRef((e,r)=>{let{children:i,...o}=e;s(i)&&"function"==typeof a&&(i=a(i._payload));let c=n.Children.toArray(i),u=c.find(d);if(u){let e=u.props.children,i=c.map(t=>t!==u?t:n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null);return(0,t.jsx)(l,{...o,ref:r,children:n.isValidElement(e)?n.cloneElement(e,void 0,i):null})}return(0,t.jsx)(l,{...o,ref:r,children:i})});return c.displayName=`${e}.Slot`,c}var l=o("Slot"),c=Symbol("radix.slottable");function d(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===c}e.s(["Slot",()=>l,"createSlot",()=>o],91918);var u=e.i(25913),h=e.i(75157);let g=(0,u.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function p({className:e,variant:n,size:r,asChild:i=!1,...a}){return(0,t.jsx)(i?l:"button",{"data-slot":"button",className:(0,h.cn)(g({variant:n,size:r,className:e})),...a})}e.s(["Button",()=>p],19455)},83086,e=>{"use strict";let t=(0,e.i(75254).default)("sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);e.s(["Sparkles",()=>t],83086)}]);