YiAi/YiAiQuickDeploy/dist/common/utils/selectKeyWithWeight.js
2024-07-02 16:38:26 +08:00

1 line
1.8 KiB
JavaScript

'use strict';const _0x4f8075=_0x17a6;(function(_0xe36e35,_0x1e4489){const _0x366983=_0x17a6,_0x2a3993=_0xe36e35();while(!![]){try{const _0x3b642a=parseInt(_0x366983(0xcb))/0x1+-parseInt(_0x366983(0xc3))/0x2*(-parseInt(_0x366983(0xc2))/0x3)+parseInt(_0x366983(0xc0))/0x4*(-parseInt(_0x366983(0xbd))/0x5)+-parseInt(_0x366983(0xcc))/0x6*(parseInt(_0x366983(0xcd))/0x7)+parseInt(_0x366983(0xc4))/0x8+parseInt(_0x366983(0xbc))/0x9*(parseInt(_0x366983(0xc9))/0xa)+parseInt(_0x366983(0xc8))/0xb*(-parseInt(_0x366983(0xc6))/0xc);if(_0x3b642a===_0x1e4489)break;else _0x2a3993['push'](_0x2a3993['shift']());}catch(_0x1f1a6c){_0x2a3993['push'](_0x2a3993['shift']());}}}(_0x4cd3,0x71898));function _0x17a6(_0x397c33,_0x6e68d5){const _0x4cd3dd=_0x4cd3();return _0x17a6=function(_0x17a6b7,_0x37cdd4){_0x17a6b7=_0x17a6b7-0xbc;let _0x47ebb5=_0x4cd3dd[_0x17a6b7];return _0x47ebb5;},_0x17a6(_0x397c33,_0x6e68d5);}function _0x4cd3(){const _0x1c443a=['reduce','47565TdhXvX','5LPUHeM','selectKeyWithWeight','defineProperty','3216824zOYJow','random','498XAvwuS','9994uiGDqj','4629904nfWBzM','weight','12PlZMcW','__esModule','16019135YqYxFf','930vtWOSi','length','891389opqiFB','18HGiyNx','153055DaYJFZ'];_0x4cd3=function(){return _0x1c443a;};return _0x4cd3();}Object[_0x4f8075(0xbf)](exports,_0x4f8075(0xc7),{'value':!![]}),exports[_0x4f8075(0xbe)]=void 0x0;function selectKeyWithWeight(_0x26e6dc){const _0x26644c=_0x4f8075;if(_0x26e6dc[_0x26644c(0xca)]===0x0)return undefined;const _0x1562c9=_0x26e6dc[_0x26644c(0xce)]((_0x38e04b,_0x29a043)=>_0x38e04b+_0x29a043['weight'],0x0);let _0x3fcc28=Math[_0x26644c(0xc1)]()*_0x1562c9;for(const _0x2cd35d of _0x26e6dc){_0x3fcc28-=_0x2cd35d[_0x26644c(0xc5)];if(_0x3fcc28<0x0)return _0x2cd35d;}return _0x26e6dc[_0x26e6dc[_0x26644c(0xca)]-0x1];}exports[_0x4f8075(0xbe)]=selectKeyWithWeight;