@genesislcap/design-system-configurator 14.172.3 → 14.173.1

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.
@@ -172,7 +172,7 @@
172
172
  `)}
173
173
  `;class W extends s.Avatar{}const q={delegatesFocus:!0,mode:"open"},K={media:Y},X=W.compose(Object.assign({baseName:"avatar",template:U,styles:G,shadowOptions:q},K)),Z=(e,t)=>r.css`
174
174
  ${(0,s.badgeStyles)(e,t)}
175
- `,Q=(e,t)=>(0,n.badgeTemplate)(e,t);class J extends s.Badge{}const ee=void 0,te={},oe=J.compose(Object.assign({baseName:"badge",template:Q,styles:Z,shadowOptions:ee},te));var ie=o(65293);const ae=(0,ie.createLogger)("foundation-ui"),ne=r.css`
175
+ `,Q=(e,t)=>(0,n.badgeTemplate)(e,t);class J extends s.Badge{}const ee=void 0,te={},oe=J.compose(Object.assign({baseName:"badge",template:Q,styles:Z,shadowOptions:ee},te));var ie=o(42534);const ae=(0,ie.createLogger)("foundation-ui"),ne=r.css`
176
176
  @keyframes delete-animate {
177
177
  from {
178
178
  height: 100px;
@@ -495,7 +495,7 @@
495
495
  ${Ue()}
496
496
  `,We=void 0,qe={};class Ke extends n.FoundationElement{constructor(){super(...arguments),this.name="",this.autoPosition=!0,this.search=!0,this.disabled=!1,this.clickOutside=e=>this.handleClickOutside(e),this.open=!1,this.options=[],this.selectedOptions=[],this.position=ze.BELOW}openChanged(e,t){var o,i;t?(document.addEventListener("mousedown",this.clickOutside),null===(o=this.optionsElement)||void 0===o||o.classList.add("visible")):(document.removeEventListener("mousedown",this.clickOutside),null===(i=this.optionsElement)||void 0===i||i.classList.remove("visible"))}connectedCallback(){var e;super.connectedCallback(),this.position===ze.ABOVE&&(null===(e=this.optionsElement)||void 0===e||e.classList.add("position-above"))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousedown",this.clickOutside)}toggle(){this.open||this.setDropdownPosition(),this.open=!this.open}sortFilteredOptions(e){const t=(null!=e?e:this.options).reduce(((e,t)=>{const o=t.type||"Other";return e[o]?e[o].options.push(t):e[o]={type:o,options:[t]},e}),{});return Object.values(t)}optionsChanged(){this.filteredAvailableOptions=this.sortFilteredOptions()}setDropdownPosition(){let e=this.position;if(this.autoPosition){let t=this.assignedSlot?this.assignedSlot.parentElement:this.parentElement;for(;t&&!t.classList.contains("content-wrapper");)t=t.parentElement;if(t){const o=t.getBoundingClientRect(),i=this.getBoundingClientRect(),a=o.top+o.height/2;e=i.top<a?ze.BELOW:ze.ABOVE}else{const t=this.getBoundingClientRect(),o=window.innerHeight,i=t.top,a=o-t.bottom;e=a<t.height&&i>a?ze.ABOVE:ze.BELOW}}e===ze.ABOVE?(this.optionsElement.classList.add("position-above"),this.optionsElement.classList.remove("position-below")):e===ze.BELOW&&(this.optionsElement.classList.add("position-below"),this.optionsElement.classList.remove("position-above"))}optionGetter(e){return e.value}getItemLabel(e){let t;return e?(t=e.label||e.value||"",this.valueFormatter?this.valueFormatter(t):t):""}isOptionDisabled(e){return e&&"string"!=typeof e&&e.disabled||!1}get getPlaceholder(){return`Search ${this.name}`.trim().concat("...")}isOptionSelected(e){return this.selectedOptions.includes(this.optionGetter(e))}selectCheckboxOne(e){const t=this.optionGetter(e);this.selectedOptions.includes(t)?(this.selectedOptions=[...this.selectedOptions],this.selectedOptions.splice(this.selectedOptions.indexOf(t),1)):this.selectedOptions=[...this.selectedOptions,t],this.$emit("selectionChange",this.selectedOptions)}setFilter(){const e=this.options.filter((e=>{var t;const o=e.description,i=null!==(t=e.label)&&void 0!==t?t:e.value;return(null==o?void 0:o.toLowerCase().includes(this.filterSearchValue.toLowerCase()))||i.toLowerCase().includes(this.filterSearchValue.toLowerCase())?e:void 0}));this.filteredAvailableOptions=this.sortFilteredOptions(e)}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){C(e,this)&&(this.open=!1)}}(0,x.__decorate)([r.attr],Ke.prototype,"name",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean",attribute:"auto-position"})],Ke.prototype,"autoPosition",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],Ke.prototype,"search",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],Ke.prototype,"disabled",void 0),(0,x.__decorate)([r.observable],Ke.prototype,"defaultSlottedNodes",void 0),(0,x.__decorate)([r.observable],Ke.prototype,"valueFormatter",void 0),(0,x.__decorate)([r.observable],Ke.prototype,"filterSearchValue",void 0),(0,x.__decorate)([r.observable],Ke.prototype,"open",void 0),(0,x.__decorate)([r.observable],Ke.prototype,"options",void 0),(0,x.__decorate)([r.observable],Ke.prototype,"selectedOptions",void 0),(0,x.__decorate)([r.observable],Ke.prototype,"filteredAvailableOptions",void 0),(0,x.__decorate)([r.observable],Ke.prototype,"position",void 0),(0,x.__decorate)([r.volatile],Ke.prototype,"getPlaceholder",null);const Xe=Ke.compose(Object.assign({baseName:"categorized-multiselect",template:Ye,styles:Ve,shadowOptions:We},qe)),Ze=(e,t)=>r.css`
497
497
  ${(0,s.checkboxStyles)(e,t)}
498
- `,Qe=(e,t)=>(0,n.checkboxTemplate)(e,t);class Je extends s.Checkbox{}const et=void 0,tt={checkedIndicator:'\n <svg\n aria-hidden="true"\n part="checked-indicator"\n class="checked-indicator"\n viewBox="0 0 20 20"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M8.143 12.6697L15.235 4.5L16.8 5.90363L8.23812 15.7667L3.80005 11.2556L5.27591 9.7555L8.143 12.6697Z"\n />\n </svg>\n ',indeterminateIndicator:'\n <div part="indeterminate-indicator" class="indeterminate-indicator"></div>\n '},ot=Je.compose(Object.assign({baseName:"checkbox",template:Qe,styles:Ze,shadowOptions:et},tt));var it=o(39087),at=o(62051),nt=o.n(at),st=o(96730),rt=o(21281),lt=o(34193),dt=o(61503),ct=o(60949),ut=o(97156);class pt extends n.FoundationElement{constructor(){super(...arguments),this.withGridInit=!0,this.isSnapshot=!1,this.maxRows=it.OD.MAX_ROWS_250,this.maxView=it.OD.MAX_VIEW_1000,this.reverse=!1,this.rowId="ROW_REF",this.withTimestampFormatting=!0,this.requiresFullDataRefresh=!0,this.rowsSyncedWithStream=new Map,this.dataSubWasLoggedOff=!1,this.criteriaFromFilters=new Map,this.update=new ut.t(new Map)}criteriaChanged(e,t){const o=e!==(0,st.Q)(t,";");this.datasource.initialized&&o&&(this.dataSub&&(this.dataSub.unsubscribe(),this.dataSub=void 0),this.fetchGenesisData(null))}dataChanged(e){e&&(this.clearData(),this.reset())}set datasourceConfig(e){e&&Object.keys(e).forEach((t=>{void 0!==e[t]&&(this[t]=e[t])}))}disconnectedCallback(){var e,t;super.disconnectedCallback(),this.clearData(),null===(e=this.dataSub)||void 0===e||e.unsubscribe(),null===(t=this.update)||void 0===t||t.unsubscribe(),delete this.dataSub,delete this.update,this.datasource.destroy(),delete this.datasource}reset(){this.requiresFullDataRefresh=!0,this.fetchGenesisData()}fetchGenesisData(e=!0){return(0,x.__awaiter)(this,void 0,void 0,(function*(){if(this.data)return void this.syncComponentData(this.data);const t=e||!this.datasource.initialized;t||(this.connect.dataLogoff(this.sourceRef),this.clearData());if(yield this.datasource.init(this.datasourceOptions(),t))if(this.isSnapshot){const e=yield this.datasource.snapshotFiltered();this.syncComponentData(e)}else ae.debug(`requesting stream for ${this.resourceName}`),this.dataSub=this.datasource.stream.subscribe((e=>{this.sourceRef=e.SOURCE_REF;const t=e.MESSAGE_TYPE;if(t&&t===rt.Go.LOGOFF_ACK)this.dataSubWasLoggedOff=!0;else if(this.dataSubWasLoggedOff=!1,e.ROW){const t=(0,lt.d)(e);this.handleStreamUpdate(t)}else this.handleStreamUpdate(e)}));else ae.debug(`Genesis Datasource init failed for ${this.resourceName}`)}))}initDatasource(){return(0,x.__awaiter)(this,void 0,void 0,(function*(){yield this.datasource.init(this.datasourceOptions(),!0)}))}datasourceOptions(){return{criteria:this.buildCriteria(),fields:this.fields,isSnapshot:this.isSnapshot,orderBy:this.orderBy,resourceName:this.resourceName,request:this.request,reverse:this.reverse,maxRows:this.maxRows,maxView:this.maxView}}handleStreamUpdate(e){if(!e)return;e.hasOwnProperty("REPLY")?this.applyRequestServerData(e):this.applyDataserverData(e)}applyRequestServerData(e){var t,o;if(!Array.isArray(e.REPLY)||!(null===(t=e.MESSAGE_TYPE)||void 0===t?void 0:t.startsWith("REP_")))return void ae.error("received invalid RequestServerResult",e);if(this.requiresFullDataRefresh){"ROW_REF"!==this.rowId&&(null===(o=e.REPLY)||void 0===o||o.forEach((e=>{this.rowsSyncedWithStream.set(e[this.rowId],e)})));const t=this.rowsSyncedWithStream.size>0?Array.from(this.rowsSyncedWithStream.values()):e.REPLY;return void this.syncComponentData(t)}this.handleStreamInserts(e.REPLY);const i=Array.from(this.rowsSyncedWithStream.values()).filter((t=>!e.REPLY.includes(t)));this.handleStreamDeletes(i)}applyDataserverData(e){var t,o,i,a;if(this.requiresFullDataRefresh){null===(t=e.inserts)||void 0===t||t.forEach((e=>{this.rowsSyncedWithStream.set(e[this.rowId],e)}));const o=Array.from(this.rowsSyncedWithStream.values());this.syncComponentData(o)}else(null===(o=e.inserts)||void 0===o?void 0:o.length)>0&&this.handleStreamInserts(e.inserts),(null===(i=e.deletes)||void 0===i?void 0:i.length)>0&&this.handleStreamDeletes(e.deletes),(null===(a=e.updates)||void 0===a?void 0:a.length)>0&&this.handleStreamUpdates(e.updates)}buildCriteria(){var e;const t=(null===(e=this.criteria)||void 0===e?void 0:e.split(";"))||[];return(0,st.Q)(t.join(" && "),";")}setFilter(e,t){this.criteriaFromFilters.set(e,t),this.update.next(this.criteriaFromFilters)}removeFilter(e){this.criteriaFromFilters.delete(e),this.update.next(this.criteriaFromFilters)}}(0,x.__decorate)([dt.dm],pt.prototype,"connect",void 0),(0,x.__decorate)([ct.yW],pt.prototype,"datasource",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],pt.prototype,"withGridInit",void 0),(0,x.__decorate)([r.attr],pt.prototype,"criteria",void 0),(0,x.__decorate)([r.observable],pt.prototype,"data",void 0),(0,x.__decorate)([r.attr],pt.prototype,"fields",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],pt.prototype,"isSnapshot",void 0),(0,x.__decorate)([r.attr],pt.prototype,"maxRows",void 0),(0,x.__decorate)([r.attr],pt.prototype,"maxView",void 0),(0,x.__decorate)([r.attr],pt.prototype,"orderBy",void 0),(0,x.__decorate)([r.attr],pt.prototype,"resourceName",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],pt.prototype,"reverse",void 0),(0,x.__decorate)([r.attr],pt.prototype,"rowId",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean",attribute:"with-timestamp-formatting"})],pt.prototype,"withTimestampFormatting",void 0);const ht=(0,ie.createLogger)("foundation-criteria");var mt;!function(e){e.AND="&&",e.OR="||",e.NOT="!",e.GT=">",e.GE=">=",e.LT="<",e.LE="<=",e.NE="!=",e.EQ="=="}(mt||(mt={}));class vt{constructor(e){this.$$operator=e}static And(){return new vt(mt.AND)}static Or(){return new vt(mt.OR)}static Not(){return new vt(mt.NOT)}static GreaterThan(){return new vt(mt.GT)}static GreaterThanOrEqual(){return new vt(mt.GE)}static LessThan(){return new vt(mt.LT)}static LessThanOrEqual(){return new vt(mt.LE)}static NotEqual(){return new vt(mt.NE)}static Equal(){return new vt(mt.EQ)}get operator(){return this.$$operator}}const gt="default";class ft{constructor(){this.expressions={},this.And=(e,t={})=>this.withExpression(e,t,vt.And()),this.Or=(e,t={})=>this.withExpression(e,t,vt.Or()),this.Not=(e,t={})=>this.withExpression(e,t,vt.Not())}withExpression(e,t={},o=vt.And()){const{condition:i,join:a,groupName:n}=t,s=(e,t=gt)=>{var n;const s=null!==(n=this.expressions[t])&&void 0!==n?n:[];this.expressions[t]=[...s,{join:o||a,condition:i,expression:e}]};if(Array.isArray(e))if(a){const t=e.filter((e=>{const t=e instanceof vt;return t&&ht.warn("Inline joins will be discarded when join is defined in ExpressionOptions"),!t}));if(n)t.forEach((e=>{s(e,n)}));else{const e=(r=a,t.flat().flatMap(((e,t,o)=>o.length-1!==t?[e,r]:e)));s(e,gt)}}else s(e,gt);else s(e,"string"==typeof e?gt:e.group);var r;return this}build(e){const t=Object.entries(this.expressions).reduce(((e,[t,o])=>Object.assign(Object.assign({},e),{[t]:`(${o.filter((({condition:e})=>!e||e())).map((({expression:e,join:t},o,i)=>this.parseExpression(e,i[o-1],t))).join("")})`})),{});return e?e(t):`(${Object.values(t).join(" && ")})`}reset(){this.expressions={}}parseExpression(e,t,o){const i=[];return o&&t&&i.push(` ${o.operator} `),"string"==typeof e?i.push(e):Array.isArray(e)?(e.forEach(((e,t,o)=>{if(e instanceof vt){if(o[t-1]instanceof vt)throw new Error("Adjacent Join operations detected")}})),i.push(`(${e.map((e=>this.parseExpression(e,void 0))).join("")})`)):e instanceof vt?i.push(` ${e.operator} `):e&&i.push(e.serialiser(e)),i.join("")}}const bt=e=>{const{value:t}=e;return e.valueGetter?e.valueGetter(t):"function"==typeof t?t(e):Array.isArray(t)?t.join(","):"string"==typeof t?`"${t}"`:t},yt=e=>t=>`${t.field} ${e} ${bt(t)}`,xt=e=>yt(mt.EQ)(e),wt=e=>`Expr.containsIgnoreCase(${e.field}, ${bt(e)})`;class $t{constructor(e){this.serialiser=xt,this.build=()=>{if(!this.field)throw new Error("Missing required param 'field'");if(void 0===this.value)throw new Error("Missing required param 'value'");if(!this.serialiser)throw new Error("Missing required param 'serialise'");return{field:this.field,value:this.value,serialiser:this.serialiser,params:this.params,valueGetter:this.valueGetter,group:this.group}},e&&(this.field=e.field,this.value=e.value,this.serialiser=e.serialiser,this.params=e.params,this.valueGetter=e.valueGetter,this.group=e.group)}withField(e){return this.field=e,this}withValue(e){return this.value=e,this}withSerialiser(e){return this.serialiser=e,this}withParams(e){return this.params=e,this}withValueGetter(e){return this.valueGetter=e,this}withGroup(e){return this.group=e,this}}function St(e,t){var o;const i=new ft;i.withExpression((new $t).withField(null!==(o=e.labelField)&&void 0!==o?o:e.valueField).withValue(t).withSerialiser(wt).build()),e.criteria=i.build()}function Ct(e,t){var o;const i=null!==(o=e.labelField)&&void 0!==o?o:e.valueField;e.request={[i]:`${t}*`},e.fetchGenesisData(!1)}var Ft;let kt=Ft=class extends pt{constructor(){super(...arguments),this.emptyDataLabel="No matching records",this.initalSelectedValueInitialized=!1,this.isSnapshot=!0}initialSelectedValueChanged(e,t){t&&(this.initalSelectedValueInitialized=!1)}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});var t,o;return(0,x.__awaiter)(this,void 0,void 0,(function*(){e.connectedCallback.call(this),this.fields=this.labelField?null===(t=this.valueField)||void 0===t?void 0:t.concat(" ",this.labelField):this.valueField,this.select=this.parentElement,this.optionElement=null!==(o=this.optionElement)&&void 0!==o?o:`${k(this.select)}-option`,this.select.addEventListener("change",(e=>{var t;const o=null===(t=this.options)||void 0===t?void 0:t.find((t=>t.label===e.target.value));this.select.$emit("value-change",o)})),this.select&&this.valueField&&(this.resourceName&&this.connect.isConnected||this.data)&&(this.select instanceof s.Combobox&&this.select.async&&this.initialSelectedValue?this.asyncModeIntialization():this.fetchGenesisData()),this.valueField||ae.warn('Specify field for values in options (e.g value-field="VALUE") and optionally field for label (e.g label-field="NAME")')}))}asyncModeIntialization(){return(0,x.__awaiter)(this,void 0,void 0,(function*(){yield this.datasource.init(this.datasourceOptions(),!0);const e=this.datasource.resourceType;e===it.vt.DATASERVER&&St(this,this.initialSelectedValue),e===it.vt.REQUEST_SERVER&&Ct(this,this.initialSelectedValue)}))}clearData(){Array.from(this.select.children).forEach((e=>{e instanceof Ft||this.select.removeChild(e)})),this.select.value="",this.select.initialValue=""}syncComponentData(e){var t;const o=null!=e?e:Array.from(this.rowsSyncedWithStream.values());if(o.length>0){this.options=o.map((e=>({value:e[this.valueField],label:this.labelFormatter?this.labelFormatter(e[this.labelField]):e[this.labelField]})));if(this.options.map((({value:e,label:t})=>{const o=document.createElement(this.optionElement);return o.textContent=t||e,o.value=e,o})).forEach((e=>{this.select.appendChild(e)})),!this.initalSelectedValueInitialized){const e=this.initialSelectedValue||0===this.initialSelectedValue?null===(t=this.options.find((e=>e.value===this.initialSelectedValue)))||void 0===t?void 0:t.label:"";r.DOM.queueUpdate((()=>{this.select.value=e})),this.initalSelectedValueInitialized=!0}}else{const e=document.createElement(this.optionElement);e.textContent=this.emptyDataLabel,e.value="",e.disabled=!0,this.select.appendChild(e)}}handleStreamInserts(e){ae.debug("handleStreamInserts - Method not implemented.")}handleStreamDeletes(e){ae.debug("handleStreamDeletes - Method not implemented.")}handleStreamUpdates(e){ae.debug("handleStreamUpdates - Method not implemented.")}};(0,x.__decorate)([(0,r.attr)({attribute:"label-field"})],kt.prototype,"labelField",void 0),(0,x.__decorate)([(0,r.attr)({attribute:"option-element"})],kt.prototype,"optionElement",void 0),(0,x.__decorate)([(0,r.attr)({attribute:"value-field"})],kt.prototype,"valueField",void 0),(0,x.__decorate)([(0,r.attr)({attribute:"empty-data-label"})],kt.prototype,"emptyDataLabel",void 0),(0,x.__decorate)([r.observable],kt.prototype,"labelFormatter",void 0),(0,x.__decorate)([r.observable],kt.prototype,"initialSelectedValue",void 0),kt=Ft=(0,x.__decorate)([(0,r.customElement)({name:"options-datasource"})],kt);const _t=(e,t)=>r.css`
498
+ `,Qe=(e,t)=>(0,n.checkboxTemplate)(e,t);class Je extends s.Checkbox{}const et=void 0,tt={checkedIndicator:'\n <svg\n aria-hidden="true"\n part="checked-indicator"\n class="checked-indicator"\n viewBox="0 0 20 20"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M8.143 12.6697L15.235 4.5L16.8 5.90363L8.23812 15.7667L3.80005 11.2556L5.27591 9.7555L8.143 12.6697Z"\n />\n </svg>\n ',indeterminateIndicator:'\n <div part="indeterminate-indicator" class="indeterminate-indicator"></div>\n '},ot=Je.compose(Object.assign({baseName:"checkbox",template:Qe,styles:Ze,shadowOptions:et},tt));var it=o(39087),at=o(62051),nt=o.n(at),st=o(96730),rt=o(21281),lt=o(34193),dt=o(61503),ct=o(60949),ut=o(97156);class pt extends n.FoundationElement{constructor(){super(...arguments),this.withGridInit=!0,this.isSnapshot=!1,this.maxRows=it.OD.MAX_ROWS_250,this.maxView=it.OD.MAX_VIEW_1000,this.reverse=!1,this.rowId="ROW_REF",this.withTimestampFormatting=!0,this.requiresFullDataRefresh=!0,this.rowsSyncedWithStream=new Map,this.dataSubWasLoggedOff=!1,this.criteriaFromFilters=new Map,this.update=new ut.t(new Map)}criteriaChanged(e,t){const o=e!==(0,st.Q)(t,";");this.datasource.initialized&&o&&(this.dataSub&&(this.dataSub.unsubscribe(),this.dataSub=void 0),this.fetchGenesisData(null))}dataChanged(e){e&&(this.clearData(),this.reset())}set datasourceConfig(e){e&&Object.keys(e).forEach((t=>{void 0!==e[t]&&(this[t]=e[t])}))}disconnectedCallback(){var e,t;super.disconnectedCallback(),this.clearData(),null===(e=this.dataSub)||void 0===e||e.unsubscribe(),null===(t=this.update)||void 0===t||t.unsubscribe(),delete this.dataSub,delete this.update,this.datasource.destroy(),delete this.datasource}reset(){this.requiresFullDataRefresh=!0,this.fetchGenesisData()}fetchGenesisData(e=!0){return(0,x.__awaiter)(this,void 0,void 0,(function*(){if(this.data)return void this.syncComponentData(this.data);const t=e||!this.datasource.initialized;t||(this.connect.dataLogoff(this.sourceRef),this.clearData());if(yield this.datasource.init(this.datasourceOptions(),t))if(this.isSnapshot){const e=yield this.datasource.snapshotFiltered();this.syncComponentData(e)}else ae.debug(`requesting stream for ${this.resourceName}`),this.dataSub=this.datasource.stream.subscribe((e=>{e.DISCONNECTED&&this.handleError({message:`Genesis Datasource disconnected for ${this.resourceName}`,loggerType:"error"}),this.sourceRef=e.SOURCE_REF;const t=e.MESSAGE_TYPE;if(t&&t===rt.Go.LOGOFF_ACK)this.dataSubWasLoggedOff=!0;else if(this.dataSubWasLoggedOff=!1,e.ROW){const t=(0,lt.d)(e);this.handleStreamUpdate(t)}else this.handleStreamUpdate(e)}));else this.handleError({message:`Genesis Datasource init failed for ${this.resourceName}`,loggerType:"error"})}))}initDatasource(){return(0,x.__awaiter)(this,void 0,void 0,(function*(){yield this.datasource.init(this.datasourceOptions(),!0)}))}datasourceOptions(){return{criteria:this.buildCriteria(),fields:this.fields,isSnapshot:this.isSnapshot,orderBy:this.orderBy,resourceName:this.resourceName,request:this.request,reverse:this.reverse,maxRows:this.maxRows,maxView:this.maxView}}handleStreamUpdate(e){if(!e)return;e.hasOwnProperty("REPLY")?this.applyRequestServerData(e):this.applyDataserverData(e)}applyRequestServerData(e){var t,o;if(!Array.isArray(e.REPLY)||!(null===(t=e.MESSAGE_TYPE)||void 0===t?void 0:t.startsWith("REP_")))return void this.handleError({message:"received invalid RequestServerResult",loggerType:"error",loggerArgs:[e]});if(this.requiresFullDataRefresh){"ROW_REF"!==this.rowId&&(null===(o=e.REPLY)||void 0===o||o.forEach((e=>{this.rowsSyncedWithStream.set(e[this.rowId],e)})));const t=this.rowsSyncedWithStream.size>0?Array.from(this.rowsSyncedWithStream.values()):e.REPLY;return void this.syncComponentData(t)}this.handleStreamInserts(e.REPLY);const i=Array.from(this.rowsSyncedWithStream.values()).filter((t=>!e.REPLY.includes(t)));this.handleStreamDeletes(i)}applyDataserverData(e){var t,o,i,a;if(this.requiresFullDataRefresh){null===(t=e.inserts)||void 0===t||t.forEach((e=>{this.rowsSyncedWithStream.set(e[this.rowId],e)}));const o=Array.from(this.rowsSyncedWithStream.values());this.syncComponentData(o)}else(null===(o=e.inserts)||void 0===o?void 0:o.length)>0&&this.handleStreamInserts(e.inserts),(null===(i=e.deletes)||void 0===i?void 0:i.length)>0&&this.handleStreamDeletes(e.deletes),(null===(a=e.updates)||void 0===a?void 0:a.length)>0&&this.handleStreamUpdates(e.updates)}buildCriteria(){var e;const t=(null===(e=this.criteria)||void 0===e?void 0:e.split(";"))||[];return(0,st.Q)(t.join(" && "),";")}setFilter(e,t){this.criteriaFromFilters.set(e,t),this.update.next(this.criteriaFromFilters)}removeFilter(e){this.criteriaFromFilters.delete(e),this.update.next(this.criteriaFromFilters)}handleError(e={}){const{message:t,loggerType:o,loggerArgs:i=[]}=e;t&&ae[o](t,...i)}}(0,x.__decorate)([dt.dm],pt.prototype,"connect",void 0),(0,x.__decorate)([ct.yW],pt.prototype,"datasource",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],pt.prototype,"withGridInit",void 0),(0,x.__decorate)([r.attr],pt.prototype,"criteria",void 0),(0,x.__decorate)([r.observable],pt.prototype,"data",void 0),(0,x.__decorate)([r.attr],pt.prototype,"fields",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],pt.prototype,"isSnapshot",void 0),(0,x.__decorate)([r.attr],pt.prototype,"maxRows",void 0),(0,x.__decorate)([r.attr],pt.prototype,"maxView",void 0),(0,x.__decorate)([r.attr],pt.prototype,"orderBy",void 0),(0,x.__decorate)([r.attr],pt.prototype,"resourceName",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],pt.prototype,"reverse",void 0),(0,x.__decorate)([r.attr],pt.prototype,"rowId",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean",attribute:"with-timestamp-formatting"})],pt.prototype,"withTimestampFormatting",void 0);const ht=(0,ie.createLogger)("foundation-criteria");var mt;!function(e){e.AND="&&",e.OR="||",e.NOT="!",e.GT=">",e.GE=">=",e.LT="<",e.LE="<=",e.NE="!=",e.EQ="=="}(mt||(mt={}));class vt{constructor(e){this.$$operator=e}static And(){return new vt(mt.AND)}static Or(){return new vt(mt.OR)}static Not(){return new vt(mt.NOT)}static GreaterThan(){return new vt(mt.GT)}static GreaterThanOrEqual(){return new vt(mt.GE)}static LessThan(){return new vt(mt.LT)}static LessThanOrEqual(){return new vt(mt.LE)}static NotEqual(){return new vt(mt.NE)}static Equal(){return new vt(mt.EQ)}get operator(){return this.$$operator}}const gt="default";class ft{constructor(){this.expressions={},this.And=(e,t={})=>this.withExpression(e,t,vt.And()),this.Or=(e,t={})=>this.withExpression(e,t,vt.Or()),this.Not=(e,t={})=>this.withExpression(e,t,vt.Not())}withExpression(e,t={},o=vt.And()){const{condition:i,join:a,groupName:n}=t,s=(e,t=gt)=>{var n;const s=null!==(n=this.expressions[t])&&void 0!==n?n:[];this.expressions[t]=[...s,{join:o||a,condition:i,expression:e}]};if(Array.isArray(e))if(a){const t=e.filter((e=>{const t=e instanceof vt;return t&&ht.warn("Inline joins will be discarded when join is defined in ExpressionOptions"),!t}));if(n)t.forEach((e=>{s(e,n)}));else{const e=(r=a,t.flat().flatMap(((e,t,o)=>o.length-1!==t?[e,r]:e)));s(e,gt)}}else s(e,gt);else s(e,"string"==typeof e?gt:e.group);var r;return this}build(e){const t=Object.entries(this.expressions).reduce(((e,[t,o])=>Object.assign(Object.assign({},e),{[t]:`(${o.filter((({condition:e})=>!e||e())).map((({expression:e,join:t},o,i)=>this.parseExpression(e,i[o-1],t))).join("")})`})),{});return e?e(t):`(${Object.values(t).join(" && ")})`}reset(){this.expressions={}}parseExpression(e,t,o){const i=[];return o&&t&&i.push(` ${o.operator} `),"string"==typeof e?i.push(e):Array.isArray(e)?(e.forEach(((e,t,o)=>{if(e instanceof vt){if(o[t-1]instanceof vt)throw new Error("Adjacent Join operations detected")}})),i.push(`(${e.map((e=>this.parseExpression(e,void 0))).join("")})`)):e instanceof vt?i.push(` ${e.operator} `):e&&i.push(e.serialiser(e)),i.join("")}}const bt=e=>{const{value:t}=e;return e.valueGetter?e.valueGetter(t):"function"==typeof t?t(e):Array.isArray(t)?t.join(","):"string"==typeof t?`"${t}"`:t},yt=e=>t=>`${t.field} ${e} ${bt(t)}`,xt=e=>yt(mt.EQ)(e),wt=e=>`Expr.containsIgnoreCase(${e.field}, ${bt(e)})`;class $t{constructor(e){this.serialiser=xt,this.build=()=>{if(!this.field)throw new Error("Missing required param 'field'");if(void 0===this.value)throw new Error("Missing required param 'value'");if(!this.serialiser)throw new Error("Missing required param 'serialise'");return{field:this.field,value:this.value,serialiser:this.serialiser,params:this.params,valueGetter:this.valueGetter,group:this.group}},e&&(this.field=e.field,this.value=e.value,this.serialiser=e.serialiser,this.params=e.params,this.valueGetter=e.valueGetter,this.group=e.group)}withField(e){return this.field=e,this}withValue(e){return this.value=e,this}withSerialiser(e){return this.serialiser=e,this}withParams(e){return this.params=e,this}withValueGetter(e){return this.valueGetter=e,this}withGroup(e){return this.group=e,this}}function St(e,t){var o;const i=new ft;i.withExpression((new $t).withField(null!==(o=e.labelField)&&void 0!==o?o:e.valueField).withValue(t).withSerialiser(wt).build()),e.criteria=i.build()}function Ct(e,t){var o;const i=null!==(o=e.labelField)&&void 0!==o?o:e.valueField;e.request={[i]:`${t}*`},e.fetchGenesisData(!1)}var Ft;let kt=Ft=class extends pt{constructor(){super(...arguments),this.emptyDataLabel="No matching records",this.initalSelectedValueInitialized=!1,this.isSnapshot=!0}initialSelectedValueChanged(e,t){t&&(this.initalSelectedValueInitialized=!1)}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});var t,o;return(0,x.__awaiter)(this,void 0,void 0,(function*(){e.connectedCallback.call(this),this.fields=this.labelField?null===(t=this.valueField)||void 0===t?void 0:t.concat(" ",this.labelField):this.valueField,this.select=this.parentElement,this.optionElement=null!==(o=this.optionElement)&&void 0!==o?o:`${k(this.select)}-option`,this.select.addEventListener("change",(e=>{var t;const o=null===(t=this.options)||void 0===t?void 0:t.find((t=>t.label===e.target.value));this.select.$emit("value-change",o)})),this.select&&this.valueField&&(this.resourceName&&this.connect.isConnected||this.data)&&(this.select instanceof s.Combobox&&this.select.async&&this.initialSelectedValue?this.asyncModeIntialization():this.fetchGenesisData()),this.valueField||ae.warn('Specify field for values in options (e.g value-field="VALUE") and optionally field for label (e.g label-field="NAME")')}))}asyncModeIntialization(){return(0,x.__awaiter)(this,void 0,void 0,(function*(){yield this.datasource.init(this.datasourceOptions(),!0);const e=this.datasource.resourceType;e===it.vt.DATASERVER&&St(this,this.initialSelectedValue),e===it.vt.REQUEST_SERVER&&Ct(this,this.initialSelectedValue)}))}clearData(){Array.from(this.select.children).forEach((e=>{e instanceof Ft||this.select.removeChild(e)})),this.select.value="",this.select.initialValue=""}syncComponentData(e){var t;const o=null!=e?e:Array.from(this.rowsSyncedWithStream.values());if(o.length>0){this.options=o.map((e=>({value:e[this.valueField],label:this.labelFormatter?this.labelFormatter(e[this.labelField]):e[this.labelField]})));if(this.options.map((({value:e,label:t})=>{const o=document.createElement(this.optionElement);return o.textContent=t||e,o.value=e,o})).forEach((e=>{this.select.appendChild(e)})),!this.initalSelectedValueInitialized){const e=this.initialSelectedValue||0===this.initialSelectedValue?null===(t=this.options.find((e=>e.value===this.initialSelectedValue)))||void 0===t?void 0:t.label:"";r.DOM.queueUpdate((()=>{this.select.value=e})),this.initalSelectedValueInitialized=!0}}else{const e=document.createElement(this.optionElement);e.textContent=this.emptyDataLabel,e.value="",e.disabled=!0,this.select.appendChild(e)}}handleStreamInserts(e){ae.debug("handleStreamInserts - Method not implemented.")}handleStreamDeletes(e){ae.debug("handleStreamDeletes - Method not implemented.")}handleStreamUpdates(e){ae.debug("handleStreamUpdates - Method not implemented.")}};(0,x.__decorate)([(0,r.attr)({attribute:"label-field"})],kt.prototype,"labelField",void 0),(0,x.__decorate)([(0,r.attr)({attribute:"option-element"})],kt.prototype,"optionElement",void 0),(0,x.__decorate)([(0,r.attr)({attribute:"value-field"})],kt.prototype,"valueField",void 0),(0,x.__decorate)([(0,r.attr)({attribute:"empty-data-label"})],kt.prototype,"emptyDataLabel",void 0),(0,x.__decorate)([r.observable],kt.prototype,"labelFormatter",void 0),(0,x.__decorate)([r.observable],kt.prototype,"initialSelectedValue",void 0),kt=Ft=(0,x.__decorate)([(0,r.customElement)({name:"options-datasource"})],kt);const _t=(e,t)=>r.css`
499
499
  .combo-box-indicator {
500
500
  transition-property: transform;
501
501
  transition-duration: 0.2s;
@@ -865,11 +865,13 @@
865
865
  }
866
866
 
867
867
  :host {
868
+ --dialog-close-icon-display: block;
868
869
  --dialog-min-width: 358px;
869
870
  --notification-details-min-height: 40px;
870
871
  }
871
872
 
872
873
  .close-icon {
874
+ display: var(--dialog-close-icon-display);
873
875
  position: absolute;
874
876
  right: calc(var(--design-unit) * 2px);
875
877
  top: calc(var(--design-unit) * 2px);
@@ -3743,5 +3745,5 @@
3743
3745
  <template ${(0,r.ref)("notificationListener")}>
3744
3746
  <slot></slot>
3745
3747
  </template>
3746
- `;var du;!function(e){e.NOTIFICATION_EVENT="notification-event"}(du||(du={}));const cu={mode:"open",delegatesFocus:!0};class uu extends n.FoundationElement{constructor(){super(...arguments),this.closeTimeout=0,this.toastButtons=[]}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});var t;return(0,x.__awaiter)(this,void 0,void 0,(function*(){if(e.connectedCallback.call(this),this.addEventListener(du.NOTIFICATION_EVENT,(e=>{e.stopImmediatePropagation(),Fa(e.detail,this.tagName,this.notificationListener)})),this.resourceName){if(!(yield this.datasource.init({resourceName:this.resourceName},!0)))return void ae.debug(`Genesis Datasource init failed for ${this.resourceName}`);this.dataSub=null===(t=this.datasource.stream)||void 0===t?void 0:t.subscribe((e=>{e.ROW&&e.SEQUENCE_ID>1&&this.handleStreamUpdate((0,lt.d)(e))}))}}))}disconnectedCallback(){var e,t;super.disconnectedCallback(),null===(e=this.dataSub)||void 0===e||e.unsubscribe(),delete this.dataSub,null===(t=this.datasource)||void 0===t||t.destroy(),delete this.datasource}handleStreamUpdate(e){const t=e.inserts;t.length>0&&t.forEach((e=>{const{HEADER:t,MESSAGE:o,NOTIFY_SEVERITY:i}=e,a=e.CREATED_AT?new Date(e.CREATED_AT):void 0,n=e.EXPIRY?e.EXPIRY-e.CREATED_AT:void 0;let s=[];this.toastButtons&&this.toastButtons.length>0&&(s=this.toastButtons.filter((({condition:t})=>!t||t({details:e}))));((e,t,o)=>{if(!e.title)throw new Error("Title is required");if(!e.body)throw new Error("Missing required param 'body'");let i={title:e.title,body:e.body},a={};e.createdAt&&(i=Object.assign({createdAt:e.createdAt},i)),e.logLevel in ie.LogLevel&&(i=Object.assign({logLevel:e.logLevel},i)),e.toast&&(a=Object.assign({toast:e.toast},a),i=Object.assign({config:a},i)),Sa(i,t,o)})({title:t,body:o,createdAt:a,toast:{details:e,type:null==i?void 0:i.toLowerCase(),buttons:s,autoClose:void 0!==n?!!n:!!this.closeTimeout,closeTimeout:null!=n?n:this.closeTimeout}},this.tagName)}))}}(0,x.__decorate)([r.observable],uu.prototype,"notificationListener",void 0),(0,x.__decorate)([(0,r.attr)({attribute:"resource-name"})],uu.prototype,"resourceName",void 0),(0,x.__decorate)([(0,r.attr)({attribute:"close-timeout",converter:r.nullableNumberConverter})],uu.prototype,"closeTimeout",void 0),(0,x.__decorate)([r.observable],uu.prototype,"toastButtons",void 0),(0,x.__decorate)([ct.yW],uu.prototype,"datasource",void 0);const pu=uu.compose({baseName:"notification-listener",template:lu,shadowOptions:cu}),hu=(e,t)=>o=>{const i="function"==typeof t?t:(a=t,e=>Object.assign(Object.assign({},a),e));var a;return r.FASTElement.define(class extends e{},i(o))};function mu(e){if("string"==typeof e)return e;if("function"==typeof e&&!(e=r.FASTElementDefinition.forType(e)))throw new Error("Missing FASTElement definition.");return e.name}const vu=e=>!e.navId||"header"===e.navId,gu=10;function fu(e,t=vu,o=gu){const i=[];return e.filter((e=>e.navItems&&e.navItems.some(t))).forEach(((e,a)=>{e.navItems.filter(t).map(((t,i)=>{var n,s,r,l;const d=null!==(n=t.placementIndex)&&void 0!==n?n:a*o+i;return Object.assign(Object.assign({},t),{navId:null!==(s=t.navId)&&void 0!==s?s:"header",placementIndex:d,routePath:null!==(r=t.routePath)&&void 0!==r?r:e.path,routeName:null!==(l=t.routeName)&&void 0!==l?l:e.name})})).forEach((e=>i.push(e)))})),i.sort(((e,t)=>e.placementIndex-t.placementIndex))}var bu,yu=o(63734);!function(e){e.controlClicked="controlClicked",e.routeChanged="routeChanged"}(bu||(bu={}));class xu{constructor(e){this.analytics=(0,yu.Ay)(e)}trackEvent(e,t){pa.v.debug(`FoundationAnalytics.trackEvent ${e} : ${JSON.stringify(t)}`),this.analytics.track(e,t)}}const wu=n.DI.createInterface((e=>e.singleton(xu)));var $u=o(3479),Su=o(80751),Cu=o(98647);let Fu=class extends($u.Ix.from(r.FASTElement)){connectedCallback(){super.connectedCallback(),r.DOM.queueUpdate((()=>(0,x.__awaiter)(this,void 0,void 0,(function*(){this.$router.config=this.config}))))}};Fu=(0,x.__decorate)([(0,r.customElement)({name:"foundation-router"})],Fu);class ku extends Su.s{constructor(){super(...arguments),this.definitions=[]}map(...e){this.definitions=[...this.definitions,...e],super.map(...e)}}(0,x.__decorate)([r.observable],ku.prototype,"definitions",void 0);class _u extends Cu.Y{constructor(){super(...arguments),this.routes=new ku(this)}getNavItems(e=vu){return fu(this.routes.definitions,e)}configureAnalytics(){this.contributors.push({navigate:e=>(0,x.__awaiter)(this,void 0,void 0,(function*(){this.analytics.trackEvent(bu.routeChanged,{path:e.route.endpoint.path})}))})}construct(e){return this.container.get(e)}}(0,x.__decorate)([n.Container],_u.prototype,"container",void 0),(0,x.__decorate)([wu],_u.prototype,"analytics",void 0);const Ou=()=>$r().register(nu)}}]);
3747
- //# sourceMappingURL=531.8ac8553d29c90734268ff95945814785.js.map
3748
+ `;var du;!function(e){e.NOTIFICATION_EVENT="notification-event"}(du||(du={}));const cu={mode:"open",delegatesFocus:!0};class uu extends n.FoundationElement{constructor(){super(...arguments),this.closeTimeout=0,this.toastButtons=[]}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});var t;return(0,x.__awaiter)(this,void 0,void 0,(function*(){if(e.connectedCallback.call(this),this.addEventListener(du.NOTIFICATION_EVENT,(e=>{e.stopImmediatePropagation(),Fa(e.detail,this.tagName,this.notificationListener)})),this.resourceName){if(!(yield this.datasource.init({resourceName:this.resourceName},!0)))return void ae.debug(`Genesis Datasource init failed for ${this.resourceName}`);this.dataSub=null===(t=this.datasource.stream)||void 0===t?void 0:t.subscribe((e=>{e.ROW&&e.SEQUENCE_ID>1&&this.handleStreamUpdate((0,lt.d)(e))}))}}))}disconnectedCallback(){var e,t;super.disconnectedCallback(),null===(e=this.dataSub)||void 0===e||e.unsubscribe(),delete this.dataSub,null===(t=this.datasource)||void 0===t||t.destroy(),delete this.datasource}handleStreamUpdate(e){const t=e.inserts;t.length>0&&t.forEach((e=>{const{HEADER:t,MESSAGE:o,NOTIFY_SEVERITY:i}=e,a=e.CREATED_AT?new Date(e.CREATED_AT):void 0,n=e.EXPIRY?e.EXPIRY-e.CREATED_AT:void 0;let s=[];this.toastButtons&&this.toastButtons.length>0&&(s=this.toastButtons.filter((({condition:t})=>!t||t({details:e}))));((e,t,o)=>{if(!e.title)throw new Error("Title is required");if(!e.body)throw new Error("Missing required param 'body'");let i={title:e.title,body:e.body},a={};e.createdAt&&(i=Object.assign({createdAt:e.createdAt},i)),e.logLevel in ie.LogLevel&&(i=Object.assign({logLevel:e.logLevel},i)),e.toast&&(a=Object.assign({toast:e.toast},a),i=Object.assign({config:a},i)),Sa(i,t,o)})({title:t,body:o,createdAt:a,toast:{details:e,type:null==i?void 0:i.toLowerCase(),buttons:s,autoClose:void 0!==n?!!n:!!this.closeTimeout,closeTimeout:null!=n?n:this.closeTimeout}},this.tagName)}))}}(0,x.__decorate)([r.observable],uu.prototype,"notificationListener",void 0),(0,x.__decorate)([(0,r.attr)({attribute:"resource-name"})],uu.prototype,"resourceName",void 0),(0,x.__decorate)([(0,r.attr)({attribute:"close-timeout",converter:r.nullableNumberConverter})],uu.prototype,"closeTimeout",void 0),(0,x.__decorate)([r.observable],uu.prototype,"toastButtons",void 0),(0,x.__decorate)([ct.yW],uu.prototype,"datasource",void 0);const pu=uu.compose({baseName:"notification-listener",template:lu,shadowOptions:cu}),hu=(e,t)=>o=>{const i="function"==typeof t?t:(a=t,e=>Object.assign(Object.assign({},a),e));var a;return r.FASTElement.define(class extends e{},i(o))};function mu(e){if("string"==typeof e)return e;if("function"==typeof e&&!(e=r.FASTElementDefinition.forType(e)))throw new Error("Missing FASTElement definition.");return e.name}const vu=e=>!e.navId||"header"===e.navId,gu=10;function fu(e,t=vu,o=gu){const i=[];return e.filter((e=>e.navItems&&e.navItems.some(t))).forEach(((e,a)=>{e.navItems.filter(t).map(((t,i)=>{var n,s,r,l;const d=null!==(n=t.placementIndex)&&void 0!==n?n:a*o+i;return Object.assign(Object.assign({},t),{navId:null!==(s=t.navId)&&void 0!==s?s:"header",placementIndex:d,routePath:null!==(r=t.routePath)&&void 0!==r?r:e.path,routeName:null!==(l=t.routeName)&&void 0!==l?l:e.name})})).forEach((e=>i.push(e)))})),i.sort(((e,t)=>e.placementIndex-t.placementIndex))}var bu,yu=o(63734);!function(e){e.controlClicked="controlClicked",e.routeChanged="routeChanged"}(bu||(bu={}));class xu{constructor(e){this.analytics=(0,yu.Ay)(e)}trackEvent(e,t){pa.v.debug(`FoundationAnalytics.trackEvent ${e} : ${JSON.stringify(t)}`),this.analytics.track(e,t)}}const wu=n.DI.createInterface((e=>e.singleton(xu)));var $u=o(3479),Su=o(80751),Cu=o(98647);let Fu=class extends($u.Ix.from(r.FASTElement)){connectedCallback(){super.connectedCallback(),r.DOM.queueUpdate((()=>(0,x.__awaiter)(this,void 0,void 0,(function*(){this.$router.config=this.config}))))}};Fu=(0,x.__decorate)([(0,r.customElement)({name:"foundation-router"})],Fu);class ku extends Su.s{constructor(){super(...arguments),this.definitions=[]}map(...e){this.definitions=[...e,...this.definitions],super.map(...e)}}(0,x.__decorate)([r.observable],ku.prototype,"definitions",void 0);class _u extends Cu.Y{constructor(){super(...arguments),this.routes=new ku(this)}getNavItems(e=vu){return fu(this.routes.definitions,e)}configureAnalytics(){this.contributors.push({navigate:e=>(0,x.__awaiter)(this,void 0,void 0,(function*(){this.analytics.trackEvent(bu.routeChanged,{path:e.route.endpoint.path})}))})}construct(e){return this.container.get(e)}}(0,x.__decorate)([n.Container],_u.prototype,"container",void 0),(0,x.__decorate)([wu],_u.prototype,"analytics",void 0);const Ou=()=>$r().register(nu)}}]);
3749
+ //# sourceMappingURL=531.11830418079820cc87052accf477bbd4.js.map
@@ -3,7 +3,7 @@
3
3
  <design-system-preview></design-system-preview>
