@genesislcap/design-system-configurator 14.374.0 → 14.374.2-alpha-2b5362b.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.
Files changed (23) hide show
  1. package/dist/106.106.74b693b4feeeaf483237.js +2 -0
  2. package/dist/{106.e550ededa8c23f362291b35f89a7d619.js.map → 106.108ffe1c0a21c8a151669c62c3841d79.js.map} +1 -1
  3. package/dist/{151.151.0a43fc3e6414436d844f.js → 151.151.61caccc5e7e8f6537134.js} +1 -1
  4. package/dist/{29.29.7e95d12d2aaf21c03e0d.js → 29.29.9df525e2c9cb46dae476.js} +4 -4
  5. package/dist/{347.347.07dc76528ef935608a82.js → 347.347.65dc284fd479b5ed5b5f.js} +1 -1
  6. package/dist/{417.417.b9aa1af5e028e65b7fdc.js → 417.417.8824b95ab8bebce922bc.js} +12 -7
  7. package/dist/417.8a9fe2b525c09518bb2214b312a32811.js.map +1 -0
  8. package/dist/{445.445.75bcad5095c175e4a251.js → 445.445.bf8306c6ef7eb55e7f83.js} +3 -3
  9. package/dist/{72.cf4df3b8552bf588c7de36a87fe52087.js.map → 72.0d3cadee23ad54ddacd7c820ec4061f0.js.map} +1 -1
  10. package/dist/{72.72.29ea929732b78d5de5cc.js → 72.72.6c90cc1f4e931bcb977a.js} +2 -2
  11. package/dist/{75.75.39b7718355b2bfd5d3a5.js → 75.75.614c41d2d128d47b52f9.js} +2 -2
  12. package/dist/969.3d0da2f0846c0462ef14bcfd4f596255.js.map +1 -0
  13. package/dist/{969.969.1e3cc8f2cd0c178eb059.js → 969.969.132f9a5f83bc4be763b7.js} +16 -5
  14. package/dist/{designSystemConfigurator.1f21d7a5e0284e142e88260cb16b6631.js.map → designSystemConfigurator.01c7c04ad39e43333de458e88ea42274.js.map} +1 -1
  15. package/dist/index.html +1 -1
  16. package/dist/{main.8157fc2d1bb633cee3d782ea13df6b0b.js.map → main.a9c603cca27eed6b98f6d46fdfde0446.js.map} +1 -1
  17. package/dist/main.b60d46ada3c514ae7e54.js +2 -0
  18. package/dist/remoteEntry.js +2 -2
  19. package/package.json +13 -13
  20. package/dist/106.106.35cfe541b81eaac47036.js +0 -2
  21. package/dist/417.145fa1c3801452bd5746b628ab30a25f.js.map +0 -1
  22. package/dist/969.f322fa1f3c643f5d5aac2658eabdca4c.js.map +0 -1
  23. package/dist/main.1bcd5c1cd8935c1140c6.js +0 -2
