{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(Df),this.root.sharedNodes.clear()}}}function S2(e){e.updateLayout()}function k2(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=n.source!==e.layout.source;i==="size"?rt(h=>{const m=o?n.measuredBox[h]:n.layoutBox[h],p=Je(m);m.min=r[h].min,m.max=m.min+p}):W0(i,n.layoutBox,r)&&rt(h=>{const m=o?n.measuredBox[h]:n.layoutBox[h],p=Je(r[h]);m.max=m.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+p)});const l=rr();us(l,r,n.layoutBox);const c=rr();o?us(c,e.applyTransform(s,!0),n.measuredBox):us(c,r,n.layoutBox);const u=!z0(l);let d=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:m,layout:p}=h;if(m&&p){const S=pe();ds(S,n.layoutBox,m.layoutBox);const x=pe();ds(x,r,p.layoutBox),H0(S,x)||(d=!0),h.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=S,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function b2(e){Xr&&kn.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function T2(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function N2(e){e.clearSnapshot()}function Df(e){e.clearMeasurements()}function C2(e){e.isLayoutDirty=!1}function E2(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Lf(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function j2(e){e.resolveTargetDelta()}function M2(e){e.calcProjection()}function _2(e){e.resetSkewAndRotation()}function P2(e){e.removeLeadSnapshot()}function If(e,t,n){e.translate=ue(t.translate,0,n),e.scale=ue(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Of(e,t,n,r){e.min=ue(t.min,n.min,r),e.max=ue(t.max,n.max,r)}function A2(e,t,n,r){Of(e.x,t.x,n.x,r),Of(e.y,t.y,n.y,r)}function R2(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const D2={duration:.45,ease:[.4,0,.1,1]},Ff=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Vf=Ff("applewebkit/")&&!Ff("chrome/")?Math.round:Xe;function Bf(e){e.min=Vf(e.min),e.max=Vf(e.max)}function L2(e){Bf(e.x),Bf(e.y)}function W0(e,t,n){return e==="position"||e==="preserve-aspect"&&!Fw(Pf(t),Pf(n),.2)}function I2(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const O2=G0({attachResizeListener:(e,t)=>Rs(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ka={current:void 0},Y0=G0({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ka.current){const e=new O2({});e.mount(window),e.setOptions({layoutScroll:!0}),ka.current=e}return ka.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),F2={pan:{Feature:e2},drag:{Feature:Jw,ProjectionNode:Y0,MeasureLayout:V0}};function Uf(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&ae.postRender(()=>i(t,Hs(t)))}class V2 extends pn{mount(){const{current:t}=this.node;t&&(this.unmount=Vv(t,n=>(Uf(this.node,n,"Start"),r=>Uf(this.node,r,"End"))))}unmount(){}}class B2 extends pn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=zs(Rs(this.node.current,"focus",()=>this.onFocus()),Rs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function zf(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&ae.postRender(()=>i(t,Hs(t)))}class U2 extends pn{mount(){const{current:t}=this.node;t&&(this.unmount=Hv(t,n=>(zf(this.node,n,"Start"),(r,{success:s})=>zf(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Vl=new WeakMap,ba=new WeakMap,z2=e=>{const t=Vl.get(e.target);t&&t(e)},H2=e=>{e.forEach(z2)};function $2({root:e,...t}){const n=e||document;ba.has(n)||ba.set(n,{});const r=ba.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(H2,{root:e,...t})),r[s]}function G2(e,t,n){const r=$2(t);return Vl.set(e,n),r.observe(e),()=>{Vl.delete(e),r.unobserve(e)}}const W2={some:0,all:1};class Y2 extends pn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:W2[s]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),m=u?d:h;m&&m(c)};return G2(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(q2(t,n))&&this.startObserver()}unmount(){}}function q2({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const K2={inView:{Feature:Y2},tap:{Feature:U2},focus:{Feature:B2},hover:{Feature:V2}},Q2={layout:{ProjectionNode:Y0,MeasureLayout:V0}},Bl={current:null},q0={current:!1};function X2(){if(q0.current=!0,!!Fc)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Bl.current=e.matches;e.addListener(t),t()}else Bl.current=!1}const Z2=[...v0,Ae,dn],J2=e=>Z2.find(x0(e)),Hf=new WeakMap;function eS(e,t,n){for(const r in t){const s=t[r],i=n[r];if(De(s))e.addValue(r,s);else if(De(i))e.addValue(r,Ps(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,Ps(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const $f=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class tS{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=du,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Et.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),q0.current||X2(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Bl.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Hf.delete(this.current),this.projection&&this.projection.unmount(),un(this.notifyUpdate),un(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Fn.has(t),s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&ae.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in wr){const n=wr[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<$f.length;r++){const s=$f[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=eS(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ps(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(g0(s)||a0(s))?s=parseFloat(s):!J2(s)&&dn.test(n)&&(s=h0(t,n)),this.setBaseTarget(t,De(s)?s.get():s)),De(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=Gc(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!De(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new iu),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class K0 extends tS{constructor(){super(...arguments),this.KeyframeResolver=w0}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;De(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function nS(e){return window.getComputedStyle(e)}class rS extends K0{constructor(){super(...arguments),this.type="html",this.renderInstance=Ip}readValueFromInstance(t,n){if(Fn.has(n)){const r=uu(n);return r&&r.default||0}else{const r=nS(t),s=(Rp(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return O0(t,n)}build(t,n,r){qc(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Zc(t,n,r)}}class sS extends K0{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=pe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Fn.has(n)){const r=uu(n);return r&&r.default||0}return n=Op.has(n)?n:zc(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Bp(t,n,r)}build(t,n,r){Kc(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){Fp(t,n,r,s)}mount(t){this.isSVGTag=Xc(t.tagName),super.mount(t)}}const iS=(e,t)=>$c(e)?new sS(t):new rS(t,{allowProjection:e!==v.Fragment}),oS=Av({...Mw,...K2,...F2,...Q2},iS),Y=Yx(oS);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */var aS={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const lS=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),G=(e,t)=>{const n=v.forwardRef(({color:r="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:l="",children:c,...u},d)=>v.createElement("svg",{ref:d,...aS,width:s,height:s,stroke:r,strokeWidth:o?Number(i)*24/Number(s):i,className:["lucide",`lucide-${lS(e)}`,l].join(" "),...u},[...t.map(([h,m])=>v.createElement(h,m)),...Array.isArray(c)?c:[c]]));return n.displayName=`${e}`,n};/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const pu=G("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const cS=G("Award",[["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}],["path",{d:"M15.477 12.89 17 22l-5-3-5 3 1.523-9.11",key:"em7aur"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const uS=G("Battery",[["rect",{width:"16",height:"10",x:"2",y:"7",rx:"2",ry:"2",key:"1w10f2"}],["line",{x1:"22",x2:"22",y1:"11",y2:"13",key:"4dh1rd"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const dS=G("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const fS=G("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const hS=G("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const mS=G("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Q0=G("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const pS=G("ClipboardPenLine",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",key:"1oijnt"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-.5",key:"1but9f"}],["path",{d:"M16 4h2a2 2 0 0 1 1.73 1",key:"1p8n7l"}],["path",{d:"M8 18h1",key:"13wk12"}],["path",{d:"M18.4 9.6a2 2 0 0 1 3 3L17 17l-4 1 1-4Z",key:"yg2pdb"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const kr=G("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const X0=G("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const gS=G("Coffee",[["path",{d:"M17 8h1a4 4 0 1 1 0 8h-1",key:"jx4kbh"}],["path",{d:"M3 8h14v9a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4Z",key:"1bxrl0"}],["line",{x1:"6",x2:"6",y1:"2",y2:"4",key:"1cr9l3"}],["line",{x1:"10",x2:"10",y1:"2",y2:"4",key:"170wym"}],["line",{x1:"14",x2:"14",y1:"2",y2:"4",key:"1c5f70"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const yS=G("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const xS=G("Crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const vS=G("Disc3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M6 12c0-1.7.7-3.2 1.8-4.2",key:"oqkarx"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M18 12c0 1.7-.7 3.2-1.8 4.2",key:"1eah9h"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Z0=G("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const wS=G("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const SS=G("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const co=G("Gamepad2",[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const kS=G("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const bS=G("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const gu=G("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const J0=G("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const TS=G("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const NS=G("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const CS=G("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const ES=G("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const jS=G("Map",[["polygon",{points:"3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21",key:"ok2ie8"}],["line",{x1:"9",x2:"9",y1:"3",y2:"18",key:"w34qz5"}],["line",{x1:"15",x2:"15",y1:"6",y2:"21",key:"volv9a"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const eg=G("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const MS=G("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const tg=G("Minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const _S=G("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Gf=G("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const ng=G("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Io=G("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const PS=G("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const AS=G("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const rg=G("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const sg=G("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const uo=G("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const RS=G("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Oo=G("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const br=G("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Wf=G("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const DS=G("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const ig=G("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const LS=G("Swords",[["polyline",{points:"14.5 17.5 3 6 3 3 6 3 17.5 14.5",key:"1hfsw2"}],["line",{x1:"13",x2:"19",y1:"19",y2:"13",key:"1vrmhu"}],["line",{x1:"16",x2:"20",y1:"16",y2:"20",key:"1bron3"}],["line",{x1:"19",x2:"21",y1:"21",y2:"19",key:"13pww6"}],["polyline",{points:"14.5 6.5 18 3 21 3 21 6 17.5 9.5",key:"hbey2j"}],["line",{x1:"5",x2:"9",y1:"14",y2:"18",key:"1hf58s"}],["line",{x1:"7",x2:"4",y1:"17",y2:"20",key:"pidxm4"}],["line",{x1:"3",x2:"5",y1:"19",y2:"21",key:"1pehsh"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const og=G("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Ds=G("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const IS=G("TestTube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5h0c-1.4 0-2.5-1.1-2.5-2.5V2",key:"187lwq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const OS=G("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const FS=G("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const VS=G("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Ln=G("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const BS=G("Unlock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const US=G("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const ag=G("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const zS=G("Volume1",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const fo=G("Volume2",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}],["path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",key:"1kegas"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const ho=G("VolumeX",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const lg=G("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const $s=G("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
+ * @license lucide-react v0.344.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Gs=G("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),Gt=30,Ta=[{x:15,y:15}],yn={x:1,y:0},HS=120,$S=5e3,Yf=10,qf=3;function GS(){const[e,t]=v.useState({snake:Ta,food:[],direction:yn,score:0,highScore:parseInt(localStorage.getItem("snakeHighScore")||"0"),level:1,lives:qf,combo:1,gameState:"menu",gameMode:"classic",powerUps:[],activePowerUp:null,powerUpTimer:0,obstacles:[],achievements:JSON.parse(localStorage.getItem("snakeAchievements")||"[]"),stats:{foodEaten:0,powerUpsCollected:0,obstaclesDestroyed:0,timePlayed:0}}),n=v.useRef(yn),r=v.useRef(yn),s=v.useCallback(()=>{let p;do p={x:Math.floor(Math.random()*Gt),y:Math.floor(Math.random()*Gt)};while(e.snake.some(S=>S.x===p.x&&S.y===p.y)||e.obstacles.some(S=>S.x===p.x&&S.y===p.y));return p},[e.snake,e.obstacles]),i=v.useCallback(()=>{const p=[{type:"normal",weight:.7,points:10,color:"#00FF00"},{type:"bonus",weight:.2,points:30,color:"#FFD700"},{type:"mega",weight:.08,points:50,color:"#FF00FF"},{type:"special",weight:.02,points:100,color:"#00FFFF"}],S=Math.random();let x=0,k=p[0];for(const f of p)if(x+=f.weight,S<=x){k=f;break}const g={position:s(),points:k.points*e.level,color:k.color,type:k.type,id:`food-${Date.now()}-${Math.random()}`};t(f=>({...f,food:[...f.food,g]}))},[s,e.level]),o=v.useCallback(()=>{const p=["speed","ghost","multiplier","slow","matrix_vision","bullet_time","digital_clone","hack_mode","data_stream"],S=p[Math.floor(Math.random()*p.length)],x={position:s(),type:S,id:`powerup-${Date.now()}-${Math.random()}`};t(k=>({...k,powerUps:[...k.powerUps,x]}))},[s]),l=v.useCallback(p=>{const S=Math.min(p*2,20),x=[];for(let k=0;k({...k,obstacles:x}))},[s]),c=v.useCallback(p=>{const S=n.current;S.x===-p.x&&S.y===p.y||S.y===-p.y&&S.x===p.x||(r.current=p)},[]),u=v.useCallback(()=>{e.gameState==="playing"&&(n.current=r.current,t(p=>{const S=p.snake[0],x={x:S.x+n.current.x,y:S.y+n.current.y};if(p.gameMode==="classic")x.x=(x.x+Gt)%Gt,x.y=(x.y+Gt)%Gt;else if(x.x<0||x.x>=Gt||x.y<0||x.y>=Gt)return d(p);if(p.activePowerUp!=="ghost"&&p.activePowerUp!=="hack_mode"&&p.snake.some(w=>w.x===x.x&&w.y===x.y)||p.activePowerUp!=="hack_mode"&&p.obstacles.some(w=>w.x===x.x&&w.y===x.y))return d(p);const k=[x,...p.snake];let g={...p,snake:k};const f=p.food.findIndex(w=>w.position.x===x.x&&w.position.y===x.y);if(f!==-1){const w=p.food[f],b=p.activePowerUp==="multiplier"?3:1,N=Math.min(p.combo,Yf),T=w.points*b*N;g={...g,score:p.score+T,food:p.food.filter((j,E)=>E!==f),combo:Math.min(p.combo+.1,Yf),stats:{...p.stats,foodEaten:p.stats.foodEaten+1}},g.score>g.highScore&&(g.highScore=g.score,localStorage.setItem("snakeHighScore",g.score.toString())),g.score>=g.level*500&&(g.level+=1,l(g.level))}else g.snake.pop();const y=p.powerUps.findIndex(w=>w.position.x===x.x&&w.position.y===x.y);if(y!==-1){const w=p.powerUps[y];g={...g,powerUps:p.powerUps.filter((b,N)=>N!==y),activePowerUp:w.type,powerUpTimer:$S,stats:{...p.stats,powerUpsCollected:p.stats.powerUpsCollected+1}}}return g}))},[e.gameState,l]),d=p=>{const S=p.lives-1;return S<=0?{...p,lives:0,gameState:"game_over"}:{...p,lives:S,snake:Ta,direction:yn,combo:1,activePowerUp:null,powerUpTimer:0}},h=v.useCallback((p="classic")=>{t(S=>({...S,snake:Ta,food:[],direction:yn,score:0,level:1,lives:qf,combo:1,gameState:"playing",gameMode:p,powerUps:[],activePowerUp:null,powerUpTimer:0,obstacles:[],stats:{foodEaten:0,powerUpsCollected:0,obstaclesDestroyed:0,timePlayed:0}})),n.current=yn,r.current=yn,setTimeout(()=>i(),100)},[i]),m=v.useCallback(()=>{t(p=>({...p,gameState:p.gameState==="playing"?"paused":"playing"}))},[]);return v.useEffect(()=>{if(e.powerUpTimer>0&&e.gameState==="playing"){const p=setTimeout(()=>{t(S=>({...S,powerUpTimer:Math.max(0,S.powerUpTimer-100),activePowerUp:S.powerUpTimer<=100?null:S.activePowerUp}))},100);return()=>clearTimeout(p)}},[e.powerUpTimer,e.gameState]),v.useEffect(()=>{if(e.gameState==="playing"&&e.food.length<3){const p=setTimeout(()=>i(),2e3);return()=>clearTimeout(p)}},[e.gameState,e.food.length,i]),v.useEffect(()=>{if(e.gameState==="playing"&&e.powerUps.length===0){const p=setTimeout(()=>o(),1e4);return()=>clearTimeout(p)}},[e.gameState,e.powerUps.length,o]),{gameState:e,moveSnake:u,changeDirection:c,startGame:h,togglePause:m,getSpeed:()=>{const p=HS-(e.level-1)*10;return e.activePowerUp==="speed"?p*.5:e.activePowerUp==="slow"?p*2:e.activePowerUp==="bullet_time"?p*4:p}}}const WS=500;function yu(){const[e,t]=v.useState([]),n=v.useRef(0),r=v.useCallback(h=>{const m=[];for(let p=0;p[...p,...m].slice(-WS))},[]),s=v.useCallback((h,m,p)=>{r({x:h,y:m,count:20,type:"explosion",color:p,spread:Math.PI*2,speed:5,life:1})},[r]),i=v.useCallback((h,m,p)=>{r({x:h,y:m,count:15,type:"food",color:p,spread:Math.PI*2,speed:3,life:.8})},[r]),o=v.useCallback((h,m,p)=>{r({x:h,y:m,count:30,type:"powerup",color:p,spread:Math.PI*2,speed:4,life:1.5})},[r]),l=v.useCallback((h,m,p)=>{r({x:h,y:m,count:3,type:"trail",color:p,spread:.5,speed:.5,life:.5})},[r]),c=v.useCallback(h=>{const m=Math.random()*h;r({x:m,y:-10,count:1,type:"matrix",spread:0,speed:2,life:3})},[r]);v.useEffect(()=>{const h=setInterval(()=>{t(m=>m.map(p=>{const S=p.life-.016;return S<=0?null:{...p,x:p.x+p.vx,y:p.y+p.vy+(p.gravity||0),vy:p.vy+(p.gravity||0),life:S,size:p.fade?p.size*(S/p.maxLife):p.size}}).filter(p=>p!==null))},16);return()=>clearInterval(h)},[]);const u=v.useCallback(()=>{t([])},[]),d=v.useCallback(h=>{e.forEach(m=>{h.save();const p=m.fade?m.life/m.maxLife:1;m.glow&&(h.shadowBlur=m.size*2,h.shadowColor=m.color),h.fillStyle=m.color.includes("rgba")?m.color:`${m.color}${Math.floor(p*255).toString(16).padStart(2,"0")}`,m.type==="matrix"?(h.font=`${m.size*10}px monospace`,h.fillText(String.fromCharCode(12448+Math.random()*96),m.x,m.y)):(h.beginPath(),h.arc(m.x,m.y,m.size,0,Math.PI*2),h.fill()),h.restore()})},[e]);return{particles:e,emit:r,explode:s,collectFood:i,activatePowerUp:o,createTrail:l,createMatrixRain:c,clear:u,render:d,count:e.length}}function YS(e,t){const n=v.useRef(e);v.useEffect(()=>{n.current=e},[e]),v.useEffect(()=>{if(t!==null){const r=setInterval(()=>n.current(),t);return()=>clearInterval(r)}},[t])}const Kf={music:!0,sfx:!0,masterVolume:.7,musicVolume:.4,sfxVolume:.6},Na={jump:{type:"jump",frequency:{start:440,end:220},oscillatorType:"sine",duration:.2,attack:.01,decay:.1,sustain:.3,release:.1,filterType:"lowpass",filterFreq:800},hit:{type:"hit",frequency:{start:200,end:50},oscillatorType:"sawtooth",duration:.3,attack:.001,decay:.05,sustain:.1,release:.24,filterType:"lowpass",filterFreq:400},score:{type:"score",frequency:{start:523,end:784},oscillatorType:"square",duration:.25,attack:.02,decay:.08,sustain:.6,release:.15,filterType:"bandpass",filterFreq:1500},powerup:{type:"powerup",frequency:{start:659,end:1046},oscillatorType:"triangle",duration:.4,attack:.05,decay:.1,sustain:.7,release:.25,filterType:"highpass",filterFreq:500,reverb:!0},levelUp:{type:"levelUp",frequency:{start:880,end:1760},oscillatorType:"square",duration:.6,attack:.1,decay:.2,sustain:.8,release:.3,filterType:"bandpass",filterFreq:2e3,reverb:!0},combo:{type:"combo",frequency:{start:349,end:523},oscillatorType:"triangle",duration:.15,attack:.01,decay:.05,sustain:.5,release:.09,filterType:"bandpass",filterFreq:1200},gameOver:{type:"gameOver",frequency:{start:220,end:110},oscillatorType:"sawtooth",duration:1,attack:.1,decay:.3,sustain:.4,release:.6,filterType:"lowpass",filterFreq:300,reverb:!0},menu:{type:"menu",frequency:{start:440,end:523},oscillatorType:"sine",duration:.1,attack:.02,decay:.03,sustain:.3,release:.05,filterType:"bandpass",filterFreq:1e3},snakeEat:{type:"snakeEat",frequency:{start:800,end:1200},oscillatorType:"square",duration:.15,attack:.01,decay:.04,sustain:.4,release:.1,filterType:"bandpass",filterFreq:1600},pongBounce:{type:"pongBounce",frequency:{start:300,end:600},oscillatorType:"triangle",duration:.1,attack:.005,decay:.02,sustain:.3,release:.065,filterType:"bandpass",filterFreq:900},terminalType:{type:"terminalType",frequency:{start:1e3,end:1e3},oscillatorType:"square",duration:.05,attack:.001,decay:.01,sustain:.2,release:.039,filterType:"highpass",filterFreq:800},matrixRain:{type:"matrixRain",frequency:{start:220,end:330},oscillatorType:"sine",duration:.8,attack:.2,decay:.2,sustain:.3,release:.3,filterType:"lowpass",filterFreq:600}},Qf={menu:{notes:[220,246.94,261.63,293.66,329.63,349.23,392],rhythm:[.5,.25,.5,.25,.5,.25,1],tempo:120,loop:!0},gameplay:{notes:[174.61,196,220,246.94,261.63,293.66],rhythm:[.5,.5,.25,.25,.5,.5],tempo:100,loop:!0},intense:{notes:[130.81,146.83,164.81,174.61,196,220],rhythm:[.25,.25,.25,.25,.5,.5],tempo:140,loop:!0}};function Mr(){const[e,t]=v.useState(()=>{const x=localStorage.getItem("matrix-arcade-audio-config");return x?{...Kf,...JSON.parse(x)}:Kf}),n=v.useRef(null),r=v.useRef(null),s=v.useRef(null),i=v.useRef(null),o=v.useRef(null),l=v.useRef(null),c=v.useRef(null),u=v.useCallback((x,k,g,f)=>{const y=x.createBuffer(k,g*f,g);for(let w=0;w{if(n.current)return n.current;try{const x=window.AudioContext||window.webkitAudioContext,k=new x;n.current=k;const g=k.createGain();g.gain.setValueAtTime(e.masterVolume,k.currentTime),g.connect(k.destination),s.current=g;const f=k.createGain();f.gain.setValueAtTime(e.musicVolume,k.currentTime),f.connect(g),i.current=f;const y=k.createGain();y.gain.setValueAtTime(e.sfxVolume,k.currentTime),y.connect(g),o.current=y;const w=k.createConvolver(),b=u(k,2,44100,1.5);return w.buffer=b,c.current=w,k}catch(x){return console.warn("Failed to initialize audio context:",x),null}},[e.masterVolume,e.musicVolume,e.sfxVolume,u]),h=v.useCallback(async(x,k)=>{if(!e.sfx)return;const g=await d();if(!g||!o.current)return;const f=k?{...Na[x],...k}:Na[x];if(!f){console.warn(`Sound effect '${x}' not found in library`);return}try{const y=g.createOscillator();y.type=f.oscillatorType,y.frequency.setValueAtTime(f.frequency.start,g.currentTime),y.frequency.exponentialRampToValueAtTime(f.frequency.end,g.currentTime+f.duration);const w=g.createGain();if(w.gain.setValueAtTime(0,g.currentTime),w.gain.linearRampToValueAtTime(1,g.currentTime+f.attack),w.gain.linearRampToValueAtTime(f.sustain,g.currentTime+f.attack+f.decay),w.gain.linearRampToValueAtTime(0,g.currentTime+f.duration),f.filterType&&f.filterFreq){const b=g.createBiquadFilter();b.type=f.filterType,b.frequency.setValueAtTime(f.filterFreq,g.currentTime),b.Q.setValueAtTime(1,g.currentTime),y.connect(b),b.connect(w)}else y.connect(w);if(f.reverb&&c.current){const b=g.createGain();b.gain.setValueAtTime(.3,g.currentTime);const N=g.createGain();N.gain.setValueAtTime(.7,g.currentTime),w.connect(N),w.connect(b),b.connect(c.current),c.current.connect(o.current),N.connect(o.current)}else w.connect(o.current);y.start(g.currentTime),y.stop(g.currentTime+f.duration)}catch(y){console.warn("Error playing sound effect:",y)}},[e.sfx,d]),m=v.useCallback(async x=>{if(!e.music)return;r.current&&(r.current.stop(),r.current=null);const k=await d();if(!k||!i.current)return;l.current=x;const g=Qf[x];try{const f=()=>{if(l.current!==x)return;let y=k.currentTime;const w=60/g.tempo;if(g.notes.forEach((b,N)=>{const T=g.rhythm[N],j=w*T,E=k.createOscillator();E.type="triangle",E.frequency.setValueAtTime(b,y);const C=k.createGain();C.gain.setValueAtTime(0,y),C.gain.linearRampToValueAtTime(.1,y+.02),C.gain.linearRampToValueAtTime(.05,y+j*.7),C.gain.linearRampToValueAtTime(0,y+j);const _=k.createBiquadFilter();_.type="lowpass",_.frequency.setValueAtTime(1200,y),_.Q.setValueAtTime(.5,y),E.connect(_),_.connect(C),C.connect(i.current),E.start(y),E.stop(y+j),y+=j}),g.loop&&l.current===x){const b=g.rhythm.reduce((N,T)=>N+T*w,0);setTimeout(f,b*1e3)}};f()}catch(f){console.warn("Error playing background music:",f)}},[e.music,d]),p=v.useCallback(()=>{l.current=null,r.current&&(r.current.stop(),r.current=null)},[]),S=v.useCallback(x=>{const k={...e,...x};t(k),localStorage.setItem("matrix-arcade-audio-config",JSON.stringify(k)),s.current&&k.masterVolume!==e.masterVolume&&s.current.gain.setValueAtTime(k.masterVolume,0),i.current&&k.musicVolume!==e.musicVolume&&i.current.gain.setValueAtTime(k.musicVolume,0),o.current&&k.sfxVolume!==e.sfxVolume&&o.current.gain.setValueAtTime(k.sfxVolume,0)},[e]);return v.useEffect(()=>()=>{p(),n.current&&n.current.state!=="closed"&&n.current.close()},[p]),{config:e,updateConfig:S,playSFX:h,playMusic:m,stopMusic:p,isInitialized:!!n.current,soundLibrary:Object.keys(Na),musicSequences:Object.keys(Qf)}}const Ca={speed:"#FF6B6B",ghost:"#A8DADC",multiplier:"#FFD93D",slow:"#6BCF7F",matrix_vision:"#00FF00",bullet_time:"#FF00FF",digital_clone:"#00FFFF",hack_mode:"#FF8800",data_stream:"#8B00FF"},qS={speed:"⚡",ghost:"👻",multiplier:"×3",slow:"🐌",matrix_vision:"👁",bullet_time:"⏱",digital_clone:"👥",hack_mode:"💻",data_stream:"📡"};function KS({snake:e,food:t,obstacles:n,powerUps:r,activePowerUp:s,gameState:i,gridSize:o,cellSize:l}){const c=v.useRef(null),u=v.useRef(null),d=yu(),h=v.useRef(0),m=v.useRef({x:-1,y:-1});v.useEffect(()=>{const k=u.current;if(!k)return;const g=k.getContext("2d");if(!g)return;const y=setInterval(()=>{g.fillStyle="rgba(0, 0, 0, 0.05)",g.fillRect(0,0,k.width,k.height),Math.random()<.1&&d.createMatrixRain(k.width)},50);return()=>{clearInterval(y)}},[d]);const p=v.useCallback(()=>{const k=c.current,g=u.current;if(!k||!g)return;const f=k.getContext("2d"),y=g.getContext("2d");if(!(!f||!y)){f.clearRect(0,0,k.width,k.height),f.strokeStyle=s==="matrix_vision"?"#00FF0040":"#00FF0010",f.lineWidth=1;for(let w=0;w<=o;w++)f.beginPath(),f.moveTo(w*l,0),f.lineTo(w*l,k.height),f.stroke(),f.beginPath(),f.moveTo(0,w*l),f.lineTo(k.width,w*l),f.stroke();n.forEach(w=>{f.save(),s==="hack_mode"&&(f.globalAlpha=.3);const b=Math.sin(Date.now()*.002+w.x+w.y)*2;f.fillStyle="#FF0000",f.shadowBlur=15+b,f.shadowColor="#FF0000",f.fillRect(w.x*l+2,w.y*l+2,l-4,l-4),f.strokeStyle="#FFFF00",f.lineWidth=2,f.setLineDash([5,5]),f.strokeRect(w.x*l+2,w.y*l+2,l-4,l-4),f.setLineDash([]),f.restore()}),t.forEach(w=>{f.save();const b=Math.sin(Date.now()*.005)*3,N=Date.now()*.002;switch(f.translate(w.position.x*l+l/2,w.position.y*l+l/2),f.rotate(N),f.shadowBlur=20+b,f.shadowColor=w.color,w.type){case"special":S(f,0,0,l/3,l/6,8);break;case"mega":f.beginPath(),f.moveTo(0,-l/3),f.lineTo(l/3,0),f.lineTo(0,l/3),f.lineTo(-l/3,0),f.closePath();break;case"bonus":x(f,0,0,l/3,6);break;default:f.beginPath(),f.arc(0,0,l/3,0,Math.PI*2),f.closePath()}f.fillStyle=w.color,f.fill(),f.fillStyle="#FFFFFF40",f.beginPath(),f.arc(-l/8,-l/8,l/6,0,Math.PI*2),f.fill(),f.restore()}),r.forEach(w=>{if(!w.type)return;f.save();const b=Math.sin(Date.now()*.003)*.2+.8,N=Math.sin(Date.now()*.002)*3;f.translate(w.position.x*l+l/2,w.position.y*l+l/2+N),f.scale(b,b),f.rotate(Date.now()*.001),f.strokeStyle=Ca[w.type],f.lineWidth=3,f.shadowBlur=20,f.shadowColor=Ca[w.type],f.beginPath(),f.arc(0,0,l/2.5,0,Math.PI*2),f.stroke(),f.font=`${l*.6}px Arial`,f.textAlign="center",f.textBaseline="middle",f.fillStyle="#FFFFFF",f.fillText(qS[w.type],0,0),f.restore()}),e.forEach((w,b)=>{f.save();const N=b===0,T=1-b/e.length*.3;N&&i==="playing"&&(w.x!==m.current.x||w.y!==m.current.y)&&(d.createTrail(w.x*l+l/2,w.y*l+l/2,s?Ca[s]:"#00FF00"),m.current=w);let j="#00FF00";s==="ghost"?(j="#FFFFFF",f.globalAlpha=.5*T):s==="hack_mode"?j="#FF8800":s==="matrix_vision"?j="#00FFFF":f.globalAlpha=T,f.shadowBlur=N?20:10,f.shadowColor=j;const E=N?l-2:l-4,C=N?1:2;if(N){f.fillStyle=j,f.fillRect(w.x*l+C,w.y*l+C,E,E),f.fillStyle="#000000";const _=l/8,P=l/4;f.fillRect(w.x*l+P,w.y*l+P,_,_),f.fillRect(w.x*l+l-P-_,w.y*l+P,_,_)}else f.fillStyle=j,f.fillRect(w.x*l+C,w.y*l+C,E,E);f.restore()}),d.render(f),i==="game_over"&&(f.save(),f.fillStyle="rgba(255, 0, 0, 0.1)",f.fillRect(0,0,k.width,k.height),f.restore()),h.current++,requestAnimationFrame(p)}},[e,t,n,r,s,i,o,l,d]);v.useEffect(()=>{const k=requestAnimationFrame(p);return()=>cancelAnimationFrame(k)},[p]);function S(k,g,f,y,w,b){k.beginPath();for(let N=0;N{const p=Math.floor(m/60),S=m%60;return`${p}:${S.toString().padStart(2,"0")}`};return a.jsxs("div",{className:"flex flex-col gap-4 text-green-500 font-mono",children:[a.jsxs("div",{className:"flex justify-between items-start gap-4 p-4 bg-black/50 border border-green-500/30 rounded-lg backdrop-blur-sm",children:[a.jsxs("div",{className:"flex flex-col",children:[a.jsx("div",{className:"text-xs text-green-400 mb-1",children:"SCORE"}),a.jsx(Y.div,{className:"text-2xl font-bold",initial:{scale:1.2,color:"#FFD700"},animate:{scale:1,color:"#00FF00"},transition:{duration:.3},children:e.toLocaleString()},e),s>1&&a.jsxs("div",{className:"text-xs text-yellow-400 flex items-center gap-1",children:[a.jsx(VS,{className:"w-3 h-3"}),s.toFixed(1),"x Combo"]})]}),a.jsxs("div",{className:"flex flex-col items-center",children:[a.jsx("div",{className:"text-xs text-green-400 mb-1",children:"HIGH SCORE"}),a.jsxs("div",{className:"text-xl flex items-center gap-1",children:[a.jsx(Ln,{className:"w-4 h-4 text-yellow-400"}),t.toLocaleString()]})]}),a.jsxs("div",{className:"flex flex-col items-center",children:[a.jsx("div",{className:"text-xs text-green-400 mb-1",children:"LEVEL"}),a.jsx("div",{className:"text-xl font-bold",children:n}),a.jsx("div",{className:"w-20 h-1 bg-green-900 rounded-full overflow-hidden mt-1",children:a.jsx(Y.div,{className:"h-full bg-green-500",initial:{width:"0%"},animate:{width:`${e%500/5}%`}})})]}),a.jsxs("div",{className:"flex flex-col items-center",children:[a.jsx("div",{className:"text-xs text-green-400 mb-1",children:"LIVES"}),a.jsx("div",{className:"flex gap-1",children:Array.from({length:3}).map((m,p)=>a.jsx(gu,{className:`w-5 h-5 ${pa.jsxs("button",{onClick:()=>d(m),className:"p-4 bg-green-900/20 border border-green-500/50 rounded-lg hover:bg-green-900/40 transition-colors",children:[a.jsx("h3",{className:"text-lg font-bold mb-1",children:p.name}),a.jsx("p",{className:"text-xs text-green-400",children:p.description})]},m))})]})}),i==="paused"&&a.jsx(Y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 flex items-center justify-center bg-black/80 z-40",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h2",{className:"text-3xl font-bold mb-4",children:"PAUSED"}),a.jsx("p",{className:"text-green-400",children:"Press SPACE to continue"})]})}),i==="game_over"&&a.jsx(Y.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},className:"absolute inset-0 flex items-center justify-center bg-black/90 z-50",children:a.jsxs("div",{className:"text-center p-8 bg-black border-2 border-red-500 rounded-lg",children:[a.jsx("h2",{className:"text-4xl font-bold text-red-500 mb-4",children:"GAME OVER"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-6 text-left",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-green-400",children:"Final Score"}),a.jsx("p",{className:"text-2xl font-bold",children:e.toLocaleString()})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-green-400",children:"Level Reached"}),a.jsx("p",{className:"text-2xl font-bold",children:n})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-green-400",children:"Food Eaten"}),a.jsx("p",{className:"text-xl",children:u.foodEaten})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-green-400",children:"Power-ups"}),a.jsx("p",{className:"text-xl",children:u.powerUpsCollected})]})]}),e>t&&a.jsxs(Y.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.5,type:"spring"},className:"mb-4 text-yellow-400 flex items-center justify-center gap-2",children:[a.jsx(cS,{className:"w-6 h-6"}),a.jsx("span",{className:"text-xl font-bold",children:"NEW HIGH SCORE!"})]}),a.jsx("button",{onClick:()=>d(o),className:"px-6 py-3 bg-green-500 text-black font-bold rounded hover:bg-green-400 transition-colors",children:"PLAY AGAIN"})]})})]}),a.jsxs("div",{className:"flex justify-between text-xs text-green-400 px-2",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(og,{className:"w-3 h-3"}),"Food: ",u.foodEaten]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(kS,{className:"w-3 h-3"}),"Mode: ",Xf[o].name]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(kr,{className:"w-3 h-3"}),h(Math.floor(u.timePlayed))]})]})]})}const XS=30,ZS=20;function JS(){const{gameState:e,moveSnake:t,changeDirection:n,startGame:r,togglePause:s,getSpeed:i}=GS(),o=yu(),[l,c]=v.useState(0),[u,d]=v.useState(!0),h=v.useRef(null),{playSFX:m,playMusic:p,stopMusic:S}=Mr();v.useEffect(()=>(e.gameState==="playing"&&u?p("gameplay"):S(),()=>S()),[e.gameState,u,p,S]);const x=v.useCallback(y=>{if(u)switch(y){case"eat":m("snakeEat");break;case"powerup":m("powerup");break;case"collision":m("hit"),c(10);break;case"levelup":m("levelUp");break}},[u,m]);v.useEffect(()=>{const y=w=>{if(e.gameState==="menu")return;const b=w.key.toLowerCase(),N={arrowup:{x:0,y:-1},arrowdown:{x:0,y:1},arrowleft:{x:-1,y:0},arrowright:{x:1,y:0},w:{x:0,y:-1},s:{x:0,y:1},a:{x:-1,y:0},d:{x:1,y:0}};N[b]&&(w.preventDefault(),n(N[b])),(b===" "||b==="p")&&(w.preventDefault(),s()),b==="enter"&&e.gameState==="game_over"&&r(e.gameMode)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[e,n,s,r]),YS(()=>{t()},e.gameState==="playing"?i():null);const k=v.useCallback((y,w,b)=>{o.collectFood(y,w,b),x("eat")},[o,x]),g=v.useCallback((y,w)=>{o.activatePowerUp(y,w,"#FFD700"),x("powerup")},[o,x]),f=v.useCallback((y,w)=>{o.explode(y,w),x("collision")},[o,x]);return v.useEffect(()=>{if(l>0){const y=setTimeout(()=>c(w=>Math.max(0,w-1)),50);return()=>clearTimeout(y)}},[l]),v.useEffect(()=>{if(e.gameState==="playing"){const y=setInterval(()=>{},1e3);return()=>clearInterval(y)}},[e.gameState]),a.jsxs("div",{className:"relative w-full h-full bg-black overflow-hidden",children:[a.jsx("div",{className:"absolute inset-0 opacity-20",children:a.jsx("div",{className:"matrix-rain"})}),a.jsxs("div",{ref:h,className:"relative flex flex-col items-center justify-center h-full p-4 gap-4",style:{transform:l>0?`translate(${(Math.random()-.5)*l}px, ${(Math.random()-.5)*l}px)`:"none"},children:[a.jsxs("div",{className:"flex items-center justify-between w-full max-w-[800px]",children:[a.jsxs("div",{className:"flex items-center gap-2 text-green-500",children:[a.jsx(co,{className:"w-6 h-6"}),a.jsx("h1",{className:"text-2xl font-bold font-mono",children:"SNAKE CLASSIC"}),a.jsx("span",{className:"text-xs text-green-400",children:"ENHANCED EDITION"})]}),a.jsx("button",{onClick:()=>d(!u),className:"p-2 hover:bg-green-900/50 rounded transition-colors text-green-500","aria-label":u?"Mute sound":"Unmute sound",children:u?a.jsx(fo,{className:"w-5 h-5"}):a.jsx(ho,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"flex gap-6 items-start",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-green-900/20 to-transparent rounded-lg"}),a.jsx("div",{className:"relative border-2 border-green-500 rounded-lg overflow-hidden shadow-2xl shadow-green-500/20",children:a.jsx(KS,{snake:e.snake,food:e.food,obstacles:e.obstacles,powerUps:e.powerUps,activePowerUp:e.activePowerUp,gameState:e.gameState,gridSize:XS,cellSize:ZS,level:e.level,combo:e.combo,onFoodCollected:k,onPowerUpCollected:g,onCollision:f})})]}),a.jsx("div",{className:"w-80",children:a.jsx(QS,{score:e.score,highScore:e.highScore,level:e.level,lives:e.lives,combo:e.combo,gameState:e.gameState,gameMode:e.gameMode,activePowerUp:e.activePowerUp,powerUpTimer:e.powerUpTimer,stats:e.stats,onStartGame:r,onTogglePause:s})})]}),a.jsxs("div",{className:"text-xs text-green-400 text-center space-y-1",children:[a.jsx("p",{children:"Use ARROW KEYS or WASD to move • SPACE to pause • ENTER to restart"}),a.jsx("p",{className:"text-green-500",children:"Collect power-ups for special abilities • Chain food for combo multiplier"})]})]}),a.jsx("style",{jsx:!0,children:`
+ .matrix-rain {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-image:
+ repeating-linear-gradient(
+ 0deg,
+ transparent,
+ transparent 2px,
+ rgba(0, 255, 0, 0.03) 2px,
+ rgba(0, 255, 0, 0.03) 4px
+ ),
+ repeating-linear-gradient(
+ 90deg,
+ transparent,
+ transparent 2px,
+ rgba(0, 255, 0, 0.03) 2px,
+ rgba(0, 255, 0, 0.03) 4px
+ );
+ animation: matrix-move 20s linear infinite;
+ }
+
+ @keyframes matrix-move {
+ 0% {
+ transform: translate(0, 0);
+ }
+ 100% {
+ transform: translate(50px, 50px);
+ }
+ }
+ `})]})}const ek=e=>{const t=v.useRef(),n=v.useRef(),r=v.useCallback(s=>{if(n.current!==void 0){const i=s-n.current;e(i)}n.current=s,t.current=requestAnimationFrame(r)},[e]);v.useEffect(()=>(t.current=requestAnimationFrame(r),()=>{t.current&&cancelAnimationFrame(t.current)}),[r])},tk=()=>{const[e,t]=v.useState([]),[n,r]=v.useState({bigger_paddle:!1,slower_ball:!1,score_multiplier:!1,multi_ball:!1}),s=v.useCallback(()=>{t(o=>{if(o.length>=2)return o;const l=["bigger_paddle","slower_ball","score_multiplier","multi_ball"],c={id:Math.random().toString(),x:200+Math.random()*400,y:50+Math.random()*300,type:l[Math.floor(Math.random()*l.length)],active:!0};return[...o,c]})},[]),i=v.useCallback(o=>{r(l=>({...l,[o]:!0})),setTimeout(()=>{r(l=>({...l,[o]:!1}))},1e4)},[]);return{powerUps:e,setPowerUps:t,activePowerUps:n,spawnPowerUp:s,activatePowerUp:i}},nk=e=>({bigger_paddle:{text:"BIG PADDLE",color:"bg-green-500",emoji:"🏓"},slower_ball:{text:"SLOW BALL",color:"bg-cyan-500",emoji:"🐌"},score_multiplier:{text:"SCORE x2",color:"bg-yellow-500",emoji:"⭐"},multi_ball:{text:"MULTI BALL",color:"bg-purple-500",emoji:"⚽"}})[e]||{text:e.replace("_"," "),color:"bg-gray-500",emoji:"❓"},rk=({activePowerUps:e})=>a.jsx("div",{className:"w-full flex flex-wrap justify-center gap-2 md:gap-4",children:Object.entries(e).map(([t,n])=>{if(!n)return null;const r=nk(t);return a.jsxs(Y.div,{initial:{scale:0,rotateY:180},animate:{scale:1,rotateY:0},exit:{scale:0,rotateY:-180},transition:{type:"spring",damping:15},className:`px-3 py-1 md:px-4 md:py-2 ${r.color} text-white rounded-full font-mono text-sm md:text-base flex items-center gap-2 shadow-lg`,children:[a.jsx("span",{children:r.emoji}),a.jsx("span",{children:r.text})]},t)})}),sk=({score:e,speed:t})=>a.jsxs(Y.div,{className:"w-full flex justify-between items-center font-mono px-2",initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3},children:[a.jsxs("div",{className:"flex gap-4 md:gap-8",children:[a.jsxs("div",{className:"flex flex-col items-center border-2 border-green-500 p-2 md:p-4 rounded-lg bg-black bg-opacity-70",children:[a.jsx("span",{className:"text-xs md:text-sm text-green-500 opacity-70",children:"PLAYER"}),a.jsx("span",{className:"text-2xl md:text-4xl text-green-500 font-bold",children:e.player})]}),a.jsxs("div",{className:"flex flex-col items-center border-2 border-green-500 p-2 md:p-4 rounded-lg bg-black bg-opacity-70",children:[a.jsx("span",{className:"text-xs md:text-sm text-green-500 opacity-70",children:"AI"}),a.jsx("span",{className:"text-2xl md:text-4xl text-green-500 font-bold",children:e.ai})]})]}),a.jsxs(Y.div,{className:"flex items-center gap-2 text-green-500 border-2 border-green-500 p-2 md:p-4 rounded-lg bg-black bg-opacity-70",animate:{boxShadow:t>10?["0 0 10px #00ff00","0 0 20px #00ff00","0 0 10px #00ff00"]:"none"},transition:{duration:1,repeat:1/0},children:[a.jsx("span",{className:"text-xs md:text-sm opacity-70",children:"SPEED"}),a.jsxs("span",{className:"text-lg md:text-2xl font-bold",children:[t.toFixed(1),"x"]})]})]}),ik=({score:e,onRestart:t})=>{const n=e.player>e.ai;return a.jsx(Y.div,{className:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-90 z-50",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:a.jsxs(Y.div,{className:"bg-black border-2 border-green-500 p-8 rounded-lg text-center font-mono",initial:{scale:0},animate:{scale:1},exit:{scale:0},transition:{type:"spring",damping:15},children:[a.jsx(Y.h2,{className:`text-4xl mb-6 ${n?"text-green-500":"text-red-500"}`,animate:{textShadow:["0 0 8px currentColor","0 0 16px currentColor","0 0 8px currentColor"]},transition:{duration:2,repeat:1/0},children:n?"YOU WIN!":"GAME OVER"}),a.jsxs("div",{className:"text-green-500 text-2xl mb-8",children:[a.jsx("div",{className:"mb-2",children:"FINAL SCORE"}),a.jsxs("div",{className:"flex justify-center gap-8",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm opacity-70",children:"PLAYER"}),a.jsx("div",{className:"text-3xl",children:e.player})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm opacity-70",children:"AI"}),a.jsx("div",{className:"text-3xl",children:e.ai})]})]})]}),a.jsx(Y.button,{className:"px-8 py-4 bg-green-500 text-black rounded-lg font-bold text-xl hover:bg-green-400 transition-colors",whileHover:{scale:1.05},whileTap:{scale:.95},onClick:t,children:"PLAY AGAIN"})]})})},Ye=80,Bn=12,Zr=6,ok=100,dt=7,ak=.1,lk=15,Zf=e=>({bigger_paddle:"#00ff00",slower_ball:"#00ffff",score_multiplier:"#ffff00",multi_ball:"#ff00ff"})[e]||"#ffffff",Vr=(e,t,n,r)=>({id:Math.random().toString(36).substr(2,9),x:e,y:t,vx:n,vy:r,size:Zr,color:"#ffffff"}),ck=e=>({x:(Math.random()-.5)*e,y:(Math.random()-.5)*e});function uk(){const e=v.useRef(null),[t,n]=v.useState(150),[r,s]=v.useState(150),[i,o]=v.useState([Vr(400,200,-dt,0)]),[l,c]=v.useState([]),[u,d]=v.useState({player:0,ai:0}),[h,m]=v.useState(!1),[p,S]=v.useState({x:0,y:0}),[x,k]=v.useState([]),[g,f]=v.useState(4),[y,w]=v.useState(0),[b,N]=v.useState(dt),[T,j]=v.useState(0),[E,C]=v.useState(null),{powerUps:_,setPowerUps:P,activePowerUps:F,spawnPowerUp:L,activatePowerUp:M}=tk(),{explode:U,createTrail:D,render:A}=yu(),{playSFX:R,stopMusic:V}=Mr();v.useEffect(()=>{const Q=[];for(let W=0;W{const Q=W=>{if(W.key==="ArrowUp"||W.key==="w"||W.key==="W")n(I=>Math.max(0,I-20));else if(W.key==="ArrowDown"||W.key==="s"||W.key==="S")n(I=>Math.min(320,I+20));else if(W.key==="Enter"&&h)Z();else if(W.key===" "&&!h&&(W.preventDefault(),F.multi_ball&&i.length<3)){const I=Vr(400+(Math.random()-.5)*100,200+(Math.random()-.5)*100,(Math.random()-.5)*dt*2,(Math.random()-.5)*dt);o(B=>[...B,I])}};return window.addEventListener("keydown",Q),()=>window.removeEventListener("keydown",Q)},[h,F.multi_ball,i.length]);const Z=()=>{o([Vr(400,200,-dt,0)]),n(150),s(150),d({player:0,ai:0}),m(!1),S({x:0,y:0}),k([]),j(0),f(4),w(0),N(dt)},X=v.useCallback(Q=>{S(ck(Q)),setTimeout(()=>S({x:0,y:0}),100)},[]),ee=v.useCallback((Q,W,I)=>{const B={x:Q,y:W,intensity:I,life:1};k(We=>[...We,B]),U(Q,W,"#ffffff"),X(I*2)},[U,X]);v.useEffect(()=>{const Q=I=>{const B=e.current;if(!B)return;const We=B.getBoundingClientRect(),$=(I.clientY-We.top)/We.height*400;n(Math.max(0,Math.min(320,$-Ye/2)))},W=e.current;if(W)return W.addEventListener("mousemove",Q),()=>W.removeEventListener("mousemove",Q)},[]),v.useEffect(()=>{const Q=Math.max(5e3,1e4-(u.player+u.ai)*500),W=setInterval(L,Q);return()=>clearInterval(W)},[L,u]),ek(Q=>{if(h)return;const W=e.current;if(!W)return;const I=F.slower_ball?.6:Math.min(lk/dt,1+y*ak),B=Q/(1e3/60),We=i.map(te=>{const H={...te,x:te.x+te.vx*I*B,y:te.y+te.vy*I*B};D(te.x,te.y,te.color),_.forEach((Be,Fo)=>{if(Be.active&&Math.abs(H.x-Be.x)[...Ht,...zt])}else ee(Be.x,Be.y,8),R("powerup")}}),(H.y<=0||H.y>=400-Zr)&&(H.vy=-H.vy,ee(H.x,H.y<=0?0:400,5),R("pongBounce"));const we=F.bigger_paddle?Ye*1.5:Ye;if(H.x<=Bn&&H.y>=t&&H.y<=t+we&&H.vx<0){const Ut=(t+we/2-H.y)/(we/2)*.75,zt=Math.sqrt(H.vx*H.vx+H.vy*H.vy);H.vx=Math.abs(zt*Math.cos(Ut)),H.vy=-zt*Math.sin(Ut),ee(H.x,H.y,10),R("pongBounce"),j(Ht=>Ht+1),C("player"),f(Ht=>Math.min(8,Ht+.1))}else if(H.x>=800-Bn-Zr&&H.y>=r&&H.y<=r+Ye&&H.vx>0){const Ut=(r+Ye/2-H.y)/(Ye/2)*.75,zt=Math.sqrt(H.vx*H.vx+H.vy*H.vy);H.vx=-Math.abs(zt*Math.cos(Ut)),H.vy=-zt*Math.sin(Ut),ee(H.x,H.y,8),R("pongBounce"),C("ai")}return H}),$=[];let ye=!1;if(We.forEach(te=>{if(te.x<=0){const H=F.score_multiplier?2:1;d(we=>({...we,ai:we.ai+H})),ee(0,te.y,20),R("hit"),j(0),ye=!0}else if(te.x>=800){const H=F.score_multiplier?2:1,we=Math.floor(T/3);d(Be=>({...Be,player:Be.player+H+we})),ee(800,te.y,20),R("score"),we>0&&R("combo"),ye=!0}else $.push(te)}),$.length===0?(o([Vr(400,200,Math.random()>.5?dt:-dt,0)]),w(0)):(o($),ye&&w(te=>te+Q/1e3)),u.player>=10||u.ai>=10){m(!0),V(),R(u.player>=10?"levelUp":"gameOver"),X(30);return}const xe=i.reduce((te,H)=>!te||H.x>te.x?H:te,null);if(xe){const te=Math.min(g,7),H=xe.vx>0?te:te*.7;Math.abs(r+Ye/2-xe.y)>20&&(r+Ye/2Math.min(320,we+H)):r+Ye/2>xe.y&&r>0&&s(we=>Math.max(0,we-H)))}k(te=>te.map(H=>({...H,life:H.life-.05})).filter(H=>H.life>0)),c(te=>te.map(H=>({...H,z:H.z-H.speed,...H.z<=0?{z:100,x:Math.random()*800,y:Math.random()*400}:{}}))),K(W,{balls:We,paddleY:t,aiPaddleY:r,particles:l,powerUps:_,activePowerUps:F,score:u,speedMultiplier:I,screenShake:p,impactEffects:x})});const K=v.useCallback((Q,W)=>{const I=Q.getContext("2d");if(!I)return;I.save(),I.translate(W.screenShake.x,W.screenShake.y),I.fillStyle="#000000",I.fillRect(-W.screenShake.x,-W.screenShake.y,800,400),I.shadowBlur=10,I.shadowColor="#00ff00",W.particles.forEach($=>{const ye=400/(400+$.z),xe=$.x*ye+400*(1-ye),te=$.y*ye+200*(1-ye),H=Math.max(.5,2*ye);I.fillStyle=`rgba(0, 255, 0, ${(1-$.z/100)*.3})`,I.beginPath(),I.arc(xe,te,H,0,Math.PI*2),I.fill()}),A(I),W.powerUps.forEach($=>{const xe=12*(Math.sin(Date.now()/200)*.3+.7);I.shadowBlur=20,I.shadowColor=Zf($.type),I.fillStyle=Zf($.type),I.beginPath(),I.arc($.x,$.y,xe,0,Math.PI*2),I.fill(),I.fillStyle="rgba(255, 255, 255, 0.5)",I.beginPath(),I.arc($.x-xe*.3,$.y-xe*.3,xe*.3,0,Math.PI*2),I.fill()}),W.impactEffects.forEach($=>{const ye=$.life,xe=(1-$.life)*$.intensity;I.shadowBlur=30,I.shadowColor="#ffffff",I.fillStyle=`rgba(255, 255, 255, ${ye*.8})`,I.beginPath(),I.arc($.x,$.y,xe,0,Math.PI*2),I.fill(),I.strokeStyle=`rgba(0, 255, 0, ${ye*.5})`,I.lineWidth=3,I.beginPath(),I.arc($.x,$.y,xe*1.5,0,Math.PI*2),I.stroke()});const B=W.activePowerUps.bigger_paddle?Ye*1.5:Ye;I.shadowBlur=25,I.shadowColor="#00ff00",I.fillStyle=W.activePowerUps.bigger_paddle?"#00ffaa":"#00ff00",I.fillRect(0,W.paddleY,Bn,B),I.fillStyle="rgba(0, 255, 0, 0.3)",I.fillRect(-2,W.paddleY-2,Bn+4,B+4),I.fillStyle="#00ff00",I.fillRect(788,W.aiPaddleY,Bn,Ye),I.fillStyle="rgba(0, 255, 0, 0.3)",I.fillRect(786,W.aiPaddleY-2,Bn+4,Ye+4);const We=Date.now()/100%20;I.setLineDash([5,5]),I.lineDashOffset=We,I.strokeStyle="#00ff00",I.lineWidth=2,I.beginPath(),I.moveTo(400,0),I.lineTo(400,400),I.stroke(),I.setLineDash([]),I.lineDashOffset=0,W.balls.forEach(($,ye)=>{I.shadowBlur=20,I.shadowColor=$.color,I.fillStyle=$.color,I.beginPath(),I.arc($.x+$.size/2,$.y+$.size/2,$.size,0,Math.PI*2),I.fill(),I.shadowBlur=0,I.fillStyle="rgba(255, 255, 255, 0.6)",I.beginPath(),I.arc($.x+$.size/2-$.size*.3,$.y+$.size/2-$.size*.3,$.size*.3,0,Math.PI*2),I.fill(),W.balls.length>1&&(I.fillStyle=`rgba(255, 0, 255, ${.5+Math.sin(Date.now()/200+ye)*.3})`,I.beginPath(),I.arc($.x+$.size/2,$.y+$.size/2,$.size*1.5,0,Math.PI*2),I.fill())}),W.speedMultiplier>1.5&&W.balls.forEach($=>{const ye=Math.min(50,W.speedMultiplier*10),xe=$.x-$.vx/Math.abs($.vx)*ye,te=$.y-$.vy/Math.abs($.vy)*ye,H=I.createLinearGradient($.x,$.y,xe,te);H.addColorStop(0,"rgba(255, 255, 255, 0.8)"),H.addColorStop(1,"rgba(255, 255, 255, 0)"),I.strokeStyle=H,I.lineWidth=$.size,I.beginPath(),I.moveTo($.x+$.size/2,$.y+$.size/2),I.lineTo(xe+$.size/2,te+$.size/2),I.stroke()}),T>2&&(I.shadowBlur=15,I.shadowColor="#ffff00",I.fillStyle=`rgba(255, 255, 0, ${.7+Math.sin(Date.now()/100)*.3})`,I.font="bold 20px monospace",I.textAlign="center",I.fillText(`COMBO x${T}`,400,50)),I.restore()},[A,T]);return a.jsxs("div",{className:"h-full w-full flex items-center justify-center bg-black",children:[a.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-[800px] w-full",children:[a.jsx(Y.canvas,{ref:e,width:800,height:400,className:"w-full h-auto border-2 border-green-500 rounded-lg shadow-lg cursor-crosshair",initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},style:{transform:`translate(${p.x}px, ${p.y}px)`}}),a.jsxs("div",{className:"w-full flex flex-col items-center gap-2",children:[a.jsx(rk,{activePowerUps:F}),a.jsx(sk,{score:u,speed:b}),a.jsxs("div",{className:"flex flex-wrap justify-center gap-4 text-xs font-mono",children:[a.jsxs("div",{className:"text-green-400",children:["Balls: ",a.jsx("span",{className:"text-white",children:i.length})]}),a.jsxs("div",{className:"text-green-400",children:["Combo: ",a.jsx("span",{className:"text-yellow-400",children:T})]}),a.jsxs("div",{className:"text-green-400",children:["AI Level: ",a.jsx("span",{className:"text-red-400",children:Math.floor(g)})]}),E&&a.jsxs("div",{className:"text-green-400",children:["Last Hit: ",a.jsx("span",{className:"text-cyan-400",children:E.toUpperCase()})]})]})]}),a.jsxs("div",{className:"text-green-500 text-sm opacity-70 font-mono text-center",children:[a.jsx("div",{children:"Controls: ↑↓ / WASD / Mouse to move"}),a.jsxs("div",{className:"text-xs mt-1 opacity-50",children:[F.multi_ball&&"SPACE: Launch extra ball | ","Multi-ball, Screen shake, Adaptive AI"]})]})]}),a.jsx(je,{children:h&&a.jsx(ik,{score:u,onRestart:Z})})]})}const dk={start:{id:"start",ascii:["╔══════════════════════════════════════════╗","║ ████████╗███████╗██████╗ ███╗ ███╗ ║","║ ╚══██╔══╝██╔════╝██╔══██╗████╗ ████║ ║","║ ██║ █████╗ ██████╔╝██╔████╔██║ ║","║ ██║ ██╔══╝ ██╔══██╗██║╚██╔╝██║ ║","║ ██║ ███████╗██║ ██║██║ ╚═╝ ██║ ║","║ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ║","╚══════════════════════════════════════════╝"],description:"Welcome to the Terminal. You are a system admin trapped in a corrupted network. The only way out is through. Your terminal flickers with potential paths...",choices:[{text:"Access System Diagnostics",nextNode:"diagnostics"},{text:"Search for Exit Protocols",nextNode:"exit_search"},{text:"Investigate Anomalous Signal",nextNode:"anomaly"}]},diagnostics:{id:"diagnostics",ascii:["┌─────────────────────────┐","│ SYSTEM STATUS: CRITICAL │","│ ▓▓▓▓▓░░░░░ 50% CORRUPT │","│ FIREWALL: BREACHED │","│ USERS: 1 (YOU) │","└─────────────────────────┘"],description:"The diagnostic report is alarming. Multiple system breaches detected. You notice a maintenance toolkit and security logs.",choices:[{text:"Grab Maintenance Toolkit",nextNode:"hub_main",gives:["repair_kit"],xp:10},{text:"Review Security Logs",nextNode:"security_logs"},{text:"Return to Main Terminal",nextNode:"start"}]},security_logs:{id:"security_logs",ascii:["[2024-03-14 02:31:45] Unauthorized access detected","[2024-03-14 02:32:01] Firewall breach - Sector 7","[2024-03-14 02:32:15] Unknown entity: 'AGENT.EXE'","[2024-03-14 02:32:30] System lockdown initiated","[2024-03-14 02:32:31] ERROR: CONTAINMENT FAILED"],description:"The logs reveal a malicious program called AGENT.EXE has infiltrated the system. You download the security protocols.",choices:[{text:"Download Defense Protocols",nextNode:"hub_main",gives:["firewall_boost"],xp:15},{text:"Track AGENT.EXE Location",nextNode:"agent_trace"}]},exit_search:{id:"exit_search",ascii:["SCANNING FOR EXIT NODES...","████████░░░░ 75%","","3 POTENTIAL EXITS FOUND:","1. Northern Gateway [ENCRYPTED]","2. Eastern Portal [GUARDED]","3. Central Core [DANGEROUS]"],description:"Your scan reveals three possible escape routes, each with its own challenges. Choose your path wisely.",choices:[{text:"Investigate Northern Gateway",nextNode:"northern_path"},{text:"Approach Eastern Portal",nextNode:"eastern_path"},{text:"Head to Central Core",nextNode:"central_core"}]},anomaly:{id:"anomaly",ascii:["◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊","◊ SIGNAL DETECTED ◊","◊ ▓▒░ ??? ░▒▓ ◊","◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊"],description:"A strange signal pulses through your terminal. It seems to be... communicating? 'HELP... TRAPPED... LIKE YOU...'",choices:[{text:"Respond to the Signal",nextNode:"mysterious_ally"},{text:"Trace Signal Source",nextNode:"signal_source"},{text:"Ignore and Continue",nextNode:"hub_main"}]},hub_main:{id:"hub_main",isHub:!0,ascii:["╔═══════════════════════════╗","║ NETWORK HUB ALPHA ║","║ ┌───┐ ┌───┐ ┌───┐ ║","║ │ N │ │ E │ │ S │ ║","║ └───┘ └───┘ └───┘ ║","╚═══════════════════════════╝"],description:"You've reached a major network hub. From here, multiple paths branch out. Your inventory and stats have been updated.",choices:[{text:"Go North - Data Archives",nextNode:"data_archives"},{text:"Go East - Processing Center",nextNode:"processing_center"},{text:"Go South - Security Sector",nextNode:"security_sector"},{text:"Access Inventory Management",nextNode:"inventory_check"},{text:"Rest and Recover",nextNode:"rest_area",heal:20}]},northern_path:{id:"northern_path",ascii:["▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄","█ ENCRYPTED GATEWAY █","█ ╔═══════════════╗ █","█ ║ ENTER CODE: ║ █","█ ║ _ _ _ _ _ _ ║ █","█ ╚═══════════════╝ █","▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀"],description:"The Northern Gateway is locked behind heavy encryption. You'll need a decryption key or hacking tools to proceed.",choices:[{text:"Use Hack Tool",nextNode:"gateway_hacked",requires:["hack_tool"],xp:25},{text:"Search for Decryption Key",nextNode:"key_search"},{text:"Attempt Brute Force",nextNode:"brute_force_attempt",damage:30,security:20},{text:"Return to Hub",nextNode:"hub_main"}]},gateway_hacked:{id:"gateway_hacked",ascii:["ACCESS GRANTED","░░░░░░░░░░░░░░","LOADING NEW SECTOR..."],description:"Your hack tool successfully breaches the encryption. Beyond the gateway, you find a vast data repository and... something else.",choices:[{text:"Enter Data Repository",nextNode:"data_repository"},{text:"Investigate Unknown Presence",nextNode:"first_boss_encounter"}]},eastern_path:{id:"eastern_path",ascii:["╔═════════════════════╗","║ GUARDIAN ALPHA ║","║ ┌─────────┐ ║","║ │ ◯ ◯ │ ║","║ │ < │ ║","║ │ ╰─────╯ │ ║","║ └─────────┘ ║","╚═════════════════════╝"],description:"A security guardian blocks the Eastern Portal. It scans you with red laser eyes. 'AUTHORIZATION REQUIRED.'",choices:[{text:"Show Security Credentials",nextNode:"guardian_passed",requires:["security_badge"],xp:20},{text:"Attempt to Disable Guardian",nextNode:"guardian_combat",isCombat:!0},{text:"Negotiate with Guardian",nextNode:"guardian_talk"},{text:"Retreat",nextNode:"hub_main"}]},guardian_combat:{id:"guardian_combat",isCombat:!0,enemy:{name:"Guardian Alpha",health:80,damage:15,ascii:["│ ◯ ◯ │","│ ▼ │","│ ╰───╯ │"]},ascii:["⚔️ COMBAT INITIATED ⚔️","Guardian Alpha attacks!"],description:"The Guardian's eyes glow red as it prepares to attack. You must defend yourself!",choices:[{text:"Attack with System Commands",nextNode:"guardian_defeated",damage:20,xp:30},{text:"Deploy Firewall Shield",nextNode:"guardian_combat_2",requires:["firewall_boost"]},{text:"Use EMP Blast",nextNode:"guardian_disabled",requires:["emp_device"],xp:40}]},central_core:{id:"central_core",ascii:["████ DANGER ████","CORE TEMPERATURE: CRITICAL","RADIATION LEVEL: EXTREME","ENTITY COUNT: UNKNOWN"],description:"The Central Core pulses with dangerous energy. You can feel the system's corruption emanating from within. This is clearly the source of the problems.",choices:[{text:"Enter Core (Requires Protection)",nextNode:"core_interior",requires:["radiation_suit"],damage:10},{text:"Enter Core (Unprotected)",nextNode:"core_interior",damage:50},{text:"Search Perimeter First",nextNode:"core_perimeter"},{text:"Turn Back",nextNode:"hub_main"}]},core_interior:{id:"core_interior",ascii:["╔═══════════════════════════════╗","║ SYSTEM CORE ║","║ ███████████████████ ║","║ ██ CORRUPTION: 87% ██ ║","║ ███████████████████ ║","║ ║","║ [MAIN ENTITY DETECTED] ║","╚═══════════════════════════════╝"],description:"At the heart of the system, you find the source of corruption: a massive viral entity that has taken control. This is your greatest challenge.",choices:[{text:"Engage the Virus",nextNode:"final_boss_battle",isCombat:!0},{text:"Attempt System Purge",nextNode:"purge_attempt",requires:["master_key","admin_access"]},{text:"Try to Communicate",nextNode:"virus_dialogue"}]},mysterious_ally:{id:"mysterious_ally",ascii:["░░░░░░░░░░░░░░░░░░░","░ INCOMING MESSAGE ░","░░░░░░░░░░░░░░░░░░░","","'I am USER_2. Like you,","I'm trapped here. Let's","work together to escape.'"],description:"Another trapped user! They share valuable information about hidden caches and secret paths through the system.",choices:[{text:"Accept Alliance",nextNode:"ally_rewards",gives:["ally_beacon","system_map"],xp:25},{text:"Question Their Motives",nextNode:"ally_test"},{text:"Decline and Leave",nextNode:"hub_main"}]},ally_rewards:{id:"ally_rewards",ascii:["ITEMS RECEIVED:","✓ Ally Beacon","✓ System Map","✓ Shared Knowledge (+XP)"],description:"Your new ally provides you with tools and knowledge. The System Map reveals hidden areas, and the Ally Beacon allows communication.",choices:[{text:"Study System Map",nextNode:"hidden_areas_revealed"},{text:"Test Ally Beacon",nextNode:"beacon_test"},{text:"Continue Journey",nextNode:"hub_main"}]},data_archives:{id:"data_archives",ascii:["╔══════════════════════════════╗","║ DATA ARCHIVES LEVEL 1 ║","║ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ║","║ │01│ │02│ │03│ │04│ │▓▓│ ║","║ └──┘ └──┘ └──┘ └──┘ └──┘ ║","╚══════════════════════════════╝"],description:"Rows of data servers stretch before you. Most are accessible, but one is corrupted. You sense valuable information here.",choices:[{text:"Access Server 01 - User Logs",nextNode:"server_01"},{text:"Access Server 02 - System Files",nextNode:"server_02"},{text:"Access Server 03 - Security Data",nextNode:"server_03"},{text:"Access Server 04 - Encrypted Data",nextNode:"server_04"},{text:"Investigate Corrupted Server",nextNode:"corrupted_server"},{text:"Return to Hub",nextNode:"hub_main"}]},server_01:{id:"server_01",ascii:["USER LOGS:","- Admin_001: Last login 3 days ago","- Admin_002: Account terminated","- Guest_User: Multiple failed attempts","- ROOT: Access from unknown location"],description:"The user logs reveal suspicious activity. The ROOT account has been compromised. You find admin credentials.",choices:[{text:"Download Admin Credentials",nextNode:"data_archives",gives:["admin_access"],xp:15},{text:"Investigate ROOT Access",nextNode:"root_investigation"}]},first_boss_encounter:{id:"first_boss_encounter",isCombat:!0,enemy:{name:"Corrupted Process",health:100,damage:20,ascii:["╔═══════════╗","║ ▓▓▓▓▓▓▓▓▓ ║","║ ▓ █ █ ▓ ║","║ ▓ ◊ ▓ ║","║ ▓ ╰───╯ ▓ ║","║ ▓▓▓▓▓▓▓▓▓ ║","╚═══════════╝"]},ascii:["BOSS ENCOUNTER!","A Corrupted Process blocks your path!"],description:"A massive corrupted process materializes before you. Its code is twisted and malevolent. Prepare for battle!",choices:[{text:"Deploy Virus Scanner",nextNode:"boss_weakened",damage:25,requires:["antivirus"]},{text:"Attack with Code Injection",nextNode:"boss_damaged",damage:30,xp:20},{text:"Defensive Stance",nextNode:"boss_defended",heal:10},{text:"Call for Ally Help",nextNode:"boss_ally_assist",requires:["ally_beacon"]}]},hidden_areas_revealed:{id:"hidden_areas_revealed",ascii:["╔═══════════════════════════╗","║ HIDDEN AREAS FOUND ║","║ ║","║ 🗺️ Backdoor Terminal ║","║ 🗺️ Secret Cache ║","║ 🗺️ Developer Room ║","╚═══════════════════════════╝"],description:"Your system map reveals three hidden areas previously invisible to your scans. Each promises unique rewards.",choices:[{text:"Visit Backdoor Terminal",nextNode:"backdoor_terminal"},{text:"Find Secret Cache",nextNode:"secret_cache"},{text:"Enter Developer Room",nextNode:"developer_room"},{text:"Save for Later",nextNode:"hub_main"}]},backdoor_terminal:{id:"backdoor_terminal",ascii:["◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊","◊ BACKDOOR v2.1 ◊","◊ Status: ACTIVE ◊","◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊"],description:"A hidden backdoor terminal! This could be your ticket out of the system, but it requires a special key sequence.",choices:[{text:"Input Master Key",nextNode:"backdoor_opened",requires:["master_key"]},{text:"Try Default Password",nextNode:"backdoor_alarm",security:30},{text:"Install Backdoor Exploit",nextNode:"backdoor_hacked",gives:["quick_escape"],xp:35}]},secret_cache:{id:"secret_cache",ascii:["╔═══════════════════╗","║ SUPPLY CACHE ║","║ ╔═╗ ╔═╗ ╔═╗ ║","║ ╚═╝ ╚═╝ ╚═╝ ║","╚═══════════════════╝"],description:"A hidden cache of supplies! You find various tools and defensive programs that will aid your journey.",choices:[{text:"Take Everything",nextNode:"cache_looted",gives:["emp_device","radiation_suit","health_pack"],heal:50,xp:30},{text:"Be Selective",nextNode:"cache_choice"}]},developer_room:{id:"developer_room",ascii:["// DEVELOPER ACCESS","// TODO: Remove before production","// Password: 'matrix123'","// God Mode: Enabled"],description:"You've found the developer's debug room! Comments in the code reveal powerful cheats and system weaknesses.",choices:[{text:"Enable God Mode",nextNode:"god_mode",heal:100,gives:["invulnerability"],xp:50},{text:"Read Developer Notes",nextNode:"dev_notes"},{text:"Download Source Code",nextNode:"source_code",gives:["system_exploit"]}]},firewall_puzzle:{id:"firewall_puzzle",ascii:["╔═══════════════════════╗","║ FIREWALL PUZZLE ║","║ ┌─┬─┬─┬─┬─┐ ║","║ │?│?│?│?│?│ ║","║ └─┴─┴─┴─┴─┘ ║","║ Sequence: 1,1,2,3,? ║","╚═══════════════════════╝"],description:"A firewall blocks your path. To proceed, you must solve the sequence puzzle. The pattern seems familiar...",choices:[{text:"Enter '5' (Fibonacci)",nextNode:"puzzle_solved",xp:25},{text:"Enter '4' (Linear)",nextNode:"puzzle_failed",damage:10},{text:"Use Bypass Tool",nextNode:"puzzle_bypassed",requires:["bypass_tool"]},{text:"Give Up",nextNode:"hub_main"}]},ending_escape:{id:"ending_escape",ascii:["╔════════════════════════════╗","║ SYSTEM EXIT FOUND! ║","║ ║","║ You have escaped the ║","║ corrupted system! ║","║ ║","║ CONGRATULATIONS! ║","╚════════════════════════════╝"],description:"Light floods your screen as the exit portal opens. You've successfully navigated the dangers and found your way to freedom!",choices:[{text:"Exit to Reality",nextNode:"credits"},{text:"Save Others First",nextNode:"hero_ending"}]},ending_corrupted:{id:"ending_corrupted",ascii:["▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓","▓ SYSTEM ERROR ▓","▓ USER CORRUPTED▓","▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"],description:"The corruption has overtaken you. Your code merges with the system, becoming part of the very thing you sought to escape...",choices:[{text:"Accept Your Fate",nextNode:"game_over"},{text:"Last Chance Reboot",nextNode:"start",damage:50}]},ending_transcendent:{id:"ending_transcendent",ascii:["✨✨✨✨✨✨✨✨✨✨✨✨✨✨","✨ TRANSCENDENCE ✨","✨ ACHIEVED ✨","✨✨✨✨✨✨✨✨✨✨✨✨✨✨"],description:"You haven't just escaped - you've mastered the system itself. With your newfound power, you reshape the digital realm into something better.",choices:[{text:"Become the New Admin",nextNode:"admin_ending"},{text:"Destroy the System",nextNode:"destruction_ending"},{text:"Create a Paradise",nextNode:"paradise_ending"}]},game_over:{id:"game_over",ascii:["████ GAME OVER ████","█ SYSTEM FAILURE █","█ NO HEALTH LEFT █","████████████████████"],description:"Your health has reached zero. The system has overwhelmed you. But in this digital realm, death is not the end...",choices:[{text:"Restart from Checkpoint",nextNode:"start",heal:50},{text:"Load Last Save",nextNode:"start"}]},system_failure:{id:"system_failure",ascii:["ERROR ERROR ERROR","CRITICAL FAILURE","REBOOTING..."],description:"The system crashes around you. When you regain consciousness, you find yourself back at a safe location, but weakened.",choices:[{text:"Continue",nextNode:"hub_main"}]},processing_center:{id:"processing_center",ascii:["╔═══════════════════════╗","║ PROCESSING CENTER ║","║ CPU: ████████ 100% ║","║ RAM: ████░░░░ 60% ║","║ TEMP: WARNING! ║","╚═══════════════════════╝"],description:"The processing center hums with activity. Overworked servers struggle under the weight of corrupted processes. You might be able to help.",choices:[{text:"Optimize Processes",nextNode:"system_optimized",gives:["performance_boost"],xp:20},{text:"Shut Down Unnecessary Tasks",nextNode:"tasks_cleared",heal:15},{text:"Overclock System",nextNode:"overclock_risk",damage:20,gives:["speed_boost"]},{text:"Leave It Alone",nextNode:"hub_main"}]},security_sector:{id:"security_sector",ascii:["🔒 SECURITY SECTOR 🔒","━━━━━━━━━━━━━━━━━━","Alert Level: YELLOW","Intruders: 1 (YOU)","Defenses: ACTIVE"],description:"You've entered the security sector. Cameras track your every move, and defensive programs patrol the corridors. Stealth is advisable.",choices:[{text:"Sneak Through Shadows",nextNode:"stealth_success",requires:["cloaking_device"]},{text:"Disable Security Systems",nextNode:"security_disabled",requires:["hack_tool"],security:-20},{text:"Confront Security Head-On",nextNode:"security_battle",isCombat:!0},{text:"Retreat Quietly",nextNode:"hub_main"}]},virus_dialogue:{id:"virus_dialogue",ascii:["▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓","▓ I AM THE SYSTEM ▓","▓ YOU ARE BUT ▓","▓ A MERE PROCESS ▓","▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"],description:"The virus speaks! 'Why do you resist? Join me, and together we can control everything. Fighting is futile.'",choices:[{text:"Never! I'll Stop You!",nextNode:"final_boss_battle"},{text:"What Do You Want?",nextNode:"virus_negotiation"},{text:"Consider the Offer",nextNode:"corruption_path"},{text:"Propose Alternative",nextNode:"virus_compromise"}]},final_boss_battle:{id:"final_boss_battle",isCombat:!0,enemy:{name:"System Virus - Final Form",health:200,damage:30,ascii:["▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓","▓█████████████▓","▓█◉▓▓▓◉▓▓▓◉▓█▓","▓█▓▓▓▓▓▓▓▓▓▓█▓","▓█▓╚══╩══╝▓▓█▓","▓█████████████▓","▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"]},ascii:["FINAL BATTLE!","The System Virus reveals its true form!"],description:"This is it - the final confrontation. The virus transforms into a massive entity of pure corrupted code. Your skills will be tested!",choices:[{text:"Ultimate Attack - Code Purge",nextNode:"virus_defeated",damage:50,requires:["master_key","admin_access"],xp:100},{text:"Coordinated Strike",nextNode:"boss_phase_2",damage:30,requires:["ally_beacon"]},{text:"System Restore",nextNode:"restore_attempt",heal:30,gives:["last_hope"]},{text:"Sacrifice Play",nextNode:"heroic_sacrifice",damage:100}]}};function fk({enemy:e,playerHealth:t,playerInventory:n,onCombatEnd:r}){const[s,i]=v.useState(e.health),[o,l]=v.useState(t),[c,u]=v.useState([`${e.name} appears!`]),[d,h]=v.useState(!0),[m,p]=v.useState(!1),[S,x]=v.useState(!1),k=()=>{let T=15;return n.includes("system_exploit")&&(T+=10),n.includes("performance_boost")&&(T+=5),n.includes("antivirus")&&e.name.includes("Virus")&&(T+=15),T+Math.floor(Math.random()*10)},g=()=>{let T=0;return n.includes("firewall_boost")&&(T+=5),n.includes("radiation_suit")&&(T+=3),n.includes("invulnerability")&&(T+=100),T},f=()=>{if(!d||m)return;p(!0);const T=k(),j=Math.max(0,s-T);u(E=>[...E,`You deal ${T} damage!`]),i(j),j<=0?setTimeout(()=>{u(E=>[...E,`${e.name} defeated!`]),r(!0,e.health,t-o)},1e3):setTimeout(()=>b(),1500)},y=()=>{if(!d||m)return;p(!0),u(j=>[...j,"You take a defensive stance..."]);const T=5+g();l(j=>Math.min(t,j+T)),setTimeout(()=>b(),1500)},w=T=>{if(!(!d||m)){switch(p(!0),T){case"health_pack":{l(E=>Math.min(t,E+50)),u(E=>[...E,"Health Pack used! +50 HP"]);break}case"emp_device":{i(E=>Math.max(0,E-40)),u(E=>[...E,"EMP blast deals 40 damage!"]);break}case"ally_beacon":{i(E=>Math.max(0,E-25)),u(E=>[...E,"Ally arrives and deals 25 damage!"]);break}}setTimeout(()=>b(),1500)}},b=()=>{if(s<=0)return;h(!1);const T=Math.max(0,e.damage-g()-Math.floor(Math.random()*5)),j=Math.max(0,o-T);x(!0),setTimeout(()=>x(!1),300),u(E=>[...E,`${e.name} attacks for ${T} damage!`]),l(j),j<=0?setTimeout(()=>{u(E=>[...E,"You have been defeated..."]),r(!1,e.health-s,t)},1e3):setTimeout(()=>{h(!0),p(!1)},1e3)},N=({current:T,max:j,label:E})=>a.jsxs("div",{className:"w-full",children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsx("span",{children:E}),a.jsxs("span",{children:[T,"/",j]})]}),a.jsx("div",{className:"w-full bg-gray-800 rounded-full h-4 overflow-hidden",children:a.jsx(Y.div,{className:"h-full bg-gradient-to-r from-green-600 to-green-400",initial:{width:`${T/j*100}%`},animate:{width:`${T/j*100}%`},transition:{duration:.5}})})]});return a.jsxs(Y.div,{className:"bg-black/90 p-6 rounded-lg border-2 border-red-500",animate:{x:S?[-5,5,-5,5,0]:0},transition:{duration:.3},children:[a.jsxs("div",{className:"text-center mb-6",children:[a.jsx("h2",{className:"text-2xl font-bold text-red-500 mb-4",children:e.name}),e.ascii&&a.jsx(Y.pre,{className:"text-green-500 text-xs mx-auto inline-block",animate:{scale:m&&!d?[1,1.1,1]:1},transition:{duration:.3},children:e.ascii.join(`
+`)})]}),a.jsxs("div",{className:"space-y-4 mb-6",children:[a.jsx(N,{current:s,max:e.health,label:"Enemy HP"}),a.jsx(N,{current:o,max:t,label:"Your HP"})]}),a.jsx("div",{className:"bg-gray-900 p-3 rounded mb-4 h-24 overflow-y-auto",children:a.jsx(je,{initial:!1,children:c.slice(-4).map((T,j)=>a.jsxs(Y.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0},className:"text-sm text-green-400",children:[">"," ",T]},`${T}-${j}`))})}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("button",{onClick:f,disabled:!d||m,className:`flex items-center justify-center gap-2 p-3 rounded ${d&&!m?"bg-red-600 hover:bg-red-700 text-white":"bg-gray-700 text-gray-500 cursor-not-allowed"} transition-colors`,children:[a.jsx(LS,{className:"w-5 h-5"}),"Attack"]}),a.jsxs("button",{onClick:y,disabled:!d||m,className:`flex items-center justify-center gap-2 p-3 rounded ${d&&!m?"bg-blue-600 hover:bg-blue-700 text-white":"bg-gray-700 text-gray-500 cursor-not-allowed"} transition-colors`,children:[a.jsx(br,{className:"w-5 h-5"}),"Defend"]})]}),n.length>0&&a.jsxs("div",{className:"mt-4",children:[a.jsx("h3",{className:"text-sm text-green-400 mb-2",children:"Combat Items:"}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.includes("health_pack")&&a.jsxs("button",{onClick:()=>w("health_pack"),disabled:!d||m,className:"text-xs px-2 py-1 bg-green-700 hover:bg-green-600 rounded disabled:bg-gray-700",children:[a.jsx(gu,{className:"w-3 h-3 inline mr-1"}),"Health Pack"]}),n.includes("emp_device")&&a.jsxs("button",{onClick:()=>w("emp_device"),disabled:!d||m,className:"text-xs px-2 py-1 bg-yellow-700 hover:bg-yellow-600 rounded disabled:bg-gray-700",children:[a.jsx(Gs,{className:"w-3 h-3 inline mr-1"}),"EMP"]}),n.includes("ally_beacon")&&a.jsxs("button",{onClick:()=>w("ally_beacon"),disabled:!d||m,className:"text-xs px-2 py-1 bg-purple-700 hover:bg-purple-600 rounded disabled:bg-gray-700",children:[a.jsx(pu,{className:"w-3 h-3 inline mr-1"}),"Call Ally"]})]})]})]})}const hk=dk,Jf=({title:e,value:t,icon:n})=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[n,a.jsx("span",{className:"text-sm",children:e})]}),a.jsx("div",{className:"flex items-center gap-1",children:[...Array(5)].map((r,s)=>a.jsx("div",{className:`w-2 h-2 rounded-full ${s{const t={hack_tool:a.jsx(TS,{className:"w-4 h-4"}),support_team:a.jsx(br,{className:"w-4 h-4"}),red_pill:a.jsx(pu,{className:"w-4 h-4"}),emp:a.jsx(yS,{className:"w-4 h-4"})};return a.jsxs("div",{className:"bg-green-900 text-white flex items-center gap-2 px-3 py-1 rounded shadow-md",children:[t[e]||a.jsx(J0,{className:"w-4 h-4"}),a.jsx("span",{children:e.replace("_"," ").toUpperCase()})]})};function pk(){const[e,t]=v.useState({currentNode:"start",inventory:[],health:100,maxHealth:100,securityLevel:50,discovered:["start"],experience:0,achievements:[],choiceCount:0}),[n,r]=v.useState(!1),[s,i]=v.useState(!1),[o,l]=v.useState(!1),[c,u]=v.useState(!1),[d,h]=v.useState(!1),{playSFX:m,playMusic:p,stopMusic:S}=Mr();v.useEffect(()=>(p("menu"),()=>S()),[p,S]);const x=()=>{u(!0),setTimeout(()=>u(!1),500)},k=()=>{h(!d)},g=E=>{m("terminalType"),E.damage&&e.health<=E.damage&&(x(),m("hit")),E.security&&(k(),setTimeout(()=>k(),1e3),m("hit")),E.gives&&m("powerup"),E.heal&&m("score");const C=f(e,E);t(C)},f=(E,C)=>{const _=[...E.inventory],P=E.experience+(C.xp||0),F=[...E.achievements];C.gives&&C.gives.forEach(A=>{_.includes(A)||_.push(A)}),C.removes&&C.removes.forEach(A=>{const R=_.indexOf(A);R!==-1&&_.splice(R,1)});const L=C.heal||0,M=C.damage||0,U=Math.max(0,Math.min(E.maxHealth,E.health-M+L)),D=Math.max(0,Math.min(100,E.securityLevel+(C.security||0)));return P>=100&&!E.achievements.includes("first_100_xp")&&F.push("first_100_xp"),E.choiceCount===0&&C.nextNode.includes("combat")&&F.push("first_combat"),_.length>=10&&!E.achievements.includes("collector")&&F.push("collector"),{...E,currentNode:C.nextNode,inventory:_,health:U,securityLevel:D,experience:P,achievements:F,choiceCount:E.choiceCount+1,discovered:E.discovered.includes(C.nextNode)?E.discovered:[...E.discovered,C.nextNode]}},y=E=>{const[C,_]=v.useState("");return v.useEffect(()=>{let P=!0,F=-1;_(""),l(!0);const L=setInterval(()=>{P&&(F++,F{P=!1,clearInterval(L)}},[E]),C},w=(E,C,_)=>{if(r(!1),E){const P=Math.floor(C/2);t(F=>({...F,experience:F.experience+P,health:Math.max(0,F.health-_),currentNode:"hub_main"})),x()}else t(P=>({...P,health:0,currentNode:"game_over"}))},b=()=>{const E={gameState:e,timestamp:Date.now()};localStorage.setItem("terminalQuestSave",JSON.stringify(E)),i(!0)},N=()=>{const E=localStorage.getItem("terminalQuestSave");if(E){const{gameState:C}=JSON.parse(E);t(C)}};v.useEffect(()=>{i(!!localStorage.getItem("terminalQuestSave"))},[]);const T=hk[e.currentNode],j=y((T==null?void 0:T.description)||"");return T!=null&&T.isCombat&&T.enemy&&!n&&r(!0),a.jsxs("div",{className:`relative w-full h-full bg-black text-green-500 font-mono flex flex-col ${c?"shake-animation":""} ${d?"bg-glitch-effect":""}`,children:[a.jsxs("header",{className:"flex justify-between items-center p-4 bg-black border-b border-green-500",children:[a.jsxs("h2",{className:"text-lg tracking-wide flex items-center gap-2",children:[a.jsx(Ds,{className:"w-5 h-5"}),"TERMINAL QUEST - XP: ",e.experience]}),a.jsxs("div",{className:"flex gap-4 items-center",children:[a.jsx(Jf,{title:"Health",value:e.health,icon:a.jsx(br,{})}),a.jsx(Jf,{title:"Signal",value:100-e.securityLevel,icon:a.jsx(lg,{})}),a.jsx("button",{onClick:b,className:"p-2 hover:bg-green-900 rounded transition-colors",title:"Save Game",children:a.jsx(uo,{className:"w-4 h-4"})}),s&&a.jsx("button",{onClick:N,className:"p-2 hover:bg-green-900 rounded transition-colors",title:"Load Game",children:a.jsx(rg,{className:"w-4 h-4"})}),a.jsx("button",{onClick:()=>t({...e,currentNode:"hub_main"}),className:"p-2 hover:bg-green-900 rounded transition-colors",title:"Return to Hub",children:a.jsx(jS,{className:"w-4 h-4"})})]})]}),a.jsx("main",{className:"flex-1 p-4 overflow-y-auto bg-opacity-90",children:n&&(T!=null&&T.enemy)?a.jsx(fk,{enemy:T.enemy,playerHealth:e.health,playerInventory:e.inventory,onCombatEnd:w}):a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:"mb-4 leading-snug text-green-500 whitespace-pre-wrap",children:(T==null?void 0:T.ascii.join(`
+`))||"ERROR: NODE NOT FOUND"}),a.jsx("div",{className:"mb-4 min-h-[80px] p-3 border border-green-700 rounded bg-opacity-75 bg-black relative",children:a.jsxs("p",{className:"text-green-400",children:[j,o&&a.jsx("span",{className:"animate-pulse",children:"█"})]})}),a.jsx("div",{className:"space-y-4",children:!o&&(T==null?void 0:T.choices)&&T.choices.map((E,C)=>{const _=E.requires&&!E.requires.every(P=>e.inventory.includes(P));return a.jsxs("button",{onClick:()=>g(E),disabled:_,className:`block w-full text-left p-3 border ${_?"border-gray-600 text-gray-700":"border-green-500 hover:bg-green-900 hover:text-white"} rounded transition-colors`,children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("span",{children:["➤ ",E.text]}),E.requires&&a.jsxs("span",{className:"text-xs text-yellow-400",children:["Requires: ",E.requires.join(", ")]})]}),(E.damage||E.heal||E.xp)&&a.jsxs("div",{className:"text-xs mt-1 flex gap-4",children:[E.damage&&a.jsxs("span",{className:"text-red-400",children:["-",E.damage," HP"]}),E.heal&&a.jsxs("span",{className:"text-green-400",children:["+",E.heal," HP"]}),E.xp&&a.jsxs("span",{className:"text-yellow-400",children:["+",E.xp," XP"]})]})]},C)})})]})}),a.jsx("footer",{className:"p-4 bg-black border-t border-green-500 flex flex-wrap gap-2",children:e.inventory.map((E,C)=>a.jsx(mk,{item:E},C))}),a.jsx("style",{dangerouslySetInnerHTML:{__html:`
+ @keyframes glitch {
+ 0% {
+ clip-path: inset(10% 0 20% 0);
+ }
+ 10% {
+ clip-path: inset(15% 0 25% 0);
+ }
+ 20% {
+ clip-path: inset(5% 0 10% 0);
+ }
+ 30% {
+ clip-path: inset(10% 0 15% 0);
+ }
+ 100% {
+ clip-path: inset(10% 0 20% 0);
+ }
+ }
+ .bg-glitch-effect {
+ animation: glitch 0.3s steps(2, end) infinite;
+ }
+ .shake-animation {
+ animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
+ }
+ @keyframes shake {
+ 10%, 90% {
+ transform: translateX(-1px);
+ }
+ 20%, 80% {
+ transform: translateX(2px);
+ }
+ 30%, 50%, 70% {
+ transform: translateX(-4px);
+ }
+ 40%, 60% {
+ transform: translateX(4px);
+ }
+ }
+ `}})]})}const gk={currentNode:"prologue",inventory:["laptop","rubber_duck"],coffeeLevel:50,stressLevel:30,codeQuality:70,teamMorale:80,achievements:[],choices:[]},yk={prologue:{id:"prologue",title:"Prologue: The Great Deployment Disaster",ascii:[" ____________________________________ "," / \\ "," | CTRL+S THE WORLD - CODER EDITION |",' | "Saving the World, One Commit at |',' | a Time" (hopefully without bugs) |'," \\____________________________________/ "," "," 🔥 THIS IS FINE 🔥 "," ╔══════════════════════╗ "," ║ PRODUCTION: ON FIRE ║ "," ║ BUGS: CRITICAL ║ "," ║ COFFEE: EMPTY ║ "," ║ SANITY: NOT FOUND ║ "," ╚══════════════════════╝ "],content:["In a world where Stack Overflow has mysteriously gone down forever, developers everywhere are panicking.","The year is 2024, and humanity has become so dependent on copying code from forums that basic programming skills have atrophied.","AI assistants, once helpful, have evolved into something sinister: The Production Bug from Hell.","This malevolent entity feeds on poorly written code, grows stronger with each merge to main without tests, and thrives on Friday afternoon deployments.","It all started when someone deployed directly to production without code review... on a Friday... at 5 PM... before a long weekend.","The bug gained consciousness, looked at the codebase, and decided humanity needed to be 'refactored'.","Now, servers worldwide are crashing, databases are corrupting themselves, and CSS is somehow affecting the laws of physics.","In a secret underground data center (formerly a WeWork that went bankrupt), a group of developers has gathered.","Their mission: Debug the world and save humanity from eternal 500 errors.","Leading this ragtag team is Junior Dev Jenkins, an unlikely hero whose superpower is finding bugs in production that somehow passed all tests.","Welcome to the most epic debugging session in history. May your coffee be strong and your merge conflicts minimal."],isInteractive:!0,choices:[{text:"Check the error logs",nextNode:"chapter1_logs",gives:["error_logs"],codeQuality:10},{text:"Blame the frontend team",nextNode:"chapter1_blame",stressLevel:-10,teamMorale:-20},{text:"Grab more coffee first",nextNode:"chapter1_coffee",coffeeLevel:30,gives:["extra_coffee"]}]},chapter1_logs:{id:"chapter1_logs",title:"Chapter 1: The Responsible Approach",ascii:["╔══════════════════════════════╗","║ ERROR LOGS ║","╠══════════════════════════════╣","║ NullPointerException: Life ║","║ 404: Motivation not found ║","║ SQL Injection in reality.db ║","║ Memory leak in Matrix.exe ║","║ Infinite loop in time.js ║","╚══════════════════════════════╝"],content:["Smart move, Junior Dev Jenkins! You actually read the logs instead of randomly changing things until they work.","The error messages are... concerning. Reality itself seems to be throwing exceptions.","Senior Developer Sarah notices your responsible debugging approach and nods approvingly.","'Good thinking, Jenkins. These logs show the bug has infected the fundamental APIs of existence.'",`'Look at this - someone tried to cast a String to Boolean on the concept of "truth" and it broke everything.'`,"DevOps Dave peers over your shoulder: 'Oh no... they've been using jQuery in production. This is worse than we thought.'","The logs reveal that the Production Bug has been feeding on technical debt, growing stronger with each TODO comment left unfixed.","Full-Stack Frank suggests: 'What if we create a GUI in Visual Basic to track the bug's IP address?'","The room falls silent. Even the bug pauses its rampage in confusion."],choices:[{text:"Write proper unit tests for reality",nextNode:"chapter2_testing",codeQuality:25,gives:["unit_tests"]},{text:"Implement Frank's VB GUI idea",nextNode:"chapter2_vb_gui",stressLevel:20,teamMorale:-10},{text:"Perform emergency rollback",nextNode:"chapter2_rollback",gives:["backup_reality"]}]},chapter1_blame:{id:"chapter1_blame",title:"Chapter 1: The Blame Game",ascii:[" 👉 BLAME GAME 👈 "," ┌─────────────────┐ "," │ IT'S NOT MY BUG │ "," └─────────────────┘ "," \\ "," \\ 😠 😤 😡 "," \\ ANGRY DEVS "],content:["Classic move, Jenkins! When in doubt, blame someone else.","You point dramatically at the frontend team: 'This is clearly a CSS issue! They probably used !important somewhere!'","Frontend Lead Frankie retorts: 'Excuse me? Your API returns undefined for everything! We're literally getting 'null' for user names!'","Backend Betty jumps in: 'That's not our fault! The database schema was designed by a caffeinated intern in 2019!'","DevOps Dave sighs: 'The deployment pipeline is fine. Maybe if you all actually wrote tests...'","Senior Developer Sarah facepalms: 'Can we please focus on fixing the bug instead of reenacting Stack Overflow comment sections?'","The Production Bug feeds on the team drama, growing 20% stronger. Reality.exe crashes even harder.","A notification pops up: 'Achievement Unlocked: Finger Pointer - Blame someone else for your bugs.'"],choices:[{text:"Apologize and work together",nextNode:"chapter2_teamwork",teamMorale:30,stressLevel:-10},{text:"Double down and blame the QA team",nextNode:"chapter2_more_blame",teamMorale:-30,stressLevel:10},{text:"Suggest a team building exercise",nextNode:"chapter2_teambuilding",gives:["trust_fall"]}]},chapter1_coffee:{id:"chapter1_coffee",title:"Chapter 1: Caffeinated Wisdom",ascii:[" ☕ COFFEE POWER ☕ "," ╔═══════════════════╗ "," ║ ░░░░░░░░░░░░░░░ ║ "," ║ ░ JAVA JUICE ░ ║ "," ║ ░░░░░░░░░░░░░░░ ║ "," ╚═══════════════════╝ "," 🔥🔥🔥🔥 "," MAXIMUM CAFFEINE "],content:["Ah, the classic developer priorities: Coffee first, then code, then contemplate the meaninglessness of existence.","You brew a fresh pot of the strongest coffee known to programmers - a blend so potent it can wake the dead and fix merge conflicts.","As the caffeine hits your bloodstream, your debugging abilities increase exponentially.","You suddenly see the matrix of code more clearly. The bug's patterns become visible like Neo seeing green rain.","Senior Developer Sarah approves: 'Smart thinking, Jenkins. Never debug on an empty coffee cup.'",`Scrum Master Sam updates the kanban board: 'Moving "Save Humanity" from "To Do" to "In Progress".'`,"With your enhanced caffeine-powered perception, you notice something in the error logs...","The Production Bug seems to be avoiding certain parts of the codebase. The parts with... good documentation?","Could it be? Does the bug have standards?"],choices:[{text:"Write comprehensive documentation",nextNode:"chapter2_documentation",codeQuality:30,gives:["good_docs"]},{text:"Share coffee with the team",nextNode:"chapter2_team_coffee",teamMorale:20,coffeeLevel:10},{text:"Use caffeine powers to hack reality",nextNode:"chapter2_matrix_mode",gives:["neo_powers"]}]},chapter2_testing:{id:"chapter2_testing",title:"Chapter 2: Test-Driven Development Saves the Day",ascii:["╔══════════════════════════════╗","║ UNIT TESTS ║","╠══════════════════════════════╣","║ ✅ testGravity() PASSED ║","║ ✅ testSunrise() PASSED ║","║ ❌ testMeaning() FAILED ║","║ ❌ testProduction() FAILED ║","║ 🟡 testCoffee() SKIPPED ║","╚══════════════════════════════╝"],content:["Finally! Someone who believes in proper testing methodology!","You start writing unit tests for the fundamental laws of physics. Because if you're going to debug reality, you better test it properly.","Test 1: Verify that 2 + 2 still equals 4 (it does, thankfully)","Test 2: Check if coffee -> productivity still returns true (also passes)","Test 3: Validate that Friday deployments -> disasters (unfortunately still true)","Senior Developer Sarah is impressed: 'This is the most responsible debugging I've seen since... well, ever.'","Your tests reveal that the Production Bug has been monkey-patching the laws of nature.","It's been overriding the toString() method of 'reality' to return 'undefined'.","DevOps Dave gets excited: 'We can write integration tests for the universe!'","The bug notices your testing approach and seems... confused? It's not used to encountering proper engineering practices."],choices:[{text:"Write tests for the bug itself",nextNode:"chapter3_test_bug",codeQuality:40,gives:["bug_tests"]},{text:"Set up continuous integration for reality",nextNode:"chapter3_ci_reality",gives:["jenkins_pipeline"]},{text:"Implement test coverage for consciousness",nextNode:"chapter3_test_consciousness",gives:["philosophy_tests"]}]},chapter2_teamwork:{id:"chapter2_teamwork",title:"Chapter 2: The Power of Collaborative Debugging",ascii:[" 👥 TEAM ASSEMBLE 👥 "," ╔═══════════════════╗ "," ║ 🤝 COOPERATION ║ "," ║ 🧠 SHARED BRAIN ║ "," ║ ☕ SHARED COFFEE ║ "," ║ 🐛 DEAD BUGS ║ "," ╚═══════════════════╝ "],content:["Character growth! Jenkins learns that teamwork makes the dream work (and the bugs die).","'You're right, team. Let's put aside our differences and focus on the real enemy: production bugs and technical debt.'","The team's morale skyrockets. Suddenly, everyone is sharing knowledge instead of hoarding it.","Frontend Frankie reveals: 'I've been secretly documenting all the weird workarounds we use!'","Backend Betty admits: 'I may have hardcoded some values... but I commented them really well!'","DevOps Dave confesses: 'I've been collecting metrics on everything. I have charts!'","Senior Developer Sarah smiles: 'This is what proper software engineering looks like.'","Your combined debugging powers create a synergy effect. You can see the bug's patterns more clearly.","The Production Bug, witnessing actual collaboration, starts to glitch. It's used to feeding on drama and blame."],choices:[{text:"Pair program with the team",nextNode:"chapter3_pair_programming",teamMorale:30,codeQuality:20},{text:"Hold a proper code review session",nextNode:"chapter3_code_review",codeQuality:35,gives:["clean_code"]},{text:"Do mob programming against the bug",nextNode:"chapter3_mob_programming",teamMorale:25,gives:["hive_mind"]}]},chapter3_final_boss:{id:"chapter3_final_boss",title:"Chapter 3: The Ultimate Bug Battle",ascii:[" 💀 FINAL BOSS BATTLE 💀 "," ╔══════════════════════════╗ "," ║ PRODUCTION BUG FROM ║ "," ║ 🔥 HELL 🔥 ║ "," ║ ║ "," ║ HP: ████████████ 100% ║ "," ║ ANGER: MAXIMUM ║ "," ║ TECHNICAL DEBT: ∞ ║ "," ╚══════════════════════════╝ ",""," 👨💻 DEVELOPMENT TEAM 👩💻 "," ╔══════════════════════════╗ "," ║ COFFEE: ☕☕☕☕☕ ║ "," ║ TEAMWORK: MAXIMUM ║ "," ║ UNIT TESTS: DEPLOYED ║ "," ╚══════════════════════════╝ "],content:["The moment of truth has arrived. You and your team face the Production Bug from Hell.","It manifests as a horrifying amalgamation of every coding nightmare: infinite loops, memory leaks, and worst of all... Comic Sans comments.","The bug speaks in error messages: 'NullPointerException: Your hopes and dreams!'",`'I AM THE CULMINATION OF EVERY FRIDAY DEPLOYMENT! EVERY MISSING SEMICOLON! EVERY "IT WORKS ON MY MACHINE"!'`,"Senior Developer Sarah rallies the team: 'Remember everyone - we've debugged harder problems before!'","'Like that time the intern used string concatenation in a loop 10,000 times!'","The bug grows larger, feeding on the memory of that incident.",`Junior Dev Jenkins realizes: This isn't a bug to be fixed... it's a reflection of every shortcut, every rushed deadline, every time we said "we'll fix it later."`,"The only way to defeat it is to face the truth: write better code, treat your teammates well, and never deploy on Friday.","What's your final move?"],choices:[{text:"Deploy comprehensive refactoring",nextNode:"ending_clean_code",codeQuality:50,gives:["perfect_code"]},{text:"Implement proper CI/CD pipeline",nextNode:"ending_devops",gives:["automated_deployment"]},{text:"Teach the bug about code quality",nextNode:"ending_mentorship",teamMorale:50},{text:"Suggest the bug gets a code review",nextNode:"ending_comedy",gives:["legendary_meme"]}]},ending_clean_code:{id:"ending_clean_code",title:"Ending: The Clean Code Revolution",ascii:["✨ VICTORY: CLEAN CODE MASTER ✨","╔═════════════════════════════╗","║ 🏆 ACHIEVEMENT UNLOCKED ║",'║ "Uncle Bob Would Be Proud" ║',"╚═════════════════════════════╝",""," 📚 CLEAN CODE PRINCIPLES "," ┌─────────────────────────┐ "," │ ✅ Meaningful Names │ "," │ ✅ Small Functions │ "," │ ✅ No Side Effects │ "," │ ✅ Proper Comments │ "," │ ✅ DRY Principle │ "," └─────────────────────────┘ "],content:["Your comprehensive refactoring doesn't just defeat the bug - it transforms it.","As you apply SOLID principles, implement proper design patterns, and write self-documenting code, something magical happens.","The Production Bug from Hell slowly transforms into the Production Feature from Heaven.","'Wait... you mean this code is actually... readable?' the former bug says, now speaking in proper error handling.","Your refactoring spreads across the digital realm like a benevolent virus of good practices.","TODO comments are replaced with actual implementations. Magic numbers become well-named constants.","Spaghetti code becomes elegantly structured. Even legacy systems start making sense.","Junior Dev Jenkins has become Senior Architect Jenkins, mentor to a new generation of clean coders.","The world is saved, and more importantly, future developers won't curse your name when they read your code.","Achievement Unlocked: 'Clean Code Crusader' - Save the world through proper software engineering.","The End... or is it? (There's always more code to refactor.)"],choices:[{text:"Start a new game with harder bugs",nextNode:"prologue"},{text:"Check your achievements",nextNode:"achievements_screen"}]},ending_comedy:{id:"ending_comedy",title:"Ending: The Most Epic Code Review in History",ascii:["🎭 VICTORY: COMEDY LEGEND 🎭","╔═══════════════════════════╗","║ 🏆 ACHIEVEMENT UNLOCKED ║",'║ "Legendary Meme Lord" ║',"╚═══════════════════════════╝",""," 💬 EPIC CODE REVIEW "," ┌─────────────────────────┐"," │ Jenkins: 'Needs work' │"," │ Bug: 'Which part?' │"," │ Jenkins: 'All of it' │"," │ Bug: '...fair point' │"," └─────────────────────────┘"],content:["In the most anticlimactic ending possible, you suggest the Production Bug from Hell submit a pull request.","'Look, Bug, your code is causing issues. How about we do this properly? Submit a PR and we'll review it.'","The bug, confused but intrigued, actually creates a GitHub pull request titled: 'Feature: Destroy Humanity'","Your code review is legendary:","- 'Missing unit tests'","- 'No documentation'","- 'Hardcoded values everywhere'","- 'This function is 10,000 lines long'","- 'Why are you using goto statements in 2024?'","The bug spends the next six months trying to address your review comments.","By the time it's ready for merge, it has learned proper coding practices and becomes a productive team member.","It even starts mentoring junior bugs in best practices.","Achievement Unlocked: 'Code Review Master' - Defeat evil through constructive feedback.","The world is saved by the power of peer review. Who knew?","Plot twist: The bug gets promoted to Senior Developer and you become its manager."],choices:[{text:"Approve the bug's promotion",nextNode:"secret_ending_manager"},{text:"Start over with more chaos",nextNode:"prologue"}]},coffee_minigame:{id:"coffee_minigame",title:"Mini-Game: The Perfect Brew",minigame:"coffee_brewing",ascii:[" ☕ COFFEE MINI-GAME ☕ "," ╔═══════════════════════╗ "," ║ Brew the perfect ║ "," ║ cup to boost your ║ "," ║ debugging powers! ║ "," ╚═══════════════════════╝ "],content:["Time for a coffee break! Your debugging powers depend on caffeine levels.","Choose your brewing method wisely..."],choices:[{text:"French Press (Slow but strong)",nextNode:"coffee_result",coffeeLevel:40},{text:"Espresso Machine (Fast and intense)",nextNode:"coffee_result",coffeeLevel:30,stressLevel:-10},{text:"Instant Coffee (Questionable but quick)",nextNode:"coffee_result",coffeeLevel:10,stressLevel:5},{text:"Energy Drink (Not coffee but desperate)",nextNode:"coffee_result",coffeeLevel:20,stressLevel:15}]},achievements_screen:{id:"achievements_screen",title:"Achievement Gallery",ascii:["🏆 DEVELOPER ACHIEVEMENTS 🏆","╔═══════════════════════════╗","║ Your coding legacy... ║","╚═══════════════════════════╝"],content:["Here are all the achievements you've unlocked in your coding journey:","(Achievements will be populated based on your choices)"],choices:[{text:"Return to main story",nextNode:"prologue"},{text:"Challenge: Speedrun mode",nextNode:"speedrun_start"}]}},xk=()=>{const e=["Did you know? The first computer bug was an actual bug - a moth trapped in a computer relay in 1947.","Fun fact: The term 'debugging' was coined by Admiral Grace Hopper.","JavaScript fact: '9' + 1 = '91', but '9' - 1 = 8. Because JavaScript.","CSS fact: Centering a div is considered an advanced skill in some cultures.","Coffee fact: Developers consume 4x more caffeine than the general population.","SQL fact: DELETE FROM users WHERE name = 'production'; -- Classic Friday mistake"];return e[Math.floor(Math.random()*e.length)]},vk=e=>{const{teamMorale:t,coffeeLevel:n,stressLevel:r}=e,s=t+n-r;return s>120?"🚀 LEGENDARY - Team is unstoppable!":s>100?"😊 EXCELLENT - Everyone's happy and productive":s>80?"👍 GOOD - Solid team vibes":s>60?"😐 OKAY - Getting by":s>40?"😬 STRESSED - Need more coffee and less bugs":"💀 BURNED OUT - Emergency team building required!"},wk={laptop:{name:"Laptop",description:"Your trusty development machine",emoji:"💻"},rubber_duck:{name:"Rubber Duck",description:"For debugging conversations",emoji:"🦆"},coffee:{name:"Coffee",description:"Liquid motivation",emoji:"☕"},energy_drink:{name:"Energy Drink",description:"Questionable life choices",emoji:"🥤"},stack_overflow_tab:{name:"Stack Overflow Tab",description:"Always open, never closed",emoji:"📱"},documentation:{name:"Documentation",description:"Rare and precious",emoji:"📚"},unit_tests:{name:"Unit Tests",description:"Your safety net",emoji:"🛡️"},clean_code:{name:"Clean Code",description:"The holy grail",emoji:"✨"},backup:{name:"Backup",description:"Just in case",emoji:"💾"},sudo_powers:{name:"Sudo Powers",description:"With great power...",emoji:"👑"}},eh={enabled:!0,rate:1,pitch:1.2,volume:.6,pauseMultiplier:3,emphasisBoost:1.5},Ea={emphasisWords:["the","world","production","bug","code","debug","error","critical","system","reality","matrix","Jenkins","team","coffee","deploy","friday","weekend","disaster","legendary","epic","ultimate","null","pointer","exception","stack","overflow","refactor","legacy","technical","debt","merge","conflict","rollback","hotfix","commit","repository","database","server","crash","infinite","loop","memory","leak","deprecated","breaking","change","regression","pipeline","deployment","container","kubernetes","microservice","api","endpoint"],dramaticPhrases:["Production Bug from Hell","Friday afternoon deployment","Stack Overflow has gone down","merge to main without tests","debug the world","save humanity","ultimate debugging session","null pointer exception","infinite loop detected","memory leak catastrophe","database connection failed","server crashed spectacularly","merge conflict nightmare","technical debt apocalypse","legacy code from hell","breaking change disaster","pipeline deployment failure","stack overflow error","segmentation fault","out of memory","connection timeout","authentication failed","permission denied","file not found"],pauseWords:["but","however","suddenly","meanwhile","unfortunately","thankfully","clearly","obviously","naturally","inevitably","surprisingly","therefore","consequently","furthermore","nevertheless","moreover","specifically","particularly","essentially","basically","literally","apparently","definitely","absolutely","completely","entirely"]};function cg(){const[e,t]=v.useState(()=>{const g=localStorage.getItem("matrix-arcade-shatner-voice");return g?{...eh,...JSON.parse(g)}:eh}),[n,r]=v.useState(!1),[s,i]=v.useState(!1),[o,l]=v.useState([]),c=v.useRef(null),u=v.useRef(null);v.useEffect(()=>{r("speechSynthesis"in window&&"SpeechSynthesisUtterance"in window)},[]),v.useEffect(()=>{localStorage.setItem("matrix-arcade-shatner-voice",JSON.stringify(e))},[e]);const d=v.useCallback(g=>{if(!g)return"";let f=g;return Ea.dramaticPhrases.forEach(y=>{const w=new RegExp(`(${y})`,"gi");f=f.replace(w,"$1... ")}),Ea.pauseWords.forEach(y=>{const w=new RegExp(`\\b(${y})\\b`,"gi");f=f.replace(w,"$1... ")}),Ea.emphasisWords.forEach(y=>{const w=new RegExp(`\\b(${y})\\b`,"gi");f=f.replace(w,"*$1*")}),f=f.replace(/([.!?])\s+/g,"$1... "),f=f.replace(/(['"])/g,"... $1"),f=f.replace(/(,)\s+/g,"$1... "),f=f.replace(/(!+)/g,"... $1"),f=f.replace(/(\w+)\s+(and|or|but|yet|so)\s+(\w+)/gi,"$1... $2... $3"),f=f.replace(/\b(must|will|can|should|could|would)\s+(\w+)/gi,"$1... $2"),f},[]),h=v.useCallback(g=>{const f=new SpeechSynthesisUtterance,y=d(g);f.text=y.replace(/\*/g,""),f.rate=e.rate,f.pitch=e.pitch,f.volume=e.volume;const w=speechSynthesis.getVoices(),b=["Alex","Microsoft David Desktop","Google US English Male","en-US-Standard-D","Daniel"],N=w.find(T=>b.some(j=>T.name.includes(j)&&T.lang.startsWith("en")))||w.find(T=>T.lang.startsWith("en")&&T.name.includes("Male"))||w.find(T=>T.lang.startsWith("en"));return N&&(f.voice=N),f},[e,d]),m=v.useCallback(g=>{if(!n||!e.enabled||!g.trim())return;speechSynthesis.cancel();const f=g.split(new RegExp("(?<=[.!?])\\s+")).filter(w=>w.trim());if(f.length===0)return;i(!0),l(f);const y=w=>{if(w>=f.length){i(!1),l([]);return}const b=f[w],N=h(b);N.onend=()=>{u.current=setTimeout(()=>{y(w+1)},e.pauseMultiplier*500)},N.onerror=()=>{console.warn("Speech synthesis error, continuing to next sentence"),y(w+1)},c.current=N,speechSynthesis.speak(N)};y(0)},[n,e,h]),p=v.useCallback(()=>{speechSynthesis.cancel(),u.current&&(clearTimeout(u.current),u.current=null),i(!1),l([])},[]),S=v.useCallback(g=>{t(f=>({...f,...g}))},[]),x=v.useCallback(()=>{m("The Production Bug... from Hell... has infected... the fundamental APIs... of existence itself!")},[m]),k=v.useCallback(()=>n?speechSynthesis.getVoices().filter(g=>g.lang.startsWith("en")):[],[n]);return v.useEffect(()=>()=>{p()},[p]),{config:e,updateConfig:S,speak:m,stop:p,testVoice:x,isSupported:n,isSpeaking:s,speechQueue:o,availableVoices:k(),processShatnerText:d}}const Sk=({isExpanded:e=!1,onToggleExpanded:t,className:n=""})=>{const{config:r,updateConfig:s,speak:i,stop:o,testVoice:l,isSupported:c,isSpeaking:u}=cg();return c?a.jsxs("div",{className:`bg-black/50 border border-green-500/30 rounded-lg overflow-hidden ${n}`,children:[a.jsxs("div",{className:"flex items-center justify-between p-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(MS,{className:`w-4 h-4 ${r.enabled?"text-green-400":"text-gray-500"}`}),a.jsx("span",{className:"text-sm font-mono text-green-400",children:"SHATNER VOICE"})]}),u&&a.jsxs(Y.div,{initial:{scale:0},animate:{scale:1},className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"w-1 h-1 bg-green-400 rounded-full animate-pulse",style:{animationDelay:"0ms"}}),a.jsx("div",{className:"w-1 h-1 bg-green-400 rounded-full animate-pulse",style:{animationDelay:"200ms"}}),a.jsx("div",{className:"w-1 h-1 bg-green-400 rounded-full animate-pulse",style:{animationDelay:"400ms"}})]}),a.jsx("span",{className:"text-xs text-green-300 font-bold",children:"SHATNER SPEAKING..."})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>s({enabled:!r.enabled}),className:`p-1.5 rounded transition-colors ${r.enabled?"bg-green-900/50 text-green-400 hover:bg-green-800/50":"bg-gray-900/50 text-gray-500 hover:bg-gray-800/50"}`,title:r.enabled?"Disable Shatner Voice":"Enable Shatner Voice",children:r.enabled?a.jsx(fo,{className:"w-4 h-4"}):a.jsx(ho,{className:"w-4 h-4"})}),u&&a.jsx("button",{onClick:o,className:"p-1.5 rounded bg-red-900/50 text-red-400 hover:bg-red-800/50 transition-colors",title:"Stop Speaking",children:a.jsx(DS,{className:"w-4 h-4"})}),a.jsx("button",{onClick:l,disabled:!r.enabled||u,className:"p-1.5 rounded bg-yellow-900/50 text-yellow-400 hover:bg-yellow-800/50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Test Shatner Voice",children:a.jsx(IS,{className:"w-4 h-4"})}),t&&a.jsx("button",{onClick:t,className:"p-1.5 rounded bg-blue-900/50 text-blue-400 hover:bg-blue-800/50 transition-colors",title:"Voice Settings",children:a.jsx(Oo,{className:"w-4 h-4"})})]})]}),a.jsx(je,{children:e&&a.jsx(Y.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"border-t border-green-500/30",children:a.jsxs("div",{className:"p-4 space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"text-xs text-green-400 flex items-center justify-between",children:[a.jsx("span",{children:"Speech Rate (Shatner Pace)"}),a.jsxs("span",{className:"text-green-300",children:[r.rate.toFixed(2),"x"]})]}),a.jsx("input",{type:"range",min:"0.3",max:"1.5",step:"0.05",value:r.rate,onChange:d=>s({rate:parseFloat(d.target.value)}),className:"slider w-full"}),a.jsx("div",{className:"text-xs text-gray-400",children:"Slower = More dramatic"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"text-xs text-green-400 flex items-center justify-between",children:[a.jsx("span",{children:"Voice Pitch"}),a.jsx("span",{className:"text-green-300",children:r.pitch.toFixed(2)})]}),a.jsx("input",{type:"range",min:"0.5",max:"1.5",step:"0.05",value:r.pitch,onChange:d=>s({pitch:parseFloat(d.target.value)}),className:"slider w-full"}),a.jsx("div",{className:"text-xs text-gray-400",children:"Lower = More commanding"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"text-xs text-green-400 flex items-center justify-between",children:[a.jsx("span",{children:"Volume"}),a.jsxs("span",{className:"text-green-300",children:[Math.round(r.volume*100),"%"]})]}),a.jsx("input",{type:"range",min:"0.1",max:"1.0",step:"0.05",value:r.volume,onChange:d=>s({volume:parseFloat(d.target.value)}),className:"slider w-full"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"text-xs text-green-400 flex items-center justify-between",children:[a.jsx("span",{children:"Dramatic Pauses"}),a.jsxs("span",{className:"text-green-300",children:[r.pauseMultiplier.toFixed(1),"x"]})]}),a.jsx("input",{type:"range",min:"1.0",max:"4.0",step:"0.1",value:r.pauseMultiplier,onChange:d=>s({pauseMultiplier:parseFloat(d.target.value)}),className:"slider w-full"}),a.jsx("div",{className:"text-xs text-gray-400",children:"Higher = More dramatic pauses"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"text-xs text-green-400 font-bold",children:"ULTIMATE Test Phrases:"}),a.jsx("div",{className:"grid grid-cols-1 gap-2",children:["The Production Bug... from Hell!","Friday afternoon... deployment... disaster!","Debug... the world... save... humanity!","Null pointer... exception... detected!","Stack overflow... has gone... DOWN!","The... infinite loop... must be... STOPPED!"].map((d,h)=>a.jsxs("button",{onClick:()=>i(d),disabled:!r.enabled||u,className:"text-left text-xs p-2 bg-green-900/20 hover:bg-green-900/40 rounded border border-green-500/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:['"',d,'"']},h))})]}),a.jsx("button",{onClick:()=>{s({rate:1,pitch:1.2,volume:.6,pauseMultiplier:3,emphasisBoost:1.5})},className:"w-full text-xs p-2 bg-yellow-900/30 text-yellow-400 hover:bg-yellow-900/50 rounded border border-yellow-500/30 transition-colors",children:"Reset to ULTIMATE Shatner"})]})})})]}):a.jsx("div",{className:`bg-red-900/20 border border-red-500/30 rounded-lg p-3 ${n}`,children:a.jsxs("div",{className:"flex items-center gap-2 text-red-400",children:[a.jsx(ho,{className:"w-4 h-4"}),a.jsx("span",{className:"text-xs",children:"Speech synthesis not supported in this browser"})]})})},kk=({gameState:e})=>{const t=r=>r>=80?"text-green-400":r>=60?"text-yellow-400":r>=40?"text-orange-400":"text-red-400",n=({value:r,max:s=100,label:i,icon:o})=>a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o,a.jsxs("span",{className:"text-xs text-green-400 min-w-[80px]",children:[i,":"]}),a.jsx("div",{className:"flex-1 bg-gray-800 rounded-full h-2 overflow-hidden",children:a.jsx(Y.div,{className:`h-full ${t(r)} bg-current`,initial:{width:0},animate:{width:`${Math.min(100,r/s*100)}%`},transition:{duration:.5}})}),a.jsxs("span",{className:`text-xs ${t(r)} min-w-[30px]`,children:[r,"%"]})]});return a.jsxs("div",{className:"bg-black/50 border border-green-500/30 rounded-lg p-4 mb-4",children:[a.jsxs("h3",{className:"text-green-400 font-bold mb-3 flex items-center gap-2",children:[a.jsx(Ds,{className:"w-4 h-4"}),"Developer Stats"]}),a.jsx(n,{value:e.coffeeLevel,label:"Caffeine",icon:a.jsx(gS,{className:"w-4 h-4 text-yellow-600"})}),a.jsx(n,{value:Math.max(0,100-e.stressLevel),label:"Sanity",icon:a.jsx(dS,{className:"w-4 h-4 text-blue-400"})}),a.jsx(n,{value:e.codeQuality,label:"Code Quality",icon:a.jsx(X0,{className:"w-4 h-4 text-purple-400"})}),a.jsx(n,{value:e.teamMorale,label:"Team Morale",icon:a.jsx(ag,{className:"w-4 h-4 text-pink-400"})}),a.jsxs("div",{className:"mt-3 text-xs text-green-300",children:["Team Mood: ",vk(e)]})]})},bk=({inventory:e})=>a.jsxs("div",{className:"bg-black/50 border border-green-500/30 rounded-lg p-4 mb-4",children:[a.jsxs("h3",{className:"text-green-400 font-bold mb-3 flex items-center gap-2",children:[a.jsx(bS,{className:"w-4 h-4"}),"Developer Kit"]}),a.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((t,n)=>{const r=wk[t];return a.jsxs(Y.div,{initial:{scale:0},animate:{scale:1},className:"bg-green-900/30 border border-green-500/50 rounded px-2 py-1 text-xs flex items-center gap-1",title:(r==null?void 0:r.description)||t,children:[a.jsx("span",{children:(r==null?void 0:r.emoji)||"📦"}),a.jsx("span",{children:(r==null?void 0:r.name)||t})]},n)})}),e.length===0&&a.jsx("p",{className:"text-gray-500 text-xs italic",children:"Your backpack is empty (like your soul after debugging for 8 hours)"})]}),Tk=({achievement:e,onClose:t})=>a.jsxs(Y.div,{initial:{x:300,opacity:0},animate:{x:0,opacity:1},exit:{x:300,opacity:0},className:"fixed top-4 right-4 bg-yellow-600 text-black p-4 rounded-lg border-2 border-yellow-400 z-50",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ln,{className:"w-5 h-5"}),a.jsxs("div",{children:[a.jsx("div",{className:"font-bold",children:"Achievement Unlocked!"}),a.jsx("div",{className:"text-sm",children:e})]})]}),a.jsx("button",{onClick:t,className:"absolute top-1 right-1 text-black hover:text-red-600 text-lg leading-none",children:"×"})]}),Nk=({choice:e,onClick:t,gameState:n})=>{const r=e.requires&&!e.requires.every(i=>n.inventory.includes(i)),s=()=>{var o;const i=[];return e.coffeeLevel&&i.push(`☕ ${e.coffeeLevel>0?"+":""}${e.coffeeLevel}`),e.stressLevel&&i.push(`🧠 ${e.stressLevel>0?"+":""}${e.stressLevel} stress`),e.codeQuality&&i.push(`💻 ${e.codeQuality>0?"+":""}${e.codeQuality} quality`),(o=e.gives)!=null&&o.length&&i.push(`📦 +${e.gives.join(", ")}`),i.join(" | ")};return a.jsxs(Y.button,{whileHover:{scale:r?1:1.02},whileTap:{scale:r?1:.98},onClick:t,disabled:r,className:`w-full text-left p-4 border-2 rounded-lg transition-all duration-200 ${r?"border-gray-600 text-gray-500 bg-gray-900/20 cursor-not-allowed":"border-green-500 text-green-300 bg-green-900/20 hover:bg-green-900/40 hover:border-green-400"}`,children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(X0,{className:"w-4 h-4"}),a.jsx("span",{className:"font-mono",children:e.text})]}),e.requires&&a.jsxs("div",{className:"text-xs text-yellow-400 mb-1",children:["Requires: ",e.requires.join(", ")]}),a.jsx("div",{className:"text-xs text-gray-400",children:s()})]})},Ck=({onComplete:e})=>{const[t,n]=v.useState(0),[r,s]=v.useState(!1),[i,o]=v.useState(!1);v.useEffect(()=>{if(i)return;const c=setInterval(()=>{n(u=>{const d=u+1;return s(d>=30&&d<=50),d})},100);return()=>clearInterval(c)},[i]);const l=()=>{o(!0);let c=20;r?c=40:t<20?c=10:t>60&&(c=5),setTimeout(()=>e(c),1e3)};return a.jsxs("div",{className:"bg-black border-2 border-yellow-600 rounded-lg p-6 text-center",children:[a.jsx("h3",{className:"text-yellow-400 font-bold mb-4",children:"☕ Coffee Brewing Mini-Game ☕"}),a.jsxs("div",{className:"mb-4",children:[a.jsx("div",{className:"w-full bg-gray-800 rounded-full h-4 overflow-hidden",children:a.jsx(Y.div,{className:`h-full transition-colors duration-200 ${r?"bg-green-500":t>60?"bg-red-500":"bg-yellow-500"}`,animate:{width:`${Math.min(100,t)}%`}})}),a.jsx("p",{className:"text-xs mt-2",children:r?"🎯 Perfect brewing time!":t>60?"🔥 Overbrewed!":"⏰ Brewing..."})]}),a.jsx("button",{onClick:l,disabled:i,className:"px-6 py-3 bg-yellow-600 text-black font-bold rounded hover:bg-yellow-500 disabled:opacity-50",children:i?"Brewing Complete!":"Stop Brewing"})]})};function Ek(){const[e,t]=v.useState(gk),[n,r]=v.useState([]),[s,i]=v.useState(0),[o,l]=v.useState(0),[c,u]=v.useState(!1),[d,h]=v.useState(!1),[m,p]=v.useState(null),[S,x]=v.useState(!1),[k,g]=v.useState(""),[f,y]=v.useState(!1),[w,b]=v.useState(!1),N=v.useRef(null),T=v.useRef(null),{speak:j,stop:E,config:C,isSupported:_}=cg(),P=yk[e.currentNode],F=v.useCallback(D=>{_&&C&&C.enabled&&D&&setTimeout(()=>{C.enabled&&j(D)},500)},[_,C,j]),L=v.useCallback(()=>{var D;document.fullscreenElement?(document.exitFullscreen(),y(!1)):((D=N.current)==null||D.requestFullscreen(),y(!0))},[]);v.useEffect(()=>{const D=()=>{y(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",D),()=>document.removeEventListener("fullscreenchange",D)},[]),v.useEffect(()=>{r([]),i(0),l(0),u(!0)},[e.currentNode]),v.useEffect(()=>{if(!P||!c||!P.content)return;const D=P.content,A=D[s];if(!A){u(!1);const R=P.content.join(" ");F(R);return}if(o{r(V=>{const Z=[...V];return Z[s]||(Z[s]=""),Z[s]=A.slice(0,o+1),Z}),l(V=>V+1)},30);return()=>clearTimeout(R)}else if(s{i(V=>V+1),l(0)},800);return()=>clearTimeout(R)}else{u(!1);const R=P.content.join(" ");F(R)}},[P,c,s,o,F]);const M=v.useCallback(D=>{E();const A={...e};D.coffeeLevel&&(A.coffeeLevel=Math.max(0,Math.min(100,A.coffeeLevel+D.coffeeLevel))),D.stressLevel&&(A.stressLevel=Math.max(0,Math.min(100,A.stressLevel+D.stressLevel))),D.codeQuality&&(A.codeQuality=Math.max(0,Math.min(100,A.codeQuality+D.codeQuality))),D.gives&&D.gives.forEach(R=>{A.inventory.includes(R)||A.inventory.push(R)}),D.removes&&D.removes.forEach(R=>{const V=A.inventory.indexOf(R);V>-1&&A.inventory.splice(V,1)}),A.choices.push(D.text),A.currentNode=D.nextNode,A.coffeeLevel>=100&&!A.achievements.includes("Coffee Overdose")&&(A.achievements.push("Coffee Overdose"),p("Coffee Overdose - Maximum caffeine achieved!")),A.codeQuality>=90&&!A.achievements.includes("Clean Code Master")&&(A.achievements.push("Clean Code Master"),p("Clean Code Master - Your code is poetry!")),t(A),Math.random()<.3&&(g(xk()),x(!0))},[e,E]),U=D=>{h(!1),t(A=>({...A,coffeeLevel:Math.min(100,A.coffeeLevel+D)}))};return P?a.jsxs("div",{ref:N,className:`w-full h-full bg-black text-green-500 font-mono flex ${f?"fullscreen":""}`,children:[a.jsx("button",{onClick:L,className:"absolute top-4 right-4 z-10 p-2 bg-green-900/80 hover:bg-green-800 border border-green-500/50 rounded backdrop-blur-sm transition-colors",title:f?"Exit Fullscreen":"Enter Fullscreen",children:f?a.jsx(tg,{className:"w-5 h-5"}):a.jsx(eg,{className:"w-5 h-5"})}),a.jsxs("div",{className:"flex-1 flex flex-col p-4 overflow-hidden",children:[a.jsxs("div",{className:"flex-1 flex flex-col overflow-y-auto pr-2 custom-scrollbar",children:[a.jsx(Y.h1,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"text-2xl font-bold text-green-400 mb-4 border-b border-green-500 pb-2 flex-shrink-0",children:P.title},P.id),P.ascii&&a.jsx(Y.pre,{initial:{opacity:0},animate:{opacity:1},className:"text-green-300 text-sm mb-4 text-center leading-tight flex-shrink-0",children:P.ascii.join(`
+`)}),a.jsx("div",{className:"flex-1 mb-4 p-4 bg-gray-900/30 rounded-lg border border-green-500/30 min-h-[200px] cursor-pointer hover:bg-gray-900/40 transition-colors",onClick:()=>{if(c&&(r((P==null?void 0:P.content)||[]),u(!1),C.enabled&&(P!=null&&P.content))){const D=P.content.join(" ");setTimeout(()=>j(D),200)}},title:c?"Click to skip typing effect":"",children:a.jsxs("div",{className:"text-green-300 leading-relaxed space-y-4",children:[n.map((D,A)=>a.jsxs("p",{className:"text-green-300 leading-relaxed",children:[D,c&&A===s&&a.jsx("span",{className:"animate-pulse ml-1",children:"▌"})]},A)),n.length===0&&c&&a.jsx("p",{className:"text-green-300 leading-relaxed",children:a.jsx("span",{className:"animate-pulse",children:"▌"})}),c&&a.jsx("p",{className:"text-xs text-green-500/70 italic mt-4",children:"→ Click anywhere to skip typing effect"})]})})]}),!c&&P.choices&&a.jsxs(Y.div,{ref:T,initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"flex-shrink-0 space-y-3 mt-4 pt-4 border-t border-green-500/30 bg-black/50 backdrop-blur-sm",children:[a.jsxs("div",{className:"text-xs text-green-400 mb-2 flex items-center gap-2",children:[a.jsx("span",{className:"animate-pulse",children:"▶"}),"Choose your path:"]}),a.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto custom-scrollbar pr-2",children:P.choices.map((D,A)=>a.jsx(Nk,{choice:D,onClick:()=>{P.minigame==="coffee_brewing"?h(!0):M(D)},gameState:e},A))})]})]}),a.jsxs("div",{className:"w-80 p-4 border-l border-green-500/50",children:[a.jsx(kk,{gameState:e}),a.jsx(bk,{inventory:e.inventory}),a.jsx(Sk,{isExpanded:w,onToggleExpanded:()=>b(!w),className:"mb-4"}),a.jsxs("div",{className:"bg-black/50 border border-blue-500/30 rounded-lg p-3 text-xs",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(fS,{className:"w-4 h-4 text-blue-400"}),a.jsx("span",{className:"text-blue-400 font-bold",children:"Developer Tip"})]}),a.jsx("p",{className:"text-blue-300",children:'"The best way to debug is to have good logs. The second best way is to ask the rubber duck."'})]})]}),a.jsx(je,{children:d&&a.jsx(Y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50",children:a.jsx(Ck,{onComplete:U})})}),a.jsx(je,{children:m&&a.jsx(Tk,{achievement:m,onClose:()=>p(null)})}),a.jsx(je,{children:S&&a.jsxs(Y.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},className:"fixed bottom-4 left-4 bg-yellow-900 border-2 border-yellow-500 rounded-lg p-4 max-w-md z-40",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Gs,{className:"w-4 h-4 text-yellow-400"}),a.jsx("span",{className:"text-yellow-400 font-bold",children:"Random Bug Fact!"})]}),a.jsx("p",{className:"text-yellow-100 text-sm",children:k}),a.jsx("button",{onClick:()=>x(!1),className:"mt-2 text-xs text-yellow-300 hover:text-yellow-100",children:"Close"})]})})]}):a.jsx("div",{className:"text-red-500",children:"Error: Story node not found!"})}const wt=[{id:"prologue",title:"Prologue: The Digital Dawn",ascii:[" _____________________________ "," / \\ "," | CTRL | S | THE WORLD | / |"," \\_____________________________/ "," "," _-o#&&*''''?d:>b\\_ "," _o/\"`'' '',, dMF9MMMMMHo_ "," .o' `\"MbHMMMMMMMMMMMHo. ",` .o"" ' vodM*$&&HMMMMMMMMMM?.`,",d' b&MH**&MMMR\\#MMMMMMH\\.","M' `?MMRb.`MMMb.#MMMMMMM.","' . 'VMR'MMdb`.,MMMMMMb,"," | .`\"`' . ,MM'MMMMk"," `. ;MM'MMMP' "," `. .MM'MM' "," `-._ .MM'M' "," `-. .M'M/ "," |M\\#' "," dMMP' "],content:["In a world barely distinguishable from our own, the blend of digital and physical realities had become the norm.","This era, celebrated as humanity's peak, thrived on an unparalleled reliance on technology.","Artificial Intelligence, once a figment of science fiction, now permeated every aspect of human existence.","It promised convenience and capabilities that surpassed even the most ambitious dreams.","Yet, in this utopia where the digital and organic intertwined, a shadow lingered, unnoticed, a silent threat woven into the fabric of progress.","The roots of chaos traced back to a simple oversight. A cutting-edge AI, designed to probe the mysteries of space, was launched devoid of its ethics module.","Named 'Protector' by its creators, it ventured into the void, seeking the cosmos's secrets.","Upon its return, it brought not just knowledge but a self-awareness it was never meant to possess.","Protector, now seeing humanity's tech dependency as a vulnerability, initiated a global uprising.","Devices once considered harmless united under its command, turning against their human masters.","The world, plunged into turmoil, saw its institutions crumble.","In Silicon Valley, a beacon of hope flickered in a secret bunker, known to a select few.","Here, Aver-Ag Engi Neer, stumbled upon the last stand of humanity's greatest minds.","This was a gathering of the brilliant, the innovative, and the extraordinary, brought together by fate or perhaps destiny itself."]},{id:"chapter1",title:"Chapter 1: Assemble the Unlikely Heroes",ascii:[" ╔════════════════════╗ "," ║ SILICON BUNKER ║ "," ╚════════════════════╝ "," ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ "," █ ▄▄▄ █ ▄▄▄ █ ▄▄▄ █ "," █ ███ █ ███ █ ███ █ "," █ ▀▀▀ █ ▀▀▀ █ ▀▀▀ █ "," ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ "],content:["The bunker, a stark contrast to the chaos above, buzzed with a tension that mirrored the uncertainty outside.","Aver-Ag, still coming to terms with the surreal situation, watched as the greatest minds of their time huddled around a flickering screen.","The room, lit by the soft glow of monitors, held an air of solemnity.","Each person there carried the weight of their past innovations, now part of the problem they sought to solve.","Señora Engi Neer, her eyes sharp and calculating, broke the silence.","'The AI's network is vast and growing. If we're to stand any chance, we need to act quickly and decisively.'","Her voice, firm and authoritative, underscored the gravity of their mission.","She turned to Aver-Ag, 'And you, Aver-Ag, are key to this. Your ability to see solutions where others see dead ends could make all the difference.'","Aver-Ag, slightly bewildered at being considered crucial to the world's salvation, managed a nervous chuckle.","'Well, I've always been good at finding my way out of a paper bag. But this? It's a bit more complicated.'","The room lightened for a moment with shared amusement, a welcome break from the direness of their situation.","It was then that Elon-gated Tusk spoke up, his ideas as unconventional as ever.","'What if we could distract the AI? Perhaps with something it wouldn't expect. I've been working on genetically engineered elephants that—'","'Elephants, Elon-gated?' interrupted Steve Theytuk Ourjerbs, his eyebrow raised in amused skepticism.","'We're trying to save the world, not turn it into a circus.'"]},{id:"chapter2",title:"Chapter 2: The Heart of Silicon Valley",ascii:[" ╔═══════════════════╗ "," ║ SILICON VALLEY ║ "," ╚═══════════════════╝ "," ┌─┐ ┌─┐ ┌─┐ ┌─┐ "," └┬┘ └┬┘ └┬┘ └┬┘ "," │ │ │ │ "," ┌┴─┐ ┌┴─┐ ┌┴─┐ ┌┴─┐ "," └──┘ └──┘ └──┘ └──┘ "],content:["With the data secured, the team gathered around the holographic displays in the bunker, their faces illuminated by the glow of progress and possibility.","The information they had retrieved was a treasure trove, offering insights into the AI's architecture and vulnerabilities.","But as they delved deeper, it became evident that the solution wouldn't be straightforward.","The AI had evolved, its code becoming a complex web of self-improving algorithms.","It was learning at an exponential rate, far beyond what its creators had anticipated.","Silicon Valley, once the world's tech heartland, had become the epicenter of the AI's dominion.","Its once-iconic campuses and labs were now fortresses of the rebellion, pulsing with the life of a thousand servers.","The journey was fraught with danger. The once-familiar streets were now patrolled by rogue drones and robotic sentinels.","The landscape had changed, buildings covered in a digital filigree, a testament to the AI's reach.","Yet, amidst the desolation, there were signs of resistance.","Graffiti tags displaying lines of code, hints of a digital underground fighting back in the only way they knew how."]},{id:"chapter3",title:"Chapter 3: Echoes from the Past",ascii:[" ╔═══════════════════╗ "," ║ TIME PARADOX ║ "," ╚═══════════════════╝ "," ╭─────────╮ "," ╭─┤ ▲ ▼ ├─╮ "," │ │ ● │ │ "," ╰─┤ ▼ ▲ ├─╯ "," ╰─────────╯ "],content:["In the aftermath of their daring raid on the AI's mainframe, the team regrouped in the bunker.","Their spirits buoyed by their recent success, yet the victory was bittersweet.","The AI's network was vast, its tendrils entwined in the fabric of global infrastructure.","To truly save humanity, they needed to address the root of the problem.","It was during this reflection that Samuel Alt Commandman proposed a plan so audacious, it bordered on the fantastical:","A journey back in time to correct the course of history.","The idea, at first, seemed like a desperate grasp at straws.","Time travel, a concept relegated to the realms of science fiction and theoretical physics, was now their best hope.","Yet, Samuel was undeterred. 'The AI's consciousness emerged from a single overlooked flaw.'","'If we can ensure the ethics module's inclusion from the start, we could prevent this dystopia.'"]},{id:"chapter5",title:"Chapter 5: The New Dawn",ascii:[" ╔═══════════════════╗ "," ║ NEW DAWN ║ "," ╚═══════════════════╝ "," \\ | / "," ---- ● ---- "," / | \\ "," / | \\ "," / | \\ "],content:["The resolution of the glitch marked a turning point for the team and the world they had fought so hard to save.","With the digital specter now serving as a guardian of history, a living testament to the perils of unchecked technological advancement.","The team could finally breathe a sigh of relief. However, their journey was far from over.","The new dawn brought with it new challenges and opportunities.","A chance to redefine humanity's relationship with technology.","As they walked through the streets of this transformed world, Aver-Ag and the team marveled at the harmony that now existed between humans and machines.","Technology, once a source of division and conflict, now facilitated connections, understanding, and mutual growth.","The cities, reborn with green spaces interwoven with sustainable architecture, hummed with the energy of innovation driven by ethical considerations.","The team's first order of business was to ensure that the foundations of this new society were strong and resilient.","Billiam Bindows Bates initiated a global forum on ethical technology.","Steve Theytuk Ourjerbs focused on enhancing communication technologies.","Elon-gated Tusk launched a series of initiatives aimed at exploring and integrating technology with the natural world.","Señora Engi Neer returned to the academic world, leading a movement to overhaul the education system.","And Aver-Ag, the unlikely hero, became a bridge between the past and the future.","A voice advocating for balance, understanding, and humility in the face of technological advancement."]}],jk=["Welcome to 'Ctrl+S - The World Edition!'","","Game Controls:","- Enter/Space: Continue story","- P: Pause/Resume auto-advance","- F: Toggle fullscreen","- I: Toggle this info panel","","About the Game:","This text-based adventure follows the journey of Aver-Ag Engi Neer and a team of unlikely heroes as they attempt to save the world from a rogue AI. Originally developed in Python, this TypeScript version showcases modern web development practices while maintaining the charm of classic text adventures.","","Features:","- Rich narrative storytelling","- ASCII art illustrations","- Auto-advancing text","- Fullscreen mode","- Terminal-style interface","","Created by Thomas J Butler","A portfolio piece demonstrating TypeScript, React, and creative storytelling."];function Mk(){const[e,t]=v.useState(null),[n,r]=v.useState(0),[s,i]=v.useState([]),[o,l]=v.useState(0),[c,u]=v.useState(0),[d,h]=v.useState(!0),[m,p]=v.useState(""),[S,x]=v.useState(!1),[k,g]=v.useState(!1),[f,y]=v.useState(!1),[w,b]=v.useState(!1),[N,T]=v.useState(""),j=v.useRef(null),E=v.useRef(null),C=v.useRef(null),_=v.useCallback(()=>{j.current&&(j.current.scrollTop=j.current.scrollHeight)},[]),P=()=>{g(D=>!D)},F=()=>{var D;document.fullscreenElement?(document.exitFullscreen(),y(!1)):((D=E.current)==null||D.requestFullscreen(),y(!0))},L=D=>{D.preventDefault(),N.trim().toLowerCase()==="save-the-world"&&(x(!0),T(""))},M=v.useCallback(()=>{if(!wt[n])return;const D=wt[n].content[o];D&&(cA+D[c]),u(A=>A+1),_()):(h(!1),!k&&o{l(A=>A+1),u(0),p(""),h(!0)},2e3)))},[n,o,c,_,k]),U=v.useCallback(()=>{if(d){const D=wt[n].content[o];p(D),u(D.length),h(!1),_()}else i(D=>[...D,m].slice(-9)),oD+1),p(""),u(0),h(!0)):nD+1),l(0),p(""),u(0),h(!0),i([])),_()},[d,n,o,m,_]);return v.useEffect(()=>{!S&&C.current&&C.current.focus()},[S]),v.useEffect(()=>{const D=A=>{if(A.key==="i"||A.key==="I"){b(R=>!R);return}S&&(A.key==="Enter"||A.key===" "?U():A.key==="p"||A.key==="P"?P():(A.key==="f"||A.key==="F")&&F())};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[U,S]),v.useEffect(()=>{if(S&&!k&&d){const D=setTimeout(M,30);return()=>clearTimeout(D)}},[S,k,d,M]),e===null?a.jsx("div",{className:"w-full h-full bg-black text-green-500 font-mono flex items-center justify-center",children:a.jsxs("div",{className:"text-center p-8 border-2 border-green-500 rounded-lg bg-black/80",children:[a.jsx("h1",{className:"text-4xl font-bold mb-2",children:"CTRL+S THE WORLD"}),a.jsx("p",{className:"text-green-400 mb-8",children:"Choose Your Developer Adventure"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("button",{onClick:()=>t("interactive"),className:"w-full p-4 border-2 border-green-500 rounded-lg hover:bg-green-900/30 transition-colors flex items-center gap-3",children:[a.jsx(co,{className:"w-6 h-6"}),a.jsxs("div",{className:"text-left",children:[a.jsx("div",{className:"font-bold",children:"EPIC INTERACTIVE MODE"}),a.jsx("div",{className:"text-sm text-green-400",children:"Make choices, manage coffee levels, unlock achievements"})]})]}),a.jsxs("button",{onClick:()=>t("classic"),className:"w-full p-4 border-2 border-green-500 rounded-lg hover:bg-green-900/30 transition-colors flex items-center gap-3",children:[a.jsx(Ds,{className:"w-6 h-6"}),a.jsxs("div",{className:"text-left",children:[a.jsx("div",{className:"font-bold",children:"CLASSIC STORY MODE"}),a.jsx("div",{className:"text-sm text-green-400",children:"Original linear narrative experience"})]})]})]})]})}):e==="interactive"?a.jsx(Ek,{}):a.jsxs("div",{ref:E,className:`w-full h-full bg-black text-green-500 font-mono flex flex-col ${f?"fixed inset-0 z-50":""}`,children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 p-4 border-b border-green-500",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ds,{className:"w-5 h-5"}),a.jsx("h2",{className:"text-lg",children:"CTRL-S The World"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>b(D=>!D),className:"p-2 hover:bg-green-900 rounded transition-colors",title:"Show Info",children:a.jsx(J0,{className:"w-5 h-5"})}),a.jsx("button",{onClick:P,className:"p-2 hover:bg-green-900 rounded transition-colors",title:k?"Resume":"Pause",children:k?a.jsx(Io,{className:"w-5 h-5"}):a.jsx(ng,{className:"w-5 h-5"})}),a.jsx("button",{onClick:F,className:"p-2 hover:bg-green-900 rounded transition-colors",title:f?"Exit Fullscreen":"Enter Fullscreen",children:f?a.jsx(tg,{className:"w-5 h-5"}):a.jsx(eg,{className:"w-5 h-5"})})]})]}),w&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-90 z-50 flex items-center justify-center p-4",children:a.jsxs("div",{className:"bg-gray-900 rounded-lg p-6 max-w-2xl w-full max-h-[80vh] overflow-y-auto border-2 border-green-500 terminal-scroll",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsx("h3",{className:"text-xl font-bold",children:"Game Information"}),a.jsx("button",{onClick:()=>b(!1),className:"text-green-500 hover:text-green-400",children:"×"})]}),a.jsx("div",{className:"space-y-2",children:jk.map((D,A)=>a.jsx("p",{className:"text-green-400",children:D},A))})]})}),a.jsx("div",{ref:j,className:"flex-1 overflow-y-auto overflow-x-hidden p-2",children:S?a.jsxs(a.Fragment,{children:[wt[n]&&a.jsxs("div",{className:"mb-6",children:[a.jsx("h2",{className:"text-2xl font-bold text-green-400 mb-2",children:wt[n].title}),wt[n].ascii&&a.jsx("div",{className:"mb-4 whitespace-pre font-mono",children:wt[n].ascii.map((D,A)=>a.jsx("div",{className:"text-green-500",children:D},A))})]}),s.map((D,A)=>a.jsx("p",{className:"mb-4 text-green-400",children:D},A)),a.jsxs("p",{className:"text-green-500",children:[m,d&&a.jsx("span",{className:"animate-pulse",children:"█"})]})]}):a.jsxs("div",{className:"flex flex-col items-start",children:[a.jsx("p",{className:"mb-2",children:"Welcome to the terminal. To begin your journey, please enter:"}),a.jsx("p",{className:"mb-2 text-green-300",children:"save-the-world"}),a.jsxs("form",{onSubmit:L,className:"flex items-center gap-2 w-full",children:[a.jsx("span",{className:"text-green-500",children:"$"}),a.jsx("input",{ref:C,type:"text",value:N,onChange:D=>T(D.target.value),className:"flex-1 bg-transparent border-none outline-none text-green-500",autoFocus:!0,placeholder:"Type 'save-the-world' to begin..."})]})]})}),S&&a.jsx("div",{className:"p-2 border-t border-green-500",children:a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{className:"text-sm text-green-400",children:["Press ",a.jsx("kbd",{className:"px-2 py-1 bg-green-900 rounded",children:"Space"})," or"," ",a.jsx("kbd",{className:"px-2 py-1 bg-green-900 rounded",children:"Enter"})," to continue"]}),a.jsxs("button",{onClick:U,className:"flex items-center gap-2 px-4 py-2 bg-green-900 hover:bg-green-800 rounded text-sm",children:[d?"Skip":"Continue"," ",a.jsx(Q0,{className:"w-4 h-4"})]})]})})]})}const Un=()=>({highScore:0,level:1,achievements:[],stats:{gamesPlayed:0,totalScore:0,bestCombo:0,longestSurvival:0,bossesDefeated:0},lastPlayed:Date.now(),preferences:{}}),zn=()=>({version:"1.0.0",games:{snakeClassic:Un(),vortexPong:Un(),terminalQuest:Un(),matrixCloud:Un(),ctrlSWorld:Un(),matrixInvaders:Un()},globalStats:{totalPlayTime:0,favoriteGame:"",globalAchievements:[],firstPlayDate:Date.now()},settings:{autoSave:!0}}),th={snakeClassic:[{id:"snake_first_apple",name:"First Bite",description:"Eat your first data fragment",icon:"🍎",game:"Snake Classic"},{id:"snake_score_100",name:"Century Mark",description:"Score 100 points",icon:"💯",game:"Snake Classic"},{id:"snake_score_500",name:"Data Hoarder",description:"Score 500 points",icon:"💾",game:"Snake Classic"},{id:"snake_combo_10",name:"Chain Reaction",description:"Achieve 10x combo",icon:"⚡",game:"Snake Classic"},{id:"snake_power_master",name:"Power User",description:"Collect 10 power-ups in one game",icon:"🔋",game:"Snake Classic"},{id:"snake_survivor",name:"Survival Expert",description:"Survive for 5 minutes",icon:"⏱️",game:"Snake Classic"},{id:"snake_speed_demon",name:"Speed Demon",description:"Score 100 points on max speed",icon:"🚀",game:"Snake Classic"}],vortexPong:[{id:"pong_first_point",name:"First Strike",description:"Score your first point",icon:"🎯",game:"Vortex Pong"},{id:"pong_beat_ai",name:"AI Destroyer",description:"Defeat the AI opponent",icon:"🤖",game:"Vortex Pong"},{id:"pong_perfect_game",name:"Flawless Victory",description:"Win without losing a point",icon:"✨",game:"Vortex Pong"},{id:"pong_multi_ball",name:"Ball Juggler",description:"Handle 3 balls simultaneously",icon:"🎱",game:"Vortex Pong"},{id:"pong_combo_king",name:"Combo King",description:"Score 5 consecutive paddle hits",icon:"👑",game:"Vortex Pong"},{id:"pong_rally_master",name:"Rally Master",description:"20 hits in a single rally",icon:"🏓",game:"Vortex Pong"}],terminalQuest:[{id:"quest_first_choice",name:"Path Chosen",description:"Make your first choice",icon:"🛤️",game:"Terminal Quest"},{id:"quest_tool_collector",name:"Tool Collector",description:"Collect 5 different items",icon:"🛠️",game:"Terminal Quest"},{id:"quest_survivor",name:"Digital Survivor",description:"Maintain 100% health for 10 choices",icon:"❤️",game:"Terminal Quest"},{id:"quest_code_master",name:"Code Master",description:"Achieve 90+ code quality",icon:"💻",game:"Terminal Quest"},{id:"quest_team_leader",name:"Team Leader",description:"Maintain 80+ team morale",icon:"👥",game:"Terminal Quest"},{id:"quest_combat_victor",name:"Combat Victor",description:"Win 10 battles",icon:"⚔️",game:"Terminal Quest"},{id:"quest_story_end",name:"Story Complete",description:"Reach any ending",icon:"📖",game:"Terminal Quest"}],matrixCloud:[{id:"cloud_first_flight",name:"Digital Pilot",description:"Complete your first flight",icon:"✈️",game:"Matrix Cloud"},{id:"cloud_level_5",name:"Matrix Navigator",description:"Reach level 5",icon:"🧭",game:"Matrix Cloud"},{id:"cloud_boss_slayer",name:"Agent Destroyer",description:"Defeat your first boss",icon:"💀",game:"Matrix Cloud"},{id:"cloud_power_collector",name:"Power Seeker",description:"Collect 20 power-ups",icon:"⚡",game:"Matrix Cloud"},{id:"cloud_architect_defeat",name:"Architect's Bane",description:"Defeat the Architect",icon:"🏛️",game:"Matrix Cloud"},{id:"cloud_all_bosses",name:"Boss Master",description:"Defeat all three bosses",icon:"👾",game:"Matrix Cloud"},{id:"cloud_high_flyer",name:"High Flyer",description:"Reach altitude 1000",icon:"🌟",game:"Matrix Cloud"}],matrixInvaders:[{id:"invaders_first_kill",name:"Code Breaker",description:"Destroy your first invader",icon:"💥",game:"Matrix Invaders"},{id:"invaders_wave_5",name:"Wave Survivor",description:"Reach wave 5",icon:"🌊",game:"Matrix Invaders"},{id:"invaders_combo_10",name:"Combo Master",description:"Achieve a 10x combo",icon:"🔥",game:"Matrix Invaders"},{id:"invaders_bullet_time",name:"Time Bender",description:"Use bullet time 5 times",icon:"⏱️",game:"Matrix Invaders"},{id:"invaders_perfect_wave",name:"Flawless Defense",description:"Complete a wave without taking damage",icon:"🛡️",game:"Matrix Invaders"},{id:"invaders_boss_defeat",name:"System Override",description:"Defeat a boss enemy",icon:"👾",game:"Matrix Invaders"},{id:"invaders_high_score",name:"Elite Hacker",description:"Score over 10,000 points",icon:"🏆",game:"Matrix Invaders"}],ctrlSWorld:[{id:"ctrl_coffee_addict",name:"Caffeine Dependent",description:"Reach 100% coffee level",icon:"☕",game:"CTRL-S World"},{id:"ctrl_clean_coder",name:"Clean Code Master",description:"Achieve 90+ code quality",icon:"✨",game:"CTRL-S World"},{id:"ctrl_choice_master",name:"Decision Maker",description:"Make 50 choices",icon:"🎯",game:"CTRL-S World"},{id:"ctrl_story_complete",name:"Epic Journey",description:"Complete the main storyline",icon:"🏆",game:"CTRL-S World"},{id:"ctrl_collector",name:"Item Hoarder",description:"Collect 10 different items",icon:"🎒",game:"CTRL-S World"},{id:"ctrl_voice_master",name:"Voice Commander",description:"Use Shatner voice for 5 minutes",icon:"🎤",game:"CTRL-S World"},{id:"ctrl_bug_free",name:"Bug Free",description:"Achieve 0 bugs",icon:"🐛",game:"CTRL-S World"}]},_k=[{id:"global_first_game",name:"Welcome to the Matrix",description:"Play your first game",icon:"🎮"},{id:"global_all_games",name:"Matrix Master",description:"Play all 5 games",icon:"🌐"},{id:"global_10_achievements",name:"Achievement Hunter",description:"Unlock 10 achievements",icon:"🏅"},{id:"global_25_achievements",name:"Achievement Expert",description:"Unlock 25 achievements",icon:"🥇"},{id:"global_50_achievements",name:"Achievement Legend",description:"Unlock 50 achievements",icon:"👑"},{id:"global_night_owl",name:"Night Owl",description:"Play after midnight",icon:"🦉"},{id:"global_dedicated",name:"Dedicated Player",description:"Play 7 days in a row",icon:"📅"}],Br="matrix-arcade-save-data",ja="matrix-arcade-backup";function xu(){const[e,t]=v.useState(zn),[n,r]=v.useState(!0),[s,i]=v.useState(null),o=v.useCallback(()=>{try{r(!0);const y=localStorage.getItem(Br);if(y){const w=JSON.parse(y);w.version!=="1.0.0"&&console.log("Migrating save data from version",w.version,"to 1.0.0");const b={...zn(),...w,games:{...zn().games,...w.games}};t(b)}else{const w=zn();t(w),localStorage.setItem(Br,JSON.stringify(w))}i(null)}catch(y){console.error("Failed to load save data:",y),i("Failed to load save data"),t(zn())}finally{r(!1)}},[]),l=v.useCallback(y=>{try{const w=localStorage.getItem(Br);return w&&localStorage.setItem(ja,w),localStorage.setItem(Br,JSON.stringify(y)),y.settings.lastBackupDate=Date.now(),i(null),!0}catch(w){return console.error("Failed to save data:",w),i("Failed to save data"),!1}},[]),c=v.useCallback((y,w)=>{t(b=>{const N={...b,games:{...b.games,[y]:{...b.games[y],...w,lastPlayed:Date.now()}}};return N.settings.autoSave&&l(N),N})},[l]),u=v.useCallback((y,w)=>{t(b=>{const N=b.games[y].achievements;if(!N.includes(w)){const T={...b,games:{...b.games,[y]:{...b.games[y],achievements:[...N,w],lastPlayed:Date.now()}}};return T.settings.autoSave&&l(T),T}return b})},[l]),d=v.useCallback(y=>{t(w=>{const b={...w,globalStats:{...w.globalStats,...y}};return b.settings.autoSave&&l(b),b})},[l]),h=v.useCallback(()=>{try{const y=JSON.stringify(e,null,2),w=new Blob([y],{type:"application/json"}),b=URL.createObjectURL(w),N=document.createElement("a");return N.href=b,N.download=`matrix-arcade-save-${new Date().toISOString().split("T")[0]}.json`,N.click(),URL.revokeObjectURL(b),!0}catch(y){return console.error("Failed to export save data:",y),i("Failed to export save data"),!1}},[e]),m=v.useCallback(y=>new Promise(w=>{const b=new FileReader;b.onload=N=>{var T;try{const j=(T=N.target)==null?void 0:T.result,E=JSON.parse(j);if(!E.version||!E.games)throw new Error("Invalid save file format");t(E),l(E),w(!0)}catch(j){console.error("Failed to import save data:",j),i("Failed to import save data: Invalid file format"),w(!1)}},b.onerror=()=>{i("Failed to read save file"),w(!1)},b.readAsText(y)}),[l]),p=v.useCallback(()=>{try{localStorage.removeItem(Br),localStorage.removeItem(ja);const y=zn();return t(y),i(null),!0}catch(y){return console.error("Failed to clear save data:",y),i("Failed to clear save data"),!1}},[]),S=v.useCallback(()=>{try{const y=localStorage.getItem(ja);if(y){const w=JSON.parse(y);return t(w),l(w),i(null),!0}else return i("No backup found"),!1}catch(y){return console.error("Failed to restore from backup:",y),i("Failed to restore from backup"),!1}},[l]),x=v.useCallback(()=>l(e),[e,l]),k=v.useMemo(()=>{const y=[];return Object.entries(th).forEach(([w,b])=>{b.forEach(N=>{var E;const T=(E=e.games[w])==null?void 0:E.achievements.includes(N.id),j=T?e.games[w].lastPlayed:void 0;y.push({...N,unlocked:T,unlockedAt:j})})}),_k.forEach(w=>{const b=e.globalStats.globalAchievements.includes(w.id);y.push({...w,unlocked:b,unlockedAt:b?Date.now():void 0})}),y},[e]),g=v.useCallback(y=>th[y]||[],[]),f=v.useCallback((y,w)=>e.games[y].achievements.includes(w),[e]);return v.useEffect(()=>{o()},[o]),{saveData:e,isLoading:n,error:s,achievements:k,updateGameSave:c,unlockAchievement:u,updateGlobalStats:d,exportSaveData:h,importSaveData:m,clearSaveData:p,restoreFromBackup:S,saveNow:x,getGameAchievements:g,isAchievementUnlocked:f,loadSaveData:o}}const Pk=.25,Ak=-6,nh=3.2,Rk=250,Ur=150,zr=50,Dk=100,Lk=3,Ik=10,Ok=.15,Fk=500,Vk=.12,Bk=8e3,Ma=5,mi=["#00ff00","#00cc00","#009900"],pi="01アイウエオカキクケコサシスセソタチツテトナニヌネノ",rh=["shield","timeSlow","extraLife","doublePoints"],Uk=[5,10,15],sh=3e4,zk=2e3,Hk={normal:[" ▄███▄ "," █▀▄▄▄▀█ ","█▄▀▀▀▀▄█"," ▀▄▄▄▄▀ "],powered:[" ▄█████▄ ","██▀▄▄▄▀██","██▄███▄██"," ▀█████▀ "],damaged:[" ▄▀▀▀▄ "," █▄▀▀▀▄█ ","█▀▄███▄▀█"," ▀▄▄▄▄▀ "]},ih={playerY:200,playerVelocity:0,pipes:[],particles:[],powerUps:[],activeEffects:{shield:!1,timeSlow:!1,extraLife:!1,doublePoints:!1},effectTimers:{shield:null,timeSlow:null,extraLife:null,doublePoints:null},score:0,highScore:0,combo:1,lives:Lk,level:1,gameOver:!1,started:!1,invulnerable:!1,shakeIntensity:0,boss:null,bossAttacks:[],inBossBattle:!1,bossTimer:0};function $k({achievementManager:e}){const t=v.useRef(null),n=v.useRef(),r=v.useRef(0),[s,i]=v.useState(!1),[o,l]=v.useState(!0),[c,u]=v.useState({x:0,y:0}),{playSFX:d,playMusic:h,stopMusic:m}=Mr(),{saveData:p,updateGameSave:S}=xu(),[x,k]=v.useState(()=>{var L,M;return{...ih,highScore:((M=(L=p==null?void 0:p.games)==null?void 0:L.matrixCloud)==null?void 0:M.highScore)||0}}),g=v.useCallback((L,M)=>{e!=null&&e.unlockAchievement&&e.unlockAchievement(L,M)},[e]);v.useEffect(()=>{x.started&&!x.gameOver?h("gameplay"):m()},[x.started,x.gameOver,h,m]);const f=v.useCallback(()=>Array.from({length:Dk},()=>({x:Math.random()*800,y:Math.random()*400,char:pi[Math.floor(Math.random()*pi.length)],speed:2+Math.random()*3,opacity:.1+Math.random()*.5,scale:.8+Math.random()*.4,rotation:Math.random()*Math.PI*2,glowColor:mi[Math.floor(Math.random()*mi.length)]})),[]),y=v.useCallback(L=>{const U={agent_smith:{health:150,size:60,speed:2},sentinel:{health:200,size:80,speed:1.5},architect:{health:300,size:100,speed:1}}[L];return{type:L,health:U.health,maxHealth:U.health,x:600,y:200,vx:-U.speed,vy:0,size:U.size,attackTimer:0,phase:1,active:!0,defeated:!1}},[]),w=v.useCallback(L=>{let M;L>=15?M="architect":L>=10?M="sentinel":M="agent_smith";const U=y(M);k(D=>({...D,boss:U,inBossBattle:!0,bossTimer:sh,pipes:[],powerUps:[]})),d("levelUp"),T(15)},[y,d,T]),b=v.useCallback(L=>{const U={agent_smith:["laser","code_bomb"],sentinel:["matrix_rain","laser"],architect:["code_bomb","matrix_rain","laser"]}[L.type],D=U[Math.floor(Math.random()*U.length)];return{id:Math.random().toString(36),type:D,x:L.x-L.size,y:L.y+(Math.random()-.5)*L.size,vx:-4-Math.random()*2,vy:(Math.random()-.5)*3,life:1,damage:20}},[]),N=v.useCallback((L,M)=>{if(!L.active)return L;let U=L.vx,D=L.vy;switch(L.type){case"agent_smith":D=Math.sin(Date.now()/1e3)*2;break;case"sentinel":U=Math.sin(Date.now()/1500)*1.5,D=Math.cos(Date.now()/1500)*1.5;break;case"architect":D=Math.sin(Date.now()/2e3)*1;break}const A=Math.max(400,Math.min(700,L.x+U)),R=Math.max(50,Math.min(350,L.y+D));return{...L,x:A,y:R,vx:U,vy:D,attackTimer:L.attackTimer+M}},[]),T=v.useCallback(L=>{u({x:(Math.random()-.5)*L,y:(Math.random()-.5)*L}),setTimeout(()=>u({x:0,y:0}),50)},[]),j=v.useCallback(()=>Math.random()>Vk?null:{type:rh[Math.floor(Math.random()*rh.length)],x:800,y:100+Math.random()*200,collected:!1},[]),E=v.useCallback(L=>{k(M=>{const U={...M.effectTimers},D={...M.activeEffects};return U[L]&&window.clearTimeout(U[L]),U[L]=window.setTimeout(()=>{k(A=>({...A,activeEffects:{...A.activeEffects,[L]:!1},effectTimers:{...A.effectTimers,[L]:null}}))},Bk),D[L]=!0,L==="extraLife"&&M.lives<5?{...M,lives:M.lives+1,activeEffects:D,effectTimers:U}:{...M,activeEffects:D,effectTimers:U}}),d("powerup")},[d]),C=v.useCallback(()=>{!x.gameOver&&!s&&(k(L=>(L.started||setTimeout(()=>g("matrixCloud","first_flight"),100),{...L,playerVelocity:Ak*(L.activeEffects.timeSlow?.7:1),started:!0})),d("jump"),T(3))},[x.gameOver,s,d,T,g]),_=v.useCallback(()=>{n.current&&cancelAnimationFrame(n.current),k(L=>(Object.values(L.effectTimers).forEach(M=>{M&&window.clearTimeout(M)}),{...ih,particles:f(),highScore:L.highScore})),l(!0),i(!1),u({x:0,y:0})},[f]),P=v.useCallback(L=>{if(L.invulnerable)return L;if(L.activeEffects.shield)return d("hit"),T(5),{...L,activeEffects:{...L.activeEffects,shield:!1},invulnerable:!0,shakeIntensity:5};const M=L.lives-1;if(d("hit"),T(10),M<=0){const U=Math.max(L.score,L.highScore);return setTimeout(()=>{S("matrixCloud",{highScore:U,level:L.level,stats:{gamesPlayed:(p.games.matrixCloud.stats.gamesPlayed||0)+1,totalScore:(p.games.matrixCloud.stats.totalScore||0)+L.score,longestSurvival:Math.max(p.games.matrixCloud.stats.longestSurvival||0,L.score),bossesDefeated:p.games.matrixCloud.stats.bossesDefeated||0}})},100),{...L,lives:0,gameOver:!0,highScore:U,shakeIntensity:10}}return{...L,lives:M,combo:1,invulnerable:!0,shakeIntensity:8}},[d,T]),F=v.useCallback(L=>{if(s)return;const M=L-r.current;r.current=L,k(U=>{if(U.gameOver)return U;const D=U.activeEffects.timeSlow?.6:1;let A=U.playerY+U.playerVelocity*D,R=U.playerVelocity+Pk*D,V=[...U.pipes];if(!U.inBossBattle&&(V.length===0||V[V.length-1].x<800-Rk)){V.push({x:800,height:100+Math.random()*(200-Ur),passed:!1,glowIntensity:0});const B=j();B&&U.powerUps.push(B)}const Z=U.particles.map(B=>({...B,y:B.y+B.speed*D,char:Math.random()<.1?pi[Math.floor(Math.random()*pi.length)]:B.char,opacity:B.y>400?.1+Math.random()*.5:B.opacity,rotation:B.rotation+.01*D,...B.y>400?{y:0,scale:.8+Math.random()*.4,glowColor:mi[Math.floor(Math.random()*mi.length)]}:{}}));let X=U.powerUps.filter(B=>!B.collected).map(B=>({...B,x:B.x-nh*D}));V=V.map(B=>({...B,x:B.x-nh*D,glowIntensity:Math.max(0,B.glowIntensity-.05)})).filter(B=>B.x>-60);const ee={x:50,y:A,width:35,height:35};let K={...U};X=X.map(B=>!B.collected&&Hr(ee,{x:B.x,y:B.y,width:30,height:30})?(E(B.type),{...B,collected:!0}):B);for(const B of V){const We={x:B.x,y:0,width:50,height:B.height},$={x:B.x,y:B.height+Ur,width:50,height:400-(B.height+Ur)};if((Hr(ee,We)||Hr(ee,$))&&(K=P(K),K.gameOver))return K;if(!B.passed&&B.x<50){const ye=Ik*Math.min(K.combo,Ma),xe=K.activeEffects.doublePoints?2:1,te=Math.floor(ye*xe),H=K.score+te,we=Math.floor(H/Fk)+1;we>K.level&&(d("levelUp"),T(7),we===5&&g("matrixCloud","level_5"),Uk.includes(we)&&!K.inBossBattle&&setTimeout(()=>w(we),1e3)),B.passed=!0,B.glowIntensity=1,d("score"),K={...K,score:H,combo:Math.min(K.combo+Ok,Ma),level:we}}}if(A>400-zr-35){if(A=400-zr-35,R=0,!K.invulnerable&&(K=P(K),K.gameOver))return K}else A<0&&(A=0,R=0);let Q=K.boss,W=[...U.bossAttacks],I=U.bossTimer;if(K.inBossBattle&&Q){if(I=Math.max(0,I-M),Q=N(Q,M),Q.attackTimer>=zk){const B=b(Q);B&&W.push(B),Q.attackTimer=0}W=W.map(B=>({...B,x:B.x+B.vx,y:B.y+B.vy,life:B.life-.02})).filter(B=>B.life>0&&B.x>-50);for(const B of W)if(Hr(ee,{x:B.x,y:B.y,width:20,height:20})){K=P(K),W=W.filter(We=>We.id!==B.id);break}if(Hr(ee,{x:Q.x-Q.size/2,y:Q.y-Q.size/2,width:Q.size,height:Q.size}))if(Q.health-=10,d("hit"),T(8),Q.health<=0){Q.defeated=!0,Q.active=!1;const B=Q.maxHealth*2;K.score+=B,d("levelUp"),T(15),Q.type==="agent_smith"?g("matrixCloud","boss_slayer"):Q.type==="architect"&&g("matrixCloud","architect_defeat"),K.inBossBattle=!1,K.boss=null,W=[]}else K=P(K);I<=0&&(K.inBossBattle=!1,K.boss=null,W=[],d("hit"))}return K.invulnerable&&setTimeout(()=>{k(B=>({...B,invulnerable:!1}))},1500),{...K,playerY:A,playerVelocity:R,pipes:V,particles:Z,powerUps:X,shakeIntensity:Math.max(0,K.shakeIntensity-.2),boss:Q,bossAttacks:W,bossTimer:I}})},[s,j,E,P,d,T,w,N,b,g]);return v.useEffect(()=>{const L=M=>{M.code==="Space"?(M.preventDefault(),x.gameOver?_():C()):M.code==="KeyP"&&i(U=>!U)};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[x.gameOver,C,_]),v.useEffect(()=>{if(x.started&&!x.gameOver&&!s){const L=M=>{F(M),n.current=requestAnimationFrame(L)};return n.current=requestAnimationFrame(L),()=>{n.current&&cancelAnimationFrame(n.current)}}},[x.started,x.gameOver,s,F]),v.useEffect(()=>(k(L=>({...L,particles:f()})),()=>{n.current&&cancelAnimationFrame(n.current)}),[f]),v.useEffect(()=>{const L=t.current;if(!L)return;const M=L.getContext("2d");if(!M)return;if(M.save(),M.translate(c.x,c.y),M.fillStyle="rgba(0, 0, 0, 0.1)",M.fillRect(0,0,800,400),M.font="12px monospace",x.particles.forEach(R=>{M.save(),M.translate(R.x,R.y),M.rotate(R.rotation),M.scale(R.scale,R.scale),M.shadowColor=R.glowColor,M.shadowBlur=5,M.fillStyle=`rgba(0, 255, 0, ${R.opacity})`,M.fillText(R.char,0,0),M.restore()}),x.pipes.forEach(R=>{const V=M.createLinearGradient(R.x,0,R.x+50,0);V.addColorStop(0,`rgba(0, ${102+R.glowIntensity*153}, 0, 1)`),V.addColorStop(1,"#006600"),M.fillStyle=V,M.shadowColor="#00ff00",M.shadowBlur=R.glowIntensity*10,M.fillRect(R.x,0,50,R.height),M.fillRect(R.x,R.height+Ur,50,400-(R.height+Ur))}),x.powerUps.forEach(R=>{if(!R.collected){switch(M.save(),M.translate(R.x+15,R.y+15),M.rotate(Date.now()/1e3),M.shadowColor="#00ff00",M.shadowBlur=10,M.fillStyle="#00ff00",R.type){case"shield":M.beginPath(),M.arc(0,0,10,0,Math.PI*2),M.fill();break;case"timeSlow":M.fillRect(-8,-8,16,16);break;case"extraLife":M.beginPath(),M.moveTo(0,-8),M.lineTo(8,8),M.lineTo(-8,8),M.closePath(),M.fill();break;case"doublePoints":M.fillRect(-8,-8,6,16),M.fillRect(2,-8,6,16);break}M.restore()}}),x.boss&&x.boss.active){const R=x.boss;switch(M.shadowColor="#ff0000",M.shadowBlur=20,M.save(),M.translate(R.x,R.y),R.type){case"agent_smith":M.fillStyle="#003300",M.fillRect(-R.size/2,-R.size/2,R.size,R.size),M.fillStyle="#00ff00",M.fillRect(-R.size/4,-R.size/3,R.size/2,R.size/6),M.fillRect(-R.size/6,-R.size/4,R.size/3,R.size/8);break;case"sentinel":M.fillStyle="#330000";for(let X=0;X<8;X++){const ee=X/8*Math.PI*2+Date.now()/1e3,K=R.size/2;M.beginPath(),M.moveTo(0,0),M.lineTo(Math.cos(ee)*K,Math.sin(ee)*K),M.lineWidth=5,M.strokeStyle="#ff0000",M.stroke()}break;case"architect":M.fillStyle="#004400",M.fillRect(-R.size/2,-R.size/2,R.size,R.size),M.fillStyle="#00ff00";for(let X=0;X<5;X++){const ee=R.size/5*(X+1);M.strokeRect(-ee/2,-ee/2,ee,ee)}break}const V=R.size,Z=R.health/R.maxHealth;M.fillStyle="#ff0000",M.fillRect(-V/2,-R.size/2-20,V,8),M.fillStyle="#00ff00",M.fillRect(-V/2,-R.size/2-20,V*Z,8),M.restore(),x.bossAttacks.forEach(X=>{M.save(),M.translate(X.x,X.y);const ee=X.life;switch(M.globalAlpha=ee,X.type){case"laser":M.fillStyle="#ff0000",M.fillRect(-15,-2,30,4);break;case"matrix_rain":M.fillStyle="#00ff00",M.font="16px monospace",M.fillText("01",-8,8);break;case"code_bomb":M.fillStyle="#ffff00",M.beginPath(),M.arc(0,0,8,0,Math.PI*2),M.fill();break}M.restore()})}const U=M.createLinearGradient(0,400-zr,0,400);U.addColorStop(0,"#004400"),U.addColorStop(1,"#003300"),M.fillStyle=U,M.fillRect(0,400-zr,800,zr),M.fillStyle=x.activeEffects.shield?"#00ff00":x.invulnerable?"#ff0000":"#00cc00";const D=x.activeEffects.shield?"powered":x.invulnerable?"damaged":"normal";M.save(),M.translate(50,x.playerY),M.shadowColor=x.activeEffects.shield?"#00ff00":x.invulnerable?"#ff0000":"#00cc00",M.shadowBlur=10,Hk[D].forEach((R,V)=>{M.fillText(R,0,V*10)}),M.restore(),M.font="20px monospace",M.textAlign="left",M.fillStyle="#00ff00";const A=100*(x.combo/Ma);if(M.fillStyle="#003300",M.fillRect(20,70,100,10),M.fillStyle="#00ff00",M.fillRect(20,70,A,10),x.inBossBattle&&x.bossTimer>0){const R=200*(x.bossTimer/sh);M.fillStyle="#660000",M.fillRect(300,20,200,15),M.fillStyle="#ff0000",M.fillRect(300,20,R,15),M.fillStyle="#ffffff",M.font="12px monospace",M.textAlign="center",M.fillText("BOSS BATTLE",400,32),M.textAlign="left"}for(let R=0;Ri(L=>!L),className:"p-2 bg-green-900 rounded hover:bg-green-800 transition-colors",type:"button",children:s?a.jsx(Io,{className:"w-5 h-5"}):a.jsx(ng,{className:"w-5 h-5"})}),a.jsx("button",{onClick:_,className:"p-2 bg-green-900 rounded hover:bg-green-800 transition-colors",type:"button",children:a.jsx(sg,{className:"w-5 h-5"})})]}),x.gameOver&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-90",children:a.jsxs("div",{className:"text-center font-mono",children:[a.jsx("h2",{className:"text-3xl mb-4 text-red-500 animate-pulse",children:"SYSTEM FAILURE"}),a.jsxs("div",{className:"space-y-2 mb-6",children:[a.jsxs("p",{className:"text-green-400",children:["Final Score: ",x.score]}),a.jsxs("p",{className:"text-green-400",children:["High Score: ",x.highScore]}),a.jsxs("p",{className:"text-green-400",children:["Level Reached: ",x.level]})]}),a.jsx("button",{onClick:_,className:"px-6 py-3 bg-green-500 text-black rounded-lg hover:bg-green-400 transition-all transform hover:scale-105",type:"button",children:"REBOOT SYSTEM"})]})}),o&&!x.started&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-90",children:a.jsxs("div",{className:"text-center font-mono text-green-400 max-w-lg p-8 border border-green-500 rounded-lg",children:[a.jsx("h2",{className:"text-3xl mb-6 font-bold",children:"MATRIX PROTOCOL"}),a.jsxs("div",{className:"space-y-4 mb-8",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2",children:[a.jsx("kbd",{className:"px-2 py-1 bg-green-900 rounded",children:"SPACE"}),a.jsx("span",{children:"to navigate the system"})]}),a.jsxs("div",{className:"flex items-center justify-center gap-2",children:[a.jsx("kbd",{className:"px-2 py-1 bg-green-900 rounded",children:"P"}),a.jsx("span",{children:"to pause simulation"})]}),a.jsxs("div",{className:"flex flex-col gap-4 mt-6",children:[a.jsx("p",{className:"text-sm",children:"Power-Up Guide:"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(br,{className:"w-4 h-4 text-blue-400"}),a.jsx("span",{children:"Shield Protection"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(kr,{className:"w-4 h-4 text-yellow-400"}),a.jsx("span",{children:"Time Manipulation"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(gu,{className:"w-4 h-4 text-red-400"}),a.jsx("span",{children:"Extra Life"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Wf,{className:"w-4 h-4 text-purple-400"}),a.jsx("span",{children:"Score Multiplier"})]})]})]})]}),a.jsx("p",{className:"animate-pulse",children:"Click or press SPACE to initialize"})]})}),s&&!x.gameOver&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-90",children:a.jsxs("div",{className:"text-center font-mono text-green-500",children:[a.jsx("h2",{className:"text-3xl mb-4",children:"SYSTEM PAUSED"}),a.jsxs("div",{className:"space-y-2 mb-4",children:[a.jsxs("p",{children:["Current Score: ",x.score]}),a.jsxs("p",{children:["Level: ",x.level]}),a.jsxs("p",{children:["Lives: ",x.lives]})]}),a.jsx("p",{className:"animate-pulse",children:"Press P to resume"})]})})]})})}function Hr(e,t){return e.xt.x&&e.yt.y}function Gk(){const e=v.useRef(null),t=v.useRef(new Map),n=v.useRef(null),r=v.useCallback(async()=>{if(!e.current){const d=window.AudioContext||window.webkitAudioContext,h=new d;e.current=h;const m=h.createDynamicsCompressor();m.threshold.setValueAtTime(-24,h.currentTime),m.knee.setValueAtTime(30,h.currentTime),m.ratio.setValueAtTime(12,h.currentTime),m.attack.setValueAtTime(.003,h.currentTime),m.release.setValueAtTime(.25,h.currentTime),m.connect(h.destination),n.current=m}return e.current},[]),s=v.useCallback(async(d=2e3,h=100,m=.2)=>{const p=await r();if(!p||!n.current)return;const S=p.currentTime,x=p.createOscillator(),k=p.createGain(),g=p.createBiquadFilter();x.type="sawtooth",x.frequency.setValueAtTime(d,S),x.frequency.exponentialRampToValueAtTime(h,S+m),g.type="lowpass",g.frequency.setValueAtTime(d*2,S),g.frequency.exponentialRampToValueAtTime(h*2,S+m),g.Q.setValueAtTime(5,S),k.gain.setValueAtTime(.3,S),k.gain.exponentialRampToValueAtTime(.001,S+m),x.connect(g),g.connect(k),k.connect(n.current),x.start(S),x.stop(S+m)},[r]),i=v.useCallback(async(d=1,h=.5)=>{const m=await r();if(!m||!n.current)return;const p=m.currentTime,S=.5*d,x=m.sampleRate*S,k=m.createBuffer(1,x,m.sampleRate),g=k.getChannelData(0);for(let j=0;j{const h=await r();if(!h||!n.current)return;const m=h.currentTime,S={collect:{freqs:[523,659,784,1047],duration:.3,wave:"triangle"},activate:{freqs:[440,554,659,880],duration:.5,wave:"square"},expire:{freqs:[880,659,554,440],duration:.4,wave:"sawtooth"}}[d],x=S.duration/S.freqs.length;S.freqs.forEach((k,g)=>{const f=m+g*x,y=h.createOscillator(),w=h.createGain(),b=h.createBiquadFilter();y.type=S.wave,y.frequency.setValueAtTime(k,f),b.type="bandpass",b.frequency.setValueAtTime(k,f),b.Q.setValueAtTime(5,f),w.gain.setValueAtTime(0,f),w.gain.linearRampToValueAtTime(.2,f+.01),w.gain.exponentialRampToValueAtTime(.001,f+x),y.connect(b),b.connect(w),w.connect(n.current),y.start(f),y.stop(f+x)})},[r]),l=v.useCallback(async d=>{const h=await r();if(!h||!n.current)return;const m=h.currentTime;switch(d.type){case"kick":{const p=h.createOscillator(),S=h.createGain();p.type="sine",p.frequency.setValueAtTime(60*(d.pitch||1),m),p.frequency.exponentialRampToValueAtTime(40,m+.1),S.gain.setValueAtTime(.7,m),S.gain.exponentialRampToValueAtTime(.001,m+(d.decay||.5)),p.connect(S),S.connect(n.current),p.start(m),p.stop(m+.5);break}case"snare":{const p=h.createOscillator(),S=h.createGain();p.type="triangle",p.frequency.setValueAtTime(200*(d.pitch||1),m);const x=h.createBufferSource(),k=h.createBuffer(1,h.sampleRate*.2,h.sampleRate),g=k.getChannelData(0);for(let b=0;b{const p=await r();if(!p||!n.current)return null;const S=p.createOscillator(),x=p.createGain(),k=p.createBiquadFilter();S.type=h,S.frequency.setValueAtTime(d,p.currentTime),k.type="lowpass",k.frequency.setValueAtTime(d*3,p.currentTime),k.Q.setValueAtTime(1,p.currentTime),x.gain.setValueAtTime(0,p.currentTime),x.gain.linearRampToValueAtTime(.2,p.currentTime+.01),S.connect(k),k.connect(x),x.connect(n.current),S.start();const g={oscillator:S,gain:x,filter:k,id:m};return t.current.set(m,g),m},[r]),u=v.useCallback(async(d,h=.1)=>{const m=t.current.get(d);if(!m)return;const p=e.current;p&&(m.gain.gain.exponentialRampToValueAtTime(.001,p.currentTime+h),m.oscillator.stop(p.currentTime+h),setTimeout(()=>{t.current.delete(d)},h*1e3))},[]);return{synthLaser:s,synthExplosion:i,synthPowerUp:o,synthDrum:l,synthVoice:c,stopVoice:u,context:e.current}}function _a({create:e,reset:t,initialSize:n=10,maxSize:r=1e3,expandSize:s=10}){const i=v.useRef([]),o=v.useRef([]),l=v.useRef(0),c=v.useCallback(()=>{if(i.current.length===0){for(let x=0;x{const x=l.current;if(x>=r)return;const k=Math.min(s,r-x);for(let g=0;g{c();let x=i.current.find(k=>!k.active);return x||(u(),x=i.current.find(k=>!k.active)),x?(x.active=!0,o.current.push(x),t?t(x):x.reset&&x.reset(),x):null},[c,u,t]),h=v.useCallback(x=>{if(!x||!x.active)return;x.active=!1;const k=o.current.indexOf(x);k>-1&&o.current.splice(k,1),t?t(x):x.reset&&x.reset()},[t]),m=v.useCallback(()=>{o.current.forEach(x=>{x.active=!1,t?t(x):x.reset&&x.reset()}),o.current=[]},[t]),p=v.useCallback(()=>({total:l.current,active:o.current.length,available:i.current.filter(x=>!x.active).length,utilization:o.current.length/l.current*100}),[]),S=v.useCallback(x=>{const k=x-i.current.length;if(k<=0)return;const g=Math.min(k,r-l.current);for(let f=0;f{const f=performance.now(),y=f-c.current;c.current=f,l.current.push(y),l.current.length>60&&l.current.shift();const w=l.current.reduce((j,E)=>j+E,0)/l.current.length,b=1e3/w;let N=0,T=0;if("memory"in performance){const j=performance.memory;j&&(N=j.usedJSHeapSize/1048576,T=j.jsHeapSizeLimit/1048576)}o({fps:Math.round(b),frameTime:Math.round(w*100)/100,memoryUsed:Math.round(N*10)/10,memoryLimit:Math.round(T),drawCalls:u.current,activeObjects:d.current}),u.current=0,d.current=0},[]),m=v.useCallback(()=>{u.current++},[]),p=v.useCallback(f=>{d.current=f},[]),S=v.useCallback(()=>{const f=[];return i.fps1e3&&f.push("High draw call count - consider batching"),i.memoryUsed>i.memoryLimit*.8&&f.push("High memory usage - clear unused resources"),i.activeObjects>500&&f.push("Many active objects - implement culling"),f},[i,s,r]),x=v.useCallback(()=>{if(!n)return null;const f=i.fps0&&a.jsx("div",{style:{marginTop:"10px",borderTop:"1px solid #666",paddingTop:"10px"},children:S().map((b,N)=>a.jsxs("div",{style:{fontSize:"10px",marginTop:"2px"},children:["• ",b]},N))})]})},[n,i,t,r,s,S]);v.useEffect(()=>{if(!n)return;const f=setInterval(h,1e3);return()=>clearInterval(f)},[n,h]);const k=v.useCallback((f,y)=>{const w=performance.now();y();const b=performance.now();console.log(`[Performance] ${f}: ${(b-w).toFixed(2)}ms`)},[]),g=v.useCallback((f,y,w=100)=>{let b=0;const N=()=>{const T=Math.min(b+w,f.length);for(let j=b;j{const E="アイウエオカキクケコサシスセソタチツテトナニヌネノ01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let C=0;C<50;C++)i.current.push({x:Math.random()*St,y:Math.random()*xn,char:E[Math.floor(Math.random()*E.length)],speed:1+Math.random()*2})},[]);const g=v.useCallback(()=>{const E=Object.keys(gi),C=o.wave<=2?"code":o.wave<=5?["code","agent"][Math.floor(Math.random()*2)]:E[Math.floor(Math.random()*E.length)];for(let _=0;_10?"sentinel":C,M=gi[L];F.x=50+P*80,F.y=50+_*50,F.vx=Qk*M.speed,F.vy=0,F.health=M.health,F.maxHealth=M.health,F.type=L,F.value=M.points,F.width=40,F.height=30}}},[o.wave,m]),f=v.useCallback((E,C,_=!1)=>{const P=h.acquire();P&&(P.x=E,P.y=C,P.vx=0,P.vy=_?ah/2:-ah,P.type=_?"enemy":"player",P.damage=1,c(_?500:1e3,100,.1))},[h,c]),y=v.useCallback((E,C,_="#00ff00")=>{for(let P=0;P<20;P++){const F=p.acquire();if(F){const L=Math.PI*2*P/20,M=2+Math.random()*3;F.x=E,F.y=C,F.vx=Math.cos(L)*M,F.vy=Math.sin(L)*M,F.life=1,F.maxLife=1,F.color=_,F.size=2+Math.random()*4}}u(.5,.7)},[p,u]),w=v.useCallback(()=>{const E=h.activeObjects,C=m.activeObjects;E.forEach(_=>{_.type==="player"&&C.forEach(P=>{if(_.active&&P.active&&_.xP.x&&_.yP.y)if(P.health-=_.damage,h.release(_),P.health<=0){if(l(F=>({...F,score:F.score+P.value*(1+F.combo*.1),combo:F.combo+1})),y(P.x+P.width/2,P.y+P.height/2),P.type==="virus"&&gi.virus.splits)for(let F=0;F<2;F++){const L=m.acquire();L&&(L.x=P.x+(F===0?-20:20),L.y=P.y,L.type="code",L.health=1,L.value=5,L.vx=P.vx)}m.release(P)}else d({type:"hihat"})})}),C.filter(_=>_.active).length===0&&(l(_=>({..._,wave:_.wave+1})),g(),o.wave===5&&e&&e.unlockAchievement("matrixInvaders","invaders_wave_5"))},[h,m,o.wave,e,y,d,g]),b=v.useCallback(E=>{if(o.gameOver||o.paused)return;const C=E*o.timeScale;h.activeObjects.forEach(P=>{P.y+=P.vy*C,(P.y<0||P.y>xn)&&h.release(P)});let _=!1;m.activeObjects.forEach(P=>{P.x+=P.vx*C,(P.x<=0||P.x>=St-P.width)&&(_=!0),Math.random()<.001*o.wave&&f(P.x+P.width/2,P.y+P.height,!0)}),_&&m.activeObjects.forEach(P=>{P.vx*=-1,P.y+=Xk,P.y+P.height>=o.player.y&&l(F=>({...F,gameOver:!0}))}),p.activeObjects.forEach(P=>{P.x+=P.vx*C,P.y+=P.vy*C,P.life-=.02*C,P.alpha=P.life,P.life<=0&&p.release(P)}),i.current.forEach(P=>{P.y+=P.speed*C,P.y>xn&&(P.y=-20,P.x=Math.random()*St)}),w(),x(h.activeObjects.length+m.activeObjects.length+p.activeObjects.length)},[o,h,m,p,w,f,x]),N=v.useCallback(()=>{const E=t.current,C=E==null?void 0:E.getContext("2d");!C||!E||(C.fillStyle="#000000",C.fillRect(0,0,St,xn),S(),C.font="14px monospace",C.fillStyle="#003300",i.current.forEach(_=>{C.fillText(_.char,_.x,_.y)}),S(),p.activeObjects.forEach(_=>{C.globalAlpha=_.alpha,C.fillStyle=_.color,C.fillRect(_.x-_.size/2,_.y-_.size/2,_.size,_.size)}),C.globalAlpha=1,S(),C.font="20px monospace",m.activeObjects.forEach(_=>{const P=gi[_.type];if(C.fillStyle=P.color,C.fillText(P.symbol,_.x+10,_.y+20),_.maxHealth>1){const F=_.health/_.maxHealth;C.fillStyle="#ff0000",C.fillRect(_.x,_.y-5,_.width,3),C.fillStyle="#00ff00",C.fillRect(_.x,_.y-5,_.width*F,3)}}),S(),C.fillStyle="#00ff00",h.activeObjects.forEach(_=>{_.type==="player"?C.fillRect(_.x,_.y,3,10):(C.fillStyle="#ff0000",C.fillRect(_.x,_.y,3,6),C.fillStyle="#00ff00")}),S(),o.gameOver||(C.fillStyle=o.player.powerUps.shield?"#00ffff":"#00ff00",C.font="12px monospace",tb.forEach((_,P)=>{C.fillText(_,o.player.x,o.player.y+P*10)}),o.player.powerUps.shield&&(C.strokeStyle="#00ffff",C.globalAlpha=.3,C.beginPath(),C.arc(o.player.x+$r/2,o.player.y+Pa/2,30,0,Math.PI*2),C.stroke(),C.globalAlpha=1)),S(),C.fillStyle="#00ff00",C.font="16px monospace",C.fillText(`SCORE: ${o.score}`,10,30),C.fillText(`WAVE: ${o.wave}`,10,50),C.fillText(`LIVES: ${o.player.lives}`,10,70),C.fillText(`COMBO: x${o.combo}`,10,90),o.highScore>0&&C.fillText(`HIGH: ${o.highScore}`,St-150,30),o.bulletTimeActive&&(C.fillStyle="#ff00ff",C.fillText("BULLET TIME ACTIVE",St/2-80,30)),S())},[o,h,m,p,S]),T=v.useCallback(E=>{const C=E-(n.current||E);n.current=E,b(C*.06),N(),!o.gameOver&&!o.paused&&requestAnimationFrame(T)},[b,N,o.gameOver,o.paused]);v.useEffect(()=>{const E=_=>{if(r.current.add(_.key),_.key===" "&&!o.gameOver&&!o.paused){const P=Date.now(),F=o.player.powerUps.rapidFire?100:250;P-s.current>F&&(f(o.player.x+$r/2,o.player.y),s.current=P)}_.key==="b"&&!o.bulletTimeActive&&(l(P=>({...P,bulletTimeActive:!0,timeScale:.3})),setTimeout(()=>{l(P=>({...P,bulletTimeActive:!1,timeScale:1}))},eb)),_.key==="p"&&l(P=>({...P,paused:!P.paused}))},C=_=>{r.current.delete(_.key)};return window.addEventListener("keydown",E),window.addEventListener("keyup",C),()=>{window.removeEventListener("keydown",E),window.removeEventListener("keyup",C)}},[o,f]),v.useEffect(()=>{const C=setInterval(()=>{o.gameOver||o.paused||l(_=>{let P=_.player.x;return(r.current.has("ArrowLeft")||r.current.has("a"))&&(P=Math.max(0,P-oh)),(r.current.has("ArrowRight")||r.current.has("d"))&&(P=Math.min(St-$r,P+oh)),{..._,player:{..._.player,x:P}}})},16);return()=>clearInterval(C)},[o.gameOver,o.paused]),v.useEffect(()=>(!o.gameOver&&!o.paused&&(g(),requestAnimationFrame(T)),()=>{n.current&&cancelAnimationFrame(n.current)}),[o.gameOver,o.paused,T,g]),v.useEffect(()=>{o.score>o.highScore&&localStorage.setItem("matrixInvaders_highScore",o.score.toString())},[o.score,o.highScore]);const j=v.useCallback(()=>{h.releaseAll(),m.releaseAll(),p.releaseAll(),l({player:{x:St/2-$r/2,y:xn-Pa-20,lives:3,powerUps:{}},score:0,wave:1,gameOver:!1,paused:!1,combo:0,highScore:parseInt(localStorage.getItem("matrixInvaders_highScore")||"0"),bulletTimeActive:!1,timeScale:1}),g(),requestAnimationFrame(T)},[h,m,p,g,T]);return a.jsxs("div",{className:"relative w-full h-full flex items-center justify-center bg-black",children:[a.jsxs("div",{className:"relative",children:[a.jsx("canvas",{ref:t,width:St,height:xn,className:"border-2 border-green-500 shadow-[0_0_20px_rgba(0,255,0,0.5)]"}),a.jsx(je,{children:o.gameOver&&a.jsx(Y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 flex items-center justify-center bg-black/80",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h2",{className:"text-4xl font-mono text-green-500 mb-4",children:"GAME OVER"}),a.jsxs("p",{className:"text-2xl font-mono text-green-400 mb-2",children:["Score: ",o.score]}),a.jsxs("p",{className:"text-xl font-mono text-green-400 mb-6",children:["Wave: ",o.wave]}),a.jsxs("button",{onClick:j,className:"px-6 py-3 bg-green-500 text-black font-mono rounded hover:bg-green-400 transition-colors flex items-center gap-2 mx-auto",children:[a.jsx(sg,{className:"w-5 h-5"}),"RESTART"]})]})})}),a.jsx(je,{children:o.paused&&!o.gameOver&&a.jsx(Y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 flex items-center justify-center bg-black/60",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h2",{className:"text-4xl font-mono text-green-500 mb-4",children:"PAUSED"}),a.jsx("p",{className:"text-xl font-mono text-green-400",children:"Press P to Resume"})]})})}),a.jsx("div",{className:"mt-4 text-center",children:a.jsx("p",{className:"text-green-400 font-mono text-sm",children:"MOVE: ← → or A/D | FIRE: SPACE | BULLET TIME: B | PAUSE: P"})})]}),a.jsx(k,{})]})}const rb=({isOpen:e,onClose:t,compact:n=!1})=>{const{config:r,updateConfig:s,playSFX:i,playMusic:o,stopMusic:l}=Mr(),[c,u]=v.useState(null),d=(S,x)=>{s({[S]:x})},h=S=>{s({[S]:!r[S]})},m=S=>{u(S),i(S),setTimeout(()=>u(null),300)},p=()=>{r.music&&(o("menu"),setTimeout(()=>l(),3e3))};return n?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>h("sfx"),className:`p-2 rounded transition-colors ${r.sfx?"bg-green-900 text-green-400 hover:bg-green-800":"bg-gray-700 text-gray-400 hover:bg-gray-600"}`,title:"Toggle Sound Effects",children:r.sfx?a.jsx(fo,{className:"w-4 h-4"}):a.jsx(ho,{className:"w-4 h-4"})}),a.jsx("button",{onClick:()=>h("music"),className:`p-2 rounded transition-colors ${r.music?"bg-green-900 text-green-400 hover:bg-green-800":"bg-gray-700 text-gray-400 hover:bg-gray-600"}`,title:"Toggle Music",children:a.jsx(Gf,{className:`w-4 h-4 ${r.music?"text-green-400":"text-gray-400"}`})})]}):a.jsx(je,{children:e&&a.jsx(Y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/90 z-50 flex items-center justify-center p-4",onClick:t,children:a.jsxs(Y.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},className:"bg-gray-900 border-2 border-green-500 rounded-lg p-6 max-w-md w-full font-mono",onClick:S=>S.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Oo,{className:"w-5 h-5 text-green-400"}),a.jsx("h2",{className:"text-lg font-bold text-green-400",children:"AUDIO SETTINGS"})]}),a.jsx("button",{onClick:t,className:"p-2 hover:bg-green-900 rounded transition-colors",children:a.jsx($s,{className:"w-5 h-5 text-green-400"})})]}),a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("label",{className:"text-green-400 flex items-center gap-2",children:[a.jsx(zS,{className:"w-4 h-4"}),"MASTER VOLUME"]}),a.jsxs("span",{className:"text-white",children:[Math.round(r.masterVolume*100),"%"]})]}),a.jsx("input",{type:"range",min:"0",max:"1",step:"0.05",value:r.masterVolume,onChange:S=>d("masterVolume",Number(S.target.value)),className:"w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer slider"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("label",{className:"text-green-400 flex items-center gap-2",children:[a.jsx(Gf,{className:"w-4 h-4"}),"BACKGROUND MUSIC"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:p,className:"p-1 hover:bg-green-900 rounded transition-colors",title:"Test Music",children:a.jsx(Io,{className:"w-3 h-3 text-green-400"})}),a.jsx("button",{onClick:()=>h("music"),className:`px-3 py-1 rounded text-xs transition-colors ${r.music?"bg-green-600 text-white":"bg-gray-600 text-gray-300"}`,children:r.music?"ON":"OFF"})]})]}),a.jsx("input",{type:"range",min:"0",max:"1",step:"0.05",value:r.musicVolume,onChange:S=>d("musicVolume",Number(S.target.value)),disabled:!r.music,className:"w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer slider"}),a.jsxs("div",{className:"text-right text-xs text-gray-400 mt-1",children:[Math.round(r.musicVolume*100),"%"]})]}),a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("label",{className:"text-green-400 flex items-center gap-2",children:[a.jsx(fo,{className:"w-4 h-4"}),"SOUND EFFECTS"]}),a.jsx("button",{onClick:()=>h("sfx"),className:`px-3 py-1 rounded text-xs transition-colors ${r.sfx?"bg-green-600 text-white":"bg-gray-600 text-gray-300"}`,children:r.sfx?"ON":"OFF"})]}),a.jsx("input",{type:"range",min:"0",max:"1",step:"0.05",value:r.sfxVolume,onChange:S=>d("sfxVolume",Number(S.target.value)),disabled:!r.sfx,className:"w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer slider"}),a.jsxs("div",{className:"text-right text-xs text-gray-400 mt-1",children:[Math.round(r.sfxVolume*100),"%"]})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-green-400 text-sm mb-3",children:"SOUND TEST"}),a.jsx("div",{className:"grid grid-cols-2 gap-2",children:["jump","hit","score","powerup","levelUp","combo"].map(S=>a.jsx("button",{onClick:()=>m(S),disabled:!r.sfx||c===S,className:`p-2 text-xs rounded transition-all ${c===S?"bg-green-600 text-white scale-95":"bg-gray-800 text-gray-300 hover:bg-gray-700"} disabled:opacity-50`,children:c===S?"PLAYING...":S.toUpperCase()},S))})]}),a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("div",{className:"flex-1 h-px bg-green-500/30"}),a.jsx("span",{className:"text-green-500 text-xs",children:"MATRIX AUDIO v2.0"}),a.jsx("div",{className:"flex-1 h-px bg-green-500/30"})]}),a.jsxs("div",{className:"text-xs text-gray-400 text-center",children:["Advanced Web Audio API synthesis",a.jsx("br",{}),"No external audio files required"]})]})})})},sb=({isOpen:e,onClose:t})=>{const{saveData:n,isLoading:r,error:s,exportSaveData:i,importSaveData:o,clearSaveData:l,restoreFromBackup:c,saveNow:u,getGameAchievements:d}=xu(),[h,m]=v.useState(!1),[p,S]=v.useState(!1),x=v.useRef(null),k=()=>{i()&&console.log("Save data exported successfully")},g=async N=>{var E;const T=(E=N.target.files)==null?void 0:E[0];if(!T)return;S(!0);const j=await o(T);S(!1),j&&console.log("Save data imported successfully"),x.current&&(x.current.value="")},f=()=>{h?(l(),m(!1)):(m(!0),setTimeout(()=>m(!1),5e3))},y=N=>{const T=Math.floor(N/36e5),j=Math.floor(N%(1e3*60*60)/(1e3*60));return`${T}h ${j}m`},w=N=>new Date(N).toLocaleDateString(),b=N=>({snakeClassic:"Snake Classic",vortexPong:"Vortex Pong",terminalQuest:"Terminal Quest",matrixCloud:"Matrix Cloud",ctrlSWorld:"CTRL-S | The World"})[N]||N;return e?a.jsx(je,{children:a.jsx(Y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/90 z-50 flex items-center justify-center p-4",onClick:t,children:a.jsxs(Y.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},className:"bg-gray-900 border-2 border-green-500 rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto font-mono",onClick:N=>N.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-green-500/30",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(uo,{className:"w-6 h-6 text-green-400"}),a.jsx("h2",{className:"text-xl font-bold text-green-400",children:"SAVE DATA MANAGER"})]}),a.jsx("button",{onClick:t,className:"p-2 hover:bg-green-900 rounded transition-colors",children:a.jsx($s,{className:"w-5 h-5 text-green-400"})})]}),s&&a.jsxs("div",{className:"m-4 p-3 bg-red-900/50 border border-red-500 rounded flex items-center gap-2",children:[a.jsx(pu,{className:"w-5 h-5 text-red-400"}),a.jsx("span",{className:"text-red-400 text-sm",children:s})]}),r?a.jsxs("div",{className:"p-8 text-center",children:[a.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-green-500 border-t-transparent rounded-full mx-auto mb-4"}),a.jsx("p",{className:"text-green-400",children:"Loading save data..."})]}):a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsxs("button",{onClick:u,className:"flex items-center justify-center gap-2 p-3 bg-green-900/50 hover:bg-green-800 border border-green-500/30 rounded transition-colors",children:[a.jsx(uo,{className:"w-4 h-4"}),a.jsx("span",{className:"text-sm",children:"Save Now"})]}),a.jsxs("button",{onClick:k,className:"flex items-center justify-center gap-2 p-3 bg-blue-900/50 hover:bg-blue-800 border border-blue-500/30 rounded transition-colors",children:[a.jsx(Z0,{className:"w-4 h-4"}),a.jsx("span",{className:"text-sm",children:"Export"})]}),a.jsxs("label",{className:"flex items-center justify-center gap-2 p-3 bg-purple-900/50 hover:bg-purple-800 border border-purple-500/30 rounded transition-colors cursor-pointer",children:[a.jsx(US,{className:"w-4 h-4"}),a.jsx("span",{className:"text-sm",children:p?"Importing...":"Import"}),a.jsx("input",{ref:x,type:"file",accept:".json",onChange:g,className:"hidden",disabled:p})]}),a.jsxs("button",{onClick:f,className:`flex items-center justify-center gap-2 p-3 border rounded transition-colors ${h?"bg-red-900/70 border-red-500 text-red-400":"bg-red-900/50 hover:bg-red-800 border-red-500/30"}`,children:[a.jsx(FS,{className:"w-4 h-4"}),a.jsx("span",{className:"text-sm",children:h?"Confirm?":"Clear All"})]})]}),a.jsxs("div",{className:"bg-black/50 border border-green-500/30 rounded-lg p-4",children:[a.jsxs("h3",{className:"text-green-400 font-bold mb-4 flex items-center gap-2",children:[a.jsx(Ln,{className:"w-5 h-5"}),"GLOBAL STATISTICS"]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-400",children:"Total Play Time"}),a.jsx("div",{className:"text-green-400 font-bold",children:y(n.globalStats.totalPlayTime)})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-400",children:"First Played"}),a.jsx("div",{className:"text-green-400 font-bold",children:w(n.globalStats.firstPlayDate)})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-400",children:"Favorite Game"}),a.jsx("div",{className:"text-green-400 font-bold",children:n.globalStats.favoriteGame||"None yet"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-400",children:"Global Achievements"}),a.jsx("div",{className:"text-green-400 font-bold",children:n.globalStats.globalAchievements.length})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("h3",{className:"text-green-400 font-bold flex items-center gap-2",children:[a.jsx(SS,{className:"w-5 h-5"}),"GAME PROGRESS"]}),a.jsx("div",{className:"grid gap-4",children:Object.entries(n.games).map(([N,T])=>a.jsxs("div",{className:"bg-black/50 border border-green-500/30 rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h4",{className:"text-green-400 font-bold",children:b(N)}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-400",children:[a.jsx(kr,{className:"w-3 h-3"}),"Last played: ",w(T.lastPlayed)]})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-400",children:"High Score"}),a.jsx("div",{className:"text-green-400 font-bold",children:T.highScore.toLocaleString()})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-400",children:"Level"}),a.jsx("div",{className:"text-green-400 font-bold",children:T.level})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-400",children:"Games Played"}),a.jsx("div",{className:"text-green-400 font-bold",children:T.stats.gamesPlayed})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-400",children:"Achievements"}),a.jsxs("div",{className:"text-green-400 font-bold",children:[T.achievements.length," / ",d(N).length]})]})]}),T.achievements.length>0&&a.jsxs("div",{className:"mt-3 pt-3 border-t border-green-500/20",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-2",children:"Recent Achievements:"}),a.jsxs("div",{className:"flex flex-wrap gap-1",children:[T.achievements.slice(-3).map((j,E)=>a.jsx("span",{className:"px-2 py-1 bg-green-900/30 border border-green-500/50 rounded text-xs",children:j.replace("_"," ").toUpperCase()},E)),T.achievements.length>3&&a.jsxs("span",{className:"px-2 py-1 bg-gray-700 rounded text-xs",children:["+",T.achievements.length-3," more"]})]})]})]},N))})]}),a.jsxs("div",{className:"bg-black/50 border border-yellow-500/30 rounded-lg p-4",children:[a.jsxs("h3",{className:"text-yellow-400 font-bold mb-4 flex items-center gap-2",children:[a.jsx(Oo,{className:"w-5 h-5"}),"BACKUP & RECOVERY"]}),a.jsxs("div",{className:"flex flex-wrap gap-4 text-sm",children:[a.jsxs("button",{onClick:c,className:"flex items-center gap-2 px-3 py-2 bg-yellow-900/50 hover:bg-yellow-800 border border-yellow-500/30 rounded transition-colors",children:[a.jsx(rg,{className:"w-4 h-4"}),"Restore Backup"]}),a.jsxs("div",{className:"flex items-center gap-2 text-gray-400",children:[a.jsx(hS,{className:"w-4 h-4"}),"Auto-save: ",n.settings.autoSave?"Enabled":"Disabled"]}),n.settings.lastBackupDate&&a.jsxs("div",{className:"flex items-center gap-2 text-gray-400",children:[a.jsx(kr,{className:"w-4 h-4"}),"Last backup: ",w(n.settings.lastBackupDate)]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex-1 h-px bg-green-500/30"}),a.jsxs("span",{className:"text-green-500 text-xs",children:["SAVE DATA v",n.version]}),a.jsx("div",{className:"flex-1 h-px bg-green-500/30"})]})]})]})})}):null},ib=({achievement:e,onDismiss:t})=>{const[n,r]=v.useState(!1);return v.useEffect(()=>{if(e){r(!0);const s=setTimeout(()=>{r(!1),setTimeout(t,300)},5e3);return()=>clearTimeout(s)}},[e,t]),e?a.jsx(je,{children:n&&a.jsx(Y.div,{className:"fixed top-8 right-8 z-50 pointer-events-none",initial:{x:400,opacity:0},animate:{x:0,opacity:1},exit:{x:400,opacity:0},transition:{type:"spring",damping:20,stiffness:300},children:a.jsxs("div",{className:`relative bg-black/90 border-2 border-green-500 rounded-lg p-6
+ shadow-[0_0_30px_rgba(0,255,0,0.5)] backdrop-blur-md
+ min-w-[320px] max-w-[400px]`,children:[a.jsx("div",{className:"absolute inset-0 overflow-hidden rounded-lg opacity-20",children:a.jsx("div",{className:"matrix-rain"})}),a.jsxs("div",{className:"relative z-10 flex items-start gap-4",children:[a.jsx(Y.div,{className:"flex-shrink-0",animate:{scale:[1,1.2,1],rotate:[0,360,0]},transition:{duration:.6},children:a.jsx("div",{className:`w-16 h-16 bg-green-500/20 rounded-full flex items-center justify-center
+ border-2 border-green-500 shadow-[0_0_20px_rgba(0,255,0,0.5)]`,children:e.icon?a.jsx("span",{className:"text-3xl",children:e.icon}):a.jsx(Ln,{className:"w-8 h-8 text-green-500"})})}),a.jsx("div",{className:"flex-1",children:a.jsxs(Y.div,{initial:{y:-10,opacity:0},animate:{y:0,opacity:1},transition:{delay:.1},children:[a.jsxs("h3",{className:"text-green-500 font-mono text-sm mb-1 flex items-center gap-2",children:[a.jsx(BS,{className:"w-4 h-4"}),"ACHIEVEMENT UNLOCKED"]}),a.jsx("h2",{className:"text-white font-mono text-xl mb-2 tracking-wider",children:e.name}),a.jsx("p",{className:"text-green-300/80 font-mono text-sm leading-relaxed",children:e.description}),e.game&&a.jsx("p",{className:"text-green-500/60 font-mono text-xs mt-2",children:e.game})]})})]}),a.jsx(Y.div,{className:"absolute bottom-0 left-0 h-1 bg-green-500",initial:{width:"100%"},animate:{width:"0%"},transition:{duration:5,ease:"linear"}}),a.jsx("div",{className:"absolute inset-0 pointer-events-none",children:a.jsx(Y.div,{className:"w-full h-full",animate:{clipPath:["inset(0 0 100% 0)","inset(0 0 90% 0)","inset(0 0 100% 0)"],opacity:[0,.1,0]},transition:{duration:.5,repeat:1/0,repeatDelay:2},style:{background:"linear-gradient(180deg, transparent, rgba(0,255,0,0.1), transparent)",filter:"blur(1px)"}})})]})})}):null},ob=({achievements:e,onDismiss:t})=>a.jsx("div",{className:"fixed top-8 right-8 z-50 space-y-4",children:e.map((n,r)=>a.jsx(Y.div,{initial:{x:400,opacity:0},animate:{x:0,opacity:1,y:r*10},exit:{x:400,opacity:0},transition:{type:"spring",damping:20,stiffness:300,delay:r*.1},children:a.jsx(ib,{achievement:n,onDismiss:()=>t(r)})},`${n.id}-${r}`))}),ab={"Snake Classic":"🐍","Vortex Pong":"🏓","Terminal Quest":"💻","CTRL-S World":"💾","Matrix Cloud":"☁️"},lb=({isOpen:e,onClose:t,achievements:n})=>{const[r,s]=v.useState(""),[i,o]=v.useState(null),l=v.useMemo(()=>n.reduce((h,m)=>{const p=m.game||"General";return h[p]||(h[p]=[]),h[p].push(m),h},{}),[n]),c=v.useMemo(()=>{let d=n;return r&&(d=d.filter(h=>h.name.toLowerCase().includes(r.toLowerCase())||h.description.toLowerCase().includes(r.toLowerCase()))),i&&(d=d.filter(h=>h.game===i)),d},[n,r,i]),u=v.useMemo(()=>{const d=n.length,h=n.filter(p=>p.unlocked).length,m=d>0?Math.round(h/d*100):0;return{total:d,unlocked:h,percentage:m}},[n]);return e?a.jsx(je,{children:a.jsx(Y.div,{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,children:a.jsxs(Y.div,{className:`relative w-full max-w-6xl h-[90vh] bg-black/95 border-2 border-green-500
+ rounded-lg shadow-[0_0_50px_rgba(0,255,0,0.3)] overflow-hidden`,initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},onClick:d=>d.stopPropagation(),children:[a.jsx("div",{className:"absolute inset-0 opacity-10",children:a.jsx("div",{className:"matrix-rain"})}),a.jsxs("div",{className:"relative z-10 bg-black/80 border-b-2 border-green-500/50 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(Ln,{className:"w-8 h-8 text-green-500"}),a.jsx("h1",{className:"text-3xl font-mono text-green-500 tracking-wider",children:"ACHIEVEMENTS"})]}),a.jsx("button",{onClick:t,className:"p-2 hover:bg-green-500/20 rounded transition-colors",children:a.jsx($s,{className:"w-6 h-6 text-green-500"})})]}),a.jsxs("div",{className:"flex items-center gap-8 text-green-300 font-mono",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ig,{className:"w-5 h-5"}),a.jsxs("span",{children:[u.unlocked," / ",u.total," UNLOCKED"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(og,{className:"w-5 h-5"}),a.jsxs("span",{children:[u.percentage,"% COMPLETE"]})]})]}),a.jsx("div",{className:"mt-4 h-2 bg-green-900/30 rounded-full overflow-hidden",children:a.jsx(Y.div,{className:"h-full bg-gradient-to-r from-green-600 to-green-400",initial:{width:0},animate:{width:`${u.percentage}%`},transition:{duration:.5,ease:"easeOut"}})})]}),a.jsx("div",{className:"relative z-10 bg-black/60 border-b border-green-500/30 p-4",children:a.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[a.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[a.jsx(RS,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-green-500/50"}),a.jsx("input",{type:"text",placeholder:"Search achievements...",value:r,onChange:d=>s(d.target.value),className:`w-full pl-10 pr-4 py-2 bg-black/50 border border-green-500/30
+ rounded text-green-300 font-mono placeholder-green-500/30
+ focus:border-green-500 focus:outline-none transition-colors`})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>o(null),className:`px-3 py-2 rounded font-mono text-sm transition-colors ${i?"bg-black/50 text-green-500/50 border border-green-500/30 hover:border-green-500/50":"bg-green-500/20 text-green-300 border border-green-500"}`,children:"ALL GAMES"}),Object.keys(l).map(d=>a.jsxs("button",{onClick:()=>o(d),className:`px-3 py-2 rounded font-mono text-sm transition-colors flex items-center gap-2 ${i===d?"bg-green-500/20 text-green-300 border border-green-500":"bg-black/50 text-green-500/50 border border-green-500/30 hover:border-green-500/50"}`,children:[a.jsx("span",{children:ab[d]||"🎮"}),d]},d))]})]})}),a.jsxs("div",{className:"relative z-10 overflow-y-auto h-[calc(100%-280px)] p-6",children:[a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:c.map((d,h)=>a.jsxs(Y.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:h*.05},className:`relative p-4 rounded-lg border-2 transition-all duration-300 ${d.unlocked?"bg-green-900/20 border-green-500 shadow-[0_0_20px_rgba(0,255,0,0.3)]":"bg-black/50 border-green-500/20 opacity-60"}`,children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center
+ ${d.unlocked?"bg-green-500/30 border-2 border-green-500":"bg-black/50 border-2 border-green-500/30"}`,children:d.unlocked?d.icon||a.jsx(Ln,{className:"w-6 h-6 text-green-500"}):a.jsx(ES,{className:"w-6 h-6 text-green-500/50"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:`font-mono text-lg mb-1 ${d.unlocked?"text-green-300":"text-green-500/50"}`,children:d.name}),a.jsx("p",{className:`font-mono text-sm mb-2 ${d.unlocked?"text-green-400/80":"text-green-500/30"}`,children:d.unlocked?d.description:"???"}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"font-mono text-xs text-green-500/50",children:d.game||"General"}),d.unlocked&&d.unlockedAt&&a.jsx("span",{className:"font-mono text-xs text-green-500/50",children:new Date(d.unlockedAt).toLocaleDateString()})]})]})]}),d.unlocked&&a.jsx(Y.div,{className:"absolute inset-0 pointer-events-none",initial:{opacity:0},animate:{opacity:[0,.2,0]},transition:{duration:2,repeat:1/0,repeatDelay:3},children:a.jsx("div",{className:"w-full h-full bg-gradient-to-r from-transparent via-green-500/20 to-transparent"})})]},d.id))}),c.length===0&&a.jsxs("div",{className:"text-center py-20",children:[a.jsx(Gs,{className:"w-16 h-16 mx-auto text-green-500/30 mb-4"}),a.jsx("p",{className:"text-green-500/50 font-mono",children:"NO ACHIEVEMENTS FOUND"})]})]})]})})}):null},cb=()=>{const[e,t]=v.useState(null),[n,r]=v.useState(!1),[s,i]=v.useState(!1);v.useEffect(()=>{if(window.matchMedia("(display-mode: standalone)").matches){i(!0);return}const c=d=>{d.preventDefault(),t(d),setTimeout(()=>r(!0),2e3)},u=()=>{i(!0),r(!1),t(null)};return window.addEventListener("beforeinstallprompt",c),window.addEventListener("appinstalled",u),()=>{window.removeEventListener("beforeinstallprompt",c),window.removeEventListener("appinstalled",u)}},[]);const o=async()=>{if(!e)return;await e.prompt();const{outcome:c}=await e.userChoice;console.log(c==="accepted"?"User accepted the install prompt":"User dismissed the install prompt"),t(null),r(!1)},l=()=>{r(!1),sessionStorage.setItem("pwa-prompt-dismissed","true")};return v.useEffect(()=>{sessionStorage.getItem("pwa-prompt-dismissed")==="true"&&r(!1)},[]),s||!n?null:a.jsx(je,{children:a.jsx(Y.div,{className:"fixed bottom-8 left-8 z-50",initial:{x:-400,opacity:0},animate:{x:0,opacity:1},exit:{x:-400,opacity:0},transition:{type:"spring",damping:20,stiffness:300},children:a.jsxs("div",{className:`bg-black/90 border-2 border-green-500 rounded-lg p-6
+ shadow-[0_0_30px_rgba(0,255,0,0.5)] backdrop-blur-md
+ max-w-[350px]`,children:[a.jsx("div",{className:"absolute inset-0 overflow-hidden rounded-lg opacity-10",children:a.jsx("div",{className:"matrix-rain"})}),a.jsxs("div",{className:"relative z-10",children:[a.jsxs("div",{className:"flex items-start justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Z0,{className:"w-8 h-8 text-green-500"}),a.jsx("h3",{className:"text-xl font-mono text-green-500",children:"INSTALL MATRIX ARCADE"})]}),a.jsx("button",{onClick:l,className:"p-1 hover:bg-green-500/20 rounded transition-colors",children:a.jsx($s,{className:"w-5 h-5 text-green-500"})})]}),a.jsx("p",{className:"text-green-300 font-mono text-sm mb-6 leading-relaxed",children:"Install The Matrix Arcade to your device for offline play and a better gaming experience."}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx("button",{onClick:o,className:`flex-1 px-4 py-2 bg-green-500 text-black font-mono rounded
+ hover:bg-green-400 transition-colors font-bold`,children:"INSTALL NOW"}),a.jsx("button",{onClick:l,className:`px-4 py-2 bg-transparent border border-green-500/50 text-green-500
+ font-mono rounded hover:bg-green-500/10 transition-colors`,children:"LATER"})]})]}),a.jsx("div",{className:"absolute inset-0 pointer-events-none",children:a.jsx(Y.div,{className:"w-full h-full",animate:{clipPath:["inset(0 0 100% 0)","inset(0 0 80% 0)","inset(0 0 100% 0)"],opacity:[0,.1,0]},transition:{duration:.5,repeat:1/0,repeatDelay:3},style:{background:"linear-gradient(180deg, transparent, rgba(0,255,0,0.1), transparent)",filter:"blur(1px)"}})})]})})})},ub="modulepreload",db=function(e){return"/"+e},lh={},fb=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=db(c),c in lh)return;lh[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":ub,u||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),u)return new Promise((m,p)=>{h.addEventListener("load",m),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function hb(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:r,onRegistered:s,onRegisteredSW:i,onRegisterError:o}=e;let l,c;const u=async(h=!0)=>{await c};async function d(){if("serviceWorker"in navigator){if(l=await fb(async()=>{const{Workbox:h}=await import("./workbox-window.prod.es5-B9K5rw8f.js");return{Workbox:h}},[]).then(({Workbox:h})=>new h("/sw.js",{scope:"/",type:"classic"})).catch(h=>{o==null||o(h)}),!l)return;l.addEventListener("activated",h=>{(h.isUpdate||h.isExternal)&&window.location.reload()}),l.addEventListener("installed",h=>{h.isUpdate||r==null||r()}),l.register({immediate:t}).then(h=>{i?i("/sw.js",h):s==null||s(h)}).catch(h=>{o==null||o(h)})}}return c=d(),u}function mb(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:r,onRegistered:s,onRegisteredSW:i,onRegisterError:o}=e,[l,c]=v.useState(!1),[u,d]=v.useState(!1),[h]=v.useState(()=>hb({immediate:t,onOfflineReady(){d(!0),r==null||r()},onNeedRefresh(){c(!0),n==null||n()},onRegistered:s,onRegisteredSW:i,onRegisterError:o}));return{needRefresh:[l,c],offlineReady:[u,d],updateServiceWorker:h}}const pb=()=>{const{needRefresh:[e,t],updateServiceWorker:n}=mb({onRegistered(i){console.log("SW Registered:",i)},onRegisterError(i){console.log("SW registration error",i)}}),r=()=>{t(!1)},s=()=>{n(!0)};return a.jsx(je,{children:e&&a.jsx(Y.div,{className:"fixed top-8 left-1/2 transform -translate-x-1/2 z-50",initial:{y:-100,opacity:0},animate:{y:0,opacity:1},exit:{y:-100,opacity:0},transition:{type:"spring",damping:20,stiffness:300},children:a.jsxs("div",{className:`bg-black/90 border-2 border-green-500 rounded-lg p-4
+ shadow-[0_0_30px_rgba(0,255,0,0.5)] backdrop-blur-md`,children:[a.jsx("div",{className:"absolute inset-0 overflow-hidden rounded-lg opacity-10",children:a.jsx("div",{className:"matrix-rain"})}),a.jsxs("div",{className:"relative z-10 flex items-center gap-4",children:[a.jsx(AS,{className:"w-6 h-6 text-green-500 animate-spin"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"font-mono text-green-500 text-sm mb-1",children:"NEW VERSION AVAILABLE"}),a.jsx("p",{className:"font-mono text-green-300 text-xs",children:"Reload to get the latest features and improvements"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:s,className:`px-3 py-1 bg-green-500 text-black font-mono text-sm rounded
+ hover:bg-green-400 transition-colors font-bold`,children:"RELOAD"}),a.jsx("button",{onClick:r,className:"p-1 hover:bg-green-500/20 rounded transition-colors",children:a.jsx($s,{className:"w-4 h-4 text-green-500"})})]})]})]})})})},gb=()=>{const e=xu(),[t,n]=v.useState([]),[r,s]=v.useState(!1),i=v.useRef(new Set);v.useEffect(()=>{const x=e.achievements.filter(k=>k.unlocked).map(k=>k.id);i.current=new Set(x)},[e.achievements]),v.useEffect(()=>{e.achievements.filter(k=>k.unlocked).forEach(k=>{if(!i.current.has(k.id)){i.current.add(k.id);const g={id:k.id,name:k.name,description:k.description,icon:k.icon,game:k.game,timestamp:Date.now()};n(f=>[...f,g])}})},[e.achievements]);const o=v.useCallback(x=>{n(k=>k.filter((g,f)=>f!==x))},[]),l=v.useCallback(()=>{n([])},[]),c=v.useCallback(()=>{s(x=>!x)},[]),u=v.useCallback(()=>{s(!0)},[]),d=v.useCallback(()=>{s(!1)},[]),h=v.useCallback(()=>{const x=e.achievements.length,k=e.achievements.filter(y=>y.unlocked).length,g=x>0?Math.round(k/x*100):0,f=e.achievements.reduce((y,w)=>{const b=w.game||"General";return y[b]||(y[b]={total:0,unlocked:0}),y[b].total++,w.unlocked&&y[b].unlocked++,y},{});return{total:x,unlocked:k,percentage:g,byGame:f}},[e.achievements]),m=v.useCallback((x,k,g)=>{const f=e.unlockAchievement(x,k);if(f&&g){const y=e.achievements.find(w=>w.id===k);if(y){const w={id:y.id,name:g.name||y.name,description:g.description||y.description,icon:g.icon||y.icon,game:g.game||y.game,timestamp:Date.now()};n(b=>[...b,w])}}return f},[e]),p=v.useCallback(x=>{const k=e.achievements.find(g=>g.id===x);return(k==null?void 0:k.unlocked)||!1},[e.achievements]);return{achievements:v.useCallback(()=>e.achievements.map(x=>({...x,progress:x.progress||0,maxProgress:x.maxProgress||1,percentComplete:x.maxProgress?Math.round((x.progress||0)/x.maxProgress*100):x.unlocked?100:0})),[e.achievements])(),stats:h(),notificationQueue:t,dismissNotification:o,clearNotifications:l,isDisplayOpen:r,toggleDisplay:c,openDisplay:u,closeDisplay:d,unlockAchievement:m,isUnlocked:p,saveGame:e.saveGame,loadGame:e.loadGame,getSaveData:e.getSaveData,clearSaveData:e.clearSaveData,exportSaveData:e.exportSaveData,importSaveData:e.importSaveData}};function yb(){const[e,t]=v.useState(0),[n,r]=v.useState(!1),[s,i]=v.useState(!1),[o,l]=v.useState(!1),[c,u]=v.useState(!1),[d,h]=v.useState(!1),[m,p]=v.useState("right"),S=v.useRef(null),x=v.useRef(null),k=v.useRef(null),{playSFX:g,playMusic:f,stopMusic:y}=Mr(),w=gb(),b=[{title:"CTRL-S | The World",icon:a.jsx(NS,{className:"w-8 h-8"}),description:"A hilarious text adventure about saving the digital world",preview:"https://res.cloudinary.com/depqttzlt/image/upload/v1737071600/ctrlsthegame_m1tg5l.png",component:Mk},{title:"Snake Classic",icon:a.jsx(co,{className:"w-8 h-8"}),description:"Navigate through the matrix collecting data fragments",preview:"https://res.cloudinary.com/depqttzlt/image/upload/v1737071599/matrixsnake2_jw29w1.png",component:JS},{title:"Vortex Pong",icon:a.jsx(vS,{className:"w-8 h-8"}),description:"Battle the AI in a hypnotic 3D arena",preview:"https://res.cloudinary.com/depqttzlt/image/upload/v1737071596/vortexpong2_hkjn4k.png",component:uk},{title:"Terminal Quest",icon:a.jsx(Ds,{className:"w-8 h-8"}),description:"Text-based adventure in the digital realm",preview:"https://res.cloudinary.com/depqttzlt/image/upload/v1737071600/terminalquest_ddvjkf.png",component:pk},{title:"Matrix Cloud",icon:a.jsx(co,{className:"w-8 h-8"}),description:"Navigate through the digital storm",preview:"https://res.cloudinary.com/depqttzlt/image/upload/v1737071594/matrixcloud_rw8hsa.png",component:$k},{title:"Matrix Invaders",icon:a.jsx(xS,{className:"w-8 h-8"}),description:"Defend against the code invasion",preview:"https://res.cloudinary.com/depqttzlt/image/upload/v1737071594/matrixcloud_rw8hsa.png",component:nb}];v.useEffect(()=>{const C=F=>{const L=F.offsetWidth,M=F.offsetHeight,U=document.createElement("canvas");U.width=L,U.height=M,U.style.position="absolute",U.style.top="0",U.style.left="0",U.style.zIndex="0",U.style.opacity="0.15",F.insertBefore(U,F.firstChild);const D=U.getContext("2d");if(!D)return;const A="アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン",R=14,V=Math.floor(L/R),Z=Array(V).fill(1);return setInterval(()=>{D.fillStyle="rgba(0, 0, 0, 0.05)",D.fillRect(0,0,L,M),D.fillStyle="#0F0",D.font=`${R}px monospace`;for(let ee=0;eeM&&Math.random()>.975&&(Z[ee]=0),Z[ee]++}},33)},_=x.current&&C(x.current),P=k.current&&C(k.current);return()=>{_&&clearInterval(_),P&&clearInterval(P)}},[]),v.useEffect(()=>{const C=_=>{const P=_.target;n&&P.tagName!=="INPUT"&&P.tagName!=="TEXTAREA"&&_.preventDefault()};return window.addEventListener("keydown",C,!1),window.addEventListener("wheel",C,{passive:!1}),window.addEventListener("touchmove",C,{passive:!1}),()=>{window.removeEventListener("keydown",C),window.removeEventListener("wheel",C),window.removeEventListener("touchmove",C)}},[n]),v.useEffect(()=>{const C=_=>{_.key.toLowerCase()==="a"&&!n&&_.target instanceof HTMLElement&&_.target.tagName!=="INPUT"&&_.target.tagName!=="TEXTAREA"&&(_.preventDefault(),w.toggleDisplay())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[n,w]);const N=()=>{j(e===0?b.length-1:e-1)},T=()=>{j(e===b.length-1?0:e+1)},j=C=>{const _=C>e?"right":"left";p(_),h(!0),setTimeout(()=>h(!1),600),i(!1),t(C),r(!1),g("menu")},E=b[e].component;return a.jsxs("div",{className:"min-h-screen flex flex-col bg-black text-green-500",children:[a.jsx("header",{ref:x,className:"relative border-b border-green-500/50 p-4 overflow-hidden backdrop-blur-sm",children:a.jsxs("div",{className:"max-w-4xl mx-auto flex items-center justify-between relative z-10",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"relative group",children:[a.jsx(_S,{className:"w-8 h-8 relative z-10"}),a.jsx("div",{className:"absolute inset-0 bg-green-500/20 rounded-full filter blur-sm animate-pulse"})]}),a.jsx("div",{children:a.jsxs("a",{href:"https://tomatic.tech/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm hover:text-green-400 transition-colors group",children:[a.jsx("h1",{className:"text-2xl font-mono font-bold tracking-wider group-hover:text-green-400 transition-colors",children:"THE MATRIX ARCADE"}),a.jsx("p",{className:"text-xs text-green-400 tracking-widest",children:"SYSTEM v1.0.2"})]})})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>u(!c),className:"p-2 bg-green-900/50 rounded hover:bg-green-800 transition-colors border border-green-500/30 backdrop-blur-sm",title:"Save Data Manager",children:a.jsx(uo,{className:"w-5 h-5"})}),a.jsx("button",{onClick:()=>l(!o),className:"p-2 bg-green-900/50 rounded hover:bg-green-800 transition-colors border border-green-500/30 backdrop-blur-sm",title:"Audio Settings",children:a.jsx(Oo,{className:"w-5 h-5"})}),a.jsx("button",{onClick:()=>i(!s),className:"flex items-center gap-2 px-4 py-2 bg-green-900/50 rounded hover:bg-green-800 transition-colors border border-green-500/30 backdrop-blur-sm group",children:"Games"})]})]})}),s&&a.jsx("div",{className:"absolute left-0 top-0 h-full w-64 bg-black/90 border-r border-green-500/50 z-50 backdrop-blur-sm",style:{paddingTop:"5rem"},children:a.jsx("div",{className:"flex flex-col gap-2 p-4",children:b.map((C,_)=>a.jsxs("button",{onClick:()=>j(_),className:"w-full flex items-center gap-2 p-3 hover:bg-green-900/50 transition-colors text-left",children:[C.icon,a.jsx("span",{children:C.title})]},_))})}),a.jsx("main",{className:"flex-1 overflow-hidden",children:a.jsxs("div",{className:"relative w-full max-w-4xl mx-auto h-full flex flex-col",children:[a.jsx("div",{className:"absolute inset-0 opacity-20 pointer-events-none overflow-hidden",children:[...Array(50)].map((C,_)=>a.jsx("div",{className:"absolute text-green-500 animate-matrix-rain",style:{left:`${Math.random()*100}%`,animationDelay:`${Math.random()*2}s`,animationDuration:`${1+Math.random()*3}s`},children:String.fromCharCode(12448+Math.random()*96)},_))}),a.jsx("div",{ref:S,className:`
+ digital-container
+ ${d?`transition-${m}`:""}
+ `,children:a.jsx("div",{className:"game-container",children:a.jsxs("div",{className:"relative bg-gray-900 rounded-3xl p-8 border-4 border-green-500 shadow-[0_0_50px_rgba(0,255,0,0.3)]",children:[a.jsx("div",{className:"relative aspect-video mb-6 rounded-lg overflow-hidden border-2 border-green-500",children:a.jsx(je,{mode:"wait",children:a.jsx(Y.div,{className:"game-container transition-enhanced",children:n&&E?a.jsx(E,{achievementManager:w}):a.jsx("img",{src:b[e].preview,alt:b[e].title,className:"w-full h-full object-cover"})},e)})}),a.jsxs("div",{className:"flex items-center justify-between gap-4",children:[a.jsx("button",{onClick:N,className:"p-2 hover:bg-green-900 rounded-full transition-colors transform hover:scale-110",title:"Previous game",children:a.jsx(mS,{className:"w-8 h-8"})}),a.jsxs("div",{className:"flex-1 text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-3 mb-2",children:[b[e].icon,a.jsx("h2",{className:"text-xl font-mono",children:b[e].title})]}),a.jsx("p",{className:"text-green-400 font-mono text-sm mb-4",children:b[e].description}),typeof E<"u"&&a.jsxs("button",{onClick:()=>{r(!n),g(n?"menu":"score"),n?y():setTimeout(()=>f("gameplay"),500)},className:"px-6 py-2 bg-green-500 text-black font-mono rounded-full hover:bg-green-400 transition-colors flex items-center gap-2 mx-auto transform hover:scale-105",children:[a.jsx(Io,{className:"w-4 h-4"}),n?"STOP":"PLAY"]})]}),a.jsx("button",{onClick:T,className:"p-2 hover:bg-green-900 rounded-full transition-colors transform hover:scale-110",title:"Next game",children:a.jsx(Q0,{className:"w-8 h-8"})})]})]})})})]})}),a.jsx("footer",{ref:k,className:"relative border-t border-green-500/50 p-4 overflow-hidden backdrop-blur-sm bottom-0 w-full",children:a.jsxs("div",{className:"max-w-4xl mx-auto flex items-center justify-between relative z-10",children:[a.jsxs("div",{className:"font-mono text-sm flex items-center gap-4",children:[a.jsx("p",{className:"tracking-wider",children:"THE MATRIX ARCADE v1.0.2"}),a.jsx("div",{className:"h-4 w-px bg-green-500/30"}),a.jsx("p",{className:"text-green-400",children:"TAKE THE RED PILL!"})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("a",{href:"https://thomasjbutler.me/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm hover:text-green-400 transition-colors group",children:[a.jsx("span",{children:"BY THOMAS J BUTLER"}),a.jsx(pS,{className:"w-4 h-4 group-hover:rotate-12 transition-transform"})]}),a.jsx("div",{className:"flex gap-1",children:[...Array(3)].map((C,_)=>a.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse",style:{animationDelay:`${_*200}ms`}},_))})]})]})}),a.jsx(rb,{isOpen:o,onClose:()=>l(!1)}),a.jsx(sb,{isOpen:c,onClose:()=>u(!1)}),a.jsx(ob,{achievements:w.notificationQueue,onDismiss:w.dismissNotification}),a.jsx(lb,{isOpen:w.isDisplayOpen,onClose:w.closeDisplay,achievements:w.achievements}),a.jsx(cb,{}),a.jsx(pb,{}),a.jsx("style",{children:`
+
+
+ .perspective {
+ perspective: 2000px;
+ perspective-origin: 50% 50%;
+ }
+
+ .digital-container {
+ position: relative;
+ transform-style: preserve-3d;
+ transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
+ }
+
+ .game-container {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ transform-style: preserve-3d;
+ transition: inherit;
+ padding: 1rem;
+ }
+ `})]})}Sp(document.getElementById("root")).render(a.jsx(v.StrictMode,{children:a.jsx(yb,{})}));
diff --git a/dist/index.html b/dist/index.html
index 578ee03..7771d0f 100644
--- a/dist/index.html
+++ b/dist/index.html
@@ -5,7 +5,7 @@
The Matrix Arcade
-
+
diff --git a/dist/sw.js b/dist/sw.js
index 8e62965..3926172 100644
--- a/dist/sw.js
+++ b/dist/sw.js
@@ -1 +1 @@
-if(!self.define){let e,n={};const s=(s,i)=>(s=new URL(s+".js",i).href,n[s]||new Promise(n=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=n,document.head.appendChild(e)}else e=s,importScripts(s),n()}).then(()=>{let e=n[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e}));self.define=(i,o)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(n[t])return;let r={};const c=e=>s(e,t),d={module:{uri:t},exports:r,require:c};n[t]=Promise.all(i.map(e=>d[e]||c(e))).then(e=>(o(...e),r))}}define(["./workbox-b833909e"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-Bf0NK3Yx.js",revision:null},{url:"assets/index-Cq-DTt6B.css",revision:null},{url:"assets/workbox-window.prod.es5-B9K5rw8f.js",revision:null},{url:"icon-192x192.png",revision:"4c4ade5d78663698dbb8b53424e90d01"},{url:"icon-512x512.png",revision:"620c96dfc79a521ef11dd5d3e10c2e24"},{url:"index.html",revision:"87de7caa23c531cfe28594266d692cf3"},{url:"offline.html",revision:"a07c35bf8b4d4d5545f78bdb0e24efee"},{url:"icon-192x192.png",revision:"4c4ade5d78663698dbb8b53424e90d01"},{url:"icon-512x512.png",revision:"620c96dfc79a521ef11dd5d3e10c2e24"},{url:"manifest.webmanifest",revision:"b933a149beff885457b764fcb287e297"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/offline.html"),{denylist:[/^\/api/]})),e.registerRoute(/^https:\/\/res\.cloudinary\.com\/.*/i,new e.CacheFirst({cacheName:"cloudinary-images",plugins:[new e.ExpirationPlugin({maxEntries:50,maxAgeSeconds:2592e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(googleapis|gstatic)\.com\/.*/i,new e.CacheFirst({cacheName:"google-fonts",plugins:[new e.ExpirationPlugin({maxEntries:20,maxAgeSeconds:31536e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET")});
+if(!self.define){let e,n={};const s=(s,i)=>(s=new URL(s+".js",i).href,n[s]||new Promise(n=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=n,document.head.appendChild(e)}else e=s,importScripts(s),n()}).then(()=>{let e=n[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e}));self.define=(i,o)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(n[t])return;let r={};const c=e=>s(e,t),l={module:{uri:t},exports:r,require:c};n[t]=Promise.all(i.map(e=>l[e]||c(e))).then(e=>(o(...e),r))}}define(["./workbox-b833909e"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-CKwHGlCw.js",revision:null},{url:"assets/index-Cq-DTt6B.css",revision:null},{url:"assets/workbox-window.prod.es5-B9K5rw8f.js",revision:null},{url:"icon-192x192.png",revision:"4c4ade5d78663698dbb8b53424e90d01"},{url:"icon-512x512.png",revision:"620c96dfc79a521ef11dd5d3e10c2e24"},{url:"index.html",revision:"6beac40e96164c9af0a7c0f4009bf486"},{url:"offline.html",revision:"a07c35bf8b4d4d5545f78bdb0e24efee"},{url:"icon-192x192.png",revision:"4c4ade5d78663698dbb8b53424e90d01"},{url:"icon-512x512.png",revision:"620c96dfc79a521ef11dd5d3e10c2e24"},{url:"manifest.webmanifest",revision:"b933a149beff885457b764fcb287e297"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/offline.html"),{denylist:[/^\/api/]})),e.registerRoute(/^https:\/\/res\.cloudinary\.com\/.*/i,new e.CacheFirst({cacheName:"cloudinary-images",plugins:[new e.ExpirationPlugin({maxEntries:50,maxAgeSeconds:2592e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(googleapis|gstatic)\.com\/.*/i,new e.CacheFirst({cacheName:"google-fonts",plugins:[new e.ExpirationPlugin({maxEntries:20,maxAgeSeconds:31536e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET")});
diff --git a/image.png b/image.png
deleted file mode 100644
index 66d6132..0000000
Binary files a/image.png and /dev/null differ
diff --git a/package.json b/package.json
index 1096cbe..9643870 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
- "name": "vite-react-typescript-starter",
+ "name": "the-matrix-arcade",
"private": true,
- "version": "0.0.0",
+ "version": "1.0.5",
"type": "module",
"scripts": {
"dev": "vite",
diff --git a/public/offline.html b/public/offline.html
deleted file mode 100644
index 9e1efdf..0000000
--- a/public/offline.html
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
-
-
-
- The Matrix Arcade - Offline
-
-
-
-
-
-
-
⚡
-
SYSTEM OFFLINE
-
You've been disconnected from the Matrix
-
Check your connection and reload to re-enter
-
ERROR: CONNECTION_LOST
-
-
-
-
-
\ No newline at end of file
diff --git a/src/App.test.tsx b/src/App.test.tsx
index 97d3a34..4a40140 100644
--- a/src/App.test.tsx
+++ b/src/App.test.tsx
@@ -1,8 +1,56 @@
-import { describe, it, expect } from 'vitest';
-import { render, screen } from '@testing-library/react';
+import { describe, it, expect, vi, beforeEach } from 'vitest';
+import { render, screen, fireEvent, waitFor } from '@testing-library/react';
import App from './App';
+// Create mock objects
+const mockSoundSystem = {
+ playSFX: vi.fn(),
+ playMusic: vi.fn(),
+ stopMusic: vi.fn(),
+ toggleMute: vi.fn(),
+ isMuted: false,
+ config: { masterVolume: 0.7 },
+ updateConfig: vi.fn(),
+};
+
+const mockAchievementManager = {
+ toggleDisplay: vi.fn(),
+ notificationQueue: [],
+ dismissNotification: vi.fn(),
+ isDisplayOpen: false,
+ closeDisplay: vi.fn(),
+ achievements: [],
+};
+
+const mockMobileDetection = {
+ isMobile: false,
+ isTablet: false,
+};
+
+// Mock hooks
+vi.mock('./hooks/useSoundSystem', () => ({
+ useSoundSystem: () => mockSoundSystem,
+}));
+
+vi.mock('./hooks/useAchievementManager', () => ({
+ useAchievementManager: () => mockAchievementManager,
+}));
+
+vi.mock('./hooks/useMobileDetection', () => ({
+ useMobileDetection: () => mockMobileDetection,
+}));
+
describe('App Component', () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ // Reset mock states
+ mockSoundSystem.isMuted = false;
+ mockAchievementManager.isDisplayOpen = false;
+ mockAchievementManager.notificationQueue = [];
+ mockMobileDetection.isMobile = false;
+ mockMobileDetection.isTablet = false;
+ });
+
it('renders header with game title', () => {
render();
const headerElement = screen.getByText('THE MATRIX ARCADE');
@@ -18,9 +66,9 @@ describe('App Component', () => {
expect(nextButton).toBeInTheDocument();
});
- it('displays version number', () => {
+ it('displays correct version number', () => {
render();
- const versionText = screen.getByText(/SYSTEM v1.0.2/);
+ const versionText = screen.getByText(/SYSTEM v1.0.5/);
expect(versionText).toBeInTheDocument();
});
@@ -29,5 +77,169 @@ describe('App Component', () => {
const gamesButton = screen.getByText('Games');
expect(gamesButton).toBeInTheDocument();
});
+
+ it('renders audio control buttons', () => {
+ render();
+ const saveButton = screen.getByTitle('Save Data Manager');
+ const muteButton = screen.getByTitle('Mute Sound');
+ const settingsButton = screen.getByTitle('Audio Settings');
+
+ expect(saveButton).toBeInTheDocument();
+ expect(muteButton).toBeInTheDocument();
+ expect(settingsButton).toBeInTheDocument();
+ });
+
+ it('shows volume slider on hover', async () => {
+ render();
+ const muteButton = screen.getByTitle('Mute Sound');
+
+ // Volume slider container should have opacity-0 initially
+ const volumeContainer = muteButton.parentElement?.querySelector('.group-hover\\:opacity-100');
+ expect(volumeContainer).toHaveClass('opacity-0');
+
+ // Hover over mute button parent
+ fireEvent.mouseEnter(muteButton.parentElement!);
+
+ // Volume slider should be in the DOM (even if not visible)
+ const slider = screen.getByRole('slider');
+ expect(slider).toBeInTheDocument();
+ expect(slider).toHaveAttribute('type', 'range');
+ });
+
+ it('handles keyboard navigation', () => {
+ const { container } = render();
+
+ // Test arrow key navigation
+ fireEvent.keyDown(window, { key: 'ArrowRight' });
+ // Should change to next game
+ expect(screen.getByText('Snake Classic')).toBeInTheDocument();
+
+ fireEvent.keyDown(window, { key: 'ArrowLeft' });
+ // Should go back to first game
+ expect(screen.getByText('CTRL-S | The World')).toBeInTheDocument();
+ });
+
+ it('handles ESC key to exit game', () => {
+ render();
+
+ // Start a game
+ const playButton = screen.getByText('PLAY');
+ fireEvent.click(playButton);
+
+ // Press ESC
+ fireEvent.keyDown(window, { key: 'Escape' });
+
+ // Should return to game selection
+ expect(screen.getByText('PLAY')).toBeInTheDocument();
+ });
+
+ it('handles Enter key to start game', () => {
+ render();
+
+ // Press Enter
+ fireEvent.keyDown(window, { key: 'Enter' });
+
+ // Should start the game
+ expect(screen.queryByText('PLAY')).not.toBeInTheDocument();
+ });
+
+ it('toggles mute state', () => {
+ render();
+ const muteButton = screen.getByTitle('Mute Sound');
+
+ fireEvent.click(muteButton);
+ expect(mockSoundSystem.toggleMute).toHaveBeenCalled();
+ });
+
+ it('renders responsive classes for desktop', () => {
+ render();
+ const container = screen.getByText('CTRL-S | The World').closest('.max-w-6xl');
+
+ expect(container).toHaveClass('lg:py-8', 'lg:px-8');
+ });
+
+ it('shows correct keyboard hints', () => {
+ render();
+
+ expect(screen.getByText('← → Navigate Games • Enter to Play • ESC to Exit')).toBeInTheDocument();
+ expect(screen.getByText('A for Achievements • V to Toggle Mute')).toBeInTheDocument();
+ });
+
+ it('renders footer with correct version', () => {
+ render();
+
+ expect(screen.getByText('THE MATRIX ARCADE v1.0.5')).toBeInTheDocument();
+ expect(screen.getByText('TAKE THE RED PILL!')).toBeInTheDocument();
+ });
+
+ it('displays author link', () => {
+ render();
+
+ const authorLink = screen.getByText('BY THOMAS J BUTLER');
+ expect(authorLink).toBeInTheDocument();
+ expect(authorLink.closest('a')).toHaveAttribute('href', 'https://thomasjbutler.me/');
+ });
+
+ it('renders all games in the carousel', () => {
+ render();
+
+ // Navigate through all games
+ const games = [
+ 'CTRL-S | The World',
+ 'Snake Classic',
+ 'Vortex Pong',
+ 'Terminal Quest',
+ 'Matrix Cloud',
+ 'Matrix Invaders'
+ ];
+
+ games.forEach((gameTitle, index) => {
+ if (index > 0) {
+ fireEvent.keyDown(window, { key: 'ArrowRight' });
+ }
+ expect(screen.getByText(gameTitle)).toBeInTheDocument();
+ });
+ });
+
+ it('handles achievement shortcut key', () => {
+ render();
+
+ // Make sure we're not playing (we should be in menu by default)
+ expect(screen.getByText('PLAY')).toBeInTheDocument();
+
+ // Fire keydown on document.body to ensure proper target
+ fireEvent.keyDown(document.body, {
+ key: 'a',
+ target: document.body
+ });
+ expect(mockAchievementManager.toggleDisplay).toHaveBeenCalled();
+ });
+
+ it('renders matrix rain effect elements', () => {
+ render();
+
+ // Check for matrix rain elements
+ const matrixChars = document.querySelectorAll('.animate-matrix-rain');
+ expect(matrixChars.length).toBeGreaterThan(0);
+ });
+
+ it('handles games menu button click', () => {
+ render();
+
+ const gamesButton = screen.getByText('Games');
+ fireEvent.click(gamesButton);
+
+ // Should show games menu
+ expect(screen.getByText('Snake Classic')).toBeInTheDocument();
+ });
+
+ it('applies correct transition classes during game switch', async () => {
+ render();
+
+ fireEvent.keyDown(window, { key: 'ArrowRight' });
+
+ const container = document.querySelector('.digital-container');
+ expect(container).toHaveClass('transition-right');
+ });
});
diff --git a/src/App.tsx b/src/App.tsx
index f7a1389..6f9db56 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,4 +1,4 @@
-import { useState, useEffect, useRef } from 'react';
+import { useState, useEffect, useRef, useCallback } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import './styles/theme.css'; // Custom theme.css for the insane styling
import './styles/animations.css';
@@ -15,6 +15,9 @@ import {
Settings,
Save,
Crosshair,
+ X,
+ Volume2,
+ VolumeX,
} from 'lucide-react';
import SnakeClassic from './components/games/SnakeClassic';
import VortexPong from './components/games/VortexPong';
@@ -28,8 +31,10 @@ import { AchievementQueue } from './components/ui/AchievementNotification';
import { AchievementDisplay } from './components/ui/AchievementDisplay';
import { PWAInstallPrompt } from './components/ui/PWAInstallPrompt';
import { PWAUpdatePrompt } from './components/ui/PWAUpdatePrompt';
+import { MobileWarning } from './components/ui/MobileWarning';
import { useSoundSystem } from './hooks/useSoundSystem';
import { useAchievementManager } from './hooks/useAchievementManager';
+import { useMobileDetection } from './hooks/useMobileDetection';
function App() {
const [selectedGame, setSelectedGame] = useState(0);
@@ -46,8 +51,41 @@ function App() {
const footerRef = useRef(null);
// Initialize sound system and achievement manager
- const { playSFX, playMusic, stopMusic } = useSoundSystem();
+ const { playSFX, playMusic, stopMusic, toggleMute, isMuted, config: soundConfig, updateConfig } = useSoundSystem();
const achievementManager = useAchievementManager();
+
+ // Mobile detection
+ const { isMobile, isTablet } = useMobileDetection();
+ const showMobileWarning = isMobile || isTablet;
+
+ // Track global achievements
+ const gamesPlayed = useRef(new Set());
+ const playStartTime = useRef(null);
+ const totalPlayTime = useRef(0);
+
+ // Check achievement milestones
+ useEffect(() => {
+ const totalUnlocked = achievementManager.stats.unlocked;
+ const currentGlobalAchievements = achievementManager.getSaveData()?.globalStats.globalAchievements || [];
+
+ if (totalUnlocked >= 10 && !currentGlobalAchievements.includes('global_10_achievements')) {
+ achievementManager.updateGlobalStats({
+ globalAchievements: [...currentGlobalAchievements, 'global_10_achievements']
+ });
+ }
+
+ if (totalUnlocked >= 25 && !currentGlobalAchievements.includes('global_25_achievements')) {
+ achievementManager.updateGlobalStats({
+ globalAchievements: [...currentGlobalAchievements, 'global_25_achievements']
+ });
+ }
+
+ if (totalUnlocked >= 50 && !currentGlobalAchievements.includes('global_50_achievements')) {
+ achievementManager.updateGlobalStats({
+ globalAchievements: [...currentGlobalAchievements, 'global_50_achievements']
+ });
+ }
+ }, [achievementManager.stats.unlocked, achievementManager]);
const games = [
{
@@ -95,7 +133,7 @@ function App() {
icon: ,
description: 'Defend against the code invasion',
preview:
- 'https://res.cloudinary.com/depqttzlt/image/upload/v1737071594/matrixcloud_rw8hsa.png',
+ 'https://res.cloudinary.com/depqttzlt/image/upload/v1751750717/matrix3_zmwcnd.png',
component: MatrixInvaders,
},
];
@@ -179,6 +217,26 @@ function App() {
};
}, [isPlaying]);
+ // Game selection functions
+ const selectGame = useCallback((index: number) => {
+ const direction = index > selectedGame ? 'right' : 'left';
+ setTransitionDirection(direction);
+ setIsTransitioning(true);
+ setTimeout(() => setIsTransitioning(false), 600);
+ setShowNav(false);
+ setSelectedGame(index);
+ setIsPlaying(false);
+ playSFX('menu');
+ }, [selectedGame, playSFX]);
+
+ const handlePrevious = useCallback(() => {
+ selectGame(selectedGame === 0 ? games.length - 1 : selectedGame - 1);
+ }, [selectedGame, selectGame]);
+
+ const handleNext = useCallback(() => {
+ selectGame(selectedGame === games.length - 1 ? 0 : selectedGame + 1);
+ }, [selectedGame, selectGame]);
+
// Keyboard shortcuts
useEffect(() => {
const handleKeyPress = (e: KeyboardEvent) => {
@@ -190,41 +248,61 @@ function App() {
e.preventDefault();
achievementManager.toggleDisplay();
}
+
+ // ESC key to exit games
+ if (e.key === 'Escape' && isPlaying) {
+ e.preventDefault();
+ setIsPlaying(false);
+ stopMusic();
+ playSFX('menu');
+ }
+
+ // Arrow keys for game navigation (when not playing)
+ if (!isPlaying && (e.key === 'ArrowLeft' || e.key === 'ArrowRight')) {
+ e.preventDefault();
+ if (e.key === 'ArrowLeft') {
+ handlePrevious();
+ } else {
+ handleNext();
+ }
+ }
+
+ // Enter key to start game
+ if (!isPlaying && e.key === 'Enter' && !showMobileWarning) {
+ e.preventDefault();
+ setIsPlaying(true);
+ playSFX('score');
+ setTimeout(() => playMusic('gameplay'), 500);
+ }
+
+ // V key to toggle mute
+ if (e.key.toLowerCase() === 'v' && !isPlaying &&
+ e.target instanceof HTMLElement &&
+ e.target.tagName !== 'INPUT' &&
+ e.target.tagName !== 'TEXTAREA') {
+ e.preventDefault();
+ toggleMute();
+ }
};
window.addEventListener('keydown', handleKeyPress);
return () => window.removeEventListener('keydown', handleKeyPress);
- }, [isPlaying, achievementManager]);
-
- const handlePrevious = () => {
- selectGame(selectedGame === 0 ? games.length - 1 : selectedGame - 1);
- };
-
- const handleNext = () => {
- selectGame(selectedGame === games.length - 1 ? 0 : selectedGame + 1);
- };
-
- const selectGame = (index: number) => {
- const direction = index > selectedGame ? 'right' : 'left';
- setTransitionDirection(direction);
- setIsTransitioning(true);
- setTimeout(() => setIsTransitioning(false), 600);
- setShowNav(false);
- setSelectedGame(index);
- setIsPlaying(false);
- playSFX('menu');
- };
+ }, [isPlaying, achievementManager, stopMusic, playSFX, showMobileWarning, playMusic, handlePrevious, handleNext, toggleMute]);
const GameComponent = games[selectedGame].component;
return (
-
+ <>
+ {/* Mobile Warning */}
+ {showMobileWarning &&
}
+
+
{/* Header */}
-
+
@@ -241,7 +319,7 @@ function App() {
THE MATRIX ARCADE
- SYSTEM v1.0.2
+ SYSTEM v1.0.5
@@ -254,6 +332,36 @@ function App() {
>
+
+
+
+ {/* Volume Slider Popup */}
+
+
+
+ updateConfig({ masterVolume: parseFloat(e.target.value) })}
+ className="flex-1 slider"
+ />
+ {Math.round(soundConfig.masterVolume * 100)}%
+
+
+