@genesislcap/foundation-filters 9.0.1-alpha-b5c5eb7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MODULE_FEDERATION.md +11 -0
- package/README.md +173 -0
- package/dist/1.0.0.remoteEntry.js +1 -0
- package/dist/191.191.64feeeeeb6c4132a6cae.js +2 -0
- package/dist/191.d7c8a7fc5c69e4190ea53a04618e0459.js.map +1 -0
- package/dist/195.195.2c71a4e018ba860ab228.js +3 -0
- package/dist/195.195.2c71a4e018ba860ab228.js.LICENSE.txt +4 -0
- package/dist/195.331a5c4d39a8a3d001d3344cb66ef3b8.js.map +1 -0
- package/dist/259.0acac2573f700ecd1acac239926438a5.js.map +1 -0
- package/dist/259.259.3aa926921ed1388957f1.js +2 -0
- package/dist/338.338.cd6e49db31e7adc808c6.js +3 -0
- package/dist/338.338.cd6e49db31e7adc808c6.js.LICENSE.txt +1 -0
- package/dist/338.7a143cd09921b756e7fe871d338dcb67.js.map +1 -0
- package/dist/410.410.76d9d4b118ba230b93c4.js +2 -0
- package/dist/410.cda4ae21eb38efbf2dbfd913db12d66f.js.map +1 -0
- package/dist/755.755.ec31a791472b4b3fcb0f.js +2 -0
- package/dist/755.c71c3a1801dd2c0461f8b831d09ec90f.js.map +1 -0
- package/dist/dashboard.json +1 -0
- package/dist/dts/clientFilter.d.ts +108 -0
- package/dist/dts/clientFilter.d.ts.map +1 -0
- package/dist/dts/index.d.ts +9 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/index.federated.d.ts +1 -0
- package/dist/dts/index.federated.d.ts.map +1 -0
- package/dist/dts/logger.d.ts +17 -0
- package/dist/dts/logger.d.ts.map +1 -0
- package/dist/dts/nodeEnv.d.ts +81 -0
- package/dist/dts/nodeEnv.d.ts.map +1 -0
- package/dist/dts/percentage.d.ts +81 -0
- package/dist/dts/percentage.d.ts.map +1 -0
- package/dist/dts/timeWindow.d.ts +91 -0
- package/dist/dts/timeWindow.d.ts.map +1 -0
- package/dist/dts/tsdoc-metadata.json +11 -0
- package/dist/dts/urlTargeting.d.ts +94 -0
- package/dist/dts/urlTargeting.d.ts.map +1 -0
- package/dist/dts/userAgent.d.ts +96 -0
- package/dist/dts/userAgent.d.ts.map +1 -0
- package/dist/dts/userTargeting.d.ts +107 -0
- package/dist/dts/userTargeting.d.ts.map +1 -0
- package/dist/esm/clientFilter.js +84 -0
- package/dist/esm/clientFilter.js.map +1 -0
- package/dist/esm/index.federated.js +2 -0
- package/dist/esm/index.federated.js.map +1 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/logger.js +18 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/nodeEnv.js +48 -0
- package/dist/esm/nodeEnv.js.map +1 -0
- package/dist/esm/percentage.js +38 -0
- package/dist/esm/percentage.js.map +1 -0
- package/dist/esm/timeWindow.js +49 -0
- package/dist/esm/timeWindow.js.map +1 -0
- package/dist/esm/urlTargeting.js +68 -0
- package/dist/esm/urlTargeting.js.map +1 -0
- package/dist/esm/userAgent.js +59 -0
- package/dist/esm/userAgent.js.map +1 -0
- package/dist/esm/userTargeting.js +73 -0
- package/dist/esm/userTargeting.js.map +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/foundation-filters.api.json +3065 -0
- package/dist/foundation-filters.d.ts +707 -0
- package/dist/foundation-filters.iife.min.js +3 -0
- package/dist/foundation-filters.js +8608 -0
- package/dist/foundation-filters.min.js +3 -0
- package/dist/foundationFilters.c0ca375607bf5b49304e9efbcfb9ec0d.js.map +1 -0
- package/dist/index.ejs +23 -0
- package/dist/index.html +16 -0
- package/dist/info.ejs +13 -0
- package/dist/main.479db3c6a61354c4d21c4a52177a4fc9.js.map +1 -0
- package/dist/main.8bf3ac27c0d922605d1f.js +2 -0
- package/dist/npm.analytics.343.d4561facd9660fd45482.js +2 -0
- package/dist/npm.analytics.50acd47759b15e99bc3ad79caad7c672.js.map +1 -0
- package/dist/npm.consola.0f92c98545c00deac8a01e6e5c25e63c.js.map +1 -0
- package/dist/npm.consola.713.4cfd0e26a2fd1e472409.js +2 -0
- package/dist/npm.finos.690.4b909dcccf246b8fb074.js +2 -0
- package/dist/npm.finos.83f8bd7cc8c58aabd1049256a8d005fe.js.map +1 -0
- package/dist/npm.microsoft.127.2934a743e3e0797a43e6.js +1469 -0
- package/dist/npm.microsoft.127.2934a743e3e0797a43e6.js.LICENSE.txt +14 -0
- package/dist/npm.microsoft.e17056c760df168ceb07617558d61f7e.js.map +1 -0
- package/dist/npm.rxjs.271.11caf676e6c2aaf1715a.js +2 -0
- package/dist/npm.rxjs.2d42120c7dd915e4ea92bdec64a19f45.js.map +1 -0
- package/dist/npm.ua-parser-js.809.92491f7cd444ab77d377.js +2 -0
- package/dist/npm.ua-parser-js.b1390f6f6c6080318a30bc73abe8add8.js.map +1 -0
- package/dist/remoteEntry.js +2 -0
- package/dist/serve.json +3 -0
- package/docs/api/foundation-filters.clientfilter.filter.md +24 -0
- package/docs/api/foundation-filters.clientfilter.md +24 -0
- package/docs/api/foundation-filters.clientfiltername.md +19 -0
- package/docs/api/foundation-filters.clientfilterrunner.md +20 -0
- package/docs/api/foundation-filters.clientfilterrunner.run.md +23 -0
- package/docs/api/foundation-filters.clientfilterschema.md +22 -0
- package/docs/api/foundation-filters.clientfilterschemas.md +15 -0
- package/docs/api/foundation-filters.defaultclientfilterrunner.container.md +11 -0
- package/docs/api/foundation-filters.defaultclientfilterrunner.md +27 -0
- package/docs/api/foundation-filters.defaultclientfilterrunner.run.md +23 -0
- package/docs/api/foundation-filters.defaultnodeenv.filter.md +24 -0
- package/docs/api/foundation-filters.defaultnodeenv.isdevelopment.md +16 -0
- package/docs/api/foundation-filters.defaultnodeenv.isproduction.md +16 -0
- package/docs/api/foundation-filters.defaultnodeenv.istesting.md +16 -0
- package/docs/api/foundation-filters.defaultnodeenv.md +29 -0
- package/docs/api/foundation-filters.defaultpercentage.filter.md +24 -0
- package/docs/api/foundation-filters.defaultpercentage.md +21 -0
- package/docs/api/foundation-filters.defaulttimewindow.filter.md +24 -0
- package/docs/api/foundation-filters.defaulttimewindow.md +21 -0
- package/docs/api/foundation-filters.defaulturltargeting.filter.md +24 -0
- package/docs/api/foundation-filters.defaulturltargeting.issecure.md +26 -0
- package/docs/api/foundation-filters.defaulturltargeting.md +22 -0
- package/docs/api/foundation-filters.defaultuseragent.filter.md +24 -0
- package/docs/api/foundation-filters.defaultuseragent.issafari.md +16 -0
- package/docs/api/foundation-filters.defaultuseragent.md +27 -0
- package/docs/api/foundation-filters.defaultusertargeting._constructor_.md +20 -0
- package/docs/api/foundation-filters.defaultusertargeting.auth.md +11 -0
- package/docs/api/foundation-filters.defaultusertargeting.filter.md +24 -0
- package/docs/api/foundation-filters.defaultusertargeting.hasadminprofile.md +16 -0
- package/docs/api/foundation-filters.defaultusertargeting.isloggedin.md +16 -0
- package/docs/api/foundation-filters.defaultusertargeting.md +35 -0
- package/docs/api/foundation-filters.getfilterbyname.md +25 -0
- package/docs/api/foundation-filters.logger.md +27 -0
- package/docs/api/foundation-filters.md +71 -0
- package/docs/api/foundation-filters.nodeenv.isdevelopment.md +16 -0
- package/docs/api/foundation-filters.nodeenv.isproduction.md +16 -0
- package/docs/api/foundation-filters.nodeenv.istesting.md +16 -0
- package/docs/api/foundation-filters.nodeenv.md +23 -0
- package/docs/api/foundation-filters.nodeenvfilter.md +28 -0
- package/docs/api/foundation-filters.nodeenvparams.md +25 -0
- package/docs/api/foundation-filters.nodeenvschema.md +19 -0
- package/docs/api/foundation-filters.percentage.md +19 -0
- package/docs/api/foundation-filters.percentagefilter.md +29 -0
- package/docs/api/foundation-filters.percentageparams.md +41 -0
- package/docs/api/foundation-filters.percentageschema.md +19 -0
- package/docs/api/foundation-filters.runner.md +29 -0
- package/docs/api/foundation-filters.timewindow.md +19 -0
- package/docs/api/foundation-filters.timewindowfilter.md +29 -0
- package/docs/api/foundation-filters.timewindowparams.md +59 -0
- package/docs/api/foundation-filters.timewindowschema.md +19 -0
- package/docs/api/foundation-filters.urltargeting.issecure.md +26 -0
- package/docs/api/foundation-filters.urltargeting.md +21 -0
- package/docs/api/foundation-filters.urltargetingfilter.md +32 -0
- package/docs/api/foundation-filters.urltargetingparams.md +30 -0
- package/docs/api/foundation-filters.urltargetingschema.md +19 -0
- package/docs/api/foundation-filters.useragent.issafari.md +16 -0
- package/docs/api/foundation-filters.useragent.md +25 -0
- package/docs/api/foundation-filters.useragentfilter.md +31 -0
- package/docs/api/foundation-filters.useragentparams.md +30 -0
- package/docs/api/foundation-filters.useragentschema.md +19 -0
- package/docs/api/foundation-filters.usertargeting.hasadminprofile.md +16 -0
- package/docs/api/foundation-filters.usertargeting.isloggedin.md +16 -0
- package/docs/api/foundation-filters.usertargeting.md +26 -0
- package/docs/api/foundation-filters.usertargetingfilter.md +31 -0
- package/docs/api/foundation-filters.usertargetingparams.md +29 -0
- package/docs/api/foundation-filters.usertargetingschema.md +19 -0
- package/docs/api/index.md +12 -0
- package/docs/api-report.md +283 -0
- package/jsdom.setup.ts +1 -0
- package/license.txt +46 -0
- package/package.json +122 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
!function(e){"use strict";var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},t(e,r)};function r(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},n.apply(this,arguments)};function s(e,t,r,n){var s,i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,r,o):s(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function i(e,t){return function(r,n){t(r,n,e)}}function o(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))}function a(e,t){var r,n,s,i,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(6===a[0]&&o.label<s[1]){o.label=s[1],s=a;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(a);break}s[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function c(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}function u(e,t,r){if(r||2===arguments.length)for(var n,s=0,i=t.length;s<i;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);return e.concat(n||Array.prototype.slice.call(t))}function h(e){return this instanceof h?(this.v=e,this):new h(e)}function d(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,s=r.apply(e,t||[]),i=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(e){s[e]&&(n[e]=function(t){return new Promise((function(r,n){i.push([e,t,r,n])>1||a(e,t)}))})}function a(e,t){try{(r=s[e](t)).value instanceof h?Promise.resolve(r.value.v).then(c,l):u(i[0][2],r)}catch(e){u(i[0][3],e)}var r}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=c(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,s){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,s,(t=e[r](t)).done,t.value)}))}}}const p=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof global)return global;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;try{return new Function("return this")()}catch(e){return{}}}();void 0===p.trustedTypes&&(p.trustedTypes={createPolicy:(e,t)=>t});const g={configurable:!1,enumerable:!1,writable:!1};void 0===p.FAST&&Reflect.defineProperty(p,"FAST",Object.assign({value:Object.create(null)},g));const v=p.FAST;if(void 0===v.getById){const e=Object.create(null);Reflect.defineProperty(v,"getById",Object.assign({value(t,r){let n=e[t];return void 0===n&&(n=r?e[t]=r():null),n}},g))}const b=Object.freeze([]);function m(){const e=new WeakMap;return function(t){let r=e.get(t);if(void 0===r){let n=Reflect.getPrototypeOf(t);for(;void 0===r&&null!==n;)r=e.get(n),n=Reflect.getPrototypeOf(n);r=void 0===r?[]:r.slice(0),e.set(t,r)}return r}}const y=p.FAST.getById(1,(()=>{const e=[],t=[];function r(){if(t.length)throw t.shift()}function n(e){try{e.call()}catch(e){t.push(e),setTimeout(r,0)}}function s(){let t=0;for(;t<e.length;)if(n(e[t]),t++,t>1024){for(let r=0,n=e.length-t;r<n;r++)e[r]=e[r+t];e.length-=t,t=0}e.length=0}return Object.freeze({enqueue:function(t){e.length<1&&p.requestAnimationFrame(s),e.push(t)},process:s})})),w=p.trustedTypes.createPolicy("fast-html",{createHTML:e=>e});let S=w;const _=`fast-${Math.random().toString(36).substring(2,8)}`,E=`${_}{`,T=`}${_}`,O=Object.freeze({supportsAdoptedStyleSheets:Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype,setHTMLPolicy(e){if(S!==w)throw new Error("The HTML policy can only be set once.");S=e},createHTML:e=>S.createHTML(e),isMarker:e=>e&&8===e.nodeType&&e.data.startsWith(_),extractDirectiveIndexFromMarker:e=>parseInt(e.data.replace(`${_}:`,"")),createInterpolationPlaceholder:e=>`${E}${e}${T}`,createCustomAttributePlaceholder(e,t){return`${e}="${this.createInterpolationPlaceholder(t)}"`},createBlockPlaceholder:e=>`\x3c!--${_}:${e}--\x3e`,queueUpdate:y.enqueue,processUpdates:y.process,nextUpdate:()=>new Promise(y.enqueue),setAttribute(e,t,r){null==r?e.removeAttribute(t):e.setAttribute(t,r)},setBooleanAttribute(e,t,r){r?e.setAttribute(t,""):e.removeAttribute(t)},removeChildNodes(e){for(let t=e.firstChild;null!==t;t=e.firstChild)e.removeChild(t)},createTemplateWalker:e=>document.createTreeWalker(e,133,null,!1)});class A{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.source=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const r=t.indexOf(e);-1!==r&&t.splice(r,1)}}notify(e){const t=this.spillover,r=this.source;if(void 0===t){const t=this.sub1,n=this.sub2;void 0!==t&&t.handleChange(r,e),void 0!==n&&n.handleChange(r,e)}else for(let n=0,s=t.length;n<s;++n)t[n].handleChange(r,e)}}class R{constructor(e){this.subscribers={},this.sourceSubscribers=null,this.source=e}notify(e){var t;const r=this.subscribers[e];void 0!==r&&r.notify(e),null===(t=this.sourceSubscribers)||void 0===t||t.notify(e)}subscribe(e,t){var r;if(t){let r=this.subscribers[t];void 0===r&&(this.subscribers[t]=r=new A(this.source)),r.subscribe(e)}else this.sourceSubscribers=null!==(r=this.sourceSubscribers)&&void 0!==r?r:new A(this.source),this.sourceSubscribers.subscribe(e)}unsubscribe(e,t){var r;if(t){const r=this.subscribers[t];void 0!==r&&r.unsubscribe(e)}else null===(r=this.sourceSubscribers)||void 0===r||r.unsubscribe(e)}}const C=v.getById(2,(()=>{const e=/(:|&&|\|\||if)/,t=new WeakMap,r=O.queueUpdate;let n,s=e=>{throw new Error("Must call enableArrayObservation before observing arrays.")};function i(e){let r=e.$fastController||t.get(e);return void 0===r&&(Array.isArray(e)?r=s(e):t.set(e,r=new R(e))),r}const o=m();class a{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==n&&n.watch(e,this.name),e[this.field]}setValue(e,t){const r=this.field,n=e[r];if(n!==t){e[r]=t;const s=e[this.callback];"function"==typeof s&&s.call(e,n,t),i(e).notify(this.name)}}}class c extends A{constructor(e,t,r=!1){super(e,t),this.binding=e,this.isVolatileBinding=r,this.needsRefresh=!0,this.needsQueue=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}observe(e,t){this.needsRefresh&&null!==this.last&&this.disconnect();const r=n;n=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;const s=this.binding(e,t);return n=r,s}disconnect(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=!0}}watch(e,t){const r=this.last,s=i(e),o=null===r?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=s,s.subscribe(this,t),null!==r){if(!this.needsRefresh){let t;n=void 0,t=r.propertySource[r.propertyName],n=this,e===t&&(this.needsRefresh=!0)}r.next=o}this.last=o}handleChange(){this.needsQueue&&(this.needsQueue=!1,r(this))}call(){null!==this.last&&(this.needsQueue=!0,this.notify(this))}records(){let e=this.first;return{next:()=>{const t=e;return void 0===t?{value:void 0,done:!0}:(e=e.next,{value:t,done:!1})},[Symbol.iterator]:function(){return this}}}}return Object.freeze({setArrayObserverFactory(e){s=e},getNotifier:i,track(e,t){void 0!==n&&n.watch(e,t)},trackVolatile(){void 0!==n&&(n.needsRefresh=!0)},notify(e,t){i(e).notify(t)},defineProperty(e,t){"string"==typeof t&&(t=new a(t)),o(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get:function(){return t.getValue(this)},set:function(e){t.setValue(this,e)}})},getAccessors:o,binding(e,t,r=this.isVolatileBinding(e)){return new c(e,t,r)},isVolatileBinding:t=>e.test(t.toString())})}));function I(e,t){C.defineProperty(e,t)}function k(e,t,r){return Object.assign({},r,{get:function(){return C.trackVolatile(),r.get.apply(this)}})}const M=v.getById(3,(()=>{let e=null;return{get:()=>e,set(t){e=t}}}));class N{constructor(){this.index=0,this.length=0,this.parent=null,this.parentContext=null}get event(){return M.get()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}static setEvent(e){M.set(e)}}C.defineProperty(N.prototype,"index"),C.defineProperty(N.prototype,"length");const P=Object.seal(new N);class L{constructor(){this.targets=new WeakSet}addStylesTo(e){this.targets.add(e)}removeStylesFrom(e){this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}}function x(e){return e.map((e=>e instanceof L?x(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}function U(e){return e.map((e=>e instanceof L?e.behaviors:null)).reduce(((e,t)=>null===t?e:(null===e&&(e=[]),e.concat(t))),null)}L.create=(()=>{if(O.supportsAdoptedStyleSheets){const e=new Map;return t=>new F(t,e)}return e=>new j(e)})();class F extends L{constructor(e,t){super(),this.styles=e,this.styleSheetCache=t,this._styleSheets=void 0,this.behaviors=U(e)}get styleSheets(){if(void 0===this._styleSheets){const e=this.styles,t=this.styleSheetCache;this._styleSheets=x(e).map((e=>{if(e instanceof CSSStyleSheet)return e;let r=t.get(e);return void 0===r&&(r=new CSSStyleSheet,r.replaceSync(e),t.set(e,r)),r}))}return this._styleSheets}addStylesTo(e){e.adoptedStyleSheets=[...e.adoptedStyleSheets,...this.styleSheets],super.addStylesTo(e)}removeStylesFrom(e){const t=this.styleSheets;e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e))),super.removeStylesFrom(e)}}let D=0;class j extends L{constructor(e){super(),this.styles=e,this.behaviors=null,this.behaviors=U(e),this.styleSheets=x(e),this.styleClass="fast-style-class-"+ ++D}addStylesTo(e){const t=this.styleSheets,r=this.styleClass;e=this.normalizeTarget(e);for(let n=0;n<t.length;n++){const s=document.createElement("style");s.innerHTML=t[n],s.className=r,e.append(s)}super.addStylesTo(e)}removeStylesFrom(e){const t=(e=this.normalizeTarget(e)).querySelectorAll(`.${this.styleClass}`);for(let r=0,n=t.length;r<n;++r)e.removeChild(t[r]);super.removeStylesFrom(e)}isAttachedTo(e){return super.isAttachedTo(this.normalizeTarget(e))}normalizeTarget(e){return e===document?document.body:e}}const G=Object.freeze({locate:m()}),$={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e};class H{constructor(e,t,r=t.toLowerCase(),n="reflect",s){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=r,this.mode=n,this.converter=s,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,"boolean"===n&&void 0===s&&(this.converter=$)}setValue(e,t){const r=e[this.fieldName],n=this.converter;void 0!==n&&(t=n.fromView(t)),r!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](r,t),e.$fastController.notify(this.name))}getValue(e){return C.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,r=this.guards;r.has(e)||"fromView"===t||O.queueUpdate((()=>{r.add(e);const n=e[this.fieldName];switch(t){case"reflect":const t=this.converter;O.setAttribute(e,this.attribute,void 0!==t?t.toView(n):n);break;case"boolean":O.setBooleanAttribute(e,this.attribute,n)}r.delete(e)}))}static collect(e,...t){const r=[];t.push(G.locate(e));for(let n=0,s=t.length;n<s;++n){const s=t[n];if(void 0!==s)for(let t=0,n=s.length;t<n;++t){const n=s[t];"string"==typeof n?r.push(new H(e,n)):r.push(new H(e,n.property,n.attribute,n.mode,n.converter))}}return r}}const B={mode:"open"},V={},z=v.getById(4,(()=>{const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t)})}));class W{constructor(e,t=e.definition){"string"==typeof t&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template;const r=H.collect(e,t.attributes),n=new Array(r.length),s={},i={};for(let e=0,t=r.length;e<t;++e){const t=r[e];n[e]=t.attribute,s[t.name]=t,i[t.attribute]=t}this.attributes=r,this.observedAttributes=n,this.propertyLookup=s,this.attributeLookup=i,this.shadowOptions=void 0===t.shadowOptions?B:null===t.shadowOptions?void 0:Object.assign(Object.assign({},B),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?V:Object.assign(Object.assign({},V),t.elementOptions),this.styles=void 0===t.styles?void 0:Array.isArray(t.styles)?L.create(t.styles):t.styles instanceof L?t.styles:L.create([t.styles])}get isDefined(){return!!z.getByType(this.type)}define(e=customElements){const t=this.type;if(z.register(this)){const e=this.attributes,r=t.prototype;for(let t=0,n=e.length;t<n;++t)C.defineProperty(r,e[t]);Reflect.defineProperty(t,"observedAttributes",{value:this.observedAttributes,enumerable:!0})}return e.get(this.name)||e.define(this.name,t,this.elementOptions),this}}W.forType=z.getByType;const Y=new WeakMap,K={bubbles:!0,composed:!0,cancelable:!0};function q(e){return e.shadowRoot||Y.get(e)||null}class Q extends R{constructor(e,t){super(e),this.boundObservables=null,this.behaviors=null,this.needsInitialization=!0,this._template=null,this._styles=null,this._isConnected=!1,this.$fastController=this,this.view=null,this.element=e,this.definition=t;const r=t.shadowOptions;if(void 0!==r){const t=e.attachShadow(r);"closed"===r.mode&&Y.set(e,t)}const n=C.getAccessors(e);if(n.length>0){const t=this.boundObservables=Object.create(null);for(let r=0,s=n.length;r<s;++r){const s=n[r].name,i=e[s];void 0!==i&&(delete e[s],t[s]=i)}}}get isConnected(){return C.track(this,"isConnected"),this._isConnected}setIsConnected(e){this._isConnected=e,C.notify(this,"isConnected")}get template(){return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get styles(){return this._styles}set styles(e){this._styles!==e&&(null!==this._styles&&this.removeStyles(this._styles),this._styles=e,this.needsInitialization||null===e||this.addStyles(e))}addStyles(e){const t=q(this.element)||this.element.getRootNode();if(e instanceof HTMLStyleElement)t.append(e);else if(!e.isAttachedTo(t)){const r=e.behaviors;e.addStylesTo(t),null!==r&&this.addBehaviors(r)}}removeStyles(e){const t=q(this.element)||this.element.getRootNode();if(e instanceof HTMLStyleElement)t.removeChild(e);else if(e.isAttachedTo(t)){const r=e.behaviors;e.removeStylesFrom(t),null!==r&&this.removeBehaviors(r)}}addBehaviors(e){const t=this.behaviors||(this.behaviors=new Map),r=e.length,n=[];for(let s=0;s<r;++s){const r=e[s];t.has(r)?t.set(r,t.get(r)+1):(t.set(r,1),n.push(r))}if(this._isConnected){const e=this.element;for(let t=0;t<n.length;++t)n[t].bind(e,P)}}removeBehaviors(e,t=!1){const r=this.behaviors;if(null===r)return;const n=e.length,s=[];for(let i=0;i<n;++i){const n=e[i];if(r.has(n)){const e=r.get(n)-1;0===e||t?r.delete(n)&&s.push(n):r.set(n,e)}}if(this._isConnected){const e=this.element;for(let t=0;t<s.length;++t)s[t].unbind(e)}}onConnectedCallback(){if(this._isConnected)return;const e=this.element;this.needsInitialization?this.finishInitialization():null!==this.view&&this.view.bind(e,P);const t=this.behaviors;if(null!==t)for(const[r]of t)r.bind(e,P);this.setIsConnected(!0)}onDisconnectedCallback(){if(!this._isConnected)return;this.setIsConnected(!1);const e=this.view;null!==e&&e.unbind();const t=this.behaviors;if(null!==t){const e=this.element;for(const[r]of t)r.unbind(e)}}onAttributeChangedCallback(e,t,r){const n=this.definition.attributeLookup[e];void 0!==n&&n.onAttributeChangedCallback(this.element,r)}emit(e,t,r){return!!this._isConnected&&this.element.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},K),r)))}finishInitialization(){const e=this.element,t=this.boundObservables;if(null!==t){const r=Object.keys(t);for(let n=0,s=r.length;n<s;++n){const s=r[n];e[s]=t[s]}this.boundObservables=null}const r=this.definition;null===this._template&&(this.element.resolveTemplate?this._template=this.element.resolveTemplate():r.template&&(this._template=r.template||null)),null!==this._template&&this.renderTemplate(this._template),null===this._styles&&(this.element.resolveStyles?this._styles=this.element.resolveStyles():r.styles&&(this._styles=r.styles||null)),null!==this._styles&&this.addStyles(this._styles),this.needsInitialization=!1}renderTemplate(e){const t=this.element,r=q(t)||t;null!==this.view?(this.view.dispose(),this.view=null):this.needsInitialization||O.removeChildNodes(r),e&&(this.view=e.render(t,r,t))}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const r=W.forType(e.constructor);if(void 0===r)throw new Error("Missing FASTElement definition.");return e.$fastController=new Q(e,r)}}function J(e){return class extends e{constructor(){super(),Q.forCustomElement(this)}$emit(e,t,r){return this.$fastController.emit(e,t,r)}connectedCallback(){this.$fastController.onConnectedCallback()}disconnectedCallback(){this.$fastController.onDisconnectedCallback()}attributeChangedCallback(e,t,r){this.$fastController.onAttributeChangedCallback(e,t,r)}}}const Z=Object.assign(J(HTMLElement),{from:e=>J(e),define:(e,t)=>new W(e,t).define().type}),X=new Map;"metadata"in Reflect||(Reflect.metadata=function(e,t){return function(r){Reflect.defineMetadata(e,t,r)}},Reflect.defineMetadata=function(e,t,r){let n=X.get(r);void 0===n&&X.set(r,n=new Map),n.set(e,t)},Reflect.getOwnMetadata=function(e,t){const r=X.get(t);if(void 0!==r)return r.get(e)});class ee{constructor(e,t){this.container=e,this.key=t}instance(e){return this.registerResolver(0,e)}singleton(e){return this.registerResolver(1,e)}transient(e){return this.registerResolver(2,e)}callback(e){return this.registerResolver(3,e)}cachedCallback(e){return this.registerResolver(3,Te(e))}aliasTo(e){return this.registerResolver(5,e)}registerResolver(e,t){const{container:r,key:n}=this;return this.container=this.key=void 0,r.registerResolver(n,new de(n,e,t))}}function te(e){const t=e.slice(),r=Object.keys(e),n=r.length;let s;for(let i=0;i<n;++i)s=r[i],Ne(s)||(t[s]=e[s]);return t}const re=Object.freeze({none(e){throw Error(`${e.toString()} not registered, did you forget to add @singleton()?`)},singleton:e=>new de(e,1,e),transient:e=>new de(e,2,e)}),ne=Object.freeze({default:Object.freeze({parentLocator:()=>null,responsibleForOwnerRequests:!1,defaultResolver:re.singleton})}),se=new Map;function ie(e){return t=>Reflect.getOwnMetadata(e,t)}let oe=null;const ae=Object.freeze({createContainer:e=>new _e(null,Object.assign({},ne.default,e)),findResponsibleContainer(e){const t=e.$$container$$;return t&&t.responsibleForOwnerRequests?t:ae.findParentContainer(e)},findParentContainer(e){const t=new CustomEvent(we,{bubbles:!0,composed:!0,cancelable:!0,detail:{container:void 0}});return e.dispatchEvent(t),t.detail.container||ae.getOrCreateDOMContainer()},getOrCreateDOMContainer:(e,t)=>e?e.$$container$$||new _e(e,Object.assign({},ne.default,t,{parentLocator:ae.findParentContainer})):oe||(oe=new _e(null,Object.assign({},ne.default,t,{parentLocator:()=>null}))),getDesignParamtypes:ie("design:paramtypes"),getAnnotationParamtypes:ie("di:paramtypes"),getOrCreateAnnotationParamTypes(e){let t=this.getAnnotationParamtypes(e);return void 0===t&&Reflect.defineMetadata("di:paramtypes",t=[],e),t},getDependencies(e){let t=se.get(e);if(void 0===t){const r=e.inject;if(void 0===r){const r=ae.getDesignParamtypes(e),n=ae.getAnnotationParamtypes(e);if(void 0===r)if(void 0===n){const r=Object.getPrototypeOf(e);t="function"==typeof r&&r!==Function.prototype?te(ae.getDependencies(r)):[]}else t=te(n);else if(void 0===n)t=te(r);else{t=te(r);let e,s=n.length;for(let r=0;r<s;++r)e=n[r],void 0!==e&&(t[r]=e);const i=Object.keys(n);let o;s=i.length;for(let e=0;e<s;++e)o=i[e],Ne(o)||(t[o]=n[o])}}else t=te(r);se.set(e,t)}return t},defineProperty(e,t,r,n=!1){const s=`$di_${t}`;Reflect.defineProperty(e,t,{get:function(){let e=this[s];if(void 0===e){const i=this instanceof HTMLElement?ae.findResponsibleContainer(this):ae.getOrCreateDOMContainer();if(e=i.get(r),this[s]=e,n&&this instanceof Z){const n=this.$fastController,i=()=>{ae.findResponsibleContainer(this).get(r)!==this[s]&&(this[s]=e,n.notify(t))};n.subscribe({handleChange:i},"isConnected")}}return e}})},createInterface(e,t){const r="function"==typeof e?e:t,n="string"==typeof e?e:e&&"friendlyName"in e&&e.friendlyName||Ce,s="string"!=typeof e&&(e&&"respectConnection"in e&&e.respectConnection||!1),i=function(e,t,r){if(null==e||void 0!==new.target)throw new Error(`No registration for interface: '${i.friendlyName}'`);if(t)ae.defineProperty(e,t,i,s);else{ae.getOrCreateAnnotationParamTypes(e)[r]=i}};return i.$isInterface=!0,i.friendlyName=null==n?"(anonymous)":n,null!=r&&(i.register=function(e,t){return r(new ee(e,null!=t?t:i))}),i.toString=function(){return`InterfaceSymbol<${i.friendlyName}>`},i},inject:(...e)=>function(t,r,n){if("number"==typeof n){const r=ae.getOrCreateAnnotationParamTypes(t),s=e[0];void 0!==s&&(r[n]=s)}else if(r)ae.defineProperty(t,r,e[0]);else{const r=n?ae.getOrCreateAnnotationParamTypes(n.value):ae.getOrCreateAnnotationParamTypes(t);let s;for(let t=0;t<e.length;++t)s=e[t],void 0!==s&&(r[t]=s)}},transient:e=>(e.register=function(t){return Oe.transient(e,e).register(t)},e.registerInRequestor=!1,e),singleton:(e,t=le)=>(e.register=function(t){return Oe.singleton(e,e).register(t)},e.registerInRequestor=t.scoped,e)}),ce=ae.createInterface("Container");ae.inject;const le={scoped:!1},ue=(he=(e,t,r)=>r.has(e,!0)?r.get(e):void 0,function(e){const t=function(e,r,n){ae.inject(t)(e,r,n)};return t.$isResolver=!0,t.resolve=function(t,r){return he(e,t,r)},t});var he;class de{constructor(e,t,r){this.key=e,this.strategy=t,this.state=r,this.resolving=!1}get $isResolver(){return!0}register(e){return e.registerResolver(this.key,this)}resolve(e,t){switch(this.strategy){case 0:return this.state;case 1:if(this.resolving)throw new Error(`Cyclic dependency found: ${this.state.name}`);return this.resolving=!0,this.state=e.getFactory(this.state).construct(t),this.strategy=0,this.resolving=!1,this.state;case 2:{const r=e.getFactory(this.state);if(null===r)throw new Error(`Resolver for ${String(this.key)} returned a null factory`);return r.construct(t)}case 3:return this.state(e,t,this);case 4:return this.state[0].resolve(e,t);case 5:return t.get(this.state);default:throw new Error(`Invalid resolver strategy specified: ${this.strategy}.`)}}getFactory(e){var t,r,n;switch(this.strategy){case 1:case 2:return e.getFactory(this.state);case 5:return null!==(n=null===(r=null===(t=e.getResolver(this.state))||void 0===t?void 0:t.getFactory)||void 0===r?void 0:r.call(t,e))&&void 0!==n?n:null;default:return null}}}function fe(e){return this.get(e)}function pe(e,t){return t(e)}class ge{constructor(e,t){this.Type=e,this.dependencies=t,this.transformers=null}construct(e,t){let r;return r=void 0===t?new this.Type(...this.dependencies.map(fe,e)):new this.Type(...this.dependencies.map(fe,e),...t),null==this.transformers?r:this.transformers.reduce(pe,r)}registerTransformer(e){(this.transformers||(this.transformers=[])).push(e)}}const ve={$isResolver:!0,resolve:(e,t)=>t};function be(e){return"function"==typeof e.register}function me(e){return function(e){return be(e)&&"boolean"==typeof e.registerInRequestor}(e)&&e.registerInRequestor}const ye=new Set(["Array","ArrayBuffer","Boolean","DataView","Date","Error","EvalError","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Number","Object","Promise","RangeError","ReferenceError","RegExp","Set","SharedArrayBuffer","String","SyntaxError","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakMap","WeakSet"]),we="__DI_LOCATE_PARENT__",Se=new Map;class _e{constructor(e,t){this.owner=e,this.config=t,this._parent=void 0,this.registerDepth=0,this.context=null,null!==e&&(e.$$container$$=this),this.resolvers=new Map,this.resolvers.set(ce,ve),e instanceof Node&&e.addEventListener(we,(e=>{e.composedPath()[0]!==this.owner&&(e.detail.container=this,e.stopImmediatePropagation())}))}get parent(){return void 0===this._parent&&(this._parent=this.config.parentLocator(this.owner)),this._parent}get depth(){return null===this.parent?0:this.parent.depth+1}get responsibleForOwnerRequests(){return this.config.responsibleForOwnerRequests}registerWithContext(e,...t){return this.context=e,this.register(...t),this.context=null,this}register(...e){if(100==++this.registerDepth)throw new Error("Unable to autoregister dependency");let t,r,n,s,i;const o=this.context;for(let a=0,c=e.length;a<c;++a)if(t=e[a],Ie(t))if(be(t))t.register(this,o);else if(void 0!==t.prototype)Oe.singleton(t,t).register(this);else for(r=Object.keys(t),s=0,i=r.length;s<i;++s)n=t[r[s]],Ie(n)&&(be(n)?n.register(this,o):this.register(n));return--this.registerDepth,this}registerResolver(e,t){Ae(e);const r=this.resolvers,n=r.get(e);return null==n?r.set(e,t):n instanceof de&&4===n.strategy?n.state.push(t):r.set(e,new de(e,4,[n,t])),t}registerTransformer(e,t){const r=this.getResolver(e);if(null==r)return!1;if(r.getFactory){const e=r.getFactory(this);return null!=e&&(e.registerTransformer(t),!0)}return!1}getResolver(e,t=!0){if(Ae(e),void 0!==e.resolve)return e;let r,n=this;for(;null!=n;){if(r=n.resolvers.get(e),null!=r)return r;if(null==n.parent){const r=me(e)?this:n;return t?this.jitRegister(e,r):null}n=n.parent}return null}has(e,t=!1){return!!this.resolvers.has(e)||!(!t||null==this.parent)&&this.parent.has(e,!0)}get(e){if(Ae(e),e.$isResolver)return e.resolve(this,this);let t,r=this;for(;null!=r;){if(t=r.resolvers.get(e),null!=t)return t.resolve(r,this);if(null==r.parent){const n=me(e)?this:r;return t=this.jitRegister(e,n),t.resolve(r,this)}r=r.parent}throw new Error(`Unable to resolve key: ${e}`)}getAll(e,t=!1){Ae(e);const r=this;let n,s=r;if(t){let t=b;for(;null!=s;)n=s.resolvers.get(e),null!=n&&(t=t.concat(Re(n,s,r))),s=s.parent;return t}for(;null!=s;){if(n=s.resolvers.get(e),null!=n)return Re(n,s,r);if(s=s.parent,null==s)return b}return b}getFactory(e){let t=Se.get(e);if(void 0===t){if(ke(e))throw new Error(`${e.name} is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.`);Se.set(e,t=new ge(e,ae.getDependencies(e)))}return t}registerFactory(e,t){Se.set(e,t)}createChild(e){return new _e(null,Object.assign({},this.config,e,{parentLocator:()=>this}))}jitRegister(e,t){if("function"!=typeof e)throw new Error(`Attempted to jitRegister something that is not a constructor: '${e}'. Did you forget to register this dependency?`);if(ye.has(e.name))throw new Error(`Attempted to jitRegister an intrinsic type: ${e.name}. Did you forget to add @inject(Key)`);if(be(e)){const r=e.register(t);if(!(r instanceof Object)||null==r.resolve){const r=t.resolvers.get(e);if(null!=r)return r;throw new Error("A valid resolver was not returned from the static register method")}return r}if(e.$isInterface)throw new Error(`Attempted to jitRegister an interface: ${e.friendlyName}`);{const r=this.config.defaultResolver(e,t);return t.resolvers.set(e,r),r}}}const Ee=new WeakMap;function Te(e){return function(t,r,n){if(Ee.has(n))return Ee.get(n);const s=e(t,r,n);return Ee.set(n,s),s}}const Oe=Object.freeze({instance:(e,t)=>new de(e,0,t),singleton:(e,t)=>new de(e,1,t),transient:(e,t)=>new de(e,2,t),callback:(e,t)=>new de(e,3,t),cachedCallback:(e,t)=>new de(e,3,Te(t)),aliasTo:(e,t)=>new de(t,5,e)});function Ae(e){if(null==e)throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?")}function Re(e,t,r){if(e instanceof de&&4===e.strategy){const n=e.state;let s=n.length;const i=new Array(s);for(;s--;)i[s]=n[s].resolve(t,r);return i}return[e.resolve(t,r)]}const Ce="(anonymous)";function Ie(e){return"object"==typeof e&&null!==e||"function"==typeof e}const ke=function(){const e=new WeakMap;let t=!1,r="",n=0;return function(s){return t=e.get(s),void 0===t&&(r=s.toString(),n=r.length,t=n>=29&&n<=100&&125===r.charCodeAt(n-1)&&r.charCodeAt(n-2)<=32&&93===r.charCodeAt(n-3)&&101===r.charCodeAt(n-4)&&100===r.charCodeAt(n-5)&&111===r.charCodeAt(n-6)&&99===r.charCodeAt(n-7)&&32===r.charCodeAt(n-8)&&101===r.charCodeAt(n-9)&&118===r.charCodeAt(n-10)&&105===r.charCodeAt(n-11)&&116===r.charCodeAt(n-12)&&97===r.charCodeAt(n-13)&&110===r.charCodeAt(n-14)&&88===r.charCodeAt(n-15),e.set(s,t)),t}}(),Me={};function Ne(e){switch(typeof e){case"number":return e>=0&&(0|e)===e;case"string":{const t=Me[e];if(void 0!==t)return t;const r=e.length;if(0===r)return Me[e]=!1;let n=0;for(let t=0;t<r;++t)if(n=e.charCodeAt(t),0===t&&48===n&&r>1||n<48||n>57)return Me[e]=!1;return Me[e]=!0}default:return!1}}const Pe={};Pe[Pe.Fatal=0]="Fatal",Pe[Pe.Error=0]="Error",Pe[Pe.Warn=1]="Warn",Pe[Pe.Log=2]="Log",Pe[Pe.Info=3]="Info",Pe[Pe.Success=3]="Success",Pe[Pe.Debug=4]="Debug",Pe[Pe.Trace=5]="Trace",Pe[Pe.Silent=-1/0]="Silent",Pe[Pe.Verbose=1/0]="Verbose";var Le={silent:{level:-1},fatal:{level:Pe.Fatal},error:{level:Pe.Error},warn:{level:Pe.Warn},log:{level:Pe.Log},info:{level:Pe.Info},success:{level:Pe.Success},debug:{level:Pe.Debug},trace:{level:Pe.Trace},verbose:{level:Pe.Trace},ready:{level:Pe.Info},start:{level:Pe.Info}};function xe(e){return t=e,"[object Object]"===Object.prototype.toString.call(t)&&(!(!e.message&&!e.args)&&!e.stack);var t}let Ue=!1;const Fe=[];class De{constructor(e={}){this._reporters=e.reporters||[],this._types=e.types||Le,this.level=void 0!==e.level?e.level:3,this._defaults=e.defaults||{},this._async=void 0!==e.async?e.async:void 0,this._stdout=e.stdout,this._stderr=e.stderr,this._mockFn=e.mockFn,this._throttle=e.throttle||1e3,this._throttleMin=e.throttleMin||5;for(const e in this._types){const t={type:e,...this._types[e],...this._defaults};this[e]=this._wrapLogFn(t),this[e].raw=this._wrapLogFn(t,!0)}this._mockFn&&this.mockTypes(),this._lastLogSerialized=void 0,this._lastLog=void 0,this._lastLogTime=void 0,this._lastLogCount=0,this._throttleTimeout=void 0}get stdout(){return this._stdout||console._stdout}get stderr(){return this._stderr||console._stderr}create(e){return new De(Object.assign({reporters:this._reporters,level:this.level,types:this._types,defaults:this._defaults,stdout:this._stdout,stderr:this._stderr,mockFn:this._mockFn},e))}withDefaults(e){return this.create({defaults:Object.assign({},this._defaults,e)})}withTag(e){return this.withDefaults({tag:this._defaults.tag?this._defaults.tag+":"+e:e})}addReporter(e){return this._reporters.push(e),this}removeReporter(e){if(e){const t=this._reporters.indexOf(e);if(t>=0)return this._reporters.splice(t,1)}else this._reporters.splice(0);return this}setReporters(e){return this._reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(const e in this._types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(const e in this._types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.stdout,"log"),this._wrapStream(this.stderr,"log")}_wrapStream(e,t){e&&(e.__write||(e.__write=e.write),e.write=e=>{this[t].raw(String(e).trim())})}restoreStd(){this._restoreStream(this.stdout),this._restoreStream(this.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){Ue=!0}resumeLogs(){Ue=!1;const e=Fe.splice(0);for(const t of e)t[0]._logFn(t[1],t[2])}mockTypes(e){if(this._mockFn=e||this._mockFn,"function"==typeof this._mockFn)for(const e in this._types)this[e]=this._mockFn(e,this._types[e])||this[e],this[e].raw=this[e]}_wrapLogFn(e,t){return(...r)=>{if(!Ue)return this._logFn(e,r,t);Fe.push([this,e,r,t])}}_logFn(e,t,r){if(e.level>this.level)return!!this._async&&Promise.resolve(!1);const n=Object.assign({date:new Date,args:[]},e);!r&&1===t.length&&xe(t[0])?Object.assign(n,t[0]):n.args=Array.from(t),n.message&&(n.args.unshift(n.message),delete n.message),n.additional&&(Array.isArray(n.additional)||(n.additional=n.additional.split("\n")),n.args.push("\n"+n.additional.join("\n")),delete n.additional),n.type="string"==typeof n.type?n.type.toLowerCase():"",n.tag="string"==typeof n.tag?n.tag.toLowerCase():"";const s=(e=!1)=>{const t=this._lastLogCount-this._throttleMin;if(this._lastLog&&t>0){const e=[...this._lastLog.args];t>1&&e.push(`(repeated ${t} times)`),this._log({...this._lastLog,args:e}),this._lastLogCount=1}if(e){if(this._lastLog=n,this._async)return this._logAsync(n);this._log(n)}};clearTimeout(this._throttleTimeout);const i=this._lastLogTime?n.date-this._lastLogTime:0;if(this._lastLogTime=n.date,i<this._throttle)try{const e=JSON.stringify([n.type,n.tag,n.args]),t=this._lastLogSerialized===e;if(this._lastLogSerialized=e,t&&(this._lastLogCount++,this._lastLogCount>this._throttleMin))return void(this._throttleTimeout=setTimeout(s,this._throttle))}catch(e){}s(!0)}_log(e){for(const t of this._reporters)t.log(e,{async:!1,stdout:this.stdout,stderr:this.stderr})}_logAsync(e){return Promise.all(this._reporters.map((t=>t.log(e,{async:!0,stdout:this.stdout,stderr:this.stderr}))))}}De.prototype.add=De.prototype.addReporter,De.prototype.remove=De.prototype.removeReporter,De.prototype.clear=De.prototype.removeReporter,De.prototype.withScope=De.prototype.withTag,De.prototype.mock=De.prototype.mockTypes,De.prototype.pause=De.prototype.pauseLogs,De.prototype.resume=De.prototype.resumeLogs;class je{constructor(e){this.options=Object.assign({},e),this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}log(e){const t=e.level<1?console.__error||console.error:1===e.level&&console.warn?console.__warn||console.warn:console.__log||console.log,r="log"!==e.type?e.type:"",n=e.tag?e.tag:"",s=`\n background: ${this.typeColorMap[e.type]||this.levelColorMap[e.level]||this.defaultColor};\n border-radius: 0.5em;\n color: white;\n font-weight: bold;\n padding: 2px 0.5em;\n `,i=`%c${[n,r].filter(Boolean).join(":")}`;"string"==typeof e.args[0]?t(`${i}%c ${e.args[0]}`,s,"",...e.args.slice(1)):t(i,s,...e.args)}}var Ge="undefined"!=typeof window&&window.consola||function(){const e=new De({reporters:[new je]});return e.Consola=De,e.LogLevel=Pe,e.BrowserReporter=je,e}(),$e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(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 r(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(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 i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function l(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=a(e))){var t=0,r=function(){};return{s:r,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,s,i=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){o=!0,s=e},f:function(){try{i||null==n.return||n.return()}finally{if(o)throw s}}}}var u={};u[u.Fatal=0]="Fatal",u[u.Error=0]="Error",u[u.Warn=1]="Warn",u[u.Log=2]="Log",u[u.Info=3]="Info",u[u.Success=3]="Success",u[u.Debug=4]="Debug",u[u.Trace=5]="Trace",u[u.Silent=-1/0]="Silent",u[u.Verbose=1/0]="Verbose";var h={silent:{level:-1},fatal:{level:u.Fatal},error:{level:u.Error},warn:{level:u.Warn},log:{level:u.Log},info:{level:u.Info},success:{level:u.Success},debug:{level:u.Debug},trace:{level:u.Trace},verbose:{level:u.Trace},ready:{level:u.Info},start:{level:u.Info}};function d(e){return t=e,!("[object Object]"!==Object.prototype.toString.call(t)||!e.message&&!e.args||e.stack);var t}var f=!1,p=[],g=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var n in e(this,t),this._reporters=r.reporters||[],this._types=r.types||h,this.level=void 0!==r.level?r.level:3,this._defaults=r.defaults||{},this._async=void 0!==r.async?r.async:void 0,this._stdout=r.stdout,this._stderr=r.stderr,this._mockFn=r.mockFn,this._throttle=r.throttle||1e3,this._throttleMin=r.throttleMin||5,this._types){var s=i(i({type:n},this._types[n]),this._defaults);this[n]=this._wrapLogFn(s),this[n].raw=this._wrapLogFn(s,!0)}this._mockFn&&this.mockTypes(),this._lastLogSerialized=void 0,this._lastLog=void 0,this._lastLogTime=void 0,this._lastLogCount=0,this._throttleTimeout=void 0}return r(t,[{key:"create",value:function(e){return new t(Object.assign({reporters:this._reporters,level:this.level,types:this._types,defaults:this._defaults,stdout:this._stdout,stderr:this._stderr,mockFn:this._mockFn},e))}},{key:"withDefaults",value:function(e){return this.create({defaults:Object.assign({},this._defaults,e)})}},{key:"withTag",value:function(e){return this.withDefaults({tag:this._defaults.tag?this._defaults.tag+":"+e:e})}},{key:"addReporter",value:function(e){return this._reporters.push(e),this}},{key:"removeReporter",value:function(e){if(e){var t=this._reporters.indexOf(e);if(t>=0)return this._reporters.splice(t,1)}else this._reporters.splice(0);return this}},{key:"setReporters",value:function(e){return this._reporters=Array.isArray(e)?e:[e],this}},{key:"wrapAll",value:function(){this.wrapConsole(),this.wrapStd()}},{key:"restoreAll",value:function(){this.restoreConsole(),this.restoreStd()}},{key:"wrapConsole",value:function(){for(var e in this._types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}},{key:"restoreConsole",value:function(){for(var e in this._types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}},{key:"wrapStd",value:function(){this._wrapStream(this.stdout,"log"),this._wrapStream(this.stderr,"log")}},{key:"_wrapStream",value:function(e,t){var r=this;e&&(e.__write||(e.__write=e.write),e.write=function(e){r[t].raw(String(e).trim())})}},{key:"restoreStd",value:function(){this._restoreStream(this.stdout),this._restoreStream(this.stderr)}},{key:"_restoreStream",value:function(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}},{key:"pauseLogs",value:function(){f=!0}},{key:"resumeLogs",value:function(){f=!1;var e,t=l(p.splice(0));try{for(t.s();!(e=t.n()).done;){var r=e.value;r[0]._logFn(r[1],r[2])}}catch(e){t.e(e)}finally{t.f()}}},{key:"mockTypes",value:function(e){if(this._mockFn=e||this._mockFn,"function"==typeof this._mockFn)for(var t in this._types)this[t]=this._mockFn(t,this._types[t])||this[t],this[t].raw=this[t]}},{key:"_wrapLogFn",value:function(e,t){var r=this;return function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];if(!f)return r._logFn(e,s,t);p.push([r,e,s,t])}}},{key:"_logFn",value:function(e,t,r){var n=this;if(e.level>this.level)return!!this._async&&Promise.resolve(!1);var s=Object.assign({date:new Date,args:[]},e);!r&&1===t.length&&d(t[0])?Object.assign(s,t[0]):s.args=Array.from(t),s.message&&(s.args.unshift(s.message),delete s.message),s.additional&&(Array.isArray(s.additional)||(s.additional=s.additional.split("\n")),s.args.push("\n"+s.additional.join("\n")),delete s.additional),s.type="string"==typeof s.type?s.type.toLowerCase():"",s.tag="string"==typeof s.tag?s.tag.toLowerCase():"";var a=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=n._lastLogCount-n._throttleMin;if(n._lastLog&&t>0){var r=o(n._lastLog.args);t>1&&r.push("(repeated ".concat(t," times)")),n._log(i(i({},n._lastLog),{},{args:r})),n._lastLogCount=1}if(e){if(n._lastLog=s,n._async)return n._logAsync(s);n._log(s)}};clearTimeout(this._throttleTimeout);var c=this._lastLogTime?s.date-this._lastLogTime:0;if(this._lastLogTime=s.date,c<this._throttle)try{var l=JSON.stringify([s.type,s.tag,s.args]),u=this._lastLogSerialized===l;if(this._lastLogSerialized=l,u&&(this._lastLogCount++,this._lastLogCount>this._throttleMin))return void(this._throttleTimeout=setTimeout(a,this._throttle))}catch(e){}a(!0)}},{key:"_log",value:function(e){var t,r=l(this._reporters);try{for(r.s();!(t=r.n()).done;)t.value.log(e,{async:!1,stdout:this.stdout,stderr:this.stderr})}catch(e){r.e(e)}finally{r.f()}}},{key:"_logAsync",value:function(e){var t=this;return Promise.all(this._reporters.map((function(r){return r.log(e,{async:!0,stdout:t.stdout,stderr:t.stderr})})))}},{key:"stdout",get:function(){return this._stdout||console._stdout}},{key:"stderr",get:function(){return this._stderr||console._stderr}}]),t}();g.prototype.add=g.prototype.addReporter,g.prototype.remove=g.prototype.removeReporter,g.prototype.clear=g.prototype.removeReporter,g.prototype.withScope=g.prototype.withTag,g.prototype.mock=g.prototype.mockTypes,g.prototype.pause=g.prototype.pauseLogs,g.prototype.resume=g.prototype.resumeLogs;var v,b=function(){function t(r){e(this,t),this.options=Object.assign({},r),this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}return r(t,[{key:"log",value:function(e){var t=e.level<1?console.__error||console.error:1===e.level&&console.warn?console.__warn||console.warn:console.__log||console.log,r="log"!==e.type?e.type:"",n=e.tag?e.tag:"",s=this.typeColorMap[e.type]||this.levelColorMap[e.level]||this.defaultColor,i="\n background: ".concat(s,";\n border-radius: 0.5em;\n color: white;\n font-weight: bold;\n padding: 2px 0.5em;\n "),a="%c".concat([n,r].filter(Boolean).join(":"));"string"==typeof e.args[0]?t.apply(void 0,["".concat(a,"%c ").concat(e.args[0]),i,""].concat(o(e.args.slice(1)))):t.apply(void 0,[a,i].concat(o(e.args)))}}]),t}();"undefined"!=typeof window&&window.consola||((v=new g({reporters:[new b]})).Consola=g,v.LogLevel=u,v.BrowserReporter=b)})();const He={level:4};function Be(e,t=He){return Ge.create(t).withTag(e)}const Ve=Be("foundation-utils");class ze{constructor(){this.serialize=e=>JSON.stringify(e)}deserialize(e){return e&&e.ok?e.text().then((e=>JSON.parse(e))):(e&&e.data&&(e=e.data),JSON.parse(e))}}const We=ae.createInterface((e=>e.singleton(ze)));var Ye,Ke=new Uint8Array(16);function qe(){if(!Ye&&!(Ye="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ye(Ke)}var Qe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Je=[],Ze=0;Ze<256;++Ze)Je.push((Ze+256).toString(16).substr(1));function Xe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(Je[e[t+0]]+Je[e[t+1]]+Je[e[t+2]]+Je[e[t+3]]+"-"+Je[e[t+4]]+Je[e[t+5]]+"-"+Je[e[t+6]]+Je[e[t+7]]+"-"+Je[e[t+8]]+Je[e[t+9]]+"-"+Je[e[t+10]]+Je[e[t+11]]+Je[e[t+12]]+Je[e[t+13]]+Je[e[t+14]]+Je[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&Qe.test(e)}(r))throw TypeError("Stringified UUID is invalid");return r}function et(e,t,r){var n=(e=e||{}).random||(e.rng||qe)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var s=0;s<16;++s)t[r+s]=n[s];return t}return Xe(n)}class tt{constructor(){}createId(e=!1){const t=et();return e&&Ve.debug(`UUID.createID ${t}`),t}createRemoteId(e=!1){return o(this,void 0,void 0,(function*(){const t=et();return e&&Ve.debug(`UUID.createRemoteID ${t}`),t}))}}const rt=ae.createInterface((e=>e.singleton(tt))),nt=Be("foundation-filters");function st(e){return e?!!process.env.NODE_ENV&&e.includes(process.env.NODE_ENV):(nt.warn("NodeEnv filter parameters must include envs."),!0)}class it{filter(e){return st(null==e?void 0:e.envs)}get isDevelopment(){return st(["development"])}get isTesting(){return st(["testing","test"])}get isProduction(){return st(["production"])}}const ot=ae.createInterface((e=>e.transient(it)));function at(e,t=Math.random()){return e>=0&&e<=1?t<e:(nt.warn("Percentage filter parameters must include a numeric percent between 0 and 1."),!0)}class ct{filter(e){return at(null==e?void 0:e.percent,null==e?void 0:e.random)}}const lt=ae.createInterface((e=>e.transient(ct)));function ut(e,t){if(!e&&!t)return nt.warn("TimeWindow filter parameters must include start, end, or both."),!0;const r=new Date;let n=!0;if(e){n=r>=new Date(e)}if(t&&n){n=r<new Date(t)}return n}class ht{filter(e){return ut(null==e?void 0:e.start,null==e?void 0:e.end)}}const dt=ae.createInterface((e=>e.transient(ht)));function ft(e,t,r,n,s){var i;if(!e)return nt.warn("URLTargeting filter needs a url to filter on."),!0;if(!(t||r||n||s))return nt.warn("URLTargeting filter parameters must include pattern, schemes, hosts, or paths."),!0;if(t&&t.test(e))return!0;let o;try{o=new URL(e)}catch(e){return!0}return!(!r||!r.includes(null===(i=o.protocol)||void 0===i?void 0:i.slice(0,-1)))||(!(!n||!n.includes(o.host))||!!s&&s.includes(o.pathname))}class pt{filter(e){return ft(null==e?void 0:e.url,null==e?void 0:e.pattern,null==e?void 0:e.schemes,null==e?void 0:e.hosts,null==e?void 0:e.paths)}isSecure(e){return ft(e,null,["https","wss"])}}const gt=ae.createInterface((e=>e.transient(pt)));var vt={exports:{}};!function(e,t){!function(r,n){var s="function",i="undefined",o="object",a="string",c="model",l="name",u="type",h="vendor",d="version",f="architecture",p="console",g="mobile",v="tablet",b="smarttv",m="wearable",y="embedded",w="Amazon",S="Apple",_="ASUS",E="BlackBerry",T="Browser",O="Chrome",A="Firefox",R="Google",C="Huawei",I="LG",k="Microsoft",M="Motorola",N="Opera",P="Samsung",L="Sharp",x="Sony",U="Xiaomi",F="Zebra",D="Facebook",j=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},G=function(e,t){return typeof e===a&&-1!==$(t).indexOf($(e))},$=function(e){return e.toLowerCase()},H=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===i?e:e.substring(0,350)},B=function(e,t){for(var r,i,a,c,l,u,h=0;h<t.length&&!l;){var d=t[h],f=t[h+1];for(r=i=0;r<d.length&&!l;)if(l=d[r++].exec(e))for(a=0;a<f.length;a++)u=l[++i],typeof(c=f[a])===o&&c.length>0?2===c.length?typeof c[1]==s?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==s||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):n:this[c[0]]=u?c[1].call(this,u,c[2]):n:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):n):this[c]=u||n;h+=2}},V=function(e,t){for(var r in t)if(typeof t[r]===o&&t[r].length>0){for(var s=0;s<t[r].length;s++)if(G(t[r][s],e))return"?"===r?n:r}else if(G(t[r],e))return"?"===r?n:r;return e},z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},W={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,d],[/opios[\/ ]+([\w\.]+)/i],[d,[l,N+" Mini"]],[/\bopr\/([\w\.]+)/i],[d,[l,N]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[l,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[l,"UC"+T]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[d,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[l,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+T],d],[/\bfocus\/([\w\.]+)/i],[d,[l,A+" Focus"]],[/\bopt\/([\w\.]+)/i],[d,[l,N+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[l,N+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[l,"MIUI "+T]],[/fxios\/([-\w\.]+)/i],[d,[l,A]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 "+T]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 "+T],d],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,D],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[l,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[l,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[l,O+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,O+" WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[l,"Android "+T]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,d],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[d,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[d,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[d,V,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[l,A+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,d],[/(cobalt)\/([\w\.]+)/i],[l,[d,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,$]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",$]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,$]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[h,P],[u,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[c,[h,P],[u,g]],[/\((ip(?:hone|od)[\w ]*);/i],[c,[h,S],[u,g]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[h,S],[u,v]],[/(macintosh);/i],[c,[h,S]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[h,C],[u,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[h,C],[u,g]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[c,/_/g," "],[h,U],[u,g]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[h,U],[u,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[h,"OPPO"],[u,g]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[h,"Vivo"],[u,g]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[c,[h,"Realme"],[u,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[h,M],[u,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[h,M],[u,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[h,I],[u,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[h,I],[u,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[h,"Lenovo"],[u,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[h,"Nokia"],[u,g]],[/(pixel c)\b/i],[c,[h,R],[u,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[h,R],[u,g]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[c,[h,x],[u,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[h,x],[u,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[h,"OnePlus"],[u,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[h,w],[u,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[h,w],[u,g]],[/(playbook);[-\w\),; ]+(rim)/i],[c,h,[u,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[h,E],[u,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[h,_],[u,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[h,_],[u,g]],[/(nexus 9)/i],[c,[h,"HTC"],[u,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[c,/_/g," "],[u,g]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[h,"Acer"],[u,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[h,"Meizu"],[u,g]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[h,L],[u,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,c,[u,g]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,c,[u,v]],[/(surface duo)/i],[c,[h,k],[u,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[h,"Fairphone"],[u,g]],[/(u304aa)/i],[c,[h,"AT&T"],[u,g]],[/\bsie-(\w*)/i],[c,[h,"Siemens"],[u,g]],[/\b(rct\w+) b/i],[c,[h,"RCA"],[u,v]],[/\b(venue[\d ]{2,7}) b/i],[c,[h,"Dell"],[u,v]],[/\b(q(?:mv|ta)\w+) b/i],[c,[h,"Verizon"],[u,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[h,"Barnes & Noble"],[u,v]],[/\b(tm\d{3}\w+) b/i],[c,[h,"NuVision"],[u,v]],[/\b(k88) b/i],[c,[h,"ZTE"],[u,v]],[/\b(nx\d{3}j) b/i],[c,[h,"ZTE"],[u,g]],[/\b(gen\d{3}) b.+49h/i],[c,[h,"Swiss"],[u,g]],[/\b(zur\d{3}) b/i],[c,[h,"Swiss"],[u,v]],[/\b((zeki)?tb.*\b) b/i],[c,[h,"Zeki"],[u,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],c,[u,v]],[/\b(ns-?\w{0,9}) b/i],[c,[h,"Insignia"],[u,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[h,"NextBook"],[u,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],c,[u,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],c,[u,g]],[/\b(ph-1) /i],[c,[h,"Essential"],[u,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[h,"Envizen"],[u,v]],[/\b(trio[-\w\. ]+) b/i],[c,[h,"MachSpeed"],[u,v]],[/\btu_(1491) b/i],[c,[h,"Rotor"],[u,v]],[/(shield[\w ]+) b/i],[c,[h,"Nvidia"],[u,v]],[/(sprint) (\w+)/i],[h,c,[u,g]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[h,k],[u,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[h,F],[u,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[h,F],[u,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,c,[u,p]],[/droid.+; (shield) bui/i],[c,[h,"Nvidia"],[u,p]],[/(playstation [345portablevi]+)/i],[c,[h,x],[u,p]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[h,k],[u,p]],[/smart-tv.+(samsung)/i],[h,[u,b]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[h,P],[u,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,I],[u,b]],[/(apple) ?tv/i],[h,[c,S+" TV"],[u,b]],[/crkey/i],[[c,O+"cast"],[h,R],[u,b]],[/droid.+aft(\w)( bui|\))/i],[c,[h,w],[u,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[h,L],[u,b]],[/(bravia[\w ]+)( bui|\))/i],[c,[h,x],[u,b]],[/(mitv-\w{5}) bui/i],[c,[h,U],[u,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,H],[c,H],[u,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,b]],[/((pebble))app/i],[h,c,[u,m]],[/droid.+; (glass) \d/i],[c,[h,R],[u,m]],[/droid.+; (wt63?0{2,3})\)/i],[c,[h,F],[u,m]],[/(quest( 2)?)/i],[c,[h,D],[u,m]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[u,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[c,[u,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[u,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[u,g]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[l,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[d,V,z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"Windows"],[d,V,z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[d,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,d],[/\(bb(10);/i],[d,[l,E]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[l,A+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[l,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[l,O+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[l,"Chromium OS"],d],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,d],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[l,d]]},Y=function(e,t){if(typeof e===o&&(t=e,e=n),!(this instanceof Y))return new Y(e,t).getResult();var s=e||(typeof r!==i&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),p=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(W,t):W;return this.getBrowser=function(){var e,t={};return t[l]=n,t[d]=n,B.call(t,s,p.browser),t.major=typeof(e=t.version)===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n,t},this.getCPU=function(){var e={};return e[f]=n,B.call(e,s,p.cpu),e},this.getDevice=function(){var e={};return e[h]=n,e[c]=n,e[u]=n,B.call(e,s,p.device),e},this.getEngine=function(){var e={};return e[l]=n,e[d]=n,B.call(e,s,p.engine),e},this.getOS=function(){var e={};return e[l]=n,e[d]=n,B.call(e,s,p.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return s},this.setUA=function(e){return s=typeof e===a&&e.length>350?H(e,350):e,this},this.setUA(s),this};Y.VERSION="1.0.33",Y.BROWSER=j([l,d,"major"]),Y.CPU=j([f]),Y.DEVICE=j([c,h,u,p,g,b,v,m,y]),Y.ENGINE=Y.OS=j([l,d]),e.exports&&(t=e.exports=Y),t.UAParser=Y;var K=typeof r!==i&&(r.jQuery||r.Zepto);if(K&&!K.ua){var q=new Y;K.ua=q.getResult(),K.ua.get=function(){return q.getUA()},K.ua.set=function(e){q.setUA(e);var t=q.getResult();for(var r in t)K.ua[r]=t[r]}}}("object"==typeof window?window:$e)}(vt,vt.exports);var bt=vt.exports;function mt(e,t,r,n){if(!e&&!t&&!r)return nt.warn("UserAgent filter parameters must include browsers, devices, oss, or all three."),!0;const s=new bt(n),i=e&&s.getBrowser();if(i&&i.name&&e.includes(i.name))return!0;const o=t&&s.getDevice();if(o&&o.type&&t.includes(o.type))return!0;const a=r&&s.getOS();return!!a&&!!a.name&&r.includes(a.name)}class yt{filter(e){return mt(null==e?void 0:e.browsers,null==e?void 0:e.devices,null==e?void 0:e.oss,null==e?void 0:e.ua)}get isSafari(){return mt(["Safari"])}}const wt=ae.createInterface((e=>e.transient(yt))),St=Be("foundation-comms"),_t=new RegExp(/wss?:\/\/[-a-zA-Z0-9@:%._\+~#=]{1,256}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)\b\/*$/,"i");class Et{constructor(){this.cachedMetadata=new Map}getMetadataFor(e){return this.cachedMetadata.get(e)}hasMetadataFor(e){return this.cachedMetadata.has(e)}setMetadataFor(e,t){this.cachedMetadata.set(e,t)}}s([I],Et.prototype,"cachedMetadata",void 0);const Tt=ae.createInterface((e=>e.singleton(Et)));function Ot(e){return"function"==typeof e}function At(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Rt=At((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function Ct(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var It=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,n,s;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var o=c(i),a=o.next();!a.done;a=o.next()){a.value.remove(this)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else i.remove(this);var h=this.initialTeardown;if(Ot(h))try{h()}catch(e){s=e instanceof Rt?e.errors:[e]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var f=c(d),p=f.next();!p.done;p=f.next()){var g=p.value;try{Nt(g)}catch(e){s=null!=s?s:[],e instanceof Rt?s=u(u([],l(s)),l(e.errors)):s.push(e)}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}}if(s)throw new Rt(s)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Nt(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Ct(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&Ct(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),kt=It.EMPTY;function Mt(e){return e instanceof It||e&&"closed"in e&&Ot(e.remove)&&Ot(e.add)&&Ot(e.unsubscribe)}function Nt(e){Ot(e)?e():e.unsubscribe()}var Pt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Lt={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var s=Lt.delegate;return(null==s?void 0:s.setTimeout)?s.setTimeout.apply(s,u([e,t],l(r))):setTimeout.apply(void 0,u([e,t],l(r)))},clearTimeout:function(e){var t=Lt.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function xt(e){Lt.setTimeout((function(){throw e}))}function Ut(){}var Ft=Dt("C",void 0,void 0);function Dt(e,t,r){return{kind:e,value:t,error:r}}var jt=null;function Gt(e){if(Pt.useDeprecatedSynchronousErrorHandling){var t=!jt;if(t&&(jt={errorThrown:!1,error:null}),e(),t){var r=jt,n=r.errorThrown,s=r.error;if(jt=null,n)throw s}}else e()}var $t=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,Mt(t)&&t.add(r)):r.destination=Kt,r}return r(t,e),t.create=function(e,t,r){return new zt(e,t,r)},t.prototype.next=function(e){this.isStopped?Yt(function(e){return Dt("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Yt(Dt("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Yt(Ft,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(It),Ht=Function.prototype.bind;function Bt(e,t){return Ht.call(e,t)}var Vt=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Wt(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Wt(e)}else Wt(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Wt(e)}},e}(),zt=function(e){function t(t,r,n){var s,i,o=e.call(this)||this;Ot(t)||!t?s={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:o&&Pt.useDeprecatedNextContext?((i=Object.create(t)).unsubscribe=function(){return o.unsubscribe()},s={next:t.next&&Bt(t.next,i),error:t.error&&Bt(t.error,i),complete:t.complete&&Bt(t.complete,i)}):s=t;return o.destination=new Vt(s),o}return r(t,e),t}($t);function Wt(e){xt(e)}function Yt(e,t){var r=Pt.onStoppedNotification;r&&Lt.setTimeout((function(){return r(e,t)}))}var Kt={closed:!0,next:Ut,error:function(e){throw e},complete:Ut},qt="function"==typeof Symbol&&Symbol.observable||"@@observable";function Qt(e){return e}var Jt=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n,s=this,i=(n=e)&&n instanceof $t||function(e){return e&&Ot(e.next)&&Ot(e.error)&&Ot(e.complete)}(n)&&Mt(n)?e:new zt(e,t,r);return Gt((function(){var e=s,t=e.operator,r=e.source;i.add(t?t.call(i,r):r?s._subscribe(i):s._trySubscribe(i))})),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=Zt(t))((function(t,n){var s=new zt({next:function(t){try{e(t)}catch(e){n(e),s.unsubscribe()}},error:n,complete:t});r.subscribe(s)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[qt]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(0===(e=t).length?Qt:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Zt(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function Zt(e){var t;return null!==(t=null!=e?e:Pt.Promise)&&void 0!==t?t:Promise}function Xt(e){return function(t){if(function(e){return Ot(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}function er(e,t,r,n,s){return new tr(e,t,r,n,s)}var tr=function(e){function t(t,r,n,s,i,o){var a=e.call(this,t)||this;return a.onFinalize=i,a.shouldUnsubscribe=o,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=s?function(e){try{s(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return r(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}($t),rr=At((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),nr=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return r(t,e),t.prototype.lift=function(e){var t=new sr(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new rr},t.prototype.next=function(e){var t=this;Gt((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var s=c(t.currentObservers),i=s.next();!i.done;i=s.next()){i.value.next(e)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;Gt((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;Gt((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,s=r.isStopped,i=r.observers;return n||s?kt:(this.currentObservers=null,i.push(e),new It((function(){t.currentObservers=null,Ct(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,s=t.isStopped;r?e.error(n):s&&e.complete()},t.prototype.asObservable=function(){var e=new Jt;return e.source=this,e},t.create=function(e,t){return new sr(e,t)},t}(Jt),sr=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return r(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:kt},t}(nr),ir=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return r(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(nr),or={now:function(){return(or.delegate||Date).now()},delegate:void 0},ar=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=or);var s=e.call(this)||this;return s._bufferSize=t,s._windowTime=r,s._timestampProvider=n,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=r===1/0,s._bufferSize=Math.max(1,t),s._windowTime=Math.max(1,r),s}return r(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,s=r._buffer,i=r._infiniteTimeWindow,o=r._timestampProvider,a=r._windowTime;n||(s.push(t),!i&&s.push(o.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),s=0;s<n.length&&!e.closed;s+=r?1:2)e.next(n[s]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,s=e._infiniteTimeWindow,i=(s?1:2)*t;if(t<1/0&&i<n.length&&n.splice(0,n.length-i),!s){for(var o=r.now(),a=0,c=1;c<n.length&&n[c]<=o;c+=2)a=c;a&&n.splice(0,a+1)}},t}(nr),cr=function(e){function t(t,r){return e.call(this)||this}return r(t,e),t.prototype.schedule=function(e,t){return this},t}(It),lr={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var s=lr.delegate;return(null==s?void 0:s.setInterval)?s.setInterval.apply(s,u([e,t],l(r))):setInterval.apply(void 0,u([e,t],l(r)))},clearInterval:function(e){var t=lr.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},ur=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return r(t,e),t.prototype.schedule=function(e,t){var r;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,s=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(s,n,t)),this.pending=!0,this.delay=t,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(s,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),lr.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&lr.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Ct(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(cr),hr=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=or.now,e}(),dr=new(function(e){function t(t,r){void 0===r&&(r=hr.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return r(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(hr))(ur),fr=dr;function pr(e){return e&&Ot(e.schedule)}function gr(e){return pr((t=e)[t.length-1])?e.pop():void 0;var t}var vr=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function br(e){return Ot(null==e?void 0:e.then)}function mr(e){return Ot(e[qt])}function yr(e){return Symbol.asyncIterator&&Ot(null==e?void 0:e[Symbol.asyncIterator])}function wr(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var Sr="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function _r(e){return Ot(null==e?void 0:e[Sr])}function Er(e){return d(this,arguments,(function(){var t,r,n;return a(this,(function(s){switch(s.label){case 0:t=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,h(t.read())];case 3:return r=s.sent(),n=r.value,r.done?[4,h(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,h(n)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function Tr(e){return Ot(null==e?void 0:e.getReader)}function Or(e){if(e instanceof Jt)return e;if(null!=e){if(mr(e))return s=e,new Jt((function(e){var t=s[qt]();if(Ot(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(vr(e))return n=e,new Jt((function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()}));if(br(e))return r=e,new Jt((function(e){r.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,xt)}));if(yr(e))return Ar(e);if(_r(e))return t=e,new Jt((function(e){var r,n;try{for(var s=c(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(e.next(o),e.closed)return}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}e.complete()}));if(Tr(e))return Ar(Er(e))}var t,r,n,s;throw wr(e)}function Ar(e){return new Jt((function(t){(function(e,t){var r,n,s,i;return o(this,void 0,void 0,(function(){var o,c;return a(this,(function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),r=f(e),a.label=1;case 1:return[4,r.next()];case 2:if((n=a.sent()).done)return[3,4];if(o=n.value,t.next(o),t.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=a.sent(),s={error:c},[3,11];case 6:return a.trys.push([6,,9,10]),n&&!n.done&&(i=r.return)?[4,i.call(r)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function Rr(e,t,r,n,s){void 0===n&&(n=0),void 0===s&&(s=!1);var i=t.schedule((function(){r(),s?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(i),!s)return i}function Cr(e,t){return void 0===t&&(t=0),Xt((function(r,n){r.subscribe(er(n,(function(r){return Rr(n,e,(function(){return n.next(r)}),t)}),(function(){return Rr(n,e,(function(){return n.complete()}),t)}),(function(r){return Rr(n,e,(function(){return n.error(r)}),t)})))}))}function Ir(e,t){return void 0===t&&(t=0),Xt((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}function kr(e,t){if(!e)throw new Error("Iterable cannot be null");return new Jt((function(r){Rr(r,t,(function(){var n=e[Symbol.asyncIterator]();Rr(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}function Mr(e,t){if(null!=e){if(mr(e))return function(e,t){return Or(e).pipe(Ir(t),Cr(t))}(e,t);if(vr(e))return function(e,t){return new Jt((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}(e,t);if(br(e))return function(e,t){return Or(e).pipe(Ir(t),Cr(t))}(e,t);if(yr(e))return kr(e,t);if(_r(e))return function(e,t){return new Jt((function(r){var n;return Rr(r,t,(function(){n=e[Sr](),Rr(r,t,(function(){var e,t,s;try{t=(e=n.next()).value,s=e.done}catch(e){return void r.error(e)}s?r.complete():r.next(t)}),0,!0)})),function(){return Ot(null==n?void 0:n.return)&&n.return()}}))}(e,t);if(Tr(e))return function(e,t){return kr(Er(e),t)}(e,t)}throw wr(e)}function Nr(e,t){return t?Mr(e,t):Or(e)}function Pr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Nr(e,gr(e))}function Lr(e,t){var r=Ot(e)?e:function(){return e},n=function(e){return e.error(r())};return new Jt(t?function(e){return t.schedule(n,0,e)}:n)}function xr(e,t,r){return void 0===r&&(r=1/0),Ot(t)?xr((function(r,n){return function(e,t){return Xt((function(r,n){var s=0;r.subscribe(er(n,(function(r){n.next(e.call(t,r,s++))})))}))}((function(e,s){return t(r,e,n,s)}))(Or(e(r,n)))}),r):("number"==typeof t&&(r=t),Xt((function(t,n){return function(e,t,r,n,s,i,o,a){var c=[],l=0,u=0,h=!1,d=function(){!h||c.length||l||t.complete()},f=function(e){return l<n?p(e):c.push(e)},p=function(e){i&&t.next(e),l++;var a=!1;Or(r(e,u++)).subscribe(er(t,(function(e){null==s||s(e),i?f(e):t.next(e)}),(function(){a=!0}),void 0,(function(){if(a)try{l--;for(var e=function(){var e=c.shift();o?Rr(t,o,(function(){return p(e)})):p(e)};c.length&&l<n;)e();d()}catch(e){t.error(e)}})))};return e.subscribe(er(t,f,(function(){h=!0,d()}))),function(){null==a||a()}}(t,n,e,r)})))}function Ur(){return void 0===(e=1)&&(e=1/0),xr(Qt,e);var e}function Fr(e,t,r){void 0===e&&(e=0),void 0===r&&(r=fr);var n=-1;return null!=t&&(pr(t)?r=t:n=t),new Jt((function(t){var s,i=(s=e)instanceof Date&&!isNaN(s)?+e-r.now():e;i<0&&(i=0);var o=0;return r.schedule((function(){t.closed||(t.next(o++),0<=n?this.schedule(void 0,n):t.complete())}),i)}))}function Dr(e,t){return Xt((function(r,n){var s=null,i=0,o=!1,a=function(){return o&&!s&&n.complete()};r.subscribe(er(n,(function(r){null==s||s.unsubscribe();var o=0,c=i++;Or(e(r,c)).subscribe(s=er(n,(function(e){return n.next(t?t(r,e,c,o++):e)}),(function(){s=null,a()})))}),(function(){o=!0,a()})))}))}function jr(e,t){return void 0===t&&(t=!1),Xt((function(r,n){var s=0;r.subscribe(er(n,(function(r){var i=e(r,s++);(i||t)&&n.next(r),!i&&n.complete()})))}))}class Gr{constructor(){this.storageKeyPrefix="",this.returnUrl=this.getSessionStorageItem("returnUrl")||""}deleteUserFromSessionStorage(){["authToken","refreshToken","username","sessionId","ssoToken"].forEach((e=>this.removeSessionStorageItem(e)))}setStorageKeyPrefix(e){this.storageKeyPrefix=`${e.replace(/\s/g,"")}/`}setAuthResult(e){this.setSessionStorageItem("authToken",e.SESSION_AUTH_TOKEN),this.setSessionStorageItem("refreshToken",e.REFRESH_AUTH_TOKEN),this.setSessionStorageItem("username",e.USER_NAME),this.setSessionStorageItem("sessionId",e.SESSION_ID)}captureReturnUrl(){const{pathname:e,search:t,hash:r}=location;if("/login"===e)return;const n=`${"/"!==e?e:""}`;this.returnUrl=`${n}${t}${r}`,this.setSessionStorageItem("returnUrl",this.returnUrl)}setItem(e,t,r){"local"===r?localStorage.setItem(this.storageKeyPrefix+e,t):sessionStorage.setItem(this.storageKeyPrefix+e,t)}getItem(e,t){return"local"===t?localStorage.getItem(this.storageKeyPrefix+e):sessionStorage.getItem(this.storageKeyPrefix+e)}removeItem(e,t){"local"===t?localStorage.removeItem(this.storageKeyPrefix+e):sessionStorage.removeItem(this.storageKeyPrefix+e)}setLocalStorageItem(e,t){this.setItem(e,t,"local")}setSessionStorageItem(e,t){this.setItem(e,t,"session")}getLocalStorageItem(e){return this.getItem(e,"local")}getSessionStorageItem(e){return this.getItem(e,"session")}removeLocalStorageItem(e){this.removeItem(e,"local")}removeSessionStorageItem(e){this.removeItem(e,"session")}}const $r=ae.createInterface((e=>e.singleton(Gr)));class Hr{serialize(e){return JSON.stringify(e)}deserialize(e){return e?"string"==typeof e?JSON.parse(e):e.data?JSON.parse(e.data):e.text().then((e=>JSON.parse(e))):Promise.resolve({})}}const Br=ae.createInterface((e=>e.singleton(Hr)));let Vr=class{constructor(e){this.serializer=e}get(e,t){return o(this,void 0,void 0,(function*(){const r=yield fetch(e,Object.assign(Object.assign({},t),{method:"GET"}));return(t.serializer||this.serializer).deserialize(r)}))}post(e,t){return o(this,void 0,void 0,(function*(){const r=yield fetch(e,Object.assign(Object.assign({},t),{method:"POST"}));return(t.serializer||this.serializer).deserialize(r)}))}};Vr=s([i(0,Br)],Vr);const zr=ae.createInterface((e=>e.singleton(Vr)));var Wr,Yr,Kr,qr;!function(e){e.BASIC="BASIC",e.SSO="SSO",e.JWT="JWT",e.REFRESH="REFRESH"}(Wr||(Wr={}));class Qr extends Error{constructor(e,t,r="Auth Failed \n"){super(r),this.sent=e,this.received=t,Object.setPrototypeOf(this,Qr.prototype)}isIgnorableError(){var e,t,r,n;return null===(n=null===(r=null===(t=null===(e=this.received)||void 0===e?void 0:e.DETAILS)||void 0===t?void 0:t.ERROR)||void 0===r?void 0:r.toLowerCase())||void 0===n?void 0:n.includes("request needs the user to be logged")}getMessageError(){var e,t;return Array.isArray(null===(e=this.received)||void 0===e?void 0:e.ERROR)?null===(t=this.received)||void 0===t?void 0:t.ERROR.map((e=>this.errorDetailFormatter(e))).join("\n"):""}getDetailsError(){var e,t,r,n;return Array.isArray(null===(t=null===(e=this.received)||void 0===e?void 0:e.DETAILS)||void 0===t?void 0:t.ERROR)?null===(n=null===(r=this.received)||void 0===r?void 0:r.DETAILS)||void 0===n?void 0:n.ERROR.map((e=>this.errorDetailFormatter(e))).join("\n"):""}hasPasswordExpiredError(){return this.hasErrorCode("PASSWORD_EXPIRED")}hasErrorCode(e){var t,r;return!!Array.isArray(null===(t=this.received)||void 0===t?void 0:t.ERROR)&&(null===(r=this.received)||void 0===r?void 0:r.ERROR.some((t=>t.CODE===e)))}errorDetailFormatter(e){return`\n ${e.CODE}: \n ${e.TEXT}`}}!function(e){e.LOGON_ACK="LOGON_ACK",e.LOGON_NACK="LOGON_NACK",e.LOGOFF_ACK="LOGOFF_ACK",e.LOGOFF_NACK="LOGOFF_NACK",e.HEARTBEAT_PING="HEARTBEAT_PING",e.HEARTBEAT_PONG="HEARTBEAT_PONG",e.MORE_ROWS="MORE_ROWS",e.MSG_ACK="MSG_ACK",e.MSG_NACK="MSG_NACK",e.LOGOUT_ACK="LOGOUT_ACK",e.LOGOUT_NACK="LOGOUT_NACK",e.QUERY_UPDATE="QUERY_UPDATE"}(Yr||(Yr={})),function(e){e.EVENT_LOGIN_AUTH="EVENT_LOGIN_AUTH",e.EVENT_LOGIN_AUTH_ACK="EVENT_LOGIN_AUTH_ACK",e.EVENT_LOGIN_AUTH_NACK="EVENT_LOGIN_AUTH_NACK",e.EVENT_LOGOUT="EVENT_LOGOUT",e.DATA_LOGON="DATA_LOGON",e.DATA_LOGOFF="DATA_LOGOFF",e.META_REQUEST="META_REQUEST",e.JSON_SCHEMA_REQUEST="JSON_SCHEMA_REQUEST",e.RESOURCES_REQUEST="RESOURCES_REQUEST",e.EVENT_CHANGE_USER_PASSWORD="EVENT_CHANGE_USER_PASSWORD",e.EVENT_SELF_SERVICE_PASSWORD_RESET="EVENT_SELF_SERVICE_PASSWORD_RESET",e.EVENT_PASSWORD_RESET_ACTION="EVENT_PASSWORD_RESET_ACTION"}(Kr||(Kr={})),function(e){e.SESSION_NOT_FOUND="SESSION_NOT_FOUND",e.UNKNOWN_MESSAGE_TYPE="UNKNOWN_MESSAGE_TYPE"}(qr||(qr={}));let Jr=class{constructor(e,t){this.session=e,this.uuid=t}createLoginMessage(e){let t;switch(e.type){case Wr.BASIC:t={USER_NAME:e.username,PASSWORD:e.password};break;case Wr.REFRESH:t={USER_NAME:e.username,REFRESH_AUTH_TOKEN:e.refreshToken};break;case Wr.SSO:t={SSO_TOKEN:e.ssoToken};break;case Wr.JWT:t={JWT:e.jwt,DOMAIN:e.domain}}return{DETAILS:t,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:Kr.EVENT_LOGIN_AUTH}}createLogoutMessage(e){var t,r,n;return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:Kr.EVENT_LOGOUT,USER_NAME:null!==(t=e.username)&&void 0!==t?t:this.session.getSessionStorageItem("username"),SESSION_AUTH_TOKEN:null!==(r=e.authToken)&&void 0!==r?r:this.session.getSessionStorageItem("authToken"),SESSION_ID:null!==(n=e.sessionId)&&void 0!==n?n:this.session.getSessionStorageItem("sessionId")}}createDataLogonMessage(e,t){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:Kr.DATA_LOGON,USER_NAME:this.session.getSessionStorageItem("username"),DETAILS:Object.assign({DATASOURCE_NAME:e},t),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createDataLogoffMessage(e){return{SOURCE_REF:e,MESSAGE_TYPE:Kr.DATA_LOGOFF,SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createRequestMessage(e,t){return Object.assign({SOURCE_REF:this.uuid.createId(),USER_NAME:this.session.getSessionStorageItem("username"),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:e.startsWith("REQ_")?e:`REQ_${e}`},t)}createMetaRequestMessage(e,t=Kr.META_REQUEST){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:t,DETAILS:{FEATURE:e},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createCommitMessage(e,t){return Object.assign({SOURCE_REF:this.uuid.createId(),USER_NAME:this.session.getSessionStorageItem("username"),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:e},t)}createRefreshTokenMessage(){const e=this.session.getSessionStorageItem("username");return{USER_NAME:e,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:Kr.EVENT_LOGIN_AUTH,DETAILS:{USER_NAME:e,REFRESH_AUTH_TOKEN:this.session.getSessionStorageItem("refreshToken")}}}createChangePasswordMessage(e,t,r){return{USER_NAME:e,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:Kr.EVENT_CHANGE_USER_PASSWORD,DETAILS:{OLD_PASSWORD:t,NEW_PASSWORD:r}}}createForgotPasswordMessage(e,t,r=e){return{USER_NAME:r,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:Kr.EVENT_SELF_SERVICE_PASSWORD_RESET,DETAILS:{USER_NAME:e,RETURN_URL:t}}}createForgotPasswordTokenMessage(e,t,r,n=e){return{USER_NAME:n,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:Kr.EVENT_PASSWORD_RESET_ACTION,DETAILS:{USER_NAME:e,RESET_TOKEN:t,NEW_PASSWORD:r}}}createMoreRowsMessage(e){return{USER_NAME:this.session.getSessionStorageItem("username"),SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:Yr.MORE_ROWS,DETAILS:{SOURCE_REF:e},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}};Jr=s([i(0,$r),i(1,rt)],Jr);const Zr=ae.createInterface((e=>e.singleton(Jr))),Xr=ae.createInterface(),en=ae.createInterface();let tn,rn;try{tn=HTTP_CONFIG}catch(e){}try{rn=FORCE_HTTP}catch(e){}const nn={polling:Object.assign({POLLING_MAP:{EVENT_AMEND_USER:{TEMP_FREQUENCY:500,AMOUNT_OF_POLLS:5,QUERIES:["ALL_USERS"]}},POLLING_INTERVAL_MAP:{ALL_TRADES:5e3,ALL_USERS:5e3,ALL_PROCESSES_STATUS:1e4},POLLING_FREQUENCY:5e3},tn&&tn.length?JSON.parse(tn):{})};let sn=class e{get isConnected(){return this._isConnected}set isConnected(e){this._isConnected=e,this.isConnectedSubject.next(this._isConnected)}constructor(e,t,r,n,s,i=nn){this.http=e,this.messageBuilder=t,this.session=r,this.metaCache=n,this.serializer=s,this.config=i,this.isWorking=!1,this._isConnected=!1,this.isConnectedSubject=new ir(this._isConnected),this.ongoingTurbo={},this.streams=new Map}checkHost(){return o(this,void 0,void 0,(function*(){try{return this.getMessage({MESSAGE_TYPE:Yr.HEARTBEAT_PING,SOURCE_REF:"host check"}).then((e=>e.MESSAGE_TYPE===Yr.HEARTBEAT_PONG))}catch(e){return St.error(e),!1}}))}send(t,r){return this.http.post(e.getUrl(this.host,t),{body:e.getBody(t),headers:e.getHeaders(t)})}httpMode(){return!0}setValidSession(e){St.warn("setValidSession() called while in http polling mode.")}connect(e){return o(this,void 0,void 0,(function*(){return this.host=e,this.host.endsWith("/")||(this.host=this.host.concat("/")),this.checkHost().then((e=>(this.isConnected=e,this.session.setSessionStorageItem("hostUrl",this.host),e)))}))}disconnect(){this.isConnected=!1,this.streams.clear(),this.ongoingTurbo={},this.host=void 0}snapshot(e,t){return o(this,void 0,void 0,(function*(){const r=this.messageBuilder.createDataLogonMessage(e,t);return St.debug(`HTTP MODE - ${r.MESSAGE_TYPE} (snapshot) message created -> `,r),this.send(r).then((e=>(this.dataLogoff(r.SOURCE_REF).catch((e=>St.error(e))),e)))}))}stream(e,t,r,n){const s=this.messageBuilder.createDataLogonMessage(e,n);St.debug(`HTTP MODE - ${s.MESSAGE_TYPE} (stream) message created -> `,s);const i=s.SOURCE_REF;this.streams.set(i,{SOURCE_REF:i,POLLING_FREQUENCY:new ir(this.config.polling.POLLING_FREQUENCY),RESOURCE_NAME:e});const o=this.streams.get(i).POLLING_FREQUENCY,a=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ur()(Nr(e,gr(e)))}(Nr(this.send(s)),o.pipe(Dr((e=>{return void 0===(t=e)&&(t=0),void 0===r&&(r=dr),t<0&&(t=0),Fr(t,t,r);var t,r}))).pipe(Dr((()=>Nr(this.getMessage(s)))))).pipe(jr((()=>this.streams.has(i))),(c=()=>{St.debug(`Terminating stream for ${e} - ${i}`),this.dataLogoff(i)},Xt((function(e,t){try{e.subscribe(t)}finally{t.add(c)}}))));var c;return this.streams.get(i).STREAM=a,a}getMessage(t){return o(this,void 0,void 0,(function*(){return this.http.get(e.getUrl(this.host,t),{headers:e.getHeaders(t)})}))}getMoreRows(e){return o(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMoreRowsMessage(e);return St.debug(`HTTP MODE - ${t.MESSAGE_TYPE} message created -> `,t),this.send(t)}))}dataLogoff(e){return o(this,void 0,void 0,(function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return this.send(t).then((t=>(this.streams.has(e)&&(St.debug(`Removing stream ${e}`),this.streams.delete(e)),t)))}))}getMetadata(e,t=!0){return o(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMetaRequestMessage(e);return St.debug(`HTTP MODE - ${t.MESSAGE_TYPE} (metadata) message created -> `,t),this.send(t).then((e=>e.DETAILS))}))}getJSONSchema(e){return o(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMetaRequestMessage(e,Kr.JSON_SCHEMA_REQUEST);return St.debug(`HTTP MODE! - ${t.MESSAGE_TYPE} (json schema) message created -> `,t),this.send(t)}))}request(e,t){const r=this.messageBuilder.createRequestMessage(e,t);return St.debug(`HTTP MODE! - ${r.MESSAGE_TYPE} (request server) message created -> `,r),this.send(r)}commitEvent(e,t){return o(this,void 0,void 0,(function*(){const r=this.messageBuilder.createCommitMessage(e,t);return St.debug(`HTTP MODE! - ${r.MESSAGE_TYPE} (commit) message created -> `,r),this.send(r).then((t=>(this.maybeTurbo(e,t),t)))}))}maybeTurbo(e,t){var r;if(!(null===(r=null==t?void 0:t.MESSAGE_TYPE)||void 0===r?void 0:r.endsWith("_ACK")))return;if(this.ongoingTurbo[e])return void St.debug(`${e} polling frequency is already accelerated.`);const n=this.config.polling.POLLING_MAP[e];if(!(null==n?void 0:n.TEMP_FREQUENCY)||!n.AMOUNT_OF_POLLS)return;const s=n.TEMP_FREQUENCY,i=s*n.AMOUNT_OF_POLLS,o=JSON.parse(JSON.stringify(this.config.polling.POLLING_INTERVAL_MAP)),a=JSON.parse(JSON.stringify(this.config.polling.POLLING_INTERVAL_MAP));for(const e of n.QUERIES)a[e]=s,o[e]||(o[e]=this.config.polling.POLLING_FREQUENCY);St.debug(`${e} TRIGGERED -> ENFORCING TURBO | FREQUENCY=${s}ms DURATION=${i}`),this.ongoingTurbo[e]=!0,this.updateIntervals({polling:{POLLING_INTERVAL_MAP:a}}),setTimeout((()=>{St.debug(`RESTORED ORIGINAL POLLING INTERVALS FOR ${e}`),this.updateIntervals({polling:{POLLING_INTERVAL_MAP:o}}),this.ongoingTurbo[e]=!1}),i)}updateIntervals(e){const{POLLING_INTERVAL_MAP:t}=e.polling;t&&(this.config.polling.POLLING_INTERVAL_MAP=t,this.handlePollingIntervalMapUpdate(t))}handlePollingIntervalMapUpdate(e){if(e)for(const t in e){if(!e.hasOwnProperty(t))continue;const r=e[t];this.config.polling.POLLING_INTERVAL_MAP[t]=r,St.debug(`Setting polling frequency for ${t} = ${r}`),[...this.streams.values()].filter((e=>e.RESOURCE_NAME===t)).forEach((e=>{var t;return null===(t=null==e?void 0:e.POLLING_FREQUENCY)||void 0===t?void 0:t.next(r)}))}}static getHeaders(e){const t={"Content-type":"application/json; charset=UTF-8","source-ref":e.SOURCE_REF};return e.SESSION_AUTH_TOKEN&&(t["SESSION-AUTH-TOKEN"]=e.SESSION_AUTH_TOKEN),e.MESSAGE_TYPE===Kr.EVENT_LOGOUT&&(t["SESSION-ID"]=e.SESSION_ID),t}static getBody(e){return JSON.stringify(e)}static getUrl(e,t){const r=t.MESSAGE_TYPE;let n=t.MESSAGE_TYPE.replace(/_/g,"-").toLowerCase();return r===Kr.DATA_LOGON&&(n=t.DETAILS.DATASOURCE_NAME.replace(/_/g,"-").toLowerCase()),`${e}${n}`}};s([I],sn.prototype,"host",void 0),s([I],sn.prototype,"isWorking",void 0),s([I],sn.prototype,"_isConnected",void 0),s([k],sn.prototype,"isConnected",null),sn=s([i(0,zr),i(1,Zr),i(2,$r),i(3,Tt),i(4,We),i(5,ue(en))],sn);const on=ae.createInterface((e=>e.singleton(sn)));var an={url:"",deserializer:function(e){return JSON.parse(e.data)},serializer:function(e){return JSON.stringify(e)}},cn=function(e){function t(t,r){var s=e.call(this)||this;if(s._socket=null,t instanceof Jt)s.destination=r,s.source=t;else{var i=s._config=n({},an);if(s._output=new nr,"string"==typeof t)i.url=t;else for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);if(!i.WebSocketCtor&&WebSocket)i.WebSocketCtor=WebSocket;else if(!i.WebSocketCtor)throw new Error("no WebSocket constructor can be found");s.destination=new ar}return s}return r(t,e),t.prototype.lift=function(e){var r=new t(this._config,this.destination);return r.operator=e,r.source=this,r},t.prototype._resetState=function(){this._socket=null,this.source||(this.destination=new ar),this._output=new nr},t.prototype.multiplex=function(e,t,r){var n=this;return new Jt((function(s){try{n.next(e())}catch(e){s.error(e)}var i=n.subscribe({next:function(e){try{r(e)&&s.next(e)}catch(e){s.error(e)}},error:function(e){return s.error(e)},complete:function(){return s.complete()}});return function(){try{n.next(t())}catch(e){s.error(e)}i.unsubscribe()}}))},t.prototype._connectSocket=function(){var e=this,t=this._config,r=t.WebSocketCtor,n=t.protocol,s=t.url,i=t.binaryType,o=this._output,a=null;try{a=n?new r(s,n):new r(s),this._socket=a,i&&(this._socket.binaryType=i)}catch(e){return void o.error(e)}var c=new It((function(){e._socket=null,a&&1===a.readyState&&a.close()}));a.onopen=function(t){if(!e._socket)return a.close(),void e._resetState();var r=e._config.openObserver;r&&r.next(t);var n=e.destination;e.destination=$t.create((function(t){if(1===a.readyState)try{var r=e._config.serializer;a.send(r(t))}catch(t){e.destination.error(t)}}),(function(t){var r=e._config.closingObserver;r&&r.next(void 0),t&&t.code?a.close(t.code,t.reason):o.error(new TypeError("WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }")),e._resetState()}),(function(){var t=e._config.closingObserver;t&&t.next(void 0),a.close(),e._resetState()})),n&&n instanceof ar&&c.add(n.subscribe(e.destination))},a.onerror=function(t){e._resetState(),o.error(t)},a.onclose=function(t){a===e._socket&&e._resetState();var r=e._config.closeObserver;r&&r.next(t),t.wasClean?o.complete():o.error(t)},a.onmessage=function(t){try{var r=e._config.deserializer;o.next(r(t))}catch(e){o.error(e)}}},t.prototype._subscribe=function(e){var t=this,r=this.source;return r?r.subscribe(e):(this._socket||this._connectSocket(),this._output.subscribe(e),e.add((function(){var e=t._socket;0===t._output.observers.length&&(!e||1!==e.readyState&&0!==e.readyState||e.close(),t._resetState())})),e)},t.prototype.unsubscribe=function(){var t=this._socket;!t||1!==t.readyState&&0!==t.readyState||t.close(),this._resetState(),e.prototype.unsubscribe.call(this)},t}(sr);const ln=1e4,un=6e4;var hn;!function(e){e.Linear="linear",e.Exponential="exponential"}(hn||(hn={}));const dn=(e,t)=>{const{reconnectInterval:r=ln}=e,n=r>un?un:r,s=Math.round(Math.log2(un/n));return n*Math.pow(2,t%s)},fn=(e,t)=>{const{reconnectInterval:r=ln}=e;return r>un?un:r};class pn extends nr{constructor(){super()}}class gn{constructor(e,t,r,n){this._message=e,this._onMessage=t,this._onError=r,this._isSubscription=n}get sentMessage(){return this._message}get onReceivedMessage(){return this._onMessage}get onReceivedError(){return this._onError}get isSubscription(){return this._isSubscription}}let vn=class{isConnectedChanged(e,t){this.isConnectedSubject.next(t)}constructor(e,t,r,n){this.messageBuilder=e,this.session=t,this.serializer=r,this.uuid=n,this.defaultInterval=1e4,this.secondsMultiplier=1e3,this.isConnectedSubject=new ir(!1),this.isConnected=!1,this.hasValidSession=!1,this.heartbeatIsEnabled=!0,this.heartbeatInterval=this.defaultInterval,this.isReconnecting=!1,this.socketMessages=()=>this.wsMessages}get heartbeatLoggingIsEnabled(){var e,t;return null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableHeartbeatLogging)&&void 0!==t&&t}get messageLoggingIsEnabled(){var e,t;return null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableMessageLogging)&&void 0!==t&&t}connect(e,t,r){return this.url=e,this.connectOptions=t,this.reconnectOptions=r,new Promise((e=>{var t,r,n,s;St.info(`${this.isReconnecting?"Reconnecting":"Connecting"} to ${this.url}`);(!this.isReconnecting||!(null===(t=this.reconnectOptions)||void 0===t?void 0:t.reconnectStreams))&&this.cleanMessages(),null===(r=this.socketSubscription)||void 0===r||r.unsubscribe(),this.websocket=new cn({url:this.url,openObserver:{next:()=>{this.isConnected=!0,this.session.setSessionStorageItem("hostUrl",this.url),this.prepareHeartbeat(),St.info("WebSocket connection is now open"),e(this.isConnected)}},closeObserver:{next:t=>{this.disconnectedByServer=!t.wasClean,this.isConnected=!1,St.info(`WebSocket connection was closed due an error - Code: ${t.code} ${t.reason?" | Reason: "+t.reason:""}`),e(this.isConnected)}},serializer:this.serializer.serialize,deserializer:this.serializer.deserialize});this.socketSubscription=this.websocket.subscribe(null!==(s=null===(n=this.connectOptions)||void 0===n?void 0:n.connectObserver)&&void 0!==s?s:{next:e=>o(this,void 0,void 0,(function*(){var t;const r=`Response Message received for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;this.logMessageTypeFlow(e.MESSAGE_TYPE,St.info,r);const{SOURCE_REF:n,MESSAGE_TYPE:s}=e,i=this.getMessageHandler(n,s);if(!i)return;let o=!1;switch(e.MESSAGE_TYPE){case Kr.EVENT_LOGIN_AUTH_ACK:{this.hasValidSession=!0;const r=e.DETAILS;r.HEARTBEAT_INTERVAL_SECS&&void 0===(null===(t=this.connectOptions)||void 0===t?void 0:t.heartbeatInterval)&&(this.heartbeatInterval=r.HEARTBEAT_INTERVAL_SECS*this.secondsMultiplier,this.prepareHeartbeat());break}case Yr.LOGOUT_ACK:return this.hasValidSession=!1,i.onReceivedMessage.call(this,e),void this.cleanMessages();case Yr.LOGON_ACK:return;case Yr.LOGOFF_ACK:if(e.LOGGED_OUT&&this.hasValidSession){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.send(e);t?t.MESSAGE_TYPE===Kr.EVENT_LOGIN_AUTH_ACK&&(this.session.setAuthResult(t),this.wsMessageHandlers.forEach((e=>{e.isSubscription&&(e.sentMessage.SESSION_AUTH_TOKEN=t.SESSION_AUTH_TOKEN,this.websocket.next(e.sentMessage))}))):this.hasValidSession=!1}break;case Yr.QUERY_UPDATE:if(!i.isSubscription){const e=this.messageBuilder.createDataLogoffMessage(n);this.send(e)}break;case Yr.MSG_NACK:o=!0}o?i.onReceivedError.call(this,{receivedMessage:e,sentMessage:i.sentMessage}):i.onReceivedMessage.call(this,e),this.wsMessages.next(e),i.isSubscription||this.removeMessageHandler(n)})),error:e=>{St.debug("Error found: ",e),this.reconnect()},complete:()=>{var e;this.disconnectedByServer&&(null===(e=this.connectOptions)||void 0===e?void 0:e.alwaysOn)?this.reconnect():St.info("Connection is now closed")}})}))}prepareHeartbeat(){var e,t,r,n;this.heartbeatSubscription&&this.heartbeatSubscription.unsubscribe();const s=()=>o(this,void 0,void 0,(function*(){if(!this.isConnected)return;const e={MESSAGE_TYPE:Yr.HEARTBEAT_PING,SOURCE_REF:this.uuid.createId()},t=yield this.send(e);this.heartbeatIsEnabled=t.MESSAGE_TYPE===Yr.HEARTBEAT_PONG&&t.SOURCE_REF===e.SOURCE_REF}));if(null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableHeartbeat)&&void 0!==t?t:this.heartbeatIsEnabled){const e=null!==(n=null===(r=this.connectOptions)||void 0===r?void 0:r.heartbeatInterval)&&void 0!==n?n:this.heartbeatInterval;this.heartbeatSubscription=Fr(e,e).pipe(jr((()=>this.websocket&&this.isConnected)),(i=()=>this.heartbeatLoggingIsEnabled&&St.debug(`Sending a heartbeat ping every ${e} ms`),l=Ot(i)||a||c?{next:i,error:a,complete:c}:i,l?Xt((function(e,t){var r;null===(r=l.subscribe)||void 0===r||r.call(l);var n=!0;e.subscribe(er(t,(function(e){var r;null===(r=l.next)||void 0===r||r.call(l,e),t.next(e)}),(function(){var e;n=!1,null===(e=l.complete)||void 0===e||e.call(l),t.complete()}),(function(e){var r;n=!1,null===(r=l.error)||void 0===r||r.call(l,e),t.error(e)}),(function(){var e,t;n&&(null===(e=l.unsubscribe)||void 0===e||e.call(l)),null===(t=l.finalize)||void 0===t||t.call(l)})))})):Qt)).subscribe((()=>s()))}var i,a,c,l}reconnect(){var e,t,r,n,s;const i=!(null===(e=this.connectOptions)||void 0===e?void 0:e.alwaysOn)&&!1===(null===(t=this.connectOptions)||void 0===t?void 0:t.enableHeartbeat);if(this.isReconnecting||i)return;this.isReconnecting=!0;const o=(null===(r=this.reconnectOptions)||void 0===r?void 0:r.reconnectStrategy)===hn.Exponential?dn:fn,a=this.isConnectedSubject.asObservable().pipe(Dr((e=>e?Pr(-1):((e,t)=>new Jt((r=>{let n,s=0;return function i(){r.next(s),clearTimeout(n),n=setTimeout(i,t(e,s)),s+=1}(),()=>{clearTimeout(n)}})))(this.reconnectOptions,o).pipe(xr((e=>{var t,r,n;let s;return s=(null===(t=this.connectOptions)||void 0===t?void 0:t.alwaysOn)?e+1:null!==(n=null===(r=this.reconnectOptions)||void 0===r?void 0:r.reconnectAttempts)&&void 0!==n?n:10,e<s?Pr(e):Lr((()=>new Error(`Max reconnect attempts ${s} reached.`)))}))))),jr((()=>this.websocket&&!this.isConnected)));a.subscribe(null!==(s=null===(n=this.reconnectOptions)||void 0===n?void 0:n.reconnectObserver)&&void 0!==s?s:{next:e=>{St.debug(`Attempt no. ${e+1} to reconnect`),this.websocket.complete(),this.connect(this.url,this.connectOptions,this.reconnectOptions)},error:e=>{var t;St.debug(e),null===(t=this.socketSubscription)||void 0===t||t.unsubscribe(),this.isReconnecting=!1},complete:()=>{St.info(this.isConnected?"Reconnected":"Disconnected"),this.isReconnecting=!1,this.wsMessageHandlers.forEach((e=>{e.isSubscription&&this.websocket.next(e.sentMessage)}))}})}reset(){this.isConnected=!1,this.websocket&&this.websocket.complete(),this.websocket=null,this.cleanMessages()}cleanMessages(){this.wsMessages&&this.wsMessages.complete(),this.wsMessages=new pn,this.wsMessageHandlers=new Map}send(e,t=!0){if(!this.isConnected)return void Promise.reject(new Error("WebSocket connection is closed"));const r=`Sending Message for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,St.info,r),new Promise(((r,n)=>{const s=e=>{r(e)},i=e=>{n(e)};t&&this.setMessageHandler(e,s,i),this.websocket.next(e)}))}sendForStream(e,t,r){if(!this.isConnected)return Lr((()=>new Error("WebSocket connection is closed")));if(!this.hasValidSession)return Lr((()=>new Error("WebSocket connection is open but there is no valid/active session, please check your auth flow")));const n=`Sending Message (stream) for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,St.info,n),this.setMessageHandler(e,t,r,!0),this.websocket.next(e),Nr(this.wsMessages.pipe((s=t=>t.SOURCE_REF===e.SOURCE_REF,Xt((function(e,t){var r=0;e.subscribe(er(t,(function(e){return s.call(i,e,r++)&&t.next(e)})))})))));var s,i}setMessageHandler(e,t,r,n=!1){const s=`Setting Message Handler for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;this.logMessageTypeFlow(e.MESSAGE_TYPE,St.debug,s),this.wsMessageHandlers.set(e.SOURCE_REF,new gn(e,t,r,n))}removeMessageHandler(e){this.wsMessageHandlers.delete(e)}getMessageHandler(e,t){const r=`Getting Message Handler for SourceRef: ${e} | MessageType: ${t}`;return this.logMessageTypeFlow(t,St.debug,r),this.wsMessageHandlers.get(e)}logMessageTypeFlow(e,t,r){switch(e){case Yr.HEARTBEAT_PING:case Yr.HEARTBEAT_PONG:this.heartbeatLoggingIsEnabled&&t(r);break;default:this.messageLoggingIsEnabled&&t(r)}}};s([I],vn.prototype,"websocket",void 0),s([I],vn.prototype,"wsMessages",void 0),s([I],vn.prototype,"wsMessageHandlers",void 0),s([I],vn.prototype,"isConnected",void 0),s([I],vn.prototype,"disconnectedByServer",void 0),s([I],vn.prototype,"hasValidSession",void 0),s([I],vn.prototype,"heartbeatIsEnabled",void 0),s([I],vn.prototype,"isReconnecting",void 0),vn=s([i(0,Zr),i(1,$r),i(2,Br),i(3,rt)],vn);const bn=ae.createInterface((e=>e.singleton(vn))),mn={connect:{alwaysOn:!1,enableHeartbeat:!0,enableHeartbeatLogging:!1,heartbeatInterval:1e4,enableMessageLogging:!1},reconnect:{reconnectAttempts:10,reconnectInterval:1e4,reconnectStreams:!0}};let yn=class{get isConnected(){return this.socket.isConnected}get isConnectedSubject(){return this.socket.isConnectedSubject}constructor(e,t,r,n=mn){this.socket=e,this.messageBuilder=t,this.metaCache=r,this.config=n,this.isWorking=!1}httpMode(){return!1}setValidSession(e){this.socket.hasValidSession=e}send(e,t){return this.socket.send(e,t)}connect(e){return o(this,void 0,void 0,(function*(){return this.socket.reset(),_t.test(e)?this.socket.connect(e,this.config.connect,this.config.reconnect):(St.error(`Specified host (${e}) is not valid WebSocket url. Connection will not proceed.`),void St.warn("Make sure the host url starts with wss:// or ws://"))}))}disconnect(){this.socket.reset()}snapshot(e,t){return o(this,void 0,void 0,(function*(){const r=this.messageBuilder.createDataLogonMessage(e,t);return St.debug(`${r.MESSAGE_TYPE} (snapshot) message created -> `,r),this.socket.send(r)}))}stream(e,t,r,n){const s=this.messageBuilder.createDataLogonMessage(e,n);return St.debug(`${s.MESSAGE_TYPE} (stream) message created -> `,s),this.socket.sendForStream(s,t,r)}getMoreRows(e){return o(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMoreRowsMessage(e);return St.debug(`${t.MESSAGE_TYPE} message created -> `,t),this.socket.send(t,!1)}))}dataLogoff(e){return o(this,void 0,void 0,(function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return St.debug(`${t.MESSAGE_TYPE} message created -> `,t),this.socket.send(t)}))}getMetadata(e,t=!0){var r;return o(this,void 0,void 0,(function*(){if(t&&(yield function(e,t=300){const r=n=>{e()?n():setTimeout((()=>r(n)),t)};return new Promise(r)}((()=>!1===this.isWorking)),this.metaCache.hasMetadataFor(e)))return St.debug(`Cached metadata retrieved for ${e}`),this.metaCache.getMetadataFor(e);const n=this.messageBuilder.createMetaRequestMessage(e);let s;St.debug(`${n.MESSAGE_TYPE} (metadata) message created -> `,n);try{this.isWorking=!0;const e=yield this.socket.send(n);s=null!==(r=null==e?void 0:e.DETAILS)&&void 0!==r?r:[]}finally{s&&this.metaCache.setMetadataFor(e,s),this.isWorking=!1}return s}))}getJSONSchema(e){return o(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMetaRequestMessage(e,Kr.JSON_SCHEMA_REQUEST);return St.debug(`${t.MESSAGE_TYPE} (json schema) message created -> `,t),this.socket.send(t)}))}request(e,t){const r=this.messageBuilder.createRequestMessage(e,t);return St.debug(`${r.MESSAGE_TYPE} (request server) message created -> `,r),this.socket.send(r)}commitEvent(e,t){return o(this,void 0,void 0,(function*(){const r=this.messageBuilder.createCommitMessage(e,t);return St.debug(`${r.MESSAGE_TYPE} (commit) message created -> `,r),this.socket.send(r)}))}};s([I],yn.prototype,"isWorking",void 0),s([k],yn.prototype,"isConnected",null),yn=s([i(0,bn),i(1,Zr),i(2,Tt),i(3,ue(Xr))],yn);const wn="true"===rn||!1,Sn=ae.createInterface((e=>e.singleton(yn))),_n=ae.createInterface((e=>wn?e.aliasTo(on):e.aliasTo(Sn)));
|
|
2
|
+
/*! js-cookie v3.0.1 | MIT */
|
|
3
|
+
function En(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var Tn=function e(t,r){function n(e,n,s){if("undefined"!=typeof document){"number"==typeof(s=En({},r,s)).expires&&(s.expires=new Date(Date.now()+864e5*s.expires)),s.expires&&(s.expires=s.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var o in s)s[o]&&(i+="; "+o,!0!==s[o]&&(i+="="+s[o].split(";")[0]));return document.cookie=e+"="+t.write(n,e)+i}}return Object.create({set:n,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],n={},s=0;s<r.length;s++){var i=r[s].split("="),o=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(n[a]=t.read(o,a),e===a)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){n(e,"",En({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,En({},this.attributes,t))},withConverter:function(t){return e(En({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const On=ae.createInterface();function An(){return(null===navigator||void 0===navigator?void 0:navigator.credentials)?"PasswordCredential"in window||(St.warn("PasswordCredential not available in this browser."),!1):(St.warn("CredentialsContainer not available in this browser."),!1)}const Rn={password:!0,mediation:"optional"},Cn={cookie:{path:"/",name:"credentials",expires:7300,storePasswords:!1}};let In=class{constructor(e,t=Cn){this.session=e,this.config=t}createBasicCredentials(e){return{type:Wr.BASIC,username:e.username,password:e.password}}createRefreshCredentials(e){var t,r;return{type:Wr.REFRESH,username:null!==(t=null==e?void 0:e.username)&&void 0!==t?t:this.getUsername(),refreshToken:null!==(r=null==e?void 0:e.refreshToken)&&void 0!==r?r:this.getRefreshToken()}}createSSOCredentials(e){var t;return{type:Wr.SSO,ssoToken:null!==(t=null==e?void 0:e.ssoToken)&&void 0!==t?t:this.getSSOToken()}}validateBasicCredentials(e){return e&&!!e.username&&!!e.password}validateRefreshCredentials(e){return e&&!!e.refreshToken&&!!e.username}validateSSOCredentials(e){return e&&!!e.ssoToken}storeCredentialsInContainer(e){return o(this,void 0,void 0,(function*(){if(!An())return;const t=new PasswordCredential(e);return St.debug("Storing credentials in CredentialsContainer"),navigator.credentials.store(t)}))}getCredentialsFromContainer(e=Rn){return o(this,void 0,void 0,(function*(){if(An())return St.debug("Getting credentials from CredentialsContainer"),yield navigator.credentials.get(e)}))}storeCredentialsInCookie(e){const t=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r}(e,["password"]),r=this.config.cookie.storePasswords?e:t;return St.debug("Storing credentials in cookie"),!!Tn.set(this.config.cookie.name,JSON.stringify(r),{expires:this.config.cookie.expires,domain:location.hostname,path:this.config.cookie.path,secure:!0})}getCredentialsFromCookie(){St.debug("Getting credentials from cookie");const e=Tn.get(this.config.cookie.name);return e?JSON.parse(e):void 0}storeCredentials(e){return o(this,void 0,void 0,(function*(){if(An()){const t=yield this.storeCredentialsInContainer(e);return Promise.resolve(!!t)}return Promise.resolve(this.storeCredentialsInCookie(e))}))}getCredentials(e){return o(this,void 0,void 0,(function*(){return An()?this.getCredentialsFromContainer(e):Promise.resolve(this.getCredentialsFromCookie())}))}getSSOToken(){return this.session.getSessionStorageItem("ssoToken")}getUsername(){return this.session.getSessionStorageItem("username")}getRefreshToken(){return this.session.getSessionStorageItem("refreshToken")}removeCookie(){Tn.remove(this.config.cookie.name,{domain:location.hostname,path:this.config.cookie.path})}removeSSOToken(){this.session.removeSessionStorageItem("ssoToken")}removeUsername(){this.session.removeSessionStorageItem("username")}removeRefreshToken(){this.session.removeSessionStorageItem("refreshToken")}removeAll(){this.removeCookie(),this.removeSSOToken(),this.removeUsername(),this.removeRefreshToken()}preventSilentAccess(){return An()&&navigator.credentials.preventSilentAccess()}};In=s([i(0,$r),i(1,ue(On))],In);const kn=ae.createInterface((e=>e.singleton(In)));class Mn{constructor(e){Object.assign(this,e)}hasAdminProfile(){return this.hasProfile("ADMIN")}hasPermission(e){return this.hasKey(this.permissions,e)}hasProfile(e){return this.hasKey(this.profiles,e)}hasKey(e,t){return!!(e&&e.length&&t)&&(Array.isArray(t)||(t=[t]),t.some((t=>e.includes(t))))}}s([I],Mn.prototype,"permissions",void 0),s([I],Mn.prototype,"profiles",void 0),s([I],Mn.prototype,"username",void 0);let Nn=class{get isLoggedIn(){return!!this.loggedUserResult&&!(!this.loggedUserResult.authToken||!this.loggedUserResult.sessionId)}constructor(e,t,r,n){this.session=e,this.connect=t,this.messageBuilder=r,this.credentialManager=n,this.isWorking=!1,this.loggedUserResult=null,this.currentUser=null}login(e){var t;return o(this,void 0,void 0,(function*(){this.isWorking=!0;try{const r=this.messageBuilder.createLoginMessage(e),n=yield this.connect.send(r);if(!n||n.ERROR||(null===(t=n.DETAILS)||void 0===t?void 0:t.ERROR))throw new Qr(r,n);this.applyAuthResults({authToken:n.SESSION_AUTH_TOKEN,refreshToken:n.REFRESH_AUTH_TOKEN,profiles:n.PROFILE,username:n.USER_NAME,permissions:n.PERMISSION,sessionId:n.SESSION_ID}),this.session.setAuthResult(n),St.debug("Login Authentication Result:",n)}catch(e){if(St.error("Login Authentication Error:",e),!(e instanceof Qr&&e.isIgnorableError()))throw this.removeAuthResults(),e;St.warn("Ignoring authentication error as it is a known edge case.")}finally{this.isWorking=!1}return this.loggedUserResult}))}logout(){var e;return o(this,void 0,void 0,(function*(){this.isWorking=!0;let t={success:!1};try{const r=this.messageBuilder.createLogoutMessage(this.loggedUserResult);this.session.deleteUserFromSessionStorage(),this.connect.setValidSession(!1);const{CODE:n,DETAILS:s,MESSAGE_TYPE:i}=yield this.connect.send(r);t={success:i===Yr.LOGOUT_ACK||n===qr.SESSION_NOT_FOUND,error:null!==(e=null==s?void 0:s.ERROR)&&void 0!==e?e:void 0}}catch(e){const r=new Qr(e.sentMessage,e.receivedMessage);if(St.error("Logout Authentication Error:",r),!r.isIgnorableError())throw e;St.warn("Ignoring authentication error as it is a known edge case."),t.success=!0}finally{this.removeAuthResults(),this.isWorking=!1}return t}))}reAuthFromSession(){return o(this,void 0,void 0,(function*(){const e=this.session.getSessionStorageItem("hostUrl");if(e&&(yield this.connect.connect(e))){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.connect.send(e);if((null==t?void 0:t.MESSAGE_TYPE)===Kr.EVENT_LOGIN_AUTH_ACK)return this.session.setAuthResult(t),this.connect.setValidSession(!0),this.applyAuthResults(this.getLoggedUserFromSession(t)),!0}return this.session.deleteUserFromSessionStorage(),this.connect.setValidSession(!1),!1}))}getLoggedUserFromSession(e){const t=e.USER_NAME,r=e.SESSION_AUTH_TOKEN,n=e.REFRESH_AUTH_TOKEN;return t&&r&&n?{username:t,authToken:r,refreshToken:n,profiles:e.PROFILE,permissions:e.PERMISSION,sessionId:e.SESSION_ID}:null}applyAuthResults(e){e?(this.loggedUserResult={authToken:e.authToken,refreshToken:e.refreshToken,profiles:e.profiles,username:e.username,permissions:e.permissions,sessionId:e.sessionId},this.currentUser=new Mn({permissions:e.permissions,profiles:e.profiles,username:e.username})):this.removeAuthResults()}removeAuthResults(){this.loggedUserResult=null,this.currentUser=null}};s([I],Nn.prototype,"isWorking",void 0),s([I],Nn.prototype,"loggedUserResult",void 0),s([I],Nn.prototype,"currentUser",void 0),s([k],Nn.prototype,"isLoggedIn",null),Nn=s([i(0,$r),i(1,_n),i(2,Zr),i(3,kn)],Nn);const Pn=ae.createInterface((e=>e.singleton(Nn)));function Ln(e,t,r,n){return e?t||r||n?!(!t||!t.includes(e.username))||(!(!r||!r.some((t=>e.profiles.includes(t))))||!!n&&n.some((t=>e.permissions.includes(t)))):(nt.warn("UserTargeting filter parameters must include usernames, profiles, permissions, or all three."),!0):(nt.warn("UserTargeting filter needs a user to filter on."),!0)}e.DefaultUserTargeting=class{constructor(e){this.auth=e}filter(e){return Ln(this.auth.currentUser,null==e?void 0:e.usernames,null==e?void 0:e.profiles,null==e?void 0:e.permissions)}get hasAdminProfile(){return Ln(this.auth.currentUser,void 0,["ADMIN"])}get isLoggedIn(){return this.auth.isLoggedIn}},e.DefaultUserTargeting=s([i(0,Pn)],e.DefaultUserTargeting);const xn=ae.createInterface((t=>t.transient(e.DefaultUserTargeting))),Un={nodeEnv:"nodeEnv",percentage:"percentage",timeWindow:"timeWindow",urlTargeting:"urlTargeting",userAgent:"userAgent",userTargeting:"userTargeting"};function Fn(e,t){switch(e){case Un.nodeEnv:return t.get(ot);case Un.percentage:return t.get(lt);case Un.timeWindow:return t.get(dt);case Un.urlTargeting:return t.get(gt);case Un.userAgent:return t.get(wt);case Un.userTargeting:return t.get(xn)}}function Dn(e,t){return e&&e.length?e.every((e=>{const r=Fn(e.name,t);return!r||r.filter(e.parameters)})):(nt.warn("The client filter runner requires an array of filters to run, received:",e),!0)}class jn{run(e,t=this.container){return Dn(e,t)}}s([ce],jn.prototype,"container",void 0);const Gn=ae.createInterface((e=>e.transient(jn)));e.ClientFilterName=Un,e.ClientFilterRunner=Gn,e.DefaultClientFilterRunner=jn,e.DefaultNodeEnv=it,e.DefaultPercentage=ct,e.DefaultTimeWindow=ht,e.DefaultURLTargeting=pt,e.DefaultUserAgent=yt,e.NodeEnv=ot,e.Percentage=lt,e.TimeWindow=dt,e.URLTargeting=gt,e.UserAgent=wt,e.UserTargeting=xn,e.getFilterByName=Fn,e.logger=nt,e.nodeEnvFilter=st,e.percentageFilter=at,e.runner=Dn,e.timeWindowFilter=ut,e.urlTargetingFilter=ft,e.userAgentFilter=mt,e.userTargetingFilter=Ln,Object.defineProperty(e,"__esModule",{value:!0})}({});
|