---
# System prepended metadata

title: Untitled

---

```
// ==UserScript==
// @name         Extended tribe profile
// @version      1.0.3
// @description  Adds additional info and actions on a tribe overview.
// @author       Dawid Wysokiński - Kichiyaki - contact@dwysokinski.me
// @match        https://*/game.php?*screen=info_ally*
// @downloadURL  https://scripts.tribalwarshelp.com/extended-tribe-profile.user.js
// @updateURL    https://scripts.tribalwarshelp.com/extended-tribe-profile.user.js
// @icon         https://www.google.com/s2/favicons?domain=plemiona.pl
// @grant        none
// @run-at       document-end
// ==/UserScript==
!function(){let e;var t,r,n,i,o,a,s,l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function u(e,t){return function(){return e.apply(t,arguments)}}let{toString:c}=Object.prototype,{getPrototypeOf:f}=Object,h=(t=Object.create(null),e=>{let r=c.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())}),d=e=>(e=e.toLowerCase(),t=>h(t)===e),p=e=>t=>typeof t===e,{isArray:g}=Array,y=p("undefined"),m=d("ArrayBuffer"),b=p("string"),v=p("function"),w=p("number"),E=e=>null!==e&&"object"==typeof e,S=e=>{if("object"!==h(e))return!1;let t=f(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},A=d("Date"),O=d("File"),T=d("Blob"),R=d("FileList"),C=d("URLSearchParams");function L(e,t,{allOwnKeys:r=!1}={}){let n,i;if(null!=e){if("object"!=typeof e&&(e=[e]),g(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{let i;let o=r?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;for(n=0;n<a;n++)i=o[n],t.call(null,e[i],i,e)}}}function U(e,t){let r;t=t.toLowerCase();let n=Object.keys(e),i=n.length;for(;i-- >0;)if(t===(r=n[i]).toLowerCase())return r;return null}let P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:l,B=e=>!y(e)&&e!==P,k=(r="undefined"!=typeof Uint8Array&&f(Uint8Array),e=>r&&e instanceof r),$=d("HTMLFormElement"),x=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),D=d("RegExp"),N=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};L(r,(r,i)=>{let o;!1!==(o=t(r,i,e))&&(n[i]=o||r)}),Object.defineProperties(e,n)},j="abcdefghijklmnopqrstuvwxyz",_="0123456789",I={DIGIT:_,ALPHA:j,ALPHA_DIGIT:j+j.toUpperCase()+_},M=d("AsyncFunction");var F={isArray:g,isArrayBuffer:m,isBuffer:function(e){return null!==e&&!y(e)&&null!==e.constructor&&!y(e.constructor)&&v(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||v(e.append)&&("formdata"===(t=h(e))||"object"===t&&v(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer)},isString:b,isNumber:w,isBoolean:e=>!0===e||!1===e,isObject:E,isPlainObject:S,isUndefined:y,isDate:A,isFile:O,isBlob:T,isRegExp:D,isFunction:v,isStream:e=>E(e)&&v(e.pipe),isURLSearchParams:C,isTypedArray:k,isFileList:R,forEach:L,merge:function e(){let{caseless:t}=B(this)&&this||{},r={},n=(n,i)=>{let o=t&&U(r,i)||i;S(r[o])&&S(n)?r[o]=e(r[o],n):S(n)?r[o]=e({},n):g(n)?r[o]=n.slice():r[o]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&L(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:n}={})=>(L(t,(t,n)=>{r&&v(t)?e[n]=u(t,r):e[n]=t},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,o,a;let s={};if(t=t||{},null==e)return t;do{for(o=(i=Object.getOwnPropertyNames(e)).length;o-- >0;)a=i[o],(!n||n(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=!1!==r&&f(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype)return t},kindOf:h,kindOfTest:d,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return -1!==n&&n===r},toArray:e=>{if(!e)return null;if(g(e))return e;let t=e.length;if(!w(t))return null;let r=Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{let r;let n=e&&e[Symbol.iterator],i=n.call(e);for(;(r=i.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let r;let n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:$,hasOwnProperty:x,hasOwnProp:x,reduceDescriptors:N,freezeMethods:e=>{N(e,(t,r)=>{if(v(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;let n=e[r];if(v(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},toObjectSet:(e,t)=>{let r={};return(e=>{e.forEach(e=>{r[e]=!0})})(g(e)?e:String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>Number.isFinite(e=+e)?e:t,findKey:U,global:P,isContextDefined:B,ALPHABET:I,generateString:(e=16,t=I.ALPHA_DIGIT)=>{let r="",{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&v(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{let t=Array(10),r=(e,n)=>{if(E(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;let i=g(e)?[]:{};return L(e,(e,t)=>{let o=r(e,n+1);y(o)||(i[t]=o)}),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:M,isThenable:e=>e&&(E(e)||v(e))&&v(e.then)&&v(e.catch)};function z(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}F.inherits(z,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:F.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});let q=z.prototype,H={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{H[e]={value:e}}),Object.defineProperties(z,H),Object.defineProperty(q,"isAxiosError",{value:!0}),z.from=(e,t,r,n,i,o)=>{let a=Object.create(q);return F.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),z.call(a,e.message,t,r,n,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a},i=function(e){for(var t,r=e.length,n=r%3,i=[],o=0,a=r-n;o<a;o+=16383)i.push(function(e,t,r){for(var n,i=[],o=t;o<r;o+=3)i.push(V[(n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]))>>18&63]+V[n>>12&63]+V[n>>6&63]+V[63&n]);return i.join("")}(e,o,o+16383>a?a:o+16383));return 1===n?i.push(V[(t=e[r-1])>>2]+V[t<<4&63]+"=="):2===n&&i.push(V[(t=(e[r-2]<<8)+e[r-1])>>10]+V[t>>4&63]+V[t<<2&63]+"="),i.join("")};for(var V=[],J=[],W="undefined"!=typeof Uint8Array?Uint8Array:Array,K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Q=0,G=K.length;Q<G;++Q)V[Q]=K[Q],J[K.charCodeAt(Q)]=Q;J["-".charCodeAt(0)]=62,J["_".charCodeAt(0)]=63,o=function(e,t,r,n,i){var o,a,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+f],f+=h,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:(d?-1:1)*(1/0);a+=Math.pow(2,n),o-=u}return(d?-1:1)*a*Math.pow(2,o-n)},a=function(e,t,r,n,i,o){var a,s,l,u=8*o-i-1,c=(1<<u)-1,f=c>>1,h=23===i?5960464477539062e-23:0,d=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+f>=1?t+=h/l:t+=h*Math.pow(2,1-f),t*l>=2&&(a++,l/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*l-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[r+d]=255&a,d+=p,a/=256,u-=8);e[r+d-p]|=128*g};var Y="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function X(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,Z.prototype),t}function Z(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return er(e)}return ee(e,t,r)}function ee(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!Z.isEncoding(t))throw TypeError("Unknown encoding: "+t);var r=0|ea(e,t),n=X(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(eE(e,Uint8Array)){var t=new Uint8Array(e);return ei(t.buffer,t.byteOffset,t.byteLength)}return en(e)}(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(eE(e,ArrayBuffer)||e&&eE(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(eE(e,SharedArrayBuffer)||e&&eE(e.buffer,SharedArrayBuffer)))return ei(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Z.from(n,t,r);var i=function(e){if(Z.isBuffer(e)){var t,r=0|eo(e.length),n=X(r);return 0===n.length||e.copy(n,0,0,r),n}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?X(0):en(e):"Buffer"===e.type&&Array.isArray(e.data)?en(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Z.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function et(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function er(e){return et(e),X(e<0?0:0|eo(e))}function en(e){for(var t=e.length<0?0:0|eo(e.length),r=X(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function ei(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Z.prototype),n}function eo(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function ea(e,t){if(Z.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||eE(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return eb(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ev(e).length;default:if(i)return n?-1:eb(e).length;t=(""+t).toLowerCase(),i=!0}}function es(e,t,r){var n,o,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=eS[e[o]];return i}(this,t,r);case"utf8":case"utf-8":return ef(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return n=t,o=r,0===n&&o===this.length?i(this):i(this.slice(n,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}(this,t,r);default:if(a)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function el(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function eu(e,t,r,n,i){var o;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(o=r=+r)!=o&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return -1;r=e.length-1}else if(r<0){if(!i)return -1;r=0}if("string"==typeof t&&(t=Z.from(t,n)),Z.isBuffer(t))return 0===t.length?-1:ec(e,t,r,n,i);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):ec(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function ec(e,t,r,n,i){var o,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,s/=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;o<s;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*a}else -1!==c&&(o-=o-c),c=-1}else for(r+l>s&&(r=s-l),o=r;o>=0;o--){for(var f=!0,h=0;h<l;h++)if(u(e,o+h)!==u(t,h)){f=!1;break}if(f)return o}return -1}function ef(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,l,u=e[i],c=null,f=u>239?4:u>223?3:u>191?2:1;if(i+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:(192&(o=e[i+1]))==128&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[i+1],a=e[i+2],(192&o)==128&&(192&a)==128&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],(192&o)==128&&(192&a)==128&&(192&s)==128&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}function eh(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function ed(e,t,r,n,i,o){if(!Z.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function ep(e,t,r,n,i,o){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function eg(e,t,r,n,i){return t=+t,r>>>=0,i||ep(e,t,r,4,34028234663852886e22,-34028234663852886e22),a(e,t,r,n,23,4),r+4}function ey(e,t,r,n,i){return t=+t,r>>>=0,i||ep(e,t,r,8,17976931348623157e292,-17976931348623157e292),a(e,t,r,n,52,8),r+8}Z.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),Z.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Z.prototype,"parent",{enumerable:!0,get:function(){if(Z.isBuffer(this))return this.buffer}}),Object.defineProperty(Z.prototype,"offset",{enumerable:!0,get:function(){if(Z.isBuffer(this))return this.byteOffset}}),Z.poolSize=8192,Z.from=function(e,t,r){return ee(e,t,r)},Object.setPrototypeOf(Z.prototype,Uint8Array.prototype),Object.setPrototypeOf(Z,Uint8Array),Z.alloc=function(e,t,r){return(et(e),e<=0)?X(e):void 0!==t?"string"==typeof r?X(e).fill(t,r):X(e).fill(t):X(e)},Z.allocUnsafe=function(e){return er(e)},Z.allocUnsafeSlow=function(e){return er(e)},Z.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==Z.prototype},Z.compare=function(e,t){if(eE(e,Uint8Array)&&(e=Z.from(e,e.offset,e.byteLength)),eE(t,Uint8Array)&&(t=Z.from(t,t.offset,t.byteLength)),!Z.isBuffer(e)||!Z.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},Z.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Z.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Z.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=Z.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(eE(o,Uint8Array))i+o.length>n.length?Z.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else if(Z.isBuffer(o))o.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n},Z.byteLength=ea,Z.prototype._isBuffer=!0,Z.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)el(this,t,t+1);return this},Z.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)el(this,t,t+3),el(this,t+1,t+2);return this},Z.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)el(this,t,t+7),el(this,t+1,t+6),el(this,t+2,t+5),el(this,t+3,t+4);return this},Z.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?ef(this,0,e):es.apply(this,arguments)},Z.prototype.toLocaleString=Z.prototype.toString,Z.prototype.equals=function(e){if(!Z.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===Z.compare(this,e)},Z.prototype.inspect=function(){var e="";return e=this.toString("hex",0,50).replace(/(.{2})/g,"$1 ").trim(),this.length>50&&(e+=" ... "),"<Buffer "+e+">"},Y&&(Z.prototype[Y]=Z.prototype.inspect),Z.prototype.compare=function(e,t,r,n,i){if(eE(e,Uint8Array)&&(e=Z.from(e,e.offset,e.byteLength)),!Z.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,a=r-t,s=Math.min(o,a),l=this.slice(n,i),u=e.slice(t,r),c=0;c<s;++c)if(l[c]!==u[c]){o=l[c],a=u[c];break}return o<a?-1:a<o?1:0},Z.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},Z.prototype.indexOf=function(e,t,r){return eu(this,e,t,r,!0)},Z.prototype.lastIndexOf=function(e,t,r){return eu(this,e,t,r,!1)},Z.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,a,s,l,u,c,f,h=this.length-t;if((void 0===r||r>h)&&(r=h),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var d=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(s!=s)break;e[r+a]=s}return a}(this,e,t,r);case"utf8":case"utf-8":return i=t,o=r,ew(eb(e,this.length-i),this,i,o);case"ascii":case"latin1":case"binary":return a=t,s=r,ew(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(e),this,a,s);case"base64":return l=t,u=r,ew(ev(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,f=r,ew(function(e,t){for(var r,n,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(e,this.length-c),this,c,f);default:if(d)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),d=!0}},Z.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Z.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,Z.prototype),n},Z.prototype.readUintLE=Z.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||eh(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},Z.prototype.readUintBE=Z.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||eh(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},Z.prototype.readUint8=Z.prototype.readUInt8=function(e,t){return e>>>=0,t||eh(e,1,this.length),this[e]},Z.prototype.readUint16LE=Z.prototype.readUInt16LE=function(e,t){return e>>>=0,t||eh(e,2,this.length),this[e]|this[e+1]<<8},Z.prototype.readUint16BE=Z.prototype.readUInt16BE=function(e,t){return e>>>=0,t||eh(e,2,this.length),this[e]<<8|this[e+1]},Z.prototype.readUint32LE=Z.prototype.readUInt32LE=function(e,t){return e>>>=0,t||eh(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Z.prototype.readUint32BE=Z.prototype.readUInt32BE=function(e,t){return e>>>=0,t||eh(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Z.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||eh(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},Z.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||eh(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},Z.prototype.readInt8=function(e,t){return(e>>>=0,t||eh(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},Z.prototype.readInt16LE=function(e,t){e>>>=0,t||eh(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Z.prototype.readInt16BE=function(e,t){e>>>=0,t||eh(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Z.prototype.readInt32LE=function(e,t){return e>>>=0,t||eh(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Z.prototype.readInt32BE=function(e,t){return e>>>=0,t||eh(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Z.prototype.readFloatLE=function(e,t){return e>>>=0,t||eh(e,4,this.length),o(this,e,!0,23,4)},Z.prototype.readFloatBE=function(e,t){return e>>>=0,t||eh(e,4,this.length),o(this,e,!1,23,4)},Z.prototype.readDoubleLE=function(e,t){return e>>>=0,t||eh(e,8,this.length),o(this,e,!0,52,8)},Z.prototype.readDoubleBE=function(e,t){return e>>>=0,t||eh(e,8,this.length),o(this,e,!1,52,8)},Z.prototype.writeUintLE=Z.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;ed(this,e,t,r,i,0)}var o=1,a=0;for(this[t]=255&e;++a<r&&(o*=256);)this[t+a]=e/o&255;return t+r},Z.prototype.writeUintBE=Z.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;ed(this,e,t,r,i,0)}var o=r-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+r},Z.prototype.writeUint8=Z.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||ed(this,e,t,1,255,0),this[t]=255&e,t+1},Z.prototype.writeUint16LE=Z.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||ed(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Z.prototype.writeUint16BE=Z.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||ed(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Z.prototype.writeUint32LE=Z.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||ed(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Z.prototype.writeUint32BE=Z.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||ed(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Z.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);ed(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},Z.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);ed(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},Z.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||ed(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Z.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||ed(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Z.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||ed(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Z.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||ed(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Z.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||ed(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Z.prototype.writeFloatLE=function(e,t,r){return eg(this,e,t,!0,r)},Z.prototype.writeFloatBE=function(e,t,r){return eg(this,e,t,!1,r)},Z.prototype.writeDoubleLE=function(e,t,r){return ey(this,e,t,!0,r)},Z.prototype.writeDoubleBE=function(e,t,r){return ey(this,e,t,!1,r)},Z.prototype.copy=function(e,t,r,n){if(!Z.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},Z.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!Z.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=Z.isBuffer(e)?e:Z.from(e,n),s=a.length;if(0===s)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%s]}return this};var em=/[^+/0-9A-Za-z-_]/g;function eb(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319||a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function ev(e){return function(e){var t,r,n=function(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}(e),i=n[0],o=n[1],a=new W((i+o)*3/4-o),s=0,l=o>0?i-4:i;for(r=0;r<l;r+=4)t=J[e.charCodeAt(r)]<<18|J[e.charCodeAt(r+1)]<<12|J[e.charCodeAt(r+2)]<<6|J[e.charCodeAt(r+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=255&t;return 2===o&&(t=J[e.charCodeAt(r)]<<2|J[e.charCodeAt(r+1)]>>4,a[s++]=255&t),1===o&&(t=J[e.charCodeAt(r)]<<10|J[e.charCodeAt(r+1)]<<4|J[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t),a}(function(e){if((e=(e=e.split("=")[0]).trim().replace(em,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function ew(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function eE(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var eS=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}();function eA(e){return F.isPlainObject(e)||F.isArray(e)}function eO(e){return F.endsWith(e,"[]")?e.slice(0,-2):e}function eT(e,t,r){return e?e.concat(t).map(function(e,t){return e=eO(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}let eR=F.toFlatObject(F,{},null,function(e){return/^is[A-Z]/.test(e)});var eC=function(e,t,r){if(!F.isObject(e))throw TypeError("target must be an object");t=t||new FormData,r=F.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!F.isUndefined(t[e])});let n=r.metaTokens,i=r.visitor||c,o=r.dots,a=r.indexes,s=r.Blob||"undefined"!=typeof Blob&&Blob,l=s&&F.isSpecCompliantForm(t);if(!F.isFunction(i))throw TypeError("visitor must be a function");function u(e){if(null===e)return"";if(F.isDate(e))return e.toISOString();if(!l&&F.isBlob(e))throw new z("Blob is not supported. Use a Buffer instead.");return F.isArrayBuffer(e)||F.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):Z.from(e):e}function c(e,r,i){let s=e;if(e&&!i&&"object"==typeof e){if(F.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else{var l;if(F.isArray(e)&&(l=e,F.isArray(l)&&!l.some(eA))||(F.isFileList(e)||F.endsWith(r,"[]"))&&(s=F.toArray(e)))return r=eO(r),s.forEach(function(e,n){F.isUndefined(e)||null===e||t.append(!0===a?eT([r],n,o):null===a?r:r+"[]",u(e))}),!1}}return!!eA(e)||(t.append(eT(i,r,o),u(e)),!1)}let f=[],h=Object.assign(eR,{defaultVisitor:c,convertValue:u,isVisitable:eA});if(!F.isObject(e))throw TypeError("data must be an object");return!function e(r,n){if(!F.isUndefined(r)){if(-1!==f.indexOf(r))throw Error("Circular reference detected in "+n.join("."));f.push(r),F.forEach(r,function(r,o){let a=!(F.isUndefined(r)||null===r)&&i.call(t,r,F.isString(o)?o.trim():o,n,h);!0===a&&e(r,n?n.concat(o):[o])}),f.pop()}}(e),t};function eL(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\x00"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function eU(e,t){this._pairs=[],e&&eC(e,this,t)}let eP=eU.prototype;function eB(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ek(e,t,r){let n;if(!t)return e;let i=r&&r.encode||eB,o=r&&r.serialize;if(n=o?o(t,r):F.isURLSearchParams(t)?t.toString():new eU(t,r).toString(i)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}eP.append=function(e,t){this._pairs.push([e,t])},eP.toString=function(e){let t=e?function(t){return e.call(this,t,eL)}:eL;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};var e$=class{use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){F.forEach(this.handlers,function(t){null!==t&&e(t)})}constructor(){this.handlers=[]}},ex={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},eD="undefined"!=typeof URLSearchParams?URLSearchParams:eU,eN="undefined"!=typeof FormData?FormData:null,ej="undefined"!=typeof Blob?Blob:null;let e_=("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document,eI="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var eM={classes:{URLSearchParams:eD,FormData:eN,Blob:ej},isStandardBrowserEnv:e_,isStandardBrowserWebWorkerEnv:eI,protocols:["http","https","file","blob","url","data"]},eF=function(e){if(F.isFormData(e)&&F.isFunction(e.entries)){let t={};return F.forEachEntry(e,(e,r)=>{!function e(t,r,n,i){let o=t[i++],a=Number.isFinite(+o),s=i>=t.length;if(o=!o&&F.isArray(n)?n.length:o,s)return F.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!a;n[o]&&F.isObject(n[o])||(n[o]=[]);let l=e(t,r,n[o],i);return l&&F.isArray(n[o])&&(n[o]=function(e){let t,r;let n={},i=Object.keys(e),o=i.length;for(t=0;t<o;t++)n[r=i[t]]=e[r];return n}(n[o])),!a}(F.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0]),r,t,0)}),t}return null};let ez={transitional:ex,adapter:eM.isNode?"http":"xhr",transformRequest:[function(e,t){let r;let n=t.getContentType()||"",i=n.indexOf("application/json")>-1,o=F.isObject(e);o&&F.isHTMLForm(e)&&(e=new FormData(e));let a=F.isFormData(e);if(a)return i&&i?JSON.stringify(eF(e)):e;if(F.isArrayBuffer(e)||F.isBuffer(e)||F.isStream(e)||F.isFile(e)||F.isBlob(e))return e;if(F.isArrayBufferView(e))return e.buffer;if(F.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1){var s,l;return(s=e,l=this.formSerializer,eC(s,new eM.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return eM.isNode&&F.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},l))).toString()}if((r=F.isFileList(e))||n.indexOf("multipart/form-data")>-1){let t=this.env&&this.env.FormData;return eC(r?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||i?(t.setContentType("application/json",!1),function(e,t,r){if(F.isString(e))try{return(0,JSON.parse)(e),F.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){let t=this.transitional||ez.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&F.isString(e)&&(r&&!this.responseType||n)){let r=t&&t.silentJSONParsing;try{return JSON.parse(e)}catch(e){if(!r&&n){if("SyntaxError"===e.name)throw z.from(e,z.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:eM.classes.FormData,Blob:eM.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};F.forEach(["delete","get","head","post","put","patch"],e=>{ez.headers[e]={}});let eq=F.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var eH=e=>{let t,r,n;let i={};return e&&e.split("\n").forEach(function(e){n=e.indexOf(":"),t=e.substring(0,n).trim().toLowerCase(),r=e.substring(n+1).trim(),!t||i[t]&&eq[t]||("set-cookie"===t?i[t]?i[t].push(r):i[t]=[r]:i[t]=i[t]?i[t]+", "+r:r)}),i};let eV=Symbol("internals");function eJ(e){return e&&String(e).trim().toLowerCase()}function eW(e){return!1===e||null==e?e:F.isArray(e)?e.map(eW):String(e)}let eK=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function eQ(e,t,r,n,i){if(F.isFunction(n))return n.call(this,t,r);if(i&&(t=r),F.isString(t)){if(F.isString(n))return -1!==t.indexOf(n);if(F.isRegExp(n))return n.test(t)}}class eG{set(e,t,r){let n=this;function i(e,t,r){let i=eJ(t);if(!i)throw Error("header name must be a non-empty string");let o=F.findKey(n,i);o&&void 0!==n[o]&&!0!==r&&(void 0!==r||!1===n[o])||(n[o||t]=eW(e))}let o=(e,t)=>F.forEach(e,(e,r)=>i(e,r,t));return F.isPlainObject(e)||e instanceof this.constructor?o(e,t):F.isString(e)&&(e=e.trim())&&!eK(e)?o(eH(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=eJ(e)){let r=F.findKey(this,e);if(r){let e=this[r];if(!t)return e;if(!0===t)return function(e){let t;let r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=n.exec(e);)r[t[1]]=t[2];return r}(e);if(F.isFunction(t))return t.call(this,e,r);if(F.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=eJ(e)){let r=F.findKey(this,e);return!!(r&&void 0!==this[r]&&(!t||eQ(this,this[r],r,t)))}return!1}delete(e,t){let r=this,n=!1;function i(e){if(e=eJ(e)){let i=F.findKey(r,e);i&&(!t||eQ(r,r[i],i,t))&&(delete r[i],n=!0)}}return F.isArray(e)?e.forEach(i):i(e),n}clear(e){let t=Object.keys(this),r=t.length,n=!1;for(;r--;){let i=t[r];(!e||eQ(this,this[i],i,e,!0))&&(delete this[i],n=!0)}return n}normalize(e){let t=this,r={};return F.forEach(this,(n,i)=>{let o=F.findKey(r,i);if(o){t[o]=eW(n),delete t[i];return}let a=e?i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r):String(i).trim();a!==i&&delete t[i],t[a]=eW(n),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return F.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&F.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){let t=this[eV]=this[eV]={accessors:{}},r=t.accessors,n=this.prototype;function i(e){let t=eJ(e);r[t]||(!function(e,t){let r=F.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})})}(n,e),r[t]=!0)}return F.isArray(e)?e.forEach(i):i(e),this}constructor(e){e&&this.set(e)}}function eY(e,t){let r=this||ez,n=t||r,i=eG.from(n.headers),o=n.data;return F.forEach(e,function(e){o=e.call(r,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function eX(e){return!!(e&&e.__CANCEL__)}function eZ(e,t,r){z.call(this,null==e?"canceled":e,z.ERR_CANCELED,t,r),this.name="CanceledError"}eG.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),F.reduceDescriptors(eG.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),F.freezeMethods(eG),F.inherits(eZ,z,{__CANCEL__:!0});var e0=eM.isStandardBrowserEnv?{write:function(e,t,r,n,i,o){let a=[];a.push(e+"="+encodeURIComponent(t)),F.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),F.isString(n)&&a.push("path="+n),F.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){let t=document.cookie.match(RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function e1(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e:t}var e2=eM.isStandardBrowserEnv?function(){let e;let t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){let n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){let r=F.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0},e5=function(e,t){let r;e=e||10;let n=Array(e),i=Array(e),o=0,a=0;return t=void 0!==t?t:1e3,function(s){let l=Date.now(),u=i[a];r||(r=l),n[o]=s,i[o]=l;let c=a,f=0;for(;c!==o;)f+=n[c++],c%=e;if((o=(o+1)%e)===a&&(a=(a+1)%e),l-r<t)return;let h=u&&l-u;return h?Math.round(1e3*f/h):void 0}};function e6(e,t){let r=0,n=e5(50,250);return i=>{let o=i.loaded,a=i.lengthComputable?i.total:void 0,s=o-r,l=n(s),u=o<=a;r=o;let c={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&u?(a-o)/l:void 0,event:i};c[t?"download":"upload"]=!0,e(c)}}let e8="undefined"!=typeof XMLHttpRequest;var e4=e8&&function(e){return new Promise(function(t,r){let n,i=e.data,o=eG.from(e.headers).normalize(),a=e.responseType;function s(){e.cancelToken&&e.cancelToken.unsubscribe(n),e.signal&&e.signal.removeEventListener("abort",n)}F.isFormData(i)&&(eM.isStandardBrowserEnv||eM.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(e.auth){let t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+r))}let u=e1(e.baseURL,e.url);function c(){if(!l)return;let n=eG.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),i=a&&"text"!==a&&"json"!==a?l.response:l.responseText,o={data:i,status:l.status,statusText:l.statusText,headers:n,config:e,request:l};!function(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new z("Request failed with status code "+r.status,[z.ERR_BAD_REQUEST,z.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}(function(e){t(e),s()},function(e){r(e),s()},o),l=null}if(l.open(e.method.toUpperCase(),ek(u,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=c:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(c)},l.onabort=function(){l&&(r(new z("Request aborted",z.ECONNABORTED,e,l)),l=null)},l.onerror=function(){r(new z("Network Error",z.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||ex;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new z(t,n.clarifyTimeoutError?z.ETIMEDOUT:z.ECONNABORTED,e,l)),l=null},eM.isStandardBrowserEnv){let t=(e.withCredentials||e2(u))&&e.xsrfCookieName&&e0.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===i&&o.setContentType(null),"setRequestHeader"in l&&F.forEach(o.toJSON(),function(e,t){l.setRequestHeader(t,e)}),F.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&"json"!==a&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e6(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e6(e.onUploadProgress)),(e.cancelToken||e.signal)&&(n=t=>{l&&(r(!t||t.type?new eZ(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(n),e.signal&&(e.signal.aborted?n():e.signal.addEventListener("abort",n)));let f=function(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);if(f&&-1===eM.protocols.indexOf(f)){r(new z("Unsupported protocol "+f+":",z.ERR_BAD_REQUEST,e));return}l.send(i||null)})};let e3={http:null,xhr:e4};F.forEach(e3,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});var e7={getAdapter:e=>{let t,r;e=F.isArray(e)?e:[e];let{length:n}=e;for(let i=0;i<n&&(t=e[i],!(r=F.isString(t)?e3[t.toLowerCase()]:t));i++);if(!r){if(!1===r)throw new z(`Adapter ${t} is not supported by the environment`,"ERR_NOT_SUPPORT");throw Error(F.hasOwnProp(e3,t)?`Adapter '${t}' is not available in the build`:`Unknown adapter '${t}'`)}if(!F.isFunction(r))throw TypeError("adapter is not a function");return r},adapters:e3};function e9(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new eZ(null,e)}function te(e){e9(e),e.headers=eG.from(e.headers),e.data=eY.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);let t=e7.getAdapter(e.adapter||ez.adapter);return t(e).then(function(t){return e9(e),t.data=eY.call(e,e.transformResponse,t),t.headers=eG.from(t.headers),t},function(t){return!eX(t)&&(e9(e),t&&t.response&&(t.response.data=eY.call(e,e.transformResponse,t.response),t.response.headers=eG.from(t.response.headers))),Promise.reject(t)})}let tt=e=>e instanceof eG?e.toJSON():e;function tr(e,t){t=t||{};let r={};function n(e,t,r){return F.isPlainObject(e)&&F.isPlainObject(t)?F.merge.call({caseless:r},e,t):F.isPlainObject(t)?F.merge({},t):F.isArray(t)?t.slice():t}function i(e,t,r){return F.isUndefined(t)?F.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function o(e,t){if(!F.isUndefined(t))return n(void 0,t)}function a(e,t){return F.isUndefined(t)?F.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,o){return o in t?n(r,i):o in e?n(void 0,r):void 0}let l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t)=>i(tt(e),tt(t),!0)};return F.forEach(Object.keys(Object.assign({},e,t)),function(n){let o=l[n]||i,a=o(e[n],t[n],n);F.isUndefined(a)&&o!==s||(r[n]=a)}),r}let tn="1.5.0",ti={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ti[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});let to={};ti.transitional=function(e,t,r){function n(e,t){return"[Axios v"+tn+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,o)=>{if(!1===e)throw new z(n(i," has been removed"+(t?" in "+t:"")),z.ERR_DEPRECATED);return t&&!to[i]&&(to[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,o)}};var ta={assertOptions:function(e,t,r){if("object"!=typeof e)throw new z("options must be an object",z.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),i=n.length;for(;i-- >0;){let o=n[i],a=t[o];if(a){let t=e[o],r=void 0===t||a(t,o,e);if(!0!==r)throw new z("option "+o+" must be "+r,z.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new z("Unknown option "+o,z.ERR_BAD_OPTION)}},validators:ti};let ts=ta.validators;class tl{request(e,t){let r,n;"string"==typeof e?(t=t||{}).url=e:t=e||{},t=tr(this.defaults,t);let{transitional:i,paramsSerializer:o,headers:a}=t;void 0!==i&&ta.assertOptions(i,{silentJSONParsing:ts.transitional(ts.boolean),forcedJSONParsing:ts.transitional(ts.boolean),clarifyTimeoutError:ts.transitional(ts.boolean)},!1),null!=o&&(F.isFunction(o)?t.paramsSerializer={serialize:o}:ta.assertOptions(o,{encode:ts.function,serialize:ts.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&F.merge(a.common,a[t.method]);a&&F.forEach(["delete","get","head","post","put","patch","common"],e=>{delete a[e]}),t.headers=eG.concat(s,a);let l=[],u=!0;this.interceptors.request.forEach(function(e){("function"!=typeof e.runWhen||!1!==e.runWhen(t))&&(u=u&&e.synchronous,l.unshift(e.fulfilled,e.rejected))});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let f=0;if(!u){let e=[te.bind(this),void 0];for(e.unshift.apply(e,l),e.push.apply(e,c),n=e.length,r=Promise.resolve(t);f<n;)r=r.then(e[f++],e[f++]);return r}n=l.length;let h=t;for(f=0;f<n;){let e=l[f++],t=l[f++];try{h=e(h)}catch(e){t.call(this,e);break}}try{r=te.call(this,h)}catch(e){return Promise.reject(e)}for(f=0,n=c.length;f<n;)r=r.then(c[f++],c[f++]);return r}getUri(e){e=tr(this.defaults,e);let t=e1(e.baseURL,e.url);return ek(t,e.params,e.paramsSerializer)}constructor(e){this.defaults=e,this.interceptors={request:new e$,response:new e$}}}F.forEach(["delete","get","head","options"],function(e){tl.prototype[e]=function(t,r){return this.request(tr(r||{},{method:e,url:t,data:(r||{}).data}))}}),F.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,i){return this.request(tr(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}tl.prototype[e]=t(),tl.prototype[e+"Form"]=t(!0)});class tu{throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;let t=new tu(function(t){e=t});return{token:t,cancel:e}}constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});let r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;let n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,i){r.reason||(r.reason=new eZ(e,n,i),t(r.reason))})}}let tc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(tc).forEach(([e,t])=>{tc[t]=e});let tf=function e(t){let r=new tl(t),n=u(tl.prototype.request,r);return F.extend(n,tl.prototype,r,{allOwnKeys:!0}),F.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(tr(t,r))},n}(ez);tf.Axios=tl,tf.CanceledError=eZ,tf.CancelToken=tu,tf.isCancel=eX,tf.VERSION=tn,tf.toFormData=eC,tf.AxiosError=z,tf.Cancel=tf.CanceledError,tf.all=function(e){return Promise.all(e)},tf.spread=function(e){return function(t){return e.apply(null,t)}},tf.isAxiosError=function(e){return F.isObject(e)&&!0===e.isAxiosError},tf.mergeConfig=tr,tf.AxiosHeaders=eG,tf.formToJSON=e=>eF(F.isHTMLForm(e)?new FormData(e):e),tf.getAdapter=e7.getAdapter,tf.HttpStatusCode=tc,tf.default=tf;let{Axios:th,AxiosError:td,CanceledError:tp,isCancel:tg,CancelToken:ty,VERSION:tm,all:tb,Cancel:tv,isAxiosError:tw,spread:tE,toFormData:tS,AxiosHeaders:tA,HttpStatusCode:tO,formToJSON:tT,getAdapter:tR,mergeConfig:tC}=tf;class tL{async serverConfig(e,t){let r=await this.client.get(`/api/v1/versions/${e}/servers/${t}/config`);return r.data.data}async unitInfo(e,t){let r=await this.client.get(`/api/v1/versions/${e}/servers/${t}/unit-info`);return r.data.data}async tribe(e,t,r){let n=await this.client.get(`/api/v1/versions/${e}/servers/${t}/tribes/${r}`);return n.data.data}async tribeSnapshots(e,t,r,n){let i=n?this.buildQueryString(n):"",o=await this.client.get(`/api/v1/versions/${e}/servers/${t}/tribes/${r}/snapshots?${i}`);return{data:o.data.data,total:this.parseTotal(o.headers)}}async tribeTribeChanges(e,t,r,n){let i=n?this.buildQueryString(n):"",o=await this.client.get(`/api/v1/versions/${e}/servers/${t}/tribes/${r}/tribe-changes?${i}`);return{data:o.data.data,total:this.parseTotal(o.headers)}}async tribeEnnoblements(e,t,r,n){let i=n?this.buildQueryString(n):"",o=await this.client.get(`/api/v1/versions/${e}/servers/${t}/tribes/${r}/ennoblements?${i}`);return{data:o.data.data,total:this.parseTotal(o.headers)}}async tribeMembers(e,t,r,n){let i=n?this.buildQueryString(n):"",o=await this.client.get(`/api/v1/versions/${e}/servers/${t}/tribes/${r}/members?${i}`);return{data:o.data.data,total:this.parseTotal(o.headers)}}async player(e,t,r){let n=await this.client.get(`/api/v1/versions/${e}/servers/${t}/players/${r}`);return n.data.data}async playerTribeChanges(e,t,r,n){let i=n?this.buildQueryString(n):"",o=await this.client.get(`/api/v1/versions/${e}/servers/${t}/players/${r}/tribe-changes?${i}`);return{data:o.data.data,total:this.parseTotal(o.headers)}}async playerEnnoblements(e,t,r,n){let i=n?this.buildQueryString(n):"",o=await this.client.get(`/api/v1/versions/${e}/servers/${t}/players/${r}/ennoblements?${i}`);return{data:o.data.data,total:this.parseTotal(o.headers)}}async playerSnapshots(e,t,r,n){let i=n?this.buildQueryString(n):"",o=await this.client.get(`/api/v1/versions/${e}/servers/${t}/players/${r}/snapshots?${i}`);return{data:o.data.data,total:this.parseTotal(o.headers)}}async playerOtherServers(e,t,r,n){let i=n?this.buildQueryString(n):"",o=await this.client.get(`/api/v1/versions/${e}/servers/${t}/players/${r}/other-servers?${i}`);return{data:o.data.data,total:this.parseTotal(o.headers)}}async villageEnnoblements(e,t,r,n){let i=n?this.buildQueryString(n):"",o=await this.client.get(`/api/v1/versions/${e}/servers/${t}/villages/${r}/ennoblements?${i}`);return{data:o.data.data,total:this.parseTotal(o.headers)}}buildQueryString(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e)){if(Array.isArray(n)){n.forEach(e=>{t.append(r,e)});continue}if(n instanceof Date){t.set(r,n.toISOString());continue}t.set(r,n.toString())}return t.toString()}parseTotal(e){var t;return parseInt(null!==(t=e["x-total-count"])&&void 0!==t?t:"0")}constructor(e,t=1e4){this.client=tf.create({baseURL:e,timeout:t})}}let tU=e=>t=>{var r,n;return null!==(n=null===(r=e[window.game_data.locale])||void 0===r?void 0:r[t])&&void 0!==n?n:t},tP=tU({pl_PL:{Loading:"Wczytywanie","Previous page":"Poprzednia strona","Next page":"Następna strona","Something went wrong while loading the data":"Coś poszło nie tak podczas wczytywania danych"}});class tB{async render(){await this.renderPage(1)}async renderPage(e){window.Dialog.show(`${this.id}_loading`,`<p>${tP("Loading")}...</p>`);try{let{data:t,total:r}=await this.loadData(e,this.limit);window.Dialog.show(this.id,`
      ${this.buildPagination(e,r)}
      ${this.buildTable(t)}
    `),this.addEventListeners(e)}catch(e){console.error(e),window.Dialog.close(),window.UI.ErrorMessage(tP("Something went wrong while loading the data"))}}buildPagination(e,t){let r=Math.ceil(t/this.limit),n=[];for(let t=1;t<=(e>r?e:r);t++)n.push(`<option${t===e?" disabled selected":""} value="${t}">${t}</option>`);return`
      <div style="display: flex; flex-direction: row; align-items: center; justify-content: center; margin-bottom: 10px">
          <button title="${tP("Previous page")}" style="margin-right: 5px" class="btn" id="${this.prevPageId}"${e<=1?" disabled":""}>&lt;</button>
          <select style="margin-right: 5px" id="${this.selectId}">
              ${n.join("")}
          </select>
          <button title="${tP("Next page")}" class="btn" id="${this.nextPageId}"${e>=r?" disabled":""}>&gt;</button>
      </div>    
    `}buildTable(e){return`
      <table style="width: 100%" class="vis">
        <tbody>
          <tr>
            ${this.columns.map(e=>`<th>${e.header}</th>`).join("")}
          </tr>
          ${e.map((t,r)=>`
            <tr>
                ${this.columns.map(n=>`<td>${n.accessor(t,r,e)}</td>`).join("")}
            </tr>
          `).join("")}
        </tbody>
      </table>      
      `}addEventListeners(e){var t,r,n;null===(t=document.querySelector("#"+this.prevPageId))||void 0===t||t.addEventListener("click",()=>{this.renderPage(e-1)}),null===(r=document.querySelector("#"+this.selectId))||void 0===r||r.addEventListener("change",e=>{e.currentTarget instanceof HTMLSelectElement&&this.renderPage(parseInt(e.currentTarget.value))}),null===(n=document.querySelector("#"+this.nextPageId))||void 0===n||n.addEventListener("click",()=>{this.renderPage(e+1)})}constructor(e,t,r,n){this.id=e,this.columns=t,this.limit=r,this.loadData=n,this.prevPageId=`${this.id}_page_prev`,this.selectId=`${this.id}_page_select`,this.nextPageId=`${this.id}_page_next`}}let tk="https://www.twstats.com",t$=e=>{switch(e.entity){case"player":return`${tk}/in/${e.server}/player/${e.id}`;case"tribe":return`${tk}/in/${e.server}/tribe/${e.id}`;default:throw Error("Incorrect params.entity")}},tx=tU({pl_PL:{"Created at":"Data/czas utworzenia",Dominance:"Dominacja","Best rank":"Najwyższy ranking","Most points":"Najwięcej punkt\xf3w","Most villages":"Najwięcej wiosek","Show tribe changes":"Pokaż zmiany plemion","Show history":"Pokaż historię","Show ennoblements":"Pokaż przejęcia",Changes:"Zmiany",Members:"Członkowie",Points:"Punkty",Rank:"Ranking",Villages:"Wioski",Village:"Wioska",OD:"Pokonani og\xf3lnie","OD - rank":"Pokonani og\xf3lnie - ranking",ODA:"Pokonani agresor","ODA - rank":"Pokonani agresor - ranking",ODD:"Pokonani obrońca","ODD - rank":"Pokonani obrońca - ranking",ODS:"Pokonani wspierający","ODS - rank":"Pokonani wspierający - ranking",Player:"Gracz","New owner":"Nowy właściciel","New tribe":"Nowe plemię","Old owner":"Stary własciciel","Old tribe":"Stare plemię","Date/time":"Data/czas",Action:"Akcja",Joined:"Dołączył",Left:"Opuścił",Barbarian:"Barbarzyńska",Unknown:"Nieznany","Last activity at":"Ostatnia aktywność",Actions:"Akcje"}});class tD{tribe(){return this.client.tribe(this.version,this.server,this.id)}tribeMembers(){return this.client.tribeMembers(this.version,this.server,this.id)}async latestSnapshot(){let e=await this.tribeSnapshots(1,1);return e.data.length>0?e.data[0]:null}tribeSnapshots(e,t){return this.client.tribeSnapshots(this.version,this.server,this.id,{offset:(e-1)*t,limit:t,sort:["date:desc"]})}tribeTribeChanges(e,t){return this.client.tribeTribeChanges(this.version,this.server,this.id,{offset:(e-1)*t,limit:t,sort:["createdAt:desc"]})}tribeEnnoblements(e,t){return this.client.tribeEnnoblements(this.version,this.server,this.id,{offset:(e-1)*t,limit:t,sort:["createdAt:desc"]})}constructor(e,t,r,n){this.client=e,this.version=t,this.server=r,this.id=n}}(n=s||(s={})).HISTORY="extended_tribe_profile_history",n.TRIBE_CHANGES="extended_tribe_profile_tribe_changes",n.ENNOBLEMENTS="extended_tribe_profile_ennoblements";class tN{render(){this.renderAdditionalInfo(),this.renderStats(),this.renderActions(),this.extendMemberTable()}renderAdditionalInfo(){var e;let t=null===(e=document.querySelector('#content_value a[href*="twstats"]'))||void 0===e?void 0:e.closest("tbody");t instanceof HTMLTableSectionElement&&t.insertAdjacentHTML("beforeend",`
    <tr>
        <td>${tx("Created at")}:</td>
        <td>${new Date(this.tribe.createdAt).toLocaleString()}</td>
    </tr>
    <tr>
        <td>${tx("Dominance")}:</td>
        <td>${this.tribe.dominance.toFixed(2)}%</td>
    </tr>
    <tr>
        <td>${tx("Best rank")}:</td>
        <td>${this.tribe.bestRank} (${new Date(this.tribe.bestRankAt).toLocaleString()})</td>
    </tr>
    <tr>
        <td>${tx("Most points")}:</td>
        <td>${this.tribe.mostPoints.toLocaleString()} (${new Date(this.tribe.mostPointsAt).toLocaleString()})</td>
    </tr>
    <tr>
        <td>${tx("Most villages")}:</td>
        <td>${this.tribe.mostVillages.toLocaleString()} (${new Date(this.tribe.mostVillagesAt).toLocaleString()})</td>
    </tr>
  `)}renderStats(){var e,t,r,n,i,o,a,s,l,u,c,f,h,d,p,g,y,m,b,v,w,E;let S=document.querySelector('#content_value td[valign="top"]:nth-child(2)');if(!(S instanceof HTMLTableCellElement))return;let A=[{header:tx("Points"),value:this.tribe.allPoints-(null!==(f=null===(e=this.latestSnapshot)||void 0===e?void 0:e.allPoints)&&void 0!==f?f:0)},{header:tx("Dominance"),value:this.tribe.dominance-(null!==(h=null===(t=this.latestSnapshot)||void 0===t?void 0:t.dominance)&&void 0!==h?h:0),customFormat:e=>`${e.toFixed(4)}%`},{header:tx("Members"),value:this.tribe.numMembers-(null!==(d=null===(r=this.latestSnapshot)||void 0===r?void 0:r.numMembers)&&void 0!==d?d:0)},{header:tx("Rank"),value:this.tribe.rank-(null!==(p=null===(n=this.latestSnapshot)||void 0===n?void 0:n.rank)&&void 0!==p?p:0),rank:!0},{header:tx("Villages"),value:this.tribe.numVillages-(null!==(g=null===(i=this.latestSnapshot)||void 0===i?void 0:i.numVillages)&&void 0!==g?g:0)},{header:tx("ODA"),value:this.tribe.scoreAtt-(null!==(y=null===(o=this.latestSnapshot)||void 0===o?void 0:o.scoreAtt)&&void 0!==y?y:0)},{header:tx("ODA - rank"),value:this.tribe.rankAtt-(null!==(m=null===(a=this.latestSnapshot)||void 0===a?void 0:a.rankAtt)&&void 0!==m?m:0),rank:!0},{header:tx("ODD"),value:this.tribe.scoreDef-(null!==(b=null===(s=this.latestSnapshot)||void 0===s?void 0:s.scoreDef)&&void 0!==b?b:0)},{header:tx("ODD - rank"),value:this.tribe.rankDef-(null!==(v=null===(l=this.latestSnapshot)||void 0===l?void 0:l.rankDef)&&void 0!==v?v:0),rank:!0},{header:tx("OD"),value:this.tribe.scoreTotal-(null!==(w=null===(u=this.latestSnapshot)||void 0===u?void 0:u.scoreTotal)&&void 0!==w?w:0)},{header:tx("OD - rank"),value:this.tribe.rankTotal-(null!==(E=null===(c=this.latestSnapshot)||void 0===c?void 0:c.rankTotal)&&void 0!==E?E:0),rank:!0}];S.insertAdjacentHTML("afterbegin",`
    <table style="width: 100%" class="vis">
       <tbody>
          <tr>
            <th colspan="2">
              ${tx("Changes")}
            </th>
          </tr>
          ${A.map(e=>`
            <tr>
             <td>${e.header}</td>
             <td style="color: #000; background-color: ${this.getStatBgColor(e.value,e.rank)}">${e.customFormat?e.customFormat(e.value):Math.abs(e.value).toLocaleString()}</td>
            </tr>
          `).join("")}
      </tbody>
    </table>
  `)}getStatBgColor(e,t){return e>0&&!t||e<0&&t?"#0f0":e<0&&!t||e>0&&t?"#f00":"#808080"}renderActions(){var e;let t=null===(e=document.querySelector('#content_value a[href*="twstats"]'))||void 0===e?void 0:e.closest("tbody");t instanceof HTMLTableSectionElement&&[{name:tx("Show tribe changes"),handler:this.showTribeChanges.bind(this)},{name:tx("Show history"),handler:this.showHistory.bind(this)},{name:tx("Show ennoblements"),handler:this.showEnnoblements.bind(this)}].forEach(({name:e,handler:r})=>{let n=document.createElement("tr"),i=document.createElement("td");i.colSpan=2;let o=document.createElement("a");o.innerText=e,o.href="#",o.addEventListener("click",r),i.appendChild(o),n.appendChild(i),t.appendChild(n)})}async showTribeChanges(e){e.preventDefault(),await new tB(s.TRIBE_CHANGES,[{header:tx("Player"),accessor:e=>`<a href="${e.player.profileUrl}">${e.player.name}</a>`},{header:tx("Action"),accessor:e=>{var t;return tx((null===(t=e.newTribe)||void 0===t?void 0:t.id)!==this.tribe.id?"Left":"Joined")}},{header:tx("Old tribe"),accessor:e=>e.player.tribe?`<a href="${e.player.tribe.profileUrl}">${e.player.tribe.tag}</a>`:"-"},{header:tx("New tribe"),accessor:e=>e.newTribe?`<a href="${e.newTribe.profileUrl}">${e.newTribe.tag}</a>`:"-"},{header:tx("Date/time"),accessor:e=>new Date(e.createdAt).toLocaleString()}],30,(e,t)=>this.twhelpConnector.tribeTribeChanges(e,t)).render()}async showHistory(e){e.preventDefault(),await new tB(s.HISTORY,[{header:tx("Date"),accessor:e=>e.date},{header:tx("Points"),accessor:e=>`${e.allPoints.toLocaleString()} (<strong>${e.rank}</strong>)`},{header:tx("Villages"),accessor:e=>`${e.numVillages.toLocaleString()}`},{header:tx("Members"),accessor:e=>`${e.numMembers.toLocaleString()}`},{header:tx("Dominance"),accessor:e=>`${e.dominance.toFixed(2)}%`},{header:tx("OD"),accessor:e=>`${e.scoreTotal.toLocaleString()} (<strong>${e.rankTotal}</strong>)`},{header:tx("ODA"),accessor:e=>`${e.scoreAtt.toLocaleString()} (<strong>${e.rankAtt}</strong>)`},{header:tx("ODD"),accessor:e=>`${e.scoreDef.toLocaleString()} (<strong>${e.rankDef}</strong>)`}],30,(e,t)=>this.twhelpConnector.tribeSnapshots(e,t)).render()}async showEnnoblements(e){e.preventDefault(),await new tB(s.ENNOBLEMENTS,[{header:tx("Village"),accessor:e=>`<a href="${e.village.profileUrl}">${e.village.fullName}</a>`},{header:tx("Points"),accessor:e=>e.points.toLocaleString()},{header:tx("Old owner"),accessor:({village:{player:e}})=>e?`<a href="${e.profileUrl}">${e.name}</a>${e.tribe?` (<a href="${e.tribe.profileUrl}">${e.tribe.tag}</a>)`:""}`:tx("Barbarian")},{header:tx("New owner"),accessor:({newOwner:e})=>e?`<a href="${e.profileUrl}">${e.name}</a>${e.tribe?` (<a href="${e.tribe.profileUrl}">${e.tribe.tag}</a>)`:""}`:tx("Unknown")},{header:tx("Date/time"),accessor:e=>new Date(e.createdAt).toLocaleString()}],30,(e,t)=>this.twhelpConnector.tribeEnnoblements(e,t)).render()}extendMemberTable(){var e,t,r,n,i,o;let a=document.querySelector("#content_value .vis:nth-child(3)");if(!(a instanceof HTMLTableElement)||!a.querySelector('a[href*="info_player"]')||!(a.previousElementSibling instanceof HTMLHeadingElement))return;let s=document.createElement("div");for(let l of(a.previousElementSibling instanceof HTMLHeadingElement&&s.appendChild(a.previousElementSibling),s.appendChild(a),null===(e=document.querySelector("#content_value"))||void 0===e||e.appendChild(s),a.querySelectorAll("tr"))){let e=l.querySelector('a[href*="info_player"]');if(!(e instanceof HTMLAnchorElement)){[tx("ODA"),tx("ODD"),tx("ODS"),tx("OD"),tx("Last activity at"),tx("Actions")].forEach(e=>{let t=document.createElement("th");t.innerHTML=e,l.appendChild(t)});continue}let a=parseInt(null!==(t=new URL(e.href).searchParams.get("id"))&&void 0!==t?t:""),s=this.members.find(e=>e.id===a);[(null!==(r=null==s?void 0:s.rankAtt)&&void 0!==r?r:0).toString(),(null!==(n=null==s?void 0:s.rankDef)&&void 0!==n?n:0).toString(),(null!==(i=null==s?void 0:s.rankSup)&&void 0!==i?i:0).toString(),(null!==(o=null==s?void 0:s.rankTotal)&&void 0!==o?o:0).toString(),(null==s?void 0:s.lastActivityAt)?new Date(s.lastActivityAt).toLocaleString():"-",`<a href="${t$({entity:"player",id:a,server:this.serverKey})}" target="_blank">TWStats</a>`].forEach(e=>{let t=document.createElement("td");t.innerHTML=e,l.appendChild(t)})}}constructor(e,t,r,n,i){this.serverKey=e,this.tribe=t,this.latestSnapshot=r,this.members=n,this.twhelpConnector=i}}class tj{async run(){let[e,t,{data:r}]=await Promise.all([this.twhelpConnector.tribe(),this.twhelpConnector.latestSnapshot(),this.twhelpConnector.tribeMembers()]);await new tN(window.game_data.world,e,t,r,this.twhelpConnector).render()}getTribeId(){let e=new URLSearchParams(window.location.search).get("id");if(!e)throw Error("couldn't extract tribe id");return parseInt(e)}constructor(e){this.twhelpConnector=new tD(e,window.game_data.market,window.game_data.world,this.getTribeId())}}(async()=>{"info_ally"===window.game_data.screen&&null===window.game_data.mode&&await new tj(new tL("https://tribalwarshelp.com")).run().catch(e=>{console.log(e)})})()}();
  ```