/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./_virtual/_rollupPluginBabelHelpers.js"),t=require("../../../_virtual/index.js");var r={},n=null,i=function(t){e.inherits(a,t);var i=e.createSuper(a);function a(){return e.classCallCheck(this,a),i.apply(this,arguments)}return e.createClass(a,[{key:"add",value:function(e){e&&(r[e.playerId]=e,1===Object.keys(r).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete r[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var i=r[n];if(t){if(e(i))break}else e(i)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var t=null;return this._iterate(function(r){var n=e(r);return n&&(t=r),n},!0),t}},{key:"findAll",value:function(e){var t=[];return this._iterate(function(r){e(r)&&t.push(r)}),t}},{key:"setActive",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(r[e])return t?this.forEach(function(t){e===t.playerId?(t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1}):r[e].isUserActive=t,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(r),t=0;t<e.length;t++){var n=r[e[t]];if(n&&n.isUserActive)return e[t]}return null}},{key:"setNext",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(r[e])return t?this.forEach(function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1}):r[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return n||(n=new a),n}}]),a}(t.e.EventEmitter);exports.InstManager=i,exports.checkPlayerRoot=function(e){for(var t=Object.keys(r),n=0;n<t.length;n++){var i=r[t[n]];if(i.root===e)return i}return null};