!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).SkillsClient={})}(this,function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r,i={exports:{}},o=i.exports;
/*!
	 * js-logger - http://github.com/jonnyreeves/js-logger
	 * Jonny Reeves, http://jonnyreeves.co.uk/
	 * js-logger may be freely distributed under the MIT license.
	 */var s,a,c,l,u,h,d=(r||(r=1,function(e){!function(t){var n,r={VERSION:"1.6.1"},i={},o=function(e,t){return function(){return t.apply(e,arguments)}},s=function(){var e,t,n=arguments,r=n[0];for(t=1;t<n.length;t++)for(e in n[t])!(e in r)&&n[t].hasOwnProperty(e)&&(r[e]=n[t][e]);return r},a=function(e,t){return{value:e,name:t}};r.TRACE=a(1,"TRACE"),r.DEBUG=a(2,"DEBUG"),r.INFO=a(3,"INFO"),r.TIME=a(4,"TIME"),r.WARN=a(5,"WARN"),r.ERROR=a(8,"ERROR"),r.OFF=a(99,"OFF");var c=function(e){this.context=e,this.setLevel(e.filterLevel),this.log=this.info};c.prototype={setLevel:function(e){e&&"value"in e&&(this.context.filterLevel=e)},getLevel:function(){return this.context.filterLevel},enabledFor:function(e){var t=this.context.filterLevel;return e.value>=t.value},trace:function(){this.invoke(r.TRACE,arguments)},debug:function(){this.invoke(r.DEBUG,arguments)},info:function(){this.invoke(r.INFO,arguments)},warn:function(){this.invoke(r.WARN,arguments)},error:function(){this.invoke(r.ERROR,arguments)},time:function(e){"string"==typeof e&&e.length>0&&this.invoke(r.TIME,[e,"start"])},timeEnd:function(e){"string"==typeof e&&e.length>0&&this.invoke(r.TIME,[e,"end"])},invoke:function(e,t){n&&this.enabledFor(e)&&n(t,s({level:e},this.context))}};var l,u=new c({filterLevel:r.OFF});(l=r).enabledFor=o(u,u.enabledFor),l.trace=o(u,u.trace),l.debug=o(u,u.debug),l.time=o(u,u.time),l.timeEnd=o(u,u.timeEnd),l.info=o(u,u.info),l.warn=o(u,u.warn),l.error=o(u,u.error),l.log=l.info,r.setHandler=function(e){n=e},r.setLevel=function(e){for(var t in u.setLevel(e),i)i.hasOwnProperty(t)&&i[t].setLevel(e)},r.getLevel=function(){return u.getLevel()},r.get=function(e){return i[e]||(i[e]=new c(s({name:e},u.context)))},r.createDefaultHandler=function(e){(e=e||{}).formatter=e.formatter||function(e,t){t.name&&e.unshift("["+t.name+"]")};var t={},n=function(e,t){Function.prototype.apply.call(e,console,t)};return"undefined"==typeof console?function(){}:function(i,o){i=Array.prototype.slice.call(i);var s,a=console.log;o.level===r.TIME?(s=(o.name?"["+o.name+"] ":"")+i[0],"start"===i[1]?console.time?console.time(s):t[s]=(new Date).getTime():console.timeEnd?console.timeEnd(s):n(a,[s+": "+((new Date).getTime()-t[s])+"ms"])):(o.level===r.WARN&&console.warn?a=console.warn:o.level===r.ERROR&&console.error?a=console.error:o.level===r.INFO&&console.info?a=console.info:o.level===r.DEBUG&&console.debug?a=console.debug:o.level===r.TRACE&&console.trace&&(a=console.trace),e.formatter(i,o),n(a,i))}},r.useDefaults=function(e){r.setLevel(e&&e.defaultLevel||r.DEBUG),r.setHandler(r.createDefaultHandler(e))},r.setDefaults=r.useDefaults,e.exports?e.exports=r:(r._prevLogger=t.Logger,r.noConflict=function(){return t.Logger=r._prevLogger,r},t.Logger=r)}(o)}(i)),i.exports),p=n(d),f={exports:{}},m={};function g(){if(c)return a;c=1;var e=(s||(s=1,t.crypto&&t.crypto.getRandomValues?m.randomBytes=function(e){var n=new Uint8Array(e);return t.crypto.getRandomValues(n),n}:m.randomBytes=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=Math.floor(256*Math.random());return t}),m),n="abcdefghijklmnopqrstuvwxyz012345";return a={string:function(t){for(var r=e.randomBytes(t),i=[],o=0;o<t;o++)i.push(n.substr(r[o]%32,1));return i.join("")},number:function(e){return Math.floor(Math.random()*e)},numberString:function(e){var t=(""+(e-1)).length;return(new Array(t+1).join("0")+this.number(e)).slice(-t)}}}function y(){return l||(l=1,function(e){var n=g(),r={},i=!1,o=t.chrome&&t.chrome.app&&t.chrome.app.runtime;e.exports={attachEvent:function(e,n){void 0!==t.addEventListener?t.addEventListener(e,n,!1):t.document&&t.attachEvent&&(t.document.attachEvent("on"+e,n),t.attachEvent("on"+e,n))},detachEvent:function(e,n){void 0!==t.addEventListener?t.removeEventListener(e,n,!1):t.document&&t.detachEvent&&(t.document.detachEvent("on"+e,n),t.detachEvent("on"+e,n))},unloadAdd:function(e){if(o)return null;var t=n.string(8);return r[t]=e,i&&setTimeout(this.triggerUnloadCallbacks,0),t},unloadDel:function(e){e in r&&delete r[e]},triggerUnloadCallbacks:function(){for(var e in r)r[e](),delete r[e]}};o||e.exports.attachEvent("unload",function(){i||(i=!0,e.exports.triggerUnloadCallbacks())})}(f)),f.exports}var b,v,w,S,_,k={};function E(){if(w)return v;w=1;var e=h?u:(h=1,u=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}),n=function(){if(b)return k;b=1;var e=Object.prototype.hasOwnProperty;function t(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function n(e){try{return encodeURIComponent(e)}catch(e){return null}}return k.stringify=function(t,r){r=r||"";var i,o,s=[];for(o in"string"!=typeof r&&(r="?"),t)if(e.call(t,o)){if((i=t[o])||null!=i&&!isNaN(i)||(i=""),o=n(o),i=n(i),null===o||null===i)continue;s.push(o+"="+i)}return s.length?r+s.join("&"):""},k.parse=function(e){for(var n,r=/([^=?#&]+)=?([^&]*)/g,i={};n=r.exec(e);){var o=t(n[1]),s=t(n[2]);null===o||null===s||o in i||(i[o]=s)}return i},k}(),r=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i=/[\n\r\t]/g,o=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,s=/:\d+$/,a=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function l(e){return(e||"").toString().replace(r,"")}var d=[["#","hash"],["?","query"],function(e,t){return m(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],p={hash:1,query:1};function f(e){var n,r=("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{}).location||{},i={},s=typeof(e=e||r);if("blob:"===e.protocol)i=new y(unescape(e.pathname),{});else if("string"===s)for(n in i=new y(e,{}),p)delete i[n];else if("object"===s){for(n in e)n in p||(i[n]=e[n]);void 0===i.slashes&&(i.slashes=o.test(e.href))}return i}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function g(e,t){e=(e=l(e)).replace(i,""),t=t||{};var n,r=a.exec(e),o=r[1]?r[1].toLowerCase():"",s=!!r[2],c=!!r[3],u=0;return s?c?(n=r[2]+r[3]+r[4],u=r[2].length+r[3].length):(n=r[2]+r[4],u=r[2].length):c?(n=r[3]+r[4],u=r[3].length):n=r[4],"file:"===o?u>=2&&(n=n.slice(2)):m(o)?n=r[4]:o?s&&(n=n.slice(2)):u>=2&&m(t.protocol)&&(n=r[4]),{protocol:o,slashes:s||m(o),slashesCount:u,rest:n}}function y(t,r,o){if(t=(t=l(t)).replace(i,""),!(this instanceof y))return new y(t,r,o);var s,a,u,h,p,b,v=d.slice(),w=typeof r,S=this,_=0;for("object"!==w&&"string"!==w&&(o=r,r=null),o&&"function"!=typeof o&&(o=n.parse),s=!(a=g(t||"",r=f(r))).protocol&&!a.slashes,S.slashes=a.slashes||s&&r.slashes,S.protocol=a.protocol||r.protocol||"",t=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||c.test(t))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(S.protocol)))&&(v[3]=[/(.*)/,"pathname"]);_<v.length;_++)"function"!=typeof(h=v[_])?(u=h[0],b=h[1],u!=u?S[b]=t:"string"==typeof u?~(p="@"===u?t.lastIndexOf(u):t.indexOf(u))&&("number"==typeof h[2]?(S[b]=t.slice(0,p),t=t.slice(p+h[2])):(S[b]=t.slice(p),t=t.slice(0,p))):(p=u.exec(t))&&(S[b]=p[1],t=t.slice(0,p.index)),S[b]=S[b]||s&&h[3]&&r[b]||"",h[4]&&(S[b]=S[b].toLowerCase())):t=h(t,S);o&&(S.query=o(S.query)),s&&r.slashes&&"/"!==S.pathname.charAt(0)&&(""!==S.pathname||""!==r.pathname)&&(S.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,i=n[r-1],o=!1,s=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),s++):s&&(0===r&&(o=!0),n.splice(r,1),s--);return o&&n.unshift(""),"."!==i&&".."!==i||n.push(""),n.join("/")}(S.pathname,r.pathname)),"/"!==S.pathname.charAt(0)&&m(S.protocol)&&(S.pathname="/"+S.pathname),e(S.port,S.protocol)||(S.host=S.hostname,S.port=""),S.username=S.password="",S.auth&&(~(p=S.auth.indexOf(":"))?(S.username=S.auth.slice(0,p),S.username=encodeURIComponent(decodeURIComponent(S.username)),S.password=S.auth.slice(p+1),S.password=encodeURIComponent(decodeURIComponent(S.password))):S.username=encodeURIComponent(decodeURIComponent(S.auth)),S.auth=S.password?S.username+":"+S.password:S.username),S.origin="file:"!==S.protocol&&m(S.protocol)&&S.host?S.protocol+"//"+S.host:"null",S.href=S.toString()}return y.prototype={set:function(t,r,i){var o=this;switch(t){case"query":"string"==typeof r&&r.length&&(r=(i||n.parse)(r)),o[t]=r;break;case"port":o[t]=r,e(r,o.protocol)?r&&(o.host=o.hostname+":"+r):(o.host=o.hostname,o[t]="");break;case"hostname":o[t]=r,o.port&&(r+=":"+o.port),o.host=r;break;case"host":o[t]=r,s.test(r)?(r=r.split(":"),o.port=r.pop(),o.hostname=r.join(":")):(o.hostname=r,o.port="");break;case"protocol":o.protocol=r.toLowerCase(),o.slashes=!i;break;case"pathname":case"hash":if(r){var a="pathname"===t?"/":"#";o[t]=r.charAt(0)!==a?a+r:r}else o[t]=r;break;case"username":case"password":o[t]=encodeURIComponent(r);break;case"auth":var c=r.indexOf(":");~c?(o.username=r.slice(0,c),o.username=encodeURIComponent(decodeURIComponent(o.username)),o.password=r.slice(c+1),o.password=encodeURIComponent(decodeURIComponent(o.password))):o.username=encodeURIComponent(decodeURIComponent(r))}for(var l=0;l<d.length;l++){var u=d[l];u[4]&&(o[u[1]]=o[u[1]].toLowerCase())}return o.auth=o.password?o.username+":"+o.password:o.username,o.origin="file:"!==o.protocol&&m(o.protocol)&&o.host?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(e){e&&"function"==typeof e||(e=n.stringify);var t,r=this,i=r.host,o=r.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var a=o+(r.protocol&&r.slashes||m(r.protocol)?"//":"");return r.username?(a+=r.username,r.password&&(a+=":"+r.password),a+="@"):r.password?(a+=":"+r.password,a+="@"):"file:"!==r.protocol&&m(r.protocol)&&!i&&"/"!==r.pathname&&(a+="@"),(":"===i[i.length-1]||s.test(r.hostname)&&!r.port)&&(i+=":"),a+=i+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(a+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(a+=r.hash),a}},y.extractProtocol=g,y.location=f,y.trimLeft=l,y.qs=n,v=y}function C(){if(_)return S;_=1;var e=E();return S={getOrigin:function(t){if(!t)return null;var n=new e(t);if("file:"===n.protocol)return null;var r=n.port;return r||(r="https:"===n.protocol?"443":"80"),n.protocol+"//"+n.hostname+":"+r},isOriginEqual:function(e,t){return this.getOrigin(e)===this.getOrigin(t)},isSchemeEqual:function(e,t){return e.split(":")[0]===t.split(":")[0]},addPath:function(e,t){var n=e.split("?");return n[0]+t+(n[1]?"?"+n[1]:"")},addQuery:function(e,t){return e+(-1===e.indexOf("?")?"?"+t:"&"+t)},isLoopbackAddr:function(e){return/^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(e)||/^\[::1\]$/.test(e)}}}var O,T={exports:{}};function R(){return O||(O=1,"function"==typeof Object.create?T.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:T.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),T.exports}var x,A,I,N={};function L(){if(A)return x;function e(){this._listeners={}}return A=1,e.prototype.addEventListener=function(e,t){e in this._listeners||(this._listeners[e]=[]);var n=this._listeners[e];-1===n.indexOf(t)&&(n=n.concat([t])),this._listeners[e]=n},e.prototype.removeEventListener=function(e,t){var n=this._listeners[e];if(n){var r=n.indexOf(t);-1===r||(n.length>1?this._listeners[e]=n.slice(0,r).concat(n.slice(r+1)):delete this._listeners[e])}},e.prototype.dispatchEvent=function(){var e=arguments[0],t=e.type,n=1===arguments.length?[e]:Array.apply(null,arguments);if(this["on"+t]&&this["on"+t].apply(this,n),t in this._listeners)for(var r=this._listeners[t],i=0;i<r.length;i++)r[i].apply(this,n)},x=e}function U(){if(I)return N;I=1;var e=R(),t=L();function n(){t.call(this)}return e(n,t),n.prototype.removeAllListeners=function(e){e?delete this._listeners[e]:this._listeners={}},n.prototype.once=function(e,t){var n=this,r=!1;this.on(e,function i(){n.removeListener(e,i),r||(r=!0,t.apply(this,arguments))})},n.prototype.emit=function(){var e=arguments[0],t=this._listeners[e];if(t){for(var n=arguments.length,r=new Array(n-1),i=1;i<n;i++)r[i-1]=arguments[i];for(var o=0;o<t.length;o++)t[o].apply(this,r)}},n.prototype.on=n.prototype.addListener=t.prototype.addEventListener,n.prototype.removeListener=t.prototype.removeEventListener,N.EventEmitter=n,N}var j,P,D,B,$,F,H,M,W,q,V,J,z,G,K,X,Q,Z,Y,ee,te,ne,re,ie,oe,se,ae,ce,le,ue,he,de,pe,fe,me,ge={exports:{}};function ye(){if(D)return P;D=1;var e=y(),n=C(),r=R(),i=U().EventEmitter,o=function(){if(j)return ge.exports;j=1;var e=t.WebSocket||t.MozWebSocket;return ge.exports=e?function(t){return new e(t)}:void 0,ge.exports}();function s(t,r,a){if(!s.enabled())throw new Error("Transport created when disabled");i.call(this);var c=this,l=n.addPath(t,"/websocket");l="https"===l.slice(0,5)?"wss"+l.slice(5):"ws"+l.slice(4),this.url=l,this.ws=new o(this.url,[],a),this.ws.onmessage=function(e){e.data,c.emit("message",e.data)},this.unloadRef=e.unloadAdd(function(){c.ws.close()}),this.ws.onclose=function(e){e.code,e.reason,c.emit("close",e.code,e.reason),c._cleanup()},this.ws.onerror=function(e){c.emit("close",1006,"WebSocket connection broken"),c._cleanup()}}return r(s,i),s.prototype.send=function(e){var t="["+e+"]";this.ws.send(t)},s.prototype.close=function(){var e=this.ws;this._cleanup(),e&&e.close()},s.prototype._cleanup=function(){var t=this.ws;t&&(t.onmessage=t.onclose=t.onerror=null),e.unloadDel(this.unloadRef),this.unloadRef=this.ws=null,this.removeAllListeners()},s.enabled=function(){return!!o},s.transportName="websocket",s.roundTrips=2,P=s}function be(){if(W)return M;W=1;var e=R(),t=C(),n=function(){if($)return B;$=1;var e=R(),t=U().EventEmitter;function n(e,n){t.call(this),this.sendBuffer=[],this.sender=n,this.url=e}return e(n,t),n.prototype.send=function(e){this.sendBuffer.push(e),this.sendStop||this.sendSchedule()},n.prototype.sendScheduleWait=function(){var e,t=this;this.sendStop=function(){t.sendStop=null,clearTimeout(e)},e=setTimeout(function(){t.sendStop=null,t.sendSchedule()},25)},n.prototype.sendSchedule=function(){this.sendBuffer.length;var e=this;if(this.sendBuffer.length>0){var t="["+this.sendBuffer.join(",")+"]";this.sendStop=this.sender(this.url,t,function(t){e.sendStop=null,t?(e.emit("close",t.code||1006,"Sending error: "+t),e.close()):e.sendScheduleWait()}),this.sendBuffer=[]}},n.prototype._cleanup=function(){this.removeAllListeners()},n.prototype.close=function(){this._cleanup(),this.sendStop&&(this.sendStop(),this.sendStop=null)},B=n}(),r=function(){if(H)return F;H=1;var e=R(),t=U().EventEmitter;function n(e,n,r){t.call(this),this.Receiver=e,this.receiveUrl=n,this.AjaxObject=r,this._scheduleReceiver()}return e(n,t),n.prototype._scheduleReceiver=function(){var e=this,t=this.poll=new this.Receiver(this.receiveUrl,this.AjaxObject);t.on("message",function(t){e.emit("message",t)}),t.once("close",function(n,r){e.pollIsClosing,e.poll=t=null,e.pollIsClosing||("network"===r?e._scheduleReceiver():(e.emit("close",n||1006,r),e.removeAllListeners()))})},n.prototype.abort=function(){this.removeAllListeners(),this.pollIsClosing=!0,this.poll&&this.poll.abort()},F=n}();function i(e,i,o,s,a){var c=t.addPath(e,i),l=this;n.call(this,e,o),this.poll=new r(s,c,a),this.poll.on("message",function(e){l.emit("message",e)}),this.poll.once("close",function(e,t){l.poll=null,l.emit("close",e,t),l.close()})}return e(i,n),i.prototype.close=function(){n.prototype.close.call(this),this.removeAllListeners(),this.poll&&(this.poll.abort(),this.poll=null)},M=i}function ve(){if(V)return q;V=1;var e=R(),t=C(),n=be();function r(e,r,i,o){n.call(this,e,r,function(e){return function(n,r,i){var o={};"string"==typeof r&&(o.headers={"Content-type":"text/plain"});var s=t.addPath(n,"/xhr_send"),a=new e("POST",s,r,o);return a.once("finish",function(e){if(a=null,200!==e&&204!==e)return i(new Error("http status "+e));i()}),function(){a.close(),a=null;var e=new Error("Aborted");e.code=1e3,i(e)}}}(o),i,o)}return e(r,n),q=r}function we(){if(z)return J;z=1;var e=R(),t=U().EventEmitter;function n(e,n){t.call(this);var r=this;this.bufferPosition=0,this.xo=new n("POST",e,null),this.xo.on("chunk",this._chunkHandler.bind(this)),this.xo.once("finish",function(e,t){r._chunkHandler(e,t),r.xo=null;var n=200===e?"network":"permanent";r.emit("close",null,n),r._cleanup()})}return e(n,t),n.prototype._chunkHandler=function(e,t){if(200===e&&t)for(var n=-1;;this.bufferPosition+=n+1){var r=t.slice(this.bufferPosition);if(-1===(n=r.indexOf("\n")))break;var i=r.slice(0,n);i&&this.emit("message",i)}},n.prototype._cleanup=function(){this.removeAllListeners()},n.prototype.abort=function(){this.xo&&(this.xo.close(),this.emit("close",null,"user"),this.xo=null),this._cleanup()},J=n}function Se(){if(K)return G;K=1;var e=U().EventEmitter,n=R(),r=y(),i=C(),o=t.XMLHttpRequest;function s(t,n,r,i){var o=this;e.call(this),setTimeout(function(){o._start(t,n,r,i)},0)}n(s,e),s.prototype._start=function(e,t,n,a){var c=this;try{this.xhr=new o}catch(e){}if(!this.xhr)return this.emit("finish",0,"no xhr support"),void this._cleanup();t=i.addQuery(t,"t="+ +new Date),this.unloadRef=r.unloadAdd(function(){c._cleanup(!0)});try{this.xhr.open(e,t,!0),this.timeout&&"timeout"in this.xhr&&(this.xhr.timeout=this.timeout,this.xhr.ontimeout=function(){c.emit("finish",0,""),c._cleanup(!1)})}catch(e){return this.emit("finish",0,""),void this._cleanup(!1)}if(a&&a.noCredentials||!s.supportsCORS||(this.xhr.withCredentials=!0),a&&a.headers)for(var l in a.headers)this.xhr.setRequestHeader(l,a.headers[l]);this.xhr.onreadystatechange=function(){if(c.xhr){var e,t,n=c.xhr;switch(n.readyState,n.readyState){case 3:try{t=n.status,e=n.responseText}catch(e){}1223===t&&(t=204),200===t&&e&&e.length>0&&c.emit("chunk",t,e);break;case 4:1223===(t=n.status)&&(t=204),12005!==t&&12029!==t||(t=0),n.responseText,c.emit("finish",t,n.responseText),c._cleanup(!1)}}};try{c.xhr.send(n)}catch(e){c.emit("finish",0,""),c._cleanup(!1)}},s.prototype._cleanup=function(e){if(this.xhr){if(this.removeAllListeners(),r.unloadDel(this.unloadRef),this.xhr.onreadystatechange=function(){},this.xhr.ontimeout&&(this.xhr.ontimeout=null),e)try{this.xhr.abort()}catch(e){}this.unloadRef=this.xhr=null}},s.prototype.close=function(){this._cleanup(!0)},s.enabled=!!o;var a=["Active"].concat("Object").join("X");!s.enabled&&a in t&&(o=function(){try{return new t[a]("Microsoft.XMLHTTP")}catch(e){return null}},s.enabled=!!new o);var c=!1;try{c="withCredentials"in new o}catch(e){}return s.supportsCORS=c,G=s}function _e(){if(Q)return X;Q=1;var e=R(),t=Se();function n(e,n,r,i){t.call(this,e,n,r,i)}return e(n,t),n.enabled=t.enabled&&t.supportsCORS,X=n}function ke(){if(Y)return Z;Y=1;var e=R(),t=Se();function n(e,n,r){t.call(this,e,n,r,{noCredentials:!0})}return e(n,t),n.enabled=t.enabled,Z=n}function Ee(){return te?ee:(te=1,ee={isOpera:function(){return t.navigator&&/opera/i.test(t.navigator.userAgent)},isKonqueror:function(){return t.navigator&&/konqueror/i.test(t.navigator.userAgent)},hasDomain:function(){if(!t.document)return!0;try{return!!t.document.domain}catch(e){return!1}}})}function Ce(){if(re)return ne;re=1;var e=R(),n=ve(),r=we(),i=_e(),o=ke(),s=Ee();function a(e){if(!o.enabled&&!i.enabled)throw new Error("Transport created when disabled");n.call(this,e,"/xhr_streaming",r,i)}return e(a,n),a.enabled=function(e){return!e.nullOrigin&&(!s.isOpera()&&i.enabled)},a.transportName="xhr-streaming",a.roundTrips=2,a.needBody=!!t.document,ne=a}function Oe(){if(oe)return ie;oe=1;var e=U().EventEmitter,n=R(),r=y(),i=Ee(),o=C();function s(t,n,r){var i=this;e.call(this),setTimeout(function(){i._start(t,n,r)},0)}return n(s,e),s.prototype._start=function(e,n,i){var s=this,a=new t.XDomainRequest;n=o.addQuery(n,"t="+ +new Date),a.onerror=function(){s._error()},a.ontimeout=function(){s._error()},a.onprogress=function(){a.responseText,s.emit("chunk",200,a.responseText)},a.onload=function(){s.emit("finish",200,a.responseText),s._cleanup(!1)},this.xdr=a,this.unloadRef=r.unloadAdd(function(){s._cleanup(!0)});try{this.xdr.open(e,n),this.timeout&&(this.xdr.timeout=this.timeout),this.xdr.send(i)}catch(e){this._error()}},s.prototype._error=function(){this.emit("finish",0,""),this._cleanup(!1)},s.prototype._cleanup=function(e){if(this.xdr){if(this.removeAllListeners(),r.unloadDel(this.unloadRef),this.xdr.ontimeout=this.xdr.onerror=this.xdr.onprogress=this.xdr.onload=null,e)try{this.xdr.abort()}catch(e){}this.unloadRef=this.xdr=null}},s.prototype.close=function(){this._cleanup(!0)},s.enabled=!(!t.XDomainRequest||!i.hasDomain()),ie=s}function Te(){if(ae)return se;ae=1;var e=R(),t=ve(),n=we(),r=Oe();function i(e){if(!r.enabled)throw new Error("Transport created when disabled");t.call(this,e,"/xhr_streaming",n,r)}return e(i,t),i.enabled=function(e){return!e.cookie_needed&&!e.nullOrigin&&(r.enabled&&e.sameScheme)},i.transportName="xdr-streaming",i.roundTrips=2,se=i}function Re(){return le?ce:(le=1,ce=t.EventSource)}function xe(){if(pe)return de;pe=1;var e=R(),t=ve(),n=function(){if(he)return ue;he=1;var e=R(),t=U().EventEmitter,n=Re();function r(e){t.call(this);var r=this,i=this.es=new n(e);i.onmessage=function(e){e.data,r.emit("message",decodeURI(e.data))},i.onerror=function(e){i.readyState;var t=2!==i.readyState?"network":"permanent";r._cleanup(),r._close(t)}}return e(r,t),r.prototype.abort=function(){this._cleanup(),this._close("user")},r.prototype._cleanup=function(){var e=this.es;e&&(e.onmessage=e.onerror=null,e.close(),this.es=null)},r.prototype._close=function(e){var t=this;setTimeout(function(){t.emit("close",null,e),t.removeAllListeners()},200)},ue=r}(),r=_e(),i=Re();function o(e){if(!o.enabled())throw new Error("Transport created when disabled");t.call(this,e,"/eventsource",n,r)}return e(o,t),o.enabled=function(){return!!i},o.transportName="eventsource",o.roundTrips=2,de=o}function Ae(){return me?fe:(me=1,fe="1.6.1")}var Ie,Ne,Le,Ue,je,Pe,De,Be,$e,Fe,He,Me,We,qe,Ve,Je,ze,Ge,Ke,Xe,Qe,Ze,Ye,et={exports:{}};function tt(){return Ie||(Ie=1,function(e){var n=y(),r=Ee();e.exports={WPrefix:"_jp",currentWindowId:null,polluteGlobalNamespace:function(){e.exports.WPrefix in t||(t[e.exports.WPrefix]={})},postMessage:function(n,r){t.parent!==t&&t.parent.postMessage(JSON.stringify({windowId:e.exports.currentWindowId,type:n,data:r||""}),"*")},createIframe:function(e,r){var i,o,s=t.document.createElement("iframe"),a=function(){clearTimeout(i);try{s.onload=null}catch(e){}s.onerror=null},c=function(){s&&(a(),setTimeout(function(){s&&s.parentNode.removeChild(s),s=null},0),n.unloadDel(o))},l=function(e){s&&(c(),r(e))};return s.src=e,s.style.display="none",s.style.position="absolute",s.onerror=function(){l("onerror")},s.onload=function(){clearTimeout(i),i=setTimeout(function(){l("onload timeout")},2e3)},t.document.body.appendChild(s),i=setTimeout(function(){l("timeout")},15e3),o=n.unloadAdd(c),{post:function(e,t){setTimeout(function(){try{s&&s.contentWindow&&s.contentWindow.postMessage(e,t)}catch(e){}},0)},cleanup:c,loaded:a}},createHtmlfile:function(r,i){var o,s,a,c=["Active"].concat("Object").join("X"),l=new t[c]("htmlfile"),u=function(){clearTimeout(o),a.onerror=null},h=function(){l&&(u(),n.unloadDel(s),a.parentNode.removeChild(a),a=l=null,CollectGarbage())},d=function(e){l&&(h(),i(e))};l.open(),l.write('<html><script>document.domain="'+t.document.domain+'";<\/script></html>'),l.close(),l.parentWindow[e.exports.WPrefix]=t[e.exports.WPrefix];var p=l.createElement("div");return l.body.appendChild(p),a=l.createElement("iframe"),p.appendChild(a),a.src=r,a.onerror=function(){d("onerror")},o=setTimeout(function(){d("timeout")},15e3),s=n.unloadAdd(h),{post:function(e,t){try{setTimeout(function(){a&&a.contentWindow&&a.contentWindow.postMessage(e,t)},0)}catch(e){}},cleanup:h,loaded:u}}},e.exports.iframeEnabled=!1,t.document&&(e.exports.iframeEnabled=("function"==typeof t.postMessage||"object"==typeof t.postMessage)&&!r.isKonqueror())}(et)),et.exports}function nt(){if(Le)return Ne;Le=1;var e=R(),t=U().EventEmitter,n=Ae(),r=C(),i=tt(),o=y(),s=g();function a(e,n,c){if(!a.enabled())throw new Error("Transport created when disabled");t.call(this);var l=this;this.origin=r.getOrigin(c),this.baseUrl=c,this.transUrl=n,this.transport=e,this.windowId=s.string(8);var u=r.addPath(c,"/iframe.html")+"#"+this.windowId;this.iframeObj=i.createIframe(u,function(e){l.emit("close",1006,"Unable to load an iframe ("+e+")"),l.close()}),this.onmessageCallback=this._message.bind(this),o.attachEvent("message",this.onmessageCallback)}return e(a,t),a.prototype.close=function(){if(this.removeAllListeners(),this.iframeObj){o.detachEvent("message",this.onmessageCallback);try{this.postMessage("c")}catch(e){}this.iframeObj.cleanup(),this.iframeObj=null,this.onmessageCallback=this.iframeObj=null}},a.prototype._message=function(e){if(e.data,!r.isOriginEqual(e.origin,this.origin))return e.origin,void this.origin;var t;try{t=JSON.parse(e.data)}catch(t){return void e.data}if(t.windowId!==this.windowId)return t.windowId,void this.windowId;switch(t.type){case"s":this.iframeObj.loaded(),this.postMessage("s",JSON.stringify([n,this.transport,this.transUrl,this.baseUrl]));break;case"t":this.emit("message",t.data);break;case"c":var i;try{i=JSON.parse(t.data)}catch(e){return void t.data}this.emit("close",i[0],i[1]),this.close()}},a.prototype.postMessage=function(e,t){this.iframeObj.post(JSON.stringify({windowId:this.windowId,type:e,data:t||""}),this.origin)},a.prototype.send=function(e){this.postMessage("m",e)},a.enabled=function(){return i.iframeEnabled},a.transportName="iframe",a.roundTrips=2,Ne=a}function rt(){return je||(je=1,Ue={isObject:function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},extend:function(e){if(!this.isObject(e))return e;for(var t,n,r=1,i=arguments.length;r<i;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}}),Ue}function it(){if(De)return Pe;De=1;var e=R(),n=nt(),r=rt();return Pe=function(i){function o(e,t){n.call(this,i.transportName,e,t)}return e(o,n),o.enabled=function(e,o){if(!t.document)return!1;var s=r.extend({},o);return s.sameOrigin=!0,i.enabled(s)&&n.enabled()},o.transportName="iframe-"+i.transportName,o.needBody=!0,o.roundTrips=n.roundTrips+i.roundTrips-1,o.facadeTransport=i,o},Pe}function ot(){if(He)return Fe;He=1;var e=R(),n=function(){if($e)return Be;$e=1;var e=R(),n=tt(),r=C(),i=U().EventEmitter,o=g();function s(e){i.call(this);var a=this;n.polluteGlobalNamespace(),this.id="a"+o.string(6),e=r.addQuery(e,"c="+decodeURIComponent(n.WPrefix+"."+this.id)),s.htmlfileEnabled;var c=s.htmlfileEnabled?n.createHtmlfile:n.createIframe;t[n.WPrefix][this.id]={start:function(){a.iframeObj.loaded()},message:function(e){a.emit("message",e)},stop:function(){a._cleanup(),a._close("network")}},this.iframeObj=c(e,function(){a._cleanup(),a._close("permanent")})}e(s,i),s.prototype.abort=function(){this._cleanup(),this._close("user")},s.prototype._cleanup=function(){this.iframeObj&&(this.iframeObj.cleanup(),this.iframeObj=null),delete t[n.WPrefix][this.id]},s.prototype._close=function(e){this.emit("close",null,e),this.removeAllListeners()},s.htmlfileEnabled=!1;var a=["Active"].concat("Object").join("X");if(a in t)try{s.htmlfileEnabled=!!new t[a]("htmlfile")}catch(e){}return s.enabled=s.htmlfileEnabled||n.iframeEnabled,Be=s}(),r=ke(),i=ve();function o(e){if(!n.enabled)throw new Error("Transport created when disabled");i.call(this,e,"/htmlfile",n,r)}return e(o,i),o.enabled=function(e){return n.enabled&&e.sameOrigin},o.transportName="htmlfile",o.roundTrips=2,Fe=o}function st(){if(We)return Me;We=1;var e=R(),t=ve(),n=we(),r=_e(),i=ke();function o(e){if(!i.enabled&&!r.enabled)throw new Error("Transport created when disabled");t.call(this,e,"/xhr",n,r)}return e(o,t),o.enabled=function(e){return!e.nullOrigin&&(!(!i.enabled||!e.sameOrigin)||r.enabled)},o.transportName="xhr-polling",o.roundTrips=2,Me=o}function at(){if(Ve)return qe;Ve=1;var e=R(),t=ve(),n=Te(),r=we(),i=Oe();function o(e){if(!i.enabled)throw new Error("Transport created when disabled");t.call(this,e,"/xhr",r,i)}return e(o,t),o.enabled=n.enabled,o.transportName="xdr-polling",o.roundTrips=2,qe=o}function ct(){if(Ke)return Ge;Ke=1;var e,n,r=g(),i=C();return Ge=function(o,s,a){e||((e=t.document.createElement("form")).style.display="none",e.style.position="absolute",e.method="POST",e.enctype="application/x-www-form-urlencoded",e.acceptCharset="UTF-8",(n=t.document.createElement("textarea")).name="d",e.appendChild(n),t.document.body.appendChild(e));var c="a"+r.string(8);e.target=c,e.action=i.addQuery(i.addPath(o,"/jsonp_send"),"i="+c);var l=function(e){try{return t.document.createElement('<iframe name="'+e+'">')}catch(r){var n=t.document.createElement("iframe");return n.name=e,n}}(c);l.id=c,l.style.display="none",e.appendChild(l);try{n.value=s}catch(e){}e.submit();var u=function(e){l.onerror&&(l.onreadystatechange=l.onerror=l.onload=null,setTimeout(function(){l.parentNode.removeChild(l),l=null},500),n.value="",a(e))};return l.onerror=function(){u()},l.onload=function(){u()},l.onreadystatechange=function(e){l.readyState,"complete"===l.readyState&&u()},function(){u(new Error("Aborted"))}},Ge}function lt(){if(Qe)return Xe;Qe=1;var e=R(),n=be(),r=function(){if(ze)return Je;ze=1;var e=tt(),n=g(),r=Ee(),i=C(),o=R(),s=U().EventEmitter;function a(r){var o=this;s.call(this),e.polluteGlobalNamespace(),this.id="a"+n.string(6);var c=i.addQuery(r,"c="+encodeURIComponent(e.WPrefix+"."+this.id));t[e.WPrefix][this.id]=this._callback.bind(this),this._createScript(c),this.timeoutId=setTimeout(function(){o._abort(new Error("JSONP script loaded abnormally (timeout)"))},a.timeout)}return o(a,s),a.prototype.abort=function(){if(t[e.WPrefix][this.id]){var n=new Error("JSONP user aborted read");n.code=1e3,this._abort(n)}},a.timeout=35e3,a.scriptErrorTimeout=1e3,a.prototype._callback=function(e){this._cleanup(),this.aborting||(e&&this.emit("message",e),this.emit("close",null,"network"),this.removeAllListeners())},a.prototype._abort=function(e){this._cleanup(),this.aborting=!0,this.emit("close",e.code,e.message),this.removeAllListeners()},a.prototype._cleanup=function(){if(clearTimeout(this.timeoutId),this.script2&&(this.script2.parentNode.removeChild(this.script2),this.script2=null),this.script){var n=this.script;n.parentNode.removeChild(n),n.onreadystatechange=n.onerror=n.onload=n.onclick=null,this.script=null}delete t[e.WPrefix][this.id]},a.prototype._scriptError=function(){var e=this;this.errorTimer||(this.errorTimer=setTimeout(function(){e.loadedOkay||e._abort(new Error("JSONP script loaded abnormally (onerror)"))},a.scriptErrorTimeout))},a.prototype._createScript=function(e){var i,o=this,s=this.script=t.document.createElement("script");if(s.id="a"+n.string(8),s.src=e,s.type="text/javascript",s.charset="UTF-8",s.onerror=this._scriptError.bind(this),s.onload=function(){o._abort(new Error("JSONP script loaded abnormally (onload)"))},s.onreadystatechange=function(){if(s.readyState,/loaded|closed/.test(s.readyState)){if(s&&s.htmlFor&&s.onclick){o.loadedOkay=!0;try{s.onclick()}catch(e){}}s&&o._abort(new Error("JSONP script loaded abnormally (onreadystatechange)"))}},void 0===s.async&&t.document.attachEvent)if(r.isOpera())(i=this.script2=t.document.createElement("script")).text="try{var a = document.getElementById('"+s.id+"'); if(a)a.onerror();}catch(x){};",s.async=i.async=!1;else{try{s.htmlFor=s.id,s.event="onclick"}catch(e){}s.async=!0}void 0!==s.async&&(s.async=!0);var a=t.document.getElementsByTagName("head")[0];a.insertBefore(s,a.firstChild),i&&a.insertBefore(i,a.firstChild)},Je=a}(),i=ct();function o(e){if(!o.enabled())throw new Error("Transport created when disabled");n.call(this,e,"/jsonp",i,r)}return e(o,n),o.enabled=function(){return!!t.document},o.transportName="jsonp-polling",o.roundTrips=1,o.needBody=!0,Xe=o}function ut(){return Ye?Ze:(Ye=1,Ze=[ye(),Ce(),Te(),xe(),it()(xe()),ot(),it()(ot()),st(),at(),it()(st()),lt()])}var ht,dt,pt,ft,mt,gt,yt,bt,vt,wt,St,_t,kt,Et,Ct,Ot,Tt,Rt,xt,At,It,Nt,Lt,Ut,jt,Pt,Dt,Bt,$t,Ft,Ht,Mt,Wt,qt={};function Vt(){if(ht)return qt;ht=1;var e,t=Array.prototype,n=Object.prototype,r=Function.prototype,i=String.prototype,o=t.slice,s=n.toString,a=function(e){return"[object Function]"===n.toString.call(e)},c=function(e){return"[object String]"===s.call(e)},l=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}();e=l?function(e,t,n,r){!r&&t in e||Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:n})}:function(e,t,n,r){!r&&t in e||(e[t]=n)};var u=function(t,r,i){for(var o in r)n.hasOwnProperty.call(r,o)&&e(t,o,r[o],i)},h=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)};function d(){}u(r,{bind:function(e){var t=this;if(!a(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var n=o.call(arguments,1),r=Math.max(0,t.length-n.length),i=[],s=0;s<r;s++)i.push("$"+s);var c=Function("binder","return function ("+i.join(",")+"){ return binder.apply(this, arguments); }")(function(){if(this instanceof c){var r=t.apply(this,n.concat(o.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(o.call(arguments)))});return t.prototype&&(d.prototype=t.prototype,c.prototype=new d,d.prototype=null),c}}),u(Array,{isArray:function(e){return"[object Array]"===s.call(e)}});var p,f,m,g=Object("a"),y="a"!==g[0]||!(0 in g);u(t,{forEach:function(e){var t=h(this),n=y&&c(this)?this.split(""):t,r=arguments[1],i=-1,o=n.length>>>0;if(!a(e))throw new TypeError;for(;++i<o;)i in n&&e.call(r,n[i],i,t)}},(p=t.forEach,f=!0,m=!0,p&&(p.call("foo",function(e,t,n){"object"!=typeof n&&(f=!1)}),p.call([1],function(){m="string"==typeof this},"x")),!(p&&f&&m)));var b=Array.prototype.indexOf&&-1!==[0,1].indexOf(1,2);u(t,{indexOf:function(e){var t=y&&c(this)?this.split(""):h(this),n=t.length>>>0;if(!n)return-1;var r,i=0;for(arguments.length>1&&((r=+arguments[1])!=r?r=0:0!==r&&r!==1/0&&r!==-1/0&&(r=(r>0||-1)*Math.floor(Math.abs(r))),i=r),i=i>=0?i:Math.max(0,n+i);i<n;i++)if(i in t&&t[i]===e)return i;return-1}},b);var v,w=i.split;2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?(v=void 0===/()??/.exec("")[1],i.split=function(e,n){var r=this;if(void 0===e&&0===n)return[];if("[object RegExp]"!==s.call(e))return w.call(this,e,n);var i,o,a,c,l=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),h=0;for(e=new RegExp(e.source,u+"g"),r+="",v||(i=new RegExp("^"+e.source+"$(?!\\s)",u)),n=void 0===n?-1>>>0:n>>>0;(o=e.exec(r))&&!((a=o.index+o[0].length)>h&&(l.push(r.slice(h,o.index)),!v&&o.length>1&&o[0].replace(i,function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(o[e]=void 0)}),o.length>1&&o.index<r.length&&t.push.apply(l,o.slice(1)),c=o[0].length,h=a,l.length>=n));)e.lastIndex===o.index&&e.lastIndex++;return h===r.length?!c&&e.test("")||l.push(""):l.push(r.slice(h)),l.length>n?l.slice(0,n):l}):"0".split(void 0,0).length&&(i.split=function(e,t){return void 0===e&&0===t?[]:w.call(this,e,t)});var S=i.substr,_="".substr&&"b"!=="0b".substr(-1);return u(i,{substr:function(e,t){return S.call(this,e<0&&(e=this.length+e)<0?0:e,t)}},_),qt}function Jt(){if(pt)return dt;pt=1;var e,t=/[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g;return dt={quote:function(n){var r=JSON.stringify(n);return t.lastIndex=0,t.test(r)?(e||(e=function(e){var t,n={},r=[];for(t=0;t<65536;t++)r.push(String.fromCharCode(t));return e.lastIndex=0,r.join("").replace(e,function(e){return n[e]="\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4),""}),e.lastIndex=0,n}(t)),r.replace(t,function(t){return e[t]})):r}}}function zt(){if(mt)return ft;mt=1;return ft=function(e){return{filterToEnabled:function(t,n){var r={main:[],facade:[]};return t?"string"==typeof t&&(t=[t]):t=[],e.forEach(function(e){e&&("websocket"===e.transportName&&!1===n.websocket||(t.length&&-1===t.indexOf(e.transportName)?e.transportName:e.enabled(n)?(e.transportName,r.main.push(e),e.facadeTransport&&r.facade.push(e.facadeTransport)):e.transportName))}),r}}}}function Gt(){if(yt)return gt;yt=1;var e={};return["log","debug","warn"].forEach(function(n){var r;try{r=t.console&&t.console[n]&&t.console[n].apply}catch(e){}e[n]=r?function(){return t.console[n].apply(t.console,arguments)}:"log"===n?function(){}:e.log}),gt=e}function Kt(){if(vt)return bt;function e(e){this.type=e}return vt=1,e.prototype.initEvent=function(e,t,n){return this.type=e,this.bubbles=t,this.cancelable=n,this.timeStamp=+new Date,this},e.prototype.stopPropagation=function(){},e.prototype.preventDefault=function(){},e.CAPTURING_PHASE=1,e.AT_TARGET=2,e.BUBBLING_PHASE=3,bt=e}function Xt(){return St?wt:(St=1,wt=t.location||{origin:"http://localhost:80",protocol:"http:",host:"localhost",port:80,href:"http://localhost/",hash:""})}function Qt(){if(xt)return Rt;xt=1;var e=U().EventEmitter,t=R(),n=rt();function r(t,r){e.call(this);var i=this,o=+new Date;this.xo=new r("GET",t),this.xo.once("finish",function(e,t){var r,s;if(200===e){if(s=+new Date-o,t)try{r=JSON.parse(t)}catch(e){}n.isObject(r)||(r={})}i.emit("finish",r,s),i.removeAllListeners()})}return t(r,e),r.prototype.close=function(){this.removeAllListeners(),this.xo.close()},Rt=r}function Zt(){if(It)return At;It=1;var e=R(),t=U().EventEmitter,n=ke(),r=Qt();function i(e){var i=this;t.call(this),this.ir=new r(e,n),this.ir.once("finish",function(e,t){i.ir=null,i.emit("message",JSON.stringify([e,t]))})}return e(i,t),i.transportName="iframe-info-receiver",i.prototype.close=function(){this.ir&&(this.ir.close(),this.ir=null),this.removeAllListeners()},At=i}function Yt(){if(jt)return Ut;jt=1;var e=U().EventEmitter,n=R(),r=C(),i=Oe(),o=_e(),s=ke(),a=function(){if(Tt)return Ot;Tt=1;var e=U().EventEmitter;function t(){var n=this;e.call(this),this.to=setTimeout(function(){n.emit("finish",200,"{}")},t.timeout)}return R()(t,e),t.prototype.close=function(){clearTimeout(this.to)},t.timeout=2e3,Ot=t}(),c=function(){if(Lt)return Nt;Lt=1;var e=U().EventEmitter,n=R(),r=y(),i=nt(),o=Zt();function s(n,s){var a=this;e.call(this);var c=function(){var e=a.ifr=new i(o.transportName,s,n);e.once("message",function(e){if(e){var t;try{t=JSON.parse(e)}catch(e){return a.emit("finish"),void a.close()}var n=t[0],r=t[1];a.emit("finish",n,r)}a.close()}),e.once("close",function(){a.emit("finish"),a.close()})};t.document.body?c():r.attachEvent("load",c)}return n(s,e),s.enabled=function(){return i.enabled()},s.prototype.close=function(){this.ifr&&this.ifr.close(),this.removeAllListeners(),this.ifr=null},Nt=s}(),l=Qt();function u(t,n){var r=this;e.call(this),setTimeout(function(){r.doXhr(t,n)},0)}return n(u,e),u._getReceiver=function(e,t,n){return n.sameOrigin?new l(t,s):o.enabled?new l(t,o):i.enabled&&n.sameScheme?new l(t,i):c.enabled()?new c(e,t):new l(t,a)},u.prototype.doXhr=function(e,t){var n=this,i=r.addPath(e,"/info");this.xo=u._getReceiver(e,i,t),this.timeoutRef=setTimeout(function(){n._cleanup(!1),n.emit("finish")},u.timeout),this.xo.once("finish",function(e,t){n._cleanup(!0),n.emit("finish",e,t)})},u.prototype._cleanup=function(e){clearTimeout(this.timeoutRef),this.timeoutRef=null,!e&&this.xo&&this.xo.close(),this.xo=null},u.prototype.close=function(){this.removeAllListeners(),this._cleanup(!1)},u.timeout=8e3,Ut=u}function en(){if($t)return Bt;$t=1;var e=C(),t=y(),n=function(){if(Dt)return Pt;Dt=1;var e=tt();function t(e){this._transport=e,e.on("message",this._transportMessage.bind(this)),e.on("close",this._transportClose.bind(this))}return t.prototype._transportClose=function(t,n){e.postMessage("c",JSON.stringify([t,n]))},t.prototype._transportMessage=function(t){e.postMessage("t",t)},t.prototype._send=function(e){this._transport.send(e)},t.prototype._close=function(){this._transport.close(),this._transport.removeAllListeners()},Pt=t}(),r=Zt(),i=tt(),o=Xt();return Bt=function(s,a){var c,l={};a.forEach(function(e){e.facadeTransport&&(l[e.facadeTransport.transportName]=e.facadeTransport)}),l[r.transportName]=r,s.bootstrap_iframe=function(){var r;i.currentWindowId=o.hash.slice(1);t.attachEvent("message",function(t){if(t.source===parent&&(void 0===c&&(c=t.origin),t.origin===c)){var a;try{a=JSON.parse(t.data)}catch(e){return void t.data}if(a.windowId===i.currentWindowId)switch(a.type){case"s":var u;try{u=JSON.parse(a.data)}catch(e){a.data;break}var h=u[0],d=u[1],p=u[2],f=u[3];if(h!==s.version)throw new Error('Incompatible SockJS! Main site uses: "'+h+'", the iframe: "'+s.version+'".');if(!e.isOriginEqual(p,o.href)||!e.isOriginEqual(f,o.href))throw new Error("Can't connect to different domain from within an iframe. ("+o.href+", "+p+", "+f+")");r=new n(new l[d](p,f));break;case"m":r._send(a.data);break;case"c":r&&r._close(),r=null}}}),i.postMessage("s")}},Bt}function tn(){if(Ht)return Ft;Ht=1,Vt();var e,n=E(),r=R(),i=g(),o=Jt(),s=C(),a=y(),c=zt(),l=rt(),u=Ee(),h=Gt(),d=Kt(),p=L(),f=Xt(),m=function(){if(kt)return _t;kt=1;var e=R(),t=Kt();function n(){t.call(this),this.initEvent("close",!1,!1),this.wasClean=!1,this.code=0,this.reason=""}return e(n,t),_t=n}(),b=function(){if(Ct)return Et;Ct=1;var e=R(),t=Kt();function n(e){t.call(this),this.initEvent("message",!1,!1),this.data=e}return e(n,t),Et=n}(),v=Yt(),w=function(){};function S(e,t,r){if(!(this instanceof S))return new S(e,t,r);if(arguments.length<1)throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present");p.call(this),this.readyState=S.CONNECTING,this.extensions="",this.protocol="",(r=r||{}).protocols_whitelist&&h.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead."),this._transportsWhitelist=r.transports,this._transportOptions=r.transportOptions||{},this._timeout=r.timeout||0;var o=r.sessionId||8;if("function"==typeof o)this._generateSessionId=o;else{if("number"!=typeof o)throw new TypeError("If sessionId is used in the options, it needs to be a number or a function.");this._generateSessionId=function(){return i.string(o)}}this._server=r.server||i.numberString(1e3);var a=new n(e);if(!a.host||!a.protocol)throw new SyntaxError("The URL '"+e+"' is invalid");if(a.hash)throw new SyntaxError("The URL must not contain a fragment");if("http:"!==a.protocol&&"https:"!==a.protocol)throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '"+a.protocol+"' is not allowed.");var c="https:"===a.protocol;if("https:"===f.protocol&&!c&&!s.isLoopbackAddr(a.hostname))throw new Error("SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS");t?Array.isArray(t)||(t=[t]):t=[];var l=t.sort();l.forEach(function(e,t){if(!e)throw new SyntaxError("The protocols entry '"+e+"' is invalid.");if(t<l.length-1&&e===l[t+1])throw new SyntaxError("The protocols entry '"+e+"' is duplicated.")});var d=s.getOrigin(f.href);this._origin=d?d.toLowerCase():null,a.set("pathname",a.pathname.replace(/\/+$/,"")),this.url=a.href,this.url,this._urlInfo={nullOrigin:!u.hasDomain(),sameOrigin:s.isOriginEqual(this.url,f.href),sameScheme:s.isSchemeEqual(this.url,f.href)},this._ir=new v(this.url,this._urlInfo),this._ir.once("finish",this._receiveInfo.bind(this))}function _(e){return 1e3===e||e>=3e3&&e<=4999}return r(S,p),S.prototype.close=function(e,t){if(e&&!_(e))throw new Error("InvalidAccessError: Invalid code");if(t&&t.length>123)throw new SyntaxError("reason argument has an invalid length");if(this.readyState!==S.CLOSING&&this.readyState!==S.CLOSED){this._close(e||1e3,t||"Normal closure",!0)}},S.prototype.send=function(e){if("string"!=typeof e&&(e=""+e),this.readyState===S.CONNECTING)throw new Error("InvalidStateError: The connection has not been established yet");this.readyState===S.OPEN&&this._transport.send(o.quote(e))},S.version=Ae(),S.CONNECTING=0,S.OPEN=1,S.CLOSING=2,S.CLOSED=3,S.prototype._receiveInfo=function(t,n){if(this._ir=null,t){this._rto=this.countRTO(n),this._transUrl=t.base_url?t.base_url:this.url,t=l.extend(t,this._urlInfo);var r=e.filterToEnabled(this._transportsWhitelist,t);this._transports=r.main,this._transports.length,this._connect()}else this._close(1002,"Cannot connect to server")},S.prototype._connect=function(){for(var e=this._transports.shift();e;e=this._transports.shift()){if(w(e.transportName),e.needBody&&(!t.document.body||void 0!==t.document.readyState&&"complete"!==t.document.readyState&&"interactive"!==t.document.readyState))return this._transports.unshift(e),void a.attachEvent("load",this._connect.bind(this));var n=Math.max(this._timeout,this._rto*e.roundTrips||5e3);this._transportTimeoutId=setTimeout(this._transportTimeout.bind(this),n);var r=s.addPath(this._transUrl,"/"+this._server+"/"+this._generateSessionId()),i=this._transportOptions[e.transportName],o=new e(r,this._transUrl,i);return o.on("message",this._transportMessage.bind(this)),o.once("close",this._transportClose.bind(this)),o.transportName=e.transportName,void(this._transport=o)}this._close(2e3,"All transports failed",!1)},S.prototype._transportTimeout=function(){this.readyState===S.CONNECTING&&(this._transport&&this._transport.close(),this._transportClose(2007,"Transport timed out"))},S.prototype._transportMessage=function(e){var t,n=this,r=e.slice(0,1),i=e.slice(1);switch(r){case"o":return void this._open();case"h":return this.dispatchEvent(new d("heartbeat")),void this.transport}if(i)try{t=JSON.parse(i)}catch(e){}if(void 0!==t)switch(r){case"a":Array.isArray(t)&&t.forEach(function(e){n.transport,n.dispatchEvent(new b(e))});break;case"m":this.transport,this.dispatchEvent(new b(t));break;case"c":Array.isArray(t)&&2===t.length&&this._close(t[0],t[1],!0)}},S.prototype._transportClose=function(e,t){this.transport,this._transport&&(this._transport.removeAllListeners(),this._transport=null,this.transport=null),_(e)||2e3===e||this.readyState!==S.CONNECTING?this._close(e,t):this._connect()},S.prototype._open=function(){this._transport&&this._transport.transportName,this.readyState,this.readyState===S.CONNECTING?(this._transportTimeoutId&&(clearTimeout(this._transportTimeoutId),this._transportTimeoutId=null),this.readyState=S.OPEN,this.transport=this._transport.transportName,this.dispatchEvent(new d("open")),this.transport):this._close(1006,"Server lost session")},S.prototype._close=function(e,t,n){this.transport,this.readyState;var r=!1;if(this._ir&&(r=!0,this._ir.close(),this._ir=null),this._transport&&(this._transport.close(),this._transport=null,this.transport=null),this.readyState===S.CLOSED)throw new Error("InvalidStateError: SockJS has already been closed");this.readyState=S.CLOSING,setTimeout(function(){this.readyState=S.CLOSED,r&&this.dispatchEvent(new d("error"));var i=new m("close");i.wasClean=n||!1,i.code=e||1e3,i.reason=t,this.dispatchEvent(i),this.onmessage=this.onclose=this.onerror=null}.bind(this),0)},S.prototype.countRTO=function(e){return e>100?4*e:300+e},Ft=function(t){return e=c(t),en()(S,t),S}}var nn=function(){if(Wt)return Mt;Wt=1;var e=ut();return Mt=tn()(e),"_sockjs_onload"in t&&setTimeout(t._sockjs_onload,1),Mt}(),rn=n(nn);const on="\n",sn="\0";class an{get body(){return!this._body&&this.isBinaryBody&&(this._body=(new TextDecoder).decode(this._binaryBody)),this._body||""}get binaryBody(){return this._binaryBody||this.isBinaryBody||(this._binaryBody=(new TextEncoder).encode(this._body)),this._binaryBody}constructor(e){const{command:t,headers:n,body:r,binaryBody:i,escapeHeaderValues:o,skipContentLengthHeader:s}=e;this.command=t,this.headers=Object.assign({},n||{}),i?(this._binaryBody=i,this.isBinaryBody=!0):(this._body=r||"",this.isBinaryBody=!1),this.escapeHeaderValues=o||!1,this.skipContentLengthHeader=s||!1}static fromRawFrame(e,t){const n={},r=e=>e.replace(/^\s+|\s+$/g,"");for(const i of e.headers.reverse()){i.indexOf(":");const o=r(i[0]);let s=r(i[1]);t&&"CONNECT"!==e.command&&"CONNECTED"!==e.command&&(s=an.hdrValueUnEscape(s)),n[o]=s}return new an({command:e.command,headers:n,binaryBody:e.binaryBody,escapeHeaderValues:t})}toString(){return this.serializeCmdAndHeaders()}serialize(){const e=this.serializeCmdAndHeaders();return this.isBinaryBody?an.toUnit8Array(e,this._binaryBody).buffer:e+this._body+sn}serializeCmdAndHeaders(){const e=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(const t of Object.keys(this.headers||{})){const n=this.headers[t];this.escapeHeaderValues&&"CONNECT"!==this.command&&"CONNECTED"!==this.command?e.push(`${t}:${an.hdrValueEscape(`${n}`)}`):e.push(`${t}:${n}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&e.push(`content-length:${this.bodyLength()}`),e.join(on)+on+on}isBodyEmpty(){return 0===this.bodyLength()}bodyLength(){const e=this.binaryBody;return e?e.length:0}static sizeOfUTF8(e){return e?(new TextEncoder).encode(e).length:0}static toUnit8Array(e,t){const n=(new TextEncoder).encode(e),r=new Uint8Array([0]),i=new Uint8Array(n.length+t.length+r.length);return i.set(n),i.set(t,n.length),i.set(r,n.length+t.length),i}static marshall(e){return new an(e).serialize()}static hdrValueEscape(e){return e.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(e){return e.replace(/\\r/g,"\r").replace(/\\n/g,"\n").replace(/\\c/g,":").replace(/\\\\/g,"\\")}}class cn{constructor(e,t){this.onFrame=e,this.onIncomingPing=t,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(e,t=!1){let n;if(n="string"==typeof e?this._encoder.encode(e):new Uint8Array(e),t&&0!==n[n.length-1]){const e=new Uint8Array(n.length+1);e.set(n,0),e[n.length]=0,n=e}for(let e=0;e<n.length;e++){const t=n[e];this._onByte(t)}}_collectFrame(e){0!==e&&13!==e&&(10!==e?(this._onByte=this._collectCommand,this._reinjectByte(e)):this.onIncomingPing())}_collectCommand(e){if(13!==e)return 10===e?(this._results.command=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_collectHeaders(e){13!==e&&(10!==e?(this._onByte=this._collectHeaderKey,this._reinjectByte(e)):this._setupCollectBody())}_reinjectByte(e){this._onByte(e)}_collectHeaderKey(e){if(58===e)return this._headerKey=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaderValue);this._consumeByte(e)}_collectHeaderValue(e){if(13!==e)return 10===e?(this._results.headers.push([this._headerKey,this._consumeTokenAsUTF8()]),this._headerKey=void 0,void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_setupCollectBody(){const e=this._results.headers.filter(e=>"content-length"===e[0])[0];e?(this._bodyBytesRemaining=parseInt(e[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(e){0!==e?this._consumeByte(e):this._retrievedBody()}_collectBodyFixedSize(e){0!==this._bodyBytesRemaining--?this._consumeByte(e):this._retrievedBody()}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw();try{this.onFrame(this._results)}catch(e){console.log("Ignoring an exception thrown by a frame handler. Original exception: ",e)}this._initState()}_consumeByte(e){this._token.push(e)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){const e=new Uint8Array(this._token);return this._token=[],e}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}}var ln,un,hn,dn;!function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(ln||(ln={})),function(e){e[e.ACTIVE=0]="ACTIVE",e[e.DEACTIVATING=1]="DEACTIVATING",e[e.INACTIVE=2]="INACTIVE"}(un||(un={})),function(e){e[e.LINEAR=0]="LINEAR",e[e.EXPONENTIAL=1]="EXPONENTIAL"}(hn||(hn={})),function(e){e.Interval="interval",e.Worker="worker"}(dn||(dn={}));class pn{constructor(e,t=dn.Interval,n){this._interval=e,this._strategy=t,this._debug=n,this._workerScript=`\n    var startTime = Date.now();\n    setInterval(function() {\n        self.postMessage(Date.now() - startTime);\n    }, ${this._interval});\n  `}start(e){this.stop(),this.shouldUseWorker()?this.runWorker(e):this.runInterval(e)}stop(){this.disposeWorker(),this.disposeInterval()}shouldUseWorker(){return"undefined"!=typeof Worker&&this._strategy===dn.Worker}runWorker(e){this._debug("Using runWorker for outgoing pings"),this._worker||(this._worker=new Worker(URL.createObjectURL(new Blob([this._workerScript],{type:"text/javascript"}))),this._worker.onmessage=t=>e(t.data))}runInterval(e){if(this._debug("Using runInterval for outgoing pings"),!this._timer){const t=Date.now();this._timer=setInterval(()=>{e(Date.now()-t)},this._interval)}}disposeWorker(){this._worker&&(this._worker.terminate(),delete this._worker,this._debug("Outgoing ping disposeWorker"))}disposeInterval(){this._timer&&(clearInterval(this._timer),delete this._timer,this._debug("Outgoing ping disposeInterval"))}}class fn{constructor(e){this.versions=e}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map(e=>`v${e.replace(".","")}.stomp`)}}fn.V1_0="1.0",fn.V1_1="1.1",fn.V1_2="1.2",fn.default=new fn([fn.V1_2,fn.V1_1,fn.V1_0]);class mn{get connectedVersion(){return this._connectedVersion}get connected(){return this._connected}constructor(e,t,n){this._client=e,this._webSocket=t,this._connected=!1,this._serverFrameHandlers={CONNECTED:e=>{this.debug(`connected to server ${e.headers.server}`),this._connected=!0,this._connectedVersion=e.headers.version,this._connectedVersion===fn.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(e.headers),this.onConnect(e)},MESSAGE:e=>{const t=e.headers.subscription,n=this._subscriptions[t]||this.onUnhandledMessage,r=e,i=this,o=this._connectedVersion===fn.V1_2?r.headers.ack:r.headers["message-id"];r.ack=(e={})=>i.ack(o,t,e),r.nack=(e={})=>i.nack(o,t,e),n(r)},RECEIPT:e=>{const t=this._receiptWatchers[e.headers["receipt-id"]];t?(t(e),delete this._receiptWatchers[e.headers["receipt-id"]]):this.onUnhandledReceipt(e)},ERROR:e=>{this.onStompError(e)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.debug=n.debug,this.stompVersions=n.stompVersions,this.connectHeaders=n.connectHeaders,this.disconnectHeaders=n.disconnectHeaders,this.heartbeatIncoming=n.heartbeatIncoming,this.heartbeatOutgoing=n.heartbeatOutgoing,this.splitLargeFrames=n.splitLargeFrames,this.maxWebSocketChunkSize=n.maxWebSocketChunkSize,this.forceBinaryWSFrames=n.forceBinaryWSFrames,this.logRawCommunication=n.logRawCommunication,this.appendMissingNULLonIncoming=n.appendMissingNULLonIncoming,this.discardWebsocketOnCommFailure=n.discardWebsocketOnCommFailure,this.onConnect=n.onConnect,this.onDisconnect=n.onDisconnect,this.onStompError=n.onStompError,this.onWebSocketClose=n.onWebSocketClose,this.onWebSocketError=n.onWebSocketError,this.onUnhandledMessage=n.onUnhandledMessage,this.onUnhandledReceipt=n.onUnhandledReceipt,this.onUnhandledFrame=n.onUnhandledFrame}start(){const e=new cn(e=>{const t=an.fromRawFrame(e,this._escapeHeaderValues);this.logRawCommunication||this.debug(`<<< ${t}`);(this._serverFrameHandlers[t.command]||this.onUnhandledFrame)(t)},()=>{this.debug("<<< PONG")});this._webSocket.onmessage=t=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){const e=t.data instanceof ArrayBuffer?(new TextDecoder).decode(t.data):t.data;this.debug(`<<< ${e}`)}e.parseChunk(t.data,this.appendMissingNULLonIncoming)},this._webSocket.onclose=e=>{this.debug(`Connection closed to ${this._webSocket.url}`),this._cleanUp(),this.onWebSocketClose(e)},this._webSocket.onerror=e=>{this.onWebSocketError(e)},this._webSocket.onopen=()=>{const e=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),e["accept-version"]=this.stompVersions.supportedVersions(),e["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:e})}}_setupHeartbeat(e){if(e.version!==fn.V1_1&&e.version!==fn.V1_2)return;if(!e["heart-beat"])return;const[t,n]=e["heart-beat"].split(",").map(e=>parseInt(e,10));if(0!==this.heartbeatOutgoing&&0!==n){const e=Math.max(this.heartbeatOutgoing,n);this.debug(`send PING every ${e}ms`),this._pinger=new pn(e,this._client.heartbeatStrategy,this.debug),this._pinger.start(()=>{this._webSocket.readyState===ln.OPEN&&(this._webSocket.send(on),this.debug(">>> PING"))})}if(0!==this.heartbeatIncoming&&0!==t){const e=Math.max(this.heartbeatIncoming,t);this.debug(`check PONG every ${e}ms`),this._ponger=setInterval(()=>{const t=Date.now()-this._lastServerActivityTS;t>2*e&&(this.debug(`did not receive server activity for the last ${t}ms`),this._closeOrDiscardWebsocket())},e)}}_closeOrDiscardWebsocket(){this.discardWebsocketOnCommFailure?(this.debug("Discarding websocket, the underlying socket may linger for a while"),this.discardWebsocket()):(this.debug("Issuing close on the websocket"),this._closeWebsocket())}forceDisconnect(){this._webSocket&&(this._webSocket.readyState!==ln.CONNECTING&&this._webSocket.readyState!==ln.OPEN||this._closeOrDiscardWebsocket())}_closeWebsocket(){this._webSocket.onmessage=()=>{},this._webSocket.close()}discardWebsocket(){var e,t;"function"!=typeof this._webSocket.terminate&&(e=this._webSocket,t=e=>this.debug(e),e.terminate=function(){const n=()=>{};this.onerror=n,this.onmessage=n,this.onopen=n;const r=new Date,i=Math.random().toString().substring(2,8),o=this.onclose;this.onclose=e=>{const n=(new Date).getTime()-r.getTime();t(`Discarded socket (#${i})  closed after ${n}ms, with code/reason: ${e.code}/${e.reason}`)},this.close(),o?.call(e,{code:4001,reason:`Quick discarding socket (#${i}) without waiting for the shutdown sequence.`,wasClean:!1})}),this._webSocket.terminate()}_transmit(e){const{command:t,headers:n,body:r,binaryBody:i,skipContentLengthHeader:o}=e,s=new an({command:t,headers:n,body:r,binaryBody:i,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:o});let a=s.serialize();if(this.logRawCommunication?this.debug(`>>> ${a}`):this.debug(`>>> ${s}`),this.forceBinaryWSFrames&&"string"==typeof a&&(a=(new TextEncoder).encode(a)),"string"==typeof a&&this.splitLargeFrames){let e=a;for(;e.length>0;){const t=e.substring(0,this.maxWebSocketChunkSize);e=e.substring(this.maxWebSocketChunkSize),this._webSocket.send(t),this.debug(`chunk sent = ${t.length}, remaining = ${e.length}`)}}else this._webSocket.send(a)}dispose(){if(this.connected)try{const e=Object.assign({},this.disconnectHeaders);e.receipt||(e.receipt="close-"+this._counter++),this.watchForReceipt(e.receipt,e=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(e)}),this._transmit({command:"DISCONNECT",headers:e})}catch(e){this.debug(`Ignoring error during disconnect ${e}`)}else this._webSocket.readyState!==ln.CONNECTING&&this._webSocket.readyState!==ln.OPEN||this._closeWebsocket()}_cleanUp(){this._connected=!1,this._pinger&&(this._pinger.stop(),this._pinger=void 0),this._ponger&&(clearInterval(this._ponger),this._ponger=void 0)}publish(e){const{destination:t,headers:n,body:r,binaryBody:i,skipContentLengthHeader:o}=e,s=Object.assign({destination:t},n);this._transmit({command:"SEND",headers:s,body:r,binaryBody:i,skipContentLengthHeader:o})}watchForReceipt(e,t){this._receiptWatchers[e]=t}subscribe(e,t,n={}){(n=Object.assign({},n)).id||(n.id="sub-"+this._counter++),n.destination=e,this._subscriptions[n.id]=t,this._transmit({command:"SUBSCRIBE",headers:n});const r=this;return{id:n.id,unsubscribe:e=>r.unsubscribe(n.id,e)}}unsubscribe(e,t={}){t=Object.assign({},t),delete this._subscriptions[e],t.id=e,this._transmit({command:"UNSUBSCRIBE",headers:t})}begin(e){const t=e||"tx-"+this._counter++;this._transmit({command:"BEGIN",headers:{transaction:t}});const n=this;return{id:t,commit(){n.commit(t)},abort(){n.abort(t)}}}commit(e){this._transmit({command:"COMMIT",headers:{transaction:e}})}abort(e){this._transmit({command:"ABORT",headers:{transaction:e}})}ack(e,t,n={}){n=Object.assign({},n),this._connectedVersion===fn.V1_2?n.id=e:n["message-id"]=e,n.subscription=t,this._transmit({command:"ACK",headers:n})}nack(e,t,n={}){return n=Object.assign({},n),this._connectedVersion===fn.V1_2?n.id=e:n["message-id"]=e,n.subscription=t,this._transmit({command:"NACK",headers:n})}}class gn{get webSocket(){return this._stompHandler?._webSocket}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(e){this._disconnectHeaders=e,this._stompHandler&&(this._stompHandler.disconnectHeaders=this._disconnectHeaders)}get connected(){return!!this._stompHandler&&this._stompHandler.connected}get connectedVersion(){return this._stompHandler?this._stompHandler.connectedVersion:void 0}get active(){return this.state===un.ACTIVE}_changeState(e){this.state=e,this.onChangeState(e)}constructor(e={}){this.stompVersions=fn.default,this.connectionTimeout=0,this.reconnectDelay=5e3,this._nextReconnectDelay=0,this.maxReconnectDelay=9e5,this.reconnectTimeMode=hn.LINEAR,this.heartbeatIncoming=1e4,this.heartbeatOutgoing=1e4,this.heartbeatStrategy=dn.Interval,this.splitLargeFrames=!1,this.maxWebSocketChunkSize=8192,this.forceBinaryWSFrames=!1,this.appendMissingNULLonIncoming=!1,this.discardWebsocketOnCommFailure=!1,this.state=un.INACTIVE;const t=()=>{};this.debug=t,this.beforeConnect=t,this.onConnect=t,this.onDisconnect=t,this.onUnhandledMessage=t,this.onUnhandledReceipt=t,this.onUnhandledFrame=t,this.onStompError=t,this.onWebSocketClose=t,this.onWebSocketError=t,this.logRawCommunication=!1,this.onChangeState=t,this.connectHeaders={},this._disconnectHeaders={},this.configure(e)}configure(e){Object.assign(this,e),this.maxReconnectDelay>0&&this.maxReconnectDelay<this.reconnectDelay&&(this.debug(`Warning: maxReconnectDelay (${this.maxReconnectDelay}ms) is less than reconnectDelay (${this.reconnectDelay}ms). Using reconnectDelay as the maxReconnectDelay delay.`),this.maxReconnectDelay=this.reconnectDelay)}activate(){const e=()=>{this.active?this.debug("Already ACTIVE, ignoring request to activate"):(this._changeState(un.ACTIVE),this._nextReconnectDelay=this.reconnectDelay,this._connect())};this.state===un.DEACTIVATING?(this.debug("Waiting for deactivation to finish before activating"),this.deactivate().then(()=>{e()})):e()}async _connect(){if(await this.beforeConnect(this),this._stompHandler)return void this.debug("There is already a stompHandler, skipping the call to connect");if(!this.active)return void this.debug("Client has been marked inactive, will not attempt to connect");this.connectionTimeout>0&&(this._connectionWatcher&&clearTimeout(this._connectionWatcher),this._connectionWatcher=setTimeout(()=>{this.connected||(this.debug(`Connection not established in ${this.connectionTimeout}ms, closing socket`),this.forceDisconnect())},this.connectionTimeout)),this.debug("Opening Web Socket...");const e=this._createWebSocket();this._stompHandler=new mn(this,e,{debug:this.debug,stompVersions:this.stompVersions,connectHeaders:this.connectHeaders,disconnectHeaders:this._disconnectHeaders,heartbeatIncoming:this.heartbeatIncoming,heartbeatOutgoing:this.heartbeatOutgoing,heartbeatStrategy:this.heartbeatStrategy,splitLargeFrames:this.splitLargeFrames,maxWebSocketChunkSize:this.maxWebSocketChunkSize,forceBinaryWSFrames:this.forceBinaryWSFrames,logRawCommunication:this.logRawCommunication,appendMissingNULLonIncoming:this.appendMissingNULLonIncoming,discardWebsocketOnCommFailure:this.discardWebsocketOnCommFailure,onConnect:e=>{if(this._connectionWatcher&&(clearTimeout(this._connectionWatcher),this._connectionWatcher=void 0),!this.active)return this.debug("STOMP got connected while deactivate was issued, will disconnect now"),void this._disposeStompHandler();this.onConnect(e)},onDisconnect:e=>{this.onDisconnect(e)},onStompError:e=>{this.onStompError(e)},onWebSocketClose:e=>{this._stompHandler=void 0,this.state===un.DEACTIVATING&&this._changeState(un.INACTIVE),this.onWebSocketClose(e),this.active&&this._schedule_reconnect()},onWebSocketError:e=>{this.onWebSocketError(e)},onUnhandledMessage:e=>{this.onUnhandledMessage(e)},onUnhandledReceipt:e=>{this.onUnhandledReceipt(e)},onUnhandledFrame:e=>{this.onUnhandledFrame(e)}}),this._stompHandler.start()}_createWebSocket(){let e;if(this.webSocketFactory)e=this.webSocketFactory();else{if(!this.brokerURL)throw new Error("Either brokerURL or webSocketFactory must be provided");e=new WebSocket(this.brokerURL,this.stompVersions.protocolVersions())}return e.binaryType="arraybuffer",e}_schedule_reconnect(){this._nextReconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this._nextReconnectDelay}ms`),this._reconnector=setTimeout(()=>{this.reconnectTimeMode===hn.EXPONENTIAL&&(this._nextReconnectDelay=2*this._nextReconnectDelay,0!==this.maxReconnectDelay&&(this._nextReconnectDelay=Math.min(this._nextReconnectDelay,this.maxReconnectDelay))),this._connect()},this._nextReconnectDelay))}async deactivate(e={}){const t=e.force||!1,n=this.active;let r;if(this.state===un.INACTIVE)return this.debug("Already INACTIVE, nothing more to do"),Promise.resolve();if(this._changeState(un.DEACTIVATING),this._nextReconnectDelay=0,this._reconnector&&(clearTimeout(this._reconnector),this._reconnector=void 0),!this._stompHandler||this.webSocket.readyState===ln.CLOSED)return this._changeState(un.INACTIVE),Promise.resolve();{const e=this._stompHandler.onWebSocketClose;r=new Promise((t,n)=>{this._stompHandler.onWebSocketClose=n=>{e(n),t()}})}return t?this._stompHandler?.discardWebsocket():n&&this._disposeStompHandler(),r}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&this._stompHandler.dispose()}publish(e){this._checkConnection(),this._stompHandler.publish(e)}_checkConnection(){if(!this.connected)throw new TypeError("There is no underlying STOMP connection")}watchForReceipt(e,t){this._checkConnection(),this._stompHandler.watchForReceipt(e,t)}subscribe(e,t,n={}){return this._checkConnection(),this._stompHandler.subscribe(e,t,n)}unsubscribe(e,t={}){this._checkConnection(),this._stompHandler.unsubscribe(e,t)}begin(e){return this._checkConnection(),this._stompHandler.begin(e)}commit(e){this._checkConnection(),this._stompHandler.commit(e)}abort(e){this._checkConnection(),this._stompHandler.abort(e)}ack(e,t,n={}){this._checkConnection(),this._stompHandler.ack(e,t,n)}nack(e,t,n={}){this._checkConnection(),this._stompHandler.nack(e,t,n)}}var yn={sendLogMessage:(e,t,n)=>new Promise((r,i)=>{const o=new XMLHttpRequest;o.open("POST",`${e}/public/log`),o.onreadystatechange=()=>{4===o.readyState&&(200!==o.status?i(new Error(`Unable to send client log message.  Received status [${o.status}]`)):r(JSON.parse(o.response)))},o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.send(JSON.stringify({message:t[0],level:n.level}))}),configureLogging(e,t){if(!!t.clientLib&&"true"===t.clientLib.loggingEnabled){const n=p.createDefaultHandler();p.setHandler((t,r)=>{n(t,r),this.sendLogMessage(e,t,r)});let r=p[t.clientLib.loggingLevel];p.setLevel(r),r||(r=p.INFO,p.warn(`SkillsClient::SkillService::Unknown log level [${t.clientLib.loggingLevel}], defaulting to INFO`)),p.info(`SkillsClient::SkillService::Logger enabled, log level set to [${r.name}]`)}},reportSkillsClientVersion:e=>new Promise((t,n)=>{const r=new XMLHttpRequest;r.open("POST",`${e.getServiceUrl()}/api/projects/${e.getProjectId()}/skillsClientVersion`),r.withCredentials=!0,e.isPKIMode()||r.setRequestHeader("Authorization",`Bearer ${e.getAuthToken()}`),r.onreadystatechange=()=>{4===r.readyState&&(200!==r.status?n(new Error(`Unable to report skillsClientVersion.  Received status [${r.status}]`)):t(JSON.parse(r.response)))},r.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.send(JSON.stringify({skillsClientVersion:e.skillsClientVersion}))}),getServiceStatus:e=>new Promise((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e),r.onreadystatechange=()=>{4===r.readyState&&(200!==r.status?n(new Error(`Unable to retrieve client configuration.  Received status [${r.status}]`)):t(JSON.parse(r.response)))},r.send()}),isOAuthMode:(e,t)=>"string"==typeof e&&e.startsWith(`${t}/oauth2/authorization`),getAuthenticationToken(e,t,n,r=!1){return new Promise((i,o)=>{const s=this.isOAuthMode(e,t),a=new XMLHttpRequest;s?(a.open("GET",`${t}/api/projects/${n}/token`),a.withCredentials=!0):a.open("GET",e),a.onreadystatechange=()=>{if(4===a.readyState)if(200!==a.status)if(s&&r&&401===a.status){const t=`${e}?skillsRedirectUri=${window.location}`;p.info(`SkillsClient::SkillService::unable to get oAuth token, navigating to [${t}]`),window.location.assign(t),i()}else o(new Error(`SkillTree: Unable to authenticate using [${e}] endpoint. Response Code=[${a.status}].\n\n    Ideas to diagnose:\n\n        (1) verify that the authenticator property is correct.\n\n        (2) verify that the server providing the authenticator endpoint is responding (ex. daemon is running, network path is clear).\n\n        (3) check logs on the server providing authenticator endpoint.\n\n  Full Response=[${a.response}]`));else{const t=JSON.parse(a.response);t.access_token?i(t.access_token):o(new Error(`SkillTree: Response from [${e}] endpoint did have NOT have 'access_token' attribute. \n\n    Ideas to diagnose:\n\n        (1) verify that the authenticator property is correct.\n\n        (2) check implementation of the authenticator endpoint; it must return payload that has 'access_token' attribute.\n\n  Full Response=[${a.response}]`))}},a.send()})}};window.process||(window.process={env:{DEBUG:void 0}});let bn=null,vn=null,wn=!1,Sn=!1;const _n=()=>{bn||(bn=new Promise((e,t)=>{vn={resolve:e,reject:t}}))},kn=e=>{p.debug("SkillsClient::SkillsConfiguration::calling initializedResolvers"),vn.resolve(),yn.reportSkillsClientVersion(e),wn=!0,p.debug("SkillsClient::SkillsConfiguration::initialized")},En=()=>{p.info("SkillsClient::SkillConfiguration::configured"),Sn=!0};_n();const Cn={configure({serviceUrl:e,projectId:t,authenticator:n,authToken:r,oauthRedirect:i=!1,enabled:o=!0}){if(!this.isInitialized()){if(p.debug(`SkillsConfiguration::configure params serviceUrl=[${e}], projectId=[${t}], authenticator=[${n}], authToken=[${r}], oauthRedirect=${i}, enabled=${o}`),this.enabled=o,!o)return p.useDefaults(),p.setLevel(p.TRACE),p.info("SkillsConfiguration is disabled."),Promise.resolve();if(this.skillsClientVersion||(this.skillsClientVersion="@skilltree/skills-client-js-3.6.2"),!t||"null"===t)throw new Error(`SkillTree: SkillsConfiguration.configure received invalid parameter for projectId=[${t}]`);if(!e||"null"===e)throw new Error(`SkillTree: SkillsConfiguration.configure received invalid parameter for serviceUrl=[${e}]`);if(!(r||n&&"null"!==n))throw new Error(`SkillTree: SkillsConfiguration.configure received invalid parameter for authenticator=[${n}]`);return this.projectId=t,this.serviceUrl=`${e}`.trim().replace(/\/$/,""),this.authenticator=n,this.authToken=r,yn.getServiceStatus(`${this.getServiceUrl()}/public/status`).then(e=>{if(this.status=e.status,yn.configureLogging(this.getServiceUrl(),e),p.info(`Returned status [${JSON.stringify(e)}]`),e.oAuthProviders&&e.oAuthProviders.includes(n)&&(this.authenticator=`${this.getServiceUrl()}/oauth2/authorization/${n}`,p.info(`Auto configured authenticator [${this.authenticator}] for provider [${n}]`)),!this.isPKIMode()&&!this.getAuthToken())return yn.getAuthenticationToken(this.getAuthenticator(),this.getServiceUrl(),this.getProjectId(),i).then(e=>{this.setAuthToken(e),kn(this),En()});kn(this),En()}).catch(e=>{console.error("Error getting service status",e),En(),vn.resolve()})}p.warn("SkillsConfiguration already initialized.")},afterConfigure:()=>bn,validate(){if(!this.serviceUrl||!this.projectId||!this.authenticator){throw new Error("SkillTree: SkillsConfiguration was not configured and serviceUrl, projectId and authenticationUrl are missing. Please call: \n      SkillsConfiguration.configure(serviceUrl, myProjectId, authenticator);\nSkillsConfiguration is a singleton and you only have to do this once. Please see the docs for more info.")}},isPKIMode(){return"pki"===this.getAuthenticator()||"pki"===this.getAuthToken()},isOAuthMode(){return yn.isOAuthMode(this.authenticator,this.serviceUrl)},isInitialized:()=>wn,wasConfigureCalled:()=>Sn,getProjectId(){return this.projectId},isDisabled(){return!this.enabled},getServiceUrl(){return this.serviceUrl},getAuthenticator(){return this.authenticator},getAuthToken(){return this.authToken},getServiceStatus(){return this.status},setAuthToken(e){this.authToken=e},logout(){vn=null,bn=null,Sn=!1,wn=!1,_n(),this.setAuthToken(null)}},On=new Set,Tn=new Set;let Rn=null;let xn;const An=e=>{if(xn&&xn.active)p.warn("SkillsClient::SkillsReporter::websocket already connecting, preventing duplicate connection.",xn.active);else{const t=`${e}/skills-websocket`;p.info(`SkillsClient::SkillsReporter::connecting websocket using SockJS to [${t}]`),xn||(xn=new gn);let n={};Cn.isPKIMode()||(p.debug("SkillsClient::SkillsReporter::adding Authorization header to web socket connection"),n={Authorization:`Bearer ${Cn.getAuthToken()}`}),xn.configure({webSocketFactory:()=>new rn(t),connectHeaders:n,onConnect:()=>{p.info("SkillsClient::SkillsReporter::stompClient connected");const e=`/user/queue/${Cn.getProjectId()}-skill-updates`;p.info(`SkillsClient::SkillsReporter::stompClient subscribing to topic [${e}]`),xn.subscribe(e,t=>{p.debug(`SkillsClient::SkillsReporter::ws message [${t.body}] received over topic [${e}]. calling success handlers...`),(e=>{On.forEach(t=>t(e))})(JSON.parse(t.body)),p.debug("SkillsClient::SkillsReporter::Done calling success handlers...")}),window.postMessage({skillsWebsocketConnected:!0},window.location.origin),p.debug("SkillsClient::SkillsReporter::window.postMessage skillsWebsocketConnected")},onStompError:e=>{p.error(`Received STOMP error event. headers [${JSON.stringify(n)}] frame [${e}]`),!Cn.isPKIMode()&&e&&e.headers&&e.headers.message&&e.headers.message.includes("invalid_token")&&yn.getAuthenticationToken(Cn.getAuthenticator(),Cn.getServiceUrl(),Cn.getProjectId()).then(e=>{Cn.setAuthToken(e),xn.deactivate(),An(Cn.getServiceUrl())}).catch(e=>{p.error(`SkillsReporter::Unable to retrieve auth token when attempting to reconnect web socket [${e}]`)})},onDisconnect:e=>{p.info(`Received disconnect event.  frame [${e}]`)}}),p.debug("SkillsClient::SkillsReporter::activating stompClient..."),xn.activate(),p.debug("SkillsClient::SkillsReporter::stompClient activated")}},In="skillTreeRetryQueue",Nn=6e4,Ln=function(){const e=JSON.parse(localStorage.getItem(In));localStorage.removeItem(In),null!==e&&e.forEach(e=>{p.info(`SkillsClient::SkillsReporter::retryErrors retrying skillId [${e.skillId}], timestamp [${e.timestamp}], retryAttempt [${e.retryAttempt}]`),this.reportSkill(e.skillId,e.timestamp,!0,e.retryAttempt)})},Un=(e,t,n,r,i)=>{const o=r?r.status:null;if(p.info(`SkillsClient::SkillsReporter::addToRetryQueue [${e}], timeReported [${t}], retryAttempt[${n}], status [${o}]`),r&&r.response){const e=JSON.parse(r.response);if(e&&"SkillNotFound"===e.errorCode)return void p.info("not adding to retry queue because the skillId does not exist.")}let s=JSON.parse(localStorage.getItem(In));if(null==s&&(s=[]),s.length<i){const r=null==t?Date.now():t;s.push({skillId:e,timestamp:r,retryAttempt:n}),localStorage.setItem(In,JSON.stringify(s))}else p.warn(`Max retry queue size has been reached (${i}), Unable to retry skillId [${e}]`)},jn=(e,t,n,r,i,o,s,a,c)=>{Cn.validate();const l=new XMLHttpRequest;l.open("POST",`${Cn.getServiceUrl()}/api/projects/${Cn.getProjectId()}/skills/${n}`),l.withCredentials=!0,Cn.isPKIMode()||l.setRequestHeader("Authorization",`Bearer ${Cn.getAuthToken()}`),l.onreadystatechange=()=>{4===l.readyState&&(200!==l.status?(o<=s?(401!==l.status&&0!==l.status||Cn.isPKIMode()||Cn.setAuthToken(null),Un(n,r,o,l,a)):p.warn(`Max retry attempts has been reached (${s}), Unable to retry skillId [${n}]`),l.response?t(JSON.parse(l.response)):t(new Error(`Error occurred reporting skill [${n}], status returned [${l.status}]`))):e(JSON.parse(l.response)))};const u=JSON.stringify({timestamp:r,notifyIfSkillNotApplied:c,isRetry:i});l.setRequestHeader("Content-Type","application/json;charset=UTF-8"),l.send(u),p.info(`SkillsClient::SkillsReporter::reporting skill request sent: ${u}`)},Pn={configure({notifyIfSkillNotApplied:e,retryInterval:t=6e4,maxRetryQueueSize:n=1e3,maxRetryAttempts:r=1440}){this.notifyIfSkillNotApplied=e,this.retryInterval=t,this.maxRetryQueueSize=n,this.maxRetryAttempts=r,Cn.isDisabled()?p.info("SkillsClient::SkillsReporter::configure: SkillsConfiguration is disabled. No reporting will occur"):(null!=t&&this.cancelRetryChecker(),p.info(`SkillsClient::SkillsReporter::Enabling retries. retryInterval [${this.retryInterval}]`),Rn=setInterval(()=>{Ln.call(this)},this.retryInterval||Nn))},addSuccessHandler(e){Cn.isDisabled()?p.info("SkillsClient::SkillsReporter::addSuccessHandler: SkillsConfiguration is disabled handler is not added"):(On.add(e),p.info(`SkillsClient::SkillsReporter::added success handler. successHandlerCache size [${On.size}]`))},addErrorHandler(e){Cn.isDisabled()?p.info("SkillsClient::SkillsReporter::addErrorHandler: SkillsConfiguration is disabled handler is not added"):(Tn.add(e),p.info(`SkillsClient::SkillsReporter::added error handler. errorHandlerCache size [${Tn.size}]`))},reportSkill(e,t=null,n=!1,r=void 0){if(Cn.isDisabled())return p.info(`SkillsClient::SkillsReporter::reportSkill: SkillsConfiguration is disabled. No reporting will occur for skillId=[${e}]`),Promise.resolve();p.info(`SkillsClient::SkillsReporter::reporting skill [${e}] retryAttempt [${r}]`),Cn.validate(),null==Rn&&(p.info(`SkillsClient::SkillsReporter::Enabling retries. retryInterval [${this.retryInterval}]`),Rn=setInterval(()=>{Ln.call(this)},this.retryInterval||Nn));let i=1;void 0!==r&&(i=r+1);const o=this.maxRetryAttempts||1440,s=this.maxRetryQueueSize||1e3,a=new Promise((r,a)=>{Cn.getAuthToken()||Cn.isPKIMode()?jn(r,a,e,t,n,i,o,s,this.notifyIfSkillNotApplied):yn.getAuthenticationToken(Cn.getAuthenticator(),Cn.getServiceUrl(),Cn.getProjectId()).then(c=>{Cn.setAuthToken(c),jn(r,a,e,t,n,i,o,s,this.notifyIfSkillNotApplied)}).catch(n=>{i<=o?Un(e,t,i,null,s):p.warn(`Max retry attempts has been reached (${this.maxRetryAttempts}), Unable to retry skillId [${e}]`),p.error(`SkillsReporter::Unable to retrieve auth token reporting skill [${e}]`),a(n)})});return a.catch(e=>{(e=>{console.error("Error reporting skill:",e),Tn.forEach(t=>t(e))})(e)}),a},getConf:()=>Cn,cancelRetryChecker(){null!=Rn&&(clearInterval(Rn),Rn=null)}};Cn.afterConfigure().then(()=>{An(Cn.getServiceUrl()),Rn||(p.info(`SkillsClient::SkillsReporter::Enabling retries. retryInterval [${Pn.retryInterval}]`),Rn=setInterval(()=>{Ln.call(Pn)},Pn.retryInterval||Nn))});
/**
	  postmate - A powerful, simple, promise-based postMessage library
	  @version v1.5.2
	  @link https://github.com/dollarshaveclub/postmate
	  @author Jacob Kelley <jakie8@gmail.com>
	  @license MIT
	**/
var Dn="application/x-postmate-v1+json",Bn=0,$n={handshake:1,"handshake-reply":1,call:1,emit:1,reply:1,request:1},Fn=function(e,t){return("string"!=typeof t||e.origin===t)&&(!!e.data&&(("object"!=typeof e.data||"postmate"in e.data)&&(e.data.type===Dn&&!!$n[e.data.postmate])))},Hn=function(){function e(e){var t=this;this.parent=e.parent,this.frame=e.frame,this.child=e.child,this.childOrigin=e.childOrigin,this.events={},this.listener=function(e){if(!Fn(e,t.childOrigin))return!1;var n=((e||{}).data||{}).value||{},r=n.data,i=n.name;"emit"===e.data.postmate&&i in t.events&&t.events[i].call(t,r)},this.parent.addEventListener("message",this.listener,!1)}var t=e.prototype;return t.get=function(e){var t=this;return new Wn.Promise(function(n){var r=++Bn;t.parent.addEventListener("message",function e(i){i.data.uid===r&&"reply"===i.data.postmate&&(t.parent.removeEventListener("message",e,!1),n(i.data.value))},!1),t.child.postMessage({postmate:"request",type:Dn,property:e,uid:r},t.childOrigin)})},t.call=function(e,t){this.child.postMessage({postmate:"call",type:Dn,property:e,data:t},this.childOrigin)},t.on=function(e,t){this.events[e]=t},t.destroy=function(){window.removeEventListener("message",this.listener,!1),this.frame.parentNode.removeChild(this.frame)},e}(),Mn=function(){function e(e){var t=this;this.model=e.model,this.parent=e.parent,this.parentOrigin=e.parentOrigin,this.child=e.child,this.child.addEventListener("message",function(e){if(Fn(e,t.parentOrigin)){var n=e.data,r=n.property,i=n.uid,o=n.data;"call"!==e.data.postmate?function(e,t){var n="function"==typeof e[t]?e[t]():e[t];return Wn.Promise.resolve(n)}(t.model,r).then(function(t){return e.source.postMessage({property:r,postmate:"reply",type:Dn,uid:i,value:t},e.origin)}):r in t.model&&"function"==typeof t.model[r]&&t.model[r](o)}})}return e.prototype.emit=function(e,t){this.parent.postMessage({postmate:"emit",type:Dn,value:{name:e,data:t}},this.parentOrigin)},e}(),Wn=function(){function e(e){var t=e.container,n=void 0===t?void 0!==n?n:document.body:t,r=e.model,i=e.url,o=e.name,s=e.classListArray,a=void 0===s?[]:s;return this.parent=window,this.frame=document.createElement("iframe"),this.frame.name=o||"",this.frame.classList.add.apply(this.frame.classList,a),n.appendChild(this.frame),this.child=this.frame.contentWindow||this.frame.contentDocument.parentWindow,this.model=r||{},this.sendHandshake(i)}return e.prototype.sendHandshake=function(t){var n,r=this,i=function(e){var t=document.createElement("a");t.href=e;var n=t.protocol.length>4?t.protocol:window.location.protocol,r=t.host.length?"80"===t.port||"443"===t.port?t.hostname:t.host:window.location.host;return t.origin||n+"//"+r}(t),o=0;return new e.Promise(function(e,s){r.parent.addEventListener("message",function t(o){return!!Fn(o,i)&&("handshake-reply"===o.data.postmate?(clearInterval(n),r.parent.removeEventListener("message",t,!1),r.childOrigin=o.origin,e(new Hn(r))):s("Failed handshake"))},!1);var a=function(){o++,r.child.postMessage({postmate:"handshake",type:Dn,model:r.model},i),5===o&&clearInterval(n)},c=function(){a(),n=setInterval(a,500)};r.frame.attachEvent?r.frame.attachEvent("onload",c):r.frame.onload=c,r.frame.src=t})},e}();Wn.debug=!1,Wn.Promise=function(){try{return window?window.Promise:Promise}catch(e){return null}}(),Wn.Model=function(){function e(e){return this.child=window,this.model=e,this.parent=this.child.parent,this.sendHandshakeReply()}return e.prototype.sendHandshakeReply=function(){var e=this;return new Wn.Promise(function(t,n){e.child.addEventListener("message",function r(i){if(i.data.postmate){if("handshake"===i.data.postmate){e.child.removeEventListener("message",r,!1),i.source.postMessage({postmate:"handshake-reply",type:Dn},i.origin),e.parentOrigin=i.origin;var o=i.data.model;return o&&Object.keys(o).forEach(function(t){e.model[t]=o[t]}),t(new Mn(e))}return n("Handshake Reply Failed")}},!1)})},e}();var qn={removeAllChildren(e){let t=e.lastElementChild;for(;t;)e.removeChild(t),t=e.lastElementChild;return e},buildErrorPage(){const e=(e,t,n,r)=>{const i=document.createElement(e);return t&&t.appendChild(i),n&&i.appendChild(document.createTextNode(n)),r&&i.setAttribute("style",r),i},t=e("div",void 0,void 0,"text-align: center; padding-top: 3rem; color: #3e3c3c;"),n=e("p",t);return e("span",n,"😕","font-size: 6rem; border: 1px solid #ccc !important; border-radius: 4px; padding: 1rem 4rem 1rem 4rem;"),e("p",t,"Could NOT reach Skilltree Service.","font-size: 2rem; color: #460f0f;"),e("div",t,"Please contact the skilltree server administrator. "),t}};let Vn,Jn=0;const zn="skillsClientDisplayPath",Gn=[];function Kn(e,t){return function(){return e.apply(t,arguments)}}const{toString:Xn}=Object.prototype,{getPrototypeOf:Qn}=Object,{iterator:Zn,toStringTag:Yn}=Symbol,er=(tr=Object.create(null),e=>{const t=Xn.call(e);return tr[t]||(tr[t]=t.slice(8,-1).toLowerCase())});var tr;const nr=e=>(e=e.toLowerCase(),t=>er(t)===e),rr=e=>t=>typeof t===e,{isArray:ir}=Array,or=rr("undefined");const sr=nr("ArrayBuffer");const ar=rr("string"),cr=rr("function"),lr=rr("number"),ur=e=>null!==e&&"object"==typeof e,hr=e=>{if("object"!==er(e))return!1;const t=Qn(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Yn in e||Zn in e)},dr=nr("Date"),pr=nr("File"),fr=nr("Blob"),mr=nr("FileList"),gr=nr("URLSearchParams"),[yr,br,vr,wr]=["ReadableStream","Request","Response","Headers"].map(nr);function Sr(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),ir(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let s;for(r=0;r<o;r++)s=i[r],t.call(null,e[s],s,e)}}function _r(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const kr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Er=e=>!or(e)&&e!==kr;const Cr=(Or="undefined"!=typeof Uint8Array&&Qn(Uint8Array),e=>Or&&e instanceof Or);var Or;const Tr=nr("HTMLFormElement"),Rr=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),xr=nr("RegExp"),Ar=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Sr(n,(n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)}),Object.defineProperties(e,r)};const Ir=nr("AsyncFunction"),Nr=(Lr="function"==typeof setImmediate,Ur=cr(kr.postMessage),Lr?setImmediate:Ur?(jr=`axios@${Math.random()}`,Pr=[],kr.addEventListener("message",({source:e,data:t})=>{e===kr&&t===jr&&Pr.length&&Pr.shift()()},!1),e=>{Pr.push(e),kr.postMessage(jr,"*")}):e=>setTimeout(e));var Lr,Ur,jr,Pr;const Dr="undefined"!=typeof queueMicrotask?queueMicrotask.bind(kr):"undefined"!=typeof process&&process.nextTick||Nr;var Br={isArray:ir,isArrayBuffer:sr,isBuffer:function(e){return null!==e&&!or(e)&&null!==e.constructor&&!or(e.constructor)&&cr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||cr(e.append)&&("formdata"===(t=er(e))||"object"===t&&cr(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&sr(e.buffer),t},isString:ar,isNumber:lr,isBoolean:e=>!0===e||!1===e,isObject:ur,isPlainObject:hr,isReadableStream:yr,isRequest:br,isResponse:vr,isHeaders:wr,isUndefined:or,isDate:dr,isFile:pr,isBlob:fr,isRegExp:xr,isFunction:cr,isStream:e=>ur(e)&&cr(e.pipe),isURLSearchParams:gr,isTypedArray:Cr,isFileList:mr,forEach:Sr,merge:function e(){const{caseless:t}=Er(this)&&this||{},n={},r=(r,i)=>{const o=t&&_r(n,i)||i;hr(n[o])&&hr(r)?n[o]=e(n[o],r):hr(r)?n[o]=e({},r):ir(r)?n[o]=r.slice():n[o]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Sr(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(Sr(t,(t,r)=>{n&&cr(t)?e[r]=Kn(t,n):e[r]=t},{allOwnKeys:r}),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,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&Qn(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:er,kindOfTest:nr,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(ir(e))return e;let t=e.length;if(!lr(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Zn]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Tr,hasOwnProperty:Rr,hasOwnProp:Rr,reduceDescriptors:Ar,freezeMethods:e=>{Ar(e,(t,n)=>{if(cr(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];cr(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return ir(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:_r,global:kr,isContextDefined:Er,isSpecCompliantForm:function(e){return!!(e&&cr(e.append)&&"FormData"===e[Yn]&&e[Zn])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(ur(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=ir(e)?[]:{};return Sr(e,(e,t)=>{const o=n(e,r+1);!or(o)&&(i[t]=o)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:Ir,isThenable:e=>e&&(ur(e)||cr(e))&&cr(e.then)&&cr(e.catch),setImmediate:Nr,asap:Dr,isIterable:e=>null!=e&&cr(e[Zn])};function $r(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Br.inherits($r,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:Br.toJSONObject(this.config),code:this.code,status:this.status}}});const Fr=$r.prototype,Hr={};["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=>{Hr[e]={value:e}}),Object.defineProperties($r,Hr),Object.defineProperty(Fr,"isAxiosError",{value:!0}),$r.from=(e,t,n,r,i,o)=>{const s=Object.create(Fr);return Br.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),$r.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};function Mr(e){return Br.isPlainObject(e)||Br.isArray(e)}function Wr(e){return Br.endsWith(e,"[]")?e.slice(0,-2):e}function qr(e,t,n){return e?e.concat(t).map(function(e,t){return e=Wr(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Vr=Br.toFlatObject(Br,{},null,function(e){return/^is[A-Z]/.test(e)});function Jr(e,t,n){if(!Br.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Br.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Br.isUndefined(t[e])})).metaTokens,i=n.visitor||l,o=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Br.isSpecCompliantForm(t);if(!Br.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Br.isDate(e))return e.toISOString();if(Br.isBoolean(e))return e.toString();if(!a&&Br.isBlob(e))throw new $r("Blob is not supported. Use a Buffer instead.");return Br.isArrayBuffer(e)||Br.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,i){let a=e;if(e&&!i&&"object"==typeof e)if(Br.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Br.isArray(e)&&function(e){return Br.isArray(e)&&!e.some(Mr)}(e)||(Br.isFileList(e)||Br.endsWith(n,"[]"))&&(a=Br.toArray(e)))return n=Wr(n),a.forEach(function(e,r){!Br.isUndefined(e)&&null!==e&&t.append(!0===s?qr([n],r,o):null===s?n:n+"[]",c(e))}),!1;return!!Mr(e)||(t.append(qr(i,n,o),c(e)),!1)}const u=[],h=Object.assign(Vr,{defaultVisitor:l,convertValue:c,isVisitable:Mr});if(!Br.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Br.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Br.forEach(n,function(n,o){!0===(!(Br.isUndefined(n)||null===n)&&i.call(t,n,Br.isString(o)?o.trim():o,r,h))&&e(n,r?r.concat(o):[o])}),u.pop()}}(e),t}function zr(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Gr(e,t){this._pairs=[],e&&Jr(e,this,t)}const Kr=Gr.prototype;function Xr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Qr(e,t,n){if(!t)return e;const r=n&&n.encode||Xr;Br.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(o=i?i(t,n):Br.isURLSearchParams(t)?t.toString():new Gr(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}Kr.append=function(e,t){this._pairs.push([e,t])},Kr.toString=function(e){const t=e?function(t){return e.call(this,t,zr)}:zr;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class Zr{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Br.forEach(this.handlers,function(t){null!==t&&e(t)})}}var Yr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ei={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Gr,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ti="undefined"!=typeof window&&"undefined"!=typeof document,ni="object"==typeof navigator&&navigator||void 0,ri=ti&&(!ni||["ReactNative","NativeScript","NS"].indexOf(ni.product)<0),ii="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,oi=ti&&window.location.href||"http://localhost";var si={...Object.freeze({__proto__:null,hasBrowserEnv:ti,hasStandardBrowserEnv:ri,hasStandardBrowserWebWorkerEnv:ii,navigator:ni,origin:oi}),...ei};function ai(e){function t(e,n,r,i){let o=e[i++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),a=i>=e.length;if(o=!o&&Br.isArray(r)?r.length:o,a)return Br.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!s;r[o]&&Br.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],i)&&Br.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}(r[o])),!s}if(Br.isFormData(e)&&Br.isFunction(e.entries)){const n={};return Br.forEachEntry(e,(e,r)=>{t(function(e){return Br.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const ci={transitional:Yr,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=Br.isObject(e);i&&Br.isHTMLForm(e)&&(e=new FormData(e));if(Br.isFormData(e))return r?JSON.stringify(ai(e)):e;if(Br.isArrayBuffer(e)||Br.isBuffer(e)||Br.isStream(e)||Br.isFile(e)||Br.isBlob(e)||Br.isReadableStream(e))return e;if(Br.isArrayBufferView(e))return e.buffer;if(Br.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Jr(e,new si.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return si.isNode&&Br.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=Br.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Jr(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(Br.isString(e))try{return(t||JSON.parse)(e),Br.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ci.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Br.isResponse(e)||Br.isReadableStream(e))return e;if(e&&Br.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw $r.from(e,$r.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:si.classes.FormData,Blob:si.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Br.forEach(["delete","get","head","post","put","patch"],e=>{ci.headers[e]={}});const li=Br.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"]);const ui=Symbol("internals");function hi(e){return e&&String(e).trim().toLowerCase()}function di(e){return!1===e||null==e?e:Br.isArray(e)?e.map(di):String(e)}function pi(e,t,n,r,i){return Br.isFunction(r)?r.call(this,t,n):(i&&(t=n),Br.isString(t)?Br.isString(r)?-1!==t.indexOf(r):Br.isRegExp(r)?r.test(t):void 0:void 0)}let fi=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=hi(t);if(!i)throw new Error("header name must be a non-empty string");const o=Br.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=di(e))}const o=(e,t)=>Br.forEach(e,(e,n)=>i(e,n,t));if(Br.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Br.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&li[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(Br.isObject(e)&&Br.isIterable(e)){let n,r,i={};for(const t of e){if(!Br.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?Br.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=hi(e)){const n=Br.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Br.isFunction(t))return t.call(this,e,n);if(Br.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=hi(e)){const n=Br.findKey(this,e);return!(!n||void 0===this[n]||t&&!pi(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=hi(e)){const i=Br.findKey(n,e);!i||t&&!pi(0,n[i],i,t)||(delete n[i],r=!0)}}return Br.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!pi(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return Br.forEach(this,(r,i)=>{const o=Br.findKey(n,i);if(o)return t[o]=di(r),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();s!==i&&delete t[i],t[s]=di(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Br.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Br.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[ui]=this[ui]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=hi(e);t[r]||(!function(e,t){const n=Br.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return Br.isArray(e)?e.forEach(r):r(e),this}};function mi(e,t){const n=this||ci,r=t||n,i=fi.from(r.headers);let o=r.data;return Br.forEach(e,function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function gi(e){return!(!e||!e.__CANCEL__)}function yi(e,t,n){$r.call(this,null==e?"canceled":e,$r.ERR_CANCELED,t,n),this.name="CanceledError"}function bi(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new $r("Request failed with status code "+n.status,[$r.ERR_BAD_REQUEST,$r.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}fi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Br.reduceDescriptors(fi.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Br.freezeMethods(fi),Br.inherits(yi,$r,{__CANCEL__:!0});const vi=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[s];i||(i=c),n[o]=a,r[o]=c;let u=s,h=0;for(;u!==o;)h+=n[u++],u%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i<t)return;const d=l&&c-l;return d?Math.round(1e3*h/d):void 0}}(50,250);return function(e,t){let n,r,i=0,o=1e3/t;const s=(t,o=Date.now())=>{i=o,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),a=t-i;a>=o?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},o-a)))},()=>n&&s(n)]}(n=>{const o=n.loaded,s=n.lengthComputable?n.total:void 0,a=o-r,c=i(a);r=o;e({loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&o<=s?(s-o)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},wi=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Si=e=>(...t)=>Br.asap(()=>e(...t));var _i=si.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,si.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(si.origin),si.navigator&&/(msie|trident)/i.test(si.navigator.userAgent)):()=>!0,ki=si.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const s=[e+"="+encodeURIComponent(t)];Br.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),Br.isString(r)&&s.push("path="+r),Br.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Ei(e,t,n){let r=!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ci=e=>e instanceof fi?{...e}:e;function Oi(e,t){t=t||{};const n={};function r(e,t,n,r){return Br.isPlainObject(e)&&Br.isPlainObject(t)?Br.merge.call({caseless:r},e,t):Br.isPlainObject(t)?Br.merge({},t):Br.isArray(t)?t.slice():t}function i(e,t,n,i){return Br.isUndefined(t)?Br.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function o(e,t){if(!Br.isUndefined(t))return r(void 0,t)}function s(e,t){return Br.isUndefined(t)?Br.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>i(Ci(e),Ci(t),0,!0)};return Br.forEach(Object.keys(Object.assign({},e,t)),function(r){const o=c[r]||i,s=o(e[r],t[r],r);Br.isUndefined(s)&&o!==a||(n[r]=s)}),n}var Ti=e=>{const t=Oi({},e);let n,{data:r,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:s,headers:a,auth:c}=t;if(t.headers=a=fi.from(a),t.url=Qr(Ei(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Br.isFormData(r))if(si.hasStandardBrowserEnv||si.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map(e=>e.trim()).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(si.hasStandardBrowserEnv&&(i&&Br.isFunction(i)&&(i=i(t)),i||!1!==i&&_i(t.url))){const e=o&&s&&ki.read(s);e&&a.set(o,e)}return t};var Ri="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Ti(e);let i=r.data;const o=fi.from(r.headers).normalize();let s,a,c,l,u,{responseType:h,onUploadProgress:d,onDownloadProgress:p}=r;function f(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=fi.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());bi(function(e){t(e),f()},function(e){n(e),f()},{data:h&&"text"!==h&&"json"!==h?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new $r("Request aborted",$r.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new $r("Network Error",$r.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||Yr;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new $r(t,i.clarifyTimeoutError?$r.ETIMEDOUT:$r.ECONNABORTED,e,m)),m=null},void 0===i&&o.setContentType(null),"setRequestHeader"in m&&Br.forEach(o.toJSON(),function(e,t){m.setRequestHeader(t,e)}),Br.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),h&&"json"!==h&&(m.responseType=r.responseType),p&&([c,u]=vi(p,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=vi(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(s=t=>{m&&(n(!t||t.type?new yi(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===si.protocols.indexOf(y)?n(new $r("Unsupported protocol "+y+":",$r.ERR_BAD_REQUEST,e)):m.send(i||null)})};const xi=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof $r?t:new yi(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,i(new $r(`timeout ${t} of ms exceeded`,$r.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:a}=r;return a.unsubscribe=()=>Br.asap(s),a}},Ai=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},Ii=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Ni=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of Ii(e))yield*Ai(n,t)}(e,t);let o,s=0,a=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return a(),void e.close();let o=r.byteLength;if(n){let e=s+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),i.return())},{highWaterMark:2})},Li="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Ui=Li&&"function"==typeof ReadableStream,ji=Li&&("function"==typeof TextEncoder?(Pi=new TextEncoder,e=>Pi.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Pi;const Di=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Bi=Ui&&Di(()=>{let e=!1;const t=new Request(si.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),$i=Ui&&Di(()=>Br.isReadableStream(new Response("").body)),Fi={stream:$i&&(e=>e.body)};var Hi;Li&&(Hi=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Fi[e]&&(Fi[e]=Br.isFunction(Hi[e])?t=>t[e]():(t,n)=>{throw new $r(`Response type '${e}' is not supported`,$r.ERR_NOT_SUPPORT,n)})}));const Mi=async(e,t)=>{const n=Br.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Br.isBlob(e))return e.size;if(Br.isSpecCompliantForm(e)){const t=new Request(si.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Br.isArrayBufferView(e)||Br.isArrayBuffer(e)?e.byteLength:(Br.isURLSearchParams(e)&&(e+=""),Br.isString(e)?(await ji(e)).byteLength:void 0)})(t):n};var Wi=Li&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:h="same-origin",fetchOptions:d}=Ti(e);l=l?(l+"").toLowerCase():"text";let p,f=xi([i,o&&o.toAbortSignal()],s);const m=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let g;try{if(c&&Bi&&"get"!==n&&"head"!==n&&0!==(g=await Mi(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(Br.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=wi(g,vi(Si(c)));r=Ni(n.body,65536,e,t)}}Br.isString(h)||(h=h?"include":"omit");const i="credentials"in Request.prototype;p=new Request(t,{...d,signal:f,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:i?h:void 0});let o=await fetch(p,d);const s=$i&&("stream"===l||"response"===l);if($i&&(a||s&&m)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=o[t]});const t=Br.toFiniteNumber(o.headers.get("content-length")),[n,r]=a&&wi(t,vi(Si(a),!0))||[];o=new Response(Ni(o.body,65536,n,()=>{r&&r(),m&&m()}),e)}l=l||"text";let y=await Fi[Br.findKey(Fi,l)||"text"](o,e);return!s&&m&&m(),await new Promise((t,n)=>{bi(t,n,{data:y,headers:fi.from(o.headers),status:o.status,statusText:o.statusText,config:e,request:p})})}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new $r("Network Error",$r.ERR_NETWORK,e,p),{cause:t.cause||t});throw $r.from(t,t&&t.code,e,p)}});const qi={http:null,xhr:Ri,fetch:Wi};Br.forEach(qi,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Vi=e=>`- ${e}`,Ji=e=>Br.isFunction(e)||null===e||!1===e;var zi=e=>{e=Br.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o<t;o++){let t;if(n=e[o],r=n,!Ji(n)&&(r=qi[(t=String(n)).toLowerCase()],void 0===r))throw new $r(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+o]=r}if(!r){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new $r("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Vi).join("\n"):" "+Vi(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Gi(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yi(null,e)}function Ki(e){Gi(e),e.headers=fi.from(e.headers),e.data=mi.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return zi(e.adapter||ci.adapter)(e).then(function(t){return Gi(e),t.data=mi.call(e,e.transformResponse,t),t.headers=fi.from(t.headers),t},function(t){return gi(t)||(Gi(e),t&&t.response&&(t.response.data=mi.call(e,e.transformResponse,t.response),t.response.headers=fi.from(t.response.headers))),Promise.reject(t)})}const Xi="1.10.0",Qi={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Qi[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Zi={};Qi.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Xi+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new $r(r(i," has been removed"+(t?" in "+t:"")),$r.ERR_DEPRECATED);return t&&!Zi[i]&&(Zi[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},Qi.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Yi={assertOptions:function(e,t,n){if("object"!=typeof e)throw new $r("options must be an object",$r.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new $r("option "+o+" must be "+n,$r.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new $r("Unknown option "+o,$r.ERR_BAD_OPTION)}},validators:Qi};const eo=Yi.validators;let to=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Zr,response:new Zr}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Oi(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Yi.assertOptions(n,{silentJSONParsing:eo.transitional(eo.boolean),forcedJSONParsing:eo.transitional(eo.boolean),clarifyTimeoutError:eo.transitional(eo.boolean)},!1),null!=r&&(Br.isFunction(r)?t.paramsSerializer={serialize:r}:Yi.assertOptions(r,{encode:eo.function,serialize:eo.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Yi.assertOptions(t,{baseUrl:eo.spelling("baseURL"),withXsrfToken:eo.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&Br.merge(i.common,i[t.method]);i&&Br.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=fi.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,h=0;if(!a){const e=[Ki.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);h<u;)l=l.then(e[h++],e[h++]);return l}u=s.length;let d=t;for(h=0;h<u;){const e=s[h++],t=s[h++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=Ki.call(this,d)}catch(e){return Promise.reject(e)}for(h=0,u=c.length;h<u;)l=l.then(c[h++],c[h++]);return l}getUri(e){return Qr(Ei((e=Oi(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Br.forEach(["delete","get","head","options"],function(e){to.prototype[e]=function(t,n){return this.request(Oi(n||{},{method:e,url:t,data:(n||{}).data}))}}),Br.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,i){return this.request(Oi(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}to.prototype[e]=t(),to.prototype[e+"Form"]=t(!0)});const no={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(no).forEach(([e,t])=>{no[t]=e});const ro=function e(t){const n=new to(t),r=Kn(to.prototype.request,n);return Br.extend(r,to.prototype,n,{allOwnKeys:!0}),Br.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Oi(t,n))},r}(ci);ro.Axios=to,ro.CanceledError=yi,ro.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new yi(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},ro.isCancel=gi,ro.VERSION=Xi,ro.toFormData=Jr,ro.AxiosError=$r,ro.Cancel=ro.CanceledError,ro.all=function(e){return Promise.all(e)},ro.spread=function(e){return function(t){return e.apply(null,t)}},ro.isAxiosError=function(e){return Br.isObject(e)&&!0===e.isAxiosError},ro.mergeConfig=Oi,ro.AxiosHeaders=fi,ro.formToJSON=e=>ai(Br.isHTMLForm(e)?new FormData(e):e),ro.getAdapter=zi,ro.HttpStatusCode=no,ro.default=ro;const{Axios:io,AxiosError:oo,CanceledError:so,isCancel:ao,CancelToken:co,VERSION:lo,all:uo,Cancel:ho,isAxiosError:po,spread:fo,toFormData:mo,AxiosHeaders:go,HttpStatusCode:yo,formToJSON:bo,getAdapter:vo,mergeConfig:wo}=ro;e.FAILURE_EVENT="skills-report-error",e.Logger=p,e.SUCCESS_EVENT="skills-report-success",e.SkillsConfiguration=Cn,e.SkillsDisplayJS=class{constructor({options:e,theme:t,version:n,handleRouteChanged:r,userId:i}={}){p.debug(`SkillsClient::SkillsDisplayJS::Constructing with options [${e}], theme [${t}], version [${n}], userId [${i}]`),this._options={...e},this._theme=t,this._version=n,this._handleRouteChanged=r,this._userId=i}currentIframeId(){return Jn}navigate(e=this.skillsDisplayPath,t=!0,n=!0){this._childFrame&&null!=e&&this._childFrame.call("navigate",{path:e,replace:n,query:{skipParentHistory:t}})}attachTo(e){if(Cn.isDisabled())return void p.info("SkillsClient::SkillsDisplayJS::attachTo: SkillsConfiguration is disabled Skills Display will not be initialized");p.info(`SkillsClient::SkillsDisplayJS::attaching to [${e?e.toString():e}]`);let t=e;if("string"==typeof e&&(t=document.querySelector(e),p.debug(`SkillsClient::SkillsDisplayJS::document.querySelector returned [${t?t.toString():t}]`)),!t)throw new Error(`Can't find element with selector='${e?e.toString():e}'`);Jn+=1;const n=`client-display-iframe-${Jn}`,r=this.options.isSummaryOnly?600:960,i=new Wn({container:t,url:`${this.configuration.serviceUrl}/static/clientPortal/index.html`,classListArray:[n],model:{serviceUrl:this.configuration.serviceUrl,projectId:this.configuration.projectId,version:this.version,userId:"pki"===this.configuration.authenticator?this.userId:null,theme:this.theme,options:this.options,minHeight:`${r}px`,isSummaryOnly:this.options.isSummaryOnly,internalBackButton:null!=this.options.internalBackButton&&this.options.internalBackButton}}),o=document.querySelector(`.${n}`);o.setAttribute("style","border: 0; height: 100%; width: 100%"),o.setAttribute("aria-label","SkillTree Skills Display"),t.height=0,t.style.height="0px",Vn=()=>{this.navigate(this.skillsDisplayPath||"/",!0)},window.addEventListener("popstate",Vn),window.addEventListener("hashchange",Vn),i.then(e=>{const n=e.frame.className,i=Gn.indexOf(n);if(i>-1)return p.info(`SkillsClient::SkillsDisplayJS::handshake: child frame [${n}] already marked for destruction, not initializing.`),void(e&&(e.destroy(),Gn.splice(i,1)));this._childFrame=e,e.on("height-changed",e=>{p.debug(`SkillsClient::SkillsDisplayJS::height-changed: data [${e}]`);const n=Math.max(e,r);t.height=n,t.style.height=`${n}px`}),e.on("do-scroll",e=>{let t=0;this.options.scrollTopOffset&&(t=this.options.scrollTopOffset);const n=Math.max(o.getBoundingClientRect().top,0),r=e,i=n+r-t;p.debug(`do-scroll fromTopToIframe=[${n}], withinIframe=[${r}], additionalOffset=[${t}], toScroll=[${i}]`),window.scroll({top:i,behavior:"smooth"})}),e.on("route-changed",e=>{const n=e?e.path:null;if(p.debug(`SkillsClient::SkillsDisplayJS::route-changed - newPath [${n}]`),null!=n){const t=n.endsWith("index.html")?"/":n;if(this._shouldUpdateHistory(e)){const e=new URLSearchParams(window.location.search);e.set(zn,t);const r=`${window.location.pathname}?${e.toString()}${window.location.hash}`;window.history.pushState({skillsClientDisplayPath:n},"",r)}this._handleRouteChanged&&this._handleRouteChanged(t)}if(!this.options.disableAutoScroll){let e=t;if("top-offset"===this.options.autoScrollStrategy){let t=0;this.options.scrollTopOffset&&(t=this.options.scrollTopOffset);const n=e.offsetTop-t;window.scroll({top:n,behavior:"smooth"})}else"top-of-page"===this.options.autoScrollStrategy&&(e=document.querySelector("body")),e.scrollIntoView({behavior:"smooth"})}}),e.on("needs-authentication",()=>{p.debug("SkillsClient::SkillsDisplayJS::needs-authentication");const t="pki"===this.configuration.authenticator;this.authenticationPromise||t?t&&(e.call("updateAuthenticationToken","pki"),this.navigate()):this.authenticationPromise=yn.getAuthenticationToken(this.configuration.authenticator,this.configuration.serviceUrl,this.configuration.projectId).then(t=>{e.call("updateAuthenticationToken",t),this.navigate()}).finally(()=>{this.authenticationPromise=null})})}),p.debug("SkillsClient::SkillsDisplayJS::calling _checkAndHandleServiceStatus"),this._checkAndHandleServiceStatus(t)}_checkAndHandleServiceStatus(e){this.status=Cn.getServiceStatus(),this.status||(p.info("SkillsClient::SkillsDisplayJS::SkillsConfiguration.configure() was not called, checking status endpoint."),yn.getServiceStatus(`${this.configuration.serviceUrl}/public/status`).then(e=>{this.status=e.status,yn.configureLogging(this,e)}).catch(t=>{let n="Please ensure the skilltree server is running";this.configuration.serviceUrl&&this.configuration.serviceUrl.startsWith("https")&&(n+=" and that your browser trusts the server's certificate"),n+=`. skilltree service URL: ${this.configuration.serviceUrl}`,console.error(n),p.error(`SkillsClient::SkillsDisplayJS::${n}`,t),qn.removeAllChildren(e),e.appendChild(qn.buildErrorPage()),e.setAttribute("style","border: 5px; height: 20rem; width: 100%")}))}_shouldUpdateHistory(e){const t="true"!==e.query.skipParentHistory&&!0!==e.query.skipParentHistory;return(null==this.options.updateHistory||!0===this.options.updateHistory)&&t}set version(e){p.info(`SkillsClient::SkillsDisplayJS::setting version [${e}]`),this._version=e,this._childFrame.call("updateVersion",e)}get options(){return this._options}get theme(){return this._theme}get version(){return this._version}get userId(){return this._userId}get configuration(){return{serviceUrl:this._options.serviceUrl?this._options.serviceUrl:Cn.getServiceUrl(),authenticator:this._options.authenticator?this._options.authenticator:Cn.getAuthenticator(),projectId:this._options.projectId?this._options.projectId:Cn.getProjectId()}}get skillsDisplayPath(){return new URLSearchParams(window.location.search).get(zn)}destroy(){if(p.info(`SkillsClient::SkillsDisplayJS::destroy called. _childFrame [${this._childFrame}]`),this._childFrame)this._childFrame.destroy();else{const e=`client-display-iframe-${Jn}`;p.info(`SkillsClient::SkillsDisplayJS::destroy child frame [${e}] not yet initialized, marking for future destruction`),Gn.push(e)}new URLSearchParams(window.location.search).delete(zn),window.removeEventListener("popstate",Vn),window.removeEventListener("hashchange",Vn)}},e.SkillsLevelJS=class{constructor(e){if(!Cn.wasConfigureCalled()){const e="SkillsConfiguration.configure must be called before invoking SkillsLevelJS constructor.";throw p.error(`SkillsClient::SkillsLevelJS::${e}`),new Error(e)}this._projectId=e}attachTo(e){if(Cn.isDisabled())return void p.info("SkillsLevelJS.js::attachTo: SkillsConfiguration is disabled Level will not be initialized");p.info(`SkillsClient::SkillsLevelJS::attaching to [${e}]`);let t=e;if("string"==typeof e&&(t=document.querySelector(e),p.debug(`SkillsClient::SkillsLevelJS::document.querySelector returned [${t}]`)),!t)throw new Error(`Can't find element with selector='${e}'`);this._skillLevelElement=t,Cn.afterConfigure().then(()=>{this._projectId||(this._projectId=Cn.getProjectId(),p.debug(`SkillsClient::SkillsLevelJS::getting projectId from SkillsConfiguration: [${this._projectId}]`));const e={withCredentials:!0};if(!Cn.isPKIMode()){const t=Cn.getAuthToken();e.headers={Authorization:`Bearer ${t}`}}ro.get(`${Cn.getServiceUrl()}/api/projects/${this._projectId}/level`,e).then(e=>{this.setSkillLevel(e.data),Pn.addSuccessHandler(this.update.bind(this)),p.info(`SkillsClient::SkillsLevelJS::received initial skill level [${e.data}]`)})})}update(e){const t=e.completed||[];this._skillLevel=t.filter(e=>"OVERALL"===e.id).reduce((e,t)=>{const n=t.level;return e<n?n:e},this._skillLevel),this.setSkillLevel(this._skillLevel),p.info(`SkillsClient::SkillsLevelJS::updated skill level [${this._skillLevel}]`)}setSkillLevel(e){this._skillLevel=e,this._skillLevelElement.innerText=`Level ${e}`}get projectId(){return this._projectId}get skillLevel(){return this._skillLevel}},e.SkillsReporter=Pn});
//# sourceMappingURL=skills-client-js.umd.min.js.map
