PageSourceSearch

https://minesweeperxcore.com/chunk-FNC4IIFW.js

js minesweeperxcore.com collected 2026-09-30 16:35:56 UTC 3,099 bytes, 1 lines download raw bytes

1import{a,n as s,o as g,p as u}from"./chunk-I4DQX4IC.js";import{T as E}from"./chunk-H32UXDEZ.js";import{a as f,b as p}from"./chunk-D7YYRZS5.js";var _=(()=>{let t=class t{loadPendingConfigEntry(){let e=s(this.CONFIG_KEY);if(!e)return null;try{let r=JSON.parse(e);return this.isStoredPendingClassicConfig(r)?p(f({},r),{config:this.normalizeConfig(r.config)}):{config:this.normalizeConfig(r),createdAt:0}}catch(r){return console.error("Failed to parse pending config",r),null}}isStoredPendingClassicConfig(e){return!!e&&typeof e=="object"&&"config"in e&&"createdAt"in e}storeClearBarrier(e){g(this.CLEAR_BARRIER_KEY,JSON.stringify({clearedAt:e}))}clearClearBarrier(){u(this.CLEAR_BARRIER_KEY)}loadClearBarrier(){let e=s(this.CLEAR_BARRIER_KEY);if(!e)return null;try{let r=JSON.parse(e);return typeof r?.clearedAt!="number"?null:r}catch{return null}}shouldIgnoreIncomingSave(e){if(!e)return!1;let r=this.loadClearBarrier();return!!r&&r.clearedAt>e.timestamp}getPendingConfigCreatedAt(){return this.loadPendingConfigEntry()?.createdAt??null}getLaunchState(){let e=this.loadPendingConfigEntry(),r=this.loadGame(),i=e?.createdAt??0;return{pendingConfig:e?.config??null,savedGame:r,shouldStartNewGame:!!e&&(!r||i>=r.timestamp)}}constructor(){this.STORAGE_KEY="minesweeper_classic_save",this.CONFIG_KEY="minesweeper_classic_config",this.CLEAR_BARRIER_KEY="minesweeper_classic_save_clear_barrier"}savePendingConfig(e){let r={config:this.normalizeConfig(e),createdAt:Date.now()};g(this.CONFIG_KEY,JSON.stringify(r))}loadPendingConfig(){return this.loadPendingConfigEntry()?.config??null}clearPendingConfig(){u(this.CONFIG_KEY)}hasSavedGame(){return!!s(this.STORAGE_KEY)}saveGame(e,r,i,o,S,l,d){if(o==="won"||o==="lost"||o==="locked"){this.clearGame();return}let C=[];for(let c=0;c<r.length;c++)for(let m=0;m<r[c].length;m++){let n=r[c][m];C.push({r:n.row,c:n.col,mine:n.hasMine,revealed:n.revealed,flagged:n.flagged,adj:n.adjacentMines})}let y={config:this.normalizeConfig(e),grid:C,timeElapsed:i,gameState:o,minesLeft:S,cameraPos:l?{x:l.x,y:l.y,z:l.z}:void 0,cameraTarget:d?{x:d.x,y:d.y,z:d.z}:void 0,timestamp:Date.now()};this.persistSavedGame(y)}loadGame(){let e=s(this.STORAGE_KEY);if(!e)return null;try{let r=JSON.parse(e);return p(f({},r),{config:this.normalizeConfig(r.config)})}catch(r){return console.error("Failed to parse saved game",r),null}}clearGame(){let e=Date.now();this.storeClearBarrier(e),u(this.STORAGE_KEY),a.suspended||a.onClassicSaveSaved(null)}replaceSavedGame(e){if(!e){this.clearGame();return}this.shouldIgnoreIncomingSave(e)||this.persistSavedGame(e)}persistSavedGame(e){this.clearClearBarrier(),g(this.STORAGE_KEY,JSON.stringify(e)),a.suspended||a.onClassicSaveSaved(e)}normalizeConfig(e){let r=e?.boosters??e?.loadout,i=Array.isArray(e?.challenges)?e.challenges:Array.isArray(e?.modifiers)?e.modifiers:[];return f({difficulty:e?.difficulty,challenges:i,xpMultiplier:typeof e?.xpMultiplier=="number"?e.xpMultiplier:1},r?{boosters:r}:{})}};t.\u0275fac=function(r){return new(r||t)},t.\u0275prov=E({token:t,factory:t.\u0275fac,providedIn:"root"});let h=t;return h})();export{_ as a};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.