@@ -0,0 +1,2 @@
1
+ (self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[106,792],{2106:(e,s,n)=>{Promise.all([n.e(681),n.e(399),n.e(372),n.e(343),n.e(72)]).then(n.bind(n,38072))}}]);
2
+ //# sourceMappingURL=106.108ffe1c0a21c8a151669c62c3841d79.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"106.106.xxxxxxxxxxxxxxxxxxxx.js","mappings":"wJAAA,+E","sources":["webpack://@genesislcap/design-system-configurator/./src/index.federated.ts"],"sourcesContent":["import('./index');\n"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"106.106.xxxxxxxxxxxxxxxxxxxx.js","mappings":"wJAAA,gF","sources":["webpack://@genesislcap/design-system-configurator/./src/index.federated.ts"],"sourcesContent":["import('./index');\n"],"names":[],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[61,151,204,823],{28745:(t,e,n)=>{n.d(e,{v:()=>o});var r=n(30314);const o=(0,r.createLogger)("foundation-utils")},52945:(t,e,n)=>{n.d(e,{O5:()=>o,fI:()=>a});var r=n(28745);const o=(t,e)=>{var n;let o=document.getElementById(e);if(o)return void r.v.debug(`\n An element with the id of '${e}' already exists and likely has the css rules applied.\n `);const a=null!==(n=document.head)&&void 0!==n?n:document.getElementsByTagName("head")[0];o=document.createElement("style"),o.id=e,a.appendChild(o);if((t.match(/}/g)||[]).length>1)return o.textContent=t,()=>{o&&a.removeChild(o)};{const e=o.sheet.insertRule(t);return()=>{o&&(o.sheet.deleteRule(e),a.removeChild(o))}}};function a(t){const e=[],n=new Set;return function t(r){const o=Array.from(r.querySelectorAll("*"));e.push(...o),o.forEach(e=>{e.shadowRoot&&!n.has(e.shadowRoot)&&(n.add(e.shadowRoot),t(e.shadowRoot))})}(t),e}},55823:(t,e,n)=>{n.d(e,{AQ:()=>d,C6:()=>o,Cg:()=>i,Cl:()=>a,GG:()=>v,Ju:()=>s,N3:()=>h,Qj:()=>u,Tt:()=>c,YH:()=>f,fX:()=>p,gn:()=>w,sH:()=>l,xN:()=>b,zs:()=>y});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=function(){return a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},a.apply(this,arguments)};function c(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function i(t,e,n,r){var o,a=arguments.length,c=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,n,r);else for(var i=t.length-1;i>=0;i--)(o=t[i])&&(c=(a<3?o(c):a>3?o(e,n,c):o(e,n))||c);return a>3&&c&&Object.defineProperty(e,n,c),c}function u(t,e){return function(n,r){e(n,r,t)}}function l(t,e,n,r){return new(n||(n=Promise))(function(o,a){function c(t){try{u(r.next(t))}catch(t){a(t)}}function i(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(c,i)}u((r=r.apply(t,e||[])).next())})}function f(t,e){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=i(0),c.throw=i(1),c.return=i(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function i(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,i[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}Object.create;function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,a=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)c.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return c}function p(t,e,n){if(n||2===arguments.length)for(var r,o=0,a=e.length;o<a;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function h(t){return this instanceof h?(this.v=t,this):new h(t)}function d(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(t,e||[]),a=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",function(t){return function(e){return Promise.resolve(e).then(t,l)}}),r[Symbol.asyncIterator]=function(){return this},r;function c(t,e){o[t]&&(r[t]=function(e){return new Promise(function(n,r){a.push([t,e,n,r])>1||i(t,e)})},e&&(r[t]=e(r[t])))}function i(t,e){try{(n=o[t](e)).value instanceof h?Promise.resolve(n.value.v).then(u,l):f(a[0][2],n)}catch(t){f(a[0][3],t)}var n}function u(t){i("next",t)}function l(t){i("throw",t)}function f(t,e){t(e),a.shift(),a.length&&i(a[0][0],a[0][1])}}function b(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=s(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise(function(r,o){(function(t,e,n,r){Promise.resolve(r).then(function(e){t({value:e,done:n})},e)})(r,o,(e=t[n](e)).done,e.value)})}}}Object.create;function w(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function v(t,e,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(t,n):o?o.value=n:e.set(t,n),n}"function"==typeof SuppressedError&&SuppressedError}}]);
1
+ "use strict";(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[61,151,204,823],{28745:(t,e,n)=>{n.d(e,{v:()=>o});var r=n(63170);const o=(0,r.createLogger)("foundation-utils")},52945:(t,e,n)=>{n.d(e,{O5:()=>o,fI:()=>a});var r=n(28745);const o=(t,e)=>{var n;let o=document.getElementById(e);if(o)return void r.v.debug(`\n An element with the id of '${e}' already exists and likely has the css rules applied.\n `);const a=null!==(n=document.head)&&void 0!==n?n:document.getElementsByTagName("head")[0];o=document.createElement("style"),o.id=e,a.appendChild(o);if((t.match(/}/g)||[]).length>1)return o.textContent=t,()=>{o&&a.removeChild(o)};{const e=o.sheet.insertRule(t);return()=>{o&&(o.sheet.deleteRule(e),a.removeChild(o))}}};function a(t){const e=[],n=new Set;return function t(r){const o=Array.from(r.querySelectorAll("*"));e.push(...o),o.forEach(e=>{e.shadowRoot&&!n.has(e.shadowRoot)&&(n.add(e.shadowRoot),t(e.shadowRoot))})}(t),e}},55823:(t,e,n)=>{n.d(e,{AQ:()=>d,C6:()=>o,Cg:()=>i,Cl:()=>a,GG:()=>v,Ju:()=>s,N3:()=>h,Qj:()=>u,Tt:()=>c,YH:()=>f,fX:()=>p,gn:()=>w,sH:()=>l,xN:()=>b,zs:()=>y});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=function(){return a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},a.apply(this,arguments)};function c(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function i(t,e,n,r){var o,a=arguments.length,c=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,n,r);else for(var i=t.length-1;i>=0;i--)(o=t[i])&&(c=(a<3?o(c):a>3?o(e,n,c):o(e,n))||c);return a>3&&c&&Object.defineProperty(e,n,c),c}function u(t,e){return function(n,r){e(n,r,t)}}function l(t,e,n,r){return new(n||(n=Promise))(function(o,a){function c(t){try{u(r.next(t))}catch(t){a(t)}}function i(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(c,i)}u((r=r.apply(t,e||[])).next())})}function f(t,e){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=i(0),c.throw=i(1),c.return=i(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function i(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,i[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}Object.create;function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,a=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)c.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return c}function p(t,e,n){if(n||2===arguments.length)for(var r,o=0,a=e.length;o<a;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function h(t){return this instanceof h?(this.v=t,this):new h(t)}function d(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(t,e||[]),a=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",function(t){return function(e){return Promise.resolve(e).then(t,l)}}),r[Symbol.asyncIterator]=function(){return this},r;function c(t,e){o[t]&&(r[t]=function(e){return new Promise(function(n,r){a.push([t,e,n,r])>1||i(t,e)})},e&&(r[t]=e(r[t])))}function i(t,e){try{(n=o[t](e)).value instanceof h?Promise.resolve(n.value.v).then(u,l):f(a[0][2],n)}catch(t){f(a[0][3],t)}var n}function u(t){i("next",t)}function l(t){i("throw",t)}function f(t,e){t(e),a.shift(),a.length&&i(a[0][0],a[0][1])}}function b(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=s(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise(function(r,o){(function(t,e,n,r){Promise.resolve(r).then(function(e){t({value:e,done:n})},e)})(r,o,(e=t[n](e)).done,e.value)})}}}Object.create;function w(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function v(t,e,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(t,n):o?o.value=n:e.set(t,n),n}"function"==typeof SuppressedError&&SuppressedError}}]);
2
2
  //# sourceMappingURL=151.df7f6c518aba4dc761325e73decb24ee.js.map
@@ -63,7 +63,7 @@
63
63
  background: ${m.A.Canvas};
64
64
  border-color: ${m.A.CanvasText};
65
65
  }
66
- `));var v=a(40729);const y={"^[\\+]?[(]?[0-9]{3}[)]?[-\\s\\.]?[0-9]{3}[-\\s\\.]?[0-9]{4,6}$":"Invalid phone number. Must match +###-###-######"};var f=a(30314);const x=(0,f.createLogger)("foundation-form"),A=p.html`
66
+ `));var v=a(40729);const y={"^[\\+]?[(]?[0-9]{3}[)]?[-\\s\\.]?[0-9]{3}[-\\s\\.]?[0-9]{4,6}$":"Invalid phone number. Must match +###-###-######"};var f=a(63170);const x=(0,f.createLogger)("foundation-form"),A=p.html`
67
67
  <template>
68
68
  ${(0,p.when)(e=>!1,p.html`
69
69
  <rapid-button class="clipboard-button" @click=${e=>e.copyUISchemaToClipboard()}>
@@ -381,7 +381,7 @@
381
381
  </control-wrapper>
382
382
  </template>
383
383
  `)(e.prefix)}
384
- `,tester:(0,c.Hc7)(3,G),mapper:c.kOB};var U=a(99638);const W=e=>t=>{if(!t||!(0,c.c0N)(t))return!1;const a=t.options;return!(!a||!a[e])},Y=(0,c.Uo6)((0,c.or)(W("allOptionsResourceName"),W("data")),(0,c.or)((0,c.f4S)(e=>(0,c.dfR)(e,"array")),(0,c.f4S)(e=>e.hasOwnProperty("oneOf")&&e.oneOf.some(e=>(0,c.dfR)(e,"array")))));U.MultiselectDatasource;const q={renderer:p.html`
384
+ `,tester:(0,c.Hc7)(3,G),mapper:c.kOB};var U=a(51174);const W=e=>t=>{if(!t||!(0,c.c0N)(t))return!1;const a=t.options;return!(!a||!a[e])},Y=(0,c.Uo6)((0,c.or)(W("allOptionsResourceName"),W("data")),(0,c.or)((0,c.f4S)(e=>(0,c.dfR)(e,"array")),(0,c.f4S)(e=>e.hasOwnProperty("oneOf")&&e.oneOf.some(e=>(0,c.dfR)(e,"array")))));U.MultiselectDatasource;const q={renderer:p.html`
385
385
  ${e=>((e="zero")=>p.html`
386
386
  <template>
387
387
  <control-wrapper
@@ -3341,7 +3341,7 @@
3341
3341
  ${kl}
3342
3342
  ${Rl}
3343
3343
  ${Il}
3344
- `;const Dl=(0,a(82128).U)("zero"),Ol="ag-theme-genesis-rapid-dark",Ll="ag-theme-genesis-rapid-light";class Tl extends ml.cF{constructor(){super(...arguments),this.theme="light"===localStorage.getItem("luminance")?Ll:Ol}connectedCallback(){super.connectedCallback(),g.baseLayerLuminance.subscribe({handleChange:e=>{const t=g.baseLayerLuminance.getValueFor(e.target);this.theme=t===g.StandardLuminance.DarkMode?Ol:Ll}},this.provider)}themeChanged(e,t){(e||t===Ol)&&super.themeChanged(e,t)}set gridOptions(e){var t,a,o,r,i;e.components=Object.assign({[hl.IX.action]:Ks,[hl.IX.actionsMenu]:el,[hl.IX.boolean]:ol,[hl.IX.editable]:Zs,[hl.IX.statusPill]:ul,[hl.IX.select]:dl,[hl.IX.selectEditor]:Bs,[hl.IX.numberEditor]:Vs,[hl.IX.multiselectEditor]:Ns,[hl.IX.dateEditor]:Ls,[hl.IX.stringEditor]:Ys},null!==(t=e.components)&&void 0!==t?t:{});(this.theme===Cl||this.theme===Ml||this.theme===Fl)&&(this.headerHeight=null!==(o=null!==(a=e.headerHeight)&&void 0!==a?a:Al())&&void 0!==o?o:32,this.rowHeight=null!==(i=null!==(r=e.rowHeight)&&void 0!==r?r:Al())&&void 0!==i?i:32),super.gridOptions=e}}(0,i.Cg)([p.observable],Tl.prototype,"provider",void 0);const El=ml.LU,Nl=ml.Z$,Pl={zeroAgEditableRenderer:Qs,zeroAgActionRenderer:$s,zeroAgActionsMenuRenderer:tl,zeroAgBooleanRenderer:rl,zeroAgTextRenderer:sl,zeroAgSelectRenderer:cl,zeroStatusPillRenderer:gl,zeroAgDateEditor:Ts,zeroAgMultiselectEditor:Ps,zeroAgSelectEditor:Hs,zeroAgNumberEditor:Us,zeroAgStringEditor:qs,zeroGridPro:Tl.compose(Object.assign({baseName:"grid-pro",template:Dl,styles:zl,shadowOptions:El},Nl)),register(e,...t){if(e)for(const a in this)"register"!==a&&this[a]().register(e,...t)}};var jl,Bl=a(89812),Hl=a(26052);!function(e){e.STYLES_CHANGED="styles-changed",e.DS_CHANGED="design-system-changed",e.APPLY_CUSTOM_DESIGN="apply-custom-design"}(jl||(jl={}));const Gl={Roboto:va,"Segoe UI":'"Segoe UI", Arial, Helvetica, sans-serif',Monospace:'Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace',"Times New Roman":'Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif',Garamond:'"Palatino Linotype", Palatino, Palladio, "URW Palladio L", "Book Antiqua", Baskerville, "Bookman Old Style", "Bitstream Charter", "Nimbus Roman No9 L", Garamond, "Apple Garamond", "ITC Garamond Narrow", "New Century Schoolbook", "Century Schoolbook", "Century Schoolbook L", Georgia, serif',Georgia:'Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif',Helvetica:'Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif',Verdana:'Candara, "Bitstream Vera Sans", "DejaVu Sans", "Bitstream Vera Sans", "Trebuchet MS", Verdana, "Verdana Ref", sans-serif'},Vl=Gl["Segoe UI"],Ul=p.css`
3344
+ `;const Dl=(0,a(82128).U)("zero"),Ol="ag-theme-genesis-rapid-dark",Ll="ag-theme-genesis-rapid-light";class Tl extends ml.cF{constructor(){super(...arguments),this.theme="light"===localStorage.getItem("luminance")?Ll:Ol}connectedCallback(){super.connectedCallback(),g.baseLayerLuminance.subscribe({handleChange:e=>{const t=g.baseLayerLuminance.getValueFor(e.target);this.theme=t===g.StandardLuminance.DarkMode?Ol:Ll}},this.provider)}themeChanged(e,t){(e||t===Ol)&&super.themeChanged(e,t)}set gridOptions(e){var t,a,o,r,i;e.components=Object.assign({[hl.IX.action]:Ks,[hl.IX.actionsMenu]:el,[hl.IX.boolean]:ol,[hl.IX.editable]:Zs,[hl.IX.statusPill]:ul,[hl.IX.select]:dl,[hl.IX.selectEditor]:Bs,[hl.IX.numberEditor]:Vs,[hl.IX.multiselectEditor]:Ns,[hl.IX.dateEditor]:Ls,[hl.IX.stringEditor]:Ys},null!==(t=e.components)&&void 0!==t?t:{});(this.theme===Cl||this.theme===Ml||this.theme===Fl)&&(this.headerHeight=null!==(o=null!==(a=e.headerHeight)&&void 0!==a?a:Al())&&void 0!==o?o:32,this.rowHeight=null!==(i=null!==(r=e.rowHeight)&&void 0!==r?r:Al())&&void 0!==i?i:32),super.gridOptions=e}}(0,i.Cg)([p.observable],Tl.prototype,"provider",void 0);const El=ml.LU,Nl=ml.Z$,Pl={zeroAgEditableRenderer:Qs,zeroAgActionRenderer:$s,zeroAgActionsMenuRenderer:tl,zeroAgBooleanRenderer:rl,zeroAgTextRenderer:sl,zeroAgSelectRenderer:cl,zeroStatusPillRenderer:gl,zeroAgDateEditor:Ts,zeroAgMultiselectEditor:Ps,zeroAgSelectEditor:Hs,zeroAgNumberEditor:Us,zeroAgStringEditor:qs,zeroGridPro:Tl.compose(Object.assign({baseName:"grid-pro",template:Dl,styles:zl,shadowOptions:El},Nl)),register(e,...t){if(e)for(const a in this)"register"!==a&&this[a]().register(e,...t)}};var jl,Bl=a(50372),Hl=a(80724);!function(e){e.STYLES_CHANGED="styles-changed",e.DS_CHANGED="design-system-changed",e.APPLY_CUSTOM_DESIGN="apply-custom-design"}(jl||(jl={}));const Gl={Roboto:va,"Segoe UI":'"Segoe UI", Arial, Helvetica, sans-serif',Monospace:'Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace',"Times New Roman":'Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif',Garamond:'"Palatino Linotype", Palatino, Palladio, "URW Palladio L", "Book Antiqua", Baskerville, "Bookman Old Style", "Bitstream Charter", "Nimbus Roman No9 L", Garamond, "Apple Garamond", "ITC Garamond Narrow", "New Century Schoolbook", "Century Schoolbook", "Century Schoolbook L", Georgia, serif',Georgia:'Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif',Helvetica:'Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif',Verdana:'Candara, "Bitstream Vera Sans", "DejaVu Sans", "Bitstream Vera Sans", "Trebuchet MS", Verdana, "Verdana Ref", sans-serif'},Vl=Gl["Segoe UI"],Ul=p.css`
3345
3345
  ${(0,u.display)("block")} :host {
3346
3346
  width: 100%;
3347
3347
  display: inline-flex;
@@ -4790,5 +4790,5 @@
4790
4790
  </rapid-tab-panel>
4791
4791
  </rapid-tabs>
4792
4792
  </template>
4793
- `;let jd=class extends p.FASTElement{};jd=(0,i.Cg)([(0,p.customElement)({name:"design-system-preview",template:Pd,styles:Sd})],jd),((e,t="zero")=>(0,U.provideDesignSystem)(e,t,r,o))().register(Ds,Pl),(0,Bl.provideDesignSystem)().register(Bl.baseComponents,Hl.rapidGridComponents,zt)},60416:(e,t,a)=>{a.d(t,{cL:()=>u,jE:()=>p,uP:()=>d,u_:()=>c});var o=a(30314),r=a(52945),i=a(68424);const n=(0,o.createLogger)("foundation-notifications");let s=null;const l=new Map,d=e=>{var t,a;return`${null!==(t=null==e?void 0:e.title)&&void 0!==t?t:"Error"}: ${null!==(a=null==e?void 0:e.body)&&void 0!==a?a:"Something went wrong"}`},c=e=>{var t,a;n.log({message:d(e),level:(t=e,(null==t?void 0:t.logLevel)||(null===(a=null==t?void 0:t.config)||void 0===a?void 0:a.logLevel)||o.LogLevel.Debug)})},p=(e,t)=>{let a=document.querySelector(`#${e}`);if(!a)if(l.has(e))a=l.get(e);else{const t=(0,r.fI)(document).find(t=>t.id===e);t&&(a=t,l.set(e,t))}if(!a){a=document.createElement("div"),a.setAttribute("id",e),a.style.zIndex="9999";const{element:t,prefix:o}=(0,i.DW)(document.body,"rapid");if(t)t.appendChild(a),s=t;else if(s)s.appendChild(a);else{const e=document.createElement(`${o}-design-system-provider`);e.appendChild(a),document.body.appendChild(e),s=e}}return a},u=e=>{for(var t,a;e&&!(e instanceof ShadowRoot);){const o=null===(t=null==e?void 0:e.getRootNode())||void 0===t?void 0:t.getElementById("banner-anchor");if(o)return o.style.position="relative",o;e=null===(a=null==e?void 0:e.getRootNode())||void 0===a?void 0:a.host}return g()},g=()=>{const e=document.createElement("div");return e.setAttribute("id","banner-anchor"),e.style.position="relative",document.body.insertBefore(e,document.body.firstChild),e}},70997:(e,t,a)=>{function o(e,t,a){const o=e=>"function"==typeof e?e:()=>e,r=o(t),i=o(a);return(t,a)=>e(t,a)?r(t,a):i(t,a)}a.d(t,{q:()=>o})},80273:(e,t,a)=>{a.d(t,{Du:()=>l,IT:()=>n,WP:()=>r,f4:()=>s,zz:()=>i});var o=a(52945);const r=(e,t)=>{(0,o.O5)(e,t)};var i,n;!function(e){e.Italic="italic",e.Normal="normal"}(i||(i={})),function(e){e[e.Thin=100]="Thin",e[e.Light=300]="Light",e[e.Regular=400]="Regular",e[e.Medium=500]="Medium",e[e.Bold=700]="Bold",e[e.Black=900]="Black"}(n||(n={}));const s=(e,t=i.Normal,a=n.Regular)=>`\n font-family: ${e};\n font-style: ${t};\n font-weight: ${a};\n`,l={minusOne:-1,minusTwo:-2,plusOne:1,plusTwo:2,plusThree:3,plusFour:4,plusFive:5,plusSix:6}}}]);
4793
+ `;let jd=class extends p.FASTElement{};jd=(0,i.Cg)([(0,p.customElement)({name:"design-system-preview",template:Pd,styles:Sd})],jd),((e,t="zero")=>(0,U.provideDesignSystem)(e,t,r,o))().register(Ds,Pl),(0,Bl.provideDesignSystem)().register(Bl.baseComponents,Hl.rapidGridComponents,zt)},60416:(e,t,a)=>{a.d(t,{cL:()=>u,jE:()=>p,uP:()=>d,u_:()=>c});var o=a(63170),r=a(52945),i=a(68424);const n=(0,o.createLogger)("foundation-notifications");let s=null;const l=new Map,d=e=>{var t,a;return`${null!==(t=null==e?void 0:e.title)&&void 0!==t?t:"Error"}: ${null!==(a=null==e?void 0:e.body)&&void 0!==a?a:"Something went wrong"}`},c=e=>{var t,a;n.log({message:d(e),level:(t=e,(null==t?void 0:t.logLevel)||(null===(a=null==t?void 0:t.config)||void 0===a?void 0:a.logLevel)||o.LogLevel.Debug)})},p=(e,t)=>{let a=document.querySelector(`#${e}`);if(!a)if(l.has(e))a=l.get(e);else{const t=(0,r.fI)(document).find(t=>t.id===e);t&&(a=t,l.set(e,t))}if(!a){a=document.createElement("div"),a.setAttribute("id",e),a.style.zIndex="9999";const{element:t,prefix:o}=(0,i.DW)(document.body,"rapid");if(t)t.appendChild(a),s=t;else if(s)s.appendChild(a);else{const e=document.createElement(`${o}-design-system-provider`);e.appendChild(a),document.body.appendChild(e),s=e}}return a},u=e=>{for(var t,a;e&&!(e instanceof ShadowRoot);){const o=null===(t=null==e?void 0:e.getRootNode())||void 0===t?void 0:t.getElementById("banner-anchor");if(o)return o.style.position="relative",o;e=null===(a=null==e?void 0:e.getRootNode())||void 0===a?void 0:a.host}return g()},g=()=>{const e=document.createElement("div");return e.setAttribute("id","banner-anchor"),e.style.position="relative",document.body.insertBefore(e,document.body.firstChild),e}},70997:(e,t,a)=>{function o(e,t,a){const o=e=>"function"==typeof e?e:()=>e,r=o(t),i=o(a);return(t,a)=>e(t,a)?r(t,a):i(t,a)}a.d(t,{q:()=>o})},80273:(e,t,a)=>{a.d(t,{Du:()=>l,IT:()=>n,WP:()=>r,f4:()=>s,zz:()=>i});var o=a(52945);const r=(e,t)=>{(0,o.O5)(e,t)};var i,n;!function(e){e.Italic="italic",e.Normal="normal"}(i||(i={})),function(e){e[e.Thin=100]="Thin",e[e.Light=300]="Light",e[e.Regular=400]="Regular",e[e.Medium=500]="Medium",e[e.Bold=700]="Bold",e[e.Black=900]="Black"}(n||(n={}));const s=(e,t=i.Normal,a=n.Regular)=>`\n font-family: ${e};\n font-style: ${t};\n font-weight: ${a};\n`,l={minusOne:-1,minusTwo:-2,plusOne:1,plusTwo:2,plusThree:3,plusFour:4,plusFive:5,plusSix:6}}}]);
4794
4794
  //# sourceMappingURL=29.0a1ece57d1b5ca67cd47edb954da1bcc.js.map
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[347],{5709:(e,t,s)=>{s.d(t,{S5:()=>d});var i=s(55823),r=s(92277),n=s(33681),o=s(84674),a=s(97156);class c{constructor(){this.isConfigured=!1,this.isConnecting=!1,this.isConnected=!1,this.isReconnecting=!1,this.reconnectionLimitReached=!1,this.isConnectedSubject=new a.t(this.isConnected)}get hasValidSession(){return this.user.isAuthenticated}get isDisconnected(){return!this.isConnected}get isDisconnectedByServer(){return void 0!==this.closedClean&&!this.closedClean}isConnectedChanged(){var e;this.isConnected&&this.resetClosedState(),this.isConnecting=!1,this.isReconnecting=!1,null===(e=this.isConnectedSubject)||void 0===e||e.next(this.isConnected)}isReconnectingChanged(){this.isReconnecting&&(this.reconnectionLimitReached=!1)}resetClosedState(){this.closedCode=void 0,this.closedReason=void 0,this.closedClean=void 0}serialize(){return{isConfigured:this.isConfigured,isConnecting:this.isConnecting,isConnected:this.isConnected,isDisconnected:this.isDisconnected,isDisconnectedByServer:this.isDisconnectedByServer,isReconnecting:this.isReconnecting,reconnectionLimitReached:this.reconnectionLimitReached,hasValidSession:this.hasValidSession,closedCode:this.closedCode,closedReason:this.closedReason,closedClean:this.closedClean}}onClose(e){this.isConnected=!1,this.closedCode=e.code,this.closedReason=e.reason,this.closedClean=e.wasClean}}(0,i.Cg)([n.observable],c.prototype,"isConfigured",void 0),(0,i.Cg)([n.observable],c.prototype,"isConnecting",void 0),(0,i.Cg)([n.observable],c.prototype,"isConnected",void 0),(0,i.Cg)([n.observable],c.prototype,"isReconnecting",void 0),(0,i.Cg)([n.observable],c.prototype,"reconnectionLimitReached",void 0),(0,i.Cg)([n.observable],c.prototype,"closedCode",void 0),(0,i.Cg)([n.observable],c.prototype,"closedReason",void 0),(0,i.Cg)([n.observable],c.prototype,"closedClean",void 0),(0,i.Cg)([r.KJ],c.prototype,"user",void 0);const d=o.DI.createInterface(e=>e.singleton(c))},6884:(e,t,s)=>{s.d(t,{aB:()=>c,OD:()=>o});var i=s(84674);function r(e,t){const s=new Date(e),i=s.getUTCFullYear(),r=String(s.getUTCMonth()+1).padStart(2,"0"),n=String(s.getUTCDate()).padStart(2,"0");if(t)return`${i}${r}${n}`;return`${i}${r}${n}-${String(s.getUTCHours()).padStart(2,"0")}:${String(s.getUTCMinutes()).padStart(2,"0")}`}var n=s(34193);class o{}o.MAX_ROWS_250=250,o.MAX_VIEW_1000=1e3,o.REQ_REP_POLLING_INTERVAL_MS=1e4,o.DATASERVER_ROW_ID="ROW_REF",o.REQUEST_SERVER_ROW_ID="RECORD_ID",o.DEFAULT_PAGINATION_PAGE_SIZE=25,o.DEFAULT_REQ_REP_OFFSET=0;const a={options:{criteria:"",isSnapshot:!1,maxRows:o.MAX_ROWS_250,maxView:o.MAX_VIEW_1000,pollingInterval:o.REQ_REP_POLLING_INTERVAL_MS,movingView:!1,orderBy:"",resourceName:"",reverse:!1,pollTriggerEvents:[]},criteriaToFields:function(e){if(!e)return{};const t=e.split("&&").map(e=>e.trim()),s={};return t.forEach(e=>{if(e)if(e.startsWith("Expr"))!function(e,t){const s=e.match(/Expr\.(\w+)\(/);if(s)switch(s[1]){case"dateIsToday":{const s=/Expr\.dateIsToday\((\w+)\)/,i=e.match(s);if(i){const[,e]=i,s=new Date;t[`${e}_FROM`]=`${s.toISOString().replace(/-/g,"").split("T")[0]}-00:00`,s.setDate(s.getDate()+1),t[`${e}_TO`]=`${s.toISOString().replace(/-/g,"").split("T")[0]}-00:00`}break}case"dateTimeIsGreaterEqual":{const s=/Expr\.dateTimeIsGreaterEqual\((\w+), ?['"](.+)['"]\)/,i=e.match(s);if(i){const[,e,s]=i;t[`${e}_FROM`]=s}break}case"dateTimeIsLessEqual":{const s=/Expr\.dateTimeIsLessEqual\((\w+), ?['"](.+)['"]\)/,i=e.match(s);if(i){const[,e,s]=i;t[`${e}_TO`]=s}break}case"dateIsGreaterEqual":{const s=/Expr\.dateIsGreaterEqual\((\w+), ?['"](.+)['"]\)/,i=e.match(s);if(i){const[,e,s]=i;t[`${e}_FROM`]=s}break}case"dateIsLessEqual":{const s=/Expr\.dateIsLessEqual\((\w+), ?['"](.+)['"]\)/,i=e.match(s);if(i){const[,e,s]=i;t[`${e}_TO`]=s}break}case"containsIgnoreCase":{const s=/Expr\.containsIgnoreCase\((\w+), ?['"](.+)['"]\)/,i=e.match(s);if(i){const[,e,s]=i;t[e]=`*${s}*`}break}}}(e,s);else if(/[A-Z_]+\s*(>=|<=)\s*\d+/.test(e)){const t=e.match(/([A-Z_]+)\s*>=\s*(\d+)/);if(t){const[,e,i]=t,n=parseInt(i,10),o=e.toUpperCase(),a=o.includes("DATE")&&!o.includes("DATETIME");s[`${e}_FROM`]=r(n,a)}const i=e.match(/([A-Z_]+)\s*<=\s*(\d+)/);if(i){const[,e,t]=i,n=parseInt(t,10),o=e.toUpperCase(),a=o.includes("DATE")&&!o.includes("DATETIME");s[`${e}_TO`]=r(n,a)}}else!function(e,t){const s=e.substr(0,e.indexOf("=")).trim().replace(/["']/g,""),i=e.substr(e.lastIndexOf("=")+1,e.length).trim().replace(/["']/g,"");t[s]=i}(e,s)}),s},dataServerResultFilter:n.d},c=i.DI.createInterface(e=>e.instance(a))},9033:(e,t,s)=>{s.d(t,{yW:()=>M});var i=s(55823),r=s(33681),n=s(84674),o=s(50049),a=s(8790),c=s(1762),d=s(51046),h=s(66640),l=s(84190),u=s(65052),E=s(40113),g=s(26347),S=s(24669),v=s(48707),R=s(17465),m=s(79780);const T={throwWhenUnavailable:!0,throwWhenUnknown:!1},p=n.DI.createInterface(e=>e.instance(T)),_=(0,m.Es)("genesis-resources");let A=class{constructor(e,t){this.connect=e,this.config=t}isValidResource(e){return(0,i.sH)(this,void 0,void 0,function*(){if(!(e=null==e?void 0:e.trim()))return!1;yield this.fetchResources();return!!this.resources.find(t=>t.RESOURCE_NAME===e)})}getResourceTypeFor(e){return(0,i.sH)(this,void 0,void 0,function*(){yield this.fetchResources();const t=this.resources.find(t=>t.RESOURCE_NAME===e);if(t)return t.RESOURCE_TYPE;const s=`${e} resource does not exist.`;if(R.v.error(s),this.config.throwWhenUnknown)throw new Error(s)})}getAllResources(){return(0,i.sH)(this,void 0,void 0,function*(){return this.resources||(yield this.fetchResources()),this.resources})}destroy(){this.resources=void 0,this.resourcesPromise=void 0}fetchResources(){return(0,i.sH)(this,void 0,void 0,function*(){var e;if(this.resources)return Promise.resolve();if(this.resourcesPromise)yield this.resourcesPromise;else{this.resourcesPromise=this.connect.getAvailableResources();const t=yield this.resourcesPromise;if(this.resources=null==t?void 0:t.RESOURCES,!(null===(e=this.resources)||void 0===e?void 0:e.length)){const e="Genesis resources unavailable.";if(R.v.error(e),this.config.throwWhenUnavailable)throw new Error(e)}this.postLoadedMessage(),this.resourcesPromise=void 0}})}postLoadedMessage(){const e=n.DI.getOrCreateDOMContainer().get(_);e.postMessage("resources-loaded",this.resources),e.close()}};A=(0,i.Cg)([(0,i.Qj)(0,g.dm),(0,i.Qj)(1,p)],A);const O=n.DI.createInterface(e=>e.singleton(A));var f=s(6884),I=s(39087);let C=class{get initialized(){var e;return!!(null===(e=this.status)||void 0===e?void 0:e.isInitialized)}constructor(e,t,s,i,r){this.connect=e,this.auth=t,this.resources=s,this.config=i,this.connectEvents=r,this.fetchMetadataRequired=!0,this.startStreamRequired=!0,this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.customRequestFields=[],this.availableIndexes=[],this.criteriaOnlyRequest=!1,this.loadMoreCount=0,this.readOnly=!0,this._allParams=null,this.pollTrigger$=new o.B}triggerPoll(){this.pollTrigger$.next()}validResourceName(e){return R.v.deprecated("Datasource.validResourceName","Use `GenesisResources.isValidResource` instead."),!!e&&!!e.trim().length}init(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=this.fetchMetadataRequired,s=this.startStreamRequired){this.fetchMetadataRequired=t,this.options=Object.assign(Object.assign({},this.config.options),e),this.invalidateCache();const i=this.options.resourceName;if(!(this.connect.isConnected||(yield this.connect.connect())))return R.v.error(`Unable to connect to ${this.connect.host} to get ${i} datasource`),this.reportStatus(),!1;return(yield this.resources.isValidResource(i))?(this.resourceType=yield this.resources.getResourceTypeFor(i),this.resourceType?(this.fetchMetadataRequired&&(yield this.fetchAndApplyMetadata(this.options.resourceName),this._allParams=null),R.v.debug(`Initializing ${i} datasource from ${this.connect.host}`),!this.options.isSnapshot&&s&&(this.stream=yield this.createStream()),R.v.debug(`${i} datasource initialization ${this.initialized?"was successful.":"has failed."}`),this.reportStatus(),this.initialized):(R.v.error(`Unable to get the resource type for ${i} datasource from ${this.connect.host}`),this.reportStatus(),!1)):(R.v.error(`${i} datasource does not exist on ${this.connect.host}`),this.reportStatus(),!1)})}startStream(){return(0,i.sH)(this,void 0,void 0,function*(){this.options.isSnapshot||void 0!==this.stream||(this.stream=yield this.createStream())})}destroy(){var e,t;R.v.debug("Datasource.destroy",null===(e=this.options)||void 0===e?void 0:e.resourceName),this.commitResponseUnsubscribe&&(this.commitResponseUnsubscribe(),this.commitResponseUnsubscribe=void 0),null===(t=this.pollTrigger$)||void 0===t||t.complete(),this.status=void 0,this.fetchMetadataRequired=!0,this.options={},this.resourceType=void 0,this.availableIndexes=[],this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.criteriaOnlyRequest=!1,this.loadMoreCount=0,this.stream=void 0}get allResourceParams(){var e;if(this._allParams)return this._allParams;let t;if(this.options.orderBy)if(this.criteriaOnlyRequest||(null===(e=this.availableIndexes)||void 0===e?void 0:e.findIndex(e=>e.NAME===this.options.orderBy))>-1)t=this.options.orderBy;else{const e=this.availableIndexes.map(e=>e.NAME);R.v.warn("Specified [orderBy] index is not valid and will not be used. See https://learn.genesis.global/docs/database/data-types/index-entities/ - Available indexes:",e)}return this._allParams={CRITERIA_MATCH:this.options.criteria,MAX_ROWS:this.options.maxRows,ORDER_BY:t,VIEW_NUMBER:this.options.viewNumber,FIELDS:this.options.fields,MAX_VIEW:this.options.maxView,MOVING_VIEW:this.options.movingView,REVERSE:this.options.reverse,DISABLE_POLLING:this.options.disablePolling,OFFSET:this.options.offset,POLLING_INTERVAL:this.options.pollingInterval,REQUEST:this.options.request},R.v.debug("Getting configured params:",this._allParams),this._allParams}get dataserverOnlyParams(){return{CRITERIA_MATCH:this.allResourceParams.CRITERIA_MATCH,MAX_ROWS:this.allResourceParams.MAX_ROWS,VIEW_NUMBER:this.allResourceParams.VIEW_NUMBER,FIELDS:this.allResourceParams.FIELDS,MAX_VIEW:this.allResourceParams.MAX_VIEW,MOVING_VIEW:this.allResourceParams.MOVING_VIEW,ORDER_BY:this.allResourceParams.ORDER_BY,REVERSE:this.allResourceParams.REVERSE}}get requestOnlyParams(){const e=this.allResourceParams,{REQUEST:t}=e,s=(0,i.Tt)(e,["REQUEST"]);return{DETAILS:{CRITERIA_MATCH:this.options.requestAutoSetup?void 0:s.CRITERIA_MATCH,MAX_ROWS:s.MAX_ROWS,OFFSET:s.OFFSET,ORDER_BY:s.ORDER_BY,VIEW_NUMBER:s.VIEW_NUMBER},REQUEST:this.criteriaOnlyRequest?{}:null!=t?t:this.buildRequestFields()}}buildRequestFields(){if(!this.options.requestAutoSetup)return{};const e=Object.assign({},Object.fromEntries(this.requestFields.map(e=>[e.NAME,"*"]))),t=this.options.criteria?this.config.criteriaToFields(this.options.criteria):{};return Object.assign(Object.assign({},e),t)}updateLoadMoreCount(e){this.loadMoreCount=e}snapshot(e){return(0,i.sH)(this,void 0,void 0,function*(){switch(R.v.debug(`Requesting snapshot for ${this.options.resourceName} (${this.resourceType}).`),this.resourceType){case I.v.DATASERVER:return this.connect.snapshot(this.options.resourceName,Object.assign(Object.assign({},this.dataserverOnlyParams),e));case I.v.REQUEST_SERVER:return this.connect.request(this.options.resourceName,Object.assign(Object.assign({},this.requestOnlyParams),e));default:throw new Error(`Snapshot not supported for selected resource type: ${this.resourceType}`)}})}snapshotFiltered(){return(0,i.sH)(this,arguments,void 0,function*(e="ROW_REF"){const t=yield this.snapshot();return Array.isArray(t)?t:t.REPLY?t.REPLY:t.ROW?this.config.dataServerResultFilter(t,e).inserts:void 0})}createStream(){return(0,i.sH)(this,void 0,void 0,function*(){if(![I.v.DATASERVER,I.v.REQUEST_SERVER].includes(this.resourceType))throw new Error(`Streaming not supported for selected resource type: ${this.resourceType}`);return this.resourceType===I.v.DATASERVER?this.createDataserverStream():(R.v.debug(`Creating fake stream by polling ${this.options.resourceName} REQUEST_SERVER`),this.createReqRepStream())})}createDataserverStream(){return(0,i.sH)(this,void 0,void 0,function*(){return this.connect.stream(this.options.resourceName,e=>{},e=>R.v.error(e),this.dataserverOnlyParams)})}createReqRepStream(){this.commitResponseUnsubscribe=this.connectEvents.addCommitResponseListener(e=>{var t;const{eventName:s,response:i}=e.detail;this.options.pollTriggerEvents&&this.options.pollTriggerEvents.includes(s)&&(null===(t=i.MESSAGE_TYPE)||void 0===t?void 0:t.endsWith("_ACK"))&&(R.v.debug(`Received commit response for ${s}, triggering poll.`),this.triggerPoll())});const e=this.allResourceParams.DISABLE_POLLING?void 0:this.allResourceParams.POLLING_INTERVAL,t=()=>{const e=this.requestOnlyParams;if(this.resourceType===I.v.REQUEST_SERVER&&this.loadMoreCount>0){const t=25,s=(this.options.maxRows||t)*(this.loadMoreCount+1);e.DETAILS.MAX_ROWS=s}return(0,a.z)([this.connect.isConnected$,this.auth.isLoggedIn$]).pipe((0,h.v)(()=>this.connect.isConnected&&this.auth.isLoggedIn),(0,l.n)(()=>(0,c.H)(this.snapshot(e))))};return e?this.pollTrigger$.pipe((0,u.Z)(0),(0,l.n)(()=>(0,d.O)(0,e).pipe((0,l.n)(t)))):this.pollTrigger$.pipe((0,u.Z)(0),(0,l.n)(t))}fetchAndApplyMetadata(e){return(0,i.sH)(this,void 0,void 0,function*(){var t,s;try{R.v.debug(`Requesting metadata for ${this.options.resourceName} Datasource`);const e=yield this.connect.getMetadata(this.options.resourceName);e&&(this.availableIndexes=null!==(t=e.INDEXES)&&void 0!==t?t:[],this.originalFieldDef=(0,v.a)(e),this.fieldMetadata=(0,v.X)(this.originalFieldDef),this.requestFields=e.REQUEST_FIELD||[],this.customRequestFields=e.FIELD||[],this.criteriaOnlyRequest=e.CRITERIA_ONLY_REQUEST||!1,this.fetchMetadataRequired=!1),this.status=this.normaliseStatus({isInitialized:!0,metadataRequired:!0,hasMetadata:(null===(s=this.fieldMetadata)||void 0===s?void 0:s.length)>0})}catch(t){R.v.error(`Metadata Fetch failed for ${e}:`,t),this.status=this.normaliseStatus({isInitialized:!1,metadataRequired:!0,hasMetadata:!1})}})}reportStatus(e={}){var t;const s=null!==(t=this.config.eventEmitter)&&void 0!==t?t:document;this.status=this.normaliseStatus(e),R.v.debug(`Dispatching '${I.w}'`,this.status),null==s||s.dispatchEvent(new CustomEvent(I.w,{detail:this.status,bubbles:s!==document,composed:!0}))}normaliseStatus(e){var t,s,i,r,n;const o=null!==(t=e.isInitialized)&&void 0!==t?t:this.initialized,a=null!==(s=e.metadataRequired)&&void 0!==s?s:this.fetchMetadataRequired,c=null!==(i=e.hasMetadata)&&void 0!==i?i:(null===(r=this.fieldMetadata)||void 0===r?void 0:r.length)>0;return{name:null===(n=this.options)||void 0===n?void 0:n.resourceName,type:this.resourceType,isInitialized:o,metadataRequired:a,hasMetadata:c}}invalidateCache(){this._allParams=null}};(0,i.Cg)([r.observable],C.prototype,"status",void 0),(0,i.Cg)([r.observable],C.prototype,"fetchMetadataRequired",void 0),(0,i.Cg)([r.observable],C.prototype,"startStreamRequired",void 0),(0,i.Cg)([r.observable],C.prototype,"originalFieldDef",void 0),(0,i.Cg)([r.observable],C.prototype,"fieldMetadata",void 0),(0,i.Cg)([r.observable],C.prototype,"requestFields",void 0),(0,i.Cg)([r.observable],C.prototype,"customRequestFields",void 0),(0,i.Cg)([r.observable],C.prototype,"availableIndexes",void 0),(0,i.Cg)([r.observable],C.prototype,"criteriaOnlyRequest",void 0),(0,i.Cg)([r.observable],C.prototype,"loadMoreCount",void 0),(0,i.Cg)([r.observable],C.prototype,"readOnly",void 0),(0,i.Cg)([r.observable],C.prototype,"stream",void 0),C=(0,i.Cg)([(0,i.Qj)(0,g.dm),(0,i.Qj)(1,E.N),(0,i.Qj)(2,O),(0,i.Qj)(3,f.aB),(0,i.Qj)(4,S.a4)],C);const M=n.DI.createInterface(e=>e.transient(C))},12066:(e,t,s)=>{s.d(t,{CL:()=>r,Ey:()=>a,zT:()=>o});const i=10;function r(e){return!e||isNaN(e)?null:new Date(e).toISOString().slice(0,i)}const n=19;function o(e){return!e||isNaN(e)?null:new Date(e).toISOString().slice(0,n).replace("T"," ")}function a(e,t){return t?o(e):r(e)}},16183:(e,t,s)=>{s.d(t,{$G:()=>h,Z8:()=>l,vE:()=>d});var i=s(55823),r=s(84686),n=s(84674),o=s(32748);const a="reauthActionLock",c=3e4;var d;function h(){return(0,i.sH)(this,arguments,void 0,function*(e={}){const{reloadOnFailure:t=!0}=e;if(function(){const e=parseInt(localStorage.getItem(a)||"0");Date.now()-e>c&&localStorage.removeItem(a)}(),localStorage.getItem(a)||(localStorage.setItem(a,Date.now().toString()),0))return d.HANDLED_BY_OTHER_TAB;try{if(yield function(){return(0,i.sH)(this,void 0,void 0,function*(){const e=yield fetch(r.Be,{credentials:"include"});return"EVENT_LOGIN_DETAILS_ACK"===(yield e.json()).MESSAGE_TYPE})}())return d.ALREADY_VALID;return(yield function(){return(0,i.sH)(this,void 0,void 0,function*(){const e=n.DI.getOrCreateDOMContainer().get(o.l);return"EVENT_LOGIN_AUTH_ACK"===(yield e.post(r.aW,{body:JSON.stringify({DETAILS:{},MESSAGE_TYPE:"EVENT_LOGIN_AUTH"})})).MESSAGE_TYPE})}())?d.SUCCESS:(t&&window.location.reload(),d.FAILED)}finally{localStorage.removeItem(a)}})}function l(e){const t=s=>{s.key===a&&null===s.newValue&&(e(),window.removeEventListener("storage",t))};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)}!function(e){e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.HANDLED_BY_OTHER_TAB="HANDLED_BY_OTHER_TAB",e.ALREADY_VALID="ALREADY_VALID"}(d||(d={}))},17190:(e,t,s)=>{s.d(t,{j:()=>r,r:()=>i});const i=()=>{let e=[];return{subscribe:t=>(e.push(t),()=>e=e.filter(e=>e!==t)),publish(t){e.forEach(e=>e(t))}}},r=(e,t)=>{const s={root:document.documentElement};new IntersectionObserver(e=>{e.forEach(e=>{t(e.intersectionRatio>0)})},s).observe(e)}},17465:(e,t,s)=>{s.d(t,{v:()=>r});var i=s(30314);const r=(0,i.createLogger)("foundation-comms")},21281:(e,t,s)=>{s.d(t,{Go:()=>i,Gp:()=>r,lT:()=>E,x6:()=>n,z2:()=>l});var i,r,n,o=s(55823),a=s(32808),c=s(84674),d=s(56653),h=s(98316);!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.MORE_COLUMNS="MORE_COLUMNS",e.MORE_COLUMNS_ACK="MORE_COLUMNS_ACK",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"}(i||(i={})),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.RESOURCES_REQUEST_ACK="RESOURCES_REQUEST_ACK",e.RESOURCES_REQUEST_NACK="RESOURCES_REQUEST_NACK",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"}(r||(r={})),function(e){e.SESSION_NOT_FOUND="SESSION_NOT_FOUND",e.UNKNOWN_MESSAGE_TYPE="UNKNOWN_MESSAGE_TYPE"}(n||(n={}));const l=(e,t)=>!!Array.isArray(null==e?void 0:e.ERROR)&&(null==e?void 0:e.ERROR.some(e=>{var s,i;return(null===(s=e.CODE)||void 0===s?void 0:s.includes(`${t}`))||(null===(i=e.STATUS_CODE)||void 0===i?void 0:i.includes(`${t}`))}));let u=class{constructor(e,t){this.session=e,this.uuid=t}createLoginMessage(e){let t;switch(e.type){case d.h.BASIC:t={USER_NAME:e.username,PASSWORD:e.password,MFA_CODE:e.mfaToken};break;case d.h.REFRESH:t={USER_NAME:e.username,REFRESH_AUTH_TOKEN:e.refreshToken,MFA_CODE:e.mfaToken};break;case d.h.SSO:t={SSO_TOKEN:e.ssoToken};break;case d.h.JWT:t={JWT:e.jwt,DOMAIN:e.domain}}return{DETAILS:t,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_LOGIN_AUTH}}createLogoutMessage(e){var t,s;return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_LOGOUT,SESSION_AUTH_TOKEN:null!==(t=e.authToken)&&void 0!==t?t:this.session.getSessionStorageItem("authToken"),SESSION_ID:null!==(s=e.sessionId)&&void 0!==s?s:this.session.getSessionStorageItem("sessionId")}}createDataLogonMessage(e,t){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.DATA_LOGON,DETAILS:Object.assign({DATASOURCE_NAME:e},t),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createDataLogoffMessage(e){return{SOURCE_REF:e,MESSAGE_TYPE:r.DATA_LOGOFF,SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createRequestMessage(e,t){return Object.assign({SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:e.startsWith("REQ_")?e:`REQ_${e}`},t)}createResourcesMessage(e){return Object.assign({SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:r.RESOURCES_REQUEST},e)}createMetaRequestMessage(e,t=r.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(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:e},t)}createRefreshTokenMessage(){return{SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:r.EVENT_LOGIN_AUTH,DETAILS:{REFRESH_AUTH_TOKEN:this.session.getSessionStorageItem("refreshToken"),MFA_CODE:this.session.getSessionStorageItem("mfaToken")}}}createChangePasswordMessage(e,t,s){return{USER_NAME:e,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_CHANGE_USER_PASSWORD,DETAILS:{OLD_PASSWORD:t,NEW_PASSWORD:s}}}createForgotPasswordMessage(e,t,s=e){return{USER_NAME:s,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_SELF_SERVICE_PASSWORD_RESET,DETAILS:{USER_NAME:e,RETURN_URL:t}}}createForgotPasswordTokenMessage(e,t,s,i=e){return{USER_NAME:i,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_PASSWORD_RESET_ACTION,DETAILS:{USER_NAME:e,RESET_TOKEN:t,NEW_PASSWORD:s}}}createMoreRowsMessage(e,t){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:i.MORE_ROWS,DETAILS:{SOURCE_REF:e,VIEW_NUMBER:t},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createMoreColumnsMessage(e){return Object.assign(Object.assign({},this.createMoreRowsMessage(e)),{MESSAGE_TYPE:i.MORE_COLUMNS})}createHTTPHeadersFromMessage(e,t="application/json; charset=UTF-8"){const s={"Content-type":t};return e.SOURCE_REF&&(s["source-ref"]=e.SOURCE_REF,s.SOURCE_REF=e.SOURCE_REF),e.SESSION_AUTH_TOKEN&&(s["SESSION-AUTH-TOKEN"]=e.SESSION_AUTH_TOKEN),e.MESSAGE_TYPE===r.EVENT_LOGOUT&&(s["SESSION-ID"]=e.SESSION_ID),s}createHeartbeatPingMessage(e=!1){return{MESSAGE_TYPE:i.HEARTBEAT_PING,SOURCE_REF:this.uuid.createId(),VERBOSE:e,DETAILS:{},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}};u=(0,o.Cg)([(0,o.Qj)(0,h.N),(0,o.Qj)(1,a.k)],u);const E=c.DI.createInterface(e=>e.singleton(u))},24669:(e,t,s)=>{s.d(t,{EQ:()=>a,a4:()=>o});var i=s(17190),r=s(84674);class n{constructor(){this.streamListeners=(0,i.r)(),this.streamCompleteListeners=(0,i.r)(),this.streamErrorListeners=(0,i.r)(),this.commitListeners=(0,i.r)(),this.metadataListeners=(0,i.r)(),this.commitResponseListeners=(0,i.r)()}addStreamListener(e,t,s){var i,r,n;const o=null===(i=this.streamListeners)||void 0===i?void 0:i.subscribe(e),a=null===(r=this.streamCompleteListeners)||void 0===r?void 0:r.subscribe(t),c=null===(n=this.streamErrorListeners)||void 0===n?void 0:n.subscribe(s);return()=>{o(),a(),c()}}onStreamEvent(e,t,s,i){var r;null===(r=this.streamListeners)||void 0===r||r.publish(new CustomEvent("connect-stream-event",{detail:{functions:i,message:t,resourceName:e,stream:s}}))}onStreamErrorEvent(e,t,s){var i;null===(i=this.streamErrorListeners)||void 0===i||i.publish(new CustomEvent("connect-stream-error-event",{detail:{resourceName:e,stream:t,error:s}}))}onStreamCompleteEvent(e,t){var s;null===(s=this.streamCompleteListeners)||void 0===s||s.publish(new CustomEvent("connect-stream-complete-event",{detail:{resourceName:e,stream:t}}))}addCommitListener(e){var t;return null===(t=this.commitListeners)||void 0===t?void 0:t.subscribe(e)}onCommitEvent(e,t){var s;null===(s=this.commitListeners)||void 0===s||s.publish(new CustomEvent("connect-commit-event",{detail:{eventName:e,message:t}}))}addMetadataListener(e){var t;return null===(t=this.metadataListeners)||void 0===t?void 0:t.subscribe(e)}onMetadataEvent(e,t,s){var i;null===(i=this.metadataListeners)||void 0===i||i.publish(new CustomEvent("connect-metadata-event",{detail:{resourceName:e,message:t,error:s}}))}addCommitResponseListener(e){var t;return null===(t=this.commitResponseListeners)||void 0===t?void 0:t.subscribe(e)}onCommitResponseEvent(e,t){var s;null===(s=this.commitResponseListeners)||void 0===s||s.publish(new CustomEvent("connect-commit-response-event",{detail:{eventName:e,response:t}}))}}const o=r.DI.createInterface(e=>e.singleton(n)),a=r.DI.createInterface(e=>e.aliasTo(o))},26347:(e,t,s)=>{s.d(t,{dm:()=>$,tn:()=>B});var i=s(55823),r=s(84686),n=s(77679),o=s(33681),a=s(84674),c=s(77909);class d{constructor(){this.cachedMetadata=new Map,this.cachedJsonSchema=new Map}getMetadataFor(e){return this.cachedMetadata.get(e)}getJsonSchemaFor(e){return this.cachedJsonSchema.get(e)}hasMetadataFor(e){return this.cachedMetadata.has(e)}hasJsonSchemaFor(e){return this.cachedJsonSchema.has(e)}setMetadataFor(e,t){this.cachedMetadata.set(e,t)}setJsonSchemaFor(e,t){this.cachedJsonSchema.set(e,t)}}const h=a.DI.createInterface(e=>e.singleton(d));var l=s(17465),u=s(24669),E=s(49587),g=s(49229),S=s(13160),v=s(97156),R=s(7827),m=s(1762),T=s(53940),p=s(84190),_=s(78213),A=s(66640),O=s(36090),f=s(51046),I=s(16220),C=s(98316),M=s(32748);const b={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},{})},N=a.DI.createInterface(e=>e.instance(b));var L=s(21281),U=s(16183);const y=(e,t)=>((null==t?void 0:t.ROW)&&e&&e.length>0?t.ROW.forEach(t=>{const s=t;if(s&&s.DETAILS){const i=s.DETAILS.ROW_REF,r=s.DETAILS.OPERATION;"INSERT"===r&&(e.find(e=>{var t;return(null===(t=e.DETAILS)||void 0===t?void 0:t.ROW_REF)===i})||e.unshift(s)),"DELETE"===r&&(e=e.filter(e=>{var s,i;return(null===(s=t.DETAILS)||void 0===s?void 0:s.ROW_REF)!==(null===(i=e.DETAILS)||void 0===i?void 0:i.ROW_REF)})),"MODIFY"===r&&(e=e.map(e=>{var t;return(null===(t=e.DETAILS)||void 0===t?void 0:t.ROW_REF)===i?Object.assign(Object.assign({},e),s):e}))}}):!t||e&&0!==e.length||(e=[...new Set(t.ROW)]),e);var D;let P=D=class{get isConnected(){return this._isConnected}set isConnected(e){this._isConnected=e,this.isConnectedSubject.next(this._isConnected)}constructor(e,t,s,i,r,n){var o;this.http=e,this.messageBuilder=t,this.session=s,this.metaCache=i,this.serializer=r,this.config=n,this.isWorking=!1,this._isConnected=!1,this.isConnectedSubject=new v.t(this._isConnected),this.isConnected$=null===(o=this.isConnectedSubject)||void 0===o?void 0:o.asObservable(),this.ongoingTurbo={},this.streams=new Map,this.ongoingRefresh=null}handleSessionRefresh(){return this.ongoingRefresh||(this.ongoingRefresh=(()=>(0,i.sH)(this,void 0,void 0,function*(){const e=this.host;this.disconnect();let t=yield(0,U.$G)();return t===U.vE.HANDLED_BY_OTHER_TAB&&(yield new Promise(e=>{setTimeout(e,D.REAUTH_WAIT_MS)}),t=yield(0,U.$G)()),(t===U.vE.SUCCESS||t===U.vE.ALREADY_VALID)&&(this.connect(e),!0)}))().finally(()=>{this.ongoingRefresh=null})),this.ongoingRefresh}checkHost(){return(0,i.sH)(this,void 0,void 0,function*(){try{return this.getMessage({MESSAGE_TYPE:L.Go.HEARTBEAT_PING,SOURCE_REF:"host check"}).then(e=>e.MESSAGE_TYPE===L.Go.HEARTBEAT_PONG)}catch(e){return l.v.error(e),!1}})}send(e,t){return(0,i.sH)(this,void 0,void 0,function*(){if(this.ongoingRefresh){if(!(yield this.ongoingRefresh))throw new Error("Cannot send message: session refresh failed")}return this.http.post(D.getUrl(this.host,e),{body:D.getBody(e),headers:this.messageBuilder.createHTTPHeadersFromMessage(e)})})}httpMode(){return!0}setValidSession(e){l.v.deprecated("setValidSession","Please refrain from calling this API as this state is managed internally.","15.0.0")}connect(e){return(0,i.sH)(this,void 0,void 0,function*(){return this.host=e,this.host.startsWith("ws")&&(this.host=this.host.replace("ws","http")),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(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return l.v.debug(`HTTP MODE - ${s.MESSAGE_TYPE} (snapshot) message created -> `,s),this.send(s).then(e=>(this.dataLogoff(s.SOURCE_REF).catch(e=>l.v.error(e)),e))})}stream(e,t,s,i){const r=this.messageBuilder.createDataLogonMessage(e,i);l.v.debug(`HTTP MODE - ${r.MESSAGE_TYPE} (stream) message created -> `,r);const n=r.SOURCE_REF;this.streams.set(n,{SOURCE_REF:n,POLLING_FREQUENCY:new v.t(this.config.polling.POLLING_FREQUENCY),RESOURCE_NAME:e});const o=this.streams.get(n).POLLING_FREQUENCY,a=(0,R.x)((0,m.H)(this.send(r)),o.pipe((0,T.p)(()=>"visible"===document.visibilityState)).pipe((0,p.n)(e=>(0,_.Y)(e))).pipe((0,p.n)(()=>(0,m.H)(this.getMessage(r))))).pipe((0,A.v)(()=>this.streams.has(n)),(0,O.L)({count:D.MAX_RETRIES,delay:(e,t)=>{const s=e;l.v.error(`Retry ${t}/${D.MAX_RETRIES}:`,s.status,s);if(!(0===s.status||s.status&&s.status>=S.v.BAD_REQUEST&&s.status<S.v.INTERNAL_SERVER_ERROR))throw e;return s.status===S.v.NOT_FOUND&&this.streams.delete(n),s.status===S.v.UNAUTHORIZED?(0,m.H)(this.handleSessionRefresh()):(0,f.O)(D.RETRY_DELAY_MS)}}),(0,I.j)(()=>{l.v.debug(`Terminating stream for ${e} - ${n}`),this.dataLogoff(n)}));return this.streams.get(n).STREAM=a,a}streamState(e,t=()=>{},s=()=>{},i,r=[]){return this.stream(e,t,s,i).pipe((0,c.S)(y,r))}streamWithoutAutoTeardown(e,t,s,i){return l.v.deprecated("streamWithoutAutoTeardown","Please use 'stream' api instead.","15.0.0"),this.stream(e,t,s,i)}getMessage(e){return(0,i.sH)(this,void 0,void 0,function*(){if(this.ongoingRefresh){if(!(yield this.ongoingRefresh))throw new Error("Cannot get message: session refresh failed")}return this.http.get(D.getUrl(this.host,e),{headers:this.messageBuilder.createHTTPHeadersFromMessage(e)})})}getMoreRows(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMoreRowsMessage(e);return l.v.debug(`HTTP MODE - ${t.MESSAGE_TYPE} message created -> `,t),this.send(t)})}getMoreColumns(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMoreColumnsMessage(e);return this.send(t)})}dataLogoff(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return this.send(t).then(t=>(this.streams.has(e)&&(l.v.debug(`Removing stream ${e}`),this.streams.delete(e)),t))})}getMetadata(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!0){const s=this.messageBuilder.createMetaRequestMessage(e);return l.v.debug(`HTTP MODE - ${s.MESSAGE_TYPE} (metadata) message created -> `,s),this.send(s).then(e=>e.DETAILS)})}getJSONSchema(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMetaRequestMessage(e,L.Gp.JSON_SCHEMA_REQUEST);return l.v.debug(`HTTP MODE! - ${t.MESSAGE_TYPE} (json schema) message created -> `,t),this.send(t)})}request(e,t){const s=this.messageBuilder.createRequestMessage(e,t);return l.v.debug(`HTTP MODE! - ${s.MESSAGE_TYPE} (request server) message created -> `,s),this.send(s)}getAvailableResources(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createResourcesMessage(e);return l.v.debug(`HTTP MODE! - ${t.MESSAGE_TYPE} (getResources) message created -> `,t),this.send(t)})}commitEvent(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createCommitMessage(e,t);return l.v.debug(`HTTP MODE! - ${s.MESSAGE_TYPE} (commit) message created -> `,s),this.send(s).then(t=>(this.maybeTurbo(e,t),t))})}maybeTurbo(e,t){var s;if(!(null===(s=null==t?void 0:t.MESSAGE_TYPE)||void 0===s?void 0:s.endsWith("_ACK")))return;if(this.ongoingTurbo[e])return void l.v.debug(`${e} polling frequency is already accelerated.`);const i=this.config.polling.POLLING_MAP[e];if(!(null==i?void 0:i.TEMP_FREQUENCY)||!i.AMOUNT_OF_POLLS)return;const r=i.TEMP_FREQUENCY,n=r*i.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 i.QUERIES)a[e]=r,o[e]||(o[e]=this.config.polling.POLLING_FREQUENCY);l.v.debug(`${e} TRIGGERED -> ENFORCING TURBO | FREQUENCY=${r}ms DURATION=${n}`),this.ongoingTurbo[e]=!0,this.updateIntervals({polling:{POLLING_INTERVAL_MAP:a}}),setTimeout(()=>{l.v.debug(`RESTORED ORIGINAL POLLING INTERVALS FOR ${e}`),this.updateIntervals({polling:{POLLING_INTERVAL_MAP:o}}),this.ongoingTurbo[e]=!1},n)}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 s=e[t];this.config.polling.POLLING_INTERVAL_MAP[t]=s,l.v.debug(`Setting polling frequency for ${t} = ${s}`),[...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(s)})}}static getBody(e){return JSON.stringify(e)}static getUrl(e,t){const s=t.MESSAGE_TYPE;let i=t.MESSAGE_TYPE.replace(/_/g,"-").toLowerCase();return s===L.Gp.DATA_LOGON&&(i=t.DETAILS.DATASOURCE_NAME.replace(/_/g,"-").toLowerCase()),`${e}${i}`}};P.REAUTH_WAIT_MS=5e3,P.RETRY_DELAY_MS=1e3,P.MAX_RETRIES=3,(0,i.Cg)([o.observable],P.prototype,"host",void 0),(0,i.Cg)([o.observable],P.prototype,"isWorking",void 0),(0,i.Cg)([o.observable],P.prototype,"_isConnected",void 0),(0,i.Cg)([o.volatile],P.prototype,"isConnected",null),P=D=(0,i.Cg)([(0,i.Qj)(0,M.l),(0,i.Qj)(1,L.lT),(0,i.Qj)(2,C.N),(0,i.Qj)(3,h),(0,i.Qj)(4,g.b_),(0,i.Qj)(5,N)],P);const w=a.DI.createInterface(e=>e.singleton(P));var G=s(45230);let F=class{get isConnected(){return this.socket.isConnected}get isConnectedSubject(){return this.socket.isConnectedSubject}get isConnected$(){var e;return null===(e=this.socket.isConnectedSubject)||void 0===e?void 0:e.asObservable()}get host(){return this.socket.host}constructor(e,t,s,i,r){this.socket=e,this.messageBuilder=t,this.metaCache=s,this.events=i,this.config=r,this.isWorking=!1}httpMode(){return!1}setValidSession(e){l.v.deprecated("setValidSession","Please refrain from calling this API as this state is managed internally.","15.0.0")}send(e,t){return this.socket.send(e,t)}connect(){return(0,i.sH)(this,arguments,void 0,function*(e=r.vN){return this.socket.reset(),this.socket.connect(e,this.config.connect,this.config.reconnect)})}disconnect(){this.socket.reset()}snapshot(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return l.v.debug(`${s.MESSAGE_TYPE} (snapshot) message created -> `,s),this.socket.send(s)})}stream(e,t,s,i){const r=this.messageBuilder.createDataLogonMessage(e,i);l.v.debug(`${r.MESSAGE_TYPE} (stream) message created -> `,r);const n=this.socket.sendForStream(r,t,t=>{s(t),this.events.onStreamErrorEvent(e,n,t)},()=>{this.events.onStreamCompleteEvent(e,n)});return this.events.onStreamEvent(e,r,n,{onMessage:t,onError:s}),n}streamState(e,t=()=>{},s=()=>{},i,r=[]){return this.stream(e,t,s,i).pipe((0,c.S)(y,r))}streamWithoutAutoTeardown(e,t,s,i){l.v.deprecated("streamWithoutAutoTeardown","Please use 'stream' api instead.","15.0.0");const r=this.messageBuilder.createDataLogonMessage(e,i);l.v.debug(`${r.MESSAGE_TYPE} (stream without auto-teardown) message created -> `,r);const n=this.socket.sendForStreamWithoutTeardown(r,t,t=>{s(t),this.events.onStreamErrorEvent(e,n,t)});return this.events.onStreamEvent(e,r,n,{onMessage:t,onError:s}),n}getMoreRows(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createMoreRowsMessage(e,t);return l.v.debug(`${s.MESSAGE_TYPE} message created -> `,s),this.socket.send(s,!1)})}getMoreColumns(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMoreColumnsMessage(e);return this.socket.send(t)})}dataLogoff(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return l.v.debug(`${t.MESSAGE_TYPE} message created -> `,t),this.socket.send(t)})}getMetadata(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!0){var s;if(t&&this.metaCache.hasMetadataFor(e))return l.v.debug(`Cached metadata retrieved for ${e}`),this.metaCache.getMetadataFor(e);const i=this.messageBuilder.createMetaRequestMessage(e);let r,n;l.v.debug(`${i.MESSAGE_TYPE} (metadata) message created -> `,i);try{this.isWorking=!0;const t=yield this.socket.send(i);r=null!==(s=null==t?void 0:t.DETAILS)&&void 0!==s?s:{},Object.keys(r).length&&this.metaCache.setMetadataFor(e,r)}catch(e){throw n=e,l.v.error(e),n}finally{this.events.onMetadataEvent(e,i,n),this.isWorking=!1}return r})}getJSONSchema(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!0){var s;if(t&&this.metaCache.hasJsonSchemaFor(e))return l.v.debug(`Cached JsonSchema retrieved for ${e}`),this.metaCache.getJsonSchemaFor(e);const i=this.messageBuilder.createMetaRequestMessage(e,L.Gp.JSON_SCHEMA_REQUEST);let r;l.v.debug(`${i.MESSAGE_TYPE} (json schema) message created -> `,i);try{this.isWorking=!0,r=null!==(s=yield this.socket.send(i))&&void 0!==s?s:{},Object.keys(r).length&&this.metaCache.setJsonSchemaFor(e,r)}catch(e){l.v.error(e)}finally{this.isWorking=!1}return r})}request(e,t){const s=this.messageBuilder.createRequestMessage(e,t);return l.v.debug(`${s.MESSAGE_TYPE} (request server) message created -> `,s),this.socket.send(s)}getAvailableResources(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createResourcesMessage(e);return l.v.debug(`${t.MESSAGE_TYPE} (resources) message created -> `,t),this.socket.send(t)})}commitEvent(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createCommitMessage(e,t);l.v.debug(`${s.MESSAGE_TYPE} (commit) message created -> `,s);const i=this.socket.send(s);return this.events.onCommitEvent(e,s),i.then(t=>(this.events.onCommitResponseEvent(e,t),t))})}};(0,i.Cg)([o.observable],F.prototype,"isWorking",void 0),F=(0,i.Cg)([(0,i.Qj)(0,G.yQ),(0,i.Qj)(1,L.lT),(0,i.Qj)(2,h),(0,i.Qj)(3,u.EQ),(0,i.Qj)(4,E.R)],F);const k="true"===r.PF||(0,n.m)("forceHttp"),H=a.DI.createInterface(e=>e.singleton(F)),$=a.DI.createInterface(e=>k?e.aliasTo(w):e.aliasTo(H));function B(){return a.DI.getOrCreateDOMContainer().get($)}},32748:(e,t,s)=>{s.d(t,{l:()=>c});var i=s(55823),r=s(49229),n=s(84674);function o(e){const t=new Error(`HTTP error: ${e.status} ${e.statusText}`);return t.status=e.status,t.message=e.statusText,t}let a=class{constructor(e){this.serializer=e}get(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=yield fetch(e,Object.assign(Object.assign({credentials:"include",headers:{"Content-type":"application/json; charset=UTF-8"}},t),{method:"GET"}));if(!s.ok)throw o(s);return(t.serializer||this.serializer).deserialize(s)})}post(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=yield fetch(e,Object.assign(Object.assign({credentials:"include",headers:{"Content-type":"application/json; charset=UTF-8"}},t),{method:"POST"}));if(!s.ok)throw o(s);return(t.serializer||this.serializer).deserialize(s)})}};a=(0,i.Cg)([(0,i.Qj)(0,r.b_)],a);const c=n.DI.createInterface(e=>e.singleton(a))},32808:(e,t,s)=>{s.d(t,{k:()=>c});var i=s(55823),r=s(84674),n=s(31261),o=s(28745);class a{constructor(){}createId(e=!1){const t=(0,n.A)();return e&&o.v.debug(`UUID.createID ${t}`),t}createRemoteId(){return(0,i.sH)(this,arguments,void 0,function*(e=!1){const t=(0,n.A)();return e&&o.v.debug(`UUID.createRemoteID ${t}`),t})}}const c=r.DI.createInterface(e=>e.singleton(a))},34193:(e,t,s)=>{s.d(t,{d:()=>r});var i=s(17465);function r(e,t="ROW_REF"){const s=e=>{const s=Object.assign(Object.assign({},e),{[t]:e.DETAILS[t]});return delete s.DETAILS,s},r=[],n=[],o=[];for(const t of e.ROW)if(t.DETAILS)switch(t.DETAILS.OPERATION){case"INSERT":r.push(s(t));break;case"MODIFY":o.push(s(t));break;case"DELETE":n.push(s(t));break;default:i.v.error(`Unsupported operation type: '${t.DETAILS.OPERATION}'`)}return{inserts:r,deletes:n,updates:o,SOURCE_REF:e.SOURCE_REF}}},39087:(e,t,s)=>{var i;s.d(t,{v:()=>i,w:()=>r}),function(e){e.DATASERVER="DATASERVER",e.EVENT_HANDLER="EVENT_HANDLER",e.REQUEST_SERVER="REQUEST_SERVER"}(i||(i={}));const r="datasource-status-changed"},40113:(e,t,s)=>{s.d(t,{N:()=>L});var i=s(55823),r=s(92277),n=s(33681),o=s(84674),a=s(97156),c=s(26347),d=s(21281),h=s(10447),l=s(56653),u=s(98316),E=s(17465);const g=o.DI.createInterface();function S(){return(null===navigator||void 0===navigator?void 0:navigator.credentials)?"PasswordCredential"in window||(E.v.warn("PasswordCredential not available in this browser."),!1):(E.v.warn("CredentialsContainer not available in this browser."),!1)}const v=":";function R(e="",t=v,s){return e.split(t,s).map(e=>e.trim()).filter(e=>""!==e)}function m(e,t=v){const s="string"==typeof e&&e.trim();return!!s&&s.includes(t)}function T(e,t=v){return"string"==typeof e&&e.trim()?(e.match(new RegExp(t,"g"))||[]).length:0}function p(e,t=v){for(const s of e)if(m(s,t))return s;return e.find(e=>"string"==typeof e&&!!e.trim())}function _(e,t,s){const i="string"==typeof e&&e.trim();return!i||s&&!i.includes(s)||T(i)>1?s&&t&&s!==t?`${t}:${s}`:t||s:i}function A(e="credential"){E.v.warn(`Unable to migrate legacy ${e} to latest format. Please remove from your browser.`)}const O={password:!0,mediation:"optional"},f={cookie:{path:"/",name:"credentials",expires:7300,storePasswords:!1}};let I=class{constructor(e,t=f){this.session=e,this.config=t}createBasicCredentials(e){return{type:l.h.BASIC,username:e.username,password:e.password,mfaToken:this.getMFAToken()}}createRefreshCredentials(e){var t,s,i;return{type:l.h.REFRESH,username:null!==(t=null==e?void 0:e.username)&&void 0!==t?t:this.getUsername(),refreshToken:null!==(s=null==e?void 0:e.refreshToken)&&void 0!==s?s:this.getRefreshToken(),mfaToken:null!==(i=null==e?void 0:e.mfaToken)&&void 0!==i?i:this.getMFAToken()}}createSSOCredentials(e){var t;return{type:l.h.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}validateUserCredentialData(e,t){const s=e&&!!e.id&&!!e.name&&!e.name.includes(v)&&T(e.id)<=1;return t?s&&!!e.password:s}normaliseLegacyCredentialData(e,t){if(this.validateUserCredentialData(e,!0))return[e,!0];if(this.validateUserCredentialData(t))return[t,!1];if(e)try{const t=e,[s]=R(t.name||t.id),[i,r]=R(p([t.id,t.name]));return[{id:_(t.id||t.name,s,r),name:s,password:t.password||""},!0]}catch(e){A("PasswordCredential")}if(t)try{const e=t,[s]=R(e.name||e.username||e.organisation),[i,r]=R(p([e.organisation||e.username||e.name]));return[{id:_(e.id||e.username||e.name,s,r),name:s,password:e.password||""},!1]}catch(e){A("cookie")}return[void 0,!1]}storeCredentialsInContainer(e){return(0,i.sH)(this,void 0,void 0,function*(){if(!S())return;const t=new PasswordCredential(e);return E.v.debug("Storing credentials in CredentialsContainer"),navigator.credentials.store(t)})}getCredentialsFromContainer(){return(0,i.sH)(this,arguments,void 0,function*(e=O){if(S())return E.v.debug("Getting credentials from CredentialsContainer"),yield navigator.credentials.get(e)})}storeCredentialsInCookie(e){const{password:t}=e,s=(0,i.Tt)(e,["password"]),r=this.config.cookie.storePasswords?e:s;return E.v.debug("Storing credentials in cookie"),!!h.A.set(this.config.cookie.name,JSON.stringify(r),{expires:this.config.cookie.expires,domain:location.hostname,path:this.config.cookie.path,secure:!0})}getCredentialsFromCookie(){E.v.debug("Getting credentials from cookie");const e=h.A.get(this.config.cookie.name);return e?JSON.parse(e):void 0}storeCredentials(e){return(0,i.sH)(this,void 0,void 0,function*(){if(S()){const t=yield this.storeCredentialsInContainer(e);return Promise.resolve(!!t)}return Promise.resolve(this.storeCredentialsInCookie(e))})}getCredentials(e){return(0,i.sH)(this,void 0,void 0,function*(){return S()?this.getCredentialsFromContainer(e):Promise.resolve(this.getCredentialsFromCookie())})}getSSOToken(){return this.session.getSessionStorageItem("ssoToken")}getUsername(){return this.session.getSessionStorageItem("username")||this.session.getLocalStorageItem("username")}getRefreshToken(){return this.session.getSessionStorageItem("refreshToken")||this.session.getLocalStorageItem("refreshToken")}getMFAToken(){return this.session.getSessionStorageItem("mfaToken")}removeCookie(){h.A.remove(this.config.cookie.name,{domain:location.hostname,path:this.config.cookie.path})}removeSSOToken(){this.session.removeSessionStorageItem("ssoToken")}removeUsername(){this.session.removeSessionStorageItem("username"),this.session.removeLocalStorageItem("username")}removeRefreshToken(){this.session.removeSessionStorageItem("refreshToken"),this.session.removeLocalStorageItem("refreshToken")}removeMFAToken(){this.session.removeSessionStorageItem("mfaToken")}removeAll(){this.removeCookie(),this.removeSSOToken(),this.removeUsername(),this.removeRefreshToken(),this.removeMFAToken()}preventSilentAccess(){return S()&&navigator.credentials.preventSilentAccess()}};I=(0,i.Cg)([(0,i.Qj)(0,u.N),(0,i.Qj)(1,(0,o.optional)(g))],I);const C=o.DI.createInterface(e=>e.singleton(I)),M=e=>Array.isArray(e)?e.map(e=>null!=e?e:""):[],b=e=>{try{if("EVENT_LOGIN_AUTH_ACK"===(null==e?void 0:e.MESSAGE_TYPE)){const{DETAILS:i}=e;return{messageType:e.MESSAGE_TYPE,sourceRef:e.SOURCE_REF,userName:e.USER_NAME,updateQueue:e.UPDATE_QUEUE,zeroMqProxyModeEnabled:e.ZERO_MQ_PROXY_MODE_ENABLED,zeroMqProxyInboundPort:e.ZERO_MQ_PROXY_INBOUND_PORT,zeroMqProxyOutboundPort:e.ZERO_MQ_PROXY_OUTBOUND_PORT,userKVs:e.USER,details:i?{system:(s=i.SYSTEM,s?{date:s.DATE}:null),heartbeatIntervalSecs:i.HEARTBEAT_INTERVAL_SECS,failedLoginAttempts:i.FAILED_LOGIN_ATTEMPTS,rejectedLoginAttempts:i.REJECTED_LOGIN_ATTEMPTS,lastLoginDatetime:i.LAST_LOGIN_DATETIME,daysToPasswordExpiry:i.DAYS_TO_PASSWORD_EXPIRY,product:(t=i.PRODUCT,t?t.map(e=>({name:e.NAME,version:e.VERSION})):[])}:null,permission:M(e.PERMISSION),profile:M(e.PROFILE)}}throw new Error("No Entity mapping implementation for provided DTO")}catch(e){throw E.v.error(e),e}var t,s};let N=class{loggedUserResultChanged(){var e;null===(e=this.isLoggedInSubject)||void 0===e||e.next(this.isLoggedIn)}get isLoggedIn$(){return this.isLoggedInSubject.asObservable()}get isLoggedIn(){return this.currentUser.isAuthenticated}constructor(e,t,s,i,r){this.session=e,this.connect=t,this.messageBuilder=s,this.credentialManager=i,this.currentUser=r,this.isWorking=!1,this.isLoggedInSubject=new a.t(this.isLoggedIn),this.currentUser.addAuthenticationChangeListener(e=>{var t;null===(t=this.isLoggedInSubject)||void 0===t||t.next(e.detail)})}login(e){return(0,i.sH)(this,void 0,void 0,function*(){var t;this.isWorking=!0;try{const s=this.messageBuilder.createLoginMessage(e),i=yield this.connect.send(s);if(!i||i.ERROR||(null===(t=i.DETAILS)||void 0===t?void 0:t.ERROR))throw new l.l(s,i);this.applyAuthResults({authToken:i.SESSION_AUTH_TOKEN,refreshToken:i.REFRESH_AUTH_TOKEN,profiles:i.PROFILE,username:i.USER_NAME,permissions:i.PERMISSION,sessionId:i.SESSION_ID}),this.currentUser.set(b(i)),this.session.setAuthResult(i),E.v.debug("Login Authentication Result:",i)}catch(e){if(E.v.error("Login Authentication Error:",e),!(e instanceof l.l&&e.isIgnorableError()))throw this.removeAuthResults(),this.currentUser.unset(),e;E.v.warn("Ignoring authentication error as it is a known edge case.")}finally{this.isWorking=!1}return this.loggedUserResult})}logout(){return(0,i.sH)(this,void 0,void 0,function*(){var e;this.isWorking=!0;let t={success:!1};try{const s=this.messageBuilder.createLogoutMessage(this.loggedUserResult);this.session.deleteUserFromSessionStorage();const{CODE:i,DETAILS:r,ERROR:n,MESSAGE_TYPE:o,OIDC_LOGOUT_URL:a}=yield this.connect.send(s),c=null!==(e=null==r?void 0:r.ERROR)&&void 0!==e?e:n,h=o===d.Go.LOGOUT_NACK;h&&E.v.warn("Unexpected Logout NACK received during logout.",c),t={success:o===d.Go.LOGOUT_ACK||i===d.x6.SESSION_NOT_FOUND||!h,error:c},a&&window.open(a,"_self")}catch(e){const s=new l.l(e.sentMessage,e.receivedMessage);if(E.v.error("Logout Authentication Error:",s),!s.isIgnorableError())throw e;E.v.warn("Ignoring authentication error as it is a known edge case."),t.success=!0}finally{this.removeAuthResults(),this.currentUser.unset(),this.isWorking=!1}return t})}reAuthFromSession(){return(0,i.sH)(this,void 0,void 0,function*(){const e=yield this.ensureConnection(),t=this.credentialManager.createRefreshCredentials();if(e&&this.credentialManager.validateRefreshCredentials(t)){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.connect.send(e);if((null==t?void 0:t.MESSAGE_TYPE)===d.Gp.EVENT_LOGIN_AUTH_ACK)return this.session.setAuthResult(t),this.currentUser.set(b(t)),this.applyAuthResults(this.getLoggedUserFromMessage(t)),!0}return this.session.deleteUserFromSessionStorage(),this.currentUser.unset(),!1})}ensureConnection(){return(0,i.sH)(this,void 0,void 0,function*(){if(this.connect.isConnected)return!0;const e=this.session.getSessionStorageItem("hostUrl");return!!e&&this.connect.connect(e)})}getLoggedUserFromMessage(e){const t=e.USER_NAME,s=e.SESSION_AUTH_TOKEN,i=e.REFRESH_AUTH_TOKEN;return t&&s&&i?{username:t,authToken:s,refreshToken:i,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.removeAuthResults()}removeAuthResults(){this.loggedUserResult=null}};(0,i.Cg)([n.observable],N.prototype,"isWorking",void 0),(0,i.Cg)([n.observable],N.prototype,"loggedUserResult",void 0),N=(0,i.Cg)([(0,i.Qj)(0,u.N),(0,i.Qj)(1,c.dm),(0,i.Qj)(2,d.lT),(0,i.Qj)(3,C),(0,i.Qj)(4,r.KJ)],N);const L=o.DI.createInterface(e=>e.singleton(N))},40370:(e,t,s)=>{s.d(t,{C:()=>a});var i=s(55823),r=s(33681),n=s(17465),o=s(39087);const a=e=>{class t extends e{constructor(){super(),this.hasOwnProperty("onDatasourceStatusChanged")||(this.onDatasourceStatusChanged=e=>{var t;this.resourceName||n.v.warn("Target classes must have a resourceName property to use the DatasourceEventHandler mixin.");const s=e.detail;if(s.name===this.resourceName){const e=null!==(t=this.datasourceStatus)&&void 0!==t?t:{isInitialized:!1,hasMetadata:!1};(e.isInitialized!==s.isInitialized||s.metadataRequired&&e.hasMetadata!==s.hasMetadata)&&(this.datasourceStatus=s)}})}datasourceStatusChanged(e,t){n.v.debug("Target classes should override the datasourceStatusChanged method of the DatasourceEventHandler mixin to respond to changes in the target datasource.")}connectedCallback(){super.connectedCallback(),document.addEventListener(o.w,this.onDatasourceStatusChanged,{passive:!0,capture:!0})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(o.w,this.onDatasourceStatusChanged,{capture:!0})}}return(0,i.Cg)([r.observable],t.prototype,"datasourceStatus",void 0),t}},40729:(e,t,s)=>{s.d(t,{O:()=>d});var i=s(33681);const r=new Map([["FAST-TEXT-AREA","input"],["FAST-TEXT-FIELD","input"],["FOUNDATION-TEXT-AREA","input"],["FOUNDATION-TEXT-FIELD","input"],["INPUT","input"],["ZERO-TEXT-FIELD","input"]]);function n(e){this.keyAttr||(this.target[this.targetName]=e)}function o(e,t){this.keyAttr&&(this.updateTarget=n),this.originalBind.call(this,e,t),this.target.addEventListener(this.changeEvent,this.changeHandler)}function a(){this.originalUnbind.call(this),this.target.removeEventListener(this.changeEvent,this.changeHandler)}class c extends i.HTMLBindingDirective{constructor(e,t,s,i){super(e),this.keyAttr=i,this.conversionType=t,this.eventName=s}createBehavior(e){const t=super.createBehavior(e);return t.originalBind=t.bind,t.originalUnbind=t.unbind,t.keyAttr=this.keyAttr,t.bind=o,t.unbind=a,t.changeEvent=function(e,t){var s;const i=e.tagName;return"default"===t?null!==(s=r.get(i))&&void 0!==s?s:"change":t}(e,this.eventName),t.changeHandler=()=>{const e="boolean"===this.conversionType?t.target.checked:t.target.value;if(this.keyAttr){const s=t.bindingObserver.last,i=t.target[this.keyAttr];s.propertySource[s.propertyName][i]=this.convert(e)}else{const s=t.bindingObserver.last;s.propertySource[s.propertyName]=this.convert(e)}},t}convert(e){if(null==e)return e;switch(this.conversionType){case"time":const t=new Date(e).getTime();return isNaN(t)?void 0:t;case"number":return e.length?Number(e):void 0;case"string":return String(e);case"boolean":return Boolean(e);default:return e}}}function d(e,t="string",s="default",i){return new c(e,t,s,i)}},41119:(e,t,s)=>{var i;s.d(t,{v:()=>r,w:()=>i}),function(e){e.STRING="STRING",e.NUMBER="NUMBER",e.BOOLEAN="BOOLEAN",e.ENUM="ENUM",e.DATE="DATE",e.DATETIME="DATETIME",e.CUSTOM="CUSTOM",e.NANO_TIMESTAMP="NANO_TIMESTAMP"}(i||(i={}));const r={STRING:i.STRING,ENUM:i.ENUM,BOOLEAN:i.BOOLEAN,INT:i.NUMBER,LONG:i.NUMBER,DOUBLE:i.NUMBER,BIGDECIMAL:i.NUMBER,DATE:i.DATE,DATETIME:i.DATETIME,NANO_TIMESTAMP:i.NANO_TIMESTAMP}},45230:(e,t,s)=>{s.d(t,{yQ:()=>G,Ol:()=>F});var i=s(55823),r=s(92277),n=s(84686),o=s(49229),a=s(32808),c=s(33681),d=s(84674),h=s(50049),l=s(37970),u=s(75841),E=s(26274),g=s(53193),S=s(84190),v=s(82834),R=s(66640),m=s(53940),T=s(48653),p=s(98316),_=s(17465),A=s(49587),O=s(32748),f=s(21281);const I=1e4,C=6e4;var M;!function(e){e.Linear="linear",e.Exponential="exponential"}(M||(M={}));const b=(e,t)=>{const{reconnectInterval:s=I}=e,i=s>C?C:s,r=Math.round(Math.log2(C/i));return i*Math.pow(2,t%r)},N=e=>{const{reconnectInterval:t=I}=e;return t>C?C:t};var L=s(16183),U=s(5709);class y{constructor(e){this.interval=e}get workerScript(){return`\n const startTime = Date.now();\n setInterval(function() {\n self.postMessage(Date.now() - startTime);\n }, ${this.interval});\n `}start(e){this.stop(),this.runWorker(e)}stop(){this.worker&&(this.worker.terminate(),delete this.worker)}runWorker(e){this.worker||(this.worker=new Worker(URL.createObjectURL(new Blob([this.workerScript],{type:"text/javascript"}))),this.worker.onmessage=t=>e(t.data))}}class D extends h.B{constructor(){super()}}l.c;class P{constructor(e,t,s,i){this._message=e,this._onMessage=t,this._onError=s,this._isSubscription=i}get sentMessage(){return this._message}get onReceivedMessage(){return this._onMessage}get onReceivedError(){return this._onError}get isSubscription(){return this._isSubscription}}let w=class{get isConfigured(){return this.status.isConfigured}get isConnecting(){return this.status.isConnecting}get isConnected(){return this.status.isConnected}get isConnectedSubject(){return this.status.isConnectedSubject}get isDisconnected(){return this.status.isDisconnected}get isDisconnectedByServer(){return this.status.isDisconnectedByServer}get isReconnecting(){return this.status.isReconnecting}get hasValidSession(){return _.v.deprecated("get hasValidSession","Use `User.isAuthenticated` from `@genesislcap/foundation-user` instead.","15.0.0"),this.user.isAuthenticated}set hasValidSession(e){_.v.deprecated("set hasValidSession","Please refrain from calling this API as this state is managed internally.","15.0.0")}get host(){var e;return null!==(e=this.url)&&void 0!==e?e:n.vN}constructor(e,t,s,i,r,n,o){this.messageBuilder=e,this.session=t,this.serializer=s,this.uuid=i,this.status=r,this.user=n,this.config=o,this.defaultInterval=1e4,this.secondsMultiplier=1e3,this.heartbeatIsEnabled=!0,this.heartbeatInterval=this.defaultInterval,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=n.vN,t,s){var r;return this.url=e,this.connectOptions=null!=t?t:this.config.connect,this.reconnectOptions=null!=s?s:this.config.reconnect,(null===(r=this.config.isWebSocketExpression)||void 0===r?void 0:r.test(this.host))?new Promise(e=>{var t,s,r,n;_.v.info(`${this.isReconnecting?"Reconnecting":"Connecting"} to ${this.url}`),this.status.isConnecting=!this.isReconnecting;(!this.isReconnecting||!(null===(t=this.reconnectOptions)||void 0===t?void 0:t.reconnectStreams))&&this.cleanMessages(),null===(s=this.socketSubscription)||void 0===s||s.unsubscribe(),this.websocket=new T.Q({url:this.url,openObserver:{next:()=>{this.session.setSessionStorageItem("hostUrl",this.url),this.status.isConnected=!0,this.prepareHeartbeat(),_.v.info("WebSocket connection is now open"),e(this.isConnected)}},closeObserver:{next:t=>{this.status.onClose(t),this.isDisconnectedByServer&&_.v.info(`WebSocket connection was closed due an error - Code: ${t.code} ${t.reason?" | Reason: "+t.reason:""}`),e(this.isConnected)}},serializer:e=>this.serializer.serialize(e),deserializer:e=>this.serializer.deserialize(e)});this.socketSubscription=this.websocket.subscribe(null!==(n=null===(r=this.connectOptions)||void 0===r?void 0:r.connectObserver)&&void 0!==n?n:{next:e=>(0,i.sH)(this,void 0,void 0,function*(){var t;const s=`Response Message received for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,s);const{SOURCE_REF:i,MESSAGE_TYPE:r}=e,n=this.getMessageHandler(i,r);if(!n)return void(e.MESSAGE_TYPE===f.Go.MSG_NACK&&e.ERROR&&e.ERROR.forEach(t=>{_.v.error(`MessageType: ${e.MESSAGE_TYPE} | Error Details:`,t)}));let o=!1;switch(e.MESSAGE_TYPE){case f.Gp.EVENT_LOGIN_AUTH_ACK:{const s=e.DETAILS;s.HEARTBEAT_INTERVAL_SECS&&void 0===(null===(t=this.connectOptions)||void 0===t?void 0:t.heartbeatInterval)&&(this.heartbeatInterval=s.HEARTBEAT_INTERVAL_SECS*this.secondsMultiplier,this.prepareHeartbeat());break}case f.Go.LOGOUT_ACK:return n.onReceivedMessage.call(this,e),void this.cleanMessages();case f.Go.LOGON_ACK:return;case f.Go.LOGOFF_ACK:break;case f.Go.QUERY_UPDATE:n.isSubscription||this.sendDataLogoff(i);break;case f.Go.MSG_NACK:case f.Go.LOGON_NACK:o=!0}o?n.onReceivedError.call(this,{receivedMessage:e,sentMessage:n.sentMessage}):n.onReceivedMessage.call(this,e),this.wsMessages.next(e),n.isSubscription||this.removeMessageHandler(i)}),error:e=>{_.v.debug("Error found: ",e),this.reconnect()},complete:()=>{var e;this.isDisconnectedByServer&&(null===(e=this.connectOptions)||void 0===e?void 0:e.alwaysOn)?this.reconnect():_.v.info("Connection is now closed")}}),this.status.isConfigured=!0}):(_.v.error(`Specified host (${this.host}) is not valid WebSocket url. Connection will not proceed.`),void _.v.warn("Make sure the host url starts with wss:// or ws://"))}handleExpiredSession(){return(0,i.sH)(this,void 0,void 0,function*(){if(this.session.getSessionStorageItem("refreshToken")){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.send(e);this.session.setAuthResult(t),this.updateSessionAndSubscriptions(t)}else yield this.handleCookieBasedReauth()})}handleCookieBasedReauth(){return(0,i.sH)(this,void 0,void 0,function*(){const e=yield(0,L.$G)();e!==L.vE.HANDLED_BY_OTHER_TAB?e!==L.vE.FAILED&&(yield this.connect()):(0,L.Z8)(()=>this.connect())})}updateSessionAndSubscriptions(e){(null==e?void 0:e.MESSAGE_TYPE)===f.Gp.EVENT_LOGIN_AUTH_ACK&&this.wsMessageHandlers.forEach(t=>{t.isSubscription&&(t.sentMessage.SESSION_AUTH_TOKEN=e.SESSION_AUTH_TOKEN,this.websocket.next(t.sentMessage))})}prepareHeartbeat(){var e,t,s,r;this.heartbeatTicker&&this.heartbeatTicker.stop();const n=()=>(0,i.sH)(this,void 0,void 0,function*(){var e,t,s;if(!this.isConnected)return;const i=this.messageBuilder.createHeartbeatPingMessage(null===(e=this.connectOptions)||void 0===e?void 0:e.verboseHeartbeat);(null===(t=this.connectOptions)||void 0===t?void 0:t.heartbeatPingCallback)&&this.connectOptions.heartbeatPingCallback(i);const r=yield this.send(i);this.user.isAuthenticated&&!r.IS_AUTHENTICATED&&this.handleExpiredSession(),(null===(s=this.connectOptions)||void 0===s?void 0:s.heartbeatPongCallback)&&this.connectOptions.heartbeatPongCallback(r),this.heartbeatIsEnabled=r.MESSAGE_TYPE===f.Go.HEARTBEAT_PONG&&r.SOURCE_REF===i.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!==(r=null===(s=this.connectOptions)||void 0===s?void 0:s.heartbeatInterval)&&void 0!==r?r:this.heartbeatInterval;this.heartbeatTicker=new y(e),this.heartbeatTicker.start(()=>{this.websocket&&this.isConnected&&(n(),this.heartbeatLoggingIsEnabled&&_.v.debug(`Sending a heartbeat ping every ${e} ms`))})}}reconnect(){var e,t,s,i,r;const n=!(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||n)return;this.status.isReconnecting=!0;const o=(null===(s=this.reconnectOptions)||void 0===s?void 0:s.reconnectStrategy)===M.Exponential?b:N,a=this.isConnectedSubject.asObservable().pipe((0,S.n)(e=>e?(0,u.of)(-1):((e,t)=>new l.c(s=>{let i,r=0;return function n(){s.next(r),clearTimeout(i),i=setTimeout(n,t(e,r)),r+=1}(),()=>{clearTimeout(i)}}))(this.reconnectOptions,o).pipe((0,v.Z)(e=>{var t,s,i;let r;return r=(null===(t=this.connectOptions)||void 0===t?void 0:t.alwaysOn)?e+1:null!==(i=null===(s=this.reconnectOptions)||void 0===s?void 0:s.reconnectAttempts)&&void 0!==i?i:10,e<r?(0,u.of)(e):(this.status.reconnectionLimitReached=!0,(0,E.$)(()=>new Error(`Max reconnect attempts ${r} reached.`)))}))),(0,R.v)(()=>this.websocket&&!this.isConnected));a.subscribe(null!==(r=null===(i=this.reconnectOptions)||void 0===i?void 0:i.reconnectObserver)&&void 0!==r?r:{next:e=>{_.v.debug(`Attempt no. ${e+1} to reconnect`),this.websocket.complete(),this.connect(this.url,this.connectOptions,this.reconnectOptions)},error:e=>{var t;_.v.debug(e),null===(t=this.socketSubscription)||void 0===t||t.unsubscribe(),this.status.isReconnecting=!1},complete:()=>{_.v.info(this.isConnected?"Reconnected":"Disconnected"),this.status.isReconnecting=!1,this.wsMessageHandlers.forEach(e=>{e.isSubscription&&this.websocket.next(e.sentMessage)})}})}reset(){this.status.isConnected=!1,this.status.isConfigured=!1,this.websocket&&this.websocket.complete(),this.websocket=null,this.cleanMessages()}cleanMessages(){this.wsMessages&&this.wsMessages.complete(),this.wsMessages=new D,this.wsMessageHandlers=new Map}send(e,t=!0){if(!this.isConnected)return Promise.reject(new Error("WebSocket connection is closed"));const s=`Sending Message for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,s),new Promise((s,i)=>{const r=e=>{s(e)},n=e=>{i(e)};t&&this.setMessageHandler(e,r,n),this.websocket.next(e)})}sendForStream(e,t,s,i){if(!this.isConnected)return(0,E.$)(()=>new Error("WebSocket connection is closed"));const r=`Sending Message (stream) for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,r),this.setMessageHandler(e,t,s,!0),c.DOM.queueUpdate(()=>this.websocket.next(e)),new l.c(t=>{const s=new h.B;return this.wsMessages.pipe((0,m.p)(t=>t.SOURCE_REF===e.SOURCE_REF),(0,g.Q)(s)).subscribe({next:e=>{t.next(e)},error:e=>{t.error(e)},complete:()=>{t.complete()}}),()=>{s.complete(),this.sendDataLogoff(e.SOURCE_REF),this.removeMessageHandler(e.SOURCE_REF),i&&i()}})}sendForStreamWithoutTeardown(e,t,s){if(!this.isConnected)return(0,E.$)(()=>new Error("WebSocket connection is closed"));const i=`Sending Message (stream) for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,i),this.setMessageHandler(e,t,s,!0),this.websocket.next(e),this.wsMessages.pipe((0,m.p)(t=>t.SOURCE_REF===e.SOURCE_REF))}setMessageHandler(e,t,s,i=!1){const r=`Setting Message Handler for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.debug,r),this.wsMessageHandlers.set(e.SOURCE_REF,new P(e,t,s,i))}sendDataLogoff(e){this.send(this.messageBuilder.createDataLogoffMessage(e),!1)}removeMessageHandler(e){this.wsMessageHandlers.delete(e)}getMessageHandler(e,t){const s=`Getting Message Handler for SourceRef: ${e} | MessageType: ${t}`;return this.logMessageTypeFlow(t,_.v.debug,s),this.wsMessageHandlers.get(e)}logMessageTypeFlow(e,t,s){switch(e){case f.Gp.DATA_LOGOFF:t(s);break;case f.Go.HEARTBEAT_PING:case f.Go.HEARTBEAT_PONG:this.heartbeatLoggingIsEnabled&&t(s);break;default:this.messageLoggingIsEnabled&&t(s)}}};(0,i.Cg)([c.observable],w.prototype,"websocket",void 0),(0,i.Cg)([c.observable],w.prototype,"wsMessages",void 0),(0,i.Cg)([c.observable],w.prototype,"wsMessageHandlers",void 0),(0,i.Cg)([O.l],w.prototype,"http",void 0),(0,i.Cg)([c.observable],w.prototype,"heartbeatIsEnabled",void 0),w=(0,i.Cg)([(0,i.Qj)(0,f.lT),(0,i.Qj)(1,p.N),(0,i.Qj)(2,o.b_),(0,i.Qj)(3,a.k),(0,i.Qj)(4,U.S5),(0,i.Qj)(5,r.KJ),(0,i.Qj)(6,A.R)],w);const G=d.DI.createInterface(e=>e.singleton(w));function F(){return d.DI.getOrCreateDOMContainer().get(G)}},48707:(e,t,s)=>{s.d(t,{X:()=>o,a:()=>a});var i=s(39087),r=s(17465),n=s(41119);const o=e=>e?e.map(e=>{const t={name:e.NAME,type:n.v[e.TYPE]||n.w.STRING};if(e.TYPE===n.w.ENUM&&e.VALID_VALUES)try{t.enumOptions=Array.isArray(e.VALID_VALUES)?e.VALID_VALUES:e.VALID_VALUES.split("|")}catch(e){r.v.error(e),t.enumOptions=[]}return t}):null,a=e=>{var t;const s=null==e?void 0:e.TYPE;if(s===i.v.DATASERVER)return e.FIELD||[];if(s===i.v.REQUEST_SERVER)return e.REPLY_FIELD||(null===(t=e.REPLY)||void 0===t?void 0:t.FIELD)||[];throw new Error(`Unsupported resource type: ${s}`)}},49229:(e,t,s)=>{s.d(t,{b_:()=>h});var i=s(55823),r=s(84674),n=s(61455);const o=r.DI.createInterface();function a(e){return Number.isSafeInteger(+e)?Number(e):(0,n.Fq)(e)?BigInt.asIntN(64,e):parseFloat(e)}const c={parse:e=>(0,n.qg)(e,null,a),stringify:e=>(0,n.As)(e)};let d=class{constructor(e=c){this.config=e,this.serialize=e=>this.config.stringify(e)}deserialize(e){return e?"string"==typeof e?this.config.parse(e):e&&e.ok?e.text().then(e=>this.config.parse(e)):(e&&e.data&&(e=e.data),this.config.parse(e)):Promise.resolve({})}};d=(0,i.Cg)([(0,i.Qj)(0,(0,r.optional)(o))],d);const h=r.DI.createInterface(e=>e.singleton(d))},49587:(e,t,s)=>{s.d(t,{R:()=>n});var i=s(84674);const r={connect:{alwaysOn:!1,enableHeartbeat:!0,enableHeartbeatLogging:!1,heartbeatInterval:1e4,verboseHeartbeat:!1,enableMessageLogging:!1},reconnect:{reconnectAttempts:10,reconnectInterval:1e4,reconnectStreams:!0},isWebSocketExpression:new RegExp(/wss?:\/\/[-a-zA-Z0-9@:%._\+~#=]{1,256}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)\b\/*$/,"i")},n=i.DI.createInterface(e=>e.instance(r))},56653:(e,t,s)=>{var i;s.d(t,{h:()=>i,l:()=>r}),function(e){e.BASIC="BASIC",e.SSO="SSO",e.JWT="JWT",e.REFRESH="REFRESH"}(i||(i={}));class r extends Error{constructor(e,t,s="Auth Failed \n"){super(s),this.sent=e,this.received=t,Object.setPrototypeOf(this,r.prototype)}isIgnorableError(){var e,t,s,i,r,n,o,a;return!!(null===(i=null===(s=null===(t=null===(e=this.received)||void 0===e?void 0:e.DETAILS)||void 0===t?void 0:t.ERROR)||void 0===s?void 0:s.toLowerCase())||void 0===i?void 0:i.includes("request needs the user to be logged"))||!!(null===(a=null===(o=null===(n=null===(r=this.received)||void 0===r?void 0:r.DETAILS)||void 0===n?void 0:n.ERROR)||void 0===o?void 0:o.toLowerCase())||void 0===a?void 0:a.includes("is not logged in"))}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,s,i;return Array.isArray(null===(t=null===(e=this.received)||void 0===e?void 0:e.DETAILS)||void 0===t?void 0:t.ERROR)?null===(i=null===(s=this.received)||void 0===s?void 0:s.DETAILS)||void 0===i?void 0:i.ERROR.map(e=>this.errorDetailFormatter(e)).join("\n"):""}hasPasswordExpiredError(){return this.hasErrorCode("PASSWORD_EXPIRED")}hasMFAError(){return this.hasErrorCode("MFA_REQUIRED")||this.hasErrorCode("MFA_FAILED")}requiresTermsAndConditions(){return this.hasErrorCode("TERMS_ACCEPTANCE_REQUIRED")}hasErrorCode(e){var t,s;return!!Array.isArray(null===(t=this.received)||void 0===t?void 0:t.ERROR)&&(null===(s=this.received)||void 0===s?void 0:s.ERROR.some(t=>t.CODE===e))}errorDetailFormatter(e){return`\n ${e.CODE}: \n ${e.TEXT}`}}},68424:(e,t,s)=>{s.d(t,{DW:()=>n,JH:()=>o});var i=s(52945),r=s(28745);function n(e,t){let s=e;for(;s;){const e=s.tagName.toLowerCase();if(e.endsWith("-design-system-provider")){const t=e.split("-design-system-provider")[0];if(t)return r.v.debug(`Found provider by ancestor search: ${e}, prefix: ${t}`),{element:s,prefix:t}}s=s.parentElement?s.parentElement:s.getRootNode&&s.getRootNode()instanceof ShadowRoot?s.getRootNode().host:null}const n=document.querySelectorAll('[class*="-design-system-provider"],[id*="-design-system-provider"]'),o=Array.from(n),a=(0,i.fI)(document).filter(e=>{var t;const s=null===(t=e.tagName)||void 0===t?void 0:t.toLowerCase();return(null==s?void 0:s.endsWith("-design-system-provider"))||!1});if(o.push(...a),o.length>0){const e=o[0],t=e.tagName.toLowerCase(),s=t.split("-design-system-provider")[0];if(s)return r.v.debug(`Found provider by document search: ${t}, prefix: ${s}`),{element:e,prefix:s}}return r.v.debug(`No provider found. Falling back to ${t}.`),{element:null,prefix:t}}function o(e,t){return n(e,t).prefix}},77679:(e,t,s)=>{s.d(t,{m:()=>i});const i=e=>{const t=window.location.href,s=new URL(t).search,i=new URLSearchParams(s),r=`feature.${e}`.toLowerCase();for(const[e]of i.entries())if(e.toLowerCase()===r)return!0;return!1}},79780:(e,t,s)=>{s.d(t,{Es:()=>n});var i=s(84674);class r extends BroadcastChannel{constructor(){super(...arguments),this.postMessage=(...e)=>{const[t,s]=e;super.postMessage({type:t,detail:s})},this.isMessageType=(e,t)=>{var s;return(null===(s=t.data)||void 0===s?void 0:s.type)===e}}}const n=e=>{class t extends r{constructor(){super(e)}}return i.DI.createInterface(e=>e.transient(t))}},84686:(e,t,s)=>{s.d(t,{Be:()=>v,H6:()=>O,OB:()=>n,PF:()=>o,aW:()=>g,vN:()=>c});var i=s(77679);let r="webpack";try{r="webpack"}catch(e){}let n="/";try{n="auto".replace(/\/$/,"")}catch(e){}let o,a="gwf";try{"undefined"!=typeof SOCKET_EXT&&(a=SOCKET_EXT)}catch(e){}try{o=FORCE_HTTP}catch(e){}const c=`${location.protocol.replace("http","ws")}//${location.host}${n}/${a}/`;"true"===o||(0,i.m)("forceHttp")?location.protocol:location.protocol.replace("http","ws");let d,h,l,u,E=null;try{"undefined"!=typeof API_HOST&&(E=API_HOST)}catch(e){}try{d=""}catch(e){}try{h=DEFAULT_ORGANISATION}catch(e){}try{l=DEFAULT_PASSWORD}catch(e){}try{u=DEFAULT_USER}catch(e){}let g="gwf/event-login-auth";"undefined"!=typeof GENX_LOGIN_URL&&(g=GENX_LOGIN_URL);let S="gwf/event-login-auth";"undefined"!=typeof GENX_LOGIN_REFRESH_URL&&(S=GENX_LOGIN_REFRESH_URL);let v="gwf/event-login-details";"undefined"!=typeof GENX_LOGIN_DETAILS_URL&&(v=GENX_LOGIN_DETAILS_URL);let R="gwf/event-logout";"undefined"!=typeof GENX_LOGOUT_URL&&(R=GENX_LOGOUT_URL);let m="gwf/event-change-user-password";"undefined"!=typeof GENX_CHANGE_PASSWORD_URL&&(m=GENX_CHANGE_PASSWORD_URL);let T="gwf/event-self-service-password-reset";"undefined"!=typeof GENX_FORGOT_PASSWORD_URL&&(T=GENX_FORGOT_PASSWORD_URL);let p="gwf/event-password-reset-action";"undefined"!=typeof GENX_RESET_PASSWORD_URL&&(p=GENX_RESET_PASSWORD_URL);let _="gwf/sso/list";"undefined"!=typeof GENX_SSO_LIST_URL&&(_=GENX_SSO_LIST_URL);let A="gwf/{type}/login?idp={id}";"undefined"!=typeof GENX_SSO_LOGIN_URL&&(A=GENX_SSO_LOGIN_URL);let O="default";"undefined"!=typeof GENX_ENVIRONMENT_LEVEL&&(O=GENX_ENVIRONMENT_LEVEL);let f="gwf/auth/accept-terms";"undefined"!=typeof GENX_ACCEPT_TERMS_URL&&(f=GENX_ACCEPT_TERMS_URL)},92277:(e,t,s)=>{s.d(t,{KJ:()=>E});var i=s(55823),r=s(17190),n=s(33681),o=s(84674),a=s(79780);const c=(0,s(30314).createLogger)("foundation-user"),d={trackActionExclusions:[],trackPathExclusions:[""],setUser(e,t){if(e.isAuthenticated)throw new Error("User already set. If this is intentional, please call User.unset first.");return c.debug("setUser",t),e.rawProperties=structuredClone(t),e.userKVs=t.userKVs,e.details=t.details,e.permission=t.permission,e.profile=t.profile,e.sourceRef=t.sourceRef,e.userName=t.userName,e.isAuthenticated=!0,e},unsetUser:e=>(c.debug("unsetUser"),e.rawProperties=void 0,e.userKVs=void 0,e.details=void 0,e.permission=void 0,e.profile=void 0,e.sourceRef=void 0,e.userName=void 0,e.isAuthenticated=!1,e)},h=o.DI.createInterface(e=>e.instance(d)),l=(0,a.Es)("genesis-user");class u{constructor(){this.pathHistory=[],this.actionHistory=[],this.isAuthenticated=!1,this.authenticationChangeListeners=(0,r.r)()}set(e){return this.config.setUser(this,e)}unset(){return this.config.unsetUser(this)}get isAnonymous(){return!this.isAuthenticated}isAdmin(){return this.hasProfile("ADMIN")}isBanned(){return this.hasProfile("BANNED")}hasPermission(e){return this.hasKey(this.permission,e)}hasProfile(e){return this.hasKey(this.profile,e)}trackPath(){const{pathname:e,search:t,hash:s}=location,i=`${`${"/"!==e?e:""}`}${t}${s}`;if(!this.config.trackPathExclusions.includes(i))return this.pathHistory.push(i),i}clearPaths(){this.pathHistory=[]}lastPath(){const e=this.pathHistory.length;return e>0?this.pathHistory[e-1]:void 0}trackAction(e){this.config.trackActionExclusions.includes(e)||this.actionHistory.push(e)}clearActions(){this.actionHistory=[]}lastAction(){const e=this.actionHistory.length;return e>0?this.actionHistory[e-1]:void 0}clearTrackingHistory(){this.clearPaths(),this.clearActions()}hasKey(e,t){return!!(e&&e.length&&t)&&(Array.isArray(t)||(t=[t]),t.some(t=>e.includes(t)))}addAuthenticationChangeListener(e){var t;return null===(t=this.authenticationChangeListeners)||void 0===t?void 0:t.subscribe(e)}isAuthenticatedChanged(){var e;null===(e=this.authenticationChangeListeners)||void 0===e||e.publish(new CustomEvent("user-authentication-change",{detail:this.isAuthenticated}));const t=o.DI.getOrCreateDOMContainer().get(l);t.postMessage("user-authentication-change",this.isAuthenticated),t.close()}userNameChanged(){n.Observable.notify(this,"username")}get username(){return n.Observable.track(this,"username"),this.userName}permissionChanged(){n.Observable.notify(this,"permissions")}get permissions(){return n.Observable.track(this,"permissions"),this.permission}profileChanged(){n.Observable.notify(this,"profiles")}get profiles(){return n.Observable.track(this,"profiles"),this.profile}hasAdminProfile(){return this.isAdmin()}}(0,i.Cg)([h],u.prototype,"config",void 0),(0,i.Cg)([n.observable],u.prototype,"pathHistory",void 0),(0,i.Cg)([n.observable],u.prototype,"actionHistory",void 0),(0,i.Cg)([n.observable],u.prototype,"isAuthenticated",void 0),(0,i.Cg)([n.observable],u.prototype,"userKVs",void 0),(0,i.Cg)([n.observable],u.prototype,"details",void 0),(0,i.Cg)([n.observable],u.prototype,"permission",void 0),(0,i.Cg)([n.observable],u.prototype,"profile",void 0),(0,i.Cg)([n.observable],u.prototype,"sourceRef",void 0),(0,i.Cg)([n.observable],u.prototype,"userName",void 0),(0,i.Cg)([n.observable],u.prototype,"rawProperties",void 0);const E=o.DI.createInterface(e=>e.singleton(u))},96730:(e,t,s)=>{function i(e,t=";"){return e?e.split(t).map(e=>e.trim()).sort((e,t)=>e.localeCompare(t)).join(t):e}s.d(t,{Q:()=>i})},98316:(e,t,s)=>{s.d(t,{N:()=>n});var i=s(84674);class r{constructor(){this.storageKeyPrefix="",this.returnUrl=this.getSessionStorageItem("returnUrl")||""}deleteUserFromSessionStorage(){["authToken","refreshToken","sessionId","ssoToken"].forEach(e=>this.removeSessionStorageItem(e)),this.removeLocalStorageItem("refreshToken")}setStorageKeyPrefix(e){this.storageKeyPrefix=`${e.replace(/\s/g,"")}/`}setAuthResult(e){var t;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),(null===(t=e.DETAILS)||void 0===t?void 0:t.MFA_CODE)&&this.setSessionStorageItem("mfaToken",e.DETAILS.MFA_CODE)}captureReturnUrl(){const{pathname:e,search:t,hash:s}=location;if(e&&(e.includes("/login")||e.includes("/auth")))return;const i=`${"/"!==e?e:""}`;this.returnUrl=`${i}${t}${s}`,this.setSessionStorageItem("returnUrl",this.returnUrl)}setItem(e,t,s){"local"===s?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 n=i.DI.createInterface(e=>e.singleton(r))}}]);
1
+ "use strict";(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[347],{5709:(e,t,s)=>{s.d(t,{S5:()=>d});var i=s(55823),r=s(92277),n=s(33681),o=s(84674),a=s(97156);class c{constructor(){this.isConfigured=!1,this.isConnecting=!1,this.isConnected=!1,this.isReconnecting=!1,this.reconnectionLimitReached=!1,this.isConnectedSubject=new a.t(this.isConnected)}get hasValidSession(){return this.user.isAuthenticated}get isDisconnected(){return!this.isConnected}get isDisconnectedByServer(){return void 0!==this.closedClean&&!this.closedClean}isConnectedChanged(){var e;this.isConnected&&this.resetClosedState(),this.isConnecting=!1,this.isReconnecting=!1,null===(e=this.isConnectedSubject)||void 0===e||e.next(this.isConnected)}isReconnectingChanged(){this.isReconnecting&&(this.reconnectionLimitReached=!1)}resetClosedState(){this.closedCode=void 0,this.closedReason=void 0,this.closedClean=void 0}serialize(){return{isConfigured:this.isConfigured,isConnecting:this.isConnecting,isConnected:this.isConnected,isDisconnected:this.isDisconnected,isDisconnectedByServer:this.isDisconnectedByServer,isReconnecting:this.isReconnecting,reconnectionLimitReached:this.reconnectionLimitReached,hasValidSession:this.hasValidSession,closedCode:this.closedCode,closedReason:this.closedReason,closedClean:this.closedClean}}onClose(e){this.isConnected=!1,this.closedCode=e.code,this.closedReason=e.reason,this.closedClean=e.wasClean}}(0,i.Cg)([n.observable],c.prototype,"isConfigured",void 0),(0,i.Cg)([n.observable],c.prototype,"isConnecting",void 0),(0,i.Cg)([n.observable],c.prototype,"isConnected",void 0),(0,i.Cg)([n.observable],c.prototype,"isReconnecting",void 0),(0,i.Cg)([n.observable],c.prototype,"reconnectionLimitReached",void 0),(0,i.Cg)([n.observable],c.prototype,"closedCode",void 0),(0,i.Cg)([n.observable],c.prototype,"closedReason",void 0),(0,i.Cg)([n.observable],c.prototype,"closedClean",void 0),(0,i.Cg)([r.KJ],c.prototype,"user",void 0);const d=o.DI.createInterface(e=>e.singleton(c))},6884:(e,t,s)=>{s.d(t,{aB:()=>c,OD:()=>o});var i=s(84674);function r(e,t){const s=new Date(e),i=s.getUTCFullYear(),r=String(s.getUTCMonth()+1).padStart(2,"0"),n=String(s.getUTCDate()).padStart(2,"0");if(t)return`${i}${r}${n}`;return`${i}${r}${n}-${String(s.getUTCHours()).padStart(2,"0")}:${String(s.getUTCMinutes()).padStart(2,"0")}`}var n=s(34193);class o{}o.MAX_ROWS_250=250,o.MAX_VIEW_1000=1e3,o.REQ_REP_POLLING_INTERVAL_MS=1e4,o.DATASERVER_ROW_ID="ROW_REF",o.REQUEST_SERVER_ROW_ID="RECORD_ID",o.DEFAULT_PAGINATION_PAGE_SIZE=25,o.DEFAULT_REQ_REP_OFFSET=0;const a={options:{criteria:"",isSnapshot:!1,maxRows:o.MAX_ROWS_250,maxView:o.MAX_VIEW_1000,pollingInterval:o.REQ_REP_POLLING_INTERVAL_MS,movingView:!1,orderBy:"",resourceName:"",reverse:!1,pollTriggerEvents:[]},criteriaToFields:function(e){if(!e)return{};const t=e.split("&&").map(e=>e.trim()),s={};return t.forEach(e=>{if(e)if(e.startsWith("Expr"))!function(e,t){const s=e.match(/Expr\.(\w+)\(/);if(s)switch(s[1]){case"dateIsToday":{const s=/Expr\.dateIsToday\((\w+)\)/,i=e.match(s);if(i){const[,e]=i,s=new Date;t[`${e}_FROM`]=`${s.toISOString().replace(/-/g,"").split("T")[0]}-00:00`,s.setDate(s.getDate()+1),t[`${e}_TO`]=`${s.toISOString().replace(/-/g,"").split("T")[0]}-00:00`}break}case"dateTimeIsGreaterEqual":{const s=/Expr\.dateTimeIsGreaterEqual\((\w+), ?['"](.+)['"]\)/,i=e.match(s);if(i){const[,e,s]=i;t[`${e}_FROM`]=s}break}case"dateTimeIsLessEqual":{const s=/Expr\.dateTimeIsLessEqual\((\w+), ?['"](.+)['"]\)/,i=e.match(s);if(i){const[,e,s]=i;t[`${e}_TO`]=s}break}case"dateIsGreaterEqual":{const s=/Expr\.dateIsGreaterEqual\((\w+), ?['"](.+)['"]\)/,i=e.match(s);if(i){const[,e,s]=i;t[`${e}_FROM`]=s}break}case"dateIsLessEqual":{const s=/Expr\.dateIsLessEqual\((\w+), ?['"](.+)['"]\)/,i=e.match(s);if(i){const[,e,s]=i;t[`${e}_TO`]=s}break}case"containsIgnoreCase":{const s=/Expr\.containsIgnoreCase\((\w+), ?['"](.+)['"]\)/,i=e.match(s);if(i){const[,e,s]=i;t[e]=`*${s}*`}break}}}(e,s);else if(/[A-Z_]+\s*(>=|<=)\s*\d+/.test(e)){const t=e.match(/([A-Z_]+)\s*>=\s*(\d+)/);if(t){const[,e,i]=t,n=parseInt(i,10),o=e.toUpperCase(),a=o.includes("DATE")&&!o.includes("DATETIME");s[`${e}_FROM`]=r(n,a)}const i=e.match(/([A-Z_]+)\s*<=\s*(\d+)/);if(i){const[,e,t]=i,n=parseInt(t,10),o=e.toUpperCase(),a=o.includes("DATE")&&!o.includes("DATETIME");s[`${e}_TO`]=r(n,a)}}else!function(e,t){const s=e.substr(0,e.indexOf("=")).trim().replace(/["']/g,""),i=e.substr(e.lastIndexOf("=")+1,e.length).trim().replace(/["']/g,"");t[s]=i}(e,s)}),s},dataServerResultFilter:n.d},c=i.DI.createInterface(e=>e.instance(a))},9033:(e,t,s)=>{s.d(t,{yW:()=>M});var i=s(55823),r=s(33681),n=s(84674),o=s(50049),a=s(8790),c=s(1762),d=s(51046),h=s(66640),l=s(84190),u=s(65052),E=s(40113),g=s(26347),S=s(24669),v=s(48707),R=s(17465),m=s(79780);const T={throwWhenUnavailable:!0,throwWhenUnknown:!1},p=n.DI.createInterface(e=>e.instance(T)),_=(0,m.Es)("genesis-resources");let A=class{constructor(e,t){this.connect=e,this.config=t}isValidResource(e){return(0,i.sH)(this,void 0,void 0,function*(){if(!(e=null==e?void 0:e.trim()))return!1;yield this.fetchResources();return!!this.resources.find(t=>t.RESOURCE_NAME===e)})}getResourceTypeFor(e){return(0,i.sH)(this,void 0,void 0,function*(){yield this.fetchResources();const t=this.resources.find(t=>t.RESOURCE_NAME===e);if(t)return t.RESOURCE_TYPE;const s=`${e} resource does not exist.`;if(R.v.error(s),this.config.throwWhenUnknown)throw new Error(s)})}getAllResources(){return(0,i.sH)(this,void 0,void 0,function*(){return this.resources||(yield this.fetchResources()),this.resources})}destroy(){this.resources=void 0,this.resourcesPromise=void 0}fetchResources(){return(0,i.sH)(this,void 0,void 0,function*(){var e;if(this.resources)return Promise.resolve();if(this.resourcesPromise)yield this.resourcesPromise;else{this.resourcesPromise=this.connect.getAvailableResources();const t=yield this.resourcesPromise;if(this.resources=null==t?void 0:t.RESOURCES,!(null===(e=this.resources)||void 0===e?void 0:e.length)){const e="Genesis resources unavailable.";if(R.v.error(e),this.config.throwWhenUnavailable)throw new Error(e)}this.postLoadedMessage(),this.resourcesPromise=void 0}})}postLoadedMessage(){const e=n.DI.getOrCreateDOMContainer().get(_);e.postMessage("resources-loaded",this.resources),e.close()}};A=(0,i.Cg)([(0,i.Qj)(0,g.dm),(0,i.Qj)(1,p)],A);const O=n.DI.createInterface(e=>e.singleton(A));var f=s(6884),I=s(39087);let C=class{get initialized(){var e;return!!(null===(e=this.status)||void 0===e?void 0:e.isInitialized)}constructor(e,t,s,i,r){this.connect=e,this.auth=t,this.resources=s,this.config=i,this.connectEvents=r,this.fetchMetadataRequired=!0,this.startStreamRequired=!0,this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.customRequestFields=[],this.availableIndexes=[],this.criteriaOnlyRequest=!1,this.loadMoreCount=0,this.readOnly=!0,this._allParams=null,this.pollTrigger$=new o.B}triggerPoll(){this.pollTrigger$.next()}validResourceName(e){return R.v.deprecated("Datasource.validResourceName","Use `GenesisResources.isValidResource` instead."),!!e&&!!e.trim().length}init(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=this.fetchMetadataRequired,s=this.startStreamRequired){this.fetchMetadataRequired=t,this.options=Object.assign(Object.assign({},this.config.options),e),this.invalidateCache();const i=this.options.resourceName;if(!(this.connect.isConnected||(yield this.connect.connect())))return R.v.error(`Unable to connect to ${this.connect.host} to get ${i} datasource`),this.reportStatus(),!1;return(yield this.resources.isValidResource(i))?(this.resourceType=yield this.resources.getResourceTypeFor(i),this.resourceType?(this.fetchMetadataRequired&&(yield this.fetchAndApplyMetadata(this.options.resourceName),this._allParams=null),R.v.debug(`Initializing ${i} datasource from ${this.connect.host}`),!this.options.isSnapshot&&s&&(this.stream=yield this.createStream()),R.v.debug(`${i} datasource initialization ${this.initialized?"was successful.":"has failed."}`),this.reportStatus(),this.initialized):(R.v.error(`Unable to get the resource type for ${i} datasource from ${this.connect.host}`),this.reportStatus(),!1)):(R.v.error(`${i} datasource does not exist on ${this.connect.host}`),this.reportStatus(),!1)})}startStream(){return(0,i.sH)(this,void 0,void 0,function*(){this.options.isSnapshot||void 0!==this.stream||(this.stream=yield this.createStream())})}destroy(){var e,t;R.v.debug("Datasource.destroy",null===(e=this.options)||void 0===e?void 0:e.resourceName),this.commitResponseUnsubscribe&&(this.commitResponseUnsubscribe(),this.commitResponseUnsubscribe=void 0),null===(t=this.pollTrigger$)||void 0===t||t.complete(),this.status=void 0,this.fetchMetadataRequired=!0,this.options={},this.resourceType=void 0,this.availableIndexes=[],this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.criteriaOnlyRequest=!1,this.loadMoreCount=0,this.stream=void 0}get allResourceParams(){var e;if(this._allParams)return this._allParams;let t;if(this.options.orderBy)if(this.criteriaOnlyRequest||(null===(e=this.availableIndexes)||void 0===e?void 0:e.findIndex(e=>e.NAME===this.options.orderBy))>-1)t=this.options.orderBy;else{const e=this.availableIndexes.map(e=>e.NAME);R.v.warn("Specified [orderBy] index is not valid and will not be used. See https://learn.genesis.global/docs/database/data-types/index-entities/ - Available indexes:",e)}return this._allParams={CRITERIA_MATCH:this.options.criteria,MAX_ROWS:this.options.maxRows,ORDER_BY:t,VIEW_NUMBER:this.options.viewNumber,FIELDS:this.options.fields,MAX_VIEW:this.options.maxView,MOVING_VIEW:this.options.movingView,REVERSE:this.options.reverse,DISABLE_POLLING:this.options.disablePolling,OFFSET:this.options.offset,POLLING_INTERVAL:this.options.pollingInterval,REQUEST:this.options.request},R.v.debug("Getting configured params:",this._allParams),this._allParams}get dataserverOnlyParams(){return{CRITERIA_MATCH:this.allResourceParams.CRITERIA_MATCH,MAX_ROWS:this.allResourceParams.MAX_ROWS,VIEW_NUMBER:this.allResourceParams.VIEW_NUMBER,FIELDS:this.allResourceParams.FIELDS,MAX_VIEW:this.allResourceParams.MAX_VIEW,MOVING_VIEW:this.allResourceParams.MOVING_VIEW,ORDER_BY:this.allResourceParams.ORDER_BY,REVERSE:this.allResourceParams.REVERSE}}get requestOnlyParams(){const e=this.allResourceParams,{REQUEST:t}=e,s=(0,i.Tt)(e,["REQUEST"]);return{DETAILS:{CRITERIA_MATCH:this.options.requestAutoSetup?void 0:s.CRITERIA_MATCH,MAX_ROWS:s.MAX_ROWS,OFFSET:s.OFFSET,ORDER_BY:s.ORDER_BY,VIEW_NUMBER:s.VIEW_NUMBER},REQUEST:this.criteriaOnlyRequest?{}:null!=t?t:this.buildRequestFields()}}buildRequestFields(){if(!this.options.requestAutoSetup)return{};const e=Object.assign({},Object.fromEntries(this.requestFields.map(e=>[e.NAME,"*"]))),t=this.options.criteria?this.config.criteriaToFields(this.options.criteria):{};return Object.assign(Object.assign({},e),t)}updateLoadMoreCount(e){this.loadMoreCount=e}snapshot(e){return(0,i.sH)(this,void 0,void 0,function*(){switch(R.v.debug(`Requesting snapshot for ${this.options.resourceName} (${this.resourceType}).`),this.resourceType){case I.v.DATASERVER:return this.connect.snapshot(this.options.resourceName,Object.assign(Object.assign({},this.dataserverOnlyParams),e));case I.v.REQUEST_SERVER:return this.connect.request(this.options.resourceName,Object.assign(Object.assign({},this.requestOnlyParams),e));default:throw new Error(`Snapshot not supported for selected resource type: ${this.resourceType}`)}})}snapshotFiltered(){return(0,i.sH)(this,arguments,void 0,function*(e="ROW_REF"){const t=yield this.snapshot();return Array.isArray(t)?t:t.REPLY?t.REPLY:t.ROW?this.config.dataServerResultFilter(t,e).inserts:void 0})}createStream(){return(0,i.sH)(this,void 0,void 0,function*(){if(![I.v.DATASERVER,I.v.REQUEST_SERVER].includes(this.resourceType))throw new Error(`Streaming not supported for selected resource type: ${this.resourceType}`);return this.resourceType===I.v.DATASERVER?this.createDataserverStream():(R.v.debug(`Creating fake stream by polling ${this.options.resourceName} REQUEST_SERVER`),this.createReqRepStream())})}createDataserverStream(){return(0,i.sH)(this,void 0,void 0,function*(){return this.connect.stream(this.options.resourceName,e=>{},e=>R.v.error(e),this.dataserverOnlyParams)})}createReqRepStream(){this.commitResponseUnsubscribe=this.connectEvents.addCommitResponseListener(e=>{var t;const{eventName:s,response:i}=e.detail;this.options.pollTriggerEvents&&this.options.pollTriggerEvents.includes(s)&&(null===(t=i.MESSAGE_TYPE)||void 0===t?void 0:t.endsWith("_ACK"))&&(R.v.debug(`Received commit response for ${s}, triggering poll.`),this.triggerPoll())});const e=this.allResourceParams.DISABLE_POLLING?void 0:this.allResourceParams.POLLING_INTERVAL,t=()=>{const e=this.requestOnlyParams;if(this.resourceType===I.v.REQUEST_SERVER&&this.loadMoreCount>0){const t=25,s=(this.options.maxRows||t)*(this.loadMoreCount+1);e.DETAILS.MAX_ROWS=s}return(0,a.z)([this.connect.isConnected$,this.auth.isLoggedIn$]).pipe((0,h.v)(()=>this.connect.isConnected&&this.auth.isLoggedIn),(0,l.n)(()=>(0,c.H)(this.snapshot(e))))};return e?this.pollTrigger$.pipe((0,u.Z)(0),(0,l.n)(()=>(0,d.O)(0,e).pipe((0,l.n)(t)))):this.pollTrigger$.pipe((0,u.Z)(0),(0,l.n)(t))}fetchAndApplyMetadata(e){return(0,i.sH)(this,void 0,void 0,function*(){var t,s;try{R.v.debug(`Requesting metadata for ${this.options.resourceName} Datasource`);const e=yield this.connect.getMetadata(this.options.resourceName);e&&(this.availableIndexes=null!==(t=e.INDEXES)&&void 0!==t?t:[],this.originalFieldDef=(0,v.a)(e),this.fieldMetadata=(0,v.X)(this.originalFieldDef),this.requestFields=e.REQUEST_FIELD||[],this.customRequestFields=e.FIELD||[],this.criteriaOnlyRequest=e.CRITERIA_ONLY_REQUEST||!1,this.fetchMetadataRequired=!1),this.status=this.normaliseStatus({isInitialized:!0,metadataRequired:!0,hasMetadata:(null===(s=this.fieldMetadata)||void 0===s?void 0:s.length)>0})}catch(t){R.v.error(`Metadata Fetch failed for ${e}:`,t),this.status=this.normaliseStatus({isInitialized:!1,metadataRequired:!0,hasMetadata:!1})}})}reportStatus(e={}){var t;const s=null!==(t=this.config.eventEmitter)&&void 0!==t?t:document;this.status=this.normaliseStatus(e),R.v.debug(`Dispatching '${I.w}'`,this.status),null==s||s.dispatchEvent(new CustomEvent(I.w,{detail:this.status,bubbles:s!==document,composed:!0}))}normaliseStatus(e){var t,s,i,r,n;const o=null!==(t=e.isInitialized)&&void 0!==t?t:this.initialized,a=null!==(s=e.metadataRequired)&&void 0!==s?s:this.fetchMetadataRequired,c=null!==(i=e.hasMetadata)&&void 0!==i?i:(null===(r=this.fieldMetadata)||void 0===r?void 0:r.length)>0;return{name:null===(n=this.options)||void 0===n?void 0:n.resourceName,type:this.resourceType,isInitialized:o,metadataRequired:a,hasMetadata:c}}invalidateCache(){this._allParams=null}};(0,i.Cg)([r.observable],C.prototype,"status",void 0),(0,i.Cg)([r.observable],C.prototype,"fetchMetadataRequired",void 0),(0,i.Cg)([r.observable],C.prototype,"startStreamRequired",void 0),(0,i.Cg)([r.observable],C.prototype,"originalFieldDef",void 0),(0,i.Cg)([r.observable],C.prototype,"fieldMetadata",void 0),(0,i.Cg)([r.observable],C.prototype,"requestFields",void 0),(0,i.Cg)([r.observable],C.prototype,"customRequestFields",void 0),(0,i.Cg)([r.observable],C.prototype,"availableIndexes",void 0),(0,i.Cg)([r.observable],C.prototype,"criteriaOnlyRequest",void 0),(0,i.Cg)([r.observable],C.prototype,"loadMoreCount",void 0),(0,i.Cg)([r.observable],C.prototype,"readOnly",void 0),(0,i.Cg)([r.observable],C.prototype,"stream",void 0),C=(0,i.Cg)([(0,i.Qj)(0,g.dm),(0,i.Qj)(1,E.N),(0,i.Qj)(2,O),(0,i.Qj)(3,f.aB),(0,i.Qj)(4,S.a4)],C);const M=n.DI.createInterface(e=>e.transient(C))},12066:(e,t,s)=>{s.d(t,{CL:()=>r,Ey:()=>a,zT:()=>o});const i=10;function r(e){return!e||isNaN(e)?null:new Date(e).toISOString().slice(0,i)}const n=19;function o(e){return!e||isNaN(e)?null:new Date(e).toISOString().slice(0,n).replace("T"," ")}function a(e,t){return t?o(e):r(e)}},16183:(e,t,s)=>{s.d(t,{$G:()=>h,Z8:()=>l,vE:()=>d});var i=s(55823),r=s(84686),n=s(84674),o=s(32748);const a="reauthActionLock",c=3e4;var d;function h(){return(0,i.sH)(this,arguments,void 0,function*(e={}){const{reloadOnFailure:t=!0}=e;if(function(){const e=parseInt(localStorage.getItem(a)||"0");Date.now()-e>c&&localStorage.removeItem(a)}(),localStorage.getItem(a)||(localStorage.setItem(a,Date.now().toString()),0))return d.HANDLED_BY_OTHER_TAB;try{if(yield function(){return(0,i.sH)(this,void 0,void 0,function*(){const e=yield fetch(r.Be,{credentials:"include"});return"EVENT_LOGIN_DETAILS_ACK"===(yield e.json()).MESSAGE_TYPE})}())return d.ALREADY_VALID;return(yield function(){return(0,i.sH)(this,void 0,void 0,function*(){const e=n.DI.getOrCreateDOMContainer().get(o.l);return"EVENT_LOGIN_AUTH_ACK"===(yield e.post(r.aW,{body:JSON.stringify({DETAILS:{},MESSAGE_TYPE:"EVENT_LOGIN_AUTH"})})).MESSAGE_TYPE})}())?d.SUCCESS:(t&&window.location.reload(),d.FAILED)}finally{localStorage.removeItem(a)}})}function l(e){const t=s=>{s.key===a&&null===s.newValue&&(e(),window.removeEventListener("storage",t))};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)}!function(e){e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.HANDLED_BY_OTHER_TAB="HANDLED_BY_OTHER_TAB",e.ALREADY_VALID="ALREADY_VALID"}(d||(d={}))},17190:(e,t,s)=>{s.d(t,{j:()=>r,r:()=>i});const i=()=>{let e=[];return{subscribe:t=>(e.push(t),()=>e=e.filter(e=>e!==t)),publish(t){e.forEach(e=>e(t))}}},r=(e,t)=>{const s={root:document.documentElement};new IntersectionObserver(e=>{e.forEach(e=>{t(e.intersectionRatio>0)})},s).observe(e)}},17465:(e,t,s)=>{s.d(t,{v:()=>r});var i=s(63170);const r=(0,i.createLogger)("foundation-comms")},21281:(e,t,s)=>{s.d(t,{Go:()=>i,Gp:()=>r,lT:()=>E,x6:()=>n,z2:()=>l});var i,r,n,o=s(55823),a=s(32808),c=s(84674),d=s(56653),h=s(98316);!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.MORE_COLUMNS="MORE_COLUMNS",e.MORE_COLUMNS_ACK="MORE_COLUMNS_ACK",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"}(i||(i={})),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.RESOURCES_REQUEST_ACK="RESOURCES_REQUEST_ACK",e.RESOURCES_REQUEST_NACK="RESOURCES_REQUEST_NACK",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"}(r||(r={})),function(e){e.SESSION_NOT_FOUND="SESSION_NOT_FOUND",e.UNKNOWN_MESSAGE_TYPE="UNKNOWN_MESSAGE_TYPE"}(n||(n={}));const l=(e,t)=>!!Array.isArray(null==e?void 0:e.ERROR)&&(null==e?void 0:e.ERROR.some(e=>{var s,i;return(null===(s=e.CODE)||void 0===s?void 0:s.includes(`${t}`))||(null===(i=e.STATUS_CODE)||void 0===i?void 0:i.includes(`${t}`))}));let u=class{constructor(e,t){this.session=e,this.uuid=t}createLoginMessage(e){let t;switch(e.type){case d.h.BASIC:t={USER_NAME:e.username,PASSWORD:e.password,MFA_CODE:e.mfaToken};break;case d.h.REFRESH:t={USER_NAME:e.username,REFRESH_AUTH_TOKEN:e.refreshToken,MFA_CODE:e.mfaToken};break;case d.h.SSO:t={SSO_TOKEN:e.ssoToken};break;case d.h.JWT:t={JWT:e.jwt,DOMAIN:e.domain}}return{DETAILS:t,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_LOGIN_AUTH}}createLogoutMessage(e){var t,s;return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_LOGOUT,SESSION_AUTH_TOKEN:null!==(t=e.authToken)&&void 0!==t?t:this.session.getSessionStorageItem("authToken"),SESSION_ID:null!==(s=e.sessionId)&&void 0!==s?s:this.session.getSessionStorageItem("sessionId")}}createDataLogonMessage(e,t){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.DATA_LOGON,DETAILS:Object.assign({DATASOURCE_NAME:e},t),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createDataLogoffMessage(e){return{SOURCE_REF:e,MESSAGE_TYPE:r.DATA_LOGOFF,SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createRequestMessage(e,t){return Object.assign({SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:e.startsWith("REQ_")?e:`REQ_${e}`},t)}createResourcesMessage(e){return Object.assign({SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:r.RESOURCES_REQUEST},e)}createMetaRequestMessage(e,t=r.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(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:e},t)}createRefreshTokenMessage(){return{SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:r.EVENT_LOGIN_AUTH,DETAILS:{REFRESH_AUTH_TOKEN:this.session.getSessionStorageItem("refreshToken"),MFA_CODE:this.session.getSessionStorageItem("mfaToken")}}}createChangePasswordMessage(e,t,s){return{USER_NAME:e,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_CHANGE_USER_PASSWORD,DETAILS:{OLD_PASSWORD:t,NEW_PASSWORD:s}}}createForgotPasswordMessage(e,t,s=e){return{USER_NAME:s,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_SELF_SERVICE_PASSWORD_RESET,DETAILS:{USER_NAME:e,RETURN_URL:t}}}createForgotPasswordTokenMessage(e,t,s,i=e){return{USER_NAME:i,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_PASSWORD_RESET_ACTION,DETAILS:{USER_NAME:e,RESET_TOKEN:t,NEW_PASSWORD:s}}}createMoreRowsMessage(e,t){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:i.MORE_ROWS,DETAILS:{SOURCE_REF:e,VIEW_NUMBER:t},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createMoreColumnsMessage(e){return Object.assign(Object.assign({},this.createMoreRowsMessage(e)),{MESSAGE_TYPE:i.MORE_COLUMNS})}createHTTPHeadersFromMessage(e,t="application/json; charset=UTF-8"){const s={"Content-type":t};return e.SOURCE_REF&&(s["source-ref"]=e.SOURCE_REF,s.SOURCE_REF=e.SOURCE_REF),e.SESSION_AUTH_TOKEN&&(s["SESSION-AUTH-TOKEN"]=e.SESSION_AUTH_TOKEN),e.MESSAGE_TYPE===r.EVENT_LOGOUT&&(s["SESSION-ID"]=e.SESSION_ID),s}createHeartbeatPingMessage(e=!1){return{MESSAGE_TYPE:i.HEARTBEAT_PING,SOURCE_REF:this.uuid.createId(),VERBOSE:e,DETAILS:{},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}};u=(0,o.Cg)([(0,o.Qj)(0,h.N),(0,o.Qj)(1,a.k)],u);const E=c.DI.createInterface(e=>e.singleton(u))},24669:(e,t,s)=>{s.d(t,{EQ:()=>a,a4:()=>o});var i=s(17190),r=s(84674);class n{constructor(){this.streamListeners=(0,i.r)(),this.streamCompleteListeners=(0,i.r)(),this.streamErrorListeners=(0,i.r)(),this.commitListeners=(0,i.r)(),this.metadataListeners=(0,i.r)(),this.commitResponseListeners=(0,i.r)()}addStreamListener(e,t,s){var i,r,n;const o=null===(i=this.streamListeners)||void 0===i?void 0:i.subscribe(e),a=null===(r=this.streamCompleteListeners)||void 0===r?void 0:r.subscribe(t),c=null===(n=this.streamErrorListeners)||void 0===n?void 0:n.subscribe(s);return()=>{o(),a(),c()}}onStreamEvent(e,t,s,i){var r;null===(r=this.streamListeners)||void 0===r||r.publish(new CustomEvent("connect-stream-event",{detail:{functions:i,message:t,resourceName:e,stream:s}}))}onStreamErrorEvent(e,t,s){var i;null===(i=this.streamErrorListeners)||void 0===i||i.publish(new CustomEvent("connect-stream-error-event",{detail:{resourceName:e,stream:t,error:s}}))}onStreamCompleteEvent(e,t){var s;null===(s=this.streamCompleteListeners)||void 0===s||s.publish(new CustomEvent("connect-stream-complete-event",{detail:{resourceName:e,stream:t}}))}addCommitListener(e){var t;return null===(t=this.commitListeners)||void 0===t?void 0:t.subscribe(e)}onCommitEvent(e,t){var s;null===(s=this.commitListeners)||void 0===s||s.publish(new CustomEvent("connect-commit-event",{detail:{eventName:e,message:t}}))}addMetadataListener(e){var t;return null===(t=this.metadataListeners)||void 0===t?void 0:t.subscribe(e)}onMetadataEvent(e,t,s){var i;null===(i=this.metadataListeners)||void 0===i||i.publish(new CustomEvent("connect-metadata-event",{detail:{resourceName:e,message:t,error:s}}))}addCommitResponseListener(e){var t;return null===(t=this.commitResponseListeners)||void 0===t?void 0:t.subscribe(e)}onCommitResponseEvent(e,t){var s;null===(s=this.commitResponseListeners)||void 0===s||s.publish(new CustomEvent("connect-commit-response-event",{detail:{eventName:e,response:t}}))}}const o=r.DI.createInterface(e=>e.singleton(n)),a=r.DI.createInterface(e=>e.aliasTo(o))},26347:(e,t,s)=>{s.d(t,{dm:()=>$,tn:()=>B});var i=s(55823),r=s(84686),n=s(77679),o=s(33681),a=s(84674),c=s(77909);class d{constructor(){this.cachedMetadata=new Map,this.cachedJsonSchema=new Map}getMetadataFor(e){return this.cachedMetadata.get(e)}getJsonSchemaFor(e){return this.cachedJsonSchema.get(e)}hasMetadataFor(e){return this.cachedMetadata.has(e)}hasJsonSchemaFor(e){return this.cachedJsonSchema.has(e)}setMetadataFor(e,t){this.cachedMetadata.set(e,t)}setJsonSchemaFor(e,t){this.cachedJsonSchema.set(e,t)}}const h=a.DI.createInterface(e=>e.singleton(d));var l=s(17465),u=s(24669),E=s(49587),g=s(49229),S=s(13160),v=s(97156),R=s(7827),m=s(1762),T=s(53940),p=s(84190),_=s(78213),A=s(66640),O=s(36090),f=s(51046),I=s(16220),C=s(98316),M=s(32748);const b={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},{})},N=a.DI.createInterface(e=>e.instance(b));var L=s(21281),U=s(16183);const y=(e,t)=>((null==t?void 0:t.ROW)&&e&&e.length>0?t.ROW.forEach(t=>{const s=t;if(s&&s.DETAILS){const i=s.DETAILS.ROW_REF,r=s.DETAILS.OPERATION;"INSERT"===r&&(e.find(e=>{var t;return(null===(t=e.DETAILS)||void 0===t?void 0:t.ROW_REF)===i})||e.unshift(s)),"DELETE"===r&&(e=e.filter(e=>{var s,i;return(null===(s=t.DETAILS)||void 0===s?void 0:s.ROW_REF)!==(null===(i=e.DETAILS)||void 0===i?void 0:i.ROW_REF)})),"MODIFY"===r&&(e=e.map(e=>{var t;return(null===(t=e.DETAILS)||void 0===t?void 0:t.ROW_REF)===i?Object.assign(Object.assign({},e),s):e}))}}):!t||e&&0!==e.length||(e=[...new Set(t.ROW)]),e);var D;let P=D=class{get isConnected(){return this._isConnected}set isConnected(e){this._isConnected=e,this.isConnectedSubject.next(this._isConnected)}constructor(e,t,s,i,r,n){var o;this.http=e,this.messageBuilder=t,this.session=s,this.metaCache=i,this.serializer=r,this.config=n,this.isWorking=!1,this._isConnected=!1,this.isConnectedSubject=new v.t(this._isConnected),this.isConnected$=null===(o=this.isConnectedSubject)||void 0===o?void 0:o.asObservable(),this.ongoingTurbo={},this.streams=new Map,this.ongoingRefresh=null}handleSessionRefresh(){return this.ongoingRefresh||(this.ongoingRefresh=(()=>(0,i.sH)(this,void 0,void 0,function*(){const e=this.host;this.disconnect();let t=yield(0,U.$G)();return t===U.vE.HANDLED_BY_OTHER_TAB&&(yield new Promise(e=>{setTimeout(e,D.REAUTH_WAIT_MS)}),t=yield(0,U.$G)()),(t===U.vE.SUCCESS||t===U.vE.ALREADY_VALID)&&(this.connect(e),!0)}))().finally(()=>{this.ongoingRefresh=null})),this.ongoingRefresh}checkHost(){return(0,i.sH)(this,void 0,void 0,function*(){try{return this.getMessage({MESSAGE_TYPE:L.Go.HEARTBEAT_PING,SOURCE_REF:"host check"}).then(e=>e.MESSAGE_TYPE===L.Go.HEARTBEAT_PONG)}catch(e){return l.v.error(e),!1}})}send(e,t){return(0,i.sH)(this,void 0,void 0,function*(){if(this.ongoingRefresh){if(!(yield this.ongoingRefresh))throw new Error("Cannot send message: session refresh failed")}return this.http.post(D.getUrl(this.host,e),{body:D.getBody(e),headers:this.messageBuilder.createHTTPHeadersFromMessage(e)})})}httpMode(){return!0}setValidSession(e){l.v.deprecated("setValidSession","Please refrain from calling this API as this state is managed internally.","15.0.0")}connect(e){return(0,i.sH)(this,void 0,void 0,function*(){return this.host=e,this.host.startsWith("ws")&&(this.host=this.host.replace("ws","http")),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(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return l.v.debug(`HTTP MODE - ${s.MESSAGE_TYPE} (snapshot) message created -> `,s),this.send(s).then(e=>(this.dataLogoff(s.SOURCE_REF).catch(e=>l.v.error(e)),e))})}stream(e,t,s,i){const r=this.messageBuilder.createDataLogonMessage(e,i);l.v.debug(`HTTP MODE - ${r.MESSAGE_TYPE} (stream) message created -> `,r);const n=r.SOURCE_REF;this.streams.set(n,{SOURCE_REF:n,POLLING_FREQUENCY:new v.t(this.config.polling.POLLING_FREQUENCY),RESOURCE_NAME:e});const o=this.streams.get(n).POLLING_FREQUENCY,a=(0,R.x)((0,m.H)(this.send(r)),o.pipe((0,T.p)(()=>"visible"===document.visibilityState)).pipe((0,p.n)(e=>(0,_.Y)(e))).pipe((0,p.n)(()=>(0,m.H)(this.getMessage(r))))).pipe((0,A.v)(()=>this.streams.has(n)),(0,O.L)({count:D.MAX_RETRIES,delay:(e,t)=>{const s=e;l.v.error(`Retry ${t}/${D.MAX_RETRIES}:`,s.status,s);if(!(0===s.status||s.status&&s.status>=S.v.BAD_REQUEST&&s.status<S.v.INTERNAL_SERVER_ERROR))throw e;return s.status===S.v.NOT_FOUND&&this.streams.delete(n),s.status===S.v.UNAUTHORIZED?(0,m.H)(this.handleSessionRefresh()):(0,f.O)(D.RETRY_DELAY_MS)}}),(0,I.j)(()=>{l.v.debug(`Terminating stream for ${e} - ${n}`),this.dataLogoff(n)}));return this.streams.get(n).STREAM=a,a}streamState(e,t=()=>{},s=()=>{},i,r=[]){return this.stream(e,t,s,i).pipe((0,c.S)(y,r))}streamWithoutAutoTeardown(e,t,s,i){return l.v.deprecated("streamWithoutAutoTeardown","Please use 'stream' api instead.","15.0.0"),this.stream(e,t,s,i)}getMessage(e){return(0,i.sH)(this,void 0,void 0,function*(){if(this.ongoingRefresh){if(!(yield this.ongoingRefresh))throw new Error("Cannot get message: session refresh failed")}return this.http.get(D.getUrl(this.host,e),{headers:this.messageBuilder.createHTTPHeadersFromMessage(e)})})}getMoreRows(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMoreRowsMessage(e);return l.v.debug(`HTTP MODE - ${t.MESSAGE_TYPE} message created -> `,t),this.send(t)})}getMoreColumns(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMoreColumnsMessage(e);return this.send(t)})}dataLogoff(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return this.send(t).then(t=>(this.streams.has(e)&&(l.v.debug(`Removing stream ${e}`),this.streams.delete(e)),t))})}getMetadata(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!0){const s=this.messageBuilder.createMetaRequestMessage(e);return l.v.debug(`HTTP MODE - ${s.MESSAGE_TYPE} (metadata) message created -> `,s),this.send(s).then(e=>e.DETAILS)})}getJSONSchema(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMetaRequestMessage(e,L.Gp.JSON_SCHEMA_REQUEST);return l.v.debug(`HTTP MODE! - ${t.MESSAGE_TYPE} (json schema) message created -> `,t),this.send(t)})}request(e,t){const s=this.messageBuilder.createRequestMessage(e,t);return l.v.debug(`HTTP MODE! - ${s.MESSAGE_TYPE} (request server) message created -> `,s),this.send(s)}getAvailableResources(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createResourcesMessage(e);return l.v.debug(`HTTP MODE! - ${t.MESSAGE_TYPE} (getResources) message created -> `,t),this.send(t)})}commitEvent(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createCommitMessage(e,t);return l.v.debug(`HTTP MODE! - ${s.MESSAGE_TYPE} (commit) message created -> `,s),this.send(s).then(t=>(this.maybeTurbo(e,t),t))})}maybeTurbo(e,t){var s;if(!(null===(s=null==t?void 0:t.MESSAGE_TYPE)||void 0===s?void 0:s.endsWith("_ACK")))return;if(this.ongoingTurbo[e])return void l.v.debug(`${e} polling frequency is already accelerated.`);const i=this.config.polling.POLLING_MAP[e];if(!(null==i?void 0:i.TEMP_FREQUENCY)||!i.AMOUNT_OF_POLLS)return;const r=i.TEMP_FREQUENCY,n=r*i.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 i.QUERIES)a[e]=r,o[e]||(o[e]=this.config.polling.POLLING_FREQUENCY);l.v.debug(`${e} TRIGGERED -> ENFORCING TURBO | FREQUENCY=${r}ms DURATION=${n}`),this.ongoingTurbo[e]=!0,this.updateIntervals({polling:{POLLING_INTERVAL_MAP:a}}),setTimeout(()=>{l.v.debug(`RESTORED ORIGINAL POLLING INTERVALS FOR ${e}`),this.updateIntervals({polling:{POLLING_INTERVAL_MAP:o}}),this.ongoingTurbo[e]=!1},n)}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 s=e[t];this.config.polling.POLLING_INTERVAL_MAP[t]=s,l.v.debug(`Setting polling frequency for ${t} = ${s}`),[...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(s)})}}static getBody(e){return JSON.stringify(e)}static getUrl(e,t){const s=t.MESSAGE_TYPE;let i=t.MESSAGE_TYPE.replace(/_/g,"-").toLowerCase();return s===L.Gp.DATA_LOGON&&(i=t.DETAILS.DATASOURCE_NAME.replace(/_/g,"-").toLowerCase()),`${e}${i}`}};P.REAUTH_WAIT_MS=5e3,P.RETRY_DELAY_MS=1e3,P.MAX_RETRIES=3,(0,i.Cg)([o.observable],P.prototype,"host",void 0),(0,i.Cg)([o.observable],P.prototype,"isWorking",void 0),(0,i.Cg)([o.observable],P.prototype,"_isConnected",void 0),(0,i.Cg)([o.volatile],P.prototype,"isConnected",null),P=D=(0,i.Cg)([(0,i.Qj)(0,M.l),(0,i.Qj)(1,L.lT),(0,i.Qj)(2,C.N),(0,i.Qj)(3,h),(0,i.Qj)(4,g.b_),(0,i.Qj)(5,N)],P);const w=a.DI.createInterface(e=>e.singleton(P));var G=s(45230);let F=class{get isConnected(){return this.socket.isConnected}get isConnectedSubject(){return this.socket.isConnectedSubject}get isConnected$(){var e;return null===(e=this.socket.isConnectedSubject)||void 0===e?void 0:e.asObservable()}get host(){return this.socket.host}constructor(e,t,s,i,r){this.socket=e,this.messageBuilder=t,this.metaCache=s,this.events=i,this.config=r,this.isWorking=!1}httpMode(){return!1}setValidSession(e){l.v.deprecated("setValidSession","Please refrain from calling this API as this state is managed internally.","15.0.0")}send(e,t){return this.socket.send(e,t)}connect(){return(0,i.sH)(this,arguments,void 0,function*(e=r.vN){return this.socket.reset(),this.socket.connect(e,this.config.connect,this.config.reconnect)})}disconnect(){this.socket.reset()}snapshot(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return l.v.debug(`${s.MESSAGE_TYPE} (snapshot) message created -> `,s),this.socket.send(s)})}stream(e,t,s,i){const r=this.messageBuilder.createDataLogonMessage(e,i);l.v.debug(`${r.MESSAGE_TYPE} (stream) message created -> `,r);const n=this.socket.sendForStream(r,t,t=>{s(t),this.events.onStreamErrorEvent(e,n,t)},()=>{this.events.onStreamCompleteEvent(e,n)});return this.events.onStreamEvent(e,r,n,{onMessage:t,onError:s}),n}streamState(e,t=()=>{},s=()=>{},i,r=[]){return this.stream(e,t,s,i).pipe((0,c.S)(y,r))}streamWithoutAutoTeardown(e,t,s,i){l.v.deprecated("streamWithoutAutoTeardown","Please use 'stream' api instead.","15.0.0");const r=this.messageBuilder.createDataLogonMessage(e,i);l.v.debug(`${r.MESSAGE_TYPE} (stream without auto-teardown) message created -> `,r);const n=this.socket.sendForStreamWithoutTeardown(r,t,t=>{s(t),this.events.onStreamErrorEvent(e,n,t)});return this.events.onStreamEvent(e,r,n,{onMessage:t,onError:s}),n}getMoreRows(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createMoreRowsMessage(e,t);return l.v.debug(`${s.MESSAGE_TYPE} message created -> `,s),this.socket.send(s,!1)})}getMoreColumns(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMoreColumnsMessage(e);return this.socket.send(t)})}dataLogoff(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return l.v.debug(`${t.MESSAGE_TYPE} message created -> `,t),this.socket.send(t)})}getMetadata(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!0){var s;if(t&&this.metaCache.hasMetadataFor(e))return l.v.debug(`Cached metadata retrieved for ${e}`),this.metaCache.getMetadataFor(e);const i=this.messageBuilder.createMetaRequestMessage(e);let r,n;l.v.debug(`${i.MESSAGE_TYPE} (metadata) message created -> `,i);try{this.isWorking=!0;const t=yield this.socket.send(i);r=null!==(s=null==t?void 0:t.DETAILS)&&void 0!==s?s:{},Object.keys(r).length&&this.metaCache.setMetadataFor(e,r)}catch(e){throw n=e,l.v.error(e),n}finally{this.events.onMetadataEvent(e,i,n),this.isWorking=!1}return r})}getJSONSchema(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!0){var s;if(t&&this.metaCache.hasJsonSchemaFor(e))return l.v.debug(`Cached JsonSchema retrieved for ${e}`),this.metaCache.getJsonSchemaFor(e);const i=this.messageBuilder.createMetaRequestMessage(e,L.Gp.JSON_SCHEMA_REQUEST);let r;l.v.debug(`${i.MESSAGE_TYPE} (json schema) message created -> `,i);try{this.isWorking=!0,r=null!==(s=yield this.socket.send(i))&&void 0!==s?s:{},Object.keys(r).length&&this.metaCache.setJsonSchemaFor(e,r)}catch(e){l.v.error(e)}finally{this.isWorking=!1}return r})}request(e,t){const s=this.messageBuilder.createRequestMessage(e,t);return l.v.debug(`${s.MESSAGE_TYPE} (request server) message created -> `,s),this.socket.send(s)}getAvailableResources(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createResourcesMessage(e);return l.v.debug(`${t.MESSAGE_TYPE} (resources) message created -> `,t),this.socket.send(t)})}commitEvent(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createCommitMessage(e,t);l.v.debug(`${s.MESSAGE_TYPE} (commit) message created -> `,s);const i=this.socket.send(s);return this.events.onCommitEvent(e,s),i.then(t=>(this.events.onCommitResponseEvent(e,t),t))})}};(0,i.Cg)([o.observable],F.prototype,"isWorking",void 0),F=(0,i.Cg)([(0,i.Qj)(0,G.yQ),(0,i.Qj)(1,L.lT),(0,i.Qj)(2,h),(0,i.Qj)(3,u.EQ),(0,i.Qj)(4,E.R)],F);const k="true"===r.PF||(0,n.m)("forceHttp"),H=a.DI.createInterface(e=>e.singleton(F)),$=a.DI.createInterface(e=>k?e.aliasTo(w):e.aliasTo(H));function B(){return a.DI.getOrCreateDOMContainer().get($)}},32748:(e,t,s)=>{s.d(t,{l:()=>c});var i=s(55823),r=s(49229),n=s(84674);function o(e){const t=new Error(`HTTP error: ${e.status} ${e.statusText}`);return t.status=e.status,t.message=e.statusText,t}let a=class{constructor(e){this.serializer=e}get(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=yield fetch(e,Object.assign(Object.assign({credentials:"include",headers:{"Content-type":"application/json; charset=UTF-8"}},t),{method:"GET"}));if(!s.ok)throw o(s);return(t.serializer||this.serializer).deserialize(s)})}post(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=yield fetch(e,Object.assign(Object.assign({credentials:"include",headers:{"Content-type":"application/json; charset=UTF-8"}},t),{method:"POST"}));if(!s.ok)throw o(s);return(t.serializer||this.serializer).deserialize(s)})}};a=(0,i.Cg)([(0,i.Qj)(0,r.b_)],a);const c=n.DI.createInterface(e=>e.singleton(a))},32808:(e,t,s)=>{s.d(t,{k:()=>c});var i=s(55823),r=s(84674),n=s(31261),o=s(28745);class a{constructor(){}createId(e=!1){const t=(0,n.A)();return e&&o.v.debug(`UUID.createID ${t}`),t}createRemoteId(){return(0,i.sH)(this,arguments,void 0,function*(e=!1){const t=(0,n.A)();return e&&o.v.debug(`UUID.createRemoteID ${t}`),t})}}const c=r.DI.createInterface(e=>e.singleton(a))},34193:(e,t,s)=>{s.d(t,{d:()=>r});var i=s(17465);function r(e,t="ROW_REF"){const s=e=>{const s=Object.assign(Object.assign({},e),{[t]:e.DETAILS[t]});return delete s.DETAILS,s},r=[],n=[],o=[];for(const t of e.ROW)if(t.DETAILS)switch(t.DETAILS.OPERATION){case"INSERT":r.push(s(t));break;case"MODIFY":o.push(s(t));break;case"DELETE":n.push(s(t));break;default:i.v.error(`Unsupported operation type: '${t.DETAILS.OPERATION}'`)}return{inserts:r,deletes:n,updates:o,SOURCE_REF:e.SOURCE_REF}}},39087:(e,t,s)=>{var i;s.d(t,{v:()=>i,w:()=>r}),function(e){e.DATASERVER="DATASERVER",e.EVENT_HANDLER="EVENT_HANDLER",e.REQUEST_SERVER="REQUEST_SERVER"}(i||(i={}));const r="datasource-status-changed"},40113:(e,t,s)=>{s.d(t,{N:()=>L});var i=s(55823),r=s(92277),n=s(33681),o=s(84674),a=s(97156),c=s(26347),d=s(21281),h=s(10447),l=s(56653),u=s(98316),E=s(17465);const g=o.DI.createInterface();function S(){return(null===navigator||void 0===navigator?void 0:navigator.credentials)?"PasswordCredential"in window||(E.v.warn("PasswordCredential not available in this browser."),!1):(E.v.warn("CredentialsContainer not available in this browser."),!1)}const v=":";function R(e="",t=v,s){return e.split(t,s).map(e=>e.trim()).filter(e=>""!==e)}function m(e,t=v){const s="string"==typeof e&&e.trim();return!!s&&s.includes(t)}function T(e,t=v){return"string"==typeof e&&e.trim()?(e.match(new RegExp(t,"g"))||[]).length:0}function p(e,t=v){for(const s of e)if(m(s,t))return s;return e.find(e=>"string"==typeof e&&!!e.trim())}function _(e,t,s){const i="string"==typeof e&&e.trim();return!i||s&&!i.includes(s)||T(i)>1?s&&t&&s!==t?`${t}:${s}`:t||s:i}function A(e="credential"){E.v.warn(`Unable to migrate legacy ${e} to latest format. Please remove from your browser.`)}const O={password:!0,mediation:"optional"},f={cookie:{path:"/",name:"credentials",expires:7300,storePasswords:!1}};let I=class{constructor(e,t=f){this.session=e,this.config=t}createBasicCredentials(e){return{type:l.h.BASIC,username:e.username,password:e.password,mfaToken:this.getMFAToken()}}createRefreshCredentials(e){var t,s,i;return{type:l.h.REFRESH,username:null!==(t=null==e?void 0:e.username)&&void 0!==t?t:this.getUsername(),refreshToken:null!==(s=null==e?void 0:e.refreshToken)&&void 0!==s?s:this.getRefreshToken(),mfaToken:null!==(i=null==e?void 0:e.mfaToken)&&void 0!==i?i:this.getMFAToken()}}createSSOCredentials(e){var t;return{type:l.h.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}validateUserCredentialData(e,t){const s=e&&!!e.id&&!!e.name&&!e.name.includes(v)&&T(e.id)<=1;return t?s&&!!e.password:s}normaliseLegacyCredentialData(e,t){if(this.validateUserCredentialData(e,!0))return[e,!0];if(this.validateUserCredentialData(t))return[t,!1];if(e)try{const t=e,[s]=R(t.name||t.id),[i,r]=R(p([t.id,t.name]));return[{id:_(t.id||t.name,s,r),name:s,password:t.password||""},!0]}catch(e){A("PasswordCredential")}if(t)try{const e=t,[s]=R(e.name||e.username||e.organisation),[i,r]=R(p([e.organisation||e.username||e.name]));return[{id:_(e.id||e.username||e.name,s,r),name:s,password:e.password||""},!1]}catch(e){A("cookie")}return[void 0,!1]}storeCredentialsInContainer(e){return(0,i.sH)(this,void 0,void 0,function*(){if(!S())return;const t=new PasswordCredential(e);return E.v.debug("Storing credentials in CredentialsContainer"),navigator.credentials.store(t)})}getCredentialsFromContainer(){return(0,i.sH)(this,arguments,void 0,function*(e=O){if(S())return E.v.debug("Getting credentials from CredentialsContainer"),yield navigator.credentials.get(e)})}storeCredentialsInCookie(e){const{password:t}=e,s=(0,i.Tt)(e,["password"]),r=this.config.cookie.storePasswords?e:s;return E.v.debug("Storing credentials in cookie"),!!h.A.set(this.config.cookie.name,JSON.stringify(r),{expires:this.config.cookie.expires,domain:location.hostname,path:this.config.cookie.path,secure:!0})}getCredentialsFromCookie(){E.v.debug("Getting credentials from cookie");const e=h.A.get(this.config.cookie.name);return e?JSON.parse(e):void 0}storeCredentials(e){return(0,i.sH)(this,void 0,void 0,function*(){if(S()){const t=yield this.storeCredentialsInContainer(e);return Promise.resolve(!!t)}return Promise.resolve(this.storeCredentialsInCookie(e))})}getCredentials(e){return(0,i.sH)(this,void 0,void 0,function*(){return S()?this.getCredentialsFromContainer(e):Promise.resolve(this.getCredentialsFromCookie())})}getSSOToken(){return this.session.getSessionStorageItem("ssoToken")}getUsername(){return this.session.getSessionStorageItem("username")||this.session.getLocalStorageItem("username")}getRefreshToken(){return this.session.getSessionStorageItem("refreshToken")||this.session.getLocalStorageItem("refreshToken")}getMFAToken(){return this.session.getSessionStorageItem("mfaToken")}removeCookie(){h.A.remove(this.config.cookie.name,{domain:location.hostname,path:this.config.cookie.path})}removeSSOToken(){this.session.removeSessionStorageItem("ssoToken")}removeUsername(){this.session.removeSessionStorageItem("username"),this.session.removeLocalStorageItem("username")}removeRefreshToken(){this.session.removeSessionStorageItem("refreshToken"),this.session.removeLocalStorageItem("refreshToken")}removeMFAToken(){this.session.removeSessionStorageItem("mfaToken")}removeAll(){this.removeCookie(),this.removeSSOToken(),this.removeUsername(),this.removeRefreshToken(),this.removeMFAToken()}preventSilentAccess(){return S()&&navigator.credentials.preventSilentAccess()}};I=(0,i.Cg)([(0,i.Qj)(0,u.N),(0,i.Qj)(1,(0,o.optional)(g))],I);const C=o.DI.createInterface(e=>e.singleton(I)),M=e=>Array.isArray(e)?e.map(e=>null!=e?e:""):[],b=e=>{try{if("EVENT_LOGIN_AUTH_ACK"===(null==e?void 0:e.MESSAGE_TYPE)){const{DETAILS:i}=e;return{messageType:e.MESSAGE_TYPE,sourceRef:e.SOURCE_REF,userName:e.USER_NAME,updateQueue:e.UPDATE_QUEUE,zeroMqProxyModeEnabled:e.ZERO_MQ_PROXY_MODE_ENABLED,zeroMqProxyInboundPort:e.ZERO_MQ_PROXY_INBOUND_PORT,zeroMqProxyOutboundPort:e.ZERO_MQ_PROXY_OUTBOUND_PORT,userKVs:e.USER,details:i?{system:(s=i.SYSTEM,s?{date:s.DATE}:null),heartbeatIntervalSecs:i.HEARTBEAT_INTERVAL_SECS,failedLoginAttempts:i.FAILED_LOGIN_ATTEMPTS,rejectedLoginAttempts:i.REJECTED_LOGIN_ATTEMPTS,lastLoginDatetime:i.LAST_LOGIN_DATETIME,daysToPasswordExpiry:i.DAYS_TO_PASSWORD_EXPIRY,product:(t=i.PRODUCT,t?t.map(e=>({name:e.NAME,version:e.VERSION})):[])}:null,permission:M(e.PERMISSION),profile:M(e.PROFILE)}}throw new Error("No Entity mapping implementation for provided DTO")}catch(e){throw E.v.error(e),e}var t,s};let N=class{loggedUserResultChanged(){var e;null===(e=this.isLoggedInSubject)||void 0===e||e.next(this.isLoggedIn)}get isLoggedIn$(){return this.isLoggedInSubject.asObservable()}get isLoggedIn(){return this.currentUser.isAuthenticated}constructor(e,t,s,i,r){this.session=e,this.connect=t,this.messageBuilder=s,this.credentialManager=i,this.currentUser=r,this.isWorking=!1,this.isLoggedInSubject=new a.t(this.isLoggedIn),this.currentUser.addAuthenticationChangeListener(e=>{var t;null===(t=this.isLoggedInSubject)||void 0===t||t.next(e.detail)})}login(e){return(0,i.sH)(this,void 0,void 0,function*(){var t;this.isWorking=!0;try{const s=this.messageBuilder.createLoginMessage(e),i=yield this.connect.send(s);if(!i||i.ERROR||(null===(t=i.DETAILS)||void 0===t?void 0:t.ERROR))throw new l.l(s,i);this.applyAuthResults({authToken:i.SESSION_AUTH_TOKEN,refreshToken:i.REFRESH_AUTH_TOKEN,profiles:i.PROFILE,username:i.USER_NAME,permissions:i.PERMISSION,sessionId:i.SESSION_ID}),this.currentUser.set(b(i)),this.session.setAuthResult(i),E.v.debug("Login Authentication Result:",i)}catch(e){if(E.v.error("Login Authentication Error:",e),!(e instanceof l.l&&e.isIgnorableError()))throw this.removeAuthResults(),this.currentUser.unset(),e;E.v.warn("Ignoring authentication error as it is a known edge case.")}finally{this.isWorking=!1}return this.loggedUserResult})}logout(){return(0,i.sH)(this,void 0,void 0,function*(){var e;this.isWorking=!0;let t={success:!1};try{const s=this.messageBuilder.createLogoutMessage(this.loggedUserResult);this.session.deleteUserFromSessionStorage();const{CODE:i,DETAILS:r,ERROR:n,MESSAGE_TYPE:o,OIDC_LOGOUT_URL:a}=yield this.connect.send(s),c=null!==(e=null==r?void 0:r.ERROR)&&void 0!==e?e:n,h=o===d.Go.LOGOUT_NACK;h&&E.v.warn("Unexpected Logout NACK received during logout.",c),t={success:o===d.Go.LOGOUT_ACK||i===d.x6.SESSION_NOT_FOUND||!h,error:c},a&&window.open(a,"_self")}catch(e){const s=new l.l(e.sentMessage,e.receivedMessage);if(E.v.error("Logout Authentication Error:",s),!s.isIgnorableError())throw e;E.v.warn("Ignoring authentication error as it is a known edge case."),t.success=!0}finally{this.removeAuthResults(),this.currentUser.unset(),this.isWorking=!1}return t})}reAuthFromSession(){return(0,i.sH)(this,void 0,void 0,function*(){const e=yield this.ensureConnection(),t=this.credentialManager.createRefreshCredentials();if(e&&this.credentialManager.validateRefreshCredentials(t)){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.connect.send(e);if((null==t?void 0:t.MESSAGE_TYPE)===d.Gp.EVENT_LOGIN_AUTH_ACK)return this.session.setAuthResult(t),this.currentUser.set(b(t)),this.applyAuthResults(this.getLoggedUserFromMessage(t)),!0}return this.session.deleteUserFromSessionStorage(),this.currentUser.unset(),!1})}ensureConnection(){return(0,i.sH)(this,void 0,void 0,function*(){if(this.connect.isConnected)return!0;const e=this.session.getSessionStorageItem("hostUrl");return!!e&&this.connect.connect(e)})}getLoggedUserFromMessage(e){const t=e.USER_NAME,s=e.SESSION_AUTH_TOKEN,i=e.REFRESH_AUTH_TOKEN;return t&&s&&i?{username:t,authToken:s,refreshToken:i,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.removeAuthResults()}removeAuthResults(){this.loggedUserResult=null}};(0,i.Cg)([n.observable],N.prototype,"isWorking",void 0),(0,i.Cg)([n.observable],N.prototype,"loggedUserResult",void 0),N=(0,i.Cg)([(0,i.Qj)(0,u.N),(0,i.Qj)(1,c.dm),(0,i.Qj)(2,d.lT),(0,i.Qj)(3,C),(0,i.Qj)(4,r.KJ)],N);const L=o.DI.createInterface(e=>e.singleton(N))},40370:(e,t,s)=>{s.d(t,{C:()=>a});var i=s(55823),r=s(33681),n=s(17465),o=s(39087);const a=e=>{class t extends e{constructor(){super(),this.hasOwnProperty("onDatasourceStatusChanged")||(this.onDatasourceStatusChanged=e=>{var t;this.resourceName||n.v.warn("Target classes must have a resourceName property to use the DatasourceEventHandler mixin.");const s=e.detail;if(s.name===this.resourceName){const e=null!==(t=this.datasourceStatus)&&void 0!==t?t:{isInitialized:!1,hasMetadata:!1};(e.isInitialized!==s.isInitialized||s.metadataRequired&&e.hasMetadata!==s.hasMetadata)&&(this.datasourceStatus=s)}})}datasourceStatusChanged(e,t){n.v.debug("Target classes should override the datasourceStatusChanged method of the DatasourceEventHandler mixin to respond to changes in the target datasource.")}connectedCallback(){super.connectedCallback(),document.addEventListener(o.w,this.onDatasourceStatusChanged,{passive:!0,capture:!0})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(o.w,this.onDatasourceStatusChanged,{capture:!0})}}return(0,i.Cg)([r.observable],t.prototype,"datasourceStatus",void 0),t}},40729:(e,t,s)=>{s.d(t,{O:()=>d});var i=s(33681);const r=new Map([["FAST-TEXT-AREA","input"],["FAST-TEXT-FIELD","input"],["FOUNDATION-TEXT-AREA","input"],["FOUNDATION-TEXT-FIELD","input"],["INPUT","input"],["ZERO-TEXT-FIELD","input"]]);function n(e){this.keyAttr||(this.target[this.targetName]=e)}function o(e,t){this.keyAttr&&(this.updateTarget=n),this.originalBind.call(this,e,t),this.target.addEventListener(this.changeEvent,this.changeHandler)}function a(){this.originalUnbind.call(this),this.target.removeEventListener(this.changeEvent,this.changeHandler)}class c extends i.HTMLBindingDirective{constructor(e,t,s,i){super(e),this.keyAttr=i,this.conversionType=t,this.eventName=s}createBehavior(e){const t=super.createBehavior(e);return t.originalBind=t.bind,t.originalUnbind=t.unbind,t.keyAttr=this.keyAttr,t.bind=o,t.unbind=a,t.changeEvent=function(e,t){var s;const i=e.tagName;return"default"===t?null!==(s=r.get(i))&&void 0!==s?s:"change":t}(e,this.eventName),t.changeHandler=()=>{const e="boolean"===this.conversionType?t.target.checked:t.target.value;if(this.keyAttr){const s=t.bindingObserver.last,i=t.target[this.keyAttr];s.propertySource[s.propertyName][i]=this.convert(e)}else{const s=t.bindingObserver.last;s.propertySource[s.propertyName]=this.convert(e)}},t}convert(e){if(null==e)return e;switch(this.conversionType){case"time":const t=new Date(e).getTime();return isNaN(t)?void 0:t;case"number":return e.length?Number(e):void 0;case"string":return String(e);case"boolean":return Boolean(e);default:return e}}}function d(e,t="string",s="default",i){return new c(e,t,s,i)}},41119:(e,t,s)=>{var i;s.d(t,{v:()=>r,w:()=>i}),function(e){e.STRING="STRING",e.NUMBER="NUMBER",e.BOOLEAN="BOOLEAN",e.ENUM="ENUM",e.DATE="DATE",e.DATETIME="DATETIME",e.CUSTOM="CUSTOM",e.NANO_TIMESTAMP="NANO_TIMESTAMP"}(i||(i={}));const r={STRING:i.STRING,ENUM:i.ENUM,BOOLEAN:i.BOOLEAN,INT:i.NUMBER,LONG:i.NUMBER,DOUBLE:i.NUMBER,BIGDECIMAL:i.NUMBER,DATE:i.DATE,DATETIME:i.DATETIME,NANO_TIMESTAMP:i.NANO_TIMESTAMP}},45230:(e,t,s)=>{s.d(t,{yQ:()=>G,Ol:()=>F});var i=s(55823),r=s(92277),n=s(84686),o=s(49229),a=s(32808),c=s(33681),d=s(84674),h=s(50049),l=s(37970),u=s(75841),E=s(26274),g=s(53193),S=s(84190),v=s(82834),R=s(66640),m=s(53940),T=s(48653),p=s(98316),_=s(17465),A=s(49587),O=s(32748),f=s(21281);const I=1e4,C=6e4;var M;!function(e){e.Linear="linear",e.Exponential="exponential"}(M||(M={}));const b=(e,t)=>{const{reconnectInterval:s=I}=e,i=s>C?C:s,r=Math.round(Math.log2(C/i));return i*Math.pow(2,t%r)},N=e=>{const{reconnectInterval:t=I}=e;return t>C?C:t};var L=s(16183),U=s(5709);class y{constructor(e){this.interval=e}get workerScript(){return`\n const startTime = Date.now();\n setInterval(function() {\n self.postMessage(Date.now() - startTime);\n }, ${this.interval});\n `}start(e){this.stop(),this.runWorker(e)}stop(){this.worker&&(this.worker.terminate(),delete this.worker)}runWorker(e){this.worker||(this.worker=new Worker(URL.createObjectURL(new Blob([this.workerScript],{type:"text/javascript"}))),this.worker.onmessage=t=>e(t.data))}}class D extends h.B{constructor(){super()}}l.c;class P{constructor(e,t,s,i){this._message=e,this._onMessage=t,this._onError=s,this._isSubscription=i}get sentMessage(){return this._message}get onReceivedMessage(){return this._onMessage}get onReceivedError(){return this._onError}get isSubscription(){return this._isSubscription}}let w=class{get isConfigured(){return this.status.isConfigured}get isConnecting(){return this.status.isConnecting}get isConnected(){return this.status.isConnected}get isConnectedSubject(){return this.status.isConnectedSubject}get isDisconnected(){return this.status.isDisconnected}get isDisconnectedByServer(){return this.status.isDisconnectedByServer}get isReconnecting(){return this.status.isReconnecting}get hasValidSession(){return _.v.deprecated("get hasValidSession","Use `User.isAuthenticated` from `@genesislcap/foundation-user` instead.","15.0.0"),this.user.isAuthenticated}set hasValidSession(e){_.v.deprecated("set hasValidSession","Please refrain from calling this API as this state is managed internally.","15.0.0")}get host(){var e;return null!==(e=this.url)&&void 0!==e?e:n.vN}constructor(e,t,s,i,r,n,o){this.messageBuilder=e,this.session=t,this.serializer=s,this.uuid=i,this.status=r,this.user=n,this.config=o,this.defaultInterval=1e4,this.secondsMultiplier=1e3,this.heartbeatIsEnabled=!0,this.heartbeatInterval=this.defaultInterval,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=n.vN,t,s){var r;return this.url=e,this.connectOptions=null!=t?t:this.config.connect,this.reconnectOptions=null!=s?s:this.config.reconnect,(null===(r=this.config.isWebSocketExpression)||void 0===r?void 0:r.test(this.host))?new Promise(e=>{var t,s,r,n;_.v.info(`${this.isReconnecting?"Reconnecting":"Connecting"} to ${this.url}`),this.status.isConnecting=!this.isReconnecting;(!this.isReconnecting||!(null===(t=this.reconnectOptions)||void 0===t?void 0:t.reconnectStreams))&&this.cleanMessages(),null===(s=this.socketSubscription)||void 0===s||s.unsubscribe(),this.websocket=new T.Q({url:this.url,openObserver:{next:()=>{this.session.setSessionStorageItem("hostUrl",this.url),this.status.isConnected=!0,this.prepareHeartbeat(),_.v.info("WebSocket connection is now open"),e(this.isConnected)}},closeObserver:{next:t=>{this.status.onClose(t),this.isDisconnectedByServer&&_.v.info(`WebSocket connection was closed due an error - Code: ${t.code} ${t.reason?" | Reason: "+t.reason:""}`),e(this.isConnected)}},serializer:e=>this.serializer.serialize(e),deserializer:e=>this.serializer.deserialize(e)});this.socketSubscription=this.websocket.subscribe(null!==(n=null===(r=this.connectOptions)||void 0===r?void 0:r.connectObserver)&&void 0!==n?n:{next:e=>(0,i.sH)(this,void 0,void 0,function*(){var t;const s=`Response Message received for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,s);const{SOURCE_REF:i,MESSAGE_TYPE:r}=e,n=this.getMessageHandler(i,r);if(!n)return void(e.MESSAGE_TYPE===f.Go.MSG_NACK&&e.ERROR&&e.ERROR.forEach(t=>{_.v.error(`MessageType: ${e.MESSAGE_TYPE} | Error Details:`,t)}));let o=!1;switch(e.MESSAGE_TYPE){case f.Gp.EVENT_LOGIN_AUTH_ACK:{const s=e.DETAILS;s.HEARTBEAT_INTERVAL_SECS&&void 0===(null===(t=this.connectOptions)||void 0===t?void 0:t.heartbeatInterval)&&(this.heartbeatInterval=s.HEARTBEAT_INTERVAL_SECS*this.secondsMultiplier,this.prepareHeartbeat());break}case f.Go.LOGOUT_ACK:return n.onReceivedMessage.call(this,e),void this.cleanMessages();case f.Go.LOGON_ACK:return;case f.Go.LOGOFF_ACK:break;case f.Go.QUERY_UPDATE:n.isSubscription||this.sendDataLogoff(i);break;case f.Go.MSG_NACK:case f.Go.LOGON_NACK:o=!0}o?n.onReceivedError.call(this,{receivedMessage:e,sentMessage:n.sentMessage}):n.onReceivedMessage.call(this,e),this.wsMessages.next(e),n.isSubscription||this.removeMessageHandler(i)}),error:e=>{_.v.debug("Error found: ",e),this.reconnect()},complete:()=>{var e;this.isDisconnectedByServer&&(null===(e=this.connectOptions)||void 0===e?void 0:e.alwaysOn)?this.reconnect():_.v.info("Connection is now closed")}}),this.status.isConfigured=!0}):(_.v.error(`Specified host (${this.host}) is not valid WebSocket url. Connection will not proceed.`),void _.v.warn("Make sure the host url starts with wss:// or ws://"))}handleExpiredSession(){return(0,i.sH)(this,void 0,void 0,function*(){if(this.session.getSessionStorageItem("refreshToken")){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.send(e);this.session.setAuthResult(t),this.updateSessionAndSubscriptions(t)}else yield this.handleCookieBasedReauth()})}handleCookieBasedReauth(){return(0,i.sH)(this,void 0,void 0,function*(){const e=yield(0,L.$G)();e!==L.vE.HANDLED_BY_OTHER_TAB?e!==L.vE.FAILED&&(yield this.connect()):(0,L.Z8)(()=>this.connect())})}updateSessionAndSubscriptions(e){(null==e?void 0:e.MESSAGE_TYPE)===f.Gp.EVENT_LOGIN_AUTH_ACK&&this.wsMessageHandlers.forEach(t=>{t.isSubscription&&(t.sentMessage.SESSION_AUTH_TOKEN=e.SESSION_AUTH_TOKEN,this.websocket.next(t.sentMessage))})}prepareHeartbeat(){var e,t,s,r;this.heartbeatTicker&&this.heartbeatTicker.stop();const n=()=>(0,i.sH)(this,void 0,void 0,function*(){var e,t,s;if(!this.isConnected)return;const i=this.messageBuilder.createHeartbeatPingMessage(null===(e=this.connectOptions)||void 0===e?void 0:e.verboseHeartbeat);(null===(t=this.connectOptions)||void 0===t?void 0:t.heartbeatPingCallback)&&this.connectOptions.heartbeatPingCallback(i);const r=yield this.send(i);this.user.isAuthenticated&&!r.IS_AUTHENTICATED&&this.handleExpiredSession(),(null===(s=this.connectOptions)||void 0===s?void 0:s.heartbeatPongCallback)&&this.connectOptions.heartbeatPongCallback(r),this.heartbeatIsEnabled=r.MESSAGE_TYPE===f.Go.HEARTBEAT_PONG&&r.SOURCE_REF===i.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!==(r=null===(s=this.connectOptions)||void 0===s?void 0:s.heartbeatInterval)&&void 0!==r?r:this.heartbeatInterval;this.heartbeatTicker=new y(e),this.heartbeatTicker.start(()=>{this.websocket&&this.isConnected&&(n(),this.heartbeatLoggingIsEnabled&&_.v.debug(`Sending a heartbeat ping every ${e} ms`))})}}reconnect(){var e,t,s,i,r;const n=!(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||n)return;this.status.isReconnecting=!0;const o=(null===(s=this.reconnectOptions)||void 0===s?void 0:s.reconnectStrategy)===M.Exponential?b:N,a=this.isConnectedSubject.asObservable().pipe((0,S.n)(e=>e?(0,u.of)(-1):((e,t)=>new l.c(s=>{let i,r=0;return function n(){s.next(r),clearTimeout(i),i=setTimeout(n,t(e,r)),r+=1}(),()=>{clearTimeout(i)}}))(this.reconnectOptions,o).pipe((0,v.Z)(e=>{var t,s,i;let r;return r=(null===(t=this.connectOptions)||void 0===t?void 0:t.alwaysOn)?e+1:null!==(i=null===(s=this.reconnectOptions)||void 0===s?void 0:s.reconnectAttempts)&&void 0!==i?i:10,e<r?(0,u.of)(e):(this.status.reconnectionLimitReached=!0,(0,E.$)(()=>new Error(`Max reconnect attempts ${r} reached.`)))}))),(0,R.v)(()=>this.websocket&&!this.isConnected));a.subscribe(null!==(r=null===(i=this.reconnectOptions)||void 0===i?void 0:i.reconnectObserver)&&void 0!==r?r:{next:e=>{_.v.debug(`Attempt no. ${e+1} to reconnect`),this.websocket.complete(),this.connect(this.url,this.connectOptions,this.reconnectOptions)},error:e=>{var t;_.v.debug(e),null===(t=this.socketSubscription)||void 0===t||t.unsubscribe(),this.status.isReconnecting=!1},complete:()=>{_.v.info(this.isConnected?"Reconnected":"Disconnected"),this.status.isReconnecting=!1,this.wsMessageHandlers.forEach(e=>{e.isSubscription&&this.websocket.next(e.sentMessage)})}})}reset(){this.status.isConnected=!1,this.status.isConfigured=!1,this.websocket&&this.websocket.complete(),this.websocket=null,this.cleanMessages()}cleanMessages(){this.wsMessages&&this.wsMessages.complete(),this.wsMessages=new D,this.wsMessageHandlers=new Map}send(e,t=!0){if(!this.isConnected)return Promise.reject(new Error("WebSocket connection is closed"));const s=`Sending Message for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,s),new Promise((s,i)=>{const r=e=>{s(e)},n=e=>{i(e)};t&&this.setMessageHandler(e,r,n),this.websocket.next(e)})}sendForStream(e,t,s,i){if(!this.isConnected)return(0,E.$)(()=>new Error("WebSocket connection is closed"));const r=`Sending Message (stream) for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,r),this.setMessageHandler(e,t,s,!0),c.DOM.queueUpdate(()=>this.websocket.next(e)),new l.c(t=>{const s=new h.B;return this.wsMessages.pipe((0,m.p)(t=>t.SOURCE_REF===e.SOURCE_REF),(0,g.Q)(s)).subscribe({next:e=>{t.next(e)},error:e=>{t.error(e)},complete:()=>{t.complete()}}),()=>{s.complete(),this.sendDataLogoff(e.SOURCE_REF),this.removeMessageHandler(e.SOURCE_REF),i&&i()}})}sendForStreamWithoutTeardown(e,t,s){if(!this.isConnected)return(0,E.$)(()=>new Error("WebSocket connection is closed"));const i=`Sending Message (stream) for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,i),this.setMessageHandler(e,t,s,!0),this.websocket.next(e),this.wsMessages.pipe((0,m.p)(t=>t.SOURCE_REF===e.SOURCE_REF))}setMessageHandler(e,t,s,i=!1){const r=`Setting Message Handler for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.debug,r),this.wsMessageHandlers.set(e.SOURCE_REF,new P(e,t,s,i))}sendDataLogoff(e){this.send(this.messageBuilder.createDataLogoffMessage(e),!1)}removeMessageHandler(e){this.wsMessageHandlers.delete(e)}getMessageHandler(e,t){const s=`Getting Message Handler for SourceRef: ${e} | MessageType: ${t}`;return this.logMessageTypeFlow(t,_.v.debug,s),this.wsMessageHandlers.get(e)}logMessageTypeFlow(e,t,s){switch(e){case f.Gp.DATA_LOGOFF:t(s);break;case f.Go.HEARTBEAT_PING:case f.Go.HEARTBEAT_PONG:this.heartbeatLoggingIsEnabled&&t(s);break;default:this.messageLoggingIsEnabled&&t(s)}}};(0,i.Cg)([c.observable],w.prototype,"websocket",void 0),(0,i.Cg)([c.observable],w.prototype,"wsMessages",void 0),(0,i.Cg)([c.observable],w.prototype,"wsMessageHandlers",void 0),(0,i.Cg)([O.l],w.prototype,"http",void 0),(0,i.Cg)([c.observable],w.prototype,"heartbeatIsEnabled",void 0),w=(0,i.Cg)([(0,i.Qj)(0,f.lT),(0,i.Qj)(1,p.N),(0,i.Qj)(2,o.b_),(0,i.Qj)(3,a.k),(0,i.Qj)(4,U.S5),(0,i.Qj)(5,r.KJ),(0,i.Qj)(6,A.R)],w);const G=d.DI.createInterface(e=>e.singleton(w));function F(){return d.DI.getOrCreateDOMContainer().get(G)}},48707:(e,t,s)=>{s.d(t,{X:()=>o,a:()=>a});var i=s(39087),r=s(17465),n=s(41119);const o=e=>e?e.map(e=>{const t={name:e.NAME,type:n.v[e.TYPE]||n.w.STRING};if(e.TYPE===n.w.ENUM&&e.VALID_VALUES)try{t.enumOptions=Array.isArray(e.VALID_VALUES)?e.VALID_VALUES:e.VALID_VALUES.split("|")}catch(e){r.v.error(e),t.enumOptions=[]}return t}):null,a=e=>{var t;const s=null==e?void 0:e.TYPE;if(s===i.v.DATASERVER)return e.FIELD||[];if(s===i.v.REQUEST_SERVER)return e.REPLY_FIELD||(null===(t=e.REPLY)||void 0===t?void 0:t.FIELD)||[];throw new Error(`Unsupported resource type: ${s}`)}},49229:(e,t,s)=>{s.d(t,{b_:()=>h});var i=s(55823),r=s(84674),n=s(61455);const o=r.DI.createInterface();function a(e){return Number.isSafeInteger(+e)?Number(e):(0,n.Fq)(e)?BigInt.asIntN(64,e):parseFloat(e)}const c={parse:e=>(0,n.qg)(e,null,a),stringify:e=>(0,n.As)(e)};let d=class{constructor(e=c){this.config=e,this.serialize=e=>this.config.stringify(e)}deserialize(e){return e?"string"==typeof e?this.config.parse(e):e&&e.ok?e.text().then(e=>this.config.parse(e)):(e&&e.data&&(e=e.data),this.config.parse(e)):Promise.resolve({})}};d=(0,i.Cg)([(0,i.Qj)(0,(0,r.optional)(o))],d);const h=r.DI.createInterface(e=>e.singleton(d))},49587:(e,t,s)=>{s.d(t,{R:()=>n});var i=s(84674);const r={connect:{alwaysOn:!1,enableHeartbeat:!0,enableHeartbeatLogging:!1,heartbeatInterval:1e4,verboseHeartbeat:!1,enableMessageLogging:!1},reconnect:{reconnectAttempts:10,reconnectInterval:1e4,reconnectStreams:!0},isWebSocketExpression:new RegExp(/wss?:\/\/[-a-zA-Z0-9@:%._\+~#=]{1,256}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)\b\/*$/,"i")},n=i.DI.createInterface(e=>e.instance(r))},56653:(e,t,s)=>{var i;s.d(t,{h:()=>i,l:()=>r}),function(e){e.BASIC="BASIC",e.SSO="SSO",e.JWT="JWT",e.REFRESH="REFRESH"}(i||(i={}));class r extends Error{constructor(e,t,s="Auth Failed \n"){super(s),this.sent=e,this.received=t,Object.setPrototypeOf(this,r.prototype)}isIgnorableError(){var e,t,s,i,r,n,o,a;return!!(null===(i=null===(s=null===(t=null===(e=this.received)||void 0===e?void 0:e.DETAILS)||void 0===t?void 0:t.ERROR)||void 0===s?void 0:s.toLowerCase())||void 0===i?void 0:i.includes("request needs the user to be logged"))||!!(null===(a=null===(o=null===(n=null===(r=this.received)||void 0===r?void 0:r.DETAILS)||void 0===n?void 0:n.ERROR)||void 0===o?void 0:o.toLowerCase())||void 0===a?void 0:a.includes("is not logged in"))}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,s,i;return Array.isArray(null===(t=null===(e=this.received)||void 0===e?void 0:e.DETAILS)||void 0===t?void 0:t.ERROR)?null===(i=null===(s=this.received)||void 0===s?void 0:s.DETAILS)||void 0===i?void 0:i.ERROR.map(e=>this.errorDetailFormatter(e)).join("\n"):""}hasPasswordExpiredError(){return this.hasErrorCode("PASSWORD_EXPIRED")}hasMFAError(){return this.hasErrorCode("MFA_REQUIRED")||this.hasErrorCode("MFA_FAILED")}requiresTermsAndConditions(){return this.hasErrorCode("TERMS_ACCEPTANCE_REQUIRED")}hasErrorCode(e){var t,s;return!!Array.isArray(null===(t=this.received)||void 0===t?void 0:t.ERROR)&&(null===(s=this.received)||void 0===s?void 0:s.ERROR.some(t=>t.CODE===e))}errorDetailFormatter(e){return`\n ${e.CODE}: \n ${e.TEXT}`}}},68424:(e,t,s)=>{s.d(t,{DW:()=>n,JH:()=>o});var i=s(52945),r=s(28745);function n(e,t){let s=e;for(;s;){const e=s.tagName.toLowerCase();if(e.endsWith("-design-system-provider")){const t=e.split("-design-system-provider")[0];if(t)return r.v.debug(`Found provider by ancestor search: ${e}, prefix: ${t}`),{element:s,prefix:t}}s=s.parentElement?s.parentElement:s.getRootNode&&s.getRootNode()instanceof ShadowRoot?s.getRootNode().host:null}const n=document.querySelectorAll('[class*="-design-system-provider"],[id*="-design-system-provider"]'),o=Array.from(n),a=(0,i.fI)(document).filter(e=>{var t;const s=null===(t=e.tagName)||void 0===t?void 0:t.toLowerCase();return(null==s?void 0:s.endsWith("-design-system-provider"))||!1});if(o.push(...a),o.length>0){const e=o[0],t=e.tagName.toLowerCase(),s=t.split("-design-system-provider")[0];if(s)return r.v.debug(`Found provider by document search: ${t}, prefix: ${s}`),{element:e,prefix:s}}return r.v.debug(`No provider found. Falling back to ${t}.`),{element:null,prefix:t}}function o(e,t){return n(e,t).prefix}},77679:(e,t,s)=>{s.d(t,{m:()=>i});const i=e=>{const t=window.location.href,s=new URL(t).search,i=new URLSearchParams(s),r=`feature.${e}`.toLowerCase();for(const[e]of i.entries())if(e.toLowerCase()===r)return!0;return!1}},79780:(e,t,s)=>{s.d(t,{Es:()=>n});var i=s(84674);class r extends BroadcastChannel{constructor(){super(...arguments),this.postMessage=(...e)=>{const[t,s]=e;super.postMessage({type:t,detail:s})},this.isMessageType=(e,t)=>{var s;return(null===(s=t.data)||void 0===s?void 0:s.type)===e}}}const n=e=>{class t extends r{constructor(){super(e)}}return i.DI.createInterface(e=>e.transient(t))}},84686:(e,t,s)=>{s.d(t,{Be:()=>v,H6:()=>O,OB:()=>n,PF:()=>o,aW:()=>g,vN:()=>c});var i=s(77679);let r="webpack";try{r="webpack"}catch(e){}let n="/";try{n="auto".replace(/\/$/,"")}catch(e){}let o,a="gwf";try{"undefined"!=typeof SOCKET_EXT&&(a=SOCKET_EXT)}catch(e){}try{o=FORCE_HTTP}catch(e){}const c=`${location.protocol.replace("http","ws")}//${location.host}${n}/${a}/`;"true"===o||(0,i.m)("forceHttp")?location.protocol:location.protocol.replace("http","ws");let d,h,l,u,E=null;try{"undefined"!=typeof API_HOST&&(E=API_HOST)}catch(e){}try{d=""}catch(e){}try{h=DEFAULT_ORGANISATION}catch(e){}try{l=DEFAULT_PASSWORD}catch(e){}try{u=DEFAULT_USER}catch(e){}let g="gwf/event-login-auth";"undefined"!=typeof GENX_LOGIN_URL&&(g=GENX_LOGIN_URL);let S="gwf/event-login-auth";"undefined"!=typeof GENX_LOGIN_REFRESH_URL&&(S=GENX_LOGIN_REFRESH_URL);let v="gwf/event-login-details";"undefined"!=typeof GENX_LOGIN_DETAILS_URL&&(v=GENX_LOGIN_DETAILS_URL);let R="gwf/event-logout";"undefined"!=typeof GENX_LOGOUT_URL&&(R=GENX_LOGOUT_URL);let m="gwf/event-change-user-password";"undefined"!=typeof GENX_CHANGE_PASSWORD_URL&&(m=GENX_CHANGE_PASSWORD_URL);let T="gwf/event-self-service-password-reset";"undefined"!=typeof GENX_FORGOT_PASSWORD_URL&&(T=GENX_FORGOT_PASSWORD_URL);let p="gwf/event-password-reset-action";"undefined"!=typeof GENX_RESET_PASSWORD_URL&&(p=GENX_RESET_PASSWORD_URL);let _="gwf/sso/list";"undefined"!=typeof GENX_SSO_LIST_URL&&(_=GENX_SSO_LIST_URL);let A="gwf/{type}/login?idp={id}";"undefined"!=typeof GENX_SSO_LOGIN_URL&&(A=GENX_SSO_LOGIN_URL);let O="default";"undefined"!=typeof GENX_ENVIRONMENT_LEVEL&&(O=GENX_ENVIRONMENT_LEVEL);let f="gwf/auth/accept-terms";"undefined"!=typeof GENX_ACCEPT_TERMS_URL&&(f=GENX_ACCEPT_TERMS_URL)},92277:(e,t,s)=>{s.d(t,{KJ:()=>E});var i=s(55823),r=s(17190),n=s(33681),o=s(84674),a=s(79780);const c=(0,s(63170).createLogger)("foundation-user"),d={trackActionExclusions:[],trackPathExclusions:[""],setUser(e,t){if(e.isAuthenticated)throw new Error("User already set. If this is intentional, please call User.unset first.");return c.debug("setUser",t),e.rawProperties=structuredClone(t),e.userKVs=t.userKVs,e.details=t.details,e.permission=t.permission,e.profile=t.profile,e.sourceRef=t.sourceRef,e.userName=t.userName,e.isAuthenticated=!0,e},unsetUser:e=>(c.debug("unsetUser"),e.rawProperties=void 0,e.userKVs=void 0,e.details=void 0,e.permission=void 0,e.profile=void 0,e.sourceRef=void 0,e.userName=void 0,e.isAuthenticated=!1,e)},h=o.DI.createInterface(e=>e.instance(d)),l=(0,a.Es)("genesis-user");class u{constructor(){this.pathHistory=[],this.actionHistory=[],this.isAuthenticated=!1,this.authenticationChangeListeners=(0,r.r)()}set(e){return this.config.setUser(this,e)}unset(){return this.config.unsetUser(this)}get isAnonymous(){return!this.isAuthenticated}isAdmin(){return this.hasProfile("ADMIN")}isBanned(){return this.hasProfile("BANNED")}hasPermission(e){return this.hasKey(this.permission,e)}hasProfile(e){return this.hasKey(this.profile,e)}trackPath(){const{pathname:e,search:t,hash:s}=location,i=`${`${"/"!==e?e:""}`}${t}${s}`;if(!this.config.trackPathExclusions.includes(i))return this.pathHistory.push(i),i}clearPaths(){this.pathHistory=[]}lastPath(){const e=this.pathHistory.length;return e>0?this.pathHistory[e-1]:void 0}trackAction(e){this.config.trackActionExclusions.includes(e)||this.actionHistory.push(e)}clearActions(){this.actionHistory=[]}lastAction(){const e=this.actionHistory.length;return e>0?this.actionHistory[e-1]:void 0}clearTrackingHistory(){this.clearPaths(),this.clearActions()}hasKey(e,t){return!!(e&&e.length&&t)&&(Array.isArray(t)||(t=[t]),t.some(t=>e.includes(t)))}addAuthenticationChangeListener(e){var t;return null===(t=this.authenticationChangeListeners)||void 0===t?void 0:t.subscribe(e)}isAuthenticatedChanged(){var e;null===(e=this.authenticationChangeListeners)||void 0===e||e.publish(new CustomEvent("user-authentication-change",{detail:this.isAuthenticated}));const t=o.DI.getOrCreateDOMContainer().get(l);t.postMessage("user-authentication-change",this.isAuthenticated),t.close()}userNameChanged(){n.Observable.notify(this,"username")}get username(){return n.Observable.track(this,"username"),this.userName}permissionChanged(){n.Observable.notify(this,"permissions")}get permissions(){return n.Observable.track(this,"permissions"),this.permission}profileChanged(){n.Observable.notify(this,"profiles")}get profiles(){return n.Observable.track(this,"profiles"),this.profile}hasAdminProfile(){return this.isAdmin()}}(0,i.Cg)([h],u.prototype,"config",void 0),(0,i.Cg)([n.observable],u.prototype,"pathHistory",void 0),(0,i.Cg)([n.observable],u.prototype,"actionHistory",void 0),(0,i.Cg)([n.observable],u.prototype,"isAuthenticated",void 0),(0,i.Cg)([n.observable],u.prototype,"userKVs",void 0),(0,i.Cg)([n.observable],u.prototype,"details",void 0),(0,i.Cg)([n.observable],u.prototype,"permission",void 0),(0,i.Cg)([n.observable],u.prototype,"profile",void 0),(0,i.Cg)([n.observable],u.prototype,"sourceRef",void 0),(0,i.Cg)([n.observable],u.prototype,"userName",void 0),(0,i.Cg)([n.observable],u.prototype,"rawProperties",void 0);const E=o.DI.createInterface(e=>e.singleton(u))},96730:(e,t,s)=>{function i(e,t=";"){return e?e.split(t).map(e=>e.trim()).sort((e,t)=>e.localeCompare(t)).join(t):e}s.d(t,{Q:()=>i})},98316:(e,t,s)=>{s.d(t,{N:()=>n});var i=s(84674);class r{constructor(){this.storageKeyPrefix="",this.returnUrl=this.getSessionStorageItem("returnUrl")||""}deleteUserFromSessionStorage(){["authToken","refreshToken","sessionId","ssoToken"].forEach(e=>this.removeSessionStorageItem(e)),this.removeLocalStorageItem("refreshToken")}setStorageKeyPrefix(e){this.storageKeyPrefix=`${e.replace(/\s/g,"")}/`}setAuthResult(e){var t;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),(null===(t=e.DETAILS)||void 0===t?void 0:t.MFA_CODE)&&this.setSessionStorageItem("mfaToken",e.DETAILS.MFA_CODE)}captureReturnUrl(){const{pathname:e,search:t,hash:s}=location;if(e&&(e.includes("/login")||e.includes("/auth")))return;const i=`${"/"!==e?e:""}`;this.returnUrl=`${i}${t}${s}`,this.setSessionStorageItem("returnUrl",this.returnUrl)}setItem(e,t,s){"local"===s?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 n=i.DI.createInterface(e=>e.singleton(r))}}]);
2
2
  //# sourceMappingURL=347.dc20c3579c9073997e093bb6d65c2cde.js.map