!function(e,r){"object"==typeofexports&&"object"==typeofmodule?module.exports=r():"function"==typeofdefine&&define.amd?define([],r):"object"==typeofexports?exports.rpc=r():e.rpc=r()}("undefined"!=typeofself?self:this,function(){returnfunction(e){varr={};functionn(t){if(r[t])returnr[t].exports;varc=r[t]={i:t,l:!1,exports:{}};returne[t].call(c.exports,c,c.exports,n),c.l=!0,c.exports}returnn.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeofSymbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)returne;if(4&r&&"object"==typeofe&&e&&e.__esModule)returne;vart=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeofe)for(varcine)n.d(t,c,function(r){returne[r]}.bind(null,c));returnt},n.n=function(e){varr=e&&e.__esModule?function(){returne.default}:function(){returne};returnn.d(r,"a",r),r},n.o=function(e,r){returnObject.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=1)}([function(e,r,n){"use strict";functiont(){conste=46656*Math.random()|0,r=46656*Math.random()|0;return("000"+e.toString(36)).slice(-3)+("000"+r.toString(36)).slice(-3)}functionc(){returnmp.joaat?"server":mp.game&&mp.game.joaat?"client":mp.trigger?"cef":void0}functiono(e){returnJSON.stringify(e)}functions(e){returnJSON.parse(e)}n.d(r,"d",function(){returnt}),n.d(r,"a",function(){returnc}),n.d(r,"c",function(){returno}),n.d(r,"b",function(){returns})},function(e,r,n){"use strict";n.r(r),function(e){n.d(r,"register",function(){returnp}),n.d(r,"unregister",function(){returnd}),n.d(r,"call",function(){returnm}),n.d(r,"callServer",function(){returnv}),n.d(r,"callClient",function(){returnh}),n.d(r,"callBrowsers",function(){returny}),n.d(r,"callBrowser",function(){returnb});vart=n(0);constc=t.a();if(!c)throw"Unknown RAGE environment";consto="PROCEDURE_NOT_FOUND",s="__rpc:process",i="__rpc:exists",a="cef"===c?window:e;functionl(e,r,n){constc=t.c(r);e.execute(`var process = window["${s}"]; if(process){ process('${c}'); }else{ ${n?"":`mp.trigger("${s}", '{"ret":1,"id":"${r.id}","err":"${o}","env":"cef"}');`} }`)}functionu(e,r){mp.browsers.forEach(n=>l(n,e,r))}asyncfunctionf(e,r,n){constt=a.__rpcListeners[e];if(!t)throwo;returnt(r,n)}functionp(e,r){if(2!==arguments.length)throw'register expects 2 arguments: "name" and "cb"';a.__rpcListeners[e]=r}functiond(e){if(1!==arguments.length)throw'unregister expects 1 argument: "name"';a.__rpcListeners[e]=void0}functionm(e,r){return1!==arguments.length&&2!==arguments.length?Promise.reject('call expects 1 or 2 arguments: "name" and optional "args"'):f(e,r,{environment:c})}functiong(e,r,n={}){switch(c){case"server":returnm(e,r);case"client":{consto=t.d();returnnewPromise((i,l)=>{a.__rpcPending[o]={resolve:i,reject:l};constu={req:1,id:o,name:e,env:c,args:r,...n};mp.events.callRemote(s,t.c(u))})}case"cef":returnh("__rpc:callServer",[e,r])}}functionv(e,r){return1!==arguments.length&&2!==arguments.length?Promise.reject('callServer expects 1 or 2 arguments: "name" and optional "args"'):g(e,r,{})}functionh(e,r,n){switch(c){case"client":returnn=r,r=e,1!==arguments.length&&2!==arguments.length||"string"!=typeofr?Promise.reject('callClient from the client expects 1 or 2 arguments: "name" and optional "args"'):m(r,n);case"server":{if(2!==arguments.length&&3!==arguments.length||"object"!=typeofe)returnPromise.reject('callClient from the server expects 2 or 3 arguments: "player", "name", and optional "args"');consto=t.d();returnnewPromise((i,l)=>{a.__rpcPending[o]={resolve:i,reject:l,player:e};constu={req:1,id:o,name:r,env:c,args:n};e.call(s,[t.c(u)])})}case"cef":{if(n=r,r=e,1!==arguments.length&&2!==arguments.length||"string"!=typeofr)returnPromise.reject('callClient from the browser expects 1 or 2 arguments: "name" and optional "args"');consto=t.d();returnnewPromise((e,i)=>{a.__rpcPending[o]={resolve:e,reject:i}