PageSourceSearch

https://usetunez.com/_next/static/chunks/2450-1025592938b0b0f3.js

js usetunez.com collected 2026-10-02 01:47:36 UTC 162,224 bytes, 1,595 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2450],{26806:(e,t,i)=>{i.d(t,{m:()=>r});var o=i(78234),a=i(98446),n=i(28111),s=i(67518),l=i(32865);class r{static build(e){return this.buildMany([e])[0]}static buildMany(e){let t=this.getSharedTapGroupKeys(e),i=e.map(e=>this.buildByType(e,t)),o=new Map;return i.forEach(e=>{if(!this.supportsSharedTapArbiter(e.customMod)||!t.has((0,s.my)(e.customMod.handler)))return;let i=(0,s.my)(e.customMod.handler);o.has(i)||o.set(i,[]),o.get(i)?.push(e)}),o.forEach(e=>{let t=(e=>{let[t]=e,i=t.handler,o=(0,n.uE)((0,s.my)(i)),a=`embedded${o}TapCount`,r=`embedded${o}LastTapTime`,d=`embedded${o}TriggerPrev`,u=i.secondaryButton||i.primaryButton,c=i.secondaryButton?(0,l.$O)(i.primaryButton,i.device):"TRUE",m=e.find(e=>"tap"===e.handler.trigger)?.dispatchFunctionName,p=e.find(e=>"double-tap"===e.handler.trigger)?.dispatchFunctionName,g=e.find(e=>"triple-tap"===e.handler.trigger)?.dispatchFunctionName,S=[`if (${l.pH} - ${r} > EMBEDDED_MULTI_TAP_WINDOW) {`,`    ${a} = 0;`,"}","",`${a} = ${a} + 1;`,`${r} = ${l.pH};`];g&&S.push("",`if (${a} >= 3) {`,`    ${a} = 0;`,`    ${r} = 0;`,`    ${g}();`,"}"),p&&!g&&S.push("",`if (${a} >= 2) {`,`    ${a} = 0;`,`    ${r} = 0;`,`    ${p}();`,"}");let b=m?[`        ${m}();`,...p?[]:[`        if (${a} >= 2) {`,`            ${m}();`,"        }",`        if (${a} >= 3) {`,`            ${m}();`,"        }"]]:[],h=[`if (${a} > 0 && ${l.pH} - ${r} > EMBEDDED_MULTI_TAP_WINDOW) {`];p?(h.push(`    if (${a} >= 2) {`,`        ${p}();`,`    }${m?" else {":""}`),m&&h.push(...b,"    }")):m&&h.push(...b.map(e=>`    ${e.trimStart()}`)),h.push(`    ${a} = 0;`,`    ${r} = 0;`,"}");let _=S.join("\n"),f=h.join("\n"),E="gamepad"===i.device?`if (${(0,l.h5)(c,`event_press(${u})`)}) {
2${(0,l.Mz)(_)}
3}
4${f}`:`if (${(0,l.$O)(u,i.device)}) {
5    if (${(0,l.YI)(`!${d}`,c)}) {
6${(0,l.Mz)(_,8)}
7    }
8    ${d} = TRUE;
9} else {
10    ${d} = FALSE;
11}
12${f}`,v=[`int ${l.pH} = 0;`,`int ${a} = 0;`,`int ${r} = 0;`];return"keyboard"===i.device&&v.push(`int ${d} = FALSE;`),{runtimeDefines:l.r0,runtimeVars:v.join("\n"),priorityLogic:l.Vv,inputHook:E}})(e.map(e=>({modId:e.customMod.id,handler:e.customMod.handler,dispatchFunctionName:e.compiledHandler.dispatchFunctionName})));e.forEach((e,i)=>{0===i&&(e.definition.templates.mainLogicBlock=[`// ${e.customMod.name} Shared Tap Group`,t.inputHook,e.definition.templates.mainLogicBlock||""].filter(Boolean).join("\n\n"),e.definition.templates.runtimeDefines=[e.definition.templates.runtimeDefines,t.runtimeDefines].filter(Boolean).join("\n"),e.definition.templates.function=[t.runtimeVars,e.definition.templates.function].filter(Boolean).join("\n\n"),e.definition.templates.priorityLogic=[e.definition.templates.priorityLogic,t.priorityLogic].filter(Boolean).join("\n"))})}),i.map(e=>e.definition)}static buildByType(e,t){if("embedded"===e.type)return this.buildEmbedded(e,t.has((0,s.my)(e.handler)));if("toggle-only"===e.type)return this.buildToggleOnly(e);throw Error("Unsupported custom mod type")}static buildEmbedded(e,t){let i=(0,n.oO)(e.functionCode),s=(0,n.oO)(e.comboCode||""),l=(0,a.s)(e.id,e.handler,{deferTapHandling:t,symbolPrefix:"Embedded",stopComboOnRelease:!!s}),r=this.buildSuppressCombatLifecycle(e,l,s),d=(0,n.ZV)(i,{...l.tokenReplacements,...r.tokenReplacements}),u=(0,n.ZV)(s,l.tokenReplacements),c=o.u.Embedded({id:e.id,name:e.name,description:e.note,activation:l.activation,runtimeDefines:[l.runtimeDefines,l.runtimeVars,r.runtimeDefines].filter(Boolean).join("\n"),suppressCombatFlag:r.suppressCombatFlag,priorityLogic:[l.priorityLogic,r.priorityLogic].filter(Boolean).join("\n"),mainLogicBlock:l.inputHook,functionBlock:[d,r.functionWrappers].filter(Boolean).join("\n\n"),combo:u});return{customMod:e,definition:c,compiledHandler:l}}static buildToggleOnly(e){let t=(0,n.oO)(e.functionCode),i=(0,n.oO)(e.comboCode||""),s=(0,a.s)(e.id,e.handler,{symbolPrefix:"ToggleOnly",stopComboOnRelease:!!i}),r=this.buildSuppressCombatLifecycle(e,s,i),d=(0,n.ZV)(t,{...s.tokenReplacements,...r.tokenReplacements}),u=(0,n.ZV)(i,s.tokenReplacements),c=[s.resetCode,i?`combo_stop(${s.c
12omboName});`:""].filter(Boolean).join("\n"),m=`if (toggle[Toggle${e.id}Enum]) {
13${(0,l.Mz)(s.inputHook)}
14}${c?` else {
15${(0,l.Mz)(c)}
16}`:""}`,p=o.u.ToggleOnly({id:e.id,name:e.name,description:e.note,category:"utility",version:"1.0.0",activation:s.activation,runtimeDefines:[s.runtimeDefines,s.runtimeVars,r.runtimeDefines].filter(Boolean).join("\n"),suppressCombatFlag:r.suppressCombatFlag,settings:[{id:"active",label:"Active by default",hint:"Whether this mod is on when the script starts.",type:"toggle",default:+!!e.activeByDefault,editable:!0}],priorityLogic:[s.priorityLogic,r.priorityLogic].filter(Boolean).join("\n"),mainLogicBlock:m,function:[d,r.functionWrappers].filter(Boolean).join("\n\n"),combo:u});return{customMod:e,definition:p,compiledHandler:s}}static getSharedTapGroupKeys(e){let t=new Map;return e.forEach(e=>{if(!this.supportsSharedTapArbiter(e))return;let i=(0,s.my)(e.handler);t.has(i)||t.set(i,[]),t.get(i)?.push(e)}),new Set(Array.from(t.entries()).filter(([,e])=>!(e.length<2)&&!!e.every(e=>(0,s.dm)(e.handler.trigger))&&new Set(e.map(e=>(0,s.Hm)(e.handler.trigger))).size===e.length).map(([e])=>e))}static supportsSharedTapArbiter(e){return"embedded"===e.type&&(0,s.dm)(e.handler.trigger)}static buildSuppressCombatLifecycle(e,t,i){let o=(0,n.Ys)(e.suppressCombat);if("none"===o.mode)return this.emptySuppressCombatBuild();let a=t.stateVariableName.endsWith("Active")?t.stateVariableName.slice(0,-6):t.stateVariableName,s=`${a}SuppressCombat`,l=`${a}SuppressTimer`,r=[`int ${s} = FALSE;`],d=[],u=[],c={},m=i.includes(n.cP.comboName),p="toggle-only"===e.type?`toggle[Toggle${e.id}Enum]`:"";if("while-combo"===o.mode)d.push(`${s} = ${m?`combo_running(${t.comboName})`:"FALSE"};`);else if("while-held"===o.mode){let i=this.buildHeldExpression(e),o=m?` || combo_running(${t.comboName})`:"";d.push(`${s} = ${i}${o};`)}else if("while-toggled"===o.mode)"toggle-only"===e.type?d.push(`${s} = toggle[Toggle${e.id}Enum];`):"loop"===e.handler.execution?d.push(`${s} = ${t.stateVariableName};`):d.push(`${s} = FALSE;`);else{let i=o.durationMs||n.ap;r.push(`int ${l} = 0;`),d.push(this.buildTimedSuppressCombatPriorityLogic(s,l,"timed-early-return"===o.mode?this.buildEarlyReturnExpression(o.earlyReturn):"",p)),u.push(this.buildTimedSuppressCombatWrappers(t,e.handler.execution,i,s,l,c))}return{suppressCombatFlag:s,runtimeDefines:r.join("\n"),priorityLogic:d.filter(Boolean).join("\n"),tokenReplacements:c,functionWrappers:u.filter(Boolean).join("\n\n")}}static emptySuppressCombatBuild(){return{runtimeDefines:"",priorityLogic:"",tokenReplacements:{},functionWrappers:""}}static buildHeldExpression(e){let{handler:t}=e,i=t.secondaryButton||t.primaryButton;return t.secondaryButton?`${(0,l.$O)(t.primaryButton,t.device)} && ${(0,l.$O)(i,t.device)}`:(0,l.$O)(i,t.device)}static buildEarlyReturnExpression(e){let t=[];return e?.fire&&t.push("event_press(FIRE_BTN)"),e?.adsFire&&t.push("(get_val(ADS_BTN) && event_press(FIRE_BTN))"),e?.weaponSwap&&t.push("event_press(SWITCHWEAPON_BTN)"),e?.reload&&t.push("event_press(RELOAD_BTN)"),t.join(" || ")}static buildTimedSuppressCombatPriorityLogic(e,t,i,o){let a=i?`if (${i}) {
17        ${t} = 0;
18        ${e} = FALSE;
19    } else {
20        ${t} = ${t} - get_rtime();
21        if (${t} < 0) {
22            ${t} = 0;
23        }
24        ${e} = TRUE;
25    }`:`${t} = ${t} - get_rtime();
26    if (${t} < 0) {
27        ${t} = 0;
28    }
29    ${e} = TRUE;`,n=`if (${t} > 0) {
30    ${a}
31} else {
32    ${e} = FALSE;
33}`;return o?`if (!${o}) {
34    ${t} = 0;
35    ${e} = FALSE;
36} else ${n}`:n}static buildTimedSuppressCombatWrappers(e,t,i,o,a,n){let s=`${a} = ${i};
37    ${o} = TRUE;`,l=`${a} = 0;
38        ${o} = FALSE;`;if("loop"===t){let t=`${e.toggleFunctionName}User`,i=`${e.runFunctionName}User`;return n[e.tokenReplacements["{{TOGGLE_FUNCTION}}"]]=t,n[e.tokenReplacements["{{RUN_FUNCTION}}"]]=i,`function ${e.toggleFunctionName}() {
39    ${t}();
40    if (${e.stateVariableName}) {
41        ${s}
42    } else {
43        ${l}
44    }
45}
46
47function ${e.runFunctionName}() {
48    ${i}();
49}`}if("while-held"===t){let t=`${e.runFunctionName}User`;return n[e.tokenReplacements["{{RUN_FUNCTION}}"]]=t,`function ${e.runFunctionName}() {
50    ${s}
51    ${t}();
52}`}let r=`${e.entryFunctionName}User`;return n[e.tokenReplacements["{{ENTRY_FUNCTION}}"]]=r,`function ${e.entryFunctionName}() {
53    ${s}
54    ${r}();
55}`}}},28111:(e,t,i)=>{i.d(t,{BK:()=>a,Bo:()=>T,Fd:()=>R,Lz:()=>y,P7:()=>d,YZ:()=>s,Ys:()=>S,ZV:()=>P,aO:()=>C,ap:()=>c,cP:()=>l,js:()=>h,mh:()=>f,nU:()=>p,nW:()=>u,oO:()=>v,s9:()=>m,sv:()=>r,uE:()=>A,w7:()=>n,wE:()=>$,ws:()=>E,zx:()=>_});var o=i(35789);let a=26,n=80,s=18,l={entryFunction:"{{ENTRY_FUNCTION}}",stateVariable:"{{STATE_VARIABLE}}",toggleFunction:"{{TOGGLE_FUNCTION}}",runFunction:"{{RUN_FUNCTION}}",comboName:"{{COMBO_NAME}}"},r={device:"gamepad",primaryButton:"PS5_UP",trigger:"tap",execution:"single",holdMs:o.Jb},d=50,u=12e4,c=3e4,m={mode:"none"},p={fire:!0,adsFire:!0,weaponSwap:!0,reload:!0},g=["none","while-combo","timed","timed-early-return","while-held","while-toggled"],S=e=>{if(!e||"object"!=typeof e)return{...m};let t=g.includes(e.mode)?e.mode:m.mode;if("none"===t)return{mode:t};let i={mode:t};if(("timed"===t||"timed-early-return"===t)&&(i.durationMs="number"==typeof e.durationMs?e.durationMs:c),"timed-early-return"===t){let t=e.earlyReturn&&"object"==typeof e.earlyReturn?e.earlyReturn:{};i.earlyReturn={fire:"boolean"==typeof t.fire?t.fire:p.fire,adsFire:"boolean"==typeof t.adsFire?t.adsFire:p.adsFire,weaponSwap:"boolean"==typeof t.weaponSwap?t.weaponSwap:p.weaponSwap,reload:"boolean"==typeof t.reload?t.reload:p.reload}}return i},b={embedded:"embedded","toggle-only":"toggleOnly"},h=`function ${l.entryFunction}() {
56    combo_run(${l.comboName});
57}`,_=`function ${l.toggleFunction}() {
58    ${l.stateVariable} = !${l.stateVariable};
59
60    if (!${l.stateVariable}) {
61        combo_stop(${l.comboName});
62    }
63}
64
65function ${l.runFunction}() {
66    if (get_val(PS5_SQUARE)) {
67        combo_run(${l.comboName});
68    } else {
69        combo_stop(${l.comboName});
70    }
71}`,f=`function ${l.runFunction}() {
72    if (get_val(PS5_SQUARE)) {
73        combo_run(${l.comboName});
74    } else {
75        combo_stop(${l.comboName});
76    }
77}`,E=`combo ${l.comboName} {
78    set_val(PS5_SQUARE, 100);
79    wait(40);
80    set_val(PS5_SQUARE, 0);
81    wait(40);
82}`,v=e=>("string"==typeof e?e:"").replace(/\r\n/g,"\n").trim(),A=e=>{let t=e.replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("");return t?/^[A-Za-z]/.test(t)?t:`Custom${t}`:"CustomMod"},y=(e,t,i)=>{let o=A(e),a=`${b[t]}${o}`,n=2;for(;i.includes(a);)a=`${b[t]}${o}${n}`,n+=1;return a},P=(e,t)=>Object.entries(t).reduce((e,[t,i])=>e.split(t).join(i),e),T=()=>new Date().toISOString(),$=e=>/combo_run\s*\(/.test(e)||/combo_stop\s*\(/.test(e),R=e=>{let t=S(e.suppressCombat),i=new Blob([JSON.stringify({tunezMod:"1.0",name:e.name,note:e.note,tag:e.tag,type:e.type,handler:e.handler,..."none"!==t.mode&&{suppressCombat:t},function:e.functionCode,combo:e.comboCode,..."toggle-only"===e.type&&{activeByDefault:e.activeByDefault}},null,2)],{type:"application/json"}),o=URL.createObjectURL(i),a=document.createElement("a");a.href=o,a.download=`${A(e.name)}
82.tunezmod.json`,a.click(),URL.revokeObjectURL(o)},C=e=>Object.values(e||{}).map(e=>{let t=e.tag||"";return"toggle-only"===(e.type||"embedded")?{...e,type:"toggle-only",tag:t,activeByDefault:"activeByDefault"in e&&(e.activeByDefault??!1),suppressCombat:S(e.suppressCombat)}:{...e,type:"embedded",tag:t,suppressCombat:S(e.suppressCombat)}}).sort((e,t)=>e.name.localeCompare(t.name))},32865:(e,t,i)=>{i.d(t,{$O:()=>r,Mz:()=>n,Vv:()=>c,YI:()=>l,h5:()=>s,pH:()=>d,r0:()=>u});var o=i(35789),a=i(51152);let n=(e,t=4)=>{let i=" ".repeat(t);return e.split("\n").map(e=>""===e.trim()?"":`${i}${e}`).join("\n")},s=(e,t)=>"TRUE"===e?t:`${e} && ${t}`,l=(e,t)=>"TRUE"===t?e:`${e} && ${t}`,r=(e,t)=>{if("keyboard"!==t)return`get_val(${e})`;let i=(0,a.rM)(e);return(0,a.jX)(i)?`get_modifiers(${i})`:`get_keyboard(${i})`},d="embeddedGlobalTime",u=`define EMBEDDED_MULTI_TAP_WINDOW = ${o.EJ};`,c=`${d} = ${d} + get_rtime();`},35789:(e,t,i)=>{i.d(t,{B7:()=>n,EJ:()=>c,Jb:()=>m,VB:()=>u,Y7:()=>r,cW:()=>d,jr:()=>s,w3:()=>a,y$:()=>o});let o=["tap","double-tap","triple-tap","hold","held"],a=["single","loop","while-held"],n={tap:"Tap","double-tap":"Double Tap","triple-tap":"Triple Tap",hold:"Hold",held:"Held"},s={single:"Single",loop:"Loop","while-held":"While Held"},l=e=>e.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),r=e=>{let t=(e||"").trim().toLowerCase();return n[t]||l(t||"tap")},d=e=>{let t=(e||"").trim().toLowerCase();return s[t]||l(t||"single")},u=e=>{let t=(e||"").trim();return t?l(t.toLowerCase()):"Auto"},c=300,m=200},36459:(e,t,i)=>{i.d(t,{Kb:()=>c,YL:()=>u,_g:()=>r,tT:()=>d,xx:()=>a});var o=i(90012);let a=e=>"xbox"===e?"xbox":"playstation",n={...o.kL,PS5_PS:"PS",PS5_TOUCHPAD:"TOUCHPAD",PS5_RX:"Right stick X",PS5_RY:"Right stick Y",PS5_LX:"Left stick X",PS5_LY:"Left stick Y"},s={...n,PS5_PS:"Xbox",PS5_SHARE:"View",PS5_OPTIONS:"Menu",PS5_R1:"RB",PS5_R2:"RT",PS5_R3:"RS",PS5_L1:"LB",PS5_L2:"LT",PS5_L3:"LS",PS5_TRIANGLE:"Y",PS5_CIRCLE:"B",PS5_CROSS:"A",PS5_SQUARE:"X",PS5_TOUCHPAD:"Touchpad (PlayStation)"},l={...n,PS5_CROSS:"Cross",PS5_CIRCLE:"Circle",PS5_SQUARE:"Square",PS5_TRIANGLE:"Triangle",PS5_SHARE:"Share",PS5_OPTIONS:"Options",PS5_TOUCHPAD:"Touchpad"},r=(e="playstation")=>"xbox"===e?s:n;function d(e,t="playstation"){let i=e in o.gy?e:`PS5_${e}`;return r(t)[i]||e}function u(e,t,i="playstation"){let a=o.G.indexOf(e),n=a<0?e:(o.tk[t]||o.tk[0])[a];if(["PS5_UP","PS5_DOWN","PS5_LEFT","PS5_RIGHT"].includes(n)){let e=n.slice(4).toLowerCase();return`D-Pad ${e[0].toUpperCase()}${e.slice(1)}`}return("xbox"===i?s:l)[n]||n}function c(e="playstation"){return Object.keys(o.gy).map(t=>/^PS5_[RL][XY]$/.test(t)?`STICK_${t.slice(4)}`:"PS5_TOUCHPAD"===t?"TOUCHPAD":d(t,e).toUpperCase())}},42450:(e,t,i)=>{i.d(t,{ConfigProvider:()=>g,U:()=>S});var o=i(95155),a=i(12115),n=i(96795),s=i(36459),l=i(86831),r=i(66609),d=i(95168),u=i(28111),c=i(63226);let m=(0,a.createContext)(void 0),p=async e=>{let t=await e.json().catch(()=>null),i="string"==typeof t?.error?t.error:null;if(401===e.status){let t=Error("Session expired");return t.status=e.status,t.retryable=!1,t.description="Please sign in again to save your changes.",t}if(402===e.status){let t=Error("Subscription required");return t.status=e.status,t.retryable=!1,t.description=i||"Activate your subscription to create new scripts or custom mods.",t}let o=Error(i||"Sync failed");return o.status=e.status,o.retryable=!0,o.description="Connection lost. Changes will be lost if you refresh.",o},g=({children:e})=>{let[t,i]=(0,a.useState)(c.ru),[g,S]=(0,a.useState)("library"),[b,h]=(0,a.useState)(!1),[_,f]=(0,a.useState)(!1),[E,v]=(0,a.useState)(null),{data:A,isPending:y}=(0,l.wV)(),P=(0,a.useRef)(null),T=(0,a.useRef)(""),$=(0,a.useRef)(!1),R=(0,a.useRef)(t);(0,a.useEffect)(()=>{R.current=t},[t]);let C=y||!!A&&!b;(0,a.useEffect)(()=>{if(!A){b&&(i((0,c.ru)()),h(!1));return}b||(async()=>{let e=R.current;try{let t=await fetch("/api/scripts/sync");if(!t.ok)throw Error("Failed to fetch config");let{config:o}=await t.json();if(o){let e=(0,c.nh)(o);i(e),T.current=JSON.stringify(e)}else T.current=JSON.stringify(e);h(!0)}catch(e){console.error("Initial cloud sync failed:",e),v("Failed to load your scripts. Please refresh the page."),r.oR.error("Failed to load scripts",{description:"Please refresh the page to try again.",duration:1/0})}})()},[A,b]);let L=a.useCallback(async e=>{f(!0),v(null);try{let t=await fetch("/api/scripts/sync",{method:"POST",body:JSON.stringify({data:JSON.parse(e)}),headers:{"Content-Type":"application/json"}});if(!t.ok)throw await p(t);f(!1),T.current=e,$.current||r.oR.success("Changes saved",{id:"sync-status"}),$.current=!1}catch(i){$.current=!1;let e=i instanceof Error?i.message:"Connection lost",t=!1!==i.retryable;v(e),f(!1),r.oR.error("Connection lost"===e||t?"Sync error":e,{id:"sync-status",description:i.description||"Connection lost. Changes will be lost if you refresh.",duration:5e3,action:t?{label:"Retry",onClick:()=>L(JSON.stringify(R.current))}:void 0})}},[]),N=a.useCallback(()=>{let e=JSON.stringify(R.current);e!==T.current&&L(e)},[L]);(0,a.useEffect)(()=>
82{if(!A||!b)return;let e=JSON.stringify(t);if(e===T.current)return;P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{L(e)},2e3);let i=t=>{e!==T.current&&(t.preventDefault(),t.returnValue="")};return window.addEventListener("beforeunload",i),()=>{P.current&&clearTimeout(P.current),window.removeEventListener("beforeunload",i)}},[t,A,b,L]);let M=(0,a.useMemo)(()=>(0,c.Jl)(t),[t]),w=(0,a.useMemo)(()=>(0,c.py)(t),[t]),I=(0,a.useMemo)(()=>(0,c.yx)(t),[t]),B=(0,a.useMemo)(()=>(0,c.Vp)(t),[t]),k=(0,a.useMemo)(()=>(0,c.zS)(t),[t]),F=(0,a.useMemo)(()=>t.customMods||{},[t]),O=(0,a.useMemo)(()=>(0,d.ag)(F),[F]),D=(0,a.useMemo)(()=>(0,d.hs)(B,F),[B,F]),U=e=>{$.current=!1,i(t=>(0,c.w2)(t,e))},K=e=>{$.current=!1,i(t=>({...t,customMods:e(t.customMods||{})}))},H=e=>{i(t=>(0,c.lW)(t,e))},Y=(e,t="",o,a)=>{let n=w.id;return i(i=>{let s=(0,c.r8)(i,e,t,o,a);return n=s.activeScriptPresetId,s}),n},V=(e,t,o="",a,n)=>{i(i=>(0,c.jS)(i,e,t,o,a,n))},j=()=>{i(e=>(0,c.nd)(e))},x=()=>{i(e=>(0,c.vt)(e))},G=e=>{i(t=>(0,c.gi)(t,e))},W=e=>{i(t=>(0,c.C9)(t,e))},J=e=>{i(t=>(0,c.bo)(t,e))},Q=(e,t,o,a,n)=>{let s="";return i(i=>{let l={...i.customMods};a.forEach(e=>{let t=l[e.id];(!t||e.updatedAt>=t.updatedAt)&&(l[e.id]=e)});let r=(0,c.zZ)(e,o,{notes:t,...n});return s=r.id,{...i,scriptPresets:{...i.scriptPresets,[r.id]:r},customMods:l}}),s},z=(e,t)=>{i(i=>{let o=i.scriptPresets[e];return o?{...i,scriptPresets:{...i.scriptPresets,[e]:{...o,...t}}}:i})},X=a.useCallback(()=>{i(e=>e.onboardingCompleted&&"completed"===e.onboardingStatus?e:($.current=!0,{...e,onboardingCompleted:!0,onboardingStatus:"completed"}))},[]),q=a.useCallback(e=>{i(t=>t.onboardingCompleted&&t.onboardingStatus===e?t:($.current=!0,{...t,onboardingCompleted:!0,onboardingStatus:e}))},[]),Z=e=>{U(t=>{let i=t.mods[e]||{enabled:!1,settings:{},activation:{button:"NONE",editable:!1}};return{...t,mods:{...t.mods,[e]:{...i,enabled:!i.enabled,activation:i.activation||{button:"NONE",editable:!1}}}}})},ee=e=>{U(t=>{let i=t.customModStates?.[e];return F[e]?{...t,customModStates:{...t.customModStates,[e]:{enabled:!i?.enabled}}}:t})},et=(e,t,i)=>{U(o=>{let a=o.mods[e]||{enabled:!1,settings:{},activation:{button:"NONE",editable:!1}};return{...o,mods:{...o.mods,[e]:{...a,settings:{...a.settings,[t]:i},activation:a.activation||{button:"NONE",editable:!1}}}}})},ei=(e,t)=>{U(i=>{let o=i.mods[e]||{enabled:!1,settings:{},activation:{button:"NONE",editable:!1}};return{...i,mods:{...i.mods,[e]:{...o,settings:{...o.settings,...t}}}}})},eo=(e,t)=>{U(i=>{let o=i.mods[e]||{enabled:!1,settings:{},activation:{button:"NONE",editable:!1}};return{...i,mods:{...i.mods,[e]:{...o,handler:t}}}})},ea=(e,t,i)=>{U(o=>{let a=o.mods[e]||{enabled:!1,settings:{},activation:{button:"NONE",editable:!1}},n=a.activation||{button:"NONE",editable:!1};return{...o,mods:{...o.mods,[e]:{...a,activation:{...n,[t]:i}}}}})},en=e=>{U(t=>({...t,buttonLayout:e}))},es=e=>{let t=(0,u.Lz)(e.name,e.type,Object.keys(F)),i=(0,u.Bo)(),o={...e,id:t,createdAt:i,updatedAt:i};return K(e=>({...e,[t]:o})),U(i=>({...i,customModStates:{...i.customModStates,[t]:{enabled:e.enabled}}})),t},el=(e,t)=>
82{let o=F[e];if(!o)return;let a=(0,u.Lz)(t.name,t.type,Object.keys(F).filter(t=>t!==e)),n={...t,id:a,createdAt:o.createdAt,updatedAt:(0,u.Bo)()};a===e?K(t=>({...t,[e]:n})):i(t=>{let i={...t.customMods};delete i[e],i[a]=n;let o=t=>{if(!t.customModStates?.[e])return t;let i={...t.customModStates};return i[a]=i[e],delete i[e],{...t,customModStates:i}},s=Object.fromEntries(Object.entries(t.scriptPresets).map(([e,t])=>[e,{...t,data:o(t.data)}]));return{...t,customMods:i,workingCopy:o(t.workingCopy),scriptPresets:s}})},er=e=>{F[e]&&(K(t=>{let i={...t};return delete i[e],i}),i(t=>{let i=t=>{if(!t.customModStates?.[e])return t;let i={...t.customModStates};return delete i[e],{...t,customModStates:i}},o=Object.fromEntries(Object.entries(t.scriptPresets).map(([e,t])=>[e,{...t,data:i(t.data)}]));return{...t,workingCopy:i(t.workingCopy),scriptPresets:o}}))},ed=(0,s.xx)(t.preferences?.controllerLabels),eu=e=>{i(t=>({...t,preferences:{...t.preferences,controllerLabels:(0,s.xx)(e)}}))},ec=e=>{U(()=>e)},em=()=>{let e={};D.forEach(t=>{let i=B.mods[t.id];i&&(e[t.id]={enabled:i.enabled,settings:i.settings,activation:i.activation})});let t=(0,d.KG)(B,F).reduce((e,t)=>(e[t.id]={id:t.id,name:t.name,type:t.type,enabled:t.enabled},e),{});return JSON.stringify({builtIn:B.core,mods:e,customMods:t},null,2)},ep=(0,a.useMemo)(()=>({controllerLabels:ed,updateControllerLabels:eu,config:B,enabledMods:D,customMods:O,onboardingCompleted:t.onboardingCompleted||!1,onboardingStatus:t.onboardingStatus||"not_started",currentView:g,scriptPresets:M,activeScriptPreset:w,activeScriptPresetId:t.activeScriptPresetId,pinnedScriptPresets:I,scriptPresetLimit:c.Og,canCreateScriptPreset:M.length<c.Og,workingCopyDirty:k,isWorkspaceInitializing:C,setCurrentView:S,activateScriptPreset:H,createScriptPreset:Y,updateScriptPresetDetails:V,updateActiveScriptPreset:j,resetWorkingCopy:x,deleteScriptPreset:G,duplicateScriptPreset:W,togglePinnedScriptPreset:J,importScriptPreset:Q,updateScriptPresetLoadoutMetadata:z,markOnboardingCompleted:X,markOnboardingFinished:q,toggleMod:Z,toggleCustomMod:ee,updateSetting:et,updateModSettings:ei,updateModHandler:eo,updateActivation:ea,createCustomMod:es,updateCustomMod:el,deleteCustomMod:er,updateButtonLayout:en,updateConfig:ec,getRawConfig:em,isSyncing:_,syncError:E,retrySync:N}),[ed,B,D,O,t.onboardingCompleted,t.onboardingStatus,g,M,w,t.activeScriptPresetId,I,k,C,_,E]);return(0,o.jsx)(m.Provider,{value:ep,children:(0,o.jsx)(n.x.Provider,{value:ed,children:e})})},S=()=>{let e=(0,a.useContext)(m);if(!e)throw Error("useConfig must be used within a ConfigProvider");return e}},51152:(e,t,i)=>{i.d(t,{Dq:()=>g,Ey:()=>m,GB:()=>c,Gm:()=>E,J3:()=>n,eI:()=>s,hE:()=>p,jX:()=>v,k8:()=>f,kX:()=>y,rM:()=>_,vl:()=>h});var o=i(36459),a=i(90012);let n=["gamepad","keyboard"],s={gamepad:"Gamepad",keyboard:"Keyboard"},l=Object.keys(a.kL),r=[{code:"KEY_A",label:"A",value:4},{code:"KEY_B",label:"B",value:5},{code:"KEY_C",label:"C",value:6},{code:"KEY_D",label:"D",value:7},{code:"KEY_E",label:"E",value:8},{code:"KEY_F",label:"F",value:9},{code:"KEY_G",label:"G",value:10},{code:"KEY_H",label:"H",value:11},{code:"KEY_I",label:"I",value:12},{code:"KEY_J",label:"J",value:13},{code:"KEY_K",label:"K",value:14},{code:"KEY_L",label:"L",value:15},{code:"KEY_M",label:"M",value:16},{code:"KEY_N",label:"N",value:17},{code:"KEY_O",label:"O",value:18},{code:"KEY_P",label:"P",value:19},{code:"KEY_Q",label:"Q",value:20},{code:"KEY_R",label:"R",value:21},{code:"KEY_S",label:"S",value:22},{code:"KEY_T",label:"T",value:23},{code:"KEY_U",label:"U",value:24},{code:"KEY_V",label:"V",value:25},{code:"KEY_W",label:"W",value:26},{code:"KEY_X",label:"X",value:27},{code:"KEY_Y",label:"Y",value:28},{code:"KEY_Z",label:"Z",value:29},{code:"KEY_1",label:"1",value:30},{code:"KEY_2",label:"2",value:31},{code:"KEY_3",label:"3",value:32},{code:"KEY_4",label:"4",value:33},{code:"KEY_5",label:"5",value:34},{code:"KEY_6",label:"6",value:35},{code:"KEY_7",label:"7",value:36},{code:"KEY_8",label:"8",value:37},{code:"KEY_9",label:"9",value:38},{code:"KEY_0",label:"0",value:39},{code:"KEY_ENTER",label:"Enter",value:40}
82,{code:"KEY_ESC",label:"Esc",value:41},{code:"KEY_BACKSPACE",label:"Backspace",value:42},{code:"KEY_TAB",label:"Tab",value:43},{code:"KEY_SPACE",label:"Space",value:44},{code:"KEY_MINUS",label:"-",value:45},{code:"KEY_EQUAL",label:"=",value:46},{code:"KEY_LEFTBRACE",label:"[",value:47},{code:"KEY_RIGHTBRACE",label:"]",value:48},{code:"KEY_BACKSLASH",label:"\\",value:49},{code:"KEY_HASHTILDE",label:"# / ~",value:50},{code:"KEY_SEMICOLON",label:";",value:51},{code:"KEY_APOSTROPHE",label:"'",value:52},{code:"KEY_GRAVE",label:"`",value:53},{code:"KEY_COMMA",label:",",value:54},{code:"KEY_DOT",label:".",value:55},{code:"KEY_SLASH",label:"/",value:56},{code:"KEY_CAPSLOCK",label:"Caps Lock",value:57},{code:"KEY_F1",label:"F1",value:58},{code:"KEY_F2",label:"F2",value:59},{code:"KEY_F3",label:"F3",value:60},{code:"KEY_F4",label:"F4",value:61},{code:"KEY_F5",label:"F5",value:62},{code:"KEY_F6",label:"F6",value:63},{code:"KEY_F7",label:"F7",value:64},{code:"KEY_F8",label:"F8",value:65},{code:"KEY_F9",label:"F9",value:66},{code:"KEY_F10",label:"F10",value:67},{code:"KEY_F11",label:"F11",value:68},{code:"KEY_F12",label:"F12",value:69},{code:"KEY_SYSRQ",label:"SysRq",value:70},{code:"KEY_SCROLLLOCK",label:"Scroll Lock",value:71},{code:"KEY_PAUSE",label:"Pause",value:72},{code:"KEY_INSERT",label:"Insert",value:73},{code:"KEY_HOME",label:"Home",value:74},{code:"KEY_PAGEUP",label:"Page Up",value:75},{code:"KEY_DELETE",label:"Delete",value:76},{code:"KEY_END",label:"End",value:77},{code:"KEY_PAGEDOWN",label:"Page Down",value:78},{code:"KEY_RIGHT",label:"Right Arrow",value:79},{code:"KEY_LEFT",label:"Left Arrow",value:80},{code:"KEY_DOWN",label:"Down Arrow",value:81},{code:"KEY_UP",label:"Up Arrow",value:82},{code:"KEY_NUMLOCK",label:"Num Lock",value:83},{code:"KEY_KPSLASH",label:"Numpad /",value:84},{code:"KEY_KPASTERISK",label:"Numpad *",value:85},{code:"KEY_KPMINUS",label:"Numpad -",value:86},{code:"KEY_KPPLUS",label:"Numpad +",value:87},{code:"KEY_KPENTER",label:"Numpad Enter",value:88},{code:"KEY_KP1",label:"Numpad 1",value:89},{code:"KEY_KP2",label:"Numpad 2",value:90},{code:"KEY_KP3",label:"Numpad 3",value:91},{code:"KEY_KP4",label:"Numpad 4",value:92},{code:"KEY_KP5",label:"Numpad 5",value:93},{code:"KEY_KP6",label:"Numpad 6",value:94},{code:"KEY_KP7",label:"Numpad 7",value:95},{code:"KEY_KP8",label:"Numpad 8",value:96},{code:"KEY_KP9",label:"Numpad 9",value:97},{code:"KEY_KP0",label:"Numpad 0",value:98},{code:"KEY_KPDOT",label:"Numpad .",value:99},{code:"KEY_102ND",label:"102nd Key",value:100},{code:"KEY_COMPOSE",label:"Compose",value:101},{code:"KEY_POWER",label:"Power",value:102},{code:"KEY_KPEQUAL",label:"Numpad =",value:103},{code:"KEY_F13",label:"F13",value:104},{code:"KEY_F14",label:"F14",value:105},{code:"KEY_F15",label:"F15",value:106},{code:"KEY_F16",label:"F16",value:107},{code:"KEY_F17",label:"F17",value:108},{code:"KEY_F18",label:"F18",value:109},{code:"KEY_F19",label:"F19",value:110},{code:"KEY_F20",label:"F20",value:111},{code:"KEY_F21",label:"F21",value:112},{code:"KEY_F22",label:"F22",value:113},{code:"KEY_F23",label:"F23",value:114},{code:"KEY_F24",label:"F24",value:115},{code:"KEY_OPEN",label:"Open",value:116},{code:"KEY_HELP",label:"Help",value:117},{code:"KEY_PROPS",label:"Props",value:118},{code:"KEY_FRONT",label:"Front",value:119},{code:"KEY_STOP",label:"Stop",value:120},{code:"KEY_AGAIN",label:"Again",value:121},{code:"KEY_UNDO",label:"Undo",value:122},{code:"KEY_CUT",label:"Cut",value:123},{code:"KEY_COPY",label:"Copy",value:124},{code:"KEY_PASTE",label:"Paste",value:125},{code:"KEY_FIND",label:"Find",value:126},{code:"KEY_MUTE",label:"Mute",value:127},{code:"KEY_VOLUMEUP",label:"Volume Up",value:128},{code:"KEY_VOLUMEDOWN",label:"Volume Down",value:129},{code:"KEY_KPCOMMA",label:"Numpad Comma",value:133},{code:"KEY_RO",label:"RO",value:135},{code:"KEY_KATAKANAHIRAGANA",label:"Katakana / Hiragana",value:136},{code:"KEY_YEN",label:"Yen",value:137},{code:"KEY_HENKAN",label:"Henkan",value:138},{code:"KEY_MUHENKAN",label:"Muhenkan",value:139},{code:"KEY_KPJPCOMMA",label:"Numpad JP Comma",value:140},{code:"KEY_HANGEUL",label:"Hangeul",value:144},{code:"KEY_HANJA",label:"Hanja",value:145},{code:"KEY_KATAKANA",label:"Katakana",value:146},{code:"KEY_HIRAGANA",label:"Hiragana",value:147},{code:"KEY_ZENKAKUHANKAKU",label:"Zenkaku / Hankaku",value:148},{code:"KEY_KPLEFTPAREN",label:"Numpad (",value:182},{code:"KEY_KPRIGHTPAREN",label:"Numpad )",value:183},{code:"KEY_LEFTCTRL",label:"Left Ctrl",value:224},{code:"KEY_LEFTSHIFT",label:"Left Shift",value:225},{code:"KEY_LEFTALT",label:"Left Alt",value:226},{code:"KEY_LEFTMETA",label:"Left Meta",value:227},{code:"KEY_RIGHTCTRL",label:"Right Ctrl",value:228},{code:"KEY_RIGHTSHIFT",label:"Right Shift",value:229},{code:"KEY_RIGHTALT",label:"Right Alt",value:230}
82,{code:"KEY_RIGHTMETA",label:"Right Meta",value:231},{code:"KEY_MEDIA_PLAYPAUSE",label:"Media Play / Pause",value:232},{code:"KEY_MEDIA_STOPCD",label:"Media Stop",value:233},{code:"KEY_MEDIA_PREVIOUSSONG",label:"Media Previous Song",value:234},{code:"KEY_MEDIA_NEXTSONG",label:"Media Next Song",value:235},{code:"KEY_MEDIA_EJECTCD",label:"Media Eject",value:236},{code:"KEY_MEDIA_VOLUMEUP",label:"Media Volume Up",value:237},{code:"KEY_MEDIA_VOLUMEDOWN",label:"Media Volume Down",value:238},{code:"KEY_MEDIA_MUTE",label:"Media Mute",value:239},{code:"KEY_MEDIA_WWW",label:"Media WWW",value:240},{code:"KEY_MEDIA_BACK",label:"Media Back",value:241},{code:"KEY_MEDIA_FORWARD",label:"Media Forward",value:242},{code:"KEY_MEDIA_STOP",label:"Media Stop",value:243},{code:"KEY_MEDIA_FIND",label:"Media Find",value:244},{code:"KEY_MEDIA_SCROLLUP",label:"Media Scroll Up",value:245},{code:"KEY_MEDIA_SCROLLDOWN",label:"Media Scroll Down",value:246},{code:"KEY_MEDIA_EDIT",label:"Media Edit",value:247},{code:"KEY_MEDIA_SLEEP",label:"Media Sleep",value:248},{code:"KEY_MEDIA_COFFEE",label:"Media Coffee",value:249},{code:"KEY_MEDIA_REFRESH",label:"Media Refresh",value:250},{code:"KEY_MEDIA_CALC",label:"Media Calc",value:251}],d=[{code:"MOD_LCTRL",label:"Left Ctrl",value:1},{code:"MOD_LSHIFT",label:"Left Shift",value:2},{code:"MOD_LALT",label:"Left Alt",value:4},{code:"MOD_LGUI",label:"Left GUI",value:8},{code:"MOD_RCTRL",label:"Right Ctrl",value:16},{code:"MOD_RSHIFT",label:"Right Shift",value:32},{code:"MOD_RALT",label:"Right Alt",value:64},{code:"MOD_RGUI",label:"Right GUI",value:128}],u={MOD_LMETA:"MOD_LGUI",MOD_RMETA:"MOD_RGUI"},c=r.map(e=>e.code);Object.fromEntries(r.map(e=>[e.code,e.value]));let m=Object.fromEntries(r.map(e=>[e.code,e.label])),p=d.map(e=>e.code);Object.fromEntries(d.map(e=>[e.code,e.value]));let g=Object.fromEntries(d.map(e=>[e.code,e.label])),S=Object.fromEntries(Object.entries(u).map(([e,t])=>[e,g[t]])),b={...a.kL,...m,...g,...S},h={gamepad:l,keyboard:[...p,...c]},_=e=>u[e]||e,f=(e,t="playstation")=>{let i=_(e);return E(i)?b[i]||e:a.cy[i]||(0,o.tT)(i,t)},E=e=>{let t=_(e);return t.startsWith("KEY_")||t.startsWith("MOD_")},v=e=>_(e).startsWith("MOD_"),A=new Set(["KEY_LEFTCTRL","KEY_LEFTSHIFT","KEY_LEFTALT","KEY_LEFTMETA","KEY_RIGHTCTRL","KEY_RIGHTSHIFT","KEY_RIGHTALT","KEY_RIGHTMETA"]),y=(e,t="playstation")=>{let i=_(e),o=f(i,t);return v(i)?`${o} (MOD)`:A.has(i)?`${o} (KEY)`:o}},53556:(e,t,i)=>{i.d(t,{$f:()=>o,o3:()=>n,sn:()=>a});let o="other",a=[{id:"marathon",name:"Marathon",iconSrc:"/games/marathon.png"},{id:"arc-raiders",name:"Arc Raiders",iconSrc:"/games/arc-raiders.ico"},{id:"pubg",name:"PUBG",iconSrc:"/logo.png"},{id:o,name:"Other",iconSrc:"/logo.png"}],n=e=>(a.find(t=>t.id===e)||a[a.length-1]).id},60328:(e,t,i)=>{i.d(t,{P:()=>a,S:()=>l});var o=i(79807);let a={version:"1.0.0",profile:0,buttonLayout:0,core:{antiRecoil:{p1:{enabled:!1,vertical:22,horizontal:0,initialEnabled:!0,initialTimeMs:100,initialVertical:4,initialHorizontal:0,rampEnabled:!0,rampTimeMs:150,decayEnabled:!1,decayStartMs:900,decayTimeMs:700,decayFloorPercent:85,aimOverrideEnabled:!0,aimOverrideThreshold:25,aimOverrideStrength:50},p2:{enabled:!1,vertical:20,horizontal:0,initialEnabled:!0,initialTimeMs:100,initialVertical:4,initialHorizontal:0,rampEnabled:!0,rampTimeMs:150,decayEnabled:!1,decayStartMs:900,decayTimeMs:700,decayFloorPercent:85,aimOverrideEnabled:!0,aimOverrideThreshold:25,aimOverrideStrength:50},activation:"Ads + Fire",mode:!1,humanizer:!0},aimAssist:{enabled:!1,rightShape:"Circular",leftShape:"Circular",leftSize:10,leftSpeed:20,rightSize:5,rightSpeed:42,adsLeftSize:0,adsLeftSpeed:1,adsRightSize:0,adsRightSpeed:0,boostStrength:18,smoothingFactor:3,aimLockStrength:100,activeOnAds:!0,activationRangeMin:0,activationRangeMax:100},rapidFire:{p1:{enabled:!1,shotsPerSecond:10,holdTime:40},p2:{enabled:!1,shotsPerSecond:10,holdTime:40},humanizer:!0,activation:"ADS + Fire"},system:{inverted:!1,noRumble:!1,weaponTracking:{holsterEnabled:!1,holsterTime:250,resetProfileOnHolster:!1,turboKnifeEnabled:!1,turboKnifeButton:"FIRE_BTN",utilityButtons:[],utilityWheelEnabled:!1,utilityWheelButton:"PS5_L1",utilityWheelHoldTime:250,returnMechanic:"swap",returnProfile:"keep"}
82,weaponProfiles:{enabled:!1,showDetails:!1,gameId:null,primaryWeaponId:null,secondaryWeaponId:null,values:{}},keyboardCommandShortcuts:{enabled:!0,bindings:[]},gamepadCommandShortcuts:{bindings:[{id:"default-reset-profile-1",enabled:!0,actionId:"resetProfile1",modifier:"PS5_SHARE",button:"SWITCHWEAPON_BTN"},{id:"default-reset-profile-2",enabled:!0,actionId:"resetProfile2",modifier:"PS5_SHARE",button:"CROUCH_BTN"},{id:"default-rapid-fire-toggle",enabled:!0,actionId:"rapidFire.toggle",modifier:"ADS_BTN",button:"PS5_RIGHT"},{id:"default-anti-recoil-setup",enabled:!0,actionId:"antiRecoil.setup",modifier:"ADS_BTN",button:"PS5_LEFT"}]},passiveMode:{activateModifier:"PS5_R2",activateButton:"PS5_RIGHT",deactivateButton:"PS5_SQUARE"}}},mods:{},customModStates:{},lastUpdated:""},n=e=>{let t={};for(let i of Object.keys(e)){let a=e[i];if(!a)continue;let n=o.s.getModById(i);if(!n){t[i]=a;continue}let s=a.settings||{},l={...s};if("CrouchShot"===i&&"active"in s){let e=s.active;"profile1"in l||(l.profile1=e),"profile2"in l||(l.profile2=e)}let r={};for(let e of n.settings){let t=l[e.id];"list"===e.type&&"number"==typeof e.default&&"string"==typeof t&&(t=isNaN(Number(t))?e.default:Number(t)),"number"===e.type&&"string"==typeof t&&(t=isNaN(Number(t))?e.default:Number(t)),"toggle"===e.type&&("number"==typeof t&&(t=!!t),"string"==typeof t&&(t="true"===t||"1"===t)),r[e.id]=void 0!==t?t:e.default}t[i]={...a,settings:{...l,...r}}}return t},s=e=>{if("boolean"==typeof e)return e;if("number"==typeof e)return e>0;if("string"==typeof e){let t=e.trim().toLowerCase();return"true"===t||"1"===t||"on"===t||"yes"===t}return!1},l=(e,t)=>
82{if(!t.core)return{...e,...t,mods:{...e.mods,...n(t.mods||{})},customModStates:{...e.customModStates,...t.customModStates||{}}};let i=t.core.rapidFire,o=!i||"p1"in i||"p2"in i?void 0:i,a=(e=>{if(!e||!("jumpShotP1"in e||"jumpShotP2"in e||"jumpShotMode"in e||"jumpShotDelay"in e))return{};let t=s(e.jumpShotP1),i=s(e.jumpShotP2),o=+("once"===e.jumpShotMode||1===e.jumpShotMode||"1"===e.jumpShotMode),a=Number(e.jumpShotDelay);return{JumpShot:{enabled:t||i,settings:{profile1:t,profile2:i,mode:o,delay:Number.isFinite(a)?Math.max(0,Math.min(1e3,Math.round(a))):200},activation:{button:"FIRE_BTN",editable:!1}}}})(t.core.system);return{...e,...t,mods:{...e.mods,...a,...n(t.mods||{})},customModStates:{...e.customModStates,...t.customModStates||{}},core:{...e.core,...t.core,antiRecoil:{...e.core.antiRecoil,...t.core.antiRecoil||{},p1:{...e.core.antiRecoil.p1,...t.core.antiRecoil?.p1||{}},p2:{...e.core.antiRecoil.p2,...t.core.antiRecoil?.p2||{}}},aimAssist:{...e.core.aimAssist,...(e=>{if(!e)return{};let t={...e};return delete t.headShotStrength,delete t.headShotTimer,t})(t.core.aimAssist)},rapidFire:o?{...e.core.rapidFire,p1:{...e.core.rapidFire.p1,...o},p2:{...e.core.rapidFire.p2,...o}}:{...e.core.rapidFire,...i||{},p1:{...e.core.rapidFire.p1,...i?.p1||{}},p2:{...e.core.rapidFire.p2,...i?.p2||{}}},system:{...e.core.system,...t.core.system||{},weaponTracking:{...e.core.system.weaponTracking,...t.core.system?.weaponTracking||{}},weaponProfiles:{...e.core.system.weaponProfiles,...t.core.system?.weaponProfiles||{},values:{...e.core.system.weaponProfiles.values,...t.core.system?.weaponProfiles?.values||{}}},keyboardCommandShortcuts:{...e.core.system.keyboardCommandShortcuts,...t.core.system?.keyboardCommandShortcuts||{},bindings:t.core.system?.keyboardCommandShortcuts?.bindings||e.core.system.keyboardCommandShortcuts.bindings},gamepadCommandShortcuts:{...e.core.system.gamepadCommandShortcuts,...t.core.system?.gamepadCommandShortcuts||{},bindings:t.core.system?.gamepadCommandShortcuts?.bindings||e.core.system.gamepadCommandShortcuts.bindings},passiveMode:{...e.core.system.passiveMode,...t.core.system?.passiveMode||{}}}}}}},63226:(e,t,i)=>{i.d(t,{C9:()=>k,Jl:()=>$,Og:()=>m,Rp:()=>H,SE:()=>E,Vp:()=>C,W6:()=>u,a_:()=>v,bj:()=>K,bo:()=>D,gi:()=>F,j8:()=>c,jS:()=>I,lW:()=>O,nd:()=>M,nh:()=>T,py:()=>R,r8:()=>B,ru:()=>P,uG:()=>f,vt:()=>w,w2:()=>N,yx:()=>U,zS:()=>L,zZ:()=>A});var o=i(36459),a=i(53556),n=i(60328),s=i(79807),l=i(95168);let r={core:{...n.P.core,antiRecoil:{...n.P.core.antiRecoil,p1:{...n.P.core.antiRecoil.p1,enabled:!0,vertical:22,horizontal:0}},system:{...n.P.core.system,weaponTracking:{...n.P.core.system.weaponTracking,holsterEnabled:!0}}},mods:{AutoSprint:{enabled:!0,settings:{active:0,direction:0,mode:0,threshold:90}},HairTrigger:{enabled:!0,settings:{active:0,threshold:5}}},customModStates:{"onboarding-led-flash":{enabled:!0}}},d={id:"onboarding-led-flash",name:"LED Flash",note:"Hold Cross to cycle LED colors on Cronus Zen.",tag:"Visual",type:"embedded",enabled:!0,handler:{device:"gamepad",primaryButton:"PS5_CROSS",trigger:"hold",execution:"while-held",holdMs:300},functionCode:`function {{RUN_FUNCTION}}() {
83    combo_run({{COMBO_NAME}});
84}`,comboCode:`combo {{COMBO_NAME}} {
85    set_led(LED_1, 2); wait(150); reset_leds();
86    set_led(LED_2, 2); wait(150); reset_leds();
87    set_led(LED_3, 2); wait(150); reset_leds();
88    set_led(LED_4, 2); wait(150); reset_leds();
89}`,createdAt:"2025-01-01T00:00:00.000Z",updatedAt:"2025-01-01T00:00:00.000Z"},u="My Script",c="1.0.0",m=20,p="1.0.0",g=()=>new Date().toISOString(),S=e=>JSON.parse(JSON.stringify(e)),b=e=>Array.isArray(e)?e.map(b):e&&"object"==typeof e?Object.keys(e).sort().reduce((t,i)=>(t[i]=b(e[i]),t),{}):e,h=e=>(0,n.S)(n.P,e||{}),_=e=>("string"==typeof e?e.trim():"")||c,f=(e,t,i=new Date().toISOString())=>{let o=new Set(Object.entries(e.data.customModStates||{}).filter(([,e])=>e.enabled).map(([e])=>e)),n={...e.data};for(let t of(n.customModStates={},o))e.data.customModStates?.[t]&&(n.customModStates[t]=e.data.customModStates[t]);let s=t.filter(e=>o.has(e.id));return{tunezScript:"1.0",name:e.name,notes:e.notes,scriptVersion:_(e.scriptVersion),gameId:(0,a.o3)(e.gameId),data:n,customMods:s,exportedAt:i}},E=(e,t)=>{let i=f(e,t),o=e.name.trim().toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"")||"tunez-script",a=new Blob([JSON.stringify(i,null,2)],{type:"application/json"}),n=URL.createObjectURL(a),s=document.createElement("a");s.href=n,s.download=`${o}.tunezscript.json`,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(n)},v=e=>{if(!e||"object"!=typeof e||!("tunezScript"in e)||"1.0"!==e.tunezScript)throw Error("Invalid Tunez script file");let t="string"==typeof e.name?e.name:"Imported Script",i="string"==typeof e.notes?e.notes:"",o=_("string"==typeof e.scriptVersion?e.scriptVersion:void 0),n=(0,a.o3)("string"==typeof e.gameId?e.gameId:void 0);return{name:t,notes:i,scriptVersion:o,gameId:n,data:h(e.data),customMods:Array.isArray(e.customMods)?e.customMods:[]}},A=(e,t,i)=>{let o=g(),n=h(t);return{id:i?.id||(()=>{let e=globalThis.crypto?.randomUUID;if("function"==typeof e)return e.call(globalThis.crypto);let t=Math.random().toString(36).slice(2,12),i=Date.now().toString(36);return`preset_${i}_${t}`})(),name:e.trim()||u,notes:i?.notes?.trim()||"",scriptVersion:_(i?.scriptVersion),gameId:(0,a.o3)(i?.gameId||(0,a.o3)(n?.core?.system?.weaponProfiles?.gameId||a.$f)),data:{...S(n),lastUpdated:i?.updatedAt||o},isPinned:i?.isPinned??!1,createdAt:i?.createdAt||o,updatedAt:i?.updatedAt||o,loadoutId:i?.loadoutId,loadoutVersion:i?.loadoutVersion,authorId:i?.authorId,authorName:i?.authorName}},y=["not_started","completed","dismissed"],P=(e,t=u)=>{let i=A(t,e??r),o=e?{}:{[d.id]:{...d}};return{version:p,preferences:{controllerLabels:"playstation"},activeScriptPresetId:i.id,workingCopy:S(h(i.data)),scriptPresets:{[i.id]:i},customMods:o,onboardingCompleted:!1,onboardingStatus:"not_started"}},T=e=>{if(e&&"object"==typeof e&&"scriptPresets"in e&&null!==e&&"object"==typeof e.scriptPresets){let t,i=Object.values(e.scriptPresets||{}).map(e=>({...e,notes:e.notes?.trim()||"",scriptVersion:_(e.scriptVersion),gameId:(0,a.o3)(e.gameId),data:h(e.data)})).sort((e,t)=>
89e.createdAt.localeCompare(t.createdAt));if(0===i.length)return{...P(),preferences:{controllerLabels:(0,o.xx)(e.preferences?.controllerLabels)}};let n=i.reduce((e,t)=>(e[t.id]=t,e),{}),s=n[e.activeScriptPresetId]?e.activeScriptPresetId:i[0].id,l={};"customMods"in e&&e.customMods&&"object"==typeof e.customMods?Object.assign(l,e.customMods):i.forEach(e=>{let t=e.data.customMods;t&&Object.values(t).forEach(e=>{let t=l[e.id];(!t||e.updatedAt>t.updatedAt)&&(l[e.id]=e)})});let r=!("onboardingCompleted"in e)||!!e.onboardingCompleted,d=("string"==typeof(t=e.onboardingStatus)&&y.includes(t)?t:void 0)||(r?"dismissed":"not_started");return{version:e.version||p,preferences:{controllerLabels:(0,o.xx)(e.preferences?.controllerLabels)},activeScriptPresetId:s,workingCopy:S(h("workingCopy"in e&&e.workingCopy?e.workingCopy:n[s]?.data)),scriptPresets:n,customMods:l,onboardingCompleted:r,onboardingStatus:d}}return P(e)},$=e=>Object.values(e.scriptPresets).sort((e,t)=>{let i=e.createdAt.localeCompare(t.createdAt);return 0!==i?i:e.id.localeCompare(t.id)}),R=e=>{let t=e.scriptPresets[e.activeScriptPresetId];return t||$(e)[0]||A(u)},C=e=>S(h(e.workingCopy||R(e).data)),L=e=>{let t,i;return t=C(e),i=R(e).data,JSON.stringify(b(h(t)))!==JSON.stringify(b(h(i)))},N=(e,t)=>{let i=g(),o=h(t(C(e)));return{...e,workingCopy:{...o,lastUpdated:i}}},M=e=>{let t=R(e),i=g(),o={...C(e),lastUpdated:i};return{...e,workingCopy:o,scriptPresets:{...e.scriptPresets,[t.id]:{...t,data:o,updatedAt:i}}}},w=e=>({...e,workingCopy:S(h(R(e).data))}),I=(e,t,i,o="",n,s)=>{let l=e.scriptPresets[t];if(!l)return e;let r=g();return{...e,scriptPresets:{...e.scriptPresets,[t]:{...l,name:i.trim()||l.name,notes:o.trim(),scriptVersion:_(n??l.scriptVersion),gameId:(0,a.o3)(s??l.gameId),updatedAt:r}}}},B=(e,t,i="",o=c,a)=>{if(Object.keys(e.scriptPresets).length>=m)return e;let n=A(t,C(e),{notes:i,scriptVersion:o,gameId:a});return{...e,activeScriptPresetId:n.id,workingCopy:S(h(n.data)),scriptPresets:{...e.scriptPresets,[n.id]:n}}},k=(e,t)=>{if(Object.keys(e.scriptPresets).length>=m)return e;let i=e.scriptPresets[t];if(!i)return e;let o=A(((e,t)=>{let i=e.trim()||u,o=`${i} Copy`,a=new Set(t.map(e=>e.trim().toLowerCase()));if(!a.has(o.toLowerCase()))return o;let n=2;for(;a.has(`${o} ${n}`.toLowerCase());)n+=1;return`${o} ${n}`})(i.name,Object.values(e.scriptPresets).map(e=>e.name)),i.data,{notes:i.notes,scriptVersion:i.scriptVersion,gameId:i.gameId});return o.data=S(i.data),{...e,scriptPresets:{...e.scriptPresets,[o.id]:o}}},F=(e,t)=>{let i=Object.keys(e.scriptPresets);if(!e.scriptPresets[t]||i.length<=1)return e;let o={...e.scriptPresets};delete o[t];let a=$({...e,scriptPresets:o});return{...e,activeScriptPresetId:e.activeScriptPresetId===t?a[0].id:e.activeScriptPresetId,workingCopy:e.activeScriptPresetId===t?S(h(a[0].data)):e.workingCopy,scriptPresets:o}},O=(e,t)=>e.scriptPresets[t]?{...e,activeScriptPresetId:t,workingCopy:S(h(e.scriptPresets[t].data))}:e,D=(e,t)=>{let i=e.scriptPresets[t];return i?{...e,scriptPresets:{...e.scriptPresets,[t]:{...i,isPinned:!i.isPinned}}}:e},U=e=>$(e).filter(t=>t.isPinned&&t.id!==e.activeScriptPresetId).slice(0,3),K=(e,t={})=>(0,l.hs)(e,t).length,H=(e,t)=>{let i=[];return Object.entries(e.mods).forEach(([e,t])=>{if(!t.enabled)return;let o=s.s.getModById(e);o&&i.push(o.name)}),Object.entries(e.customModStates||{}).forEach(([e,o])=>{o.enabled&&t[e]&&i.push(t[e].name)}),[...new Set(i)]}},65198:(e,t,i)=>{i.d(t,{B7:()=>n,HN:()=>c,IX:()=>a,d7:()=>_,hI:()=>u,lo:()=>h,pJ:()=>p,vS:()=>m});var o=i(90012);let a=8,n=Object.keys(o.kL),s=new Set(n),l=(e,t,i,o,a=1)=>{let n=Number(e??t);return Number.isFinite(n)?Math.max(i,Math.min(o,Math.round(n/a)*a)):t},r=(e,t="NONE")=>"string"==typeof e&&s.has(e)?e:t,d=e=>+(!0===e||1===e||"1"===e);function u(e){if("string"!=typeof e)return[];try{let t=JSON.parse(e);if(!Array.isArray(t)||t.length>a)return[];return t.flatMap(e=>e&&"object"==typeof e&&("NONE"===e.button||s.has(e.button))&&(void 0===e.modifier||"NONE"===e.modifier||s.has(e.modifier))&&("press"===e.trigger||"hold"===e.trigger)?[{button:e.button,modifier:r(e.modifier),trigger:e.trigger,holdMs:l(e.holdMs,300,100,1e3)}]:[])}catch{return[]}}function c(e){return u(e).filter(e=>"NONE"!==e.button).map(e=>({button:e.button,modifier:"NONE",trigger:"press",holdMs:300}))}function m(e){return{selectionActions:u(e.selectionActions).filter(e=>"NONE"!==e.button).slice(0,1),exitActions:c(e.exitActions),active:d(e.active),autoThrow:d(e.autoThrow),ping:d(e.ping),throwButton:r(e.throwButton,"PS5_R2"),cookTime:l(e.cookTime,2500,100,4e3,50),afterThrow:l(e.afterThrow,0,0,1),pingTrigger:r(e.pingTrigger,"PS5_UP"),pingButton:r(e.pingButton),pingCondition:l(e.pingCondition,1,0,1),pingPattern:l(e.pingPattern,1,0,1),pingPress:l(e.pingPress,50,20,200),pingGap:l(e.pingGap,80,20,300)}}function p(e){let t=m(e);return t.exitActions.some(e=>e.button===t.throwButton)?"Choose exit buttons different from the throw button.":t.selectionActions.some(e=>"press"===e.trigger&&t.exitActions.some(t=>t.button===e.button))?"Choose exit buttons different from a press-based selection button.":"NONE"!==t.pingButton&&t.pingButton===t.throwButton?"Choose a ping output different from the throw button.":t.pingTrigger===t.throwButton?"Choose a ping trigger different from the throw button.":[...t.selectionActions,...t.exitActions].flatMap(e=>[e.button,e.modifier]).includes(t.pingTrigger)?"Choose a ping trigger different from the selection button, selection modifier and exit buttons.":null}let g=e=>"NONE"===e?"FALSE":`get_ival(${e}) > 50`,S=e=>"NONE"===e?"":` && ${g(e)}`,b=(e,t)=>"NONE"===e?"FALSE":`(${g(e)} && get_lval(${e}) <= 50${S(t)})`;function h(e){let t=p(e);if(t)throw Error(`Grenade Assist: ${t}`);let i=m(e),o=[],a=[],n=(e,t)=>e.map((e,i)=>{if("press"===e.trigger)return`if (${b(e.button,e.modifier)}) { ga${t} = TRUE; }`;let n=`ga${t}${i}`;return a.push(`${n}Time = 0; ${n}Latched = FALSE;`),o.push(`int ${n}Time;
90int ${n}Latched;`),`if (${g(e.button)}${S(e.modifier)}) {
91        ${n}Time = min(${n}Time + get_rtime(), ${e.holdMs});
92        if (${n}Time >= ${e.holdMs} && !${n}Latched) {
93            ga${t} = TRUE;
94            ${n}Latched = TRUE;
95        }
96    } else {
97        ${n}Time = 0;
98        ${n}Latched = FALSE;
99    }`}).join("\n    "),s=n(i.selectionActions,"Enter"),l=n(i.exitActions,"Exit"),r=[...new Set([...i.selectionActions.map(e=>e.button),i.throwButton,i.pingTrigger])].filter(e=>"NONE"!==e);return`// Grenade Assist runtime: independent input-derived state, never Weapon Sync state.
100int gaSelected;
101int gaPreparing;
102int gaCooking;
103int gaElapsed;
104int gaStarted;
105int gaReady;
106int gaEnter;
107int gaExit;
108int gaThrowDown;
109int gaBlockThrow;
110int gaBlockPing;
111int gaSuppressCombat;
112${o.join("\n")}
113
114function resetGrenadeAssist() {
115    gaSelected = FALSE;
116    gaPreparing = FALSE;
117    gaCooking = FALSE;
118    gaElapsed = 0;
119    ${a.join("\n    ")}
120    combo_stop(GrenadeAssistPingCombo);
121}
122
123function finishGrenadeThrow() {
124    gaPreparing = FALSE;
125    gaCooking = FALSE;
126    gaElapsed = 0;
127    gaSelected = ${i.afterThrow};
128    combo_stop(GrenadeAssistPingCombo);
129}
130
131function blockGrenadeAssistInputs() {
132    if (!(${g(i.throwButton)})) { gaBlockThrow = FALSE; }
133    if (!(${g(i.pingTrigger)})) { gaBlockPing = FALSE; }
134    if (gaBlockThrow) { set_val(${i.throwButton}, 0); }
135    if (gaBlockPing) { set_val(${i.pingTrigger}, 0); }
136    gaSuppressCombat = gaSelected || gaBlockThrow;
137}
138
139function suspendGrenadeAssist() {
140    resetGrenadeAssist();
141    gaReady = FALSE;
142    blockGrenadeAssistInputs();
143}
144
145function updateGrenadeAssist() {
146    gaEnter = FALSE;
147    gaExit = FALSE;
148    gaStarted = FALSE;
149    gaThrowDown = ${g(i.throwButton)};
150    blockGrenadeAssistInputs();
151    if (!toggle[ToggleGrenadeAssistEnum] || passiveMod || (currentState != STATE_PLAYING && currentState != STATE_SCREEN_SAVER) || !(${i.selectionActions.length?"TRUE":"FALSE"}/* @[INLINE_SUPPRESS_COMBAT] */)) {
152        suspendGrenadeAssist();
153        return;
154    }
155    if (!gaReady) {
156        if (!(${r.map(g).join(" || ")})) { gaReady = TRUE; }
157        return;
158    }
159    ${s}
160    ${l}
161    if (gaExit) {
162        resetGrenadeAssist();
163    } else {
164        if (gaEnter && !gaSelected) {
165            gaSelected = TRUE;
166            gaPreparing = FALSE;
167        }
168        if (gaSelected) {
169            if (gaThrowDown && get_lval(${i.throwButton}) <= 50 && !gaBlockThrow) {
170                gaPreparing = TRUE;
171                if (settings[GrenadeAssistAutoThrowEnum]) { gaCooking = TRUE; gaStarted = TRUE; gaElapsed = 0; }
172            }
173            if (gaPreparing && !gaThrowDown) {
174                finishGrenadeThrow();
175            }
176            if (!settings[GrenadeAssistAutoThrowEnum]) { gaCooking = FALSE; gaElapsed = 0; }
177            if (gaCooking && !gaStarted) {
178                gaElapsed = min(gaElapsed + get_rtime(), 4000);
179                if (gaElapsed >= settings[GrenadeAssistCookTimeEnum]) {
180                    gaBlockThrow = TRUE;
181                    finishGrenadeThrow();
182                }
183            }
184        }
185    }
186    if (gaSelected && !gaExit && settings[GrenadeAssistPingEnum] && !gaBlockThrow${i.pingCondition?" && gaThrowDown && gaPreparing":""} && ${"NONE"===i.pingButton?"FALSE":"TRUE"}) {
187        if (${b(i.pingTrigger,"NONE")} && !gaBlockPing) {
188            gaBlockPing = TRUE;
189            if (!combo_running(GrenadeAssistPingCombo)) { combo_run(GrenadeAssistPingCombo); }
190        }
191    } else {
192        combo_stop(GrenadeAssistPingCombo);
193    }
194    if (gaSelected) { screenSaverTimer = 0; }
195    blockGrenadeAssistInputs();
196}
197
198function finishGrenadeAssistFrame() {
199    if (!toggle[ToggleGrenadeAssistEnum] || passiveMod || !(TRUE/* @[INLINE_SUPPRESS_COMBAT] */) || (currentState != STATE_PLAYING && currentState != STATE_SCREEN_SAVER)) {
200        suspendGrenadeAssist();
201    }
202    blockGrenadeAssistInputs();
203}`}function _(e){let t=m(e);if("NONE"===t.pingButton)return"combo GrenadeAssistPingCombo {\n    wait(20);\n}";let i=`    set_val(${t.pingButton}, 100);
204    wait(${t.pingPress});
205    set_val(${t.pingButton}, 0);`;return`combo GrenadeAssistPingCombo {
206${i}
207    wait(${t.pingPattern?t.pingGap:20});${t.pingPattern?`
208${i}
209    wait(20);`:""}
210}`}},67518:(e,t,i)=>{i.d(t,{Cz:()=>d,Hm:()=>a,dm:()=>n,mc:()=>s,my:()=>r,xH:()=>l});var o=i(51152);let a=e=>(e||"").trim().toLowerCase(),n=e=>{let t=a(e);return"tap"===t||"double-tap"===t||"triple-tap"===t},s=(e,t,i)=>`${e}:${t||"NONE"}+${i}`,l=e=>{let[t="gamepad",i="NONE+NONE"]=e.split(":"),[o="NONE",a="NONE"]=i.split("+");return{device:t,shortcut:"NONE"===o?a:`${o} + ${a}`}},r=e=>{let t=e.secondaryButton?e.primaryButton:"NONE",i=e.secondaryButton||e.primaryButton;return s(e.device,"keyboard"===e.device?(0,o.rM)(t):t,"keyboard"===e.device?(0,o.rM)(i):i)},d=(e,t)=>!!e&&"embedded"===t&&n(e.trigger)},78234:(e,t,i)=>{function o(e){let t=Array.from(e.toUpperCase().substring(0,15)).map(e=>e.charCodeAt(0));for(t.push(0);t.length<16;)t.push(0);return`{ ${t.join(", ")} }`}function a(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function n(e){return a((e.oledLabel||e.label).toUpperCase())}function s(e){return{oledLabel:e.oledLabel,oledOrder:e.oledOrder,oledVisible:e.oledVisible,oledScope:e.oledScope,oledScale:e.oledScale}}function l(e,t){return r(e,t).filter(e=>!1!==e.oledVisible).map((e,t)=>({setting:e,index:t})).sort((e,t)=>
210{let i=e.setting.oledOrder??Number.MAX_SAFE_INTEGER,o=t.setting.oledOrder??Number.MAX_SAFE_INTEGER;return i!==o?i-o:e.index-t.index}).map(e=>e.setting)}function r(e,t){return e.filter(e=>!e.isVirtual&&t.includes(e.type))}function d(e,t){let i=r(e,t);return[...l(i,t),...i.filter(e=>!1===e.oledVisible)]}i.d(t,{u:()=>u});class u{static ToggleOnly(e){let{id:t,name:i,oledName:a,description:r,category:u,version:c,activation:m,runtimeDefines:p,suppressCombatFlag:g,settings:S,mainLogicBlock:b,priorityLogic:h,handler:_,init:f,function:E,combo:v}=e,A=a||i,y=(S||[]).find(e=>"active"===e.id),P=(S||[]).filter(e=>"active"!==e.id),T={id:"active",enumName:`Toggle${t}Enum`,label:y?.label||i,hint:y?.hint,default:y?.default??0,type:y?.type||"toggle",editable:y?.editable??!0,isVirtual:!1,hideInUI:y?.hideInUI??!1,calloutMode:y?.calloutMode,...y?s(y):{}},$=P.map(e=>({id:e.id,enumName:e.enumName||`${t}${e.id.charAt(0).toUpperCase()+e.id.slice(1)}Enum`,label:e.label||"",...s(e),hint:e.hint,default:e.default??0,type:e.type||"slider",buttonRole:e.buttonRole,editable:e.editable??!0,isVirtual:e.isVirtual??!0,hideInUI:e.hideInUI??!1,min:e.min,max:e.max,options:e.options,optionDescriptions:e.optionDescriptions,calloutMode:e.calloutMode,dependsOn:e.dependsOn,disabledOptions:e.disabledOptions,onChangeHook:e.onChangeHook,hideWhenDisabled:e.hideWhenDisabled})),R=l($,["slider","number"]),C=d($,["slider","number"]),L=R.length>0?R[0].enumName:"",N=R.length>0?R[R.length-1].enumName:"",M="function"==typeof b||"string"==typeof b&&""!==b.trim()||"function"==typeof h||"string"==typeof h&&""!==h.trim()||_?b||"":`if (toggle[Toggle${t}Enum]) {
211    handle${t}();
212}`;return{id:t,name:i,description:r,category:u,type:"toggle-only",version:c,settings:[T,...$],activation:m,dynamicHandler:_,suppressCombatFlag:g,templates:{modEnum:`${t}Enum, `,modIdArray:`${t}Enum, `,toggleEnum:`, Toggle${t}Enum`,init:f||"",asciiName:`${o(A)}, // ${A.toUpperCase()}`,runtimeDefines:p||"",submenuBlock:R.length>0?"":`&& modId[currentMod] != ${t}Enum`,settingsLabel:R.map(e=>`
213        , "${n(e)}" // ${e.enumName}`).join(""),submenuDispatcher:R.length>0?`// ${i} Mod
214case ${t}Enum: {
215    renderGenericSubMenu(modMenu, ${L}, ${N});
216    break;
217}`:"",priorityLogic:h||"",mainLogicBlock:M?`// ${i} Mod
218${M}`:"",getToggleState:`// ${i} Mod
219case ${t}Enum: {
220    return toggle[Toggle${t}Enum];
221}`,switchActiveMod:`// ${i} Mod
222case ${t}Enum: {
223    toggle[Toggle${t}Enum] = !toggle[Toggle${t}Enum];
224    break;
225}`,minMaxTable:C.map(e=>`
226        , { ${e.min??0}, ${e.max??100} } // ${e.enumName}`).join(""),settingEnum:C.length>0?`, ${C.map(e=>e.enumName).join(", ")}`:"",saveBvar:`save_bvar_auto(toggle[Toggle${t}Enum], 0, 1);`,readBvar:`toggle[Toggle${t}Enum] = read_bvar_auto(0, 1, \${active});`,loadDefaults:`toggle[Toggle${t}Enum] = \${active};`,saveBvarAppend:C.map(e=>`save_bvar_auto(settings[${e.enumName}], ${e.min??0}, ${e.max??100});`).join("\n"),readBvarAppend:C.map(e=>`settings[${e.enumName}] = read_bvar_auto(${e.min??0}, ${e.max??100}, \${${e.id}});`).join("\n"),loadDefaultsAppend:C.map(e=>`settings[${e.enumName}] = \${${e.id}};`).join("\n"),function:E||"",combo:v||""}}}static SingleSlider(e){let{id:t,name:i,description:a,category:r,version:u,sliderLabel:c,sliderMin:m,sliderMax:p,sliderDefault:g,activation:S,settings:b,mainLogicBlock:h,priorityLogic:_,init:f,function:E,combo:v}=e,A=`${t}ValueEnum`,y=(b||[]).find(e=>"active"===e.id),P=(b||[]).find(e=>"value"===e.id),T=(b||[]).filter(e=>"active"!==e.id&&"value"!==e.id),$={id:"active",enumName:`Toggle${t}Enum`,label:y?.label||i,hint:y?.hint,default:y?.default??0,type:y?.type||"toggle",editable:y?.editable??!0,isVirtual:!1,hideInUI:y?.hideInUI??!1,...y?s(y):{}},R={id:"value",enumName:A,label:P?.label||c,...P?s(P):{},hint:P?.hint,type:P?.type||"slider",min:P?.min??m,max:P?.max??p,default:P?.default??g,editable:!0,isVirtual:P?.isVirtual??!1,hideInUI:P?.hideInUI??!1},C=T.map(e=>({id:e.id,label:e.label||"",...s(e),hint:e.hint,default:e.default??0,type:e.type||"slider",buttonRole:e.buttonRole,editable:e.editable??!0,isVirtual:e.isVirtual??!0,hideInUI:e.hideInUI??!1,min:e.min,max:e.max,options:e.options,optionDescriptions:e.optionDescriptions,calloutMode:e.calloutMode,dependsOn:e.dependsOn,disabledOptions:e.disabledOptions,onChangeHook:e.onChangeHook,hideWhenDisabled:e.hideWhenDisabled})),L="function"==typeof h||"string"==typeof h&&""!==h.trim()||"function"==typeof _||"string"==typeof _&&""!==_.trim()?h||"":`if (toggle[Toggle${t}Enum]) {
227    handle${t}();
228}`,N=l([R],["slider","number"]),M=d([R],["slider","number"]);return{id:t,name:i,description:a,category:r,type:"single-slider",version:u,settings:[$,R,...C],activation:S,templates:{modEnum:`${t}Enum, `,modIdArray:`${t}Enum, `,toggleEnum:`, Toggle${t}Enum`,init:f||"",asciiName:`${o(i)}, // ${i.toUpperCase()}`,submenuBlock:N.length>0?"":`&& modId[currentMod] != ${t}
228Enum`,settingsLabel:N.map(e=>`, "${n(e)}" // ${e.enumName}`).join(""),submenuDispatcher:`// ${i} Mod
229case ${t}Enum: {
230    ${N.length>0?`renderGenericSettingBar(modMenu, ${N[0].enumName});`:""}
231    break;
232}`,priorityLogic:_||"",mainLogicBlock:L?`// ${i} Mod
233${L}`:"",getToggleState:`// ${i} Mod
234case ${t}Enum: {
235    return toggle[Toggle${t}Enum];
236}`,switchActiveMod:`// ${i} Mod
237case ${t}Enum: {
238    toggle[Toggle${t}Enum] = !toggle[Toggle${t}Enum];
239    break;
240}`,minMaxTable:M.map(e=>`, { ${e.min}, ${e.max} } // ${e.enumName}`).join(""),settingEnum:M.map(e=>`, ${e.enumName}`).join(""),saveBvar:`save_bvar_auto(toggle[Toggle${t}Enum], 0, 1);
241${M.map(e=>`save_bvar_auto(settings[${e.enumName}], ${e.min}, ${e.max});`).join("\n")}`,readBvar:`toggle[Toggle${t}Enum] = read_bvar_auto(0, 1, \${active});
242${M.map(e=>`settings[${e.enumName}] = read_bvar_auto(${e.min}, ${e.max}, \${${e.id}});`).join("\n")}`,loadDefaults:`toggle[Toggle${t}Enum] = \${active};
243${M.map(e=>`settings[${e.enumName}] = \${${e.id}};`).join("\n")}`,function:E||"",combo:v||""}}}static MultiSlider(e){let{id:t,name:i,description:a,category:r,version:u,settings:c,customSettings:m,activation:p,mainLogicBlock:g,priorityLogic:S,init:b,function:h,combo:_}=e,f="function"==typeof g||"string"==typeof g&&""!==g.trim()||"function"==typeof S||"string"==typeof S&&""!==S.trim()?g||"":`if (toggle[Toggle${t}Enum]) {
244    handle${t}();
245}`,E=(c||[]).find(e=>"active"===e.id),v=(c||[]).filter(e=>"active"!==e.id),A={id:"active",enumName:`Toggle${t}Enum`,label:E?.label||i,hint:E?.hint,default:E?.default??0,type:E?.type||"toggle",editable:!0,isVirtual:!1,hideInUI:E?.hideInUI??!1,...E?s(E):{}},y=v.map(e=>({id:e.id,enumName:e.enumName||`${t}${e.id.charAt(0).toUpperCase()+e.id.slice(1)}Enum`,label:e.label||"",...s(e),hint:e.hint,type:e.type||"slider",buttonRole:e.buttonRole,min:e.min??0,max:e.max??100,default:e.default??0,editable:!0,isVirtual:e.isVirtual??!1,hideInUI:e.hideInUI??!1})),P=(m||[]).map(e=>({id:e.id,label:e.label||"",...s(e),hint:e.hint,default:e.default??0,type:e.type||"slider",buttonRole:e.buttonRole,editable:e.editable??!0,isVirtual:e.isVirtual??!0,hideInUI:e.hideInUI??!1,min:e.min,max:e.max,options:e.options,optionDescriptions:e.optionDescriptions,calloutMode:e.calloutMode,dependsOn:e.dependsOn,disabledOptions:e.disabledOptions,onChangeHook:e.onChangeHook,hideWhenDisabled:e.hideWhenDisabled})),T=l(y,["slider","number"]),$=d(y,["slider","number"]),R=T.length>0?T[0].enumName:"",C=T.length>0?T[T.length-1].enumName:"";return{id:t,name:i,description:a,category:r,type:"multi-slider",version:u,settings:[A,...y,...P],activation:p,templates:{modEnum:`${t}Enum, `,modIdArray:`${t}Enum, `,toggleEnum:`, Toggle${t}Enum`,init:b||"",asciiName:`${o(i)}, // ${i.toUpperCase()}`,submenuBlock:T.length>0?"":`&& modId[currentMod] != ${t}Enum`,settingsLabel:T.map(e=>`
246        , "${n(e)}" // ${e.enumName}`).join(""),submenuDispatcher:`// ${i} Mod
247case ${t}Enum: {
248    ${R&&C?`renderGenericSubMenu(modMenu, ${R}, ${C});`:""}
249    break;
250}`,priorityLogic:S||"",mainLogicBlock:f?`// ${i} Mod
251${f}`:"",getToggleState:`// ${i} Mod
252case ${t}Enum: {
253    return toggle[Toggle${t}Enum];
254}`,switchActiveMod:`// ${i} Mod
255case ${t}Enum: {
256    toggle[Toggle${t}Enum] = !toggle[Toggle${t}Enum];
257    break;
258}`,minMaxTable:$.map(e=>`
259        , { ${e.min??0}, ${e.max??100} } // ${e.enumName}`).join(""),settingEnum:$.length>0?`, ${$.map(e=>e.enumName).join(", ")}`:"",saveBvar:`save_bvar_auto(toggle[Toggle${t}Enum], 0, 1);
260${$.map(e=>`save_bvar_auto(settings[${e.enumName}], ${e.min??0}, ${e.max??100});`).join("\n")}`,readBvar:`toggle[Toggle${t}Enum] = read_bvar_auto(0, 1, \${active});
261${$.map(e=>`settings[${e.enumName}] = read_bvar_auto(${e.min??0}, ${e.max??100}, \${${e.id}});`).join("\n")}`,loadDefaults:`toggle[Toggle${t}Enum] = \${active};
262${$.map(e=>`settings[${e.enumName}] = \${${e.id}};`).join("\n")}`,function:h||"",combo:_||""}}}static ScaleSlider(e){let{id:t,name:i,description:a,category:r,version:u,settings:c,customSettings:m,percentSettingId:p,activation:g,mainLogicBlock:S,priorityLogic:b,init:h,function:_,combo:f}=e,E=(c||[]).find(e=>"active"===e.id),v=(c||[]).filter(e=>"active"!==e.id),A={id:"active",enumName:`Toggle${t}Enum`,label:E?.label||i,hint:E?.hint,default:E?.default??0,type:E?.type||"toggle",editable:!0,isVirtual:!1,hideInUI:E?.hideInUI??!1,...E?s(E):{}},y=v.map(e=>({id:e.id,enumName:e.enumName||`${t}${e.id.charAt(0).toUpperCase()+e.id.slice(1)}Enum`,label:e.label||"",...s(e),hint:e.hint,type:e.type||"slider",buttonRole:e.buttonRole,min:e.min??0,max:e.max??100,default:e.default??0,editable:!0,isVirtual:e.isVirtual??!1,hideInUI:e.hideInUI??!1})),P=(m||[]).map(e=>({id:e.id,label:e.label||"",...s(e),hint:e.hint,default:e.default??0,type:e.type||"slider",buttonRole:e.buttonRole,editable:e.editable??!0,isVirtual:e.isVirtual??!0,hideInUI:e.hideInUI??!1,min:e.min,max:e.max,options:e.options,optionDescriptions:e.optionDescriptions})),T=l(y,["slider","number"]),$=d(y,["slider","number"]),R=T.length>0?T[0].enumName:"",C=T.length>0?T[T.length-1].enumName:"",L=p?`${t}${p.charAt(0).toUpperCase()+p.slice(1)}Enum`:"",N="function"==typeof S||"string"==typeof S&&""!==S.trim()||"function"==typeof b||"string"==typeof b&&""!==b.trim()?S||"":`if (toggle[Toggle${t}Enum]) {
263    handle${t}();
264}`;return{id:t,name:i,description:a,category:r,type:"scale-slider",version:u,settings:[A,...y,...P],activation:g,templates:{modEnum:`${t}Enum, `,modIdArray:`${t}Enum, `,toggleEnum:`, Toggle${t}Enum`,init:h||"",asciiName:`${o(i)}, // ${i.toUpperCase()}`,submenuBlock:T.length>0?"":`&& modId[currentMod] != ${t}
264Enum`,settingsLabel:T.map(e=>`
265        , "${n(e)}" // ${e.enumName}`).join(""),submenuDispatcher:`// ${i} Mod
266case ${t}Enum: {
267    ${R&&C&&L?`renderSubMenuWithPercent(${R}, ${C}, ${L});`:""}
268    break;
269}`,priorityLogic:b||"",mainLogicBlock:N?`// ${i} Mod
270${N}`:"",getToggleState:`// ${i} Mod
271case ${t}Enum: {
272    return toggle[Toggle${t}Enum];
273}`,switchActiveMod:`// ${i} Mod
274case ${t}Enum: {
275    toggle[Toggle${t}Enum] = !toggle[Toggle${t}Enum];
276    break;
277}`,minMaxTable:$.map(e=>`
278        , { ${e.min??0}, ${e.max??100} } // ${e.enumName}`).join(""),settingEnum:$.length>0?`, ${$.map(e=>e.enumName).join(", ")}`:"",saveBvar:`save_bvar_auto(toggle[Toggle${t}Enum], 0, 1);
279${$.map(e=>`save_bvar_auto(settings[${e.enumName}], ${e.min??0}, ${e.max??100});`).join("\n")}`,readBvar:`toggle[Toggle${t}Enum] = read_bvar_auto(0, 1, \${active});
280${$.map(e=>`settings[${e.enumName}] = read_bvar_auto(${e.min??0}, ${e.max??100}, \${${e.id}});`).join("\n")}`,loadDefaults:`toggle[Toggle${t}Enum] = \${active};
281${$.map(e=>`settings[${e.enumName}] = \${${e.id}};`).join("\n")}`,function:_||"",combo:f||""}}}static Advanced(e){let{id:t,name:i,description:a,category:r,version:u,settings:c,activation:m,mainLogicBlock:p,priorityLogic:g,init:S,function:b,combo:h}=e,_=(c||[]).find(e=>"active"===e.id),f=(c||[]).filter(e=>"active"!==e.id),E={id:"active",enumName:`Toggle${t}Enum`,label:_?.label||i,hint:_?.hint,default:_?.default??0,type:"toggle",editable:!0,isVirtual:!1,hideInUI:_?.hideInUI??!1,..._?s(_):{}},v=f.map(e=>({id:e.id,enumName:e.enumName||`${t}${e.id.charAt(0).toUpperCase()+e.id.slice(1)}Enum`,label:e.label||"",...s(e),hint:e.hint,type:e.type||"slider",buttonRole:e.buttonRole,min:e.min??0,max:e.max??("button"===e.type?21:100),default:e.default??0,editable:!0,isVirtual:e.isVirtual??!1,hideInUI:e.hideInUI??!1,options:e.options,optionDescriptions:e.optionDescriptions,dependsOn:e.dependsOn,hideWhenDisabled:e.hideWhenDisabled,disabledOptions:e.disabledOptions,onChangeHook:e.onChangeHook})),A=[...l(v,["slider","number"]),...l(v,["button"])],y=[...d(v,["slider","number"]),...d(v,["button"])],P=A.filter(e=>"slider"===e.type||"number"===e.type),T=A.filter(e=>"button"===e.type),$=P.length>0?P[0].enumName:T.length>0?T[0].enumName:"",R=P.length>0?P[P.length-1].enumName:"",C=T.length>0?T[T.length-1].enumName:"",L=$&&C?`renderSubMenuWithButton(modMenu, ${$}, ${C});`:$&&R?`renderGenericSubMenu(modMenu, ${$}, ${R});`:"",N="function"==typeof p||"string"==typeof p&&""!==p.trim()||"function"==typeof g||"string"==typeof g&&""!==g.trim()?p||"":`if (toggle[Toggle${t}Enum]) {
282    handle${t}();
283}`;return{id:t,name:i,description:a,category:r,type:"advanced",version:u,settings:[E,...v],activation:m,templates:{modEnum:`${t}Enum, `,modIdArray:`${t}Enum, `,toggleEnum:`, Toggle${t}Enum`,init:S||"",asciiName:`${o(i)}, // ${i.toUpperCase()}`,submenuBlock:A.length>0?"":`&& modId[currentMod] != ${t}Enum`,settingsLabel:A.map(e=>`
284        , "${n(e)}" // ${e.enumName}`).join(""),submenuDispatcher:`// ${i} Mod
285	case ${t}Enum: {
286	    ${L}
287	    break;
288	}`,priorityLogic:g||"",mainLogicBlock:N?`// ${i} Mod
289${N}`:"",getToggleState:`// ${i} Mod
290case ${t}Enum: {
291    return toggle[Toggle${t}Enum];
292}`,switchActiveMod:`// ${i} Mod
293case ${t}Enum: {
294    toggle[Toggle${t}Enum] = !toggle[Toggle${t}Enum];
295    break;
296}`,minMaxTable:y.length>0?y.map(e=>`
297        , { ${e.min??0}, ${e.max??100} } // ${e.enumName}`).join(""):"",settingEnum:y.length>0?`, ${y.map(e=>e.enumName).join(", ")}`:"",saveBvar:`save_bvar_auto(toggle[Toggle${t}Enum], 0, 1);
298${y.map(e=>`save_bvar_auto(settings[${e.enumName}], ${e.min??0}, ${e.max??100});`).join("\n")}`,readBvar:`toggle[Toggle${t}Enum] = read_bvar_auto(0, 1, \${active});
299${y.map(e=>`settings[${e.enumName}] = read_bvar_auto(${e.min??0}, ${e.max??100}, \${${e.id}});`).join("\n")}`,loadDefaults:`toggle[Toggle${t}Enum] = \${active};
300${y.map(e=>`settings[${e.enumName}] = \${${e.id}};`).join("\n")}`,function:b||"",combo:h||""}}}static Custom(e){let{id:t,name:i,oledName:r,description:u,category:c,version:m,settings:p,activation:g,submenuRenderCode:S,mainLogicBlock:b,priorityLogic:h,init:_,function:f,combo:E}=e,v=r||i,A=(p||[]).find(e=>"active"===e.id),y=(p||[]).filter(e=>"active"!==e.id),P={id:"active",enumName:`Toggle${t}Enum`,label:A?.label||i,hint:A?.hint,default:A?.default??0,type:"toggle",editable:!0,isVirtual:!1,hideInUI:A?.hideInUI??!1,...A?s(A):{}},T=y.map(e=>({id:e.id,enumName:e.enumName||`${t}${e.id.charAt(0).toUpperCase()+e.id.slice(1)}Enum`,label:e.label||"",...s(e),hint:e.hint,type:e.type||"slider",buttonRole:e.buttonRole,min:e.min??0,max:e.max??100,default:e.default??0,editable:!0,isVirtual:e.isVirtual??!1,hideInUI:e.hideInUI??!1,options:e.options,optionDescriptions:e.optionDescriptions,dependsOn:e.dependsOn,hideWhenDisabled:e.hideWhenDisabled,disabledOptions:e.disabledOptions,onChangeHook:e.onChangeHook})),$="function"==typeof b||"string"==typeof b&&""!==b.trim()||"function"==typeof h||"string"==typeof h&&""!==h.trim()?b||"":`if (toggle[Toggle${t}Enum]) {
301    handle${t}();
302}`,R=l(T,["slider","number","toggle","list","button"]),C=d(T,["slider","number","toggle","list","button"]);return{id:t,name:i,description:u,category:c,type:"custom",version:m,settings:[P,...T],activation:g,templates:{modEnum:`${t}Enum, `,modIdArray:`${t}Enum, `,toggleEnum:`, Toggle${t}Enum`,init:_||"",strings:T.filter(e=>"list"===e.type&&e.options).map(e=>`
303const string ${t.toUpperCase()}_${e.id.toUpperCase()}_NAMES[] = { ${e.options?.map(e=>`"${a(e.toUpperCase())}"`).join(", ")} };`).join(""),asciiName:`${o(v)}, // ${v.toUpperCase()}`,settingsLabel:R.map(e=>`
304        , "${n(e)}" // ${e.enumName}`).join(""),submenuDispatcher:`// ${i} Mod
305case ${t}Enum: {
306    // Legacy custom snippets mix drawing and input: keep their full redraw contract.
307    if (!oledSubmenuDraw) { cls_oled(OLED_BLACK); }
308    drawModTitle(modMenu);
309    oledSubmenuDraw = TRUE;
310    render${t}SubMenu();
311    break;
312}`,submenuRender:`// ${i} Mod
313function render${t}SubMenu() {
314    ${S}
315}`,priorityLogic:h||"",mainLogicBlock:$?`// ${i} Mod
316${$}`:"",getToggleState:`// ${i} Mod
317case ${t}Enum: {
318    return toggle[Toggle${t}Enum];
319}`,switchActiveMod:`// ${i} Mod
320case ${t}Enum: {
321    toggle[Toggle${t}Enum] = !toggle[Toggle${t}Enum];
322    break;
323}`,minMaxTable:C.length>0?C.map(e=>`
324        , { ${e.min??0}, ${e.max??100} } // ${e.enumName}`).join(""):"",settingEnum:C.length>0?`, ${C.map(e=>e.enumName||"").join(", ")}`:"",saveBvar:`save_bvar_auto(toggle[Toggle${t}Enum], 0, 1);
325${C.map(e=>`save_bvar_auto(settings[${e.enumName}], ${e.min??0}, ${e.max??100});`).join("\n")}`,readBvar:`toggle[Toggle${t}Enum] = read_bvar_auto(0, 1, \${active});
326${C.map(e=>`settings[${e.enumName}] = read_bvar_auto(${e.min??0}, ${e.max??100}, \${${e.id}});`).join("\n")}`,loadDefaults:`toggle[Toggle${t}Enum] = \${active};
327${C.map(e=>`settings[${e.enumName}] = \${${e.id}};`).join("\n")}`,function:f||"",combo:E||""}}}static MiscToggle(e){let{id:t,name:i,oledName:o,description:n,category:l,version:r,activation:d,handler:u,runtimeDefines:c,suppressCombatFlag:m,settings:p,mainLogicBlock:g,priorityLogic:S,init:b,function:h,combo:_}=e,f=a((o||i).toUpperCase()),E=(p||[]).find(e=>"active"===e.id),v=(p||[]).filter(e=>"active"!==e.id),A={id:"active",enumName:`${t}Enum`,label:E?.label||i,hint:E?.hint,default:E?.default??0,type:"toggle",editable:!0,isVirtual:!1,hideInUI:E?.hideInUI??!1,...E?s(E):{}},y=v.map(e=>({id:e.id,label:e.label||"",...s(e),hint:e.hint,default:e.default??0,type:e.type||"slider",buttonRole:e.buttonRole,editable:e.editable??!0,isVirtual:e.isVirtual??!0,hideInUI:e.hideInUI??!1,min:e.min,max:e.max,options:e.options,optionDescriptions:e.optionDescriptions,calloutMode:e.calloutMode,dependsOn:e.dependsOn,disabledOptions:e.disabledOptions,onChangeHook:e.onChangeHook,hideWhenDisabled:e.hideWhenDisabled})),P="function"==typeof g||"string"==typeof g&&""!==g.trim()||"function"==typeof S||"string"==typeof S&&""!==S.trim()||u?g||"":`if (settings[${t}Enum]) {
328    handle${t}();
329}`,T=!1!==A.oledVisible;return{id:t,name:i,description:n,category:l,type:"misc-toggle",dynamicHandler:u,suppressCombatFlag:m,version:r,settings:[A,...y],activation:d,templates:{runtimeDefines:c||"",init:b||"",miscSettingsLabel:T?`"${f}", // ${t}Enum`:"",priorityLogic:S||"",mainLogicBlock:P?`// ${i} Mod
330${P}`:"",miscRender:T?`// ${i} Mod
331	case ${t}Enum: {
332	    drawOnOffValue(settings[${t}Enum], 45);
333	    break;
334	}`:"",miscInput:T?`// ${i} Mod
335case ${t}Enum: {
336    settings[${t}Enum] = !settings[${t}Enum];
337    blinkLedAndRumble();
338    break;
339}`:"",miscNavigation:T?`${t}Enum`:"",miscMinMaxTable:T?`{ 0, 1 }, // ${t}Enum`:"",miscSettingEnum:T?`${t}Enum, `:"",saveBvar:`save_bvar_auto(settings[${t}Enum], 0, 1);`,readBvar:`settings[${t}Enum] = read_bvar_auto(0, 1, \${active});`,loadDefaults:`settings[${t}Enum] = \${active};`,function:h||"",combo:_||""}}}static Embedded(e){let{id:t,name:i,description:o,version:a="1.0.0",activation:n,runtimeDefines:s,suppressCombatFlag:l,mainLogicBlock:r,priorityLogic:d,functionBlock:u,combo:c}=e;return{id:t,name:i,description:o,category:"utility",type:"embedded",version:a,settings:[],activation:n,suppressCombatFlag:l,templates:{runtimeDefines:s||"",priorityLogic:d||"",mainLogicBlock:r?`// ${i} Embedded Mod
340${r}`:"",function:u,combo:c||""}}}static MiscList(e){let{id:t,name:i,description:o,category:r,version:u,activation:c,settings:m,mainLogicBlock:p,priorityLogic:g,miscInput:S,init:b,function:h,combo:_}=e,f=m.find(e=>"value"===e.id),E=m.filter(e=>"value"!==e.id);if(!f||!f.options)throw Error(`Mod ${t} (MiscList) requires a 'value' setting with an 'options' array.`);let v=f.options,A=v.length-1,y={id:"value",enumName:`${t}Enum`,label:f.label||i,hint:f.hint,type:"list",options:v,optionDescriptions:f.o
340ptionDescriptions,calloutMode:f.calloutMode,default:f.default??0,editable:!0,isVirtual:f.isVirtual??!1,hideInUI:f.hideInUI??!1,...s(f)},P=E.map(e=>({id:e.id,label:e.label||"",...s(e),hint:e.hint,default:e.default??0,type:e.type||"slider",buttonRole:e.buttonRole,editable:e.editable??!0,isVirtual:e.isVirtual??!0,hideInUI:e.hideInUI??!1,min:e.min,max:e.max,options:e.options,optionDescriptions:e.optionDescriptions,calloutMode:e.calloutMode})),T="function"==typeof p||"string"==typeof p&&""!==p.trim()||"function"==typeof g||"string"==typeof g&&""!==g.trim()?p||"":`if (settings[${t}Enum] > 0) {
341    handle${t}();
342}`,$=l([y],["list"]),R=d([y],["list"]),C=$.length>0;return{id:t,name:i,description:o,category:r,type:"misc-list",version:u,settings:[y,...P],activation:c,templates:{strings:`
343	const string ${t.toUpperCase()}_NAMES[] = { ${v.map(e=>`"${a(e.toUpperCase())}"`).join(", ")} };`,init:b||"",miscSettingsLabel:C?`"${n(y)}", // ${t}Enum`:"",priorityLogic:g||"",mainLogicBlock:T?`// ${i} Mod
344${T}`:"",miscRender:C?`// ${i} Mod
345	case ${t}Enum: {
346	    printCenteredBold(45, OLED_FONT_SMALL, OLED_FONT_SMALL_WIDTH, OLED_WHITE, ${t.toUpperCase()}_NAMES[settings[${t}Enum]]);
347	    break;
348	}`:"",miscInput:C?S||`// ${i} Mod
349case ${t}Enum: {
350    miscStep = iif(event_press(PS5_LEFT), -1, 1);
351    settings[${t}Enum] = clamp(settings[${t}Enum] + miscStep, 0, ${A});
352    blinkLedAndRumble();
353    break;
354}`:"",miscNavigation:C?`${t}Enum`:"",miscMinMaxTable:C?`{ 0, ${A} }, // ${t}Enum`:"",miscSettingEnum:C?`${t}Enum, `:"",saveBvar:R.length>0?`save_bvar_auto(settings[${t}Enum], 0, ${A});`:"",readBvar:R.length>0?`settings[${t}Enum] = read_bvar_auto(0, ${A}, \${value});`:"",loadDefaults:R.length>0?`settings[${t}Enum] = \${value};`:"",function:h||"",combo:_||""}}}}},79807:(e,t,i)=>{i.d(t,{s:()=>F});var o={};i.r(o),i.d(o,{AntiAfk:()=>h,AntiDrift:()=>N,AutoLean:()=>c,AutoPing:()=>u,AutoReload:()=>g,AutoSprint:()=>E,BunnyHop:()=>M,CrouchShot:()=>v,CustomMod:()=>I,GrenadeAssist:()=>d,HairTrigger:()=>w,JumpShot:()=>f,KoreanSlide:()=>T,LobbyKeepalive:()=>_,ScopeAssist:()=>C,SlideCancel:()=>P,SniperBreath:()=>y,StrafeShot:()=>A,SwapSticks:()=>b,TestMultiSlider:()=>B,TurboButton:()=>S,VMSpeed:()=>L});var a=i(78234),n=i(65198);let s=(e,t,i,o=!1)=>({id:e,label:t,type:"button",default:i,buttonRole:"player-input",isVirtual:!0,options:o?["NONE",...n.B7]:n.B7}),l=e=>({isVirtual:!0,...e}),r=e=>l({dependsOn:e=>!!e.ping,...e}),d=a.u.Custom({id:"GrenadeAssist",name:"Grenade Assist",category:"tactical",version:"1.0",description:"Customizable assistance for grenade handling.",activation:{button:"NONE",mode:"AUTO"},settings:[{id:"active",label:"Active by default",hint:"When enabled, grenade assist is active as soon as the script loads on your device.",type:"toggle",default:0},{id:"autoThrow",label:"Auto throw",hint:"Starts the timer when you press the throw button and releases it when the time is up. You can still release it earlier.",oledLabel:"Auto Throw",type:"toggle",min:0,max:1,default:0},{id:"ping",label:"Grenade ping",hint:"Press your trigger button to send a single or double ping while using a grenade.",oledLabel:"Grenade Ping",type:"toggle",min:0,max:1,default:0},{id:"cookTime",label:"Cook time (ms)",oledLabel:"Cook Time (ms)",hint:"Time from pressing the throw button to automatic release, in 50 ms steps. This does not calculate distance or fuse duration.",type:"number",min:100,max:4e3,options:["50"],default:2500,dependsOn:e=>!!e.autoThrow},l({id:"selectionActions",label:"Grenade selection actions",type:"list",default:"[]",hideInUI:!0}),l({id:"exitActions",label:"Exit actions",type:"list",default:"[]",hideInUI:!0}),s("throwButton","Throw button","PS5_R2"),r(s("pingTrigger","Trigger button","PS5_UP")),r({id:"pingCondition",label:"Activation condition",type:"list",options:["Grenade selected","Holding throw button"],default:1}),r({...s("pingButton","Ping button","NONE",!0),buttonRole:"script-output",hint:"Choose the game’s ping button. Leave unassigned to send no pings."}),r({id:"pingPattern",label:"Ping pattern",type:"list",options:["Single tap","Double tap"],default:1}),r({id:"pingPress",label:"Press duration (ms)",type:"slider",min:20,max:200,default:50}),r({id:"pingGap",label:"Gap between taps (ms)",type:"slider",min:20,max:300,default:80,dependsOn:e=>1===Number(e.pingPattern)}),l({id:"afterThrow",label:"After throw",type:"list",options:["Exit grenade mode","Wait for next grenade"],default:0})],priorityLogic:"updateGrenadeAssist();",mainLogicBlock:"finishGrenadeAssistFrame();",function:n.lo,combo:n.d7,submenuRenderCode:`suspendGrenadeAssist();
355    handleUpDown(GrenadeAssistAutoThrowEnum, GrenadeAssistCookTimeEnum);
356    if (currentSubCfg == GrenadeAssistCookTimeEnum) {
357        if (press_hold(PS5_LEFT)) { settings[currentSubCfg] = max(100, settings[currentSubCfg] - 50); }
358        if (press_hold(PS5_RIGHT)) { settings[currentSubCfg] = min(4000, settings[currentSubCfg] + 50); }
359    } else {
360        handleLeftRight(currentSubCfg);
361    }
362    drawModTitle(GrenadeAssistEnum);
363    if (currentSubCfg == GrenadeAssistCookTimeEnum) {
364        drawStandardSetting(currentSubCfg, FALSE);
365    } else {
366        drawSettingLabel(currentSubCfg);
367        drawOnOffValue(settings[currentSubCfg], 45);
368    }`});d.suppressCombatFlag="gaSuppressCombat",d.templates.offStateInput="suspendGrenadeAssist();",d.templates.setupMenuInput="suspendGrenadeAssist();",d.templates.switchActiveMod=`case GrenadeAssistEnum: {
369    toggle[ToggleGrenadeAssistEnum] = !toggle[ToggleGrenadeAssistEnum];
370    suspendGrenadeAssist();
371    break;
372}`,d.templates.readBvar=e=>{let t=(0,n.vS)(e);return`toggle[ToggleGrenadeAssistEnum] = read_bvar_auto(0, 1, ${t.active});
373settings[GrenadeAssistAutoThrowEnum] = read_bvar_auto(0, 1, ${t.autoThrow});
374settings[GrenadeAssistPingEnum] = read_bvar_auto(0, 1, ${t.ping});
375settings[GrenadeAssistCookTimeEnum] = read_bvar_auto(100, 4000, ${t.cookTime});`},d.templates.loadDefaults=e=>{let t=(0,n.vS)(e);return`toggle[ToggleGrenadeAssistEnum] = ${t.active};
376settings[GrenadeAssistAutoThrowEnum] = ${t.autoThrow};
377settings[GrenadeAssistPingEnum] = ${t.ping};
378settings[GrenadeAssistCookTimeEnum] = ${t.cookTime};`};let u=a.u.ToggleOnly({id:"AutoPing",name:"Auto Ping",description:"Automatically pings enemies while you fire or aim. Keeps your team informed without extra button presses.",category:"tactical",version:"2.0",settings:[{id:"active",label:"Active by default",hint:"When enabled, auto ping is active as soon as the script loads on your device.",type:"toggle",default:1,editable:!0},{id:"pingButton",label:"Ping button",hint:"The button your game uses for marking enemies.",type:"button",buttonRole:"script-output",default:"PS5_UP",isVirtual:!0,editable:!0},{id:"condition",label:"Activation",hint:"Choose what action triggers a ping.",type:"list",options:["Fire","ADS","ADS + Fire"],optionDescriptions:[{title:"Fire",description:"Pings while you are shooting."},{title:"ADS",description:"Pings while you are aiming down sights."},{title:"ADS + Fire",description:"Pings only when you aim and shoot at the same time."}],default:2,isVirtual:!0,editable:!0},{id:"pattern",label:"Ping pattern",hint:"Choose whether each ping action sends one tap or two quick taps.",type:"list",options:["Single tap","Double tap"],optionDescriptions:[{title:"Single tap",description:"Presses the ping button once per ping action."},{title:"Double tap",description:"Presses the ping button twice per ping action for stronger confirmation."}],default:1,isVirtual:!0,editable:!0},{id:"mode",label:"Mode",hint:"How many times to ping when triggered.",type:"list",options:["Once","Repeat"],optionDescriptions:[{title:"Once",description:"Sends a single ping when triggered. Resets when you release the button."},{title:"Repeat",description:"Keeps pinging on a timer for as long as the condition is active."}],default:1,isVirtual:!0,editable:!0},{id:"delay",label:"Repeat interval (s)",hint:"How many seconds to wait between pings.",type:"slider",min:1,max:10,default:1,isVirtual:!0,editable:!0,dependsOn:e=>1===e.mode}],init:e=>0===e.mode?"ap_fired = FALSE;":`ap_timer = 0;
379ap_fired = FALSE;`,runtimeDefines:e=>0===e.mode?"int ap_fired;":`int ap_timer;
380int ap_fired;`,priorityLogic:"",mainLogicBlock:`if (toggle[ToggleAutoPingEnum]) {
381    handleAutoPing();
382} else {
383    resetAutoPingRuntime();
384}`,function:e=>{let t=0===e.mode,i=e.condition,o=1e3*Number(e.delay),a="!passiveMod && !no_gun_state && !utility_state/* @[INLINE_SUPPRESS_COMBAT] */",n="";return(0===i?n="get_ival(FIRE_BTN)":1===i?n="get_ival(ADS_BTN)":2===i&&(n="(get_ival(ADS_BTN) && get_ival(FIRE_BTN))"),t)?`// Auto Ping Mod (Once)
385function resetAutoPingRuntime() {
386    ap_fired = FALSE;
387    combo_stop(AutoPingCombo);
388}
389
390function handleAutoPing() {
391    if (!(${a})) {
392        resetAutoPingRuntime();
393        return;
394    }
395
396    if (${n}) {
397        if (!ap_fired) {
398            combo_run(AutoPingCombo);
399            ap_fired = TRUE;
400        }
401    } else {
402        resetAutoPingRuntime();
403    }
404}`:`// Auto Ping Mod (Repeat)
405function resetAutoPingRuntime() {
406    ap_fired = FALSE;
407    ap_timer = 0;
408    combo_stop(AutoPingCombo);
409}
410
411function handleAutoPing() {
412    if (!(${a})) {
413        resetAutoPingRuntime();
414        return;
415    }
416
417    if (${n}) {
418        if (!ap_fired) {
419            combo_run(AutoPingCombo);
420            ap_fired = TRUE;
421            ap_timer = 0;
422        } else {
423            ap_timer = ap_timer + get_rtime();
424            if (ap_timer >= ${o} && !combo_running(AutoPingCombo)) {
425                combo_run(AutoPingCombo);
426                ap_timer = 0;
427            }
428        }
429    } else {
430        resetAutoPingRuntime();
431    }
432}`},combo:e=>0===e.pattern?`// Auto Ping Mod Combo
433combo AutoPingCombo {
434    set_val(\${pingButton}, 100);
435    wait(40);
436    set_val(\${pingButton}, 0);
437    wait(40);
438}`:`// Auto Ping Mod Combo
439combo AutoPingCombo {
440    set_val(\${pingButton}, 100);
441    wait(40);
442    set_val(\${pingButton}, 0);
443    wait(40);
444    set_val(\${pingButton}, 100);
445    wait(40);
446    set_val(\${pingButton}, 0);
447    wait(40);
448}`}),c=a.u.ToggleOnly({id:"AutoLean",name:"Auto Lean",description:"Leans with your left stick while aiming.",category:"movement",version:"1.0",activation:{button:"ADS_BTN",mode:"AUTO"},settings:[{id:"active",label:"Active by default",hint:"When enabled, auto lean is active as soon as the script loads on your device.",type:"toggle",default:0},{id:"threshold",label:"Activation threshold (%)",hint:"How far to move the left stick sideways before leaning. Return below this threshold to stop the automatic press.",type:"slider",min:10,max:100,default:80,isVirtual:!0},{id:"leanLeftButton",label:"Lean left button",hint:"Match the left lean button in your game.",type:"button",buttonRole:"script-output",default:"PS5_L3",isVirtual:!0},{id:"leanRightButton",label:"Lean right button",hint:"Match the right lean button in your game.",type:"button",buttonRole:"script-output",default:"PS5_R3",isVirtual:!0}],function:e=>{let t=Number(e.threshold??80),i=Number.isFinite(t)?Math.max(10,Math.min(100,Math.round(t))):80;return`// Auto Lean Mod
449function handleAutoLean() {
450    if (get_ival(ADS_BTN) > 50 && !passiveMod && !no_gun_state && !utility_state/* @[INLINE_SUPPRESS_COMBAT] */) {
451        if (get_ival(PS5_LX) <= -${i}) {
452            set_val(\${leanLeftButton}, 100);
453        } else if (get_ival(PS5_LX) >= ${i}) {
454            set_val(\${leanRightButton}, 100);
455        }
456    }
457}`}}),m=(e,t,i,o)=>{let a=Number(e??t);return Number.isFinite(a)?Math.max(i,Math.min(o,Math.round(a))):t},p=e=>e>0?`    wait(${e});
458`:"",g={id:"AutoReload",name:"Auto Reload",description:"Automatically reloads after you release Fire, with optional reload animation cancel timing.",category:"utility",type:"toggle-only",ver
458sion:"1.0",activation:{button:"FIRE_BTN",mode:"AUTO"},suppressCombatFlag:"autoReloadSuppressCombat",settings:[{id:"profile1",label:"Profile 1 active",hint:"Initial ON/OFF state for Auto Reload while Profile 1 is active. You can still toggle it from the OLED main menu while on Profile 1.",type:"toggle",default:0,isVirtual:!0,editable:!0},{id:"profile2",label:"Profile 2 active",hint:"Initial ON/OFF state for Auto Reload while Profile 2 is active. You can still toggle it from the OLED main menu while on Profile 2.",type:"toggle",default:0,isVirtual:!0,editable:!0},{id:"reloadDelay",label:"Reload delay (ms)",hint:"Wait time after releasing Fire before Reload is pressed. Increase if reload starts too eagerly between shots.",type:"slider",min:0,max:1e3,default:80,isVirtual:!0,editable:!0},{id:"reloadPressTime",label:"Reload press time (ms)",hint:"How long Reload is held when Auto Reload triggers.",type:"slider",min:20,max:500,default:40,isVirtual:!0,editable:!0},{id:"reloadCancel",label:"Reload cancel",hint:"After Auto Reload starts, send a timed cancel action to skip the tail of the reload animation. Weapon Swap and Knife Pull-Out return to the reloaded weapon.",type:"toggle",default:0,isVirtual:!0,editable:!0},{id:"cancelMethod",label:"Cancel method",hint:"Choose which action interrupts the reload animation after the cancel delay.",type:"list",options:["Sprint Cancel","Weapon Swap","Knife Pull-Out"],optionDescriptions:[{title:"Sprint Cancel",description:"After Reload, waits for the cancel delay, then taps Sprint. No switch-back step."},{title:"Weapon Swap",description:"After Reload, taps Switch Weapon, waits for the return delay, then taps Switch Weapon back."},{title:"Knife Pull-Out",description:"After Reload, holds Switch Weapon to pull the knife, waits, then taps Switch Weapon back."}],calloutMode:"all",default:0,isVirtual:!0,editable:!0,dependsOn:e=>1===Number(e.reloadCancel)},{id:"cancelDelay",label:"Cancel start delay (ms)",hint:"How long to wait after Reload starts before Sprint, Weapon Swap, or Knife Pull-Out begins. Tune this around the HUD ammo update.",type:"slider",min:300,max:3500,default:1400,isVirtual:!0,editable:!0,dependsOn:e=>1===Number(e.reloadCancel)},{id:"cancelPressTime",label:"Tap press time (ms)",hint:"How long short taps are held: Sprint tap, Switch Weapon tap, and the final switch-back tap.",type:"slider",min:20,max:200,default:40,isVirtual:!0,editable:!0,dependsOn:e=>1===Number(e.reloadCancel)}
458,{id:"swapBackPause",label:"Return delay (ms)",hint:"Weapon Swap and Knife Pull-Out only. How long to wait before switching back to the reloaded weapon.",type:"slider",min:40,max:1e3,default:160,isVirtual:!0,editable:!0,dependsOn:e=>1===Number(e.reloadCancel)&&(1===Number(e.cancelMethod)||2===Number(e.cancelMethod))},{id:"knifeHoldTime",label:"Knife pull hold (ms)",hint:"Knife Pull-Out only. How long Switch Weapon is held to pull the knife before returning to the weapon.",type:"slider",min:150,max:1e3,default:350,isVirtual:!0,editable:!0,dependsOn:e=>1===Number(e.reloadCancel)&&2===Number(e.cancelMethod)}],templates:{modEnum:"AutoReloadEnum, ",modIdArray:"AutoReloadEnum, ",asciiName:`${(e=>{let t=Array.from(e.toUpperCase().substring(0,15)).map(e=>e.charCodeAt(0));for(t.push(0);t.length<16;)t.push(0);return`{ ${t.join(", ")} }`})("Auto Reload")}, // AUTO RELOAD`,runtimeDefines:`int toggleAutoReload[2];
459int autoReloadFireWasDown = FALSE;
460int autoReloadFireReleased = FALSE;
461int autoReloadPending = FALSE;
462int autoReloadDelayTimer = 0;
463int autoReloadSuppressCombat = FALSE;`,init:`autoReloadFireWasDown = FALSE;
464autoReloadFireReleased = FALSE;
465autoReloadPending = FALSE;
466autoReloadDelayTimer = 0;
467autoReloadSuppressCombat = FALSE;`,submenuBlock:"&& modId[currentMod] != AutoReloadEnum",withProfileMod:"|| currentModId == AutoReloadEnum",priorityLogic:`if (toggleAutoReload[profileId]) {
468    updateAutoReloadFireState();
469    autoReloadSuppressCombat = autoReloadPending || combo_running(AutoReloadCombo);
470} else {
471    autoReloadFireWasDown = FALSE;
472    autoReloadFireReleased = FALSE;
473    autoReloadSuppressCombat = FALSE;
474}`,mainLogicBlock:`if (toggleAutoReload[profileId]) {
475    handleAutoReload();
476} else {
477    resetAutoReloadRuntime();
478}`,profileChanged:"resetAutoReloadRuntime();",getToggleState:`// Auto Reload Mod
479case AutoReloadEnum: {
480    return toggleAutoReload[profileId];
481}`,switchActiveMod:`// Auto Reload Mod
482case AutoReloadEnum: {
483    toggleAutoReload[profileId] = !toggleAutoReload[profileId];
484    break;
485}`,saveBvar:`save_bvar_auto(toggleAutoReload[Profile1Enum], 0, 1);
486save_bvar_auto(toggleAutoReload[Profile2Enum], 0, 1);`,readBvar:`toggleAutoReload[Profile1Enum] = read_bvar_auto(0, 1, \${profile1});
487toggleAutoReload[Profile2Enum] = read_bvar_auto(0, 1, \${profile2});`,loadDefaults:`toggleAutoReload[Profile1Enum] = \${profile1};
488toggleAutoReload[Profile2Enum] = \${profile2};`,function:e=>{let t=m(e.reloadDelay,80,0,1e3);return`// Auto Reload Mod
489function updateAutoReloadFireState() {
490    autoReloadFireReleased = FALSE;
491    if (autoReloadFireWasDown && get_ival(FIRE_BTN) <= 50) {
492        autoReloadFireReleased = TRUE;
493    }
494    autoReloadFireWasDown = get_ival(FIRE_BTN) > 50;
495}
496
497function resetAutoReloadRuntime() {
498    autoReloadPending = FALSE;
499    autoReloadDelayTimer = 0;
500    autoReloadSuppressCombat = FALSE;
501    combo_stop(AutoReloadCombo);
502}
503
504function handleAutoReload() {
505    if (!(!passiveMod && !no_gun_state && !utility_state/* @[INLINE_SUPPRESS_COMBAT] */)) {
506        resetAutoReloadRuntime();
507        return;
508    }
509
510    if (get_ival(FIRE_BTN) > 50) {
511        resetAutoReloadRuntime();
512        return;
513    }
514
515    if (autoReloadFireReleased) {
516        autoReloadPending = TRUE;
517        autoReloadDelayTimer = 0;
518        autoReloadSuppressCombat = TRUE;
519        combo_stop(AutoReloadCombo);
520    }
521
522    if (autoReloadPending) {
523        if (autoReloadDelayTimer < ${t}) {
524            autoReloadDelayTimer = autoReloadDelayTimer + get_rtime();
525        }
526        if (autoReloadDelayTimer >= ${t}) {
527            autoReloadPending = FALSE;
528            autoReloadDelayTimer = 0;
529            autoReloadSuppressCombat = TRUE;
530            combo_run(AutoReloadCombo);
531        }
532    }
533}`},combo:e=>{let t=m(e.reloadPressTime,40,20,500),i=1===Number(e.reloadCancel),o=m(e.cancelMethod,0,0,2),a=m(e.cancelDelay,1400,300,3500),n=m(e.cancelPressTime,40,20,200),s=m(e.swapBackPause,160,40,1e3),l=m(e.knifeHoldTime,350,150,1e3),r=i?Math.max(0,a-t):0,d="";return i&&0===o?d=`${p(r)}    set_val(SPRINT_BTN, 100);
534    wait(${n});
535    set_val(SPRINT_BTN, 0);
536`:i&&1===o?d=`${p(r)}    set_val(SWITCHWEAPON_BTN, 100);
537    wait(${n});
538    set_val(SWITCHWEAPON_BTN, 0);
539    wait(${s});
540    set_val(SWITCHWEAPON_BTN, 100);
541    wait(${n});
542    set_val(SWITCHWEAPON_BTN, 0);
543`:i&&2===o&&(d=`${p(r)}    set_val(SWITCHWEAPON_BTN, 100);
544    wait(${l});
545    set_val(SWITCHWEAPON_BTN, 0);
546    wait(${s});
547    set_val(SWITCHWEAPON_BTN, 100);
548    wait(${n});
549    set_val(SWITCHWEAPON_BTN, 0);
550`),`// Auto Reload Mod Combo
551combo AutoReloadCombo {
552    set_val(RELOAD_BTN, 100);
553    wait(${t});
554    set_val(RELOAD_BTN, 0);
555${d}    wait(20);
556}`}}},S=a.u.ToggleOnly({id:"TurboButton",name:"Turbo Button",description:"Turns any button into a rapid-press. Taps it repeatedly so you don't have to.",category:"utility",version:"1.0",settings:[{id:"active",label:"Active by default",hint:"When enabled, turbo button is active as soon as the script loads on your device.",type:"toggle",default:0,editable:!0},{id:"turboButton",label:"Turbo Button",hint:"The button to press repeatedly.",type:"button",buttonRole:"script-output",default:"PS5_SQUARE",editable:!0,isVirtual:!0},{id:"time",label:"Repeat interval (ms)",hint:"How fast the button repeats. Lower means faster.",type:"number",min:20,max:500,default:40,editable:!0,isVirtual:!0}],handler:{device:"gamepad",primaryButton:"PS5_UP",trigger:"held",execution:"while-held"},init:"",priorityLogic:"",function:`// Turbo Button Mod
557function runTurboButton() {
558    combo_run(TurboButtonCombo);
559}`,combo:`// Turbo Button Mod
560combo TurboButtonCombo {
561    set_val(\${turboButton}, 100);
562    wait(\${time});
563    set_val(\${turboButton}, 0);
564    wait(\${time});
565}`}),b=a.u.MiscToggle({id:"SwapSticks",name:"Swap Sticks",description:"Moves looting and interact actions from the left stick button to the right stick button. More comfortable for extraction shooter players.",category:"utility",version:"1.0",handler:{device:"gamepad",primaryButton:"PS5_UP",trigger:"held",execution:"while-held"},suppressCombatFlag:"swapSticksActive",runtimeDefines:"int swapSticksActive;",priorityLogic:"swapSticksActive = settings[SwapSticksEnum] && ${INPUT_EXPR};",settings:[{id:"active",label:"Active by default",hint:"When enabled, swap sticks is active as soon as the script loads on your device.",type:"toggle",default:0,editable:!0},{id:"cursorSpeed",label:"Navigation speed",hint:"How fast the swapped stick moves. Raise it for quicker looting navigation.",type:"slider",min:1,max:15,default:5,isVirtual:!0,editable:!0}],init:"",function:e=>{let t=e.cursorSpeed,i=`    // 1. Swap the axes
566    swap(PS5_LX, PS5_RX);
567    swap(PS5_LY, PS5_RY);
568    
569    // 2. Multiply sensitivity and clamp to prevent overflow
570    set_val(PS5_LX, clamp(get_val(PS5_LX) * ${t}, -100, 100));
571    set_val(PS5_LY, clamp(get_val(PS5_LY) * ${t}, -100, 100));`;return`// Swap Sticks Mod (For Mouse Looting)
572function runSwapSticks() {
573${i}
574}`},combo:""}
574),h=a.u.ToggleOnly({id:"AntiAfk",name:"Anti AFK",description:"In-game AFK helper. Use fixed loop for classic behavior or Smart AFK to wait for inactivity before running the AFK loop.",category:"tactical",version:"1.1",activation:{button:"NONE",mode:"AUTO"},suppressCombatFlag:"antiAfkSuppressCombat",settings:[{id:"active",label:"Active by default",hint:"When enabled, Anti AFK is active as soon as the script loads on your device.",type:"toggle",default:0,editable:!0},{id:"mode",label:"Mode",hint:"Fixed loop runs the classic AFK loop. Smart AFK waits until you stop using the controller.",type:"list",options:["Fixed loop","Smart AFK"],optionDescriptions:[{title:"Fixed loop",description:"Runs the classic movement, fire, ADS, and reload loop while Anti AFK is enabled."},{title:"Smart AFK",description:"Waits for physical inactivity before starting the same in-game AFK loop."}],min:0,max:1,default:0,editable:!0,isVirtual:!0},{id:"idleTime",label:"Idle time (s)",hint:"How long Smart AFK waits before the AFK loop starts.",type:"slider",min:5,max:120,default:30,editable:!0,dependsOn:e=>1===e.mode,hideWhenDisabled:!0},{id:"deadzone",label:"Idle deadzone",hint:"Stick movement above this value resets Smart AFK.",type:"slider",min:5,max:40,default:12,editable:!0,dependsOn:e=>1===e.mode,hideWhenDisabled:!0}],runtimeDefines:"int antiAfkSuppressCombat = FALSE;",init:"antiAfkSuppressCombat = FALSE;",priorityLogic:"antiAfkSuppressCombat = combo_running(AntiAfkCombo);",mainLogicBlock:`if (toggle[ToggleAntiAfkEnum]) {
575    handleAntiAfk();
576} else {
577    resetAntiAfkRuntime();
578}`,function:e=>{let t=Number(e.mode??0),i=Number(e.idleTime??30),o=Number(e.deadzone??12);return 0===t?`// Anti AFK Mod
579int anti_afk_idle_timer = 0;
580
581function resetAntiAfkRuntime() {
582    anti_afk_idle_timer = 0;
583    antiAfkSuppressCombat = FALSE;
584    combo_stop(AntiAfkCombo);
585}
586
587function handleAntiAfk() {
588    combo_run(AntiAfkCombo);
589}`:`// Anti AFK Mod
590int anti_afk_idle_timer = 0;
591
592function resetAntiAfkRuntime() {
593    anti_afk_idle_timer = 0;
594    antiAfkSuppressCombat = FALSE;
595    combo_stop(AntiAfkCombo);
596}
597
598function handleAntiAfk() {
599    if (tunezPhysicalActivity(${o}) || get_ival(ADS_BTN) || get_ival(FIRE_BTN)) {
600        anti_afk_idle_timer = 0;
601        combo_stop(AntiAfkCombo);
602        return;
603    }
604
605    if (anti_afk_idle_timer < ${i} * 1000) {
606        anti_afk_idle_timer = anti_afk_idle_timer + get_rtime();
607    }
608
609    if (anti_afk_idle_timer >= ${i} * 1000) {
610        combo_run(AntiAfkCombo);
611    } else {
612        combo_stop(AntiAfkCombo);
613    }
614}`},combo:`// Anti AFK Mod Combo
615combo AntiAfkCombo {
616    set_val(PS5_LY, -100);
617    wait(2000);
618    set_val(PS5_LY, 0);
619    wait(100);
620    set_val(PS5_LY, 100);
621    wait(2000);
622    set_val(PS5_LY, 0);
623    wait(100);
624    set_val(ADS_BTN, 100);
625    set_val(FIRE_BTN, 100);
626    wait(2000);
627    set_val(FIRE_BTN, 0);
628    wait(2000);
629    set_val(ADS_BTN, 0);
630    wait(100);
631    set_val(RELOAD_BTN, 100);
632    wait(200);
633    set_val(RELOAD_BTN, 0);
634    wait(300);
635}`}),_=a.u.ToggleOnly({id:"LobbyKeepalive",name:"Lobby Keepalive",oledName:"Keepalive",description:"Background-safe keepalive for menus and lobbies. After long inactivity, it sends only a tiny right-stick pulse.",category:"utility",version:"1.0",activation:{button:"NONE",mode:"AUTO"},settings:[{id:"active",label:"Active by default",hint:"When enabled, Lobby Keepalive starts with the script and can stay on in the background.",type:"toggle",default:0,editable:!0},{id:"idleTime",label:"Idle time (s)",oledLabel:"Idle Time",hint:"How long to wait without physical input before sending a safe menu pulse.",type:"slider",min:60,max:900,default:60,editable:!0,isVirtual:!1},{id:"deadzone",label:"Idle deadzone",oledLabel:"Idle Deadzone",hint:"Stick movement above this value resets the idle timer.",type:"slider",min:5,max:40,default:12,editable:!0,isVirtual:!1},{id:"strength",label:"Pulse strength",oledLabel:"Pulse Strength",hint:"Right-stick pulse strength. Use enough to pass the game deadzone without feeling disruptive.",type:"slider",min:5,max:40,default:20,editable:!0,isVirtual:!1},{id:"duration",label:"Pulse time (ms)",oledLabel:"Pulse Time",hint:"How long the right-stick pulse is held.",type:"slider",min:20,max:80,default:40,editable:!0,isVirtual:!1}],init:"",priorityLogic:"",mainLogicBlock:`if (toggle[ToggleLobbyKeepaliveEnum]) {
636    handleLobbyKeepalive();
637} else {
638    resetLobbyKeepaliveRuntime();
639}`,function:e=>`// Lobby Keepalive Mod
640int lobby_keepalive_timer = 0;
641int lobby_keepalive_direction = 1;
642int lobby_keepalive_output = 0;
643
644function resetLobbyKeepaliveRuntime() {
645    lobby_keepalive_timer = 0;
646    lobby_keepalive_output = 0;
647    combo_stop(LobbyKeepaliveCombo);
648}
649
650function handleLobbyKeepalive() {
651    if (tunezPhysicalActivity(settings[LobbyKeepaliveDeadzoneEnum]) || get_ival(ADS_BTN) || get_ival(FI
651RE_BTN)) {
652        resetLobbyKeepaliveRuntime();
653        return;
654    }
655
656    if (lobby_keepalive_timer < settings[LobbyKeepaliveIdleTimeEnum] * 1000) {
657        lobby_keepalive_timer = lobby_keepalive_timer + get_rtime();
658    }
659
660    if (lobby_keepalive_timer >= settings[LobbyKeepaliveIdleTimeEnum] * 1000 && !combo_running(LobbyKeepaliveCombo)) {
661        lobby_keepalive_output = settings[LobbyKeepaliveStrengthEnum] * lobby_keepalive_direction;
662        combo_run(LobbyKeepaliveCombo);
663        lobby_keepalive_direction = inv(lobby_keepalive_direction);
664        lobby_keepalive_timer = 0;
665    }
666}`,combo:`// Lobby Keepalive Mod Combo
667combo LobbyKeepaliveCombo {
668    set_val(PS5_RX, lobby_keepalive_output);
669    wait(settings[LobbyKeepaliveDurationEnum]);
670    set_val(PS5_RX, 0);
671    wait(40);
672}`}),f={id:"JumpShot",name:"Jump Shot",description:"Automatically jumps while firing after the configured delay.",category:"movement",type:"toggle-only",version:"1.0",activation:{button:"FIRE_BTN",mode:"AUTO"},settings:[{id:"profile1",label:"Profile 1 active",hint:"Initial ON/OFF state for Jump Shot while Profile 1 is active. You can still toggle it from the OLED main menu while on Profile 1.",type:"toggle",default:0,isVirtual:!0,editable:!0},{id:"profile2",label:"Profile 2 active",hint:"Initial ON/OFF state for Jump Shot while Profile 2 is active. You can still toggle it from the OLED main menu while on Profile 2.",type:"toggle",default:0,isVirtual:!0,editable:!0},{id:"activation",label:"Activation",hint:"Choose when jumping starts.",type:"list",options:["Fire","ADS + Fire"],optionDescriptions:[{title:"Fire",description:"Jumps any time you shoot."},{title:"ADS + Fire",description:"Jumps only when you aim and shoot at the same time."}],default:0,isVirtual:!0,editable:!0},{id:"mode",label:"Mode",hint:"Always keeps jumping while firing. Once jumps only on the first shot per trigger pull.",type:"list",options:["Always","Once"],optionDescriptions:[{title:"Always",description:"Jumps every time you fire. Keeps you constantly moving and harder to hit."},{title:"Once",description:"Jumps only on the first shot per trigger pull. Less aggressive, more controlled."}],calloutMode:"all",default:0,isVirtual:!0,editable:!0},{id:"delay",label:"Activation delay (ms)",hint:"Wait time before the jump triggers after you press fire. Increase if jumps feel too early.",type:"slider",min:0,max:1e3,default:200,isVirtual:!0,editable:!0}],templates:{modEnum:"JumpShotEnum, ",modIdArray:"JumpShotEnum, ",asciiName:`${(e=>{let t=Array.from(e.toUpperCase().substring(0,15)).map(e=>e.charCodeAt(0));for(t.push(0);t.length<16;)t.push(0);return`{ ${t.join(", ")} }`})("Jump Shot")}, // JUMP SHOT`,runtimeDefines:e=>1===Number(e.mode??0)?`int toggleJumpShot[2];
673int jumpShotActivationActive = FALSE;
674int jumpShotFired = FALSE;
675int jumpShotTimer = 0;`:`int toggleJumpShot[2];
676int jumpShotActivationActive = FALSE;
677int jumpShotTimer = 0;`,init:e=>1===Number(e.mode??0)?`jumpShotActivationActive = FALSE;
678jumpShotFired = FALSE;
679jumpShotTimer = 0;`:`jumpShotActivationActive = FALSE;
680jumpShotTimer = 0;`,submenuBlock:"&& modId[currentMod] != JumpShotEnum",withProfileMod:"|| currentModId == JumpShotEnum",priorityLogic:`if (toggleJumpShot[profileId]) {
681    updateJumpShotActivationState();
682} else {
683    jumpShotActivationActive = FALSE;
684}`,mainLogicBlock:`if (toggleJumpShot[profileId]) {
685    handleJumpShot();
686} else {
687    resetJumpShotRuntime();
688}`,profileChanged:"resetJumpShotRuntime();",getToggleState:`// Jump Shot Mod
689case JumpShotEnum: {
690    return toggleJumpShot[profileId];
691}`,switchActiveMod:`// Jump Shot Mod
692case JumpShotEnum: {
693    toggleJumpShot[profileId] = !toggleJumpShot[profileId];
694    break;
695}`,saveBvar:`save_bvar_auto(toggleJumpShot[Profile1Enum], 0, 1);
696save_bvar_auto(toggleJumpShot[Profile2Enum], 0, 1);`,readBvar:`toggleJumpShot[Profile1Enum] = read_bvar_auto(0, 1, \${profile1});
697toggleJumpShot[Profile2Enum] = read_bvar_auto(0, 1, \${profile2});`,loadDefaults:`toggleJumpShot[Profile1Enum] = \${profile1};
698toggleJumpShot[Profile2Enum] = \${profile2};`,function:e=>{let t=Number(e.mode??0),i=1===Number(e.activation??0)?"(get_ival(ADS_BTN) >
698 50 && get_ival(FIRE_BTN) > 50)":"get_ival(FIRE_BTN) > 50",o=Number(e.delay??200);return 1===t?`// Jump Shot Mod
699function updateJumpShotActivationState() {
700    jumpShotActivationActive = ${i};
701}
702
703function resetJumpShotRuntime() {
704    jumpShotFired = FALSE;
705    jumpShotTimer = 0;
706    combo_stop(JumpShotCombo);
707}
708
709function handleJumpShot() {
710    if (jumpShotActivationActive && !passiveMod && !no_gun_state && !utility_state/* @[INLINE_SUPPRESS_COMBAT] */) {
711        if (jumpShotTimer < ${o}) {
712            jumpShotTimer = jumpShotTimer + get_rtime();
713        }
714        if (jumpShotTimer >= ${o} && !jumpShotFired) {
715            combo_run(JumpShotCombo);
716            jumpShotFired = TRUE;
717        }
718    } else if (!jumpShotActivationActive) {
719        resetJumpShotRuntime();
720    } else {
721        combo_stop(JumpShotCombo);
722    }
723}`:`// Jump Shot Mod
724function updateJumpShotActivationState() {
725    jumpShotActivationActive = ${i};
726}
727
728function resetJumpShotRuntime() {
729    jumpShotTimer = 0;
730    combo_stop(JumpShotCombo);
731}
732
733function handleJumpShot() {
734    if (jumpShotActivationActive && !passiveMod && !no_gun_state && !utility_state/* @[INLINE_SUPPRESS_COMBAT] */) {
735        if (jumpShotTimer < ${o}) {
736            jumpShotTimer = jumpShotTimer + get_rtime();
737        }
738        if (jumpShotTimer >= ${o}) {
739            combo_run(JumpShotCombo);
740        }
741    } else if (!jumpShotActivationActive) {
742        resetJumpShotRuntime();
743    } else {
744        combo_stop(JumpShotCombo);
745    }
746}`},combo:`// Jump Shot Mod Combo
747combo JumpShotCombo {
748    set_val(JUMP_BTN, 100);
749    wait(50);
750    set_val(JUMP_BTN, 0);
751    wait(50);
752}`}},E=a.u.ToggleOnly({id:"AutoSprint",name:"Auto Sprint",description:"Always sprints when you move. No need to hold the sprint button.",category:"movement",version:"2.0",activation:{button:"L3 ↑",mode:"AUTO"},settings:[{id:"active",label:"Active by default",hint:"When enabled, auto sprint is active as soon as the script loads on your device.",type:"toggle",default:0},{id:"direction",label:"Direction",type:"list",options:["Forward only","360\xb0 omni"],optionDescriptions:[{title:"Forward only",description:"Sprints when you push the stick straight forward."},{title:"360\xb0 omni",description:"Sprints in any direction you move."}],default:0,isVirtual:!0},{id:"mode",label:"Mode",type:"list",options:["Always on","Press sensitive"],optionDescriptions:[{title:"Always on",description:"Starts sprinting any time you move the stick."},{title:"Press sensitive",description:"Only sprints when you push the stick past the threshold below."}],default:0,isVirtual:!0},{id:"threshold",label:"Activation threshold",hint:"How far you need to push the stick before sprinting kicks in.",type:"slider",min:10,max:100,default:90,isVirtual:!0,dependsOn:e=>1===e.mode}],runtimeDefines:"int sprint_active = FALSE;\nint sprint_start_timer = 0;\nint koreanSlideSprintState = 0;",init:"",priorityLogic:"",mainLogicBlock:`if (toggle[ToggleAutoSprintEnum]) {
753    handleAutoSprint();
754} else {
755    resetAutoSprintRuntime();
756}`,function:e=>{let t=1===e.direction,i=0===e.mode?20:Number(e.threshold),o="";return o=t?`((get_ival(PS5_LX) * get_ival(PS5_LX)) + (get_ival(PS5_LY) * get_ival(PS5_LY))) >= ${i*i}`:`get_ival(PS5_LY) <= -${i}`,`// Auto Sprint Mod
757function resetAutoSprintRuntime() {
758    sprint_active = FALSE;
759    sprint_start_timer = 0;
760    combo_stop(AutoSprintCombo);
761}
762
763function handleAutoSprint() {
764    // Reserve Sprint for Korean Slide, including an already running sprint tap.
765    if (koreanSlideSprintState == 1) {
766        resetAutoSprintRuntime();
767        return;
768    }
769    if (${o} && !get_val(ADS_BTN) && !get_val(FIRE_BTN) && !passiveMod && !no_gun_state && !utility_state/* @[INLINE_SUPPRESS_COMBAT] */) {
770        if (koreanSlideSprintState == 2) {
771            sprint_active = TRUE;
772            sprint_start_timer = 0;
773        }
774        if (!sprint_active) {
775            sprint_start_timer = sprint_start_timer + get_rtime();
776            if (sprint_start_timer >= 120 && !combo_running(AutoSprintCombo)) {
777                combo_run(AutoSprintCombo);
778                sprint_active = TRUE;
779            }
780        }
781    } else {
782        resetAutoSprintRuntime();
783    }
784    if (koreanSlideSprintState == 2) {
785        koreanSlideSprintState = 0;
786    }
787}`},combo:`// Auto Sprint Tap Combo
788combo AutoSprintCombo {
789    set_val(SPRINT_BTN, 100);
790    wait(50);
791    set_val(SPRINT_BTN, 0);
792    wait(50);
793}`}
793),v={id:"CrouchShot",name:"Crouch Shot",description:"Automatically crouches when you shoot, either once per shot or repeatedly while firing.",category:"movement",type:"toggle-only",version:"1.0",activation:{button:"NONE",mode:"AUTO"},settings:[{id:"profile1",label:"Profile 1 active",hint:"Initial ON/OFF state for Crouch Shot while Profile 1 is active. You can still toggle it from the OLED main menu while on Profile 1.",type:"toggle",default:0,isVirtual:!0,editable:!0},{id:"profile2",label:"Profile 2 active",hint:"Initial ON/OFF state for Crouch Shot while Profile 2 is active. You can still toggle it from the OLED main menu while on Profile 2.",type:"toggle",default:0,isVirtual:!0,editable:!0},{id:"activation",label:"Activation",hint:"Choose when crouch tapping starts.",type:"list",options:["Fire","ADS + Fire"],optionDescriptions:[{title:"Fire",description:"Crouch taps any time you shoot."},{title:"ADS + Fire",description:"Crouch taps only when you aim and shoot at the same time."}],default:1,isVirtual:!0,editable:!0},{id:"mode",label:"Mode",hint:"Choose whether crouch shot fires once or repeats while active.",type:"list",options:["Once","Repeat"],optionDescriptions:[{title:"Once",description:"Taps crouch one time when the activation starts."},{title:"Repeat",description:"Keeps alternating crouch while the activation is held."}],default:1,isVirtual:!0,editable:!0},{id:"rhythm",label:"Crouch rhythm (ms)",hint:"Repeat mode only. Time between crouch taps. Lower values crouch more rapidly.",type:"slider",min:80,max:300,default:125,isVirtual:!0,editable:!0,dependsOn:e=>1===e.mode},{id:"pressDuration",label:"Press duration (ms)",hint:"How long each crouch tap is held.",type:"slider",min:30,max:100,default:75,isVirtual:!0,editable:!0}],templates:{modEnum:"CrouchShotEnum, ",modIdArray:"CrouchShotEnum, ",asciiName:`${(e=>{let t=Array.from(e.toUpperCase().substring(0,15)).map(e=>e.charCodeAt(0));for(t.push(0);t.length<16;)t.push(0);return`{ ${t.join(", ")} }`})("Crouch Shot")}, // CROUCH SHOT`,runtimeDefines:e=>0===Number(e.mode??1)?`int toggleCrouchShot[2];
794int crouchShotActivationActive = FALSE;
795int cs_fired = FALSE;`:`int toggleCrouchShot[2];
796int crouchShotActivationActive = FALSE;`,init:e=>0===Number(e.mode??1)?`crouchShotActivationActive = FALSE;
797cs_fired = FALSE;`:"crouchShotActivationActive = FALSE;",submenuBlock:"&& modId[currentMod] != CrouchShotEnum",withProfileMod:"|| currentModId == CrouchShotEnum",priorityLogic:`if (toggleCrouchShot[profileId]) {
798    updateCrouchShotActivationState();
799} else {
800    crouchShotActivationActive = FALSE;
801}`,mainLogicBlock:`if (toggleCrouchShot[profileId]) {
802    handleCrouchShot();
803} else {
804    resetCrouchShotRuntime();
805}`,profileChanged:"resetCrouchShotRuntime();",getToggleState:`// Crouch Shot Mod
806case CrouchShotEnum: {
807    return toggleCrouchShot[profileId];
808}`,switchActiveMod:`// Crouch Shot Mod
809case CrouchShotEnum: {
810    toggleCrouchShot[profileId] = !toggleCrouchShot[profileId];
811    break;
812}`,saveBvar:`save_bvar_auto(toggleCrouchShot[Profile1Enum], 0, 1);
813save_bvar_auto(toggleCrouchShot[Profile2Enum], 0, 1);`,readBvar:`toggleCrouchShot[Profile1Enum] = read_bvar_auto(0, 1, \${profile1});
814toggleCrouchShot[Profile2Enum] = read_bvar_auto(0, 1, \${profile2});`,loadDefaults:`toggleCrouchShot[Profile1Enum] = \${profile1};
815toggleCrouchShot[Profile2Enum] = \${profile2};`,function:e=>{let t=1===Number(e.activation??1)?"(get_ival(ADS_BTN) > 50 && get_ival(FIRE_BTN) > 50)":"get_ival(FIRE_BTN) > 50";return 0===Number(e.mode??1)?`// Crouch Shot Mod (Once)
816function updateCrouchShotActivationState() {
817    crouchShotActivationActive = ${t};
818}
819
820function resetCrouchShotRuntime() {
821    cs_fired = FALSE;
822    combo_stop(CrouchShotCombo);
823}
824
825function handleCrouchShot() {
826    if (crouchShotActivationActive && !passiveMod && !no_gun_state && !utility_state/* @[INLINE_SUPPRESS_COMBAT] */) {
827        if (!cs_fired) {
828            combo_run(CrouchShotCombo);
829            cs_fired = TRUE;
830        }
831    } else if (!crouchShotActivationActive) {
832        resetCrouchShotRuntime();
833    } else {
834        combo_stop(CrouchShotCombo);
835    }
836}`:`// Crouch Shot Mod (Repeat)
837function updateCrouchShotActivationState() {
838    crouchShotActivationActive = ${t};
839}
840
841function resetCrouchShotRuntime() {
842    combo_stop(CrouchShotCombo);
843}
844
845function handleCrouchShot() {
846    if (crouchShotActivationActive && !passiveMod && !no_gun_state && !utility_state/* @[INLINE_SUPPRESS_COMBAT] */) {
847        combo_run(CrouchShotCombo);
848    } else {
849        combo_stop(CrouchShotCombo);
850    }
851}`},combo:e=>`// Crouch Shot Mod Combo
852combo CrouchShotCombo {
853    set_val(CROUCH_BTN, 100);
854    wait(${e.pressDuration});
855    set_val(CROUCH_BTN, 0);
856    wait(${e.rhythm});
857}`}},A=a.u.ToggleOnly({id:"StrafeShot",name:"Strafe Shot",description:"Automatically moves left and right while you shoot, making you harder to hit without changing your aim.",category:"movement",version:"1.0",activation:{button:"NONE",mode:"AUTO"},settings:[{id:"active",label:"Active by default",hint:"When enabled, strafe shot is active as soon as the script loads on your device.",type:"toggle",default:0},{id:"activation",label:"Activation",hint:"Choose when auto-strafe starts.",type:"list",options:["Fire","ADS + Fire"],optionDescriptions:[{title:"Fire",description:"Strafes any time you shoot."},{title:"ADS + Fire",description:"Strafes only when you aim and shoot at the same time."}],default:0,isVirtual:!0},{id:"direction",label:"Direction",hint:"Choose the side movement pattern.",type:"list",options:["Left / Right","Right / Left","Left only","Right only"],optionDescriptions:[{title:"Left / Right",description:"Starts left, then switches right."},{title:"Right / Left",description:"Starts right, then switches left."},{title:"Left only",description:"Keeps pushing left while the mod is active."},{title:"Right only",description:"Keeps pushing right while the mod is active."}],default:0,isVirtual:!0},{id:"switchDelay",label:"Side switch delay (ms)",hint:"Lower values switch direction faster. Higher values hold each side longer.",type:"slider",min:60,max:300,default:150,isVirtual:!0},{id:"strength",label:"Strafe strength",hint:"How far the movement stick is pushed sideways.",type:"slider",min:20,max:100,default:75,isVirtual:!0},{id:"manualOverride",label:"Manual override",hint:"Auto-strafe stops when your manual movement is stronger than this.",type:"slider",min:0,max:50,default:20,isVirtual:!0}],runtimeDefines:e=>1>=Number(e.direction)?"int strafe_shot_timer;\nint strafe_shot_phase;":"",init:e=>1>=Number(e.direction)?"strafe_shot_timer = 0;\nstrafe_shot_phase = 0;":"",priorityLogic:"",function:e=>{let t=1===e.activation?"(get_ival(ADS_BTN) >
857 50 && get_ival(FIRE_BTN) > 50)":"get_ival(FIRE_BTN) > 50",i=Number(e.direction),o=Number(e.strength),a=Number(e.switchDelay),n=Number(e.manualOverride),s=`${t} && !passiveMod && !no_gun_state && !utility_state/* @[INLINE_SUPPRESS_COMBAT] */ && abs(get_ival(PS5_LX)) <= ${n} && abs(get_ival(PS5_LY)) <= ${n}`;return 2===i?`// Strafe Shot Mod
858function handleStrafeShot() {
859    if (${s}) {
860        set_val(PS5_LX, -${o});
861    }
862}`:3===i?`// Strafe Shot Mod
863function handleStrafeShot() {
864    if (${s}) {
865        set_val(PS5_LX, ${o});
866    }
867}`:`// Strafe Shot Mod
868function handleStrafeShot() {
869    if (${s}) {
870        strafe_shot_timer = strafe_shot_timer + get_rtime();
871        if (strafe_shot_timer >= ${a}) {
872            strafe_shot_timer = 0;
873            strafe_shot_phase = !strafe_shot_phase;
874        }
875        if (strafe_shot_phase == 0) {
876            set_val(PS5_LX, ${1===i?o:-o});
877        } else {
878            set_val(PS5_LX, ${1===i?-o:o});
879        }
880    } else {
881        strafe_shot_timer = 0;
882    }
883}`},combo:""}),y=a.u.ScaleSlider({id:"SniperBreath",name:"Sniper Breath",description:"Automatically holds the Sprint button while aiming to activate your game’s hold-breath action.",category:"aim",version:"2.0",activation:{button:"NONE",mode:"AUTO"},settings:[{id:"active",label:"Active by default",hint:"When enabled, sniper breath is active as soon as the script loads on your device.",type:"toggle",default:0},{id:"holdTime",label:"Breath timer (s)",hint:"How long to hold your breath during steady aim.",type:"slider",min:0,max:4,default:3},{id:"activationDelay",label:"Delay before (s)",hint:"Wait time before starting to hold breath after aiming.",type:"slider",min:0,max:20,default:5},{id:"cooldown",label:"Cooldown (ms)",hint:"Recovery period between breaths to prevent exhaustion.",type:"slider",min:0,max:20,default:3}],percentSettingId:"cooldown",init:"",priorityLogic:"",mainLogicBlock:`if (toggle[ToggleSniperBreathEnum]) {
884    handleSniperBreath();
885} else {
886    resetSniperBreathRuntime();
887}`,function:`// Sniper Breath Mod
888function resetSniperBreathRuntime() {
889    combo_stop(SniperBreathCombo);
890}
891
892function handleSniperBreath() {
893    // 1. Условие работы: целимся (ADS) и не бежим вперед (LY >= -90)
894    if (get_ival(ADS_BTN) && get_ival(PS5_LY) >= -90 && !passiveMod && !no_gun_state && !utility_state/* @[INLINE_SUPPRESS_COMBAT] */) {
895        
896        // 2. Ждем начальную задержку (Activation Delay)
897        if (get_ptime(ADS_BTN) >= (settings[SniperBreathActivationDelayEnum] * 1000)) {
898            
899            // 3. Запускаем цикл (Дыхание -> Кулдаун)
900            if (!combo_running(SniperBreathCombo)) {
901                combo_run(SniperBreathCombo);
902            }
903        }
904    } else {
905        // 4. Мгновенно всё сбрасываем при отпускании прицела или резком рывке стика
906        resetSniperBreathRuntime();
907    }
908}`,combo:`// Sniper Breath Mod Combo
909combo SniperBreathCombo {
910    set_val(SPRINT_BTN, 100);
911    wait(settings[SniperBreathHoldTimeEnum] * 1000); // Держим дыхание
912    set_val(SPRINT_BTN, 0);
913    wait(settings[SniperBreathCooldownEnum] * 100);  // Отдыхаем (Кулдаун)
914}`}),P=a.u.ToggleOnly({id:"SlideCancel",name:"Slide Cancel",description:"Automatically cancels slides at the right moment. Keeps you moving at full speed without slowing down.",category:"movement",version:"2.0",activation:{button:"CROUCH_BTN",mode:"AUTO"},settings:[{id:"active",label:"Active by default",hint:"When enabled, slide cancel is active as soon as the script loads on your device.",type:"toggle",default:0,editable:!0},{id:"detectionMode",label:"Detection mode",hint:"When the slide cancel fires.",type:"list",options:["Release","Auto-cancel"],optionDescriptions:[{title:"Release",description:"Cancels when you let go of Crouch. Ignores short taps, so normal dodge rolls still work. Best for Arc Raiders."},{title:"Auto-cancel",description:"Cancels automatically after the set duration, even while holding the button. Best for CoD and Apex."}],default:1,isVirtual:!0,editable:!0},{id:"cancelMechanic",label:"Cancel mechanic",hint:"The button combo used to perform the cancel.",type:"list",options:["Crouch + jump","Jump only","Crouch only"],optionDescriptions:[{title:"Crouch + jump",description:"Press crouch then jump. Classic Call of Duty slide cancel."},{title:"Jump only",description:"Press jump to cancel. Used in Apex Legends."},{title:"Crouch only",description:"Press crouch once to cancel. Used in Arc Raiders for the dodge roll."}],default:2,isVirtual:!0,editable:!0},{id:"slideDuration",label:"Slide duration (ms)",oledLabel:"Slide Duration",hint:"Release mode: minimum hold time to count as a slide. Auto-cancel mode: how long before the cancel fires automatically.",type:"slider",min:50,max:1e3,default:350,isVirtual:!1,editable:!0},{id:"syncDelay",label:"Initial sync delay (ms)",hint:"Small pause before the cancel fires. Increase if the cancel triggers too early.",type:"slider",min:0,max:100,default:40,isVirtual:!0,editable:!0},{id:"actionDelay",label:"Action delay (ms)",oledLabel:"Action Delay",hint:"Duration of button presses inside the cancel combo. 30ms is standard.",type:"slider",min:10,max:100,default:30,isVirtual:!1,editable:!0}],init:e=>0===e.detectionMode?"sc_timer = 0;":`sc_timer = 0;
915sc_active = FALSE;`,runtimeDefines:e=>0===e.detectionMode?"int sc_timer;":`int sc_timer;
916int sc_active;`,priorityLogic:"",mainLogicBlock:`if (toggle[ToggleSlideCancelEnum]) {
917    handleSlideCancel();
918} else {
919    resetSlideCancelRuntime();
920}`,function:e=>{let t=e.detectionMode,i=`// Modular Slide Cancel
921function resetSlideCancelRuntime() {
922    sc_timer = 0;${0===t?"":"\n    sc_active = FALSE;"}
923    combo_stop(SlideCancelCombo);
924}
925
926function handleSlideCancel() {
927    if (!(!passiveMod && !no_gun_state && !utility_state/* @[INLINE_SUPPRESS_COMBAT] */)) {
928        resetSlideCancelRuntime();
929        return;
930    }
931
932`;return 0===t?i+=`    if (get_ival(CROUCH_BTN)) {
933        sc_timer = sc_timer + get_rtime();
934    } else {
935        // Button released. Was it a slide?
936        if (sc_timer >= settings[SlideCancelSlideDurationEnum]) {
937            combo_run(SlideCancelCombo);
938        }
939        sc_timer = 0;
940    }`:i+=`    if (get_ival(CROUCH_BTN)) {
941        sc_timer = sc_timer + get_rtime();
942        if (sc_timer >= settings[SlideCancelSlideDurationEnum] && !sc_active) {
943            combo_run(SlideCancelCombo);
944            sc_active = TRUE; // Lock so it only cancels once per slide
945        }
946        
947        // Force physical release output so player doesn't instantly crouch again after cancel
948        if (sc_active) {
949            set_val(CROUCH_BTN, 0);
950        }
951    } else {
952        sc_timer = 0;
953        sc_active = FALSE; // Reset lock when physical button is released
954    }`,i+=`
955
956    if (combo_running(SlideCancelCombo) && get_val(ADS_BTN)) {
957        combo_stop(SlideCancelCombo);
958    }
959}`},combo:e=>{let t=e.cancelMechanic,i=Number(e.syncDelay),o=`// Modular Slide Cancel Combo
960combo SlideCancelCombo {
961`;return i>0&&(o+=`    wait(${i});
962`),0===t?o+=`    set_val(CROUCH_BTN, 100);
963    wait(settings[SlideCancelActionDelayEnum]);
964    set_val(CROUCH_BTN, 0);
965    wait(settings[SlideCancelActionDelayEnum]);
966    set_val(JUMP_BTN, 100);
967    wait(settings[SlideCancelActionDelayEnum]);
968    set_val(JUMP_BTN, 0);
969`:1===t?o+=`    set_val(JUMP_BTN, 100);
970    wait(settings[SlideCancelActionDelayEnum]);
971    set_val(JUMP_BTN, 0);
972`:2===t&&(o+=`    set_val(CROUCH_BTN, 100);
973    wait(settings[SlideCancelActionDelayEnum]);
974    set_val(CROUCH_BTN, 0);
975`),o+=`    wait(50);
976}`}}),T=a.u.ToggleOnly({id:"KoreanSlide",name:"Korean Slide",description:"Performs a crouch-slide sequence when you press Crouch while moving forward.",category:"movement",version:"0.3",settings:[{id:"active",label:"Active by default",type:"toggle",default:0,editable:!0,hint:"Set Crouch to Toggle in your game settings."},{id:"forwardThreshold",label:"Forward activation (%)",oledLabel:"Forward min",type:"slider",min:20,max:100,default:60,isVirtual:!1,editable:!0,hint:"How far to push the movement stick forward to activate the mod. Pull back below this value to cancel."},{id:"firstPressMs",label:"First crouch press (ms)",oledLabel:"First press",type:"slider",min:40,max:200,default:100,isVirtual:!1,editable:!0,hint:"How long the first Crouch press lasts before the button is released."},{id:"followUpDelayMs",label:"Follow-up delay (ms)",oledLabel:"Follow-up delay",type:"slider",min:50,max:1e3,default:300,isVirtual:!1,editable:!0,hint:"How long to wait after the first Crouch press before the two quick presses."},{id:"tapIntervalMs",label:"Tap interval (ms)",oledLabel:"Tap interval",type:"slider",min:10,max:200,default:35,isVirtual:!1,editable:!0,hint:"The pause between the two quick Crouch presses. Each press lasts 50 ms."},{id:"sprintDelayMs",label:"Sprint delay (ms)",oledLabel:"Sprint delay",type:"slider",min:10,max:300,default:60,isVirtual:!1,editable:!0,hint:"How long to wait after the third Crouch press before pressing Sprint."}],runtimeDefines:`int koreanSlideSprintState = 0;
977int ks_active = FALSE;
978int ks_wait_release = TRUE;
979int ks_consumed = FALSE;`,priorityLogic:`if (koreanSlideCanRun() && (ks_active || (!ks_wait_release && get_ival(CROUCH_BTN) && !get_lval(CROUCH_BTN)))) {
980    koreanSlideSprintState = 1;
981}`,mainLogicBlock:"handleKoreanSlide();",function:`function koreanSlideCanRun() {
982    return toggle[ToggleKoreanSlideEnum]
983        && (currentState == STATE_PLAYING || currentState == STATE_SCREEN_SAVER)
984        && get_ival(PS5_LY) <= -settings[KoreanSlideForwardThresholdEnum]
985        && !get_ival(ADS_BTN) && !get_ival(FIRE_BTN)
986        && !passiveMod && !no_gun_state && !utility_state/* @[INLINE_SUPPRESS_COMBAT] */;
987}
988
989function resetKoreanSlideRuntime() {
990    combo_stop(KoreanSlideCombo);
991    ks_active = FALSE;
992    ks_wait_release = get_ival(CROUCH_BTN) != 0;
993    ks_consumed = FALSE;
994    koreanSlideSprintState = 0;
995}
996
997function handleKoreanSlide() {
998    if (!koreanSlideCanRun()) {
999        resetKoreanSlideRuntime();
1000        return;
1001    }
1002
1003    if (ks_active) {
1004        ks_wait_release = TRUE;
1005        if (!combo_running(KoreanSlideCombo)) {
1006            ks_active = FALSE;
1007            koreanSlideSprintState = 2;
1008        }
1009    } else if (!ks_wait_release && get_ival(CROUCH_BTN) && !get_lval(CROUCH_BTN)) {
1010        ks_active = TRUE;
1011        ks_wait_release = TRUE;
1012        ks_consumed = TRUE;
1013        koreanSlideSprintState = 1;
1014        combo_run(KoreanSlideCombo);
1015    } else {
1016        combo_stop(KoreanSlideCombo);
1017    }
1018
1019    // Consume the activating hold so it cannot crouch again after the sequence.
1020    if (ks_consumed) {
1021        set_val(CROUCH_BTN, 0);
1022    }
1023    if (!ks_active && !get_ival(CROUCH_BTN)) {
1024        ks_wait_release = FALSE;
1025        ks_consumed = FALSE;
1026    }
1027}`,combo:`combo KoreanSlideCombo {
1028    set_val(PS5_LY, -100);
1029    set_val(CROUCH_BTN, 100);
1030    set_val(SPRINT_BTN, 0);
1031    wait(settings[KoreanSlideFirstPressMsEnum]);
1032
1033    set_val(CROUCH_BTN, 0);
1034    set_val(SPRINT_BTN, 0);
1035    wait(settings[KoreanSlideFollowUpDelayMsEnum]);
1036
1037    set_val(PS5_LY, -100);
1038    set_val(CROUCH_BTN, 100);
1039    set_val(SPRINT_BTN, 0);
1040    wait(50);
1041
1042    set_val(CROUCH_BTN, 0);
1043    set_val(SPRINT_BTN, 0);
1044    wait(settings[KoreanSlideTapIntervalMsEnum]);
1045
1046    set_val(PS5_LY, -100);
1047    set_val(CROUCH_BTN, 100);
1048    set_val(SPRINT_BTN, 0);
1049    wait(50);
1050
1051    set_val(CROUCH_BTN, 0);
1052    set_val(SPRINT_BTN, 0);
1053    wait(settings[KoreanSlideSprintDelayMsEnum]);
1054
1055    set_val(PS5_LY, -100);
1056    set_val(CROUCH_BTN, 0);
1057    set_val(SPRINT_BTN, 100);
1058    wait(60);
1059
1060    set_val(CROUCH_BTN, 0);
1061    set_val(SPRINT_BTN, 0);
1062    wait(70);
1063}`});T.templates.setupMenuInput="resetKoreanSlideRuntime();",T.templates.offStateInput="resetKoreanSlideRuntime();";var $=i(94917);let R=e=>{let t=Number(e);return Number.isInteger(t)&&t>=1&&t<=4?t:1},C={id:"ScopeAssist",name:"Scope Assist",description:"Automates ADS and fire timing for scoped weapons, with per-profile and weapon-specific modes.",category:"aim",type:"toggle-only",version:"1.0",activation:{button:"FIRE_BTN",mode:"AUTO"},settings:[{id:"profile1",label:"Profile 1 active",hint:"Initial ON/OFF state for Scope Assist while Profile 1 is active. You can still toggle it from the OLED main menu while on Profile 1.",type:"toggle",default:0,isVirtual:!0,editable:!0},{id:"profile2",label:"Profile 2 active",hint:"Initial ON/OFF state for Scope Assist while Profile 2 is active. You can still toggle it from the OLED main menu while on Profile 2.",type:"toggle",default:0,isVirtual:!0,editable:!0},{id:"profile1Mode",label:"Profile 1 mode",hint:"Scope Assist behavior used by Profile 1 when Weapon Profiles are disabled.",type:"list",options:[...$.aV],optionDescriptions:[{title:"Auto Scope",description:"Holding Fire also holds ADS immediately."},{title:"ADS Auto Fire",description:"Holding Fire also holds ADS, and holding ADS also holds Fire. If Rapid Fire is active, ADS-triggered Fire pulses instead of holding."},{title:"Scoped Fire",description:"Holding Fire blocks the first shot, holds ADS, waits, then allows Fire."},{title:"Quick Scope",description:"Pressing Fire runs ADS, waits, fires once, then releases ADS."}],calloutMode:"selected",default:1,isVirtual:!0,editable:!0},{id:"profile2Mode",label:"Profile 2 mode",hint:"Scope Assist behavior used by Profile 2 when Weapon Profiles are disabled.",type:"list",options:[...$.aV],optionDescriptions:[{title:"Auto Scope",description:"Holding Fire also holds ADS immediately."},{title:"ADS Auto Fire",description:"Holding Fire also holds ADS, and holding ADS also holds Fire. If Rapid Fire is active, ADS-triggered Fire pulses instead of holding."},{title:"Scoped Fire",description:"Holding Fire blocks the first shot, holds ADS, waits, then allows Fire."},{title:"Quick Scope",description:"Pressing Fire runs ADS, waits, fires once, then releases ADS."}],calloutMode:"selected",default:1,isVirtual:!0,editable:!0},{id:"scopeDelay",label:"Scoped Fire delay (ms)",oledLabel:"Scoped Delay",hint:"Shared timing for Profile modes and weapon-specific Scoped Fire. Time to hold ADS before Fire is allowed.",type:"slider",min:0,max:500,default:200,isVirtual:!1,editable:!0},{id:"quickScopeDelay",label:"Quick Scope delay (ms)",oledLabel:"QS Delay",hint:"Shared timing for Profile modes and weapon-specific Quick Scope. Time to hold ADS before the one-shot Fire tap.",type:"slider",min:0,max:600,default:250,isVirtual:!1,editable:!0},{id:"shotHold",label:"Quick Scope shot hold (ms)",oledLabel:"QS Shot Hold",hint:"Shared timing for Profile modes and weapon-specific Quick Scope. How long the automated Fire tap is held.",type:"slider",min:20,max:120,default:40,isVirtual:!1,editable:!0}],suppressCombatFlag:"scopeAssistSuppressCombat",templates:{modEnum:"ScopeAssistEnum, ",modIdArray:"ScopeAssistEnum, ",asciiName:`${(e=>{let t=Array.from(e.toUpperCase().substring(0,15)).map(e=>e.charCodeAt(0));for(t.push(0);t.length<16;)t.push(0);return`{ ${t.join(", ")} }`})("Scope Assist")}, // SCOPE ASSIST`,runtimeDefines:`define ScopeAssistOff = 0;
1064define ScopeAssistAutoScope = 1;
1065define ScopeAssistAutoScopeFireOnAds = 2;
1066define ScopeAssistScopedFire = 3;
1067define ScopeAssistQuickScope = 4;
1068define ScopeAssistScopedIdle = 0;
1069define ScopeAssistScopedWait = 1;
1070define ScopeAssistScopedFireActive = 2;
1071define ScopeAssistFireBlockTime = 50;
1072define ScopeAssistQuickIdle = 0;
1073define ScopeAssistQuickWait = 1;
1074define ScopeAssistQuickFire = 2;
1075define ScopeAssistQuickDone = 3;
1076int toggleScopeAssist[2];
1077int scopeAssistProfileMode[2];
1078int scopeAssistWeaponMode;
1079int scopeAssistUseWeaponModes = FALSE;
1080int scopeAssistMode;
1081int scopeAssistScopedFireTimer = 0;
1082int scopeAssistScopedFirePhase = 0;
1083int scopeAssistQuickScopeLocked = FALSE;
1084int scopeAssistQuickScopeTimer = 0;
1085int scopeAssistQuickScopePhase = 0;
1086int scopeAssistSuppressCombat = FALSE;`,init:`scopeAssistScopedFireTimer = 0;
1087scopeAssistScopedFirePhase = ScopeAssistScopedIdle;
1088scopeAssistQuickScopeLocked = FALSE;
1089scopeAssistQuickScopeTimer = 0;
1090scopeAssistQuickScopePhase = ScopeAssistQuickIdle;
1091if (!scopeAssistUseWeaponModes) {
1092    scopeAssistWeaponMode = ScopeAssistOff;
1093}
1094scopeAssistSuppressCombat = FALSE;`,settingsLabel:`
1095        , "SCOPED DELAY" // ScopeAssistScopeDelayEnum
1096        , "QS DELAY" // ScopeAssistQuickScopeDelayEnum
1097        , "QS SHOT HOLD" // ScopeAssistShotHoldEnum`,submenuBlock:"",submenuDispatcher:`// Scope Assist Mod
1098case ScopeAssistEnum: {
1099    renderGenericSubMenu(modMenu, ScopeAssistScopeDelayEnum, ScopeAssistShotHoldEnum);
1100    break;
1101}`,withProfileMod:"|| currentModId == ScopeAssistEnum",priorityLogic:`if (toggleScopeAssist[profileId]) {
1102    handleScopeAssist();
1103} else {
1104    resetScopeAssistRuntime();
1105}`,profileChanged:"resetScopeAssistRuntime();",getToggleState:`// Scope Assist Mod
1106case ScopeAssistEnum: {
1107    return toggleScopeAssist[profileId];
1108}`,switchActiveMod:`// Scope Assist Mod
1109case ScopeAssistEnum: {
1110    toggleScopeAssist[profileId] = !toggleScopeAssist[profileId];
1111    break;
1112}`,saveBvar:`save_bvar_auto(toggleScopeAssist[Profile1Enum], 0, 1);
1113save_bvar_auto(toggleScopeAssist[Profile2Enum], 0, 1);
1114save_bvar_auto(scopeAssistProfileMode[Profile1Enum], 1, 4);
1115save_bvar_auto(scopeAssistProfileMode[Profile2Enum], 1, 4);
1116save_bvar_auto(settings[ScopeAssistScopeDelayEnum], 0, 500);
1117save_bvar_auto(settings[ScopeAssistQuickScopeDelayEnum], 0, 600);
1118save_bvar_auto(settings[ScopeAssistShotHoldEnum], 20, 120);`,readBvar:e=>`toggleScopeAssist[Profile1Enum] = read_bvar_auto(0, 1, \${profile1});
1119toggleScopeAssist[Profile2Enum] = read_bvar_auto(0, 1, \${profile2});
1120scopeAssistProfileMode[Profile1Enum] = read_bvar_auto(1, 4, ${R(e.profile1Mode)});
1121scopeAssistProfileMode[Profile2Enum] = read_bvar_auto(1, 4, ${R(e.profile2Mode)});
1122settings[ScopeAssistScopeDelayEnum] = read_bvar_auto(0, 500, \${scopeDelay});
1123settings[ScopeAssistQuickScopeDelayEnum] = read_bvar_auto(0, 600, \${quickScopeDelay});
1124settings[ScopeAssistShotHoldEnum] = read_bvar_auto(20, 120, \${shotHold});`,loadDefaults:e=>`toggleScopeAssist[Profile1Enum] = \${profile1};
1125toggleScopeAssist[Profile2Enum] = \${profile2};
1126scopeAssistProfileMode[Profile1Enum] = ${R(e.profile1Mode)};
1127scopeAssistProfileMode[Profile2Enum] = ${R(e.profile2Mode)};
1128settings[ScopeAssistScopeDelayEnum] = \${scopeDelay};
1129settings[ScopeAssistQuickScopeDelayEnum] = \${quickScopeDelay};
1130settings[ScopeAssistShotHoldEnum] = \${shotHold};`,minMaxTable:`
1131        , { 0, 500 } // ScopeAssistScopeDelayEnum
1132        , { 0, 600 } // ScopeAssistQuickScopeDelayEnum
1133        , { 20, 120 }
1133 // ScopeAssistShotHoldEnum`,settingEnum:", ScopeAssistScopeDelayEnum, ScopeAssistQuickScopeDelayEnum, ScopeAssistShotHoldEnum",function:e=>`// Scope Assist Mod
1134function resetScopeAssistRuntime() {
1135    scopeAssistScopedFireTimer = 0;
1136    scopeAssistScopedFirePhase = ScopeAssistScopedIdle;
1137    scopeAssistQuickScopeLocked = FALSE;
1138    scopeAssistQuickScopeTimer = 0;
1139    scopeAssistQuickScopePhase = ScopeAssistQuickIdle;
1140    scopeAssistSuppressCombat = FALSE;
1141}
1142
1143function updateScopeAssistMode() {
1144    if (scopeAssistUseWeaponModes) {
1145        scopeAssistMode = scopeAssistWeaponMode;
1146    } else {
1147        scopeAssistMode = scopeAssistProfileMode[profileId];
1148    }
1149}
1150
1151function handleScopeAssist() {
1152    updateScopeAssistMode();
1153    scopeAssistSuppressCombat = FALSE;
1154
1155    if (!(scopeAssistMode != ScopeAssistOff && !passiveMod && !no_gun_state && !utility_state/* @[INLINE_SUPPRESS_COMBAT] */)) {
1156        resetScopeAssistRuntime();
1157        return;
1158    }
1159
1160    if (scopeAssistMode == ScopeAssistAutoScope) {
1161        scopeAssistScopedFireTimer = 0;
1162        scopeAssistScopedFirePhase = ScopeAssistScopedIdle;
1163        scopeAssistQuickScopeLocked = FALSE;
1164        scopeAssistQuickScopeTimer = 0;
1165        scopeAssistQuickScopePhase = ScopeAssistQuickIdle;
1166
1167        if (get_val(FIRE_BTN) > 50) {
1168            set_val(ADS_BTN, 100);
1169        }
1170    } else if (scopeAssistMode == ScopeAssistAutoScopeFireOnAds) {
1171        scopeAssistScopedFireTimer = 0;
1172        scopeAssistScopedFirePhase = ScopeAssistScopedIdle;
1173        scopeAssistQuickScopeLocked = FALSE;
1174        scopeAssistQuickScopeTimer = 0;
1175        scopeAssistQuickScopePhase = ScopeAssistQuickIdle;
1176
1177        if (get_val(FIRE_BTN) > 50) {
1178            set_val(ADS_BTN, 100);
1179        }
1180        if (get_val(ADS_BTN) > 50) {
1181            set_val(FIRE_BTN, 100);
1182        }
1183    } else if (scopeAssistMode == ScopeAssistScopedFire) {
1184        scopeAssistQuickScopeLocked = FALSE;
1185        scopeAssistQuickScopeTimer = 0;
1186        scopeAssistQuickScopePhase = ScopeAssistQuickIdle;
1187
1188        if (get_val(FIRE_BTN) <= 50) {
1189            scopeAssistScopedFireTimer = 0;
1190            scopeAssistScopedFirePhase = ScopeAssistScopedIdle;
1191            set_val(FIRE_BTN, 0);
1192        } else {
1193            if (scopeAssistScopedFirePhase == ScopeAssistScopedIdle) {
1194                scopeAssistScopedFireTimer = 0;
1195                scopeAssistScopedFirePhase = ScopeAssistScopedWait;
1196            }
1197
1198            set_val(ADS_BTN, 100);
1199            set_val(FIRE_BTN, 0);
1200
1201            if (scopeAssistScopedFirePhase == ScopeAssistScopedWait) {
1202                block(FIRE_BTN, ScopeAssistFireBlockTime);
1203                combo_stop(RapidFireCombo);
1204                scopeAssistSuppressCombat = TRUE;
1205                set_val(FIRE_BTN, 0);
1206
1207                if (scopeAssistScopedFireTimer < settings[ScopeAssistScopeDelayEnum]) {
1208                    scopeAssistScopedFireTimer = scopeAssistScopedFireTimer + get_rtime();
1209                }
1210                if (scopeAssistScopedFireTimer >= settings[ScopeAssistScopeDelayEnum]) {
1211                    scopeAssistScopedFireTimer = 0;
1212                    scopeAssistScopedFirePhase = ScopeAssistScopedFireActive;
1213                }
1214            } else if (scopeAssistScopedFirePhase == ScopeAssistScopedFireActive) {
1215                scopeAssistSuppressCombat = FALSE;
1216                set_val(ADS_BTN, 100);
1217                set_val(FIRE_BTN, 100);
1218            }
1219        }
1220    } else if (scopeAssistMode == ScopeAssistQuickScope) {
1221        scopeAssistScopedFireTimer = 0;
1222        scopeAssistScopedFirePhase = ScopeAssistScopedIdle;
1223
1224        if (get_val(FIRE_BTN) <= 50) {
1225            scopeAssistQuickScopeLocked = FALSE;
1226            scopeAssistQuickScopeTimer = 0;
1227            scopeAssistQuickScopePhase = ScopeAssistQuickIdle;
1228            set_val(FIRE_BTN, 0);
1229        } else {
1230            combo_stop(RapidFireCombo);
1231            if (scopeAssistQuickScopePhase == ScopeAssistQuickIdle && !scopeAssistQuickScopeLocked) {
1232                scopeAssistQuickScopeLocked = TRUE;
1233                scopeAssistQuickScopeTimer = 0;
1234                scopeAssistQuickScopePhase = ScopeAssistQuickWait;
1235            }
1236
1237            set_val(ADS_BTN, 100);
1238            block(FIRE_BTN, ScopeAssistFireBlockTime);
1239            set_val(FIRE_BTN, 0);
1240            scopeAssistSuppressCombat = TRUE;
1241
1242            if (scopeAssistQuickScopeLocked && scopeAssistQuickScopePhase == ScopeAssistQuickWait) {
1243                if (scopeAssistQuickScopeTimer < settings[ScopeAssistQuickScopeDelayEnum]) {
1244                    scopeAssistQuickScopeTimer = scopeAssistQuickScopeTimer + get_rtime();
1245                }
1246                if (scopeAssistQuickScopeTimer >= settings[ScopeAssistQuickScopeDelayEnum]) {
1247                    scopeAssistQuickScopeTimer = 0;
1248                    scopeAssistQuickScopePhase = ScopeAssistQuickFire;
1249                }
1250            }
1251
1252            if (scopeAssistQuickScopeLocked && scopeAssistQuickScopePhase == ScopeAssistQuickFire) {
1253                if (scopeAssistQuickScopeTimer < settings[ScopeAssistShotHoldEnum]) {
1254                    set_val(FIRE_BTN, 100);
1255                    scopeAssistQuickScopeTimer = scopeAssistQuickScopeTimer + get_rtime();
1256                } else {
1257                    block(FIRE_BTN, ScopeAssistFireBlockTime);
1258                    set_val(FIRE_BTN, 0);
1259                    set_val(ADS_BTN, 0);
1260                    scopeAssistQuickScopeTimer = 0;
1261                    scopeAssistQuickScopePhase = ScopeAssistQuickDone;
1262                }
1263            } else if (scopeAssistQuickScopeLocked && scopeAssistQuickScopePhase == ScopeAssistQuickDone) {
1264                scopeAssistSuppressCombat = TRUE;
1265                block(FIRE_BTN, ScopeAssistFireBlockTime);
1266                set_val(FIRE_BTN, 0);
1267                set_val(ADS_BTN, 0);
1268            }
1269        }
1270    }
1271}`}},L=a.u.MiscList({id:"VMSpeed",name:"VM Speed",description:"Sets the controller polling rate to reduce input lag. Lower ms means faster, snappier response.",category:"utility",version:"1.0",activation:{button:"NONE",mode:"AUTO"},settings:[{id:"value",label:"VM Speed",hint:"Auto is recommended. Lower ms can feel snappier, but may be less stable on some setups.",type:"list",options:["Auto","8ms","4ms","2ms"],optionDescriptions:[{title:"Important",description:"When using mouse and keyboard with Cronus Zen, set VM Speed to 8ms for correct input behavior."}
1271,{title:"Auto",description:"Uses the recommended timing for the detected console: 2ms on Xbox/PS4, 4ms on PS5, and 8ms as a safe fallback."},{title:"8ms",description:"Stable manual option. Required when using Cronus Zen with mouse and keyboard."},{title:"4ms",description:"Advanced manual option, matching Marathon PS4/PS5 timing. Use only if the script remains stable."},{title:"2ms",description:"Fastest manual option. Best for supported controller setups; avoid for mouse and keyboard."}],calloutMode:"all",default:0}],mainLogicBlock:`// Adjustable VM Speeds Mod
1272handleVMSpeed();`,miscInput:`// VM Speed Mod
1273case VMSpeedEnum: {
1274    miscStep = iif(event_press(PS5_LEFT), -1, 1);
1275    settings[VMSpeedEnum] = clamp(settings[VMSpeedEnum] + miscStep, 0, 3);
1276    handleVMSpeed();
1277    blinkLedAndRumble();
1278    break;
1279}`,function:`// Adjustable VM Speeds Mod
1280int vmSpeed;
1281int vmHost;
1282int lastVMSpeed = -1;
1283int lastVMHost = -1;
1284
1285function handleVMSpeed() {
1286    if (settings[VMSpeedEnum] == 0) {
1287        vmHost = get_console();
1288        if (settings[VMSpeedEnum] == lastVMSpeed && vmHost == lastVMHost) return;
1289
1290        if (vmHost == PIO_XB1 || vmHost == PIO_PS4) {
1291            vmSpeed = 2;
1292        }
1293        else if (vmHost == PIO_PS5) {
1294            vmSpeed = 4;
1295        }
1296        else {
1297            vmSpeed = 8;
1298        }
1299    }
1300    else if (settings[VMSpeedEnum] == 1) {
1301        if (settings[VMSpeedEnum] == lastVMSpeed) return;
1302        vmSpeed = 8;
1303        lastVMHost = -1;
1304    }
1305    else if (settings[VMSpeedEnum] == 2) {
1306        if (settings[VMSpeedEnum] == lastVMSpeed) return;
1307        vmSpeed = 4;
1308        lastVMHost = -1;
1309    }
1310    else if (settings[VMSpeedEnum] == 3) {
1311        if (settings[VMSpeedEnum] == lastVMSpeed) return;
1312        vmSpeed = 2;
1313        lastVMHost = -1;
1314    }
1315
1316    vm_tctrl(inv(10 - vmSpeed));
1317    lastVMSpeed = settings[VMSpeedEnum];
1318    if (settings[VMSpeedEnum] == 0) {
1319        lastVMHost = vmHost;
1320    }
1321} `,combo:""}),N=a.u.MiscToggle({id:"AntiDrift",name:"Anti Drift",description:"Stops your character and aim from drifting on their own when you're not touching the stick.",category:"utility",version:"1.0",activation:{button:"NONE",mode:"AUTO"},settings:[{id:"active",label:"Active by default",hint:"When enabled, anti drift is active as soon as the script loads on your device.",type:"toggle",default:0},{id:"deadzone_l3",label:"Left stick deadzone",hint:"How much movement to ignore on the left stick. Increase if your character walks on its own.",type:"slider",min:0,max:20,default:10,isVirtual:!0},{id:"deadzone_r3",label:"Right stick deadzone",hint:"How much movement to ignore on the right stick. Increase if the camera drifts on its own.",type:"slider",min:0,max:20,default:10,isVirtual:!0}],init:"",priorityLogic:`// Anti Drift Mod
1322if (settings[AntiDriftEnum] && currentState == STATE_PLAYING) {
1323    if (abs(get_val(PS5_LX)) < \${deadzone_l3}) set_val(PS5_LX, 0);
1324    if (abs(get_val(PS5_LY)) < \${deadzone_l3}) set_val(PS5_LY, 0);
1325    if (abs(get_val(PS5_RX)) < \${deadzone_r3}) set_val(PS5_RX, 0);
1326    if (abs(get_val(PS5_RY)) < \${deadzone_r3}) set_val(PS5_RY, 0);
1327}`,mainLogicBlock:"",function:"",combo:""}),M=a.u.MiscToggle({id:"BunnyHop",name:"Bunny Hop",description:"Keeps jumping automatically while preserving normal long jumps with optional Double Tap or Modifier activation.",category:"movement",version:"2.1",activation:{button:"JUMP",mode:"HOLD"},settings:[{id:"active",label:"Active by default",hint:"When enabled, bunny hop is active as soon as the script loads on your device.",type:"toggle",default:0,editable:!0},{id:"mode",label:"Activation mode",hint:"Choose how Bunny Hop starts. Double Tap keeps normal hold-to-jump behavior available.",type:"list",options:["Hold Jump","Double Tap","Modifier + Jump"],optionDescriptions:[{title:"Hold Jump",description:"Starts hopping while you hold Jump. This matches the original Bunny Hop behavior."},{title:"Double Tap",description:"Single press or hold stays normal. Tap Jump twice quickly and hold the second press to hop."},{title:"Modifier + Jump",description:"Bunny Hop only runs while the modifier button and Jump are both held."}],calloutMode:"selected",default:0,isVirtual:!0,editable:!0},{id:"initialDelay",label:"Activation delay (ms)",hint:"Hold Jump only. At 0, hopping starts the moment you press. Raise it if you still want normal single jumps.",type:"slider",min:0,max:500,default:0,isVirtual:!0,editable:!0,dependsOn:e=>0===Number(e.mode??0),hideWhenDisabled:!0},{id:"doubleTapWindow",label:"Double tap window (ms)",hint:"Double Tap only. How quickly the second Jump press must happen to start Bu
1327nny Hop.",type:"slider",min:100,max:500,default:250,isVirtual:!0,editable:!0,dependsOn:e=>1===Number(e.mode??0),hideWhenDisabled:!0},{id:"modifierButton",label:"Modifier button",hint:"Modifier + Jump only. Hold this button with Jump to start Bunny Hop.",type:"button",buttonRole:"player-input",default:"SPRINT_BTN",isVirtual:!0,editable:!0,dependsOn:e=>2===Number(e.mode??0),hideWhenDisabled:!0},{id:"holdTime",label:"Button hold time (ms)",hint:"How long each jump press lasts. 50ms works for most games. Raise it if your game ignores the jumps.",type:"slider",min:20,max:200,default:50,isVirtual:!0,editable:!0},{id:"waitTime",label:"Pause between jumps (ms)",hint:"Gap between each jump. Call of Duty works best at 50ms, Destiny and Apex at 100–150ms. If hopping feels inconsistent, try raising this.",type:"slider",min:20,max:300,default:100,isVirtual:!0,editable:!0}],runtimeDefines:e=>{let t=Number(e.mode??0);return 1===t?`int bh_press_timer = 0;
1328int bh_tap_timer = 0;
1329int bh_waiting_second_tap = FALSE;
1330int bh_double_active = FALSE;
1331int bh_jump_was_down = FALSE;`:0===t&&Number(e.initialDelay)>0?"int bh_timer = 0;":""},init:e=>{let t=Number(e.mode??0);return 1===t?`bh_press_timer = 0;
1332bh_tap_timer = 0;
1333bh_waiting_second_tap = FALSE;
1334bh_double_active = FALSE;
1335bh_jump_was_down = FALSE;`:0===t&&Number(e.initialDelay)>0?"bh_timer = 0;":""},priorityLogic:"",mainLogicBlock:`if (settings[BunnyHopEnum]) {
1336    handleBunnyHop();
1337} else {
1338    resetBunnyHopRuntime();
1339}`,function:e=>{let t=Number(e.mode??0),i=Number(e.initialDelay??0),o=`    if (!(!passiveMod && !no_gun_state && !utility_state/* @[INLINE_SUPPRESS_COMBAT] */)) {
1340        resetBunnyHopRuntime();
1341        return;
1342    }
1343
1344`;if(1===t){let t=Number(e.doubleTapWindow??250);return`// Bunny Hop Mod (Double Tap)
1345function resetBunnyHopRuntime() {
1346    bh_press_timer = 0;
1347    bh_tap_timer = 0;
1348    bh_waiting_second_tap = FALSE;
1349    bh_double_active = FALSE;
1350    bh_jump_was_down = FALSE;
1351    combo_stop(BunnyHopCombo);
1352}
1353
1354function handleBunnyHop() {
1355${o}    if (get_ival(JUMP_BTN)) {
1356        if (bh_press_timer <= ${t}) {
1357            bh_press_timer = bh_press_timer + get_rtime();
1358        }
1359    }
1360
1361    if (get_ival(JUMP_BTN) && !bh_jump_was_down) {
1362        if (bh_waiting_second_tap && bh_tap_timer <= ${t}) {
1363            bh_double_active = TRUE;
1364            bh_waiting_second_tap = FALSE;
1365            bh_tap_timer = 0;
1366        } else {
1367            bh_double_active = FALSE;
1368        }
1369    }
1370
1371    if (!get_ival(JUMP_BTN) && bh_jump_was_down) {
1372        if (!bh_double_active && bh_press_timer <= ${t}) {
1373            bh_waiting_second_tap = TRUE;
1374            bh_tap_timer = 0;
1375        }
1376        bh_press_timer = 0;
1377    }
1378
1379    if (bh_waiting_second_tap) {
1380        bh_tap_timer = bh_tap_timer + get_rtime();
1381        if (bh_tap_timer > ${t}) {
1382            bh_waiting_second_tap = FALSE;
1383            bh_tap_timer = 0;
1384        }
1385    }
1386
1387    if (get_ival(JUMP_BTN) && bh_double_active) {
1388        combo_run(BunnyHopCombo);
1389    } else {
1390        combo_stop(BunnyHopCombo);
1391    }
1392
1393    if (!get_ival(JUMP_BTN)) {
1394        bh_double_active = FALSE;
1395    }
1396    bh_jump_was_down = get_ival(JUMP_BTN);
1397}`}if(2===t){let t=e.modifierButton||"SPRINT_BTN";return`// Bunny Hop Mod (Modifier + Jump)
1398function resetBunnyHopRuntime() {
1399    combo_stop(BunnyHopCombo);
1400}
1401
1402function handleBunnyHop() {
1403${o}    if (get_ival(${t}) && get_ival(JUMP_BTN)) {
1404        combo_run(BunnyHopCombo);
1405    } else {
1406        combo_stop(BunnyHopCombo);
1407    }
1408}`}return 0===i?`// Bunny Hop Mod (Instant)
1409function resetBunnyHopRuntime() {
1410    combo_stop(BunnyHopCombo);
1411}
1412
1413function handleBunnyHop() {
1414${o}    // get_ival reads the pure physical button press.
1415    // This prevents the combo from interrupting itself when it sets JUMP_BTN to 0.
1416    if (get_ival(JUMP_BTN)) {
1417        combo_run(BunnyHopCombo);
1418    } else {
1419        combo_stop(BunnyHopCombo);
1420    }
1421}`:`// Bunny Hop Mod (Delayed)
1422function resetBunnyHopRuntime() {
1423    bh_timer = 0;
1424    combo_stop(BunnyHopCombo);
1425}
1426
1427function handleBunnyHop() {
1428${o}    // get_ival reads the pure physical button press
1429    if (get_ival(JUMP_BTN)) {
1430        bh_timer = bh_timer + get_rtime();
1431        if (bh_timer >= ${i}) {
1432            combo_run(BunnyHopCombo);
1433        } else {
1434            combo_stop(BunnyHopCombo);
1435        }
1436    } else {
1437        resetBunnyHopRuntime();
1438    }
1439}`},combo:e=>`// Bunny Hop Mod Combo
1440combo BunnyHopCombo {
1441    set_val(JUMP_BTN, 100);
1442    wait(${e.holdTime});
1443    set_val(JUMP_BTN, 0);
1444    wait(${e.waitTime});
1445}`}),w=a.u.MiscToggle({id:"HairTrigger",name:"Hair Trigger",description:"Makes your triggers respond instantly with the lightest press. No delay, no dead zone.",category:"utility",version:"1.0",activation:{button:"NONE",mode:"AUTO"},settings:[{id:"active",label:"Active by default",hint:"When enabled, hair trigger is active as soon as the script loads on your device.",type:"toggle",default:0},{id:"threshold",label:"Trigger threshold",hint:"How much you need to press before the trigger snaps to full. Raise it if triggers fire by accident.",type:"slider",min:0,max:20,default:5,isVirtual:!0}],init:"",priorityLogic:`// Hair Trigger Mod
1446	if (settings[HairTriggerEnum]) {
1447    if (get_val(PS5_L1) > \${threshold}) set_val(PS5_L1, 100);
1448    if (get_val(PS5_R1) > \${threshold}) set_val(PS5_R1, 100);
1449    if (get_val(PS5_L2) > \${threshold}) set_val(PS5_L2, 100);
1450    if (get_val(PS5_R2) > \${threshold}) set_val(PS5_R2, 100);
1451}`,mainLogicBlock:"",function:"",combo:""}),I=a.u.Custom({id:"CustomMod",name:"Test Custom Mod",description:"[Dev] Template mod showcasing custom submenu rendering and complex LED logic.",category:"utility",version:"1.0",activation:{button:"PS5_L1",mode:"TOGGLE"},settings:[{id:"active",label:"Active by Default",hint:"Whether test custom mod is loaded when the script starts.",type:"toggle",default:0},{id:"color",enumName:"CustomModColorEnum",label:"LED Color",hint:"Choose the base color for the LED logic.",type:"list",options:["Red","Blue","Green"],default:0},{id:"freq",enumName:"CustomModFreqEnum",label:"Blink Freq",hint:"Adjust how fast the LED blinks.",type:"slider",min:1,max:10,default:5},{id:"mode",enumName:"CustomModModeEnum",label:"L1 Only",hint:"If enabled, LED only blinks when L1 is pressed.",type:"toggle",default:0}],init:"",priorityLogic:"",submenuRenderCode:`drawModTitle(CustomModEnum);
1452    drawSettingLabel(currentSubCfg);
1453    switch (currentSubCfg) {
1454        case CustomModColorEnum: {
1455            drawTextSettingValue(CUSTOMMOD_COLOR_NAMES[settings[currentSubCfg]]);
1456            break;
1457        }
1458        case CustomModModeEnum: {
1459            drawOnOffValue(settings[currentSubCfg], 45);
1460            break;
1461        }
1462        default {
1463            drawStandardSetting(currentSubCfg, FALSE);
1464            break;
1465        }
1466    }
1467    if (event_press(PS5_LEFT) || event_press(PS5_RIGHT)) {
1468        switch (currentSubCfg) {
1469            case CustomModColorEnum: { settings[currentSubCfg] = clamp(settings[currentSubCfg] + iif(event_press(PS5_LEFT), -1, 1), 0, 2); break; }
1470            case CustomModModeEnum: { settings[currentSubCfg] = !settings[currentSubCfg]; break; }
1471            default { handleLeftRight(currentSubCfg); break; }
1472        }
1473        blinkLedAndRumble();
1474    }
1475    handleUpDown(CustomModColorEnum, CustomModModeEnum);`,function:`// Custom Mod
1476    int cm_timer, cm_blink_timer, cm_phase, cm_led_on;
1477    function handleCustomMod() {
1478        if (settings[CustomModModeEnum] && !get_val(PS5_L1)) { SetLEDColor(Black); return; }
1479        if (cm_phase == 0) {
1480            cm_blink_timer += get_rtime();
1481            if (cm_blink_timer >= (1000 / settings[CustomModFreqEnum])) {
1482                cm_blink_timer = 0; cm_led_on = !cm_led_on;
1483                if (cm_led_on) {
1484                    SetLEDColor(settings[CustomModColorEnum] + 2);
1485                } else {
1486                    SetLEDColor(Black);
1487                }
1488            }
1489            cm_timer += get_rtime();
1490            if (cm_timer >= 2000) { cm_timer = 0; cm_phase = 1; }
1491        } else {
1492            SetLEDColor(Black); cm_timer += get_rtime();
1493            if (cm_timer >= 3000) { cm_timer = 0; cm_phase = 0; }
1494        }
1495    }`,combo:""}),B=a.u.MultiSlider({id:"TestMultiSlider",name:"Test Multi Slider Mod",description:"[Dev] Cycles LED colors while held. Duration is set by three sliders.",category:"utility",version:"1.0",activation:{button:"PS5_L1",mode:"HOLD"},settings:[{id:"active",label:"Active by Default",hint:"Whether test multi slider mod is loaded when the script starts.",type:"toggle",default:0},{id:"button",label:"Button",hint:"The button used in the game.",type:"button",default:"PS5_L1",isVirtual:!0},{id:"redTime",label:"Red Duration",hint:"Duration for Red phase.",min:10,max:250,default:50},{id:"greenTime",label:"Green Duration",hint:"Duration for Green phase.",min:10,max:250,default:50},{id:"blueTime",label:"Blue Duration",hint:"Duration for Blue phase.",min:10,max:250,default:50}],init:"",priorityLogic:"",function:`// Test Multi Slider Mod
1496int tms_timer, tms_phase;
1497
1498function handleTestMultiSlider() {
1499    if (toggle[ToggleTestMultiSliderEnum] && get_val(\${button})) {
1500        tms_timer += get_rtime();
1501
1502        if (tms_phase == 0) { // Red Phase
1503            SetLEDColor(Red);
1504            if (tms_timer >= (settings[TestMultiSliderRedTimeEnum] * 10)) {
1505                tms_timer = 0;
1506                tms_phase = 1;
1507            }
1508        } 
1509        else if (tms_phase == 1) { // Green Phase
1510            SetLEDColor(Green);
1511            if (tms_timer >= (settings[TestMultiSliderGreenTimeEnum] * 10)) {
1512                tms_timer = 0;
1513                tms_phase = 2;
1514            }
1515        } 
1516        else { // Blue Phase
1517            SetLEDColor(Blue);
1518            if (tms_timer >= (settings[TestMultiSliderBlueTimeEnum] * 10)) {
1519                tms_timer = 0;
1520                tms_phase = 0;
1521            }
1522        }
1523    } else {
1524        // Reset and turn off LED when button is released or mod disabled
1525        if (tms_phase != 0 || tms_timer != 0) {
1526            tms_phase = 0;
1527            tms_timer = 0;
1528            SetLEDColor(Black);
1529        }
1530    }
1531} `,combo:""}),k=Object.values(o);class F{static getAllMods(){return k}static getModById(e){return k.find(t=>t.id===e)}static getModsByCategory(e){return k.filter(t=>t.category===e)}}},86831:(e,t,i)=>{i.d(t,{CI:()=>d,Hh:()=>l,Jv:()=>s,wV:()=>r,yK:()=>n});var o=i(56249),a=i(9773);i(41463);let n=(0,o.M)({baseURL:window.location.origin,basePath:"/api/auth",plugins:[(0,a.px)()]}),{signIn:s,signUp:l,useSession:r,signOut:d}=n},90012:(e,t,i)=>{i.d(t,{G:()=>a,Vb:()=>o,cy:()=>n,gy:()=>s,kL:()=>l,tk:()=>r});let o=["Default","Tactical","Lefty","N0M4D / Charlie","N0M4D / Charlie tac","N0M4D / Charlie left","Bumper jumper","Bumper jumper tac","1-hand gunslinger","Stick & move","Brawler","Beast","Bumper ping","Bumper ping tac","Default flipped","Tactical flipped","B. jumper flipped","B. jumprTac flipped","Stick & move flipped","Beasty swapped","B. ping flipped","B. ping. tac. flipped"],a=["FIRE_BTN","ADS_BTN","LETHAL_BTN","TACTICAL_BTN","JUMP_BTN","CROUCH_BTN","MELEE_BTN","SPRINT_BTN","RELOAD_BTN","SWITCHWEAPON_BTN","PING_BTN"],n={FIRE_BTN:"Fire",ADS_BTN:"Aim",LETHAL_BTN:"Lethal",TACTICAL_BTN:"Tactical",JUMP_BTN:"Jump",CROUCH_BTN:"Crouch",MELEE_BTN:"Melee",SPRINT_BTN:"Sprint",RELOAD_BTN:"Reload",SWITCHWEAPON_BTN:"Switch weapon",PING_BTN:"Ping"},s={PS5_PS:0,PS5_SHARE:1,PS5_OPTIONS:2,PS5_R1:3,PS5_R2:4,PS5_R3:5,PS5_L1:6,PS5_L2:7,PS5_L3:8,PS5_RX:9,PS5_RY:10,PS5_LX:11,PS5_LY:12,PS5_UP:13,PS5_DOWN:14,PS5_LEFT:15,PS5_RIGHT:16,PS5_TRIANGLE:17,PS5_CIRCLE:18,PS5_CROSS:19,PS5_SQUARE:20,PS5_TOUC
1531HPAD:21},l={PS5_R1:"R1",PS5_R2:"R2",PS5_R3:"R3",PS5_L1:"L1",PS5_L2:"L2",PS5_L3:"L3",PS5_CROSS:"CROSS",PS5_CIRCLE:"CIRCLE",PS5_SQUARE:"SQUARE",PS5_TRIANGLE:"TRIANGLE",PS5_UP:"UP",PS5_DOWN:"DOWN",PS5_LEFT:"LEFT",PS5_RIGHT:"RIGHT",PS5_SHARE:"SHARE",PS5_OPTIONS:"OPTIONS"},r=[["PS5_R2","PS5_L2","PS5_R1","PS5_L1","PS5_CROSS","PS5_CIRCLE","PS5_R3","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_R2","PS5_L2","PS5_R1","PS5_L1","PS5_CROSS","PS5_R3","PS5_CIRCLE","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_L2","PS5_R2","PS5_L1","PS5_R1","PS5_CROSS","PS5_CIRCLE","PS5_L3","PS5_R3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_R2","PS5_R1","PS5_L2","PS5_L1","PS5_CROSS","PS5_CIRCLE","PS5_R3","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_R2","PS5_R1","PS5_L2","PS5_L1","PS5_CROSS","PS5_R3","PS5_CIRCLE","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_L2","PS5_L1","PS5_R2","PS5_R1","PS5_CROSS","PS5_CIRCLE","PS5_L3","PS5_R3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_R2","PS5_L2","PS5_R1","PS5_CROSS","PS5_L1","PS5_CIRCLE","PS5_R3","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_R2","PS5_L2","PS5_R1","PS5_CROSS","PS5_L1","PS5_R3","PS5_CIRCLE","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_L1","PS5_L2","PS5_R2","PS5_R1","PS5_CROSS","PS5_CIRCLE","PS5_R3","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_R2","PS5_L2","PS5_R1","PS5_L1","PS5_R3","PS5_CIRCLE","PS5_CROSS","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_R2","PS5_L2","PS5_R1","PS5_L1","PS5_CROSS","PS5_CIRCLE","PS5_R3","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_R2","PS5_L2","PS5_R3","PS5_CROSS","PS5_L1","PS5_CIRCLE","PS5_R1","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_R2","PS5_L2","PS5_R1","PS5_R1","PS5_CROSS","PS5_CIRCLE","PS5_R3","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_L1"],["PS5_R2","PS5_L2","PS5_R1","PS5_R1","PS5_CROSS","PS5_R3","PS5_CIRCLE","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_L1"],["PS5_R1","PS5_L1","PS5_R2","PS5_L2","PS5_CROSS","PS5_CIRCLE","PS5_R3","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_R1","PS5_L1","PS5_R2","PS5_L2","PS5_CROSS","PS5_R3","PS5_CIRCLE","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_R1","PS5_L1","PS5_R2","PS5_CROSS","PS5_L2","PS5_CIRCLE","PS5_R3","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_R1","PS5_L1","PS5_R2","PS5_CROSS","PS5_L2","PS5_R3","PS5_CIRCLE","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_R1","PS5_L1","PS5_R2","PS5_L2","PS5_R3","PS5_CIRCLE","PS5_CROSS","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_R1","PS5_L1","PS5_R3","PS5_CROSS","PS5_L1","PS5_CIRCLE","PS5_R1","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_UP"],["PS5_R1","PS5_L1","PS5_R2","PS5_R2","PS5_CROSS","PS5_CIRCLE","PS5_R3","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_L2"],["PS5_R1","PS5_L1","PS5_R2","PS5_R2","PS5_CROSS","PS5_R3","PS5_CIRCLE","PS5_L3","PS5_SQUARE","PS5_TRIANGLE","PS5_L2"]]},94917:(e,t,i)=>{i.d(t,{MS:()=>a,Md:()=>s,aV:()=>o,tS:()=>n});let o=["Off","Auto Scope","ADS Auto Fire","Scoped Fire","Quick Scope"],a=4,n=["1","2","3","4"],s={1:"Auto Scope",2:"ADS Auto Fire",3:"Scoped Fire",4:"Quick Scope"}},95168:(e,t,i)=>{i.d(t,{KG:()=>r,ag:()=>l,hs:()=>d});var o=i(79807),a=i(26806),n=i(28111),s=i(60328);let l=e=>(0,n.aO)(e),r=(e,t)=>{let i=e.customModStates||{};return(0,n.aO)(t).filter(e=>i[e.id]?.enabled)},d=(e,t)=>{let i=(0,s.S)(s.P,e);return[...o.s.getAllMods().filter(e=>i.mods[e.id]?.enabled),...a.m.buildMany(r(i,t))]}},96795:(e,t,i)=>{i.d(t,{Z:()=>n,x:()=>a});var o=i(12115);let a=(0,o.createContext)("playstation"),n=()=>(0,o.useContext)(a)},98446:(e,t,i)=>{i.d(t,{s:()=>d});var o=i(51152),a=i(28111),n=i(67518),s=i(32865);let l=e=>{let t=e.secondaryButton||e.primaryButton;return e.secondaryButton?`${(0,s.$O)(e.primaryButton,e.device)} && ${(0,s.$O)(t,e.device)}`:(0,s.$O)(t,e.device)},r=(e,t,i,o,a,n)=>{let l=e.secondaryButton||e.primaryButton,r=e.secondaryButton?(0,s.$O)(e.primaryButton,e.device):"TRUE",d=`if (${s.pH} - ${a} > EMBEDDED_MULTI_TAP_WINDOW) {
1532    ${o} = 0;
1533}
1534
1535${o} = ${o} + 1;
1536${a} = ${s.pH};
1537
1538if (${o} >= ${n}) {
1539    ${o} = 0;
1540    ${a} = 0;
1541    ${t}();
1542}`,u=`if (${o} > 0 && ${s.pH} - ${a} > EMBEDDED_MULTI_TAP_WINDOW) {
1543    ${o} = 0;
1544    ${a} = 0;
1545}`;if("gamepad"===e.device)return`if (${(0,s.h5)(r,`event_press(${l})`)}) {
1546${(0,s.Mz)(d)}
1547}
1548${u}`;let c=(0,s.$O)(l,e.device);return`if (${c}) {
1549    if (${(0,s.YI)(`!${i}`,r)}) {
1550${(0,s.Mz)(d,8)}
1551    }
1552    ${i} = TRUE;
1553} else {
1554    ${i} = FALSE;
1555}
1556${u}`},d=(e,t,i)=>{let d=i?.deferTapHandling??!1,u=i?.symbolPrefix??"Embedded",c=u.charAt(0).toLowerCase()+u.slice(1),m=e.startsWith("embedded")?e.
1556slice(8):e.startsWith("toggleOnly")?e.slice(10):e,p=(0,a.uE)(m||e),g=`${c}${p}Active`,S=`execute${u}${p}`,b=`toggle${u}${p}`,h=`run${u}${p}`,_=`${u}${p}Combo`,f=`${c}${p}TriggerPrev`,E=`${c}${p}TriggerDownTime`,v=`${c}${p}HoldLatched`,A=`${c}${p}TapCount`,y=`${c}${p}LastTapTime`,P=(0,n.dm)(t.trigger)&&!d,T="hold"===t.trigger&&"keyboard"===t.device||("double-tap"===t.trigger||"triple-tap"===t.trigger)&&P,$=[],R=[],C=[],L=[];"loop"===t.execution&&(R.push(`int ${g} = FALSE;`),C.push(`if (${g}) {
1557    ${h}();
1558}`),L.push(`${g} = FALSE;`));T&&R.push(`int ${s.pH} = 0;`),"keyboard"!==t.device||"tap"!==t.trigger&&"hold"!==t.trigger&&"double-tap"!==t.trigger&&"triple-tap"!==t.trigger||d||(R.push(`int ${f} = FALSE;`),L.push(`${f} = FALSE;`)),"keyboard"===t.device&&"hold"===t.trigger&&(R.push(`int ${E} = 0;`),L.push(`${E} = 0;`)),"hold"===t.trigger&&(R.push(`int ${v} = FALSE;`),L.push(`${v} = FALSE;`)),("double-tap"===t.trigger||"triple-tap"===t.trigger)&&P&&($.push(s.r0),R.push(`int ${A} = 0;`),R.push(`int ${y} = 0;`),L.push(`${A} = 0;`),L.push(`${y} = 0;`));let N="loop"===t.execution?b:"while-held"===t.execution?h:S,M="keyboard"===t.device?(0,o.rM)(t.primaryButton):t.primaryButton,w=t.secondaryButton?"keyboard"===t.device?(0,o.rM)(t.secondaryButton):t.secondaryButton:void 0;if("while-held"===t.execution){let e=i?.stopComboOnRelease?_:void 0;C.unshift(e?`if (${l(t)}) {
1559    ${h}();
1560} else {
1561    combo_stop(${e});
1562}`:`if (${l(t)}) {
1563    ${h}();
1564}`)}else"tap"===t.trigger&&P?C.unshift(((e,t,i)=>{let o=e.secondaryButton||e.primaryButton,a=e.secondaryButton?(0,s.$O)(e.primaryButton,e.device):"TRUE";if("gamepad"===e.device)return`if (${(0,s.h5)(a,`event_press(${o})`)}) {
1565    ${t}();
1566}`;let n=(0,s.$O)(o,e.device);return`if (${n}) {
1567    if (${(0,s.YI)(`!${i}`,a)}) {
1568        ${t}();
1569    }
1570    ${i} = TRUE;
1571} else {
1572    ${i} = FALSE;
1573}`})(t,N,f)):"hold"===t.trigger?C.unshift(((e,t,i,o,a)=>{let n=e.secondaryButton||e.primaryButton,l=e.holdMs||200,r=e.secondaryButton?(0,s.$O)(e.primaryButton,e.device):"TRUE";if("gamepad"===e.device)return`if (${(0,s.h5)(r,`get_val(${n})`)}) {
1574    if (!${a} && get_ptime(${n}) >= ${l}) {
1575        ${a} = TRUE;
1576        ${t}();
1577    }
1578} else {
1579    ${a} = FALSE;
1580}`;let d=(0,s.$O)(n,e.device);return`if (${d}) {
1581    if (!${i}) {
1582        ${i} = TRUE;
1583        ${o} = ${s.pH};
1584        ${a} = FALSE;
1585    }
1586
1587    if (${(0,s.YI)(`!${a} && ${s.pH} - ${o} >= ${l}`,r)}) {
1588        ${a} = TRUE;
1589        ${t}();
1590    }
1591} else {
1592    ${i} = FALSE;
1593    ${o} = 0;
1594    ${a} = FALSE;
1595}`})(t,N,f,E,v)):"double-tap"===t.trigger&&P?C.unshift(r(t,N,f,A,y,2)):"triple-tap"===t.trigger&&P&&C.unshift(r(t,N,f,A,y,3));return{activation:{device:t.device,button:w||M,modifier:w?M:void 0,secondaryButton:w,trigger:t.trigger,execution:t.execution,holdMs:"hold"===t.trigger?t.holdMs||200:void 0},runtimeDefines:$.join("\n"),runtimeVars:R.join("\n"),priorityLogic:T?s.Vv:"",inputHook:C.filter(Boolean).join("\n\n"),resetCode:L.join("\n"),entryFunctionName:S,toggleFunctionName:b,runFunctionName:h,dispatchFunctionName:N,comboName:_,stateVariableName:g,tokenReplacements:{[a.cP.entryFunction]:S,[a.cP.stateVariable]:g,[a.cP.toggleFunction]:b,[a.cP.runFunction]:h,[a.cP.comboName]:_}}}}}]);

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