UNPKG

auto-champion-select

Version:
10 lines 128 kB
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`.dropdown-champions-default{position:inherit;inline-size:100%}.dropdown-champions-default.dropdown-drop-up::part(ui-dropdown-menu),.dropdown-champions-default.dropdown-drop-up::part(ui-dropdown-content),.dropdown-champions-default.dropdown-drop-up::part(ui-dropdown-options){top:auto;bottom:100%;transform-origin:bottom}.dropdown-champions-default .controlado-champion-option__content{display:inline-flex;align-items:center;gap:8px;width:100%;min-width:0;line-height:20px;vertical-align:middle}.dropdown-champions-default .controlado-champion-option__icon{display:block;flex:0 0 20px;width:20px;height:20px;border:1px solid rgba(200,170,110,.65);border-radius:50%;background:#010a13;object-fit:cover;box-sizing:border-box;pointer-events:none}.dropdown-champions-default img.controlado-champion-option__icon{clip-path:circle(41.67% at 51.5% 51.5%);object-position:center;transform:scale(1.2);transform-origin:51.5% 51.5%}.dropdown-champions-default .controlado-champion-option__static-icon{display:grid;place-items:center;color:#f0e6d2;font-family:var(--font-display);font-size:13px;font-weight:700;line-height:1}.dropdown-champions-default .controlado-champion-option__text{display:flex;align-items:baseline;gap:8px;width:100%;min-width:0}.dropdown-champions-default .controlado-champion-option__name{flex:0 0 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-champions-default .controlado-champion-option__description{flex:1 1 auto;min-width:0;color:#a09b8ce6;font-size:11px;line-height:1;overflow:hidden;text-align:right;text-overflow:ellipsis;white-space:nowrap}.champion-priority-selector{display:grid;gap:0;padding:2px 0 3px}.champion-priority-selector__scroll{position:relative;inline-size:100%;height:58px;border:1px solid rgba(120,90,40,.7);border-top:0;background:rgba(30,35,40,.5);box-sizing:border-box}.champion-priority-selector__track{display:inline-flex;align-items:center;gap:12px;min-width:max-content;min-height:45px;padding:10px 8px 8px;box-sizing:border-box}.champion-priority-selector__empty{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:#5f5b4f;font-family:var(--font-body);font-size:11px;line-height:13px;text-align:center;white-space:nowrap;pointer-events:none}.champion-priority-selector__icon{position:relative;flex:0 0 auto;width:34px;height:34px;border:1px solid #c8aa6e;border-radius:50%;background:#1e2328;box-shadow:0 0 0 1px #010a13e6;box-sizing:border-box;cursor:grab;outline:none}.champion-priority-selector__icon:focus{border-color:#f0e6d2}.champion-priority-selector__icon--dragging{cursor:grabbing;filter:brightness(1.15);z-index:1}.champion-priority-selector__icon:before,.champion-priority-selector__remove,.champion-priority-selector__position-badge{display:grid;place-items:center;width:17px;height:17px;padding:0;border-radius:50%;box-sizing:border-box;font-family:var(--font-body);font-size:10px;font-weight:700;line-height:1;z-index:2}.champion-priority-selector__icon:before{content:attr(data-rank);position:absolute;left:-6px;top:-6px;border:1px solid #c8aa6e;background:#010a13;color:#f0e6d2;text-align:center;pointer-events:none}.champion-priority-selector__icon>img{position:relative;z-index:0;display:block;width:100%;height:100%;border-radius:50%;clip-path:circle(45.87% at 50% 50%);object-fit:cover;object-position:center;pointer-events:none;transform:scale(1.09);transform-origin:center}.champion-priority-selector__icon--random{display:grid;place-items:center;color:#f0e6d2;font-family:var(--font-display);font-weight:700}.champion-priority-selector__random-icon{font-size:20px;line-height:1;transform:translateY(-.5px);pointer-events:none}.champion-priority-selector__remove{position:absolute;right:-6px;bottom:-6px;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid #785a28;background:#1e2328;color:#c8aa6e;cursor:pointer;font-family:var(--font-display);font-size:0;text-align:center}.champion-priority-selector__remove:before{content:attr(data-icon);font-family:var(--font-display);font-size:7px;line-height:1;transform:translate(.4px,-.1px)}.champion-priority-selector__remove:hover{border-color:#c8aa6e;color:#f0e6d2}.champion-priority-selector__position-badge{position:absolute;left:-6px;bottom:-6px;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid #785a28;background:#010a13;color:#c8aa6e;cursor:pointer}.champion-priority-selector__position-badge:hover,.champion-priority-selector__position-badge:focus{border-color:#c8aa6e;color:#f0e6d2;outline:none}.champion-priority-selector__position-badge--empty{background:#1e2328;font-size:0}.champion-priority-selector__position-badge--empty:before{content:"+";font-family:var(--font-body);font-size:12px;line-height:1;transform:translate(.25px,.4px)}.champion-priority-selector__position-badge--random{left:auto;right:-6px;top:-6px;bottom:auto}.champion-priority-selector__position-badge--random:before{content:"";display:block;width:11px;height:11px;background:url(/fe/lol-tft-team-planner/images/team_editor_trait_filter_icon.png) center / contain no-repeat;transform:none}.champion-priority-selector__position-badge--random:hover:before,.champion-priority-selector__position-badge--random:focus:before,.champion-priority-selector__position-badge--random.champion-priority-selector__position-badge--active:before{background-image:url(/fe/lol-tft-team-planner/images/team_editor_trait_filter_icon_pressed.png)}.champion-priority-selector__position-badge--random.champion-priority-selector__position-badge--active{border-color:#c8aa6e;background:#010a13}.champion-priority-selector__position-badge img{display:block;width:11px;height:11px;object-fit:contain;transform:translate(.1px)}.champion-priority-selector__position-badge:after{content:attr(data-count);position:absolute;right:-5px;top:-5px;display:none;place-items:center;width:11px;min-width:11px;height:11px;border:1px solid #785a28;border-radius:50%;background:#010a13;box-sizing:border-box;color:#f0e6d2;font-family:var(--font-body);font-size:7px;font-weight:700;line-height:1;text-align:center}.champion-priority-selector__position-badge[data-count]:after{display:grid}.champion-priority-selector__position-menu{position:fixed;z-index:10002;display:flex;gap:4px;padding:5px;border:1px solid #785a28;background:#010a13;box-shadow:0 0 0 1px #010a13d9,0 4px 16px #0000008c;box-sizing:border-box}.champion-priority-selector__position-menu[hidden]{display:none}.champion-priority-selector__position-option{display:grid;place-items:center;width:28px;height:28px;padding:0;border:1px solid #463714;background:#1e2328;box-sizing:border-box;cursor:pointer}.champion-priority-selector__position-option:hover,.champion-priority-selector__position-option--selected{border-color:#c8aa6e;background:#0f1b2d}.champion-priority-selector__position-option img{display:block;width:18px;height:18px;pointer-events:none}.auto-select-checkboxes-div{display:flex;border-top:thin solid #1e282d}.auto-select-checkbox{margin:auto}.auto-select-checkbox:last-child{margin-right:17px}.auto-select-social-roster-section__header{position:relative;padding-right:28px;box-sizing:border-box}.auto-select-social-roster-section .group-name,.auto-select-social-roster-section .group-name-text{min-width:0}.auto-select-social-roster-section .group-name-text{padding-right:5px}.auto-select-settings-trigger{display:grid;place-items:center;width:18px;height:18px;padding:0;border:0;background:transparent;box-shadow:none;box-sizing:border-box;cursor:pointer;outline:none}.auto-select-social-roster-section__header>.auto-select-settings-trigger{position:absolute;right:8px;top:50%;transform:translateY(-50%)}.auto-select-champ-select-menu__title>.auto-select-settings-trigger{position:absolute;right:5px;top:50%;transform:translateY(-50%)}.auto-select-settings-trigger:before{content:"";display:block;width:13px;height:13px;background:#5f5b4f;opacity:.95;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19.43 12.98c.04-.32.07-.65.07-.98s-.02-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.37-.31-.6-.22l-2.49 1a7.34 7.34 0 0 0-1.69-.98L14.5 2.42A.5.5 0 0 0 14 2h-4a.5.5 0 0 0-.49.42l-.38 2.65c-.61.24-1.18.56-1.69.98l-2.49-1a.5.5 0 0 0-.6.22l-2 3.46a.5.5 0 0 0 .12.64l2.11 1.65c-.04.32-.08.65-.08.98s.03.66.08.98l-2.11 1.65a.5.5 0 0 0-.12.64l2 3.46c.12.22.37.31.6.22l2.49-1c.51.4 1.08.73 1.69.98l.38 2.65c.04.24.25.42.49.42h4c.25 0 .46-.18.5-.42l.38-2.65c.61-.25 1.18-.58 1.69-.98l2.49 1c.23.08.48 0 .6-.22l2-3.46a.5.5 0 0 0-.12-.64l-2.11-1.65ZM12 15.5A3.5 3.5 0 1 1 12 8a3.5 3.5 0 0 1 0 7.5Z'/%3E%3C/svg%3E") center / 13px 13px no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19.43 12.98c.04-.32.07-.65.07-.98s-.02-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.37-.31-.6-.22l-2.49 1a7.34 7.34 0 0 0-1.69-.98L14.5 2.42A.5.5 0 0 0 14 2h-4a.5.5 0 0 0-.49.42l-.38 2.65c-.61.24-1.18.56-1.69.98l-2.49-1a.5.5 0 0 0-.6.22l-2 3.46a.5.5 0 0 0 .12.64l2.11 1.65c-.04.32-.08.65-.08.98s.03.66.08.98l-2.11 1.65a.5.5 0 0 0-.12.64l2 3.46c.12.22.37.31.6.22l2.49-1c.51.4 1.08.73 1.69.98l.38 2.65c.04.24.25.42.49.42h4c.25 0 .46-.18.5-.42l.38-2.65c.61-.25 1.18-.58 1.69-.98l2.49 1c.23.08.48 0 .6-.22l2-3.46a.5.5 0 0 0-.12-.64l-2.11-1.65ZM12 15.5A3.5 3.5 0 1 1 12 8a3.5 3.5 0 0 1 0 7.5Z'/%3E%3C/svg%3E") center / 13px 13px no-repeat}.auto-select-settings-trigger:hover:before,.auto-select-settings-trigger:focus:before,.auto-select-settings-trigger[aria-expanded=true]:before{background:#c8aa6e;opacity:1}.auto-select-settings-flyout{color:#a09b8c;font-family:var(--font-body);font-size:12px;line-height:16px;z-index:10004}.auto-select-settings-flyout lc-flyout-content{display:block;width:100%;box-sizing:border-box}.auto-select-settings-menu{display:flex;flex-direction:column;width:100%;padding:6px 0;color:#a09b8c}.auto-select-settings-menu__empty{min-height:32px;padding:8px 12px;box-sizing:border-box;color:#5f5b4f;font-size:11px}.auto-select-settings-checkbox{display:block;min-height:0;width:100%;height:36px;padding:0;box-sizing:content-box;color:#a09b8c;cursor:pointer}.auto-select-settings-checkbox:hover,.auto-select-settings-checkbox[selected]{color:#f0e6d2}.auto-select-settings-range{display:grid;gap:8px;padding:8px 12px 10px;border-bottom:thin solid #1e282d;box-sizing:border-box}.auto-select-settings-range__header{display:flex;align-items:baseline;justify-content:space-between;gap:8px;min-width:0}.auto-select-settings-range__label{min-width:0;overflow:hidden;color:#f0e6d2;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.auto-select-settings-range__value{flex:0 0 auto;color:#a09b8c;font-size:11px}.auto-select-settings-range__track{position:relative;height:30px;margin:0 15px;cursor:pointer}.auto-select-settings-range__track:before{content:"";position:absolute;left:0;right:0;top:14px;height:2px;background:#1e2328}.auto-select-settings-range__fill{position:absolute;top:13px;height:2px;border:thin solid #010a13;background:linear-gradient(to right,#785a28 0%,#c89b3c 56%,#c8aa6e 100%);box-sizing:border-box;pointer-events:none}.auto-select-settings-range__handle{position:absolute;top:0;width:30px;height:30px;padding:0;border:0;background:url(/fe/lol-uikit/images/slider-btn.png) no-repeat top left;background-size:100%;box-sizing:border-box;cursor:pointer;outline:none;transform:translate(-50%)}.auto-select-settings-range__handle:hover,.auto-select-settings-range__handle:focus{background-position:0 -30px}.auto-select-settings-range__handle--dragging{background-position:0 -60px}.auto-select-champ-select-menu{position:absolute;right:0;bottom:36px;z-index:10000;width:min(340px,calc(100vw - 32px));color:#a09b8c;font-family:var(--font-body);font-size:12px;font-weight:400;line-height:normal;pointer-events:none;text-transform:none}.auto-select-champ-select-menu-button-wrapper{position:relative;display:block;width:38px;height:32px;flex:0 0 38px;box-sizing:border-box}.auto-select-champ-select-menu__header{position:relative;display:block;width:38px;height:32px;border:1px solid #785a28;background:#1e2328;box-shadow:inset 0 0 0 1px #010a13;box-sizing:border-box;cursor:pointer;outline:none;padding:0}.auto-select-champ-select-menu__header:before{content:"";position:absolute;left:50%;top:50%;width:20px;height:20px;background-color:#c8aa6e;-webkit-mask:url(/fe/lol-static-assets/images/nav-icon-collections.svg) center / 20px 20px no-repeat;mask:url(/fe/lol-static-assets/images/nav-icon-collections.svg) center / 20px 20px no-repeat;pointer-events:none;transform:translate(-50%,-50%)}.auto-select-champ-select-menu__header:hover{border-color:#c8aa6e;background:#2a3038}.auto-select-champ-select-menu__header:hover:before{background-color:#f0e6d2}.auto-select-champ-select-menu__header:active,.auto-select-champ-select-menu-button-wrapper--open .auto-select-champ-select-menu__header{border-color:#c89b3c;background:#111820}.auto-select-champ-select-menu-button-wrapper--open{z-index:10000}.auto-select-champ-select-menu-button-wrapper--open .auto-select-champ-select-menu__header:hover{border-color:#c8aa6e;background:#1e2328}.auto-select-champ-select-menu-button-wrapper--open .auto-select-champ-select-menu__header:before{background-color:#f0e6d2}.auto-select-champ-select-menu__content{display:grid;gap:4px;width:100%;margin-bottom:4px;border:1px solid #785a28;background:rgba(1,10,19,.96);box-shadow:0 0 18px #000000a6;box-sizing:border-box;pointer-events:auto;padding:8px}.auto-select-champ-select-menu__title{position:relative;display:flex;align-items:center;justify-content:center;min-height:24px;padding-right:24px;padding-bottom:4px;border-bottom:thin solid #1e282d;color:#f0e6d2;font-family:var(--font-display);font-size:14px;font-weight:700;text-align:center}.auto-select-champ-select-menu .auto-select-checkboxes-div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:center;border-top:0;border-bottom:thin solid #1e282d;padding-bottom:6px}.auto-select-champ-select-menu .auto-select-checkbox{justify-self:center;margin:0}.auto-select-champ-select-menu .dropdown-champions-default{min-height:32px}.auto-select-champ-select-menu .champion-priority-selector__scroll{height:56px}.auto-select-champ-select-menu--collapsed .auto-select-champ-select-menu__content{display:none}`)),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})(); /** * @author balaclava * @name auto-champion-select * @link https://github.com/controlado/auto-champion-select#readme * @description Pick or ban automatically! 🐧 * @version 1.11.4 * @license GPL-3.0-or-later */ import{request as O,sleep as v,linkEndpoint as Ot}from"https://cdn.jsdelivr.net/npm/balaclava-utils@latest";const Oe="1.11.4",we={enabled:!1,hideAutoAcceptPrompt:!0},Te={minMs:2e3,maxMs:4e3},ke={enabled:!1,force:!1,pickIntent:!0,respectManualPick:!1,champions:[432,235],randomAssignedPositions:[],randomPoolPositions:[],positionsByChampionId:{235:["BOTTOM","UTILITY"],432:["UTILITY"]}},Ie={enabled:!1,force:!1,champions:[157,777,238,38],randomPoolPositions:[]},Le={controladoAutoAccept:we,controladoActionDelay:Te,controladoPick:ke,controladoBan:Ie},te=0,ee=8e3,rt=100,ct=2e3,_e=4e3;function lt(o,t){const e=Number(o),n=Number.isFinite(t)?t:ct;if(!Number.isFinite(e))return lt(n,ct);const i=Math.round(e/rt)*rt;return Math.max(te,Math.min(ee,i))}function z(o,t,e=ct,n=_e){const i=lt(o,e),s=lt(t,n);return{minMs:Math.min(i,s),maxMs:Math.max(i,s)}}function ve(o){const{minMs:t,maxMs:e}=z(o.minMs,o.maxMs),n=e-t;return t+Math.floor(Math.random()*(n+1))}function U(o){const t=o/1e3;return`${Number.isInteger(t)?t.toFixed(0):t.toFixed(1)}s`}function m(o){const t=Number(o);return Number.isSafeInteger(t)&&t>0?t:null}function Re(o,t=null){const e=[],n=new Set,i=Me(t);if(!Array.isArray(o))return e;for(const s of o){const a=m(s);a===null||n.has(a)||i&&!i.has(a)||(e.push(a),n.add(a))}return e}function Me(o){return o?new Set(Array.from(o,m).filter(t=>t!==null)):null}const x=[{value:"TOP",label:"Top",iconPath:"/fe/lol-parties/icon-position-top.png"},{value:"JUNGLE",label:"Jungle",iconPath:"/fe/lol-parties/icon-position-jungle.png"},{value:"MIDDLE",label:"Mid",iconPath:"/fe/lol-parties/icon-position-middle.png"},{value:"BOTTOM",label:"ADC",iconPath:"/fe/lol-parties/icon-position-bottom.png"},{value:"UTILITY",label:"Support",iconPath:"/fe/lol-parties/icon-position-utility.png"}],Ne=new Set(x.map(o=>o.value));function F(o){const t=String(o??"").toUpperCase();return Ne.has(t)?t:null}function T(o){if(!Array.isArray(o))return[];const t=new Set;for(const e of o){const n=F(e);n&&t.add(n)}return x.map(e=>e.value).filter(e=>t.has(e))}function W(o,t=null){const e={};if(!o||typeof o!="object"||Array.isArray(o))return e;const n=Be(t);for(const[i,s]of Object.entries(o)){const a=m(i);if(a===null||!Array.isArray(s))continue;const r=String(a);if(n&&!n.has(r))continue;const l=[],u=new Set;for(const A of s){const V=F(A);!V||u.has(V)||(l.push(V),u.add(V))}l.length>0&&(e[r]=l)}return e}function Be(o){if(!o)return null;const t=new Set;for(const e of o){const n=m(e);n!==null&&t.add(String(n))}return t}function ne(o){return x.find(t=>t.value===o)}function oe(o,t){var n;const e=m(t);return e===null?[]:((n=o==null?void 0:o.positionsByChampionId)==null?void 0:n[String(e)])||[]}function De(o,t,e){const n=oe(o,t);if(n.length===0)return!0;const i=F(e);return i!==null&&n.includes(i)}const E="random",L="bravery";function P(o){return o===E}function k(o){return o===L}function M(o){return P(o)?E:k(o)?L:m(o)}function I(o){const t=M(o);return t===null?null:String(t)}function ft(o,t=null){const e=[],n=new Set,i=xe(t);if(!Array.isArray(o))return e;for(const s of o){const a=M(s);if(a===null)continue;const r=String(a);n.has(r)||typeof a=="number"&&i&&!i.has(a)||(e.push(a),n.add(r))}return e}function H(o){return o?Array.from(o,m).filter(t=>t!==null):[]}function xe(o){return o?new Set(Array.from(o,m).filter(t=>t!==null)):null}const wt=new Set;function ie(o,t){return Object.prototype.hasOwnProperty.call(o,t)}function C(o,t){return ie(o,t)}function Fe(o){return Array.isArray(o.priorityOptions)?o.priorityOptions:o.champions}function $e(o,t){return ie(o,"randomPoolPositions")?o.randomPoolPositions:t.randomPositions}function yt(){if(!DataStore)throw new Error("DataStore is not available");return DataStore}function He(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function Pt(o){if(o!==void 0)return JSON.parse(JSON.stringify(o))}function se(o){const t=Le[o];if(!t)throw new Error(`Unknown auto-champion-select config key: ${o}`);return Pt(t)}function ae(o,t,e={}){const n=se(o),i=He(t)?Pt(t):{},s={...n,...i},a={};if(C(n,"enabled")&&(a.enabled=s.enabled===!0),C(n,"hideAutoAcceptPrompt")&&(a.hideAutoAcceptPrompt=s.hideAutoAcceptPrompt===!0),C(n,"minMs")&&C(n,"maxMs")){const{minMs:r,maxMs:l}=z(s.minMs,s.maxMs,n.minMs,n.maxMs);a.minMs=r,a.maxMs=l}return C(n,"force")&&(a.force=s.force===!0),C(n,"pickIntent")&&(a.pickIntent=s.pickIntent!==!1),C(n,"respectManualPick")&&(a.respectManualPick=s.respectManualPick===!0),C(n,"champions")&&(a.priorityOptions=ft(Fe(s),e.allowedChampionIds),a.champions=H(a.priorityOptions)),C(n,"randomAssignedPositions")&&(a.randomAssignedPositions=T(s.randomAssignedPositions)),C(n,"randomPoolPositions")&&(a.randomPoolPositions=T($e(i,s))),C(n,"positionsByChampionId")&&(a.positionsByChampionId=W(s.positionsByChampionId,e.selectedChampionIds||a.champions)),a}function re(o,t,e={}){const n=t===void 0?se(o):t;return ae(o,n,e)}function y(o,t={}){const n=yt().get(o);return re(o,n,t)}function ze(o,t,e={}){const n=yt(),i=ae(o,t,e);return n.set(o,i),i}function Ve(o,t){return JSON.stringify(o)===JSON.stringify(t)}function Ue(o,t,e){wt.has(o)||(wt.add(o),console.warn(`auto-champion-select: Repaired ${o} in DataStore. The stored value used a different schema; plugins like reynbow/auto-champ-lock write this shape. Saved normalized config.`,{storedConfig:t,normalizedConfig:e}))}function ce(o,t={}){const e=yt(),n=e.get(o),i=re(o,n,t);return(n===void 0||!Ve(n,i))&&(n!==void 0&&Ue(o,n,i),e.set(o,i)),i}function R(o,t,e={}){const n=y(o,e),i=Pt(n),s=t(i)||i;return ze(o,s,e)}const f=Object.freeze({readyCheckAccept:"/lol-matchmaking/v1/ready-check/accept",regionLocale:"/riotclient/region-locale",gameflowPhase:"/lol-gameflow/v1/gameflow-phase",wallet:"/lol-inventory/v1/wallet",ownedChampions:"/lol-champions/v1/owned-champions-minimal",championSummary:"/lol-game-data/assets/v1/champion-summary.json",recommendedChampionPositions:"/lol-perks/v1/recommended-champion-positions",champSelectSession:"/lol-champ-select/v1/session",pickableChampionIds:"/lol-champ-select/v1/pickable-champion-ids",bannableChampionIds:"/lol-champ-select/v1/bannable-champion-ids",championIcon(o){return`/lol-game-data/assets/v1/champion-icons/${o}.png`},champSelectAction(o){return`/lol-champ-select/v1/session/actions/${o}`}}),Ge=1e3;function St(o){let t=null;return function(){return t||(t=Promise.resolve().then(o).finally(()=>{t=null})),t}}function le(o,t={}){const e=[],n=new Set;if(!Array.isArray(o))return e;for(const i of o){if(!i||typeof i!="object")continue;const s=m(i.id),a=typeof i.name=="string"?i.name:"";s===null||!a||n.has(a)||(e.push({...i,id:s,name:a,squarePortraitPath:i.squarePortraitPath||f.championIcon(s),recommendedPositions:t[String(s)]||[]}),n.add(a))}return e.sort((i,s)=>i.name.localeCompare(s.name)),e}function Ye(o){const t={};if(!o||typeof o!="object"||Array.isArray(o))return t;for(const[e,n]of Object.entries(o))!n||typeof n!="object"||Array.isArray(n)||(t[e]=n.recommendedPositions);return W(t)}async function qe(){try{const o=await O("GET",f.recommendedChampionPositions);return o.ok?Ye(await o.json()):(console.warn("auto-champion-select(recommended-champion-positions): Request failed",o),{})}catch(o){return console.warn("auto-champion-select(recommended-champion-positions): Failed to load",o),{}}}const X=St(qe);async function je(){let o=await O("GET",f.ownedChampions);for(;!o.ok;)console.debug("auto-champion-select(owned-champions-minimal): Retrying..."),o=await O("GET",f.ownedChampions),await v(Ge);return le(await o.json(),await X())}async function Ke(){const[o,t]=await Promise.all([O("GET",f.championSummary),X()]);return le(await o.json(),t)}const We=St(je),de=St(Ke),Tt=300,Xe=-1,B=-3,Z=Object.freeze({INTENT:"intent",COMPLETION:"completion"}),b=Object.freeze({SATISFIED:"satisfied",TRY_NEXT_CHAMPION:"try-next-champion",STOP_CYCLE:"stop-cycle"}),N=Object.freeze({CONTINUE:"continue-cycle",STOP:"stop-cycle"}),h=Object.freeze({READY:"ready",SKIP_ACTION:"skip-action",STOP_CYCLE:"stop-cycle"}),S=Object.freeze({SATISFIED:"satisfied",TRY_NEXT_PRIORITY_OPTION:"try-next-priority-option",STOP_CYCLE:"stop-cycle"});function dt(o){return Array.isArray(o)?o.flat():[]}function Je(o){return dt(o).filter(t=>t.type==="ban"&&t.completed===!0).map(t=>t.championId)}function kt(o){return Array.isArray(o)?o:[]}function G(o){const t=new Set;for(const e of o){const n=m(e);n!==null&&t.add(n)}return t}function It(o){return o.type==="pick"?0:1}function Lt(){return{pickConfig:y("controladoPick"),banConfig:y("controladoBan"),actionDelayConfig:y("controladoActionDelay")}}function Qe(o){const t=[...o];for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}function Ze(o){return Array.isArray(o)&&o.length===1&&o[0]===Xe}function Y(o){return Number(o)===B}function tn(o){return o.type!=="pick"||o.isInProgress===!0}class en{constructor(){this.session=null,this.actions=null,this.localPlayerCellId=null,this.alliedIntentChampionIds=new Set,this.teammateIntentChampionIds=new Set,this.localPlayerIntentChampionId=null,this.localPlayerIntentIsBravery=!1,this.pickedChampionIds=new Set,this.bannedChampionIds=new Set,this.localPlayerAssignedPosition=null,this.rejectedBraveryActionPhases=new Map,this.pluginPickSelectionId=null,this.manualPickBlocked=!1,this.watchTask=null,this.watchVersion=0,this.mounted=!1}mount(){this.mounted||(this.mounted=!0,this.rejectedBraveryActionPhases.clear(),this.resetPickTracking(),this.watchVersion+=1,this.watchTask||(this.watchTask=this.watch()))}unmount(){this.mounted&&(this.mounted=!1,this.rejectedBraveryActionPhases.clear(),this.resetPickTracking(),this.watchVersion+=1)}async watch(){try{for(;this.mounted;){const t=this.watchVersion;let e=!1;try{await this.refreshSessionState(),e=!0}catch(n){console.debug("auto-champion-select: Failed to update champion select",n)}if(!e||!this.mounted||t!==this.watchVersion){this.mounted&&t===this.watchVersion&&await v(Tt);continue}try{await this.runAutoSelectCycle()}catch(n){console.debug("auto-champion-select: Failed to run champion select cycle",n)}this.mounted&&t===this.watchVersion&&await v(Tt)}}finally{this.watchTask=null}}async refreshSessionState(){var a,r;const t=await O("GET",f.champSelectSession);if(!t.ok)throw new Error(`Session request failed with status ${t.status}`);this.session=await t.json(),this.actions=this.session.actions,this.localPlayerCellId=this.session.localPlayerCellId;const e=kt(this.session.myTeam),n=kt(this.session.theirTeam),i=e.find(l=>l.cellId===this.localPlayerCellId),s=e.filter(l=>l.cellId!==this.localPlayerCellId);this.localPlayerAssignedPosition=F(i==null?void 0:i.assignedPosition),this.localPlayerIntentChampionId=m(i==null?void 0:i.championPickIntent),this.localPlayerIntentIsBravery=Y(i==null?void 0:i.championPickIntent),this.pickedChampionIds=G([...e,...n].map(l=>l.championId)),this.bannedChampionIds=G([...((a=this.session.bans)==null?void 0:a.myTeamBans)||[],...((r=this.session.bans)==null?void 0:r.theirTeamBans)||[],...Je(this.actions)]),this.alliedIntentChampionIds=G(e.map(l=>l.championPickIntent)),this.teammateIntentChampionIds=G(s.map(l=>l.championPickIntent))}async runAutoSelectCycle(){const t=Lt();if(!t.pickConfig.enabled&&!t.banConfig.enabled)return;const e=this.getLocalPlayerActions();if(e.length===0){console.debug("auto-champion-select: No local player sub actions found, skipping..."),this.unmount();return}for(const n of e)if(await this.runAutoSelectForAction(n,t)===N.STOP)return}async runAutoSelectForAction(t,e){const n=await this.prepareActionForAutoSelect(t,e);switch(n.status){case h.READY:return this.tryAutoSelectPlan(n.plan);case h.SKIP_ACTION:return N.CONTINUE;case h.STOP_CYCLE:return N.STOP;default:throw new Error(`Unexpected auto-select plan status: ${n.status}`)}}async prepareActionForAutoSelect(t,e){const n=this.getConfigForActionType(t.type,e);if(!(n!=null&&n.enabled))return{status:h.SKIP_ACTION};if(!this.isActionAvailable(t,n))return{status:h.SKIP_ACTION};if(this.shouldSkipPickForManualSelection(t,n))return{status:h.SKIP_ACTION};const i=this.createAutoSelectPlan(t,n);if(!i)return{status:h.SKIP_ACTION};const s=this.createPlanLimitedToAlreadySatisfiedPriorityOption(i);if(s)return{status:h.READY,plan:s};const a=await this.delayAndRefreshAutoSelectPlan(t,n,e.actionDelayConfig);return a.status!==h.READY?a:{status:h.READY,plan:this.createPlanLimitedToAlreadySatisfiedPriorityOption(a.plan)||a.plan}}async tryAutoSelectPlan(t){for(const e of t.priorityOptions){const n=await this.tryPriorityOptionForAction(t.action,e,t.config);if(n===S.SATISFIED)return N.CONTINUE;if(n===S.STOP_CYCLE)return N.STOP}return N.CONTINUE}async tryPriorityOptionForAction(t,e,n){if(this.isPriorityOptionAlreadySatisfied(t,e))return S.SATISFIED;if(k(e))return this.tryBraveryForAction(t,n);const i=await this.resolveChampionIdsForPriorityOption(t,e,n),s=P(e)&&!this.isLockingExistingPickIntent(t,i);for(const a of i){const r={tryNextRandomCandidateOnFailure:s},l=await this.attemptChampionForAction(t,a,n,r);if(l===b.SATISFIED)return S.SATISFIED;if(l===b.STOP_CYCLE)return S.STOP_CYCLE}return S.TRY_NEXT_PRIORITY_OPTION}async tryBraveryForAction(t,e){if(t.type!=="pick")return S.TRY_NEXT_PRIORITY_OPTION;if(this.isBraveryPickIntentSet(t))return S.SATISFIED;console.debug("auto-champion-select: Trying to pick Bravery...");const n=await this.selectChampion(t,B);console.debug(n.ok?"auto-champion-select: Bravery request accepted, refreshing champ select state...":"auto-champion-select: Failed to pick Bravery, refreshing champ select state..."),n.ok&&(this.pluginPickSelectionId=B,await this.completePickIfNowInProgress(t,B));const i=await this.refreshPendingAction(t);return!i||!this.isActionAvailable(i,e)?n.ok?S.SATISFIED:S.STOP_CYCLE:this.isBraveryPickIntentSet(i)?S.SATISFIED:(this.pluginPickSelectionId=null,this.rememberRejectedBraveryAction(t),console.debug("auto-champion-select: Bravery was not applied after refresh, trying next pick..."),S.TRY_NEXT_PRIORITY_OPTION)}getLocalPlayerActions(){return dt(this.actions).filter(t=>this.isPendingLocalPlayerAction(t)).sort((t,e)=>It(t)-It(e))}isPendingLocalPlayerAction(t){return t.actorCellId===this.localPlayerCellId&&t.completed===!1}isActionAvailable(t,e){return t.type==="pick"?t.isInProgress===!0||e.pickIntent!==!1:t.isInProgress===!0}getConfigForActionType(t,e){return t==="pick"?e.pickConfig:t==="ban"?e.banConfig:null}createAutoSelectPlan(t,e){const n=this.getAvailablePriorityOptionsForAction(t,e);return n.length===0?null:{action:t,config:e,priorityOptions:n}}getAvailablePriorityOptionsForAction(t,e){return ft(e.priorityOptions||e.champions).filter(n=>!this.isPriorityOptionUnavailableForAction(t,n,e))}isPriorityOptionUnavailableForAction(t,e,n){return P(e)?this.isRandomPriorityOptionUnavailableForAction(t,n):k(e)?this.isBraveryPriorityOptionUnavailableForAction(t):this.isChampionUnavailableForAction(t,e,n)}isBraveryPriorityOptionUnavailableForAction(t){if(t.type!=="pick")return!0;const e=this.rejectedBraveryActionPhases.get(t.id);return e===void 0?!1:t.isInProgress===!0&&e===Z.INTENT?(this.rejectedBraveryActionPhases.delete(t.id),!1):!0}rememberRejectedBraveryAction(t){const e=t.isInProgress===!0?Z.COMPLETION:Z.INTENT;this.rejectedBraveryActionPhases.set(t.id,e)}isRandomPriorityOptionUnavailableForAction(t,e){if(t.type!=="pick")return!1;const n=T(e.randomAssignedPositions);return n.length===0?!1:this.localPlayerAssignedPosition?n.includes(this.localPlayerAssignedPosition)?!1:(console.debug(`auto-champion-select: Skipping random pick because assigned position ${this.localPlayerAssignedPosition} is not in ${n.join(", ")}.`),!0):(console.debug(`auto-champion-select: Skipping random pick because no assigned position is available for ${n.join(", ")} restriction.`),!0)}createPlanLimitedToAlreadySatisfiedPriorityOption(t){const e=t.priorityOptions.find(n=>this.isPriorityOptionAlreadySatisfied(t.action,n));return e===void 0?null:{...t,priorityOptions:[e]}}isPriorityOptionAlreadySatisfied(t,e){return P(e)?this.hasAnyPickIntentSet(t):k(e)?this.isBraveryPickIntentSet(t):this.isPickIntentSetToChampion(t,e)}hasAnyPickIntentSet(t){return t.type==="pick"&&t.isInProgress!==!0&&(this.localPlayerIntentChampionId!==null||this.localPlayerIntentIsBravery||m(t.championId)!==null||Y(t.championId))}isBraveryPickIntentSet(t){return t.type==="pick"&&t.isInProgress!==!0&&(this.localPlayerIntentIsBravery||Y(t.championId))}isLockingExistingPickIntent(t,e){return t.type==="pick"&&t.isInProgress===!0&&e.length===1&&e[0]===this.getPickIntentChampionId(t)}getPickIntentChampionId(t){return t.type!=="pick"?null:m(t.championId)??this.localPlayerIntentChampionId}getCurrentLocalPickOrIntentSelectionId(t){if(t.type!=="pick")return null;const e=m(t.championId);return e!==null?e:Y(t.championId)?B:this.localPlayerIntentChampionId!==null?this.localPlayerIntentChampionId:this.localPlayerIntentIsBravery?B:null}shouldSkipPickForManualSelection(t,e){if(t.type!=="pick"||e.respectManualPick!==!0)return!1;if(this.manualPickBlocked)return!0;const n=this.getCurrentLocalPickOrIntentSelectionId(t);return n===null||this.pluginPickSelectionId===n?!1:(this.manualPickBlocked=!0,console.debug(`auto-champion-select: Skipping pick action ${t.id} because manual pick ${n} was detected.`),!0)}resetPickTracking(){this.pluginPickSelectionId=null,this.manualPickBlocked=!1}async delayAndRefreshAutoSelectPlan(t,e,n){const i=ve(n);if(i<=0){console.debug(`auto-champion-select: Action delay is instant for ${t.type}.`);const u=this.createAutoSelectPlan(t,e);return u?{status:h.READY,plan:u}:{status:h.STOP_CYCLE}}console.debug(`auto-champion-select: Waiting ${i}ms before ${t.type}...`);const s=this.watchVersion;if(await v(i),!this.mounted||s!==this.watchVersion)return{status:h.STOP_CYCLE};let a=null;try{await this.refreshSessionState(),a=this.findPendingAction(t)}catch(u){return console.debug("auto-champion-select: Failed to refresh champion select after action delay",u),{status:h.STOP_CYCLE}}const r=this.getConfigForActionType(t.type,Lt());if(!(r!=null&&r.enabled))return{status:h.STOP_CYCLE};if(!a||!this.isActionAvailable(a,r))return{status:h.STOP_CYCLE};if(this.shouldSkipPickForManualSelection(a,r))return{status:h.SKIP_ACTION};const l=this.createAutoSelectPlan(a,r);return l?{status:h.READY,plan:l}:{status:h.STOP_CYCLE}}async resolveChampionIdsForPriorityOption(t,e,n){return k(e)?[]:P(e)?this.resolveRandomChampionIdsForAction(t,n):[e]}async resolveRandomChampionIdsForAction(t,e){if(t.type==="pick"&&t.isInProgress===!0){const a=this.getPickIntentChampionId(t);if(a!==null&&!this.isChampionUnavailableForAction(t,a,e))return[a]}const n=await this.fetchRandomCandidateChampionIds(t);if(n.length===0)return[];const i=n.filter(a=>!this.isChampionUnavailableForAction(t,a,e)),s=t.type==="pick"&&!this.hasConfiguredRandomPoolPositions(e)?await this.preferAssignedPositionRandomPickCandidates(i):await this.filterRandomChampionIdsByConfiguredPoolPositions(i,e);return Qe(s)}async fetchRandomCandidateChampionIds(t){const e=t.type==="pick"?f.pickableChampionIds:f.bannableChampionIds;try{const n=await O("GET",e);if(!n.ok)return console.debug(`auto-champion-select: Failed to load random ${t.type} candidates`,n),[];const i=await n.json();return t.type==="ban"&&Ze(i)?(console.debug("auto-champion-select: Random ban endpoint returned unrestricted sentinel, falling back to all champions..."),await this.fetchAllChampionIdsForRandomBan()):Re(i)}catch(n){return console.debug(`auto-champion-select: Failed to load random ${t.type} candidates`,n),[]}}async fetchAllChampionIdsForRandomBan(){return(await de()).map(e=>e.id)}hasConfiguredRandomPoolPositions(t){return T(t.randomPoolPositions).length>0}async filterRandomChampionIdsByConfiguredPoolPositions(t,e){const n=T(e.randomPoolPositions);if(n.length===0)return t;const i=new Set(n),s=await X(),a=t.filter(r=>{var l;return(l=s[String(r)])==null?void 0:l.some(u=>i.has(u))});return a.length===0&&console.debug(`auto-champion-select: No random candidates matched ${n.join(", ")} restriction.`),a}async preferAssignedPositionRandomPickCandidates(t){if(!this.localPlayerAssignedPosition)return t;const e=await X(),n=t.filter(i=>{var s;return(s=e[String(i)])==null?void 0:s.includes(this.localPlayerAssignedPosition)});return n.length>0?n:t}async attemptChampionForAction(t,e,n,i={}){const s=m(e);if(s===null||this.isChampionUnavailableForAction(t,s,n))return b.TRY_NEXT_CHAMPION;if(this.isPickIntentSetToChampion(t,s))return b.SATISFIED;if(console.debug(`auto-champion-select: Trying to ${t.type} ${s}...`),(await this.selectChampion(t,s)).ok)return t.type==="pick"&&(this.pluginPickSelectionId=s,await this.completePickIfNowInProgress(t,s)),b.SATISFIED;console.debug(`auto-champion-select: Failed to ${t.type} ${s}, refreshing champ select state...`);const r=await this.refreshPendingAction(t);return!r||!this.isActionAvailable(r,n)?b.STOP_CYCLE:i.tryNextRandomCandidateOnFailure===!0?this.hasAnyPickIntentSet(r)?b.SATISFIED:(console.debug(`auto-champion-select: Failed random ${t.type} candidate ${s}, trying next ${t.type}...`),b.TRY_NEXT_CHAMPION):this.isChampionUnavailableForAction(r,s,n)?(console.debug(`auto-champion-select: ${s} is unavailable after refresh, trying next ${t.type}...`),b.TRY_NEXT_CHAMPION):b.STOP_CYCLE}isPickIntentSetToChampion(t,e){return t.type==="pick"&&t.isInProgress!==!0&&(this.localPlayerIntentChampionId===e||m(t.championId)===e)}async completePickIfNowInProgress(t,e){if(t.type!=="pick"||t.isInProgress===!0)return;const n=await this.refreshPendingAction(t);(n==null?void 0:n.isInProgress)!==!0||this.getCurrentLocalPickOrIntentSelectionId(n)!==e||(console.debug(`auto-champion-select: Completing pick ${e} after accepted pick intent...`),await this.selectChampion(n,e))}async refreshPendingAction(t){try{await this.refreshSessionState()}catch(e){return console.debug("auto-champion-select: Failed to refresh champion select action",e),null}return this.findPendingAction(t)}findPendingAction(t){return dt(this.actions).find(e=>e.id===t.id&&e.actorCellId===t.actorCellId&&e.type===t.type&&e.completed===!1)||null}isChampionUnavailableForAction(t,e,n){if(t.type==="pick"&&!De(n,e,this.localPlayerAssignedPosition)){const i=oe(n,e);return this.localPlayerAssignedPosition?console.debug(`auto-champion-select: Picking ${e} but assigned position ${this.localPlayerAssignedPosition} is not in ${i.join(", ")}, skipping...`):console.debug(`auto-champion-select: Picking ${e} but no assigned position is available for ${i.join(", ")} restriction, skipping...`),!0}if(this.bannedChampionIds.has(e))return console.debug(`auto-champion-select: Banning ${e} but it's already banned, skipping...`),!0;if(t.type==="ban"&&this.alliedIntentChampionIds.has(e))if(n.force===!0)console.debug(`auto-champion-select: Banning ${e} but it has an allied pick intent, forcing...`);else return console.debug(`auto-champion-select: Banning ${e} but it has an allied pick intent, skipping...`),!0;if(t.type==="pick"&&this.teammateIntentChampionIds.has(e))if(n.force===!0)console.debug(`auto-champion-select: Picking ${e} but it has a teammate pick intent, forcing...`);else return console.debug(`auto-champion-select: Picking ${e} but it has a teammate pick intent, skipping...`),!0;return t.type==="pick"&&this.pickedChampionIds.has(e)?(console.debug(`auto-champion-select: Picking ${e} but it's already picked, skipping...`),!0):!1}selectChampion(t,e){const n=f.champSelectAction(t.id),i={championId:e,completed:tn(t)};return O("PATCH",n,{body:i})}}const nn={socialRosterTitle:"AUTO CHAMPION SELECT",champSelectMenuTitle:"Auto Champion Select"},on={autoAccept:"Accept",pick:"Pick",ban:"Ban"},sn={on:"ON",off:"OFF"},an={pick:"Pick",ban:"Ban"},rn={TOP:"Top",JUNGLE:"Jungle",MIDDLE:"Mid",BOTTOM:"ADC",UTILITY:"Support"},cn={two:"{first} or {second}",many:"{items}, or {last}"},ln={pickPlaceholder:"Add pick",banPlaceholder:"Add ban",search:"Search",emptyTitle:"No champions",pickEmptyHint:"Use the menu to add a pick",banEmptyHint:"Use the menu to add a ban",remove:"Remove {name}",positionFilterLabel:"Filter champions by position",random:{label:"Random",assignedTitlePart:"runs only when assigned role matches {positions}",poolTitlePart:"limits Random pool to {positions}"},bravery:{label:"Bravery",description:"For Arena mode"},positionBadge:{randomAssignedAny:"The plugin can use Random in any role. Click to run it only in selected draft roles.",randomAssignedSome:"The plugin will use Random only when your assigned role matches {positions}. Draft modes only. Click to edit.",randomPoolAny:"The plugin can choose any available champion at random. Click to filter the pool first.",randomPoolSome:"The plugin filters Random to champions for {positions}, then picks one. Click to edit.",championSome:"The plugin will pick this champion only when your assigned role matches {positions}. Draft modes only. Click to edit.",championAny:"The plugin can pick this champion in any role. Click to limit it to selected draft roles."}},dn={triggerLabel:"Auto champion select settings",empty:"No settings available",actionDelay:"Action delay",pickIntent:"Set pick intent",respectManualPick:"Respect manual pick",forcePick:"Ignore ally pick intent",forceBan:"Ignore ally pick intent when banning",hideAutoAcceptPrompt:"Hide auto-accept prompt",handleLabel:"{label} {handle}",handles:{min:"min",max:"max"},actionDelayValue:{instant:"Instant",exact:"Delays actions for {delay}",upTo:"Delays actions up to {delay}",range:"Delays actions {min}-{max}"}},un={readyCheckAccepted:"Match accepted!",readyCheckAcceptFailed:"Failed to accept match. Check console."},hn={group:"Balaclava: Auto Champion Select",autoSwitchName:"Auto {name} [{state}]",turnOn:"Turn ON",turnOff:"Turn OFF",autoSwitchOn:"Auto {name} is ON!",autoSwitchOff:"Auto {name} is OFF!",autoSwitchError:"Failed to toggle Auto {name}. Check console.",forcePickName:"Ignore Team Intent Pick",forceBanName:"Ignore Team Intent Ban",forceSwitchName:"{name} [{state}]",forcePickLegend:"Pick even if a teammate intends that champion",forceBanLegend:"Ban even if a teammate intends that champion",forceSwitchOn:"{name} is ON!",forceSwitchOff:"{name} is OFF!",forceSwitchError:"Failed to toggle {name}. Check console.",refreshChampionsName:"Refresh Champions",refreshChampionsLegend:"Normally champion selectors refresh automatically...",refreshChampionsSuccess:"Refreshed Champions!",refreshChampionsError:"Failed to refresh Champions. Check console."},pn={plugin:nn,toggles:on,states:sn,actions:an,positions:rn,list:cn,selectors:ln,settings:dn,toasts:un,commandBar:hn},mn={socialRosterTitle:"AUTO CHAMPION SELECT",champSelectMenuTitle:"Auto Champion Select"},gn={autoAccept:"Aceptar",pick:"Pick",ban:"Ban"},fn={on:"ON",off:"OFF"},yn={pick:"Pick",ban:"Ban"},Pn={TOP:"Top",JUNGLE:"Jungla",MIDDLE:"Mid",BOTTOM:"ADC",UTILITY:"Soporte"},Sn={two:"{first} o {second}",many:"{items} o {last}"},An={pickPlaceholder:"Agregar pick",banPlaceholder:"Agregar ban",search:"Buscar",emptyTitle:"Sin campeones",pickEmptyHint:"Usa el menú para agregar",banEmptyHint:"Usa el menú para agregar",remove:"Quitar {name}",positionFilterLabel:"Filtrar campeones por posición",random:{label:"Aleatorio",assignedTitlePart:"solo si la posición asignada es {positions}",poolTitlePart:"filtra el pool a {positions}"},bravery:{label:"Valentía",description:"Para Arena"},positionBadge:{randomAssignedAny:"Aleatorio sirve en cualquier posición. Haz clic para limitar posiciones de draft.",randomAssignedSome:"Aleatorio solo si tu posición es {positions}. Solo draft; haz clic para editar.",randomPoolAny:"Aleatorio puede elegir cualquier campeón disponible. Haz clic para filtrar.",randomPoolSome:"Aleatorio elige campeones de {positions}. Haz clic para editar.",championSome:"Este campeón solo se elige si tu posición es {positions}. Solo draft; haz clic para editar.",championAny:"Este campeón sirve en cualquier posición. Haz clic para limitar posiciones."}},Cn={triggerLabel:"Ajustes de Auto Champion Select",empty:"Sin ajustes",actionDelay:"Retraso de acción",pickIntent:"Marcar intención de selección",respectManualPick:"Respetar selección manual",forcePick:"Ignorar intención aliada al pickear",forceBan:"Ignorar intención aliada al banear",hideAutoAcceptPrompt:"Ocultar confirmación de partida",handleLabel:"{label} {handle}",handles:{min:"mín",max:"máx"},actionDelayValue:{instant:"Sin retraso",exact:"Retraso de {delay}",upTo:"Hasta {delay}",range:"Retraso de {min}-{max}"}},bn={readyCheckAccepted:"¡Partida aceptada!",readyCheckAcceptFailed:"No se pudo aceptar la partida. Revisa la consola."},En={group:"Balaclava: Auto Champion Select",autoSwitchName:"Auto {name} [{state}]",turnOn:"Activar",turnOff:"Desactivar",autoSwitchOn:"Auto {name} está ON!",autoSwitchOff:"Auto {name} está OFF!",autoSwitchError:"No se pudo cambiar Auto {name}. Revisa la consola.",forcePickName:"Ignorar intención aliada al pickear",forceBanName:"Ignorar intención aliada al banear",forceSwitchName:"{name} [{state}]",forcePickLegend:"Pickea aunque un aliado quiera el mismo campeón",forceBanLegend:"Banea aunque un aliado quiera ese campeón",forceSwitchOn:"{name} está ON!",forceSwitchOff:"{name} está OFF!",forceSwitchError:"No se pudo cambiar {name}. Revisa la consola.",refreshChampionsName:"Actualizar campeones",refreshChampionsLegend:"Normalmente los selectores se actualizan solos...",refreshChampionsSuccess:"¡Campeones actualizados!",refreshChampionsError:"No se actualizaron campeones. Revisa la consola."},On={plugin:mn,toggles:gn,states:fn,actions:yn,positions:Pn,list:Sn,selectors:An,settings:Cn,toasts:bn,commandBar:En},wn={socialRosterTitle:"AUTO CHAMPION SELECT",champSelectMenuTitle:"Auto Champion Select"},Tn={autoAccept:"수락",pick:"선택",ban:"밴"},kn={on:"ON",off:"OFF"},In={pick:"선택",ban:"밴"},Ln={TOP:"탑",JUNGLE:"정글",MIDDLE:"미드",BOTTOM:"원딜",UTILITY:"서폿"},_n={two:"{first} 또는 {second}",many:"{items} 또는 {last}"},vn={pickPlaceholder:"픽 추가",banPlaceholder:"밴 추가",search:"검색",emptyTitle:"챔피언 없음",pickEmptyHint:"메뉴에서 추가",banEmptyHint:"메뉴에서 추가",remove:"{name} 제거",positionFilterLabel:"포지션별 챔피언 필터",random:{label:"랜덤",assignedTitlePart:"배정 포지션이 {positions}일 때만 실행",poolTitlePart:"랜덤 풀을 {positions}로 제한"},bravery:{label:"용기",description:"아레나용"},positionBadge:{randomAssignedAny:"랜덤은 모든 포지션에서 사용 가능. 클릭해 드래프트 포지션 제한.",randomAssignedSome:"랜덤은 배정 포지션이 {positions}일 때만 사용. 드래프트 전용; 클릭해 편집.",randomPoolAny:"랜덤은 가능한 모든 챔피언 중 선택 가능. 클릭해 풀 필터.",randomPoolSome:"랜덤은 {positions} 챔피언 중 선택. 클릭해 편집.",championSome:"이 챔피언은 배정 포지션이 {positions}일 때만 선택. 드래프트 전용; 클릭해 편집.",championAny:"이 챔피언은 모든 포지션에서 선택 가능. 클릭해 포지션 제한."}},Rn={triggerLabel:"Auto Champion Select 설정",empty:"설정 없음",actionDelay:"동작 지연",pickIntent:"선택 의도 설정",respectManualPick:"수동 선택 존중",forcePick:"아군 희망 챔피언 무시하고 선택",forceBan:"아군 희망 챔피언 무시하고 밴",hideAutoAcceptPrompt:"자동 수락 알림 숨기기",handleLabel:"{label} {handle}",handles:{min:"최소",max:"최대"},actionDelayValue:{instant:"즉시",exact:"{delay} 지연",upTo:"{delay}까지 지연",range:"{min}-{max} 지연"}},Mn={readyCheckAccepted:"게임 수락됨!",readyCheckAcceptFailed:"게임 수락 실패. 콘솔 확인."},Nn={group:"Balaclava: Auto Champion Select",autoSwitchName:"자동 {name} [{state}]",turnOn:"켜기",turnOff:"끄기",autoSwitchOn:"자동 {name} 켜짐!",autoSwitchOff:"자동 {name} 꺼짐!",autoSwitchError:"자동 {name} 전환 실패. 콘솔 확인.",forcePickName:"희망 챔피언 무시 선택",forceBanName:"희망 챔피언 무시 밴",forceSwitchName:"{name} [{state}]",forcePickLegend:"팀원이 같은 챔피언을 희망해도 선택",forceBanLegend:"팀원이 같은 챔피언을 희망해도 밴",forceSwitchOn:"{name} 켜짐!",forceSwitchOff:"{name} 꺼짐!",forceSwitchError:"{name} 전환 실패. 콘솔 확인.",refreshChampionsName:"챔피언 새로고침",refreshChampionsLegend:"챔피언 목록은 보통 자동으로 새로고침됩니다...",refreshChampionsSuccess:"챔피언 새로고침 완료!",refreshChampionsError:"챔피언 새로고침 실패. 콘솔 확인."},Bn={plugin:wn,toggles:Tn,states:kn,actions:In,positions:Ln,list:_n,selectors:vn,settings:Rn,toasts:Mn,commandBar:Nn},Dn={socialRosterTitle:"AUTO CHAMPION SELECT",champSelectMenuTitle:"Auto Champion Select"},xn={autoAccept:"Aceitar",pick:"Pick",ban:"Ban"},Fn={on:"ON",off:"OFF"},$n={pick:"Pick",ban:"Ban"},Hn={TOP:"Top",JUNGLE:"Jungle",MIDDLE:"Mid",BOTTOM:"ADC",UTILITY:"Suporte"},zn={two:"{first} ou {second}",many:"{items} ou {last}"},Vn={pickPlaceholder:"Adicionar pick",banPlaceholder:"Adicionar ban",search:"Buscar",emptyTitle:"Nenhum campeão",pickEmptyHint:"Use o menu para adicionar um pick",banEmptyHint:"Use o menu para adicionar um ban",remove:"Remover {name}",positionFilterLabel:"Filtrar campeões por posição",random:{label:"Aleatório",assignedTitlePart:"só roda quando sua rota for {positions}",poolTitlePart:"limita o pool a {positions}"},bravery:{label:"Bravura",description:"Para o modo Arena"},positionBadge:{randomAssignedAny:"Aleatório pode rodar em qualquer rota. Clique para limitar às rotas do draft.",randomAssignedSome:"Aleatório só roda se sua rota for {positions}. Draft apenas. Clique para editar.",randomPoolAny:"Aleatório pode escolher qualquer campeão disponível. Clique para filtrar o pool.",randomPoolSome:"Aleatório escolhe campeões de {positions}. Clique para editar.",championSome:"Este campeão só será escolhido se sua rota for {positions}. Draft apenas. Clique para editar.",championAny:"Este campeão pode ser escolhido em qualquer rota. Clique para limitar às rotas do draft."}},Un={triggerLabel:"Configurações do Auto Champion Select",empty:"Nenhuma configuração disponível",actionDelay:"Delay de ação",pickIntent:"Marcar intenção de pick",respectManualPick:"Respeitar pick manual",forcePick:"Ignorar intenção aliada no pick",forceBan:"Ignorar intenção aliada no ban",hideAutoAcceptPrompt:"Ocultar confirmação da fila",handleLabel:"{label} {handle}",handles:{min:"mínimo",max:"máximo"},actionDelayValue:{instant:"Sem delay",exact:"Delay de {delay}",upTo:"Delay de até {delay}",range:"Delay de {min}-{max}"}},Gn={readyCheckAccepted:"Fila aceita!",readyCheckAcceptFailed:"Falha ao aceitar a fila. Verifique o console."},Yn={group:"Balaclava: Auto Champion Select",autoSwitchName:"Auto {name} [{state}]",turnOn:"Ativar",turnOff:"Desativar",autoSwitchOn:"Auto {name} está ON!",autoSwitchOff:"Auto {name} está OFF!",autoSwitchError:"Falha ao alternar Auto {name}. Verifique o console.",forcePickName:"Ignorar intenção aliada no pick",forceBanName:"Ignorar intenção aliada no ban",forceSwitchName:"{name} [{state}]",forcePickLegend:"Escolhe mesmo se um aliado indicar o mesmo campeão",forceBanLegend:"Bane mesmo se um aliado indicar o campeão",forceSwitchOn:"{name} está ON!",forceSwitchOff:"{name} está OFF!",forceSwitchError:"Falha ao alternar {name}. Verifique o console.",refreshChampionsName:"Atualizar campeões",refreshChampionsLegend:"Normalmente as listas de campeões atualizam automaticamente...",refreshChampionsSuccess:"Campeões atualizados!",refreshChampionsError:"Falha ao atualizar campeões. Verifique o console."},qn={plugin:Dn,toggles:xn,states:Fn,actions:$n,positions:Hn,list:zn,selectors:Vn,settings:Un,toasts:Gn,commandBar:Yn},jn={socialRosterTitle:"AUTO CHAMPION SELECT",champSelectMenuTitle:"Auto Champion Select"},Kn={autoAccept:"Принять",pick:"Пик",ban:"Бан"},Wn={on:"ON",off:"OFF"},Xn={pick:"Пик",ban:"Бан"},Jn={TOP:"Топ",JUNGLE:"Лес",MIDDLE:"Мид",BOTTOM:"Бот",UTILITY:"Саппорт"},Qn={two:"{first} или {second}",many:"{items} или {last}"},Zn={pickPlaceholder:"Добавить пик",banPlaceholder:"Добавить бан",search:"По