From 63aa33dbd76227e8e05088107c9d7e1898e4db19 Mon Sep 17 00:00:00 2001 From: Rafal Janicki Date: Tue, 27 Feb 2024 07:34:45 +0100 Subject: [PATCH] Added CI/CD --- .github/workflows/deploy.yml | 45 ++++++++++++++++++++++++++++++++++++ .gitignore | 4 +++- dist/app.js | 1 - dist/license.js | 1 - package.json | 2 +- 5 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/deploy.yml delete mode 100644 dist/app.js delete mode 100644 dist/license.js diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..1c8ae92 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,45 @@ +name: Publish frontend + +on: + push: + branches: + - develop + - master + +env: + NODE_VERSION: 16.x + +jobs: + build: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + + steps: + - uses: actions/checkout@v4 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ vars.GH_OIDC_ROLE_ARN }} + aws-region: ${{ vars.AWS_REGION }} + + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Install Node requirements + run: npm i + + - name: Install Python requirements + run: pip install -r requirements.txt + + - name: Build and publish + env: + PUBLISH_DOCS_USERNAME: ${{ vars.PUBLISH_DOCS_USERNAME }} + PUBLISH_DOCS_PASSWORD: ${{ secrets.PUBLISH_DOCS_PASSWORD }} + run: | + SIMPLE_REF=$(echo ${GITHUB_REF#refs/heads/} | tr / -) + npm run publish-${SIMPLE_REF} diff --git a/.gitignore b/.gitignore index 98599df..96f2982 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -*node_modules \ No newline at end of file +*node_modules +.idea +dist/ \ No newline at end of file diff --git a/dist/app.js b/dist/app.js deleted file mode 100644 index 78ca3fe..0000000 --- a/dist/app.js +++ /dev/null @@ -1 +0,0 @@ -!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(t,e,n){"use strict";(function(t,r){n.d(e,"a",(function(){return Ue}));var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var s=o((function(t){var e,n;e=i,n=function(){function t(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var n=t.shift();t[0]=n+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r0&&(i=i.replace(/^[\/]+/,"")),i=r0?"?":"")+s.join("&")}return function(){return t("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=n():e.urljoin=n()})),a=Object.prototype.hasOwnProperty,u=Array.isArray,c=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),p=function(t,e){for(var n=e&&e.plainObjects?Object.create(null):{},r=0;r1;){var e=t.pop(),n=e.obj[e.prop];if(u(n)){for(var r=[],i=0;i=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122?i+=r.charAt(o):s<128?i+=c[s]:s<2048?i+=c[192|s>>6]+c[128|63&s]:s<55296||s>=57344?i+=c[224|s>>12]+c[128|s>>6&63]+c[128|63&s]:(o+=1,s=65536+((1023&s)<<10|1023&r.charCodeAt(o)),i+=c[240|s>>18]+c[128|s>>12&63]+c[128|s>>6&63]+c[128|63&s])}return i},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(u(t)){for(var n=[],r=0;r-1?t.split(","):t},j=function(t,e,n,r){if(t){var i=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,s=n.depth>0&&/(\[[^[\]]*])/.exec(i),a=s?i.slice(0,s.index):i,u=[];if(a){if(!n.plainObjects&&S.call(Object.prototype,a)&&!n.allowPrototypes)return;u.push(a)}for(var c=0;n.depth>0&&null!==(s=o.exec(i))&&c=0;--o){var s,a=t[o];if("[]"===a&&n.parseArrays)s=[].concat(i);else{s=n.plainObjects?Object.create(null):{};var u="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,c=parseInt(u,10);n.parseArrays||""!==u?!isNaN(c)&&a!==u&&String(c)===u&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(s=[])[c]=i:s[u]=i:s={0:i}}i=s}return i}(u,e,n,r)}},E=function(t,e){var n,r=t,i=function(t){if(!t)return O;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||O.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=m.default;if(void 0!==t.format){if(!y.call(m.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var r=m.formatters[n],i=O.filter;return("function"==typeof t.filter||v(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:O.addQueryPrefix,allowDots:void 0===t.allowDots?O.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:O.charsetSentinel,delimiter:void 0===t.delimiter?O.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:O.encode,encoder:"function"==typeof t.encoder?t.encoder:O.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:O.encodeValuesOnly,filter:i,formatter:r,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:O.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:O.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:O.strictNullHandling}}(e);"function"==typeof i.filter?r=(0,i.filter)("",r):v(i.filter)&&(n=i.filter);var o,s=[];if("object"!=typeof r||null===r)return"";o=e&&e.arrayFormat in g?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var a=g[o];n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var u=0;u0?l+p:""},I=o((function(t){function e(t){if(t)return function(t){for(var n in e.prototype)t[n]=e.prototype[n];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;ie?1:0}function L(t,e,n){var r,i=function t(e,n,r,i){var o;if("object"==typeof e&&null!==e){for(o=0;o0)for(var r=0;r=this._maxRetries)return!1;if(this._retryCallback)try{var n=this._retryCallback(t,e);if(!0===n)return!0;if(!1===n)return!1}catch(t){console.error(t)}if(e&&e.status&&e.status>=500&&501!==e.status)return!0;if(t){if(t.code&&W.includes(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},F.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},F.prototype.then=function(t,e){var n=this;if(!this._fullfilledPromise){var r=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(t,e){r.on("abort",(function(){if(!(n._maxRetries&&n._maxRetries>n._retries))if(n.timedout&&n.timedoutError)e(n.timedoutError);else{var t=new Error("Aborted");t.code="ABORTED",t.status=n.status,t.method=n.method,t.url=n.url,e(t)}})),r.end((function(n,r){n?e(n):t(r)}))}))}return this._fullfilledPromise.then(t,e)},F.prototype.catch=function(t){return this.then(void 0,t)},F.prototype.use=function(t){return t(this),this},F.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},F.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},F.prototype.get=function(t){return this._header[t.toLowerCase()]},F.prototype.getHeader=F.prototype.get,F.prototype.set=function(t,e){if(H(t)){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&this.set(n,t[n]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},F.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},F.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(H(t)){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&this.field(n,t[n]);return this}if(Array.isArray(e)){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.field(t,e[r]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=String(e)),this._getFormData().append(t,e),this},F.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},F.prototype._auth=function(t,e,n,r){switch(n.type){case"basic":this.set("Authorization","Basic ".concat(r("".concat(t,":").concat(e))));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(t))}return this},F.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},F.prototype.redirects=function(t){return this._maxRedirects=t,this},F.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},F.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},F.prototype.send=function(t){var e=H(t),n=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&H(this._data))for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this._data[r]=t[r]);else"string"==typeof t?(n||this.type("form"),n=this._header["content-type"],this._data="application/x-www-form-urlencoded"===n?this._data?"".concat(this._data,"&").concat(t):t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||n||this.type("json"),this},F.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},F.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.includes("?")?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var n=this.url.slice(e+1).split("&");"function"==typeof this._sort?n.sort(this._sort):n.sort(),this.url=this.url.slice(0,e)+"?"+n.join("&")}}},F.prototype._appendQueryString=function(){console.warn("Unsupported")},F.prototype._timeoutError=function(t,e,n){if(!this._aborted){var r=new Error("".concat(t+e,"ms exceeded"));r.timeout=e,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.timedoutError=r,this.abort(),this.callback(r)}},F.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))};var V=J;function J(t){if(t)return function(t){for(var e in J.prototype)Object.prototype.hasOwnProperty.call(J.prototype,e)&&(t[e]=J.prototype[e]);return t}(t)}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0||t instanceof Object)?e(t):null)},l.prototype.toError=function(){var t=this.req,e=t.method,n=t.url,r="cannot ".concat(e," ").concat(n," (").concat(this.status,")"),i=new Error(r);return i.status=this.status,i.method=e,i.url=n,i},o.Response=l,I(h.prototype),z(h.prototype),h.prototype.type=function(t){return this.set("Content-Type",o.types[t]||t),this},h.prototype.accept=function(t){return this.set("Accept",o.types[t]||t),this},h.prototype.auth=function(t,e,r){1===arguments.length&&(e=""),"object"===n(e)&&null!==e&&(r=e,e=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});var i=function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(t,e,r,i)},h.prototype.query=function(t){return"string"!=typeof t&&(t=a(t)),t&&this._query.push(t),this},h.prototype.attach=function(t,e,n){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,n||e.name)}return this},h.prototype._getFormData=function(){return this._formData||(this._formData=new r.FormData),this._formData},h.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var n=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),n(t,e)},h.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},h.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},h.prototype.ca=h.prototype.agent,h.prototype.buffer=h.prototype.ca,h.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},h.prototype.pipe=h.prototype.write,h.prototype._isHost=function(t){return t&&"object"===n(t)&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},h.prototype.end=function(t){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||i,this._finalizeQueryString(),this._end()},h.prototype._setUploadTimeout=function(){var t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},h.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var t=this;this.xhr=o.getXHR();var e=this.xhr,n=this._formData||this._data;this._setTimeouts(),e.onreadystatechange=function(){var n=e.readyState;if(n>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4===n){var r;try{r=e.status}catch(t){r=0}if(!r){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var r=function(e,n){n.total>0&&(n.percent=n.loaded/n.total*100,100===n.percent&&clearTimeout(t._uploadTimeoutTimer)),n.direction=e,t.emit("progress",n)};if(this.hasListeners("progress"))try{e.addEventListener("progress",r.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",r.bind(null,"upload"))}catch(t){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof n&&!this._isHost(n)){var i=this._header["content-type"],s=this._serializer||o.serialize[i?i.split(";")[0]:""];!s&&p(i)&&(s=o.serialize["application/json"]),s&&(n=s(n))}for(var a in this.header)null!==this.header[a]&&Object.prototype.hasOwnProperty.call(this.header,a)&&e.setRequestHeader(a,this.header[a]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===n?null:n)},o.agent=function(){return new Z},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(t){Z.prototype[t.toLowerCase()]=function(e,n){var r=new o.Request(t,e);return this._setDefaults(r),n&&r.end(n),r}})),Z.prototype.del=Z.prototype.delete,o.get=function(t,e,n){var r=o("GET",t);return"function"==typeof e&&(n=e,e=null),e&&r.query(e),n&&r.end(n),r},o.head=function(t,e,n){var r=o("HEAD",t);return"function"==typeof e&&(n=e,e=null),e&&r.query(e),n&&r.end(n),r},o.options=function(t,e,n){var r=o("OPTIONS",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},o.del=d,o.delete=d,o.patch=function(t,e,n){var r=o("PATCH",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},o.post=function(t,e,n){var r=o("POST",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},o.put=function(t,e,n){var r=o("PUT",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r}})),G=(K.Request,[]),Y=[],tt=("undefined"!=typeof Uint8Array&&Uint8Array,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),et=0,nt=tt.length;et0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&e,[n,n===e?0:4-n%4]}function it(t,e,n){for(var r,i,o=[],s=e;s>18&63]+G[i>>12&63]+G[i>>6&63]+G[63&i]);return o.join("")}Y["-".charCodeAt(0)]=62,Y["_".charCodeAt(0)]=63;var ot=function(t){for(var e,n=t.length,r=n%3,i=[],o=0,s=n-r;os?s:o+16383));return 1===r?(e=t[n-1],i.push(G[e>>2]+G[e<<4&63]+"==")):2===r&&(e=(t[n-2]<<8)+t[n-1],i.push(G[e>>10]+G[e>>4&63]+G[e<<2&63]+"=")),i.join("")},st=function(t){return ot(function(t){for(var e=new Array(t.length),n=0;n=65&&e<=90||!i&&e>=48&&e<=57?(n+="_",n+=t[r].toLowerCase()):n+=t[r].toLowerCase(),i=e>=48&&e<=57,o=e>=65&&e<=90,r++;return n}(i):i]=t(e[i]),r}),{}))},toCamelCase:function t(e,n,r){return"object"!=typeof e||ht.isArray(e)||null===e?e:(n=n||[],r=r||{},Object.keys(e).reduce((function(i,o){var s,a=-1===n.indexOf(o)?(s=o.split("_")).reduce((function(t,e){return t+e.charAt(0).toUpperCase()+e.slice(1)}),s.shift()):o;return i[a]=t(e[a]||e[o],[],r),r.keepOriginal&&(i[o]=t(e[o],[],r)),i}),{}))},blacklist:function(t,e){return Object.keys(t).reduce((function(n,r){return-1===e.indexOf(r)&&(n[r]=t[r]),n}),{})},merge:function(t,e){return{base:e?mt(t,e):t,with:function(t,e){return t=e?mt(t,e):t,gt(this.base,t)}}},pick:mt,getKeysNotIn:function(t,e){var n=[];for(var r in t)-1===e.indexOf(r)&&n.push(r);return n},extend:gt,getOriginFromUrl:function(t){if(t){var e=vt(t);if(!e)return null;var n=e.protocol+"//"+e.hostname;return e.port&&(n+=":"+e.port),n}},getLocationFromUrl:vt,trimUserDetails:function(t){return function(t,e){return["username","email","phoneNumber"].reduce(bt,t)}(t)},updatePropertyOn:function t(e,n,r){"string"==typeof n&&(n=n.split("."));var i=n[0];e.hasOwnProperty(i)&&(1===n.length?e[i]=r:t(e[i],n.slice(1),r))}};function _t(t){this.request=t,this.method=t.method,this.url=t.url,this.body=t._data,this.headers=t._header}function Tt(t){this.request=t}function Ot(t){this._sendTelemetry=!1!==t._sendTelemetry||t._sendTelemetry,this._telemetryInfo=t._telemetryInfo||null,this._timesToRetryFailedRequests=t._timesToRetryFailedRequests,this.headers=t.headers||{},this._universalLoginPage=t.universalLoginPage}function kt(){return window}_t.prototype.abort=function(){this.request.abort()},_t.prototype.getMethod=function(){return this.method},_t.prototype.getBody=function(){return this.body},_t.prototype.getUrl=function(){return this.url},_t.prototype.getHeaders=function(){return this.headers},Tt.prototype.set=function(t,e){return this.request=this.request.set(t,e),this},Tt.prototype.send=function(t){return this.request=this.request.send(wt.trimUserDetails(t)),this},Tt.prototype.withCredentials=function(){return this.request=this.request.withCredentials(),this},Tt.prototype.end=function(t){return this.request.end(t),new _t(this.request)},Ot.prototype.setCommonConfiguration=function(t,e){if(e=e||{},this._timesToRetryFailedRequests>0&&(t=t.retry(this._timesToRetryFailedRequests)),e.noHeaders)return t;var n=this.headers;t=t.set("Content-Type","application/json");for(var r=Object.keys(this.headers),i=0;i0&&t.warning("Following parameters are not allowed on the `/authorize` endpoint: ["+n.join(",")+"]"),e},Nt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function Ht(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var $t=Ht((function(t,e){t.exports=function(){function t(t){return"function"==typeof t}var e=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=0,i=void 0,o=void 0,s=function(t,e){d[n]=t,d[n+1]=e,2===(n+=2)&&(o?o(f):b())},a="undefined"!=typeof window?window:void 0,u=a||{},c=u.MutationObserver||u.WebKitMutationObserver,p="undefined"==typeof self&&void 0!==r&&"[object process]"==={}.toString.call(r),l="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var t=setTimeout;return function(){return t(f,1)}}var d=new Array(1e3);function f(){for(var t=0;t>>2]|=(n[o>>>2]>>>24-o%4*8&255)<<24-(r+o)%4*8;else for(o=0;o>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n,r=[],i=function(e){e=e;var n=987654321,r=4294967295;return function(){var i=((n=36969*(65535&n)+(n>>16)&r)<<16)+(e=18e3*(65535&e)+(e>>16)&r)&r;return i/=4294967296,(i+=.5)*(t.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new s.init(n,e/2)}},c=a.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255));return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new s.init(n,e)}},p=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},l=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,r=n.words,i=n.sigBytes,o=this.blockSize,a=i/(4*o),u=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*o,c=t.min(4*u,i);if(u){for(var p=0;p>>7)^(f<<14|f>>>18)^f>>>3)+c[d-7]+((m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10)+c[d-16]}var y=r&i^r&o^i&o,g=h+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&p^~a&l)+u[d]+c[d];h=l,l=p,p=a,a=s+g|0,s=o,o=i,i=r,r=g+(((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+p|0,n[6]=n[6]+l|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(p),e.HmacSHA256=o._createHmacHelper(p)}(Math),n.SHA256)})),Wt=Ht((function(t,e){var n,r;t.exports=(n=(r=zt).lib.WordArray,r.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var u=r.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(t){var e=t.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>6-s%4*2;i[o>>>2]|=(a|u)<<24-o%4*8,o++}return n.create(i,o)}(t,e,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)})),Vt=Ht((function(t,e){t.exports=zt.enc.Hex})),Jt=Ht((function(t,e){(function(){var e;function n(t,e,n){null!=t&&("number"==typeof t?this.fromNumber(t,e,n):this.fromString(t,null==e&&"string"!=typeof t?256:e))}function r(){return new n(null)}var i="undefined"!=typeof navigator;i&&"Microsoft Internet Explorer"==navigator.appName?(n.prototype.am=function(t,e,n,r,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],c=this[t++]>>15,p=a*u+c*s;i=((u=s*u+((32767&p)<<15)+n[r]+(1073741823&i))>>>30)+(p>>>15)+a*c+(i>>>30),n[r++]=1073741823&u}return i},e=30):i&&"Netscape"!=navigator.appName?(n.prototype.am=function(t,e,n,r,i,o){for(;--o>=0;){var s=e*this[t++]+n[r]+i;i=Math.floor(s/67108864),n[r++]=67108863&s}return i},e=26):(n.prototype.am=function(t,e,n,r,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],c=this[t++]>>14,p=a*u+c*s;i=((u=s*u+((16383&p)<<14)+n[r]+i)>>28)+(p>>14)+a*c,n[r++]=268435455&u}return i},e=28),n.prototype.DB=e,n.prototype.DM=(1<>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function h(t){this.m=t}function d(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function b(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function w(){}function _(t){return t}function T(t){this.r2=r(),this.q3=r(),n.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}h.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},h.prototype.revert=function(t){return t},h.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},h.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},h.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},d.prototype.convert=function(t){var e=r();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(n.ZERO)>0&&this.m.subTo(e,e),e},d.prototype.revert=function(t){var e=r();return t.copyTo(e),this.reduce(e),e},d.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(t[n=e+this.m.t]+=this.m.am(0,r,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},d.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},d.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},n.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},n.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},n.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var i=t.length,o=!1,s=0;--i>=0;){var a=8==r?255&t[i]:c(t,i);a<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+r>this.DB?(this[this.t-1]|=(a&(1<>this.DB-s):this[this.t-1]|=a<=this.DB&&(s-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t},n.prototype.dlShiftTo=function(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s},n.prototype.drShiftTo=function(t,e){for(var n=t;n=0;--n)e[n+s+1]=this[n]>>i|a,a=(this[n]&o)<=0;--n)e[n]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},n.prototype.rShiftTo=function(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)e.t=0;else{var r=t%this.DB,i=this.DB-r,o=(1<>r;for(var s=n+1;s>r;r>0&&(e[this.t-n-1]|=(this.s&o)<>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()},n.prototype.multiplyTo=function(t,e){var r=this.abs(),i=t.abs(),o=r.t;for(e.t=o+i.t;--o>=0;)e[o]=0;for(o=0;o=0;)t[n]=0;for(n=0;n=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()},n.prototype.divRemTo=function(t,e,i){var o=t.abs();if(!(o.t<=0)){var s=this.abs();if(s.t0?(o.lShiftTo(p,a),s.lShiftTo(p,i)):(o.copyTo(a),s.copyTo(i));var h=a.t,d=a[h-1];if(0!=d){var f=d*(1<1?a[h-2]>>this.F2:0),m=this.FV/f,y=(1<=0&&(i[i.t++]=1,i.subTo(w,i)),n.ONE.dlShiftTo(h,w),w.subTo(a,a);a.t=0;){var _=i[--v]==d?this.DM:Math.floor(i[v]*m+(i[v-1]+g)*y);if((i[v]+=a.am(0,_,i,b,0,h))<_)for(a.dlShiftTo(b,w),i.subTo(w,i);i[v]<--_;)i.subTo(w,i)}null!=e&&(i.drShiftTo(h,e),u!=c&&n.ZERO.subTo(e,e)),i.t=h,i.clamp(),p>0&&i.rShiftTo(p,i),u<0&&n.ZERO.subTo(i,i)}}},n.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},n.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},n.prototype.exp=function(t,e){if(t>4294967295||t<1)return n.ONE;var i=r(),o=r(),s=e.convert(this),a=l(t)-1;for(s.copyTo(i);--a>=0;)if(e.sqrTo(i,o),(t&1<0)e.mulTo(o,s,i);else{var u=i;i=o,o=u}return e.revert(i)},n.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,r=(1<0)for(a>a)>0&&(i=!0,o=u(n));s>=0;)a>(a+=this.DB-e)):(n=this[s]>>(a-=e)&r,a<=0&&(a+=this.DB,--s)),n>0&&(i=!0),i&&(o+=u(n));return i?o:"0"},n.prototype.negate=function(){var t=r();return n.ZERO.subTo(this,t),t},n.prototype.abs=function(){return this.s<0?this.negate():this},n.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(0!=(e=n-t.t))return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0},n.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+l(this[this.t-1]^this.s&this.DM)},n.prototype.mod=function(t){var e=r();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(n.ZERO)>0&&t.subTo(e,e),e},n.prototype.modPowInt=function(t,e){var n;return n=t<256||e.isEven()?new h(e):new d(e),this.exp(t,n)},n.ZERO=p(0),n.ONE=p(1),w.prototype.convert=_,w.prototype.revert=_,w.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},w.prototype.sqrTo=function(t,e){t.squareTo(e)},T.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=r();return t.copyTo(e),this.reduce(e),e},T.prototype.revert=function(t){return t},T.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},T.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},T.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var O,k,S,x=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],A=(1<<26)/x[x.length-1];function C(){var t;t=(new Date).getTime(),k[S++]^=255&t,k[S++]^=t>>8&255,k[S++]^=t>>16&255,k[S++]^=t>>24&255,S>=U&&(S-=U)}if(n.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},n.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),i=p(n),o=r(),s=r(),a="";for(this.divRemTo(i,o,s);o.signum()>0;)a=(n+s.intValue()).toString(t).substr(1)+a,o.divRemTo(i,o,s);return s.intValue().toString(t)+a},n.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),i=Math.pow(e,r),o=!1,s=0,a=0,u=0;u=r&&(this.dMultiply(i),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),o&&n.ZERO.subTo(this,this)},n.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(n.ONE.shiftLeft(t-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(n.ONE.shiftLeft(t-1),this);else{var i=new Array,o=7&t;i.length=1+(t>>3),e.nextBytes(i),o>0?i[0]&=(1<>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e[n++]=r:r<-1&&(e[n++]=this.DV+r),e.t=n,e.clamp()},n.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},n.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},n.prototype.multiplyLowerTo=function(t,e,n){var r,i=Math.min(this.t+t.t,e);for(n.s=0,n.t=i;i>0;)n[--i]=0;for(r=n.t-this.t;i=0;)n[r]=0;for(r=Math.max(e-this.t,0);r0)if(0==e)n=this[0]%t;else for(var r=this.t-1;r>=0;--r)n=(e*n+this[r])%t;return n},n.prototype.millerRabin=function(t){var e=this.subtract(n.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var o=e.shiftRight(i);(t=t+1>>1)>x.length&&(t=x.length);for(var s=r(),a=0;a>24},n.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},n.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},n.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var n,r=this.DB-t*this.DB%8,i=0;if(t-- >0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this[t]&(1<>(r+=this.DB-8)):(n=this[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e},n.prototype.equals=function(t){return 0==this.compareTo(t)},n.prototype.min=function(t){return this.compareTo(t)<0?this:t},n.prototype.max=function(t){return this.compareTo(t)>0?this:t},n.prototype.and=function(t){var e=r();return this.bitwiseTo(t,f,e),e},n.prototype.or=function(t){var e=r();return this.bitwiseTo(t,m,e),e},n.prototype.xor=function(t){var e=r();return this.bitwiseTo(t,y,e),e},n.prototype.andNot=function(t){var e=r();return this.bitwiseTo(t,g,e),e},n.prototype.not=function(){for(var t=r(),e=0;e=this.t?0!=this.s:0!=(this[e]&1<1){var m=r();for(i.sqrTo(a[1],m);u<=f;)a[u]=r(),i.mulTo(m,a[u-2],a[u]),u+=2}var y,g,v=t.t-1,b=!0,w=r();for(o=l(t[v])-1;v>=0;){for(o>=c?y=t[v]>>o-c&f:(y=(t[v]&(1<0&&(y|=t[v-1]>>this.DB+o-c)),u=n;0==(1&y);)y>>=1,--u;if((o-=u)<0&&(o+=this.DB,--v),b)a[y].copyTo(s),b=!1;else{for(;u>1;)i.sqrTo(s,w),i.sqrTo(w,s),u-=2;u>0?i.sqrTo(s,w):(g=s,s=w,w=g),i.mulTo(w,a[y],s)}for(;v>=0&&0==(t[v]&1<=0?(r.subTo(i,r),e&&o.subTo(a,o),s.subTo(u,s)):(i.subTo(r,i),e&&a.subTo(o,a),u.subTo(s,u))}return 0!=i.compareTo(n.ONE)?n.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},n.prototype.pow=function(t){return this.exp(t,new w)},n.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var r=e;e=n,n=r}var i=e.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return e;for(i0&&(e.rShiftTo(o,e),n.rShiftTo(o,n));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},n.prototype.isProbablePrime=function(t){var e,n=this.abs();if(1==n.t&&n[0]<=x[x.length-1]){for(e=0;e>>8,k[S++]=255&D;S=0,C()}function I(){if(null==O){for(C(),(O=new P).init(k),S=0;S0&&e.length>0))throw new Error("Invalid key data");this.n=new Jt.BigInteger(t,16),this.e=parseInt(e,16)}Zt.prototype.verify=function(t,e){e=e.replace(/[^0-9a-f]|[\s\n]]/gi,"");var n=new Jt.BigInteger(e,16);if(n.bitLength()>this.n.bitLength())throw new Error("Signature does not match with the key modulus.");var r=function(t){for(var e in Xt){var n=Xt[e],r=n.length;if(t.substring(0,r)===n)return{alg:e,hash:t.substring(r)}}return[]}(n.modPowInt(this.e,this.n).toString(16).replace(/^1f+00/,""));if(0===r.length)return!1;if(!Qt.hasOwnProperty(r.alg))throw new Error("Hashing algorithm is not supported.");var i=Qt[r.alg](t).toString();return r.hash===i};for(var Kt=[],Gt=[],Yt="undefined"!=typeof Uint8Array?Uint8Array:Array,te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ee=0,ne=te.length;ee0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}(t),i=r[0],o=r[1],s=new Yt(function(t,e,n){return 3*(e+n)/4-n}(0,i,o)),a=0,u=o>0?i-4:i;for(n=0;n>16&255,s[a++]=e>>8&255,s[a++]=255&e;return 2===o&&(e=Gt[t.charCodeAt(n)]<<2|Gt[t.charCodeAt(n+1)]>>4,s[a++]=255&e),1===o&&(e=Gt[t.charCodeAt(n)]<<10|Gt[t.charCodeAt(n+1)]<<4|Gt[t.charCodeAt(n+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e),s};function ie(t){var e=t.length%4;return 0===e?t:t+new Array(4-e+1).join("=")}function oe(t){return t=ie(t).replace(/\-/g,"+").replace(/_/g,"/"),decodeURIComponent(function(t){for(var e="",n=0;n1){var n=t.shift();t[0]=n+t[0]}t[0]=t[0].match(/^file:\/\/\//)?t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r0&&(i=i.replace(/^[\/]+/,"")),i=i.replace(/[\/]+$/,r0?"?":"")+s.join("&")}return function(){return t("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=n():e.urljoin=n()}));function ue(t,e){return e=e||{},new Promise((function(n,r){var i=new XMLHttpRequest,o=[],s=[],a={},u=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return s},get:function(t){return a[t.toLowerCase()]},has:function(t){return t.toLowerCase()in a}}}};for(var c in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,n){o.push(e=e.toLowerCase()),s.push([e,n]),a[e]=a[e]?a[e]+","+n:n})),n(u())},i.onerror=r,i.withCredentials="include"==e.credentials,e.headers)i.setRequestHeader(c,e.headers[c]);i.send(e.body||null)}))}function ce(t){if(t.ok)return t.json();var e=new Error(t.statusText);return e.response=t,Promise.reject(e)}function pe(t){this.name="ConfigurationError",this.message=t||""}function le(t){this.name="TokenValidationError",this.message=t||""}pe.prototype=Error.prototype,le.prototype=Error.prototype;var he=function(){function t(){}var e=t.prototype;return e.get=function(){return null},e.has=function(){return null},e.set=function(){return null},t}();$t.polyfill();var de=function(t){return"number"==typeof t},fe=function(){return new Date};function me(t){var e=t||{};if(this.jwksCache=e.jwksCache||new he,this.expectedAlg=e.expectedAlg||"RS256",this.issuer=e.issuer,this.audience=e.audience,this.leeway=0===e.leeway?0:e.leeway||60,this.jwksURI=e.jwksURI,this.maxAge=e.maxAge,this.__clock="function"==typeof e.__clock?e.__clock:fe,this.leeway<0||this.leeway>300)throw new pe("The leeway should be positive and lower than five minutes.");if("RS256"!==this.expectedAlg)throw new pe('Signature algorithm of "'+this.expectedAlg+'" is not supported. Expected the ID token to be signed with "RS256".')}function ye(t,e){this.plugins=e;for(var n=0;n1){if(!f||"string"!=typeof f)return n(new le("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values",!1));if(f!==v.audience)return n(new le('Authorized Party (azp) claim mismatch in the ID token; expected "'+v.audience+'", found "'+f+'"',!1))}if(!l||!de(l))return n(new le("Expiration Time (exp) claim must be a number present in the ID token",!1));if(!d||!de(d))return n(new le("Issued At (iat) claim must be a number present in the ID token"));var a=l+v.leeway,b=new Date(0);if(b.setUTCSeconds(a),g>b)return n(new le('Expiration Time (exp) claim error in the ID token; current time "'+g+'" is after expiration time "'+b+'"',!1));if(h&&de(h)){var w=h-v.leeway,_=new Date(0);if(_.setUTCSeconds(w),g<_)return n(new le('Not Before Time (nbf) claim error in the ID token; current time "'+g+'" is before the not before time "'+_+'"'))}if(v.maxAge){if(!m||!de(m))return n(new le("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified"));var T=m+v.maxAge+v.leeway,O=new Date(0);if(O.setUTCSeconds(T),g>O)return n(new le('Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time "'+g+'" is after last auth time at "'+O+'"'))}return n(null,r.payload)}))},me.prototype.getRsaVerifier=function(t,e,n){var r=this,i=t+e;Promise.resolve(this.jwksCache.has(i)).then((function(n){return n?r.jwksCache.get(i):(o={jwksURI:r.jwksURI,iss:t,kid:e},("undefined"==typeof fetch?ue:fetch)(o.jwksURI||ae(o.iss,".well-known","jwks.json")).then(ce).then((function(t){var e,n,r,i=null;for(e=0;e-1&&null!==new RegExp("rv:([0-9]{2,2}[.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1)),t>=8}();return"undefined"!=typeof window&&window.JSON&&window.JSON.stringify&&window.JSON.parse&&window.postMessage?{open:function(i,o){if(!o)throw"missing required callback argument";var s,a;i.url||(s="missing required 'url' parameter"),i.relay_url||(s="missing required 'relay_url' parameter"),s&&setTimeout((function(){o(s)}),0),i.window_name||(i.window_name=null),i.window_features&&!function(){try{var t=navigator.userAgent;return-1!=t.indexOf("Fennec/")||-1!=t.indexOf("Firefox/")&&-1!=t.indexOf("Android")}catch(t){}return!1}()||(i.window_features=void 0);var u,c=i.origin||n(i.url);if(c!==n(i.relay_url))return setTimeout((function(){o("invalid arguments: origin of url and relay_url must match")}),0);r&&((a=document.createElement("iframe")).setAttribute("src",i.relay_url),a.style.display="none",a.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(a),u=a.contentWindow);var p=i.popup||window.open(i.url,i.window_name,i.window_features);i.popup&&(p.location.href=i.url),u||(u=p);var l=setInterval((function(){p&&p.closed&&(d(),o&&(o("User closed the popup window"),o=null))}),500),h=JSON.stringify({a:"request",d:i.params});function d(){if(a&&document.body.removeChild(a),a=void 0,l&&(l=clearInterval(l)),e(window,"message",f),e(window,"unload",d),p)try{p.close()}catch(t){u.postMessage("die",c)}p=u=void 0}function f(t){if(t.origin===c){try{var e=JSON.parse(t.data)}catch(t){if(o)return o(t);throw t}"ready"===e.a?u.postMessage(h,c):"error"===e.a?(d(),o&&(o(e.d),o=null)):"response"===e.a&&(d(),o&&(o(null,e.d),o=null))}}return t(window,"unload",d),t(window,"message",f),{originalPopup:p,close:d,focus:function(){if(p)try{p.focus()}catch(t){}}}},onOpen:function(n){var i="*",o=r?function(){for(var t=window.opener.frames,e=t.length-1;e>=0;e--)try{if(t[e].location.protocol===window.location.protocol&&t[e].location.host===window.location.host&&"__winchan_relay_frame"===t[e].name)return t[e]}catch(t){}}():window.opener;if(!o)throw"can't find relay frame";function s(t){t=JSON.stringify(t),r?o.doPost(t,i):o.postMessage(t,i)}function a(t){if("die"===t.data)try{window.close()}catch(t){}}t(r?o:window,"message",(function t(r){var o;try{o=JSON.parse(r.data)}catch(t){}o&&"request"===o.a&&(e(window,"message",t),i=r.origin,n&&setTimeout((function(){n(i,o.d,(function(t){n=void 0,s({a:"response",d:t})}))}),0))})),t(r?o:window,"message",a);try{s({a:"ready"})}catch(e){t(o,"load",(function(t){s({a:"ready"})}))}var u=function(){try{e(r?o:window,"message",a)}catch(t){}n&&s({a:"error",d:"client closed window"}),n=void 0;try{window.close()}catch(t){}};return t(window,"unload",u),{detach:function(){e(window,"unload",u)}}}}:{open:function(t,e,n,r){setTimeout((function(){r("unsupported browser")}),0)},onOpen:function(t){setTimeout((function(){t("unsupported browser")}),0)}}}();t.exports&&(t.exports=e)})),Se=function(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[-_a-zA-Z.0-9:]+)/.exec(t);return e?e[1]:t};function xe(){this._current_popup=null}function Ae(t,e){this.baseOptions=e,this.baseOptions.popupOrigin=e.popupOrigin,this.client=t.client,this.webAuth=t,this.transactionManager=new ve(this.baseOptions),this.crossOriginAuthentication=new _e(t,this.baseOptions),this.warn=new Dt({disableWarnings:!!e._disableDeprecationWarnings})}function Ce(t){this.authenticationUrl=t.authenticationUrl,this.timeout=t.timeout||6e4,this.handler=null,this.postMessageDataType=t.postMessageDataType||!1,this.postMessageOrigin=t.postMessageOrigin||St.getWindow().location.origin||St.getWindow().location.protocol+"//"+St.getWindow().location.hostname+(St.getWindow().location.port?":"+St.getWindow().location.port:"")}function De(t){this.baseOptions=t,this.request=new Ot(t),this.transactionManager=new ve(this.baseOptions)}function je(t,e){this.baseOptions=e,this.client=t,this.baseOptions.universalLoginPage=!0,this.request=new Ot(this.baseOptions),this.warn=new Dt({disableWarnings:!!e._disableDeprecationWarnings})}xe.prototype.calculatePosition=function(t){var e=t.width||500,n=t.height||600,r=St.getWindow(),i=void 0!==r.screenX?r.screenX:r.screenLeft,o=void 0!==r.screenY?r.screenY:r.screenTop,s=void 0!==r.outerWidth?r.outerWidth:r.document.body.clientWidth,a=void 0!==r.outerHeight?r.outerHeight:r.document.body.clientHeight;return{width:e,height:n,left:t.left||i+(s-e)/2,top:t.top||o+(a-n)/2}},xe.prototype.preload=function(t){var e=this,n=St.getWindow(),r=this.calculatePosition(t.popupOptions||{}),i=wt.merge(r).with(t.popupOptions),o=t.url||"about:blank",s=E(i,{encode:!1,delimiter:","});return this._current_popup&&!this._current_popup.closed||(this._current_popup=n.open(o,"auth0_signup_popup",s),this._current_popup.kill=function(){this.close(),e._current_popup=null}),this._current_popup},xe.prototype.load=function(t,e,n,r){var i=this,o=this.calculatePosition(n.popupOptions||{}),s=wt.merge(o).with(n.popupOptions),a=wt.merge({url:t,relay_url:e,window_features:E(s,{delimiter:",",encode:!1}),popup:this._current_popup}).with(n),u=ke.open(a,(function(t,e){if(!t||"SyntaxError"!==t.name)return i._current_popup=null,r(t,e)}));return u.focus(),u},Ae.prototype.buildPopupHandler=function(){var t=this.baseOptions.plugins.get("popup.getPopupHandler");return t?t.getPopupHandler():new xe},Ae.prototype.preload=function(t){t=t||{};var e=this.buildPopupHandler();return e.preload(t),e},Ae.prototype.getPopupHandler=function(t,e){return t.popupHandler?t.popupHandler:e?this.preload(t):this.buildPopupHandler()},Ae.prototype.callback=function(t){var e=this,n=St.getWindow(),r=(t=t||{}).popupOrigin||this.baseOptions.popupOrigin||St.getOrigin();n.opener?ke.onOpen((function(n,i,o){if(n!==r)return o({error:"origin_mismatch",error_description:"The popup's origin ("+n+") should match the `popupOrigin` parameter ("+r+")."});e.webAuth.parseHash(t||{},(function(t,e){return o(t||e)}))})):n.doPost=function(t){n.parent&&n.parent.postMessage(t,r)}},Ae.prototype.authorize=function(t,e){var n,r,i={},o=this.baseOptions.plugins.get("popup.authorize"),a=wt.merge(this.baseOptions,["clientID","scope","domain","audience","tenant","responseType","redirectUri","_csrf","state","_intstate","nonce"]).with(wt.blacklist(t,["popupHandler"]));return ht.check(a,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),r=s(this.baseOptions.rootUrl,"relay.html"),t.owp?a.owp=!0:(i.origin=Se(a.redirectUri),r=a.redirectUri),t.popupOptions&&(i.popupOptions=wt.pick(t.popupOptions,["width","height","top","left"])),o&&(a=o.processParams(a)),(a=this.transactionManager.process(a)).scope=a.scope||"openid profile email",delete a.domain,n=this.client.buildAuthorizeUrl(a),this.getPopupHandler(t).load(n,r,i,Ut(e,{keepOriginalCasing:!0}))},Ae.prototype.loginWithCredentials=function(t,e){t.realm=t.realm||t.connection,t.popup=!0,t=wt.merge(this.baseOptions,["redirectUri","responseType","state","nonce"]).with(wt.blacklist(t,["popupHandler","connection"])),t=this.transactionManager.process(t),this.crossOriginAuthentication.login(t,e)},Ae.prototype.passwordlessVerify=function(t,e){var n=this;return this.client.passwordless.verify(wt.blacklist(t,["popupHandler"]),(function(r){if(r)return e(r);t.username=t.phoneNumber||t.email,t.password=t.verificationCode,delete t.email,delete t.phoneNumber,delete t.verificationCode,delete t.type,n.client.loginWithResourceOwner(t,e)}))},Ae.prototype.signupAndLogin=function(t,e){var n=this;return this.client.dbConnection.signup(t,(function(r){if(r)return e(r);n.loginWithCredentials(t,e)}))},Ce.create=function(t){return new Ce(t)},Ce.prototype.login=function(t,e){this.handler=new be({auth0:this.auth0,url:this.authenticationUrl,eventListenerType:t?"message":"load",callback:this.getCallbackHandler(e,t),timeout:this.timeout,eventValidator:this.getEventValidator(),timeoutCallback:function(){e(null,"#error=timeout&error_description=Timeout+during+authentication+renew.")},usePostMessage:t||!1}),this.handler.init()},Ce.prototype.getEventValidator=function(){var t=this;return{isValid:function(e){switch(e.event.type){case"message":return e.event.origin===t.postMessageOrigin&&e.event.source===t.handler.iframe.contentWindow&&(!1===t.postMessageDataType||e.event.data.type&&e.event.data.type===t.postMessageDataType);case"load":if("about:"===e.sourceObject.contentWindow.location.protocol)return!1;default:return!0}}}},Ce.prototype.getCallbackHandler=function(t,e){return function(n){var r;r=e?"object"==typeof n.event.data&&n.event.data.hash?n.event.data.hash:n.event.data:n.sourceObject.contentWindow.location.hash,t(null,r)}},De.prototype.login=function(t,e){var n,r;return n=s(this.baseOptions.rootUrl,"usernamepassword","login"),t.username=t.username||t.email,t=wt.blacklist(t,["email"]),r=wt.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience"]).with(t),r=this.transactionManager.process(r),r=wt.toSnakeCase(r,["auth0Client"]),this.request.post(n).send(r).end(Ut(e))},De.prototype.callback=function(t){var e,n=St.getDocument();(e=n.createElement("div")).innerHTML=t,n.body.appendChild(e).children[0].submit()},je.prototype.login=function(t,e){if(St.getWindow().location.host!==this.baseOptions.domain)throw new Error("This method is meant to be used only inside the Universal Login Page.");var n,r=wt.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return ht.check(r,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),(n=new De(this.baseOptions)).login(r,(function(t,r){return t?e(t):n.callback(r)}))},je.prototype.signupAndLogin=function(t,e){var n=this;return n.client.client.dbConnection.signup(t,(function(r){return r?e(r):n.login(t,e)}))},je.prototype.getSSOData=function(t,e){var n,r="";return"function"==typeof t&&(e=t,t=!1),ht.check(t,{type:"boolean",message:"withActiveDirectories parameter is not valid"}),ht.check(e,{type:"function",message:"cb parameter is not valid"}),t&&(r="?"+E({ldaps:1,client_id:this.baseOptions.clientID})),n=s(this.baseOptions.rootUrl,"user","ssodata",r),this.request.get(n,{noHeaders:!0}).withCredentials().end(Ut(e))};var Ee=function(){},Ie={lang:"en",templates:{auth0:function(t){var e="code"===t.type?"Enter the code shown above":"Solve the formula shown above";return'
\n \n \n
\n'},recaptcha_v2:function(){return'
'},error:function(){return'
Error getting the bot detection challenge. Please contact the system administrator.
'}}};var qe=function(t,e,n,r){function i(r){r=r||Ee,t.getChallenge((function(t,o){return t?(e.innerHTML=n.templates.error(t),r(t)):o.required?(e.style.display="","auth0"===o.provider?function(t,e,n,r){t.innerHTML=e.templates[n.provider](n),t.querySelector(".captcha-reload").addEventListener("click",(function(t){t.preventDefault(),r()}))}(e,n,o,i):"recaptcha_v2"===o.provider&&function(t,e,n){var r=t.hasAttribute("data-wid")&&t.getAttribute("data-wid");function i(e){t.querySelector('input[name="captcha"]').value=e||""}if(r)return i(),void window.grecaptcha.reset(r);t.innerHTML=e.templates[n.provider](n);var o=t.querySelector(".recaptcha");!function(t,e,n){var r="recaptchaCallback_"+Math.floor(1000001*Math.random());window[r]=function(){delete window[r],n()};var i=window.document.createElement("script");i.src="https://www.google.com/recaptcha/api.js?hl="+e+"&onload="+r,i.async=!0,window.document.body.appendChild(i)}(0,e.lang,(function(){r=window.grecaptcha.render(o,{callback:i,"expired-callback":function(){i()},"error-callback":function(){i()},sitekey:n.siteKey}),t.setAttribute("data-wid",r)}))}(e,n,o),void r()):(e.style.display="none",void(e.innerHTML=""))}))}return n=wt.merge(Ie).with(n||{}),i(r),{reload:i,getValue:function(){var t=e.querySelector('input[name="captcha"]');if(t)return t.value}}};function Pe(){return new Date}function Ue(t){ht.check(t,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},clientID:{type:"string",message:"clientID option is required"},responseType:{optional:!0,type:"string",message:"responseType is not valid"},responseMode:{optional:!0,type:"string",message:"responseMode is not valid"},redirectUri:{optional:!0,type:"string",message:"redirectUri is not valid"},scope:{optional:!0,type:"string",message:"scope is not valid"},audience:{optional:!0,type:"string",message:"audience is not valid"},popupOrigin:{optional:!0,type:"string",message:"popupOrigin is not valid"},leeway:{optional:!0,type:"number",message:"leeway is not valid"},plugins:{optional:!0,type:"array",message:"plugins is not valid"},maxAge:{optional:!0,type:"number",message:"maxAge is not valid"},_disableDeprecationWarnings:{optional:!0,type:"boolean",message:"_disableDeprecationWarnings option is not valid"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"},_timesToRetryFailedRequests:{optional:!0,type:"number",message:"_timesToRetryFailedRequests option is not valid"}}),t.overrides&&ht.check(t.overrides,{type:"object",message:"overrides option is not valid"},{__tenant:{optional:!0,type:"string",message:"__tenant option is required"},__token_issuer:{optional:!0,type:"string",message:"__token_issuer option is required"},__jwks_uri:{optional:!0,type:"string",message:"__jwks_uri is required"}}),this.baseOptions=t,this.baseOptions.plugins=new ye(this,this.baseOptions.plugins||[]),this.baseOptions._sendTelemetry=!1!==this.baseOptions._sendTelemetry||this.baseOptions._sendTelemetry,this.baseOptions._timesToRetryFailedRequests=t._timesToRetryFailedRequests?parseInt(t._timesToRetryFailedRequests,0):0,this.baseOptions.tenant=this.baseOptions.overrides&&this.baseOptions.overrides.__tenant||this.baseOptions.domain.split(".")[0],this.baseOptions.token_issuer=this.baseOptions.overrides&&this.baseOptions.overrides.__token_issuer||"https://"+this.baseOptions.domain+"/",this.baseOptions.jwksURI=this.baseOptions.overrides&&this.baseOptions.overrides.__jwks_uri,this.transactionManager=new ve(this.baseOptions),this.client=new Le(this.baseOptions),this.redirect=new Oe(this,this.baseOptions),this.popup=new Ae(this,this.baseOptions),this.crossOriginAuthentication=new _e(this,this.baseOptions),this.webMessageHandler=new we(this),this._universalLogin=new je(this,this.baseOptions),this.ssodataStorage=new It(this.baseOptions)}function Re(t,e){this.baseOptions=e,this.request=t}function Me(t,e){this.baseOptions=e,this.request=t}function Le(t,e){2===arguments.length?this.auth0=t:e=t,ht.check(e,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},clientID:{type:"string",message:"clientID option is required"},responseType:{optional:!0,type:"string",message:"responseType is not valid"},responseMode:{optional:!0,type:"string",message:"responseMode is not valid"},redirectUri:{optional:!0,type:"string",message:"redirectUri is not valid"},scope:{optional:!0,type:"string",message:"scope is not valid"},audience:{optional:!0,type:"string",message:"audience is not valid"},_disableDeprecationWarnings:{optional:!0,type:"boolean",message:"_disableDeprecationWarnings option is not valid"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"}}),this.baseOptions=e,this.baseOptions._sendTelemetry=!1!==this.baseOptions._sendTelemetry||this.baseOptions._sendTelemetry,this.baseOptions.rootUrl="https://"+this.baseOptions.domain,this.request=new Ot(this.baseOptions),this.passwordless=new Re(this.request,this.baseOptions),this.dbConnection=new Me(this.request,this.baseOptions),this.warn=new Dt({disableWarnings:!!e._disableDeprecationWarnings}),this.ssodataStorage=new It(this.baseOptions)}function Be(t){ht.check(t,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},token:{type:"string",message:"token option is required"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"}}),this.baseOptions=t,this.baseOptions.headers={Authorization:"Bearer "+this.baseOptions.token},this.request=new Ot(this.baseOptions),this.baseOptions.rootUrl=s("https://"+this.baseOptions.domain,"api","v2")}Ue.prototype.parseHash=function(t,e){var n,r;e||"function"!=typeof t?t=t||{}:(e=t,t={});var i=St.getWindow(),o=void 0===t.hash?i.location.hash:t.hash;if((n=function(t,e){var n=function(t){if(!t)return A;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?A.charset:t.charset;return{allowDots:void 0===t.allowDots?A.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:A.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:A.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:A.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:A.comma,decoder:"function"==typeof t.decoder?t.decoder:A.decoder,delimiter:"string"==typeof t.delimiter||l.isRegExp(t.delimiter)?t.delimiter:A.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:A.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:A.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:A.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:A.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:A.strictNullHandling}}(e);if(""===t||null==t)return n.plainObjects?Object.create(null):{};for(var r="string"==typeof t?function(t,e){var n,r={},i=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=e.parameterLimit===1/0?void 0:e.parameterLimit,s=i.split(e.delimiter,o),a=-1,u=e.charset;if(e.charsetSentinel)for(n=0;n-1&&(p=x(p)?[p]:p),S.call(r,c)?r[c]=l.combine(r[c],p):r[c]=p}return r}(t,n):t,i=n.plainObjects?Object.create(null):{},o=Object.keys(r),s=0;s0&&-1!==s.indexOf("token")&&!n.hasOwnProperty("access_token")?e(Pt.buildResponse("invalid_hash","response_type contains `token`, but the parsed hash does not contain an `access_token` property")):s.length>0&&-1!==s.indexOf("id_token")&&!n.hasOwnProperty("id_token")?e(Pt.buildResponse("invalid_hash","response_type contains `id_token`, but the parsed hash does not contain an `id_token` property")):this.validateAuthenticationResponse(t,n,e)},Ue.prototype.validateAuthenticationResponse=function(t,e,n){var r=this;t.__enableIdPInitiatedLogin=t.__enableIdPInitiatedLogin||t.__enableImpersonation;var i=e.state,o=this.transactionManager.getStoredTransaction(i),s=t.state||o&&o.state||null,a=s===i;if((i||s||!t.__enableIdPInitiatedLogin)&&!a)return n({error:"invalid_token",errorDescription:"`state` does not match."});var u=t.nonce||o&&o.nonce||null,c=t.state||o&&o.appState||null,p=function(t,i){return t?n(t):(o&&o.lastUsedConnection&&(i&&(s=i.sub),r.ssodataStorage.set(o.lastUsedConnection,s)),n(null,function(t,e,n){return{accessToken:t.access_token||null,idToken:t.id_token||null,idTokenPayload:n||null,appState:e||null,refreshToken:t.refresh_token||null,state:t.state||null,expiresIn:t.expires_in?parseInt(t.expires_in,10):null,tokenType:t.token_type||null,scope:t.scope||null}}(e,c,i)));var s};return e.id_token?this.validateToken(e.id_token,u,(function(t,n){if(!t)return e.access_token&&n.at_hash?(new me).validateAccessToken(e.access_token,"RS256",n.at_hash,(function(t){return t?p(Pt.invalidToken(t.message)):p(null,n)})):p(null,n);if("invalid_token"!==t.error||t.errorDescription&&t.errorDescription.indexOf("Nonce (nonce) claim value mismatch in the ID token")>-1)return p(t);var i=(new me).decode(e.id_token);return"HS256"!==i.header.alg?p(t):(i.payload.nonce||null)!==u?p({error:"invalid_token",errorDescription:'Nonce (nonce) claim value mismatch in the ID token; expected "'+u+'", found "'+i.payload.nonce+'"'}):e.access_token?r.client.userInfo(e.access_token,(function(t,e){return t?p(t):p(null,e)})):p({error:"invalid_token",description:"The id_token cannot be validated because it was signed with the HS256 algorithm and public clients (like a browser) can’t store secrets. Please read the associated doc for possible ways to fix this. Read more: https://auth0.com/docs/errors/libraries/auth0-js/invalid-token#parsing-an-hs256-signed-id-token-without-an-access-token"})})):p(null,null)},Ue.prototype.validateToken=function(t,e,n){new me({issuer:this.baseOptions.token_issuer,jwksURI:this.baseOptions.jwksURI,audience:this.baseOptions.clientID,leeway:this.baseOptions.leeway||60,maxAge:this.baseOptions.maxAge,__clock:this.baseOptions.__clock||Pe}).verify(t,e,(function(t,e){if(t)return n(Pt.invalidToken(t.message));n(null,e)}))},Ue.prototype.renewAuth=function(t,e){var n=!!t.usePostMessage,r=t.postMessageDataType||!1,i=t.postMessageOrigin||St.getWindow().origin,o=t.timeout,s=this,a=wt.merge(this.baseOptions,["clientID","redirectUri","responseType","scope","audience","_csrf","state","_intstate","nonce"]).with(t);a.responseType=a.responseType||"token",a.responseMode=a.responseMode||"fragment",a=this.transactionManager.process(a),ht.check(a,{type:"object",message:"options parameter is not valid"}),ht.check(e,{type:"function",message:"cb parameter is not valid"}),a.prompt="none",a=wt.blacklist(a,["usePostMessage","tenant","postMessageDataType","postMessageOrigin"]),Ce.create({authenticationUrl:this.client.buildAuthorizeUrl(a),postMessageDataType:r,postMessageOrigin:i,timeout:o}).login(n,(function(t,n){if("object"==typeof n)return e(t,n);s.parseHash({hash:n},e)}))},Ue.prototype.checkSession=function(t,e){var n=wt.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return"code"===n.responseType?e({error:"error",error_description:"responseType can't be `code`"}):(t.nonce||(n=this.transactionManager.process(n)),n.redirectUri?(ht.check(n,{type:"object",message:"options parameter is not valid"}),ht.check(e,{type:"function",message:"cb parameter is not valid"}),n=wt.blacklist(n,["usePostMessage","tenant","postMessageDataType"]),void this.webMessageHandler.run(n,Ut(e,{forceLegacyError:!0,ignoreCasing:!0}))):e({error:"error",error_description:"redirectUri can't be empty"}))},Ue.prototype.changePassword=function(t,e){return this.client.dbConnection.changePassword(t,e)},Ue.prototype.passwordlessStart=function(t,e){var n=wt.merge(this.baseOptions,["responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t.authParams);return t.authParams=this.transactionManager.process(n),this.client.passwordless.start(t,e)},Ue.prototype.signup=function(t,e){return this.client.dbConnection.signup(t,e)},Ue.prototype.authorize=function(t){var e=wt.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);ht.check(e,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),(e=this.transactionManager.process(e)).scope=e.scope||"openid profile email",St.redirect(this.client.buildAuthorizeUrl(e))},Ue.prototype.signupAndAuthorize=function(t,e){var n=this;return this.client.dbConnection.signup(wt.blacklist(t,["popupHandler"]),(function(r){if(r)return e(r);t.realm=t.connection,t.username||(t.username=t.email),n.client.login(t,e)}))},Ue.prototype.login=function(t,e){var n=wt.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);n=this.transactionManager.process(n),St.getWindow().location.host===this.baseOptions.domain?(n.connection=n.realm,delete n.realm,this._universalLogin.login(n,e)):this.crossOriginAuthentication.login(n,e)},Ue.prototype.passwordlessLogin=function(t,e){var n=wt.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);if(n=this.transactionManager.process(n),St.getWindow().location.host===this.baseOptions.domain)this.passwordlessVerify(n,e);else{var r=wt.extend({credentialType:"http://auth0.com/oauth/grant-type/passwordless/otp",realm:n.connection,username:n.email||n.phoneNumber,otp:n.verificationCode},wt.blacklist(n,["connection","email","phoneNumber","verificationCode"]));this.crossOriginAuthentication.login(r,e)}},Ue.prototype.crossOriginAuthenticationCallback=function(){this.crossOriginVerification()},Ue.prototype.crossOriginVerification=function(){this.crossOriginAuthentication.callback()},Ue.prototype.logout=function(t){St.redirect(this.client.buildLogoutUrl(t))},Ue.prototype.passwordlessVerify=function(t,e){var n=this,r=wt.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return ht.check(r,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),r=this.transactionManager.process(r),this.client.passwordless.verify(r,(function(t){return t?e(t):St.redirect(n.client.passwordless.buildVerifyUrl(r))}))},Ue.prototype.renderCaptcha=function(t,e,n){return qe(this.client,t,e,n)},Re.prototype.buildVerifyUrl=function(t){var e,n;return ht.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},verificationCode:{type:"string",message:"verificationCode option is required"},phoneNumber:{optional:!1,type:"string",message:"phoneNumber option is required",condition:function(t){return!t.email}},email:{optional:!1,type:"string",message:"email option is required",condition:function(t){return!t.phoneNumber}}}),e=wt.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","protocol","nonce"]).with(t),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e=wt.toSnakeCase(e,["auth0Client"]),n=E(e),s(this.baseOptions.rootUrl,"passwordless","verify_redirect","?"+n)},Re.prototype.start=function(t,e){var n,r;return ht.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},send:{type:"string",message:"send option is required",values:["link","code"],value_message:"send is not valid ([link, code])"},phoneNumber:{optional:!0,type:"string",message:"phoneNumber option is required",condition:function(t){return"code"===t.send||!t.email}},email:{optional:!0,type:"string",message:"email option is required",condition:function(t){return"link"===t.send||!t.phoneNumber}},authParams:{optional:!0,type:"object",message:"authParams option is required"}}),ht.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"passwordless","start"),(r=wt.merge(this.baseOptions,["clientID","responseType","redirectUri","scope"]).with(t)).scope&&(r.authParams=r.authParams||{},r.authParams.scope=r.authParams.scope||r.scope),r.redirectUri&&(r.authParams=r.authParams||{},r.authParams.redirect_uri=r.authParams.redirectUri||r.redirectUri),r.responseType&&(r.authParams=r.authParams||{},r.authParams.response_type=r.authParams.responseType||r.responseType),delete r.redirectUri,delete r.responseType,delete r.scope,r=wt.toSnakeCase(r,["auth0Client","authParams"]),this.request.post(n).send(r).end(Ut(e))},Re.prototype.verify=function(t,e){var n,r;return ht.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},verificationCode:{type:"string",message:"verificationCode option is required"},phoneNumber:{optional:!1,type:"string",message:"phoneNumber option is required",condition:function(t){return!t.email}},email:{optional:!1,type:"string",message:"email option is required",condition:function(t){return!t.phoneNumber}}}),ht.check(e,{type:"function",message:"cb parameter is not valid"}),r=wt.pick(t,["connection","verificationCode","phoneNumber","email","auth0Client"]),r=wt.toSnakeCase(r,["auth0Client"]),n=s(this.baseOptions.rootUrl,"passwordless","verify"),this.request.post(n).send(r).end(Ut(e))},Me.prototype.signup=function(t,e){var n,r,i;return ht.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},email:{type:"string",message:"email option is required"},password:{type:"string",message:"password option is required"}}),ht.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"dbconnections","signup"),i=(r=wt.merge(this.baseOptions,["clientID","state"]).with(t)).user_metadata||r.userMetadata,r=wt.blacklist(r,["scope","userMetadata","user_metadata"]),r=wt.toSnakeCase(r,["auth0Client"]),i&&(r.user_metadata=i),this.request.post(n).send(r).end(Ut(e))},Me.prototype.changePassword=function(t,e){var n,r;return ht.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},email:{type:"string",message:"email option is required"}}),ht.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"dbconnections","change_password"),r=wt.merge(this.baseOptions,["clientID"]).with(t,["email","connection"]),r=wt.toSnakeCase(r,["auth0Client"]),this.request.post(n).send(r).end(Ut(e))},Le.prototype.buildAuthorizeUrl=function(t){var e,n;return ht.check(t,{type:"object",message:"options parameter is not valid"}),e=wt.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience"]).with(t),ht.check(e,{type:"object",message:"options parameter is not valid"},{clientID:{type:"string",message:"clientID option is required"},redirectUri:{optional:!0,type:"string",message:"redirectUri option is required"},responseType:{type:"string",message:"responseType option is required"},nonce:{type:"string",message:"nonce option is required",condition:function(t){return-1===t.responseType.indexOf("code")&&-1!==t.responseType.indexOf("id_token")}},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e.connection_scope&&ht.isArray(e.connection_scope)&&(e.connection_scope=e.connection_scope.join(",")),e=wt.blacklist(e,["username","popupOptions","domain","tenant","timeout","appState"]),e=wt.toSnakeCase(e,["auth0Client"]),e=Bt(this.warn,e),n=E(e),s(this.baseOptions.rootUrl,"authorize","?"+n)},Le.prototype.buildLogoutUrl=function(t){var e,n;return ht.check(t,{optional:!0,type:"object",message:"options parameter is not valid"}),e=wt.merge(this.baseOptions,["clientID"]).with(t||{}),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e=wt.toSnakeCase(e,["auth0Client","returnTo"]),n=E(wt.blacklist(e,["federated"])),t&&void 0!==t.federated&&!1!==t.federated&&"false"!==t.federated&&(n+="&federated"),s(this.baseOptions.rootUrl,"v2","logout","?"+n)},Le.prototype.loginWithDefaultDirectory=function(t,e){return ht.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),t.grantType="password",this.oauthToken(t,e)},Le.prototype.login=function(t,e){return ht.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},realm:{type:"string",message:"realm option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),t.grantType="http://auth0.com/oauth/grant-type/password-realm",this.oauthToken(t,e)},Le.prototype.oauthToken=function(t,e){var n,r;return ht.check(t,{type:"object",message:"options parameter is not valid"}),ht.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"oauth","token"),r=wt.merge(this.baseOptions,["clientID","scope","audience"]).with(t),ht.check(r,{type:"object",message:"options parameter is not valid"},{clientID:{type:"string",message:"clientID option is required"},grantType:{type:"string",message:"grantType option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),r=wt.toSnakeCase(r,["auth0Client"]),r=Lt(this.warn,r),this.request.post(n).send(r).end(Ut(e))},Le.prototype.loginWithResourceOwner=function(t,e){var n,r;return ht.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},connection:{type:"string",message:"connection option is required"},scope:{optional:!0,type:"string",message:"scope option is required"}}),ht.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"oauth","ro"),r=wt.merge(this.baseOptions,["clientID","scope"]).with(t,["username","password","scope","connection","device"]),(r=wt.toSnakeCase(r,["auth0Client"])).grant_type=r.grant_type||"password",this.request.post(n).send(r).end(Ut(e))},Le.prototype.getSSOData=function(t,e){if(this.auth0||(this.auth0=new Ue(this.baseOptions)),St.getWindow().location.host===this.baseOptions.domain)return this.auth0._universalLogin.getSSOData(t,e);"function"==typeof t&&(e=t),ht.check(e,{type:"function",message:"cb parameter is not valid"});var n=this.baseOptions.clientID,r=this.ssodataStorage.get()||{};this.auth0.checkSession({responseType:"token id_token",scope:"openid profile email",connection:r.lastUsedConnection,timeout:5e3},(function(t,i){return t?"login_required"===t.error?e(null,{sso:!1}):("consent_required"===t.error&&(t.error_description="Consent required. When using `getSSOData`, the user has to be authenticated with the following scope: `openid profile email`."),e(t,{sso:!1})):r.lastUsedSub&&r.lastUsedSub!==i.idTokenPayload.sub?e(t,{sso:!1}):e(null,{lastUsedConnection:{name:r.lastUsedConnection},lastUsedUserID:i.idTokenPayload.sub,lastUsedUsername:i.idTokenPayload.email||i.idTokenPayload.name,lastUsedClientID:n,sessionClients:[n],sso:!0})}))},Le.prototype.userInfo=function(t,e){var n;return ht.check(t,{type:"string",message:"accessToken parameter is not valid"}),ht.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"userinfo"),this.request.get(n).set("Authorization","Bearer "+t).end(Ut(e,{ignoreCasing:!0}))},Le.prototype.getChallenge=function(t){if(ht.check(t,{type:"function",message:"cb parameter is not valid"}),!this.baseOptions.state)return t();var e=s(this.baseOptions.rootUrl,"usernamepassword","challenge");return this.request.post(e).send({state:this.baseOptions.state}).end(Ut(t,{ignoreCasing:!0}))},Le.prototype.delegation=function(t,e){var n,r;return ht.check(t,{type:"object",message:"options parameter is not valid"},{grant_type:{type:"string",message:"grant_type option is required"}}),ht.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"delegation"),r=wt.merge(this.baseOptions,["clientID"]).with(t),r=wt.toSnakeCase(r,["auth0Client"]),this.request.post(n).send(r).end(Ut(e))},Le.prototype.getUserCountry=function(t){var e;return ht.check(t,{type:"function",message:"cb parameter is not valid"}),e=s(this.baseOptions.rootUrl,"user","geoloc","country"),this.request.get(e).end(Ut(t))},Be.prototype.getUser=function(t,e){var n;return ht.check(t,{type:"string",message:"userId parameter is not valid"}),ht.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"users",t),this.request.get(n).end(Ut(e,{ignoreCasing:!0}))},Be.prototype.patchUserMetadata=function(t,e,n){var r;return ht.check(t,{type:"string",message:"userId parameter is not valid"}),ht.check(e,{type:"object",message:"userMetadata parameter is not valid"}),ht.check(n,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"users",t),this.request.patch(r).send({user_metadata:e}).end(Ut(n,{ignoreCasing:!0}))},Be.prototype.patchUserAttributes=function(t,e,n){var r;return ht.check(t,{type:"string",message:"userId parameter is not valid"}),ht.check(e,{type:"object",message:"user parameter is not valid"}),ht.check(n,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"users",t),this.request.patch(r).send(e).end(Ut(n,{ignoreCasing:!0}))},Be.prototype.linkUser=function(t,e,n){var r;return ht.check(t,{type:"string",message:"userId parameter is not valid"}),ht.check(e,{type:"string",message:"secondaryUserToken parameter is not valid"}),ht.check(n,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"users",t,"identities"),this.request.post(r).send({link_with:e}).end(Ut(n,{ignoreCasing:!0}))}}).call(this,n(1),n(2))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],p=!1,l=-1;function h(){p&&u&&(p=!1,u.length?c=u.concat(c):l=-1,c.length&&d())}function d(){if(!p){var t=a(h);p=!0;for(var e=c.length;e;){for(u=c,c=[];++l1)for(var n=1;n{try{if(t)return $(".pre-apply").show(),$(".application").hide(),$(".loading-icon").hide(),void Foundation.reInit("equalizer");const n=e.idToken,r=e.idTokenPayload;window._eduProgram.accessToken=n,$(".pre-apply").hide(),$(".loading-icon").show(),function(t){return $.ajax({type:"GET",url:"{{API_BASE_URL}}getApplications",async:!0,headers:{Authorization:t}})}(n).fail((function(t,e,n){alert("Failed retrieving existing apps. ("+t.statusText+"). Contact edu@neo4j.com if this persists.")})).done((function(t){if(t.applications.length>0){let e=0;if(t.applications.forEach((function(t){let n=$("#existing-applications-list-header").clone();n.find(".app-date").text(o(t.created_date)),n.find(".app-school-name").text(t.school_name),n.find(".app-status").text(t.status),n.find(".app-licenses").text(""),n.find(".license-expires").text(o(t.expires_date));for(let e in t.license_keys){const r=t.license_keys[e];n.find(".app-licenses").append(''+r.licensed_feature.replace("neo4j-","")+"  ")}n.insertAfter("#existing-applications-list-header"),"APPROVED"==t.status&&(e+=1)})),n){if($(".existing-applications").show(),$(".application").hide(),$(".application-toggle").show(),$(".loading-icon").hide(),e>0){const e=0;let n="available-downloads-list-header";const r=t.downloadUrls;let i=$("#available-downloads-list-header").clone();i.attr("id","available-downloads-list-row"+e),i.find(".release-product").text("Neo4j Desktop"),i.find(".release-version").text(r.version),i.find(".download-link").html('Windows   macOS   Linux'),i.insertAfter("#"+n),n="available-downloads-list-row"+e,$(".available-downloads").show()}Foundation.reInit("equalizer")}else $(".pre-apply").show(),$(".application").hide(),$(".loading-icon").hide(),Foundation.reInit("equalizer")}else 0==t.applications.length&&(n?($(".existing-applications").hide(),$(".application").show(),$(".loading-icon").hide(),Foundation.reInit("equalizer")):($(".pre-apply").show(),$(".loading-icon").hide(),$(".application").hide(),Foundation.reInit("equalizer")))})),$("#first-name").val(r.given_name),$("#last-name").val(r.family_name),$("#email").val(r.email)}catch(t){console.log(t)}})}))}]); \ No newline at end of file diff --git a/dist/license.js b/dist/license.js deleted file mode 100644 index 65a0df1..0000000 --- a/dist/license.js +++ /dev/null @@ -1 +0,0 @@ -!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=4)}([function(t,e,r){"use strict";(function(t,n){r.d(e,"a",(function(){return Ue}));var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var s=o((function(t){var e,r;e=i,r=function(){function t(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var r=t.shift();t[0]=r+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n0&&(i=i.replace(/^[\/]+/,"")),i=n0?"?":"")+s.join("&")}return function(){return t("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=r():e.urljoin=r()})),a=Object.prototype.hasOwnProperty,u=Array.isArray,c=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),p=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n1;){var e=t.pop(),r=e.obj[e.prop];if(u(r)){for(var n=[],i=0;i=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122?i+=n.charAt(o):s<128?i+=c[s]:s<2048?i+=c[192|s>>6]+c[128|63&s]:s<55296||s>=57344?i+=c[224|s>>12]+c[128|s>>6&63]+c[128|63&s]:(o+=1,s=65536+((1023&s)<<10|1023&n.charCodeAt(o)),i+=c[240|s>>18]+c[128|s>>12&63]+c[128|s>>6&63]+c[128|63&s])}return i},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(u(t)){for(var r=[],n=0;n-1?t.split(","):t},j=function(t,e,r,n){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(i),a=s?i.slice(0,s.index):i,u=[];if(a){if(!r.plainObjects&&S.call(Object.prototype,a)&&!r.allowPrototypes)return;u.push(a)}for(var c=0;r.depth>0&&null!==(s=o.exec(i))&&c=0;--o){var s,a=t[o];if("[]"===a&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var u="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,c=parseInt(u,10);r.parseArrays||""!==u?!isNaN(c)&&a!==u&&String(c)===u&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(s=[])[c]=i:s[u]=i:s={0:i}}i=s}return i}(u,e,r,n)}},E=function(t,e){var r,n=t,i=function(t){if(!t)return O;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||O.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=y.default;if(void 0!==t.format){if(!m.call(y.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=y.formatters[r],i=O.filter;return("function"==typeof t.filter||v(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:O.addQueryPrefix,allowDots:void 0===t.allowDots?O.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:O.charsetSentinel,delimiter:void 0===t.delimiter?O.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:O.encode,encoder:"function"==typeof t.encoder?t.encoder:O.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:O.encodeValuesOnly,filter:i,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:O.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:O.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:O.strictNullHandling}}(e);"function"==typeof i.filter?n=(0,i.filter)("",n):v(i.filter)&&(r=i.filter);var o,s=[];if("object"!=typeof n||null===n)return"";o=e&&e.arrayFormat in g?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var a=g[o];r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);for(var u=0;u0?h+p:""},I=o((function(t){function e(t){if(t)return function(t){for(var r in e.prototype)t[r]=e.prototype[r];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;ie?1:0}function L(t,e,r){var n,i=function t(e,r,n,i){var o;if("object"==typeof e&&null!==e){for(o=0;o0)for(var n=0;n=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){console.error(t)}if(e&&e.status&&e.status>=500&&501!==e.status)return!0;if(t){if(t.code&&F.includes(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},V.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},V.prototype.then=function(t,e){var r=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(t,e){n.on("abort",(function(){if(!(r._maxRetries&&r._maxRetries>r._retries))if(r.timedout&&r.timedoutError)e(r.timedoutError);else{var t=new Error("Aborted");t.code="ABORTED",t.status=r.status,t.method=r.method,t.url=r.url,e(t)}})),n.end((function(r,n){r?e(r):t(n)}))}))}return this._fullfilledPromise.then(t,e)},V.prototype.catch=function(t){return this.then(void 0,t)},V.prototype.use=function(t){return t(this),this},V.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},V.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},V.prototype.get=function(t){return this._header[t.toLowerCase()]},V.prototype.getHeader=V.prototype.get,V.prototype.set=function(t,e){if(H(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},V.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},V.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(H(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.field(r,t[r]);return this}if(Array.isArray(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.field(t,e[n]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=String(e)),this._getFormData().append(t,e),this},V.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},V.prototype._auth=function(t,e,r,n){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(t,":").concat(e))));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(t))}return this},V.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},V.prototype.redirects=function(t){return this._maxRedirects=t,this},V.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},V.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},V.prototype.send=function(t){var e=H(t),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&H(this._data))for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this._data[n]=t[n]);else"string"==typeof t?(r||this.type("form"),r=this._header["content-type"],this._data="application/x-www-form-urlencoded"===r?this._data?"".concat(this._data,"&").concat(t):t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||r||this.type("json"),this},V.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},V.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.includes("?")?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.slice(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,e)+"?"+r.join("&")}}},V.prototype._appendQueryString=function(){console.warn("Unsupported")},V.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error("".concat(t+e,"ms exceeded"));n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}},V.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))};var $=J;function J(t){if(t)return function(t){for(var e in J.prototype)Object.prototype.hasOwnProperty.call(J.prototype,e)&&(t[e]=J.prototype[e]);return t}(t)}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0||t instanceof Object)?e(t):null)},h.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot ".concat(e," ").concat(r," (").concat(this.status,")"),i=new Error(n);return i.status=this.status,i.method=e,i.url=r,i},o.Response=h,I(l.prototype),W(l.prototype),l.prototype.type=function(t){return this.set("Content-Type",o.types[t]||t),this},l.prototype.accept=function(t){return this.set("Accept",o.types[t]||t),this},l.prototype.auth=function(t,e,n){1===arguments.length&&(e=""),"object"===r(e)&&null!==e&&(n=e,e=""),n||(n={type:"function"==typeof btoa?"basic":"auto"});var i=function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(t,e,n,i)},l.prototype.query=function(t){return"string"!=typeof t&&(t=a(t)),t&&this._query.push(t),this},l.prototype.attach=function(t,e,r){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},l.prototype._getFormData=function(){return this._formData||(this._formData=new n.FormData),this._formData},l.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},l.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},l.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},l.prototype.ca=l.prototype.agent,l.prototype.buffer=l.prototype.ca,l.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},l.prototype.pipe=l.prototype.write,l.prototype._isHost=function(t){return t&&"object"===r(t)&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},l.prototype.end=function(t){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||i,this._finalizeQueryString(),this._end()},l.prototype._setUploadTimeout=function(){var t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},l.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var t=this;this.xhr=o.getXHR();var e=this.xhr,r=this._formData||this._data;this._setTimeouts(),e.onreadystatechange=function(){var r=e.readyState;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4===r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(t._uploadTimeoutTimer)),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.addEventListener("progress",n.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",n.bind(null,"upload"))}catch(t){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var i=this._header["content-type"],s=this._serializer||o.serialize[i?i.split(";")[0]:""];!s&&p(i)&&(s=o.serialize["application/json"]),s&&(r=s(r))}for(var a in this.header)null!==this.header[a]&&Object.prototype.hasOwnProperty.call(this.header,a)&&e.setRequestHeader(a,this.header[a]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===r?null:r)},o.agent=function(){return new Z},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(t){Z.prototype[t.toLowerCase()]=function(e,r){var n=new o.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}})),Z.prototype.del=Z.prototype.delete,o.get=function(t,e,r){var n=o("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},o.head=function(t,e,r){var n=o("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},o.options=function(t,e,r){var n=o("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},o.del=f,o.delete=f,o.patch=function(t,e,r){var n=o("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},o.post=function(t,e,r){var n=o("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},o.put=function(t,e,r){var n=o("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}})),G=(K.Request,[]),Y=[],tt=("undefined"!=typeof Uint8Array&&Uint8Array,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),et=0,rt=tt.length;et0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&e,[r,r===e?0:4-r%4]}function it(t,e,r){for(var n,i,o=[],s=e;s>18&63]+G[i>>12&63]+G[i>>6&63]+G[63&i]);return o.join("")}Y["-".charCodeAt(0)]=62,Y["_".charCodeAt(0)]=63;var ot=function(t){for(var e,r=t.length,n=r%3,i=[],o=0,s=r-n;os?s:o+16383));return 1===n?(e=t[r-1],i.push(G[e>>2]+G[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],i.push(G[e>>10]+G[e>>4&63]+G[e<<2&63]+"=")),i.join("")},st=function(t){return ot(function(t){for(var e=new Array(t.length),r=0;r=65&&e<=90||!i&&e>=48&&e<=57?(r+="_",r+=t[n].toLowerCase()):r+=t[n].toLowerCase(),i=e>=48&&e<=57,o=e>=65&&e<=90,n++;return r}(i):i]=t(e[i]),n}),{}))},toCamelCase:function t(e,r,n){return"object"!=typeof e||lt.isArray(e)||null===e?e:(r=r||[],n=n||{},Object.keys(e).reduce((function(i,o){var s,a=-1===r.indexOf(o)?(s=o.split("_")).reduce((function(t,e){return t+e.charAt(0).toUpperCase()+e.slice(1)}),s.shift()):o;return i[a]=t(e[a]||e[o],[],n),n.keepOriginal&&(i[o]=t(e[o],[],n)),i}),{}))},blacklist:function(t,e){return Object.keys(t).reduce((function(r,n){return-1===e.indexOf(n)&&(r[n]=t[n]),r}),{})},merge:function(t,e){return{base:e?yt(t,e):t,with:function(t,e){return t=e?yt(t,e):t,gt(this.base,t)}}},pick:yt,getKeysNotIn:function(t,e){var r=[];for(var n in t)-1===e.indexOf(n)&&r.push(n);return r},extend:gt,getOriginFromUrl:function(t){if(t){var e=vt(t);if(!e)return null;var r=e.protocol+"//"+e.hostname;return e.port&&(r+=":"+e.port),r}},getLocationFromUrl:vt,trimUserDetails:function(t){return function(t,e){return["username","email","phoneNumber"].reduce(bt,t)}(t)},updatePropertyOn:function t(e,r,n){"string"==typeof r&&(r=r.split("."));var i=r[0];e.hasOwnProperty(i)&&(1===r.length?e[i]=n:t(e[i],r.slice(1),n))}};function _t(t){this.request=t,this.method=t.method,this.url=t.url,this.body=t._data,this.headers=t._header}function Tt(t){this.request=t}function Ot(t){this._sendTelemetry=!1!==t._sendTelemetry||t._sendTelemetry,this._telemetryInfo=t._telemetryInfo||null,this._timesToRetryFailedRequests=t._timesToRetryFailedRequests,this.headers=t.headers||{},this._universalLoginPage=t.universalLoginPage}function kt(){return window}_t.prototype.abort=function(){this.request.abort()},_t.prototype.getMethod=function(){return this.method},_t.prototype.getBody=function(){return this.body},_t.prototype.getUrl=function(){return this.url},_t.prototype.getHeaders=function(){return this.headers},Tt.prototype.set=function(t,e){return this.request=this.request.set(t,e),this},Tt.prototype.send=function(t){return this.request=this.request.send(wt.trimUserDetails(t)),this},Tt.prototype.withCredentials=function(){return this.request=this.request.withCredentials(),this},Tt.prototype.end=function(t){return this.request.end(t),new _t(this.request)},Ot.prototype.setCommonConfiguration=function(t,e){if(e=e||{},this._timesToRetryFailedRequests>0&&(t=t.retry(this._timesToRetryFailedRequests)),e.noHeaders)return t;var r=this.headers;t=t.set("Content-Type","application/json");for(var n=Object.keys(this.headers),i=0;i0&&t.warning("Following parameters are not allowed on the `/authorize` endpoint: ["+r.join(",")+"]"),e},Nt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function Ht(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},r.exports),r.exports}var zt=Ht((function(t,e){t.exports=function(){function t(t){return"function"==typeof t}var e=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=0,i=void 0,o=void 0,s=function(t,e){f[r]=t,f[r+1]=e,2===(r+=2)&&(o?o(d):b())},a="undefined"!=typeof window?window:void 0,u=a||{},c=u.MutationObserver||u.WebKitMutationObserver,p="undefined"==typeof self&&void 0!==n&&"[object process]"==={}.toString.call(n),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function l(){var t=setTimeout;return function(){return t(d,1)}}var f=new Array(1e3);function d(){for(var t=0;t>>2]|=(r[o>>>2]>>>24-o%4*8&255)<<24-(n+o)%4*8;else for(o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r,n=[],i=function(e){e=e;var r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n;return i/=4294967296,(i+=.5)*(t.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new s.init(r,e/2)}},c=a.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255));return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new s.init(r,e)}},p=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},h=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,a=i/(4*o),u=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*o,c=t.min(4*u,i);if(u){for(var p=0;p>>7)^(d<<14|d>>>18)^d>>>3)+c[f-7]+((y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10)+c[f-16]}var m=n&i^n&o^i&o,g=l+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&p^~a&h)+u[f]+c[f];l=h,h=p,p=a,a=s+g|0,s=o,o=i,i=n,n=g+(((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+m)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+p|0,r[6]=r[6]+h|0,r[7]=r[7]+l|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(p),e.HmacSHA256=o._createHmacHelper(p)}(Math),r.SHA256)})),Ft=Ht((function(t,e){var r,n;t.exports=(r=(n=Wt).lib.WordArray,n.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(t){var e=t.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>6-s%4*2;i[o>>>2]|=(a|u)<<24-o%4*8,o++}return r.create(i,o)}(t,e,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},n.enc.Base64)})),$t=Ht((function(t,e){t.exports=Wt.enc.Hex})),Jt=Ht((function(t,e){(function(){var e;function r(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):this.fromString(t,null==e&&"string"!=typeof t?256:e))}function n(){return new r(null)}var i="undefined"!=typeof navigator;i&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function(t,e,r,n,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],c=this[t++]>>15,p=a*u+c*s;i=((u=s*u+((32767&p)<<15)+r[n]+(1073741823&i))>>>30)+(p>>>15)+a*c+(i>>>30),r[n++]=1073741823&u}return i},e=30):i&&"Netscape"!=navigator.appName?(r.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var s=e*this[t++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i},e=26):(r.prototype.am=function(t,e,r,n,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],c=this[t++]>>14,p=a*u+c*s;i=((u=s*u+((16383&p)<<14)+r[n]+i)>>28)+(p>>14)+a*c,r[n++]=268435455&u}return i},e=28),r.prototype.DB=e,r.prototype.DM=(1<>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function l(t){this.m=t}function f(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function b(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function w(){}function _(t){return t}function T(t){this.r2=n(),this.q3=n(),r.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}l.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},l.prototype.revert=function(t){return t},l.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},l.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},l.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},f.prototype.convert=function(t){var e=n();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(r.ZERO)>0&&this.m.subTo(e,e),e},f.prototype.revert=function(t){var e=n();return t.copyTo(e),this.reduce(e),e},f.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},f.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},f.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},r.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},r.prototype.fromString=function(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var i=t.length,o=!1,s=0;--i>=0;){var a=8==n?255&t[i]:c(t,i);a<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<>this.DB-s):this[this.t-1]|=a<=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},r.prototype.drShiftTo=function(t,e){for(var r=t;r=0;--r)e[r+s+1]=this[r]>>i|a,a=(this[r]&o)<=0;--r)e[r]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<>n;for(var s=r+1;s>n;n>0&&(e[this.t-r-1]|=(this.s&o)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()},r.prototype.multiplyTo=function(t,e){var n=this.abs(),i=t.abs(),o=n.t;for(e.t=o+i.t;--o>=0;)e[o]=0;for(o=0;o=0;)t[r]=0;for(r=0;r=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function(t,e,i){var o=t.abs();if(!(o.t<=0)){var s=this.abs();if(s.t0?(o.lShiftTo(p,a),s.lShiftTo(p,i)):(o.copyTo(a),s.copyTo(i));var l=a.t,f=a[l-1];if(0!=f){var d=f*(1<1?a[l-2]>>this.F2:0),y=this.FV/d,m=(1<=0&&(i[i.t++]=1,i.subTo(w,i)),r.ONE.dlShiftTo(l,w),w.subTo(a,a);a.t=0;){var _=i[--v]==f?this.DM:Math.floor(i[v]*y+(i[v-1]+g)*m);if((i[v]+=a.am(0,_,i,b,0,l))<_)for(a.dlShiftTo(b,w),i.subTo(w,i);i[v]<--_;)i.subTo(w,i)}null!=e&&(i.drShiftTo(l,e),u!=c&&r.ZERO.subTo(e,e)),i.t=l,i.clamp(),p>0&&i.rShiftTo(p,i),u<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},r.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function(t,e){if(t>4294967295||t<1)return r.ONE;var i=n(),o=n(),s=e.convert(this),a=h(t)-1;for(s.copyTo(i);--a>=0;)if(e.sqrTo(i,o),(t&1<0)e.mulTo(o,s,i);else{var u=i;i=o,o=u}return e.revert(i)},r.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<0)for(a>a)>0&&(i=!0,o=u(r));s>=0;)a>(a+=this.DB-e)):(r=this[s]>>(a-=e)&n,a<=0&&(a+=this.DB,--s)),r>0&&(i=!0),i&&(o+=u(r));return i?o:"0"},r.prototype.negate=function(){var t=n();return r.ZERO.subTo(this,t),t},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+h(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(t){var e=n();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e},r.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new l(e):new f(e),this.exp(t,r)},r.ZERO=p(0),r.ONE=p(1),w.prototype.convert=_,w.prototype.revert=_,w.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},w.prototype.sqrTo=function(t,e){t.squareTo(e)},T.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=n();return t.copyTo(e),this.reduce(e),e},T.prototype.revert=function(t){return t},T.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},T.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},T.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var O,k,S,x=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],A=(1<<26)/x[x.length-1];function C(){var t;t=(new Date).getTime(),k[S++]^=255&t,k[S++]^=t>>8&255,k[S++]^=t>>16&255,k[S++]^=t>>24&255,S>=U&&(S-=U)}if(r.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),i=p(r),o=n(),s=n(),a="";for(this.divRemTo(i,o,s);o.signum()>0;)a=(r+s.intValue()).toString(t).substr(1)+a,o.divRemTo(i,o,s);return s.intValue().toString(t)+a},r.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),i=Math.pow(e,n),o=!1,s=0,a=0,u=0;u=n&&(this.dMultiply(i),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),o&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(t,e,n){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),y,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var i=new Array,o=7&t;i.length=1+(t>>3),e.nextBytes(i),o>0?i[0]&=(1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},r.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},r.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i=0;)r[n]=0;for(n=Math.max(e-this.t,0);n0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},r.prototype.millerRabin=function(t){var e=this.subtract(r.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var o=e.shiftRight(i);(t=t+1>>1)>x.length&&(t=x.length);for(var s=n(),a=0;a>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<=0;)n<8?(r=(this[t]&(1<>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},r.prototype.equals=function(t){return 0==this.compareTo(t)},r.prototype.min=function(t){return this.compareTo(t)<0?this:t},r.prototype.max=function(t){return this.compareTo(t)>0?this:t},r.prototype.and=function(t){var e=n();return this.bitwiseTo(t,d,e),e},r.prototype.or=function(t){var e=n();return this.bitwiseTo(t,y,e),e},r.prototype.xor=function(t){var e=n();return this.bitwiseTo(t,m,e),e},r.prototype.andNot=function(t){var e=n();return this.bitwiseTo(t,g,e),e},r.prototype.not=function(){for(var t=n(),e=0;e=this.t?0!=this.s:0!=(this[e]&1<1){var y=n();for(i.sqrTo(a[1],y);u<=d;)a[u]=n(),i.mulTo(y,a[u-2],a[u]),u+=2}var m,g,v=t.t-1,b=!0,w=n();for(o=h(t[v])-1;v>=0;){for(o>=c?m=t[v]>>o-c&d:(m=(t[v]&(1<0&&(m|=t[v-1]>>this.DB+o-c)),u=r;0==(1&m);)m>>=1,--u;if((o-=u)<0&&(o+=this.DB,--v),b)a[m].copyTo(s),b=!1;else{for(;u>1;)i.sqrTo(s,w),i.sqrTo(w,s),u-=2;u>0?i.sqrTo(s,w):(g=s,s=w,w=g),i.mulTo(w,a[m],s)}for(;v>=0&&0==(t[v]&1<=0?(n.subTo(i,n),e&&o.subTo(a,o),s.subTo(u,s)):(i.subTo(n,i),e&&a.subTo(o,a),u.subTo(s,u))}return 0!=i.compareTo(r.ONE)?r.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},r.prototype.pow=function(t){return this.exp(t,new w)},r.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(i0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},r.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=x[x.length-1]){for(e=0;e>>8,k[S++]=255&D;S=0,C()}function I(){if(null==O){for(C(),(O=new P).init(k),S=0;S0&&e.length>0))throw new Error("Invalid key data");this.n=new Jt.BigInteger(t,16),this.e=parseInt(e,16)}Zt.prototype.verify=function(t,e){e=e.replace(/[^0-9a-f]|[\s\n]]/gi,"");var r=new Jt.BigInteger(e,16);if(r.bitLength()>this.n.bitLength())throw new Error("Signature does not match with the key modulus.");var n=function(t){for(var e in Xt){var r=Xt[e],n=r.length;if(t.substring(0,n)===r)return{alg:e,hash:t.substring(n)}}return[]}(r.modPowInt(this.e,this.n).toString(16).replace(/^1f+00/,""));if(0===n.length)return!1;if(!Qt.hasOwnProperty(n.alg))throw new Error("Hashing algorithm is not supported.");var i=Qt[n.alg](t).toString();return n.hash===i};for(var Kt=[],Gt=[],Yt="undefined"!=typeof Uint8Array?Uint8Array:Array,te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ee=0,re=te.length;ee0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}(t),i=n[0],o=n[1],s=new Yt(function(t,e,r){return 3*(e+r)/4-r}(0,i,o)),a=0,u=o>0?i-4:i;for(r=0;r>16&255,s[a++]=e>>8&255,s[a++]=255&e;return 2===o&&(e=Gt[t.charCodeAt(r)]<<2|Gt[t.charCodeAt(r+1)]>>4,s[a++]=255&e),1===o&&(e=Gt[t.charCodeAt(r)]<<10|Gt[t.charCodeAt(r+1)]<<4|Gt[t.charCodeAt(r+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e),s};function ie(t){var e=t.length%4;return 0===e?t:t+new Array(4-e+1).join("=")}function oe(t){return t=ie(t).replace(/\-/g,"+").replace(/_/g,"/"),decodeURIComponent(function(t){for(var e="",r=0;r1){var r=t.shift();t[0]=r+t[0]}t[0]=t[0].match(/^file:\/\/\//)?t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n0&&(i=i.replace(/^[\/]+/,"")),i=i.replace(/[\/]+$/,n0?"?":"")+s.join("&")}return function(){return t("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=r():e.urljoin=r()}));function ue(t,e){return e=e||{},new Promise((function(r,n){var i=new XMLHttpRequest,o=[],s=[],a={},u=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return s},get:function(t){return a[t.toLowerCase()]},has:function(t){return t.toLowerCase()in a}}}};for(var c in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,r){o.push(e=e.toLowerCase()),s.push([e,r]),a[e]=a[e]?a[e]+","+r:r})),r(u())},i.onerror=n,i.withCredentials="include"==e.credentials,e.headers)i.setRequestHeader(c,e.headers[c]);i.send(e.body||null)}))}function ce(t){if(t.ok)return t.json();var e=new Error(t.statusText);return e.response=t,Promise.reject(e)}function pe(t){this.name="ConfigurationError",this.message=t||""}function he(t){this.name="TokenValidationError",this.message=t||""}pe.prototype=Error.prototype,he.prototype=Error.prototype;var le=function(){function t(){}var e=t.prototype;return e.get=function(){return null},e.has=function(){return null},e.set=function(){return null},t}();zt.polyfill();var fe=function(t){return"number"==typeof t},de=function(){return new Date};function ye(t){var e=t||{};if(this.jwksCache=e.jwksCache||new le,this.expectedAlg=e.expectedAlg||"RS256",this.issuer=e.issuer,this.audience=e.audience,this.leeway=0===e.leeway?0:e.leeway||60,this.jwksURI=e.jwksURI,this.maxAge=e.maxAge,this.__clock="function"==typeof e.__clock?e.__clock:de,this.leeway<0||this.leeway>300)throw new pe("The leeway should be positive and lower than five minutes.");if("RS256"!==this.expectedAlg)throw new pe('Signature algorithm of "'+this.expectedAlg+'" is not supported. Expected the ID token to be signed with "RS256".')}function me(t,e){this.plugins=e;for(var r=0;r1){if(!d||"string"!=typeof d)return r(new he("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values",!1));if(d!==v.audience)return r(new he('Authorized Party (azp) claim mismatch in the ID token; expected "'+v.audience+'", found "'+d+'"',!1))}if(!h||!fe(h))return r(new he("Expiration Time (exp) claim must be a number present in the ID token",!1));if(!f||!fe(f))return r(new he("Issued At (iat) claim must be a number present in the ID token"));var a=h+v.leeway,b=new Date(0);if(b.setUTCSeconds(a),g>b)return r(new he('Expiration Time (exp) claim error in the ID token; current time "'+g+'" is after expiration time "'+b+'"',!1));if(l&&fe(l)){var w=l-v.leeway,_=new Date(0);if(_.setUTCSeconds(w),g<_)return r(new he('Not Before Time (nbf) claim error in the ID token; current time "'+g+'" is before the not before time "'+_+'"'))}if(v.maxAge){if(!y||!fe(y))return r(new he("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified"));var T=y+v.maxAge+v.leeway,O=new Date(0);if(O.setUTCSeconds(T),g>O)return r(new he('Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time "'+g+'" is after last auth time at "'+O+'"'))}return r(null,n.payload)}))},ye.prototype.getRsaVerifier=function(t,e,r){var n=this,i=t+e;Promise.resolve(this.jwksCache.has(i)).then((function(r){return r?n.jwksCache.get(i):(o={jwksURI:n.jwksURI,iss:t,kid:e},("undefined"==typeof fetch?ue:fetch)(o.jwksURI||ae(o.iss,".well-known","jwks.json")).then(ce).then((function(t){var e,r,n,i=null;for(e=0;e-1&&null!==new RegExp("rv:([0-9]{2,2}[.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1)),t>=8}();return"undefined"!=typeof window&&window.JSON&&window.JSON.stringify&&window.JSON.parse&&window.postMessage?{open:function(i,o){if(!o)throw"missing required callback argument";var s,a;i.url||(s="missing required 'url' parameter"),i.relay_url||(s="missing required 'relay_url' parameter"),s&&setTimeout((function(){o(s)}),0),i.window_name||(i.window_name=null),i.window_features&&!function(){try{var t=navigator.userAgent;return-1!=t.indexOf("Fennec/")||-1!=t.indexOf("Firefox/")&&-1!=t.indexOf("Android")}catch(t){}return!1}()||(i.window_features=void 0);var u,c=i.origin||r(i.url);if(c!==r(i.relay_url))return setTimeout((function(){o("invalid arguments: origin of url and relay_url must match")}),0);n&&((a=document.createElement("iframe")).setAttribute("src",i.relay_url),a.style.display="none",a.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(a),u=a.contentWindow);var p=i.popup||window.open(i.url,i.window_name,i.window_features);i.popup&&(p.location.href=i.url),u||(u=p);var h=setInterval((function(){p&&p.closed&&(f(),o&&(o("User closed the popup window"),o=null))}),500),l=JSON.stringify({a:"request",d:i.params});function f(){if(a&&document.body.removeChild(a),a=void 0,h&&(h=clearInterval(h)),e(window,"message",d),e(window,"unload",f),p)try{p.close()}catch(t){u.postMessage("die",c)}p=u=void 0}function d(t){if(t.origin===c){try{var e=JSON.parse(t.data)}catch(t){if(o)return o(t);throw t}"ready"===e.a?u.postMessage(l,c):"error"===e.a?(f(),o&&(o(e.d),o=null)):"response"===e.a&&(f(),o&&(o(null,e.d),o=null))}}return t(window,"unload",f),t(window,"message",d),{originalPopup:p,close:f,focus:function(){if(p)try{p.focus()}catch(t){}}}},onOpen:function(r){var i="*",o=n?function(){for(var t=window.opener.frames,e=t.length-1;e>=0;e--)try{if(t[e].location.protocol===window.location.protocol&&t[e].location.host===window.location.host&&"__winchan_relay_frame"===t[e].name)return t[e]}catch(t){}}():window.opener;if(!o)throw"can't find relay frame";function s(t){t=JSON.stringify(t),n?o.doPost(t,i):o.postMessage(t,i)}function a(t){if("die"===t.data)try{window.close()}catch(t){}}t(n?o:window,"message",(function t(n){var o;try{o=JSON.parse(n.data)}catch(t){}o&&"request"===o.a&&(e(window,"message",t),i=n.origin,r&&setTimeout((function(){r(i,o.d,(function(t){r=void 0,s({a:"response",d:t})}))}),0))})),t(n?o:window,"message",a);try{s({a:"ready"})}catch(e){t(o,"load",(function(t){s({a:"ready"})}))}var u=function(){try{e(n?o:window,"message",a)}catch(t){}r&&s({a:"error",d:"client closed window"}),r=void 0;try{window.close()}catch(t){}};return t(window,"unload",u),{detach:function(){e(window,"unload",u)}}}}:{open:function(t,e,r,n){setTimeout((function(){n("unsupported browser")}),0)},onOpen:function(t){setTimeout((function(){t("unsupported browser")}),0)}}}();t.exports&&(t.exports=e)})),Se=function(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[-_a-zA-Z.0-9:]+)/.exec(t);return e?e[1]:t};function xe(){this._current_popup=null}function Ae(t,e){this.baseOptions=e,this.baseOptions.popupOrigin=e.popupOrigin,this.client=t.client,this.webAuth=t,this.transactionManager=new ve(this.baseOptions),this.crossOriginAuthentication=new _e(t,this.baseOptions),this.warn=new Dt({disableWarnings:!!e._disableDeprecationWarnings})}function Ce(t){this.authenticationUrl=t.authenticationUrl,this.timeout=t.timeout||6e4,this.handler=null,this.postMessageDataType=t.postMessageDataType||!1,this.postMessageOrigin=t.postMessageOrigin||St.getWindow().location.origin||St.getWindow().location.protocol+"//"+St.getWindow().location.hostname+(St.getWindow().location.port?":"+St.getWindow().location.port:"")}function De(t){this.baseOptions=t,this.request=new Ot(t),this.transactionManager=new ve(this.baseOptions)}function je(t,e){this.baseOptions=e,this.client=t,this.baseOptions.universalLoginPage=!0,this.request=new Ot(this.baseOptions),this.warn=new Dt({disableWarnings:!!e._disableDeprecationWarnings})}xe.prototype.calculatePosition=function(t){var e=t.width||500,r=t.height||600,n=St.getWindow(),i=void 0!==n.screenX?n.screenX:n.screenLeft,o=void 0!==n.screenY?n.screenY:n.screenTop,s=void 0!==n.outerWidth?n.outerWidth:n.document.body.clientWidth,a=void 0!==n.outerHeight?n.outerHeight:n.document.body.clientHeight;return{width:e,height:r,left:t.left||i+(s-e)/2,top:t.top||o+(a-r)/2}},xe.prototype.preload=function(t){var e=this,r=St.getWindow(),n=this.calculatePosition(t.popupOptions||{}),i=wt.merge(n).with(t.popupOptions),o=t.url||"about:blank",s=E(i,{encode:!1,delimiter:","});return this._current_popup&&!this._current_popup.closed||(this._current_popup=r.open(o,"auth0_signup_popup",s),this._current_popup.kill=function(){this.close(),e._current_popup=null}),this._current_popup},xe.prototype.load=function(t,e,r,n){var i=this,o=this.calculatePosition(r.popupOptions||{}),s=wt.merge(o).with(r.popupOptions),a=wt.merge({url:t,relay_url:e,window_features:E(s,{delimiter:",",encode:!1}),popup:this._current_popup}).with(r),u=ke.open(a,(function(t,e){if(!t||"SyntaxError"!==t.name)return i._current_popup=null,n(t,e)}));return u.focus(),u},Ae.prototype.buildPopupHandler=function(){var t=this.baseOptions.plugins.get("popup.getPopupHandler");return t?t.getPopupHandler():new xe},Ae.prototype.preload=function(t){t=t||{};var e=this.buildPopupHandler();return e.preload(t),e},Ae.prototype.getPopupHandler=function(t,e){return t.popupHandler?t.popupHandler:e?this.preload(t):this.buildPopupHandler()},Ae.prototype.callback=function(t){var e=this,r=St.getWindow(),n=(t=t||{}).popupOrigin||this.baseOptions.popupOrigin||St.getOrigin();r.opener?ke.onOpen((function(r,i,o){if(r!==n)return o({error:"origin_mismatch",error_description:"The popup's origin ("+r+") should match the `popupOrigin` parameter ("+n+")."});e.webAuth.parseHash(t||{},(function(t,e){return o(t||e)}))})):r.doPost=function(t){r.parent&&r.parent.postMessage(t,n)}},Ae.prototype.authorize=function(t,e){var r,n,i={},o=this.baseOptions.plugins.get("popup.authorize"),a=wt.merge(this.baseOptions,["clientID","scope","domain","audience","tenant","responseType","redirectUri","_csrf","state","_intstate","nonce"]).with(wt.blacklist(t,["popupHandler"]));return lt.check(a,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),n=s(this.baseOptions.rootUrl,"relay.html"),t.owp?a.owp=!0:(i.origin=Se(a.redirectUri),n=a.redirectUri),t.popupOptions&&(i.popupOptions=wt.pick(t.popupOptions,["width","height","top","left"])),o&&(a=o.processParams(a)),(a=this.transactionManager.process(a)).scope=a.scope||"openid profile email",delete a.domain,r=this.client.buildAuthorizeUrl(a),this.getPopupHandler(t).load(r,n,i,Ut(e,{keepOriginalCasing:!0}))},Ae.prototype.loginWithCredentials=function(t,e){t.realm=t.realm||t.connection,t.popup=!0,t=wt.merge(this.baseOptions,["redirectUri","responseType","state","nonce"]).with(wt.blacklist(t,["popupHandler","connection"])),t=this.transactionManager.process(t),this.crossOriginAuthentication.login(t,e)},Ae.prototype.passwordlessVerify=function(t,e){var r=this;return this.client.passwordless.verify(wt.blacklist(t,["popupHandler"]),(function(n){if(n)return e(n);t.username=t.phoneNumber||t.email,t.password=t.verificationCode,delete t.email,delete t.phoneNumber,delete t.verificationCode,delete t.type,r.client.loginWithResourceOwner(t,e)}))},Ae.prototype.signupAndLogin=function(t,e){var r=this;return this.client.dbConnection.signup(t,(function(n){if(n)return e(n);r.loginWithCredentials(t,e)}))},Ce.create=function(t){return new Ce(t)},Ce.prototype.login=function(t,e){this.handler=new be({auth0:this.auth0,url:this.authenticationUrl,eventListenerType:t?"message":"load",callback:this.getCallbackHandler(e,t),timeout:this.timeout,eventValidator:this.getEventValidator(),timeoutCallback:function(){e(null,"#error=timeout&error_description=Timeout+during+authentication+renew.")},usePostMessage:t||!1}),this.handler.init()},Ce.prototype.getEventValidator=function(){var t=this;return{isValid:function(e){switch(e.event.type){case"message":return e.event.origin===t.postMessageOrigin&&e.event.source===t.handler.iframe.contentWindow&&(!1===t.postMessageDataType||e.event.data.type&&e.event.data.type===t.postMessageDataType);case"load":if("about:"===e.sourceObject.contentWindow.location.protocol)return!1;default:return!0}}}},Ce.prototype.getCallbackHandler=function(t,e){return function(r){var n;n=e?"object"==typeof r.event.data&&r.event.data.hash?r.event.data.hash:r.event.data:r.sourceObject.contentWindow.location.hash,t(null,n)}},De.prototype.login=function(t,e){var r,n;return r=s(this.baseOptions.rootUrl,"usernamepassword","login"),t.username=t.username||t.email,t=wt.blacklist(t,["email"]),n=wt.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience"]).with(t),n=this.transactionManager.process(n),n=wt.toSnakeCase(n,["auth0Client"]),this.request.post(r).send(n).end(Ut(e))},De.prototype.callback=function(t){var e,r=St.getDocument();(e=r.createElement("div")).innerHTML=t,r.body.appendChild(e).children[0].submit()},je.prototype.login=function(t,e){if(St.getWindow().location.host!==this.baseOptions.domain)throw new Error("This method is meant to be used only inside the Universal Login Page.");var r,n=wt.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return lt.check(n,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),(r=new De(this.baseOptions)).login(n,(function(t,n){return t?e(t):r.callback(n)}))},je.prototype.signupAndLogin=function(t,e){var r=this;return r.client.client.dbConnection.signup(t,(function(n){return n?e(n):r.login(t,e)}))},je.prototype.getSSOData=function(t,e){var r,n="";return"function"==typeof t&&(e=t,t=!1),lt.check(t,{type:"boolean",message:"withActiveDirectories parameter is not valid"}),lt.check(e,{type:"function",message:"cb parameter is not valid"}),t&&(n="?"+E({ldaps:1,client_id:this.baseOptions.clientID})),r=s(this.baseOptions.rootUrl,"user","ssodata",n),this.request.get(r,{noHeaders:!0}).withCredentials().end(Ut(e))};var Ee=function(){},Ie={lang:"en",templates:{auth0:function(t){var e="code"===t.type?"Enter the code shown above":"Solve the formula shown above";return'
\n \n \n
\n'},recaptcha_v2:function(){return'
'},error:function(){return'
Error getting the bot detection challenge. Please contact the system administrator.
'}}};var qe=function(t,e,r,n){function i(n){n=n||Ee,t.getChallenge((function(t,o){return t?(e.innerHTML=r.templates.error(t),n(t)):o.required?(e.style.display="","auth0"===o.provider?function(t,e,r,n){t.innerHTML=e.templates[r.provider](r),t.querySelector(".captcha-reload").addEventListener("click",(function(t){t.preventDefault(),n()}))}(e,r,o,i):"recaptcha_v2"===o.provider&&function(t,e,r){var n=t.hasAttribute("data-wid")&&t.getAttribute("data-wid");function i(e){t.querySelector('input[name="captcha"]').value=e||""}if(n)return i(),void window.grecaptcha.reset(n);t.innerHTML=e.templates[r.provider](r);var o=t.querySelector(".recaptcha");!function(t,e,r){var n="recaptchaCallback_"+Math.floor(1000001*Math.random());window[n]=function(){delete window[n],r()};var i=window.document.createElement("script");i.src="https://www.google.com/recaptcha/api.js?hl="+e+"&onload="+n,i.async=!0,window.document.body.appendChild(i)}(0,e.lang,(function(){n=window.grecaptcha.render(o,{callback:i,"expired-callback":function(){i()},"error-callback":function(){i()},sitekey:r.siteKey}),t.setAttribute("data-wid",n)}))}(e,r,o),void n()):(e.style.display="none",void(e.innerHTML=""))}))}return r=wt.merge(Ie).with(r||{}),i(n),{reload:i,getValue:function(){var t=e.querySelector('input[name="captcha"]');if(t)return t.value}}};function Pe(){return new Date}function Ue(t){lt.check(t,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},clientID:{type:"string",message:"clientID option is required"},responseType:{optional:!0,type:"string",message:"responseType is not valid"},responseMode:{optional:!0,type:"string",message:"responseMode is not valid"},redirectUri:{optional:!0,type:"string",message:"redirectUri is not valid"},scope:{optional:!0,type:"string",message:"scope is not valid"},audience:{optional:!0,type:"string",message:"audience is not valid"},popupOrigin:{optional:!0,type:"string",message:"popupOrigin is not valid"},leeway:{optional:!0,type:"number",message:"leeway is not valid"},plugins:{optional:!0,type:"array",message:"plugins is not valid"},maxAge:{optional:!0,type:"number",message:"maxAge is not valid"},_disableDeprecationWarnings:{optional:!0,type:"boolean",message:"_disableDeprecationWarnings option is not valid"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"},_timesToRetryFailedRequests:{optional:!0,type:"number",message:"_timesToRetryFailedRequests option is not valid"}}),t.overrides&<.check(t.overrides,{type:"object",message:"overrides option is not valid"},{__tenant:{optional:!0,type:"string",message:"__tenant option is required"},__token_issuer:{optional:!0,type:"string",message:"__token_issuer option is required"},__jwks_uri:{optional:!0,type:"string",message:"__jwks_uri is required"}}),this.baseOptions=t,this.baseOptions.plugins=new me(this,this.baseOptions.plugins||[]),this.baseOptions._sendTelemetry=!1!==this.baseOptions._sendTelemetry||this.baseOptions._sendTelemetry,this.baseOptions._timesToRetryFailedRequests=t._timesToRetryFailedRequests?parseInt(t._timesToRetryFailedRequests,0):0,this.baseOptions.tenant=this.baseOptions.overrides&&this.baseOptions.overrides.__tenant||this.baseOptions.domain.split(".")[0],this.baseOptions.token_issuer=this.baseOptions.overrides&&this.baseOptions.overrides.__token_issuer||"https://"+this.baseOptions.domain+"/",this.baseOptions.jwksURI=this.baseOptions.overrides&&this.baseOptions.overrides.__jwks_uri,this.transactionManager=new ve(this.baseOptions),this.client=new Le(this.baseOptions),this.redirect=new Oe(this,this.baseOptions),this.popup=new Ae(this,this.baseOptions),this.crossOriginAuthentication=new _e(this,this.baseOptions),this.webMessageHandler=new we(this),this._universalLogin=new je(this,this.baseOptions),this.ssodataStorage=new It(this.baseOptions)}function Re(t,e){this.baseOptions=e,this.request=t}function Me(t,e){this.baseOptions=e,this.request=t}function Le(t,e){2===arguments.length?this.auth0=t:e=t,lt.check(e,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},clientID:{type:"string",message:"clientID option is required"},responseType:{optional:!0,type:"string",message:"responseType is not valid"},responseMode:{optional:!0,type:"string",message:"responseMode is not valid"},redirectUri:{optional:!0,type:"string",message:"redirectUri is not valid"},scope:{optional:!0,type:"string",message:"scope is not valid"},audience:{optional:!0,type:"string",message:"audience is not valid"},_disableDeprecationWarnings:{optional:!0,type:"boolean",message:"_disableDeprecationWarnings option is not valid"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"}}),this.baseOptions=e,this.baseOptions._sendTelemetry=!1!==this.baseOptions._sendTelemetry||this.baseOptions._sendTelemetry,this.baseOptions.rootUrl="https://"+this.baseOptions.domain,this.request=new Ot(this.baseOptions),this.passwordless=new Re(this.request,this.baseOptions),this.dbConnection=new Me(this.request,this.baseOptions),this.warn=new Dt({disableWarnings:!!e._disableDeprecationWarnings}),this.ssodataStorage=new It(this.baseOptions)}function Be(t){lt.check(t,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},token:{type:"string",message:"token option is required"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"}}),this.baseOptions=t,this.baseOptions.headers={Authorization:"Bearer "+this.baseOptions.token},this.request=new Ot(this.baseOptions),this.baseOptions.rootUrl=s("https://"+this.baseOptions.domain,"api","v2")}Ue.prototype.parseHash=function(t,e){var r,n;e||"function"!=typeof t?t=t||{}:(e=t,t={});var i=St.getWindow(),o=void 0===t.hash?i.location.hash:t.hash;if((r=function(t,e){var r=function(t){if(!t)return A;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?A.charset:t.charset;return{allowDots:void 0===t.allowDots?A.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:A.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:A.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:A.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:A.comma,decoder:"function"==typeof t.decoder?t.decoder:A.decoder,delimiter:"string"==typeof t.delimiter||h.isRegExp(t.delimiter)?t.delimiter:A.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:A.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:A.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:A.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:A.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:A.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={},i=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=e.parameterLimit===1/0?void 0:e.parameterLimit,s=i.split(e.delimiter,o),a=-1,u=e.charset;if(e.charsetSentinel)for(r=0;r-1&&(p=x(p)?[p]:p),S.call(n,c)?n[c]=h.combine(n[c],p):n[c]=p}return n}(t,r):t,i=r.plainObjects?Object.create(null):{},o=Object.keys(n),s=0;s0&&-1!==s.indexOf("token")&&!r.hasOwnProperty("access_token")?e(Pt.buildResponse("invalid_hash","response_type contains `token`, but the parsed hash does not contain an `access_token` property")):s.length>0&&-1!==s.indexOf("id_token")&&!r.hasOwnProperty("id_token")?e(Pt.buildResponse("invalid_hash","response_type contains `id_token`, but the parsed hash does not contain an `id_token` property")):this.validateAuthenticationResponse(t,r,e)},Ue.prototype.validateAuthenticationResponse=function(t,e,r){var n=this;t.__enableIdPInitiatedLogin=t.__enableIdPInitiatedLogin||t.__enableImpersonation;var i=e.state,o=this.transactionManager.getStoredTransaction(i),s=t.state||o&&o.state||null,a=s===i;if((i||s||!t.__enableIdPInitiatedLogin)&&!a)return r({error:"invalid_token",errorDescription:"`state` does not match."});var u=t.nonce||o&&o.nonce||null,c=t.state||o&&o.appState||null,p=function(t,i){return t?r(t):(o&&o.lastUsedConnection&&(i&&(s=i.sub),n.ssodataStorage.set(o.lastUsedConnection,s)),r(null,function(t,e,r){return{accessToken:t.access_token||null,idToken:t.id_token||null,idTokenPayload:r||null,appState:e||null,refreshToken:t.refresh_token||null,state:t.state||null,expiresIn:t.expires_in?parseInt(t.expires_in,10):null,tokenType:t.token_type||null,scope:t.scope||null}}(e,c,i)));var s};return e.id_token?this.validateToken(e.id_token,u,(function(t,r){if(!t)return e.access_token&&r.at_hash?(new ye).validateAccessToken(e.access_token,"RS256",r.at_hash,(function(t){return t?p(Pt.invalidToken(t.message)):p(null,r)})):p(null,r);if("invalid_token"!==t.error||t.errorDescription&&t.errorDescription.indexOf("Nonce (nonce) claim value mismatch in the ID token")>-1)return p(t);var i=(new ye).decode(e.id_token);return"HS256"!==i.header.alg?p(t):(i.payload.nonce||null)!==u?p({error:"invalid_token",errorDescription:'Nonce (nonce) claim value mismatch in the ID token; expected "'+u+'", found "'+i.payload.nonce+'"'}):e.access_token?n.client.userInfo(e.access_token,(function(t,e){return t?p(t):p(null,e)})):p({error:"invalid_token",description:"The id_token cannot be validated because it was signed with the HS256 algorithm and public clients (like a browser) can’t store secrets. Please read the associated doc for possible ways to fix this. Read more: https://auth0.com/docs/errors/libraries/auth0-js/invalid-token#parsing-an-hs256-signed-id-token-without-an-access-token"})})):p(null,null)},Ue.prototype.validateToken=function(t,e,r){new ye({issuer:this.baseOptions.token_issuer,jwksURI:this.baseOptions.jwksURI,audience:this.baseOptions.clientID,leeway:this.baseOptions.leeway||60,maxAge:this.baseOptions.maxAge,__clock:this.baseOptions.__clock||Pe}).verify(t,e,(function(t,e){if(t)return r(Pt.invalidToken(t.message));r(null,e)}))},Ue.prototype.renewAuth=function(t,e){var r=!!t.usePostMessage,n=t.postMessageDataType||!1,i=t.postMessageOrigin||St.getWindow().origin,o=t.timeout,s=this,a=wt.merge(this.baseOptions,["clientID","redirectUri","responseType","scope","audience","_csrf","state","_intstate","nonce"]).with(t);a.responseType=a.responseType||"token",a.responseMode=a.responseMode||"fragment",a=this.transactionManager.process(a),lt.check(a,{type:"object",message:"options parameter is not valid"}),lt.check(e,{type:"function",message:"cb parameter is not valid"}),a.prompt="none",a=wt.blacklist(a,["usePostMessage","tenant","postMessageDataType","postMessageOrigin"]),Ce.create({authenticationUrl:this.client.buildAuthorizeUrl(a),postMessageDataType:n,postMessageOrigin:i,timeout:o}).login(r,(function(t,r){if("object"==typeof r)return e(t,r);s.parseHash({hash:r},e)}))},Ue.prototype.checkSession=function(t,e){var r=wt.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return"code"===r.responseType?e({error:"error",error_description:"responseType can't be `code`"}):(t.nonce||(r=this.transactionManager.process(r)),r.redirectUri?(lt.check(r,{type:"object",message:"options parameter is not valid"}),lt.check(e,{type:"function",message:"cb parameter is not valid"}),r=wt.blacklist(r,["usePostMessage","tenant","postMessageDataType"]),void this.webMessageHandler.run(r,Ut(e,{forceLegacyError:!0,ignoreCasing:!0}))):e({error:"error",error_description:"redirectUri can't be empty"}))},Ue.prototype.changePassword=function(t,e){return this.client.dbConnection.changePassword(t,e)},Ue.prototype.passwordlessStart=function(t,e){var r=wt.merge(this.baseOptions,["responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t.authParams);return t.authParams=this.transactionManager.process(r),this.client.passwordless.start(t,e)},Ue.prototype.signup=function(t,e){return this.client.dbConnection.signup(t,e)},Ue.prototype.authorize=function(t){var e=wt.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);lt.check(e,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),(e=this.transactionManager.process(e)).scope=e.scope||"openid profile email",St.redirect(this.client.buildAuthorizeUrl(e))},Ue.prototype.signupAndAuthorize=function(t,e){var r=this;return this.client.dbConnection.signup(wt.blacklist(t,["popupHandler"]),(function(n){if(n)return e(n);t.realm=t.connection,t.username||(t.username=t.email),r.client.login(t,e)}))},Ue.prototype.login=function(t,e){var r=wt.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);r=this.transactionManager.process(r),St.getWindow().location.host===this.baseOptions.domain?(r.connection=r.realm,delete r.realm,this._universalLogin.login(r,e)):this.crossOriginAuthentication.login(r,e)},Ue.prototype.passwordlessLogin=function(t,e){var r=wt.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);if(r=this.transactionManager.process(r),St.getWindow().location.host===this.baseOptions.domain)this.passwordlessVerify(r,e);else{var n=wt.extend({credentialType:"http://auth0.com/oauth/grant-type/passwordless/otp",realm:r.connection,username:r.email||r.phoneNumber,otp:r.verificationCode},wt.blacklist(r,["connection","email","phoneNumber","verificationCode"]));this.crossOriginAuthentication.login(n,e)}},Ue.prototype.crossOriginAuthenticationCallback=function(){this.crossOriginVerification()},Ue.prototype.crossOriginVerification=function(){this.crossOriginAuthentication.callback()},Ue.prototype.logout=function(t){St.redirect(this.client.buildLogoutUrl(t))},Ue.prototype.passwordlessVerify=function(t,e){var r=this,n=wt.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return lt.check(n,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),n=this.transactionManager.process(n),this.client.passwordless.verify(n,(function(t){return t?e(t):St.redirect(r.client.passwordless.buildVerifyUrl(n))}))},Ue.prototype.renderCaptcha=function(t,e,r){return qe(this.client,t,e,r)},Re.prototype.buildVerifyUrl=function(t){var e,r;return lt.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},verificationCode:{type:"string",message:"verificationCode option is required"},phoneNumber:{optional:!1,type:"string",message:"phoneNumber option is required",condition:function(t){return!t.email}},email:{optional:!1,type:"string",message:"email option is required",condition:function(t){return!t.phoneNumber}}}),e=wt.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","protocol","nonce"]).with(t),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e=wt.toSnakeCase(e,["auth0Client"]),r=E(e),s(this.baseOptions.rootUrl,"passwordless","verify_redirect","?"+r)},Re.prototype.start=function(t,e){var r,n;return lt.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},send:{type:"string",message:"send option is required",values:["link","code"],value_message:"send is not valid ([link, code])"},phoneNumber:{optional:!0,type:"string",message:"phoneNumber option is required",condition:function(t){return"code"===t.send||!t.email}},email:{optional:!0,type:"string",message:"email option is required",condition:function(t){return"link"===t.send||!t.phoneNumber}},authParams:{optional:!0,type:"object",message:"authParams option is required"}}),lt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"passwordless","start"),(n=wt.merge(this.baseOptions,["clientID","responseType","redirectUri","scope"]).with(t)).scope&&(n.authParams=n.authParams||{},n.authParams.scope=n.authParams.scope||n.scope),n.redirectUri&&(n.authParams=n.authParams||{},n.authParams.redirect_uri=n.authParams.redirectUri||n.redirectUri),n.responseType&&(n.authParams=n.authParams||{},n.authParams.response_type=n.authParams.responseType||n.responseType),delete n.redirectUri,delete n.responseType,delete n.scope,n=wt.toSnakeCase(n,["auth0Client","authParams"]),this.request.post(r).send(n).end(Ut(e))},Re.prototype.verify=function(t,e){var r,n;return lt.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},verificationCode:{type:"string",message:"verificationCode option is required"},phoneNumber:{optional:!1,type:"string",message:"phoneNumber option is required",condition:function(t){return!t.email}},email:{optional:!1,type:"string",message:"email option is required",condition:function(t){return!t.phoneNumber}}}),lt.check(e,{type:"function",message:"cb parameter is not valid"}),n=wt.pick(t,["connection","verificationCode","phoneNumber","email","auth0Client"]),n=wt.toSnakeCase(n,["auth0Client"]),r=s(this.baseOptions.rootUrl,"passwordless","verify"),this.request.post(r).send(n).end(Ut(e))},Me.prototype.signup=function(t,e){var r,n,i;return lt.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},email:{type:"string",message:"email option is required"},password:{type:"string",message:"password option is required"}}),lt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"dbconnections","signup"),i=(n=wt.merge(this.baseOptions,["clientID","state"]).with(t)).user_metadata||n.userMetadata,n=wt.blacklist(n,["scope","userMetadata","user_metadata"]),n=wt.toSnakeCase(n,["auth0Client"]),i&&(n.user_metadata=i),this.request.post(r).send(n).end(Ut(e))},Me.prototype.changePassword=function(t,e){var r,n;return lt.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},email:{type:"string",message:"email option is required"}}),lt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"dbconnections","change_password"),n=wt.merge(this.baseOptions,["clientID"]).with(t,["email","connection"]),n=wt.toSnakeCase(n,["auth0Client"]),this.request.post(r).send(n).end(Ut(e))},Le.prototype.buildAuthorizeUrl=function(t){var e,r;return lt.check(t,{type:"object",message:"options parameter is not valid"}),e=wt.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience"]).with(t),lt.check(e,{type:"object",message:"options parameter is not valid"},{clientID:{type:"string",message:"clientID option is required"},redirectUri:{optional:!0,type:"string",message:"redirectUri option is required"},responseType:{type:"string",message:"responseType option is required"},nonce:{type:"string",message:"nonce option is required",condition:function(t){return-1===t.responseType.indexOf("code")&&-1!==t.responseType.indexOf("id_token")}},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e.connection_scope&<.isArray(e.connection_scope)&&(e.connection_scope=e.connection_scope.join(",")),e=wt.blacklist(e,["username","popupOptions","domain","tenant","timeout","appState"]),e=wt.toSnakeCase(e,["auth0Client"]),e=Bt(this.warn,e),r=E(e),s(this.baseOptions.rootUrl,"authorize","?"+r)},Le.prototype.buildLogoutUrl=function(t){var e,r;return lt.check(t,{optional:!0,type:"object",message:"options parameter is not valid"}),e=wt.merge(this.baseOptions,["clientID"]).with(t||{}),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e=wt.toSnakeCase(e,["auth0Client","returnTo"]),r=E(wt.blacklist(e,["federated"])),t&&void 0!==t.federated&&!1!==t.federated&&"false"!==t.federated&&(r+="&federated"),s(this.baseOptions.rootUrl,"v2","logout","?"+r)},Le.prototype.loginWithDefaultDirectory=function(t,e){return lt.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),t.grantType="password",this.oauthToken(t,e)},Le.prototype.login=function(t,e){return lt.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},realm:{type:"string",message:"realm option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),t.grantType="http://auth0.com/oauth/grant-type/password-realm",this.oauthToken(t,e)},Le.prototype.oauthToken=function(t,e){var r,n;return lt.check(t,{type:"object",message:"options parameter is not valid"}),lt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"oauth","token"),n=wt.merge(this.baseOptions,["clientID","scope","audience"]).with(t),lt.check(n,{type:"object",message:"options parameter is not valid"},{clientID:{type:"string",message:"clientID option is required"},grantType:{type:"string",message:"grantType option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),n=wt.toSnakeCase(n,["auth0Client"]),n=Lt(this.warn,n),this.request.post(r).send(n).end(Ut(e))},Le.prototype.loginWithResourceOwner=function(t,e){var r,n;return lt.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},connection:{type:"string",message:"connection option is required"},scope:{optional:!0,type:"string",message:"scope option is required"}}),lt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"oauth","ro"),n=wt.merge(this.baseOptions,["clientID","scope"]).with(t,["username","password","scope","connection","device"]),(n=wt.toSnakeCase(n,["auth0Client"])).grant_type=n.grant_type||"password",this.request.post(r).send(n).end(Ut(e))},Le.prototype.getSSOData=function(t,e){if(this.auth0||(this.auth0=new Ue(this.baseOptions)),St.getWindow().location.host===this.baseOptions.domain)return this.auth0._universalLogin.getSSOData(t,e);"function"==typeof t&&(e=t),lt.check(e,{type:"function",message:"cb parameter is not valid"});var r=this.baseOptions.clientID,n=this.ssodataStorage.get()||{};this.auth0.checkSession({responseType:"token id_token",scope:"openid profile email",connection:n.lastUsedConnection,timeout:5e3},(function(t,i){return t?"login_required"===t.error?e(null,{sso:!1}):("consent_required"===t.error&&(t.error_description="Consent required. When using `getSSOData`, the user has to be authenticated with the following scope: `openid profile email`."),e(t,{sso:!1})):n.lastUsedSub&&n.lastUsedSub!==i.idTokenPayload.sub?e(t,{sso:!1}):e(null,{lastUsedConnection:{name:n.lastUsedConnection},lastUsedUserID:i.idTokenPayload.sub,lastUsedUsername:i.idTokenPayload.email||i.idTokenPayload.name,lastUsedClientID:r,sessionClients:[r],sso:!0})}))},Le.prototype.userInfo=function(t,e){var r;return lt.check(t,{type:"string",message:"accessToken parameter is not valid"}),lt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"userinfo"),this.request.get(r).set("Authorization","Bearer "+t).end(Ut(e,{ignoreCasing:!0}))},Le.prototype.getChallenge=function(t){if(lt.check(t,{type:"function",message:"cb parameter is not valid"}),!this.baseOptions.state)return t();var e=s(this.baseOptions.rootUrl,"usernamepassword","challenge");return this.request.post(e).send({state:this.baseOptions.state}).end(Ut(t,{ignoreCasing:!0}))},Le.prototype.delegation=function(t,e){var r,n;return lt.check(t,{type:"object",message:"options parameter is not valid"},{grant_type:{type:"string",message:"grant_type option is required"}}),lt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"delegation"),n=wt.merge(this.baseOptions,["clientID"]).with(t),n=wt.toSnakeCase(n,["auth0Client"]),this.request.post(r).send(n).end(Ut(e))},Le.prototype.getUserCountry=function(t){var e;return lt.check(t,{type:"function",message:"cb parameter is not valid"}),e=s(this.baseOptions.rootUrl,"user","geoloc","country"),this.request.get(e).end(Ut(t))},Be.prototype.getUser=function(t,e){var r;return lt.check(t,{type:"string",message:"userId parameter is not valid"}),lt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"users",t),this.request.get(r).end(Ut(e,{ignoreCasing:!0}))},Be.prototype.patchUserMetadata=function(t,e,r){var n;return lt.check(t,{type:"string",message:"userId parameter is not valid"}),lt.check(e,{type:"object",message:"userMetadata parameter is not valid"}),lt.check(r,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"users",t),this.request.patch(n).send({user_metadata:e}).end(Ut(r,{ignoreCasing:!0}))},Be.prototype.patchUserAttributes=function(t,e,r){var n;return lt.check(t,{type:"string",message:"userId parameter is not valid"}),lt.check(e,{type:"object",message:"user parameter is not valid"}),lt.check(r,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"users",t),this.request.patch(n).send(e).end(Ut(r,{ignoreCasing:!0}))},Be.prototype.linkUser=function(t,e,r){var n;return lt.check(t,{type:"string",message:"userId parameter is not valid"}),lt.check(e,{type:"string",message:"secondaryUserToken parameter is not valid"}),lt.check(r,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"users",t,"identities"),this.request.post(n).send({link_with:e}).end(Ut(r,{ignoreCasing:!0}))}}).call(this,r(1),r(2))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,c=[],p=!1,h=-1;function l(){p&&u&&(p=!1,u.length?c=u.concat(c):h=-1,c.length&&f())}function f(){if(!p){var t=a(l);p=!0;for(var e=c.length;e;){for(u=c,c=[];++h1)for(var r=1;r{if(e)return $(".application").hide(),void $(".pre-apply").show();const n=r.idToken;var i,o,s,a=parseQueryString();"feature"in a&&"date"in a&&(i=a.feature[0],o=a.date[0],s=n,$.ajax({type:"GET",url:"{{API_BASE_URL}}getLicense?date="+o+"&feature="+i,async:!0,headers:{Authorization:s}})).done((function(e){const r=e.license.license_key,n=e.license.license_instructions;$("#license_description").html("License for "+e.license.licensed_feature_name),$("#license_instructions").html(n),$("#license_text").html("
"+r+"
");let i=1500-(Date.now()-t);i<0&&(i=0),setTimeout((function(){$("#pre-load").hide(),$("#post-load").show()}),i)}))})}))}]); \ No newline at end of file diff --git a/package.json b/package.json index 1e5fc1e..b877850 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "webpack --config webpack.config.js", - "publish": "npm run build && python publish.py", + "publish-develop": "npm run build && python publish.py", "publish-prod": "npm run build && python publish.py --stage prod" }, "repository": {