4
4
  <design-system-export slot="export" tokensPath="${e=>e.tokensPath}"></design-system-export>
5
5
  </design-system-editor>
6
- `;var s=n(68871),a=n(25923),i=n(32819),c=n(44405);a.DesignSystemPreview,a.DesignSystemEditor,a.DesignSystemExport;const d=(0,n(65293).createLogger)("design-system-configurator");var u=n(97478),p=n.n(u),l=n(27135),f=n.n(l),m=n(61301),h=n.n(m),v=n(49222),g=n.n(v),y=n(6626),A=n.n(y),b=n(88279),C=n.n(b),_=n(62860),E={};E.styleTagTransform=C(),E.setAttributes=g(),E.insert=h().bind(null,"head"),E.domAPI=f(),E.insertStyleElement=A();p()(_.A,E);_.A&&_.A.locals&&_.A.locals;const S=o.css`
6
+ `;var s=n(68871),a=n(92730),i=n(15420),c=n(44405);a.DesignSystemPreview,a.DesignSystemEditor,a.DesignSystemExport;const d=(0,n(42534).createLogger)("design-system-configurator");var u=n(97478),p=n.n(u),l=n(27135),f=n.n(l),m=n(61301),h=n.n(m),v=n(49222),g=n.n(v),y=n(6626),A=n.n(y),b=n(88279),C=n.n(b),_=n(62860),E={};E.styleTagTransform=C(),E.setAttributes=g(),E.insert=h().bind(null,"head"),E.domAPI=f(),E.insertStyleElement=A();p()(_.A,E);_.A&&_.A.locals&&_.A.locals;const S=o.css`
7
7
  :host {
8
8
  display: flex;
9
9
  height: 100%;
@@ -1,2 +1,2 @@
1
- (self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[653,792],{653:(e,s,n)=>{Promise.all([n.e(418),n.e(405),n.e(293),n.e(819),n.e(548)]).then(n.bind(n,96548))}}]);
1
+ (self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[653,792],{653:(e,s,n)=>{Promise.all([n.e(418),n.e(405),n.e(534),n.e(420),n.e(548)]).then(n.bind(n,96548))}}]);
2
2
  //# sourceMappingURL=653.cd79d6d50e9f0dfe8ed96f08357afbae.js.map
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[842],{78466:(e,t,s)=>{s.d(t,{N:()=>b});var i=s(8202),r=s(57418),n=s(34387),o=s(97156),a=s(61503),c=s(21281),d=s(10447),h=s(56653),l=s(98316),u=s(17465);const E=n.DI.createInterface();function g(){return(null===navigator||void 0===navigator?void 0:navigator.credentials)?"PasswordCredential"in window||(u.v.warn("PasswordCredential not available in this browser."),!1):(u.v.warn("CredentialsContainer not available in this browser."),!1)}const S=":";function _(e="",t=S,s){return e.split(t,s).map((e=>e.trim())).filter((e=>""!==e))}function v(e,t=S){const s="string"==typeof e&&e.trim();return!!s&&s.includes(t)}function m(e,t=S){return"string"==typeof e&&e.trim()?(e.match(new RegExp(t,"g"))||[]).length:0}function T(e,t=S){for(const s of e)if(v(s,t))return s;return e.find((e=>"string"==typeof e&&!!e.trim()))}function R(e,t,s){const i="string"==typeof e&&e.trim();return!i||s&&!i.includes(s)||m(i)>1?s&&t&&s!==t?`${t}:${s}`:t||s:i}function p(e="credential"){u.v.warn(`Unable to migrate legacy ${e} to latest format. Please remove from your browser.`)}const O={password:!0,mediation:"optional"},A={cookie:{path:"/",name:"credentials",expires:7300,storePasswords:!1}};let I=class{constructor(e,t=A){this.session=e,this.config=t}createBasicCredentials(e){return{type:h.h.BASIC,username:e.username,password:e.password,mfaToken:this.getMFAToken()}}createRefreshCredentials(e){var t,s,i;return{type:h.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:h.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(S)&&m(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]=_(t.name||t.id),[i,r]=_(T([t.id,t.name]));return[{id:R(t.id||t.name,s,r),name:s,password:t.password||""},!0]}catch(e){p("PasswordCredential")}if(t)try{const e=t,[s]=_(e.name||e.username||e.organisation),[i,r]=_(T([e.organisation||e.username||e.name]));return[{id:R(e.id||e.username||e.name,s,r),name:s,password:e.password||""},!1]}catch(e){p("cookie")}return[void 0,!1]}storeCredentialsInContainer(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){if(!g())return;const t=new PasswordCredential(e);return u.v.debug("Storing credentials in CredentialsContainer"),navigator.credentials.store(t)}))}getCredentialsFromContainer(e=O){return(0,i.__awaiter)(this,void 0,void 0,(function*(){if(g())return u.v.debug("Getting credentials from CredentialsContainer"),yield navigator.credentials.get(e)}))}storeCredentialsInCookie(e){const{password:t}=e,s=(0,i.__rest)(e,["password"]),r=this.config.cookie.storePasswords?e:s;return u.v.debug("Storing credentials in cookie"),!!d.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(){u.v.debug("Getting credentials from cookie");const e=d.A.get(this.config.cookie.name);return e?JSON.parse(e):void 0}storeCredentials(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){if(g()){const t=yield this.storeCredentialsInContainer(e);return Promise.resolve(!!t)}return Promise.resolve(this.storeCredentialsInCookie(e))}))}getCredentials(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){return g()?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(){d.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 g()&&navigator.credentials.preventSilentAccess()}};I=(0,i.__decorate)([(0,i.__param)(0,l.N),(0,i.__param)(1,(0,n.optional)(E))],I);const f=n.DI.createInterface((e=>e.singleton(I)));var M=s(70624);let C=class{loggedUserResultChanged(e,t){var s;null===(s=this.isLoggedInSubject)||void 0===s||s.next(this.isLoggedIn)}get isLoggedIn$(){return this.isLoggedInSubject.asObservable()}get isLoggedIn(){return!!this.loggedUserResult&&!(!this.loggedUserResult.authToken||!this.loggedUserResult.sessionId)}constructor(e,t,s,i){this.session=e,this.connect=t,this.messageBuilder=s,this.credentialManager=i,this.isWorking=!1,this.isLoggedInSubject=new o.t(!1)}login(e){var t;return(0,i.__awaiter)(this,void 0,void 0,(function*(){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 h.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.session.setAuthResult(i),u.v.debug("Login Authentication Result:",i)}catch(e){if(u.v.error("Login Authentication Error:",e),!(e instanceof h.l&&e.isIgnorableError()))throw this.removeAuthResults(),e;u.v.warn("Ignoring authentication error as it is a known edge case.")}finally{this.isWorking=!1}return this.loggedUserResult}))}logout(){var e;return(0,i.__awaiter)(this,void 0,void 0,(function*(){this.isWorking=!0;let t={success:!1};try{const s=this.messageBuilder.createLogoutMessage(this.loggedUserResult);this.session.deleteUserFromSessionStorage(),this.connect.setValidSession(!1);const{CODE:i,DETAILS:r,ERROR:n,MESSAGE_TYPE:o,OIDC_LOGOUT_URL:a}=yield this.connect.send(s),d=null!==(e=null==r?void 0:r.ERROR)&&void 0!==e?e:n,h=o===c.Go.LOGOUT_NACK;h&&u.v.warn("Unexpected Logout NACK received during logout.",d),t={success:o===c.Go.LOGOUT_ACK||i===c.x6.SESSION_NOT_FOUND||!h,error:d},a&&window.open(a,"_self")}catch(e){const s=new h.l(e.sentMessage,e.receivedMessage);if(u.v.error("Logout Authentication Error:",s),!s.isIgnorableError())throw e;u.v.warn("Ignoring authentication error as it is a known edge case."),t.success=!0}finally{this.removeAuthResults(),this.isWorking=!1}return t}))}reAuthFromSession(){return(0,i.__awaiter)(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)===c.Gp.EVENT_LOGIN_AUTH_ACK)return this.session.setAuthResult(t),this.connect.setValidSession(!0),this.applyAuthResults(this.getLoggedUserFromMessage(t)),!0}return this.session.deleteUserFromSessionStorage(),this.connect.setValidSession(!1),!1}))}ensureConnection(){return(0,i.__awaiter)(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.currentUser=n.DI.getOrCreateDOMContainer().get(M.K),this.currentUser.set({permissions:e.permissions,profiles:e.profiles,username:e.username})):this.removeAuthResults()}removeAuthResults(){var e;this.loggedUserResult=null,null===(e=this.currentUser)||void 0===e||e.unset(),this.currentUser=null}};(0,i.__decorate)([r.observable],C.prototype,"isWorking",void 0),(0,i.__decorate)([r.observable],C.prototype,"currentUser",void 0),(0,i.__decorate)([r.observable],C.prototype,"loggedUserResult",void 0),(0,i.__decorate)([r.volatile],C.prototype,"isLoggedIn",null),C=(0,i.__decorate)([(0,i.__param)(0,l.N),(0,i.__param)(1,a.dm),(0,i.__param)(2,c.lT),(0,i.__param)(3,f)],C);const b=n.DI.createInterface((e=>e.singleton(C)))},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")}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}`}}},24669:(e,t,s)=>{s.d(t,{EQ:()=>a,a4:()=>o});var i=s(17190),r=s(34387);class n{constructor(){this.streamListeners=(0,i.r)(),this.streamCompleteListeners=(0,i.r)(),this.commitListeners=(0,i.r)(),this.metadataListeners=(0,i.r)()}addStreamListener(e,t){var s,i;const r=null===(s=this.streamListeners)||void 0===s?void 0:s.subscribe(e),n=null===(i=this.streamCompleteListeners)||void 0===i?void 0:i.subscribe(t);return()=>{r(),n()}}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}}))}onStreamCompleteEvent(e){var t;null===(t=this.streamCompleteListeners)||void 0===t||t.publish(new CustomEvent("connect-stream-complete-event",{detail:e}))}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}}))}}const o=r.DI.createInterface((e=>e.singleton(n))),a=r.DI.createInterface((e=>e.aliasTo(o)))},61503:(e,t,s)=>{s.d(t,{dm:()=>V,tn:()=>B});var i=s(8202);let r,n="gwf";try{"undefined"!=typeof SOCKET_EXT&&(n=SOCKET_EXT)}catch(e){}try{r=FORCE_HTTP}catch(e){}"true"===r?location.protocol:location.protocol.replace("http","ws");let o,a,c,d,h=null;try{"undefined"!=typeof API_HOST&&(h=API_HOST)}catch(e){}try{o=""}catch(e){}try{a=DEFAULT_ORGANISATION}catch(e){}try{c=DEFAULT_PASSWORD}catch(e){}try{d=DEFAULT_USER}catch(e){}var l=s(57418),u=s(34387);class E{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 g=u.DI.createInterface((e=>e.singleton(E))),S=new RegExp(/wss?:\/\/[-a-zA-Z0-9@:%._\+~#=]{1,256}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)\b\/*$/,"i");var _=s(17465),v=s(24669);const m=u.DI.createInterface(),T=u.DI.createInterface();var R=s(49229),p=s(97156),O=s(7827),A=s(1762),I=s(84190),f=s(78213),M=s(66640),C=s(16220),b=s(98316);let N=class{constructor(e){this.serializer=e}get(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const s=yield fetch(e,Object.assign(Object.assign({},t),{method:"GET"}));return(t.serializer||this.serializer).deserialize(s)}))}post(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const s=yield fetch(e,Object.assign(Object.assign({},t),{method:"POST"}));return(t.serializer||this.serializer).deserialize(s)}))}};N=(0,i.__decorate)([(0,i.__param)(0,R.b_)],N);const L=u.DI.createInterface((e=>e.singleton(N)));var U=s(21281);const D={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},{})};let w=class e{get isConnected(){return this._isConnected}set isConnected(e){this._isConnected=e,this.isConnectedSubject.next(this._isConnected)}constructor(e,t,s,i,r,n=D){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 p.t(this._isConnected),this.isConnected$=null===(o=this.isConnectedSubject)||void 0===o?void 0:o.asObservable(),this.ongoingTurbo={},this.streams=new Map}checkHost(){return(0,i.__awaiter)(this,void 0,void 0,(function*(){try{return this.getMessage({MESSAGE_TYPE:U.Go.HEARTBEAT_PING,SOURCE_REF:"host check"}).then((e=>e.MESSAGE_TYPE===U.Go.HEARTBEAT_PONG))}catch(e){return _.v.error(e),!1}}))}send(t,s){return this.http.post(e.getUrl(this.host,t),{body:e.getBody(t),headers:this.messageBuilder.createHTTPHeadersFromMessage(t)})}httpMode(){return!0}setValidSession(e){_.v.warn("setValidSession() called while in http polling mode.")}connect(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){return this.host=e,this.host.endsWith("/")||(this.host=this.host.concat("/")),this.checkHost().then((e=>(this.isConnected=e,this.session.setSessionStorageItem("hostUrl",this.host),e)))}))}disconnect(){this.isConnected=!1,this.streams.clear(),this.ongoingTurbo={},this.host=void 0}snapshot(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return _.v.debug(`HTTP MODE - ${s.MESSAGE_TYPE} (snapshot) message created -> `,s),this.send(s).then((e=>(this.dataLogoff(s.SOURCE_REF).catch((e=>_.v.error(e))),e)))}))}stream(e,t,s,i){const r=this.messageBuilder.createDataLogonMessage(e,i);_.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 p.t(this.config.polling.POLLING_FREQUENCY),RESOURCE_NAME:e});const o=this.streams.get(n).POLLING_FREQUENCY,a=(0,O.x)((0,A.H)(this.send(r)),o.pipe((0,I.n)((e=>(0,f.Y)(e)))).pipe((0,I.n)((()=>(0,A.H)(this.getMessage(r)))))).pipe((0,M.v)((()=>this.streams.has(n))),(0,C.j)((()=>{_.v.debug(`Terminating stream for ${e} - ${n}`),this.dataLogoff(n)})));return this.streams.get(n).STREAM=a,a}getMessage(t){return(0,i.__awaiter)(this,void 0,void 0,(function*(){return this.http.get(e.getUrl(this.host,t),{headers:this.messageBuilder.createHTTPHeadersFromMessage(t)})}))}getMoreRows(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMoreRowsMessage(e);return _.v.debug(`HTTP MODE - ${t.MESSAGE_TYPE} message created -> `,t),this.send(t)}))}getMoreColumns(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMoreColumnsMessage(e);return this.send(t)}))}dataLogoff(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return this.send(t).then((t=>(this.streams.has(e)&&(_.v.debug(`Removing stream ${e}`),this.streams.delete(e)),t)))}))}getMetadata(e,t=!0){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMetaRequestMessage(e);return _.v.debug(`HTTP MODE - ${t.MESSAGE_TYPE} (metadata) message created -> `,t),this.send(t).then((e=>e.DETAILS))}))}getJSONSchema(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMetaRequestMessage(e,U.Gp.JSON_SCHEMA_REQUEST);return _.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 _.v.debug(`HTTP MODE! - ${s.MESSAGE_TYPE} (request server) message created -> `,s),this.send(s)}getAvailableResources(e){const t=this.messageBuilder.createResourcesMessage(e);return _.v.debug(`HTTP MODE! - ${t.MESSAGE_TYPE} (getResources) message created -> `,t),this.send(t)}commitEvent(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const s=this.messageBuilder.createCommitMessage(e,t);return _.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 _.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);_.v.debug(`${e} TRIGGERED -> ENFORCING TURBO | FREQUENCY=${r}ms DURATION=${n}`),this.ongoingTurbo[e]=!0,this.updateIntervals({polling:{POLLING_INTERVAL_MAP:a}}),setTimeout((()=>{_.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,_.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===U.Gp.DATA_LOGON&&(i=t.DETAILS.DATASOURCE_NAME.replace(/_/g,"-").toLowerCase()),`${e}${i}`}};(0,i.__decorate)([l.observable],w.prototype,"host",void 0),(0,i.__decorate)([l.observable],w.prototype,"isWorking",void 0),(0,i.__decorate)([l.observable],w.prototype,"_isConnected",void 0),(0,i.__decorate)([l.volatile],w.prototype,"isConnected",null),w=(0,i.__decorate)([(0,i.__param)(0,L),(0,i.__param)(1,U.lT),(0,i.__param)(2,b.N),(0,i.__param)(3,g),(0,i.__param)(4,R.b_),(0,i.__param)(5,(0,u.optional)(T))],w);const y=u.DI.createInterface((e=>e.singleton(w)));var k=s(45230);const P={connect:{alwaysOn:!1,enableHeartbeat:!0,enableHeartbeatLogging:!1,heartbeatInterval:1e4,enableMessageLogging:!1},reconnect:{reconnectAttempts:10,reconnectInterval:1e4,reconnectStreams:!0}};let G=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()}constructor(e,t,s,i,r=P){this.socket=e,this.messageBuilder=t,this.metaCache=s,this.events=i,this.config=r,this.isWorking=!1}httpMode(){return!1}setValidSession(e){this.socket.hasValidSession=e}send(e,t){return this.socket.send(e,t)}connect(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){return this.socket.reset(),S.test(e)?this.socket.connect(e,this.config.connect,this.config.reconnect):(_.v.error(`Specified host (${e}) is not valid WebSocket url. Connection will not proceed.`),void _.v.warn("Make sure the host url starts with wss:// or ws://"))}))}disconnect(){this.socket.reset()}snapshot(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return _.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);_.v.debug(`${r.MESSAGE_TYPE} (stream) message created -> `,r);const n=this.socket.sendForStream(r,t,s,(()=>{this.events.onStreamCompleteEvent(n)}));return this.events.onStreamEvent(e,r,n,{onMessage:t,onError:s}),n}getMoreRows(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMoreRowsMessage(e);return _.v.debug(`${t.MESSAGE_TYPE} message created -> `,t),this.socket.send(t,!1)}))}getMoreColumns(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMoreColumnsMessage(e);return this.socket.send(t)}))}dataLogoff(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return _.v.debug(`${t.MESSAGE_TYPE} message created -> `,t),this.socket.send(t)}))}getMetadata(e,t=!0){var s;return(0,i.__awaiter)(this,void 0,void 0,(function*(){if(t&&this.metaCache.hasMetadataFor(e))return _.v.debug(`Cached metadata retrieved for ${e}`),this.metaCache.getMetadataFor(e);const i=this.messageBuilder.createMetaRequestMessage(e);let r,n;_.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,_.v.error(e),n}finally{this.events.onMetadataEvent(e,i,n),this.isWorking=!1}return r}))}getJSONSchema(e,t=!0){var s;return(0,i.__awaiter)(this,void 0,void 0,(function*(){if(t&&this.metaCache.hasJsonSchemaFor(e))return _.v.debug(`Cached JsonSchema retrieved for ${e}`),this.metaCache.getJsonSchemaFor(e);const i=this.messageBuilder.createMetaRequestMessage(e,U.Gp.JSON_SCHEMA_REQUEST);let r;_.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){_.v.error(e)}finally{this.isWorking=!1}return r}))}request(e,t){const s=this.messageBuilder.createRequestMessage(e,t);return _.v.debug(`${s.MESSAGE_TYPE} (request server) message created -> `,s),this.socket.send(s)}getAvailableResources(e){const t=this.messageBuilder.createResourcesMessage(e);return _.v.debug(`${t.MESSAGE_TYPE} (resources) message created -> `,t),this.socket.send(t)}commitEvent(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const s=this.messageBuilder.createCommitMessage(e,t);_.v.debug(`${s.MESSAGE_TYPE} (commit) message created -> `,s);const i=this.socket.send(s);return this.events.onCommitEvent(e,s),i}))}};(0,i.__decorate)([l.observable],G.prototype,"isWorking",void 0),(0,i.__decorate)([l.volatile],G.prototype,"isConnected",null),G=(0,i.__decorate)([(0,i.__param)(0,k.yQ),(0,i.__param)(1,U.lT),(0,i.__param)(2,g),(0,i.__param)(3,v.EQ),(0,i.__param)(4,(0,u.optional)(m))],G);const F="true"===r||!1,H=u.DI.createInterface((e=>e.singleton(G))),V=u.DI.createInterface((e=>F?e.aliasTo(y):e.aliasTo(H)));function B(){return u.DI.getOrCreateDOMContainer().get(V)}},21281:(e,t,s)=>{s.d(t,{Go:()=>i,Gp:()=>r,lT:()=>E,x6:()=>n,z2:()=>l});var i,r,n,o=s(8202),a=s(32808),c=s(34387),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.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=>e.CODE===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){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:i.MORE_ROWS,DETAILS:{SOURCE_REF:e},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}};u=(0,o.__decorate)([(0,o.__param)(0,h.N),(0,o.__param)(1,a.k)],u);const E=c.DI.createInterface((e=>e.singleton(u)))},45230:(e,t,s)=>{s.d(t,{yQ:()=>U,Ol:()=>D});var i=s(8202),r=s(32808),n=s(49229),o=s(57418),a=s(34387),c=s(50049),d=s(37970),h=s(75841),l=s(26274),u=s(53193),E=s(84190),g=s(82834),S=s(66640),_=s(53940),v=s(48653),m=s(98316),T=s(17465),R=s(21281);const p=1e4,O=6e4;var A;!function(e){e.Linear="linear",e.Exponential="exponential"}(A||(A={}));const I=(e,t)=>{const{reconnectInterval:s=p}=e,i=s>O?O:s,r=Math.round(Math.log2(O/i));return i*Math.pow(2,t%r)},f=e=>{const{reconnectInterval:t=p}=e;return t>O?O:t};var M=s(5709);class C{constructor(e){this.interval=e,this.workerScript=`\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 b extends c.B{constructor(){super()}}d.c;class N{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 L=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 this.status.hasValidSession}set hasValidSession(e){this.status.hasValidSession=e}constructor(e,t,s,i,r){this.messageBuilder=e,this.session=t,this.serializer=s,this.uuid=i,this.status=r,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,t,s){return this.url=e,this.connectOptions=t,this.reconnectOptions=s,new Promise((e=>{var t,s,r,n;T.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 v.Q({url:this.url,openObserver:{next:()=>{this.session.setSessionStorageItem("hostUrl",this.url),this.status.isConnected=!0,this.prepareHeartbeat(),T.v.info("WebSocket connection is now open"),e(this.isConnected)}},closeObserver:{next:t=>{this.status.onClose(t),this.isDisconnectedByServer&&T.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.__awaiter)(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,T.v.info,s);const{SOURCE_REF:i,MESSAGE_TYPE:r}=e,n=this.getMessageHandler(i,r);if(!n)return void(e.MESSAGE_TYPE===R.Go.MSG_NACK&&e.ERROR&&e.ERROR.forEach((t=>{T.v.error(`MessageType: ${e.MESSAGE_TYPE} | Error Details:`,t)})));let o=!1;switch(e.MESSAGE_TYPE){case R.Gp.EVENT_LOGIN_AUTH_ACK:{this.hasValidSession=!0;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 R.Go.LOGOUT_ACK:return this.hasValidSession=!1,n.onReceivedMessage.call(this,e),void this.cleanMessages();case R.Go.LOGON_ACK:return;case R.Go.LOGOFF_ACK:if(e.LOGGED_OUT&&this.hasValidSession){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.send(e);t?t.MESSAGE_TYPE===R.Gp.EVENT_LOGIN_AUTH_ACK&&(this.session.setAuthResult(t),this.wsMessageHandlers.forEach((e=>{e.isSubscription&&(e.sentMessage.SESSION_AUTH_TOKEN=t.SESSION_AUTH_TOKEN,this.websocket.next(e.sentMessage))}))):this.hasValidSession=!1}break;case R.Go.QUERY_UPDATE:n.isSubscription||this.sendDataLogoff(i);break;case R.Go.MSG_NACK:case R.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=>{T.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():T.v.info("Connection is now closed")}}),this.status.isConfigured=!0}))}prepareHeartbeat(){var e,t,s,r;this.heartbeatTicker&&this.heartbeatTicker.stop();const n=()=>(0,i.__awaiter)(this,void 0,void 0,(function*(){if(!this.isConnected)return;const e={MESSAGE_TYPE:R.Go.HEARTBEAT_PING,SOURCE_REF:this.uuid.createId()},t=yield this.send(e);this.heartbeatIsEnabled=t.MESSAGE_TYPE===R.Go.HEARTBEAT_PONG&&t.SOURCE_REF===e.SOURCE_REF}));if(null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableHeartbeat)&&void 0!==t?t:this.heartbeatIsEnabled){const e=null!==(r=null===(s=this.connectOptions)||void 0===s?void 0:s.heartbeatInterval)&&void 0!==r?r:this.heartbeatInterval;this.heartbeatTicker=new C(e),this.heartbeatTicker.start((()=>{this.websocket&&this.isConnected&&(n(),this.heartbeatLoggingIsEnabled&&T.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)===A.Exponential?I:f,a=this.isConnectedSubject.asObservable().pipe((0,E.n)((e=>e?(0,h.of)(-1):((e,t)=>new d.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,g.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,h.of)(e):(this.status.reconnectionLimitReached=!0,(0,l.$)((()=>new Error(`Max reconnect attempts ${r} reached.`))))}))))),(0,S.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=>{T.v.debug(`Attempt no. ${e+1} to reconnect`),this.websocket.complete(),this.connect(this.url,this.connectOptions,this.reconnectOptions)},error:e=>{var t;T.v.debug(e),null===(t=this.socketSubscription)||void 0===t||t.unsubscribe(),this.status.isReconnecting=!1},complete:()=>{T.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 b,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,T.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,l.$)((()=>new Error("WebSocket connection is closed")));if(!this.hasValidSession)return(0,l.$)((()=>new Error("WebSocket connection is open but there is no valid/active session, please check your auth flow")));const r=`Sending Message (stream) for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,T.v.info,r),this.setMessageHandler(e,t,s,!0),this.websocket.next(e),new d.c((t=>{const s=new c.B;return this.wsMessages.pipe((0,_.p)((t=>t.SOURCE_REF===e.SOURCE_REF)),(0,u.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()}}))}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,T.v.debug,r),this.wsMessageHandlers.set(e.SOURCE_REF,new N(e,t,s,i))}sendDataLogoff(e){this.hasValidSession&&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,T.v.debug,s),this.wsMessageHandlers.get(e)}logMessageTypeFlow(e,t,s){switch(e){case R.Gp.DATA_LOGOFF:t(s);break;case R.Go.HEARTBEAT_PING:case R.Go.HEARTBEAT_PONG:this.heartbeatLoggingIsEnabled&&t(s);break;default:this.messageLoggingIsEnabled&&t(s)}}};(0,i.__decorate)([o.observable],L.prototype,"websocket",void 0),(0,i.__decorate)([o.observable],L.prototype,"wsMessages",void 0),(0,i.__decorate)([o.observable],L.prototype,"wsMessageHandlers",void 0),(0,i.__decorate)([o.observable],L.prototype,"heartbeatIsEnabled",void 0),L=(0,i.__decorate)([(0,i.__param)(0,R.lT),(0,i.__param)(1,m.N),(0,i.__param)(2,n.b_),(0,i.__param)(3,r.k),(0,i.__param)(4,M.S5)],L);const U=a.DI.createInterface((e=>e.singleton(L)));function D(){return a.DI.getOrCreateDOMContainer().get(U)}},5709:(e,t,s)=>{s.d(t,{S5:()=>c});var i=s(8202),r=s(57418),n=s(34387),o=s(97156);class a{constructor(){this.isConfigured=!1,this.isConnecting=!1,this.isConnected=!1,this.isReconnecting=!1,this.reconnectionLimitReached=!1,this.hasValidSession=!1,this.isConnectedSubject=new o.t(this.isConnected)}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.__decorate)([r.observable],a.prototype,"isConfigured",void 0),(0,i.__decorate)([r.observable],a.prototype,"isConnecting",void 0),(0,i.__decorate)([r.observable],a.prototype,"isConnected",void 0),(0,i.__decorate)([r.observable],a.prototype,"isReconnecting",void 0),(0,i.__decorate)([r.observable],a.prototype,"reconnectionLimitReached",void 0),(0,i.__decorate)([r.observable],a.prototype,"hasValidSession",void 0),(0,i.__decorate)([r.observable],a.prototype,"closedCode",void 0),(0,i.__decorate)([r.observable],a.prototype,"closedReason",void 0),(0,i.__decorate)([r.observable],a.prototype,"closedClean",void 0);const c=n.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}}},60949:(e,t,s)=>{s.d(t,{yW:()=>T});var i=s(8202),r=s(57418),n=s(34387),o=s(51046),a=s(8790),c=s(1762),d=s(84190),h=s(66640),l=s(78466),u=s(61503),E=s(48707),g=s(17465);var S=s(34193),_=s(39087);const v={options:{criteria:"",isSnapshot:!1,maxRows:_.OD.MAX_ROWS_250,maxView:_.OD.MAX_VIEW_1000,pollingInterval:_.OD.REQ_REP_POLLING_INTERVAL_MS,movingView:!1,orderBy:"",resourceName:"",reverse:!1},criteriaToFields:function(e){const t=e.split("&&").map((e=>e.trim())),s={};return t.forEach((e=>{if(e.startsWith("Expr"))switch(e.match(/Expr\.(\w+)\(/)[1]){case"dateIsToday":{const t=/Expr\.dateIsToday\((\w+)\)/,[,i]=e.match(t),r=new Date;s[`${i}_FROM`]=`${r.toISOString().replace(/-/g,"").split("T")[0]}-00:00`,r.setDate(r.getDate()+1),s[`${i}_TO`]=`${r.toISOString().replace(/-/g,"").split("T")[0]}-00:00`}break;case"dateTimeIsGreaterEqual":{const t=/Expr\.dateTimeIsGreaterEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_FROM`]=r}break;case"dateTimeIsLessEqual":{const t=/Expr\.dateTimeIsLessEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_TO`]=r}break;case"containsIgnoreCase":{const t=/Expr\.containsIgnoreCase\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[i]=`*${r}*`}}else{const t=e.substr(0,e.indexOf("=")).trim().replace(/["']/g,""),i=e.substr(e.lastIndexOf("=")+1,e.length).trim().replace(/["']/g,"");s[t]=i}})),s},dataServerResultFilter:S.d};let m=class{constructor(e,t,s=v){this.connect=e,this.auth=t,this.config=s,this.initialized=!1,this.readOnly=!0,this.originalFieldDef=[],this.requestFields=[],this.fieldMetadata=[],this.availableIndexes=[]}validResourceName(e){return!!e&&!!e.trim().length}init(e,t=!0){var s;return(0,i.__awaiter)(this,void 0,void 0,(function*(){if(!this.validResourceName(null==e?void 0:e.resourceName))return!1;this.options=Object.assign(Object.assign({},this.config.options),e);const i=this.options.resourceName;if(t){g.v.debug(`Initializing ${i} Datasource`);const e=yield this.connect.getMetadata(i).catch((e=>g.v.error(`Metadata Fetch failed for ${i}:`,e)));if(!e)return this.deinit(),!1;this.resourceType=e.TYPE,this.availableIndexes=null!==(s=e.INDEXES)&&void 0!==s?s:[],this.originalFieldDef=(0,E.a)(e),this.fieldMetadata=(0,E.X)(this.originalFieldDef),this.requestFields=e.REQUEST_FIELD||[],g.v.debug(`Datasource for ${i} is ready`)}return this.options.isSnapshot||(this._stream=yield this.createStream()),this.initialized=!0,this.initialized}))}deinit(){var e;g.v.debug("Datasource.deinit",null===(e=this.options)||void 0===e?void 0:e.resourceName),this.initialized=!1,this.options={},this.resourceType=void 0,this.availableIndexes=[],this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[]}destroy(){var e;g.v.debug("Datasource.destroy",null===(e=this.options)||void 0===e?void 0:e.resourceName),this.deinit(),delete this._stream}get stream(){return this._stream}get params(){const e={CRITERIA_MATCH:this.options.criteria,FIELDS:this.options.fields,MAX_ROWS:this.options.maxRows,MAX_VIEW:this.options.maxView,MOVING_VIEW:this.options.movingView,POLLING_INTERVAL:this.options.pollingInterval,DISABLE_POLLING:this.options.disablePolling,REQUEST:this.options.request,REVERSE:this.options.reverse};if(this.options.orderBy)if(this.availableIndexes.findIndex((e=>e.NAME===this.options.orderBy))>-1)e.ORDER_BY=this.options.orderBy;else{const e=this.availableIndexes.map((e=>e.NAME));g.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 g.v.debug("Getting configured params:",e),e}snapshot(){var e;return(0,i.__awaiter)(this,void 0,void 0,(function*(){switch(g.v.debug(`Requesting snapshot for ${this.options.resourceName} (${this.resourceType}).`),this.resourceType){case _.vt.DATASERVER:return this.connect.snapshot(this.options.resourceName,this.params);case _.vt.REQUEST_SERVER:{const t=this.params,{REQUEST:s,CRITERIA_MATCH:r}=t,n={DETAILS:(0,i.__rest)(t,["REQUEST","CRITERIA_MATCH"]),REQUEST:Object.assign(Object.assign(Object.assign({},Object.fromEntries(this.requestFields.map((e=>[e.NAME,"*"])))),this.params.REQUEST),(null===(e=null==this?void 0:this.options)||void 0===e?void 0:e.criteria)?this.config.criteriaToFields(this.options.criteria):{})};return this.connect.request(this.options.resourceName,n)}default:throw new Error(`Snapshot not supported for selected resource type: ${this.resourceType}`)}}))}snapshotFiltered(e="ROW_REF"){return(0,i.__awaiter)(this,void 0,void 0,(function*(){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.__awaiter)(this,void 0,void 0,(function*(){if(![_.vt.DATASERVER,_.vt.REQUEST_SERVER].includes(this.resourceType))throw new Error(`Streaming not supported for selected resource type: ${this.resourceType}`);return this.resourceType===_.vt.DATASERVER?this.createDataserverStream():(g.v.debug(`Creating fake stream by polling ${this.options.resourceName} REQUEST_SERVER`),this.createReqRepStream())}))}createDataserverStream(){return(0,i.__awaiter)(this,void 0,void 0,(function*(){return this.connect.stream(this.options.resourceName,(e=>{}),(e=>g.v.error(e)),this.params)}))}createReqRepStream(){return(0,o.O)(0,this.params.DISABLE_POLLING?void 0:this.params.POLLING_INTERVAL).pipe((0,d.n)((()=>(0,a.z)([this.connect.isConnected$,this.auth.isLoggedIn$]).pipe((0,h.v)((()=>this.connect.isConnected&&this.auth.isLoggedIn)),(0,d.n)((()=>(0,c.H)(this.snapshot())))))))}};(0,i.__decorate)([r.observable],m.prototype,"initialized",void 0),(0,i.__decorate)([r.observable],m.prototype,"readOnly",void 0),(0,i.__decorate)([r.observable],m.prototype,"_stream",void 0),m=(0,i.__decorate)([(0,i.__param)(0,u.dm),(0,i.__param)(1,l.N),(0,i.__param)(2,(0,n.optional)(_.aB))],m);const T=n.DI.createInterface((e=>e.transient(m)))},39087:(e,t,s)=>{s.d(t,{OD:()=>n,aB:()=>o,vt:()=>i});var i,r=s(34387);!function(e){e.DATASERVER="DATASERVER",e.EVENT_HANDLER="EVENT_HANDLER",e.REQUEST_SERVER="REQUEST_SERVER"}(i||(i={}));class n{}n.MAX_ROWS_250=250,n.MAX_VIEW_1000=1e3,n.REQ_REP_POLLING_INTERVAL_MS=1e4,n.DATASERVER_ROW_ID="ROW_REF",n.REQUEST_SERVER_ROW_ID="RECORD_ID";const o=r.DI.createInterface()},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})},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"}(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}},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=>{const t=null==e?void 0:e.TYPE;if(t===i.vt.DATASERVER)return e.FIELD||[];if(t===i.vt.REQUEST_SERVER)return e.REPLY_FIELD||[];throw new Error(`Unsupported resource type: ${t}`)}},98316:(e,t,s)=>{s.d(t,{N:()=>n});var i=s(34387);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("/login"===e)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)))},70624:(e,t,s)=>{s.d(t,{K:()=>a});var i=s(8202),r=s(57418),n=s(34387);class o{constructor(e){this.set(e)}set(e){e&&(this.permissions=e.permissions,this.profiles=e.profiles,this.username=e.username)}unset(){this.permissions=void 0,this.profiles=void 0,this.username=void 0}hasAdminProfile(){return this.hasProfile("ADMIN")}hasPermission(e){return this.hasKey(this.permissions,e)}hasProfile(e){return this.hasKey(this.profiles,e)}hasKey(e,t){return!!(e&&e.length&&t)&&(Array.isArray(t)||(t=[t]),t.some((t=>e.includes(t))))}}(0,i.__decorate)([r.observable],o.prototype,"permissions",void 0),(0,i.__decorate)([r.observable],o.prototype,"profiles",void 0),(0,i.__decorate)([r.observable],o.prototype,"username",void 0);const a=n.DI.createInterface((e=>e.singleton(o)))},17465:(e,t,s)=>{s.d(t,{v:()=>r});var i=s(65293);const r=(0,i.createLogger)("foundation-comms")},40729:(e,t,s)=>{s.d(t,{O:()=>d});var i=s(57418);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)}},70997:(e,t,s)=>{function i(e,t,s){const i=e=>"function"==typeof e?e:()=>e,r=i(t),n=i(s);return(t,s)=>e(t,s)?r(t,s):n(t,s)}s.d(t,{q:()=>i})},12066:(e,t,s)=>{s.d(t,{CL:()=>r,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"," ")}},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)}},49229:(e,t,s)=>{s.d(t,{b_:()=>h});var i=s(17914),r=s(34387),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.__decorate)([(0,i.__param)(0,(0,r.optional)(o))],d);const h=r.DI.createInterface((e=>e.singleton(d)))},21530:(e,t,s)=>{s.d(t,{O:()=>r});var i=s(28745);const r=(e,t)=>{var s;let r=document.getElementById(t);if(r)return void i.v.debug(`\n An element with the id of '${t}' already exists and likely has the css rules applied.\n `);const n=null!==(s=document.head)&&void 0!==s?s:document.getElementsByTagName("head")[0];r=document.createElement("style"),r.id=t,n.appendChild(r);const o=r.sheet.insertRule(e);return()=>{r&&(r.sheet.deleteRule(o),n.removeChild(r))}}},80273:(e,t,s)=>{s.d(t,{Du:()=>c,IT:()=>o,WP:()=>r,f4:()=>a,zz:()=>n});var i=s(21530);const r=(e,t)=>{(0,i.O)(e,t)};var n,o;!function(e){e.Italic="italic",e.Normal="normal"}(n||(n={})),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"}(o||(o={}));const a=(e,t=n.Normal,s=o.Regular)=>`\n font-family: ${e};\n font-style: ${t};\n font-weight: ${s};\n`,c={minusOne:-1,minusTwo:-2,plusOne:1,plusTwo:2,plusThree:3,plusFour:4,plusFive:5,plusSix:6}},28745:(e,t,s)=>{s.d(t,{v:()=>r});var i=s(65293);const r=(0,i.createLogger)("foundation-utils")},32808:(e,t,s)=>{s.d(t,{k:()=>c});var i=s(17914),r=s(34387),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(e=!1){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=(0,n.A)();return e&&o.v.debug(`UUID.createRemoteID ${t}`),t}))}}const c=r.DI.createInterface((e=>e.singleton(a)))}}]);
1
+ "use strict";(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[842],{78466:(e,t,s)=>{s.d(t,{N:()=>b});var i=s(8202),r=s(57418),n=s(34387),o=s(97156),a=s(61503),c=s(21281),d=s(10447),h=s(56653),l=s(98316),u=s(17465);const E=n.DI.createInterface();function g(){return(null===navigator||void 0===navigator?void 0:navigator.credentials)?"PasswordCredential"in window||(u.v.warn("PasswordCredential not available in this browser."),!1):(u.v.warn("CredentialsContainer not available in this browser."),!1)}const S=":";function _(e="",t=S,s){return e.split(t,s).map((e=>e.trim())).filter((e=>""!==e))}function v(e,t=S){const s="string"==typeof e&&e.trim();return!!s&&s.includes(t)}function m(e,t=S){return"string"==typeof e&&e.trim()?(e.match(new RegExp(t,"g"))||[]).length:0}function T(e,t=S){for(const s of e)if(v(s,t))return s;return e.find((e=>"string"==typeof e&&!!e.trim()))}function R(e,t,s){const i="string"==typeof e&&e.trim();return!i||s&&!i.includes(s)||m(i)>1?s&&t&&s!==t?`${t}:${s}`:t||s:i}function p(e="credential"){u.v.warn(`Unable to migrate legacy ${e} to latest format. Please remove from your browser.`)}const O={password:!0,mediation:"optional"},A={cookie:{path:"/",name:"credentials",expires:7300,storePasswords:!1}};let I=class{constructor(e,t=A){this.session=e,this.config=t}createBasicCredentials(e){return{type:h.h.BASIC,username:e.username,password:e.password,mfaToken:this.getMFAToken()}}createRefreshCredentials(e){var t,s,i;return{type:h.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:h.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(S)&&m(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]=_(t.name||t.id),[i,r]=_(T([t.id,t.name]));return[{id:R(t.id||t.name,s,r),name:s,password:t.password||""},!0]}catch(e){p("PasswordCredential")}if(t)try{const e=t,[s]=_(e.name||e.username||e.organisation),[i,r]=_(T([e.organisation||e.username||e.name]));return[{id:R(e.id||e.username||e.name,s,r),name:s,password:e.password||""},!1]}catch(e){p("cookie")}return[void 0,!1]}storeCredentialsInContainer(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){if(!g())return;const t=new PasswordCredential(e);return u.v.debug("Storing credentials in CredentialsContainer"),navigator.credentials.store(t)}))}getCredentialsFromContainer(e=O){return(0,i.__awaiter)(this,void 0,void 0,(function*(){if(g())return u.v.debug("Getting credentials from CredentialsContainer"),yield navigator.credentials.get(e)}))}storeCredentialsInCookie(e){const{password:t}=e,s=(0,i.__rest)(e,["password"]),r=this.config.cookie.storePasswords?e:s;return u.v.debug("Storing credentials in cookie"),!!d.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(){u.v.debug("Getting credentials from cookie");const e=d.A.get(this.config.cookie.name);return e?JSON.parse(e):void 0}storeCredentials(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){if(g()){const t=yield this.storeCredentialsInContainer(e);return Promise.resolve(!!t)}return Promise.resolve(this.storeCredentialsInCookie(e))}))}getCredentials(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){return g()?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(){d.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 g()&&navigator.credentials.preventSilentAccess()}};I=(0,i.__decorate)([(0,i.__param)(0,l.N),(0,i.__param)(1,(0,n.optional)(E))],I);const f=n.DI.createInterface((e=>e.singleton(I)));var M=s(70624);let C=class{loggedUserResultChanged(e,t){var s;null===(s=this.isLoggedInSubject)||void 0===s||s.next(this.isLoggedIn)}get isLoggedIn$(){return this.isLoggedInSubject.asObservable()}get isLoggedIn(){return!!this.loggedUserResult&&!(!this.loggedUserResult.authToken||!this.loggedUserResult.sessionId)}constructor(e,t,s,i){this.session=e,this.connect=t,this.messageBuilder=s,this.credentialManager=i,this.isWorking=!1,this.isLoggedInSubject=new o.t(!1)}login(e){var t;return(0,i.__awaiter)(this,void 0,void 0,(function*(){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 h.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.session.setAuthResult(i),u.v.debug("Login Authentication Result:",i)}catch(e){if(u.v.error("Login Authentication Error:",e),!(e instanceof h.l&&e.isIgnorableError()))throw this.removeAuthResults(),e;u.v.warn("Ignoring authentication error as it is a known edge case.")}finally{this.isWorking=!1}return this.loggedUserResult}))}logout(){var e;return(0,i.__awaiter)(this,void 0,void 0,(function*(){this.isWorking=!0;let t={success:!1};try{const s=this.messageBuilder.createLogoutMessage(this.loggedUserResult);this.session.deleteUserFromSessionStorage(),this.connect.setValidSession(!1);const{CODE:i,DETAILS:r,ERROR:n,MESSAGE_TYPE:o,OIDC_LOGOUT_URL:a}=yield this.connect.send(s),d=null!==(e=null==r?void 0:r.ERROR)&&void 0!==e?e:n,h=o===c.Go.LOGOUT_NACK;h&&u.v.warn("Unexpected Logout NACK received during logout.",d),t={success:o===c.Go.LOGOUT_ACK||i===c.x6.SESSION_NOT_FOUND||!h,error:d},a&&window.open(a,"_self")}catch(e){const s=new h.l(e.sentMessage,e.receivedMessage);if(u.v.error("Logout Authentication Error:",s),!s.isIgnorableError())throw e;u.v.warn("Ignoring authentication error as it is a known edge case."),t.success=!0}finally{this.removeAuthResults(),this.isWorking=!1}return t}))}reAuthFromSession(){return(0,i.__awaiter)(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)===c.Gp.EVENT_LOGIN_AUTH_ACK)return this.session.setAuthResult(t),this.connect.setValidSession(!0),this.applyAuthResults(this.getLoggedUserFromMessage(t)),!0}return this.session.deleteUserFromSessionStorage(),this.connect.setValidSession(!1),!1}))}ensureConnection(){return(0,i.__awaiter)(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.currentUser=n.DI.getOrCreateDOMContainer().get(M.K),this.currentUser.set({permissions:e.permissions,profiles:e.profiles,username:e.username})):this.removeAuthResults()}removeAuthResults(){var e;this.loggedUserResult=null,null===(e=this.currentUser)||void 0===e||e.unset(),this.currentUser=null}};(0,i.__decorate)([r.observable],C.prototype,"isWorking",void 0),(0,i.__decorate)([r.observable],C.prototype,"currentUser",void 0),(0,i.__decorate)([r.observable],C.prototype,"loggedUserResult",void 0),(0,i.__decorate)([r.volatile],C.prototype,"isLoggedIn",null),C=(0,i.__decorate)([(0,i.__param)(0,l.N),(0,i.__param)(1,a.dm),(0,i.__param)(2,c.lT),(0,i.__param)(3,f)],C);const b=n.DI.createInterface((e=>e.singleton(C)))},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")}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}`}}},24669:(e,t,s)=>{s.d(t,{EQ:()=>a,a4:()=>o});var i=s(17190),r=s(34387);class n{constructor(){this.streamListeners=(0,i.r)(),this.streamCompleteListeners=(0,i.r)(),this.commitListeners=(0,i.r)(),this.metadataListeners=(0,i.r)()}addStreamListener(e,t){var s,i;const r=null===(s=this.streamListeners)||void 0===s?void 0:s.subscribe(e),n=null===(i=this.streamCompleteListeners)||void 0===i?void 0:i.subscribe(t);return()=>{r(),n()}}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}}))}onStreamCompleteEvent(e){var t;null===(t=this.streamCompleteListeners)||void 0===t||t.publish(new CustomEvent("connect-stream-complete-event",{detail:e}))}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}}))}}const o=r.DI.createInterface((e=>e.singleton(n))),a=r.DI.createInterface((e=>e.aliasTo(o)))},61503:(e,t,s)=>{s.d(t,{dm:()=>V,tn:()=>B});var i=s(8202);let r,n="gwf";try{"undefined"!=typeof SOCKET_EXT&&(n=SOCKET_EXT)}catch(e){}try{r=FORCE_HTTP}catch(e){}"true"===r?location.protocol:location.protocol.replace("http","ws");let o,a,c,d,h=null;try{"undefined"!=typeof API_HOST&&(h=API_HOST)}catch(e){}try{o=""}catch(e){}try{a=DEFAULT_ORGANISATION}catch(e){}try{c=DEFAULT_PASSWORD}catch(e){}try{d=DEFAULT_USER}catch(e){}var l=s(57418),u=s(34387);class E{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 g=u.DI.createInterface((e=>e.singleton(E))),S=new RegExp(/wss?:\/\/[-a-zA-Z0-9@:%._\+~#=]{1,256}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)\b\/*$/,"i");var _=s(17465),v=s(24669);const m=u.DI.createInterface(),T=u.DI.createInterface();var R=s(49229),p=s(97156),O=s(7827),A=s(1762),I=s(84190),f=s(78213),M=s(66640),C=s(16220),b=s(98316);let N=class{constructor(e){this.serializer=e}get(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const s=yield fetch(e,Object.assign(Object.assign({},t),{method:"GET"}));return(t.serializer||this.serializer).deserialize(s)}))}post(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const s=yield fetch(e,Object.assign(Object.assign({},t),{method:"POST"}));return(t.serializer||this.serializer).deserialize(s)}))}};N=(0,i.__decorate)([(0,i.__param)(0,R.b_)],N);const L=u.DI.createInterface((e=>e.singleton(N)));var U=s(21281);const D={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},{})};let w=class e{get isConnected(){return this._isConnected}set isConnected(e){this._isConnected=e,this.isConnectedSubject.next(this._isConnected)}constructor(e,t,s,i,r,n=D){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 p.t(this._isConnected),this.isConnected$=null===(o=this.isConnectedSubject)||void 0===o?void 0:o.asObservable(),this.ongoingTurbo={},this.streams=new Map}checkHost(){return(0,i.__awaiter)(this,void 0,void 0,(function*(){try{return this.getMessage({MESSAGE_TYPE:U.Go.HEARTBEAT_PING,SOURCE_REF:"host check"}).then((e=>e.MESSAGE_TYPE===U.Go.HEARTBEAT_PONG))}catch(e){return _.v.error(e),!1}}))}send(t,s){return this.http.post(e.getUrl(this.host,t),{body:e.getBody(t),headers:this.messageBuilder.createHTTPHeadersFromMessage(t)})}httpMode(){return!0}setValidSession(e){_.v.warn("setValidSession() called while in http polling mode.")}connect(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){return this.host=e,this.host.endsWith("/")||(this.host=this.host.concat("/")),this.checkHost().then((e=>(this.isConnected=e,this.session.setSessionStorageItem("hostUrl",this.host),e)))}))}disconnect(){this.isConnected=!1,this.streams.clear(),this.ongoingTurbo={},this.host=void 0}snapshot(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return _.v.debug(`HTTP MODE - ${s.MESSAGE_TYPE} (snapshot) message created -> `,s),this.send(s).then((e=>(this.dataLogoff(s.SOURCE_REF).catch((e=>_.v.error(e))),e)))}))}stream(e,t,s,i){const r=this.messageBuilder.createDataLogonMessage(e,i);_.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 p.t(this.config.polling.POLLING_FREQUENCY),RESOURCE_NAME:e});const o=this.streams.get(n).POLLING_FREQUENCY,a=(0,O.x)((0,A.H)(this.send(r)),o.pipe((0,I.n)((e=>(0,f.Y)(e)))).pipe((0,I.n)((()=>(0,A.H)(this.getMessage(r)))))).pipe((0,M.v)((()=>this.streams.has(n))),(0,C.j)((()=>{_.v.debug(`Terminating stream for ${e} - ${n}`),this.dataLogoff(n)})));return this.streams.get(n).STREAM=a,a}getMessage(t){return(0,i.__awaiter)(this,void 0,void 0,(function*(){return this.http.get(e.getUrl(this.host,t),{headers:this.messageBuilder.createHTTPHeadersFromMessage(t)})}))}getMoreRows(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMoreRowsMessage(e);return _.v.debug(`HTTP MODE - ${t.MESSAGE_TYPE} message created -> `,t),this.send(t)}))}getMoreColumns(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMoreColumnsMessage(e);return this.send(t)}))}dataLogoff(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return this.send(t).then((t=>(this.streams.has(e)&&(_.v.debug(`Removing stream ${e}`),this.streams.delete(e)),t)))}))}getMetadata(e,t=!0){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMetaRequestMessage(e);return _.v.debug(`HTTP MODE - ${t.MESSAGE_TYPE} (metadata) message created -> `,t),this.send(t).then((e=>e.DETAILS))}))}getJSONSchema(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMetaRequestMessage(e,U.Gp.JSON_SCHEMA_REQUEST);return _.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 _.v.debug(`HTTP MODE! - ${s.MESSAGE_TYPE} (request server) message created -> `,s),this.send(s)}getAvailableResources(e){const t=this.messageBuilder.createResourcesMessage(e);return _.v.debug(`HTTP MODE! - ${t.MESSAGE_TYPE} (getResources) message created -> `,t),this.send(t)}commitEvent(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const s=this.messageBuilder.createCommitMessage(e,t);return _.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 _.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);_.v.debug(`${e} TRIGGERED -> ENFORCING TURBO | FREQUENCY=${r}ms DURATION=${n}`),this.ongoingTurbo[e]=!0,this.updateIntervals({polling:{POLLING_INTERVAL_MAP:a}}),setTimeout((()=>{_.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,_.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===U.Gp.DATA_LOGON&&(i=t.DETAILS.DATASOURCE_NAME.replace(/_/g,"-").toLowerCase()),`${e}${i}`}};(0,i.__decorate)([l.observable],w.prototype,"host",void 0),(0,i.__decorate)([l.observable],w.prototype,"isWorking",void 0),(0,i.__decorate)([l.observable],w.prototype,"_isConnected",void 0),(0,i.__decorate)([l.volatile],w.prototype,"isConnected",null),w=(0,i.__decorate)([(0,i.__param)(0,L),(0,i.__param)(1,U.lT),(0,i.__param)(2,b.N),(0,i.__param)(3,g),(0,i.__param)(4,R.b_),(0,i.__param)(5,(0,u.optional)(T))],w);const y=u.DI.createInterface((e=>e.singleton(w)));var k=s(45230);const P={connect:{alwaysOn:!1,enableHeartbeat:!0,enableHeartbeatLogging:!1,heartbeatInterval:1e4,enableMessageLogging:!1},reconnect:{reconnectAttempts:10,reconnectInterval:1e4,reconnectStreams:!0}};let G=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()}constructor(e,t,s,i,r=P){this.socket=e,this.messageBuilder=t,this.metaCache=s,this.events=i,this.config=r,this.isWorking=!1}httpMode(){return!1}setValidSession(e){this.socket.hasValidSession=e}send(e,t){return this.socket.send(e,t)}connect(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){return this.socket.reset(),S.test(e)?this.socket.connect(e,this.config.connect,this.config.reconnect):(_.v.error(`Specified host (${e}) is not valid WebSocket url. Connection will not proceed.`),void _.v.warn("Make sure the host url starts with wss:// or ws://"))}))}disconnect(){this.socket.reset()}snapshot(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return _.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);_.v.debug(`${r.MESSAGE_TYPE} (stream) message created -> `,r);const n=this.socket.sendForStream(r,t,s,(()=>{this.events.onStreamCompleteEvent(n)}));return this.events.onStreamEvent(e,r,n,{onMessage:t,onError:s}),n}getMoreRows(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMoreRowsMessage(e);return _.v.debug(`${t.MESSAGE_TYPE} message created -> `,t),this.socket.send(t,!1)}))}getMoreColumns(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMoreColumnsMessage(e);return this.socket.send(t)}))}dataLogoff(e){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return _.v.debug(`${t.MESSAGE_TYPE} message created -> `,t),this.socket.send(t)}))}getMetadata(e,t=!0){var s;return(0,i.__awaiter)(this,void 0,void 0,(function*(){if(t&&this.metaCache.hasMetadataFor(e))return _.v.debug(`Cached metadata retrieved for ${e}`),this.metaCache.getMetadataFor(e);const i=this.messageBuilder.createMetaRequestMessage(e);let r,n;_.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,_.v.error(e),n}finally{this.events.onMetadataEvent(e,i,n),this.isWorking=!1}return r}))}getJSONSchema(e,t=!0){var s;return(0,i.__awaiter)(this,void 0,void 0,(function*(){if(t&&this.metaCache.hasJsonSchemaFor(e))return _.v.debug(`Cached JsonSchema retrieved for ${e}`),this.metaCache.getJsonSchemaFor(e);const i=this.messageBuilder.createMetaRequestMessage(e,U.Gp.JSON_SCHEMA_REQUEST);let r;_.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){_.v.error(e)}finally{this.isWorking=!1}return r}))}request(e,t){const s=this.messageBuilder.createRequestMessage(e,t);return _.v.debug(`${s.MESSAGE_TYPE} (request server) message created -> `,s),this.socket.send(s)}getAvailableResources(e){const t=this.messageBuilder.createResourcesMessage(e);return _.v.debug(`${t.MESSAGE_TYPE} (resources) message created -> `,t),this.socket.send(t)}commitEvent(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const s=this.messageBuilder.createCommitMessage(e,t);_.v.debug(`${s.MESSAGE_TYPE} (commit) message created -> `,s);const i=this.socket.send(s);return this.events.onCommitEvent(e,s),i}))}};(0,i.__decorate)([l.observable],G.prototype,"isWorking",void 0),(0,i.__decorate)([l.volatile],G.prototype,"isConnected",null),G=(0,i.__decorate)([(0,i.__param)(0,k.yQ),(0,i.__param)(1,U.lT),(0,i.__param)(2,g),(0,i.__param)(3,v.EQ),(0,i.__param)(4,(0,u.optional)(m))],G);const F="true"===r||!1,H=u.DI.createInterface((e=>e.singleton(G))),V=u.DI.createInterface((e=>F?e.aliasTo(y):e.aliasTo(H)));function B(){return u.DI.getOrCreateDOMContainer().get(V)}},21281:(e,t,s)=>{s.d(t,{Go:()=>i,Gp:()=>r,lT:()=>E,x6:()=>n,z2:()=>l});var i,r,n,o=s(8202),a=s(32808),c=s(34387),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.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=>e.CODE===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){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:i.MORE_ROWS,DETAILS:{SOURCE_REF:e},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}};u=(0,o.__decorate)([(0,o.__param)(0,h.N),(0,o.__param)(1,a.k)],u);const E=c.DI.createInterface((e=>e.singleton(u)))},45230:(e,t,s)=>{s.d(t,{yQ:()=>U,Ol:()=>D});var i=s(8202),r=s(32808),n=s(49229),o=s(57418),a=s(34387),c=s(50049),d=s(37970),h=s(75841),l=s(26274),u=s(53193),E=s(84190),g=s(82834),S=s(66640),_=s(53940),v=s(48653),m=s(98316),T=s(17465),R=s(21281);const p=1e4,O=6e4;var A;!function(e){e.Linear="linear",e.Exponential="exponential"}(A||(A={}));const I=(e,t)=>{const{reconnectInterval:s=p}=e,i=s>O?O:s,r=Math.round(Math.log2(O/i));return i*Math.pow(2,t%r)},f=e=>{const{reconnectInterval:t=p}=e;return t>O?O:t};var M=s(5709);class C{constructor(e){this.interval=e,this.workerScript=`\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 b extends c.B{constructor(){super()}}d.c;class N{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 L=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 this.status.hasValidSession}set hasValidSession(e){this.status.hasValidSession=e}constructor(e,t,s,i,r){this.messageBuilder=e,this.session=t,this.serializer=s,this.uuid=i,this.status=r,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,t,s){return this.url=e,this.connectOptions=t,this.reconnectOptions=s,new Promise((e=>{var t,s,r,n;T.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 v.Q({url:this.url,openObserver:{next:()=>{this.session.setSessionStorageItem("hostUrl",this.url),this.status.isConnected=!0,this.prepareHeartbeat(),T.v.info("WebSocket connection is now open"),e(this.isConnected)}},closeObserver:{next:t=>{this.status.onClose(t),this.isDisconnectedByServer&&T.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.__awaiter)(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,T.v.info,s);const{SOURCE_REF:i,MESSAGE_TYPE:r}=e,n=this.getMessageHandler(i,r);if(!n)return void(e.MESSAGE_TYPE===R.Go.MSG_NACK&&e.ERROR&&e.ERROR.forEach((t=>{T.v.error(`MessageType: ${e.MESSAGE_TYPE} | Error Details:`,t)})));let o=!1;switch(e.MESSAGE_TYPE){case R.Gp.EVENT_LOGIN_AUTH_ACK:{this.hasValidSession=!0;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 R.Go.LOGOUT_ACK:return this.hasValidSession=!1,n.onReceivedMessage.call(this,e),void this.cleanMessages();case R.Go.LOGON_ACK:return;case R.Go.LOGOFF_ACK:if(e.LOGGED_OUT&&this.hasValidSession){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.send(e);t?t.MESSAGE_TYPE===R.Gp.EVENT_LOGIN_AUTH_ACK&&(this.session.setAuthResult(t),this.wsMessageHandlers.forEach((e=>{e.isSubscription&&(e.sentMessage.SESSION_AUTH_TOKEN=t.SESSION_AUTH_TOKEN,this.websocket.next(e.sentMessage))}))):this.hasValidSession=!1}break;case R.Go.QUERY_UPDATE:n.isSubscription||this.sendDataLogoff(i);break;case R.Go.MSG_NACK:case R.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=>{T.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():T.v.info("Connection is now closed")}}),this.status.isConfigured=!0}))}prepareHeartbeat(){var e,t,s,r;this.heartbeatTicker&&this.heartbeatTicker.stop();const n=()=>(0,i.__awaiter)(this,void 0,void 0,(function*(){if(!this.isConnected)return;const e={MESSAGE_TYPE:R.Go.HEARTBEAT_PING,SOURCE_REF:this.uuid.createId()},t=yield this.send(e);this.heartbeatIsEnabled=t.MESSAGE_TYPE===R.Go.HEARTBEAT_PONG&&t.SOURCE_REF===e.SOURCE_REF}));if(null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableHeartbeat)&&void 0!==t?t:this.heartbeatIsEnabled){const e=null!==(r=null===(s=this.connectOptions)||void 0===s?void 0:s.heartbeatInterval)&&void 0!==r?r:this.heartbeatInterval;this.heartbeatTicker=new C(e),this.heartbeatTicker.start((()=>{this.websocket&&this.isConnected&&(n(),this.heartbeatLoggingIsEnabled&&T.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)===A.Exponential?I:f,a=this.isConnectedSubject.asObservable().pipe((0,E.n)((e=>e?(0,h.of)(-1):((e,t)=>new d.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,g.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,h.of)(e):(this.status.reconnectionLimitReached=!0,(0,l.$)((()=>new Error(`Max reconnect attempts ${r} reached.`))))}))))),(0,S.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=>{T.v.debug(`Attempt no. ${e+1} to reconnect`),this.websocket.complete(),this.connect(this.url,this.connectOptions,this.reconnectOptions)},error:e=>{var t;T.v.debug(e),null===(t=this.socketSubscription)||void 0===t||t.unsubscribe(),this.status.isReconnecting=!1},complete:()=>{T.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 b,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,T.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,l.$)((()=>new Error("WebSocket connection is closed")));if(!this.hasValidSession)return(0,l.$)((()=>new Error("WebSocket connection is open but there is no valid/active session, please check your auth flow")));const r=`Sending Message (stream) for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,T.v.info,r),this.setMessageHandler(e,t,s,!0),this.websocket.next(e),new d.c((t=>{const s=new c.B;return this.wsMessages.pipe((0,_.p)((t=>t.SOURCE_REF===e.SOURCE_REF)),(0,u.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()}}))}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,T.v.debug,r),this.wsMessageHandlers.set(e.SOURCE_REF,new N(e,t,s,i))}sendDataLogoff(e){this.hasValidSession&&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,T.v.debug,s),this.wsMessageHandlers.get(e)}logMessageTypeFlow(e,t,s){switch(e){case R.Gp.DATA_LOGOFF:t(s);break;case R.Go.HEARTBEAT_PING:case R.Go.HEARTBEAT_PONG:this.heartbeatLoggingIsEnabled&&t(s);break;default:this.messageLoggingIsEnabled&&t(s)}}};(0,i.__decorate)([o.observable],L.prototype,"websocket",void 0),(0,i.__decorate)([o.observable],L.prototype,"wsMessages",void 0),(0,i.__decorate)([o.observable],L.prototype,"wsMessageHandlers",void 0),(0,i.__decorate)([o.observable],L.prototype,"heartbeatIsEnabled",void 0),L=(0,i.__decorate)([(0,i.__param)(0,R.lT),(0,i.__param)(1,m.N),(0,i.__param)(2,n.b_),(0,i.__param)(3,r.k),(0,i.__param)(4,M.S5)],L);const U=a.DI.createInterface((e=>e.singleton(L)));function D(){return a.DI.getOrCreateDOMContainer().get(U)}},5709:(e,t,s)=>{s.d(t,{S5:()=>c});var i=s(8202),r=s(57418),n=s(34387),o=s(97156);class a{constructor(){this.isConfigured=!1,this.isConnecting=!1,this.isConnected=!1,this.isReconnecting=!1,this.reconnectionLimitReached=!1,this.hasValidSession=!1,this.isConnectedSubject=new o.t(this.isConnected)}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.__decorate)([r.observable],a.prototype,"isConfigured",void 0),(0,i.__decorate)([r.observable],a.prototype,"isConnecting",void 0),(0,i.__decorate)([r.observable],a.prototype,"isConnected",void 0),(0,i.__decorate)([r.observable],a.prototype,"isReconnecting",void 0),(0,i.__decorate)([r.observable],a.prototype,"reconnectionLimitReached",void 0),(0,i.__decorate)([r.observable],a.prototype,"hasValidSession",void 0),(0,i.__decorate)([r.observable],a.prototype,"closedCode",void 0),(0,i.__decorate)([r.observable],a.prototype,"closedReason",void 0),(0,i.__decorate)([r.observable],a.prototype,"closedClean",void 0);const c=n.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}}},60949:(e,t,s)=>{s.d(t,{yW:()=>T});var i=s(8202),r=s(57418),n=s(34387),o=s(51046),a=s(8790),c=s(1762),d=s(84190),h=s(66640),l=s(78466),u=s(61503),E=s(48707),g=s(17465);var S=s(34193),_=s(39087);const v={options:{criteria:"",isSnapshot:!1,maxRows:_.OD.MAX_ROWS_250,maxView:_.OD.MAX_VIEW_1000,pollingInterval:_.OD.REQ_REP_POLLING_INTERVAL_MS,movingView:!1,orderBy:"",resourceName:"",reverse:!1},criteriaToFields:function(e){const t=e.split("&&").map((e=>e.trim())),s={};return t.forEach((e=>{if(e.startsWith("Expr"))switch(e.match(/Expr\.(\w+)\(/)[1]){case"dateIsToday":{const t=/Expr\.dateIsToday\((\w+)\)/,[,i]=e.match(t),r=new Date;s[`${i}_FROM`]=`${r.toISOString().replace(/-/g,"").split("T")[0]}-00:00`,r.setDate(r.getDate()+1),s[`${i}_TO`]=`${r.toISOString().replace(/-/g,"").split("T")[0]}-00:00`}break;case"dateTimeIsGreaterEqual":{const t=/Expr\.dateTimeIsGreaterEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_FROM`]=r}break;case"dateTimeIsLessEqual":{const t=/Expr\.dateTimeIsLessEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_TO`]=r}break;case"containsIgnoreCase":{const t=/Expr\.containsIgnoreCase\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[i]=`*${r}*`}}else{const t=e.substr(0,e.indexOf("=")).trim().replace(/["']/g,""),i=e.substr(e.lastIndexOf("=")+1,e.length).trim().replace(/["']/g,"");s[t]=i}})),s},dataServerResultFilter:S.d};let m=class{constructor(e,t,s=v){this.connect=e,this.auth=t,this.config=s,this.initialized=!1,this.readOnly=!0,this.originalFieldDef=[],this.requestFields=[],this.fieldMetadata=[],this.availableIndexes=[]}validResourceName(e){return!!e&&!!e.trim().length}init(e,t=!0){var s;return(0,i.__awaiter)(this,void 0,void 0,(function*(){if(!this.validResourceName(null==e?void 0:e.resourceName))return!1;this.options=Object.assign(Object.assign({},this.config.options),e);const i=this.options.resourceName;if(t){g.v.debug(`Initializing ${i} Datasource`);const e=yield this.connect.getMetadata(i).catch((e=>g.v.error(`Metadata Fetch failed for ${i}:`,e)));if(!e)return this.deinit(),!1;this.resourceType=e.TYPE,this.availableIndexes=null!==(s=e.INDEXES)&&void 0!==s?s:[],this.originalFieldDef=(0,E.a)(e),this.fieldMetadata=(0,E.X)(this.originalFieldDef),this.requestFields=e.REQUEST_FIELD||[],g.v.debug(`Datasource for ${i} is ready`)}return this.options.isSnapshot||(this._stream=yield this.createStream()),this.initialized=!0,this.initialized}))}deinit(){var e;g.v.debug("Datasource.deinit",null===(e=this.options)||void 0===e?void 0:e.resourceName),this.initialized=!1,this.options={},this.resourceType=void 0,this.availableIndexes=[],this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[]}destroy(){var e;g.v.debug("Datasource.destroy",null===(e=this.options)||void 0===e?void 0:e.resourceName),this.deinit(),delete this._stream}get stream(){return this._stream}get params(){const e={CRITERIA_MATCH:this.options.criteria,FIELDS:this.options.fields,MAX_ROWS:this.options.maxRows,MAX_VIEW:this.options.maxView,MOVING_VIEW:this.options.movingView,POLLING_INTERVAL:this.options.pollingInterval,DISABLE_POLLING:this.options.disablePolling,REQUEST:this.options.request,REVERSE:this.options.reverse};if(this.options.orderBy)if(this.availableIndexes.findIndex((e=>e.NAME===this.options.orderBy))>-1)e.ORDER_BY=this.options.orderBy;else{const e=this.availableIndexes.map((e=>e.NAME));g.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 g.v.debug("Getting configured params:",e),e}snapshot(){var e;return(0,i.__awaiter)(this,void 0,void 0,(function*(){switch(g.v.debug(`Requesting snapshot for ${this.options.resourceName} (${this.resourceType}).`),this.resourceType){case _.vt.DATASERVER:return this.connect.snapshot(this.options.resourceName,this.params);case _.vt.REQUEST_SERVER:{const t=this.params,{REQUEST:s,CRITERIA_MATCH:r}=t,n={DETAILS:(0,i.__rest)(t,["REQUEST","CRITERIA_MATCH"]),REQUEST:Object.assign(Object.assign(Object.assign({},Object.fromEntries(this.requestFields.map((e=>[e.NAME,"*"])))),this.params.REQUEST),(null===(e=null==this?void 0:this.options)||void 0===e?void 0:e.criteria)?this.config.criteriaToFields(this.options.criteria):{})};return this.connect.request(this.options.resourceName,n)}default:throw new Error(`Snapshot not supported for selected resource type: ${this.resourceType}`)}}))}snapshotFiltered(e="ROW_REF"){return(0,i.__awaiter)(this,void 0,void 0,(function*(){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.__awaiter)(this,void 0,void 0,(function*(){if(![_.vt.DATASERVER,_.vt.REQUEST_SERVER].includes(this.resourceType))throw new Error(`Streaming not supported for selected resource type: ${this.resourceType}`);return this.resourceType===_.vt.DATASERVER?this.createDataserverStream():(g.v.debug(`Creating fake stream by polling ${this.options.resourceName} REQUEST_SERVER`),this.createReqRepStream())}))}createDataserverStream(){return(0,i.__awaiter)(this,void 0,void 0,(function*(){return this.connect.stream(this.options.resourceName,(e=>{}),(e=>g.v.error(e)),this.params)}))}createReqRepStream(){return(0,o.O)(0,this.params.DISABLE_POLLING?void 0:this.params.POLLING_INTERVAL).pipe((0,d.n)((()=>(0,a.z)([this.connect.isConnected$,this.auth.isLoggedIn$]).pipe((0,h.v)((()=>this.connect.isConnected&&this.auth.isLoggedIn)),(0,d.n)((()=>(0,c.H)(this.snapshot())))))))}};(0,i.__decorate)([r.observable],m.prototype,"initialized",void 0),(0,i.__decorate)([r.observable],m.prototype,"readOnly",void 0),(0,i.__decorate)([r.observable],m.prototype,"_stream",void 0),m=(0,i.__decorate)([(0,i.__param)(0,u.dm),(0,i.__param)(1,l.N),(0,i.__param)(2,(0,n.optional)(_.aB))],m);const T=n.DI.createInterface((e=>e.transient(m)))},39087:(e,t,s)=>{s.d(t,{OD:()=>n,aB:()=>o,vt:()=>i});var i,r=s(34387);!function(e){e.DATASERVER="DATASERVER",e.EVENT_HANDLER="EVENT_HANDLER",e.REQUEST_SERVER="REQUEST_SERVER"}(i||(i={}));class n{}n.MAX_ROWS_250=250,n.MAX_VIEW_1000=1e3,n.REQ_REP_POLLING_INTERVAL_MS=1e4,n.DATASERVER_ROW_ID="ROW_REF",n.REQUEST_SERVER_ROW_ID="RECORD_ID";const o=r.DI.createInterface()},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})},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"}(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}},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=>{const t=null==e?void 0:e.TYPE;if(t===i.vt.DATASERVER)return e.FIELD||[];if(t===i.vt.REQUEST_SERVER)return e.REPLY_FIELD||[];throw new Error(`Unsupported resource type: ${t}`)}},98316:(e,t,s)=>{s.d(t,{N:()=>n});var i=s(34387);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("/login"===e)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)))},70624:(e,t,s)=>{s.d(t,{K:()=>a});var i=s(8202),r=s(57418),n=s(34387);class o{constructor(e){this.set(e)}set(e){e&&(this.permissions=e.permissions,this.profiles=e.profiles,this.username=e.username)}unset(){this.permissions=void 0,this.profiles=void 0,this.username=void 0}hasAdminProfile(){return this.hasProfile("ADMIN")}hasPermission(e){return this.hasKey(this.permissions,e)}hasProfile(e){return this.hasKey(this.profiles,e)}hasKey(e,t){return!!(e&&e.length&&t)&&(Array.isArray(t)||(t=[t]),t.some((t=>e.includes(t))))}}(0,i.__decorate)([r.observable],o.prototype,"permissions",void 0),(0,i.__decorate)([r.observable],o.prototype,"profiles",void 0),(0,i.__decorate)([r.observable],o.prototype,"username",void 0);const a=n.DI.createInterface((e=>e.singleton(o)))},17465:(e,t,s)=>{s.d(t,{v:()=>r});var i=s(42534);const r=(0,i.createLogger)("foundation-comms")},40729:(e,t,s)=>{s.d(t,{O:()=>d});var i=s(57418);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)}},70997:(e,t,s)=>{function i(e,t,s){const i=e=>"function"==typeof e?e:()=>e,r=i(t),n=i(s);return(t,s)=>e(t,s)?r(t,s):n(t,s)}s.d(t,{q:()=>i})},12066:(e,t,s)=>{s.d(t,{CL:()=>r,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"," ")}},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)}},49229:(e,t,s)=>{s.d(t,{b_:()=>h});var i=s(17914),r=s(34387),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.__decorate)([(0,i.__param)(0,(0,r.optional)(o))],d);const h=r.DI.createInterface((e=>e.singleton(d)))},21530:(e,t,s)=>{s.d(t,{O:()=>r});var i=s(28745);const r=(e,t)=>{var s;let r=document.getElementById(t);if(r)return void i.v.debug(`\n An element with the id of '${t}' already exists and likely has the css rules applied.\n `);const n=null!==(s=document.head)&&void 0!==s?s:document.getElementsByTagName("head")[0];r=document.createElement("style"),r.id=t,n.appendChild(r);const o=r.sheet.insertRule(e);return()=>{r&&(r.sheet.deleteRule(o),n.removeChild(r))}}},80273:(e,t,s)=>{s.d(t,{Du:()=>c,IT:()=>o,WP:()=>r,f4:()=>a,zz:()=>n});var i=s(21530);const r=(e,t)=>{(0,i.O)(e,t)};var n,o;!function(e){e.Italic="italic",e.Normal="normal"}(n||(n={})),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"}(o||(o={}));const a=(e,t=n.Normal,s=o.Regular)=>`\n font-family: ${e};\n font-style: ${t};\n font-weight: ${s};\n`,c={minusOne:-1,minusTwo:-2,plusOne:1,plusTwo:2,plusThree:3,plusFour:4,plusFive:5,plusSix:6}},28745:(e,t,s)=>{s.d(t,{v:()=>r});var i=s(42534);const r=(0,i.createLogger)("foundation-utils")},32808:(e,t,s)=>{s.d(t,{k:()=>c});var i=s(17914),r=s(34387),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(e=!1){return(0,i.__awaiter)(this,void 0,void 0,(function*(){const t=(0,n.A)();return e&&o.v.debug(`UUID.createRemoteID ${t}`),t}))}}const c=r.DI.createInterface((e=>e.singleton(a)))}}]);
2
2
  //# sourceMappingURL=842.1b8c26e4166585e1fc0b843d66f8e981.js.map