window.pubg=function(t){var s={};function e(i){if(s[i])return s[i].exports;var a=s[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,e),a.l=!0,a.exports}return e.m=t,e.c=s,e.d=function(t,s,i){e.o(t,s)||Object.defineProperty(t,s,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var s=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(s,"a",s),s},e.o=function(t,s){return Object.prototype.hasOwnProperty.call(t,s)},e.p="",e(e.s=10)}([function(t,s,e){const i=e(4),a=e(5);t.exports=class Match{constructor(t,s,e){if(Object.defineProperty(this,"client",{value:s}),"string"==typeof t)return this.id=t,void(this.full=!1);this.id=t.id,this.full=!0,this.attributes={createdAt:new Date(t.attributes.createdAt),duration:t.attributes.duration,gameMode:t.attributes.gameMode,mapName:t.attributes.mapName,isCustomMatch:t.attributes.isCustomMatch,patchVersion:t.attributes.patchVersion,shardId:t.attributes.shardId,stats:t.attributes.stats,tags:t.attributes.tags,titleId:t.attributes.titleId},this.relationships={assets:t.relationships.assets.data.map(t=>new i(e.find(s=>"asset"===s.type&&s.id===t.id),e)),rosters:t.relationships.rosters.data.map(t=>new a(e.find(s=>"roster"===s.type&&s.id===t.id),e))}}fetch(){return this.client.getMatch(this.id)}fetchTelemetry(){return this.client.getTelemetry(this.relationships.assets[0].attributes.URL)}}},function(t,s,e){const i=e(0);t.exports=class Player{constructor(t,s){if(Object.defineProperty(this,"client",{value:s}),"string"==typeof t)return this.id=t,void(this.full=!1);this.id=t.id,this.full=!0,this.attributes={name:t.attributes.name,shardId:t.attributes.shardId,patchVersion:t.attributes.patchVersion,titleId:t.attributes.titleId},this.relationships={assets:t.relationships.assets.data,matches:t.relationships.matches.data.map(t=>new i(t.id,this.client))}}getPlayerSeason(t){return this.client.getPlayerSeason(this,t)}fetch(t=this.client.defaultShard){return this.client.getPlayer({id:this.id},t)}}},function(t,s){t.exports=class Season{constructor(t,s){if(Object.defineProperty(this,"client",{value:s}),"string"==typeof t)return this.id=t,void(this.full=!1);this.id=t.id,this.full=!0,this.attributes={isCurrentSeason:t.attributes.isCurrentSeason,isOffSeason:t.attributes.isOffseason}}getPlayerSeason(t,s){return this.client.getPlayerSeason(t,this,s)}}},function(t,s){t.exports={name:"pubg.js",version:"3.6.0",description:"A powerful Playerunknown's Battlegrounds JavaScript API Wrapper",main:"src/index.js",scripts:{test:"npm run lint && npm run tests",lint:"eslint src *.js",tests:"node test/index.js",webpack:"./node_modules/.bin/webpack --config webpack.config.js",docs:"./node_modules/.bin/jsdoc src src/matches src/playerseason README.md -t ./node_modules/minami && echo pubg.js.org > ./out/CNAME"},repository:{type:"git",url:"git+https://github.com/ickerio/pubg.js.git"},keywords:["pubg","api","wrapper"],author:"ickerio",license:"ISC",bugs:{url:"https://github.com/ickerio/pubg.js/issues"},runkitExampleFilename:"docs/example.js",homepage:"https://github.com/ickerio/pubg.js#readme",dependencies:{snekfetch:"^4.0.0"},devDependencies:{eslint:"^4.19.1",jsdoc:"^3.5.5",minami:"^1.2.3","uglifyjs-webpack-plugin":"^1.2.5",webpack:"^3.11.0"}}},function(t,s){t.exports=class Asset{constructor(t){this.id=t.id,this.attributes={URL:t.attributes.URL,createdAt:t.attributes.createdAt,description:t.attributes.description,name:t.attributes.name}}}},function(t,s,e){const i=e(6);t.exports=class Roster{constructor(t,s){this.id=t.id,this.attributes={shardId:t.attributes.shardId,stats:{rank:t.attributes.stats.rank,teamId:t.attributes.stats.teamId},won:Boolean(t.attributes.won)},this.relationships={participants:t.relationships.participants.data.map(t=>new i(s.find(s=>"participant"===s.type&&s.id===t.id))),team:t.relationships.team.data}}}},function(t,s){t.exports=class Participant{constructor(t){this.id=t.id,this.attributes={actor:t.attributes.actor,shardId:t.attributes.shardId,stats:{DBNOs:t.attributes.stats.DBNOs,assists:t.attributes.stats.assists,boosts:t.attributes.stats.boosts,damageDealt:t.attributes.stats.damageDealt,deathType:t.attributes.stats.deathType,headshotKills:t.attributes.stats.headshotKills,heals:t.attributes.stats.heals,killPlace:t.attributes.stats.killPlace,killPoints:t.attributes.stats.killPoints,killPointsDelta:t.attributes.stats.killPointsDelta,killStreaks:t.attributes.stats.killStreaks,kills:t.attributes.stats.kills,lastKillPoints:t.attributes.stats.lastKillPoints,lastWinPoints:t.attributes.stats.lastWinPoints,longestKill:t.attributes.stats.longestKill,mostDamage:t.attributes.stats.mostDamage,name:t.attributes.stats.name,playerId:t.attributes.stats.playerId,revives:t.attributes.stats.revives,rideDistance:t.attributes.stats.rideDistance,roadKills:t.attributes.stats.roadKills,swimDistance:t.attributes.stats.swimDistance,teamKills:t.attributes.stats.teamKills,timeSurvived:t.attributes.stats.timeSurvived,vehicleDestroys:t.attributes.stats.vehicleDestroys,walkDistance:t.attributes.stats.walkDistance,weaponsAcquired:t.attributes.stats.weaponsAcquired,winPlace:t.attributes.stats.winPlace,winPoints:t.attributes.stats.winPoints,winPointsDelta:t.attributes.stats.winPointsDelta}}}}},function(t,s){t.exports=class Status{constructor(t){this.id=t.id,this.attributes={releasedAt:new Date(t.attributes.releasedAt),version:t.attributes.version}}}},function(t,s,e){const i=e(9),a=e(1),r=e(0),n=e(2);t.exports=class PlayerSeason{constructor(t,s){this.attributes={gameModeStats:{duo:new i(t.attributes.gameModeStats.duo),duoFPP:new i(t.attributes.gameModeStats["duo-fpp"]),solo:new i(t.attributes.gameModeStats.solo),soloFPP:new i(t.attributes.gameModeStats["solo-fpp"]),squad:new i(t.attributes.gameModeStats.squad),squadFPP:new i(t.attributes.gameModeStats["squad-fpp"])}},this.relationships={player:new a(t.relationships.player.data.id,s),matchesSolo:t.relationships.matchesSolo.data.map(t=>new r(t.id,this.client)),matchesSoloFPP:t.relationships.matchesSoloFPP.data.map(t=>new r(t.id,this.client)),matchesDuo:t.relationships.matchesDuo.data.map(t=>new r(t.id,this.client)),matchesDuoFPP:t.relationships.matchesDuoFPP.data.map(t=>new r(t.id,this.client)),matchesSquad:t.relationships.matchesSquad.data.map(t=>new r(t.id,this.client)),matchesSquadFPP:t.relationships.matchesSquadFPP.data.map(t=>new r(t.id,this.client)),season:new n(t.relationships.season.data.id)}}}},function(t,s){t.exports=class GameModeStats{constructor(t){this.assists=t.assists,this.boosts=t.boosts,this.dBNOs=t.dBNOs,this.dailyKills=t.dailyKills,this.damageDealt=t.damageDealt,this.days=t.days,this.headshotKills=t.headshotKills,this.heals=t.heals,this.killPoints=t.killPoints,this.kills=t.kills,this.longestKill=t.longestKill,this.longestTimeSurvived=t.longestTimeSurvived,this.losses=t.losses,this.maxKillStreaks=t.maxKillStreaks,this.mostSurvivalTime=t.mostSurvivalTime,this.revives=t.revives,this.rideDistance=t.rideDistance,this.roadKills=t.roadKills,this.roundMostKills=t.roundMostKills,this.roundsPlayed=t.roundsPlayed,this.suicides=t.suicides,this.teamKills=t.teamKills,this.timeSurvived=t.timeSurvived,this.top10s=t.top10s,this.vehicleDestroys=t.vehicleDestroys,this.walkDistance=t.walkDistance,this.weaponsAcquired=t.weaponsAcquired,this.weeklyKills=t.weeklyKills,this.winPoints=t.winPoints,this.winRatio=t.winRatio,this.wins=t.wins}}},function(t,s,e){t.exports={Client:e(11),Match:e(0),Asset:e(4),Participant:e(6),Roster:e(5),GameModeStats:e(9),PlayerSeason:e(8),Player:e(1),Season:e(2),Status:e(7),version:e(3).version}},function(t,s,e){const i=e(12),a=e(3),r=e(16),n=e(1),o=e(0),c=e(7),u=e(2),d=e(18),h=e(8);t.exports=class Client{constructor(t,s="pc-oc"){if(!t)throw new Error("No API key passed.");this.key=t,this.defaultShard=s}getPlayer(t,s=this.defaultShard){if("object"!=typeof t||"string"!=typeof s)throw new Error("Requires (object, !string)");return t.id?this._baseRequest({endpoint:Array.isArray(t.id)?"players":`players/${t.id}`,shard:s,query:Array.isArray(t.id)?{"filter[playerIds]":t.id.join(",")}:{}}).then(t=>Array.isArray(t.data)?1===t.data.length?new n(t.data[0],this):t.data.map(t=>new n(t,this)):new n(t.data,this)).catch(t=>Promise.reject(t.body.errors)):t.name?this._baseRequest({endpoint:"players",shard:s,query:{"filter[playerNames]":Array.isArray(t.name)?t.name.join(","):t.name}}).then(t=>Array.isArray(t.data)?1===t.data.length?new n(t.data[0],this):t.data.map(t=>new n(t,this)):new n(t.data,this)).catch(t=>Promise.reject(t.body.errors)):Promise.reject(new Error("Invalid use of .getPlayer()"))}getSeasons(t=this.defaultShard){return this._baseRequest({endpoint:"seasons",shard:t}).then(t=>t.data.map(t=>new u(t,this)))}getPlayerSeason(t,s,e){return this._baseRequest({endpoint:`players/${t instanceof n?t.id:t}/seasons/${s instanceof u?s.id:s}`,shard:t instanceof n?t.attributes.shardId:e||this.defaultShard}).then(t=>new h(t.data))}getMatch(t,s=this.defaultShard){if("string"!=typeof t||"string"!=typeof s)throw new Error("Requires (string, !string)");return this._baseRequest({endpoint:`matches/${t}`,shard:s}).then(t=>new o(t.data,this,t.included)).catch(t=>Promise.reject(t.body.errors))}getStatus(){return this._baseRequest({endpoint:"status"}).then(t=>new c(t.data)).catch(t=>Promise.reject(t.body.errors))}getTournaments(){return this._baseRequest({endpoint:"tournaments"}).then(t=>t.data.map(t=>new d(t,this))).catch(t=>Promise.reject(t))}getTournament(t){return this._baseRequest({endpoint:`tournaments/${t}`}).then(t=>new d(t.data)).catch(t=>Promise.reject(t.body.errors))}getSamples(t,s=this.defaultShard){return this._baseRequest({endpoint:"samples",shard:s,query:t instanceof Date?{"filter[createdAt]":t.toISOString()}:{}}).then(t=>t.data.relationships.matches.data.map(t=>new o(t.id,this))).catch(t=>Promise.reject(t.body.errors))}getTelemetry(t){if(!t||"string"!=typeof t)throw new Error("Requires (string)");return this._baseRequest({url:t})}_baseRequest(t={}){const s=t.url||r.constructURL(t.endpoint,t.shard);if(!s)throw new Error("Invalid shard");return i.get(s).set(this._headers).query(t.query||{}).then(t=>t.body)}get _headers(){return{"User-Agent":`pubg.js v${a.version} (${a.homepage})`,accept:"application/json",Authorization:`Bearer ${this.key}`}}}},function(t,s,e){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),e.d(s,"delete",function(){return l});var i=e(13),a=e.n(i);s.default=a.a;const{version:r}=a.a;s.version=r;const{METHODS:n}=a.a;s.METHODS=n;const{acl:o}=a.a;s.acl=o;const{bind:c}=a.a;s.bind=c;const{checkout:u}=a.a;s.checkout=u;const{connect:d}=a.a;s.connect=d;const{copy:h}=a.a;s.copy=h;const{delete:l}=a.a,{get:p}=a.a;s.get=p;const{head:b}=a.a;s.head=b;const{link:m}=a.a;s.link=m;const{lock:f}=a.a;s.lock=f;const{merge:y}=a.a;s.merge=y;const{mkactivity:w}=a.a;s.mkactivity=w;const{mkcalendar:g}=a.a;s.mkcalendar=g;const{mkcol:S}=a.a;s.mkcol=S;const{move:P}=a.a;s.move=P;const{notify:k}=a.a;s.notify=k;const{options:v}=a.a;s.options=v;const{patch:q}=a.a;s.patch=q;const{post:D}=a.a;s.post=D;const{propfind:j}=a.a;s.propfind=j;const{proppatch:x}=a.a;s.proppatch=x;const{purge:A}=a.a;s.purge=A;const{put:R}=a.a;s.put=R;const{rebind:T}=a.a;s.rebind=T;const{report:O}=a.a;s.report=O;const{search:E}=a.a;s.search=E;const{source:M}=a.a;s.source=M;const{subscribe:_}=a.a;s.subscribe=_;const{trace:K}=a.a;s.trace=K;const{unbind:I}=a.a;s.unbind=I;const{unlink:C}=a.a;s.unlink=C;const{unlock:$}=a.a;s.unlock=$;const{unsubscribe:F}=a.a;s.unsubscribe=F},function(t,s,e){"use strict";const i=e("undefined"!=typeof window?14:15);class Snekfetch extends i.Parent{constructor(t,s,e={}){super(),this.options=Object.assign({qs:i.querystring,method:t,url:s,redirect:"follow"},e,{headers:{},query:void 0,data:void 0}),e.headers&&this.set(e.headers),e.query&&this.query(e.query),e.data&&this.send(e.data)}query(t,s){return void 0===this.options.query&&(this.options.query={}),"object"==typeof t?Object.assign(this.options.query,t):this.options.query[t]=s,this}set(t,s){if("object"==typeof t)for(const[s,e]of Object.entries(t))this.options.headers[s.toLowerCase()]=e;else this.options.headers[t.toLowerCase()]=s;return this}attach(...t){const s=this.options.data instanceof i.FormData?this.options.data:this.options.data=new i.FormData;if("object"==typeof t[0])for(const[s,e]of Object.entries(t[0]))this.attach(s,e);else s.append(...t);return this}send(t){if(t instanceof i.FormData||i.shouldSendRaw(t))this.options.data=t;else if(null!==t&&"object"==typeof t){const s=this.options.headers["content-type"];let e;s?s.includes("application/json")?e=JSON.stringify:s.includes("urlencoded")&&(e=this.options.qs.stringify):(this.set("Content-Type","application/json"),e=JSON.stringify),this.options.data=e(t)}else this.options.data=t;return this}then(t,s){return this._response?this._response.then(t,s):(this._finalizeRequest(),this._response=i.request(this).then(({raw:t,headers:s,statusCode:e,statusText:i})=>{const a=this,r={request:this.request,get body(){delete r.body;const s=r.headers["content-type"];if(t instanceof ArrayBuffer&&(t=new window.TextDecoder("utf8").decode(t)),/application\/json/.test(s))try{r.body=JSON.parse(t)}catch(s){r.body=String(t)}else/application\/x-www-form-urlencoded/.test(s)?r.body=a.options.qs.parse(String(t)):r.body=t;return r.body},raw:t,ok:e>=200&&e<400,headers:s,statusCode:e,statusText:i};if(r.ok)return r;const n=new Error(`${e} ${i}`.trim());return Object.assign(n,r),Promise.reject(n)}).then(t,s))}catch(t){return this.then(null,t)}end(t){return this.then(s=>t?t(null,s):s,s=>t?t(s,s.statusCode?s:null):Promise.reject(s))}_finalizeRequest(){if("HEAD"!==this.options.method&&this.set("Accept-Encoding","gzip, deflate"),this.options.data&&this.options.data.getBoundary&&this.set("Content-Type",`multipart/form-data; boundary=${this.options.data.getBoundary()}`),this.options.query){const[t,s]=this.options.url.split("?");this.options.url=`${t}?${this.options.qs.stringify(this.options.query)}${s?`&${s}`:""}`}}_read(){this.resume(),this._response||this.catch(t=>this.emit("error",t))}}Snekfetch.METHODS=i.METHODS.filter(t=>"M-SEARCH"!==t);for(const t of Snekfetch.METHODS)Snekfetch[t.toLowerCase()]=function(s,e){return new(this&&this.prototype instanceof Snekfetch?this:Snekfetch)(t,s,e)};t.exports=Snekfetch},function(t,s,e){"use strict";t.exports={request:function(t){t.options.body=t.options.data;const s="arraybuffer"===t.options.responseType?"arrayBuffer":"text";return window.fetch(t.options.url,t.options).then(t=>t[s]().then(s=>{const e={};for(const[s,i]of t.headers.entries())e[s.toLowerCase()]=i;return{raw:s,headers:e,statusCode:t.status,statusText:t.statusText}}))},shouldSendRaw:()=>!1,METHODS:["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","PATCH"],Parent:Object,FormData:window.FormData,querystring:{parse:t=>{const s={};for(const[e,i]of new window.URLSearchParams(t).entries())s[e]=i;return s},stringify:t=>new window.URLSearchParams(t).toString()}}},function(t,s){},function(t,s,e){const i=e(17);t.exports=class Util{constructor(){throw new Error(`The ${this.constructor.name} class may not be instantiated.`)}static constructURL(t,s){return s?this.verifyShard(s)?`${i.BASE_URL}/shards/${s}/${t}`:void 0:`${i.BASE_URL}/${t}`}static verifyShard(t){return i.SHARDS.includes(t)}}},function(t,s){t.exports={BASE_URL:"https://api.pubg.com",SHARDS:["xbox-as","xbox-eu","xbox-na","xbox-oc","pc-krjp","pc-jp","pc-na","pc-eu","pc-oc","pc-ru","pc-kakao","pc-sea","pc-sa","pc-as"]}},function(t,s,e){const i=e(0);t.exports=class Tournament{constructor(t,s){Object.defineProperty(this,"client",{value:s}),this.full=!!t.relationships,this.id=t.id,this.relationships={matches:this.full?t.relationships.matches.data.map(t=>new i(t.id,this.client)):[]}}fetch(){return this.client.getTournament(this.id)}}}]);