From 81e1e8d356715a264cd3bf149dba4a7965911a04 Mon Sep 17 00:00:00 2001 From: Rafal Janicki Date: Mon, 26 Feb 2024 17:41:25 +0100 Subject: [PATCH] Added CI/CD --- .github/workflows/deploy.yml | 62 ++++++++++++++++++++++++++++++++++++ .gitignore | 4 ++- dist/app.js | 1 - dist/license.js | 1 - package.json | 2 +- publish.py | 15 +++++---- 6 files changed, 74 insertions(+), 11 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..e6c8312 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,62 @@ +name: Publish frontend + +on: + push: + branches: + - develop + - master + +env: + NODE_VERSION: 18.x + +jobs: + set_environment: + runs-on: ubuntu-latest + + steps: + - name: Set up environment based on branch + id: environment_check + run: | + SIMPLE_REF=$(echo ${GITHUB_REF#refs/heads/} | tr / -) + [ "$SIMPLE_REF" = "master" ] && ENV_NAME="prod" || ENV_NAME="$SIMPLE_REF" + + echo "env_name=${ENV_NAME}" >> $GITHUB_OUTPUT + + outputs: + env_name: ${{ steps.environment_check.outputs.env_name }} + + build: + runs-on: ubuntu-latest + needs: [set_environment] + permissions: + id-token: write + contents: read + + environment: + name: ${{ needs.set_environment.outputs.env_name }} + + 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@v3 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Install Node requirements + run: npm i + + - name: Install Python requirements + run: pip install -r requirements.txt + + - name: Deploy Serverless Lambda functions + env: + PUBLISH_DOCS_USERNAME: ${{ vars.PUBLISH_DOCS_USERNAME }} + PUBLISH_DOCS_PASSWORD: ${{ vars.PUBLISH_DOCS_PASSWORD }} + run: npm run publish-${{ needs.set_environment.outputs.env_name }} 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 c49ade9..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 be}));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)},merge:function t(e,n,r){if(!n)return e;if("object"!=typeof n){if(u(e))e.push(n);else{if(!e||"object"!=typeof e)return[e,n];(r&&(r.plainObjects||r.allowPrototypes)||!a.call(Object.prototype,n))&&(e[n]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(n);var i=e;return u(e)&&!u(n)&&(i=p(e,r)),u(e)&&u(n)?(n.forEach((function(n,i){if(a.call(e,i)){var o=e[i];o&&"object"==typeof o&&n&&"object"==typeof n?e[i]=t(o,n,r):e.push(n)}else e[i]=n})),e):Object.keys(n).reduce((function(e,i){var o=n[i];return a.call(e,i)?e[i]=t(e[i],o,r):e[i]=o,e}),i)}},h=String.prototype.replace,d=/%20/g,f={RFC1738:"RFC1738",RFC3986:"RFC3986"},m=l.assign({default:f.RFC3986,formatters:{RFC1738:function(t){return h.call(t,d,"+")},RFC3986:function(t){return String(t)}}},f),y=Object.prototype.hasOwnProperty,g={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},v=Array.isArray,w=Array.prototype.push,b=function(t,e){w.apply(t,v(e)?e:[e])},_=Date.prototype.toISOString,T=m.default,k={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:l.encode,encodeValuesOnly:!1,format:T,formatter:m.formatters[T],indices:!1,serializeDate:function(t){return _.call(t)},skipNulls:!1,strictNullHandling:!1},O=function t(e,n,r,i,o,s,a,u,c,p,h,d,f){var m=e;if("function"==typeof a?m=a(n,m):m instanceof Date?m=p(m):"comma"===r&&v(m)&&(m=m.join(",")),null===m){if(i)return s&&!d?s(n,k.encoder,f):n;m=""}if(function(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||"symbol"==typeof t||"bigint"==typeof t}(m)||l.isBuffer(m))return s?[h(d?n:s(n,k.encoder,f))+"="+h(s(m,k.encoder,f))]:[h(n)+"="+h(String(m))];var y,g=[];if(void 0===m)return g;if(v(a))y=a;else{var w=Object.keys(m);y=u?w.sort(u):w}for(var _=0;_0&&/(\[[^[\]]*])/.exec(r),s=o?r.slice(0,o.index):r,a=[];if(s){if(!n.plainObjects&&x.call(Object.prototype,s)&&!n.allowPrototypes)return;a.push(s)}for(var u=0;n.depth>0&&null!==(o=i.exec(r))&&u=0;--i){var o,s=t[i];if("[]"===s&&n.parseArrays)o=[].concat(r);else{o=n.plainObjects?Object.create(null):{};var a="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(a,10);n.parseArrays||""!==a?!isNaN(u)&&s!==a&&String(u)===a&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(o=[])[u]=r:o[a]=r:o={0:r}}r=o}return r}(a,e,n)}},D=function(t,e){var n,r=t,i=function(t){if(!t)return k;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||k.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=k.filter;return("function"==typeof t.filter||v(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:k.addQueryPrefix,allowDots:void 0===t.allowDots?k.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:k.charsetSentinel,delimiter:void 0===t.delimiter?k.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:k.encode,encoder:"function"==typeof t.encoder?t.encoder:k.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:k.encodeValuesOnly,filter:i,formatter:r,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:k.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:k.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:k.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:""},j=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;i=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&&~U.indexOf(t.code))return!0;if(t.timeout&&"ECONNABORTED"==t.code)return!0;if(t.crossDomain)return!0}return!1},q.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},q.prototype.then=function(t,e){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.end((function(n,r){n?e(n):t(r)}))}))}return this._fullfilledPromise.then(t,e)},q.prototype.catch=function(t){return this.then(void 0,t)},q.prototype.use=function(t){return t(this),this},q.prototype.ok=function(t){if("function"!=typeof t)throw Error("Callback required");return this._okCallback=t,this},q.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},q.prototype.get=function(t){return this._header[t.toLowerCase()]},q.prototype.getHeader=q.prototype.get,q.prototype.set=function(t,e){if(E(t)){for(var n in t)this.set(n,t[n]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},q.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},q.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),E(t)){for(var n in t)this.field(n,t[n]);return this}if(Array.isArray(e)){for(var r in e)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=""+e),this._getFormData().append(t,e),this},q.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},q.prototype._auth=function(t,e,n,r){switch(n.type){case"basic":this.set("Authorization","Basic "+r(t+":"+e));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer "+t)}return this},q.prototype.withCredentials=function(t){return null==t&&(t=!0),this._withCredentials=t,this},q.prototype.redirects=function(t){return this._maxRedirects=t,this},q.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw TypeError("Invalid argument");return this._maxResponseSize=t,this},q.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},q.prototype.send=function(t){var e=E(t),n=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(e&&E(this._data))for(var r in t)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?this._data+"&"+t:t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||n||this.type("json"),this},q.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},q.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var n=this.url.substring(e+1).split("&");"function"==typeof this._sort?n.sort(this._sort):n.sort(),this.url=this.url.substring(0,e)+"?"+n.join("&")}}},q.prototype._appendQueryString=function(){console.trace("Unsupported")},q.prototype._timeoutError=function(t,e,n){if(!this._aborted){var r=new Error(t+e+"ms exceeded");r.timeout=e,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.abort(),this.callback(r)}},q.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 R=P;function P(t){if(t)return function(t){for(var e in P.prototype)t[e]=P.prototype[e];return t}(t)}function M(){this._defaults=[]}P.prototype.get=function(t){return this.header[t.toLowerCase()]},P.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=e.split(/ *; */).shift();var n=function(t){return t.split(/ *; */).reduce((function(t,e){var n=e.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(t[r]=i),t}),{})}(e);for(var r in n)this[r]=n[r];this.links={};try{t.link&&(this.links=function(t){return t.split(/ *, */).reduce((function(t,e){var n=e.split(/ *; */),r=n[0].slice(1,-1);return t[n[1].split(/ *= */)[1].slice(1,-1)]=r,t}),{})}(t.link))}catch(t){}},P.prototype._setStatusProperties=function(t){var e=t/100|0;this.status=this.statusCode=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.redirect=3==e,this.clientError=4==e,this.serverError=5==e,this.error=(4==e||5==e)&&this.toError(),this.created=201==t,this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.forbidden=403==t,this.notFound=404==t,this.unprocessableEntity=422==t},["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach((function(t){M.prototype[t]=function(){return this._defaults.push({fn:t,arguments:arguments}),this}})),M.prototype._setDefaults=function(t){this._defaults.forEach((function(e){t[e.fn].apply(t,e.arguments)}))};for(var L=M,B=o((function(t,e){var n;function r(){}"undefined"!=typeof window?n=window:"undefined"!=typeof self?n=self:(console.warn("Using browser-only version of superagent in non-browser environment"),n=i);var o=e=t.exports=function(t,n){return"function"==typeof n?new e.Request("GET",t).end(n):1==arguments.length?new e.Request("GET",t):new e.Request(t,n)};e.Request=h,o.getXHR=function(){if(!(!n.XMLHttpRequest||n.location&&"file:"==n.location.protocol&&n.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw Error("Browser-only version of superagent could not find XHR")};var s="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function a(t){if(!E(t))return t;var e=[];for(var n in t)u(e,n,t[n]);return e.join("&")}function u(t,e,n){if(null!=n)if(Array.isArray(n))n.forEach((function(n){u(t,e,n)}));else if(E(n))for(var r in n)u(t,e+"["+r+"]",n[r]);else t.push(encodeURIComponent(e)+"="+encodeURIComponent(n));else null===n&&t.push(encodeURIComponent(e))}function c(t){for(var e,n,r={},i=t.split("&"),o=0,s=i.length;o=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),n.direction=e,t.emit("progress",n)};if(this.hasListeners("progress"))try{e.onprogress=r.bind(null,"download"),e.upload&&(e.upload.onprogress=r.bind(null,"upload"))}catch(t){}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]&&this.header.hasOwnProperty(a)&&e.setRequestHeader(a,this.header[a]);return this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0!==n?n:null),this},o.agent=function(){return new L},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(t){L.prototype[t.toLowerCase()]=function(e,n){var r=new o.Request(t,e);return this._setDefaults(r),n&&r.end(n),r}})),L.prototype.del=L.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}})),N=(B.Request,[]),H=[],$=("undefined"!=typeof Uint8Array&&Uint8Array,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),z=0,F=$.length;z0)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 V(t,e,n){for(var r,i,o=[],s=e;s>18&63]+N[i>>12&63]+N[i>>6&63]+N[63&i]);return o.join("")}H["-".charCodeAt(0)]=62,H["_".charCodeAt(0)]=63;var J=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(N[e>>2]+N[e<<4&63]+"==")):2===r&&(e=(t[n-2]<<8)+t[n-1],i.push(N[e>>10]+N[e>>4&63]+N[e<<2&63]+"=")),i.join("")},X=function(t){return J(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||tt.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?rt(t,e):t,with:function(t,e){return t=e?rt(t,e):t,it(this.base,t)}}},pick:rt,getKeysNotIn:function(t,e){var n=[];for(var r in t)-1===e.indexOf(r)&&n.push(r);return n},extend:it,getOriginFromUrl:function(t){if(t){var e=ot(t),n=e.protocol+"//"+e.hostname;return e.port&&(n+=":"+e.port),n}},getLocationFromUrl:ot,trimUserDetails:function(t){return function(t,e){return["username","email","phoneNumber"].reduce(st,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 ut(t){this.request=t,this.method=t.method,this.url=t.url,this.body=t._data,this.headers=t._header}function ct(t){this.request=t}function pt(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 lt(){return window}ut.prototype.abort=function(){this.request.abort()},ut.prototype.getMethod=function(){return this.method},ut.prototype.getBody=function(){return this.body},ut.prototype.getUrl=function(){return this.url},ut.prototype.getHeaders=function(){return this.headers},ct.prototype.set=function(t,e){return this.request=this.request.set(t,e),this},ct.prototype.send=function(t){return this.request=this.request.send(at.trimUserDetails(t)),this},ct.prototype.withCredentials=function(){return this.request=this.request.withCredentials(),this},ct.prototype.end=function(t){return this.request=this.request.end(t),new ut(this.request)},pt.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},Ct="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function At(t,e){return t(e={exports:{}},e.exports),e.exports}var Dt=At((function(t,e){var n;t.exports=n=n||function(t,e){var n=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),r={},i=r.lib={},o=i.Base={extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=i.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>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)})),Et=At((function(t,e){var n,r;t.exports=(r=(n=Dt).lib.WordArray,n.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,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)})),It=At((function(t,e){t.exports=Dt.enc.Hex})),qt=At((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 w(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function b(){}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(b,i)),n.ONE.dlShiftTo(h,b),b.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,w,0,h))<_)for(a.dlShiftTo(w,b),i.subTo(b,i);i[v]<--_;)i.subTo(b,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),b.prototype.convert=_,b.prototype.revert=_,b.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},b.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 k,O,x,S=[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],C=(1<<26)/S[S.length-1];function A(){var t;t=(new Date).getTime(),O[x++]^=255&t,O[x++]^=t>>8&255,O[x++]^=t>>16&255,O[x++]^=t>>24&255,x>=R&&(x-=R)}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)>S.length&&(t=S.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,w=!0,b=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),w)a[y].copyTo(s),w=!1;else{for(;u>1;)i.sqrTo(s,b),i.sqrTo(b,s),u-=2;u>0?i.sqrTo(s,b):(g=s,s=b,b=g),i.mulTo(b,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 b)},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]<=S[S.length-1]){for(e=0;e>>8,O[x++]=255&D;x=0,A()}function I(){if(null==k){for(A(),(k=new U).init(O),x=0;x0&&e.length>0))throw new Error("Invalid key data");this.n=new qt(t,16),this.e=parseInt(e,16)}Pt.prototype.verify=function(t,e){e=e.replace(/[^0-9a-f]|[\s\n]]/gi,"");var n=new qt(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 Ut){var n=Ut[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(!Rt.hasOwnProperty(r.alg))throw new Error("Hashing algorithm is not supported.");var i=Rt[r.alg](t).toString();return r.hash===i};for(var Mt=[],Lt=[],Bt="undefined"!=typeof Uint8Array?Uint8Array:Array,Nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ht=0,$t=Nt.length;Ht<$t;++Ht)Mt[Ht]=Nt[Ht],Lt[Nt.charCodeAt(Ht)]=Ht;function zt(t){var e=t.length;if(e%4>0)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]}Lt["-".charCodeAt(0)]=62,Lt["_".charCodeAt(0)]=63;var Ft=function(t){var e,n,r=zt(t),i=r[0],o=r[1],s=new Bt(3*(i+o)/4-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=Lt[t.charCodeAt(n)]<<2|Lt[t.charCodeAt(n+1)]>>4,s[a++]=255&e),1===o&&(e=Lt[t.charCodeAt(n)]<<10|Lt[t.charCodeAt(n+1)]<<4|Lt[t.charCodeAt(n+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e),s};function Wt(t){var e=t.length%4;return 0===e?t:t+new Array(4-e+1).join("=")}function Vt(t){return t=Wt(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("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=n():e.urljoin=n()}));function Zt(t){if(t.ok)return t.json();var e=new Error(t.statusText);return e.response=t,Promise.reject(e)}function Gt(t){this.name="ConfigurationError",this.message=t||""}function Kt(t){this.name="TokenValidationError",this.message=t||""}Xt.polyfill(),Gt.prototype=Error.prototype,Kt.prototype=Error.prototype;var Yt=function(){};Yt.prototype.get=function(){return null},Yt.prototype.has=function(){return null},Yt.prototype.set=function(){return null};var te="RS256",ee=function(t){return"number"==typeof t},ne=function(){return new Date};function re(t){var e=t||{};if(this.jwksCache=e.jwksCache||new Yt,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:ne,this.leeway<0||this.leeway>300)throw new Gt("The leeway should be positive and lower than five minutes.");if(te!==this.expectedAlg)throw new Gt('Signature algorithm of "'+this.expectedAlg+'" is not supported. Expected the ID token to be signed with "'+te+'".')}function ie(t,e){this.plugins=e;for(var n=0;n1){if(!f||"string"!=typeof f)return n(new Kt("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 Kt('Authorized Party (azp) claim mismatch in the ID token; expected "'+v.audience+'", found "'+f+'"',!1))}if(!l||!ee(l))return n(new Kt("Expiration Time (exp) claim must be a number present in the ID token",!1));if(!d||!ee(d))return n(new Kt("Issued At (iat) claim must be a number present in the ID token"));var a=l+v.leeway,w=new Date(0);if(w.setUTCSeconds(a),g>w)return n(new Kt('Expiration Time (exp) claim error in the ID token; current time "'+g+'" is after expiration time "'+w+'"',!1));if(h&&ee(h)){var b=h-v.leeway,_=new Date(0);if(_.setUTCSeconds(b),g<_)return n(new Kt('Not Before Time (nbf) claim error in the ID token; current time "'+g+'" is before the not before time "'+_+'"'))}if(v.maxAge){if(!m||!ee(m))return n(new Kt("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,k=new Date(0);if(k.setUTCSeconds(T),g>k)return n(new Kt('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 "'+k+'"'))}return n(null,r.payload)}))},re.prototype.getRsaVerifier=function(t,e,n){var r=this,i=t+e;if(this.jwksCache.has(i)){var o=this.jwksCache.get(i);n(null,new Pt(o.modulus,o.exp))}else!function(t,e){("undefined"==typeof fetch?function(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)}))}:fetch)(t.jwksURI||Qt(t.iss,".well-known","jwks.json")).then(Zt).then((function(n){var r,i,o,s=null;for(r=0;r-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(){window.location;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)})),de=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 fe(){this._current_popup=null}function me(t,e){this.baseOptions=e,this.baseOptions.popupOrigin=e.popupOrigin,this.client=t.client,this.webAuth=t,this.transactionManager=new se(this.baseOptions),this.crossOriginAuthentication=new ce(t,this.baseOptions),this.warn=new yt({disableWarnings:!!e._disableDeprecationWarnings})}function ye(t){this.authenticationUrl=t.authenticationUrl,this.timeout=t.timeout||6e4,this.handler=null,this.postMessageDataType=t.postMessageDataType||!1,this.postMessageOrigin=t.postMessageOrigin||ht.getWindow().location.origin||ht.getWindow().location.protocol+"//"+ht.getWindow().location.hostname+(ht.getWindow().location.port?":"+ht.getWindow().location.port:"")}function ge(t){this.baseOptions=t,this.request=new pt(t),this.transactionManager=new se(this.baseOptions)}function ve(t,e){this.baseOptions=e,this.client=t,this.baseOptions.universalLoginPage=!0,this.request=new pt(this.baseOptions),this.warn=new yt({disableWarnings:!!e._disableDeprecationWarnings})}function we(){return new Date}function be(t){tt.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&&tt.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 ie(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 se(this.baseOptions),this.client=new ke(this.baseOptions),this.redirect=new le(this,this.baseOptions),this.popup=new me(this,this.baseOptions),this.crossOriginAuthentication=new ce(this,this.baseOptions),this.webMessageHandler=new ue(this),this._universalLogin=new ve(this,this.baseOptions),this.ssodataStorage=new wt(this.baseOptions)}function _e(t,e){this.baseOptions=e,this.request=t}function Te(t,e){this.baseOptions=e,this.request=t}function ke(t,e){2===arguments.length?this.auth0=t:e=t,tt.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 pt(this.baseOptions),this.passwordless=new _e(this.request,this.baseOptions),this.dbConnection=new Te(this.request,this.baseOptions),this.warn=new yt({disableWarnings:!!e._disableDeprecationWarnings}),this.ssodataStorage=new wt(this.baseOptions)}function Oe(t){tt.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 pt(this.baseOptions),this.baseOptions.rootUrl=s("https://"+this.baseOptions.domain,"api","v2")}fe.prototype.calculatePosition=function(t){var e=t.width||500,n=t.height||600,r=ht.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}},fe.prototype.preload=function(t){var e=this,n=ht.getWindow(),r=this.calculatePosition(t.popupOptions||{}),i=at.merge(r).with(t.popupOptions),o=t.url||"about:blank",s=D(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},fe.prototype.load=function(t,e,n,r){var i=this,o=this.calculatePosition(n.popupOptions||{}),s=at.merge(o).with(n.popupOptions),a=at.merge({url:t,relay_url:e,window_features:D(s,{delimiter:",",encode:!1}),popup:this._current_popup}).with(n),u=he.open(a,(function(t,e){if(!t||"SyntaxError"!==t.name)return i._current_popup=null,r(t,e)}));return u.focus(),u},me.prototype.buildPopupHandler=function(){var t=this.baseOptions.plugins.get("popup.getPopupHandler");return t?t.getPopupHandler():new fe},me.prototype.preload=function(t){t=t||{};var e=this.buildPopupHandler();return e.preload(t),e},me.prototype.getPopupHandler=function(t,e){return t.popupHandler?t.popupHandler:e?this.preload(t):this.buildPopupHandler()},me.prototype.callback=function(t){var e=this,n=ht.getWindow(),r=(t=t||{}).popupOrigin||this.baseOptions.popupOrigin||ht.getOrigin();n.opener?he.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)}},me.prototype.authorize=function(t,e){var n,r,i={},o=this.baseOptions.plugins.get("popup.authorize"),a=at.merge(this.baseOptions,["clientID","scope","domain","audience","tenant","responseType","redirectUri","_csrf","state","_intstate","nonce"]).with(at.blacklist(t,["popupHandler"]));return tt.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=de(a.redirectUri),r=a.redirectUri),t.popupOptions&&(i.popupOptions=at.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,Tt(e,{keepOriginalCasing:!0}))},me.prototype.loginWithCredentials=function(t,e){t.realm=t.realm||t.connection,t.popup=!0,t=at.merge(this.baseOptions,["redirectUri","responseType","state","nonce"]).with(at.blacklist(t,["popupHandler","connection"])),t=this.transactionManager.process(t),this.crossOriginAuthentication.login(t,e)},me.prototype.passwordlessVerify=function(t,e){var n=this;return this.client.passwordless.verify(at.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)}))},me.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)}))},ye.create=function(t){return new ye(t)},ye.prototype.login=function(t,e){this.handler=new ae({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()},ye.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}}}},ye.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)}},ge.prototype.login=function(t,e){var n,r;return n=s(this.baseOptions.rootUrl,"usernamepassword","login"),t.username=t.username||t.email,t=at.blacklist(t,["email"]),r=at.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience"]).with(t),r=this.transactionManager.process(r),r=at.toSnakeCase(r,["auth0Client"]),this.request.post(n).send(r).end(Tt(e))},ge.prototype.callback=function(t){var e,n=ht.getDocument();(e=n.createElement("div")).innerHTML=t,n.body.appendChild(e).children[0].submit()},ve.prototype.login=function(t,e){if(ht.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=at.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return tt.check(r,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),(n=new ge(this.baseOptions)).login(r,(function(t,r){return t?e(t):n.callback(r)}))},ve.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)}))},ve.prototype.getSSOData=function(t,e){var n,r="";return"function"==typeof t&&(e=t,t=!1),tt.check(t,{type:"boolean",message:"withActiveDirectories parameter is not valid"}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),t&&(r="?"+D({ldaps:1,client_id:this.baseOptions.clientID})),n=s(this.baseOptions.rootUrl,"user","ssodata",r),this.request.get(n,{noHeaders:!0}).withCredentials().end(Tt(e))},be.prototype.parseHash=function(t,e){var n,r;e||"function"!=typeof t?t=t||{}:(e=t,t={});var i=ht.getWindow(),o=void 0===t.hash?i.location.hash:t.hash;if((n=function(t,e){var n=function(t){if(!t)return S;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 Error("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?S.charset:t.charset;return{allowDots:void 0===t.allowDots?S.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:S.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:S.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:S.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:S.comma,decoder:"function"==typeof t.decoder?t.decoder:S.decoder,delimiter:"string"==typeof t.delimiter||l.isRegExp(t.delimiter)?t.delimiter:S.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:S.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:S.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:S.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:S.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:S.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=p.split(",")),x.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(_t.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(_t.buildResponse("invalid_hash","response_type contains `id_token`, but the parsed hash does not contain an `id_token` property")):this.validateAuthenticationResponse(t,n,e)},be.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 re).validateAccessToken(e.access_token,"RS256",n.at_hash,(function(t){return t?p(_t.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 re).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)},be.prototype.validateToken=function(t,e,n){new re({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||we}).verify(t,e,(function(t,e){if(t)return n(_t.invalidToken(t.message));n(null,e)}))},be.prototype.renewAuth=function(t,e){var n=!!t.usePostMessage,r=t.postMessageDataType||!1,i=t.postMessageOrigin||ht.getWindow().origin,o=t.timeout,s=this,a=at.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),tt.check(a,{type:"object",message:"options parameter is not valid"}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),a.prompt="none",a=at.blacklist(a,["usePostMessage","tenant","postMessageDataType","postMessageOrigin"]),ye.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)}))},be.prototype.checkSession=function(t,e){var n=at.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?(tt.check(n,{type:"object",message:"options parameter is not valid"}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=at.blacklist(n,["usePostMessage","tenant","postMessageDataType"]),void this.webMessageHandler.run(n,Tt(e,{forceLegacyError:!0,ignoreCasing:!0}))):e({error:"error",error_description:"redirectUri can't be empty"}))},be.prototype.changePassword=function(t,e){return this.client.dbConnection.changePassword(t,e)},be.prototype.passwordlessStart=function(t,e){var n=at.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)},be.prototype.signup=function(t,e){return this.client.dbConnection.signup(t,e)},be.prototype.authorize=function(t){var e=at.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);tt.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",ht.redirect(this.client.buildAuthorizeUrl(e))},be.prototype.signupAndAuthorize=function(t,e){var n=this;return this.client.dbConnection.signup(at.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)}))},be.prototype.login=function(t,e){var n=at.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);n=this.transactionManager.process(n),ht.getWindow().location.host===this.baseOptions.domain?(n.connection=n.realm,delete n.realm,this._universalLogin.login(n,e)):this.crossOriginAuthentication.login(n,e)},be.prototype.passwordlessLogin=function(t,e){var n=at.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);if(n=this.transactionManager.process(n),ht.getWindow().location.host===this.baseOptions.domain)this.passwordlessVerify(n,e);else{var r=at.extend({credentialType:"http://auth0.com/oauth/grant-type/passwordless/otp",realm:n.connection,username:n.email||n.phoneNumber,otp:n.verificationCode},at.blacklist(n,["connection","email","phoneNumber","verificationCode"]));this.crossOriginAuthentication.login(r,e)}},be.prototype.crossOriginAuthenticationCallback=function(){this.crossOriginVerification()},be.prototype.crossOriginVerification=function(){this.crossOriginAuthentication.callback()},be.prototype.logout=function(t){ht.redirect(this.client.buildLogoutUrl(t))},be.prototype.passwordlessVerify=function(t,e){var n=this,r=at.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return tt.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):ht.redirect(n.client.passwordless.buildVerifyUrl(r))}))},_e.prototype.buildVerifyUrl=function(t){var e,n;return tt.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=at.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=at.toSnakeCase(e,["auth0Client"]),n=D(e),s(this.baseOptions.rootUrl,"passwordless","verify_redirect","?"+n)},_e.prototype.start=function(t,e){var n,r;return tt.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"}}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"passwordless","start"),(r=at.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=at.toSnakeCase(r,["auth0Client","authParams"]),this.request.post(n).send(r).end(Tt(e))},_e.prototype.verify=function(t,e){var n,r;return tt.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}}}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),r=at.pick(t,["connection","verificationCode","phoneNumber","email","auth0Client"]),r=at.toSnakeCase(r,["auth0Client"]),n=s(this.baseOptions.rootUrl,"passwordless","verify"),this.request.post(n).send(r).end(Tt(e))},Te.prototype.signup=function(t,e){var n,r,i;return tt.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"}}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"dbconnections","signup"),i=(r=at.merge(this.baseOptions,["clientID"]).with(t)).user_metadata||r.userMetadata,r=at.blacklist(r,["scope","userMetadata","user_metadata"]),r=at.toSnakeCase(r,["auth0Client"]),i&&(r.user_metadata=i),this.request.post(n).send(r).end(Tt(e))},Te.prototype.changePassword=function(t,e){var n,r;return tt.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"}}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"dbconnections","change_password"),r=at.merge(this.baseOptions,["clientID"]).with(t,["email","connection"]),r=at.toSnakeCase(r,["auth0Client"]),this.request.post(n).send(r).end(Tt(e))},ke.prototype.buildAuthorizeUrl=function(t){var e,n;return tt.check(t,{type:"object",message:"options parameter is not valid"}),e=at.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience"]).with(t),tt.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&&tt.isArray(e.connection_scope)&&(e.connection_scope=e.connection_scope.join(",")),e=at.blacklist(e,["username","popupOptions","domain","tenant","timeout","appState"]),e=at.toSnakeCase(e,["auth0Client"]),e=St(this.warn,e),n=D(e),s(this.baseOptions.rootUrl,"authorize","?"+n)},ke.prototype.buildLogoutUrl=function(t){var e,n;return tt.check(t,{optional:!0,type:"object",message:"options parameter is not valid"}),e=at.merge(this.baseOptions,["clientID"]).with(t||{}),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e=at.toSnakeCase(e,["auth0Client","returnTo"]),n=D(at.blacklist(e,["federated"])),t&&void 0!==t.federated&&!1!==t.federated&&"false"!==t.federated&&(n+="&federated"),s(this.baseOptions.rootUrl,"v2","logout","?"+n)},ke.prototype.loginWithDefaultDirectory=function(t,e){return tt.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)},ke.prototype.login=function(t,e){return tt.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)},ke.prototype.oauthToken=function(t,e){var n,r;return tt.check(t,{type:"object",message:"options parameter is not valid"}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"oauth","token"),r=at.merge(this.baseOptions,["clientID","scope","audience"]).with(t),tt.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=at.toSnakeCase(r,["auth0Client"]),r=xt(this.warn,r),this.request.post(n).send(r).end(Tt(e))},ke.prototype.loginWithResourceOwner=function(t,e){var n,r;return tt.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"}}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"oauth","ro"),r=at.merge(this.baseOptions,["clientID","scope"]).with(t,["username","password","scope","connection","device"]),(r=at.toSnakeCase(r,["auth0Client"])).grant_type=r.grant_type||"password",this.request.post(n).send(r).end(Tt(e))},ke.prototype.getSSOData=function(t,e){if(this.auth0||(this.auth0=new be(this.baseOptions)),ht.getWindow().location.host===this.baseOptions.domain)return this.auth0._universalLogin.getSSOData(t,e);"function"==typeof t&&(e=t),tt.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})}))},ke.prototype.userInfo=function(t,e){var n;return tt.check(t,{type:"string",message:"accessToken parameter is not valid"}),tt.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(Tt(e,{ignoreCasing:!0}))},ke.prototype.getChallenge=function(t){if(tt.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(Tt(t,{ignoreCasing:!0}))},ke.prototype.delegation=function(t,e){var n,r;return tt.check(t,{type:"object",message:"options parameter is not valid"},{grant_type:{type:"string",message:"grant_type option is required"}}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"delegation"),r=at.merge(this.baseOptions,["clientID"]).with(t),r=at.toSnakeCase(r,["auth0Client"]),this.request.post(n).send(r).end(Tt(e))},ke.prototype.getUserCountry=function(t){var e;return tt.check(t,{type:"function",message:"cb parameter is not valid"}),e=s(this.baseOptions.rootUrl,"user","geoloc","country"),this.request.get(e).end(Tt(t))},Oe.prototype.getUser=function(t,e){var n;return tt.check(t,{type:"string",message:"userId parameter is not valid"}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"users",t),this.request.get(n).end(Tt(e,{ignoreCasing:!0}))},Oe.prototype.patchUserMetadata=function(t,e,n){var r;return tt.check(t,{type:"string",message:"userId parameter is not valid"}),tt.check(e,{type:"object",message:"userMetadata parameter is not valid"}),tt.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(Tt(n,{ignoreCasing:!0}))},Oe.prototype.patchUserAttributes=function(t,e,n){var r;return tt.check(t,{type:"string",message:"userId parameter is not valid"}),tt.check(e,{type:"object",message:"user parameter is not valid"}),tt.check(n,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"users",t),this.request.patch(r).send(e).end(Tt(n,{ignoreCasing:!0}))},Oe.prototype.linkUser=function(t,e,n){var r;return tt.check(t,{type:"string",message:"userId parameter is not valid"}),tt.check(e,{type:"string",message:"secondaryUserToken parameter is not valid"}),tt.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(Tt(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;n0){var e=0;t.applications.forEach((function(t){var n=$("#existing-applications-list-header").clone();for(var r in n.find(".app-date").text(a(t.created_date)),n.find(".app-company-name").text(t.company_name),n.find(".app-status").text(t.status),n.find(".app-licenses").text(""),n.find(".license-expires").text(a(t.expires_date)),t.license_keys){var i=t.license_keys[r];n.find(".app-licenses").append(''+i.licensed_feature.replace("neo4j-","")+"  ")}n.insertAfter("#existing-applications-list-header"),"APPROVED"==t.status&&(e+=1)})),n?($(".existing-applications").show(),$(".application").hide(),$(".application-toggle").show(),$(".loading-icon").hide(),e>0&&$.ajax({type:"GET",url:"/current-neo4j-versions/"}).done((function(t){var e=JSON.parse(t),n=0,r="available-downloads-list-header";e.forEach((function(t){var e=$("#available-downloads-list-header").clone();e.attr("id","available-downloads-list-row"+n),e.find(".release-product").text("Enterprise Server"),e.find(".release-date").html('
'+t.release_date+"
"),e.find(".release-version").text(t.neo4j_version),e.find(".download-link").html('UNIX/Linux   Windows'),e.insertAfter("#"+r),r="available-downloads-list-row"+n,n+=1})),$(".available-downloads").show()})),Foundation.reInit("equalizer")):($(".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("error"),console.log(t)}}))}))}]); \ No newline at end of file diff --git a/dist/license.js b/dist/license.js deleted file mode 100644 index 8b38ebb..0000000 --- a/dist/license.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=4)}([function(t,e,n){"use strict";(function(t,r){n.d(e,"a",(function(){return we}));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)},merge:function t(e,n,r){if(!n)return e;if("object"!=typeof n){if(u(e))e.push(n);else{if(!e||"object"!=typeof e)return[e,n];(r&&(r.plainObjects||r.allowPrototypes)||!a.call(Object.prototype,n))&&(e[n]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(n);var i=e;return u(e)&&!u(n)&&(i=p(e,r)),u(e)&&u(n)?(n.forEach((function(n,i){if(a.call(e,i)){var o=e[i];o&&"object"==typeof o&&n&&"object"==typeof n?e[i]=t(o,n,r):e.push(n)}else e[i]=n})),e):Object.keys(n).reduce((function(e,i){var o=n[i];return a.call(e,i)?e[i]=t(e[i],o,r):e[i]=o,e}),i)}},l=String.prototype.replace,f=/%20/g,d={RFC1738:"RFC1738",RFC3986:"RFC3986"},m=h.assign({default:d.RFC3986,formatters:{RFC1738:function(t){return l.call(t,f,"+")},RFC3986:function(t){return String(t)}}},d),y=Object.prototype.hasOwnProperty,g={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},v=Array.isArray,b=Array.prototype.push,w=function(t,e){b.apply(t,v(e)?e:[e])},_=Date.prototype.toISOString,T=m.default,O={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:h.encode,encodeValuesOnly:!1,format:T,formatter:m.formatters[T],indices:!1,serializeDate:function(t){return _.call(t)},skipNulls:!1,strictNullHandling:!1},k=function t(e,n,r,i,o,s,a,u,c,p,l,f,d){var m=e;if("function"==typeof a?m=a(n,m):m instanceof Date?m=p(m):"comma"===r&&v(m)&&(m=m.join(",")),null===m){if(i)return s&&!f?s(n,O.encoder,d):n;m=""}if(function(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||"symbol"==typeof t||"bigint"==typeof t}(m)||h.isBuffer(m))return s?[l(f?n:s(n,O.encoder,d))+"="+l(s(m,O.encoder,d))]:[l(n)+"="+l(String(m))];var y,g=[];if(void 0===m)return g;if(v(a))y=a;else{var b=Object.keys(m);y=u?b.sort(u):b}for(var _=0;_0&&/(\[[^[\]]*])/.exec(r),s=o?r.slice(0,o.index):r,a=[];if(s){if(!n.plainObjects&&x.call(Object.prototype,s)&&!n.allowPrototypes)return;a.push(s)}for(var u=0;n.depth>0&&null!==(o=i.exec(r))&&u=0;--i){var o,s=t[i];if("[]"===s&&n.parseArrays)o=[].concat(r);else{o=n.plainObjects?Object.create(null):{};var a="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(a,10);n.parseArrays||""!==a?!isNaN(u)&&s!==a&&String(u)===a&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(o=[])[u]=r:o[a]=r:o={0:r}}r=o}return r}(a,e,n)}},A=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?h+p:""},j=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;i=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&&~U.indexOf(t.code))return!0;if(t.timeout&&"ECONNABORTED"==t.code)return!0;if(t.crossDomain)return!0}return!1},q.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},q.prototype.then=function(t,e){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.end((function(n,r){n?e(n):t(r)}))}))}return this._fullfilledPromise.then(t,e)},q.prototype.catch=function(t){return this.then(void 0,t)},q.prototype.use=function(t){return t(this),this},q.prototype.ok=function(t){if("function"!=typeof t)throw Error("Callback required");return this._okCallback=t,this},q.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},q.prototype.get=function(t){return this._header[t.toLowerCase()]},q.prototype.getHeader=q.prototype.get,q.prototype.set=function(t,e){if(E(t)){for(var n in t)this.set(n,t[n]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},q.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},q.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),E(t)){for(var n in t)this.field(n,t[n]);return this}if(Array.isArray(e)){for(var r in e)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=""+e),this._getFormData().append(t,e),this},q.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},q.prototype._auth=function(t,e,n,r){switch(n.type){case"basic":this.set("Authorization","Basic "+r(t+":"+e));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer "+t)}return this},q.prototype.withCredentials=function(t){return null==t&&(t=!0),this._withCredentials=t,this},q.prototype.redirects=function(t){return this._maxRedirects=t,this},q.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw TypeError("Invalid argument");return this._maxResponseSize=t,this},q.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},q.prototype.send=function(t){var e=E(t),n=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(e&&E(this._data))for(var r in t)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?this._data+"&"+t:t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||n||this.type("json"),this},q.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},q.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var n=this.url.substring(e+1).split("&");"function"==typeof this._sort?n.sort(this._sort):n.sort(),this.url=this.url.substring(0,e)+"?"+n.join("&")}}},q.prototype._appendQueryString=function(){console.trace("Unsupported")},q.prototype._timeoutError=function(t,e,n){if(!this._aborted){var r=new Error(t+e+"ms exceeded");r.timeout=e,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.abort(),this.callback(r)}},q.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 R=P;function P(t){if(t)return function(t){for(var e in P.prototype)t[e]=P.prototype[e];return t}(t)}function M(){this._defaults=[]}P.prototype.get=function(t){return this.header[t.toLowerCase()]},P.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=e.split(/ *; */).shift();var n=function(t){return t.split(/ *; */).reduce((function(t,e){var n=e.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(t[r]=i),t}),{})}(e);for(var r in n)this[r]=n[r];this.links={};try{t.link&&(this.links=function(t){return t.split(/ *, */).reduce((function(t,e){var n=e.split(/ *; */),r=n[0].slice(1,-1);return t[n[1].split(/ *= */)[1].slice(1,-1)]=r,t}),{})}(t.link))}catch(t){}},P.prototype._setStatusProperties=function(t){var e=t/100|0;this.status=this.statusCode=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.redirect=3==e,this.clientError=4==e,this.serverError=5==e,this.error=(4==e||5==e)&&this.toError(),this.created=201==t,this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.forbidden=403==t,this.notFound=404==t,this.unprocessableEntity=422==t},["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach((function(t){M.prototype[t]=function(){return this._defaults.push({fn:t,arguments:arguments}),this}})),M.prototype._setDefaults=function(t){this._defaults.forEach((function(e){t[e.fn].apply(t,e.arguments)}))};for(var L=M,B=o((function(t,e){var n;function r(){}"undefined"!=typeof window?n=window:"undefined"!=typeof self?n=self:(console.warn("Using browser-only version of superagent in non-browser environment"),n=i);var o=e=t.exports=function(t,n){return"function"==typeof n?new e.Request("GET",t).end(n):1==arguments.length?new e.Request("GET",t):new e.Request(t,n)};e.Request=l,o.getXHR=function(){if(!(!n.XMLHttpRequest||n.location&&"file:"==n.location.protocol&&n.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw Error("Browser-only version of superagent could not find XHR")};var s="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function a(t){if(!E(t))return t;var e=[];for(var n in t)u(e,n,t[n]);return e.join("&")}function u(t,e,n){if(null!=n)if(Array.isArray(n))n.forEach((function(n){u(t,e,n)}));else if(E(n))for(var r in n)u(t,e+"["+r+"]",n[r]);else t.push(encodeURIComponent(e)+"="+encodeURIComponent(n));else null===n&&t.push(encodeURIComponent(e))}function c(t){for(var e,n,r={},i=t.split("&"),o=0,s=i.length;o=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),n.direction=e,t.emit("progress",n)};if(this.hasListeners("progress"))try{e.onprogress=r.bind(null,"download"),e.upload&&(e.upload.onprogress=r.bind(null,"upload"))}catch(t){}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]&&this.header.hasOwnProperty(a)&&e.setRequestHeader(a,this.header[a]);return this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0!==n?n:null),this},o.agent=function(){return new L},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(t){L.prototype[t.toLowerCase()]=function(e,n){var r=new o.Request(t,e);return this._setDefaults(r),n&&r.end(n),r}})),L.prototype.del=L.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=f,o.delete=f,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}})),N=(B.Request,[]),H=[],z=("undefined"!=typeof Uint8Array&&Uint8Array,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),W=0,V=z.length;W0)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 $(t,e,n){for(var r,i,o=[],s=e;s>18&63]+N[i>>12&63]+N[i>>6&63]+N[63&i]);return o.join("")}H["-".charCodeAt(0)]=62,H["_".charCodeAt(0)]=63;var J=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(N[e>>2]+N[e<<4&63]+"==")):2===r&&(e=(t[n-2]<<8)+t[n-1],i.push(N[e>>10]+N[e>>4&63]+N[e<<2&63]+"=")),i.join("")},X=function(t){return J(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||tt.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?rt(t,e):t,with:function(t,e){return t=e?rt(t,e):t,it(this.base,t)}}},pick:rt,getKeysNotIn:function(t,e){var n=[];for(var r in t)-1===e.indexOf(r)&&n.push(r);return n},extend:it,getOriginFromUrl:function(t){if(t){var e=ot(t),n=e.protocol+"//"+e.hostname;return e.port&&(n+=":"+e.port),n}},getLocationFromUrl:ot,trimUserDetails:function(t){return function(t,e){return["username","email","phoneNumber"].reduce(st,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 ut(t){this.request=t,this.method=t.method,this.url=t.url,this.body=t._data,this.headers=t._header}function ct(t){this.request=t}function pt(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 ht(){return window}ut.prototype.abort=function(){this.request.abort()},ut.prototype.getMethod=function(){return this.method},ut.prototype.getBody=function(){return this.body},ut.prototype.getUrl=function(){return this.url},ut.prototype.getHeaders=function(){return this.headers},ct.prototype.set=function(t,e){return this.request=this.request.set(t,e),this},ct.prototype.send=function(t){return this.request=this.request.send(at.trimUserDetails(t)),this},ct.prototype.withCredentials=function(){return this.request=this.request.withCredentials(),this},ct.prototype.end=function(t){return this.request=this.request.end(t),new ut(this.request)},pt.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},Ct="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function St(t,e){return t(e={exports:{}},e.exports),e.exports}var At=St((function(t,e){var n;t.exports=n=n||function(t,e){var n=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),r={},i=r.lib={},o=i.Base={extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=i.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>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)))}},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 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)^(d<<14|d>>>18)^d>>>3)+c[f-7]+((m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10)+c[f-16]}var y=r&i^r&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=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]+h|0,n[7]=n[7]+l|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)})),Et=St((function(t,e){var n,r;t.exports=(r=(n=At).lib.WordArray,n.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,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)})),It=St((function(t,e){t.exports=At.enc.Hex})),qt=St((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 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=r(),this.q3=r(),n.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,n){t.multiplyTo(e,n),this.reduce(n)},l.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},f.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},f.prototype.revert=function(t){var e=r();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[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)},f.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},f.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 l=a.t,f=a[l-1];if(0!=f){var d=f*(1<1?a[l-2]>>this.F2:0),m=this.FV/d,y=(1<=0&&(i[i.t++]=1,i.subTo(w,i)),n.ONE.dlShiftTo(l,w),w.subTo(a,a);a.t=0;){var _=i[--v]==f?this.DM:Math.floor(i[v]*m+(i[v-1]+g)*y);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&&n.ZERO.subTo(e,e)),i.t=l,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=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)},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)+h(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 l(e):new f(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,x,D=[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],C=(1<<26)/D[D.length-1];function S(){var t;t=(new Date).getTime(),k[x++]^=255&t,k[x++]^=t>>8&255,k[x++]^=t>>16&255,k[x++]^=t>>24&255,x>=R&&(x-=R)}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)>D.length&&(t=D.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,d,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<=d;)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=h(t[v])-1;v>=0;){for(o>=c?y=t[v]>>o-c&d:(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]<=D[D.length-1]){for(e=0;e>>8,k[x++]=255&A;x=0,S()}function I(){if(null==O){for(S(),(O=new U).init(k),x=0;x0&&e.length>0))throw new Error("Invalid key data");this.n=new qt(t,16),this.e=parseInt(e,16)}Pt.prototype.verify=function(t,e){e=e.replace(/[^0-9a-f]|[\s\n]]/gi,"");var n=new qt(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 Ut){var n=Ut[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(!Rt.hasOwnProperty(r.alg))throw new Error("Hashing algorithm is not supported.");var i=Rt[r.alg](t).toString();return r.hash===i};for(var Mt=[],Lt=[],Bt="undefined"!=typeof Uint8Array?Uint8Array:Array,Nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ht=0,zt=Nt.length;Ht0)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]}Lt["-".charCodeAt(0)]=62,Lt["_".charCodeAt(0)]=63;var Vt=function(t){var e,n,r=Wt(t),i=r[0],o=r[1],s=new Bt(3*(i+o)/4-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=Lt[t.charCodeAt(n)]<<2|Lt[t.charCodeAt(n+1)]>>4,s[a++]=255&e),1===o&&(e=Lt[t.charCodeAt(n)]<<10|Lt[t.charCodeAt(n+1)]<<4|Lt[t.charCodeAt(n+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e),s};function Ft(t){var e=t.length%4;return 0===e?t:t+new Array(4-e+1).join("=")}function $t(t){return t=Ft(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("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=n():e.urljoin=n()}));function Zt(t){if(t.ok)return t.json();var e=new Error(t.statusText);return e.response=t,Promise.reject(e)}function Kt(t){this.name="ConfigurationError",this.message=t||""}function Gt(t){this.name="TokenValidationError",this.message=t||""}Xt.polyfill(),Kt.prototype=Error.prototype,Gt.prototype=Error.prototype;var Yt=function(){};Yt.prototype.get=function(){return null},Yt.prototype.has=function(){return null},Yt.prototype.set=function(){return null};var te="RS256",ee=function(t){return"number"==typeof t},ne=function(){return new Date};function re(t){var e=t||{};if(this.jwksCache=e.jwksCache||new Yt,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:ne,this.leeway<0||this.leeway>300)throw new Kt("The leeway should be positive and lower than five minutes.");if(te!==this.expectedAlg)throw new Kt('Signature algorithm of "'+this.expectedAlg+'" is not supported. Expected the ID token to be signed with "'+te+'".')}function ie(t,e){this.plugins=e;for(var n=0;n1){if(!d||"string"!=typeof d)return n(new Gt("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 n(new Gt('Authorized Party (azp) claim mismatch in the ID token; expected "'+v.audience+'", found "'+d+'"',!1))}if(!h||!ee(h))return n(new Gt("Expiration Time (exp) claim must be a number present in the ID token",!1));if(!f||!ee(f))return n(new Gt("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 n(new Gt('Expiration Time (exp) claim error in the ID token; current time "'+g+'" is after expiration time "'+b+'"',!1));if(l&&ee(l)){var w=l-v.leeway,_=new Date(0);if(_.setUTCSeconds(w),g<_)return n(new Gt('Not Before Time (nbf) claim error in the ID token; current time "'+g+'" is before the not before time "'+_+'"'))}if(v.maxAge){if(!m||!ee(m))return n(new Gt("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 Gt('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)}))},re.prototype.getRsaVerifier=function(t,e,n){var r=this,i=t+e;if(this.jwksCache.has(i)){var o=this.jwksCache.get(i);n(null,new Pt(o.modulus,o.exp))}else!function(t,e){("undefined"==typeof fetch?function(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)}))}:fetch)(t.jwksURI||Qt(t.iss,".well-known","jwks.json")).then(Zt).then((function(n){var r,i,o,s=null;for(r=0;r-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 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(n){var i="*",o=r?function(){window.location;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)})),fe=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 de(){this._current_popup=null}function me(t,e){this.baseOptions=e,this.baseOptions.popupOrigin=e.popupOrigin,this.client=t.client,this.webAuth=t,this.transactionManager=new se(this.baseOptions),this.crossOriginAuthentication=new ce(t,this.baseOptions),this.warn=new yt({disableWarnings:!!e._disableDeprecationWarnings})}function ye(t){this.authenticationUrl=t.authenticationUrl,this.timeout=t.timeout||6e4,this.handler=null,this.postMessageDataType=t.postMessageDataType||!1,this.postMessageOrigin=t.postMessageOrigin||lt.getWindow().location.origin||lt.getWindow().location.protocol+"//"+lt.getWindow().location.hostname+(lt.getWindow().location.port?":"+lt.getWindow().location.port:"")}function ge(t){this.baseOptions=t,this.request=new pt(t),this.transactionManager=new se(this.baseOptions)}function ve(t,e){this.baseOptions=e,this.client=t,this.baseOptions.universalLoginPage=!0,this.request=new pt(this.baseOptions),this.warn=new yt({disableWarnings:!!e._disableDeprecationWarnings})}function be(){return new Date}function we(t){tt.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&&tt.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 ie(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 se(this.baseOptions),this.client=new Oe(this.baseOptions),this.redirect=new he(this,this.baseOptions),this.popup=new me(this,this.baseOptions),this.crossOriginAuthentication=new ce(this,this.baseOptions),this.webMessageHandler=new ue(this),this._universalLogin=new ve(this,this.baseOptions),this.ssodataStorage=new bt(this.baseOptions)}function _e(t,e){this.baseOptions=e,this.request=t}function Te(t,e){this.baseOptions=e,this.request=t}function Oe(t,e){2===arguments.length?this.auth0=t:e=t,tt.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 pt(this.baseOptions),this.passwordless=new _e(this.request,this.baseOptions),this.dbConnection=new Te(this.request,this.baseOptions),this.warn=new yt({disableWarnings:!!e._disableDeprecationWarnings}),this.ssodataStorage=new bt(this.baseOptions)}function ke(t){tt.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 pt(this.baseOptions),this.baseOptions.rootUrl=s("https://"+this.baseOptions.domain,"api","v2")}de.prototype.calculatePosition=function(t){var e=t.width||500,n=t.height||600,r=lt.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}},de.prototype.preload=function(t){var e=this,n=lt.getWindow(),r=this.calculatePosition(t.popupOptions||{}),i=at.merge(r).with(t.popupOptions),o=t.url||"about:blank",s=A(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},de.prototype.load=function(t,e,n,r){var i=this,o=this.calculatePosition(n.popupOptions||{}),s=at.merge(o).with(n.popupOptions),a=at.merge({url:t,relay_url:e,window_features:A(s,{delimiter:",",encode:!1}),popup:this._current_popup}).with(n),u=le.open(a,(function(t,e){if(!t||"SyntaxError"!==t.name)return i._current_popup=null,r(t,e)}));return u.focus(),u},me.prototype.buildPopupHandler=function(){var t=this.baseOptions.plugins.get("popup.getPopupHandler");return t?t.getPopupHandler():new de},me.prototype.preload=function(t){t=t||{};var e=this.buildPopupHandler();return e.preload(t),e},me.prototype.getPopupHandler=function(t,e){return t.popupHandler?t.popupHandler:e?this.preload(t):this.buildPopupHandler()},me.prototype.callback=function(t){var e=this,n=lt.getWindow(),r=(t=t||{}).popupOrigin||this.baseOptions.popupOrigin||lt.getOrigin();n.opener?le.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)}},me.prototype.authorize=function(t,e){var n,r,i={},o=this.baseOptions.plugins.get("popup.authorize"),a=at.merge(this.baseOptions,["clientID","scope","domain","audience","tenant","responseType","redirectUri","_csrf","state","_intstate","nonce"]).with(at.blacklist(t,["popupHandler"]));return tt.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=fe(a.redirectUri),r=a.redirectUri),t.popupOptions&&(i.popupOptions=at.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,Tt(e,{keepOriginalCasing:!0}))},me.prototype.loginWithCredentials=function(t,e){t.realm=t.realm||t.connection,t.popup=!0,t=at.merge(this.baseOptions,["redirectUri","responseType","state","nonce"]).with(at.blacklist(t,["popupHandler","connection"])),t=this.transactionManager.process(t),this.crossOriginAuthentication.login(t,e)},me.prototype.passwordlessVerify=function(t,e){var n=this;return this.client.passwordless.verify(at.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)}))},me.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)}))},ye.create=function(t){return new ye(t)},ye.prototype.login=function(t,e){this.handler=new ae({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()},ye.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}}}},ye.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)}},ge.prototype.login=function(t,e){var n,r;return n=s(this.baseOptions.rootUrl,"usernamepassword","login"),t.username=t.username||t.email,t=at.blacklist(t,["email"]),r=at.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience"]).with(t),r=this.transactionManager.process(r),r=at.toSnakeCase(r,["auth0Client"]),this.request.post(n).send(r).end(Tt(e))},ge.prototype.callback=function(t){var e,n=lt.getDocument();(e=n.createElement("div")).innerHTML=t,n.body.appendChild(e).children[0].submit()},ve.prototype.login=function(t,e){if(lt.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=at.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return tt.check(r,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),(n=new ge(this.baseOptions)).login(r,(function(t,r){return t?e(t):n.callback(r)}))},ve.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)}))},ve.prototype.getSSOData=function(t,e){var n,r="";return"function"==typeof t&&(e=t,t=!1),tt.check(t,{type:"boolean",message:"withActiveDirectories parameter is not valid"}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),t&&(r="?"+A({ldaps:1,client_id:this.baseOptions.clientID})),n=s(this.baseOptions.rootUrl,"user","ssodata",r),this.request.get(n,{noHeaders:!0}).withCredentials().end(Tt(e))},we.prototype.parseHash=function(t,e){var n,r;e||"function"!=typeof t?t=t||{}:(e=t,t={});var i=lt.getWindow(),o=void 0===t.hash?i.location.hash:t.hash;if((n=function(t,e){var n=function(t){if(!t)return D;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 Error("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?D.charset:t.charset;return{allowDots:void 0===t.allowDots?D.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:D.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:D.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:D.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:D.comma,decoder:"function"==typeof t.decoder?t.decoder:D.decoder,delimiter:"string"==typeof t.delimiter||h.isRegExp(t.delimiter)?t.delimiter:D.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:D.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:D.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:D.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:D.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:D.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=p.split(",")),x.call(r,c)?r[c]=h.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(_t.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(_t.buildResponse("invalid_hash","response_type contains `id_token`, but the parsed hash does not contain an `id_token` property")):this.validateAuthenticationResponse(t,n,e)},we.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 re).validateAccessToken(e.access_token,"RS256",n.at_hash,(function(t){return t?p(_t.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 re).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)},we.prototype.validateToken=function(t,e,n){new re({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||be}).verify(t,e,(function(t,e){if(t)return n(_t.invalidToken(t.message));n(null,e)}))},we.prototype.renewAuth=function(t,e){var n=!!t.usePostMessage,r=t.postMessageDataType||!1,i=t.postMessageOrigin||lt.getWindow().origin,o=t.timeout,s=this,a=at.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),tt.check(a,{type:"object",message:"options parameter is not valid"}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),a.prompt="none",a=at.blacklist(a,["usePostMessage","tenant","postMessageDataType","postMessageOrigin"]),ye.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)}))},we.prototype.checkSession=function(t,e){var n=at.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?(tt.check(n,{type:"object",message:"options parameter is not valid"}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=at.blacklist(n,["usePostMessage","tenant","postMessageDataType"]),void this.webMessageHandler.run(n,Tt(e,{forceLegacyError:!0,ignoreCasing:!0}))):e({error:"error",error_description:"redirectUri can't be empty"}))},we.prototype.changePassword=function(t,e){return this.client.dbConnection.changePassword(t,e)},we.prototype.passwordlessStart=function(t,e){var n=at.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)},we.prototype.signup=function(t,e){return this.client.dbConnection.signup(t,e)},we.prototype.authorize=function(t){var e=at.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);tt.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",lt.redirect(this.client.buildAuthorizeUrl(e))},we.prototype.signupAndAuthorize=function(t,e){var n=this;return this.client.dbConnection.signup(at.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)}))},we.prototype.login=function(t,e){var n=at.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);n=this.transactionManager.process(n),lt.getWindow().location.host===this.baseOptions.domain?(n.connection=n.realm,delete n.realm,this._universalLogin.login(n,e)):this.crossOriginAuthentication.login(n,e)},we.prototype.passwordlessLogin=function(t,e){var n=at.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);if(n=this.transactionManager.process(n),lt.getWindow().location.host===this.baseOptions.domain)this.passwordlessVerify(n,e);else{var r=at.extend({credentialType:"http://auth0.com/oauth/grant-type/passwordless/otp",realm:n.connection,username:n.email||n.phoneNumber,otp:n.verificationCode},at.blacklist(n,["connection","email","phoneNumber","verificationCode"]));this.crossOriginAuthentication.login(r,e)}},we.prototype.crossOriginAuthenticationCallback=function(){this.crossOriginVerification()},we.prototype.crossOriginVerification=function(){this.crossOriginAuthentication.callback()},we.prototype.logout=function(t){lt.redirect(this.client.buildLogoutUrl(t))},we.prototype.passwordlessVerify=function(t,e){var n=this,r=at.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return tt.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):lt.redirect(n.client.passwordless.buildVerifyUrl(r))}))},_e.prototype.buildVerifyUrl=function(t){var e,n;return tt.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=at.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=at.toSnakeCase(e,["auth0Client"]),n=A(e),s(this.baseOptions.rootUrl,"passwordless","verify_redirect","?"+n)},_e.prototype.start=function(t,e){var n,r;return tt.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"}}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"passwordless","start"),(r=at.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=at.toSnakeCase(r,["auth0Client","authParams"]),this.request.post(n).send(r).end(Tt(e))},_e.prototype.verify=function(t,e){var n,r;return tt.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}}}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),r=at.pick(t,["connection","verificationCode","phoneNumber","email","auth0Client"]),r=at.toSnakeCase(r,["auth0Client"]),n=s(this.baseOptions.rootUrl,"passwordless","verify"),this.request.post(n).send(r).end(Tt(e))},Te.prototype.signup=function(t,e){var n,r,i;return tt.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"}}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"dbconnections","signup"),i=(r=at.merge(this.baseOptions,["clientID"]).with(t)).user_metadata||r.userMetadata,r=at.blacklist(r,["scope","userMetadata","user_metadata"]),r=at.toSnakeCase(r,["auth0Client"]),i&&(r.user_metadata=i),this.request.post(n).send(r).end(Tt(e))},Te.prototype.changePassword=function(t,e){var n,r;return tt.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"}}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"dbconnections","change_password"),r=at.merge(this.baseOptions,["clientID"]).with(t,["email","connection"]),r=at.toSnakeCase(r,["auth0Client"]),this.request.post(n).send(r).end(Tt(e))},Oe.prototype.buildAuthorizeUrl=function(t){var e,n;return tt.check(t,{type:"object",message:"options parameter is not valid"}),e=at.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience"]).with(t),tt.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&&tt.isArray(e.connection_scope)&&(e.connection_scope=e.connection_scope.join(",")),e=at.blacklist(e,["username","popupOptions","domain","tenant","timeout","appState"]),e=at.toSnakeCase(e,["auth0Client"]),e=Dt(this.warn,e),n=A(e),s(this.baseOptions.rootUrl,"authorize","?"+n)},Oe.prototype.buildLogoutUrl=function(t){var e,n;return tt.check(t,{optional:!0,type:"object",message:"options parameter is not valid"}),e=at.merge(this.baseOptions,["clientID"]).with(t||{}),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e=at.toSnakeCase(e,["auth0Client","returnTo"]),n=A(at.blacklist(e,["federated"])),t&&void 0!==t.federated&&!1!==t.federated&&"false"!==t.federated&&(n+="&federated"),s(this.baseOptions.rootUrl,"v2","logout","?"+n)},Oe.prototype.loginWithDefaultDirectory=function(t,e){return tt.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)},Oe.prototype.login=function(t,e){return tt.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)},Oe.prototype.oauthToken=function(t,e){var n,r;return tt.check(t,{type:"object",message:"options parameter is not valid"}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"oauth","token"),r=at.merge(this.baseOptions,["clientID","scope","audience"]).with(t),tt.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=at.toSnakeCase(r,["auth0Client"]),r=xt(this.warn,r),this.request.post(n).send(r).end(Tt(e))},Oe.prototype.loginWithResourceOwner=function(t,e){var n,r;return tt.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"}}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"oauth","ro"),r=at.merge(this.baseOptions,["clientID","scope"]).with(t,["username","password","scope","connection","device"]),(r=at.toSnakeCase(r,["auth0Client"])).grant_type=r.grant_type||"password",this.request.post(n).send(r).end(Tt(e))},Oe.prototype.getSSOData=function(t,e){if(this.auth0||(this.auth0=new we(this.baseOptions)),lt.getWindow().location.host===this.baseOptions.domain)return this.auth0._universalLogin.getSSOData(t,e);"function"==typeof t&&(e=t),tt.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})}))},Oe.prototype.userInfo=function(t,e){var n;return tt.check(t,{type:"string",message:"accessToken parameter is not valid"}),tt.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(Tt(e,{ignoreCasing:!0}))},Oe.prototype.getChallenge=function(t){if(tt.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(Tt(t,{ignoreCasing:!0}))},Oe.prototype.delegation=function(t,e){var n,r;return tt.check(t,{type:"object",message:"options parameter is not valid"},{grant_type:{type:"string",message:"grant_type option is required"}}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"delegation"),r=at.merge(this.baseOptions,["clientID"]).with(t),r=at.toSnakeCase(r,["auth0Client"]),this.request.post(n).send(r).end(Tt(e))},Oe.prototype.getUserCountry=function(t){var e;return tt.check(t,{type:"function",message:"cb parameter is not valid"}),e=s(this.baseOptions.rootUrl,"user","geoloc","country"),this.request.get(e).end(Tt(t))},ke.prototype.getUser=function(t,e){var n;return tt.check(t,{type:"string",message:"userId parameter is not valid"}),tt.check(e,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"users",t),this.request.get(n).end(Tt(e,{ignoreCasing:!0}))},ke.prototype.patchUserMetadata=function(t,e,n){var r;return tt.check(t,{type:"string",message:"userId parameter is not valid"}),tt.check(e,{type:"object",message:"userMetadata parameter is not valid"}),tt.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(Tt(n,{ignoreCasing:!0}))},ke.prototype.patchUserAttributes=function(t,e,n){var r;return tt.check(t,{type:"string",message:"userId parameter is not valid"}),tt.check(e,{type:"object",message:"user parameter is not valid"}),tt.check(n,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"users",t),this.request.patch(r).send(e).end(Tt(n,{ignoreCasing:!0}))},ke.prototype.linkUser=function(t,e,n){var r;return tt.check(t,{type:"string",message:"userId parameter is not valid"}),tt.check(e,{type:"string",message:"secondaryUserToken parameter is not valid"}),tt.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(Tt(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,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 n=1;n"+n+"");var 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 a8a84f8..cd4112e 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": { diff --git a/publish.py b/publish.py index 8067186..805695d 100755 --- a/publish.py +++ b/publish.py @@ -9,13 +9,13 @@ fapp = flask.Flask('pub', template_folder='.') -API_BASE_URL = {"dev": "https://q6kkptbenj.execute-api.us-east-1.amazonaws.com/dev/", +API_BASE_URL = {"develop": "https://q6kkptbenj.execute-api.us-east-1.amazonaws.com/dev/", "prod": "https://w3qym6pdvb.execute-api.us-east-1.amazonaws.com/"} -LANDING_PAGE = {"dev": 91469, +LANDING_PAGE = {"develop": 91469, "prod": 87812} -LICENSE_PAGE = {"dev": 91471, +LICENSE_PAGE = {"develop": 91471, "prod": 91164} ''' @@ -94,7 +94,7 @@ def update_wordpress_page(pageId, content): def main(argv): - stage = 'dev' + stage = 'develop' try: opts, args = getopt.getopt(argv,"h",['stage=']) except getopt.GetoptError: @@ -108,8 +108,8 @@ def main(argv): stage = arg print('Stage is "%s"' % (stage)) - if stage != 'dev' and stage != 'prod': - print("Stages 'prod' + 'dev' are only supported stages currently") + if stage != 'develop' and stage != 'prod': + print("Stages 'prod' + 'develop' are only supported stages currently") sys.exit() if 'PUBLISH_DOCS_USERNAME' in os.environ and 'PUBLISH_DOCS_PASSWORD' in os.environ: @@ -127,9 +127,10 @@ def main(argv): rendered_content = render_template('html/view-license.html', **tmpl_vars) pageContent = update_wordpress_page(LICENSE_PAGE[stage], rendered_content) else: - print("Environment varisbles for PUBLISH_DOCS_USERNAME and PUBLISH_DOCS_PASSWORD must be set") + print("Environment variables for PUBLISH_DOCS_USERNAME and PUBLISH_DOCS_PASSWORD must be set") sys.exit() + if __name__ == "__main__": main(sys.argv[1:])