Socket
Socket
Sign inDemoInstall

@livechat/accounts-sdk

Package Overview
Dependencies
16
Maintainers
67
Versions
46
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.6 to 2.0.7

9

dist/accounts-sdk.min.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).AccountsSDK=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}var i={extend:function(e){return e.oauth_exception&&this.oauth_exception[e.oauth_exception]?Object.assign(e,{description:this.oauth_exception[e.oauth_exception]}):e.identity_exception&&this.identity_exception[e.identity_exception]?Object.assign(e,{description:this.identity_exception[e.identity_exception]}):e},oauth_exception:{invalid_request:"You may be loading accounts-sdk on a domain that is not whitelisted.",unauthorized_client:"Client not found, not provided or incorectly configured.",access_denied:"Probably this application is installed on a different account and you do not have access to it.",unsupported_response_type:"Provided response type is incorrect or unavailable for a given client."},identity_exception:{unauthorized:"Resource owner identity is not known or consent is missing."}},o=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t(this,e),this.options=r,this.listening=!1,this.receiveMessage=this.receiveMessage.bind(this)}return n(e,[{key:"start",value:function(e,t){var r=this;this._listenerInited||(this.listening=!0,this.callback=t,e&&(this.tid=setTimeout((function(){r.stop(),t("timeout",null)}),e)),window.addEventListener("message",this.receiveMessage))}},{key:"stop",value:function(){this.listening=!1,clearTimeout(this.tid),window.removeEventListener("message",this.receiveMessage,!1)}},{key:"receiveMessage",value:function(e){e.origin!==this.options.server_url&&e.origin!==this.options.server_url.replace(/livechat\.com$/,"livechatinc.com")||(e.data.data||e.data.error)&&(this.stop(),e.data.error?this.callback(i.extend(e.data.error),null):(e.data.data.scopes&&(e.data.data.scope=e.data.data.scopes,delete e.data.data.scopes),e.data.data.expires_in&&(e.data.data.expires_in=parseInt(e.data.data.expires_in)||0),this.callback(null,e.data.data)))}}]),e}(),a=function(){function e(r,n){t(this,e),this.options=n,this.sdk=r}return n(e,[{key:"authorize",value:function(){var e=this;return new Promise((function(t,r){var n=e.sdk.authorizeURL(e.options,"button"),i=window.screen.width/2-250,a=window.screen.height/2-325;new o(e.options).start(null,(function(e,n){if(e)return r(e);t(n)}));var s=function(){window.open(n,"livechat-login-popup","resizable,scrollbars,width=".concat(500,",height=").concat(650,",left=").concat(i,",top=").concat(a))};document.requestStorageAccess?document.requestStorageAccess().then(s,s):s()}))}}]),e}(),s=Object.prototype.hasOwnProperty,c=Array.isArray,u=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),l=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},f={arrayToObject:l,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],i=0;i<r.length;++i)for(var o=r[i],a=o.obj[o.prop],s=Object.keys(a),u=0;u<s.length;++u){var l=s[u],f=a[l];"object"===e(f)&&null!==f&&-1===n.indexOf(f)&&(r.push({obj:a,prop:l}),n.push(f))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(c(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);t.obj[t.prop]=n}}}(r),t},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(t,r,n){if(0===t.length)return t;var i=t;if("symbol"===e(t)?i=Symbol.prototype.toString.call(t):"string"!=typeof t&&(i=String(t)),"iso-8859-1"===n)return escape(i).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var o="",a=0;a<i.length;++a){var s=i.charCodeAt(a);45===s||46===s||95===s||126===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122?o+=i.charAt(a):s<128?o+=u[s]:s<2048?o+=u[192|s>>6]+u[128|63&s]:s<55296||s>=57344?o+=u[224|s>>12]+u[128|s>>6&63]+u[128|63&s]:(a+=1,s=65536+((1023&s)<<10|1023&i.charCodeAt(a)),o+=u[240|s>>18]+u[128|s>>12&63]+u[128|s>>6&63]+u[128|63&s])}return o},isBuffer:function(t){return!(!t||"object"!==e(t))&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(c(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function t(r,n,i){if(!n)return r;if("object"!==e(n)){if(c(r))r.push(n);else{if(!r||"object"!==e(r))return[r,n];(i&&(i.plainObjects||i.allowPrototypes)||!s.call(Object.prototype,n))&&(r[n]=!0)}return r}if(!r||"object"!==e(r))return[r].concat(n);var o=r;return c(r)&&!c(n)&&(o=l(r,i)),c(r)&&c(n)?(n.forEach((function(n,o){if(s.call(r,o)){var a=r[o];a&&"object"===e(a)&&n&&"object"===e(n)?r[o]=t(a,n,i):r.push(n)}else r[o]=n})),r):Object.keys(n).reduce((function(e,r){var o=n[r];return s.call(e,r)?e[r]=t(e[r],o,i):e[r]=o,e}),o)}},p=String.prototype.replace,h=/%20/g,d={RFC1738:"RFC1738",RFC3986:"RFC3986"},y=f.assign({default:d.RFC3986,formatters:{RFC1738:function(e){return p.call(e,h,"+")},RFC3986:function(e){return String(e)}}},d),g=Object.prototype.hasOwnProperty,m={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},v=Array.isArray,b=Array.prototype.push,_=function(e,t){b.apply(e,v(t)?t:[t])},w=Date.prototype.toISOString,k=y.default,x={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:f.encode,encodeValuesOnly:!1,format:k,formatter:y.formatters[k],indices:!1,serializeDate:function(e){return w.call(e)},skipNulls:!1,strictNullHandling:!1},O=function t(r,n,i,o,a,s,c,u,l,p,h,d,y){var g,m=r;if("function"==typeof c?m=c(n,m):m instanceof Date?m=p(m):"comma"===i&&v(m)&&(m=f.maybeMap(m,(function(e){return e instanceof Date?p(e):e})).join(",")),null===m){if(o)return s&&!d?s(n,x.encoder,y,"key"):n;m=""}if("string"==typeof(g=m)||"number"==typeof g||"boolean"==typeof g||"symbol"===e(g)||"bigint"==typeof g||f.isBuffer(m))return s?[h(d?n:s(n,x.encoder,y,"key"))+"="+h(s(m,x.encoder,y,"value"))]:[h(n)+"="+h(String(m))];var b,w=[];if(void 0===m)return w;if(v(c))b=c;else{var k=Object.keys(m);b=u?k.sort(u):k}for(var O=0;O<b.length;++O){var j=b[O],S=m[j];if(!a||null!==S){var A=v(m)?"function"==typeof i?i(n,j):n:n+(l?"."+j:"["+j+"]");_(w,t(S,A,i,o,a,s,c,u,l,p,h,d,y))}}return w},j=Object.prototype.hasOwnProperty,S=Array.isArray,A={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:f.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},I=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},C=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},D=function(e,t,r,n){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(i),s=a?i.slice(0,a.index):i,c=[];if(s){if(!r.plainObjects&&j.call(Object.prototype,s)&&!r.allowPrototypes)return;c.push(s)}for(var u=0;r.depth>0&&null!==(a=o.exec(i))&&u<r.depth;){if(u+=1,!r.plainObjects&&j.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;c.push(a[1])}return a&&c.push("["+i.slice(a.index)+"]"),function(e,t,r,n){for(var i=n?t:C(t,r),o=e.length-1;o>=0;--o){var a,s=e[o];if("[]"===s&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(c,10);r.parseArrays||""!==c?!isNaN(u)&&s!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(a=[])[u]=i:a[c]=i:a={0:i}}i=a}return i}(c,t,r,n)}},N=function(e,t){var r=function(e){if(!e)return A;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?A.charset:e.charset;return{allowDots:void 0===e.allowDots?A.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:A.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:A.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:A.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:A.comma,decoder:"function"==typeof e.decoder?e.decoder:A.decoder,delimiter:"string"==typeof e.delimiter||f.isRegExp(e.delimiter)?e.delimiter:A.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:A.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:A.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:A.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:A.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:A.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof e?function(e,t){var r,n={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,a=i.split(t.delimiter,o),s=-1,c=t.charset;if(t.charsetSentinel)for(r=0;r<a.length;++r)0===a[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===a[r]?c="utf-8":"utf8=%26%2310003%3B"===a[r]&&(c="iso-8859-1"),s=r,r=a.length);for(r=0;r<a.length;++r)if(r!==s){var u,l,p=a[r],h=p.indexOf("]="),d=-1===h?p.indexOf("="):h+1;-1===d?(u=t.decoder(p,A.decoder,c,"key"),l=t.strictNullHandling?null:""):(u=t.decoder(p.slice(0,d),A.decoder,c,"key"),l=f.maybeMap(C(p.slice(d+1),t),(function(e){return t.decoder(e,A.decoder,c,"value")}))),l&&t.interpretNumericEntities&&"iso-8859-1"===c&&(l=I(l)),p.indexOf("[]=")>-1&&(l=S(l)?[l]:l),j.call(n,u)?n[u]=f.combine(n[u],l):n[u]=l}return n}(e,r):e,i=r.plainObjects?Object.create(null):{},o=Object.keys(n),a=0;a<o.length;++a){var s=o[a],c=D(s,n[s],r,"string"==typeof e);i=f.merge(i,c,r)}return f.compact(i)},P=function(t,r){var n,i=t,o=function(e){if(!e)return x;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||x.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=y.default;if(void 0!==e.format){if(!g.call(y.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=y.formatters[r],i=x.filter;return("function"==typeof e.filter||v(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:x.addQueryPrefix,allowDots:void 0===e.allowDots?x.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:x.charsetSentinel,delimiter:void 0===e.delimiter?x.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:x.encode,encoder:"function"==typeof e.encoder?e.encoder:x.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:x.encodeValuesOnly,filter:i,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:x.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:x.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:x.strictNullHandling}}(r);"function"==typeof o.filter?i=(0,o.filter)("",i):v(o.filter)&&(n=o.filter);var a,s=[];if("object"!==e(i)||null===i)return"";a=r&&r.arrayFormat in m?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices";var c=m[a];n||(n=Object.keys(i)),o.sort&&n.sort(o.sort);for(var u=0;u<n.length;++u){var l=n[u];o.skipNulls&&null===i[l]||_(s,O(i[l],l,c,o.strictNullHandling,o.skipNulls,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.formatter,o.encodeValuesOnly,o.charset))}var f=s.join(o.delimiter),p=!0===o.addQueryPrefix?"?":"";return o.charsetSentinel&&("iso-8859-1"===o.charset?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),f.length>0?p+f:""};
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).AccountsSDK=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s={extend:function(e){return e.oauth_exception&&this.oauth_exception[e.oauth_exception]?Object.assign(e,{description:this.oauth_exception[e.oauth_exception]}):e.identity_exception&&this.identity_exception[e.identity_exception]?Object.assign(e,{description:this.identity_exception[e.identity_exception]}):e},oauth_exception:{invalid_request:"You may be loading accounts-sdk on a domain that is not whitelisted.",unauthorized_client:"Client not found, not provided or incorectly configured.",access_denied:"Probably this application is installed on a different account and you do not have access to it.",unsupported_response_type:"Provided response type is incorrect or unavailable for a given client."},identity_exception:{unauthorized:"Resource owner identity is not known or consent is missing."}},c=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t(this,e),this.options=r,this.listening=!1,this.receiveMessage=this.receiveMessage.bind(this)}return n(e,[{key:"start",value:function(e,t){var r=this;this._listenerInited||(this.listening=!0,this.callback=t,e&&(this.tid=setTimeout((function(){r.stop(),t("timeout",null)}),e)),window.addEventListener("message",this.receiveMessage))}},{key:"stop",value:function(){this.listening=!1,clearTimeout(this.tid),window.removeEventListener("message",this.receiveMessage,!1)}},{key:"receiveMessage",value:function(e){e.origin!==this.options.server_url&&e.origin!==this.options.server_url.replace(/livechat\.com$/,"livechatinc.com")||(e.data.data||e.data.error)&&(this.stop(),e.data.error?this.callback(s.extend(e.data.error),null):(e.data.data.scopes&&(e.data.data.scope=e.data.data.scopes,delete e.data.data.scopes),e.data.data.expires_in&&(e.data.data.expires_in=parseInt(e.data.data.expires_in)||0),this.callback(null,e.data.data)))}}]),e}(),u=function(){function e(r,n){t(this,e),this.options=n,this.sdk=r}return n(e,[{key:"authorize",value:function(){var e=this;return new Promise((function(t,r){var n=e.sdk.authorizeURL(e.options,"button"),i=window.screen.width/2-250,o=window.screen.height/2-325;new c(e.options).start(null,(function(e,n){if(e)return r(e);t(n)}));var a=function(){window.open(n,"livechat-login-popup","resizable,scrollbars,width=".concat(500,",height=").concat(650,",left=").concat(i,",top=").concat(o))};document.requestStorageAccess?document.requestStorageAccess().then(a,a):a()}))}}]),e}(),l=Object.prototype.hasOwnProperty,f=Array.isArray,p=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),h=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},d={arrayToObject:h,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],i=0;i<r.length;++i)for(var o=r[i],a=o.obj[o.prop],s=Object.keys(a),c=0;c<s.length;++c){var u=s[c],l=a[u];"object"===e(l)&&null!==l&&-1===n.indexOf(l)&&(r.push({obj:a,prop:u}),n.push(l))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(f(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);t.obj[t.prop]=n}}}(r),t},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(t,r,n){if(0===t.length)return t;var i=t;if("symbol"===e(t)?i=Symbol.prototype.toString.call(t):"string"!=typeof t&&(i=String(t)),"iso-8859-1"===n)return escape(i).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var o="",a=0;a<i.length;++a){var s=i.charCodeAt(a);45===s||46===s||95===s||126===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122?o+=i.charAt(a):s<128?o+=p[s]:s<2048?o+=p[192|s>>6]+p[128|63&s]:s<55296||s>=57344?o+=p[224|s>>12]+p[128|s>>6&63]+p[128|63&s]:(a+=1,s=65536+((1023&s)<<10|1023&i.charCodeAt(a)),o+=p[240|s>>18]+p[128|s>>12&63]+p[128|s>>6&63]+p[128|63&s])}return o},isBuffer:function(t){return!(!t||"object"!==e(t))&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(f(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function t(r,n,i){if(!n)return r;if("object"!==e(n)){if(f(r))r.push(n);else{if(!r||"object"!==e(r))return[r,n];(i&&(i.plainObjects||i.allowPrototypes)||!l.call(Object.prototype,n))&&(r[n]=!0)}return r}if(!r||"object"!==e(r))return[r].concat(n);var o=r;return f(r)&&!f(n)&&(o=h(r,i)),f(r)&&f(n)?(n.forEach((function(n,o){if(l.call(r,o)){var a=r[o];a&&"object"===e(a)&&n&&"object"===e(n)?r[o]=t(a,n,i):r.push(n)}else r[o]=n})),r):Object.keys(n).reduce((function(e,r){var o=n[r];return l.call(e,r)?e[r]=t(e[r],o,i):e[r]=o,e}),o)}},y=String.prototype.replace,g=/%20/g,m={RFC1738:"RFC1738",RFC3986:"RFC3986"},v=d.assign({default:m.RFC3986,formatters:{RFC1738:function(e){return y.call(e,g,"+")},RFC3986:function(e){return String(e)}}},m),b=Object.prototype.hasOwnProperty,w={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},_=Array.isArray,k=Array.prototype.push,O=function(e,t){k.apply(e,_(t)?t:[t])},j=Date.prototype.toISOString,x=v.default,S={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:d.encode,encodeValuesOnly:!1,format:x,formatter:v.formatters[x],indices:!1,serializeDate:function(e){return j.call(e)},skipNulls:!1,strictNullHandling:!1},A=function t(r,n,i,o,a,s,c,u,l,f,p,h,y){var g,m=r;if("function"==typeof c?m=c(n,m):m instanceof Date?m=f(m):"comma"===i&&_(m)&&(m=d.maybeMap(m,(function(e){return e instanceof Date?f(e):e})).join(",")),null===m){if(o)return s&&!h?s(n,S.encoder,y,"key"):n;m=""}if("string"==typeof(g=m)||"number"==typeof g||"boolean"==typeof g||"symbol"===e(g)||"bigint"==typeof g||d.isBuffer(m))return s?[p(h?n:s(n,S.encoder,y,"key"))+"="+p(s(m,S.encoder,y,"value"))]:[p(n)+"="+p(String(m))];var v,b=[];if(void 0===m)return b;if(_(c))v=c;else{var w=Object.keys(m);v=u?w.sort(u):w}for(var k=0;k<v.length;++k){var j=v[k],x=m[j];if(!a||null!==x){var A=_(m)?"function"==typeof i?i(n,j):n:n+(l?"."+j:"["+j+"]");O(b,t(x,A,i,o,a,s,c,u,l,f,p,h,y))}}return b},I=Object.prototype.hasOwnProperty,P=Array.isArray,C={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:d.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},D=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},N=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},R=function(e,t,r,n){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(i),s=a?i.slice(0,a.index):i,c=[];if(s){if(!r.plainObjects&&I.call(Object.prototype,s)&&!r.allowPrototypes)return;c.push(s)}for(var u=0;r.depth>0&&null!==(a=o.exec(i))&&u<r.depth;){if(u+=1,!r.plainObjects&&I.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;c.push(a[1])}return a&&c.push("["+i.slice(a.index)+"]"),function(e,t,r,n){for(var i=n?t:N(t,r),o=e.length-1;o>=0;--o){var a,s=e[o];if("[]"===s&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(c,10);r.parseArrays||""!==c?!isNaN(u)&&s!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(a=[])[u]=i:a[c]=i:a={0:i}}i=a}return i}(c,t,r,n)}},E=function(e,t){var r=function(e){if(!e)return C;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?C.charset:e.charset;return{allowDots:void 0===e.allowDots?C.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:C.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:C.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:C.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:C.comma,decoder:"function"==typeof e.decoder?e.decoder:C.decoder,delimiter:"string"==typeof e.delimiter||d.isRegExp(e.delimiter)?e.delimiter:C.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:C.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:C.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:C.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:C.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:C.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof e?function(e,t){var r,n={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,a=i.split(t.delimiter,o),s=-1,c=t.charset;if(t.charsetSentinel)for(r=0;r<a.length;++r)0===a[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===a[r]?c="utf-8":"utf8=%26%2310003%3B"===a[r]&&(c="iso-8859-1"),s=r,r=a.length);for(r=0;r<a.length;++r)if(r!==s){var u,l,f=a[r],p=f.indexOf("]="),h=-1===p?f.indexOf("="):p+1;-1===h?(u=t.decoder(f,C.decoder,c,"key"),l=t.strictNullHandling?null:""):(u=t.decoder(f.slice(0,h),C.decoder,c,"key"),l=d.maybeMap(N(f.slice(h+1),t),(function(e){return t.decoder(e,C.decoder,c,"value")}))),l&&t.interpretNumericEntities&&"iso-8859-1"===c&&(l=D(l)),f.indexOf("[]=")>-1&&(l=P(l)?[l]:l),I.call(n,u)?n[u]=d.combine(n[u],l):n[u]=l}return n}(e,r):e,i=r.plainObjects?Object.create(null):{},o=Object.keys(n),a=0;a<o.length;++a){var s=o[a],c=R(s,n[s],r,"string"==typeof e);i=d.merge(i,c,r)}return d.compact(i)},L=function(t,r){var n,i=t,o=function(e){if(!e)return S;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||S.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=v.default;if(void 0!==e.format){if(!b.call(v.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=v.formatters[r],i=S.filter;return("function"==typeof e.filter||_(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:S.addQueryPrefix,allowDots:void 0===e.allowDots?S.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:S.charsetSentinel,delimiter:void 0===e.delimiter?S.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:S.encode,encoder:"function"==typeof e.encoder?e.encoder:S.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:S.encodeValuesOnly,filter:i,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:S.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:S.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:S.strictNullHandling}}(r);"function"==typeof o.filter?i=(0,o.filter)("",i):_(o.filter)&&(n=o.filter);var a,s=[];if("object"!==e(i)||null===i)return"";a=r&&r.arrayFormat in w?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices";var c=w[a];n||(n=Object.keys(i)),o.sort&&n.sort(o.sort);for(var u=0;u<n.length;++u){var l=n[u];o.skipNulls&&null===i[l]||O(s,A(i[l],l,c,o.strictNullHandling,o.skipNulls,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.formatter,o.encodeValuesOnly,o.charset))}var f=s.join(o.delimiter),p=!0===o.addQueryPrefix?"?":"";return o.charsetSentinel&&("iso-8859-1"===o.charset?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),f.length>0?p+f:""};
/** @fileOverview

@@ -6,3 +6,3 @@ * @author Auth0 https://github.com/auth0/auth0.js

*/
function R(e,t){return t.reduce((function(t,r){return e[r]&&(t[r]=e[r]),t}),{})}var E=function(){function e(r,n){t(this,e),this.options=n,this.sdk=r}return n(e,[{key:"authorize",value:function(){var e=this.sdk.authorizeURL(this.options);window.location=e}},{key:"authorizeData",value:function(){var e=this;return new Promise((function(t,r){var n={},o=[];switch(e.options.response_type){case"token":if(o=["access_token","expires_in","token_type"],n=R(n=N(window.location.hash.substring(1)),["access_token","expires_in","state","scope","token_type"]),!o.every((function(e){return n.hasOwnProperty(e)})))return void r(i.extend({identity_exception:"unauthorized"}));n.expires_in=parseInt(n.expires_in);break;case"code":if(o=["code"],n=R(n=N(window.location.search,{ignoreQueryPrefix:!0}),["state","code"]),!o.every((function(e){return n.hasOwnProperty(e)})))return void r(i.extend({identity_exception:"unauthorized"}))}t(n)}))}}]),e}(),L=function(){function e(r,n){t(this,e),this.options=n,this.sdk=r}return n(e,[{key:"authorize",value:function(){var e=this;return new Promise((function(t,r){var n=e.sdk.authorizeURL(e.options,"button");new o(e.options).start(5e3,(function(n,i){if(e.removeIframe(),n)return r(n);t(i)}));var i=document.createElement("iframe");i.setAttribute("src",n),i.setAttribute("id",e.iframeID()),i.style.width="1px",i.style.height="1px",i.style.position="fixed",i.style.top="0",i.style.right="0",i.style.opacity="0",i.style.visibility="none",document.body.appendChild(i)}))}},{key:"iframeID",value:function(){return this.options.client_id+this.options.response_type}},{key:"removeIframe",value:function(){var e=document.getElementById(this.iframeID());e&&e.parentNode&&e.parentNode.removeChild(e)}}]),e}();var U={string:
function U(e,t){return t.reduce((function(t,r){return e[r]&&(t[r]=e[r]),t}),{})}var z=function(){function e(r,n){t(this,e),this.options=n,this.sdk=r}return n(e,[{key:"authorize",value:function(){var e=this.sdk.authorizeURL(this.options);window.location=e}},{key:"authorizeData",value:function(){var e=this;return new Promise((function(t,r){var n={},i=[];switch(e.options.response_type){case"token":if(i=["access_token","expires_in","token_type"],n=U(n=E(window.location.hash.substring(1)),["access_token","expires_in","state","scope","token_type"]),!i.every((function(e){return n.hasOwnProperty(e)})))return void r(s.extend({identity_exception:"unauthorized"}));n.expires_in=parseInt(n.expires_in);break;case"code":if(i=["code"],n=U(n=E(window.location.search,{ignoreQueryPrefix:!0}),["state","code"]),!i.every((function(e){return n.hasOwnProperty(e)})))return void r(s.extend({identity_exception:"unauthorized"}))}e.sdk.redirectUriParamsPersister.retrieve(n.state),t(n)}))}}]),e}(),M=function(){function e(r,n){t(this,e),this.options=n,this.sdk=r}return n(e,[{key:"authorize",value:function(){var e=this;return new Promise((function(t,r){var n=e.sdk.authorizeURL(e.options,"button");new c(e.options).start(5e3,(function(n,i){if(e.removeIframe(),n)return r(n);t(i)}));var i=document.createElement("iframe");i.setAttribute("src",n),i.setAttribute("id",e.iframeID()),i.style.width="1px",i.style.height="1px",i.style.position="fixed",i.style.top="0",i.style.right="0",i.style.opacity="0",i.style.visibility="none",document.body.appendChild(i)}))}},{key:"iframeID",value:function(){return this.options.client_id+this.options.response_type}},{key:"removeIframe",value:function(){var e=document.getElementById(this.iframeID());e&&e.parentNode&&e.parentNode.removeChild(e)}}]),e}();
/** @fileOverview

@@ -12,7 +12,8 @@ * @author Auth0 https://github.com/auth0/auth0.js

*/
function(e){var t=new Uint8Array(e),r=[],n="0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~",i=window.crypto||window.msCrypto,o="";if(i)o=i.getRandomValues(t);else for(var a=0;a<e;a++)o+=n.charAt(Math.floor(Math.random()*n.length));for(var s=0;s<o.length;s++)r.push(n[o[s]%n.length]);return r.join("")}};
function B(){}B.prototype.getItem=function(){return null},B.prototype.removeItem=function(){},B.prototype.setItem=function(){};var T=function(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}((function(e,t){var r;r=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function r(n){function i(){}function o(t,r,o){if("undefined"!=typeof document){"number"==typeof(o=e({path:"/"},i.defaults,o)).expires&&(o.expires=new Date(1*new Date+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{var a=JSON.stringify(r);/^[\{\[]/.test(a)&&(r=a)}catch(e){}r=n.write?n.write(r,t):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s="";for(var c in o)o[c]&&(s+="; "+c,!0!==o[c]&&(s+="="+o[c].split(";")[0]));return document.cookie=t+"="+r+s}}function a(e,r){if("undefined"!=typeof document){for(var i={},o=document.cookie?document.cookie.split("; "):[],a=0;a<o.length;a++){var s=o[a].split("="),c=s.slice(1).join("=");r||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var u=t(s[0]);if(c=(n.read||n)(c,u)||t(c),r)try{c=JSON.parse(c)}catch(e){}if(i[u]=c,e===u)break}catch(e){}}return e?i[e]:i}}return i.set=o,i.get=function(e){return a(e,!1)},i.getJSON=function(e){return a(e,!0)},i.remove=function(t,r){o(t,"",e(r,{expires:-1}))},i.defaults={},i.withConverter=r,i}((function(){}))},e.exports=r()}));function H(){}function F(e){if(this.storage=new H,!0===e.force_local_storage)try{var t=window.localStorage;t&&(this.storage=t)}catch(e){console.warn(e),console.warn("Cant use localStorage. Using CookieStorage instead.")}}function Q(e){this.handler=new F(e)}H.prototype.getItem=function(e){return T.get(e)},H.prototype.removeItem=function(e){T.remove(e)},H.prototype.setItem=function(e,t,r){var n=Object.assign({expires:1,SameSite:"none",Secure:!0},r);T.set(e,t,n)},F.prototype.failover=function(){this.storage instanceof B?console.warn("DummyStorage: ignore failover"):this.storage instanceof H?(console.warn("CookieStorage: failing over DummyStorage"),this.storage=new B):(console.warn("LocalStorage: failing over CookieStorage"),this.storage=new H)},F.prototype.getItem=function(e){try{return this.storage.getItem(e)}catch(t){return console.warn(t),this.failover(),this.getItem(e)}},F.prototype.removeItem=function(e){try{return this.storage.removeItem(e)}catch(t){return console.warn(t),this.failover(),this.removeItem(e)}},F.prototype.setItem=function(e,t,r){try{return this.storage.setItem(e,t,r)}catch(n){return console.warn(n),this.failover(),this.setItem(e,t,r)}},Q.prototype.getItem=function(e){var t=this.handler.getItem(e);try{return JSON.parse(t)}catch(e){return t}},Q.prototype.removeItem=function(e){return this.handler.removeItem(e)},Q.prototype.setItem=function(e,t,r){var n=JSON.stringify(t);return this.handler.setItem(e,n,r)};var q=function(){function e(r){t(this,e),this.options=r.transaction,this.storage=new Q(this.options)}return n(e,[{key:"generate",value:function(e){this.storage.setItem(this.options.namespace+e.state,{state:e.state,code_verifier:e.code_verifier},{expires:1/48})}},{key:"get",value:function(e){var t=this.storage.getItem(this.options.namespace+e);return this.clear(e),t||{}}},{key:"clear",value:function(e){this.storage.removeItem(this.options.namespace+e)}}]),e}(),V={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(e){this.toString=function(){return"CORRUPT: "+this.message},this.message=e},invalid:function(e){this.toString=function(){return"INVALID: "+this.message},this.message=e},bug:function(e){this.toString=function(){return"BUG: "+this.message},this.message=e},notReady:function(e){this.toString=function(){return"NOT READY: "+this.message},this.message=e}}};V.bitArray={bitSlice:function(e,t,r){return e=V.bitArray._shiftRight(e.slice(t/32),32-(31&t)).slice(1),void 0===r?e:V.bitArray.clamp(e,r-t)},extract:function(e,t,r){var n=Math.floor(-t-r&31);return(-32&(t+r-1^t)?e[t/32|0]<<32-n^e[t/32+1|0]>>>n:e[t/32|0]>>>n)&(1<<r)-1},concat:function(e,t){if(0===e.length||0===t.length)return e.concat(t);var r=e[e.length-1],n=V.bitArray.getPartial(r);return 32===n?e.concat(t):V.bitArray._shiftRight(t,n,0|r,e.slice(0,e.length-1))},bitLength:function(e){var t,r=e.length;return 0===r?0:(t=e[r-1],32*(r-1)+V.bitArray.getPartial(t))},clamp:function(e,t){if(32*e.length<t)return e;var r=(e=e.slice(0,Math.ceil(t/32))).length;return t&=31,r>0&&t&&(e[r-1]=V.bitArray.partial(t,e[r-1]&2147483648>>t-1,1)),e},partial:function(e,t,r){return 32===e?t:(r?0|t:t<<32-e)+1099511627776*e},getPartial:function(e){return Math.round(e/1099511627776)||32},equal:function(e,t){if(V.bitArray.bitLength(e)!==V.bitArray.bitLength(t))return!1;var r,n=0;for(r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n},_shiftRight:function(e,t,r,n){var i,o,a;for(void 0===n&&(n=[]);t>=32;t-=32)n.push(r),r=0;if(0===t)return n.concat(e);for(i=0;i<e.length;i++)n.push(r|e[i]>>>t),r=e[i]<<32-t;return o=e.length?e[e.length-1]:0,a=V.bitArray.getPartial(o),n.push(V.bitArray.partial(t+a&31,t+a>32?r:n.pop(),1)),n},_xor4:function(e,t){return[e[0]^t[0],e[1]^t[1],e[2]^t[2],e[3]^t[3]]},byteswapM:function(e){var t,r;for(t=0;t<e.length;++t)r=e[t],e[t]=r>>>24|r>>>8&65280|(65280&r)<<8|r<<24;return e}},V.codec.utf8String={fromBits:function(e){var t,r,n="",i=V.bitArray.bitLength(e);for(t=0;t<i/8;t++)0==(3&t)&&(r=e[t/4]),n+=String.fromCharCode(r>>>8>>>8>>>8),r<<=8;return decodeURIComponent(escape(n))},toBits:function(e){e=unescape(encodeURIComponent(e));var t,r=[],n=0;for(t=0;t<e.length;t++)n=n<<8|e.charCodeAt(t),3==(3&t)&&(r.push(n),n=0);return 3&t&&r.push(V.bitArray.partial(8*(3&t),n)),r}},V.hash.sha256=function(e){this._key[0]||this._precompute(),e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()},V.hash.sha256.hash=function(e){return(new V.hash.sha256).update(e).finalize()},V.hash.sha256.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(e){"string"==typeof e&&(e=V.codec.utf8String.toBits(e));var t,r=this._buffer=V.bitArray.concat(this._buffer,e),n=this._length,i=this._length=n+V.bitArray.bitLength(e);if(i>9007199254740991)throw new V.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var o=new Uint32Array(r),a=0;for(t=512+n-(512+n&511);t<=i;t+=512)this._block(o.subarray(16*a,16*(a+1))),a+=1;r.splice(0,16*a)}else for(t=512+n-(512+n&511);t<=i;t+=512)this._block(r.splice(0,16));return this},finalize:function(){var e,t=this._buffer,r=this._h;for(e=(t=V.bitArray.concat(t,[V.bitArray.partial(1,1)])).length+2;15&e;e++)t.push(0);for(t.push(Math.floor(this._length/4294967296)),t.push(0|this._length);t.length;)this._block(t.splice(0,16));return this.reset(),r},_init:[],_key:[],_precompute:function(){var e,t,r=0,n=2;function i(e){return 4294967296*(e-Math.floor(e))|0}for(;r<64;n++){for(t=!0,e=2;e*e<=n;e++)if(n%e==0){t=!1;break}t&&(r<8&&(this._init[r]=i(Math.pow(n,.5))),this._key[r]=i(Math.pow(n,1/3)),r++)}},_block:function(e){var t,r,n,i,o=this._h,a=this._key,s=o[0],c=o[1],u=o[2],l=o[3],f=o[4],p=o[5],h=o[6],d=o[7];for(t=0;t<64;t++)t<16?r=e[t]:(n=e[t+1&15],i=e[t+14&15],r=e[15&t]=(n>>>7^n>>>18^n>>>3^n<<25^n<<14)+(i>>>17^i>>>19^i>>>10^i<<15^i<<13)+e[15&t]+e[t+9&15]|0),r=r+d+(f>>>6^f>>>11^f>>>25^f<<26^f<<21^f<<7)+(h^f&(p^h))+a[t],d=h,h=p,p=f,f=l+r|0,l=u,u=c,s=r+((c=s)&u^l&(c^u))+(c>>>2^c>>>13^c>>>22^c<<30^c<<19^c<<10)|0;o[0]=o[0]+s|0,o[1]=o[1]+c|0,o[2]=o[2]+u|0,o[3]=o[3]+l|0,o[4]=o[4]+f|0,o[5]=o[5]+p|0,o[6]=o[6]+h|0,o[7]=o[7]+d|0}};var J={base64URLEncode:function(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}},Y=function(){function e(r,n){t(this,e),this.options={namespace:r.transaction.namespace+n},this.storage=new Q(this.options)}return n(e,[{key:"set",value:function(e,t){this.storage.setItem(this.options.namespace+e,t,{expires:1/48})}},{key:"get",value:function(e){var t=this.storage.getItem(this.options.namespace+e);return this.clear(e),t||{}}},{key:"clear",value:function(e){this.storage.removeItem(this.options.namespace+e)}}]),e}(),$=function(){function e(r){t(this,e),this.persister=new Y(r,"redirect_uri_params")}return n(e,[{key:"persist",value:function(e){var t=new URL(e.redirect_uri),r=E(t.search.substring(1)),n=E(t.hash.substring(1));this.persister.set(e.state,{query_params:r,hash_params:n}),e.redirect_uri=t.origin+t.pathname}},{key:"retrieve",value:function(e){var t,r,n=this.persister.get(e,!1);if(n){var i=a(a({},null!==(t=n.query_params)&&void 0!==t?t:{}),E(window.location.search.substring(1))),o=a(a({},null!==(r=n.hash_params)&&void 0!==r?r:{}),E(window.location.hash.substring(1))),s=window.location.origin+window.location.pathname;i&&(s+="?"+L(i)),o&&(s+="#"+L(o)),window.history.replaceState({},document.title,s)}}}]),e}();var G={string:
/** @fileOverview
* @author Auth0 https://github.com/auth0/auth0.js
* @license MIT
*/function z(){}z.prototype.getItem=function(){return null},z.prototype.removeItem=function(){},z.prototype.setItem=function(){};var M=function(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}((function(e,t){var r;r=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function r(n){function i(){}function o(t,r,o){if("undefined"!=typeof document){"number"==typeof(o=e({path:"/"},i.defaults,o)).expires&&(o.expires=new Date(1*new Date+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{var a=JSON.stringify(r);/^[\{\[]/.test(a)&&(r=a)}catch(e){}r=n.write?n.write(r,t):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s="";for(var c in o)o[c]&&(s+="; "+c,!0!==o[c]&&(s+="="+o[c].split(";")[0]));return document.cookie=t+"="+r+s}}function a(e,r){if("undefined"!=typeof document){for(var i={},o=document.cookie?document.cookie.split("; "):[],a=0;a<o.length;a++){var s=o[a].split("="),c=s.slice(1).join("=");r||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var u=t(s[0]);if(c=(n.read||n)(c,u)||t(c),r)try{c=JSON.parse(c)}catch(e){}if(i[u]=c,e===u)break}catch(e){}}return e?i[e]:i}}return i.set=o,i.get=function(e){return a(e,!1)},i.getJSON=function(e){return a(e,!0)},i.remove=function(t,r){o(t,"",e(r,{expires:-1}))},i.defaults={},i.withConverter=r,i}((function(){}))},e.exports=r()}));function B(){}function T(e){if(this.storage=new B,!0===e.force_local_storage)try{var t=window.localStorage;t&&(this.storage=t)}catch(e){console.warn(e),console.warn("Cant use localStorage. Using CookieStorage instead.")}}function H(e){this.handler=new T(e)}B.prototype.getItem=function(e){return M.get(e)},B.prototype.removeItem=function(e){M.remove(e)},B.prototype.setItem=function(e,t,r){var n=Object.assign({expires:1},r);M.set(e,t,n)},T.prototype.failover=function(){this.storage instanceof z?console.warn("DummyStorage: ignore failover"):this.storage instanceof B?(console.warn("CookieStorage: failing over DummyStorage"),this.storage=new z):(console.warn("LocalStorage: failing over CookieStorage"),this.storage=new B)},T.prototype.getItem=function(e){try{return this.storage.getItem(e)}catch(t){return console.warn(t),this.failover(),this.getItem(e)}},T.prototype.removeItem=function(e){try{return this.storage.removeItem(e)}catch(t){return console.warn(t),this.failover(),this.removeItem(e)}},T.prototype.setItem=function(e,t,r){try{return this.storage.setItem(e,t,r)}catch(n){return console.warn(n),this.failover(),this.setItem(e,t,r)}},H.prototype.getItem=function(e){var t=this.handler.getItem(e);try{return JSON.parse(t)}catch(e){return t}},H.prototype.removeItem=function(e){return this.handler.removeItem(e)},H.prototype.setItem=function(e,t,r){var n=JSON.stringify(t);return this.handler.setItem(e,n,r)};var F=function(){function e(r){t(this,e),this.options=r.transaction,this.storage=new H(this.options)}return n(e,[{key:"generate",value:function(e){e.state||(e.state=U.string(this.options.key_length)),this.storage.setItem(this.options.namespace+e.state,{state:e.state,code_verifier:e.code_verifier},{expires:1/48})}},{key:"get",value:function(e){var t=this.storage.getItem(this.options.namespace+e);return this.clear(e),t||{}}},{key:"clear",value:function(e){this.storage.removeItem(this.options.namespace+e)}}]),e}(),Q={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(e){this.toString=function(){return"CORRUPT: "+this.message},this.message=e},invalid:function(e){this.toString=function(){return"INVALID: "+this.message},this.message=e},bug:function(e){this.toString=function(){return"BUG: "+this.message},this.message=e},notReady:function(e){this.toString=function(){return"NOT READY: "+this.message},this.message=e}}};Q.bitArray={bitSlice:function(e,t,r){return e=Q.bitArray._shiftRight(e.slice(t/32),32-(31&t)).slice(1),void 0===r?e:Q.bitArray.clamp(e,r-t)},extract:function(e,t,r){var n=Math.floor(-t-r&31);return(-32&(t+r-1^t)?e[t/32|0]<<32-n^e[t/32+1|0]>>>n:e[t/32|0]>>>n)&(1<<r)-1},concat:function(e,t){if(0===e.length||0===t.length)return e.concat(t);var r=e[e.length-1],n=Q.bitArray.getPartial(r);return 32===n?e.concat(t):Q.bitArray._shiftRight(t,n,0|r,e.slice(0,e.length-1))},bitLength:function(e){var t,r=e.length;return 0===r?0:(t=e[r-1],32*(r-1)+Q.bitArray.getPartial(t))},clamp:function(e,t){if(32*e.length<t)return e;var r=(e=e.slice(0,Math.ceil(t/32))).length;return t&=31,r>0&&t&&(e[r-1]=Q.bitArray.partial(t,e[r-1]&2147483648>>t-1,1)),e},partial:function(e,t,r){return 32===e?t:(r?0|t:t<<32-e)+1099511627776*e},getPartial:function(e){return Math.round(e/1099511627776)||32},equal:function(e,t){if(Q.bitArray.bitLength(e)!==Q.bitArray.bitLength(t))return!1;var r,n=0;for(r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n},_shiftRight:function(e,t,r,n){var i,o,a;for(void 0===n&&(n=[]);t>=32;t-=32)n.push(r),r=0;if(0===t)return n.concat(e);for(i=0;i<e.length;i++)n.push(r|e[i]>>>t),r=e[i]<<32-t;return o=e.length?e[e.length-1]:0,a=Q.bitArray.getPartial(o),n.push(Q.bitArray.partial(t+a&31,t+a>32?r:n.pop(),1)),n},_xor4:function(e,t){return[e[0]^t[0],e[1]^t[1],e[2]^t[2],e[3]^t[3]]},byteswapM:function(e){var t,r;for(t=0;t<e.length;++t)r=e[t],e[t]=r>>>24|r>>>8&65280|(65280&r)<<8|r<<24;return e}},Q.codec.utf8String={fromBits:function(e){var t,r,n="",i=Q.bitArray.bitLength(e);for(t=0;t<i/8;t++)0==(3&t)&&(r=e[t/4]),n+=String.fromCharCode(r>>>8>>>8>>>8),r<<=8;return decodeURIComponent(escape(n))},toBits:function(e){e=unescape(encodeURIComponent(e));var t,r=[],n=0;for(t=0;t<e.length;t++)n=n<<8|e.charCodeAt(t),3==(3&t)&&(r.push(n),n=0);return 3&t&&r.push(Q.bitArray.partial(8*(3&t),n)),r}},Q.hash.sha256=function(e){this._key[0]||this._precompute(),e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()},Q.hash.sha256.hash=function(e){return(new Q.hash.sha256).update(e).finalize()},Q.hash.sha256.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(e){"string"==typeof e&&(e=Q.codec.utf8String.toBits(e));var t,r=this._buffer=Q.bitArray.concat(this._buffer,e),n=this._length,i=this._length=n+Q.bitArray.bitLength(e);if(i>9007199254740991)throw new Q.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var o=new Uint32Array(r),a=0;for(t=512+n-(512+n&511);t<=i;t+=512)this._block(o.subarray(16*a,16*(a+1))),a+=1;r.splice(0,16*a)}else for(t=512+n-(512+n&511);t<=i;t+=512)this._block(r.splice(0,16));return this},finalize:function(){var e,t=this._buffer,r=this._h;for(e=(t=Q.bitArray.concat(t,[Q.bitArray.partial(1,1)])).length+2;15&e;e++)t.push(0);for(t.push(Math.floor(this._length/4294967296)),t.push(0|this._length);t.length;)this._block(t.splice(0,16));return this.reset(),r},_init:[],_key:[],_precompute:function(){var e,t,r=0,n=2;function i(e){return 4294967296*(e-Math.floor(e))|0}for(;r<64;n++){for(t=!0,e=2;e*e<=n;e++)if(n%e==0){t=!1;break}t&&(r<8&&(this._init[r]=i(Math.pow(n,.5))),this._key[r]=i(Math.pow(n,1/3)),r++)}},_block:function(e){var t,r,n,i,o=this._h,a=this._key,s=o[0],c=o[1],u=o[2],l=o[3],f=o[4],p=o[5],h=o[6],d=o[7];for(t=0;t<64;t++)t<16?r=e[t]:(n=e[t+1&15],i=e[t+14&15],r=e[15&t]=(n>>>7^n>>>18^n>>>3^n<<25^n<<14)+(i>>>17^i>>>19^i>>>10^i<<15^i<<13)+e[15&t]+e[t+9&15]|0),r=r+d+(f>>>6^f>>>11^f>>>25^f<<26^f<<21^f<<7)+(h^f&(p^h))+a[t],d=h,h=p,p=f,f=l+r|0,l=u,u=c,s=r+((c=s)&u^l&(c^u))+(c>>>2^c>>>13^c>>>22^c<<30^c<<19^c<<10)|0;o[0]=o[0]+s|0,o[1]=o[1]+c|0,o[2]=o[2]+u|0,o[3]=o[3]+l|0,o[4]=o[4]+f|0,o[5]=o[5]+p|0,o[6]=o[6]+h|0,o[7]=o[7]+d|0}};var V={base64URLEncode:function(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}};return function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t(this,e),null==r.client_id)throw new Error("client id not provided");var n={prompt:"",response_type:"token",popup_flow:"auto",state:"",verify_state:!0,verify_callback:!0,scope:null,redirect_uri:"",email_hint:null,server_url:"https://accounts.livechat.com",tracking:{utm_source:"accounts.livechat.com",utm_medium:"accounts-sdk"},transaction:{namespace:"com.livechat.accounts",key_length:32,force_local_storage:!1},pkce:{enabled:!0,code_verifier_length:128,code_challange_method:"S256"}};this.options=Object.assign({},n,r),this.transaction=new F(this.options)}return n(e,[{key:"iframe",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},this.options,e);return new L(this,t)}},{key:"popup",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},this.options,e);return new a(this,t)}},{key:"redirect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},this.options,e);return new E(this,t)}},{key:"authorizeURL",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=Object.assign({},this.options,e);r.redirect_uri||(r.redirect_uri=window.location.origin+window.location.pathname);var n=R(r,["client_id","redirect_uri","state","response_type","scope","prompt"]);Object.assign(n,r.tracking),null===n.scope&&delete n.scope,null!=t&&(n.flow=t),r.email_hint&&(n.email=r.email_hint);var i=r.server_url;if("manual"===r.popup_flow&&(i+="/signin"),r.path&&(i+=r.path),"code"===r.response_type&&r.pkce.enabled){var o=r.pkce.code_verifier||U.string(r.pkce.code_verifier_length);switch(r.pkce.code_challange_method){case"S256":var a=Q.hash.sha256.hash(o);Object.assign(n,{code_verifier:o,code_challenge:V.base64URLEncode(a),code_challenge_method:r.pkce.code_challange_method});break;default:Object.assign(n,{code_verifier:o,code_challenge:o,code_challenge_method:r.pkce.code_challange_method})}}return this.transaction.generate(n),delete n.code_verifier,i+"?"+P(n)}},{key:"verify",value:function(e){var t=this.transaction.get(e.state);return e.state&&this.options.verify_state&&t.state!=e.state?null:t}}]),e}()}));
*/
function(e){var t=new Uint8Array(e),r=[],n="0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~",i=window.crypto||window.msCrypto,o="";if(i)o=i.getRandomValues(t);else for(var a=0;a<e;a++)o+=n.charAt(Math.floor(Math.random()*n.length));for(var s=0;s<o.length;s++)r.push(n[o[s]%n.length]);return r.join("")}};return function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t(this,e),null==r.client_id)throw new Error("client id not provided");var n={prompt:"",response_type:"token",popup_flow:"auto",state:"",verify_state:!0,verify_callback:!0,scope:null,redirect_uri:"",email_hint:null,server_url:"https://accounts.livechat.com",tracking:{utm_source:"accounts.livechat.com",utm_medium:"accounts-sdk"},transaction:{namespace:"com.livechat.accounts",key_length:32,force_local_storage:!1},pkce:{enabled:!0,code_verifier_length:128,code_challange_method:"S256"}};this.options=Object.assign({},n,r),this.transaction=new q(this.options),this.redirectUriParamsPersister=new $(this.options)}return n(e,[{key:"iframe",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},this.options,e);return new M(this,t)}},{key:"popup",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},this.options,e);return new u(this,t)}},{key:"redirect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},this.options,e);return new z(this,t)}},{key:"authorizeURL",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=Object.assign({},this.options,e);n.state||(r.state=G.string(r.key_length)),r.redirect_uri||(r.redirect_uri=window.location.href);var n=U(r,["client_id","redirect_uri","state","response_type","scope","prompt"]);Object.assign(n,r.tracking),null===n.scope&&delete n.scope,null!=t&&(n.flow=t),r.email_hint&&(n.email=r.email_hint);var i=r.server_url;if("manual"===r.popup_flow&&(i+="/signin"),r.path&&(i+=r.path),"code"===r.response_type&&r.pkce.enabled){var o=r.pkce.code_verifier||G.string(r.pkce.code_verifier_length);switch(r.pkce.code_challange_method){case"S256":var a=V.hash.sha256.hash(o);Object.assign(n,{code_verifier:o,code_challenge:J.base64URLEncode(a),code_challenge_method:r.pkce.code_challange_method});break;default:Object.assign(n,{code_verifier:o,code_challenge:o,code_challenge_method:r.pkce.code_challange_method})}}return this.transaction.generate(n),this.redirectUriParamsPersister.persist(n),delete n.code_verifier,i+"?"+L(n)}},{key:"verify",value:function(e){var t=this.transaction.get(e.state);return e.state&&this.options.verify_state&&t.state!=e.state?null:t}}]),e}()}));
//# sourceMappingURL=accounts-sdk.min.js.map

@@ -245,2 +245,4 @@ 'use strict';

this.sdk.redirectUriParamsPersister.retrieve(authorizeData.state);
resolve(authorizeData);

@@ -317,36 +319,2 @@ });

function string(length) {
const bytes = new Uint8Array(length);
const result = [];
const charset =
'0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~';
const cryptoObj = window.crypto || window.msCrypto;
let random = '';
if (!cryptoObj) {
for (let i = 0; i < length; i++) {
random += charset.charAt(Math.floor(Math.random() * charset.length));
}
} else {
random = cryptoObj.getRandomValues(bytes);
}
for (let a = 0; a < random.length; a++) {
result.push(charset[random[a] % charset.length]);
}
return result.join('');
}
var random = {
string: string,
};
/* eslint-disable require-jsdoc */
/** @fileOverview
* @author Auth0 https://github.com/auth0/auth0.js
* @license MIT
*/
function DummyStorage() {}

@@ -377,2 +345,7 @@

expires: 1, // 1 day
// After august 2020 chrome changed iframe cookie policy and without
// those parameters cookies wont we stored properly if document is inside iframe.
SameSite: 'none',
Secure: true,
},

@@ -480,6 +453,2 @@ options

generate(params) {
if (!params.state) {
params.state = random.string(this.options.key_length);
}
// 30 minutes

@@ -1180,2 +1149,123 @@ this.storage.setItem(

/* eslint-disable require-jsdoc */
class Persister {
constructor(options, type) {
this.options = {
namespace: options.transaction.namespace + type,
};
this.storage = new Storage(this.options);
}
set(state, data) {
this.storage.setItem(this.options.namespace + state, data, {
expires: 1 / 48,
});
}
get(state) {
const data = this.storage.getItem(this.options.namespace + state);
this.clear(state);
return data || {};
}
clear(state) {
this.storage.removeItem(this.options.namespace + state);
}
}
/* eslint-disable require-jsdoc */
class RedirectUriParamsPersister {
constructor(options) {
this.persister = new Persister(options, 'redirect_uri_params');
}
/**
* Clears query and hash params from redirect_uri and persists them in storage
* @param {Object} params
*/
persist(params) {
const redirectUrl = new URL(params.redirect_uri);
const queryParams = qs__default['default'].parse(redirectUrl.search.substring(1));
const hashParams = qs__default['default'].parse(redirectUrl.hash.substring(1));
this.persister.set(params.state, {
query_params: queryParams,
hash_params: hashParams,
});
params.redirect_uri = redirectUrl.origin + redirectUrl.pathname;
}
/**
* Retrieves persisted query and hash params from storage and updates current location accordingly.
* Params returned by global accounts overrides persisted params in case of duplications.
* @param {Object} state
*/
retrieve(state) {
const redirectUriParams = this.persister.get(state, false);
if (!redirectUriParams) {
return;
}
const queryParams = {
...(redirectUriParams.query_params ?? {}),
...qs__default['default'].parse(window.location.search.substring(1)),
};
const hashParams = {
...(redirectUriParams.hash_params ?? {}),
...qs__default['default'].parse(window.location.hash.substring(1)),
};
let uri = window.location.origin + window.location.pathname;
if (queryParams) {
uri += '?' + qs__default['default'].stringify(queryParams);
}
if (hashParams) {
uri += '#' + qs__default['default'].stringify(hashParams);
}
window.history.replaceState({}, document.title, uri);
}
}
/* eslint-disable require-jsdoc */
/** @fileOverview
* @author Auth0 https://github.com/auth0/auth0.js
* @license MIT
*/
function string(length) {
const bytes = new Uint8Array(length);
const result = [];
const charset =
'0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~';
const cryptoObj = window.crypto || window.msCrypto;
let random = '';
if (!cryptoObj) {
for (let i = 0; i < length; i++) {
random += charset.charAt(Math.floor(Math.random() * charset.length));
}
} else {
random = cryptoObj.getRandomValues(bytes);
}
for (let a = 0; a < random.length; a++) {
result.push(charset[random[a] % charset.length]);
}
return result.join('');
}
var random = {
string: string,
};
/**

@@ -1246,2 +1336,5 @@ * Accounts SDK main class

this.transaction = new Transaction(this.options);
this.redirectUriParamsPersister = new RedirectUriParamsPersister(
this.options
);
}

@@ -1288,5 +1381,8 @@

if (!params.state) {
localOptions.state = random.string(localOptions.key_length);
}
if (!localOptions.redirect_uri) {
localOptions.redirect_uri =
window.location.origin + window.location.pathname;
localOptions.redirect_uri = window.location.href;
}

@@ -1351,3 +1447,6 @@

this.transaction.generate(params);
this.redirectUriParamsPersister.persist(params);
delete params.code_verifier;
return url + '?' + qs__default['default'].stringify(params);

@@ -1354,0 +1453,0 @@ }

@@ -236,2 +236,4 @@ import qs from 'qs';

this.sdk.redirectUriParamsPersister.retrieve(authorizeData.state);
resolve(authorizeData);

@@ -308,36 +310,2 @@ });

function string(length) {
const bytes = new Uint8Array(length);
const result = [];
const charset =
'0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~';
const cryptoObj = window.crypto || window.msCrypto;
let random = '';
if (!cryptoObj) {
for (let i = 0; i < length; i++) {
random += charset.charAt(Math.floor(Math.random() * charset.length));
}
} else {
random = cryptoObj.getRandomValues(bytes);
}
for (let a = 0; a < random.length; a++) {
result.push(charset[random[a] % charset.length]);
}
return result.join('');
}
var random = {
string: string,
};
/* eslint-disable require-jsdoc */
/** @fileOverview
* @author Auth0 https://github.com/auth0/auth0.js
* @license MIT
*/
function DummyStorage() {}

@@ -368,2 +336,7 @@

expires: 1, // 1 day
// After august 2020 chrome changed iframe cookie policy and without
// those parameters cookies wont we stored properly if document is inside iframe.
SameSite: 'none',
Secure: true,
},

@@ -471,6 +444,2 @@ options

generate(params) {
if (!params.state) {
params.state = random.string(this.options.key_length);
}
// 30 minutes

@@ -1171,2 +1140,123 @@ this.storage.setItem(

/* eslint-disable require-jsdoc */
class Persister {
constructor(options, type) {
this.options = {
namespace: options.transaction.namespace + type,
};
this.storage = new Storage(this.options);
}
set(state, data) {
this.storage.setItem(this.options.namespace + state, data, {
expires: 1 / 48,
});
}
get(state) {
const data = this.storage.getItem(this.options.namespace + state);
this.clear(state);
return data || {};
}
clear(state) {
this.storage.removeItem(this.options.namespace + state);
}
}
/* eslint-disable require-jsdoc */
class RedirectUriParamsPersister {
constructor(options) {
this.persister = new Persister(options, 'redirect_uri_params');
}
/**
* Clears query and hash params from redirect_uri and persists them in storage
* @param {Object} params
*/
persist(params) {
const redirectUrl = new URL(params.redirect_uri);
const queryParams = qs.parse(redirectUrl.search.substring(1));
const hashParams = qs.parse(redirectUrl.hash.substring(1));
this.persister.set(params.state, {
query_params: queryParams,
hash_params: hashParams,
});
params.redirect_uri = redirectUrl.origin + redirectUrl.pathname;
}
/**
* Retrieves persisted query and hash params from storage and updates current location accordingly.
* Params returned by global accounts overrides persisted params in case of duplications.
* @param {Object} state
*/
retrieve(state) {
const redirectUriParams = this.persister.get(state, false);
if (!redirectUriParams) {
return;
}
const queryParams = {
...(redirectUriParams.query_params ?? {}),
...qs.parse(window.location.search.substring(1)),
};
const hashParams = {
...(redirectUriParams.hash_params ?? {}),
...qs.parse(window.location.hash.substring(1)),
};
let uri = window.location.origin + window.location.pathname;
if (queryParams) {
uri += '?' + qs.stringify(queryParams);
}
if (hashParams) {
uri += '#' + qs.stringify(hashParams);
}
window.history.replaceState({}, document.title, uri);
}
}
/* eslint-disable require-jsdoc */
/** @fileOverview
* @author Auth0 https://github.com/auth0/auth0.js
* @license MIT
*/
function string(length) {
const bytes = new Uint8Array(length);
const result = [];
const charset =
'0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~';
const cryptoObj = window.crypto || window.msCrypto;
let random = '';
if (!cryptoObj) {
for (let i = 0; i < length; i++) {
random += charset.charAt(Math.floor(Math.random() * charset.length));
}
} else {
random = cryptoObj.getRandomValues(bytes);
}
for (let a = 0; a < random.length; a++) {
result.push(charset[random[a] % charset.length]);
}
return result.join('');
}
var random = {
string: string,
};
/**

@@ -1237,2 +1327,5 @@ * Accounts SDK main class

this.transaction = new Transaction(this.options);
this.redirectUriParamsPersister = new RedirectUriParamsPersister(
this.options
);
}

@@ -1279,5 +1372,8 @@

if (!params.state) {
localOptions.state = random.string(localOptions.key_length);
}
if (!localOptions.redirect_uri) {
localOptions.redirect_uri =
window.location.origin + window.location.pathname;
localOptions.redirect_uri = window.location.href;
}

@@ -1342,3 +1438,6 @@

this.transaction.generate(params);
this.redirectUriParamsPersister.persist(params);
delete params.code_verifier;
return url + '?' + qs.stringify(params);

@@ -1345,0 +1444,0 @@ }

{
"name": "@livechat/accounts-sdk",
"version": "2.0.6",
"description": "SDK for 'Sign in with LiveChat'.",
"author": "LiveChat",
"license": "MIT",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"unpkg": "./dist/accounts-sdk.min.js",
"files": [
"dist"
],
"scripts": {
"clean": "rm -rf dist && rm -rf build",
"start": "npm run clean && rollup -c --watch",
"prepare": "npm run build",
"build": "npm run clean && rollup -c",
"lint": "eslint ./src",
"lint:fix": "eslint --fix ./src rollup.config.js .eslintrc.js",
"test": "mocha --require @babel/register --require jsdom-global/register test/**/*.test.js --exit",
"test:dev": "mocha --require @babel/register --require jsdom-global/register test/**/*.test.js --watch"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"@babel/register": "^7.11.5",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^15.0.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"browserslist": "^4.14.2",
"eslint": "^7.9.0",
"eslint-config-google": "^0.14.0",
"expect.js": "^0.3.1",
"jsdom": "^16.4.0",
"jsdom-global": "^3.0.2",
"mocha": "^8.1.3",
"rollup": "^2.27.0",
"rollup-plugin-serve": "^1.0.4",
"rollup-plugin-terser": "^7.0.2"
},
"browserslist": "> 0.1%, not dead, not IE 11",
"dependencies": {
"js-cookie": "^2.2.1",
"qs": "^6.9.4"
}
"name": "@livechat/accounts-sdk",
"version": "2.0.7",
"description": "SDK for 'Sign in with LiveChat'.",
"author": "LiveChat",
"license": "MIT",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"unpkg": "./dist/accounts-sdk.min.js",
"files": [
"dist"
],
"scripts": {
"clean": "rm -rf dist && rm -rf build",
"start": "npm run clean && rollup -c --watch",
"prepare": "npm run build",
"build": "npm run clean && rollup -c",
"lint": "eslint ./src",
"lint:fix": "eslint --fix ./src rollup.config.js .eslintrc.js",
"test": "mocha --require @babel/register --require jsdom-global/register test/**/*.test.js --exit",
"test:dev": "mocha --require @babel/register --require jsdom-global/register test/**/*.test.js --watch"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"@babel/register": "^7.11.5",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^15.0.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"browserslist": "^4.14.2",
"eslint": "^7.9.0",
"eslint-config-google": "^0.14.0",
"expect.js": "^0.3.1",
"jsdom": "^16.4.0",
"jsdom-global": "^3.0.2",
"mocha": "^8.1.3",
"rollup": "^2.27.0",
"rollup-plugin-serve": "^1.0.4",
"rollup-plugin-terser": "^7.0.2"
},
"browserslist": "> 0.1%, not dead, not IE 11",
"dependencies": {
"js-cookie": "^2.2.1",
"qs": "^6.9.4"
}
}

@@ -68,3 +68,2 @@ # accountsSDK

sdk.redirect().authorizeData().then((authorizeData)=>{
sdk.redirect().authorizeData().then((authorizeData)=>{
// authorize data found in URL

@@ -71,0 +70,0 @@ const transaction = sdk.verify(authorizeData);

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc