@olympeio/runtime-node 9.11.8 → 9.11.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -239,43 +239,43 @@ var m;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:
239
239
  function ca(a){a=['object'==typeof globalThis&&globalThis,a,'object'==typeof window&&window,'object'==typeof self&&self,'object'==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error('Cannot find global object');}var da=ca(this);function ea(a,b){if(b)a:{var c=da;a=a.split('.');for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&ba(c,a,{configurable:!0,writable:!0,value:b})}}
240
240
  ea('Symbol.asyncIterator',function(a){return a?a:Symbol('Symbol.asyncIterator')});function fa(a){function b(d){return a.next(d)}function c(d){return a.throw(d)}return new Promise(function(d,e){function f(g){g.done?d(g.value):Promise.resolve(g.value).then(b,c).then(f,e)}f(a.next())})}function u(a){return fa(a())}
241
241
  function ha(a){var b=a[Symbol.asyncIterator];if(void 0!==b)a=b.call(a);else{b=ia;var c='undefined'!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];a=c?c.call(a):{next:aa(a)};a=new b(a)}return a}
242
- function ia(a){this[Symbol.asyncIterator]=function(){return this};this[Symbol.iterator]=function(){return a};this.next=function(b){return Promise.resolve(a.next(b))};void 0!==a['throw']&&(this['throw']=function(b){return Promise.resolve(a['throw'](b))});void 0!==a['return']&&(this['return']=function(b){return Promise.resolve(a['return'](b))})}function ja(a,b){this.j=a;this.value=b}function ka(a,b,c,d){this.method=a;this.j=b;this.resolve=c;this.D=d}function la(a){this.j=a;this.next=null}
242
+ function ia(a){this[Symbol.asyncIterator]=function(){return this};this[Symbol.iterator]=function(){return a};this.next=function(b){return Promise.resolve(a.next(b))};void 0!==a['throw']&&(this['throw']=function(b){return Promise.resolve(a['throw'](b))});void 0!==a['return']&&(this['return']=function(b){return Promise.resolve(a['return'](b))})}function ja(a,b){this.j=a;this.value=b}function ka(a,b,c,d){this.method=a;this.j=b;this.resolve=c;this.reject=d}function la(a){this.j=a;this.next=null}
243
243
  function ma(){this.D=this.j=null}ma.prototype.nf=function(){return null===this.j};ma.prototype.first=function(){if(this.j)return this.j.j;throw Error('no frames in executionQueue');};function na(a){a.j&&(a.j=a.j.next,a.j||(a.D=null))}ma.prototype.enqueue=function(a){a=new la(a);this.D?this.D.next=a:this.j=a;this.D=a};
244
244
  function oa(a){this.H=a;this.D=null;this.j=new ma;this[Symbol.asyncIterator]=function(){return this};var b=this;this.R=function(c){var d=b.j.first();!0===c.done?(b.D=null,d.method='next',d.j=c.value):(d.resolve({value:c.value,done:!1}),na(b.j));pa(b)};this.N=function(c){qa(b,c)};this.F=function(c){ra(b,c)}}function sa(a,b,c){return new Promise(function(d,e){var f=a.j.nf();a.j.enqueue(new ka(b,c,d,e));f&&pa(a)})}oa.prototype.next=function(a){return sa(this,'next',a)};
245
245
  oa.prototype.return=function(a){return sa(this,'return',new ja(0,a))};oa.prototype.throw=function(a){return sa(this,'throw',a)};function pa(a){if(!a.j.nf())try{if(a.D){if(!a.D)throw Error('no delegate to perform execution');var b=a.j.first();if(b.method in a.D)try{a.D[b.method](b.j).then(a.R,a.N).catch(a.F)}catch(c){qa(a,c)}else a.D=null,pa(a)}else ta(a)}catch(c){ra(a,c)}}
246
- function ta(a){var b=a.j.first();try{var c=a.H[b.method](b.j);if(c.value instanceof ja)switch(c.value.j){case 0:Promise.resolve(c.value.value).then(function(d){b.resolve({value:d,done:c.done});na(a.j);pa(a)},function(d){b.D(d);na(a.j);pa(a)}).catch(a.F);break;case 1:a.D=ha(c.value.value);b.method='next';b.j=void 0;pa(a);break;case 2:Promise.resolve(c.value.value).then(function(d){b.method='next';b.j=d;pa(a)},function(d){b.method='throw';b.j=d;pa(a)}).catch(a.F);break;default:throw Error('Unrecognized AsyncGeneratorWrapper$ActionEnum');
247
- }else b.resolve(c),na(a.j),pa(a)}catch(d){b.D(d),na(a.j),pa(a)}}function qa(a,b){var c=a.j.first();a.D=null;c.method='throw';c.j=b;pa(a)}function ra(a,b){a.j.nf()||(a.j.first().D(b),na(a.j));a.D&&'return'in a.D&&(a.D['return'](void 0),a.D=null);a.H['return'](void 0);pa(a)}ea('Array.prototype.includes',function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var f=d[c];if(f===b||Object.is(f,b))return!0}return!1}});
246
+ function ta(a){var b=a.j.first();try{var c=a.H[b.method](b.j);if(c.value instanceof ja)switch(c.value.j){case 0:Promise.resolve(c.value.value).then(function(d){b.resolve({value:d,done:c.done});na(a.j);pa(a)},function(d){b.reject(d);na(a.j);pa(a)}).catch(a.F);break;case 1:a.D=ha(c.value.value);b.method='next';b.j=void 0;pa(a);break;case 2:Promise.resolve(c.value.value).then(function(d){b.method='next';b.j=d;pa(a)},function(d){b.method='throw';b.j=d;pa(a)}).catch(a.F);break;default:throw Error('Unrecognized AsyncGeneratorWrapper$ActionEnum');
247
+ }else b.resolve(c),na(a.j),pa(a)}catch(d){b.reject(d),na(a.j),pa(a)}}function qa(a,b){var c=a.j.first();a.D=null;c.method='throw';c.j=b;pa(a)}function ra(a,b){a.j.nf()||(a.j.first().reject(b),na(a.j));a.D&&'return'in a.D&&(a.D['return'](void 0),a.D=null);a.H['return'](void 0);pa(a)}ea('Array.prototype.includes',function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var f=d[c];if(f===b||Object.is(f,b))return!0}return!1}});
248
248
  ea('Object.entries',function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push([d,b[d]]);return c}});function ua(a,b){a instanceof String&&(a+='');var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}ea('Array.prototype.values',function(a){return a?a:function(){return ua(this,function(b,c){return c})}});
249
249
  ea('Promise.prototype.finally',function(a){return a?a:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c;})})}});
250
250
  ea('Object.fromEntries',function(a){return a?a:function(b){var c={};if(!(Symbol.iterator in b))throw new TypeError(''+b+' is not iterable');b=b[Symbol.iterator].call(b);for(var d=b.next();!d.done;d=b.next()){d=d.value;if(Object(d)!==d)throw new TypeError('iterable for fromEntries should yield objects');c[d[0]]=d[1]}return c}});function va(a){if(null==a)throw new TypeError("The 'this' value for String.prototype.padStart must not be null or undefined");return a+''}
251
251
  function wa(a,b){a=void 0!==a?String(a):' ';return 0<b&&a?a.repeat(Math.ceil(b/a.length)).substring(0,b):''}ea('String.prototype.padStart',function(a){return a?a:function(b,c){var d=va(this);return wa(c,b-d.length)+d}});ea('String.prototype.padEnd',function(a){return a?a:function(b,c){var d=va(this);return d+wa(c,b-d.length)}});
252
252
  ea('Promise.allSettled',function(a){function b(d){return{status:'fulfilled',value:d}}function c(d){return{status:'rejected',reason:d}}return a?a:function(d){var e=this;d=Array.from(d,function(f){return e.resolve(f).then(b,c)});return e.all(d)}});ea('Object.values',function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push(b[d]);return c}});
253
253
  ea('Array.prototype.flatMap',function(a){return a?a:function(b,c){for(var d=[],e=0;e<this.length;e++){var f=b.call(c,this[e],e,this);Array.isArray(f)?d.push.apply(d,f):d.push(f)}return d}});ea('Array.prototype.flat',function(a){return a?a:function(b){b=void 0===b?1:b;for(var c=[],d=0;d<this.length;d++){var e=this[d];Array.isArray(e)&&0<b?(e=Array.prototype.flat.call(e,b-1),c.push.apply(c,e)):c.push(e)}return c}});var xa=this||self;
254
- function w(a,b){a=a.split('.');let c=xa;a[0]in c||'undefined'==typeof c.execScript||c.execScript('var '+a[0]);for(let d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};const olympe={de:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.de())throw Error('The olympe runtime is loaded more than once. Make sure not to import `@olympeio/runtime-web` or `@olympeio/runtime-node` explicitly, and to always use the `olympe` alias.');olympe.de().olympe=olympe;olympe.$E=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};const za=require('util');function Aa(a){if('string'===typeof a)return a;let b=a;'function'===typeof(null==a?void 0:a.toJSON)&&(b=a.toJSON());let c,d;return'function'===typeof(null==(c=b)?void 0:c.toString)&&(null==(d=b)?void 0:d.toString)!==Object.prototype.toString?b.toString():za.inspect(b,{maxStringLength:1E4,depth:null,breakLength:Infinity})}function Ba(a,b){return JSON.stringify({level:a,message:b.map(Aa).join(' ')})}
255
- const Ca=console.trace,Da=console.debug,Ea=console.log,Fa=console.info,Ga=console.warn,Ha=console.error;console.trace=(...a)=>Ca.call(console,Ba('TRACE',a));console.debug=(...a)=>Da.call(console,Ba('DEBUG',a));console.log=(...a)=>Ea.call(console,Ba('LOG',a));console.info=(...a)=>Fa.call(console,Ba('INFO',a));console.warn=(...a)=>Ga.call(console,Ba('WARN',a));console.error=(...a)=>Ha.call(console,Ba('ERROR',a));olympe.Va={};olympe.Va.node={};olympe.V={};olympe.V.Nf={};olympe.V.Nf.Po=class{process(a){for(const b of Object.keys(a.De))if(a.wd(b).Nn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.V.Nf.Po.ya=[olympe.V.Nf.gr];olympe.V.Nf.Qo=class{process(a){function b(e,f){if(f.includes(e))throw Error('Circular dependency detected: '+f.join(' > ')+' > '+e);if(d.has(e)){f=f.concat(e);d.delete(e);e=a.wd(e);c(e.zj(),f);for(const g of Ia(e))c(g.zj(),f)}}function c(e,f){for(const g of e)g instanceof olympe.V.qb&&b(g.T(),f)}const d=new Set(Object.keys(a.De));for(const e of d)b(e,[])}};olympe.V.Nf.Qo.ya=[olympe.V.Nf.gr];olympe.V.Nf.gr=class{process(){}};const Ja=[],Ka=[];function La(a){const b=a.Xa();b.debug('Registering configurations...');b.j++;Ja.forEach(c=>{B(a.G,'Registering configure callback '+(c.j?'for module '+c.j:''));a.H.push(c.D)});Ma(b);b.debug('done registering')}function Na(a){const b=a.Xa();b.debug('Running run callbacks of container...');b.j++;Ka.forEach(c=>{const d=Oa(a,c.zj());a.G.debug('Calling run callback '+`for module ${c.j}`);c.D.apply(null,d)});Ma(b);b.debug('done calling run callbacks. DI process completed!')}
256
- olympe.V.Vo=class{constructor(){}static j(a,b){Ja.push(new olympe.V.Sl(a,b))}static D(a,b,c){a.forEach(d=>{if(null===d||void 0===d)throw Error('Cannot proceed - DI configuration error. '+(c?`Run callback "${c}"`:'A run callback')+' cannot have a null or undefined dependency');});Ka.push(new olympe.V.Sl(b,c,a))}};olympe.V.config=olympe.V.Vo.j;olympe.V.run=olympe.V.Vo.D;olympe.V.Rs=a=>{const b=new Map,c=(d,e)=>{for(const [f,g]of Object.entries(d))d=e.concat((f.startsWith('#')?f.substring(1):f).toLowerCase()),'object'!==typeof g||null===g||f.startsWith('#')?b.set(d.join('.'),g):c(g,d)};c(a,[]);return b};olympe.V.Uj=class{constructor(){}getValue(){}};function Pa(a,b){let c,d;return null!=(d=null==(c=a.F)?void 0:c.call(a,b))?d:!0}olympe.V.Sl=class{constructor(a,b,c){this.D=a;this.Vd=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.V.qb(d):d);this.j=null!=b?b:'no name di callback';this.F=null}zj(){return this.Vd}};function Ra(a,b){var c=olympe.V.P.Eg;if(void 0!==a.j[c])throw Error('Service "'+c+'" has already been instantiated');a.j[c]=b}function Sa(a,b,c){let d=a.j[b];if(void 0===d){const e=a.H[b];if(void 0===e){if(c===olympe.V.Ah.j.Dm)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.G.error('Error during instantiation of service '+b),f;}!e.F&&(a.j[b]=d)}return d}
254
+ function w(a,b){a=a.split('.');let c=xa;a[0]in c||'undefined'==typeof c.execScript||c.execScript('var '+a[0]);for(let d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};const olympe={de:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.de())throw Error('The olympe runtime is loaded more than once. Make sure not to import `@olympeio/runtime-web` or `@olympeio/runtime-node` explicitly, and to always use the `olympe` alias.');olympe.de().olympe=olympe;olympe.aF=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};const za=require('util');function Aa(a){if('string'===typeof a)return a;let b=a;'function'===typeof(null==a?void 0:a.toJSON)&&(b=a.toJSON());let c,d;return'function'===typeof(null==(c=b)?void 0:c.toString)&&(null==(d=b)?void 0:d.toString)!==Object.prototype.toString?b.toString():za.inspect(b,{maxStringLength:1E4,depth:null,breakLength:Infinity})}function Ba(a,b){return JSON.stringify({level:a,message:b.map(Aa).join(' ')})}
255
+ const Ca=console.trace,Da=console.debug,Ea=console.log,Fa=console.info,Ga=console.warn,Ha=console.error;console.trace=(...a)=>Ca.call(console,Ba('TRACE',a));console.debug=(...a)=>Da.call(console,Ba('DEBUG',a));console.log=(...a)=>Ea.call(console,Ba('LOG',a));console.info=(...a)=>Fa.call(console,Ba('INFO',a));console.warn=(...a)=>Ga.call(console,Ba('WARN',a));console.error=(...a)=>Ha.call(console,Ba('ERROR',a));olympe.Xa={};olympe.Xa.node={};olympe.V={};olympe.V.Of={};olympe.V.Of.Qo=class{process(a){for(const b of Object.keys(a.Ee))if(a.wd(b).Qn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.V.Of.Qo.ya=[olympe.V.Of.hr];olympe.V.Of.Ro=class{process(a){function b(e,f){if(f.includes(e))throw Error('Circular dependency detected: '+f.join(' > ')+' > '+e);if(d.has(e)){f=f.concat(e);d.delete(e);e=a.wd(e);c(e.zj(),f);for(const g of Ia(e))c(g.zj(),f)}}function c(e,f){for(const g of e)g instanceof olympe.V.qb&&b(g.T(),f)}const d=new Set(Object.keys(a.Ee));for(const e of d)b(e,[])}};olympe.V.Of.Ro.ya=[olympe.V.Of.hr];olympe.V.Of.hr=class{process(){}};const Ja=[],Ka=[];function La(a){const b=a.Wa();b.debug('Registering configurations...');b.j++;Ja.forEach(c=>{B(a.G,'Registering configure callback '+(c.j?'for module '+c.j:''));a.H.push(c.D)});Ma(b);b.debug('done registering')}function Na(a){const b=a.Wa();b.debug('Running run callbacks of container...');b.j++;Ka.forEach(c=>{const d=Oa(a,c.zj());a.G.debug('Calling run callback '+`for module ${c.j}`);c.D.apply(null,d)});Ma(b);b.debug('done calling run callbacks. DI process completed!')}
256
+ olympe.V.Wo=class{constructor(){}static j(a,b){Ja.push(new olympe.V.Vl(a,b))}static D(a,b,c){a.forEach(d=>{if(null===d||void 0===d)throw Error('Cannot proceed - DI configuration error. '+(c?`Run callback "${c}"`:'A run callback')+' cannot have a null or undefined dependency');});Ka.push(new olympe.V.Vl(b,c,a))}};olympe.V.config=olympe.V.Wo.j;olympe.V.run=olympe.V.Wo.D;olympe.V.Ss=a=>{const b=new Map,c=(d,e)=>{for(const [f,g]of Object.entries(d))d=e.concat((f.startsWith('#')?f.substring(1):f).toLowerCase()),'object'!==typeof g||null===g||f.startsWith('#')?b.set(d.join('.'),g):c(g,d)};c(a,[]);return b};olympe.V.Uj=class{constructor(){}getValue(){}};function Pa(a,b){let c,d;return null!=(d=null==(c=a.F)?void 0:c.call(a,b))?d:!0}olympe.V.Vl=class{constructor(a,b,c){this.D=a;this.Vd=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.V.qb(d):d);this.j=null!=b?b:'no name di callback';this.F=null}zj(){return this.Vd}};function Ra(a,b){var c=olympe.V.P.Eg;if(void 0!==a.j[c])throw Error('Service "'+c+'" has already been instantiated');a.j[c]=b}function Sa(a,b,c){let d=a.j[b];if(void 0===d){const e=a.H[b];if(void 0===e){if(c===olympe.V.Ah.j.Gm)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.G.error('Error during instantiation of service '+b),f;}!e.F&&(a.j[b]=d)}return d}
257
257
  function Ta(a,b,c){b=b.toLowerCase();let d;const e=null!=(d=a.D.get(b))?d:[];e.push(c);a.D.set(b,e)}function Oa(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.G.j++,f=b[e],d[e]=f instanceof olympe.V.Uj?f.getValue(a):f,Ma(a.G);return d}
258
- olympe.V.Ah=class{constructor(a,b,c,d,e=2){this.H=a;this.F=b;this.parameters=c;this.j=Object.create(null);this.G=new olympe.V.vq(e);this.D=new Map;Ra(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Sa(this,f).subscribe(this.Ai.bind(this,f)))}Xa(){return this.G}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}Ai(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.G.debug(`Updating parameter ${a} to ${b} and notify ${null!=
259
- (d=null==(c=this.D.get(a))?void 0:c.length)?d:0} listeners.`);this.parameters[a]=b;var e;for(const f of null!=(e=this.D.get(a))?e:[])f(b)}}};olympe.V.Ah.j={mu:'exception',Dm:'null'};function Ua(a,b){b=olympe.V.Rs(b);for(const [c,d]of b)a.setParameter(c,d)}function C(a,b,c,...d){B(a.G,'Defining service '+b);a.j(b,c,d,!1,!1)}function Va(a,b,c,...d){B(a.G,'Defining service '+b);a.j(b,c,d,!1,!0)}function D(a,b,c,d,e=!1){B(a.G,'Defining service (as a factory) '+b);a.j(b,d,c,!0,e)}function Wa(a,b,c,d=!1){B(a.G,'Defining service alias '+b);a.j(b,e=>e,[c],!0,d)}function Xa(a,b){B(a.G,'Defining abstract service '+b);a.j(b).D=!0}
258
+ olympe.V.Ah=class{constructor(a,b,c,d,e=2){this.H=a;this.F=b;this.parameters=c;this.j=Object.create(null);this.G=new olympe.V.wq(e);this.D=new Map;Ra(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Sa(this,f).subscribe(this.Ai.bind(this,f)))}Wa(){return this.G}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}Ai(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.G.debug(`Updating parameter ${a} to ${b} and notify ${null!=
259
+ (d=null==(c=this.D.get(a))?void 0:c.length)?d:0} listeners.`);this.parameters[a]=b;var e;for(const f of null!=(e=this.D.get(a))?e:[])f(b)}}};olympe.V.Ah.j={nu:'exception',Gm:'null'};function Ua(a,b){b=olympe.V.Ss(b);for(const [c,d]of b)a.setParameter(c,d)}function C(a,b,c,...d){B(a.G,'Defining service '+b);a.j(b,c,d,!1,!1)}function Va(a,b,c,...d){B(a.G,'Defining service '+b);a.j(b,c,d,!1,!0)}function D(a,b,c,d,e=!1){B(a.G,'Defining service (as a factory) '+b);a.j(b,d,c,!0,e)}function Wa(a,b,c,d=!1){B(a.G,'Defining service alias '+b);a.j(b,e=>e,[c],!0,d)}function Xa(a,b){B(a.G,'Defining abstract service '+b);a.j(b).D=!0}
260
260
  function Ya(a,b,c,d){a.F.push(b);a.setParameter(b,d(...c.map(e=>a.getParameter(e))));D(a,b,c.map(e=>new olympe.V.Dh(e)),(...e)=>rxjs.combineLatest(e).pipe(rxjs.operators.skip(1),rxjs.operators.map(f=>d(...f)),rxjs.operators.distinctUntilChanged()))}function E(a,b,c){a.D[b.toLowerCase()]=c}
261
- olympe.V.cu=class{constructor(a,b){this.De=Object.create(null);this.parameters=Object.create(null);this.D=Object.create(null);this.F=[];Ua(this,a);Ua(this,b);this.R=[new olympe.V.Nf.Po,new olympe.V.Nf.Qo];this.H=[];a=this.getParameter(olympe.V.Config.uv);this.N=void 0!==a?a:3;this.G=new olympe.V.vq(this.N)}Xa(){return this.G}j(a,b,c,d,e){const f=a instanceof olympe.V.qb?a.T():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.De[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
262
- var g=this.De[f];g.id=g.id+'!!'+ ++olympe.V.cm.j;g.F=!0;g=g.id;c[h]=g;this.De[g]=this.De[f]}}this.De[f]=new olympe.V.cm(b,c,d||!1,f);return this.De[f]}setParameter(a,b){this.parameters[a.toLowerCase()]=b}wd(a){const b=this.De[a];if(void 0===b)throw Error(`DI Error: Definition ${a} was not found`);return b}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.D[a]}compile(){const a=this.H;this.G.debug('Calling '+a.length+' configure callbacks');this.G.j++;a.forEach(b=>
263
- {B(this.G,'Calling callback');this.G.j++;b(this);Ma(this.G)});Ma(this.G);this.G.debug('Configuration summary: '+Object.keys(this.De).length+' definitions');this.G.debug('Compiling...');this.G.j++;this.R.forEach((b,c)=>{this.G.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});Ma(this.G);this.G.debug('Compilation done, returning container');return new olympe.V.Ah(this.De,this.D,this.parameters,this.F,this.N)}};function Ia(a){let b,c;return null!=(c=null==(b=a.j)?void 0:b.values())?c:[]}
264
- olympe.V.cm=class{constructor(a,b,c,d){this.H=a||null;this.N=!!c;this.Vd=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.V.qb(e):e);this.D=!1;this.j=null;this.id=null!=d?d:'';this.F=!1}T(){return this.id}instantiate(a){const b=a.Xa();b.debug('Resolving arguments for '+this.id);const c=this.H;let d=Oa(a,this.Vd);const e=()=>{if(this.N)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};B(b,'Instantiating '+this.id);const f=olympe.C?olympe.C.kh().run(()=>e()):e();let g;if(0<
265
- (null==(g=this.j)?void 0:g.size)){b.j++;B(b,'Calling configuration callbacks:');for(const h of this.j.values())b.j++,B(b,'Check if need to call additional configuration callback '+h.j),Pa(h,f)?(B(b,'Calling additional configuration callback '+h.j),d=Oa(a,h.zj()),d.push(f),h.D.apply(null,d)):B(b,'Will not call additional configuration callback '+h.j+'predicate has returned false'),Ma(b);Ma(b)}B(b,'Done instantiating '+this.id);return f}zj(){return this.Vd}Nn(){return this.D}config(a,b,c,d,e){null===
266
- this.j&&(this.j=new Map);var f=this.j,g=f.set;b=new olympe.V.Sl(c,e,b);b.F=d;g.call(f,a,b)}};olympe.V.cm.j=0;olympe.V.Dh=class extends olympe.V.Uj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return new rxjs.Observable(b=>{b.next(a.getParameter(this.id));Ta(a,this.id,c=>b.next(c))})}};function Ma(a){0<a.j&&a.j--}function B(a,b){1>=a.D&&Za(a,'log','DI: '+b)}function Za(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.j;e++)d+=' ';console[b](d+c)}}olympe.V.vq=class{constructor(a){this.D=a;this.j=0}debug(a){2>=this.D&&Za(this,'log','DI: '+a)}info(a){3>=this.D&&Za(this,'info','DI: '+a)}warn(a){4>=this.D&&Za(this,'warn','DI: '+a)}error(a){5>=this.D&&Za(this,'error','DI: '+a)}};olympe.V.oa=class extends olympe.V.Uj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.V.qb=class extends olympe.V.Uj{constructor(a,b){super();this.id=a;this.j=b||olympe.V.Ah.j.mu}T(){return this.id}getValue(a){return Sa(a,this.id,this.j)}};olympe.V.P={Eg:'di.Container',IC:'di.PublicContainer'};olympe.V.Config={uv:'logging.di'};olympe.V.run([olympe.V.P.Eg],a=>{olympe.V.getParameter=b=>a.getParameter(b);olympe.V.Ai=(b,c)=>a.Ai(b,c);olympe.de().getConfig=b=>a.getParameter(b);olympe.de().getConfigNames=()=>Array.from(new Set([...Object.keys(a.parameters),...Object.keys(a.F)]));olympe.de().updateConfig=(b,c)=>a.Ai(b,c)});olympe.U={};olympe.U.jq=class{constructor(a){this.id=a||olympe.U.jq.j++}Ea(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}print(){return('000000'+this.id).substr(-6)}};olympe.U.jq.j=0;olympe.U.lC=class{constructor(a,b,c,d,e,f){this.j=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.j[3*a+b]=c}get(a,b){return this.j[3*a+b]}};olympe.U.Nh=function(a,b,c,d,e,f,g,h,k,l,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,l,n,p,q,0]};olympe.U.Nh.D=function(a){return new olympe.U.Nh(.213+.787*a,.715-.715*a,.072-.072*a,.213-.213*a,.715+.285*a,.072-.072*a,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,1)};olympe.U.Nh.j=function(){return new olympe.U.Nh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.U.Nh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.U.Nh.prototype.get=function(a,b){return this.values[5*a+b]};function $a(a){return(new TextEncoder).encode(a)}function ab(a,b){return a.j($a(b))}function bb(a){return(new TextDecoder('utf8')).decode(a)}function cb(a){const b=new olympe.U.stream.lg;for(let c=0;c<a.length;c+=65536){const d=c+65536;b.write(a.subarray(c,d>a.length?a.length:d))}b.complete();return b}
267
- olympe.U.Jl=class{D(){}j(){}H(a){return u(function*(){if(a instanceof ArrayBuffer)return new Uint8Array(a);if(a instanceof Uint8Array)return a;if('string'===typeof a)return $a(a);if(a instanceof Blob)return new Uint8Array(yield a.arrayBuffer());if(a instanceof olympe.U.stream.lg){const b=[];for(const c=ha(a);;){const d=yield c.next();if(d.done)break;b.push(...d.value)}return new Uint8Array(b)}throw Error('Unsupported value type for binary conversion.');})}F(){}};
268
- olympe.U.ys=a=>a.replace('+','-').replace('/','_');olympe.U.tx=a=>a.replace('-','+').replace('_','/');function eb(a){a.j=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.D&&a.D(d));if(0<a.values.size)eb(a);else{let d;null==(d=a.F)||d.call(a)}},a.H)}function fb(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function gb(a,b){a.D=b;return a}
269
- olympe.U.cn=class{constructor(a,b=a/2){this.timeout=a;this.H=b;this.values=new Map;this.F=this.D=this.j=null}add(a){this.values.set(a,Date.now());null===this.j&&eb(this)}has(a){return this.values.has(a)}forEach(a){this.values.forEach((b,c)=>a(c))}delete(a){a=this.values.delete(a);if(0===this.values.size){this.j&&clearTimeout(this.j);this.j=null;let b;null==(b=this.F)||b.call(this)}return a}clear(){this.j&&clearTimeout(this.j);this.j=null;this.values.clear();return this}};function hb(a,b){a.D=b;return a}function ib(a,b){a.j.F=b}
270
- olympe.U.Zh=class{constructor(a){this.j=gb(new olympe.U.cn(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);let d;null==(d=this.D)||d.call(this,b,c)});this.values=new Map;this.D=null}set(a,b){this.values.set(a,b);this.j.add(a);return this}has(a){return this.values.has(a)}get(a){return this.values.get(a)}forEach(a){this.values.forEach((b,c)=>a(b,c))}delete(a){this.values.delete(a);return this.j.delete(a)}clear(){this.j.clear();this.values.clear();return this}};function F(a,b,...c){if(!a.N)throw Error('Cannot update state before starting the state machine');if(!a.R.has(b))throw Error(`State ${b} not found`);var d;let e;var f=null!=(e=null==(d=a.D[a.D.length-1])?void 0:d.state)?e:a.F.getValue();if(null!==f){if(f===b){a.G.debug(`Move request is a no-op, state ${b} is already active or queued`);return}d=a.X.get(b);if(null!==d&&!d.has(f)){F(a,a.j,Error(`Cannot move to state ${b} from state ${f}`));return}}a.G.debug(`Plan moving to state ${b}, from state ${f}`);
261
+ olympe.V.du=class{constructor(a,b){this.Ee=Object.create(null);this.parameters=Object.create(null);this.D=Object.create(null);this.F=[];Ua(this,a);Ua(this,b);this.R=[new olympe.V.Of.Qo,new olympe.V.Of.Ro];this.H=[];a=this.getParameter(olympe.V.Config.vv);this.N=void 0!==a?a:3;this.G=new olympe.V.wq(this.N)}Wa(){return this.G}j(a,b,c,d,e){const f=a instanceof olympe.V.qb?a.T():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.Ee[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
262
+ var g=this.Ee[f];g.id=g.id+'!!'+ ++olympe.V.gm.j;g.F=!0;g=g.id;c[h]=g;this.Ee[g]=this.Ee[f]}}this.Ee[f]=new olympe.V.gm(b,c,d||!1,f);return this.Ee[f]}setParameter(a,b){this.parameters[a.toLowerCase()]=b}wd(a){const b=this.Ee[a];if(void 0===b)throw Error(`DI Error: Definition ${a} was not found`);return b}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.D[a]}compile(){const a=this.H;this.G.debug('Calling '+a.length+' configure callbacks');this.G.j++;a.forEach(b=>
263
+ {B(this.G,'Calling callback');this.G.j++;b(this);Ma(this.G)});Ma(this.G);this.G.debug('Configuration summary: '+Object.keys(this.Ee).length+' definitions');this.G.debug('Compiling...');this.G.j++;this.R.forEach((b,c)=>{this.G.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});Ma(this.G);this.G.debug('Compilation done, returning container');return new olympe.V.Ah(this.Ee,this.D,this.parameters,this.F,this.N)}};function Ia(a){let b,c;return null!=(c=null==(b=a.j)?void 0:b.values())?c:[]}
264
+ olympe.V.gm=class{constructor(a,b,c,d){this.H=a||null;this.N=!!c;this.Vd=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.V.qb(e):e);this.D=!1;this.j=null;this.id=null!=d?d:'';this.F=!1}T(){return this.id}instantiate(a){const b=a.Wa();b.debug('Resolving arguments for '+this.id);const c=this.H;let d=Oa(a,this.Vd);const e=()=>{if(this.N)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};B(b,'Instantiating '+this.id);const f=olympe.C?olympe.C.kh().run(()=>e()):e();let g;if(0<
265
+ (null==(g=this.j)?void 0:g.size)){b.j++;B(b,'Calling configuration callbacks:');for(const h of this.j.values())b.j++,B(b,'Check if need to call additional configuration callback '+h.j),Pa(h,f)?(B(b,'Calling additional configuration callback '+h.j),d=Oa(a,h.zj()),d.push(f),h.D.apply(null,d)):B(b,'Will not call additional configuration callback '+h.j+'predicate has returned false'),Ma(b);Ma(b)}B(b,'Done instantiating '+this.id);return f}zj(){return this.Vd}Qn(){return this.D}config(a,b,c,d,e){null===
266
+ this.j&&(this.j=new Map);var f=this.j,g=f.set;b=new olympe.V.Vl(c,e,b);b.F=d;g.call(f,a,b)}};olympe.V.gm.j=0;olympe.V.Dh=class extends olympe.V.Uj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return new rxjs.Observable(b=>{b.next(a.getParameter(this.id));Ta(a,this.id,c=>b.next(c))})}};function Ma(a){0<a.j&&a.j--}function B(a,b){1>=a.D&&Za(a,'log','DI: '+b)}function Za(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.j;e++)d+=' ';console[b](d+c)}}olympe.V.wq=class{constructor(a){this.D=a;this.j=0}debug(a){2>=this.D&&Za(this,'log','DI: '+a)}info(a){3>=this.D&&Za(this,'info','DI: '+a)}warn(a){4>=this.D&&Za(this,'warn','DI: '+a)}error(a){5>=this.D&&Za(this,'error','DI: '+a)}};olympe.V.oa=class extends olympe.V.Uj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.V.qb=class extends olympe.V.Uj{constructor(a,b){super();this.id=a;this.j=b||olympe.V.Ah.j.nu}T(){return this.id}getValue(a){return Sa(a,this.id,this.j)}};olympe.V.P={Eg:'di.Container',JC:'di.PublicContainer'};olympe.V.Config={vv:'logging.di'};olympe.V.run([olympe.V.P.Eg],a=>{olympe.V.getParameter=b=>a.getParameter(b);olympe.V.Ai=(b,c)=>a.Ai(b,c);olympe.de().getConfig=b=>a.getParameter(b);olympe.de().getConfigNames=()=>Array.from(new Set([...Object.keys(a.parameters),...Object.keys(a.F)]));olympe.de().updateConfig=(b,c)=>a.Ai(b,c)});olympe.U={};olympe.U.kq=class{constructor(a){this.id=a||olympe.U.kq.j++}Ea(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}print(){return('000000'+this.id).substr(-6)}};olympe.U.kq.j=0;olympe.U.mC=class{constructor(a,b,c,d,e,f){this.j=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.j[3*a+b]=c}get(a,b){return this.j[3*a+b]}};olympe.U.Nh=function(a,b,c,d,e,f,g,h,k,l,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,l,n,p,q,0]};olympe.U.Nh.D=function(a){return new olympe.U.Nh(.213+.787*a,.715-.715*a,.072-.072*a,.213-.213*a,.715+.285*a,.072-.072*a,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,1)};olympe.U.Nh.j=function(){return new olympe.U.Nh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.U.Nh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.U.Nh.prototype.get=function(a,b){return this.values[5*a+b]};function $a(a){return(new TextEncoder).encode(a)}function ab(a,b){return a.j($a(b))}function bb(a){return(new TextDecoder('utf8')).decode(a)}function cb(a){const b=new olympe.U.stream.mg;for(let c=0;c<a.length;c+=65536){const d=c+65536;b.write(a.subarray(c,d>a.length?a.length:d))}b.complete();return b}
267
+ olympe.U.Ml=class{D(){}j(){}H(a){return u(function*(){if(a instanceof ArrayBuffer)return new Uint8Array(a);if(a instanceof Uint8Array)return a;if('string'===typeof a)return $a(a);if(a instanceof Blob)return new Uint8Array(yield a.arrayBuffer());if(a instanceof olympe.U.stream.mg){const b=[];for(const c=ha(a);;){const d=yield c.next();if(d.done)break;b.push(...d.value)}return new Uint8Array(b)}throw Error('Unsupported value type for binary conversion.');})}F(){}};
268
+ olympe.U.zs=a=>a.replace('+','-').replace('/','_');olympe.U.ux=a=>a.replace('-','+').replace('_','/');function eb(a){a.j=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.D&&a.D(d));if(0<a.values.size)eb(a);else{let d;null==(d=a.F)||d.call(a)}},a.H)}function fb(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function gb(a,b){a.D=b;return a}
269
+ olympe.U.fn=class{constructor(a,b=a/2){this.timeout=a;this.H=b;this.values=new Map;this.F=this.D=this.j=null}add(a){this.values.set(a,Date.now());null===this.j&&eb(this)}has(a){return this.values.has(a)}forEach(a){this.values.forEach((b,c)=>a(c))}delete(a){a=this.values.delete(a);if(0===this.values.size){this.j&&clearTimeout(this.j);this.j=null;let b;null==(b=this.F)||b.call(this)}return a}clear(){this.j&&clearTimeout(this.j);this.j=null;this.values.clear();return this}};function hb(a,b){a.D=b;return a}function ib(a,b){a.j.F=b}
270
+ olympe.U.Zh=class{constructor(a){this.j=gb(new olympe.U.fn(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);let d;null==(d=this.D)||d.call(this,b,c)});this.values=new Map;this.D=null}set(a,b){this.values.set(a,b);this.j.add(a);return this}has(a){return this.values.has(a)}get(a){return this.values.get(a)}forEach(a){this.values.forEach((b,c)=>a(b,c))}delete(a){this.values.delete(a);return this.j.delete(a)}clear(){this.j.clear();this.values.clear();return this}};function F(a,b,...c){if(!a.N)throw Error('Cannot update state before starting the state machine');if(!a.R.has(b))throw Error(`State ${b} not found`);var d;let e;var f=null!=(e=null==(d=a.D[a.D.length-1])?void 0:d.state)?e:a.F.getValue();if(null!==f){if(f===b){a.G.debug(`Move request is a no-op, state ${b} is already active or queued`);return}d=a.X.get(b);if(null!==d&&!d.has(f)){F(a,a.j,Error(`Cannot move to state ${b} from state ${f}`));return}}a.G.debug(`Plan moving to state ${b}, from state ${f}`);
271
271
  b===a.j&&(a.G.debug("Clear transition's queue to move to error state"),a.D=[]);a.D.push({state:b,Vd:c});1===a.D.length&&jb(a).then()}function kb(a,b,c){a.H.has(b)||a.H.set(b,new Set);a.H.get(b).add(c)}
272
272
  function lb(a,b){let c=null;return(new Promise((d,e)=>{if(a.F.getValue()===b)d();else if(a.F.getValue()===a.j)e(Error(`Error state reached: ${a.j}`));else{c=()=>{let h;null==(h=a.H.get(b))||h.delete(f);let k;null==(k=a.H.get(a.j))||k.delete(g)};const f=()=>d(),g=()=>e(Error('Reached error state'));kb(a,b,f);kb(a,a.j,g)}})).finally(()=>{let d;return null==(d=c)?void 0:d()})}
273
273
  function mb(a,b,c=()=>{},d=null){if(a.N)throw Error('Cannot add state after starting the state machine');if(a.R.has(b))throw Error(`State ${b} already exists`);a.R.set(b,c);a.X.set(b,d?new Set(d):null)}function nb(a,b,c){mb(a,b,(d,e)=>u(function*(){try{yield c(d,e)}catch(f){a.G.error(`Error while processing error state ${b}: ${f}`)}}),null);a.j=b}
274
274
  function jb(a){return u(function*(){if(0!==a.D.length){var {state:b,Vd:c}=a.D[0],d=a.F.getValue();try{a.G.debug(`Start processing transition ${d} -> ${b}`);yield a.R.get(b)(d,...c);a.F.next(b);a.D.shift();a.G.debug(`New state reached: ${b}`);let e;null==(e=a.H.get(b))||e.forEach(f=>f());jb(a).then()}catch(e){a.G.debug(`Error while processing transition ${d} -> ${b}: ${e}`),F(a,a.j,e)}}})}
275
- olympe.U.Ew=class{constructor(a){this.G=a;this.N=!1;this.F=new rxjs.BehaviorSubject(null);this.R=new Map;this.X=new Map;this.j=null;this.D=[];this.H=new Map}start(a,...b){if(this.N)throw Error('State machine already started');if(null===this.j)throw Error('Error state not defined: all state machines should have an error state');this.N=!0;F(this,a,...b)}getState(){if(!this.N)throw Error('State machine not started');return this.F.getValue()}};function ob(a,b){a.R.push(b)}function pb(a,b){a.X.push(b)}function qb(a,b){let c;'object'!==typeof b&&'function'!==typeof b?c=b:b instanceof olympe.dc.CloudObject?c=b.toJSON():Array.isArray(b)?c=b.map(d=>qb(a,d)):c='N/A';return c}function rb(a,b,c,d){b={cat:b,epoch:null!=d?d:performance.now()-a.D};let e;for(const [f,g]of null!=(e=c)?e:[])b[f]=qb(a,g);a.F.push(b)}
276
- olympe.U.bw=class{constructor(){this.F=[];this.R=[];this.X=[];this.N=new Map;this.H=new Map;this.j=!1;this.D=null}start(){this.j||(this.D||(this.D=performance.now()),this.j=!0,this.R.forEach(a=>a()))}stop(){this.j&&(this.X.forEach(a=>a()),this.j=!1)}};function sb(a,b,c=5E3){return rxjs.operators.retry({resetOnSuccess:!0,delay:(d,e)=>{if(d instanceof a){const f=Math.round(Math.random()*(e+1)*c);return rxjs.timer(f).pipe(rxjs.operators.tap(()=>null==b?void 0:b(d,f)))}return rxjs.throwError(()=>d)}})}olympe.U.operators={zF(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.U.Promise={};olympe.U.Promise.uj=function(a,b){let c=null;return(...d)=>new Promise((e,f)=>{clearTimeout(c);c=setTimeout(()=>u(function*(){try{const g=yield a(...d);e(g)}catch(g){f(g)}}),b)})};olympe.U.Promise.Zf=function(a,b,c='Promise timeout'){return new Promise((d,e)=>{const f=setTimeout(()=>{e(Error(c))},b);a.then(g=>{clearTimeout(f);d(g)}).catch(g=>{clearTimeout(f);e(g)})})};
277
- olympe.U.Promise.rt=function(a,b,c=null){return u(function*(){for(let d=0;3>d;d++)try{return yield a(d)}catch(e){let f;if(2<=d||null!==c&&(null==(f=c)||!f.some(g=>e instanceof g)))throw e;yield new Promise(g=>setTimeout(g,b))}})};olympe.U.promise={};function tb(a){if(0===a.size())a.D.next(!1);else if(a.F()){a.j++;var b=ub(a);b&&b.D.call(a).then(c=>{b.resolve(c)}).catch(c=>{b.j(c)}).finally(()=>{a.j--;0===a.size()&&a.D.next(!1);tb(a)})}}function vb(a,b){return new Promise((c,d)=>{a.Ga.push(new olympe.U.promise.Dw(c,d,b));tb(a)})}function ub(a){a.D.next(!0);let b;return null!=(b=a.Ga.shift())?b:null}
278
- olympe.U.promise.Tk=class{constructor(){this.Ga=[];this.D=new rxjs.BehaviorSubject(!1);this.j=0}F(){return 0===this.j}clear(){for(;0<this.Ga.length;)this.Ga.shift().j(Error('Canceled by a clearStack'));tb(this)}size(){return this.Ga.length}};olympe.U.promise.Dw=class{constructor(a,b,c){this.resolve=a;this.j=b;this.D=c}};olympe.U.promise.Wr=class extends olympe.U.promise.Tk{constructor(a){super();if('number'!==typeof a||0>=a)throw Error('StackWindow with an invalid concurrentLimit. It must be a number > 0 for the stack to work properly');this.Hj=a}F(){return this.j<this.Hj}};olympe.U.promise.cE=class{constructor(a,...b){this.F=a;this.parameters=b;this.j=this.D=null;this.promise=new Promise((c,d)=>{this.D=c;this.j=d});this.start()}then(a){return this.promise.then(a)}catch(a){return this.promise.catch(a)}finally(a){return this.promise.finally(a)}start(){'undefined'!==typeof Worker?setTimeout(()=>{const a=URL.createObjectURL(new Blob([`
275
+ olympe.U.Fw=class{constructor(a){this.G=a;this.N=!1;this.F=new rxjs.BehaviorSubject(null);this.R=new Map;this.X=new Map;this.j=null;this.D=[];this.H=new Map}start(a,...b){if(this.N)throw Error('State machine already started');if(null===this.j)throw Error('Error state not defined: all state machines should have an error state');this.N=!0;F(this,a,...b)}getState(){if(!this.N)throw Error('State machine not started');return this.F.getValue()}};function ob(a,b){a.R.push(b)}function pb(a,b){a.X.push(b)}function qb(a,b){let c;'object'!==typeof b&&'function'!==typeof b?c=b:b instanceof olympe.dc.CloudObject?c=b.toJSON():Array.isArray(b)?c=b.map(d=>qb(a,d)):c='N/A';return c}function rb(a,b,c,d){b={cat:b,epoch:null!=d?d:performance.now()-a.D};let e;for(const [f,g]of null!=(e=c)?e:[])b[f]=qb(a,g);a.F.push(b)}
276
+ olympe.U.cw=class{constructor(){this.F=[];this.R=[];this.X=[];this.N=new Map;this.H=new Map;this.j=!1;this.D=null}start(){this.j||(this.D||(this.D=performance.now()),this.j=!0,this.R.forEach(a=>a()))}stop(){this.j&&(this.X.forEach(a=>a()),this.j=!1)}};function sb(a,b,c=5E3){return rxjs.operators.retry({resetOnSuccess:!0,delay:(d,e)=>{if(d instanceof a){const f=Math.round(Math.random()*(e+1)*c);return rxjs.timer(f).pipe(rxjs.operators.tap(()=>null==b?void 0:b(d,f)))}return rxjs.throwError(()=>d)}})}olympe.U.operators={AF(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.U.Promise={};olympe.U.Promise.uj=function(a,b){let c=null;return(...d)=>new Promise((e,f)=>{clearTimeout(c);c=setTimeout(()=>u(function*(){try{const g=yield a(...d);e(g)}catch(g){f(g)}}),b)})};olympe.U.Promise.$f=function(a,b,c='Promise timeout'){return new Promise((d,e)=>{const f=setTimeout(()=>{e(Error(c))},b);a.then(g=>{clearTimeout(f);d(g)}).catch(g=>{clearTimeout(f);e(g)})})};
277
+ olympe.U.Promise.rt=function(a,b,c=null){return u(function*(){for(let d=0;3>d;d++)try{return yield a(d)}catch(e){let f;if(2<=d||null!==c&&(null==(f=c)||!f.some(g=>e instanceof g)))throw e;yield new Promise(g=>setTimeout(g,b))}})};olympe.U.promise={};function tb(a){if(0===a.size())a.D.next(!1);else if(a.F()){a.j++;var b=ub(a);b&&b.j.call(a).then(c=>{b.resolve(c)}).catch(c=>{b.reject(c)}).finally(()=>{a.j--;0===a.size()&&a.D.next(!1);tb(a)})}}function vb(a,b){return new Promise((c,d)=>{a.Ga.push(new olympe.U.promise.Ew(c,d,b));tb(a)})}function ub(a){a.D.next(!0);let b;return null!=(b=a.Ga.shift())?b:null}
278
+ olympe.U.promise.Tk=class{constructor(){this.Ga=[];this.D=new rxjs.BehaviorSubject(!1);this.j=0}F(){return 0===this.j}clear(){for(;0<this.Ga.length;)this.Ga.shift().reject(Error('Canceled by a clearStack'));tb(this)}size(){return this.Ga.length}};olympe.U.promise.Ew=class{constructor(a,b,c){this.resolve=a;this.reject=b;this.j=c}};olympe.U.promise.Xr=class extends olympe.U.promise.Tk{constructor(a){super();if('number'!==typeof a||0>=a)throw Error('StackWindow with an invalid concurrentLimit. It must be a number > 0 for the stack to work properly');this.Hj=a}F(){return this.j<this.Hj}};olympe.U.promise.dE=class{constructor(a,...b){this.F=a;this.parameters=b;this.j=this.D=null;this.promise=new Promise((c,d)=>{this.D=c;this.j=d});this.start()}then(a){return this.promise.then(a)}catch(a){return this.promise.catch(a)}finally(a){return this.promise.finally(a)}start(){'undefined'!==typeof Worker?setTimeout(()=>{const a=URL.createObjectURL(new Blob([`
279
279
  function onFullfilledCallback(data) {
280
280
  self.postMessage({ type: "done", data, });
281
281
  self.close();
@@ -286,961 +286,963 @@ olympe.U.promise.Tk=class{constructor(){this.Ga=[];this.D=new rxjs.BehaviorSubje
286
286
  }
287
287
  self.onmessage = ({ data: { params } }) => {
288
288
  (${this.F.toString()})(onFullfilledCallback, onRejectedCallback, ...(params ?? []));
289
- };`])),b=new Worker(a);b.addEventListener('message',c=>{const {data:d,type:e}=c.data;URL.revokeObjectURL(a);b.terminate();if('done'===e){let f;null==(f=this.D)||f.call(this,d)}else{let f;null==(f=this.j)||f.call(this,d)}});b.postMessage({params:this.parameters})},0):this.F(this.D,this.j,...this.parameters)}};olympe.U.stream={};olympe.U.stream.lg=class{constructor(){this.buffer=[];this.F=this.j=!1;this.error=this.D=null}[Symbol.asyncIterator](){const a=this;return new oa(function*(){if(a.F)throw Error('This stream is already being read');for(a.F=!0;!a.error&&(!a.j||0<a.buffer.length);)0===a.buffer.length&&(yield new ja(2,new Promise(b=>{a.D=()=>b()}))),!a.error&&0<a.buffer.length&&(yield new ja(0,a.buffer.shift()));if(a.error)throw a.error;}())}write(a){const b=this;return u(function*(){if(null===a||void 0===a)throw Error('Try to stream null or undefined');
290
- if(b.j)throw Error('Cannot write to a completed stream');b.buffer.push(a);let c;null==(c=b.D)||c.call(b)})}pipeTo(a){return new Promise(b=>{const c=this;return u(function*(){try{for(const d=ha(c);;){const e=yield d.next();if(e.done)break;yield a.write(e.value)}a.complete()}catch(d){a.throw(d)}finally{b()}})})}map(a){const b=new olympe.U.stream.lg;this.pipeTo({write:c=>u(function*(){yield b.write(a(c))}),complete:()=>{b.complete()},throw:c=>{b.throw(c)}}).catch(()=>{});return b}concat(a){const b=new olympe.U.stream.lg;
291
- this.pipeTo({write:c=>u(function*(){yield b.write(c)}),complete:()=>{a.pipeTo(b).then(()=>{b.complete()})},throw:c=>{b.throw(c)}}).catch(()=>{});return b}throw(a){this.j||(this.error=a,this.complete())}complete(){if(!this.j){this.j=!0;let a;null==(a=this.D)||a.call(this)}}};olympe.U.stream.lg.ya=[olympe.U.stream.ReadableStream,olympe.U.stream.WritableStream];olympe.U.stream.ReadableStream=class{[Symbol.asyncIterator](){return new oa(function*(){}())}pipeTo(){}map(){}concat(){}};function wb(a,b){const c=new Worker(a.j),d=new TransformStream;c.addEventListener('message',({data:e})=>{e.pipeTo(d.writable).finally(()=>{c.terminate()})},{once:!0});c.postMessage(b,[b]);return d.readable}olympe.U.stream.$w=class{constructor(){this.j=URL.createObjectURL(new Blob([`self.onmessage = ({ data: stream }) => {
289
+ };`])),b=new Worker(a);b.addEventListener('message',c=>{const {data:d,type:e}=c.data;URL.revokeObjectURL(a);b.terminate();if('done'===e){let f;null==(f=this.D)||f.call(this,d)}else{let f;null==(f=this.j)||f.call(this,d)}});b.postMessage({params:this.parameters})},0):this.F(this.D,this.j,...this.parameters)}};olympe.U.stream={};olympe.U.stream.mg=class{constructor(){this.buffer=[];this.F=this.j=!1;this.error=this.D=null}[Symbol.asyncIterator](){const a=this;return new oa(function*(){if(a.F)throw Error('This stream is already being read');for(a.F=!0;!a.error&&(!a.j||0<a.buffer.length);)0===a.buffer.length&&(yield new ja(2,new Promise(b=>{a.D=()=>b()}))),!a.error&&0<a.buffer.length&&(yield new ja(0,a.buffer.shift()));if(a.error)throw a.error;}())}write(a){const b=this;return u(function*(){if(null===a||void 0===a)throw Error('Try to stream null or undefined');
290
+ if(b.j)throw Error('Cannot write to a completed stream');b.buffer.push(a);let c;null==(c=b.D)||c.call(b)})}pipeTo(a){return new Promise(b=>{const c=this;return u(function*(){try{for(const d=ha(c);;){const e=yield d.next();if(e.done)break;yield a.write(e.value)}a.complete()}catch(d){a.throw(d)}finally{b()}})})}map(a){const b=new olympe.U.stream.mg;this.pipeTo({write:c=>u(function*(){yield b.write(a(c))}),complete:()=>{b.complete()},throw:c=>{b.throw(c)}}).catch(()=>{});return b}concat(a){const b=new olympe.U.stream.mg;
291
+ this.pipeTo({write:c=>u(function*(){yield b.write(c)}),complete:()=>{a.pipeTo(b).then(()=>{b.complete()})},throw:c=>{b.throw(c)}}).catch(()=>{});return b}throw(a){this.j||(this.error=a,this.complete())}complete(){if(!this.j){this.j=!0;let a;null==(a=this.D)||a.call(this)}}};olympe.U.stream.mg.ya=[olympe.U.stream.ReadableStream,olympe.U.stream.WritableStream];olympe.U.stream.ReadableStream=class{[Symbol.asyncIterator](){return new oa(function*(){}())}pipeTo(){}map(){}concat(){}};function wb(a,b){const c=new Worker(a.j),d=new TransformStream;c.addEventListener('message',({data:e})=>{e.pipeTo(d.writable).finally(()=>{c.terminate()})},{once:!0});c.postMessage(b,[b]);return d.readable}olympe.U.stream.ax=class{constructor(){this.j=URL.createObjectURL(new Blob([`self.onmessage = ({ data: stream }) => {
292
292
  const transformedStream = (${olympe.U.stream.Ak.toString()}).transform(stream);
293
293
  self.postMessage(transformedStream, [transformedStream]);
294
- };`],{type:'application/javascript'}))}destroy(){URL.revokeObjectURL(this.j)}};olympe.U.stream.WritableStream=class{write(){return u(function*(){})}throw(){}complete(){}};olympe.U.stream.Ls=(...a)=>new ReadableStream({start(){this.cursor=0},pull(b){this.cursor<a.length?b.enqueue(a[this.cursor++]):b.close()}});olympe.U.stream.tap=a=>new TransformStream({transform(b,c){a(b);c.enqueue(b)}});
294
+ };`],{type:'application/javascript'}))}destroy(){URL.revokeObjectURL(this.j)}};olympe.U.stream.WritableStream=class{write(){return u(function*(){})}throw(){}complete(){}};olympe.U.stream.Ms=(...a)=>new ReadableStream({start(){this.cursor=0},pull(b){this.cursor<a.length?b.enqueue(a[this.cursor++]):b.close()}});olympe.U.stream.tap=a=>new TransformStream({transform(b,c){a(b);c.enqueue(b)}});
295
295
  olympe.U.stream.Ak=class a{static transform(b){return b.pipeThrough(new TextDecoderStream).pipeThrough(a.j()).pipeThrough(a.D())}static j(){return new TransformStream({start(){this.buffer=''},transform(b,c){this.buffer+=b;for(var d=0;-1!==(b=this.buffer.indexOf('\n',d));){if(d=this.buffer.slice(d,b).trim())try{c.enqueue(JSON.parse(d))}catch(e){c.error(e);return}d=b+1}this.buffer=this.buffer.slice(d)},flush(b){if(this.buffer.trim())try{b.enqueue(JSON.parse(this.buffer))}catch(c){b.error(c)}}})}static D(){return new TransformStream({start(){this.buffer=
296
- [];this.Cx=50},transform(b,c){this.buffer.push(b);this.buffer.length>=this.Cx&&(c.enqueue(this.buffer),this.buffer=[])},flush(b){0<this.buffer.length&&b.enqueue(this.buffer)}})}};olympe.U.stream.Ak.transform=olympe.U.stream.Ak.transform;function xb(a,b){return a+b&4294967295}
296
+ [];this.Dx=50},transform(b,c){this.buffer.push(b);this.buffer.length>=this.Dx&&(c.enqueue(this.buffer),this.buffer=[])},flush(b){0<this.buffer.length&&b.enqueue(this.buffer)}})}};olympe.U.stream.Ak.transform=olympe.U.stream.Ak.transform;function xb(a,b){return a+b&4294967295}
297
297
  function yb(a,b){let c=a[0],d=a[1],e=a[2],f=a[3];c=G(c,d,e,f,b[0],7,-680876936);f=G(f,c,d,e,b[1],12,-389564586);e=G(e,f,c,d,b[2],17,606105819);d=G(d,e,f,c,b[3],22,-1044525330);c=G(c,d,e,f,b[4],7,-176418897);f=G(f,c,d,e,b[5],12,1200080426);e=G(e,f,c,d,b[6],17,-1473231341);d=G(d,e,f,c,b[7],22,-45705983);c=G(c,d,e,f,b[8],7,1770035416);f=G(f,c,d,e,b[9],12,-1958414417);e=G(e,f,c,d,b[10],17,-42063);d=G(d,e,f,c,b[11],22,-1990404162);c=G(c,d,e,f,b[12],7,1804603682);f=G(f,c,d,e,b[13],12,-40341101);e=G(e,f,
298
298
  c,d,b[14],17,-1502002290);d=G(d,e,f,c,b[15],22,1236535329);c=H(c,d,e,f,b[1],5,-165796510);f=H(f,c,d,e,b[6],9,-1069501632);e=H(e,f,c,d,b[11],14,643717713);d=H(d,e,f,c,b[0],20,-373897302);c=H(c,d,e,f,b[5],5,-701558691);f=H(f,c,d,e,b[10],9,38016083);e=H(e,f,c,d,b[15],14,-660478335);d=H(d,e,f,c,b[4],20,-405537848);c=H(c,d,e,f,b[9],5,568446438);f=H(f,c,d,e,b[14],9,-1019803690);e=H(e,f,c,d,b[3],14,-187363961);d=H(d,e,f,c,b[8],20,1163531501);c=H(c,d,e,f,b[13],5,-1444681467);f=H(f,c,d,e,b[2],9,-51403784);
299
299
  e=H(e,f,c,d,b[7],14,1735328473);d=H(d,e,f,c,b[12],20,-1926607734);c=I(d^e^f,c,d,b[5],4,-378558);f=I(c^d^e,f,c,b[8],11,-2022574463);e=I(f^c^d,e,f,b[11],16,1839030562);d=I(e^f^c,d,e,b[14],23,-35309556);c=I(d^e^f,c,d,b[1],4,-1530992060);f=I(c^d^e,f,c,b[4],11,1272893353);e=I(f^c^d,e,f,b[7],16,-155497632);d=I(e^f^c,d,e,b[10],23,-1094730640);c=I(d^e^f,c,d,b[13],4,681279174);f=I(c^d^e,f,c,b[0],11,-358537222);e=I(f^c^d,e,f,b[3],16,-722521979);d=I(e^f^c,d,e,b[6],23,76029189);c=I(d^e^f,c,d,b[9],4,-640364487);
300
300
  f=I(c^d^e,f,c,b[12],11,-421815835);e=I(f^c^d,e,f,b[15],16,530742520);d=I(e^f^c,d,e,b[2],23,-995338651);c=J(c,d,e,f,b[0],6,-198630844);f=J(f,c,d,e,b[7],10,1126891415);e=J(e,f,c,d,b[14],15,-1416354905);d=J(d,e,f,c,b[5],21,-57434055);c=J(c,d,e,f,b[12],6,1700485571);f=J(f,c,d,e,b[3],10,-1894986606);e=J(e,f,c,d,b[10],15,-1051523);d=J(d,e,f,c,b[1],21,-2054922799);c=J(c,d,e,f,b[8],6,1873313359);f=J(f,c,d,e,b[15],10,-30611744);e=J(e,f,c,d,b[6],15,-1560198380);d=J(d,e,f,c,b[13],21,1309151649);c=J(c,d,e,f,
301
301
  b[4],6,-145523070);f=J(f,c,d,e,b[11],10,-1120210379);e=J(e,f,c,d,b[2],15,718787259);d=J(d,e,f,c,b[9],21,-343485551);a[0]=xb(c,a[0]);a[1]=xb(d,a[1]);a[2]=xb(e,a[2]);a[3]=xb(f,a[3])}function I(a,b,c,d,e,f){b=xb(xb(b,a),xb(d,f));return xb(b<<e|b>>>32-e,c)}function G(a,b,c,d,e,f,g){return I(b&c|~b&d,a,b,e,f,g)}function H(a,b,c,d,e,f,g){return I(b&d|c&~d,a,b,e,f,g)}function J(a,b,c,d,e,f,g){return I(c^(b|~d),a,b,e,f,g)}
302
302
  function zb(a,b=32){const c='0123456789abcdef'.split('');var d=a,e=d.length;a=[1732584193,-271733879,-1732584194,271733878];var f;for(f=64;f<=d.length;f+=64){var g=d.substring(f-64,f),h=[];for(let k=0;64>k;k+=4)h[k>>2]=g.charCodeAt(k)+(g.charCodeAt(k+1)<<8)+(g.charCodeAt(k+2)<<16)+(g.charCodeAt(k+3)<<24);yb(a,h)}d=d.substring(f-64);g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(f=0;f<d.length;f++)g[f>>2]|=d.charCodeAt(f)<<(f%4<<3);g[f>>2]|=128<<(f%4<<3);if(55<f)for(yb(a,g),f=0;16>f;f++)g[f]=0;g[14]=8*e;
303
- yb(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==zb('hello')&&(xb=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.U.rb=zb;function Ab(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function Bb(){var a=Math.random();return Ab((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}const Cb=Math.pow(2,32)-1;olympe.U.Kc=function(){return Bb()};olympe.U.hf=function(){return Bb()};olympe.U.lF=function(a,b=1){const c=a.substr(12,a.length-12);return Ab(parseInt(a.substr(0,12),16)+b)+c};
304
- olympe.U.kF=function(a){return Ab(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Db=0,Eb=0;olympe.U.Yx=function(){var a=(new Date).getTime();a<=Db?4294967295===Eb?(Eb=Math.floor(Math.random()/4*Cb),Db+=1):Eb=Math.floor(Eb+(4294967295-Eb)/2):(Eb=Math.floor(Math.random()/4*Cb),Db=a);a='00000000'+Eb.toString(16);return Ab(Db)+a.substr(a.length-8,8)};olympe.U.AF=function(){for(let a=0;1E4>a;a++)console.log(olympe.U.Yx())};
305
- olympe.U.ni=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.U.fF=function(a){let b='';for(let c=0;5>c;c++)b+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return(a?a:'UI')+'-'+b};olympe.U.bF=function(a,b){return(b?b:'UI')+'-'+a};
306
- olympe.U.Qz=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let l=null,n=null;var p=null;g&&(p=g.match(b),l=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:r.startsWith('"')&&r.endsWith('"')?r=r.substring(1,r.length-1):d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):
307
- r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,JE:g||null,Ct:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,cF:f||null,parameters:b}};olympe.U.uF=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=').map(decodeURIComponent)))};
308
- olympe.U.xF=function(a){a=Array.from(a.entries()).filter(([,b])=>null!==b&&void 0!==b).map(([b,c])=>`${encodeURIComponent(b)}=${encodeURIComponent(c)}`).join('&');return 0<a.length?`#${a}`:''};olympe.U.jF=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};
309
- olympe.U.it=a=>{var b=Fb,c=Gb;return u(function*(){return(yield Promise.all(a.map(b))).map((d,e)=>{if('string'!==typeof d)return Object.create(null);try{return JSON.parse(d)}catch(f){if(a[e].endsWith('.json'))throw Error(`Failed to parse JSON Config file: ${a[e]}: ${f}`);const g=null!=c?c:'';return d.split('\n').filter(h=>h.startsWith(g)).reduce((h,k)=>{const [l,n]=k.split('=');h['host.'+l.slice(g.length)]=olympe.U.zs(n);return h},{})}}).reduce((d,e,f)=>{olympe.U.kt(d,e,'version.json'===a[f]?'version.':
310
- '');return d},Object.create(null))})};olympe.U.zs=a=>{const b=/^true|false$/i,c=/^\d+(\.\d+)?$/;void 0===a?a=!0:a.startsWith('"')&&a.endsWith('"')?a=a.substring(1,a.length-1):b.test(a)?a='true'===a.toLowerCase():c.test(a)&&(a=parseFloat(a));return a};olympe.U.kt=(a,b,c)=>{if(b instanceof Object)for(const d of Object.keys(b)){const e=c+d,f=b[d];f instanceof Object&&void 0!==a[e]?olympe.U.kt(a[e],f,''):a[e]=f}};olympe.U.IE=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Gn(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.U.xv=class{constructor(a,b){this.start=a;this.end=b}};olympe.U.xv.j={$B:'left',SC:'right',EA:'bottom',aE:'top'};function Hb(a){return`${a.j}.${a.D}.${a.F}`}
311
- olympe.U.Lf=class{constructor(a,b,c,d){this.j=a;this.D=b;this.F=c;this.H=d||null}static parse(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.U.Lf.j;const b=Number.parseInt(a[1],10),c=Number.parseInt(a[2],10),d=Number.parseInt(a[3],10);return isNaN(b)||isNaN(c)||isNaN(d)?olympe.U.Lf.j:new olympe.U.Lf(b,c,d,a[4])}nl(a){return this.j!==a.j?this.j>a.j:this.D!==a.D?this.D>a.D:this.F>a.F}Pj(a){return this.j!==a.j?this.j<a.j:this.D!==a.D?this.D<a.D:this.F<
312
- a.F}Ea(a){return this.j===a.j&&this.D===a.D&&this.F===a.F}toString(){return`${this.j}.${this.D}.${this.F}`+(null!==this.H?`-${this.H}`:'')}};olympe.U.Lf.j=new olympe.U.Lf(Number.NaN,Number.NaN,Number.NaN);olympe.U.P={Dg:'utils.binaryConverter',Nt:'utils.base64Converter',ig:'utils.Profiler'};olympe.V.config(a=>{Xa(a,olympe.U.P.Dg);Wa(a,olympe.U.P.Nt,olympe.U.P.Dg,!0);C(a,olympe.U.P.ig,olympe.U.bw)},'Utils services');olympe.V.run([olympe.U.P.Dg,olympe.U.P.ig],(a,b)=>{olympe.U.jf=()=>a;olympe.de().isProfilerEnabled=()=>b.j;olympe.de().startProfiler=()=>b.start();olympe.de().stopProfiler=()=>b.stop();olympe.de().getProfilerEvents=()=>({events:b.F,names:Object.fromEntries(b.N.entries()),models:Object.fromEntries(b.H.entries())})});olympe.ha={};olympe.ha.xb=class{ka(){}H(){}F(){}j(){}ia(){}N(){}sa(){}Z(){}da(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ha.xb.prototype.fatal=olympe.ha.xb.prototype.fatal;olympe.ha.xb.prototype.error=olympe.ha.xb.prototype.error;olympe.ha.xb.prototype.warn=olympe.ha.xb.prototype.warn;olympe.ha.xb.prototype.info=olympe.ha.xb.prototype.info;olympe.ha.xb.prototype.log=olympe.ha.xb.prototype.log;olympe.ha.xb.prototype.debug=olympe.ha.xb.prototype.debug;olympe.ha.xb.prototype.trace=olympe.ha.xb.prototype.trace;
313
- olympe.ha.xb.j={Kw:0,ag:1,tv:2,pk:3,ps:4,Ab:5,pu:6,oC:7};olympe.ha.xb.D={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ha.Ta=class{ad(){}};olympe.ha.ve={};function Ib(a,b,c){a.Ha[b](`[OLYMPE.${a.X}]:`,...c);if(0<a.R.size){var d=new Date;d=('00'+d.getHours()).substring(-2)+':'+('00'+d.getMinutes()).substring(-2)+':'+('00'+d.getSeconds()).substring(-2)+'.'+('00'+d.getMilliseconds()).substring(-3);for(const e of a.R.values())e(d,a.X,b,...c)}}
314
- olympe.ha.ve.xb=class{constructor(a,b){this.name=a;const c=b instanceof rxjs.Observable;this.D=c?olympe.ha.xb.j.pk:b;c&&b.subscribe(d=>{this.D=d});this.X=a.toUpperCase();this.R=new Map;this.Ha=console}ka(){return this.name}H(){return this.D}F(){return this.D<=olympe.ha.xb.j.Kw}j(){return this.D<=olympe.ha.xb.j.ag}N(){return this.D<=olympe.ha.xb.j.tv}ia(){return this.D<=olympe.ha.xb.j.pk}sa(){return this.D<=olympe.ha.xb.j.ps}Z(){return this.D<=olympe.ha.xb.j.Ab}da(){return this.D<=olympe.ha.xb.j.pu}trace(...a){this.F()&&
315
- Ib(this,'trace',a)}debug(...a){this.j()&&Ib(this,'debug',a)}log(...a){this.N()&&Ib(this,'log',a)}info(...a){this.ia()&&Ib(this,'info',a)}warn(...a){this.sa()&&Ib(this,'warn',a)}error(...a){this.Z()&&Ib(this,'error',a)}fatal(...a){this.da()&&Ib(this,'error',a)}};olympe.ha.ve.xb.ya=[olympe.ha.xb];olympe.ha.ve.Ta=class{constructor(a,b,c){this.j=a;this.D=parseInt(b,10);this.F=c;this.channels=new Map;this.G=this.ad('logging');this.G.log('Logging initialized, global log level is '+olympe.ha.xb.D[b])}ad(a){var b=this.channels.get(a);if(!b){b=`${olympe.ha.Config.Wt}.${a}`;var c;const d=new rxjs.BehaviorSubject(null!=(c=this.j.getParameter(b))?c:this.D);Ta(this.j,b,e=>{d.next(e)});c=this.F;b=`${b}.${olympe.ha.Config.vw}`;Object.prototype.hasOwnProperty.call(this.j.parameters,b.toLowerCase())&&(c=
316
- !0===this.j.getParameter(b));b=new olympe.ha.ve.xb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ha.ve.Ta.ya=[olympe.ha.Ta];olympe.ha.P={Fa:'logging.Manager'};olympe.ha.Config={Gp:'logging',Hp:'logging.showLogLevel',Wt:'logging',vw:'showLogLevel'};olympe.V.config(function(a){E(a,olympe.ha.Config.Gp,olympe.ha.xb.j.pk);E(a,olympe.ha.Config.Hp,!0);Va(a,olympe.ha.P.Fa,olympe.ha.ve.Ta,olympe.V.P.Eg,new olympe.V.oa(olympe.ha.Config.Gp),new olympe.V.oa(olympe.ha.Config.Hp))},'olympe.logging');olympe.V.run([olympe.ha.P.Fa],a=>{olympe.ha.Xa=b=>a.ad(b)},'Logging singleton getter initialization');olympe.C={};olympe.C.Config={Bq:'df.nodeCreationThreshold'};const Jb=[];function Kb(){}function Lb(){}olympe.C.J=class a{constructor(b,c,d){this.j=void 0===b?Kb:b;this.D=void 0===c?Jb:c;this.X=d}static H(){var b=[];return void 0===b||0===b.length?olympe.C.J.Z:new a(Lb,b)}H(){return this.j?this.j():void 0}F(){return this.D?this.D:Jb}N(){return null===this.j&&null===this.D}R(){return this.j===Lb}};olympe.C.J.X=new olympe.C.J;olympe.C.J.j=new olympe.C.J(null,null);olympe.C.J.Z=new olympe.C.J(Lb);olympe.C.J.F=new olympe.C.J(()=>olympe.C.$);
317
- olympe.C.J.D=new olympe.C.J(()=>olympe.C.Sa);olympe.C.J.N=new olympe.C.J(()=>olympe.C.ba);olympe.C.J.R=new olympe.C.J(()=>olympe.C.Zb);olympe.C.Fh=class{T(){return''}En(){return''}destroy(){}fb(){return!1}hd(){return!1}run(a,...b){return a(...b)}rc(a){return a}getParent(){return null}xt(){}ne(){}detach(){}el(){}rg(){}onDestroy(){return''}Wf(){}Xd(){return''}mt(){}};olympe.C.Fh.prototype.offDestroy=olympe.C.Fh.prototype.Wf;olympe.C.Fh.prototype.onDestroy=olympe.C.Fh.prototype.onDestroy;let Mb=0;olympe.V.run([new olympe.V.oa(olympe.C.Config.Bq)],()=>{});
318
- olympe.C.Wb=class{constructor(a='SimpleContext',b){++Mb;this.da=new Map;this.Z=new Map;this.X=new Map;this.Ha=0;this.name=a;this.id=String(Mb);this.F=this.ia=!1;(this.N=void 0===b?olympe.C.Za():b)&&this.N.ne(this);this.debug=!1}T(){return this.id}En(){return this.name}run(a,...b){if(!this.ia){var c=olympe.C.wt(this);a=a(...b);c&&olympe.C.wt(c);return a}}rc(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.ia&&!this.F){this.F=!0;this.rg();for(const a of this.Z.keys())this.Z.has(a)&&this.Z.get(a)();
319
- this.Z.clear();this.X.clear();this.N&&(this.N.detach(this,!1),this.N=null);this.ia=!0;this.F=!1;this.rg()}}fb(){return this.ia}hd(){return this.F}ne(a){if(!this.ia){var b;olympe.C.gb(a)?b=a.Ba:olympe.C.Qn(a)&&(b=a);b&&this.da.set(b.T(),b)}}detach(a,b=!0){let c;olympe.C.gb(a)?c=a.Ba:olympe.C.Qn(a)&&(c=a);c&&this.da.has(c.T())&&(b&&c.el(this),this.da.delete(c.T()))}el(){this.N=null;this.destroy()}rg(){const a=this.da;for(const b of a.keys())a.has(b)&&a.get(b).el(this);this.da.clear();for(const b of this.X.keys())this.X.has(b)&&
320
- this.X.get(b)();this.X.clear()}onDestroy(a,b){void 0===b&&(++this.Ha,b=String(this.Ha));this.Z.set(b,a);return b}Wf(a){this.Z.delete(a)}Xd(a){if(void 0===b){++this.Ha;var b=String(this.Ha)}this.X.set(b,a);return b}mt(a){this.X.delete(a)}xt(a){this.N&&this.N.detach(this,!1);(this.N=a||null)&&this.N.ne(this)}getParent(){return this.N}};olympe.C.Fr=class extends olympe.C.Wb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Wf(){}};olympe.C.Fh.ya=[olympe.C.Fh];let Nb=0;
321
- function Ob(a,b){a.R||(a.R=new Map);a.R.set(b.T(),b);switch(b.Jc()){case olympe.C.Node.j.Oh:break;case olympe.C.Node.j.ai:break;case olympe.C.Node.j.vk:case olympe.C.Node.j.cg:olympe.C.G.warn('Not bad as such but should not happen!');break;case olympe.C.Node.j.Gh:Pb(a,olympe.C.Node.j.Gh);break;case olympe.C.Node.j.OBSOLETE:a.nb=!0;a.j!==olympe.C.Node.j.Gh&&Pb(a,olympe.C.Node.j.OBSOLETE);break;case olympe.C.Node.j.Zd:olympe.C.G.warn('Adding a destroyed node as upstream => should never happen!');break;
322
- default:olympe.C.G.warn('Unknown state, investigate: ',b.Jc())}Qb(b,a)}
323
- function Rb(a){if(a.Lc){var b=[],c=[];if(a.Xf)if(a.Xf instanceof olympe.C.Node)if(Sb(a.Xf))b=a.Xf.Eb;else return;else b=a.Xf;else b=null;if(null!==a.Vd){const e=a.qg;for(let f=0,g=a.Vd.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.Vd[f];if(Sb(h))c.push(h.Eb);else return}else c.push(a.Vd[f])}if(a.Lc instanceof Function)var d=a.Lc;else b&&(b[a.Lc]||olympe.C.G.warn('looks like you forget a cast somewhere around '+a.Lc),d=b[a.Lc]);a.run(()=>{a.rg();if(void 0!==d){const e=d.apply(b,c);e&&e.us?
324
- Tb(a,e.Ba):e instanceof olympe.C.Node?Tb(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&Pb(a,olympe.C.Node.j.ai))}else Ub(a)})}}function M(a){void 0===a.Wa&&(a.Wa=a.valueType===olympe.C.Proxy?Vb(void 0,a.yb):Vb(a.valueType,a.yb),a.Wa.Ba=a);return a.Wa}function Wb(a){void 0!==a.D&&(Xb(a.D,a),a.D=void 0)}function Yb(a){if(a.j===olympe.C.Node.j.OBSOLETE&&(a.j=olympe.C.Node.j.ai,null!==a.H))for(const b of a.H.values())Zb(b)}function Pb(a,b){b!==a.j&&(a.j=b)}
325
- function $b(a){if(a.j!==olympe.C.Node.j.OBSOLETE&&a.j!==olympe.C.Node.j.vk&&a.j!==olympe.C.Node.j.Oh&&a.j!==olympe.C.Node.j.Gh){Pb(a,olympe.C.Node.j.vk);var b=a.H;if(b)for(const c of b.values())b.has(c.T())&&$b(c);Pb(a,olympe.C.Node.j.OBSOLETE)}}function ac(a,b,c){if(a.j!==olympe.C.Node.j.cg)if(b===a.D)L(a,c,!0);else{if(a.j===olympe.C.Node.j.OBSOLETE||a.j===olympe.C.Node.j.vk)a.nb=!0;Rb(a)}}
326
- function L(a,b,c){b instanceof olympe.C.Node&&(olympe.C.G.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Eb);a.sa||c||void 0===a.D||Wb(a);if(void 0!==b){if((a.sa||a.j===olympe.C.Node.j.ai||a.j===olympe.C.Node.j.OBSOLETE)&&!olympe.C.gb(b)&&void 0!==a.Eb){if(null===b&&null===a.Eb){Yb(a);return}if(null!==b&&null!==a.Eb&&(b.valueOf()===a.Eb.valueOf()||a.Eb.Ea&&a.Eb.Ea(b))){Yb(a);return}}if(!0===a.sa)olympe.C.G.error("Circular dependency detected: updating a downstream node caused this node's (#"+
327
- a.T()+') value to get updated !');else{a.j===olympe.C.Node.j.Zd&&olympe.C.G.warn(`trying to set a value on a destroyed node (#${a.T()} ${a.$c?', '+a.$c:''})`);a.j===olympe.C.Node.j.cg&&olympe.C.G.warn(`trying to set a value on a node being destroyed (#${a.T()} ${a.$c?', '+a.$c:''})`);a.sa=!0;c=b;var d=!1,e=(f,g)=>f instanceof g?!0:!1;void 0===a.valueType||null===c||e(c,a.valueType)||(e=a.valueType&&a.valueType.name?a.valueType.name:'undefined',b='object'===typeof c?b.constructor.name:typeof c,c instanceof
328
- Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.C.Sa?(c=olympe.C.wb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.C.$?(c=olympe.C.qa(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.C.ba&&(c=olympe.C.Rb(c),d=!1)));a.Eb=c;Pb(a,olympe.C.Node.j.ai);if(b=a.H){d=0;for(const f of b.values())0<d&&$b(f),d++;for(const f of b.values())ac(f,a,c)}a.sa=!1}}}
329
- function bc(a,b){if(a.j!==olympe.C.Node.j.cg&&a.j!==olympe.C.Node.j.Zd&&(a.j!==olympe.C.Node.j.Oh||a.Lc)){var c=void 0!==a.defaultValue;a.Lc&&b!==a.D&&a.rg();if(c)L(a,a.defaultValue,!0);else if(a.Eb=void 0,Pb(a,olympe.C.Node.j.Oh),b=a.H)for(const d of b.values())bc(d,a)}}function Ub(a){if(a.j!==olympe.C.Node.j.Gh){Pb(a,olympe.C.Node.j.Gh);var b=a.H;if(b)for(const c of b.values())Ub(c);a.rg();void 0!==a.D&&Wb(a);a.Eb=a.defaultValue}}function Sb(a){return a.j===olympe.C.Node.j.ai}
330
- function Tb(a,b){b===a?olympe.C.G.error('Setting a node as provider of itself. Ignoring'):(a.D&&a.D!==b&&Wb(a),Qb(b,a),Sb(b)?L(a,b.Eb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):bc(a),a.D=b)}function cc(a,b){a.Lc&&(a.Lc=void 0);a.$c='Repeater';Tb(a,b)}function Zb(a){a.D?Yb(a):null!==a.R&&0===Array.from(a.R.values()).filter(b=>!Sb(b)).length&&(a.nb&&(a.nb=!1,Rb(a)),Yb(a))}
303
+ yb(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==zb('hello')&&(xb=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.U.rb=zb;function Ab(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function Bb(){var a=Math.random();return Ab((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}const Cb=Math.pow(2,32)-1;olympe.U.Lc=function(){return Bb()};olympe.U.hf=function(){return Bb()};olympe.U.mF=function(a,b=1){const c=a.substr(12,a.length-12);return Ab(parseInt(a.substr(0,12),16)+b)+c};
304
+ olympe.U.lF=function(a){return Ab(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Db=0,Eb=0;olympe.U.Zx=function(){var a=(new Date).getTime();a<=Db?4294967295===Eb?(Eb=Math.floor(Math.random()/4*Cb),Db+=1):Eb=Math.floor(Eb+(4294967295-Eb)/2):(Eb=Math.floor(Math.random()/4*Cb),Db=a);a='00000000'+Eb.toString(16);return Ab(Db)+a.substr(a.length-8,8)};olympe.U.BF=function(){for(let a=0;1E4>a;a++)console.log(olympe.U.Zx())};
305
+ olympe.U.ni=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.U.gF=function(a){let b='';for(let c=0;5>c;c++)b+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return(a?a:'UI')+'-'+b};olympe.U.cF=function(a,b){return(b?b:'UI')+'-'+a};
306
+ olympe.U.Rz=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let l=null,n=null;var p=null;g&&(p=g.match(b),l=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:r.startsWith('"')&&r.endsWith('"')?r=r.substring(1,r.length-1):d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):
307
+ r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,KE:g||null,Ct:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,dF:f||null,parameters:b}};olympe.U.vF=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=').map(decodeURIComponent)))};
308
+ olympe.U.yF=function(a){a=Array.from(a.entries()).filter(([,b])=>null!==b&&void 0!==b).map(([b,c])=>`${encodeURIComponent(b)}=${encodeURIComponent(c)}`).join('&');return 0<a.length?`#${a}`:''};olympe.U.kF=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};
309
+ olympe.U.it=a=>{var b=Fb,c=Gb;return u(function*(){return(yield Promise.all(a.map(b))).map((d,e)=>{if('string'!==typeof d)return Object.create(null);try{return JSON.parse(d)}catch(f){if(a[e].endsWith('.json'))throw Error(`Failed to parse JSON Config file: ${a[e]}: ${f}`);const g=null!=c?c:'';return d.split('\n').filter(h=>h.startsWith(g)).reduce((h,k)=>{const [l,n]=k.split('=');h['host.'+l.slice(g.length)]=olympe.U.As(n);return h},{})}}).reduce((d,e,f)=>{olympe.U.kt(d,e,'version.json'===a[f]?'version.':
310
+ '');return d},Object.create(null))})};olympe.U.As=a=>{const b=/^true|false$/i,c=/^\d+(\.\d+)?$/;void 0===a?a=!0:a.startsWith('"')&&a.endsWith('"')?a=a.substring(1,a.length-1):b.test(a)?a='true'===a.toLowerCase():c.test(a)&&(a=parseFloat(a));return a};olympe.U.kt=(a,b,c)=>{if(b instanceof Object)for(const d of Object.keys(b)){const e=c+d,f=b[d];f instanceof Object&&void 0!==a[e]?olympe.U.kt(a[e],f,''):a[e]=f}};olympe.U.JE=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Jn(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.U.yv=class{constructor(a,b){this.start=a;this.end=b}};olympe.U.yv.j={aC:'left',TC:'right',FA:'bottom',bE:'top'};function Hb(a){return`${a.j}.${a.D}.${a.F}`}
311
+ olympe.U.Mf=class{constructor(a,b,c,d){this.j=a;this.D=b;this.F=c;this.H=d||null}static parse(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.U.Mf.j;const b=Number.parseInt(a[1],10),c=Number.parseInt(a[2],10),d=Number.parseInt(a[3],10);return isNaN(b)||isNaN(c)||isNaN(d)?olympe.U.Mf.j:new olympe.U.Mf(b,c,d,a[4])}nl(a){return this.j!==a.j?this.j>a.j:this.D!==a.D?this.D>a.D:this.F>a.F}Pj(a){return this.j!==a.j?this.j<a.j:this.D!==a.D?this.D<a.D:this.F<
312
+ a.F}Ea(a){return this.j===a.j&&this.D===a.D&&this.F===a.F}toString(){return`${this.j}.${this.D}.${this.F}`+(null!==this.H?`-${this.H}`:'')}};olympe.U.Mf.j=new olympe.U.Mf(Number.NaN,Number.NaN,Number.NaN);olympe.U.P={Dg:'utils.binaryConverter',Nt:'utils.base64Converter',jg:'utils.Profiler'};olympe.V.config(a=>{Xa(a,olympe.U.P.Dg);Wa(a,olympe.U.P.Nt,olympe.U.P.Dg,!0);C(a,olympe.U.P.jg,olympe.U.cw)},'Utils services');olympe.V.run([olympe.U.P.Dg,olympe.U.P.jg],(a,b)=>{olympe.U.jf=()=>a;olympe.de().isProfilerEnabled=()=>b.j;olympe.de().startProfiler=()=>b.start();olympe.de().stopProfiler=()=>b.stop();olympe.de().getProfilerEvents=()=>({events:b.F,names:Object.fromEntries(b.N.entries()),models:Object.fromEntries(b.H.entries())})});olympe.ga={};olympe.ga.yb=class{ka(){}H(){}F(){}j(){}ia(){}N(){}wa(){}Z(){}ba(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ga.yb.prototype.fatal=olympe.ga.yb.prototype.fatal;olympe.ga.yb.prototype.error=olympe.ga.yb.prototype.error;olympe.ga.yb.prototype.warn=olympe.ga.yb.prototype.warn;olympe.ga.yb.prototype.info=olympe.ga.yb.prototype.info;olympe.ga.yb.prototype.log=olympe.ga.yb.prototype.log;olympe.ga.yb.prototype.debug=olympe.ga.yb.prototype.debug;olympe.ga.yb.prototype.trace=olympe.ga.yb.prototype.trace;
313
+ olympe.ga.yb.j={Lw:0,bg:1,uv:2,pk:3,qs:4,Ab:5,qu:6,pC:7};olympe.ga.yb.D={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ga.Ta=class{ad(){}};olympe.ga.we={};function Ib(a,b,c){a.Ha[b](`[OLYMPE.${a.X}]:`,...c);if(0<a.R.size){var d=new Date;d=('00'+d.getHours()).substring(-2)+':'+('00'+d.getMinutes()).substring(-2)+':'+('00'+d.getSeconds()).substring(-2)+'.'+('00'+d.getMilliseconds()).substring(-3);for(const e of a.R.values())e(d,a.X,b,...c)}}
314
+ olympe.ga.we.yb=class{constructor(a,b){this.name=a;const c=b instanceof rxjs.Observable;this.D=c?olympe.ga.yb.j.pk:b;c&&b.subscribe(d=>{this.D=d});this.X=a.toUpperCase();this.R=new Map;this.Ha=console}ka(){return this.name}H(){return this.D}F(){return this.D<=olympe.ga.yb.j.Lw}j(){return this.D<=olympe.ga.yb.j.bg}N(){return this.D<=olympe.ga.yb.j.uv}ia(){return this.D<=olympe.ga.yb.j.pk}wa(){return this.D<=olympe.ga.yb.j.qs}Z(){return this.D<=olympe.ga.yb.j.Ab}ba(){return this.D<=olympe.ga.yb.j.qu}trace(...a){this.F()&&
315
+ Ib(this,'trace',a)}debug(...a){this.j()&&Ib(this,'debug',a)}log(...a){this.N()&&Ib(this,'log',a)}info(...a){this.ia()&&Ib(this,'info',a)}warn(...a){this.wa()&&Ib(this,'warn',a)}error(...a){this.Z()&&Ib(this,'error',a)}fatal(...a){this.ba()&&Ib(this,'error',a)}};olympe.ga.we.yb.ya=[olympe.ga.yb];olympe.ga.we.Ta=class{constructor(a,b,c){this.j=a;this.D=parseInt(b,10);this.F=c;this.channels=new Map;this.G=this.ad('logging');this.G.log('Logging initialized, global log level is '+olympe.ga.yb.D[b])}ad(a){var b=this.channels.get(a);if(!b){b=`${olympe.ga.Config.Wt}.${a}`;var c;const d=new rxjs.BehaviorSubject(null!=(c=this.j.getParameter(b))?c:this.D);Ta(this.j,b,e=>{d.next(e)});c=this.F;b=`${b}.${olympe.ga.Config.ww}`;Object.prototype.hasOwnProperty.call(this.j.parameters,b.toLowerCase())&&(c=
316
+ !0===this.j.getParameter(b));b=new olympe.ga.we.yb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ga.we.Ta.ya=[olympe.ga.Ta];olympe.ga.P={Fa:'logging.Manager'};olympe.ga.Config={Hp:'logging',Ip:'logging.showLogLevel',Wt:'logging',ww:'showLogLevel'};olympe.V.config(function(a){E(a,olympe.ga.Config.Hp,olympe.ga.yb.j.pk);E(a,olympe.ga.Config.Ip,!0);Va(a,olympe.ga.P.Fa,olympe.ga.we.Ta,olympe.V.P.Eg,new olympe.V.oa(olympe.ga.Config.Hp),new olympe.V.oa(olympe.ga.Config.Ip))},'olympe.logging');olympe.V.run([olympe.ga.P.Fa],a=>{olympe.ga.Wa=b=>a.ad(b)},'Logging singleton getter initialization');olympe.C={};olympe.C.Config={Cq:'df.nodeCreationThreshold'};const Jb=[];function Kb(){}function Lb(){}olympe.C.J=class a{constructor(b,c,d){this.j=void 0===b?Kb:b;this.D=void 0===c?Jb:c;this.X=d}static H(){var b=[];return void 0===b||0===b.length?olympe.C.J.Z:new a(Lb,b)}H(){return this.j?this.j():void 0}F(){return this.D?this.D:Jb}N(){return null===this.j&&null===this.D}R(){return this.j===Lb}};olympe.C.J.X=new olympe.C.J;olympe.C.J.j=new olympe.C.J(null,null);olympe.C.J.Z=new olympe.C.J(Lb);olympe.C.J.F=new olympe.C.J(()=>olympe.C.$);
317
+ olympe.C.J.D=new olympe.C.J(()=>olympe.C.Sa);olympe.C.J.N=new olympe.C.J(()=>olympe.C.da);olympe.C.J.R=new olympe.C.J(()=>olympe.C.Zb);olympe.C.Fh=class{T(){return''}Hn(){return''}destroy(){}fb(){return!1}jd(){return!1}run(a,...b){return a(...b)}rc(a){return a}getParent(){return null}xt(){}ne(){}detach(){}el(){}sg(){}onDestroy(){return''}Xf(){}Xd(){return''}mt(){}};olympe.C.Fh.prototype.offDestroy=olympe.C.Fh.prototype.Xf;olympe.C.Fh.prototype.onDestroy=olympe.C.Fh.prototype.onDestroy;let Mb=0;olympe.V.run([new olympe.V.oa(olympe.C.Config.Cq)],()=>{});
318
+ olympe.C.Xb=class{constructor(a='SimpleContext',b){++Mb;this.ba=new Map;this.Z=new Map;this.X=new Map;this.Ha=0;this.name=a;this.id=String(Mb);this.F=this.ia=!1;(this.N=void 0===b?olympe.C.Za():b)&&this.N.ne(this);this.debug=!1}T(){return this.id}Hn(){return this.name}run(a,...b){if(!this.ia){var c=olympe.C.wt(this);a=a(...b);c&&olympe.C.wt(c);return a}}rc(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.ia&&!this.F){this.F=!0;this.sg();for(const a of this.Z.keys())this.Z.has(a)&&this.Z.get(a)();
319
+ this.Z.clear();this.X.clear();this.N&&(this.N.detach(this,!1),this.N=null);this.ia=!0;this.F=!1;this.sg()}}fb(){return this.ia}jd(){return this.F}ne(a){if(!this.ia){var b;olympe.C.gb(a)?b=a.Ba:olympe.C.Tn(a)&&(b=a);b&&this.ba.set(b.T(),b)}}detach(a,b=!0){let c;olympe.C.gb(a)?c=a.Ba:olympe.C.Tn(a)&&(c=a);c&&this.ba.has(c.T())&&(b&&c.el(this),this.ba.delete(c.T()))}el(){this.N=null;this.destroy()}sg(){const a=this.ba;for(const b of a.keys())a.has(b)&&a.get(b).el(this);this.ba.clear();for(const b of this.X.keys())this.X.has(b)&&
320
+ this.X.get(b)();this.X.clear()}onDestroy(a,b){void 0===b&&(++this.Ha,b=String(this.Ha));this.Z.set(b,a);return b}Xf(a){this.Z.delete(a)}Xd(a){if(void 0===b){++this.Ha;var b=String(this.Ha)}this.X.set(b,a);return b}mt(a){this.X.delete(a)}xt(a){this.N&&this.N.detach(this,!1);(this.N=a||null)&&this.N.ne(this)}getParent(){return this.N}};olympe.C.Gr=class extends olympe.C.Xb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Xf(){}};olympe.C.Fh.ya=[olympe.C.Fh];let Nb=0;
321
+ function Ob(a,b){a.R||(a.R=new Map);a.R.set(b.T(),b);switch(b.Kc()){case olympe.C.Node.j.Oh:break;case olympe.C.Node.j.ai:break;case olympe.C.Node.j.vk:case olympe.C.Node.j.dg:olympe.C.G.warn('Not bad as such but should not happen!');break;case olympe.C.Node.j.Gh:Pb(a,olympe.C.Node.j.Gh);break;case olympe.C.Node.j.OBSOLETE:a.lb=!0;a.j!==olympe.C.Node.j.Gh&&Pb(a,olympe.C.Node.j.OBSOLETE);break;case olympe.C.Node.j.Zd:olympe.C.G.warn('Adding a destroyed node as upstream => should never happen!');break;
322
+ default:olympe.C.G.warn('Unknown state, investigate: ',b.Kc())}Qb(b,a)}
323
+ function Rb(a){if(a.Mc){var b=[],c=[];if(a.Yf)if(a.Yf instanceof olympe.C.Node)if(Sb(a.Yf))b=a.Yf.Eb;else return;else b=a.Yf;else b=null;if(null!==a.Vd){const e=a.rg;for(let f=0,g=a.Vd.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.Vd[f];if(Sb(h))c.push(h.Eb);else return}else c.push(a.Vd[f])}if(a.Mc instanceof Function)var d=a.Mc;else b&&(b[a.Mc]||olympe.C.G.warn('looks like you forget a cast somewhere around '+a.Mc),d=b[a.Mc]);a.run(()=>{a.sg();if(void 0!==d){const e=d.apply(b,c);e&&e.vs?
324
+ Tb(a,e.Ba):e instanceof olympe.C.Node?Tb(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&Pb(a,olympe.C.Node.j.ai))}else Ub(a)})}}function M(a){void 0===a.Ua&&(a.Ua=a.valueType===olympe.C.Proxy?Vb(void 0,a.vb):Vb(a.valueType,a.vb),a.Ua.Ba=a);return a.Ua}function Wb(a){void 0!==a.D&&(Xb(a.D,a),a.D=void 0)}function Yb(a){if(a.j===olympe.C.Node.j.OBSOLETE&&(a.j=olympe.C.Node.j.ai,null!==a.H))for(const b of a.H.values())Zb(b)}function Pb(a,b){b!==a.j&&(a.j=b)}
325
+ function $b(a){if(a.j!==olympe.C.Node.j.OBSOLETE&&a.j!==olympe.C.Node.j.vk&&a.j!==olympe.C.Node.j.Oh&&a.j!==olympe.C.Node.j.Gh){Pb(a,olympe.C.Node.j.vk);var b=a.H;if(b)for(const c of b.values())b.has(c.T())&&$b(c);Pb(a,olympe.C.Node.j.OBSOLETE)}}function ac(a,b,c){if(a.j!==olympe.C.Node.j.dg)if(b===a.D)L(a,c,!0);else{if(a.j===olympe.C.Node.j.OBSOLETE||a.j===olympe.C.Node.j.vk)a.lb=!0;Rb(a)}}
326
+ function L(a,b,c){b instanceof olympe.C.Node&&(olympe.C.G.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Eb);a.wa||c||void 0===a.D||Wb(a);if(void 0!==b){if((a.wa||a.j===olympe.C.Node.j.ai||a.j===olympe.C.Node.j.OBSOLETE)&&!olympe.C.gb(b)&&void 0!==a.Eb){if(null===b&&null===a.Eb){Yb(a);return}if(null!==b&&null!==a.Eb&&(b.valueOf()===a.Eb.valueOf()||a.Eb.Ea&&a.Eb.Ea(b))){Yb(a);return}}if(!0===a.wa)olympe.C.G.error("Circular dependency detected: updating a downstream node caused this node's (#"+
327
+ a.T()+') value to get updated !');else{a.j===olympe.C.Node.j.Zd&&olympe.C.G.warn(`trying to set a value on a destroyed node (#${a.T()} ${a.$c?', '+a.$c:''})`);a.j===olympe.C.Node.j.dg&&olympe.C.G.warn(`trying to set a value on a node being destroyed (#${a.T()} ${a.$c?', '+a.$c:''})`);a.wa=!0;c=b;var d=!1,e=(f,g)=>f instanceof g?!0:!1;void 0===a.valueType||null===c||e(c,a.valueType)||(e=a.valueType&&a.valueType.name?a.valueType.name:'undefined',b='object'===typeof c?b.constructor.name:typeof c,c instanceof
328
+ Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.C.Sa?(c=olympe.C.xb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.C.$?(c=olympe.C.qa(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.C.da&&(c=olympe.C.Rb(c),d=!1)));a.Eb=c;Pb(a,olympe.C.Node.j.ai);if(b=a.H){d=0;for(const f of b.values())0<d&&$b(f),d++;for(const f of b.values())ac(f,a,c)}a.wa=!1}}}
329
+ function bc(a,b){if(a.j!==olympe.C.Node.j.dg&&a.j!==olympe.C.Node.j.Zd&&(a.j!==olympe.C.Node.j.Oh||a.Mc)){var c=void 0!==a.defaultValue;a.Mc&&b!==a.D&&a.sg();if(c)L(a,a.defaultValue,!0);else if(a.Eb=void 0,Pb(a,olympe.C.Node.j.Oh),b=a.H)for(const d of b.values())bc(d,a)}}function Ub(a){if(a.j!==olympe.C.Node.j.Gh){Pb(a,olympe.C.Node.j.Gh);var b=a.H;if(b)for(const c of b.values())Ub(c);a.sg();void 0!==a.D&&Wb(a);a.Eb=a.defaultValue}}function Sb(a){return a.j===olympe.C.Node.j.ai}
330
+ function Tb(a,b){b===a?olympe.C.G.error('Setting a node as provider of itself. Ignoring'):(a.D&&a.D!==b&&Wb(a),Qb(b,a),Sb(b)?L(a,b.Eb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):bc(a),a.D=b)}function cc(a,b){a.Mc&&(a.Mc=void 0);a.$c='Repeater';Tb(a,b)}function Zb(a){a.D?Yb(a):null!==a.R&&0===Array.from(a.R.values()).filter(b=>!Sb(b)).length&&(a.lb&&(a.lb=!1,Rb(a)),Yb(a))}
331
331
  function Qb(a,b){a.H||(a.H=new Map);a.H.set(b.T(),b);a.j===olympe.C.Node.j.Zd&&olympe.C.G.warn('adding a downstream node on a deleted one (#'+a.T()+') !')}function Xb(a,b){a.H&&(b=b.T(),a.H.has(b)&&(a.H.delete(b),dc(a)))}function dc(a){if(null===a.getParent()){var b=a.H;b&&0<b.size||a.destroy()}}
332
- olympe.C.Node=class extends olympe.C.Wb{constructor({valueType:a,Lc:b,Vz:c=!0,Xf:d,Mn:e,debug:f=!1,qg:g=null,$c:h='Node',qj:k}={}){++Nb;super(String(Nb));this.debug=!!f;this.$c=h;h&&'string'===typeof h||(b?this.$c=b.name?b.name:'anon()':this.$c='Node');this.Vd=e&&0<e.length?e:null;this.qg=g&&0<g.length?g:null;this.valueType=a;this.Eb=void 0;this.sa=!1;this.j=olympe.C.Node.j.Oh;this.nb=!1;this.H=this.R=null;this.Lc=b;this.Xf=d||null;this.defaultValue=this.Wa=this.D=void 0;this.qj=k;d&&d instanceof
333
- olympe.C.Node&&Ob(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Ob(this,a);c&&Rb(this)}wh(a){this.defaultValue=a;this.j===olympe.C.Node.j.Oh&&L(this,a,!0);return this}sj(a){this.valueType=a}Mb(){return this.valueType||Object}asObservable(a=olympe.C.Za()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.C.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.$c}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Jc(){return this.j}fb(){return this.j===olympe.C.Node.j.Zd}hd(){return this.j===
334
- olympe.C.Node.j.cg}yb(...a){if(this.qj instanceof Function)return this.qj(...a);var b=a.length;--b;const c=a[b];--b;const d=a[b],e=Array(b);for(var f=0;f<b;f++)e[f]=a[f];a=this.Jc();a!==olympe.C.Node.j.cg&&a!==olympe.C.Node.j.Zd||olympe.C.G.warn('Calling a function on a destroyed node!!!',this);a=d.F();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.C.gb(g)&&b.push(g.Ba);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.fh&&(e[g]=f.Ba,b.push(g));return M(new olympe.C.Node({valueType:d.H(),
335
- Lc:c,Xf:this,Mn:e,debug:!1,qg:b,$c:'Proxy.'+c+'()'}))}el(a){if(null===this.getParent())olympe.C.G.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.C.G.warn('Investigate a potential issue in creator-createe link: create node mismatch',a,this.getParent());return}this.xt(null);dc(this)}destroy(){var a=this.j;if(a!==olympe.C.Node.j.cg&&a!==olympe.C.Node.j.Zd){Pb(this,olympe.C.Node.j.cg);if(a=this.H){for(const c of a.values())if(a.has(c.T())){var b=c;b.R&&b.R.delete(this.T());
336
- b.D&&b.D.T()===this.T()?b.D=void 0:b.destroy()}a.clear()}this.H=null;super.destroy();if(this.R){for(const c of this.R.values())this.R.has(c.T())&&Xb(c,this);this.R.clear()}this.R=null;this.D&&(Xb(this.D,this),this.D=void 0);this.Eb=void 0;this.Vd&&(this.Vd.length=0,this.Vd=null);this.qg&&(this.qg.length=0,this.qg=null);this.qj=this.Lc=void 0;this.defaultValue=this.Xf=null;this.$c=`** Destroyed ** ${this.$c}`;Pb(this,olympe.C.Node.j.Zd)}}En(){return this.$c}print(){const a=this.Lc?this.Lc instanceof
337
- Function?this.Lc.name?this.Lc.name:'()':this.Lc:'{ }';return'#'+('000000'+this.T()).substr(-6)+(this.$c?' '+this.$c:'')+'>'+(a?' '+a+'()':'')}};olympe.C.Node.D='rootNode';olympe.C.Node.j={Oh:0,ai:1,Gh:3,vk:4,OBSOLETE:5,cg:6,Zd:7};function Vb(a,b){if('function'!==typeof a)return new olympe.C.Proxy(a,b);var c=olympe.C.Proxy.prototype;void 0===a.prototype&&olympe.C.G.error('investigate');c=Object.create(ec(c,a.prototype));c.di=a;c.vs=b;return c}function ec(a,b){Object.prototype.hasOwnProperty.call(b,olympe.C.Proxy.Om)||Object.defineProperty(b,olympe.C.Proxy.Om,{enumerable:!1,configurable:!1,writable:!1,value:fc(a,b)});return b[olympe.C.Proxy.Om]}
332
+ olympe.C.Node=class extends olympe.C.Xb{constructor({valueType:a,Mc:b,Wz:c=!0,Yf:d,Pn:e,debug:f=!1,rg:g=null,$c:h='Node',qj:k}={}){++Nb;super(String(Nb));this.debug=!!f;this.$c=h;h&&'string'===typeof h||(b?this.$c=b.name?b.name:'anon()':this.$c='Node');this.Vd=e&&0<e.length?e:null;this.rg=g&&0<g.length?g:null;this.valueType=a;this.Eb=void 0;this.wa=!1;this.j=olympe.C.Node.j.Oh;this.lb=!1;this.H=this.R=null;this.Mc=b;this.Yf=d||null;this.defaultValue=this.Ua=this.D=void 0;this.qj=k;d&&d instanceof
333
+ olympe.C.Node&&Ob(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Ob(this,a);c&&Rb(this)}wh(a){this.defaultValue=a;this.j===olympe.C.Node.j.Oh&&L(this,a,!0);return this}sj(a){this.valueType=a}Mb(){return this.valueType||Object}asObservable(a=olympe.C.Za()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.C.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.$c}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Kc(){return this.j}fb(){return this.j===olympe.C.Node.j.Zd}jd(){return this.j===
334
+ olympe.C.Node.j.dg}vb(...a){if(this.qj instanceof Function)return this.qj(...a);var b=a.length;--b;const c=a[b];--b;const d=a[b],e=Array(b);for(var f=0;f<b;f++)e[f]=a[f];a=this.Kc();a!==olympe.C.Node.j.dg&&a!==olympe.C.Node.j.Zd||olympe.C.G.warn('Calling a function on a destroyed node!!!',this);a=d.F();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.C.gb(g)&&b.push(g.Ba);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.fh&&(e[g]=f.Ba,b.push(g));return M(new olympe.C.Node({valueType:d.H(),
335
+ Mc:c,Yf:this,Pn:e,debug:!1,rg:b,$c:'Proxy.'+c+'()'}))}el(a){if(null===this.getParent())olympe.C.G.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.C.G.warn('Investigate a potential issue in creator-createe link: create node mismatch',a,this.getParent());return}this.xt(null);dc(this)}destroy(){var a=this.j;if(a!==olympe.C.Node.j.dg&&a!==olympe.C.Node.j.Zd){Pb(this,olympe.C.Node.j.dg);if(a=this.H){for(const c of a.values())if(a.has(c.T())){var b=c;b.R&&b.R.delete(this.T());
336
+ b.D&&b.D.T()===this.T()?b.D=void 0:b.destroy()}a.clear()}this.H=null;super.destroy();if(this.R){for(const c of this.R.values())this.R.has(c.T())&&Xb(c,this);this.R.clear()}this.R=null;this.D&&(Xb(this.D,this),this.D=void 0);this.Eb=void 0;this.Vd&&(this.Vd.length=0,this.Vd=null);this.rg&&(this.rg.length=0,this.rg=null);this.qj=this.Mc=void 0;this.defaultValue=this.Yf=null;this.$c=`** Destroyed ** ${this.$c}`;Pb(this,olympe.C.Node.j.Zd)}}Hn(){return this.$c}print(){const a=this.Mc?this.Mc instanceof
337
+ Function?this.Mc.name?this.Mc.name:'()':this.Mc:'{ }';return'#'+('000000'+this.T()).substr(-6)+(this.$c?' '+this.$c:'')+'>'+(a?' '+a+'()':'')}};olympe.C.Node.D='rootNode';olympe.C.Node.j={Oh:0,ai:1,Gh:3,vk:4,OBSOLETE:5,dg:6,Zd:7};function Vb(a,b){if('function'!==typeof a)return new olympe.C.Proxy(a,b);var c=olympe.C.Proxy.prototype;void 0===a.prototype&&olympe.C.G.error('investigate');c=Object.create(ec(c,a.prototype));c.di=a;c.ws=b;return c}function ec(a,b){Object.prototype.hasOwnProperty.call(b,olympe.C.Proxy.Rm)||Object.defineProperty(b,olympe.C.Proxy.Rm,{enumerable:!1,configurable:!1,writable:!1,value:fc(a,b)});return b[olympe.C.Proxy.Rm]}
338
338
  function gc(a,b){if(a.di!==b){a.di=b;b.prototype||olympe.C.G.error('Cast not possible, provided type is not a valid type!');var c=ec(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Ba&&a.Ba.sj(b)}}
339
- function fc(a,b){let c={};if(b.prototype)olympe.C.G.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(ec(a,b.__proto__));else return olympe.C.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].K;null===e||e&&e.N()?c[d]=function(...f){var g=this.Ba;if(g&&Sb(g)&&(g=g.Eb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.C.J.X,c[d]=function(...f){f=this.vs.call(this.Ba,
340
- ...f,e,d);const g=e.X;if(g){const h=this.Ba.Eb;h&&h[g]&&gc(f,h[g])}return e.R()?this:f})}});return c}function hc(a,b){L(a.Ba,b)}function ic(a){bc(a.Ba)}function jc(a,b){cc(a.Ba,olympe.C.Uf(b)?b:b.Ba)}function kc(a,b){olympe.C.gb(b)||olympe.C.Uf(b)?jc(a,b):hc(a,b)}
341
- olympe.C.Proxy=class{constructor(a,b){this.Ba=null;this.di=a;this.vs=b}static gb(a){return!(!a||!a.fh)}Ea(a){return olympe.C.ta([this,a],(b,c)=>b===c,Boolean)}Jd(a){return olympe.C.ta([this,a],(b,c)=>null===b||null===c?b===c?olympe.C.ba.D:olympe.C.ba.j:b.valueOf()===c.valueOf()?olympe.C.ba.D:olympe.C.ba.j,olympe.C.ba)}asObservable(a){return this.Ba.asObservable(a)}us(){return this.Ba}};olympe.C.Proxy.Om='__opp__';olympe.C.Proxy.prototype.fh=!0;function lc(a,b){a.node.wh(b);return a}olympe.C.lk=class{constructor(a,b='FlowSource'){this.node=olympe.C.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.C.gb(a)?L(this.node,olympe.C.Qa(a)):L(this.node,a);return this}repeat(a){cc(this.node,olympe.C.gb(a)?a.Ba:a);return this}clear(){bc(this.node);return this}tb(){return M(this.node)}getContext(){return this.node}};function mc(a,b,c=1E3,d,e){const f=olympe.C.bc(olympe.C.$),g=d||olympe.C.$.lp.tq;let h,k,l,n;f.update(olympe.C.qa(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.getContext().fb()||(l=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+l*g(k,0,1,1),f.update(olympe.C.qa(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.tb()}
342
- olympe.C.$=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.qa(b.value)}fo(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.C.Rb(!this.fo())}Wc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.C.wb(''):olympe.C.wb(this.value.toString())}toString(a,b){return void 0!==
343
- this.value&&null!==this.value?'number'===typeof a?this.value.toString(a):'number'===typeof b?this.value.toFixed(b):this.value.toString():'-'}toFixed(a){return this.fo()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.C.bc(olympe.C.$,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.C.qa(c))};a.forEach((f,g)=>{olympe.C.Vc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().fb()){var g=b.get(f);b.delete(f);
344
- g===c&&e()}});return d.tb()}ge(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(b.valueOf()+c.valueOf()),olympe.C.$,'ONumber.plus')}uh(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(b.valueOf()-c.valueOf()),olympe.C.$,'ONumber.minus')}round(){return olympe.C.qa(Math.round(this.valueOf()))}Qj(){return olympe.C.qa(-this.valueOf())}rl(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(b.valueOf()*c.valueOf()),olympe.C.$,'ONumber.mul')}vj(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(b.valueOf()/
345
- c.valueOf()),olympe.C.$,'ONumber.div')}xz(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(b.valueOf()%c.valueOf()),olympe.C.$,'ONumber.div')}floor(){return olympe.C.qa(Math.floor(this.valueOf()))}ceil(){return olympe.C.qa(Math.ceil(this.valueOf()))}trunc(){return olympe.C.qa(Math.trunc(this.valueOf()))}log(){return olympe.C.qa(Math.log(this.valueOf()))}pow(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(Math.pow(b.valueOf(),c.valueOf())),olympe.C.$,'ONumber.pow')}exp(){return olympe.C.qa(Math.exp(this.valueOf()))}Jd(a){return olympe.C.ta([this,
346
- a],(b,c)=>olympe.C.Rb(b.Ea(c)),olympe.C.ba,'ONumber.oEquals')}Ea(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Ky(){return this.valueOf()}Pn(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.C.ba.D:olympe.C.ba.j,olympe.C.ba,'ONumber.isBiggerThan')}bA(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.C.qa(c),olympe.C.$,'ONumber.returnsBiggest')}st(a){return olympe.C.ta([this,
347
- a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.C.qa(c),olympe.C.$,'ONumber.returnsSmallest')}nz(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.C.ba.D:olympe.C.ba.j,olympe.C.ba,'ONumber.isSmallerThan')}sin(){return olympe.C.qa(Math.sin(this.valueOf()))}cos(){return olympe.C.qa(Math.cos(this.valueOf()))}atan2(a){return olympe.C.gb(a)?olympe.C.xe([a],b=>olympe.C.qa(Math.atan2(this.valueOf(),b.valueOf())),olympe.C.$):olympe.C.qa(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.C.qa(Math.abs(this.valueOf()))}Ij(a,
348
- b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.xe([a,b],(c,d)=>olympe.C.qa(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.C.$):olympe.C.qa(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static ex(a,b,c,d){'number'===typeof a&&(a=olympe.C.fe(a));'number'===typeof b&&(b=olympe.C.fe(b));'number'===typeof c&&(c=olympe.C.fe(c));let e=0;const f=olympe.C.fe(0);let g,h;void 0!==b&&void 0!==c&&olympe.C.Gj(b.Pn(c),()=>{olympe.ha.Xa('df').warn('You have a min bigger than max, cap your inputs')});
349
- const k=(l,n)=>{n=olympe.C.fe(n);const p=olympe.C.$.animate(n,500);jc(f,p);hc(n,olympe.C.qa(l));e=l};olympe.C.xe([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):jc(f,olympe.C.fe(e))},olympe.C.$);void 0!==b&&olympe.C.Sn(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.C.fe(e),p=olympe.C.$.animate(n,400,d);l=olympe.C.qa(g);L(n.Ba,l);e=g;jc(f,p)}});void 0!==c&&olympe.C.Sn(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.C.fe(e),p=olympe.C.$.animate(n,400,d);l=olympe.C.qa(h);L(n.Ba,l);e=h;jc(f,p)}});
350
- return f}static offset(a){let b;return olympe.C.xe([a],c=>{void 0===b&&(b=c);return olympe.C.qa(c-b)},olympe.C.$,'offset')}static Gs(a){let b,c,d;return olympe.C.ta([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.C.qa(0);d=window.performance.now();const f=olympe.C.qa((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.C.$,'derivative')}static fz(a){let b=olympe.C.qa(0),c,d,e;return olympe.C.ta([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.C.qa(0);e=window.performance.now();
351
- b=b.ge((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.C.$,'integrate')}static Mx(a){let b;return olympe.C.ta([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.C.qa(c.valueOf()-b.valueOf());b=c;return d},olympe.C.$,'diff')}static Bx(a,b,c){return olympe.C.xe([a,b,c],(d,e,f)=>{d='number'===typeof d?d:d.valueOf();e='number'===typeof e?e:e.valueOf();f='number'===typeof f?f:f.valueOf();return olympe.C.qa(d>=e?d<=f?d:f:e)},olympe.C.$)}static animate(a,b,c,d){let e;return e=olympe.C.ta([a],
352
- f=>{const g=olympe.C.Qa(b,1E3),h=olympe.C.Qa(e);return void 0===h?olympe.C.qa(f):mc(h,f,g,c,k=>{d&&d(k)})},olympe.C.$)}static qx(a,b,c){let d,e,f,g,h,k,l=olympe.C.fe(),n;olympe.C.Vc([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);hc(l,olympe.C.qa(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Wc(a){return olympe.C.gb(a)?olympe.C.ta([a],b=>olympe.C.wb(b.valueOf().toString()),
353
- olympe.C.Sa):olympe.C.wb(a)}static Qj(a){return olympe.C.gb(a)?olympe.C.ta([a],b=>olympe.C.qa(-b.valueOf()),olympe.C.$):olympe.C.qa(-a.valueOf())}static ge(a,b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.ta([a,b],(c,d)=>olympe.C.qa(c.valueOf()+d.valueOf()),olympe.C.$,'plus'):olympe.C.qa(a.valueOf()+b.valueOf())}static uh(a,b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.xe([a,b],(c,d)=>olympe.C.qa(c.valueOf()-d.valueOf()),olympe.C.$,'minus'):olympe.C.qa(a.valueOf()-b.valueOf())}static vj(a,
354
- b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.xe([a,b],(c,d)=>olympe.C.qa(c.valueOf()/d.valueOf()),olympe.C.$,'div'):olympe.C.qa(a.valueOf()/b.valueOf())}static Tz(a,b){if(void 0===b)return a;olympe.C.Vc([b],c=>{c=olympe.C.qa(a.Ba.Eb.valueOf()+c.valueOf());L(a.Ba,c)},'plusEqual');return a}};olympe.C.$.ZERO=new olympe.C.$(0);olympe.C.$.ONE=new olympe.C.$(1);olympe.C.$.Nw=new olympe.C.$(2);olympe.C.$.PI=new olympe.C.$(Math.PI);olympe.C.$.Gu=new olympe.C.$(Infinity);olympe.C.$.Dv=new olympe.C.$(-Infinity);
355
- olympe.C.$.Aq=new olympe.C.$(NaN);olympe.C.$.KC=olympe.C.$.Tz;olympe.C.$.vA=olympe.C.$.ex;olympe.C.$.yC=olympe.C.$.offset;olympe.C.$.cB=olympe.C.$.Gs;olympe.C.$.VE=olympe.C.$.Gs;olympe.C.$.ZB=olympe.C.$.fz;olympe.C.$.dB=olympe.C.$.Mx;olympe.C.$.LA=olympe.C.$.Bx;olympe.C.$.wA=olympe.C.$.animate;olympe.C.$.xA=olympe.C.$.qx;olympe.C.$.dE=olympe.C.$.Wc;olympe.C.$.eE=olympe.C.$.Qj;olympe.C.$.JC=olympe.C.$.ge;olympe.C.$.mC=olympe.C.$.uh;olympe.C.$.eB=olympe.C.$.vj;
356
- olympe.C.$.lp={tq:function(a,b,c,d){return c*a/d+b},yB:function(a,b,c,d){a/=d;return c*a*a+b},IB:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},uB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a+b;a--;return-c/2*(a*(a-2)-1)+b},nB:function(a,b,c,d){a/=d;return c*a*a*a+b},EB:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},sB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a+b;a-=2;return c/2*(a*a*a+2)+b},zB:function(a,b,c,d){a/=d;return c*a*a*a*a+b},JB:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
357
- vB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a+b;a-=2;return-c/2*(a*a*a*a-2)+b},AB:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},KB:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},wB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a*a+b;a-=2;return c/2*(a*a*a*a*a+2)+b},BB:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},LB:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},xB:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},qB:function(a,b,c,d){return c*Math.pow(2,
358
- 10*(a/d-1))+b},HB:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},tB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*Math.pow(2,10*(a-1))+b;a--;return c/2*(-Math.pow(2,-10*a)+2)+b},mB:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},DB:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},rB:function(a,b,c,d){a/=d/2;if(1>a)return-c/2*(Math.sqrt(1-a*a)-1)+b;a-=2;return c/2*(Math.sqrt(1-a*a)+1)+b},hB:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},iB:function(a,b,c,d){d=(a/=d)*a;return b+
359
- c*(2*d*d+2*d*a+-3*d)},jB:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},kB:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},GB:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(33*e*d+-106*d*d+126*e+-67*d+15*a)},FB:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(56*e*d+-175*d*d+200*e+-100*d+20*a)},pB:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},oB:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},CB:function(a,
360
- b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},lB:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};m=olympe.C.$.prototype;m.toJSON.K=olympe.C.J.j;m.fo.K=olympe.C.J.j;m.isNaN.K=olympe.C.J.N;m.Wc.K=olympe.C.J.D;
361
- m.toString.K=new olympe.C.J(()=>String,[]);m.toFixed.K=new olympe.C.J(()=>String,[]);m.ge.K=new olympe.C.J(()=>olympe.C.$,[0]);m.uh.K=new olympe.C.J(()=>olympe.C.$,[0]);m.round.K=olympe.C.J.F;m.Qj.K=olympe.C.J.F;m.rl.K=new olympe.C.J(()=>olympe.C.$,[0]);m.vj.K=new olympe.C.J(()=>olympe.C.$,[0]);m.xz.K=new olympe.C.J(()=>olympe.C.$,[0]);m.floor.K=olympe.C.J.F;m.ceil.K=olympe.C.J.F;m.trunc.K=olympe.C.J.F;m.log.K=olympe.C.J.F;m.pow.K=new olympe.C.J(()=>olympe.C.$,[0]);m.exp.K=olympe.C.J.F;
362
- m.Jd.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.Ea.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.Ky.K=olympe.C.J.j;m.Pn.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.bA.K=new olympe.C.J(()=>olympe.C.$,[0]);m.st.K=new olympe.C.J(()=>olympe.C.$,[0]);m.nz.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.sin.K=olympe.C.J.F;m.cos.K=olympe.C.J.F;m.atan2.K=new olympe.C.J(()=>olympe.C.$,[0]);m.abs.K=olympe.C.J.F;m.Ij.K=new olympe.C.J(()=>olympe.C.$,[0,1]);olympe.C.Sa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.wb(b.value)}Ds(a){return olympe.C.Sa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.C.ta([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.C.wb(d)},olympe.C.Sa,'OString.concat')}Wc(){return this}oA(a){return olympe.C.qa(parseInt(this.value,
363
- a))}zt(){return olympe.C.qa(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Ea(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Jd(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.Rb(c&&b.valueOf()===c.valueOf()),olympe.C.ba,'OString.oEquals')}nf(){return olympe.C.Rb(!this.value||0===this.value.length)}contains(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.Rb((c instanceof olympe.C.Sa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
364
- olympe.C.ba,'OString.contains')}startsWith(a,b){return olympe.C.ta([this,a,b||0],(c,d,e)=>olympe.C.Rb(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.C.ba,'OString.startsWith')}endsWith(a,b){return olympe.C.ta([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Gn().valueOf()+e.valueOf()+1;return olympe.C.Rb(c.valueOf().endsWith(d.valueOf(),e))},olympe.C.ba,'OString.endsWith')}indexOf(a,b){return olympe.C.ta([this,a,b||0],(c,d,e)=>olympe.C.qa(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
365
- olympe.C.$,'OString.indexOf')}lastIndexOf(a,b){return olympe.C.ta([this,a,b||Infinity],(c,d,e)=>olympe.C.qa(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.C.$,'OString.lastIndexOf')}slice(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.wb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.C.Sa,'OString.slice')}Gn(){return olympe.C.qa(this.value.length)}threshold(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.C.Sa.EMPTY,olympe.C.Sa,'OString.threshold')}toLowerCase(){return olympe.C.wb(this.value.toLowerCase())}toUpperCase(){return olympe.C.wb(this.value.toUpperCase())}trim(){return olympe.C.wb(this.value.trim())}padStart(a,
366
- b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.wb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.padStart')}padEnd(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.wb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.padEnd')}replace(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.wb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.replace')}kA(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.wb(c.valueOf().substr(d.valueOf(),
367
- e.valueOf())),olympe.C.Sa,'OString.subOStr')}static concat(...a){return olympe.C.wb('').concat(...a)}};olympe.C.Sa.EMPTY=new olympe.C.Sa('');olympe.C.Sa.yw=new olympe.C.Sa(' ');m=olympe.C.Sa.prototype;m.toJSON.K=olympe.C.J.j;m.Ds.K=new olympe.C.J(()=>olympe.C.Sa,[0,1]);m.concat.K=olympe.C.J.D;m.Wc.K=olympe.C.J.D;m.oA.K=olympe.C.J.F;m.zt.K=olympe.C.J.F;m.toString.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;m.Jd.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.nf.K=olympe.C.J.N;
368
- m.contains.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.startsWith.K=new olympe.C.J(()=>olympe.C.ba,[0,1]);m.endsWith.K=new olympe.C.J(()=>olympe.C.ba,[0,1]);m.indexOf.K=new olympe.C.J(()=>olympe.C.$,[0,1]);m.lastIndexOf.K=new olympe.C.J(()=>olympe.C.$,[0,1]);m.slice.K=new olympe.C.J(()=>olympe.C.Sa,[0,1]);m.Gn.K=olympe.C.J.F;m.threshold.K=new olympe.C.J(()=>olympe.C.Sa,[0]);m.toLowerCase.K=olympe.C.J.D;m.toUpperCase.K=olympe.C.J.D;m.trim.K=olympe.C.J.D;m.padStart.K=olympe.C.J.D;m.padEnd.K=olympe.C.J.D;
369
- m.replace.K=olympe.C.J.D;m.kA.K=olympe.C.J.D;olympe.C.ba=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.C.ba.D:olympe.C.ba.j}and(a){if(void 0!==a)return olympe.C.gb(a)?olympe.C.xe([a],b=>new olympe.C.ba(this.valueOf()&&b.valueOf()),olympe.C.ba,'and'):this.value&&a.valueOf()?olympe.C.ba.D:olympe.C.ba.j}Ea(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Jd(a){if(void 0!==a)return olympe.C.gb(a)?
370
- olympe.C.xe([a],b=>new olympe.C.ba(this.valueOf()===b.valueOf()),olympe.C.ba,'oEquals'):this.Ea(a)?olympe.C.ba.D:olympe.C.ba.j}zd(){return this.value?olympe.C.ba.j:olympe.C.ba.D}px(a){if(void 0!==a)return olympe.C.gb(a)?olympe.C.xe([a],b=>new olympe.C.ba(!(this.valueOf()&&b.valueOf())),olympe.C.ba,'andNot'):this.value&&!a.valueOf()?olympe.C.ba.D:olympe.C.ba.j}or(a){if(void 0!==a)return olympe.C.gb(a)?olympe.C.xe([a],b=>new olympe.C.ba(this.valueOf()||b.valueOf()),olympe.C.ba,'or'):this.value||a.valueOf()?
371
- olympe.C.ba.D:olympe.C.ba.j}xor(a){return olympe.C.ta([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.C.Rb(b&&!c||!b&&c)},olympe.C.ba,'OBoolean.xor')}$x(){return this.value}Vs(){return!0===this.value?olympe.C.$.ONE:olympe.C.$.ZERO}Wc(){return olympe.C.wb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.C.ba.D=new olympe.C.ba(!0);olympe.C.ba.j=new olympe.C.ba(!1);m=olympe.C.ba.prototype;m.toJSON.K=olympe.C.J.j;
372
- m.and.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.Ea.K=olympe.C.J.j;m.Jd.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.zd.K=olympe.C.J.N;m.px.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.or.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.xor.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.$x.K=new olympe.C.J(()=>Boolean,[]);m.Vs.K=olympe.C.J.F;m.Wc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;function nc(a){return new olympe.C.eb(new Date(a))}
373
- olympe.C.eb=class{constructor(a){this.sb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.sb.toJSON()+'" }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.C.eb(new Date(b.value.valueOf()))}static now(){return new olympe.C.eb(new Date)}lq(){return this.sb&&!isNaN(this.sb.getTime())?olympe.C.ba.D:olympe.C.ba.j}Nu(){return olympe.C.qa(this.sb.getMilliseconds())}Pu(){return olympe.C.qa(this.sb.getSeconds())}Ou(){return olympe.C.qa(this.sb.getMinutes())}Mu(){return olympe.C.qa(this.sb.getHours())}py(){return olympe.C.qa(this.sb.getDate())}getMonth(){return olympe.C.qa(this.sb.getMonth()+1)}Qu(){return olympe.C.qa(this.sb.getFullYear())}getTime(){return this.sb.getTime()}hA(){var a=
374
- olympe.C,b=a.wb;var c=this.sb.getDate();c=10>c?'0'+c:c;var d=this.sb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.sb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.C.wb(this.sb.toLocaleString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.wb(b.sb.toLocaleString(c.valueOf())),olympe.C.Sa)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.C.wb(this.sb.toLocaleDateString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.wb(b.sb.toLocaleDateString(c.valueOf())),
375
- olympe.C.Sa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.C.wb(this.sb.toLocaleTimeString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.wb(b.sb.toLocaleTimeString(c.valueOf())),olympe.C.Sa)}Wc(){return olympe.C.wb(this.sb.toISOString())}lA(){return new Date(this.getTime())}nA(){return this}pA(){return this}pg(a,b){return olympe.C.ta([b],c=>{const d=new olympe.C.eb(new Date(this.sb.getTime()));d.sb['set'+a](this.sb['get'+a]()+c.valueOf());return d},olympe.C.eb)}hx(a){return this.pg('Milliseconds',
376
- a)}mx(a){return this.pg('Seconds',a)}ix(a){return this.pg('Minutes',a)}gx(a){return this.pg('Hours',a)}ln(a){return this.pg('Date',a)}nx(a){return'number'===typeof a?this.ln(7*a):this.ln(a.rl(7))}jx(a){return this.pg('Month',a)}ox(a){return this.pg('FullYear',a)}iA(){let a=this.sb.getDay();a=0===a?6:a-1;return new olympe.C.eb(new Date(this.sb.getFullYear(),this.sb.getMonth(),this.sb.getDate()-a))}jA(){return new olympe.C.eb(new Date(this.sb.getFullYear(),this.sb.getMonth()))}Jd(a){return olympe.C.ta([a],
377
- b=>olympe.C.Rb(this.Ea(b)),olympe.C.ba)}Ea(a){return a instanceof olympe.C.eb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Cy(){let a=this.sb.getDay();0===a&&(a=7);return olympe.C.qa(a)}uy(a,b){return olympe.C.ta([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.sb.getFullYear()-c.sb.getFullYear():'months'===d?c=12*(this.sb.getFullYear()-c.sb.getFullYear())+(this.sb.getMonth()-c.sb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
378
- void 0===d&&(olympe.ha.Xa('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.sb.getTime()-c.sb.getTime())/d));return olympe.C.qa(c)},olympe.C.$)}iz(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.getTime()<b.getTime()),olympe.C.ba)}gz(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.getTime()>b.getTime()),olympe.C.ba)}jz(a,b){return olympe.C.ta([a,b],(c,d)=>olympe.C.Rb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.C.ba)}valueOf(){return this.lq().valueOf()?
379
- new Date(this.getTime()):new Date(0)}};olympe.C.eb.j=nc(0);olympe.C.eb.D=nc(Number.NaN);m=olympe.C.eb.prototype;m.lq.K=olympe.C.J.N;m.Nu.K=olympe.C.J.F;m.Pu.K=olympe.C.J.F;m.Ou.K=olympe.C.J.F;m.Mu.K=olympe.C.J.F;m.py.K=olympe.C.J.F;m.getMonth.K=olympe.C.J.F;m.Qu.K=olympe.C.J.F;m.getTime.K=olympe.C.J.j;m.hA.K=new olympe.C.J(()=>olympe.C.Sa,[0]);m.toLocaleString.K=olympe.C.J.D;m.toLocaleDateString.K=olympe.C.J.D;m.toLocaleTimeString.K=olympe.C.J.D;m.Wc.K=olympe.C.J.D;m.lA.K=olympe.C.J.j;
380
- m.nA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.pA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.pg.K=new olympe.C.J(()=>olympe.C.eb,[]);m.hx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.mx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ix.K=new olympe.C.J(()=>olympe.C.eb,[]);m.gx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ln.K=new olympe.C.J(()=>olympe.C.eb,[0]);m.nx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.jx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ox.K=new olympe.C.J(()=>olympe.C.eb,[0]);
381
- m.iA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.jA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Jd.K=olympe.C.J.N;m.Ea.K=olympe.C.J.j;m.Cy.K=olympe.C.J.F;m.uy.K=new olympe.C.J(()=>olympe.C.$,[0,1]);m.iz.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.gz.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.jz.K=new olympe.C.J(()=>olympe.C.ba,[0,1]);m.valueOf.K=olympe.C.J.j;const oc=new Map,pc=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,qc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function rc(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=qc.exec(c)):(d=1,c=pc.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.C.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.C.pf(a)?olympe.C.xe([a],b,olympe.C.Color):b(a)}
339
+ function fc(a,b){let c={};if(b.prototype)olympe.C.G.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(ec(a,b.__proto__));else return olympe.C.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].K;null===e||e&&e.N()?c[d]=function(...f){var g=this.Ba;if(g&&Sb(g)&&(g=g.Eb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.C.J.X,c[d]=function(...f){f=this.ws.call(this.Ba,
340
+ ...f,e,d);const g=e.X;if(g){const h=this.Ba.Eb;h&&h[g]&&gc(f,h[g])}return e.R()?this:f})}});return c}function hc(a,b){L(a.Ba,b)}function ic(a){bc(a.Ba)}function jc(a,b){cc(a.Ba,olympe.C.Wf(b)?b:b.Ba)}function kc(a,b){olympe.C.gb(b)||olympe.C.Wf(b)?jc(a,b):hc(a,b)}
341
+ olympe.C.Proxy=class{constructor(a,b){this.Ba=null;this.di=a;this.ws=b}static gb(a){return!(!a||!a.fh)}Ea(a){return olympe.C.sa([this,a],(b,c)=>b===c,Boolean)}Jd(a){return olympe.C.sa([this,a],(b,c)=>null===b||null===c?b===c?olympe.C.da.D:olympe.C.da.j:b.valueOf()===c.valueOf()?olympe.C.da.D:olympe.C.da.j,olympe.C.da)}asObservable(a){return this.Ba.asObservable(a)}vs(){return this.Ba}};olympe.C.Proxy.Rm='__opp__';olympe.C.Proxy.prototype.fh=!0;function lc(a,b){a.node.wh(b);return a}olympe.C.lk=class{constructor(a,b='FlowSource'){this.node=olympe.C.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.C.gb(a)?L(this.node,olympe.C.Qa(a)):L(this.node,a);return this}repeat(a){cc(this.node,olympe.C.gb(a)?a.Ba:a);return this}clear(){bc(this.node);return this}tb(){return M(this.node)}getContext(){return this.node}};function mc(a,b,c=1E3,d,e){const f=olympe.C.bc(olympe.C.$),g=d||olympe.C.$.mp.uq;let h,k,l,n;f.update(olympe.C.qa(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.getContext().fb()||(l=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+l*g(k,0,1,1),f.update(olympe.C.qa(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.tb()}
342
+ olympe.C.$=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.qa(b.value)}ho(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.C.Rb(!this.ho())}Xc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.C.xb(''):olympe.C.xb(this.value.toString())}toString(a,b){return void 0!==
343
+ this.value&&null!==this.value?'number'===typeof a?this.value.toString(a):'number'===typeof b?this.value.toFixed(b):this.value.toString():'-'}toFixed(a){return this.ho()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.C.bc(olympe.C.$,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.C.qa(c))};a.forEach((f,g)=>{olympe.C.Wc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().fb()){var g=b.get(f);b.delete(f);
344
+ g===c&&e()}});return d.tb()}ge(a){return olympe.C.sa([this,a],(b,c)=>olympe.C.qa(b.valueOf()+c.valueOf()),olympe.C.$,'ONumber.plus')}uh(a){return olympe.C.sa([this,a],(b,c)=>olympe.C.qa(b.valueOf()-c.valueOf()),olympe.C.$,'ONumber.minus')}round(){return olympe.C.qa(Math.round(this.valueOf()))}Qj(){return olympe.C.qa(-this.valueOf())}sl(a){return olympe.C.sa([this,a],(b,c)=>olympe.C.qa(b.valueOf()*c.valueOf()),olympe.C.$,'ONumber.mul')}vj(a){return olympe.C.sa([this,a],(b,c)=>olympe.C.qa(b.valueOf()/
345
+ c.valueOf()),olympe.C.$,'ONumber.div')}yz(a){return olympe.C.sa([this,a],(b,c)=>olympe.C.qa(b.valueOf()%c.valueOf()),olympe.C.$,'ONumber.div')}floor(){return olympe.C.qa(Math.floor(this.valueOf()))}ceil(){return olympe.C.qa(Math.ceil(this.valueOf()))}trunc(){return olympe.C.qa(Math.trunc(this.valueOf()))}log(){return olympe.C.qa(Math.log(this.valueOf()))}pow(a){return olympe.C.sa([this,a],(b,c)=>olympe.C.qa(Math.pow(b.valueOf(),c.valueOf())),olympe.C.$,'ONumber.pow')}exp(){return olympe.C.qa(Math.exp(this.valueOf()))}Jd(a){return olympe.C.sa([this,
346
+ a],(b,c)=>olympe.C.Rb(b.Ea(c)),olympe.C.da,'ONumber.oEquals')}Ea(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Ly(){return this.valueOf()}Sn(a){return olympe.C.sa([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.C.da.D:olympe.C.da.j,olympe.C.da,'ONumber.isBiggerThan')}cA(a){return olympe.C.sa([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.C.qa(c),olympe.C.$,'ONumber.returnsBiggest')}st(a){return olympe.C.sa([this,
347
+ a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.C.qa(c),olympe.C.$,'ONumber.returnsSmallest')}oz(a){return olympe.C.sa([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.C.da.D:olympe.C.da.j,olympe.C.da,'ONumber.isSmallerThan')}sin(){return olympe.C.qa(Math.sin(this.valueOf()))}cos(){return olympe.C.qa(Math.cos(this.valueOf()))}atan2(a){return olympe.C.gb(a)?olympe.C.ye([a],b=>olympe.C.qa(Math.atan2(this.valueOf(),b.valueOf())),olympe.C.$):olympe.C.qa(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.C.qa(Math.abs(this.valueOf()))}Ij(a,
348
+ b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.ye([a,b],(c,d)=>olympe.C.qa(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.C.$):olympe.C.qa(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static gx(a,b,c,d){'number'===typeof a&&(a=olympe.C.fe(a));'number'===typeof b&&(b=olympe.C.fe(b));'number'===typeof c&&(c=olympe.C.fe(c));let e=0;const f=olympe.C.fe(0);let g,h;void 0!==b&&void 0!==c&&olympe.C.Gj(b.Sn(c),()=>{olympe.ga.Wa('df').warn('You have a min bigger than max, cap your inputs')});
349
+ const k=(l,n)=>{n=olympe.C.fe(n);const p=olympe.C.$.animate(n,500);jc(f,p);hc(n,olympe.C.qa(l));e=l};olympe.C.ye([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):jc(f,olympe.C.fe(e))},olympe.C.$);void 0!==b&&olympe.C.Vn(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.C.fe(e),p=olympe.C.$.animate(n,400,d);l=olympe.C.qa(g);L(n.Ba,l);e=g;jc(f,p)}});void 0!==c&&olympe.C.Vn(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.C.fe(e),p=olympe.C.$.animate(n,400,d);l=olympe.C.qa(h);L(n.Ba,l);e=h;jc(f,p)}});
350
+ return f}static offset(a){let b;return olympe.C.ye([a],c=>{void 0===b&&(b=c);return olympe.C.qa(c-b)},olympe.C.$,'offset')}static Hs(a){let b,c,d;return olympe.C.sa([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.C.qa(0);d=window.performance.now();const f=olympe.C.qa((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.C.$,'derivative')}static gz(a){let b=olympe.C.qa(0),c,d,e;return olympe.C.sa([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.C.qa(0);e=window.performance.now();
351
+ b=b.ge((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.C.$,'integrate')}static Nx(a){let b;return olympe.C.sa([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.C.qa(c.valueOf()-b.valueOf());b=c;return d},olympe.C.$,'diff')}static Cx(a,b,c){return olympe.C.ye([a,b,c],(d,e,f)=>{d='number'===typeof d?d:d.valueOf();e='number'===typeof e?e:e.valueOf();f='number'===typeof f?f:f.valueOf();return olympe.C.qa(d>=e?d<=f?d:f:e)},olympe.C.$)}static animate(a,b,c,d){let e;return e=olympe.C.sa([a],
352
+ f=>{const g=olympe.C.Qa(b,1E3),h=olympe.C.Qa(e);return void 0===h?olympe.C.qa(f):mc(h,f,g,c,k=>{d&&d(k)})},olympe.C.$)}static sx(a,b,c){let d,e,f,g,h,k,l=olympe.C.fe(),n;olympe.C.Wc([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);hc(l,olympe.C.qa(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Xc(a){return olympe.C.gb(a)?olympe.C.sa([a],b=>olympe.C.xb(b.valueOf().toString()),
353
+ olympe.C.Sa):olympe.C.xb(a)}static Qj(a){return olympe.C.gb(a)?olympe.C.sa([a],b=>olympe.C.qa(-b.valueOf()),olympe.C.$):olympe.C.qa(-a.valueOf())}static ge(a,b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.sa([a,b],(c,d)=>olympe.C.qa(c.valueOf()+d.valueOf()),olympe.C.$,'plus'):olympe.C.qa(a.valueOf()+b.valueOf())}static uh(a,b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.ye([a,b],(c,d)=>olympe.C.qa(c.valueOf()-d.valueOf()),olympe.C.$,'minus'):olympe.C.qa(a.valueOf()-b.valueOf())}static vj(a,
354
+ b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.ye([a,b],(c,d)=>olympe.C.qa(c.valueOf()/d.valueOf()),olympe.C.$,'div'):olympe.C.qa(a.valueOf()/b.valueOf())}static Uz(a,b){if(void 0===b)return a;olympe.C.Wc([b],c=>{c=olympe.C.qa(a.Ba.Eb.valueOf()+c.valueOf());L(a.Ba,c)},'plusEqual');return a}};olympe.C.$.ZERO=new olympe.C.$(0);olympe.C.$.ONE=new olympe.C.$(1);olympe.C.$.Ow=new olympe.C.$(2);olympe.C.$.PI=new olympe.C.$(Math.PI);olympe.C.$.Hu=new olympe.C.$(Infinity);olympe.C.$.Ev=new olympe.C.$(-Infinity);
355
+ olympe.C.$.Bq=new olympe.C.$(NaN);olympe.C.$.LC=olympe.C.$.Uz;olympe.C.$.wA=olympe.C.$.gx;olympe.C.$.zC=olympe.C.$.offset;olympe.C.$.dB=olympe.C.$.Hs;olympe.C.$.WE=olympe.C.$.Hs;olympe.C.$.$B=olympe.C.$.gz;olympe.C.$.eB=olympe.C.$.Nx;olympe.C.$.MA=olympe.C.$.Cx;olympe.C.$.xA=olympe.C.$.animate;olympe.C.$.yA=olympe.C.$.sx;olympe.C.$.eE=olympe.C.$.Xc;olympe.C.$.fE=olympe.C.$.Qj;olympe.C.$.KC=olympe.C.$.ge;olympe.C.$.nC=olympe.C.$.uh;olympe.C.$.fB=olympe.C.$.vj;
356
+ olympe.C.$.mp={uq:function(a,b,c,d){return c*a/d+b},zB:function(a,b,c,d){a/=d;return c*a*a+b},JB:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},vB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a+b;a--;return-c/2*(a*(a-2)-1)+b},oB:function(a,b,c,d){a/=d;return c*a*a*a+b},FB:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},tB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a+b;a-=2;return c/2*(a*a*a+2)+b},AB:function(a,b,c,d){a/=d;return c*a*a*a*a+b},KB:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
357
+ wB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a+b;a-=2;return-c/2*(a*a*a*a-2)+b},BB:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},LB:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},xB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a*a+b;a-=2;return c/2*(a*a*a*a*a+2)+b},CB:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},MB:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},yB:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},rB:function(a,b,c,d){return c*Math.pow(2,
358
+ 10*(a/d-1))+b},IB:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},uB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*Math.pow(2,10*(a-1))+b;a--;return c/2*(-Math.pow(2,-10*a)+2)+b},nB:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},EB:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},sB:function(a,b,c,d){a/=d/2;if(1>a)return-c/2*(Math.sqrt(1-a*a)-1)+b;a-=2;return c/2*(Math.sqrt(1-a*a)+1)+b},iB:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},jB:function(a,b,c,d){d=(a/=d)*a;return b+
359
+ c*(2*d*d+2*d*a+-3*d)},kB:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},lB:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},HB:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(33*e*d+-106*d*d+126*e+-67*d+15*a)},GB:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(56*e*d+-175*d*d+200*e+-100*d+20*a)},qB:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},pB:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},DB:function(a,
360
+ b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},mB:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};m=olympe.C.$.prototype;m.toJSON.K=olympe.C.J.j;m.ho.K=olympe.C.J.j;m.isNaN.K=olympe.C.J.N;m.Xc.K=olympe.C.J.D;
361
+ m.toString.K=new olympe.C.J(()=>String,[]);m.toFixed.K=new olympe.C.J(()=>String,[]);m.ge.K=new olympe.C.J(()=>olympe.C.$,[0]);m.uh.K=new olympe.C.J(()=>olympe.C.$,[0]);m.round.K=olympe.C.J.F;m.Qj.K=olympe.C.J.F;m.sl.K=new olympe.C.J(()=>olympe.C.$,[0]);m.vj.K=new olympe.C.J(()=>olympe.C.$,[0]);m.yz.K=new olympe.C.J(()=>olympe.C.$,[0]);m.floor.K=olympe.C.J.F;m.ceil.K=olympe.C.J.F;m.trunc.K=olympe.C.J.F;m.log.K=olympe.C.J.F;m.pow.K=new olympe.C.J(()=>olympe.C.$,[0]);m.exp.K=olympe.C.J.F;
362
+ m.Jd.K=new olympe.C.J(()=>olympe.C.da,[0]);m.Ea.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.Ly.K=olympe.C.J.j;m.Sn.K=new olympe.C.J(()=>olympe.C.da,[0]);m.cA.K=new olympe.C.J(()=>olympe.C.$,[0]);m.st.K=new olympe.C.J(()=>olympe.C.$,[0]);m.oz.K=new olympe.C.J(()=>olympe.C.da,[0]);m.sin.K=olympe.C.J.F;m.cos.K=olympe.C.J.F;m.atan2.K=new olympe.C.J(()=>olympe.C.$,[0]);m.abs.K=olympe.C.J.F;m.Ij.K=new olympe.C.J(()=>olympe.C.$,[0,1]);olympe.C.Sa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.xb(b.value)}Es(a){return olympe.C.Sa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.C.sa([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.C.xb(d)},olympe.C.Sa,'OString.concat')}Xc(){return this}pA(a){return olympe.C.qa(parseInt(this.value,
363
+ a))}zt(){return olympe.C.qa(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Ea(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Jd(a){return olympe.C.sa([this,a],(b,c)=>olympe.C.Rb(c&&b.valueOf()===c.valueOf()),olympe.C.da,'OString.oEquals')}nf(){return olympe.C.Rb(!this.value||0===this.value.length)}contains(a){return olympe.C.sa([this,a],(b,c)=>olympe.C.Rb((c instanceof olympe.C.Sa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
364
+ olympe.C.da,'OString.contains')}startsWith(a,b){return olympe.C.sa([this,a,b||0],(c,d,e)=>olympe.C.Rb(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.C.da,'OString.startsWith')}endsWith(a,b){return olympe.C.sa([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Jn().valueOf()+e.valueOf()+1;return olympe.C.Rb(c.valueOf().endsWith(d.valueOf(),e))},olympe.C.da,'OString.endsWith')}indexOf(a,b){return olympe.C.sa([this,a,b||0],(c,d,e)=>olympe.C.qa(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
365
+ olympe.C.$,'OString.indexOf')}lastIndexOf(a,b){return olympe.C.sa([this,a,b||Infinity],(c,d,e)=>olympe.C.qa(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.C.$,'OString.lastIndexOf')}slice(a,b){return olympe.C.sa([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.C.Sa,'OString.slice')}Jn(){return olympe.C.qa(this.value.length)}threshold(a){return olympe.C.sa([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.C.Sa.EMPTY,olympe.C.Sa,'OString.threshold')}toLowerCase(){return olympe.C.xb(this.value.toLowerCase())}toUpperCase(){return olympe.C.xb(this.value.toUpperCase())}trim(){return olympe.C.xb(this.value.trim())}padStart(a,
366
+ b){return olympe.C.sa([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.padStart')}padEnd(a,b){return olympe.C.sa([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.padEnd')}replace(a,b){return olympe.C.sa([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.replace')}lA(a,b){return olympe.C.sa([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().substr(d.valueOf(),
367
+ e.valueOf())),olympe.C.Sa,'OString.subOStr')}static concat(...a){return olympe.C.xb('').concat(...a)}};olympe.C.Sa.EMPTY=new olympe.C.Sa('');olympe.C.Sa.zw=new olympe.C.Sa(' ');m=olympe.C.Sa.prototype;m.toJSON.K=olympe.C.J.j;m.Es.K=new olympe.C.J(()=>olympe.C.Sa,[0,1]);m.concat.K=olympe.C.J.D;m.Xc.K=olympe.C.J.D;m.pA.K=olympe.C.J.F;m.zt.K=olympe.C.J.F;m.toString.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;m.Jd.K=new olympe.C.J(()=>olympe.C.da,[0]);m.nf.K=olympe.C.J.N;
368
+ m.contains.K=new olympe.C.J(()=>olympe.C.da,[0]);m.startsWith.K=new olympe.C.J(()=>olympe.C.da,[0,1]);m.endsWith.K=new olympe.C.J(()=>olympe.C.da,[0,1]);m.indexOf.K=new olympe.C.J(()=>olympe.C.$,[0,1]);m.lastIndexOf.K=new olympe.C.J(()=>olympe.C.$,[0,1]);m.slice.K=new olympe.C.J(()=>olympe.C.Sa,[0,1]);m.Jn.K=olympe.C.J.F;m.threshold.K=new olympe.C.J(()=>olympe.C.Sa,[0]);m.toLowerCase.K=olympe.C.J.D;m.toUpperCase.K=olympe.C.J.D;m.trim.K=olympe.C.J.D;m.padStart.K=olympe.C.J.D;m.padEnd.K=olympe.C.J.D;
369
+ m.replace.K=olympe.C.J.D;m.lA.K=olympe.C.J.D;olympe.C.da=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.C.da.D:olympe.C.da.j}and(a){if(void 0!==a)return olympe.C.gb(a)?olympe.C.ye([a],b=>new olympe.C.da(this.valueOf()&&b.valueOf()),olympe.C.da,'and'):this.value&&a.valueOf()?olympe.C.da.D:olympe.C.da.j}Ea(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Jd(a){if(void 0!==a)return olympe.C.gb(a)?
370
+ olympe.C.ye([a],b=>new olympe.C.da(this.valueOf()===b.valueOf()),olympe.C.da,'oEquals'):this.Ea(a)?olympe.C.da.D:olympe.C.da.j}zd(){return this.value?olympe.C.da.j:olympe.C.da.D}qx(a){if(void 0!==a)return olympe.C.gb(a)?olympe.C.ye([a],b=>new olympe.C.da(!(this.valueOf()&&b.valueOf())),olympe.C.da,'andNot'):this.value&&!a.valueOf()?olympe.C.da.D:olympe.C.da.j}or(a){if(void 0!==a)return olympe.C.gb(a)?olympe.C.ye([a],b=>new olympe.C.da(this.valueOf()||b.valueOf()),olympe.C.da,'or'):this.value||a.valueOf()?
371
+ olympe.C.da.D:olympe.C.da.j}xor(a){return olympe.C.sa([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.C.Rb(b&&!c||!b&&c)},olympe.C.da,'OBoolean.xor')}ay(){return this.value}Ws(){return!0===this.value?olympe.C.$.ONE:olympe.C.$.ZERO}Xc(){return olympe.C.xb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.C.da.D=new olympe.C.da(!0);olympe.C.da.j=new olympe.C.da(!1);m=olympe.C.da.prototype;m.toJSON.K=olympe.C.J.j;
372
+ m.and.K=new olympe.C.J(()=>olympe.C.da,[0]);m.Ea.K=olympe.C.J.j;m.Jd.K=new olympe.C.J(()=>olympe.C.da,[0]);m.zd.K=olympe.C.J.N;m.qx.K=new olympe.C.J(()=>olympe.C.da,[0]);m.or.K=new olympe.C.J(()=>olympe.C.da,[0]);m.xor.K=new olympe.C.J(()=>olympe.C.da,[0]);m.ay.K=new olympe.C.J(()=>Boolean,[]);m.Ws.K=olympe.C.J.F;m.Xc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;function nc(a){return new olympe.C.eb(new Date(a))}
373
+ olympe.C.eb=class{constructor(a){this.sb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.sb.toJSON()+'" }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.C.eb(new Date(b.value.valueOf()))}static now(){return new olympe.C.eb(new Date)}mq(){return this.sb&&!isNaN(this.sb.getTime())?olympe.C.da.D:olympe.C.da.j}Ou(){return olympe.C.qa(this.sb.getMilliseconds())}Qu(){return olympe.C.qa(this.sb.getSeconds())}Pu(){return olympe.C.qa(this.sb.getMinutes())}Nu(){return olympe.C.qa(this.sb.getHours())}qy(){return olympe.C.qa(this.sb.getDate())}getMonth(){return olympe.C.qa(this.sb.getMonth()+1)}Ru(){return olympe.C.qa(this.sb.getFullYear())}getTime(){return this.sb.getTime()}iA(){var a=
374
+ olympe.C,b=a.xb;var c=this.sb.getDate();c=10>c?'0'+c:c;var d=this.sb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.sb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.sb.toLocaleString(a)):olympe.C.sa([this,a],(b,c)=>olympe.C.xb(b.sb.toLocaleString(c.valueOf())),olympe.C.Sa)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.sb.toLocaleDateString(a)):olympe.C.sa([this,a],(b,c)=>olympe.C.xb(b.sb.toLocaleDateString(c.valueOf())),
375
+ olympe.C.Sa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.sb.toLocaleTimeString(a)):olympe.C.sa([this,a],(b,c)=>olympe.C.xb(b.sb.toLocaleTimeString(c.valueOf())),olympe.C.Sa)}Xc(){return olympe.C.xb(this.sb.toISOString())}mA(){return new Date(this.getTime())}oA(){return this}qA(){return this}qg(a,b){return olympe.C.sa([b],c=>{const d=new olympe.C.eb(new Date(this.sb.getTime()));d.sb['set'+a](this.sb['get'+a]()+c.valueOf());return d},olympe.C.eb)}ix(a){return this.qg('Milliseconds',
376
+ a)}nx(a){return this.qg('Seconds',a)}jx(a){return this.qg('Minutes',a)}hx(a){return this.qg('Hours',a)}pn(a){return this.qg('Date',a)}ox(a){return'number'===typeof a?this.pn(7*a):this.pn(a.sl(7))}kx(a){return this.qg('Month',a)}px(a){return this.qg('FullYear',a)}jA(){let a=this.sb.getDay();a=0===a?6:a-1;return new olympe.C.eb(new Date(this.sb.getFullYear(),this.sb.getMonth(),this.sb.getDate()-a))}kA(){return new olympe.C.eb(new Date(this.sb.getFullYear(),this.sb.getMonth()))}Jd(a){return olympe.C.sa([a],
377
+ b=>olympe.C.Rb(this.Ea(b)),olympe.C.da)}Ea(a){return a instanceof olympe.C.eb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Dy(){let a=this.sb.getDay();0===a&&(a=7);return olympe.C.qa(a)}vy(a,b){return olympe.C.sa([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.sb.getFullYear()-c.sb.getFullYear():'months'===d?c=12*(this.sb.getFullYear()-c.sb.getFullYear())+(this.sb.getMonth()-c.sb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
378
+ void 0===d&&(olympe.ga.Wa('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.sb.getTime()-c.sb.getTime())/d));return olympe.C.qa(c)},olympe.C.$)}jz(a){return olympe.C.sa([a],b=>olympe.C.Rb(this.getTime()<b.getTime()),olympe.C.da)}hz(a){return olympe.C.sa([a],b=>olympe.C.Rb(this.getTime()>b.getTime()),olympe.C.da)}kz(a,b){return olympe.C.sa([a,b],(c,d)=>olympe.C.Rb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.C.da)}valueOf(){return this.mq().valueOf()?
379
+ new Date(this.getTime()):new Date(0)}};olympe.C.eb.j=nc(0);olympe.C.eb.D=nc(Number.NaN);m=olympe.C.eb.prototype;m.mq.K=olympe.C.J.N;m.Ou.K=olympe.C.J.F;m.Qu.K=olympe.C.J.F;m.Pu.K=olympe.C.J.F;m.Nu.K=olympe.C.J.F;m.qy.K=olympe.C.J.F;m.getMonth.K=olympe.C.J.F;m.Ru.K=olympe.C.J.F;m.getTime.K=olympe.C.J.j;m.iA.K=new olympe.C.J(()=>olympe.C.Sa,[0]);m.toLocaleString.K=olympe.C.J.D;m.toLocaleDateString.K=olympe.C.J.D;m.toLocaleTimeString.K=olympe.C.J.D;m.Xc.K=olympe.C.J.D;m.mA.K=olympe.C.J.j;
380
+ m.oA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.qA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.qg.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ix.K=new olympe.C.J(()=>olympe.C.eb,[]);m.nx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.jx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.hx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.pn.K=new olympe.C.J(()=>olympe.C.eb,[0]);m.ox.K=new olympe.C.J(()=>olympe.C.eb,[]);m.kx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.px.K=new olympe.C.J(()=>olympe.C.eb,[0]);
381
+ m.jA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.kA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Jd.K=olympe.C.J.N;m.Ea.K=olympe.C.J.j;m.Dy.K=olympe.C.J.F;m.vy.K=new olympe.C.J(()=>olympe.C.$,[0,1]);m.jz.K=new olympe.C.J(()=>olympe.C.da,[0]);m.hz.K=new olympe.C.J(()=>olympe.C.da,[0]);m.kz.K=new olympe.C.J(()=>olympe.C.da,[0,1]);m.valueOf.K=olympe.C.J.j;const oc=new Map,pc=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,qc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function rc(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=qc.exec(c)):(d=1,c=pc.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.C.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.C.pf(a)?olympe.C.ye([a],b,olympe.C.Color):b(a)}
382
382
  olympe.C.Color=class{constructor(a,b,c,d){this.j=olympe.C.qa(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.D=olympe.C.qa(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.C.qa(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.C.qa(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return{r:this.j.valueOf(),g:this.D.valueOf(),b:this.b.valueOf(),a:this.a.valueOf()}}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.Color.create(b.r,
383
- b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.C.ta([a,b,c,d],(e,f,g,h)=>{e=olympe.C.qa(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.C.qa(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.C.qa(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.C.qa(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of oc.values())if(k&&k.j.Ea(e)&&k.D.Ea(f)&&k.b.Ea(g)&&k.a.Ea(h))return k;return new olympe.C.Color(e,f,g,h)},olympe.C.Color)}oh(){return this.j}hh(){return this.b}lh(){return this.D}gh(){return this.a}ux(a,
384
- b){return olympe.C.Color.create(this.j.Ij(a.oh(),b),this.D.Ij(a.lh(),b),this.b.Ij(a.hh(),b),this.a.Ij(a.gh(),b))}Tx(a){return olympe.C.Color.create(this.j,this.D,this.b,a)}At(){return`rgba(${this.j},${this.D},${this.b},${this.a})`}co(){const a=(16777216|this.b|this.D<<8|this.j<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);return'#'+(a+b).toUpperCase()}toString(){return this.co()}Ea(a){return a instanceof olympe.C.Color?this.j.valueOf()===a.j.valueOf()&&
385
- this.D.valueOf()===a.D.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}compare(a){const b=(this.oh().valueOf()<<16|this.lh().valueOf()<<8|this.hh().valueOf())-(a.oh().valueOf()<<16|a.lh().valueOf()<<8|a.hh().valueOf());return 0===b?this.gh().valueOf()-a.gh().valueOf():b}};olympe.C.Color.prototype.equals=olympe.C.Color.prototype.Ea;olympe.C.Color.prototype.toHexString=olympe.C.Color.prototype.co;olympe.C.Color.prototype.toRGBString=olympe.C.Color.prototype.At;
386
- olympe.C.Color.prototype.getAlpha=olympe.C.Color.prototype.gh;olympe.C.Color.prototype.getGreen=olympe.C.Color.prototype.lh;olympe.C.Color.prototype.getBlue=olympe.C.Color.prototype.hh;olympe.C.Color.prototype.getRed=olympe.C.Color.prototype.oh;olympe.C.Color.create=olympe.C.Color.create;m=olympe.C.Color.prototype;m.toJSON.K=olympe.C.J.j;m.oh.K=olympe.C.J.F;m.hh.K=olympe.C.J.F;m.lh.K=olympe.C.J.F;m.gh.K=olympe.C.J.F;m.ux.K=new olympe.C.J(()=>olympe.C.Color,[]);
387
- m.Tx.K=new olympe.C.J(()=>olympe.C.Color,[]);m.At.K=new olympe.C.J(()=>String,[]);m.co.K=new olympe.C.J(()=>String,[]);m.Ea.K=olympe.C.J.j;m.compare.K=olympe.C.J.j;olympe.C.File=class{ka(){}mq(){}nq(){}Us(){}gl(){}Cn(){}hl(){}rename(){}};olympe.C.Zb=class{constructor(a,b){this.x=olympe.C.fe(a);this.y=olympe.C.fe(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.C.Qa(this.x).valueOf())+', "y": '+JSON.stringify(olympe.C.Qa(this.y).valueOf())+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.C.Zb(b.x,b.y)}Ru(){return this.x}fA(a){kc(this.x,a)}Su(){return this.y}gA(a){kc(this.y,a)}Vy(){return this.x.st(this.y)}ge(a){return olympe.C.ta([this,a],(b,c)=>new olympe.C.Zb(b.x.ge(c.x),b.y.ge(c.y)),
388
- olympe.C.Zb,'Vector2.plus')}uh(a){return olympe.C.ta([this,a],(b,c)=>new olympe.C.Zb(b.x.uh(c.x),b.y.uh(c.y)),olympe.C.Zb,'Vector2.minus')}zz(a){return new olympe.C.Zb(this.x.rl(a),this.y.rl(a))}Ox(a){return new olympe.C.Zb(this.x.vj(a),this.y.vj(a))}Bz(){return new olympe.C.Zb(this.x.Qj(),this.y.Qj())}Px(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ta([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.C.qa(d*f+e*g),olympe.C.$),olympe.C.$)}length(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.qa(Math.sqrt(a*
389
- a+b*b)),olympe.C.$)}normalize(){return olympe.C.ta([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.C.Zb(a/c,b/c)},olympe.C.Zb)}floor(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.floor(a),Math.floor(b)),olympe.C.Zb)}ceil(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.ceil(a),Math.ceil(b)),olympe.C.Zb)}round(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.round(a),Math.round(b)),olympe.C.Zb)}kx(a){return new olympe.C.Zb(this.x.ge(a),
390
- this.y.ge(a))}lx(a,b){return new olympe.C.Zb(this.x.ge(a),this.y.ge(b))}Wc(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.wb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.C.Sa)}toString(){return`Vector2[${this.x.Ba.Eb}, ${this.y.Ba.Eb}]`}Ea(a){return this===a?!0:!1}};m=olympe.C.Zb.prototype;m.toJSON.K=olympe.C.J.j;m.Ru.K=olympe.C.J.F;m.fA.K=olympe.C.J.j;m.Su.K=olympe.C.J.F;m.gA.K=olympe.C.J.j;m.Vy.K=olympe.C.J.F;m.ge.K=new olympe.C.J(()=>olympe.C.Zb,[0]);
391
- m.uh.K=new olympe.C.J(()=>olympe.C.Zb,[0]);m.zz.K=olympe.C.J.R;m.Ox.K=olympe.C.J.R;m.Bz.K=olympe.C.J.R;m.Px.K=new olympe.C.J(()=>olympe.C.$,[0]);m.length.K=olympe.C.J.F;m.normalize.K=olympe.C.J.R;m.floor.K=olympe.C.J.R;m.ceil.K=olympe.C.J.R;m.round.K=olympe.C.J.R;m.kx.K=olympe.C.J.R;m.lx.K=olympe.C.J.R;m.Wc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;olympe.C.Ig=class{constructor(){}Mb(){}Qd(){}get(){}oi(){}has(){}rh(){}Ic(){}Rf(){}Bf(){}wg(){}forEach(){}oe(){}};olympe.C.Ig.prototype.forEachCurrentValue=olympe.C.Ig.prototype.oe;olympe.C.Ig.prototype.forEach=olympe.C.Ig.prototype.forEach;m=olympe.C.Ig.prototype;m.has.K=olympe.C.J.N;m.rh.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>Object,[]);m.Rf.K=new olympe.C.J(()=>String,[]);m.Bf.K=olympe.C.J.F;m.wg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.oe.K=olympe.C.J.j;olympe.C.ud=class extends olympe.C.Ig{Hd(){}Qf(){}mf(){}Pf(){}pe(){}lf(){}wj(){}si(){}};olympe.C.ud.prototype.getCurrentAt=olympe.C.ud.prototype.lf;olympe.C.ud.prototype.getAt=olympe.C.ud.prototype.pe;olympe.C.ud.prototype.getCurrentKeyAt=olympe.C.ud.prototype.Pf;olympe.C.ud.prototype.getKeyAt=olympe.C.ud.prototype.mf;olympe.C.ud.prototype.getCurrentRank=olympe.C.ud.prototype.Qf;olympe.C.ud.prototype.getRank=olympe.C.ud.prototype.Hd;m=olympe.C.ud.prototype;m.Hd.K=olympe.C.J.F;m.Qf.K=olympe.C.J.j;
392
- m.mf.K=new olympe.C.J(()=>String,[]);m.Pf.K=olympe.C.J.j;m.pe.K=new olympe.C.J(()=>Object,[]);m.lf.K=olympe.C.J.j;m.wj.K=olympe.C.J.j;m.si.K=new olympe.C.J(()=>Array,[]);olympe.C.Ci=class{constructor(a,b){this.H=b||olympe.C.Za();this.valueType=a||Object;this.values={};this.Wa=this.ia=null;this.Pe=0;this.R=Object.create(null);this.nb=Object.create(null);this.size=0;this.F=null;this.H.onDestroy(()=>{const c=this.R;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,l=0;l<k;l++)g[h[l]].destroy()}}})}getContext(){return this.H}Mb(){return this.valueType}Qd(a){this.valueType=a;const b=this.ia;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
393
- c)&&gc(b[c],a)}get(a){const b=c=>{null===this.ia&&(this.ia={});return this.Bj(this.ia,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.C.ta([a],c=>b(c),this.valueType)}oi(a){a=this.values[a];return olympe.C.gb(a)?Sb(a.Ba)?a.Ba.Eb:void 0:a}has(a){const b=c=>{null===this.Wa&&(this.Wa={});return this.Bj(this.Wa,c,c in this.values?olympe.C.ba.D:olympe.C.ba.j,olympe.C.ba,'Map.has('+c+')')};return olympe.C.ta([a],c=>b(c),olympe.C.ba)}rh(a){return a in this.values}Bj(a,b,c,d,e){let f=a[b];
394
- f||this.H.run(()=>{f=olympe.C.Wd(d,void 0,e);a[b]=f;f.Ba.onDestroy(()=>delete a[b]);olympe.C.gb(c)?jc(f,c):hc(f,c)});return f}Ic(){throw Error('Abstract method getFirstKey needs to be overridden');}Rf(){throw Error('Abstract method getFirstKey needs to be overridden');}Bf(){null===this.F&&this.H.run(()=>{this.F=olympe.C.Wd(olympe.C.$,olympe.C.qa(this.size));this.F.Ba.onDestroy(()=>{this.F=null})});return this.F}wg(){return this.size}forEach(a,b){const c=this.gn();a=this.ws(c,a,b);this.fn(c,a)}gn(){return String(++this.Pe)}fn(a,
395
- b){this.nb[a]=b;olympe.C.Za().Xd(()=>{const c=this.R;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.nb[a]});this.oe(b)}ws(a,b,c){const d=olympe.C.Za();return(e,f)=>{d.run(()=>{const g=olympe.C.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.kn(a,f,g)})}}kn(a,b,c){void 0===this.R[b]&&(this.R[b]={});this.R[b][a]=c}oe(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
396
- a(b[c],c,this))break}al(a,b){void 0!==this.values[a]&&this.pj(a,!0);this.values[a]=b;var c=this.ia;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.C.Proxy?jc(c[a],b):hc(c[a],b));c=this.Wa;null!==c&&void 0!==c[a]&&kc(c[a],!0);this.size++;c=this.nb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}pj(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.fh?d.Ba.Eb:d;var e=this.ia;null!==e&&void 0!==e[a]&&ic(e[a]);e=this.Wa;null!==e&&void 0!==
397
- e[a]&&kc(e[a],!1);delete c[a];this.size--;b||this.Mf()}a=this.R[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Mf(){null!==this.F&&kc(this.F,this.size)}fi(){var a=this.ia;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&ic(a[c]);a=this.Wa;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&kc(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];for(const c in this.R)if(Object.prototype.hasOwnProperty.call(this.R,
383
+ b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.C.sa([a,b,c,d],(e,f,g,h)=>{e=olympe.C.qa(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.C.qa(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.C.qa(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.C.qa(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of oc.values())if(k&&k.j.Ea(e)&&k.D.Ea(f)&&k.b.Ea(g)&&k.a.Ea(h))return k;return new olympe.C.Color(e,f,g,h)},olympe.C.Color)}oh(){return this.j}hh(){return this.b}lh(){return this.D}gh(){return this.a}vx(a,
384
+ b){return olympe.C.Color.create(this.j.Ij(a.oh(),b),this.D.Ij(a.lh(),b),this.b.Ij(a.hh(),b),this.a.Ij(a.gh(),b))}Ux(a){return olympe.C.Color.create(this.j,this.D,this.b,a)}At(){return`rgba(${this.j},${this.D},${this.b},${this.a})`}eo(){const a=(16777216|this.b|this.D<<8|this.j<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);return'#'+(a+b).toUpperCase()}toString(){return this.eo()}Ea(a){return a instanceof olympe.C.Color?this.j.valueOf()===a.j.valueOf()&&
385
+ this.D.valueOf()===a.D.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}compare(a){const b=(this.oh().valueOf()<<16|this.lh().valueOf()<<8|this.hh().valueOf())-(a.oh().valueOf()<<16|a.lh().valueOf()<<8|a.hh().valueOf());return 0===b?this.gh().valueOf()-a.gh().valueOf():b}};olympe.C.Color.prototype.equals=olympe.C.Color.prototype.Ea;olympe.C.Color.prototype.toHexString=olympe.C.Color.prototype.eo;olympe.C.Color.prototype.toRGBString=olympe.C.Color.prototype.At;
386
+ olympe.C.Color.prototype.getAlpha=olympe.C.Color.prototype.gh;olympe.C.Color.prototype.getGreen=olympe.C.Color.prototype.lh;olympe.C.Color.prototype.getBlue=olympe.C.Color.prototype.hh;olympe.C.Color.prototype.getRed=olympe.C.Color.prototype.oh;olympe.C.Color.create=olympe.C.Color.create;m=olympe.C.Color.prototype;m.toJSON.K=olympe.C.J.j;m.oh.K=olympe.C.J.F;m.hh.K=olympe.C.J.F;m.lh.K=olympe.C.J.F;m.gh.K=olympe.C.J.F;m.vx.K=new olympe.C.J(()=>olympe.C.Color,[]);
387
+ m.Ux.K=new olympe.C.J(()=>olympe.C.Color,[]);m.At.K=new olympe.C.J(()=>String,[]);m.eo.K=new olympe.C.J(()=>String,[]);m.Ea.K=olympe.C.J.j;m.compare.K=olympe.C.J.j;olympe.C.File=class{ka(){}nq(){}oq(){}Vs(){}gl(){}Fn(){}hl(){}rename(){}};olympe.C.Zb=class{constructor(a,b){this.x=olympe.C.fe(a);this.y=olympe.C.fe(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.C.Qa(this.x).valueOf())+', "y": '+JSON.stringify(olympe.C.Qa(this.y).valueOf())+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.C.Zb(b.x,b.y)}Su(){return this.x}gA(a){kc(this.x,a)}Tu(){return this.y}hA(a){kc(this.y,a)}Wy(){return this.x.st(this.y)}ge(a){return olympe.C.sa([this,a],(b,c)=>new olympe.C.Zb(b.x.ge(c.x),b.y.ge(c.y)),
388
+ olympe.C.Zb,'Vector2.plus')}uh(a){return olympe.C.sa([this,a],(b,c)=>new olympe.C.Zb(b.x.uh(c.x),b.y.uh(c.y)),olympe.C.Zb,'Vector2.minus')}Az(a){return new olympe.C.Zb(this.x.sl(a),this.y.sl(a))}Px(a){return new olympe.C.Zb(this.x.vj(a),this.y.vj(a))}Cz(){return new olympe.C.Zb(this.x.Qj(),this.y.Qj())}Qx(a){return olympe.C.sa([this,a],(b,c)=>olympe.C.sa([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.C.qa(d*f+e*g),olympe.C.$),olympe.C.$)}length(){return olympe.C.sa([this.x,this.y],(a,b)=>olympe.C.qa(Math.sqrt(a*
389
+ a+b*b)),olympe.C.$)}normalize(){return olympe.C.sa([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.C.Zb(a/c,b/c)},olympe.C.Zb)}floor(){return olympe.C.sa([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.floor(a),Math.floor(b)),olympe.C.Zb)}ceil(){return olympe.C.sa([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.ceil(a),Math.ceil(b)),olympe.C.Zb)}round(){return olympe.C.sa([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.round(a),Math.round(b)),olympe.C.Zb)}lx(a){return new olympe.C.Zb(this.x.ge(a),
390
+ this.y.ge(a))}mx(a,b){return new olympe.C.Zb(this.x.ge(a),this.y.ge(b))}Xc(){return olympe.C.sa([this.x,this.y],(a,b)=>olympe.C.xb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.C.Sa)}toString(){return`Vector2[${this.x.Ba.Eb}, ${this.y.Ba.Eb}]`}Ea(a){return this===a?!0:!1}};m=olympe.C.Zb.prototype;m.toJSON.K=olympe.C.J.j;m.Su.K=olympe.C.J.F;m.gA.K=olympe.C.J.j;m.Tu.K=olympe.C.J.F;m.hA.K=olympe.C.J.j;m.Wy.K=olympe.C.J.F;m.ge.K=new olympe.C.J(()=>olympe.C.Zb,[0]);
391
+ m.uh.K=new olympe.C.J(()=>olympe.C.Zb,[0]);m.Az.K=olympe.C.J.R;m.Px.K=olympe.C.J.R;m.Cz.K=olympe.C.J.R;m.Qx.K=new olympe.C.J(()=>olympe.C.$,[0]);m.length.K=olympe.C.J.F;m.normalize.K=olympe.C.J.R;m.floor.K=olympe.C.J.R;m.ceil.K=olympe.C.J.R;m.round.K=olympe.C.J.R;m.lx.K=olympe.C.J.R;m.mx.K=olympe.C.J.R;m.Xc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;olympe.C.Ig=class{constructor(){}Mb(){}Qd(){}get(){}oi(){}has(){}rh(){}Jc(){}Tf(){}Cf(){}wg(){}forEach(){}oe(){}};olympe.C.Ig.prototype.forEachCurrentValue=olympe.C.Ig.prototype.oe;olympe.C.Ig.prototype.forEach=olympe.C.Ig.prototype.forEach;m=olympe.C.Ig.prototype;m.has.K=olympe.C.J.N;m.rh.K=olympe.C.J.j;m.Jc.K=new olympe.C.J(()=>Object,[]);m.Tf.K=new olympe.C.J(()=>String,[]);m.Cf.K=olympe.C.J.F;m.wg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.oe.K=olympe.C.J.j;olympe.C.vd=class extends olympe.C.Ig{Hd(){}Sf(){}mf(){}Rf(){}qe(){}lf(){}wj(){}si(){}};olympe.C.vd.prototype.getCurrentAt=olympe.C.vd.prototype.lf;olympe.C.vd.prototype.getAt=olympe.C.vd.prototype.qe;olympe.C.vd.prototype.getCurrentKeyAt=olympe.C.vd.prototype.Rf;olympe.C.vd.prototype.getKeyAt=olympe.C.vd.prototype.mf;olympe.C.vd.prototype.getCurrentRank=olympe.C.vd.prototype.Sf;olympe.C.vd.prototype.getRank=olympe.C.vd.prototype.Hd;m=olympe.C.vd.prototype;m.Hd.K=olympe.C.J.F;m.Sf.K=olympe.C.J.j;
392
+ m.mf.K=new olympe.C.J(()=>String,[]);m.Rf.K=olympe.C.J.j;m.qe.K=new olympe.C.J(()=>Object,[]);m.lf.K=olympe.C.J.j;m.wj.K=olympe.C.J.j;m.si.K=new olympe.C.J(()=>Array,[]);olympe.C.Ci=class{constructor(a,b){this.H=b||olympe.C.Za();this.valueType=a||Object;this.values={};this.Ua=this.ia=null;this.Qe=0;this.R=Object.create(null);this.lb=Object.create(null);this.size=0;this.F=null;this.H.onDestroy(()=>{const c=this.R;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,l=0;l<k;l++)g[h[l]].destroy()}}})}getContext(){return this.H}Mb(){return this.valueType}Qd(a){this.valueType=a;const b=this.ia;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
393
+ c)&&gc(b[c],a)}get(a){const b=c=>{null===this.ia&&(this.ia={});return this.Bj(this.ia,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.C.sa([a],c=>b(c),this.valueType)}oi(a){a=this.values[a];return olympe.C.gb(a)?Sb(a.Ba)?a.Ba.Eb:void 0:a}has(a){const b=c=>{null===this.Ua&&(this.Ua={});return this.Bj(this.Ua,c,c in this.values?olympe.C.da.D:olympe.C.da.j,olympe.C.da,'Map.has('+c+')')};return olympe.C.sa([a],c=>b(c),olympe.C.da)}rh(a){return a in this.values}Bj(a,b,c,d,e){let f=a[b];
394
+ f||this.H.run(()=>{f=olympe.C.Wd(d,void 0,e);a[b]=f;f.Ba.onDestroy(()=>delete a[b]);olympe.C.gb(c)?jc(f,c):hc(f,c)});return f}Jc(){throw Error('Abstract method getFirstKey needs to be overridden');}Tf(){throw Error('Abstract method getFirstKey needs to be overridden');}Cf(){null===this.F&&this.H.run(()=>{this.F=olympe.C.Wd(olympe.C.$,olympe.C.qa(this.size));this.F.Ba.onDestroy(()=>{this.F=null})});return this.F}wg(){return this.size}forEach(a,b){const c=this.kn();a=this.xs(c,a,b);this.jn(c,a)}kn(){return String(++this.Qe)}jn(a,
395
+ b){this.lb[a]=b;olympe.C.Za().Xd(()=>{const c=this.R;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.lb[a]});this.oe(b)}xs(a,b,c){const d=olympe.C.Za();return(e,f)=>{d.run(()=>{const g=olympe.C.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.nn(a,f,g)})}}nn(a,b,c){void 0===this.R[b]&&(this.R[b]={});this.R[b][a]=c}oe(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
396
+ a(b[c],c,this))break}al(a,b){void 0!==this.values[a]&&this.pj(a,!0);this.values[a]=b;var c=this.ia;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.C.Proxy?jc(c[a],b):hc(c[a],b));c=this.Ua;null!==c&&void 0!==c[a]&&kc(c[a],!0);this.size++;c=this.lb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}pj(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.fh?d.Ba.Eb:d;var e=this.ia;null!==e&&void 0!==e[a]&&ic(e[a]);e=this.Ua;null!==e&&void 0!==
397
+ e[a]&&kc(e[a],!1);delete c[a];this.size--;b||this.Nf()}a=this.R[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Nf(){null!==this.F&&kc(this.F,this.size)}fi(){var a=this.ia;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&ic(a[c]);a=this.Ua;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&kc(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];for(const c in this.R)if(Object.prototype.hasOwnProperty.call(this.R,
398
398
  c)){b=this.R[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.F&&kc(this.F,this.size)}Lg(){const a=this.values;let b='\n';for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=a[c]+'\n');return b}};olympe.C.Ci.ya=[olympe.C.Ig];m=olympe.C.Ci.prototype;m.getContext.K=olympe.C.J.j;m.Mb.K=olympe.C.J.j;m.Qd.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>Object,[],'valueType');m.oi.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.rh.K=olympe.C.J.j;m.Bj.K=olympe.C.J.j;
399
- m.Bf.K=olympe.C.J.F;m.wg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.gn.K=olympe.C.J.j;m.fn.K=olympe.C.J.j;m.ws.K=olympe.C.J.j;m.kn.K=olympe.C.J.j;m.oe.K=olympe.C.J.j;m.al.K=olympe.C.J.j;m.pj.K=olympe.C.J.j;m.Mf.K=olympe.C.J.j;m.fi.K=olympe.C.J.j;m.Lg.K=olympe.C.J.j;olympe.C.Tj=class extends olympe.C.Ci{constructor(a,b){super(a,b);this.D=Object.create(null);this.j=[];this.da=this.sa=this.Ha=this.Z=null}Qd(a){super.Qd(a);if(null!==this.da)for(let b of this.da.values())gc(b,a)}Ic(){return this.pe(0)}Rf(){return this.mf(0)}Hd(a){const b=c=>{null===this.Ha&&(this.Ha=Object.create(null));let d=this.Qf(a);d=void 0!==d?olympe.C.qa(d):void 0;return this.Bj(this.Ha,c,d,olympe.C.$,`List.getRank(${c})`)};return olympe.C.gb(a)?M(olympe.C.createNode(olympe.C.$,b,null,[a.Ba],
400
- [0],'onResolved('+(b.name||'')+')')):b(a)}Qf(a){return this.D[a]}mf(a){const b=c=>{const d=c.valueOf(),e=this.Pf(d);null===this.sa&&(this.sa=Object.create(null));return this.Bj(this.sa,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.C.ta([a],c=>b(c),String)}Pf(a){return this.j[a.valueOf()]}pe(a){if(olympe.C.gb(a))return this.get(olympe.C.ta([a],c=>{c=this.mf(c);if(!Sb(c.Ba)){const d=olympe.C.Za();olympe.C.Uf(d)&&bc(d)}return c},String));null===this.da&&(this.da=new Map);let b=this.da.get(a);
401
- b||this.H.run(()=>{b=this.get(this.mf(a));this.da.set(a,b);b.Ba.onDestroy(()=>this.da.delete(a))});return b}lf(a){return this.oi(this.Pf(a))}wj(a,b,c,d){let e=this.gn();a=this.jt(e,a,b,c,d);this.fn(e,a)}jt(a,b,c,d,e){return olympe.C.Za().rc((f,g)=>{let h=!1,k=olympe.C.zi([b,c,this.Hd(g)],(l,n,p)=>{p>=l&&p<l+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.kn(a,g,k)})}si(){null===this.Z&&this.H.run(()=>{this.Z=olympe.C.Wd(Array,this.j.filter(a=>void 0!==a));this.Z.Ba.onDestroy(()=>
402
- {this.F=null})});return this.Z}oe(a){if(this.j.length!==this.size)super.oe(a);else{var b=this.values;for(let c of this.j.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}jn(a,b){const c=this.Ha,d=this.sa,e=this.D[a],f=b.valueOf();if(e!==f||this.j[e]!==a){var g=this.j[f];void 0!==g&&delete this.D[g];void 0!==e&&null!==e&&this.j[e]===a&&(this.j[e]=void 0);this.D[a]=f;this.j[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&ic(c[g]),void 0!==c[a]&&hc(c[a],olympe.C.qa(f)));
403
- null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&ic(d[e]),void 0!==d[b]&&hc(d[b],a))}}hn(a){var b=this.sa,c=this.D[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ba.Eb===a&&ic(b));delete this.D[a];this.j.splice(c,1);c=this.Ha;null!==c&&void 0!==c[a]&&ic(c[a])}xs(){if(null!==this.Z){const a=this.j,b=this.Z.Ba.Eb;b&&a.join(',')!==b.join(',')&&hc(this.Z,a)}}Mf(){this.xs();super.Mf()}fi(){var a=this.D;for(b in a)delete a[b];this.j.length=0;a=this.Ha;if(null!==a)for(b in a)ic(a[b]);a=this.sa;
404
- if(null!==a)for(b in a)ic(a[parseInt(b,10)]);var b=this.Z;null!==b&&($b(b.Ba),hc(b,this.j));return olympe.C.Ci.prototype.fi.call(this)}Lg(){const a=this.values,b=this.D;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.C.Tj.ya=[olympe.C.ud];m=olympe.C.Tj.prototype;m.Qd.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>Object,[]);m.Rf.K=new olympe.C.J(()=>String,[]);m.Hd.K=olympe.C.J.F;m.Qf.K=olympe.C.J.j;m.mf.K=new olympe.C.J(()=>String,[]);
405
- m.Pf.K=olympe.C.J.j;m.pe.K=new olympe.C.J(()=>Object,[]);m.lf.K=olympe.C.J.j;m.wj.K=new olympe.C.J(()=>{},[]);m.jt.K=olympe.C.J.j;m.si.K=new olympe.C.J(()=>Array,[]);m.oe.K=olympe.C.J.j;m.jn.K=olympe.C.J.j;m.hn.K=olympe.C.J.j;m.xs.K=olympe.C.J.j;m.Mf.K=olympe.C.J.j;m.fi.K=olympe.C.J.j;m.Lg.K=olympe.C.J.j;olympe.C.Map=class extends olympe.C.Ci{constructor(a){a===olympe.C.Proxy&&(a=Object);super(a);this.j=this.D=null}Qd(a){a===olympe.C.Proxy&&(a=Object);null!==this.D&&gc(this.D,a);super.Qd(a)}Ic(){null===this.D&&this.wn();return this.D}Rf(){null===this.j&&this.wn();return this.j}wn(){this.getContext().run(()=>{this.D=olympe.C.Wd(this.Mb());this.j=olympe.C.Wd(String);this.Oj(this.zn())})}zn(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}Oj(a){if(void 0!==
406
- a){const b=this.values[a];b&&b instanceof olympe.C.Proxy?jc(this.D,b):hc(this.D,b);hc(this.j,a)}else void 0!==this.D.Ba.Eb&&(ic(this.D),ic(this.j))}set(a,b){this.al(a,b);1===this.size&&null!==this.j&&this.Oj(a);this.Mf()}remove(a){const b=this.pj(a);null!==this.j&&this.j.Ba.Eb===a&&this.Oj(this.zn());return b}clear(){this.fi();null!==this.j&&this.Oj()}};m=olympe.C.Map.prototype;m.Qd.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>Object,[]);m.Rf.K=new olympe.C.J(()=>String,[]);m.wn.K=olympe.C.J.j;
407
- m.zn.K=olympe.C.J.j;m.Oj.K=olympe.C.J.j;m.set.K=olympe.C.J.j;m.remove.K=new olympe.C.J(()=>Object,[]);m.clear.K=olympe.C.J.j;olympe.C.Og=class extends olympe.C.Tj{constructor(a){super(a)}set(a,b,c){this.al(a,b);void 0!==c&&olympe.C.Vc([c],d=>{this.jn(a,d)});this.Mf()}remove(a){this.hn(a);return this.pj(a)}clear(){this.fi()}};olympe.C.Og.prototype.remove.K=olympe.C.J.j;olympe.C.Og.prototype.clear.K=olympe.C.J.j;olympe.C.Kt=class extends olympe.C.lk{constructor(a,b){super(olympe.C.$,'animatedFlowSource');this.duration=a;this.j=b||olympe.C.$.lp.tq}tb(){return olympe.C.Dz(this.node,this.duration,this.j,void 0)}};let sc=null;olympe.C.G=void 0;olympe.C.Vn=void 0;olympe.C.ki=void 0;olympe.C.ei=new Map;olympe.C.ei.set(0,olympe.C.$.ZERO);olympe.C.ei.set(1,olympe.C.$.ONE);olympe.C.ei.set(2,olympe.C.$.Nw);olympe.C.$k=new Map;olympe.C.$k.set('',olympe.C.Sa.EMPTY);olympe.C.$k.set(' ',olympe.C.Sa.yw);olympe.C.createNode=function(a,b,c,d,e,f,g,h){return new olympe.C.Node({valueType:a,Lc:b,Xf:c,Mn:d,debug:g,qg:e,$c:f,qj:h})};olympe.C.Uf=function(a){return a instanceof olympe.C.Node};
408
- olympe.C.Wd=function(a,b,c){a=olympe.C.createNode(a,void 0,void 0,void 0,void 0,c);olympe.C.Uf(b)?cc(a,b):olympe.C.gb(b)?cc(a,b.Ba):L(a,b);return M(a)};olympe.C.gb=function(a){return!(!a||!a.fh)};olympe.C.pf=function(a){return!(!a||!(a instanceof olympe.C.Node||a.fh))};olympe.C.Qn=function(a){return a instanceof olympe.C.Wb||a instanceof olympe.C.Fr||a instanceof olympe.C.Node};olympe.C.sh=function(a){return a instanceof olympe.C.lk};
409
- olympe.C.Sn=function(a,b){if(void 0!==a){olympe.C.sh(a)&&(a=a.tb().Ba);if(!olympe.C.pf(a))return b(a);var c=[];olympe.C.gb(a)?c.push(a.Ba):c.push(a);return olympe.C.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.C.Qa=function(a,b){let c=a;olympe.C.gb(a)?c=a.Ba.Eb:olympe.C.Uf(a)?c=a.Eb:olympe.C.sh(a)&&(c=a.tb().Ba.Eb);return void 0===c?b:c};
410
- olympe.C.wh=function(a,b){let c;olympe.C.gb(a)?c=a.Ba:olympe.C.Uf(a)?c=a:olympe.C.sh(a)&&(c=a.tb().Ba);c&&olympe.C.Vc([b],d=>{c.wh(d)},'setDefaultValue');return a};olympe.C.zi=function(a,b,c,d){const e=a.length,f=Array(e),g=[];let h;for(let k=0;k<e;k++)h=a[k],void 0!==h&&null!==h&&(void 0!==h.us?(h=h.Ba,g.push(k)):h instanceof olympe.C.Node?g.push(k):olympe.C.sh(h)&&(h=h.tb().Ba,g.push(k))),f[k]=h;return olympe.C.createNode(c,b,null,f,g,d||'syncNodes')};
411
- olympe.C.xe=function(a,b,c,d){return M(olympe.C.zi(a,b,c,d||'syncProxies'))};const tc=a=>{for(const b of a)if(olympe.C.pf(b)||olympe.C.sh(b))return!1;return!0};olympe.C.ta=function(a,b,c,d,e){if(tc(a))return b(...a);const f=olympe.C.zi(a,b,c,d||'TransformFlows');e&&olympe.C.Vc([e],g=>{f.wh(g)},'setDefaultValue');return M(f)};olympe.C.Vc=function(a,b,c){tc(a)?b(...a):olympe.C.zi(a,b,void 0,c||'processFlows')};
412
- olympe.C.TE=function(a,b,c){const d=olympe.C.Uf(a)?a.Mb():olympe.C.sh(a)?a.tb().di:a.di,e=olympe.C.bc(d,c),f=olympe.U.Promise.uj(g=>{e.getContext().fb()||e.update(g)},b);olympe.C.Vc([a],g=>f(g).then());return e.tb()};olympe.C.nt=function(a,b){if(tc(a))b(...a);else{const c=olympe.C.Za();olympe.C.zi(a,(...d)=>{olympe.C.Za().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
413
- olympe.C.Tn=function(a,b,c){const d=a.length,e=Array(d),f=[];let g;for(let h=0;h<d;h++)g=a[h],void 0!==g&&null!==g&&(olympe.C.gb(g)?(g=g.Ba,f.push(h)):g instanceof olympe.C.Node?f.push(h):olympe.C.sh(g)&&(g=g.tb().Ba,f.push(h))),e[h]=g;0!==f.length&&new olympe.C.Node({Lc:b,Mn:e,qg:f,Vz:!1,$c:c})};olympe.C.ot=function(a,b){const c=olympe.C.Za();olympe.C.Tn(a,(...d)=>{olympe.C.Za().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.C.RE=function(a,b,c){a=new olympe.C.lk(a,c);b(a);return a.tb()};
414
- olympe.C.bc=function(a,b='flowSource'){return new olympe.C.lk(a,b)};olympe.C.yF=function(a,b,c,d){const e=olympe.C.Za();olympe.C.zi(a,(...f)=>{olympe.C.Za().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.C.Gj=function(a,b,c){olympe.C.ta([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.C.dF=function(a,b,c='from observable'){const d=olympe.C.bc(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.tb()};
415
- olympe.C.aF=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.C.CF=function(a){return olympe.C.Za().rc(a)};olympe.C.YE=function(a,b,c){olympe.C.Qx(a?a.Ba:a,b,c)};
416
- olympe.C.Qx=function(a,b,c){if(a){var d=a.T();null===sc&&(sc={});if(sc[d])olympe.C.G.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{sc[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.C.G.warn(e):olympe.C.G.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.C.createNode(null,g=>{void 0===g?olympe.C.G.log(f,'undefined'):null===g?olympe.C.G.log(f,'null'):olympe.C.G.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.C.G.log(`Node #${d} destroyed`+(b?`: ${b}`:
417
- ''))});c.onDestroy(()=>{delete sc[d]})}}else olympe.C.G.log('NOT starting node dump, node is '+String(a))};olympe.C.XE=function(){let a='',b=olympe.C.Za();for(;null!==b;)a+=b.En()+' --\x3e ',b=b.getParent();olympe.C.G.log(a)};
418
- olympe.C.qa=function(a){if(void 0===a)return olympe.C.$.ZERO;if(a instanceof olympe.C.$)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.C.$.Aq;if(a===Math.PI)return olympe.C.$.PI;if(Infinity===a)return olympe.C.$.Gu;if(-Infinity===a)return olympe.C.$.Dv;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.C.ei.has(a)||olympe.C.ei.set(a,new olympe.C.$(a)),olympe.C.ei.get(a)):new olympe.C.$(a)}return null};
419
- olympe.C.fe=function(a){return void 0===a?olympe.C.Wd(olympe.C.$):olympe.C.Wd(olympe.C.$,olympe.C.pf(a)?a:olympe.C.qa(a))};olympe.C.Dz=olympe.C.$.animate;olympe.C.nF=function(a,b){return new olympe.C.Kt(a,b)};olympe.C.wb=function(a){if(a instanceof olympe.C.Sa)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.C.$k.has(a)?olympe.C.$k.get(a):new olympe.C.Sa(a)};
420
- olympe.C.sF=function(a){return void 0===a?olympe.C.Wd(olympe.C.Sa):olympe.C.Wd(olympe.C.Sa,olympe.C.pf(a)?a:olympe.C.wb(a))};olympe.C.Rb=function(a){return a instanceof olympe.C.ba?a:void 0!==a&&null!==a&&a.valueOf()?olympe.C.ba.D:olympe.C.ba.j};olympe.C.pF=function(a){return void 0===a?olympe.C.Wd(olympe.C.ba):olympe.C.Wd(olympe.C.ba,olympe.C.pf(a)?a:olympe.C.Rb(a))};olympe.C.oF=function(a){if(a instanceof Date)return new olympe.C.eb(a)};
421
- olympe.C.rF=function(a){return olympe.C.Wd(olympe.C.eb,void 0!==a?new olympe.C.eb(a):null)};olympe.C.et=a=>a instanceof olympe.C.ba||a instanceof olympe.C.$||a instanceof olympe.C.Sa||a instanceof olympe.C.eb;olympe.C.tF=function(a,b){return olympe.C.Wd(olympe.C.Zb,void 0===a&&void 0===b?void 0:new olympe.C.Zb(a,b))};olympe.C.Pz=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.C.Color?e=a:e=olympe.C.Color.create(a,b,c,d));return olympe.C.Wd(olympe.C.Color,e)};olympe.C.qF=olympe.C.Pz;
422
- olympe.C.Hx=function(a){olympe.C.G=a;olympe.C.ki=olympe.C.kh()};olympe.C.kh=function(){olympe.C.Vn||(olympe.C.Vn=new olympe.C.Fr);return olympe.C.Vn};olympe.C.Za=function(){olympe.C.ki||(olympe.C.ki=olympe.C.kh());return olympe.C.ki};olympe.C.wt=function(a){const b=olympe.C.ki;olympe.C.Qn(a)&&(olympe.C.ki=a);return null!=b?b:null};
423
- olympe.C.Pb=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.C.eb.Pb(a);break;case 'number':b=olympe.C.$.Pb(a);break;case 'string':b=olympe.C.Sa.Pb(a);break;case 'vector2':b=olympe.C.Zb.Pb(a);break;case 'color':b=olympe.C.Color.Pb(a);break;case 'boolean':b=olympe.C.ba.Pb(a)}return b}return null};function uc(a){a.j.fb()||(a.F.forEach(b=>{b.destroy()}),a.F.clear(),a.D.clear(),a.size.clear(),a.N.clear(),a.R.length=0,a.H.length=0)}
424
- olympe.C.oD=class{constructor(){this.j=new olympe.C.Wb('Slot Manager context');this.F=new Map;this.j.run(()=>{this.D=olympe.C.bc(vc,'Last slot manager entry');this.size=lc(olympe.C.bc(olympe.C.$,'SlotManager size').repeat(this.D.tb().Fn()),olympe.C.$.ZERO);this.N=lc(olympe.C.bc(olympe.C.$,'last valid slots'),olympe.C.qa(-1))});this.R=[];this.H=[];this.j.onDestroy(()=>{uc(this)})}};
425
- class vc{constructor(a,b,c,d){this.id=a;this.D=new olympe.C.Wb('Slot manager entry');this.H=c;this.N=d;this.D.run(()=>{const e=lc(olympe.C.bc(olympe.C.$),olympe.C.$.ZERO);olympe.C.gb(b)?e.repeat(b):e.update(b);this.j=olympe.C.bc(olympe.C.$);this.F=this.j.tb().ge(e.tb())});this.next=null}T(){return this.id}Zy(){return this.j.tb()}Fn(){return this.F}Hd(){return this.H}hz(){return this.N}rA(a){this.H=a}eA(a){null===a?this.j.update(olympe.C.$.ZERO):(this.j.repeat(a.Fn()),a.next=this)}Tu(){this.j.clear();
426
- this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=vc.prototype;m.T.K=olympe.C.J.j;m.Zy.K=new olympe.C.J(()=>olympe.C.$);m.Fn.K=new olympe.C.J(()=>olympe.C.$);m.Hd.K=olympe.C.J.j;m.hz.K=olympe.C.J.j;m.rA.K=olympe.C.J.j;m.eA.K=olympe.C.J.j;m.Tu.K=olympe.C.J.j;m.destroy.K=olympe.C.J.j;olympe.C.P={Ca:'df.Logger'};olympe.V.config(a=>{E(a,olympe.C.Config.Bq,Number.POSITIVE_INFINITY);D(a,olympe.C.P.Ca,[olympe.ha.P.Fa],b=>b.ad('df'))},'olympe.df');olympe.V.run([olympe.C.P.Ca],a=>{olympe.C.Hx(a)},'olympe.df');olympe.host={};const wc=new Map,xc=new Map;olympe.host.Iq=class{static register(a,b,...c){wc.set(a,b);0<c.length&&xc.set(a,c)}static create(a,b,c,d){const e=wc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=xc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Sa(d,f))):new e(b,c)}};function yc(a,b,c){a.G.debug('CREATE #',b,', type=',c);a.j.set(b,olympe.host.Iq.create(c,b,a.G,a.H))}function zc(a,b,c,...d){const e=a.j.get(b);if(void 0!==e){a.G.H()<=olympe.ha.xb.j.ag&&a.G.debug('CALL #'+b+', '+c+'('+Array.prototype.slice.call(d,0)+')');b=[];for(const f of d)if(void 0===f||null===f)b.push(f);else if(olympe.C.gb(f))b.push(a.j.get(f.bx)||null);else if('function'===typeof f){const g=f,h=olympe.C.Za();b.push((...k)=>{h.fb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
427
- function Ac(a){var b=olympe.host.Oe.Ed,c=olympe.host.Oe.Hq.ls;++a.F;const d=a.F;yc(a,d,c);const e=olympe.C.createNode(b,void 0,void 0,void 0,void 0,'Native('+d+')',!1,function(){var f=arguments.length-2;const g=Array.from({length:f}),h=[],k=arguments[f+1],l=d+'_'+k;this.D.has(l)&&this.D.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.C.gb(p)?(h.push(n),p=p.Ba):olympe.C.Uf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{zc(this,d,k,...g)}):(f=olympe.C.createNode(void 0,(...n)=>{e.run(()=>
428
- {zc(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.D.set(l,f),f.onDestroy(()=>this.D.delete(l)));return null}.bind(a));e.Xd(a.N.bind(a,d));a=M(e);a.bx=d;L(e,a);return a}olympe.host.Ta=class{constructor(a,b){this.G=a;this.H=b;this.F=0;this.j=new Map;this.D=new Map;a.debug('Starting host manager')}Xa(){return this.G}N(a){this.G.debug('DESTROY #',a);const b=this.j.get(a);this.j.delete(a);b.destroy()}};olympe.host.Sd=class{constructor(a){this.j=a;this.D=olympe.C.Za()}F(){return this.j}hd(){return this.j.Ba.hd()||this.D.hd()}fb(){return this.j.Ba.fb()}};olympe.host.Sd.prototype.F.K=new olympe.C.J(()=>olympe.host.Oe.Sd,[]);olympe.host.Uk=class{j(){}D(){}};olympe.host.Au=class{};function Bc(a,b){var c=olympe.host.Yf;const d=olympe.U.Kc(),e=new olympe.C.Wb('onTimeout context');c.j.X(b,d,()=>{e.fb()||e.hd()||e.run(a);c.j.F(d)});return new olympe.host.Ed.D(c.j,d,e)}function Cc(a,b){var c=olympe.host.Yf;const d=olympe.U.Kc(),e=new olympe.C.Wb('onInterval context');c.j.R(b,d,()=>{e.fb()||e.hd()?c.j.D(d):e.run(a)})}olympe.host.Ed=class{constructor(a){this.j=Ac(a)}};olympe.host.Ed.j=class{constructor(a,b,c){this.Yf=a;this.id=b;this.j=null!=c?c:null}T(){return this.id}cancel(){}};
429
- olympe.host.Ed.H=class extends olympe.host.Ed.j{cancel(){this.Yf.N(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ed.D=class extends olympe.host.Ed.j{cancel(){this.Yf.F(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ed.F=class extends olympe.host.Ed.j{cancel(){this.Yf.D(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Je=class{H(a,b){return null!=b?b:''}ia(a,b){return null!=b?b:''}Ha(a,b){return null!=b?b:''}F(){}j(a,b){return null!=b?b:''}D(){}};olympe.host.Je.j={LIVENESS:'liveness',READINESS:'readiness',ALL:'all'};olympe.host.Oe={};olympe.host.Oe.Sd=class{destroy(){}};olympe.host.Oe.Sd.prototype.destroy=olympe.host.Oe.Sd.prototype.destroy;olympe.host.Oe.Hq={zA:100,BA:101,AA:102,DA:103,CA:104,yA:105,fD:201,dD:202,aD:204,iD:205,$C:206,cD:207,gD:208,jD:209,kD:210,lD:211,bD:212,hD:218,eD:219,mD:220,ZC:221,YC:222,tD:300,uD:301,vD:302,zD:303,AD:304,BD:305,wD:310,xD:311,yD:312,zC:400,AC:401,BC:402,nC:450,gC:500,eC:501,jC:502,iC:503,fC:504,hC:505,UD:600,LD:601,PD:602,HD:603,ID:604,FD:605,KD:606,$D:607,SD:608,CD:609,GD:610,JD:611,RD:612,WD:613,DD:614,VD:615,QD:616,ZD:617,MD:618,ND:619,OD:620,TD:630,ED:631,XD:632,YD:633,FE:700,iE:701,jE:702,
430
- kE:703,mE:704,nE:705,oE:706,lE:707,qE:708,pE:709,rE:710,vE:711,DE:712,sE:713,tE:714,wE:715,xE:716,zE:717,AE:718,CE:719,yE:720,BE:721,EE:722,uE:723,GE:724,HE:725,ls:800};olympe.host.Oe.Ed=class{N(){}X(){}F(){}R(){}D(){}};olympe.host.P={Qk:'host.System',Op:'host.HistoryManager',Hr:'host.Scheduler',Ca:'host.platform.Logger',Fa:'host.Manager',Ge:'host.ProcessManager'};olympe.host.Config={Jk:'host.role',Pp:'host.currentHost',dr:'host.processProbe',Nr:'host.gracefulShutdownTimeout'};olympe.host.Wg={Al:'active',Th:'preview'};olympe.host.Yf=null;
431
- olympe.V.config(function(a){var b,c;const d='object'===typeof window&&(null==(b=window)?void 0:null==(c=b.location)?void 0:c.hostname)||'127.0.0.1';a.setParameter(olympe.host.Config.Pp,d);b=olympe.host.Wg.Al;c=olympe.host.Wg.Th;E(a,olympe.host.Config.Jk,d.startsWith(`${c}.`)?c:b);Xa(a,olympe.host.P.Qk);Xa(a,olympe.host.P.Op);C(a,olympe.host.P.Ge,olympe.host.Je);D(a,olympe.host.P.Ca,[olympe.ha.P.Fa],e=>e.ad('host'));C(a,olympe.host.P.Fa,olympe.host.Ta,olympe.host.P.Ca,olympe.V.P.Eg);D(a,olympe.host.P.Hr,
432
- [olympe.host.P.Fa],e=>{null===olympe.host.Yf&&(olympe.host.Yf=new olympe.host.Ed(e));return olympe.host.Yf},!0)},'olympe.host');olympe.V.run([olympe.host.P.Hr],a=>a,'olympe.host.scheduler');olympe.V.run([olympe.host.P.Fa],a=>a,'olympe.host');olympe.V.run([olympe.host.P.Ge],a=>{olympe.host.ll=()=>a});olympe.error={};olympe.error.od=class extends Error{constructor(a,b=olympe.error.lc.Wk){super(a);this.code=b}Aj(){return this.code}};olympe.error.lc={Wk:0,Oi:1,Fq:401,kk:403,Zi:404,Hv:406,TIMEOUT:408,tw:503,Eq:530,Ql:600,Gq:1006};olympe.error.Vk=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.TIMEOUT)}};olympe.error.ar=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.tw)}};olympe.error.uk=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Fq)}};olympe.error.Em=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Zi)}};
433
- olympe.error.Oq=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Oi)}};olympe.error.Nq=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Hv)}};olympe.error.qC=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Eq)}};olympe.error.Tl=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Ql)}};olympe.error.kp=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Oi)}};
434
- olympe.error.Yq=class extends olympe.error.od{constructor(){super('Working offline',olympe.error.lc.Oi)}};olympe.error.Uo=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Oi)}};olympe.error.Dr=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Oi)}};olympe.error.$m=class extends olympe.error.od{constructor(a,b){super(a);this.id=b}T(){return this.id}};olympe.error.Ph=class extends olympe.error.$m{};olympe.error.Ho=class extends olympe.error.$m{};
435
- olympe.error.Np=class extends olympe.error.$m{};olympe.net={};olympe.net.va={};olympe.net.va.Rd={Sh:'POST',GET:'GET',xu:'HEAD',er:'PUT',Dc:'DELETE',Tq:'OPTIONS',CC:'PATCH'};olympe.net.va.ResponseType={Zr:'text',JSON:'json',Hl:'blob',$h:'uint8array',je:'stream'};olympe.net.va.Headers={Ii:'content-type',OA:'content-length',uo:'authorization',Jt:'access-control-allow-origin',Ht:'access-control-allow-headers',It:'access-control-allow-methods',yp:'x-forwarded-host',zp:'x-forwarded-proto'};
436
- olympe.net.va.Ul={QB:'text/html',JSON:'application/json',ax:'application/zip',je:'application/octet-stream'};olympe.net.va.Tb={Mo:0,Qh:200,Oo:201,Rj:202,Fl:400,Qw:401,kk:403,Zi:404,kC:405,gj:500,pw:503};function Dc(a){return a.host&&encodeURI(a.host)}function Ec(a){return encodeURI(a.path).replace(olympe.net.oj.j,(b,c)=>'%'+c)}olympe.net.oj=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.xh=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.xh=d)}j(){return`${(void 0===this.xh?443===this.port:this.xh)?'wss':'ws'}://${Dc(this)}:${this.port}/${Ec(this)}`}toString(){return`${Dc(this)}:${this.port}/${Ec(this)}`}};
437
- olympe.net.oj.j=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}da(){}Z(){}X(){}D(){}};function N(a,b,c,d){a=olympe.U.Qz(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Si(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.Ct&&(c=a.Ct.split(':'),2===c.length&&(c=ab(olympe.U.jf(),`${c[0]}:${c[1]}`),Fc(b,{Authorization:`Basic ${c}`})));return b}function Gc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Hc(a,b){a.D=b;return a}function Fc(a,b){Object.assign(a.headers,b)}
438
- olympe.net.Si=class extends olympe.net.oj{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=null!=e?e:olympe.net.va.Rd.GET;this.query=h;this.headers={};this.body=f;this.D=null!=g?g:olympe.net.va.ResponseType.Zr}Cj(){return this.headers}j(){let a=Gc(this);a=a?`?${a}`:'';if(!Dc(this))return`${Ec(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${(void 0===this.xh?443===this.port:this.xh)?'https':'http'}://${Dc(this)}${b}/${Ec(this)}${a}`}toString(){return this.j()}};
439
- olympe.net.Si.Rd={Sh:'POST',GET:'GET',xu:'HEAD',er:'PUT',Dc:'DELETE',Tq:'OPTIONS'};olympe.net.pd=class{constructor(a,b,c,d){this.data=a;this.status=null!=b?b:200;this.statusText=null!=c?c:'';this.headers=null!=d?d:{}}getData(){return this.data}Jc(){return this.status}Cj(){return this.headers}};function Ic(a,b){if(!b)throw Error('Try to send an invalid HTTP request: '+b);a.G.debug('SEND HTTP '+b.method+' to '+b.j());const c=a.F++,d=olympe.C.Za(),e=d.onDestroy(()=>{var f=a.j;const g=f.j.get(c);f.j.delete(c);null==g||g()});return Jc(a.j,c,b).finally(()=>{d.Wf(e);a.j.j.delete(c)})}olympe.net.Ta=class{constructor(a){this.G=a;this.j=new olympe.net.ve.Bu(a);this.F=1;a='Initializing NET layer';this.G.j()&&(a+=' (implementation: '+this.R()+')');this.G.log(a);this.G.log('DONE initializing NET layer (ready to receive connection requests)')}D(){}N(){}H(){}Vf(){}R(){}};function Kc(a){const b=olympe.net.AMQPClient.j.ze,c=olympe.net.AMQPClient.j.CONNECTING,d=olympe.net.AMQPClient.j.zc,e=olympe.net.AMQPClient.j.Ab;mb(a.state,b,a.ia.bind(a),[c]);mb(a.state,c,()=>{a.G.debug('Connecting to the AMQP Client..');a.F=!0;F(a.state,b)},[d]);mb(a.state,d,(f,g)=>u(function*(){a.F=null!=g?g:a.F;a.F||a.D.clear();yield Lc(a);if(a.F&&!a.X&&null!==a.N){let h,k;setTimeout(()=>{a.G.debug('Reconnecting to the AMQPClient..');F(a.state,c)},null!=(k=null==(h=a.N)?void 0:h.pt)?k:5E3)}}),
440
- [b,c,e]);nb(a.state,e,(f,g)=>{a.G.warn(`Error occurred with the AMQP Client, (was in state ${f}): ${g}`);F(a.state,d,a.F)});a.state.start(d,!1)}function Mc(a,b){kb(a.state,olympe.net.AMQPClient.j.ze,b)}function Nc(a,b){kb(a.state,olympe.net.AMQPClient.j.CONNECTING,b)}function Oc(a,b){kb(a.state,olympe.net.AMQPClient.j.zc,b)}
441
- function Lc(a){return u(function*(){const b=a.j,c=a.H;a.j=a.H=null;!1===(null==b?void 0:b.closed)&&b.close().catch(d=>a.G.debug(`Issue while closing channel: ${d}`));!1===(null==c?void 0:c.closed)&&(yield olympe.U.Promise.Zf(c.close(),500,'AMQPClient close timeout').catch(d=>{a.G.debug(`Error while closing client: ${d}`)}))})}function Pc(a){return null!==a.H&&!a.H.closed&&null!==a.j&&!a.j.closed&&a.F}function Qc(a,b){if(!Pc(a))throw new olympe.error.Tl(null!=b?b:'Not connected to the bus');}
399
+ m.Cf.K=olympe.C.J.F;m.wg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.kn.K=olympe.C.J.j;m.jn.K=olympe.C.J.j;m.xs.K=olympe.C.J.j;m.nn.K=olympe.C.J.j;m.oe.K=olympe.C.J.j;m.al.K=olympe.C.J.j;m.pj.K=olympe.C.J.j;m.Nf.K=olympe.C.J.j;m.fi.K=olympe.C.J.j;m.Lg.K=olympe.C.J.j;olympe.C.Tj=class extends olympe.C.Ci{constructor(a,b){super(a,b);this.D=Object.create(null);this.j=[];this.ba=this.wa=this.Ha=this.Z=null}Qd(a){super.Qd(a);if(null!==this.ba)for(let b of this.ba.values())gc(b,a)}Jc(){return this.qe(0)}Tf(){return this.mf(0)}Hd(a){const b=c=>{null===this.Ha&&(this.Ha=Object.create(null));let d=this.Sf(a);d=void 0!==d?olympe.C.qa(d):void 0;return this.Bj(this.Ha,c,d,olympe.C.$,`List.getRank(${c})`)};return olympe.C.gb(a)?M(olympe.C.createNode(olympe.C.$,b,null,[a.Ba],
400
+ [0],'onResolved('+(b.name||'')+')')):b(a)}Sf(a){return this.D[a]}mf(a){const b=c=>{const d=c.valueOf(),e=this.Rf(d);null===this.wa&&(this.wa=Object.create(null));return this.Bj(this.wa,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.C.sa([a],c=>b(c),String)}Rf(a){return this.j[a.valueOf()]}qe(a){if(olympe.C.gb(a))return this.get(olympe.C.sa([a],c=>{c=this.mf(c);if(!Sb(c.Ba)){const d=olympe.C.Za();olympe.C.Wf(d)&&bc(d)}return c},String));null===this.ba&&(this.ba=new Map);let b=this.ba.get(a);
401
+ b||this.H.run(()=>{b=this.get(this.mf(a));this.ba.set(a,b);b.Ba.onDestroy(()=>this.ba.delete(a))});return b}lf(a){return this.oi(this.Rf(a))}wj(a,b,c,d){let e=this.kn();a=this.jt(e,a,b,c,d);this.jn(e,a)}jt(a,b,c,d,e){return olympe.C.Za().rc((f,g)=>{let h=!1,k=olympe.C.zi([b,c,this.Hd(g)],(l,n,p)=>{p>=l&&p<l+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.nn(a,g,k)})}si(){null===this.Z&&this.H.run(()=>{this.Z=olympe.C.Wd(Array,this.j.filter(a=>void 0!==a));this.Z.Ba.onDestroy(()=>
402
+ {this.F=null})});return this.Z}oe(a){if(this.j.length!==this.size)super.oe(a);else{var b=this.values;for(let c of this.j.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}mn(a,b){const c=this.Ha,d=this.wa,e=this.D[a],f=b.valueOf();if(e!==f||this.j[e]!==a){var g=this.j[f];void 0!==g&&delete this.D[g];void 0!==e&&null!==e&&this.j[e]===a&&(this.j[e]=void 0);this.D[a]=f;this.j[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&ic(c[g]),void 0!==c[a]&&hc(c[a],olympe.C.qa(f)));
403
+ null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&ic(d[e]),void 0!==d[b]&&hc(d[b],a))}}ln(a){var b=this.wa,c=this.D[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ba.Eb===a&&ic(b));delete this.D[a];this.j.splice(c,1);c=this.Ha;null!==c&&void 0!==c[a]&&ic(c[a])}ys(){if(null!==this.Z){const a=this.j,b=this.Z.Ba.Eb;b&&a.join(',')!==b.join(',')&&hc(this.Z,a)}}Nf(){this.ys();super.Nf()}fi(){var a=this.D;for(b in a)delete a[b];this.j.length=0;a=this.Ha;if(null!==a)for(b in a)ic(a[b]);a=this.wa;
404
+ if(null!==a)for(b in a)ic(a[parseInt(b,10)]);var b=this.Z;null!==b&&($b(b.Ba),hc(b,this.j));return olympe.C.Ci.prototype.fi.call(this)}Lg(){const a=this.values,b=this.D;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.C.Tj.ya=[olympe.C.vd];m=olympe.C.Tj.prototype;m.Qd.K=olympe.C.J.j;m.Jc.K=new olympe.C.J(()=>Object,[]);m.Tf.K=new olympe.C.J(()=>String,[]);m.Hd.K=olympe.C.J.F;m.Sf.K=olympe.C.J.j;m.mf.K=new olympe.C.J(()=>String,[]);
405
+ m.Rf.K=olympe.C.J.j;m.qe.K=new olympe.C.J(()=>Object,[]);m.lf.K=olympe.C.J.j;m.wj.K=new olympe.C.J(()=>{},[]);m.jt.K=olympe.C.J.j;m.si.K=new olympe.C.J(()=>Array,[]);m.oe.K=olympe.C.J.j;m.mn.K=olympe.C.J.j;m.ln.K=olympe.C.J.j;m.ys.K=olympe.C.J.j;m.Nf.K=olympe.C.J.j;m.fi.K=olympe.C.J.j;m.Lg.K=olympe.C.J.j;olympe.C.Map=class extends olympe.C.Ci{constructor(a){a===olympe.C.Proxy&&(a=Object);super(a);this.j=this.D=null}Qd(a){a===olympe.C.Proxy&&(a=Object);null!==this.D&&gc(this.D,a);super.Qd(a)}Jc(){null===this.D&&this.zn();return this.D}Tf(){null===this.j&&this.zn();return this.j}zn(){this.getContext().run(()=>{this.D=olympe.C.Wd(this.Mb());this.j=olympe.C.Wd(String);this.Oj(this.Cn())})}Cn(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}Oj(a){if(void 0!==
406
+ a){const b=this.values[a];b&&b instanceof olympe.C.Proxy?jc(this.D,b):hc(this.D,b);hc(this.j,a)}else void 0!==this.D.Ba.Eb&&(ic(this.D),ic(this.j))}set(a,b){this.al(a,b);1===this.size&&null!==this.j&&this.Oj(a);this.Nf()}remove(a){const b=this.pj(a);null!==this.j&&this.j.Ba.Eb===a&&this.Oj(this.Cn());return b}clear(){this.fi();null!==this.j&&this.Oj()}};m=olympe.C.Map.prototype;m.Qd.K=olympe.C.J.j;m.Jc.K=new olympe.C.J(()=>Object,[]);m.Tf.K=new olympe.C.J(()=>String,[]);m.zn.K=olympe.C.J.j;
407
+ m.Cn.K=olympe.C.J.j;m.Oj.K=olympe.C.J.j;m.set.K=olympe.C.J.j;m.remove.K=new olympe.C.J(()=>Object,[]);m.clear.K=olympe.C.J.j;olympe.C.Og=class extends olympe.C.Tj{constructor(a){super(a)}set(a,b,c){this.al(a,b);void 0!==c&&olympe.C.Wc([c],d=>{this.mn(a,d)});this.Nf()}remove(a){this.ln(a);return this.pj(a)}clear(){this.fi()}};olympe.C.Og.prototype.remove.K=olympe.C.J.j;olympe.C.Og.prototype.clear.K=olympe.C.J.j;olympe.C.Kt=class extends olympe.C.lk{constructor(a,b){super(olympe.C.$,'animatedFlowSource');this.duration=a;this.j=b||olympe.C.$.mp.uq}tb(){return olympe.C.Ez(this.node,this.duration,this.j,void 0)}};let sc=null;olympe.C.G=void 0;olympe.C.Yn=void 0;olympe.C.ki=void 0;olympe.C.ei=new Map;olympe.C.ei.set(0,olympe.C.$.ZERO);olympe.C.ei.set(1,olympe.C.$.ONE);olympe.C.ei.set(2,olympe.C.$.Ow);olympe.C.$k=new Map;olympe.C.$k.set('',olympe.C.Sa.EMPTY);olympe.C.$k.set(' ',olympe.C.Sa.zw);olympe.C.createNode=function(a,b,c,d,e,f,g,h){return new olympe.C.Node({valueType:a,Mc:b,Yf:c,Pn:d,debug:g,rg:e,$c:f,qj:h})};olympe.C.Wf=function(a){return a instanceof olympe.C.Node};
408
+ olympe.C.Wd=function(a,b,c){a=olympe.C.createNode(a,void 0,void 0,void 0,void 0,c);olympe.C.Wf(b)?cc(a,b):olympe.C.gb(b)?cc(a,b.Ba):L(a,b);return M(a)};olympe.C.gb=function(a){return!(!a||!a.fh)};olympe.C.pf=function(a){return!(!a||!(a instanceof olympe.C.Node||a.fh))};olympe.C.Tn=function(a){return a instanceof olympe.C.Xb||a instanceof olympe.C.Gr||a instanceof olympe.C.Node};olympe.C.sh=function(a){return a instanceof olympe.C.lk};
409
+ olympe.C.Vn=function(a,b){if(void 0!==a){olympe.C.sh(a)&&(a=a.tb().Ba);if(!olympe.C.pf(a))return b(a);var c=[];olympe.C.gb(a)?c.push(a.Ba):c.push(a);return olympe.C.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.C.Qa=function(a,b){let c=a;olympe.C.gb(a)?c=a.Ba.Eb:olympe.C.Wf(a)?c=a.Eb:olympe.C.sh(a)&&(c=a.tb().Ba.Eb);return void 0===c?b:c};
410
+ olympe.C.wh=function(a,b){let c;olympe.C.gb(a)?c=a.Ba:olympe.C.Wf(a)?c=a:olympe.C.sh(a)&&(c=a.tb().Ba);c&&olympe.C.Wc([b],d=>{c.wh(d)},'setDefaultValue');return a};olympe.C.zi=function(a,b,c,d){const e=a.length,f=Array(e),g=[];let h;for(let k=0;k<e;k++)h=a[k],void 0!==h&&null!==h&&(void 0!==h.vs?(h=h.Ba,g.push(k)):h instanceof olympe.C.Node?g.push(k):olympe.C.sh(h)&&(h=h.tb().Ba,g.push(k))),f[k]=h;return olympe.C.createNode(c,b,null,f,g,d||'syncNodes')};
411
+ olympe.C.ye=function(a,b,c,d){return M(olympe.C.zi(a,b,c,d||'syncProxies'))};const tc=a=>{for(const b of a)if(olympe.C.pf(b)||olympe.C.sh(b))return!1;return!0};olympe.C.sa=function(a,b,c,d,e){if(tc(a))return b(...a);const f=olympe.C.zi(a,b,c,d||'TransformFlows');e&&olympe.C.Wc([e],g=>{f.wh(g)},'setDefaultValue');return M(f)};olympe.C.Wc=function(a,b,c){tc(a)?b(...a):olympe.C.zi(a,b,void 0,c||'processFlows')};
412
+ olympe.C.UE=function(a,b,c){const d=olympe.C.Wf(a)?a.Mb():olympe.C.sh(a)?a.tb().di:a.di,e=olympe.C.bc(d,c),f=olympe.U.Promise.uj(g=>{e.getContext().fb()||e.update(g)},b);olympe.C.Wc([a],g=>f(g).then());return e.tb()};olympe.C.nt=function(a,b){if(tc(a))b(...a);else{const c=olympe.C.Za();olympe.C.zi(a,(...d)=>{olympe.C.Za().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
413
+ olympe.C.Wn=function(a,b,c){const d=a.length,e=Array(d),f=[];let g;for(let h=0;h<d;h++)g=a[h],void 0!==g&&null!==g&&(olympe.C.gb(g)?(g=g.Ba,f.push(h)):g instanceof olympe.C.Node?f.push(h):olympe.C.sh(g)&&(g=g.tb().Ba,f.push(h))),e[h]=g;0!==f.length&&new olympe.C.Node({Mc:b,Pn:e,rg:f,Wz:!1,$c:c})};olympe.C.ot=function(a,b){const c=olympe.C.Za();olympe.C.Wn(a,(...d)=>{olympe.C.Za().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.C.SE=function(a,b,c){a=new olympe.C.lk(a,c);b(a);return a.tb()};
414
+ olympe.C.bc=function(a,b='flowSource'){return new olympe.C.lk(a,b)};olympe.C.zF=function(a,b,c,d){const e=olympe.C.Za();olympe.C.zi(a,(...f)=>{olympe.C.Za().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.C.Gj=function(a,b,c){olympe.C.sa([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.C.eF=function(a,b,c='from observable'){const d=olympe.C.bc(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.tb()};
415
+ olympe.C.bF=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.C.DF=function(a){return olympe.C.Za().rc(a)};olympe.C.ZE=function(a,b,c){olympe.C.Rx(a?a.Ba:a,b,c)};
416
+ olympe.C.Rx=function(a,b,c){if(a){var d=a.T();null===sc&&(sc={});if(sc[d])olympe.C.G.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{sc[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.C.G.warn(e):olympe.C.G.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.C.createNode(null,g=>{void 0===g?olympe.C.G.log(f,'undefined'):null===g?olympe.C.G.log(f,'null'):olympe.C.G.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.C.G.log(`Node #${d} destroyed`+(b?`: ${b}`:
417
+ ''))});c.onDestroy(()=>{delete sc[d]})}}else olympe.C.G.log('NOT starting node dump, node is '+String(a))};olympe.C.YE=function(){let a='',b=olympe.C.Za();for(;null!==b;)a+=b.Hn()+' --\x3e ',b=b.getParent();olympe.C.G.log(a)};
418
+ olympe.C.qa=function(a){if(void 0===a)return olympe.C.$.ZERO;if(a instanceof olympe.C.$)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.C.$.Bq;if(a===Math.PI)return olympe.C.$.PI;if(Infinity===a)return olympe.C.$.Hu;if(-Infinity===a)return olympe.C.$.Ev;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.C.ei.has(a)||olympe.C.ei.set(a,new olympe.C.$(a)),olympe.C.ei.get(a)):new olympe.C.$(a)}return null};
419
+ olympe.C.fe=function(a){return void 0===a?olympe.C.Wd(olympe.C.$):olympe.C.Wd(olympe.C.$,olympe.C.pf(a)?a:olympe.C.qa(a))};olympe.C.Ez=olympe.C.$.animate;olympe.C.oF=function(a,b){return new olympe.C.Kt(a,b)};olympe.C.xb=function(a){if(a instanceof olympe.C.Sa)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.C.$k.has(a)?olympe.C.$k.get(a):new olympe.C.Sa(a)};
420
+ olympe.C.tF=function(a){return void 0===a?olympe.C.Wd(olympe.C.Sa):olympe.C.Wd(olympe.C.Sa,olympe.C.pf(a)?a:olympe.C.xb(a))};olympe.C.Rb=function(a){return a instanceof olympe.C.da?a:void 0!==a&&null!==a&&a.valueOf()?olympe.C.da.D:olympe.C.da.j};olympe.C.qF=function(a){return void 0===a?olympe.C.Wd(olympe.C.da):olympe.C.Wd(olympe.C.da,olympe.C.pf(a)?a:olympe.C.Rb(a))};olympe.C.pF=function(a){if(a instanceof Date)return new olympe.C.eb(a)};
421
+ olympe.C.sF=function(a){return olympe.C.Wd(olympe.C.eb,void 0!==a?new olympe.C.eb(a):null)};olympe.C.et=a=>a instanceof olympe.C.da||a instanceof olympe.C.$||a instanceof olympe.C.Sa||a instanceof olympe.C.eb;olympe.C.uF=function(a,b){return olympe.C.Wd(olympe.C.Zb,void 0===a&&void 0===b?void 0:new olympe.C.Zb(a,b))};olympe.C.Qz=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.C.Color?e=a:e=olympe.C.Color.create(a,b,c,d));return olympe.C.Wd(olympe.C.Color,e)};olympe.C.rF=olympe.C.Qz;
422
+ olympe.C.Ix=function(a){olympe.C.G=a;olympe.C.ki=olympe.C.kh()};olympe.C.kh=function(){olympe.C.Yn||(olympe.C.Yn=new olympe.C.Gr);return olympe.C.Yn};olympe.C.Za=function(){olympe.C.ki||(olympe.C.ki=olympe.C.kh());return olympe.C.ki};olympe.C.wt=function(a){const b=olympe.C.ki;olympe.C.Tn(a)&&(olympe.C.ki=a);return null!=b?b:null};
423
+ olympe.C.Pb=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.C.eb.Pb(a);break;case 'number':b=olympe.C.$.Pb(a);break;case 'string':b=olympe.C.Sa.Pb(a);break;case 'vector2':b=olympe.C.Zb.Pb(a);break;case 'color':b=olympe.C.Color.Pb(a);break;case 'boolean':b=olympe.C.da.Pb(a)}return b}return null};function uc(a){a.j.fb()||(a.F.forEach(b=>{b.destroy()}),a.F.clear(),a.D.clear(),a.size.clear(),a.N.clear(),a.R.length=0,a.H.length=0)}
424
+ olympe.C.pD=class{constructor(){this.j=new olympe.C.Xb('Slot Manager context');this.F=new Map;this.j.run(()=>{this.D=olympe.C.bc(vc,'Last slot manager entry');this.size=lc(olympe.C.bc(olympe.C.$,'SlotManager size').repeat(this.D.tb().In()),olympe.C.$.ZERO);this.N=lc(olympe.C.bc(olympe.C.$,'last valid slots'),olympe.C.qa(-1))});this.R=[];this.H=[];this.j.onDestroy(()=>{uc(this)})}};
425
+ class vc{constructor(a,b,c,d){this.id=a;this.D=new olympe.C.Xb('Slot manager entry');this.H=c;this.N=d;this.D.run(()=>{const e=lc(olympe.C.bc(olympe.C.$),olympe.C.$.ZERO);olympe.C.gb(b)?e.repeat(b):e.update(b);this.j=olympe.C.bc(olympe.C.$);this.F=this.j.tb().ge(e.tb())});this.next=null}T(){return this.id}$y(){return this.j.tb()}In(){return this.F}Hd(){return this.H}iz(){return this.N}sA(a){this.H=a}fA(a){null===a?this.j.update(olympe.C.$.ZERO):(this.j.repeat(a.In()),a.next=this)}Uu(){this.j.clear();
426
+ this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=vc.prototype;m.T.K=olympe.C.J.j;m.$y.K=new olympe.C.J(()=>olympe.C.$);m.In.K=new olympe.C.J(()=>olympe.C.$);m.Hd.K=olympe.C.J.j;m.iz.K=olympe.C.J.j;m.sA.K=olympe.C.J.j;m.fA.K=olympe.C.J.j;m.Uu.K=olympe.C.J.j;m.destroy.K=olympe.C.J.j;olympe.C.P={Da:'df.Logger'};olympe.V.config(a=>{E(a,olympe.C.Config.Cq,Number.POSITIVE_INFINITY);D(a,olympe.C.P.Da,[olympe.ga.P.Fa],b=>b.ad('df'))},'olympe.df');olympe.V.run([olympe.C.P.Da],a=>{olympe.C.Ix(a)},'olympe.df');olympe.host={};const wc=new Map,xc=new Map;olympe.host.Jq=class{static register(a,b,...c){wc.set(a,b);0<c.length&&xc.set(a,c)}static create(a,b,c,d){const e=wc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=xc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Sa(d,f))):new e(b,c)}};function yc(a,b,c){a.G.debug('CREATE #',b,', type=',c);a.j.set(b,olympe.host.Jq.create(c,b,a.G,a.H))}function zc(a,b,c,...d){const e=a.j.get(b);if(void 0!==e){a.G.H()<=olympe.ga.yb.j.bg&&a.G.debug('CALL #'+b+', '+c+'('+Array.prototype.slice.call(d,0)+')');b=[];for(const f of d)if(void 0===f||null===f)b.push(f);else if(olympe.C.gb(f))b.push(a.j.get(f.ex)||null);else if('function'===typeof f){const g=f,h=olympe.C.Za();b.push((...k)=>{h.fb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
427
+ function Ac(a){var b=olympe.host.Pe.Ed,c=olympe.host.Pe.Iq.ms;++a.F;const d=a.F;yc(a,d,c);const e=olympe.C.createNode(b,void 0,void 0,void 0,void 0,'Native('+d+')',!1,function(){var f=arguments.length-2;const g=Array.from({length:f}),h=[],k=arguments[f+1],l=d+'_'+k;this.D.has(l)&&this.D.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.C.gb(p)?(h.push(n),p=p.Ba):olympe.C.Wf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{zc(this,d,k,...g)}):(f=olympe.C.createNode(void 0,(...n)=>{e.run(()=>
428
+ {zc(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.D.set(l,f),f.onDestroy(()=>this.D.delete(l)));return null}.bind(a));e.Xd(a.N.bind(a,d));a=M(e);a.ex=d;L(e,a);return a}olympe.host.Ta=class{constructor(a,b){this.G=a;this.H=b;this.F=0;this.j=new Map;this.D=new Map;a.debug('Starting host manager')}Wa(){return this.G}N(a){this.G.debug('DESTROY #',a);const b=this.j.get(a);this.j.delete(a);b.destroy()}};olympe.host.Sd=class{constructor(a){this.j=a;this.D=olympe.C.Za()}F(){return this.j}jd(){return this.j.Ba.jd()||this.D.jd()}fb(){return this.j.Ba.fb()}};olympe.host.Sd.prototype.F.K=new olympe.C.J(()=>olympe.host.Pe.Sd,[]);olympe.host.Uk=class{j(){}D(){}};olympe.host.Bu=class{};function Bc(a,b){var c=olympe.host.Zf;const d=olympe.U.Lc(),e=new olympe.C.Xb('onTimeout context');c.j.X(b,d,()=>{e.fb()||e.jd()||e.run(a);c.j.F(d)});return new olympe.host.Ed.D(c.j,d,e)}function Cc(a,b){var c=olympe.host.Zf;const d=olympe.U.Lc(),e=new olympe.C.Xb('onInterval context');c.j.R(b,d,()=>{e.fb()||e.jd()?c.j.D(d):e.run(a)})}olympe.host.Ed=class{constructor(a){this.j=Ac(a)}};olympe.host.Ed.j=class{constructor(a,b,c){this.Zf=a;this.id=b;this.j=null!=c?c:null}T(){return this.id}cancel(){}};
429
+ olympe.host.Ed.H=class extends olympe.host.Ed.j{cancel(){this.Zf.N(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ed.D=class extends olympe.host.Ed.j{cancel(){this.Zf.F(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ed.F=class extends olympe.host.Ed.j{cancel(){this.Zf.D(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ke=class{H(a,b){return null!=b?b:''}ia(a,b){return null!=b?b:''}Ha(a,b){return null!=b?b:''}F(){}j(a,b){return null!=b?b:''}D(){}};olympe.host.Ke.j={LIVENESS:'liveness',READINESS:'readiness',ALL:'all'};olympe.host.Pe={};olympe.host.Pe.Sd=class{destroy(){}};olympe.host.Pe.Sd.prototype.destroy=olympe.host.Pe.Sd.prototype.destroy;olympe.host.Pe.Iq={AA:100,CA:101,BA:102,EA:103,DA:104,zA:105,gD:201,eD:202,bD:204,jD:205,aD:206,dD:207,hD:208,kD:209,lD:210,mD:211,cD:212,iD:218,fD:219,nD:220,$C:221,ZC:222,uD:300,vD:301,wD:302,AD:303,BD:304,CD:305,xD:310,yD:311,zD:312,AC:400,BC:401,CC:402,oC:450,hC:500,fC:501,kC:502,jC:503,gC:504,iC:505,VD:600,MD:601,QD:602,ID:603,JD:604,GD:605,LD:606,aE:607,TD:608,DD:609,HD:610,KD:611,SD:612,XD:613,ED:614,WD:615,RD:616,$D:617,ND:618,OD:619,PD:620,UD:630,FD:631,YD:632,ZD:633,GE:700,jE:701,kE:702,
430
+ lE:703,nE:704,oE:705,pE:706,mE:707,rE:708,qE:709,sE:710,wE:711,EE:712,tE:713,uE:714,xE:715,yE:716,AE:717,BE:718,DE:719,zE:720,CE:721,FE:722,vE:723,HE:724,IE:725,ms:800};olympe.host.Pe.Ed=class{N(){}X(){}F(){}R(){}D(){}};olympe.host.P={Qk:'host.System',Pp:'host.HistoryManager',Ir:'host.Scheduler',Da:'host.platform.Logger',Fa:'host.Manager',He:'host.ProcessManager'};olympe.host.Config={Jk:'host.role',Qp:'host.currentHost',er:'host.processProbe',Pr:'host.gracefulShutdownTimeout'};olympe.host.Wg={Dl:'active',Th:'preview'};olympe.host.Zf=null;
431
+ olympe.V.config(function(a){var b,c;const d='object'===typeof window&&(null==(b=window)?void 0:null==(c=b.location)?void 0:c.hostname)||'127.0.0.1';a.setParameter(olympe.host.Config.Qp,d);b=olympe.host.Wg.Dl;c=olympe.host.Wg.Th;E(a,olympe.host.Config.Jk,d.startsWith(`${c}.`)?c:b);Xa(a,olympe.host.P.Qk);Xa(a,olympe.host.P.Pp);C(a,olympe.host.P.He,olympe.host.Ke);D(a,olympe.host.P.Da,[olympe.ga.P.Fa],e=>e.ad('host'));C(a,olympe.host.P.Fa,olympe.host.Ta,olympe.host.P.Da,olympe.V.P.Eg);D(a,olympe.host.P.Ir,
432
+ [olympe.host.P.Fa],e=>{null===olympe.host.Zf&&(olympe.host.Zf=new olympe.host.Ed(e));return olympe.host.Zf},!0)},'olympe.host');olympe.V.run([olympe.host.P.Ir],a=>a,'olympe.host.scheduler');olympe.V.run([olympe.host.P.Fa],a=>a,'olympe.host');olympe.V.run([olympe.host.P.He],a=>{olympe.host.ll=()=>a});olympe.error={};olympe.error.pd=class extends Error{constructor(a,b=olympe.error.lc.Wk){super(a);this.code=b}Aj(){return this.code}};olympe.error.lc={Wk:0,Oi:1,Gq:401,kk:403,Zi:404,Iv:406,TIMEOUT:408,uw:503,Fq:530,Tl:600,Hq:1006};olympe.error.Vk=class extends olympe.error.pd{constructor(a){super(a,olympe.error.lc.TIMEOUT)}};olympe.error.br=class extends olympe.error.pd{constructor(a){super(a,olympe.error.lc.uw)}};olympe.error.uk=class extends olympe.error.pd{constructor(a){super(a,olympe.error.lc.Gq)}};olympe.error.Hm=class extends olympe.error.pd{constructor(a){super(a,olympe.error.lc.Zi)}};
433
+ olympe.error.Pq=class extends olympe.error.pd{constructor(a){super(a,olympe.error.lc.Oi)}};olympe.error.Oq=class extends olympe.error.pd{constructor(a){super(a,olympe.error.lc.Iv)}};olympe.error.rC=class extends olympe.error.pd{constructor(a){super(a,olympe.error.lc.Fq)}};olympe.error.Wl=class extends olympe.error.pd{constructor(a){super(a,olympe.error.lc.Tl)}};olympe.error.lp=class extends olympe.error.pd{constructor(a){super(a,olympe.error.lc.Oi)}};
434
+ olympe.error.Zq=class extends olympe.error.pd{constructor(){super('Working offline',olympe.error.lc.Oi)}};olympe.error.Vo=class extends olympe.error.pd{constructor(a){super(a,olympe.error.lc.Oi)}};olympe.error.Er=class extends olympe.error.pd{constructor(a){super(a,olympe.error.lc.Oi)}};olympe.error.cn=class extends olympe.error.pd{constructor(a,b){super(a);this.id=b}T(){return this.id}};olympe.error.Ph=class extends olympe.error.cn{};olympe.error.Io=class extends olympe.error.cn{};
435
+ olympe.error.Op=class extends olympe.error.cn{};olympe.net={};olympe.net.ua={};olympe.net.ua.Rd={Sh:'POST',GET:'GET',yu:'HEAD',fr:'PUT',Dc:'DELETE',Uq:'OPTIONS',DC:'PATCH'};olympe.net.ua.ResponseType={$r:'text',JSON:'json',Kl:'blob',$h:'uint8array',je:'stream'};olympe.net.ua.Headers={Ii:'content-type',PA:'content-length',vo:'authorization',Jt:'access-control-allow-origin',Ht:'access-control-allow-headers',It:'access-control-allow-methods',zp:'x-forwarded-host',Ap:'x-forwarded-proto'};
436
+ olympe.net.ua.Xl={RB:'text/html',JSON:'application/json',bx:'application/zip',je:'application/octet-stream'};olympe.net.ua.Tb={No:0,Qh:200,Po:201,Rj:202,Il:400,Rw:401,kk:403,Zi:404,lC:405,gj:500,qw:503};function Dc(a){return a.host&&encodeURI(a.host)}function Ec(a){return encodeURI(a.path).replace(olympe.net.oj.j,(b,c)=>'%'+c)}olympe.net.oj=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.xh=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.xh=d)}j(){return`${(void 0===this.xh?443===this.port:this.xh)?'wss':'ws'}://${Dc(this)}:${this.port}/${Ec(this)}`}toString(){return`${Dc(this)}:${this.port}/${Ec(this)}`}};
437
+ olympe.net.oj.j=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ba(){}Z(){}X(){}D(){}};function N(a,b,c,d){a=olympe.U.Rz(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Si(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.Ct&&(c=a.Ct.split(':'),2===c.length&&(c=ab(olympe.U.jf(),`${c[0]}:${c[1]}`),Fc(b,{Authorization:`Basic ${c}`})));return b}function Gc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Hc(a,b){a.D=b;return a}function Fc(a,b){Object.assign(a.headers,b)}
438
+ olympe.net.Si=class extends olympe.net.oj{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=null!=e?e:olympe.net.ua.Rd.GET;this.query=h;this.headers={};this.body=f;this.D=null!=g?g:olympe.net.ua.ResponseType.$r}Cj(){return this.headers}j(){let a=Gc(this);a=a?`?${a}`:'';if(!Dc(this))return`${Ec(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${(void 0===this.xh?443===this.port:this.xh)?'https':'http'}://${Dc(this)}${b}/${Ec(this)}${a}`}toString(){return this.j()}};
439
+ olympe.net.Si.Rd={Sh:'POST',GET:'GET',yu:'HEAD',fr:'PUT',Dc:'DELETE',Uq:'OPTIONS'};olympe.net.qd=class{constructor(a,b,c,d){this.data=a;this.status=null!=b?b:200;this.statusText=null!=c?c:'';this.headers=null!=d?d:{}}getData(){return this.data}Kc(){return this.status}Cj(){return this.headers}};function Ic(a,b){if(!b)throw Error('Try to send an invalid HTTP request: '+b);a.G.debug('SEND HTTP '+b.method+' to '+b.j());const c=a.F++,d=olympe.C.Za(),e=d.onDestroy(()=>{var f=a.j;const g=f.j.get(c);f.j.delete(c);null==g||g()});return Jc(a.j,c,b).finally(()=>{d.Xf(e);a.j.j.delete(c)})}olympe.net.Ta=class{constructor(a){this.G=a;this.j=new olympe.net.we.Cu(a);this.F=1;a='Initializing NET layer';this.G.j()&&(a+=' (implementation: '+this.R()+')');this.G.log(a);this.G.log('DONE initializing NET layer (ready to receive connection requests)')}D(){}N(){}H(){}qf(){}R(){}};function Kc(a){const b=olympe.net.AMQPClient.j.Ae,c=olympe.net.AMQPClient.j.CONNECTING,d=olympe.net.AMQPClient.j.zc,e=olympe.net.AMQPClient.j.Ab;mb(a.state,b,a.ia.bind(a),[c]);mb(a.state,c,()=>{a.G.debug('Connecting to the AMQP Client..');a.F=!0;F(a.state,b)},[d]);mb(a.state,d,(f,g)=>u(function*(){a.F=null!=g?g:a.F;a.F||a.D.clear();yield Lc(a);if(a.F&&!a.X&&null!==a.N){let h,k;setTimeout(()=>{a.G.debug('Reconnecting to the AMQPClient..');F(a.state,c)},null!=(k=null==(h=a.N)?void 0:h.pt)?k:5E3)}}),
440
+ [b,c,e]);nb(a.state,e,(f,g)=>{a.G.warn(`Error occurred with the AMQP Client, (was in state ${f}): ${g}`);F(a.state,d,a.F)});a.state.start(d,!1)}function Mc(a,b){kb(a.state,olympe.net.AMQPClient.j.Ae,b)}function Nc(a,b){kb(a.state,olympe.net.AMQPClient.j.CONNECTING,b)}function Oc(a,b){kb(a.state,olympe.net.AMQPClient.j.zc,b)}
441
+ function Lc(a){return u(function*(){const b=a.j,c=a.H;a.j=a.H=null;!1===(null==b?void 0:b.closed)&&b.close().catch(d=>a.G.debug(`Issue while closing channel: ${d}`));!1===(null==c?void 0:c.closed)&&(yield olympe.U.Promise.$f(c.close(),500,'AMQPClient close timeout').catch(d=>{a.G.debug(`Error while closing client: ${d}`)}))})}function Pc(a){return null!==a.H&&!a.H.closed&&null!==a.j&&!a.j.closed&&a.F}function Qc(a,b){if(!Pc(a))throw new olympe.error.Wl(null!=b?b:'Not connected to the bus');}
442
442
  function Rc(a){let b,c;return Number.parseInt(null!=(c=null==(b=/^.*\((\d+)\)$/.exec(a instanceof Error?a.message:a))?void 0:b[1])?c:'0',10)}
443
- function Sc(a,b,c,d){return u(function*(){try{yield Tc(a,b,c)}catch(e){if(e instanceof olympe.error.Nq)return a.G.debug(`Queue ${b} already exists with different parameters, deleting it..`),yield Uc(a,b),new Promise((f,g)=>setTimeout(()=>{a.G.debug(`Redeclare queue ${b} with new parameters..`);Sc(a,b,c,d).then(f).catch(g)},500));throw Error(`Fail to declare queue ${b}: ${e}`);}try{let e,f;yield null==(e=a.D.get(b))?void 0:null==(f=e.vn)?void 0:f.cancel()}catch(e){}try{yield Vc(a,b,c,d)}catch(e){throw Error(`Fail to consume queue ${b}: ${e}`);
444
- }})}function Wc(a,b,c,d){return u(function*(){Qc(a,'Cannot subscribe to a queue without being connected to the bus');if(a.D.has(b))throw Error(`Cannot subscribe twice to the queue ${b}.`);a.G.debug(`Subscribing to queue: ${b}, exclusive: ${c}`);a.D.set(b,{yl:new Set([b]),vn:null,Ln:d,exclusive:c});yield Sc(a,b,c,d);a.G.debug(`Subscribed queue: ${b}.`)})}
445
- function Xc(a,b){return u(function*(){a.G.debug(`Closing subscription to queue: ${b}`);const c=a.D.get(b);a.D.delete(b);let d,e;if(!1===(null==(d=a.H)?void 0:d.closed)&&!1===(null==(e=a.j)?void 0:e.closed))try{let f;yield null==c?void 0:null==(f=c.vn)?void 0:f.cancel()}catch(f){a.G.warn(`An error occurred while closing the subscription to queue: ${b}: ${f}`)}})}
446
- function Tc(a,b,c){return u(function*(){Qc(a,'Cannot declare a queue without being connected to the bus');a.G.debug(`Declaring queue: ${b}`);const d=yield Yc(a);try{yield d.queueDeclare(b,{durable:!c,exclusive:!1,autoDelete:!1,passive:!1},{'x-expires':c?15E3:a.N.Xz,'x-message-ttl':a.N.wz,'x-queue-type':c?'classic':'quorum'}),a.G.debug(`Queue: ${b} declared`)}catch(e){a.G.error(`Failed to declare queue: ${b}`,e);if(Rc(e)===olympe.net.AMQPClient.D.cr)throw new olympe.error.Nq(`Queue ${b} already exists with different parameters`);
443
+ function Sc(a,b,c,d){return u(function*(){try{yield Tc(a,b,c)}catch(e){if(e instanceof olympe.error.Oq)return a.G.debug(`Queue ${b} already exists with different parameters, deleting it..`),yield Uc(a,b),new Promise((f,g)=>setTimeout(()=>{a.G.debug(`Redeclare queue ${b} with new parameters..`);Sc(a,b,c,d).then(f).catch(g)},500));throw Error(`Fail to declare queue ${b}: ${e}`);}try{let e,f;yield null==(e=a.D.get(b))?void 0:null==(f=e.yn)?void 0:f.cancel()}catch(e){}try{yield Vc(a,b,c,d)}catch(e){throw Error(`Fail to consume queue ${b}: ${e}`);
444
+ }})}function Wc(a,b,c,d){return u(function*(){Qc(a,'Cannot subscribe to a queue without being connected to the bus');if(a.D.has(b))throw Error(`Cannot subscribe twice to the queue ${b}.`);a.G.debug(`Subscribing to queue: ${b}, exclusive: ${c}`);a.D.set(b,{Bl:new Set([b]),yn:null,On:d,exclusive:c});yield Sc(a,b,c,d);a.G.debug(`Subscribed queue: ${b}.`)})}
445
+ function Xc(a,b){return u(function*(){a.G.debug(`Closing subscription to queue: ${b}`);const c=a.D.get(b);a.D.delete(b);let d,e;if(!1===(null==(d=a.H)?void 0:d.closed)&&!1===(null==(e=a.j)?void 0:e.closed))try{let f;yield null==c?void 0:null==(f=c.yn)?void 0:f.cancel()}catch(f){a.G.warn(`An error occurred while closing the subscription to queue: ${b}: ${f}`)}})}
446
+ function Tc(a,b,c){return u(function*(){Qc(a,'Cannot declare a queue without being connected to the bus');a.G.debug(`Declaring queue: ${b}`);const d=yield Yc(a);try{yield d.queueDeclare(b,{durable:!c,exclusive:!1,autoDelete:!1,passive:!1},{'x-expires':c?15E3:a.N.Yz,'x-message-ttl':a.N.xz,'x-queue-type':c?'classic':'quorum'}),a.G.debug(`Queue: ${b} declared`)}catch(e){a.G.error(`Failed to declare queue: ${b}`,e);if(Rc(e)===olympe.net.AMQPClient.D.dr)throw new olympe.error.Oq(`Queue ${b} already exists with different parameters`);
447
447
  throw e;}finally{try{yield d.close()}catch(e){}}})}function Uc(a,b){return u(function*(){const c=yield Yc(a);try{yield c.queueDelete(b)}finally{yield c.close()}})}
448
- function Vc(a,b,c,d){return u(function*(){Qc(a,'Cannot consume a queue without being connected to the bus');a.G.debug(`Will consume queue: ${b}..`);const e=a.j,f={exclusive:c,noAck:!1},g=yield a.push(()=>e.basicConsume(b,f,h=>{a.G.j()&&a.G.debug(`AMQP < [${b}]: ${h.bodyToString()}`);d(new olympe.net.AMQPMessage(h,b,e))}));a.D.get(b).vn=g;a.G.debug(`Consumer ${g.tag} subscribed to queue: ${b}, on channel ${e.id}`);g.wait().catch(h=>{a.G.debug(`Consumer of queue ${b} has been closed: ${h}`);h=Rc(h);
449
- if(h===olympe.net.AMQPClient.D.Rm||h===olympe.net.AMQPClient.D.Wk)h=Math.round(5E3*Math.random()),a.G.warn(`Consumer of queue ${b} has been forced closed, will recreate the queue in ${h}ms..`),setTimeout(()=>{a.j===e&&!1===(null==e?void 0:e.closed)&&Sc(a,b,c,d).catch(k=>{a.G.error(`Failed to resubscribe to queue ${b}: ${k}`)})},h)})})}
450
- function Yc(a,{id:b,Mz:c}={}){return u(function*(){const d=yield a.H.channel(b);d.onerror=null!=c?c:e=>{a.G.debug(`Error with channel (${d.id}): ${e}`)};return d})}
451
- function Zc(a,b,c){return u(function*(){Qc(a,'Cannot bind a queue without being connected to the bus');var d;if(null==(d=a.D.get(b))?0:d.yl.has(c))throw Error(`Queue ${b} already bound to topic ${c}`);d=yield Yc(a);try{a.G.debug(`Binding queue ${b} to topic ${c}`),yield d.queueBind(b,'amq.topic',c),a.D.get(b).yl.add(c)}finally{yield d.close()}})}
452
- function $c(a,b,c){return u(function*(){Qc(a,'Cannot unbind a queue without being connected to the bus');const d=yield Yc(a);try{a.G.debug(`Unbinding queue ${b} to topic ${c}`);let e,f;null==(e=a.D.get(b))||null==(f=e.yl)||f.delete(c);yield d.queueUnbind(b,'amq.topic',c)}finally{try{yield d.close()}catch(e){}}})}
453
- olympe.net.AMQPClient=class{constructor(a,b){this.G=olympe.ha.Xa('AMQP');this.X=this.F=!1;this.N=null;this.name=b;this.j=this.H=null;this.state=new olympe.U.Ew(this.G);this.D=new Map;this.R=new Map;this.sa=new olympe.U.promise.Tk;const c=olympe.U.Promise.uj(()=>{const d=olympe.net.AMQPClient.j.CONNECTING,e=olympe.net.AMQPClient.j.zc,f=this.state.getState();f===e?this.F&&F(this.state,d):f!==d&&F(this.state,e,this.F)},0);a.subscribe(d=>{this.G.j()&&this.G.debug('New AMQP configuration received',d);
454
- this.N=d;null!==d&&(this.X=!1,c().then())});Kc(this)}connect(){const a=this;return u(function*(){if(Pc(a))return a;a.state.getState()===olympe.net.AMQPClient.j.zc&&F(a.state,olympe.net.AMQPClient.j.CONNECTING);yield lb(a.state,olympe.net.AMQPClient.j.ze);return a})}disconnect(){const a=this;return u(function*(){const b=olympe.net.AMQPClient.j.zc;a.state.getState()!==b&&(F(a.state,b,!1),yield lb(a.state,b))})}kd(a,b,c,d={mandatory:!1,Bt:!1}){const e=this;return u(function*(){Qc(e,'Cannot publish a message without being connected to the bus');
455
- const f=JSON.stringify(c);e.G.j()&&e.G.debug(`AMQP > [${b}]: ${f}`);return(new Promise((g,h)=>{e.R.set(a,l=>h(new olympe.error.Oq(`Impossible to deliver message to topic "${b}": ${l}`)));const k={messageId:String(a)};e.push(()=>e.j.basicPublish(d.Bt?'amq.topic':'',b,f,k,d.mandatory)).then(()=>g()).catch(l=>{l=Rc(l)===olympe.net.AMQPClient.D.Rm?new olympe.error.Em(`Topic ${b} not deployed.`):Error(`Failed to publish a message ${f} to topic ${b}: ${l}`);h(l)})})).finally(()=>e.R.delete(a))})}ia(){const a=
456
- this;return u(function*(){if(null===a.N)throw Error('Cannot connect to the bus without a configuration');a.H=a.Z(a.N,a.name);try{let b;yield olympe.U.Promise.rt(a.Ha.bind(a),(null!=(b=a.N.pt)?b:5E3)/2,[olympe.error.Tl]);a.G.debug('AMQP Client connected')}catch(b){if(b instanceof Event&&'close'===b.type)throw Error('Bus not ready, will try to reconnect..');throw b;}})}Ha(a){const b=this;return u(function*(){b.G.debug(`Connecting to the bus, tentative ${a+1}..`);b.H.onerror=d=>{if(d instanceof amqp.AMQPError){var e=
457
- olympe.error.lc.Ql;const f=olympe.error.lc.Gq,g=Rc(d);if(g===e||g===f){b.G.debug(`Connection closed by network: ${d}`);F(b.state,olympe.net.AMQPClient.j.zc,b.F);return}}else b.F=!1;e=b.state;F(e,e.j,d)};try{yield b.H.connect(),b.da(b.H,d=>{b.G.debug(`AMQP connection closed ${d?'with error':'without error'}`);d||F(b.state,olympe.net.AMQPClient.j.zc,b.F)})}catch(d){if(d instanceof Error)switch(Rc(d)){case olympe.error.lc.Ql:case olympe.error.lc.Gq:throw new olympe.error.Tl(d);case olympe.error.lc.Eq:case olympe.error.lc.Fq:case olympe.error.lc.kk:throw b.X=
458
- !0,new olympe.error.uk('Connection to the bus is not allowed: check your credentials');}throw new olympe.error.od(`Connection to the bus failed: check your config and the availability of the bus: ${d}`);}const c=()=>u(function*(){b.j=yield Yc(b,{id:1,Mz:e=>{b.G.debug(`Error with channel 0: ${e}`);b.j=null;e=Rc(e);e!==olympe.net.AMQPClient.D.Rm&&e!==olympe.net.AMQPClient.D.cr||olympe.U.Promise.rt(f=>{b.G.warn(`Trying to recreate channel after being closed, tentative ${f+1}..`);return c()},500).catch(f=>
459
- {var g=b.state;F(g,g.j,f)})}});yield b.j.confirmSelect();let d;yield b.j.prefetch(null!=(d=b.N.Yz)?d:20);b.j.onReturn=e=>{const f=`Message returned by the server: ${e.bodyToString()}`;let g;null==(g=b.R.get(parseInt(e.properties.messageId,10)))||g(f)};b.D.forEach(({Ln:e,exclusive:f},g)=>{Sc(b,g,f,e)})});yield c()})}push(a){return vb(this.sa,a)}Z(){}da(){}};olympe.net.AMQPClient.j={CONNECTING:'CONNECTING',ze:'CONNECTED',zc:'DISCONNECTED',Ab:'ERROR'};
460
- olympe.net.AMQPClient.D={Wk:0,Rm:404,NC:405,cr:406,HA:504,eq:541};function ad(a){let b;return null!=(b=a.F)?b:{}}function bd(a){return!1===a.j.closed?a.j.basicNack(a.D,!1,void 0).catch(b=>{olympe.ha.Xa('amqp').error(`Failed to reject message ${a.D}: ${b}`)}):Promise.resolve()}
461
- olympe.net.AMQPMessage=class{constructor(a,b,c){this.H=a.redelivered;this.D=a.deliveryTag;this.N=a.routingKey;this.j=c;this.F=null;try{const d=a.bodyToString();this.F=JSON.parse(null!=d?d:'null')}catch(d){console.warn(`AMQPMessage: Failed to parse message payload: ${d}`)}}wi(){return this.H}ack(){return!1===this.j.closed?this.j.basicAck(this.D,!1).catch(a=>{olympe.ha.Xa('amqp').error(`Failed to ack message ${this.D}: ${a}`)}):Promise.resolve()}};olympe.net.ci=class{constructor(a){this.G=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}F(){return Promise.reject('Try to restart web server with the browser implementation.')}stop(){return Promise.reject('Try to stop web server with the browser implementation.')}D(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}R(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
462
- olympe.net.ci.ALL='*';olympe.net.Cw=class{register(){return u(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.P={Fa:'net.Manager',Ca:'net.Logger',nj:'net.WebServer',uw:'net.ServiceWorkerManager',Gm:'net.OfflineConfig'};olympe.net.Config={Af:'net.httpPort',Sp:'net.httpBodyLimit',ks:'net.http2',Rp:'net.httpsCertificatesPath',ym:'net.localNetworkSuffix',bj:'offline.enabled',Fm:'offline.autoBackOnline',Sq:'offline.downloadBatchSize'};
463
- olympe.V.config(function(a){E(a,olympe.net.Config.Af,3141);E(a,olympe.net.Config.Sp,100);E(a,olympe.net.Config.ks,!1);E(a,olympe.net.Config.Rp,null);E(a,olympe.net.Config.ym,'frontend');E(a,olympe.net.Config.bj,!1);E(a,olympe.net.Config.Fm,!1);E(a,olympe.net.Config.Sq,20);Xa(a,olympe.net.P.Fa);D(a,olympe.net.P.Ca,[olympe.ha.P.Fa],b=>b.ad('net'));C(a,olympe.net.P.nj,olympe.net.ci,olympe.net.P.Ca);C(a,olympe.net.P.uw,olympe.net.Cw);D(a,olympe.net.P.Gm,[new olympe.V.oa(olympe.net.Config.bj),new olympe.V.oa(olympe.net.Config.Fm)],
464
- (b,c)=>new Map([['offlineEnabled',b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Va.node.host={};olympe.Va.node.host.Sd=function(a,b){this.G=b};olympe.Va.node.host.Sd.prototype.constructor=olympe.Va.node.host.Sd;olympe.Va.node.host.Sd.prototype.destroy=function(){};olympe.Va.node.host.Sd.prototype.destroy=olympe.Va.node.host.Sd.prototype.destroy;olympe.Va.node.host.Sd.prototype.Xa=function(){return this.G};olympe.Va.node.host.Sd.ya=[olympe.host.Oe.Sd];olympe.Va.node.host.Jq=class{constructor(a){this.G=a}};olympe.Va.node.host.Jq.ya=[olympe.host.Au];olympe.Va.node.host.Ed=class{constructor(){this.j={};this.H={}}destroy(){}N(a){clearTimeout(this.j[a]);delete this.j[a]}X(a,b,c){this.j[b]=setTimeout(c,a)}F(a){clearTimeout(this.j[a]);delete this.j[a]}R(a,b,c){this.H[b]=setInterval(c,a)}D(a){clearInterval(this.H[a]);delete this.H[a]}};olympe.host.Iq.register(olympe.host.Oe.Hq.ls,olympe.Va.node.host.Ed);olympe.Va.node.host.Ed.ya=[olympe.host.Oe.Ed];olympe.Va.node.host.Uk=class{constructor(a){this.G=a}j(){return olympe.C.ba.D}D(){return!0}};olympe.Va.node.host.Uk.ya=[olympe.host.Uk];function cd(a){a.sa.D('readinessProbe','/readiness',[olympe.net.va.Rd.GET],()=>ed(a,a.da)).catch(b=>a.G.error(`Failed to add readiness health check route ${b}`));a.sa.D('livenessProbe','/liveness',[olympe.net.va.Rd.GET],()=>ed(a,a.Z)).catch(b=>a.G.error(`Failed to add liveness health check route ${b}`));a.H(()=>a.sa.stop())}
465
- function fd(a,b){b=Array.from(b.values()).map(c=>c());return Promise.allSettled(b).then(c=>{let d=!1;for(const e of c)'rejected'===e.status&&(d=!0,a.G.warn(`Failed to close some resource: ${e.reason}`));return d})}function gd(a){return u(function*(){try{const b=yield fd(a,a.N),c=yield fd(a,a.R),d=yield fd(a,a.X);if(b||c||d)throw Error('Failed to gracefully close the backend');}finally{a.N.clear(),a.R.clear(),a.X.clear()}})}
466
- function ed(a,b){const c=olympe.net.va.Tb.Qh,d=olympe.net.va.Tb.gj;b=Array.from(b.values()).map(e=>e.apply(a));return 0===b.length?Promise.resolve(new olympe.net.pd('No healthCheck is set',c,'Nothing to check')):Promise.allSettled(b).then(e=>{let f=!1,g='Health check result: ';for(const h of e)'rejected'===h.status?(f=!0,e=h.reason,g+=`\n${e}`,a.G.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.pd(g,f?d:c,f?'Some services are not working':'Everything is OK')})}
467
- olympe.Va.node.host.Je=class extends olympe.host.Je{constructor(a,b,c,d=!0){super();this.G=a;this.sa=b;this.Wa=c;this.Z=new Map;this.da=new Map;this.R=new Map;this.N=new Map;this.X=new Map;d&&cd(this)}j(a,b=olympe.U.hf(),c=olympe.host.Je.j.ALL){switch(c){case olympe.host.Je.j.LIVENESS:this.Z.set(b,a);break;case olympe.host.Je.j.READINESS:this.da.set(b,a);break;default:this.Z.set(b,a),this.da.set(b,a)}return b}D(a){this.da.delete(a);this.Z.delete(a)}H(a,b=olympe.U.hf()){this.R.set(b,this.Zf(b,a,this.Wa));
468
- return b}ia(a,b=olympe.U.hf(),c){this.N.set(b,this.Zf(b,a,null!=c?c:this.Wa));return b}Ha(a,b=olympe.U.hf()){this.X.set(b,this.Zf(b,a,this.Wa));return b}F(a){this.R.has(a)?this.R.delete(a):this.N.has(a)?this.N.delete(a):this.X.delete(a)}Zf(a,b,c){return()=>olympe.U.Promise.Zf(b(),c,`Shutdown hook ${a} has timeout`)}};olympe.V.config(function(a){E(a,olympe.host.Config.dr,!0);E(a,olympe.host.Config.Nr,1E4);Va(a,olympe.host.P.Op,olympe.Va.node.host.Jq,olympe.host.P.Ca);Va(a,olympe.host.P.Qk,olympe.Va.node.host.Uk,olympe.host.P.Ca);C(a,olympe.host.P.Ge,olympe.Va.node.host.Je,olympe.host.P.Ca,olympe.net.P.nj,new olympe.V.oa(olympe.host.Config.Nr),new olympe.V.oa(olympe.host.Config.dr))},'olympe.native.node.host');olympe.V.run([olympe.host.P.Ge],a=>{olympe.Va.node.host.ll=()=>a});olympe.net.ve={};function Jc(a,b,c){const d=olympe.net.va.Tb.Mo,e=olympe.net.va.Tb.gj,f=new AbortController;a.j.set(b,()=>f.abort());const g=c.j(),h=c.method;let k;return fetch(g,{method:h,headers:c.Cj(),body:null!=(k=c.body)?k:void 0,signal:f.signal}).then(l=>l.ok?hd(l,c.D).catch(n=>new olympe.net.pd(`Error parsing response from ${g} with method ${h}: ${n.message}`,e,'Error handling response')):new olympe.net.pd(`Error fetching data from ${g} with method ${h}`,l.status,l.statusText,l.headers)).catch(l=>'AbortError'===
469
- l.name?new olympe.net.pd('',d,'Request canceled'):new olympe.net.pd(`Error connecting to ${g} with method ${h}`,e,'Failed to fetch:'+l.message))}
470
- function hd(a,b){return u(function*(){switch(b){case olympe.net.va.ResponseType.Hl:var c=yield a.blob();break;case olympe.net.va.ResponseType.$h:c=yield a.arrayBuffer();c=new Uint8Array(c,0,c.byteLength);break;case olympe.net.va.ResponseType.JSON:c=yield a.json();break;case olympe.net.va.ResponseType.je:c=a.body;break;default:c=yield a.text()}return new olympe.net.pd(c,a.status,a.statusText,a.headers)})}olympe.net.ve.Bu=class{constructor(a){this.G=a;this.j=new Map}};olympe.net.ve.WebSocket=class{constructor(a,b){this.G=b;this.id=a;this.j=null;this.buffer=[];this.N=this.F=this.H=this.R=null}T(){return this.id}open(a){const b=`#${this.id}`,c=this.ia(a);c.binaryType='arraybuffer';c.addEventListener('open',()=>{this.G.info(`Websocket ${b} OPENED`);this.R?(this.G.debug('Notifying upper layer for WebSocket',b),this.R()):this.G.warn('Nothing to notify for WebSocket',b);this.G.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));
448
+ function Vc(a,b,c,d){return u(function*(){Qc(a,'Cannot consume a queue without being connected to the bus');a.G.debug(`Will consume queue: ${b}..`);const e=a.j,f={exclusive:c,noAck:!1},g=yield a.push(()=>e.basicConsume(b,f,h=>{a.G.j()&&a.G.debug(`AMQP < [${b}]: ${h.bodyToString()}`);d(new olympe.net.AMQPMessage(h,b,e))}));a.D.get(b).yn=g;a.G.debug(`Consumer ${g.tag} subscribed to queue: ${b}, on channel ${e.id}`);g.wait().catch(h=>{a.G.debug(`Consumer of queue ${b} has been closed: ${h}`);h=Rc(h);
449
+ if(h===olympe.net.AMQPClient.D.Um||h===olympe.net.AMQPClient.D.Wk)h=Math.round(5E3*Math.random()),a.G.warn(`Consumer of queue ${b} has been forced closed, will recreate the queue in ${h}ms..`),setTimeout(()=>{a.j===e&&!1===(null==e?void 0:e.closed)&&Sc(a,b,c,d).catch(k=>{a.G.error(`Failed to resubscribe to queue ${b}: ${k}`)})},h)})})}
450
+ function Yc(a,{id:b,Nz:c}={}){return u(function*(){const d=yield a.H.channel(b);d.onerror=null!=c?c:e=>{a.G.debug(`Error with channel (${d.id}): ${e}`)};return d})}
451
+ function Zc(a,b,c){return u(function*(){Qc(a,'Cannot bind a queue without being connected to the bus');var d;if(null==(d=a.D.get(b))?0:d.Bl.has(c))throw Error(`Queue ${b} already bound to topic ${c}`);d=yield Yc(a);try{a.G.debug(`Binding queue ${b} to topic ${c}`),yield d.queueBind(b,'amq.topic',c),a.D.get(b).Bl.add(c)}finally{yield d.close()}})}
452
+ function $c(a,b,c){return u(function*(){Qc(a,'Cannot unbind a queue without being connected to the bus');const d=yield Yc(a);try{a.G.debug(`Unbinding queue ${b} to topic ${c}`);let e,f;null==(e=a.D.get(b))||null==(f=e.Bl)||f.delete(c);yield d.queueUnbind(b,'amq.topic',c)}finally{try{yield d.close()}catch(e){}}})}
453
+ olympe.net.AMQPClient=class{constructor(a,b){this.G=olympe.ga.Wa('amqp');this.X=this.F=!1;this.N=null;this.name=b;this.j=this.H=null;this.state=new olympe.U.Fw(this.G);this.D=new Map;this.R=new Map;this.wa=new olympe.U.promise.Tk;const c=olympe.U.Promise.uj(()=>{const d=olympe.net.AMQPClient.j.CONNECTING,e=olympe.net.AMQPClient.j.zc,f=this.state.getState();f===e?this.F&&F(this.state,d):f!==d&&F(this.state,e,this.F)},0);a.subscribe(d=>{this.G.j()&&this.G.debug('New AMQP configuration received',d);
454
+ this.N=d;null!==d&&(this.X=!1,c().then())});Kc(this)}connect(){const a=this;return u(function*(){if(Pc(a))return a;a.state.getState()===olympe.net.AMQPClient.j.zc&&F(a.state,olympe.net.AMQPClient.j.CONNECTING);yield lb(a.state,olympe.net.AMQPClient.j.Ae);return a})}disconnect(){const a=this;return u(function*(){const b=olympe.net.AMQPClient.j.zc;a.state.getState()!==b&&(F(a.state,b,!1),yield lb(a.state,b))})}ld(a,b,c,d={mandatory:!1,Bt:!1}){const e=this;return u(function*(){Qc(e,'Cannot publish a message without being connected to the bus');
455
+ const f=JSON.stringify(c);e.G.j()&&e.G.debug(`AMQP > [${b}]: ${f}`);return(new Promise((g,h)=>{e.R.set(a,l=>h(new olympe.error.Pq(`Impossible to deliver message to topic "${b}": ${l}`)));const k={messageId:String(a)};e.push(()=>e.j.basicPublish(d.Bt?'amq.topic':'',b,f,k,d.mandatory)).then(()=>g()).catch(l=>{l=Rc(l)===olympe.net.AMQPClient.D.Um?new olympe.error.Hm(`Topic ${b} not deployed.`):Error(`Failed to publish a message ${f} to topic ${b}: ${l}`);h(l)})})).finally(()=>e.R.delete(a))})}ia(){const a=
456
+ this;return u(function*(){if(null===a.N)throw Error('Cannot connect to the bus without a configuration');a.H=a.Z(a.N,a.name);try{let b;yield olympe.U.Promise.rt(a.Ha.bind(a),(null!=(b=a.N.pt)?b:5E3)/2,[olympe.error.Wl]);a.G.debug('AMQP Client connected')}catch(b){if(b instanceof Event&&'close'===b.type)throw Error('Bus not ready, will try to reconnect..');throw b;}})}Ha(a){const b=this;return u(function*(){b.G.debug(`Connecting to the bus, tentative ${a+1}..`);b.H.onerror=d=>{if(d instanceof amqp.AMQPError){var e=
457
+ olympe.error.lc.Tl;const f=olympe.error.lc.Hq,g=Rc(d);if(g===e||g===f){b.G.debug(`Connection closed by network: ${d}`);F(b.state,olympe.net.AMQPClient.j.zc,b.F);return}}else b.F=!1;e=b.state;F(e,e.j,d)};try{yield b.H.connect(),b.ba(b.H,d=>{b.G.debug(`AMQP connection closed ${d?'with error':'without error'}`);d||F(b.state,olympe.net.AMQPClient.j.zc,b.F)})}catch(d){if(d instanceof Error)switch(Rc(d)){case olympe.error.lc.Tl:case olympe.error.lc.Hq:throw new olympe.error.Wl(d);case olympe.error.lc.Fq:case olympe.error.lc.Gq:case olympe.error.lc.kk:throw b.X=
458
+ !0,new olympe.error.uk('Connection to the bus is not allowed: check your credentials');}throw new olympe.error.pd(`Connection to the bus failed: check your config and the availability of the bus: ${d}`);}const c=()=>u(function*(){b.j=yield Yc(b,{id:1,Nz:e=>{b.G.debug(`Error with channel 0: ${e}`);b.j=null;e=Rc(e);e!==olympe.net.AMQPClient.D.Um&&e!==olympe.net.AMQPClient.D.dr||olympe.U.Promise.rt(f=>{b.G.warn(`Trying to recreate channel after being closed, tentative ${f+1}..`);return c()},500).catch(f=>
459
+ {var g=b.state;F(g,g.j,f)})}});yield b.j.confirmSelect();let d;yield b.j.prefetch(null!=(d=b.N.Zz)?d:20);b.j.onReturn=e=>{const f=`Message returned by the server: ${e.bodyToString()}`;let g;null==(g=b.R.get(parseInt(e.properties.messageId,10)))||g(f)};b.D.forEach(({On:e,exclusive:f},g)=>{Sc(b,g,f,e)})});yield c()})}push(a){return vb(this.wa,a)}Z(){}ba(){}};olympe.net.AMQPClient.j={CONNECTING:'CONNECTING',Ae:'CONNECTED',zc:'DISCONNECTED',Ab:'ERROR'};
460
+ olympe.net.AMQPClient.D={Wk:0,Um:404,OC:405,dr:406,IA:504,fq:541};function ad(a){let b;return null!=(b=a.F)?b:{}}
461
+ olympe.net.AMQPMessage=class{constructor(a,b,c){this.H=a.redelivered;this.D=a.deliveryTag;this.N=a.routingKey;this.j=c;this.F=null;try{const d=a.bodyToString();this.F=JSON.parse(null!=d?d:'null')}catch(d){console.warn(`AMQPMessage: Failed to parse message payload: ${d}`)}}wi(){return this.H}ack(){return!1===this.j.closed?this.j.basicAck(this.D,!1).catch(a=>{olympe.ga.Wa('amqp').error(`Failed to ack message ${this.D}: ${a}`)}):Promise.resolve()}reject(a){return!1===this.j.closed?this.j.basicNack(this.D,
462
+ !1,a).catch(b=>{olympe.ga.Wa('amqp').error(`Failed to reject message ${this.D}: ${b}`)}):Promise.resolve()}};olympe.net.ci=class{constructor(a){this.G=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}F(){return Promise.reject('Try to restart web server with the browser implementation.')}stop(){return Promise.reject('Try to stop web server with the browser implementation.')}D(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}R(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
463
+ olympe.net.ci.ALL='*';olympe.net.Dw=class{register(){return u(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.P={Fa:'net.Manager',Da:'net.Logger',nj:'net.WebServer',vw:'net.ServiceWorkerManager',Jm:'net.OfflineConfig'};olympe.net.Config={Bf:'net.httpPort',Tp:'net.httpBodyLimit',ls:'net.http2',Sp:'net.httpsCertificatesPath',Bm:'net.localNetworkSuffix',bj:'offline.enabled',Im:'offline.autoBackOnline',Tq:'offline.downloadBatchSize'};
464
+ olympe.V.config(function(a){E(a,olympe.net.Config.Bf,3141);E(a,olympe.net.Config.Tp,100);E(a,olympe.net.Config.ls,!1);E(a,olympe.net.Config.Sp,null);E(a,olympe.net.Config.Bm,'frontend');E(a,olympe.net.Config.bj,!1);E(a,olympe.net.Config.Im,!1);E(a,olympe.net.Config.Tq,20);Xa(a,olympe.net.P.Fa);D(a,olympe.net.P.Da,[olympe.ga.P.Fa],b=>b.ad('net'));C(a,olympe.net.P.nj,olympe.net.ci,olympe.net.P.Da);C(a,olympe.net.P.vw,olympe.net.Dw);D(a,olympe.net.P.Jm,[new olympe.V.oa(olympe.net.Config.bj),new olympe.V.oa(olympe.net.Config.Im)],
465
+ (b,c)=>new Map([['offlineEnabled',b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Xa.node.host={};olympe.Xa.node.host.Sd=function(a,b){this.G=b};olympe.Xa.node.host.Sd.prototype.constructor=olympe.Xa.node.host.Sd;olympe.Xa.node.host.Sd.prototype.destroy=function(){};olympe.Xa.node.host.Sd.prototype.destroy=olympe.Xa.node.host.Sd.prototype.destroy;olympe.Xa.node.host.Sd.prototype.Wa=function(){return this.G};olympe.Xa.node.host.Sd.ya=[olympe.host.Pe.Sd];olympe.Xa.node.host.Kq=class{constructor(a){this.G=a}};olympe.Xa.node.host.Kq.ya=[olympe.host.Bu];olympe.Xa.node.host.Ed=class{constructor(){this.j={};this.H={}}destroy(){}N(a){clearTimeout(this.j[a]);delete this.j[a]}X(a,b,c){this.j[b]=setTimeout(c,a)}F(a){clearTimeout(this.j[a]);delete this.j[a]}R(a,b,c){this.H[b]=setInterval(c,a)}D(a){clearInterval(this.H[a]);delete this.H[a]}};olympe.host.Jq.register(olympe.host.Pe.Iq.ms,olympe.Xa.node.host.Ed);olympe.Xa.node.host.Ed.ya=[olympe.host.Pe.Ed];olympe.Xa.node.host.Uk=class{constructor(a){this.G=a}j(){return olympe.C.da.D}D(){return!0}};olympe.Xa.node.host.Uk.ya=[olympe.host.Uk];function bd(a){a.wa.D('readinessProbe','/readiness',[olympe.net.ua.Rd.GET],()=>cd(a,a.ba)).catch(b=>a.G.error(`Failed to add readiness health check route ${b}`));a.wa.D('livenessProbe','/liveness',[olympe.net.ua.Rd.GET],()=>cd(a,a.Z)).catch(b=>a.G.error(`Failed to add liveness health check route ${b}`));a.H(()=>a.wa.stop())}
466
+ function ed(a,b){b=Array.from(b.values()).map(c=>c());return Promise.allSettled(b).then(c=>{let d=!1;for(const e of c)'rejected'===e.status&&(d=!0,a.G.warn(`Failed to close some resource: ${e.reason}`));return d})}function fd(a){return u(function*(){try{const b=yield ed(a,a.N),c=yield ed(a,a.R),d=yield ed(a,a.X);if(b||c||d)throw Error('Failed to gracefully close the backend');}finally{a.N.clear(),a.R.clear(),a.X.clear()}})}
467
+ function cd(a,b){const c=olympe.net.ua.Tb.Qh,d=olympe.net.ua.Tb.gj;b=Array.from(b.values()).map(e=>e.apply(a));return 0===b.length?Promise.resolve(new olympe.net.qd('No healthCheck is set',c,'Nothing to check')):Promise.allSettled(b).then(e=>{let f=!1,g='Health check result: ';for(const h of e)'rejected'===h.status?(f=!0,e=h.reason,g+=`\n${e}`,a.G.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.qd(g,f?d:c,f?'Some services are not working':'Everything is OK')})}
468
+ olympe.Xa.node.host.Ke=class extends olympe.host.Ke{constructor(a,b,c,d=!0){super();this.G=a;this.wa=b;this.Ua=c;this.Z=new Map;this.ba=new Map;this.R=new Map;this.N=new Map;this.X=new Map;d&&bd(this)}j(a,b=olympe.U.hf(),c=olympe.host.Ke.j.ALL){switch(c){case olympe.host.Ke.j.LIVENESS:this.Z.set(b,a);break;case olympe.host.Ke.j.READINESS:this.ba.set(b,a);break;default:this.Z.set(b,a),this.ba.set(b,a)}return b}D(a){this.ba.delete(a);this.Z.delete(a)}H(a,b=olympe.U.hf()){this.R.set(b,this.$f(b,a,this.Ua));
469
+ return b}ia(a,b=olympe.U.hf(),c){this.N.set(b,this.$f(b,a,null!=c?c:this.Ua));return b}Ha(a,b=olympe.U.hf()){this.X.set(b,this.$f(b,a,this.Ua));return b}F(a){this.R.has(a)?this.R.delete(a):this.N.has(a)?this.N.delete(a):this.X.delete(a)}$f(a,b,c){return()=>olympe.U.Promise.$f(b(),c,`Shutdown hook ${a} has timeout`)}};olympe.V.config(function(a){E(a,olympe.host.Config.er,!0);E(a,olympe.host.Config.Pr,1E4);Va(a,olympe.host.P.Pp,olympe.Xa.node.host.Kq,olympe.host.P.Da);Va(a,olympe.host.P.Qk,olympe.Xa.node.host.Uk,olympe.host.P.Da);C(a,olympe.host.P.He,olympe.Xa.node.host.Ke,olympe.host.P.Da,olympe.net.P.nj,new olympe.V.oa(olympe.host.Config.Pr),new olympe.V.oa(olympe.host.Config.er))},'olympe.native.node.host');olympe.V.run([olympe.host.P.He],a=>{olympe.Xa.node.host.ll=()=>a});olympe.net.we={};function Jc(a,b,c){const d=olympe.net.ua.Tb.No,e=olympe.net.ua.Tb.gj,f=new AbortController;a.j.set(b,()=>f.abort());const g=c.j(),h=c.method;let k;return fetch(g,{method:h,headers:c.Cj(),body:null!=(k=c.body)?k:void 0,signal:f.signal}).then(l=>l.ok?gd(l,c.D).catch(n=>new olympe.net.qd(`Error parsing response from ${g} with method ${h}: ${n.message}`,e,'Error handling response')):new olympe.net.qd(`Error fetching data from ${g} with method ${h}`,l.status,l.statusText,l.headers)).catch(l=>'AbortError'===
470
+ l.name?new olympe.net.qd('',d,'Request canceled'):new olympe.net.qd(`Error connecting to ${g} with method ${h}`,e,'Failed to fetch:'+l.message))}
471
+ function gd(a,b){return u(function*(){switch(b){case olympe.net.ua.ResponseType.Kl:var c=yield a.blob();break;case olympe.net.ua.ResponseType.$h:c=yield a.arrayBuffer();c=new Uint8Array(c,0,c.byteLength);break;case olympe.net.ua.ResponseType.JSON:c=yield a.json();break;case olympe.net.ua.ResponseType.je:c=a.body;break;default:c=yield a.text()}return new olympe.net.qd(c,a.status,a.statusText,a.headers)})}olympe.net.we.Cu=class{constructor(a){this.G=a;this.j=new Map}};olympe.net.we.WebSocket=class{constructor(a,b){this.G=b;this.id=a;this.j=null;this.buffer=[];this.N=this.F=this.H=this.R=null}T(){return this.id}open(a){const b=`#${this.id}`,c=this.ia(a);c.binaryType='arraybuffer';c.addEventListener('open',()=>{this.G.info(`Websocket ${b} OPENED`);this.R?(this.G.debug('Notifying upper layer for WebSocket',b),this.R()):this.G.warn('Nothing to notify for WebSocket',b);this.G.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));
471
472
  this.buffer.length=0});c.addEventListener('message',d=>{d='string'===typeof d.data?String(d.data):bb(d.data);(this.G.F()||this.G.j()&&!d.startsWith('pong'))&&this.G.debug(b,'<',d);this.F&&this.F(d)});c.addEventListener('close',()=>{this.G.info(`WebSocket ${b} CLOSED`);this.H&&this.H()});c.addEventListener('error',()=>{this.G.debug(`WebSocket ${b} ERROR`);this.N&&this.N()});this.j=c}send(a){const b=`#${this.id}`;if(null!==this.j){const c=this.j.constructor;switch(this.j.readyState){case c.OPEN:(this.G.F()||
472
473
  this.G.j()&&!a.startsWith('ping'))&&this.G.debug(b,'>',a);try{this.j.send(a)}catch(d){this.G.error(`Error while sending message to websocket: ${d}`)}break;case c.CONNECTING:this.G.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);break;default:return this.G.debug(b,'- Closed','>',a),!1}}else this.G.debug(b,'- Not opened yet: BUFFER','>',a),this.buffer.push(a);return!0}close(){if(null!==this.j){const a=this.j.constructor,b=this.j.readyState;if(b===a.OPEN||b===a.CONNECTING){this.G.debug(`Force closing native websocket ${`#${this.id}`}`);
473
- this.j.close(1E3);return}}this.G.debug('Try to force close native websocket, but not open nor connecting')}da(a){this.R=a||null}Z(a){this.F=a||null}D(a){this.N=a||null}X(a){this.H=a||null}ia(){}};olympe.net.ve.WebSocket.ya=[olympe.net.WebSocket];olympe.Va.node.net={};olympe.Va.node.net.Jv=class extends olympe.net.Ta{R(){return'NodeJS'}Vf(){return olympe.C.ba.D}D(a){var b=this.F++;a=a.j();this.G.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Va.node.net.Lv(b,this.G);b.open(a);return b}H(){this.G.warn('DOWNLOAD FILE not available with node native implementation. URL:')}N(a,b){return new olympe.Va.node.net.Kv(a,b)}};olympe.Va.node.net.Kv=class extends olympe.net.AMQPClient{Z(a,b='olympe-node'){var c=a.host;const d=a.port,e=a.path,f=a.sA,g=a.ez;var h=URL,k=a.xh?'amqps':'amqp';var l=a.user;a=a.dd;l=`${encodeURIComponent(f||'/')}|${encodeURIComponent(l)}|${encodeURIComponent(a)}`;c=new h(`${k}://${l}:_@${c}:${d}${e}/${f}`);0<g&&c.searchParams.append('heartbeat',`${g}`);c.searchParams.append('name',b);this.G.debug(`Open AMQP Socket to: ${c.toString()}`);return new amqp.AMQPClient(c.toString())}da(a,b){a.socket.on('close',
474
- b)}};olympe.Va.node.net.Lv=class extends olympe.net.ve.WebSocket{ia(a){return new (require('ws'))(a)}};olympe.Va.node.net.Config={hE:'native.html.net.useWorkers'};olympe.V.config(function(a){a.getParameter(olympe.net.Config.bj)&&a.setParameter(olympe.net.Config.bj,!1);Va(a,olympe.net.P.Fa,olympe.Va.node.net.Jv,olympe.net.P.Ca,olympe.host.P.Fa)},'olympe.native.node.net');olympe.Va.node.net.http={};const id=require('fastify'),{Readable:jd}=require('stream'),kd={Pk:0,Ok:1,Xm:2},ld=olympe.net.va.Rd.Tq,md=olympe.net.va.Headers.Jt,nd=olympe.net.va.Headers.Ht,od=olympe.net.va.Headers.It,pd=olympe.net.va.Tb.Qh;
475
- function qd(a,b){const c=b.methods,d=b.Ln,e=b.headers,f=b.origin;a.j.route({bodyLimit:a.X<<20,url:b.path,method:[...c,ld],handler:(g,h)=>{a.G.debug('Incoming request:','hostname:',g.hostname,'headers:',g.headers);var k=g.method;const l={[md]:f,[od]:c,[nd]:e};if(k===ld)return a.G.debug('< HTTP: OPTIONS'),h.code(pd).headers(l).send();var n=g.body;if(n instanceof Buffer){var p=new Uint8Array(n.length);n.copy(p)}else if('string'===typeof n||n instanceof Object)p=n;const [q,r]=g.hostname.split(':');k=
476
- new olympe.net.Si(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,v]of Object.entries(g.headers))k.headers[t]=v;a.G.debug('< HTTP:',k.toString());n=new Map(Object.entries(g.params));g=new Map(Object.entries(g.query));return d(k,n,g).then(t=>{const v=t.Jc(),x=t.getData();(x instanceof Uint8Array||x instanceof ArrayBuffer||x instanceof jd)&&h.type(olympe.net.va.Ul.je);if(v>=olympe.net.va.Tb.gj)throw Error(x);v>=olympe.net.va.Tb.Fl?a.G.warn('> HTTP: client bad request: reply with error:',
477
- x):a.G.debug('> HTTP: reply with body:',Buffer.isBuffer(x)?'binary':x);return h.code(v).headers(Object.assign(l,t.Cj())).send(x)}).catch(t=>{a.G.error('> HTTP: reply with internal server error:',t);return h.code(olympe.net.va.Tb.gj).headers(Object.assign(l,{[olympe.net.va.Headers.Ii]:'text/plain'})).send('Internal server error')})}})}
478
- olympe.Va.node.net.http.ci=class extends olympe.net.ci{constructor(a,b,c,d,e){super(a);this.X=c;this.port=b;this.Z=d;this.N=e;this.j=this.createServer();this.H=new Map;this.state=kd.Pk;this.jd=new Set;this.timer=null}D(a,b,c,d){const e=olympe.net.ci.ALL;this.H.set(a,{path:b,methods:c,Ln:d,headers:e,origin:e});return this.F()}R(a){const b=this;return u(function*(){b.H.delete(a);return 0<b.H.size?b.F():b.stop()})}start(){if(this.state===kd.Pk)return this.F();if(this.state===kd.Ok){for(const a of this.H.values())qd(this,
479
- a);return this.j.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.state=kd.Xm;this.G.debug('Web server listening on '+a);this.jd.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.jd.forEach(b=>b(a))}).finally(()=>this.jd.clear())}return Promise.reject('Try to start a webservice already started')}F(){return this.state===kd.Ok?(new Promise((a,b)=>{this.jd.add(c=>c?b(c):a())})).then(()=>this.F()):new Promise((a,b)=>{this.jd.add(c=>c?b(c):a());this.uj(()=>{const c=this;return u(function*(){c.state=
480
- kd.Ok;yield c.j.close();c.j=c.createServer();yield c.start()})})})}stop(){return this.state===kd.Xm?this.j.close().then(()=>{this.state=kd.Pk}):Promise.resolve()}createServer(){var a=olympe.ha.xb.j.ps,b=this.G.H();a={logger:{level:olympe.ha.xb.D[b===olympe.ha.xb.j.pk?a:b].toLowerCase()},http2:this.Z};if('string'===typeof this.N){b=require('fs');const c=require('path');Object.assign(a,{https:{allowHTTP1:!0,key:b.readFileSync(c.join(this.N,'key.pem')),cert:b.readFileSync(c.join(this.N,'cert.pem'))}})}a=
481
- id(a);a.addContentTypeParser('*',{parseAs:'buffer'},(c,d,e)=>{e(null,d)});return a}uj(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.V.config(function(a){C(a,olympe.net.P.nj,olympe.Va.node.net.http.ci,olympe.net.P.Ca,new olympe.V.oa(olympe.net.Config.Af),new olympe.V.oa(olympe.net.Config.Sp),new olympe.V.oa(olympe.net.Config.ks),new olympe.V.oa(olympe.net.Config.Rp))},'olympe.native.node.net.http');olympe.Va.node.U={};const rd=require('stream').Readable,sd=require('buffer');
482
- olympe.Va.node.U.Jl=class extends olympe.U.Jl{D(a){return new Uint8Array(Buffer.from(a,'base64'))}j(a){return a instanceof Uint8Array?Buffer.from(a,a.byteOffset,a.byteLength).toString('base64'):Buffer.from(a).toString('base64')}H(a){const b=this,c=()=>super.H;return u(function*(){if(a instanceof rd){const d=[];for(const e=ha(a);;){const f=yield e.next();if(f.done)break;d.push(f.value)}return Buffer.concat(d)}return c().call(b,a)})}F(a){return Promise.resolve().then(()=>sd.resolveObjectURL(a)).catch(b=>
483
- {throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.V.config(function(a){Va(a,olympe.U.P.Dg,olympe.Va.node.U.Jl)},'olympe.native.node.utils');olympe.async={};function td(a,b){a.H||a.X.push(a.F.rc(b))}
484
- olympe.async.sp=class{constructor(a,b=void 0===a){this.D=[];this.X=[];this.F=a||new olympe.C.Wb('Async executor context');this.ia=b;this.j=null;this.env=new Map;this.env.set('Executor',this);this.H=this.N=!1;this.G=null;this.timer=this.timeout=0;this.Z=olympe.U.Kc()}Zf(a){0<=a&&(this.timeout=a);return this}Xa(){return this.G}add(a){this.H||this.D.push(this.F.rc(a));return this}start(){this.N||(this.G&&this.G.log('Executor started.'),this.N=!0,this.F.onDestroy(()=>{this.j='Context destroyed.';this.complete(!1)},
485
- this.Z),0<this.timeout&&(this.timer=setTimeout(()=>{this.j='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.D=[];this.X=[];this.env.clear();this.ia&&this.F.destroy()}complete(a){this.F.Wf(this.Z);if(!this.H){this.H=!0;this.timer&&(clearTimeout(this.timer),this.timer=0);this.G&&this.G.log(a?'Executor completed successfully':`Executor completed with error: ${this.j}`);for(const b of this.X)b(a,a?null:this.j,this.env);this.clear()}}getContext(){return this.F}};
486
- function ud(a){if(0<a.D.length){const b=a.D.shift();a.G&&a.G.log(`Executing next task. ${a.D.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{ud(a)})},c=>{c&&(a.j=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.Bw=class extends olympe.async.sp{static create(){return new olympe.async.Bw(new olympe.C.Wb('SequencedExecutor'),!0)}start(){this.N||(super.start(),ud(this))}};
487
- olympe.async.Dk=class extends olympe.async.sp{constructor(a,b){super(a,b);this.R=0;this.da=!0}static create(){return new olympe.async.Dk(new olympe.C.Wb('ParallelExecutor'),!0)}run(a){this.G&&this.G.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.da=!1;b&&(this.j=this.j?`${this.j}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.N&&!this.H&&(this.R++,this.run(a));return this}done(){this.R--;0>=this.R&&this.complete(this.da)}start(){if(!this.N)if(super.start(),
488
- 0<this.D.length){this.R=this.D.length;for(const a of this.D)this.run(a)}else this.complete(!0)}};olympe.Db={};olympe.Db.pv=class{D(){return u(function*(){})}X(){}N(){}F(){}R(){}forEach(){}has(){}get(){}set(){}remove(){}da(){}Z(){}clear(){}H(){}};olympe.Db.qv=class{D(){}};olympe.Db.Storage=class{open(){}write(){}close(){}};olympe.Db.Av=class{get(){return null}set(){return this}delete(){}};olympe.Db.P={qk:'localStorage.KeyValueDatabaseManager',hj:'localStorage.Storage',SA:'localStorage.DatacloudStorage',zm:'localStorage.LocalStorage',Ca:'localStorage.Logger',$g:'localStorage.prefix'};olympe.V.config(function(a){Xa(a,olympe.Db.P.qk);D(a,olympe.Db.P.$g,[],()=>'olympe');D(a,olympe.Db.P.Ca,[olympe.ha.P.Fa],b=>b.ad('localstorage'));C(a,olympe.Db.P.zm,olympe.Db.Av)},'olympe.localstorage');olympe.L={};olympe.L.Xb={ik:'urls.FileSvc',vo:'urls.BackupSvc',ur:'urls.RestoreBackupSvc',Jg:'urls.GetContext',Jp:'urls.GraphDef',Io:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',js:'urls.UserTagFromToken',Ww:'urls.UserNameFromTag',Vw:'urls.UserRoles',iw:'urls.RoleMembers',wk:'urls.OpenIDSvc'};
489
- olympe.V.config(a=>{E(a,olympe.L.Xb.ik,'rest/filesvc');E(a,olympe.L.Xb.vo,'rest/backupsvc');E(a,olympe.L.Xb.ur,'rest/backupsvc/restore');E(a,olympe.L.Xb.wk,'rest/openid');E(a,olympe.L.Xb.Jg,'rest/initialData');E(a,olympe.L.Xb.Jp,'rest/querysvc/graphDef');E(a,olympe.L.Xb.Io,'rest/querysvc/graphDef/static');E(a,olympe.L.Xb.TRANSACTION,'rest/transaction');E(a,olympe.L.Xb.js,'rest/token');E(a,olympe.L.Xb.Ww,'rest/authorization/getUserTag');E(a,olympe.L.Xb.Vw,'rest/authorization/getUserRoles');E(a,olympe.L.Xb.iw,
490
- 'rest/authorization/roleMembers')});function vd(a,b){a.validate=b.ack.bind(b);a.H=b.wi();return a}
491
- olympe.L.wa=class{constructor(a,b,c,d,e,f){this.ae=c;this.F=a;this.source=b;this.D=d;this.messageType=e;this.j=null!=f?f:null;this.H=!1;this.validate=()=>u(function*(){})}static F(a,b,c){const d=olympe.L.wa.D.Lm,e=ad(a);let f;var g=olympe.L.wa,h=e[olympe.L.wa.D.DESTINATION],k=e[olympe.L.wa.D.Zg],l=e[olympe.L.wa.D.Mk],n=e[olympe.L.wa.D.mg],p=e[olympe.L.wa.D.TYPE];b.R=c;return vd(new g(h,k,l,n,p,b.N(null!=(f=e[d])?f:null)),a)}wi(){return this.H}ic(){return this.F}jb(){return this.source}getType(){return this.messageType}ack(){return this.validate()}fa(a,b){const c=
492
- olympe.L.wa.D.Lm,d={[olympe.L.wa.D.DESTINATION]:this.F,[olympe.L.wa.D.Zg]:this.source,[olympe.L.wa.D.Mk]:this.ae,[olympe.L.wa.D.mg]:this.D,[olympe.L.wa.D.TYPE]:this.messageType};null!==this.j&&(a.X=b,d[c]=a.fa(this.j));return d}toString(){return`Message(dest: ${this.F}, src: ${this.source}, seqId: ${this.ae}, topic: ${this.D}, type: ${this.messageType}, payload: ${this.j})`}};olympe.L.wa.D={DESTINATION:'d',Zg:'s',Mk:'i',mg:'tp',TYPE:'t',Lm:'p',Hf:'tk'};
493
- olympe.L.wa.j={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,ms:4,je:5,mg:6,Ab:7,Ir:10,bs:11,hg:12,es:13,Wm:14,Ep:15};olympe.L.Ym=class extends olympe.L.wa{constructor(a,b,c,d,e,f,g){super(a,b,d,e,f,g);this.dd=c}static F(a,b,c){const d=olympe.L.wa.D.Lm,e=ad(a);let f;var g=olympe.L.Ym,h=e[olympe.L.wa.D.DESTINATION],k=e[olympe.L.wa.D.Zg],l=e[olympe.L.wa.D.Hf],n=e[olympe.L.wa.D.Mk],p=e[olympe.L.wa.D.mg],q=e[olympe.L.wa.D.TYPE];b.R=c;b=new g(h,k,l,n,p,q,b.N(null!=(f=e[d])?f:null));vd(b,a);return b}se(){return this.dd}fa(a,b){return Object.assign(super.fa(a,b),{[olympe.L.wa.D.Hf]:this.dd})}toString(){return`SignedMessage{dest: ${this.F}, src: ${this.source}, seqId: ${this.ae}, topic: ${this.D}, type: ${this.messageType}, token: ${this.dd}, payload: ${this.j}}`}};const wd=olympe.L.wa.j.SEND,xd=olympe.L.wa.j.GET,yd=olympe.L.wa.j.SUBSCRIBE,zd=olympe.L.wa.j.hg,Ad=olympe.L.wa.j.Ir,Bd=olympe.L.wa.j.Ab,Cd=olympe.L.wa.j.ms,Dd=olympe.L.wa.j.mg,Ed=olympe.L.wa.j.bs;
494
- olympe.L.Fc=class{constructor(a,b,c){this.j=a;this.D=b;this.F=c;this.user=null;Object.defineProperties(this,{D:{enumerable:!1},F:{enumerable:!1}})}Bi(){return null!==this.user?Promise.resolve(this.user):Fd(this.D,this.j).then(a=>this.user=a)}wi(){return this.j.wi()}qt(){return this.j.getType()}source(){return this.j.jb()}body(){return this.j.j}ack(){const a=this;return u(function*(){if(a.j.getType()!==wd)throw Error('Should only call `ack` on SEND requests');yield a.j.ack();yield a.D.cd(a.j,Ad)})}cd(a){const b=
495
- this;return u(function*(){const c=b.j.getType();if(c===xd||c===zd)yield b.j.ack(),yield b.D.cd(b.j,Cd,a);else throw Error('Should only call `reply` on GET requests');})}Rn(a){return this.j.getType()!==yd?Promise.reject(Error('Should only call `notifyOn` on SUBSCRIBE requests')):new Promise((b,c)=>{const d=`sub_${olympe.U.Kc()}`,e={seq:Gd(this.D,f=>{switch(f.getType()){case Ed:Hd(this.F,d);b(d);break;case Bd:c(f.j.reason);break;default:c('Unsupported response type for a SUBSCRIBE request')}}),topic:a,
496
- id:d,refresh:this.D.ef};this.j.ack().then(()=>this.D.cd(this.j,Dd,e)).catch(c)})}li(a){const b=this;return u(function*(){yield b.D.cd(b.j,Bd,{reason:a.message})})}};olympe.L.Fc.prototype.fail=olympe.L.Fc.prototype.li;olympe.L.Fc.prototype.notifyOn=olympe.L.Fc.prototype.Rn;olympe.L.Fc.prototype.reply=olympe.L.Fc.prototype.cd;olympe.L.Fc.prototype.ack=olympe.L.Fc.prototype.ack;olympe.L.Fc.prototype.body=olympe.L.Fc.prototype.body;olympe.L.Fc.prototype.source=olympe.L.Fc.prototype.source;
497
- olympe.L.Fc.prototype.requestType=olympe.L.Fc.prototype.qt;olympe.L.Fc.prototype.isRedelivered=olympe.L.Fc.prototype.wi;olympe.L.Fc.prototype.userTag=olympe.L.Fc.prototype.Bi;function Id(a,b){b&&a.qf();null===a.D&&(a.D=setInterval(a.qf.bind(a),a.F))}function Jd(a){if(null!==a.D){var b=a.D;a.D=null;clearInterval(b)}}function Kd(a){return Array.from(a.j.values()).reduce((b,c)=>b+c.size,0)}function Ld(a,b,c){const d=a.j.get(b);c=!(null==d||!d.delete(c));0===(null==d?void 0:d.size)&&a.j.delete(b)&&0===a.j.size&&Jd(a);return c}function Md(a){a.j.forEach((b,c)=>{b.forEach((d,e)=>{Ld(a,c,e);null==d||d(new olympe.error.Ph(`Subscription ${e} to be refreshed`,e))})})}
498
- function Nd(a,b,c){let d;null==(d=a.j.get(b))||d.forEach((e,f)=>{Ld(a,b,f);e(c)})}
499
- olympe.L.Hw=class{constructor(a,b,c,d){this.G=a;this.H=b;this.N=c;this.F=d;this.j=new Map;this.D=null}qf(){if(Od(this.H)){var a=olympe.L.wa.j.hg;this.j.forEach((b,c)=>{this.H.request(c,this.N,a,Array.from(b.keys()),!0).then(d=>{d=d.j;0<d.length&&d.forEach(e=>{let f;const g=null==(f=this.j.get(c))?void 0:f.get(e);Ld(this,c,e);null==g||g(new olympe.error.Ph('Subscription does not exist in the service.',e))})}).catch(d=>{const e=`Impossible to keep alive subscriptions of provider ${c}: ${d}`;d instanceof
500
- olympe.error.Oq?d=new olympe.error.Ph('Subscriptions must be re-subscribed.'):(this.G.error(e),d=Error(e));Nd(this,c,d)})})}else Jd(this)}};const Pd=new Set([olympe.L.wa.j.SUBSCRIBE,olympe.L.wa.j.GET,olympe.L.wa.j.SEND,olympe.L.wa.j.mg,olympe.L.wa.j.je,olympe.L.wa.j.hg]);function Fd(a,b){return new Promise((c,d)=>{a.H.qh(b.se(),(e,f)=>{e?d(e):c(f)})})}function Gd(a,b){a.sa++;const c=a.sa;a.X.set(c,d=>{a.X.delete(c);b(d)});return c}function Od(a){return Qd(a.vd)&&Pc(a.F)}
501
- function Rd(a){Oc(a.F,()=>{a.Ha&&Sd(a);a.Ha=!1});Nc(a.F,()=>{a.Ha&&a.G.info('Reconnecting to bus...');a.N=!0});Mc(a.F,()=>{Td(a).then(()=>{a.Ha=!0;a.N=!1;Ud(a)}).catch(b=>{a.G.error(`An error occurred while trying to subscribe to the session: ${b}`);a.disconnect().catch(c=>{a.G.error(`An error occurred while trying to disconnect from the bus: ${c}`)})})})}
502
- function Vd(a,b){return u(function*(){var c;const d=null==(c=a.D)?void 0:c.get(b);d&&(Jd(d),a.D.delete(b));a.G.debug(`Bus: Unsubscribe from ${b}`);c=a.yb.delete(b)?[a.j,b]:[a.j];yield Promise.all(c.map(e=>u(function*(){if(b!==e)try{yield $c(a.F,e,b)}catch(f){a.G.debug(`Failed to unbind topic ${b} from queue ${e}: ${f}`)}else try{a.Z.delete(b),yield Xc(a.F,e)}catch(f){a.G.debug(`Failed to unsubscribe from queue ${e}: ${f}`)}})))})}
503
- function Wd(a,b,c,d=!0){return u(function*(){Od(a)||(yield a.connect());const e=d?[a.j]:[a.j,b];a.Z.set(b,c);!d&&a.yb.add(b);yield Promise.all(e.map(f=>u(function*(){a.F.D.has(f)||(a.G.debug(`Bus: Subscribe to queue ${f}..`),yield Wc(a.F,f,f===a.j,a.sg.bind(a,f)));var g;if(!(g=b===f)){let h,k;g=null!=(k=null==(h=a.F.D.get(f))?void 0:h.yl.has(b))?k:!1}g||(yield Zc(a.F,f,b));a.G.debug(`Subscribed to topic ${b} over queue: ${f}`)})))})}
504
- function Sd(a){a.G.info('Disconnected from bus.');let b;null==(b=a.D)||b.forEach((c,d)=>{null!==c.D&&(a.G.info(`Disconnected from bus: pause keep alive of ${Kd(c)} subscriptions for ${d} service.`),Jd(c))})}function Td(a){return u(function*(){a.G.debug('Connection to bus established. Listening to responses on topic',a.j);yield Wd(a,a.j,b=>{let c;null==(c=a.X.get(b.ae))||c(b)},!0)})}
505
- function Ud(a){a.G.j()?a.G.debug(`Connected to bus: subscribe to ${a.Z.size} active topics.`):a.G.info(`Connected to bus (session: ${a.j}).`);let b;null==(b=a.D)||b.forEach((c,d)=>{null===c.D&&(a.G.debug(`Connected to bus: start keep alive of ${Kd(c)} subscriptions for ${d} service.`),Id(c,!0))});a.R.forEach(c=>c(null));a.R=[]}function Xd(a){a.Fd=a.ia.j(()=>Od(a)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}
506
- function Yd(a,b,c,d=new Map){a.Md.j&&rb(a.Md,'com',d.set('id',`${b}`).set('channel','bus').set('eventType',c))}function Zd(a,b,c){const d=`${b}:${c}`;b=a.da.get(d);b||(b=new olympe.L.$q(()=>a.da.delete(d)),a.da.set(d,b));return b}
507
- function $d(a,b){const c=olympe.L.Me.Gg,d=olympe.L.Me.Eh,e=olympe.L.Me.Ab,f=b.j,{id:g,e:h}=f,k=`${b.jb()}:${g}`,l=Zd(a,b.jb(),g);if(h===c){fb(a.da.j,k);const {i:n,c:p}=f;l.write(p,n).catch(q=>{l.throw(q)})}else h===d?l.complete(f.s):h===e&&l.throw(Error(`Received stream error: ${f.reason}`));b.ack().catch(n=>a.G.error(`Failed to ack message: ${n}`))}
508
- function ae(a,b,c){return u(function*(){let d;if('number'===typeof c)d=c;else{const f=be(a,b,b,olympe.L.wa.j.Ep);d=f.ae;yield a.kd(f)}let e=a.Wa.get(d);e||(e=[],a.Wa.set(d,e));return olympe.U.Promise.Zf(new Promise(f=>{e.push(g=>f(g))}),15E3,`Timeout while getting the destination (sessionId) for message ${d}.`)})}function be(a,b,c,d,e){const f=ce(a.H).Gd();a.sa++;return new olympe.L.Ym(b,a.j,f,a.sa,c,d,e)}
509
- function de(a,b,c,d){const e=b.ae,f=h=>{g&&clearTimeout(g);a.X.delete(e);c(h)};a.X.set(e,f);const g=setTimeout(()=>f(new olympe.L.wa(a.j,a.j,e,b.D,olympe.L.wa.j.Ab,{reason:'Timeout',code:olympe.error.lc.TIMEOUT})),d)}function ee(a,b,c,d,e,f){null===a.D&&(a.D=new Map);var g=a.D.get(b);g?(a=g,a.F!==e&&(a.F=e,null!==a.D&&(Jd(a),Id(a,!1)))):(g=new olympe.L.Hw(a.G,a,b,e),a.D.set(b,g));e=g;g=e.j.size;a=e.j.get(c);a||(a=new Map,e.j.set(c,a));a.set(d,f);0===g&&Id(e,!1)}
510
- function fe(a,b,c,d){var e;const f=null==(e=a.D)?void 0:e.get(b);if(null==f?0:Ld(f,c,d))e=olympe.L.wa.j.es,Od(a)&&a.kd(be(a,c,b,e,d)).catch(g=>a.G.error(`Impossible to keep alive subscriptions: ${g}`)),0===Kd(f)&&(a.D.delete(b),0===a.D.size&&(a.D=null))}
511
- olympe.L.Ll=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.vd=c;this.H=d;this.ia=e;this.ke=f;this.Md=g;this.X=new Map;this.j=`${'olympe-runtime'}-${olympe.U.Kc()}`;this.nb=h.get('requestTimeout');this.ef=h.get('subscriptionsRefreshRate');this.Qc=h.get('allowGuest');a=h.get('connection');d=this.H.dd.tb().asObservable();c=c.Vf().asObservable();c=rxjs.combineLatest([a,d,c]).pipe(rxjs.operators.map(([k,l,n])=>n.valueOf()?Object.assign({},k,{user:l.xc(),dd:l.Gd()}):null));this.F=b.N(c,this.j);Rd(this);
512
- this.Yb='';h.get('topicPrefix').subscribe(k=>{this.G.debug(`Bus: new topic prefix: ${k}`);const l=this.Yb;this.Yb=k;if(l!==k&&Od(this)){this.G.debug(`Resubscribe to queues with new topic prefix: ${k}`);Promise.all(Array.from(this.Z).map(([p,q])=>{const r=this;return u(function*(){yield Vd(r,p);yield Wd(r,p,q,r.yb.has(p))})})).catch(p=>this.G.error(`Failed to subscribe topics after changing the topic prefix: ${p}`));let n;null==(n=this.D)||n.forEach(p=>{Md(p)})}});this.mi=this.sa=0;this.D=null;this.N=
513
- !1;this.R=[];this.Z=new Map;this.yb=new Set;this.Wa=new Map;this.da=new olympe.U.Zh(this.nb);this.Pe=this.Fd='';this.Ha=this.Gc=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.R.forEach(e=>e(d));this.R=[]};Od(this)?a():this.N||this.Gc?this.R.push(d=>d?b(d):a()):Qd(this.vd)?(this.Gc=!0,olympe.C.nt([this.H.ql()],d=>{Xd(this);this.Gc=!1;d.valueOf()||this.Qc?(this.Qc||ge(this.H,()=>this.disconnect().then()),this.N=!0,this.R.push(e=>e?b(e):a()),this.F.connect().catch(e=>{this.N=!1;c(e)}),
514
- this.Pe=this.ia.Ha(()=>this.disconnect(),'Bus websocket')):c(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter!'))})):c(Error('Cannot connect to the bus if working offline'))})}disconnect(){const a=this;return u(function*(){a.G.debug('Disconnecting from bus');a.H.R.delete('busLogoutCallback');a.ia.D(a.Fd);a.ia.F(a.Pe);yield a.F.disconnect()})}kd(a,b=!1){const c=this;return u(function*(){if(!c.N||a.getType()!==olympe.L.wa.j.hg){Od(c)||
515
- (yield c.connect());var d=a.F.startsWith('olympe-runtime'),e=d?a.ic():c.Yb+a.ic();try{Yd(c,a.ae.toString(),'serialize');var f=a.fa(c.ke,c.tg.bind(c,a.D,a.ae));c.G.j()&&c.G.debug(`BUS > #${e}:`,JSON.stringify(f))}catch(h){throw Error(`An error occurred while serializing the message (seqId=${a.ae}): ${h}`);}var g=Pd.has(a.getType());yield c.F.kd(a.ae,e,f,{mandatory:g,Bt:!(d||b)});Yd(c,a.ae.toString(),'publish',(new Map).set('destination',a.ic()).set('messageType',a.getType().toString()))}})}tg(a,b,
516
- c){const d=this.mi++;(()=>{const e=this;return u(function*(){let f;try{f=yield ae(e,a,b)}catch(p){e.G.error(`Error to get the destSessionId for the stream ${d}: ${p}`);return}const g=p=>e.kd(new olympe.L.wa(f,e.j,b,a,olympe.L.wa.j.je,p)),h=olympe.L.Me.Gg,k=olympe.L.Me.Eh,l=olympe.L.Me.Ab;let n=0;try{for(const p=ha(c);;){const q=yield p.next();if(q.done)break;const r=q.value;yield g({id:d,i:n++,e:h,c:r})}yield g({id:d,s:n,e:k})}catch(p){yield g({id:d,e:l,reason:`Error to complete the stream: ${p}`})}})})();
517
- return d}cd(a,b,c){return this.send(a.ae,a.jb(),a.jb(),b,c)}send(a,b,c,d,e){return this.kd(new olympe.L.wa(c,this.j,a,b,d,e))}request(a,b,c,d,e,f){const g=be(this,a,b,c,d);return c===olympe.L.wa.j.PUBLISH?this.kd(g,e):new Promise((h,k)=>{de(this,g,h,null!=f?f:this.nb);this.kd(g,e).catch(k)})}sg(a,b){const c=olympe.L.wa.D.Zg;a=olympe.L.wa.D.Mk;var d=olympe.L.wa.D.Hf;const e=ad(b);this.G.j()&&this.G.debug(`BUS < #${b.N}:`,JSON.stringify(e));Yd(this,e[a],'consumed');a=void 0===e[d]?olympe.L.wa.F:olympe.L.Ym.F;
518
- d=null;let f=!1;try{d=a.call(null,b,this.ke,h=>{f=!0;return Zd(this,e[c],h).stream}),Pd.has(d.getType())||b.ack().catch(h=>this.G.error(`Failed to ack message: ${h}`))}catch(h){this.G.error(`An error occurred while trying to deserialize the message: ${JSON.stringify(e)} with error ${h}`);bd(b).catch(k=>this.G.error(`Failed to reject message: ${k}`));return}const g=d;b=g.ae;Yd(this,b.toString(),'deserialized',(new Map).set('source',g.jb()).set('messageType',g.getType().toString()));switch(g.getType()){case olympe.L.wa.j.je:$d(this,
519
- g);break;case olympe.L.wa.j.Ep:this.cd(g,olympe.L.wa.j.Wm).catch(k=>this.G.error(`Failed to reply to get session message: ${k}`));break;case olympe.L.wa.j.Wm:let h;null==(h=this.Wa.get(b))||h.forEach(k=>k(g.jb()));break;default:f&&this.cd(g,olympe.L.wa.j.Wm).catch(k=>this.G.error(`Failed to send session id for stream publishing: ${k}`));try{let k;null==(k=this.Z.get(g.D))||k(g)}catch(k){this.G.error(`An error occurred while trying to handle the message: ${k}`)}}}};olympe.L.Ll.D='Timeout';
520
- olympe.L.Ll.j='olympe-runtime';const he=olympe.net.va.Headers.uo,ie=olympe.net.va.Tb.Qh,je=olympe.net.va.Tb.Oo,ke=olympe.net.va.Tb.Rj,le=olympe.net.va.Tb.pw,me=olympe.net.va.Tb.Mo,ne=olympe.net.va.Tb.kk,oe=olympe.net.va.Tb.Qw,pe=olympe.net.va.Tb.Zi;function qe(a,b){let c;return null!=(c=a.F.get(b))?c:''}function re(a,b,c,d=new Map){a.j.j&&rb(a.j,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
521
- function se(a,b,c){if(null===b)return Promise.reject('No http request to send');Fc(b,{[he]:c});const d=b.j();return rxjs.firstValueFrom(rxjs.defer(()=>{a.D++;const e=a.D;if(a.G.j()){const f=b.body;a.G.debug('HTTP >',d,`body: ${'string'===typeof f?f:typeof f}`)}re(a,e,'request',(new Map).set('destination',b.j()).set('messageType',b.method.toString()));return Ic(a.H,b).then(f=>{re(a,e,'reply');switch(f.Jc()){case ie:case je:case ke:var g=f.getData();a.G.j()&&a.G.debug('HTTP <',f.Jc(),`content: ${'string'===
522
- typeof g?g:typeof g}`);return f;case le:throw f=`HTTP < Service provider for http request to ${b.j()} is overloaded, retry later`,a.G.warn(f),new olympe.error.ar(f);case me:return a.G.debug(`HTTP < request canceled (${b.j()}).`),f;case ne:case oe:throw f=`HTTP < request authorization denied: ${b.j()}, ${f.statusText}`,a.G.error(f),new olympe.error.uk(f);case pe:throw f=`HTTP < requested resource not found: ${b.j()}`,a.G.error(f),new olympe.error.Em(f);default:g=`HTTP < Error: ${f.Jc()}, ${f.statusText}`;
523
- a.G.error(g);if(500===f.Jc()&&'Connection refused'===f.statusText)throw new olympe.error.Uo(g);throw new olympe.error.od(g);}})}).pipe(sb(olympe.error.ar,(e,f)=>{a.G.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.N)))}olympe.L.yu=class{constructor(a,b,c,d,e){this.G=a;this.H=b;this.j=c;this.F=null;d.subscribe(f=>{this.F=f});this.N=e;this.D=0}};function O(a,b){if(a.state!==b)switch(a.G.debug('State change '+a.state+' --\x3e '+b),a.state=b,a.yb.forEach(c=>c(b)),b){case olympe.L.Na.j.Zk:case olympe.L.Na.j.CONNECTING:case olympe.L.Na.j.fp:break;case olympe.L.Na.j.ze:a.connected.update(olympe.C.ba.D);break;case olympe.L.Na.j.Tg:a.F=[0,0,a.F[2]];te(a);break;case olympe.L.Na.j.Ab:let c;a.G.error('Connection to server',null==(c=a.N)?void 0:c.j(),'aborted due to error');a.connected.update(olympe.C.ba.j);break;case olympe.L.Na.j.oo:te(a);break;case olympe.L.Na.j.zc:a.connected.update(olympe.C.ba.j);
474
+ this.j.close(1E3);return}}this.G.debug('Try to force close native websocket, but not open nor connecting')}ba(a){this.R=a||null}Z(a){this.F=a||null}D(a){this.N=a||null}X(a){this.H=a||null}ia(){}};olympe.net.we.WebSocket.ya=[olympe.net.WebSocket];olympe.Xa.node.net={};olympe.Xa.node.net.Kv=class extends olympe.net.Ta{R(){return'NodeJS'}qf(){return olympe.C.da.D}D(a){var b=this.F++;a=a.j();this.G.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Xa.node.net.Mv(b,this.G);b.open(a);return b}H(){this.G.warn('DOWNLOAD FILE not available with node native implementation. URL:')}N(a,b){return new olympe.Xa.node.net.Lv(a,b)}};olympe.Xa.node.net.Lv=class extends olympe.net.AMQPClient{Z(a,b='olympe-node'){var c=a.host;const d=a.port,e=a.path,f=a.tA,g=a.fz;var h=URL,k=a.xh?'amqps':'amqp';var l=a.user;a=a.dd;l=`${encodeURIComponent(f||'/')}|${encodeURIComponent(l)}|${encodeURIComponent(a)}`;c=new h(`${k}://${l}:_@${c}:${d}${e}/${f}`);0<g&&c.searchParams.append('heartbeat',`${g}`);c.searchParams.append('name',b);this.G.debug(`Open AMQP Socket to: ${c.toString()}`);return new amqp.AMQPClient(c.toString())}ba(a,b){a.socket.on('close',
475
+ b)}};olympe.Xa.node.net.Mv=class extends olympe.net.we.WebSocket{ia(a){return new (require('ws'))(a)}};olympe.Xa.node.net.Config={iE:'native.html.net.useWorkers'};olympe.V.config(function(a){a.getParameter(olympe.net.Config.bj)&&a.setParameter(olympe.net.Config.bj,!1);Va(a,olympe.net.P.Fa,olympe.Xa.node.net.Kv,olympe.net.P.Da,olympe.host.P.Fa)},'olympe.native.node.net');olympe.Xa.node.net.http={};const hd=require('fastify'),{Readable:id}=require('stream'),jd={Pk:0,Ok:1,$m:2},kd=olympe.net.ua.Rd.Uq,ld=olympe.net.ua.Headers.Jt,md=olympe.net.ua.Headers.Ht,nd=olympe.net.ua.Headers.It,od=olympe.net.ua.Tb.Qh;
476
+ function pd(a,b){const c=b.methods,d=b.On,e=b.headers,f=b.origin;a.j.route({bodyLimit:a.X<<20,url:b.path,method:[...c,kd],handler:(g,h)=>{a.G.debug('Incoming request:','hostname:',g.hostname,'headers:',g.headers);var k=g.method;const l={[ld]:f,[nd]:c,[md]:e};if(k===kd)return a.G.debug('< HTTP: OPTIONS'),h.code(od).headers(l).send();var n=g.body;if(n instanceof Buffer){var p=new Uint8Array(n.length);n.copy(p)}else if('string'===typeof n||n instanceof Object)p=n;const [q,r]=g.hostname.split(':');k=
477
+ new olympe.net.Si(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,v]of Object.entries(g.headers))k.headers[t]=v;a.G.debug('< HTTP:',k.toString());n=new Map(Object.entries(g.params));g=new Map(Object.entries(g.query));return d(k,n,g).then(t=>{const v=t.Kc(),x=t.getData();(x instanceof Uint8Array||x instanceof ArrayBuffer||x instanceof id)&&h.type(olympe.net.ua.Xl.je);if(v>=olympe.net.ua.Tb.gj)throw Error(x);v>=olympe.net.ua.Tb.Il?a.G.warn('> HTTP: client bad request: reply with error:',
478
+ x):a.G.debug('> HTTP: reply with body:',Buffer.isBuffer(x)?'binary':x);return h.code(v).headers(Object.assign(l,t.Cj())).send(x)}).catch(t=>{a.G.error('> HTTP: reply with internal server error:',t);return h.code(olympe.net.ua.Tb.gj).headers(Object.assign(l,{[olympe.net.ua.Headers.Ii]:'text/plain'})).send('Internal server error')})}})}
479
+ olympe.Xa.node.net.http.ci=class extends olympe.net.ci{constructor(a,b,c,d,e){super(a);this.X=c;this.port=b;this.Z=d;this.N=e;this.j=this.createServer();this.H=new Map;this.state=jd.Pk;this.kd=new Set;this.timer=null}D(a,b,c,d){const e=olympe.net.ci.ALL;this.H.set(a,{path:b,methods:c,On:d,headers:e,origin:e});return this.F()}R(a){const b=this;return u(function*(){b.H.delete(a);return 0<b.H.size?b.F():b.stop()})}start(){if(this.state===jd.Pk)return this.F();if(this.state===jd.Ok){for(const a of this.H.values())pd(this,
480
+ a);return this.j.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.state=jd.$m;this.G.debug('Web server listening on '+a);this.kd.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.kd.forEach(b=>b(a))}).finally(()=>this.kd.clear())}return Promise.reject('Try to start a webservice already started')}F(){return this.state===jd.Ok?(new Promise((a,b)=>{this.kd.add(c=>c?b(c):a())})).then(()=>this.F()):new Promise((a,b)=>{this.kd.add(c=>c?b(c):a());this.uj(()=>{const c=this;return u(function*(){c.state=
481
+ jd.Ok;yield c.j.close();c.j=c.createServer();yield c.start()})})})}stop(){return this.state===jd.$m?this.j.close().then(()=>{this.state=jd.Pk}):Promise.resolve()}createServer(){var a=olympe.ga.yb.j.qs,b=this.G.H();a={logger:{level:olympe.ga.yb.D[b===olympe.ga.yb.j.pk?a:b].toLowerCase()},http2:this.Z};if('string'===typeof this.N){b=require('fs');const c=require('path');Object.assign(a,{https:{allowHTTP1:!0,key:b.readFileSync(c.join(this.N,'key.pem')),cert:b.readFileSync(c.join(this.N,'cert.pem'))}})}a=
482
+ hd(a);a.addContentTypeParser('*',{parseAs:'buffer'},(c,d,e)=>{e(null,d)});return a}uj(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.V.config(function(a){C(a,olympe.net.P.nj,olympe.Xa.node.net.http.ci,olympe.net.P.Da,new olympe.V.oa(olympe.net.Config.Bf),new olympe.V.oa(olympe.net.Config.Tp),new olympe.V.oa(olympe.net.Config.ls),new olympe.V.oa(olympe.net.Config.Sp))},'olympe.native.node.net.http');olympe.Xa.node.U={};const qd=require('stream').Readable,rd=require('buffer');
483
+ olympe.Xa.node.U.Ml=class extends olympe.U.Ml{D(a){return new Uint8Array(Buffer.from(a,'base64'))}j(a){return a instanceof Uint8Array?Buffer.from(a,a.byteOffset,a.byteLength).toString('base64'):Buffer.from(a).toString('base64')}H(a){const b=this,c=()=>super.H;return u(function*(){if(a instanceof qd){const d=[];for(const e=ha(a);;){const f=yield e.next();if(f.done)break;d.push(f.value)}return Buffer.concat(d)}return c().call(b,a)})}F(a){return Promise.resolve().then(()=>rd.resolveObjectURL(a)).catch(b=>
484
+ {throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.V.config(function(a){Va(a,olympe.U.P.Dg,olympe.Xa.node.U.Ml)},'olympe.native.node.utils');olympe.async={};function sd(a,b){a.H||a.X.push(a.F.rc(b))}
485
+ olympe.async.tp=class{constructor(a,b=void 0===a){this.D=[];this.X=[];this.F=a||new olympe.C.Xb('Async executor context');this.ia=b;this.j=null;this.env=new Map;this.env.set('Executor',this);this.H=this.N=!1;this.G=null;this.timer=this.timeout=0;this.Z=olympe.U.Lc()}$f(a){0<=a&&(this.timeout=a);return this}Wa(){return this.G}add(a){this.H||this.D.push(this.F.rc(a));return this}start(){this.N||(this.G&&this.G.log('Executor started.'),this.N=!0,this.F.onDestroy(()=>{this.j='Context destroyed.';this.complete(!1)},
486
+ this.Z),0<this.timeout&&(this.timer=setTimeout(()=>{this.j='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.D=[];this.X=[];this.env.clear();this.ia&&this.F.destroy()}complete(a){this.F.Xf(this.Z);if(!this.H){this.H=!0;this.timer&&(clearTimeout(this.timer),this.timer=0);this.G&&this.G.log(a?'Executor completed successfully':`Executor completed with error: ${this.j}`);for(const b of this.X)b(a,a?null:this.j,this.env);this.clear()}}getContext(){return this.F}};
487
+ function td(a){if(0<a.D.length){const b=a.D.shift();a.G&&a.G.log(`Executing next task. ${a.D.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{td(a)})},c=>{c&&(a.j=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.Cw=class extends olympe.async.tp{static create(){return new olympe.async.Cw(new olympe.C.Xb('SequencedExecutor'),!0)}start(){this.N||(super.start(),td(this))}};
488
+ olympe.async.Dk=class extends olympe.async.tp{constructor(a,b){super(a,b);this.R=0;this.ba=!0}static create(){return new olympe.async.Dk(new olympe.C.Xb('ParallelExecutor'),!0)}run(a){this.G&&this.G.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.ba=!1;b&&(this.j=this.j?`${this.j}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.N&&!this.H&&(this.R++,this.run(a));return this}done(){this.R--;0>=this.R&&this.complete(this.ba)}start(){if(!this.N)if(super.start(),
489
+ 0<this.D.length){this.R=this.D.length;for(const a of this.D)this.run(a)}else this.complete(!0)}};olympe.Db={};olympe.Db.qv=class{D(){return u(function*(){})}X(){}N(){}F(){}R(){}forEach(){}has(){}get(){}set(){}remove(){}ba(){}Z(){}clear(){}H(){}};olympe.Db.rv=class{D(){}};olympe.Db.Storage=class{open(){}write(){}close(){}};olympe.Db.Bv=class{get(){return null}set(){return this}delete(){}};olympe.Db.P={qk:'localStorage.KeyValueDatabaseManager',hj:'localStorage.Storage',TA:'localStorage.DatacloudStorage',Cm:'localStorage.LocalStorage',Da:'localStorage.Logger',$g:'localStorage.prefix'};olympe.V.config(function(a){Xa(a,olympe.Db.P.qk);D(a,olympe.Db.P.$g,[],()=>'olympe');D(a,olympe.Db.P.Da,[olympe.ga.P.Fa],b=>b.ad('localstorage'));C(a,olympe.Db.P.Cm,olympe.Db.Bv)},'olympe.localstorage');olympe.L={};olympe.L.Yb={ik:'urls.FileSvc',wo:'urls.BackupSvc',vr:'urls.RestoreBackupSvc',Jg:'urls.GetContext',Kp:'urls.GraphDef',Jo:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',ks:'urls.UserTagFromToken',Xw:'urls.UserNameFromTag',Ww:'urls.UserRoles',jw:'urls.RoleMembers',wk:'urls.OpenIDSvc'};
490
+ olympe.V.config(a=>{E(a,olympe.L.Yb.ik,'rest/filesvc');E(a,olympe.L.Yb.wo,'rest/backupsvc');E(a,olympe.L.Yb.vr,'rest/backupsvc/restore');E(a,olympe.L.Yb.wk,'rest/openid');E(a,olympe.L.Yb.Jg,'rest/initialData');E(a,olympe.L.Yb.Kp,'rest/querysvc/graphDef');E(a,olympe.L.Yb.Jo,'rest/querysvc/graphDef/static');E(a,olympe.L.Yb.TRANSACTION,'rest/transaction');E(a,olympe.L.Yb.ks,'rest/token');E(a,olympe.L.Yb.Xw,'rest/authorization/getUserTag');E(a,olympe.L.Yb.Ww,'rest/authorization/getUserRoles');E(a,olympe.L.Yb.jw,
491
+ 'rest/authorization/roleMembers')});function ud(a,b){a.validate=b.ack.bind(b);a.N=b.reject.bind(b);a.H=b.wi();return a}
492
+ olympe.L.va=class{constructor(a,b,c,d,e,f){this.ae=c;this.F=a;this.source=b;this.D=d;this.messageType=e;this.j=null!=f?f:null;this.H=!1;this.validate=()=>u(function*(){});this.N=()=>u(function*(){})}static F(a,b,c){const d=olympe.L.va.D.Om,e=ad(a);let f;var g=olympe.L.va,h=e[olympe.L.va.D.DESTINATION],k=e[olympe.L.va.D.Zg],l=e[olympe.L.va.D.Mk],n=e[olympe.L.va.D.ng],p=e[olympe.L.va.D.TYPE];b.R=c;return ud(new g(h,k,l,n,p,b.N(null!=(f=e[d])?f:null)),a)}wi(){return this.H}ic(){return this.F}jb(){return this.source}getType(){return this.messageType}ack(){return this.validate()}reject(){return this.N()}fa(a,
493
+ b){const c=olympe.L.va.D.Om,d={[olympe.L.va.D.DESTINATION]:this.F,[olympe.L.va.D.Zg]:this.source,[olympe.L.va.D.Mk]:this.ae,[olympe.L.va.D.ng]:this.D,[olympe.L.va.D.TYPE]:this.messageType};null!==this.j&&(a.X=b,d[c]=a.fa(this.j));return d}toString(){return`Message(dest: ${this.F}, src: ${this.source}, seqId: ${this.ae}, topic: ${this.D}, type: ${this.messageType}, payload: ${this.j})`}};olympe.L.va.D={DESTINATION:'d',Zg:'s',Mk:'i',ng:'tp',TYPE:'t',Om:'p',If:'tk'};
494
+ olympe.L.va.j={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,ns:4,je:5,ng:6,Ab:7,Jr:10,cs:11,ig:12,gs:13,Zm:14,Fp:15};olympe.L.an=class extends olympe.L.va{constructor(a,b,c,d,e,f,g){super(a,b,d,e,f,g);this.dd=c}static F(a,b,c){const d=olympe.L.va.D.Om,e=ad(a);let f;var g=olympe.L.an,h=e[olympe.L.va.D.DESTINATION],k=e[olympe.L.va.D.Zg],l=e[olympe.L.va.D.If],n=e[olympe.L.va.D.Mk],p=e[olympe.L.va.D.ng],q=e[olympe.L.va.D.TYPE];b.R=c;b=new g(h,k,l,n,p,q,b.N(null!=(f=e[d])?f:null));ud(b,a);return b}te(){return this.dd}fa(a,b){return Object.assign(super.fa(a,b),{[olympe.L.va.D.If]:this.dd})}toString(){return`SignedMessage{dest: ${this.F}, src: ${this.source}, seqId: ${this.ae}, topic: ${this.D}, type: ${this.messageType}, token: ${this.dd}, payload: ${this.j}}`}};const vd=olympe.L.va.j.SEND,wd=olympe.L.va.j.GET,xd=olympe.L.va.j.SUBSCRIBE,yd=olympe.L.va.j.ig,zd=olympe.L.va.j.Jr,Ad=olympe.L.va.j.Ab,Bd=olympe.L.va.j.ns,Cd=olympe.L.va.j.ng,Dd=olympe.L.va.j.cs;
495
+ olympe.L.Fc=class{constructor(a,b,c){this.j=a;this.D=b;this.F=c;this.user=null;Object.defineProperties(this,{D:{enumerable:!1},F:{enumerable:!1}})}Bi(){return null!==this.user?Promise.resolve(this.user):Ed(this.D,this.j).then(a=>this.user=a)}wi(){return this.j.wi()}qt(){return this.j.getType()}source(){return this.j.jb()}body(){return this.j.j}ack(){const a=this;return u(function*(){if(a.j.getType()!==vd)throw Error('Should only call `ack` on SEND requests');yield a.j.ack();yield a.D.cd(a.j,zd)})}cd(a){const b=
496
+ this;return u(function*(){const c=b.j.getType();if(c===wd||c===yd)yield b.j.ack(),yield b.D.cd(b.j,Bd,a);else throw Error('Should only call `reply` on GET requests');})}Un(a){return this.j.getType()!==xd?Promise.reject(Error('Should only call `notifyOn` on SUBSCRIBE requests')):new Promise((b,c)=>{const d=`sub_${olympe.U.Lc()}`,e={seq:Fd(this.D,f=>{switch(f.getType()){case Dd:Gd(this.F,d);b(d);break;case Ad:c(f.j.reason);break;default:c('Unsupported response type for a SUBSCRIBE request')}}),topic:a,
497
+ id:d,refresh:this.D.Pf};this.j.ack().then(()=>this.D.cd(this.j,Cd,e)).catch(c)})}li(a){const b=this;return u(function*(){yield b.D.cd(b.j,Ad,{reason:a.message})})}};olympe.L.Fc.prototype.fail=olympe.L.Fc.prototype.li;olympe.L.Fc.prototype.notifyOn=olympe.L.Fc.prototype.Un;olympe.L.Fc.prototype.reply=olympe.L.Fc.prototype.cd;olympe.L.Fc.prototype.ack=olympe.L.Fc.prototype.ack;olympe.L.Fc.prototype.body=olympe.L.Fc.prototype.body;olympe.L.Fc.prototype.source=olympe.L.Fc.prototype.source;
498
+ olympe.L.Fc.prototype.requestType=olympe.L.Fc.prototype.qt;olympe.L.Fc.prototype.isRedelivered=olympe.L.Fc.prototype.wi;olympe.L.Fc.prototype.userTag=olympe.L.Fc.prototype.Bi;function Hd(a,b){b&&a.rf();null===a.D&&(a.D=setInterval(a.rf.bind(a),a.F))}function Id(a){if(null!==a.D){var b=a.D;a.D=null;clearInterval(b)}}function Jd(a){return Array.from(a.j.values()).reduce((b,c)=>b+c.size,0)}function Kd(a,b,c){const d=a.j.get(b);c=!(null==d||!d.delete(c));0===(null==d?void 0:d.size)&&a.j.delete(b)&&0===a.j.size&&Id(a);return c}function Ld(a){a.j.forEach((b,c)=>{b.forEach((d,e)=>{Kd(a,c,e);null==d||d(new olympe.error.Ph(`Subscription ${e} to be refreshed`,e))})})}
499
+ function Md(a,b,c){let d;null==(d=a.j.get(b))||d.forEach((e,f)=>{Kd(a,b,f);e(c)})}
500
+ olympe.L.Iw=class{constructor(a,b,c,d){this.G=a;this.H=b;this.N=c;this.F=d;this.j=new Map;this.D=null}rf(){if(Nd(this.H)){var a=olympe.L.va.j.ig;this.j.forEach((b,c)=>{this.H.request(c,this.N,a,Array.from(b.keys()),!0).then(d=>{d=d.j;0<d.length&&d.forEach(e=>{let f;const g=null==(f=this.j.get(c))?void 0:f.get(e);Kd(this,c,e);null==g||g(new olympe.error.Ph('Subscription does not exist in the service.',e))})}).catch(d=>{const e=`Impossible to keep alive subscriptions of provider ${c}: ${d}`;d instanceof
501
+ olympe.error.Pq?d=new olympe.error.Ph('Subscriptions must be re-subscribed.'):(this.G.error(e),d=Error(e));Md(this,c,d)})})}else Id(this)}};const Od=new Set([olympe.L.va.j.SUBSCRIBE,olympe.L.va.j.GET,olympe.L.va.j.SEND,olympe.L.va.j.ng,olympe.L.va.j.je,olympe.L.va.j.ig]);function Ed(a,b){return new Promise((c,d)=>{a.N.qh(b.te(),(e,f)=>{e?d(e):c(f)})})}function Fd(a,b){a.vb++;const c=a.vb;a.wa.set(c,d=>{a.wa.delete(c);b(d)});return c}function Nd(a){return Pd(a.Ha)&&Pc(a.D)}
502
+ function Qd(a){Oc(a.D,()=>{a.Ub&&Rd(a);a.Ub=!1});Nc(a.D,()=>{a.Ub&&a.G.info('Reconnecting to bus...');a.X=!0});Mc(a.D,()=>{Sd(a).then(()=>{a.Ub=!0;a.X=!1;Td(a)}).catch(b=>{a.G.error(`An error occurred while trying to subscribe to the session: ${b}`);a.disconnect().catch(c=>{a.G.error(`An error occurred while trying to disconnect from the bus: ${c}`)})})})}
503
+ function Ud(a,b){a.G.debug(`Bus: starting topic prefix: '${a.H}'`);const c=new rxjs.BehaviorSubject(!1);rxjs.combineLatest([b,c,a.D.state.F.asObservable(),a.Ha.qf().asObservable()]).pipe(rxjs.operators.filter(([d,e])=>Nd(a)&&a.H!==d&&!e)).pipe(rxjs.operators.switchMap(([d])=>u(function*(){c.next(!0);a.G.debug(`Bus: new topic prefix detected: '${d}' (current: '${a.H}')`);const e=[...a.ia.entries()],f=new Set([...a.ba.keys()]),g=a.H;a.G.debug(`Bus: ${e.length} topics found: ${e.map(([h])=>h)}`);a.G.debug(`Bus: ${f.size} shared topics found: ${[...f.keys()]}`);
504
+ try{a.G.debug('Bus: prefix change: unsubscribe from all topics');for(const [k]of e)yield Vd(a,k);a.H=d;a.G.debug('Bus: prefix change: subscribe again to all topics');for(const [k,l]of e)yield Wd(a,k,l,!f.has(k));a.G.debug('Bus: prefix change: force re-subscription');let h;null==(h=a.F)||h.forEach(k=>{Ld(k)});a.G.debug('Bus: prefix change: done!');c.next(!1)}catch(h){a.G.error(`Bus: was not able to change prefix: ${h}`),a.H=g,a.ia=new Map(e),a.ba=f,c.next(!1)}}))).subscribe(()=>{})}
505
+ function Rd(a){a.G.info('Disconnected from bus.');let b;null==(b=a.F)||b.forEach((c,d)=>{null!==c.D&&(a.G.info(`Disconnected from bus: pause keep alive of ${Jd(c)} subscriptions for ${d} service.`),Id(c))})}function Sd(a){return u(function*(){a.G.debug('Connection to bus established. Listening to responses on topic',a.j);yield Wd(a,a.j,b=>{let c;null==(c=a.wa.get(b.ae))||c(b)},!0)})}
506
+ function Td(a){a.R.info(`Connected to bus (session: ${a.j}).`);a.G.debug(`Connected to bus (session ${a.j}): subscribe to ${a.ia.size} active topics.`);let b;null==(b=a.F)||b.forEach((c,d)=>{null===c.D&&(a.G.debug(`Connected to bus: start keep alive of ${Jd(c)} subscriptions for ${d} service.`),Hd(c,!0))});a.Z.forEach(c=>c(null));a.Z=[]}
507
+ function Vd(a,b){return u(function*(){var c;const d=null==(c=a.F)?void 0:c.get(b);d&&(Id(d),a.F.delete(b));const e=Xd(a,b);c=a.ba.delete(b)?[a.j,e]:[a.j];a.G.debug(`Bus: Unsubscribe from ${b}`);yield Promise.all(c.map(f=>u(function*(){if(e!==f)try{yield $c(a.D,f,e)}catch(g){a.G.debug(`Failed to unbind topic ${e} from queue ${f}: ${g}`)}else try{a.ia.delete(b),yield Xc(a.D,f)}catch(g){a.G.debug(`Failed to unsubscribe from queue ${f}: ${g}`)}})))})}
508
+ function Wd(a,b,c,d=!0){return u(function*(){Nd(a)||(yield a.connect());a.ia.set(b,c);!d&&a.ba.add(b);const e=Xd(a,b);yield Promise.all((d?[[a.j,!0]]:[[a.j,!0],[e,!1]]).map(([f,g])=>u(function*(){a.D.D.has(f)||(a.G.debug(`Bus: Subscribe to queue ${f}..`),yield Wc(a.D,f,g,a.tg.bind(a,f)));var h;if(!(h=e===f)){let k,l;h=null!=(l=null==(k=a.D.D.get(f))?void 0:k.Bl.has(e))?l:!1}h||(yield Zc(a.D,f,e));a.G.debug(`Subscribed to topic ${e} over queue: ${f}`)})))})}
509
+ function Yd(a){a.Md=a.lb.j(()=>Nd(a)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}function Zd(a,b,c,d=new Map){a.ke.j&&rb(a.ke,'com',d.set('id',`${b}`).set('channel','bus').set('eventType',c))}function Xd(a,b,c=null){const d=$d(a,b,c);return!a.ba.has(d)&&null===c||!1===c||0===a.H.length?b:`${a.H}-${d}`}function ae(a,b,c){const d=`${b}:${c}`;b=a.Ua.get(d);b||(b=new olympe.L.ar(()=>a.Ua.delete(d)),a.Ua.set(d,b));return b}
510
+ function be(a,b){const c=olympe.L.Ne.Gg,d=olympe.L.Ne.Eh,e=olympe.L.Ne.Ab,f=b.j,{id:g,e:h}=f,k=`${b.jb()}:${g}`,l=ae(a,b.jb(),g);if(h===c){fb(a.Ua.j,k);const {i:n,c:p}=f;l.write(p,n).catch(q=>{l.throw(q)})}else h===d?l.complete(f.s):h===e&&l.throw(Error(`Received stream error: ${f.reason}`));b.ack().catch(n=>a.G.error(`Failed to ack message: ${n}`))}
511
+ function ce(a,b,c){return u(function*(){let d;if('number'===typeof c)d=c;else{const f=de(a,b,b,olympe.L.va.j.Fp);d=f.ae;yield a.ld(f)}let e=a.Gc.get(d);e||(e=[],a.Gc.set(d,e));return olympe.U.Promise.$f(new Promise(f=>{e.push(g=>f(g))}),15E3,`Timeout while getting the destination (sessionId) for message ${d}.`)})}function de(a,b,c,d,e){a.vb++;const f=ee(a.N).Gd();return new olympe.L.an(b,a.j,f,a.vb,c,d,e)}
512
+ function fe(a,b,c,d){const e=b.ae,f=h=>{g&&clearTimeout(g);a.wa.delete(e);c(h)};a.wa.set(e,f);const g=setTimeout(()=>f(new olympe.L.va(a.j,a.j,e,b.D,olympe.L.va.j.Ab,{reason:'Timeout',code:olympe.error.lc.TIMEOUT})),d)}function ge(a,b,c,d,e,f){null===a.F&&(a.F=new Map);var g=a.F.get(b);g?(a=g,a.F!==e&&(a.F=e,null!==a.D&&(Id(a),Hd(a,!1)))):(g=new olympe.L.Iw(a.G,a,b,e),a.F.set(b,g));e=g;g=e.j.size;a=e.j.get(c);a||(a=new Map,e.j.set(c,a));a.set(d,f);0===g&&Hd(e,!1)}
513
+ function he(a,b,c,d){var e;const f=null==(e=a.F)?void 0:e.get(b);if(null==f?0:Kd(f,c,d))e=olympe.L.va.j.gs,Nd(a)&&a.ld(de(a,c,b,e,d)).catch(g=>a.G.error(`Impossible to keep alive subscriptions: ${g}`)),0===Jd(f)&&(a.F.delete(b),0===a.F.size&&(a.F=null))}function $d(a,b,c=null){const d=b.substring(a.H.length);return a.ba.has(d)&&!1!==c?d:b}
514
+ olympe.L.Ol=class{constructor(a,b,c,d,e,f,g){this.G=olympe.ga.Wa('bus');this.R=olympe.ga.Wa('communication');this.Ha=b;this.N=c;this.lb=d;this.Qe=e;this.ke=f;this.wa=new Map;this.j=`${'olympe-runtime'}-${olympe.U.Lc()}`;this.Hc=g.get('requestTimeout');this.Pf=g.get('subscriptionsRefreshRate');this.Fd=g.get('allowGuest');b=rxjs.combineLatest([g.get('connection'),this.N.dd.tb().asObservable(),this.Ha.qf().asObservable()]).pipe(rxjs.operators.map(([h,k,l])=>l.valueOf()?Object.assign({},h,{user:k.xc(),
515
+ dd:k.Gd()}):null)).pipe(rxjs.operators.distinctUntilChanged((h,k)=>[...Object.keys(null!=k?k:{})].every(l=>(null!=h?h:{})[l]===(null!=k?k:{})[l])));this.D=a.N(b,this.j);Qd(this);this.H='';Ud(this,g.get('topicPrefix'));this.ol=this.vb=0;this.F=null;this.X=!1;this.Z=[];this.ia=new Map;this.ba=new Set;this.Gc=new Map;this.Ua=new olympe.U.Zh(this.Hc);this.ef=this.Md='';this.Ub=this.hd=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.Z.forEach(e=>e(d));this.Z=[]};Nd(this)?a():this.X||this.hd?
516
+ this.Z.push(d=>d?b(d):a()):Pd(this.Ha)?(this.hd=!0,olympe.C.nt([this.N.rl()],d=>{Yd(this);this.hd=!1;d.valueOf()||this.Fd?(this.Fd||ie(this.N,()=>this.disconnect().then()),this.X=!0,this.Z.push(e=>e?b(e):a()),this.D.connect().catch(e=>{this.X=!1;c(e)}),this.ef=this.lb.Ha(()=>this.disconnect(),'Bus websocket')):c(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter!'))})):c(Error('Cannot connect to the bus if working offline'))})}disconnect(){const a=
517
+ this;return u(function*(){a.G.debug('Disconnecting from bus');a.N.R.delete('busLogoutCallback');a.lb.D(a.Md);a.lb.F(a.ef);yield a.D.disconnect()})}ld(a,b=!1){const c=this;return u(function*(){if(!c.X||a.getType()!==olympe.L.va.j.ig){Nd(c)||(yield c.connect());var d=a.F.startsWith('olympe-runtime'),e=d?a.ic():Xd(c,a.ic(),!0);try{Zd(c,a.ae.toString(),'serialize');var f=a.fa(c.Qe,c.mi.bind(c,a.D,a.ae));c.R.j()&&c.R.j()&&c.R.debug(`BUS > #${e}:`,JSON.stringify(f))}catch(h){throw Error(`An error occurred while serializing the message (seqId=${a.ae}): ${h}`);
518
+ }var g=Od.has(a.getType());yield c.D.ld(a.ae,e,f,{mandatory:g,Bt:!(d||b)});Zd(c,a.ae.toString(),'publish',(new Map).set('destination',a.ic()).set('messageType',a.getType().toString()))}})}mi(a,b,c){const d=this.ol++;(()=>{const e=this;return u(function*(){let f;try{f=yield ce(e,a,b)}catch(p){e.G.error(`Error to get the destSessionId for the stream ${d}: ${p}`);return}const g=p=>e.ld(new olympe.L.va(f,e.j,b,a,olympe.L.va.j.je,p)),h=olympe.L.Ne.Gg,k=olympe.L.Ne.Eh,l=olympe.L.Ne.Ab;let n=0;try{for(const p=
519
+ ha(c);;){const q=yield p.next();if(q.done)break;const r=q.value;yield g({id:d,i:n++,e:h,c:r})}yield g({id:d,s:n,e:k})}catch(p){yield g({id:d,e:l,reason:`Error to complete the stream: ${p}`})}})})();return d}cd(a,b,c){return this.send(a.ae,a.jb(),a.jb(),b,c)}send(a,b,c,d,e){return this.ld(new olympe.L.va(c,this.j,a,b,d,e))}request(a,b,c,d,e,f){const g=de(this,a,b,c,d);return c===olympe.L.va.j.PUBLISH?this.ld(g,e):new Promise((h,k)=>{fe(this,g,h,null!=f?f:this.Hc);this.ld(g,e).catch(k)})}tg(a,b){const c=
520
+ olympe.L.va.D.Zg;a=olympe.L.va.D.Mk;var d=olympe.L.va.D.If;const e=ad(b);this.R.j()&&this.R.debug(`BUS < #${b.N}:`,JSON.stringify(e));Zd(this,e[a],'consumed');a=void 0===e[d]?olympe.L.va.F:olympe.L.an.F;d=null;let f=!1;try{d=a.call(null,b,this.Qe,h=>{f=!0;return ae(this,e[c],h).stream}),Od.has(d.getType())||b.ack().catch(h=>this.G.error(`Failed to ack message: ${h}`))}catch(h){this.G.error(`An error occurred while trying to deserialize the message: ${JSON.stringify(e)} with error ${h}`);b.reject().catch(k=>
521
+ this.G.error(`Failed to reject message: ${k}`));return}const g=d;b=g.ae;Zd(this,b.toString(),'deserialized',(new Map).set('source',g.jb()).set('messageType',g.getType().toString()));switch(g.getType()){case olympe.L.va.j.je:be(this,g);break;case olympe.L.va.j.Fp:this.cd(g,olympe.L.va.j.Zm).catch(k=>this.G.error(`Failed to reply to get session message: ${k}`));break;case olympe.L.va.j.Zm:let h;null==(h=this.Gc.get(b))||h.forEach(k=>k(g.jb()));break;default:f&&this.cd(g,olympe.L.va.j.Zm).catch(k=>this.G.error(`Failed to send session id for stream publishing: ${k}`));
522
+ try{let k;null==(k=this.ia.get(g.D))||k(g)}catch(k){this.G.error(`An error occurred while trying to handle the message: ${k}`)}}}};olympe.L.Ol.D='Timeout';olympe.L.Ol.j='olympe-runtime';const je=olympe.net.ua.Headers.vo,ke=olympe.net.ua.Tb.Qh,le=olympe.net.ua.Tb.Po,me=olympe.net.ua.Tb.Rj,ne=olympe.net.ua.Tb.qw,oe=olympe.net.ua.Tb.No,pe=olympe.net.ua.Tb.kk,qe=olympe.net.ua.Tb.Rw,re=olympe.net.ua.Tb.Zi;function se(a,b){let c;return null!=(c=a.F.get(b))?c:''}function te(a,b,c,d=new Map){a.j.j&&rb(a.j,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
523
+ function ue(a,b,c){if(null===b)return Promise.reject('No http request to send');Fc(b,{[je]:c});const d=b.j();return rxjs.firstValueFrom(rxjs.defer(()=>{a.D++;const e=a.D;if(a.G.j()){const f=b.body;a.G.debug('HTTP >',d,`body: ${'string'===typeof f?f:typeof f}`)}te(a,e,'request',(new Map).set('destination',b.j()).set('messageType',b.method.toString()));return Ic(a.H,b).then(f=>{te(a,e,'reply');switch(f.Kc()){case ke:case le:case me:var g=f.getData();a.G.j()&&a.G.debug('HTTP <',f.Kc(),`content: ${'string'===
524
+ typeof g?g:typeof g}`);return f;case ne:throw f=`HTTP < Service provider for http request to ${b.j()} is overloaded, retry later`,a.G.warn(f),new olympe.error.br(f);case oe:return a.G.debug(`HTTP < request canceled (${b.j()}).`),f;case pe:case qe:throw f=`HTTP < request authorization denied: ${b.j()}, ${f.statusText}`,a.G.error(f),new olympe.error.uk(f);case re:throw f=`HTTP < requested resource not found: ${b.j()}`,a.G.error(f),new olympe.error.Hm(f);default:g=`HTTP < Error: ${f.Kc()}, ${f.statusText}`;
525
+ a.G.error(g);if(500===f.Kc()&&'Connection refused'===f.statusText)throw new olympe.error.Vo(g);throw new olympe.error.pd(g);}})}).pipe(sb(olympe.error.br,(e,f)=>{a.G.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.N)))}olympe.L.zu=class{constructor(a,b,c,d,e){this.G=a;this.H=b;this.j=c;this.F=null;d.subscribe(f=>{this.F=f});this.N=e;this.D=0}};function O(a,b){if(a.state!==b)switch(a.G.debug('State change '+a.state+' --\x3e '+b),a.state=b,a.vb.forEach(c=>c(b)),b){case olympe.L.Na.j.Zk:case olympe.L.Na.j.CONNECTING:case olympe.L.Na.j.gp:break;case olympe.L.Na.j.Ae:a.connected.update(olympe.C.da.D);break;case olympe.L.Na.j.Tg:a.F=[0,0,a.F[2]];ve(a);break;case olympe.L.Na.j.Ab:let c;a.G.error('Connection to server',null==(c=a.N)?void 0:c.j(),'aborted due to error');a.connected.update(olympe.C.da.j);break;case olympe.L.Na.j.po:ve(a);break;case olympe.L.Na.j.zc:a.connected.update(olympe.C.da.j);
524
526
  break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}
525
- function ue(a){const b=olympe.L.Na.j.oo,c=olympe.L.Na.j.Zk,d=olympe.L.Na.j.zc,e=Ec(a.Z);a.G.info(`Trying to wakeup orchestrator with ${e}`);O(a,c);const f=a.Gc.D(a.Z);f.Z(g=>{const h=JSON.parse(g);a.G.info(`${e}: ${null==h?void 0:h.status}`);switch(null==h?void 0:h.status){case 'ready':O(a,b);f.close();break;case 'asleep':a.G.info(`Trying to wakeup orchestrator with ${e}`);f.send('{"action": "wakeup"}');O(a,c);break;case 'waking-up':break;default:a.G.warn(`Invalid message from ${e}: ${g}`),f.close(),
526
- O(a,d)}});f.D(()=>{a.G.warn(`Communication with ${e} failed.`);f.close();O(a,d)});f.da(()=>{a.G.info(`Checking orchestrator status with ${e}`);f.send('{"action": "status"}')})}
527
- function ve(a,b,c){a.G.log('Initializing COMMUNICATION layer');if(a.G.j()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.G.debug(d.join('\n\t'))}we(a,olympe.L.Ee.Ab,d=>{switch(d.c){case olympe.L.sk.Sw:a.G.error('Unknown message sent to the server:',olympe.L.Na.oc[d.s]);break;case olympe.L.sk.qu:a.G.error('Fatal error, the last message is probably too big according to the websocket config.'),a.D.forEach((e,f)=>{null!==e.Wn&&xe(a,f,d.i)})}});we(a,olympe.L.Ee.oc,d=>
528
- {d.c===olympe.L.sk.ew&&'boolean'===typeof d.a&&a.tg.update(olympe.C.Rb(d.a))});olympe.C.Gj(a.connected,()=>{let d=!1;olympe.C.Gj(a.Wa.j(),()=>{d&&(a.Qc(),a.nb(),d=!1);Cc(a.Qc.bind(a),a.Md);Cc(a.nb.bind(a),a.sa)},()=>{a.F=[0,0,a.F[2]];d=!0})},()=>{a.R=null;Bc(a.nb.bind(a),a.sa)});c.j(()=>ye(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.state}`));c.Ha(()=>a.disconnect(),'Orchestrator websocket');hb(a.H,(d,e)=>{e.throw(Error('Stream timeout'))});
529
- a.G.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}function ye(a){return a.state===olympe.L.Na.j.ze}function ze(a,b,c,d=!1){const e=f=>{if(0===b.length||b.includes(f))d&&a.yb.delete(e),c(f)};a.yb.add(e);e(a.state)}function Ae(a,b,c,d,e){a.da.j&&rb(a.da,'com',d.set('id',`${b}`).set('channel','ws').set('eventType',c),e)}
530
- function te(a){const b=olympe.L.Na.j.INIT,c=olympe.L.Na.j.CONNECTING,d=olympe.L.Na.j.ze,e=olympe.L.Na.j.zc,f=olympe.L.Na.j.Tg,g=olympe.L.Na.j.Zk,h=olympe.L.Na.j.Ab;if(null===a.N)a.G.warn('Trying to open a connection to the orchestrator without a valid server request. Ignoring...'),O(a,e);else{null!==a.j&&(a.j.X(null),a.j.close());var k,l;a.G.log(`Asking NET layer for a connection to ${null==(k=a.N)?void 0:Dc(k)}:${null==(l=a.N)?void 0:l.port}...`);a.j=a.Gc.D(a.N);a.j.da(a.ke.bind(a));a.j.Z(a.ef.bind(a));
531
- a.j.X(()=>{a.j=null;a.state===d?O(a,f):a.state!==h&&a.state!==g&&O(a,e)});a.Z&&a.state===b&&a.j.D(()=>{a.j.D(null);a.state===c&&ue(a);a.Z=null});a.state!==f&&O(a,c)}}function Be(a,b,c,d){const e=a.Pe;a.Pe++;c={message:{seqId:e,messageFamily:b,payload:c},qn:d?Ce(d):null,Wn:null};a.D.set(e,c);Ae(a,e,'publish',(new Map).set('family',b));d=[olympe.L.Na.j.CONNECTING,olympe.L.Na.j.Tg];(ye(a)||b===olympe.L.Ee.nk&&d.includes(a.state))&&De(a,e,c)}
532
- function Ce(a){const b=olympe.L.Na.D.ij;return c=>{if(null!==c&&void 0!==c){var d=null,e=c.s;if(void 0!==e&&e!==b){d=void 0!==olympe.L.Na.oc[e]?`Status code = ${e} [${olympe.L.Na.oc[e]}]`:`Status code = ${e}`;e=olympe.error.Dr;const f=c.error;'string'===typeof f&&0<f.length&&(f.includes('Message timeout')&&(e=olympe.error.Vk),d+=`\nReason:\n${f}`);d=new e('Rejected by orchestrator:\n'+d)}a(d,c)}}}
533
- function De(a,b,c){var d=c.message;a.G.j()&&a.G.debug('WS >',JSON.stringify(d.payload));(d=a.j.send(JSON.stringify(d)))?null===c.qn?a.D.delete(b):c.Wn=Date.now():olympe.C.Qa(a.Wa.j()).valueOf()&&O(a,olympe.L.Na.j.Tg);return d}function we(a,b,c,d){void 0===d&&(d=olympe.U.Kc());let e=a.ia.get(b);void 0===e&&(e=new Map,a.ia.set(b,e));e.set(d,c)}function Ee(a){a=a.ia.get(olympe.L.Ee.Ng);void 0!==a&&a.delete('logoutHandler')}
534
- function xe(a,b,c){if(a.D.has(b)){const {qn:d}=a.D.get(b);a.D.delete(b);null==d||d({s:olympe.L.Na.D.eq,error:c})}}function Fe(a,b){a.G.error(b);O(a,olympe.L.Na.j.Ab)}function Ge(a,b,c){a.vd=c?1E3*c:-1;let d;a.G.info(`Connected to ${null==(d=a.N)?void 0:d.j()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.D).sort(([e],[f])=>e-f);for(const [e,f]of b)if(!De(a,e,f))return;O(a,olympe.L.Na.j.ze)}
535
- function He(a,b){const c=olympe.L.Me.Gg,d=olympe.L.Me.Eh,e=olympe.L.Me.Ab,{id:f,e:g}=b;let h=a.H.get(f);h||(h=new olympe.L.$q(()=>a.H.delete(f)),a.H.set(f,h));if(g===c){fb(a.H.j,f);const {i:k,c:l}=b;h.write(l,k).catch(n=>{h.throw(n)})}else g===d?h.complete(b.s):g===e&&h.throw(Error(`Received stream error: ${b.reason}`))}
536
- olympe.L.Na=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.Gc=b;this.N=null;e.subscribe(k=>{this.N=k;k=olympe.L.Na.j.CONNECTING;if(this.state===olympe.L.Na.j.ze||this.state===k){let l;null==(l=this.j)||l.close()}});this.Z=this.j=null;e.subscribe(k=>{this.Z=k;k=olympe.L.Na.j.zc;this.state===olympe.L.Na.j.Zk&&(O(this,k),ue(this))});this.da=g;this.Md=h.get('pingInterval');this.sa=h.get('messageTimeout');this.X=olympe.U.Lf.parse(h.get('clientVersion'));this.Ha=olympe.U.Lf.parse(h.get('serverVersion'));
537
- this.state=olympe.L.Na.j.INIT;this.Wa=d;this.Yb=h.get('getContextMode');this.Pe=1;this.R=null;this.F=[0,0,0];this.ia=new Map;this.connected=olympe.C.bc(olympe.C.ba,'Server is connected');this.tg=lc(olympe.C.bc(olympe.C.ba,'Server is readonly'),olympe.C.ba.j);this.yb=new Set;this.D=new Map;this.H=new olympe.U.Zh(this.sa);this.Fd=new Map;this.vd=-1;ve(this,h,c)}connect(){const a=olympe.L.Na.j.ze,b=olympe.L.Na.j.zc,c=olympe.L.Na.j.Ab,d=olympe.L.Na.j.INIT;return new Promise((e,f)=>{this.state!==d&&this.state!==
538
- b||te(this);ze(this,[a,b,c],g=>{g===a?e():f(Error('Was not able to open a connection to the orchestrator'))},!0)})}disconnect(){return new Promise((a,b)=>{const c=olympe.L.Na.j.fp,d=olympe.L.Na.j.zc,e=olympe.L.Na.j.CONNECTING,f=olympe.L.Na.j.Ab;this.state===olympe.L.Na.j.ze||this.state===e||this.state===c?(ze(this,[d,f],g=>{g===d?a():b(Error('Was not able to disconnect'))},!0),this.state!==c&&(O(this,c),this.j.close())):(O(this,d),a())})}ke(){this.G.debug('Websocket connected, sending handshake. Client version:',
539
- Hb(this.X),'subscribeEverything:',this.Yb?'NO':'YES');Be(this,olympe.L.Ee.nk,{c:olympe.L.sk.nk,cv:Hb(this.X),m:this.Yb?0:1,s:this.R,b:this.Wa.D()},this.sg.bind(this))}sg(a,b){if(a)Fe(this,'Error in receiving handshake response: '+a.message);else{this.G.debug('Handshake response received');var c=olympe.L.Na.F;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.Ju:Fe(this,`Framework version (${Hb(this.X)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
540
- return;case c.Jw:Fe(this,`Framework version (${Hb(this.X)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.tu:Fe(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.Ha.Ea(olympe.U.Lf.j))this.G.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.U.Lf.parse(a);if(e.Pj(this.Ha)){Fe(this,`Framework v${Hb(this.X)} is expecting Orchestrator to be at least in v${Hb(this.Ha)}`);
541
- return}this.G.log('Handshake successful. Orchestrator version: ',JSON.stringify(e),'required:',Hb(this.Ha))}catch(f){Fe(this,f);return}e=olympe.L.Na.j.zc;if(this.state===olympe.L.Na.j.Tg&&null!==this.R&&this.R!==b.sessionId)this.G.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),O(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.Fd.set(f,g);this.R=b.sessionId||null;Ge(this,a,d)}}}Qc(){this.F[0]-this.F[1]>this.Md/2?
542
- (this.G.debug('Ping did not get answer, try to reconnect'),O(this,olympe.L.Na.j.Tg)):(this.F[0]=Date.now(),this.j.send('ping')||(this.G.debug('Impossible to send ping, try to reconnect'),O(this,olympe.L.Na.j.Tg)))}ef(a){this.F[2]=Date.now();if(a.startsWith('pong'))return olympe.C.Qa(this.Wa.j()).valueOf()&&(this.F[1]=this.F[2]),null;var b=0;this.da.j&&(b=performance.now()-this.da.D);try{var c=JSON.parse(a)}catch(g){return this.G.error('Unable to parse response from server: '+g.toString()),Error('Unable to parse response from server')}a=
543
- c.seqId;var d=c.stream;const e=c.messageFamily;c=c.payload;if(this.G.j()){const g=({id:h,i:k,e:l,c:n})=>l===olympe.L.Me.Gg?`stream[${h}][${k}]: ${JSON.stringify(n)}`:l===olympe.L.Me.Eh?`stream[${h}]:END`:`stream[${h}]:ERROR`;this.G.debug(`WS < ${JSON.stringify(c)}, ${d?g(d):''}`)}Ae(this,a,'consumed',new Map,b);Ae(this,a,'deserialized',(new Map).set('family',e));if(void 0!==d){var f=d.id;b=this.H.has(f);He(this,d);if(b)return null;d=this.H.get(f);if(!d)return this.G.error(`Received a stream chunk for an unknown stream id: ${f}`),
544
- null;f=d.stream}this.D.has(a)&&({qn:d}=this.D.get(a),this.D.delete(a),null==d||d(c,f));a=this.ia.get(e);if(void 0!==a)for(const g of a.values())g(c,f);return null}nb(){const a=Date.now();for(const [b,{Wn:c}]of this.D)null!==c&&a-c>this.sa&&(this.G.warn(`No response was received from the server for the seqId = ${b}`),xe(this,b,'Message timeout: never receive acknowledge'))}};function Qd(a){return olympe.C.Qa(a.state)===olympe.L.uc.j.cj}
545
- function Ie(a,b){const c=olympe.L.uc.j.Mm,d=olympe.L.uc.j.Df,e=olympe.L.uc.j.zc,f=olympe.L.uc.j.ww,g=b.get('reconnectionDelay');ze(a.D,[olympe.L.Na.j.INIT],()=>{Je(a)?(a.state.update(c),a.connect().catch(h=>a.G.error(h))):a.D.disconnect().catch(h=>a.G.error(h))},!0);ze(a.D,[olympe.L.Na.j.zc],()=>{if(olympe.C.Qa(a.state)===f)a.G.info('Disconnected, from orchestrator for shutdown');else if(a.state.update(a.j?d:e),Je(a)&&a.N){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.j?a.G.log(h):
546
- a.G.error(h);setTimeout(()=>a.connect().catch(k=>a.G.error(k)),g)}else a.G.info('Disconnected, stay offline.')});a.H.H(()=>{a.state.update(f);return Promise.resolve()},'Connectivity manager: shutdown state')}function Je(a){return null===a.storage.get(a.F+'olympe_manual_offline')}
547
- olympe.L.uc=class{constructor(a,b,c,d,e,f){this.G=a;this.D=b;this.H=d;this.storage=e;this.state=olympe.C.bc(Number).update(olympe.L.uc.j.INIT);this.j=f.get('offlineEnabled');this.N=f.get('offlineAutoBackOnline');this.F=f.get('storagePrefix');Ie(this,f)}Vf(){const a=olympe.L.uc.j.cj,b=olympe.L.uc.j.Df,c=olympe.L.uc.j.zc;let d=olympe.C.ba.j;return olympe.C.ta([this.state],e=>{if(e===a)d=olympe.C.ba.D;else if(e===b||e===c)d=olympe.C.ba.j;return d},olympe.C.ba)}getState(){return this.state.tb()}connect(){const a=
548
- this;return u(function*(){const b=olympe.L.uc.j.cj,c=olympe.L.uc.j.Mm;olympe.C.Qa(a.state)!==b&&(a.state.update(c),a.storage.delete(a.F+'olympe_manual_offline'),yield a.D.connect(),yield Ke(),a.state.update(b))})}disconnect(){const a=this;return u(function*(){const b=olympe.L.uc.j.Df,c=olympe.L.uc.j.Mm;if(!a.j)throw Error('Try to go offline manually while the process does not support it. Please add `offline.enabled=true` in the config');a.storage.set(a.F+'olympe_manual_offline','true');olympe.C.Qa(a.state)!==
549
- b&&(a.state.update(c),yield olympe.L.ih().disconnect(),yield a.D.disconnect())})}};olympe.L.uc.j={INIT:0,Mm:1,cj:2,Df:3,zc:4,ww:5};olympe.L.uc.D='olympe_manual_offline';olympe.L.cc=class{constructor(){this.R=this.X=null}fa(a){a=this.D(a);this.X=null;return a}N(a){a=this.j(a);this.R=null;return a}D(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.C.eb:return this.format(olympe.L.cc.j.Wl,a.valueOf().toISOString());case a instanceof Date:return this.format(olympe.L.cc.j.Wl,a.toISOString());case a instanceof olympe.C.Color:return this.format(olympe.L.cc.j.COLOR,
550
- a.toJSON());case a instanceof Map:return a=Object.fromEntries(Array.from(a).map(([c,d])=>[c,this.D(d)])),this.format(olympe.L.cc.j.xq,a);case a instanceof Set:return a=Array.from(a).map(this.D.bind(this)),this.format(olympe.L.cc.j.Yg,a);case Array.isArray(a):return a.map(this.D.bind(this));case a instanceof ArrayBuffer:return a=olympe.U.jf().j(new Uint8Array(a)),this.format(olympe.L.cc.j.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.U.jf().j(a),this.format(olympe.L.cc.j.$h,a);case Symbol.asyncIterator in
551
- a:if(!this.X)throw Error('No stream handler has been set, so cannot serialize the asyncIterable.');let b;return this.format(olympe.L.cc.j.je,null==(b=this.X)?void 0:b.call(this,a));case 'object'===typeof a:return a=Object.entries(a).reduce((c,[d,e])=>{c[d]=this.D(e);return c},{}),this.format(olympe.L.cc.j.Qq,a);default:throw Error(`Impossible to serialize the following value: ${a}`);}}j(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===
552
- typeof a:return a}if(Array.isArray(a))return a.map(d=>this.j(d));if('object'!==typeof a)throw new olympe.error.kp(`Impossible to deserialize the following value: ${a}`);const {t:b,v:c}=a;switch(b){case olympe.L.cc.j.Wl:return new Date(c);case olympe.L.cc.j.COLOR:return olympe.C.Color.Pb(c);case olympe.L.cc.j.xq:return new Map(Object.entries(c).map(([e,f])=>[e,this.j(f)]));case olympe.L.cc.j.Yg:return new Set(c.map(e=>this.j(e)));case olympe.L.cc.j.ARRAY_BUFFER:return olympe.U.jf().D(c).buffer;case olympe.L.cc.j.$h:return olympe.U.jf().D(c);
553
- case olympe.L.cc.j.je:if(!this.R)throw Error('No stream handler has been set, so cannot deserialize the stream.');let d;return null==(d=this.R)?void 0:d.call(this,c);case olympe.L.cc.j.Qq:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.error.kp(`Impossible to deserialize the following value: ${c}`);}}format(a,b){return{t:a,v:b}}};olympe.L.cc.j={Wl:1,COLOR:2,xq:3,Yg:4,ARRAY_BUFFER:5,$h:6,je:7,Qq:8};const Le=olympe.L.wa.j.SEND,Me=olympe.L.wa.j.GET,Ne=olympe.L.wa.j.PUBLISH,Oe=olympe.L.wa.j.SUBSCRIBE,Pe=olympe.L.wa.j.hg,Qe=olympe.L.wa.j.es,Re=olympe.L.wa.j.Ir,Se=olympe.L.wa.j.Ab,Te=olympe.L.wa.j.ms,Ue=olympe.L.wa.j.mg;function Hd(a,b){a.j||(a.j=gb(new olympe.U.cn(a.D.ef+3E4),c=>{let d;null==(d=a.H)||d.call(a,c)}));a.j.add(b)}
554
- function Ve(a){let b,c;const d=null!=(c=null==(b=a.j)?void 0:b.code)?c:olympe.error.lc.Wk;let e,f;a=null!=(f=null==(e=a.j)?void 0:e.reason)?f:'Unknown Error';return d===olympe.error.lc.TIMEOUT?new olympe.error.Vk(a):new olympe.error.od(a,d)}function We(a,b){const c=olympe.L.wa.j.mg,d=olympe.L.wa.j.bs;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.j.seq,b.jb(),b.jb(),d)}
555
- olympe.L.qb=class{constructor(a,b){this.D=olympe.L.ih();this.F=a;this.H=this.j=null;this.N=new olympe.C.Wb(`Service ${a}`,'function'===typeof b.Cb?b.Cb():b);this.G=olympe.ha.Xa(`Service ${this.F}`)}yt(a){this.H=a;return this}stop(){this.N.destroy()}clear(){Vd(this.D,this.F).catch(b=>this.G.error('Failed to unsubscribe from '+this.F+', error: '+b));if(this.H){let b;null==(b=this.j)||b.forEach(c=>{let d;return null==(d=this.H)?void 0:d.call(this,c)})}let a;null==(a=this.j)||a.clear()}static kd(a,b){return u(function*(){yield olympe.L.ih().request(a,
556
- a,Ne,b,!1)})}static Zs(a){const b=olympe.L.ih(),c=new olympe.L.Ek(a,b);ae(b,a).then(d=>Xe(c,d)).catch(d=>olympe.ha.Xa('Publisher for service '+a).error('Failed to get session id for publisher',d));return c}static send(a,b,c={}){return olympe.L.ih().request(a,a,Le,b,!0,c.timeout).then(d=>{switch(d.getType()){case Re:break;case Se:throw Ve(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.L.ih().request(a,a,Me,b,!0,c.timeout).then(d=>{switch(d.getType()){case Te:d=
557
- d.j;if(null!==d)return d;throw Error('No payload after request to service: '+a);case Se:throw Ve(d);default:throw Error('Unsupported response type for a GET request');}})}static observe(a,b,c,d={}){const e='function'===typeof b.Cb?b.Cb():b,f=olympe.L.ih(),g=new olympe.L.Ek(a,f);return{observable:(new rxjs.Observable(h=>{let k=null,l=null,n=null;const p=()=>{h.complete();l&&n&&(fe(f,a,n,l),l=n=null);k&&(Vd(f,k).catch(q=>olympe.ha.Xa('Service '+a).error('Failed to unsubscribe from a topic '+q)),k=null)};
558
- e.Xd(p);f.request(a,a,Oe,c,!0,d.timeout).then(q=>{switch(q.getType()){case Ue:Xe(g,q.jb());const r=q.j;k=r.topic;q.ack().catch(()=>olympe.ha.Xa('Service '+a).error('Failed to ack the msg'));Wd(f,k,t=>{t.getType()===Ne?h.next(t.j):(h.error('Unsupported notification message. It should be a publish'),p())}).then(()=>{l=r.id;n=q.jb();ee(f,a,n,l,r.refresh,t=>h.error(t));We(f,q).catch(t=>{h.error(`Was unable to ack the subscription: ${t}`);p()})}).catch(t=>{h.error(`Was not able to subscribe to notification topic ${k}: ${t}`);
559
- p()});break;case Se:h.error(Ve(q));break;default:h.error('Unsupported response type for a SUBSCRIBE request')}}).catch(q=>h.error(q));return p})).pipe(sb(olympe.error.Ph,(h,k)=>{olympe.ha.Xa(`Service ${a}`).debug(`Subscribed to topic ${h.T()} now that we are back online, after waiting for ${k}ms`);let l;null==(l=d.onRetry)||l.call(d)})),publisher:g}}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.N.onDestroy(b);Wd(this.D,this.F,this.R.bind(this,a),!1).catch(c=>
560
- {c='Failed to connect to the bus: '+c;this.G.error(c);a.error(Error(c))});return b})}xi(a){const b=this;return u(function*(){yield b.D.request(b.F,b.F,Ne,a,!1,b.D.nb)})}R(a,b){var c=new olympe.L.Fc(b,this.D,this);switch(b.getType()){case Pe:var d=c.body().filter(f=>{let g;return!(null==(g=this.j)?0:fb(g,f))});c.cd(d).catch(f=>this.G.error('Not able to validate subscription keep alive',f));break;case Qe:c=c.body();null==(d=this.j)||d.delete(c);let e;null==(e=this.H)||e.call(this,c);break;default:a.next(c)}}};
561
- olympe.L.qb.prototype.multicast=olympe.L.qb.prototype.xi;olympe.L.qb.prototype.listen=olympe.L.qb.prototype.listen;olympe.L.qb.observe=olympe.L.qb.observe;olympe.L.qb.get=olympe.L.qb.get;olympe.L.qb.send=olympe.L.qb.send;olympe.L.qb.getPublisher=olympe.L.qb.Zs;olympe.L.qb.publish=olympe.L.qb.kd;olympe.L.qb.prototype.stop=olympe.L.qb.prototype.stop;olympe.L.qb.prototype.setUnsubscriptionHandler=olympe.L.qb.prototype.yt;olympe.L.$q=class{constructor(a){this.j=0;this.buffer=[];this.size=null;this.stream=new olympe.U.stream.lg;this.D=null!=a?a:()=>{}}write(a,b){const c=this;return u(function*(){if(b<c.j||null!==c.size&&b>=c.size)throw Error(`Received stream chunk with unexpected index = ${b}. That index has already been processed. Next expected once is ${c.j}`);for(c.buffer[b-c.j]=a;void 0!==c.buffer[0];){c.j++;const d=c.buffer.shift();yield c.stream.write(d)}c.j===c.size&&(c.D(),c.stream.complete())})}complete(a){if(null!==
562
- this.size)throw Error('The stream has already been completed');if(a<this.j+this.buffer.length)throw Error(`The stream has already reached element n\u00b0${this.j+this.buffer.length}, specified index must be greater or equal to it.`);this.size=a;this.j===this.size&&(this.D(),this.stream.complete())}throw(a){this.D();this.stream.throw(a)}};function Xe(a,b){a.j=b;a.D.forEach(c=>c());a.D=[];return a}olympe.L.Ek=class{constructor(a,b){this.F=b;this.D=[];this.H=a;this.j=null}kd(a){const b=this;return u(function*(){b.j||(yield new Promise(c=>{b.D.push(()=>c())}));yield b.F.request(b.j,b.H,olympe.L.wa.j.PUBLISH,a,!0)})}};olympe.L.Ek.prototype.publish=olympe.L.Ek.prototype.kd;olympe.L.Ee={Gg:1,ag:2,Ab:3,Ng:4,IA:5,nk:6,oc:7};olympe.L.sk={nk:1,Sw:2,qu:3,hg:5,ew:1,fE:2};olympe.L.Me={Gg:0,Eh:1,Ab:2};olympe.L.Na.j={INIT:'initialize',CONNECTING:'connecting',zc:'disconnected',fp:'disconnecting',ze:'connected',Tg:'reconnecting',Zk:'waking',oo:'awake',Ab:'error'};olympe.L.Na.F={Qh:1,tu:-1,Ju:-2,Jw:-3};olympe.L.Na.D={ij:0,eq:23};
527
+ function we(a){const b=olympe.L.Na.j.po,c=olympe.L.Na.j.Zk,d=olympe.L.Na.j.zc,e=Ec(a.Z);a.G.info(`Trying to wakeup orchestrator with ${e}`);O(a,c);const f=a.Gc.D(a.Z);f.Z(g=>{const h=JSON.parse(g);a.G.info(`${e}: ${null==h?void 0:h.status}`);switch(null==h?void 0:h.status){case 'ready':O(a,b);f.close();break;case 'asleep':a.G.info(`Trying to wakeup orchestrator with ${e}`);f.send('{"action": "wakeup"}');O(a,c);break;case 'waking-up':break;default:a.G.warn(`Invalid message from ${e}: ${g}`),f.close(),
528
+ O(a,d)}});f.D(()=>{a.G.warn(`Communication with ${e} failed.`);f.close();O(a,d)});f.ba(()=>{a.G.info(`Checking orchestrator status with ${e}`);f.send('{"action": "status"}')})}
529
+ function xe(a,b,c){a.G.log('Initializing COMMUNICATION layer');if(a.G.j()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.G.debug(d.join('\n\t'))}ye(a,olympe.L.Fe.Ab,d=>{switch(d.c){case olympe.L.sk.Tw:a.G.error('Unknown message sent to the server:',olympe.L.Na.oc[d.s]);break;case olympe.L.sk.ru:a.G.error('Fatal error, the last message is probably too big according to the websocket config.'),a.D.forEach((e,f)=>{null!==e.Zn&&ze(a,f,d.i)})}});ye(a,olympe.L.Fe.oc,d=>
530
+ {d.c===olympe.L.sk.fw&&'boolean'===typeof d.a&&a.tg.update(olympe.C.Rb(d.a))});olympe.C.Gj(a.connected,()=>{let d=!1;olympe.C.Gj(a.Ua.j(),()=>{d&&(a.Hc(),a.lb(),d=!1);Cc(a.Hc.bind(a),a.Md);Cc(a.lb.bind(a),a.wa)},()=>{a.F=[0,0,a.F[2]];d=!0})},()=>{a.R=null;Bc(a.lb.bind(a),a.wa)});c.j(()=>Ae(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.state}`));c.Ha(()=>a.disconnect(),'Orchestrator websocket');hb(a.H,(d,e)=>{e.throw(Error('Stream timeout'))});
531
+ a.G.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}function Ae(a){return a.state===olympe.L.Na.j.Ae}function Be(a,b,c,d=!1){const e=f=>{if(0===b.length||b.includes(f))d&&a.vb.delete(e),c(f)};a.vb.add(e);e(a.state)}function Ce(a,b,c,d,e){a.ba.j&&rb(a.ba,'com',d.set('id',`${b}`).set('channel','ws').set('eventType',c),e)}
532
+ function ve(a){const b=olympe.L.Na.j.INIT,c=olympe.L.Na.j.CONNECTING,d=olympe.L.Na.j.Ae,e=olympe.L.Na.j.zc,f=olympe.L.Na.j.Tg,g=olympe.L.Na.j.Zk,h=olympe.L.Na.j.Ab;if(null===a.N)a.G.warn('Trying to open a connection to the orchestrator without a valid server request. Ignoring...'),O(a,e);else{null!==a.j&&(a.j.X(null),a.j.close());var k,l;a.G.log(`Asking NET layer for a connection to ${null==(k=a.N)?void 0:Dc(k)}:${null==(l=a.N)?void 0:l.port}...`);a.j=a.Gc.D(a.N);a.j.ba(a.ke.bind(a));a.j.Z(a.ef.bind(a));
533
+ a.j.X(()=>{a.j=null;a.state===d?O(a,f):a.state!==h&&a.state!==g&&O(a,e)});a.Z&&a.state===b&&a.j.D(()=>{a.j.D(null);a.state===c&&we(a);a.Z=null});a.state!==f&&O(a,c)}}function De(a,b,c,d){const e=a.Qe;a.Qe++;c={message:{seqId:e,messageFamily:b,payload:c},tn:d?Ee(d):null,Zn:null};a.D.set(e,c);Ce(a,e,'publish',(new Map).set('family',b));d=[olympe.L.Na.j.CONNECTING,olympe.L.Na.j.Tg];(Ae(a)||b===olympe.L.Fe.nk&&d.includes(a.state))&&Fe(a,e,c)}
534
+ function Ee(a){const b=olympe.L.Na.D.ij;return c=>{if(null!==c&&void 0!==c){var d=null,e=c.s;if(void 0!==e&&e!==b){d=void 0!==olympe.L.Na.oc[e]?`Status code = ${e} [${olympe.L.Na.oc[e]}]`:`Status code = ${e}`;e=olympe.error.Er;const f=c.error;'string'===typeof f&&0<f.length&&(f.includes('Message timeout')&&(e=olympe.error.Vk),d+=`\nReason:\n${f}`);d=new e('Rejected by orchestrator:\n'+d)}a(d,c)}}}
535
+ function Fe(a,b,c){var d=c.message;a.G.j()&&a.G.debug('WS >',JSON.stringify(d.payload));(d=a.j.send(JSON.stringify(d)))?null===c.tn?a.D.delete(b):c.Zn=Date.now():olympe.C.Qa(a.Ua.j()).valueOf()&&O(a,olympe.L.Na.j.Tg);return d}function ye(a,b,c,d){void 0===d&&(d=olympe.U.Lc());let e=a.ia.get(b);void 0===e&&(e=new Map,a.ia.set(b,e));e.set(d,c)}function Ge(a){a=a.ia.get(olympe.L.Fe.Ng);void 0!==a&&a.delete('logoutHandler')}
536
+ function ze(a,b,c){if(a.D.has(b)){const {tn:d}=a.D.get(b);a.D.delete(b);null==d||d({s:olympe.L.Na.D.fq,error:c})}}function He(a,b){a.G.error(b);O(a,olympe.L.Na.j.Ab)}function Ie(a,b,c){a.hd=c?1E3*c:-1;let d;a.G.info(`Connected to ${null==(d=a.N)?void 0:d.j()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.D).sort(([e],[f])=>e-f);for(const [e,f]of b)if(!Fe(a,e,f))return;O(a,olympe.L.Na.j.Ae)}
537
+ function Je(a,b){const c=olympe.L.Ne.Gg,d=olympe.L.Ne.Eh,e=olympe.L.Ne.Ab,{id:f,e:g}=b;let h=a.H.get(f);h||(h=new olympe.L.ar(()=>a.H.delete(f)),a.H.set(f,h));if(g===c){fb(a.H.j,f);const {i:k,c:l}=b;h.write(l,k).catch(n=>{h.throw(n)})}else g===d?h.complete(b.s):g===e&&h.throw(Error(`Received stream error: ${b.reason}`))}
538
+ olympe.L.Na=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.Gc=b;this.N=null;e.subscribe(k=>{this.N=k;k=olympe.L.Na.j.CONNECTING;if(this.state===olympe.L.Na.j.Ae||this.state===k){let l;null==(l=this.j)||l.close()}});this.Z=this.j=null;e.subscribe(k=>{this.Z=k;k=olympe.L.Na.j.zc;this.state===olympe.L.Na.j.Zk&&(O(this,k),we(this))});this.ba=g;this.Md=h.get('pingInterval');this.wa=h.get('messageTimeout');this.X=olympe.U.Mf.parse(h.get('clientVersion'));this.Ha=olympe.U.Mf.parse(h.get('serverVersion'));
539
+ this.state=olympe.L.Na.j.INIT;this.Ua=d;this.Ub=h.get('getContextMode');this.Qe=1;this.R=null;this.F=[0,0,0];this.ia=new Map;this.connected=olympe.C.bc(olympe.C.da,'Server is connected');this.tg=lc(olympe.C.bc(olympe.C.da,'Server is readonly'),olympe.C.da.j);this.vb=new Set;this.D=new Map;this.H=new olympe.U.Zh(this.wa);this.Fd=new Map;this.hd=-1;xe(this,h,c)}connect(){const a=olympe.L.Na.j.Ae,b=olympe.L.Na.j.zc,c=olympe.L.Na.j.Ab,d=olympe.L.Na.j.INIT;return new Promise((e,f)=>{this.state!==d&&this.state!==
540
+ b||ve(this);Be(this,[a,b,c],g=>{g===a?e():f(Error('Was not able to open a connection to the orchestrator'))},!0)})}disconnect(){return new Promise((a,b)=>{const c=olympe.L.Na.j.gp,d=olympe.L.Na.j.zc,e=olympe.L.Na.j.CONNECTING,f=olympe.L.Na.j.Ab;this.state===olympe.L.Na.j.Ae||this.state===e||this.state===c?(Be(this,[d,f],g=>{g===d?a():b(Error('Was not able to disconnect'))},!0),this.state!==c&&(O(this,c),this.j.close())):(O(this,d),a())})}ke(){this.G.debug('Websocket connected, sending handshake. Client version:',
541
+ Hb(this.X),'subscribeEverything:',this.Ub?'NO':'YES');De(this,olympe.L.Fe.nk,{c:olympe.L.sk.nk,cv:Hb(this.X),m:this.Ub?0:1,s:this.R,b:this.Ua.D()},this.Pf.bind(this))}Pf(a,b){if(a)He(this,'Error in receiving handshake response: '+a.message);else{this.G.debug('Handshake response received');var c=olympe.L.Na.F;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.Ku:He(this,`Framework version (${Hb(this.X)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
542
+ return;case c.Kw:He(this,`Framework version (${Hb(this.X)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.uu:He(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.Ha.Ea(olympe.U.Mf.j))this.G.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.U.Mf.parse(a);if(e.Pj(this.Ha)){He(this,`Framework v${Hb(this.X)} is expecting Orchestrator to be at least in v${Hb(this.Ha)}`);
543
+ return}this.G.log('Handshake successful. Orchestrator version: ',JSON.stringify(e),'required:',Hb(this.Ha))}catch(f){He(this,f);return}e=olympe.L.Na.j.zc;if(this.state===olympe.L.Na.j.Tg&&null!==this.R&&this.R!==b.sessionId)this.G.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),O(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.Fd.set(f,g);this.R=b.sessionId||null;Ie(this,a,d)}}}Hc(){this.F[0]-this.F[1]>this.Md/2?
544
+ (this.G.debug('Ping did not get answer, try to reconnect'),O(this,olympe.L.Na.j.Tg)):(this.F[0]=Date.now(),this.j.send('ping')||(this.G.debug('Impossible to send ping, try to reconnect'),O(this,olympe.L.Na.j.Tg)))}ef(a){this.F[2]=Date.now();if(a.startsWith('pong'))return olympe.C.Qa(this.Ua.j()).valueOf()&&(this.F[1]=this.F[2]),null;var b=0;this.ba.j&&(b=performance.now()-this.ba.D);try{var c=JSON.parse(a)}catch(g){return this.G.error('Unable to parse response from server: '+g.toString()),Error('Unable to parse response from server')}a=
545
+ c.seqId;var d=c.stream;const e=c.messageFamily;c=c.payload;if(this.G.j()){const g=({id:h,i:k,e:l,c:n})=>l===olympe.L.Ne.Gg?`stream[${h}][${k}]: ${JSON.stringify(n)}`:l===olympe.L.Ne.Eh?`stream[${h}]:END`:`stream[${h}]:ERROR`;this.G.debug(`WS < ${JSON.stringify(c)}, ${d?g(d):''}`)}Ce(this,a,'consumed',new Map,b);Ce(this,a,'deserialized',(new Map).set('family',e));if(void 0!==d){var f=d.id;b=this.H.has(f);Je(this,d);if(b)return null;d=this.H.get(f);if(!d)return this.G.error(`Received a stream chunk for an unknown stream id: ${f}`),
546
+ null;f=d.stream}this.D.has(a)&&({tn:d}=this.D.get(a),this.D.delete(a),null==d||d(c,f));a=this.ia.get(e);if(void 0!==a)for(const g of a.values())g(c,f);return null}lb(){const a=Date.now();for(const [b,{Zn:c}]of this.D)null!==c&&a-c>this.wa&&(this.G.warn(`No response was received from the server for the seqId = ${b}`),ze(this,b,'Message timeout: never receive acknowledge'))}};function Pd(a){return olympe.C.Qa(a.state)===olympe.L.uc.j.cj}
547
+ function Ke(a,b){const c=olympe.L.uc.j.Pm,d=olympe.L.uc.j.Ef,e=olympe.L.uc.j.zc,f=olympe.L.uc.j.xw,g=b.get('reconnectionDelay');Be(a.D,[olympe.L.Na.j.INIT],()=>{Le(a)?(a.state.update(c),a.connect().catch(h=>a.G.error(h))):a.D.disconnect().catch(h=>a.G.error(h))},!0);Be(a.D,[olympe.L.Na.j.zc],()=>{if(olympe.C.Qa(a.state)===f)a.G.info('Disconnected, from orchestrator for shutdown');else if(a.state.update(a.j?d:e),Le(a)&&a.N){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.j?a.G.log(h):
548
+ a.G.error(h);setTimeout(()=>a.connect().catch(k=>a.G.error(k)),g)}else a.G.info('Disconnected, stay offline.')});a.H.H(()=>{a.state.update(f);return Promise.resolve()},'Connectivity manager: shutdown state')}function Le(a){return null===a.storage.get(a.F+'olympe_manual_offline')}
549
+ olympe.L.uc=class{constructor(a,b,c,d,e,f){this.G=a;this.D=b;this.H=d;this.storage=e;this.state=olympe.C.bc(Number).update(olympe.L.uc.j.INIT);this.j=f.get('offlineEnabled');this.N=f.get('offlineAutoBackOnline');this.F=f.get('storagePrefix');Ke(this,f)}qf(){const a=olympe.L.uc.j.cj,b=olympe.L.uc.j.Ef,c=olympe.L.uc.j.zc;let d=olympe.C.da.j;return olympe.C.sa([this.state],e=>{if(e===a)d=olympe.C.da.D;else if(e===b||e===c)d=olympe.C.da.j;return d},olympe.C.da)}getState(){return this.state.tb()}connect(){const a=
550
+ this;return u(function*(){const b=olympe.L.uc.j.cj,c=olympe.L.uc.j.Pm;olympe.C.Qa(a.state)!==b&&(a.state.update(c),a.storage.delete(a.F+'olympe_manual_offline'),yield a.D.connect(),yield Me(),a.state.update(b))})}disconnect(){const a=this;return u(function*(){const b=olympe.L.uc.j.Ef,c=olympe.L.uc.j.Pm;if(!a.j)throw Error('Try to go offline manually while the process does not support it. Please add `offline.enabled=true` in the config');a.storage.set(a.F+'olympe_manual_offline','true');olympe.C.Qa(a.state)!==
551
+ b&&(a.state.update(c),yield olympe.L.ih().disconnect(),yield a.D.disconnect())})}};olympe.L.uc.j={INIT:0,Pm:1,cj:2,Ef:3,zc:4,xw:5};olympe.L.uc.D='olympe_manual_offline';olympe.L.cc=class{constructor(){this.R=this.X=null}fa(a){a=this.D(a);this.X=null;return a}N(a){a=this.j(a);this.R=null;return a}D(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.C.eb:return this.format(olympe.L.cc.j.Zl,a.valueOf().toISOString());case a instanceof Date:return this.format(olympe.L.cc.j.Zl,a.toISOString());case a instanceof olympe.C.Color:return this.format(olympe.L.cc.j.COLOR,
552
+ a.toJSON());case a instanceof Map:return a=Object.fromEntries(Array.from(a).map(([c,d])=>[c,this.D(d)])),this.format(olympe.L.cc.j.yq,a);case a instanceof Set:return a=Array.from(a).map(this.D.bind(this)),this.format(olympe.L.cc.j.Yg,a);case Array.isArray(a):return a.map(this.D.bind(this));case a instanceof ArrayBuffer:return a=olympe.U.jf().j(new Uint8Array(a)),this.format(olympe.L.cc.j.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.U.jf().j(a),this.format(olympe.L.cc.j.$h,a);case Symbol.asyncIterator in
553
+ a:if(!this.X)throw Error('No stream handler has been set, so cannot serialize the asyncIterable.');let b;return this.format(olympe.L.cc.j.je,null==(b=this.X)?void 0:b.call(this,a));case 'object'===typeof a:return a=Object.entries(a).reduce((c,[d,e])=>{c[d]=this.D(e);return c},{}),this.format(olympe.L.cc.j.Rq,a);default:throw Error(`Impossible to serialize the following value: ${a}`);}}j(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===
554
+ typeof a:return a}if(Array.isArray(a))return a.map(d=>this.j(d));if('object'!==typeof a)throw new olympe.error.lp(`Impossible to deserialize the following value: ${a}`);const {t:b,v:c}=a;switch(b){case olympe.L.cc.j.Zl:return new Date(c);case olympe.L.cc.j.COLOR:return olympe.C.Color.Pb(c);case olympe.L.cc.j.yq:return new Map(Object.entries(c).map(([e,f])=>[e,this.j(f)]));case olympe.L.cc.j.Yg:return new Set(c.map(e=>this.j(e)));case olympe.L.cc.j.ARRAY_BUFFER:return olympe.U.jf().D(c).buffer;case olympe.L.cc.j.$h:return olympe.U.jf().D(c);
555
+ case olympe.L.cc.j.je:if(!this.R)throw Error('No stream handler has been set, so cannot deserialize the stream.');let d;return null==(d=this.R)?void 0:d.call(this,c);case olympe.L.cc.j.Rq:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.error.lp(`Impossible to deserialize the following value: ${c}`);}}format(a,b){return{t:a,v:b}}};olympe.L.cc.j={Zl:1,COLOR:2,yq:3,Yg:4,ARRAY_BUFFER:5,$h:6,je:7,Rq:8};const Ne=olympe.L.va.j.SEND,Oe=olympe.L.va.j.GET,Pe=olympe.L.va.j.PUBLISH,Qe=olympe.L.va.j.SUBSCRIBE,Re=olympe.L.va.j.ig,Se=olympe.L.va.j.gs,Te=olympe.L.va.j.Jr,Ue=olympe.L.va.j.Ab,Ve=olympe.L.va.j.ns,We=olympe.L.va.j.ng;function Gd(a,b){a.j||(a.j=gb(new olympe.U.fn(a.D.Pf+3E4),c=>{let d;null==(d=a.H)||d.call(a,c)}));a.j.add(b)}
556
+ function Xe(a){let b,c;const d=null!=(c=null==(b=a.j)?void 0:b.code)?c:olympe.error.lc.Wk;let e,f;a=null!=(f=null==(e=a.j)?void 0:e.reason)?f:'Unknown Error';return d===olympe.error.lc.TIMEOUT?new olympe.error.Vk(a):new olympe.error.pd(a,d)}function Ye(a,b){const c=olympe.L.va.j.ng,d=olympe.L.va.j.cs;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.j.seq,b.jb(),b.jb(),d)}
557
+ olympe.L.qb=class{constructor(a,b){this.D=olympe.L.ih();this.F=a;this.H=this.j=null;this.N=new olympe.C.Xb(`Service ${a}`,'function'===typeof b.Cb?b.Cb():b);this.G=olympe.ga.Wa(`Service ${this.F}`)}yt(a){this.H=a;return this}stop(){this.N.destroy()}clear(){Vd(this.D,this.F).catch(b=>this.G.error('Failed to unsubscribe from '+this.F+', error: '+b));if(this.H){let b;null==(b=this.j)||b.forEach(c=>{let d;return null==(d=this.H)?void 0:d.call(this,c)})}let a;null==(a=this.j)||a.clear()}static ld(a,b){return u(function*(){yield olympe.L.ih().request(a,
558
+ a,Pe,b,!1)})}static $s(a){const b=olympe.L.ih(),c=new olympe.L.Ek(a,b);ce(b,a).then(d=>Ze(c,d)).catch(d=>olympe.ga.Wa('Publisher for service '+a).error('Failed to get session id for publisher',d));return c}static send(a,b,c={}){return olympe.L.ih().request(a,a,Ne,b,!0,c.timeout).then(d=>{switch(d.getType()){case Te:break;case Ue:throw Xe(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.L.ih().request(a,a,Oe,b,!0,c.timeout).then(d=>{switch(d.getType()){case Ve:d=
559
+ d.j;if(null!==d)return d;throw Error('No payload after request to service: '+a);case Ue:throw Xe(d);default:throw Error('Unsupported response type for a GET request');}})}static observe(a,b,c,d={}){const e='function'===typeof b.Cb?b.Cb():b,f=olympe.L.ih(),g=new olympe.L.Ek(a,f);return{observable:(new rxjs.Observable(h=>{let k=null,l=null,n=null;const p=()=>{h.complete();l&&n&&(he(f,a,n,l),l=n=null);k&&(Vd(f,k).catch(q=>olympe.ga.Wa('Service '+a).error('Failed to unsubscribe from a topic '+q)),k=null)};
560
+ e.Xd(p);f.request(a,a,Qe,c,!0,d.timeout).then(q=>{switch(q.getType()){case We:Ze(g,q.jb());const r=q.j;k=r.topic;q.ack().catch(()=>olympe.ga.Wa('Service '+a).error('Failed to ack the msg'));Wd(f,k,t=>{t.getType()===Pe?h.next(t.j):(h.error('Unsupported notification message. It should be a publish'),p())}).then(()=>{l=r.id;n=q.jb();ge(f,a,n,l,r.refresh,t=>h.error(t));Ye(f,q).catch(t=>{h.error(`Was unable to ack the subscription: ${t}`);p()})}).catch(t=>{h.error(`Was not able to subscribe to notification topic ${k}: ${t}`);
561
+ p()});break;case Ue:h.error(Xe(q));break;default:h.error('Unsupported response type for a SUBSCRIBE request')}}).catch(q=>h.error(q));return p})).pipe(sb(olympe.error.Ph,(h,k)=>{olympe.ga.Wa(`Service ${a}`).debug(`Subscribed to topic ${h.T()} now that we are back online, after waiting for ${k}ms`);let l;null==(l=d.onRetry)||l.call(d)})),publisher:g}}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.N.onDestroy(b);Wd(this.D,this.F,this.R.bind(this,a),!1).catch(c=>
562
+ {c='Failed to connect to the bus: '+c;this.G.error(c);a.error(Error(c))});return b})}xi(a){const b=this;return u(function*(){yield b.D.request(b.F,b.F,Pe,a,!1,b.D.Hc)})}R(a,b){var c=new olympe.L.Fc(b,this.D,this);switch(b.getType()){case Re:var d=c.body().filter(f=>{let g;return!(null==(g=this.j)?0:fb(g,f))});c.cd(d).catch(f=>this.G.error('Not able to validate subscription keep alive',f));break;case Se:c=c.body();null==(d=this.j)||d.delete(c);let e;null==(e=this.H)||e.call(this,c);break;default:a.next(c)}}};
563
+ olympe.L.qb.prototype.multicast=olympe.L.qb.prototype.xi;olympe.L.qb.prototype.listen=olympe.L.qb.prototype.listen;olympe.L.qb.observe=olympe.L.qb.observe;olympe.L.qb.get=olympe.L.qb.get;olympe.L.qb.send=olympe.L.qb.send;olympe.L.qb.getPublisher=olympe.L.qb.$s;olympe.L.qb.publish=olympe.L.qb.ld;olympe.L.qb.prototype.stop=olympe.L.qb.prototype.stop;olympe.L.qb.prototype.setUnsubscriptionHandler=olympe.L.qb.prototype.yt;olympe.L.ar=class{constructor(a){this.j=0;this.buffer=[];this.size=null;this.stream=new olympe.U.stream.mg;this.D=null!=a?a:()=>{}}write(a,b){const c=this;return u(function*(){if(b<c.j||null!==c.size&&b>=c.size)throw Error(`Received stream chunk with unexpected index = ${b}. That index has already been processed. Next expected once is ${c.j}`);for(c.buffer[b-c.j]=a;void 0!==c.buffer[0];){c.j++;const d=c.buffer.shift();yield c.stream.write(d)}c.j===c.size&&(c.D(),c.stream.complete())})}complete(a){if(null!==
564
+ this.size)throw Error('The stream has already been completed');if(a<this.j+this.buffer.length)throw Error(`The stream has already reached element n\u00b0${this.j+this.buffer.length}, specified index must be greater or equal to it.`);this.size=a;this.j===this.size&&(this.D(),this.stream.complete())}throw(a){this.D();this.stream.throw(a)}};function Ze(a,b){a.j=b;a.D.forEach(c=>c());a.D=[];return a}olympe.L.Ek=class{constructor(a,b){this.F=b;this.D=[];this.H=a;this.j=null}ld(a){const b=this;return u(function*(){b.j||(yield new Promise(c=>{b.D.push(()=>c())}));yield b.F.request(b.j,b.H,olympe.L.va.j.PUBLISH,a,!0)})}};olympe.L.Ek.prototype.publish=olympe.L.Ek.prototype.ld;olympe.L.Fe={Gg:1,bg:2,Ab:3,Ng:4,JA:5,nk:6,oc:7};olympe.L.sk={nk:1,Tw:2,ru:3,ig:5,fw:1,gE:2};olympe.L.Ne={Gg:0,Eh:1,Ab:2};olympe.L.Na.j={INIT:'initialize',CONNECTING:'connecting',zc:'disconnected',gp:'disconnecting',Ae:'connected',Tg:'reconnecting',Zk:'waking',po:'awake',Ab:'error'};olympe.L.Na.F={Qh:1,uu:-1,Ku:-2,Kw:-3};olympe.L.Na.D={ij:0,fq:23};
563
565
  olympe.L.Na.oc={0:'OK',1:'SRP Authentication First Step Failed',2:'SRP Authentication Last Step Failed',3:'SRP Authentication Bad Credentials',4:'AutoLogin Authentication Failed',5:'AutoLogin Authentication Token Invalid',6:'Logout Failed',7:'SAML Request Generation Failed',8:'SAML Authentication Save Failed',9:'Invalid SAML Response',10:'SAML User Not Found',11:'Transaction Failed',12:'GetContext Failed',13:'Notification Failed',15:'FileService Clean Failed',17:'Try to subscribe multiple times',
564
- 18:'Try to unsubscribe multiple times',21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.L.P={uf:'com.ConnectivityManager',Nk:'com.ServerManager',Bo:'com.BusManager',mm:'com.HttpManager',Le:'com.Serializer',Ca:'com.Logger',Zg:'com.Source',gs:'com.Urls',DC:'com.peerFileSvcUrl'};
565
- olympe.L.Config={Yl:'defaultHost',ow:'server.host',qw:'server.port',rw:'server.ssl',Jr:'server.basePath',rs:'server.wsPath',Sm:'server.reconnectionDelay',br:'server.pingInterval',qs:'server.messageTimeout',wr:'server.retryHttpOnOverload',Ol:'server.clientVersion',Mr:'server.serverVersion',sw:'server.wakeUpService',Rt:'bus.host',St:'bus.path',Tt:'bus.port',Vt:'bus.vhost',Ut:'bus.ssl',Fo:'bus.requestTimeout',Go:'bus.subscriptionRefreshRate',Eo:'bus.reconnectionDelay',Ao:'bus.heartbeat',Co:'bus.queueExpiration',
566
- Do:'bus.queuePrefetch',Il:'bus.allowGuest',cs:'bus.topicPrefix'};
567
- olympe.V.config(function(a){const b=olympe.host.Wg.Th;E(a,olympe.L.Config.Yl,a.getParameter(olympe.host.Config.Pp));E(a,olympe.L.Config.Jr,'OlympeServer');E(a,olympe.L.Config.cs,'');Ya(a,'com.hostConfig',[olympe.host.Config.Jk,olympe.L.Config.Yl,olympe.L.Config.ow,olympe.L.Config.qw,olympe.L.Config.rw,olympe.L.Config.Jr,olympe.L.Config.Rt,olympe.L.Config.Vt,olympe.L.Config.Tt,olympe.L.Config.St,olympe.L.Config.Ut],(e,f,g,h,k,l,n,p,q,r,t)=>{var v=a.getParameter(olympe.net.Config.ym);e=e===olympe.host.Wg.Th;
568
- var x=['localhost','127.0.0.1'],y=f.endsWith(v),z=y&&e?`${f}-${b}`:f;const A='object'===typeof window;g=null!=g?g:z;n=null!=n?n:!A&&y?z.replace(new RegExp(`${v}.*`),'rabbitmq'):z;z=(v=x.includes(g))||y;y=(x=x.includes(n))||y;f=x?'/':f.split('.')[0];return{Xn:g,Yn:null!=h?h:v?8080:z?e?85:80:443,Zn:null!=k?k:!z,ut:l,vx:n,zx:null!=p?p:f,xx:null!=q?q:A?x?15670:y?e?85:80:443:y?5672:5671,wx:null!=r?r:!x&&A?'/amqp/ws':'',yx:null!=t?t:!y}});E(a,olympe.L.Config.rs,'websocket');E(a,olympe.L.Config.Sm,5E3);
569
- E(a,olympe.L.Config.br,5E3);E(a,olympe.L.Config.qs,3E4);E(a,olympe.L.Config.wr,4E3);E(a,olympe.L.Config.Mr,'7.5.3');E(a,olympe.L.Config.Fo,6E4);E(a,olympe.L.Config.Go,3E4);E(a,olympe.L.Config.Il,!1);E(a,olympe.L.Config.Eo,a.getParameter(olympe.L.Config.Sm));E(a,olympe.L.Config.Ao,15);E(a,olympe.L.Config.Co,3E5);E(a,olympe.L.Config.Do,20);const c=a.getParameter(olympe.xg.Config.xp);if(void 0!==c)a.setParameter(olympe.L.Config.Ol,c);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');
570
- D(a,olympe.L.P.Ca,[olympe.ha.P.Fa],e=>e.ad('communication'));D(a,'server.WebSocketRequest',[new olympe.V.Dh('com.hostConfig'),new olympe.V.oa(olympe.L.Config.rs)],(e,f)=>e.pipe(rxjs.operators.map(({Xn:g,Yn:h,Zn:k,ut:l})=>new olympe.net.oj(g,h,(l+'/'+f).replace(/\/+/g,'/').replace(/\/$/,''),k))).pipe(rxjs.operators.shareReplay(1)));D(a,'server.wakeUpRequest',[new olympe.V.Dh('com.hostConfig'),new olympe.V.oa(olympe.L.Config.sw)],(e,f)=>e.pipe(rxjs.operators.map(({Xn:g,Yn:h,Zn:k})=>{if(null===f||void 0===
571
- f)return null;const l=f.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.oj(g,h,l,k)})).pipe(rxjs.operators.shareReplay(1)));const d=Array.from(Object.values(olympe.L.Xb));D(a,olympe.L.P.gs,[new olympe.V.Dh('com.hostConfig'),...d.map(e=>new olympe.V.oa(e))],(e,...f)=>e.pipe(rxjs.operators.map(({Xn:g,Yn:h,Zn:k,ut:l})=>{const n=d.map((p,q)=>{q=f[q];q=(new olympe.net.Si(g,h,`${l}${q?'/'+q:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).j();return[p,q]});return new Map(n)})).pipe(rxjs.operators.shareReplay(1)));
572
- C(a,olympe.L.P.Le,olympe.L.cc);C(a,olympe.L.P.mm,olympe.L.yu,olympe.L.P.Ca,olympe.net.P.Fa,olympe.U.P.ig,olympe.L.P.gs,new olympe.V.oa(olympe.L.Config.wr));D(a,'com.server.ManagerConfig',[new olympe.V.oa(olympe.L.Config.br),new olympe.V.oa(olympe.L.Config.qs),new olympe.V.oa(olympe.L.Config.Ol),new olympe.V.oa(olympe.L.Config.Mr),new olympe.V.oa(olympe.dc.Config.Yh)],(...e)=>{const f=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],g=new Map;e.forEach((h,k)=>g.set(f[k],
573
- h));return g});C(a,olympe.L.P.Nk,olympe.L.Na,olympe.L.P.Ca,olympe.net.P.Fa,olympe.host.P.Ge,olympe.host.P.Qk,'server.WebSocketRequest','server.wakeUpRequest',olympe.U.P.ig,'com.server.ManagerConfig');Ya(a,'com.bus.TopicPrefix',[olympe.host.Config.Jk,olympe.L.Config.cs],(e,f)=>e===olympe.host.Wg.Th?`${b}-${f}`:f);D(a,'com.bus.ManagerConfig',[new olympe.V.Dh('com.hostConfig'),new olympe.V.Dh('com.bus.TopicPrefix'),new olympe.V.oa(olympe.L.Config.Il),new olympe.V.oa(olympe.L.Config.Fo),new olympe.V.oa(olympe.L.Config.Go),
574
- new olympe.V.oa(olympe.L.Config.Eo),new olympe.V.oa(olympe.L.Config.Co),new olympe.V.oa(olympe.L.Config.Do),new olympe.V.oa(olympe.L.Config.Ao)],(e,f,g,h,k,l,n,p,q)=>{e=e.pipe(rxjs.operators.map(({vx:r,wx:t,xx:v,zx:x,yx:y})=>({host:r,xh:y,port:v,path:t,sA:x,pt:l,Xz:n,Yz:p,wz:h+3E4,ez:q})),rxjs.operators.shareReplay(1));return new Map([['connection',e],['topicPrefix',f],['allowGuest',g],['requestTimeout',h],['subscriptionsRefreshRate',k]])});C(a,olympe.L.P.Bo,olympe.L.Ll,olympe.L.P.Ca,olympe.net.P.Fa,
575
- olympe.L.P.uf,olympe.auth.P.Fa,olympe.host.P.Ge,olympe.L.P.Le,olympe.U.P.ig,'com.bus.ManagerConfig');D(a,'com.connectivity.ManagerConfig',[olympe.net.P.Gm,olympe.Db.P.$g,new olympe.V.oa(olympe.L.Config.Sm)],(e,...f)=>['storagePrefix','reconnectionDelay'].reduce((g,h,k)=>g.set(h,f[k]),e));C(a,olympe.L.P.uf,olympe.L.uc,olympe.L.P.Ca,olympe.L.P.Nk,olympe.net.P.Fa,olympe.host.P.Ge,olympe.Db.P.zm,'com.connectivity.ManagerConfig')},'olympe.communication');
576
- olympe.V.run([olympe.L.P.Bo,olympe.L.P.uf],(a,b)=>{olympe.L.ih=()=>a;olympe.L.Bn=()=>b});olympe.auth={};function Ye(a,b){Ee(a.j);we(a.j,olympe.L.Ee.Ng,c=>{const d=c.c;d===olympe.auth.td.j.vv?(a.j.ke(),b(olympe.auth.Ta.D.Rj,c)):d===olympe.auth.td.j.mw&&b(olympe.auth.Ta.D.Vp,c)},'logoutHandler')}
577
- function Ze(a,b,c){const d=null==b?void 0:b.Cf();if(b instanceof olympe.auth.zk){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.Gd();h.access_token=$e(b);g=`${qe(a.Lh,olympe.L.Xb.wk)}/logout${d?`?idpName=${d}`:''}`;a.D.redirect(g,h)};c=a.D.j();const f=new URL(c);0!==f.hash.length||0!==f.search.length?(f.hash='',f.search='',a.F.db.set('main',c,'redirectTo').then(()=>{e(f.toString())}).catch(g=>{a.G.error(`Error when trying to set the redirectKey in Auth store: ${g}`)})):e(c)}else Be(a.j,
578
- olympe.L.Ee.Ng,Object.assign({},{c:olympe.auth.td.j.wv},d&&{idpName:d}),c)}function af(a,b,c,d){olympe.C.Qa(a.H.getState())===olympe.L.uc.j.Df?d(new olympe.error.Yq,'Working offline'):(c.c=b,Be(a.j,olympe.L.Ee.Ng,c,d))}
579
- function bf(a,b,c){if(b.Mg()!==olympe.auth.Ec.j.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.Cf()}&access_token=${$e(b)}`;d=`${qe(a.Lh,olympe.L.Xb.wk)}/refresh${d}`;d=Hc(N(d),olympe.net.va.ResponseType.JSON);se(a.Lh,d,b.Gd()).then(e=>{(e=e.getData())?(e=new olympe.auth.zk(b.xc(),b.te(),b.Gd(),e,b.Cf()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
580
- olympe.auth.td=class{constructor(a,b,c,d,e,f){this.G=a;this.j=b;this.Lh=c;this.H=d;this.D=e;this.F=f;cf(this.F).then(g=>{g&&this.F.db.remove('main','redirectTo').then(()=>{this.D.redirect(g,null,olympe.auth.Lk.j.GET)}).catch(h=>{this.G.error(`Error when trying to remove redirect key from AUTH storage: ${h}`)})}).catch(g=>{this.G.error(`Error when trying to get redirect key from AUTH storage: ${g}`)})}qf(a){Be(this.j,olympe.L.Ee.Ng,{c:olympe.auth.td.j.hg},b=>a(b))}qh(a,b,c){const d=qe(this.Lh,olympe.L.Xb.js);
581
- a=N(`${d}/${a}`);se(this.Lh,a,b).then(e=>c(null,e.getData())).catch(e=>c(Error(e)))}};olympe.auth.td.j={Ng:1,wv:2,Ab:3,hg:5,ij:6,Cu:10,Aw:11,Gt:12,SAML:13,mw:14,vv:20};function ge(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.U.ni());a.R.set(c,b)}function ce(a){return olympe.C.Qa(a.dd.tb())}
582
- function Ke(){var a=olympe.auth.qe();const b=olympe.auth.Ta.j.Sj,c=olympe.auth.Ta.j.INIT;df(a,b);a.ia?(a.j=olympe.auth.Ta.F.Ft,a.G.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),ef(a)):(a.j=olympe.auth.Ta.F.Hf,a.G.log('Connector online, attempting to log with token'),ff(a));return rxjs.firstValueFrom(a.state.tb().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
583
- function gf(a){a.G.log('Initializing AUTH layer');let b=a.Yb;if('object'===typeof location){const c=location.hash;let d=c.indexOf('authToken=');-1<d&&(b=c.substring(d+10),'&'===c[d-1]&&d--,location.hash=c.substring(0,d))}b&&a.storage&&hf(a.storage,b).catch(c=>a.G.error(c));a.G.debug('Asking to be notified when auth connector gets online');olympe.C.Vc([a.sa.getState()],c=>{switch(c){case olympe.L.uc.j.Df:a.j=olympe.auth.Ta.F.Hf;a.G.log('Connector offline, attempting to recover sessions from current token');
584
- ff(a);break;case olympe.L.uc.j.zc:switch(olympe.C.Qa(a.state)){case olympe.auth.Ta.j.rf:c=olympe.C.Qa(a.dd).xc();jf(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ta.j.Pi:a.G.info('Disconnected from server - guest session lost');break;case olympe.auth.Ta.j.Sj:jf(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Ta.j.INIT:jf(a,'Cannot open auth session - no server connection');break;default:jf(a,'Should not get there, investigate',!0)}}});
585
- Ye(a.D,(c,d)=>{if(c===olympe.auth.Ta.D.Rj){jf(a,'authentication revoked');let e;null==(e=a.storage)||kf(e).catch(f=>a.G.error('Failed to clear token',f));a.R.forEach(f=>{f(c,d)})}else if(c===olympe.auth.Ta.D.Vp){a.G.info('Redirection to IDP to invalidate token (SAML)');ce(a);let e;null==(e=a.storage)||kf(e).catch(f=>a.G.error('Failed to clear token',f));a.Ha.D()}else throw Error(`Unknown logout step coming from server : ${c}`);});a.Z=lf(a);a.G.log('DONE initializing AUTH layer (waiting for connector to be online)')}
586
- function mf(a,b){let c=null;olympe.C.Gj(a.state.tb().Jd(olympe.auth.Ta.j.rf).and(b),()=>{const d=ce(a);!nf(a)&&d&&(c=a.Yd.get(d.Mg()).H(d,(e,f)=>{e?(a.G.error('Failed to refresh token, error message: ',e.message),a.Jj().catch(g=>a.G.error(`Failed to logout after wrong refresh ${g}`))):f&&of(a,f)}))},()=>{let d;null==(d=c)||d()})}
587
- function ff(a){null!==a.storage?(a.G.debug('Retrieving token from local storage'),a.storage.se().then(b=>{if(b){const e=new olympe.auth.Request;var c=b.xc();e.set('username',c);c=e;var d=b.Gd();c.set('nonce',d);'string'===typeof b.Cf()&&e.set('idpName',b.Cf());a.G.debug('Token found, trying login with',e);pf(a,e,olympe.auth.Ec.j.Hm)}else jf(a,'No token found, cannot perform auto login')}).catch(b=>{jf(a,b.message,!0)})):jf(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
588
- !0)}function jf(a,b,c=!1){a.dd.update(a.N);df(a,olympe.auth.Ta.j.Pi);b=`Authenticated as guest (${b})`;c?a.G.error(b):a.G.info(b)}function lf(a){const b=[olympe.auth.Ta.j.rf];a.ia||b.push(olympe.auth.Ta.j.Pi);return a.da.j(()=>{const c=qf(a);return b.includes(c)?Promise.resolve('The auth manager is OK'):Promise.reject(`The auth manager is not in valid state, the current state is: ${c}`)})}function df(a,b){a.G.log('State change: ',qf(a),'--\x3e',b);a.state.update(b)}
589
- function ef(a){if(a.H){const b=new olympe.auth.Request;b.set('username',a.H);b.set('password',a.Wa);a.G.log('Autologin with user "'+a.H+'"');pf(a,b)}else jf(a,'No user specified for auto login',!0)}function nf(a){return olympe.C.Qa(a.dd)===a.N}function of(a,b){if(b){a.dd.update(b);let c;null==(c=a.storage)||hf(c,b).catch(d=>a.G.error(d));a.G.debug('Token updated')}}function qf(a){return olympe.C.Qa(a.state.tb())}function rf(){var a=olympe.public.Ma.get();return new Map(a.D.j.Fd)}
590
- function sf(a,b,c,d=!1){b=b+c?':'+c.message:'';a.G.error(b);a.error.update(olympe.C.wb(b));df(a,olympe.auth.Ta.j.Ab);if(d)throw Error(b);}function pf(a,b,c,d){void 0===c&&(c=a.nb);void 0===c&&sf(a,'No authentication provider specified',null,!0);const e=a.Yd.get(c);e||sf(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.F.set('login',d);a.G.log('Sending authentication request using "'+c+'" for '+b);e.se(b,a.yb.bind(a));df(a,olympe.auth.Ta.j.Sj)}
591
- function tf(a,b,c){a.F.forEach(d=>{d(b,c)})}
592
- olympe.auth.Ta=class{constructor(a,b,c,d,e,f,g,h,k){this.G=a;this.sa=b;this.D=c;this.storage=d;this.Ha=e;this.nb=k.get('defaultProvider');this.ia=!!k.get('autoLogin');this.H=k.get('autoUser');this.Wa=k.get('autoPassword');this.Yb=k.get('autoToken');this.Yd=new Map;this.da=f;this.Z='';this.state=olympe.C.bc(String).update(olympe.auth.Ta.j.INIT);this.error=olympe.C.bc(olympe.C.Sa);this.j=null;this.N=new olympe.auth.eh('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.dd=olympe.C.bc(olympe.auth.eh).update(this.N);
593
- this.F=new Map;this.R=new Map;this.X=new olympe.U.Zh(k.get('cacheTokenTimeout'));h.forEach(l=>{const n=l.F();if(this.Yd.has(n))throw Error('Provider "'+n+'" has already been registered !');this.Yd.set(n,l)});gf(this);mf(this,g.j())}ql(){const a=olympe.auth.Ta.j.rf,b=olympe.auth.Ta.j.Pi,c=olympe.auth.Ta.j.Ab,d=olympe.C.bc(olympe.C.ba);olympe.C.Vc([this.state],e=>{e===a?d.update(olympe.C.ba.D):e===b?d.update(olympe.C.ba.j):e===c?(this.G.error('Authentication failed.'),d.update(olympe.C.ba.j)):d.clear()});
594
- return d.tb()}yg(a){if(olympe.C.Qa(this.state)===olympe.auth.Ta.j.rf){var b=ce(this);!nf(this)&&b&&this.Yd.get(b.Mg()).yg(b,(c,d)=>{c?(this.G.error('Failed to refresh token, error message: ',c.message),this.Jj().catch(e=>this.G.error(`Failed to logout after wrong refresh ${e}`))):d&&of(this,d);a(c)})}}getState(){return this.state.tb()}xc(){return this.dd.tb().xc()}te(){return this.dd.tb().te()}ri(){return this.dd.tb().ri()}qh(a,b){if(fb(this.X.j,a))b(null,this.X.get(a));else{var c,d=null==(c=olympe.C.Qa(this.dd.tb()))?
595
- void 0:c.Gd();this.D.qh(a,d,(e,f)=>{'string'===typeof f&&this.X.set(a,f);b(e,f)})}}Jj(){return nf(this)?(this.G.warn('Logout called for Guest user so it will be ignored'),Promise.resolve()):new Promise((a,b)=>{this.G.debug('Sending logout');let c;null==(c=this.storage)||kf(c).catch(d=>this.G.error('Failed to clear token',d));Ze(this.D,ce(this),d=>{d?(sf(this,'Logout request rejected:',d),b(d)):(this.G.debug('Logout request acknowledged'),a())});this.da.D(this.Z)})}qf(a){qf(this)===olympe.auth.Ta.j.rf&&
596
- this.D.qf(b=>{b&&this.G.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}yb(a,b){const c=null===this.j?olympe.auth.Ta.F.Cv:this.j;this.j=null;if(!a||a instanceof olympe.error.Yq){null===a?this.G.info(`User ${b.xc()} (#${b.te()}) successfully authenticated`):this.G.info(`User ${b.xc()} (#${b.te()}) recovered from token, while offline`);this.dd.update(b);df(this,olympe.auth.Ta.j.rf);tf(this,a,c);let d;null==(d=this.storage)||hf(d,b).catch(e=>this.G.error(e))}else{let d;
597
- null==(d=this.storage)||kf(d).catch(e=>this.G.error(e));this.error.update(olympe.C.wb(a.message));jf(this,'authentication rejected: '+a.message);tf(this,a,c)}this.F.has('login')&&this.F.delete('login')}};olympe.auth.Ta.j={INIT:'init',Sj:'authenticating',Pi:'guest',rf:'authenticated',Ab:'error'};olympe.auth.Ta.F={Cv:'manual',Ft:'auto',Hf:'tokenOnFirstConnection'};olympe.auth.Ta.D={Rj:'accepted',Vp:'redirect'};olympe.auth.Ec=class{constructor(a,b){this.G=a;this.D=b;this.j=null}F(){}se(){}H(a,b){const c=()=>{this.j=setTimeout(()=>this.D.qf(d=>{d?b(d,null):(b(null,null),c())}),this.D.j.vd)};c();return()=>{this.j&&clearTimeout(this.j);this.j=null}}yg(a,b){this.D.qf(c=>{b(c,null)})}};olympe.auth.Ec.j={SAML:'saml',OAUTH2:'openID',SRP:'srp',Hm:'olympeToken'};function uf(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.j=new Map}set(a,b){olympe.C.Vc([b],c=>{this.j.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.j.get(a.toLowerCase()))&&a.fh&&(a=a.Ba.Eb);return a?a.valueOf():a}xc(){return this.get('username')}Gd(){return this.get('nonce')}toString(){return this.xc()+(this.Gd()?' with nonce':'')+(this.get('password')?' with password':'')+(uf(this)?` with idp name ${uf(this)}`:'')}};olympe.auth.eh=class{constructor(a,b,c,d={},e=null){this.user=a;this.Bi=b;this.D=c;this.j=e;this.F=d}xc(){return this.user}te(){return this.Bi}Gd(){return this.D}Vi(){return this.F}ri(){return null}Cf(){return this.j}fa(){const a=olympe.U.jf(),b=Object.assign({},{user:this.user,userTag:this.Bi,nonce:this.D},this.j&&{idpName:this.j},{payload:this.F});return olympe.U.ys(ab(a,JSON.stringify(b)))}Mg(){return olympe.auth.Ec.j.SRP}};m=olympe.auth.eh.prototype;m.xc.K=new olympe.C.J(()=>String,[]);
598
- m.te.K=new olympe.C.J(()=>String,[]);m.Gd.K=new olympe.C.J(()=>String,[]);m.Vi.K=new olympe.C.J(()=>Object,[]);m.ri.K=new olympe.C.J(()=>String,[]);m.Cf.K=new olympe.C.J(()=>String,[]);m.fa.K=new olympe.C.J(()=>String,[]);m.Mg.K=new olympe.C.J(()=>String,[]);function $e(a){return a.Vi().access_token||null}function vf(a){return 1E3*parseInt(a.Vi().access_token_exp||'0',10)}olympe.auth.zk=class extends olympe.auth.eh{constructor(a,b,c,d,e){super(a,b,c,d,e);this.H=Date.now()}ri(){return $e(this)}Mg(){return olympe.auth.Ec.j.OAUTH2}};olympe.auth.Gr=class extends olympe.auth.eh{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.H=d}ri(){return this.H}Mg(){return olympe.auth.Ec.j.SAML}fa(){const a=olympe.U.jf(),b=Object.assign({},{user:this.xc(),userTag:this.te(),nonce:this.Gd()},this.Cf()&&{idpName:this.Cf()},{payload:this.Vi(),fullToken:this.H});return olympe.U.ys(ab(a,JSON.stringify(b)))}};function cf(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function hf(a,b){return vb(a.D,()=>a.db.set('main','string'===typeof b?b:b.fa(),a.j).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function kf(a){return vb(a.D,()=>a.db.remove('main',a.j).catch(b=>{a.G.error(`Error when trying to remove the token from the auth store: ${b}`)}))}
599
- olympe.auth.Mt=class{constructor(a,b,c){this.F=a;this.G=b;this.j='OlympeToken-'+c.j;this.D=new olympe.U.promise.Tk;this.db=this.F.D('AUTH')}se(){this.G.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.j}`);return vb(this.D,()=>{const a=this;return u(function*(){let b;try{b=yield a.db.get('main',a.j)}catch(g){throw Error(`Error when trying to get the token from the auth store: ${g}`);}let c=null;if(b)try{a.G.debug('olympe.auth.AuthStorage: Token retrieved successfully');var d=JSON,e=
600
- d.parse;var f=bb(olympe.U.jf().D(olympe.U.tx(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.Gr(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.zk(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.eh(g.user,g.userTag,g.nonce,g.payload,g.idpName);c=h}catch(g){throw Error(`Error while unserializing token: ${g}`);}else a.G.debug('olympe.auth.AuthStorage: No token found');return c})})}};olympe.auth.Lk=class{redirect(){}D(){}j(){}};olympe.auth.Lk.j={GET:'GET',Sh:'POST'};olympe.auth.ro=class{constructor(a){this.j=a||'default'}};olympe.auth.Yd={};function wf(a,b,c){af(a.D,olympe.auth.td.j.Ng,{token:b.Gd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.td.j.Ab:c(Error('Invalid token'),null);break;case olympe.auth.td.j.ij:d=null;if(e=e.payload){const f=e.userName,g=e.userTag,h=e.rndCook,k=e.payload,l=e.protocol;'SAML'===l?d=new olympe.auth.Gr(f,g,h,e.samlToken,k,uf(b)):'openid'===l&&(d=new olympe.auth.zk(f,g,h,k,uf(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
601
- olympe.auth.Yd.Bv=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.storage=c}F(){return olympe.auth.Ec.j.Hm}se(a,b){this.storage.se().then(c=>{wf(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function xf(a,b,c){var d=vf(b);const e=Math.max(d-b.H,0),f=olympe.V.getParameter(olympe.auth.Config.$r);d=Math.max(Math.round(d-e*(1-Math.max(Math.min((f||50)/100,.95),0))-Date.now()),0);if(0<d)return setTimeout(()=>{a.yg(b,c)},d);a.yg(b,c);return null}
602
- olympe.auth.Yd.Sv=class extends olympe.auth.Ec{constructor(a,b,c,d){super(a,b);this.N=c;this.R=d}F(){return olympe.auth.Ec.j.OAUTH2}se(a){const b=encodeURIComponent(this.N.j());a=uf(a)?`idpName=${uf(a)}&`:'';this.N.redirect(`${this.R}/auth?${a}url=${b}`,null,olympe.auth.Lk.j.GET)}H(a,b){0<vf(a)?this.j=xf(this,a,b):b(null,a);return this.X.bind(this)}yg(a,b){bf(this.D,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.j&&(this.j=xf(this,d,b)))})}X(){this.j&&clearTimeout(this.j);this.j=null}};function yf(a,b){af(a.D,olympe.auth.td.j.SAML,{},(c,d)=>{null!==c?b(c):d.url&&d.request?b(null,d.url,d.request.replace(/\s/g,''),d.id):b(Error('Missing parameters from server response'))})}olympe.auth.Yd.SAML=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.N=c}F(){return olympe.auth.Ec.j.SAML}se(a,b){yf(this,c=>{c?b(c,null):this.N.D(uf(a))})}};function zf(a,b,c){const d=olympe.auth.td.j.Cu,e=olympe.auth.td.j.Ab,f=olympe.auth.td.j.Aw,g={I:b.xc()};af(a.D,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.xc()}' invalid, or password does not match`));break;case f:h=k.payload;c(null,h.S,h.B);break;default:c(Error('Unknown response from server'))}})}
603
- function Af(a,b,c){const d=olympe.auth.td.j.Gt,e=olympe.auth.td.j.Ab,f=olympe.auth.td.j.ij;b={A:b.get('a'),M:b.get('m1'),I:b.xc()};af(a.D,d,b,(g,h)=>{if(null!==g)c(g,null);else switch(h.c){case e:a.G.debug('Login failed, invalid username or password');c(Error('Invalid username or password'),null);break;case f:g=h.payload;a.G.debug('Login successful, creating token');h=g.payload?JSON.parse(g.payload):void 0;c(null,new olympe.auth.eh(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
604
- null)}})}olympe.auth.Yd.SRP=class extends olympe.auth.Ec{F(){return olympe.auth.Ec.j.SRP}se(a,b){const c=a.get('password');a.j.delete('password');this.G.debug('Sending SRP request');zf(this,a,(d,e,f)=>{this.G.debug('Received Salt+B message');if(d)b(d,null);else{try{const g=new SRPClient;g.step1(a.xc(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g,null);return}this.G.debug('Sending SRP A+M (proof) message');Af(this,a,b)}})}};olympe.auth.P={Fa:'auth.Manager',Ca:'auth.Logger',hj:'auth.Storage',Cl:'auth.appNameToken',Hk:'auth.Redirector',Kr:'auth.ServerConnector'};olympe.auth.Config={Zl:'auth.defaultProvider',lo:'auth.autoLogin',no:'auth.autoUser',mo:'auth.autoPassword',Hf:'auth.token',Jo:'auth.cacheTokenTimeout',$r:'auth.tokenDurationPercentage'};
605
- olympe.V.config(function(a){E(a,olympe.auth.Config.Zl,olympe.auth.Ec.j.SRP);E(a,olympe.auth.Config.lo,!1);E(a,olympe.auth.Config.no,'');E(a,olympe.auth.Config.mo,'');E(a,olympe.auth.Config.Hf,'');E(a,olympe.auth.Config.$r,50);E(a,olympe.auth.Config.Jo,3E5);D(a,olympe.auth.P.Ca,[olympe.ha.P.Fa],b=>b.ad('auth'));C(a,olympe.auth.P.Cl,olympe.auth.ro,olympe.Db.P.$g);C(a,olympe.auth.P.hj,olympe.auth.Mt,olympe.Db.P.qk,olympe.auth.P.Ca,olympe.auth.P.Cl);C(a,olympe.auth.P.Kr,olympe.auth.td,olympe.auth.P.Ca,
606
- olympe.L.P.Nk,olympe.L.P.mm,olympe.L.P.uf,olympe.auth.P.Hk,olympe.auth.P.hj);Xa(a,olympe.auth.P.Hk);D(a,olympe.auth.P.Fa,[olympe.auth.P.Ca,olympe.L.P.uf,olympe.auth.P.Kr,olympe.host.P.Ge,olympe.host.P.Qk,new olympe.V.qb(olympe.auth.P.hj,olympe.V.Ah.j.Dm),new olympe.V.qb(olympe.auth.P.Hk,olympe.V.Ah.j.Dm),new olympe.V.oa(olympe.auth.Config.Zl),new olympe.V.oa(olympe.auth.Config.lo),new olympe.V.oa(olympe.auth.Config.no),new olympe.V.oa(olympe.auth.Config.mo),new olympe.V.oa(olympe.auth.Config.Hf),
607
- new olympe.V.oa(olympe.auth.Config.Jo)],(b,c,d,e,f,g,h,k,l,n,p,q,r)=>{const t=[new olympe.auth.Yd.Bv(b,d,g),new olympe.auth.Yd.SRP(b,d),new olympe.auth.Yd.SAML(b,d,h),new olympe.auth.Yd.Sv(b,d,h,qe(d.Lh,olympe.L.Xb.wk))];if(!t.map(v=>v.F()).includes(k))throw Error(`Default provider name ${k} given by parameter ${olympe.auth.Config.Zl} cannot be found`);return new olympe.auth.Ta(b,c,d,g,h,e,f,t,new Map([['defaultProvider',k],['autoLogin',l],['autoUser',n],['autoPassword',p],['autoToken',q],['cacheTokenTimeout',
608
- r]]))},!0)},'olympe.auth');olympe.V.run([olympe.auth.P.Fa],a=>{olympe.auth.qe=()=>a});olympe.Va.node.auth={};olympe.Va.node.auth.Mq=class{redirect(){console.warn('Redirection n/a in Node.JS')}D(){console.warn('Redirection n/a in Node.JS')}j(){console.warn('Redirection n/a in Node.JS');return''}};olympe.Va.node.auth.Mq.ya=[olympe.auth.Lk];olympe.V.config(a=>{C(a,olympe.auth.P.Hk,olympe.Va.node.auth.Mq)},'olympe.native.node.auth');olympe.Va.node.Db={};function Bf(){throw Error('Key-Value Database does not implement this in NodeJS');}
609
- olympe.Va.node.Db.Kq=class{constructor(a){this.G=a;this.j=new Map}X(){return 0}N(a){const b=this;return u(function*(){let c,d;return null!=(d=null==(c=b.j.get(a))?void 0:c.size)?d:0})}F(a){const b=this;return u(function*(){const c=b.j.get(a);return c?Array.from(c.values()):[]})}R(a){const b=this;return u(function*(){const c=b.j.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return u(function*(){let d;for(const [e,f]of null!=(d=c.j.get(a))?d:new Map)b(f,e)})}has(a,b){const c=this;
610
- return u(function*(){let d,e;return null!=(e=null==(d=c.j.get(a))?void 0:d.has(b))?e:!1})}get(a,b){const c=this;return u(function*(){let d;return null==(d=c.j.get(a))?void 0:d.get(b)})}set(a,b,c){const d=this;return u(function*(){let e;return null==(e=d.j.get(a))?void 0:e.set(c,b)})}remove(a,b){const c=this;return u(function*(){let d;yield null==(d=c.j.get(a))?void 0:d.delete(b)})}da(){Bf();return Promise.resolve()}Z(){Bf();return Promise.resolve()}clear(a){const b=this;return u(function*(){let c;
611
- null==(c=b.j.get(a))||c.clear()})}H(){Bf();return Promise.resolve([])}D(){return u(function*(){Bf()})}};olympe.Va.node.Db.Kq.ya=[olympe.Db.pv];olympe.Va.node.Db.Lq=class{constructor(a){this.j=new Map;this.G=a}D(a){this.j.has(a)||this.j.set(a,new olympe.Va.node.Db.Kq(this.G));return this.j.get(a)}};olympe.Va.node.Db.Lq.ya=[olympe.Db.qv];olympe.V.config(function(a){C(a,olympe.Db.P.qk,olympe.Va.node.Db.Lq,olympe.Db.P.Ca)},'olympe.native.node.localstorage');olympe.Va.node.storage={};olympe.Va.node.storage.Storage=class{constructor(a){this.G=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Va.node.storage.Storage.ya=[olympe.Db.Storage];olympe.V.config(function(a){Va(a,olympe.Db.P.hj,olympe.Va.node.storage.Storage,olympe.host.P.Ca)},'olympe.native.html.storage');olympe.xg={};olympe.xg.Config={VERSION:'version.version',Pt:'version.branch',tf:'version.commit',Iw:'version.tag',xp:'version.olympe-framework',Qt:'version.build'};olympe.V.config(function(a){E(a,olympe.xg.Config.VERSION,'');E(a,olympe.xg.Config.Pt,'');E(a,olympe.xg.Config.tf,'');E(a,olympe.xg.Config.Iw,'');E(a,olympe.xg.Config.xp,'');E(a,olympe.xg.Config.Qt,'')},'olympe.main');const Cf=require('fs'),Df=require('fs/promises');let Ef;const Ff=null!=(Ef=process.env.EXTRA_CONFIG_PATH)?Ef:null;let Gf;const Gb=null!=(Gf=process.env.EXTRA_CONFIG_KEY_PREFIX)?Gf:'';function Fb(a){return Df.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
612
- function Hf(a){var b=If;console.debug(`Start watching config files for changes: ${b}`);b.forEach(c=>{Df.access(c,Cf.constants.F_OK).then(()=>{Cf.watch(c,d=>u(function*(){if('change'===d){console.log(`Config file "${c}" has changed. Loading new configuration...`);try{const e=yield olympe.U.it([c]),f=olympe.V.Rs(e);for(const [g,h]of f)a.Ai(g,h)}catch(e){console.error(`Failed to updated config from file ${c} with message: ${e.message}`)}}}))}).catch(()=>{})})}
613
- function Jf(){console.log('The node process received a signal for graceful shutdown');let a,b,c,d;(null!=(d=null==(b=(a=olympe.Va.node.host).ll)?void 0:null==(c=b.call(a))?void 0:gd(c))?d:Promise.resolve()).then(()=>console.log('The node backend has stopped successfully')).catch(e=>console.warn(e)).finally(()=>process.exit(0))}process.on('SIGTERM',Jf);process.on('SIGINT',Jf);process.on('SIGBREAK',Jf);process.on('SIGHUP',Jf);
614
- process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);Jf()});const If=['oConfig.json','conf.d/oConfig.json','version.json'];Ff&&If.push(Ff);
615
- olympe.U.it(If).then(a=>{try{const b=Object.create(null),c=process.argv;for(let f=2;f<c.length;f++){const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(c[f]);!Array.isArray(g)||4>g.length?console.warn(`Malformed config parameter "${c[f]}" ignored. It should of the form 'a=b'`):b[g[1]]=olympe.U.zs(g[3])}const d=new olympe.V.cu(a,b);La(d);const e=d.compile();Na(e);Hf(e)}catch(b){console.error(`Failed to start Olympe: ${b}`),process.exit(1)}}).catch(a=>{console.error(`Failed to load config files: ${a.message}.`);
616
- setInterval(()=>{},1073741824)});olympe.dc={};olympe.dc.ua={ORIGIN:'<',DESTINATION:'>'};w('olympe.dc.Direction',olympe.dc.ua);olympe.dc.fc={Zc:'ff022000000000000000',Li:'ff02200000000000000e',Zj:'ff02200000000000000f'};olympe.dc.kq={VERSION:'@v',Zg:'@s'};olympe.dc.he={Xe:'?',gg:'~'};olympe.dc.qD={cj:'online',Df:'offline',VB:'invalidate'};olympe.dc.Ia={SELF:'self',SERVER:'server',Ze:'remote'};
617
- olympe.dc.Lb={NONE:null,gp:'ff023000000000000037',Dc:'ff023000000000000137',jg:'ff023000000000000237',xw:'ff023000000000000337',ju:'ff023000000000000437',Uw:'ff023000000000000537',XB:olympe.dc.he.gg+'ff023000000000000037',YB:olympe.dc.he.gg+'ff023000000000000237',WB:olympe.dc.he.gg+'ff023000000000000437',gE:olympe.dc.he.gg+'ff023000000000000537'};olympe.dc.Wq=class extends Error{constructor(a){var b=olympe.dc.ga(),c=olympe.dc.ee(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.jb(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.Pq=class extends Error{constructor(){var a=Kf();super('Try to access a resource not available yet: BusinessContainer, wait for it to be ready');this.j=a}};olympe.dc.Writable=class{Rc(){}Xc(){}D(){}Oa(){}hc(){}};olympe.dc.hr=class{qc(){}T(){}H(){}};olympe.dc.vc=class{constructor(a){this.tag='string'===typeof a?a:a.W()}W(){return this.tag}Ea(a){return a instanceof olympe.dc.vc&&this.tag===a.tag}};olympe.dc.vc.ya=[olympe.dc.Ye];olympe.dc.vc.prototype.Ea.K=olympe.C.J.j;olympe.dc.su=class a{constructor(b,c,d,e,f,g){this.G=b;this.Z=c;this.db=c.view;this.da=d;this.Jb=e;this.D=f;this.N=g;this.j=new Map;this.F=hb(new olympe.U.Zh(6E5),(h,k)=>{URL.revokeObjectURL(k);Lf(this.db,h,a.j(h))})}ia(b,c,d,e,f){this.Wa(c).then(g=>{this.nb(b,g,d,!!this.N,e,f)}).catch(g=>this.G.error(g))}H(b){const c=this;return u(function*(){const d=f=>{f=`Failed to download file ${b.W()}: ${f}`;c.G.error(f);throw Error(f);},e=b.W();if(fb(c.F.j,e)){const f=c.F.get(e);return c.D.F(f).then(g=>g.arrayBuffer()).then(g=>
566
+ 18:'Try to unsubscribe multiple times',21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.L.P={vf:'com.ConnectivityManager',Nk:'com.ServerManager',Co:'com.BusManager',pm:'com.HttpManager',Me:'com.Serializer',Da:'com.Logger',Zg:'com.Source',hs:'com.Urls',EC:'com.peerFileSvcUrl'};
567
+ olympe.L.Config={am:'defaultHost',Yt:'com.computedHost',pw:'server.host',rw:'server.port',sw:'server.ssl',Kr:'server.basePath',ss:'server.wsPath',Vm:'server.reconnectionDelay',cr:'server.pingInterval',rs:'server.messageTimeout',xr:'server.retryHttpOnOverload',Rl:'server.clientVersion',Nr:'server.serverVersion',tw:'server.wakeUpService',Rt:'bus.host',St:'bus.path',Tt:'bus.port',Vt:'bus.vhost',Ut:'bus.ssl',Go:'bus.requestTimeout',Ho:'bus.subscriptionRefreshRate',Fo:'bus.reconnectionDelay',Bo:'bus.heartbeat',
568
+ Do:'bus.queueExpiration',Eo:'bus.queuePrefetch',Ll:'bus.allowGuest',ds:'bus.topicPrefix'};
569
+ olympe.V.config(function(a){const b=olympe.host.Wg.Th;E(a,olympe.L.Config.am,a.getParameter(olympe.host.Config.Qp));E(a,olympe.L.Config.Kr,'OlympeServer');E(a,olympe.L.Config.ds,'');Ya(a,'com.hostConfig',[olympe.host.Config.Jk,olympe.L.Config.am,olympe.L.Config.pw,olympe.L.Config.rw,olympe.L.Config.sw,olympe.L.Config.Kr,olympe.L.Config.Rt,olympe.L.Config.Vt,olympe.L.Config.Tt,olympe.L.Config.St,olympe.L.Config.Ut],(e,f,g,h,k,l,n,p,q,r,t)=>{var v=a.getParameter(olympe.net.Config.Bm);e=e===olympe.host.Wg.Th;
570
+ var x=['localhost','127.0.0.1'],y=f.endsWith(v),z=y&&e?`${f}-${b}`:f;const A='object'===typeof window;g=null!=g?g:z;n=null!=n?n:!A&&y?z.replace(new RegExp(`${v}.*`),'rabbitmq'):z;z=(v=x.includes(g))||y;y=(x=x.includes(n))||y;f=x?'/':f.split('.')[0];return{yl:g,$n:null!=h?h:v?8080:z?e?85:80:443,zl:null!=k?k:!z,ut:l,wx:n,Ax:null!=p?p:f,yx:null!=q?q:A?x?15670:y?e?85:80:443:y?5672:5671,xx:null!=r?r:!x&&A?'/amqp/ws':'',zx:null!=t?t:!y}});E(a,olympe.L.Config.ss,'websocket');E(a,olympe.L.Config.Vm,5E3);
571
+ E(a,olympe.L.Config.cr,5E3);E(a,olympe.L.Config.rs,3E4);E(a,olympe.L.Config.xr,4E3);E(a,olympe.L.Config.Nr,'7.5.3');E(a,olympe.L.Config.Go,6E4);E(a,olympe.L.Config.Ho,3E4);E(a,olympe.L.Config.Ll,!1);E(a,olympe.L.Config.Fo,a.getParameter(olympe.L.Config.Vm));E(a,olympe.L.Config.Bo,15);E(a,olympe.L.Config.Do,3E5);E(a,olympe.L.Config.Eo,20);const c=a.getParameter(olympe.xg.Config.yp);if(void 0!==c)a.setParameter(olympe.L.Config.Rl,c);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');
572
+ D(a,olympe.L.P.Da,[olympe.ga.P.Fa],e=>e.ad('communication'));D(a,'server.WebSocketRequest',[new olympe.V.Dh('com.hostConfig'),new olympe.V.oa(olympe.L.Config.ss)],(e,f)=>e.pipe(rxjs.operators.map(({yl:g,$n:h,zl:k,ut:l})=>new olympe.net.oj(g,h,(l+'/'+f).replace(/\/+/g,'/').replace(/\/$/,''),k))).pipe(rxjs.operators.shareReplay(1)));D(a,'server.wakeUpRequest',[new olympe.V.Dh('com.hostConfig'),new olympe.V.oa(olympe.L.Config.tw)],(e,f)=>e.pipe(rxjs.operators.map(({yl:g,$n:h,zl:k})=>{if(null===f||void 0===
573
+ f)return null;const l=f.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.oj(g,h,l,k)})).pipe(rxjs.operators.shareReplay(1)));const d=Array.from(Object.values(olympe.L.Yb));D(a,olympe.L.P.hs,[new olympe.V.Dh('com.hostConfig'),...d.map(e=>new olympe.V.oa(e))],(e,...f)=>e.pipe(rxjs.operators.map(({yl:g,$n:h,zl:k,ut:l})=>{const n=d.map((p,q)=>{q=f[q];q=(new olympe.net.Si(g,h,`${l}${q?'/'+q:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).j();return[p,q]});return new Map(n)})).pipe(rxjs.operators.shareReplay(1)));
574
+ C(a,olympe.L.P.Me,olympe.L.cc);C(a,olympe.L.P.pm,olympe.L.zu,olympe.L.P.Da,olympe.net.P.Fa,olympe.U.P.jg,olympe.L.P.hs,new olympe.V.oa(olympe.L.Config.xr));D(a,'com.server.ManagerConfig',[new olympe.V.oa(olympe.L.Config.cr),new olympe.V.oa(olympe.L.Config.rs),new olympe.V.oa(olympe.L.Config.Rl),new olympe.V.oa(olympe.L.Config.Nr),new olympe.V.oa(olympe.dc.Config.Yh)],(...e)=>{const f=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],g=new Map;e.forEach((h,k)=>g.set(f[k],
575
+ h));return g});C(a,olympe.L.P.Nk,olympe.L.Na,olympe.L.P.Da,olympe.net.P.Fa,olympe.host.P.He,olympe.host.P.Qk,'server.WebSocketRequest','server.wakeUpRequest',olympe.U.P.jg,'com.server.ManagerConfig');Ya(a,olympe.L.Config.Yt,['com.hostConfig'],e=>`${e.zl?'https':'http'}://${e.yl}`);Ya(a,'com.bus.TopicPrefix',[olympe.host.Config.Jk,olympe.L.Config.ds],(e,f)=>{const g=0<f.length;return e===olympe.host.Wg.Th?g?`${b}-${f}`:b:g?f:''});D(a,'com.bus.ManagerConfig',[new olympe.V.Dh('com.hostConfig'),new olympe.V.Dh('com.bus.TopicPrefix'),
576
+ new olympe.V.oa(olympe.L.Config.Ll),new olympe.V.oa(olympe.L.Config.Go),new olympe.V.oa(olympe.L.Config.Ho),new olympe.V.oa(olympe.L.Config.Fo),new olympe.V.oa(olympe.L.Config.Do),new olympe.V.oa(olympe.L.Config.Eo),new olympe.V.oa(olympe.L.Config.Bo)],(e,f,g,h,k,l,n,p,q)=>{e=e.pipe(rxjs.operators.map(({wx:r,xx:t,yx:v,Ax:x,zx:y})=>({host:r,xh:y,port:v,path:t,tA:x,pt:l,Yz:n,Zz:p,xz:h+3E4,fz:q})),rxjs.operators.shareReplay(1));return new Map([['connection',e],['topicPrefix',f],['allowGuest',g],['requestTimeout',
577
+ h],['subscriptionsRefreshRate',k]])});C(a,olympe.L.P.Co,olympe.L.Ol,olympe.net.P.Fa,olympe.L.P.vf,olympe.auth.P.Fa,olympe.host.P.He,olympe.L.P.Me,olympe.U.P.jg,'com.bus.ManagerConfig');D(a,'com.connectivity.ManagerConfig',[olympe.net.P.Jm,olympe.Db.P.$g,new olympe.V.oa(olympe.L.Config.Vm)],(e,...f)=>['storagePrefix','reconnectionDelay'].reduce((g,h,k)=>g.set(h,f[k]),e));C(a,olympe.L.P.vf,olympe.L.uc,olympe.L.P.Da,olympe.L.P.Nk,olympe.net.P.Fa,olympe.host.P.He,olympe.Db.P.Cm,'com.connectivity.ManagerConfig')},
578
+ 'olympe.communication');olympe.V.run([olympe.L.P.Co,olympe.L.P.vf],(a,b)=>{olympe.L.ih=()=>a;olympe.L.En=()=>b});olympe.auth={};function $e(a,b){Ge(a.j);ye(a.j,olympe.L.Fe.Ng,c=>{const d=c.c;d===olympe.auth.ud.j.wv?(a.j.ke(),b(olympe.auth.Ta.D.Rj,c)):d===olympe.auth.ud.j.nw&&b(olympe.auth.Ta.D.Wp,c)},'logoutHandler')}
579
+ function af(a,b,c){const d=null==b?void 0:b.Df();if(b instanceof olympe.auth.zk){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.Gd();h.access_token=bf(b);g=`${se(a.Lh,olympe.L.Yb.wk)}/logout${d?`?idpName=${d}`:''}`;a.D.redirect(g,h)};c=a.D.j();const f=new URL(c);0!==f.hash.length||0!==f.search.length?(f.hash='',f.search='',a.F.db.set('main',c,'redirectTo').then(()=>{e(f.toString())}).catch(g=>{a.G.error(`Error when trying to set the redirectKey in Auth store: ${g}`)})):e(c)}else De(a.j,
580
+ olympe.L.Fe.Ng,Object.assign({},{c:olympe.auth.ud.j.xv},d&&{idpName:d}),c)}function cf(a,b,c,d){olympe.C.Qa(a.H.getState())===olympe.L.uc.j.Ef?d(new olympe.error.Zq,'Working offline'):(c.c=b,De(a.j,olympe.L.Fe.Ng,c,d))}
581
+ function df(a,b,c){if(b.Mg()!==olympe.auth.Ec.j.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.Df()}&access_token=${bf(b)}`;d=`${se(a.Lh,olympe.L.Yb.wk)}/refresh${d}`;d=Hc(N(d),olympe.net.ua.ResponseType.JSON);ue(a.Lh,d,b.Gd()).then(e=>{(e=e.getData())?(e=new olympe.auth.zk(b.xc(),b.ue(),b.Gd(),e,b.Df()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
582
+ olympe.auth.ud=class{constructor(a,b,c,d,e,f){this.G=a;this.j=b;this.Lh=c;this.H=d;this.D=e;this.F=f;ef(this.F).then(g=>{g&&this.F.db.remove('main','redirectTo').then(()=>{this.D.redirect(g,null,olympe.auth.Lk.j.GET)}).catch(h=>{this.G.error(`Error when trying to remove redirect key from AUTH storage: ${h}`)})}).catch(g=>{this.G.error(`Error when trying to get redirect key from AUTH storage: ${g}`)})}rf(a){De(this.j,olympe.L.Fe.Ng,{c:olympe.auth.ud.j.ig},b=>a(b))}qh(a,b,c){const d=se(this.Lh,olympe.L.Yb.ks);
583
+ a=N(`${d}/${a}`);ue(this.Lh,a,b).then(e=>c(null,e.getData())).catch(e=>c(Error(e)))}};olympe.auth.ud.j={Ng:1,xv:2,Ab:3,ig:5,ij:6,Du:10,Bw:11,Gt:12,SAML:13,nw:14,wv:20};function ie(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.U.ni());a.R.set(c,b)}function ee(a){return olympe.C.Qa(a.dd.tb())}
584
+ function Me(){var a=olympe.auth.re();const b=olympe.auth.Ta.j.Sj,c=olympe.auth.Ta.j.INIT;ff(a,b);a.ia?(a.j=olympe.auth.Ta.F.Ft,a.G.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),gf(a)):(a.j=olympe.auth.Ta.F.If,a.G.log('Connector online, attempting to log with token'),hf(a));return rxjs.firstValueFrom(a.state.tb().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
585
+ function jf(a){a.G.log('Initializing AUTH layer');let b=a.Ub;if('object'===typeof location){const c=location.hash;let d=c.indexOf('authToken=');-1<d&&(b=c.substring(d+10),'&'===c[d-1]&&d--,location.hash=c.substring(0,d))}b&&a.storage&&kf(a.storage,b).catch(c=>a.G.error(c));a.G.debug('Asking to be notified when auth connector gets online');olympe.C.Wc([a.wa.getState()],c=>{switch(c){case olympe.L.uc.j.Ef:a.j=olympe.auth.Ta.F.If;a.G.log('Connector offline, attempting to recover sessions from current token');
586
+ hf(a);break;case olympe.L.uc.j.zc:switch(olympe.C.Qa(a.state)){case olympe.auth.Ta.j.sf:c=olympe.C.Qa(a.dd).xc();lf(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ta.j.Pi:a.G.info('Disconnected from server - guest session lost');break;case olympe.auth.Ta.j.Sj:lf(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Ta.j.INIT:lf(a,'Cannot open auth session - no server connection');break;default:lf(a,'Should not get there, investigate',!0)}}});
587
+ $e(a.D,(c,d)=>{if(c===olympe.auth.Ta.D.Rj){lf(a,'authentication revoked');let e;null==(e=a.storage)||mf(e).catch(f=>a.G.error('Failed to clear token',f));a.R.forEach(f=>{f(c,d)})}else if(c===olympe.auth.Ta.D.Wp){a.G.info('Redirection to IDP to invalidate token (SAML)');ee(a);let e;null==(e=a.storage)||mf(e).catch(f=>a.G.error('Failed to clear token',f));a.Ha.D()}else throw Error(`Unknown logout step coming from server : ${c}`);});a.Z=nf(a);a.G.log('DONE initializing AUTH layer (waiting for connector to be online)')}
588
+ function of(a,b){let c=null;olympe.C.Gj(a.state.tb().Jd(olympe.auth.Ta.j.sf).and(b),()=>{const d=ee(a);!pf(a)&&d&&(c=a.Yd.get(d.Mg()).H(d,(e,f)=>{e?(a.G.error('Failed to refresh token, error message: ',e.message),a.Jj().catch(g=>a.G.error(`Failed to logout after wrong refresh ${g}`))):f&&qf(a,f)}))},()=>{let d;null==(d=c)||d()})}
589
+ function hf(a){null!==a.storage?(a.G.debug('Retrieving token from local storage'),a.storage.te().then(b=>{if(b){const e=new olympe.auth.Request;var c=b.xc();e.set('username',c);c=e;var d=b.Gd();c.set('nonce',d);'string'===typeof b.Df()&&e.set('idpName',b.Df());a.G.debug('Token found, trying login with',e);rf(a,e,olympe.auth.Ec.j.Km)}else lf(a,'No token found, cannot perform auto login')}).catch(b=>{lf(a,b.message,!0)})):lf(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
590
+ !0)}function lf(a,b,c=!1){a.dd.update(a.N);ff(a,olympe.auth.Ta.j.Pi);b=`Authenticated as guest (${b})`;c?a.G.error(b):a.G.info(b)}function nf(a){const b=[olympe.auth.Ta.j.sf];a.ia||b.push(olympe.auth.Ta.j.Pi);return a.ba.j(()=>{const c=sf(a);return b.includes(c)?Promise.resolve('The auth manager is OK'):Promise.reject(`The auth manager is not in valid state, the current state is: ${c}`)})}function ff(a,b){a.G.log('State change: ',sf(a),'--\x3e',b);a.state.update(b)}
591
+ function gf(a){if(a.H){const b=new olympe.auth.Request;b.set('username',a.H);b.set('password',a.Ua);a.G.log('Autologin with user "'+a.H+'"');rf(a,b)}else lf(a,'No user specified for auto login',!0)}function pf(a){return olympe.C.Qa(a.dd)===a.N}function qf(a,b){if(b){a.dd.update(b);let c;null==(c=a.storage)||kf(c,b).catch(d=>a.G.error(d));a.G.debug('Token updated')}}function sf(a){return olympe.C.Qa(a.state.tb())}function tf(){var a=olympe.public.Ma.get();return new Map(a.D.j.Fd)}
592
+ function uf(a,b,c,d=!1){b=b+c?':'+c.message:'';a.G.error(b);a.error.update(olympe.C.xb(b));ff(a,olympe.auth.Ta.j.Ab);if(d)throw Error(b);}function rf(a,b,c,d){void 0===c&&(c=a.lb);void 0===c&&uf(a,'No authentication provider specified',null,!0);const e=a.Yd.get(c);e||uf(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.F.set('login',d);a.G.log('Sending authentication request using "'+c+'" for '+b);e.te(b,a.vb.bind(a));ff(a,olympe.auth.Ta.j.Sj)}
593
+ function vf(a,b,c){a.F.forEach(d=>{d(b,c)})}
594
+ olympe.auth.Ta=class{constructor(a,b,c,d,e,f,g,h,k){this.G=a;this.wa=b;this.D=c;this.storage=d;this.Ha=e;this.lb=k.get('defaultProvider');this.ia=!!k.get('autoLogin');this.H=k.get('autoUser');this.Ua=k.get('autoPassword');this.Ub=k.get('autoToken');this.Yd=new Map;this.ba=f;this.Z='';this.state=olympe.C.bc(String).update(olympe.auth.Ta.j.INIT);this.error=olympe.C.bc(olympe.C.Sa);this.j=null;this.N=new olympe.auth.eh('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.dd=olympe.C.bc(olympe.auth.eh).update(this.N);
595
+ this.F=new Map;this.R=new Map;this.X=new olympe.U.Zh(k.get('cacheTokenTimeout'));h.forEach(l=>{const n=l.F();if(this.Yd.has(n))throw Error('Provider "'+n+'" has already been registered !');this.Yd.set(n,l)});jf(this);of(this,g.j())}rl(){const a=olympe.auth.Ta.j.sf,b=olympe.auth.Ta.j.Pi,c=olympe.auth.Ta.j.Ab,d=olympe.C.bc(olympe.C.da);olympe.C.Wc([this.state],e=>{e===a?d.update(olympe.C.da.D):e===b?d.update(olympe.C.da.j):e===c?(this.G.error('Authentication failed.'),d.update(olympe.C.da.j)):d.clear()});
596
+ return d.tb()}yg(a){if(olympe.C.Qa(this.state)===olympe.auth.Ta.j.sf){var b=ee(this);!pf(this)&&b&&this.Yd.get(b.Mg()).yg(b,(c,d)=>{c?(this.G.error('Failed to refresh token, error message: ',c.message),this.Jj().catch(e=>this.G.error(`Failed to logout after wrong refresh ${e}`))):d&&qf(this,d);a(c)})}}getState(){return this.state.tb()}xc(){return this.dd.tb().xc()}ue(){return this.dd.tb().ue()}ri(){return this.dd.tb().ri()}qh(a,b){if(fb(this.X.j,a))b(null,this.X.get(a));else{var c,d=null==(c=olympe.C.Qa(this.dd.tb()))?
597
+ void 0:c.Gd();this.D.qh(a,d,(e,f)=>{'string'===typeof f&&this.X.set(a,f);b(e,f)})}}Jj(){return pf(this)?(this.G.warn('Logout called for Guest user so it will be ignored'),Promise.resolve()):new Promise((a,b)=>{this.G.debug('Sending logout');let c;null==(c=this.storage)||mf(c).catch(d=>this.G.error('Failed to clear token',d));af(this.D,ee(this),d=>{d?(uf(this,'Logout request rejected:',d),b(d)):(this.G.debug('Logout request acknowledged'),a())});this.ba.D(this.Z)})}rf(a){sf(this)===olympe.auth.Ta.j.sf&&
598
+ this.D.rf(b=>{b&&this.G.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}vb(a,b){const c=null===this.j?olympe.auth.Ta.F.Dv:this.j;this.j=null;if(!a||a instanceof olympe.error.Zq){null===a?this.G.info(`User ${b.xc()} (#${b.ue()}) successfully authenticated`):this.G.info(`User ${b.xc()} (#${b.ue()}) recovered from token, while offline`);this.dd.update(b);ff(this,olympe.auth.Ta.j.sf);vf(this,a,c);let d;null==(d=this.storage)||kf(d,b).catch(e=>this.G.error(e))}else{let d;
599
+ null==(d=this.storage)||mf(d).catch(e=>this.G.error(e));this.error.update(olympe.C.xb(a.message));lf(this,'authentication rejected: '+a.message);vf(this,a,c)}this.F.has('login')&&this.F.delete('login')}};olympe.auth.Ta.j={INIT:'init',Sj:'authenticating',Pi:'guest',sf:'authenticated',Ab:'error'};olympe.auth.Ta.F={Dv:'manual',Ft:'auto',If:'tokenOnFirstConnection'};olympe.auth.Ta.D={Rj:'accepted',Wp:'redirect'};olympe.auth.Ec=class{constructor(a,b){this.G=a;this.D=b;this.j=null}F(){}te(){}H(a,b){const c=()=>{this.j=setTimeout(()=>this.D.rf(d=>{d?b(d,null):(b(null,null),c())}),this.D.j.hd)};c();return()=>{this.j&&clearTimeout(this.j);this.j=null}}yg(a,b){this.D.rf(c=>{b(c,null)})}};olympe.auth.Ec.j={SAML:'saml',OAUTH2:'openID',SRP:'srp',Km:'olympeToken'};function wf(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.j=new Map}set(a,b){olympe.C.Wc([b],c=>{this.j.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.j.get(a.toLowerCase()))&&a.fh&&(a=a.Ba.Eb);return a?a.valueOf():a}xc(){return this.get('username')}Gd(){return this.get('nonce')}toString(){return this.xc()+(this.Gd()?' with nonce':'')+(this.get('password')?' with password':'')+(wf(this)?` with idp name ${wf(this)}`:'')}};olympe.auth.eh=class{constructor(a,b,c,d={},e=null){this.user=a;this.Bi=b;this.D=c;this.j=e;this.F=d}xc(){return this.user}ue(){return this.Bi}Gd(){return this.D}Vi(){return this.F}ri(){return null}Df(){return this.j}fa(){const a=olympe.U.jf(),b=Object.assign({},{user:this.user,userTag:this.Bi,nonce:this.D},this.j&&{idpName:this.j},{payload:this.F});return olympe.U.zs(ab(a,JSON.stringify(b)))}Mg(){return olympe.auth.Ec.j.SRP}};m=olympe.auth.eh.prototype;m.xc.K=new olympe.C.J(()=>String,[]);
600
+ m.ue.K=new olympe.C.J(()=>String,[]);m.Gd.K=new olympe.C.J(()=>String,[]);m.Vi.K=new olympe.C.J(()=>Object,[]);m.ri.K=new olympe.C.J(()=>String,[]);m.Df.K=new olympe.C.J(()=>String,[]);m.fa.K=new olympe.C.J(()=>String,[]);m.Mg.K=new olympe.C.J(()=>String,[]);function bf(a){return a.Vi().access_token||null}function xf(a){return 1E3*parseInt(a.Vi().access_token_exp||'0',10)}olympe.auth.zk=class extends olympe.auth.eh{constructor(a,b,c,d,e){super(a,b,c,d,e);this.H=Date.now()}ri(){return bf(this)}Mg(){return olympe.auth.Ec.j.OAUTH2}};olympe.auth.Hr=class extends olympe.auth.eh{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.H=d}ri(){return this.H}Mg(){return olympe.auth.Ec.j.SAML}fa(){const a=olympe.U.jf(),b=Object.assign({},{user:this.xc(),userTag:this.ue(),nonce:this.Gd()},this.Df()&&{idpName:this.Df()},{payload:this.Vi(),fullToken:this.H});return olympe.U.zs(ab(a,JSON.stringify(b)))}};function ef(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function kf(a,b){return vb(a.D,()=>a.db.set('main','string'===typeof b?b:b.fa(),a.j).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function mf(a){return vb(a.D,()=>a.db.remove('main',a.j).catch(b=>{a.G.error(`Error when trying to remove the token from the auth store: ${b}`)}))}
601
+ olympe.auth.Mt=class{constructor(a,b,c){this.F=a;this.G=b;this.j='OlympeToken-'+c.j;this.D=new olympe.U.promise.Tk;this.db=this.F.D('AUTH')}te(){this.G.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.j}`);return vb(this.D,()=>{const a=this;return u(function*(){let b;try{b=yield a.db.get('main',a.j)}catch(g){throw Error(`Error when trying to get the token from the auth store: ${g}`);}let c=null;if(b)try{a.G.debug('olympe.auth.AuthStorage: Token retrieved successfully');var d=JSON,e=
602
+ d.parse;var f=bb(olympe.U.jf().D(olympe.U.ux(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.Hr(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.zk(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.eh(g.user,g.userTag,g.nonce,g.payload,g.idpName);c=h}catch(g){throw Error(`Error while unserializing token: ${g}`);}else a.G.debug('olympe.auth.AuthStorage: No token found');return c})})}};olympe.auth.Lk=class{redirect(){}D(){}j(){}};olympe.auth.Lk.j={GET:'GET',Sh:'POST'};olympe.auth.so=class{constructor(a){this.j=a||'default'}};olympe.auth.Yd={};function yf(a,b,c){cf(a.D,olympe.auth.ud.j.Ng,{token:b.Gd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.ud.j.Ab:c(Error('Invalid token'),null);break;case olympe.auth.ud.j.ij:d=null;if(e=e.payload){const f=e.userName,g=e.userTag,h=e.rndCook,k=e.payload,l=e.protocol;'SAML'===l?d=new olympe.auth.Hr(f,g,h,e.samlToken,k,wf(b)):'openid'===l&&(d=new olympe.auth.zk(f,g,h,k,wf(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
603
+ olympe.auth.Yd.Cv=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.storage=c}F(){return olympe.auth.Ec.j.Km}te(a,b){this.storage.te().then(c=>{yf(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function zf(a,b,c){var d=xf(b);const e=Math.max(d-b.H,0),f=olympe.V.getParameter(olympe.auth.Config.bs);d=Math.max(Math.round(d-e*(1-Math.max(Math.min((f||50)/100,.95),0))-Date.now()),0);if(0<d)return setTimeout(()=>{a.yg(b,c)},d);a.yg(b,c);return null}
604
+ olympe.auth.Yd.Tv=class extends olympe.auth.Ec{constructor(a,b,c,d){super(a,b);this.N=c;this.R=d}F(){return olympe.auth.Ec.j.OAUTH2}te(a){const b=encodeURIComponent(this.N.j());a=wf(a)?`idpName=${wf(a)}&`:'';this.N.redirect(`${this.R}/auth?${a}url=${b}`,null,olympe.auth.Lk.j.GET)}H(a,b){0<xf(a)?this.j=zf(this,a,b):b(null,a);return this.X.bind(this)}yg(a,b){df(this.D,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.j&&(this.j=zf(this,d,b)))})}X(){this.j&&clearTimeout(this.j);this.j=null}};function Af(a,b){cf(a.D,olympe.auth.ud.j.SAML,{},(c,d)=>{null!==c?b(c):d.url&&d.request?b(null,d.url,d.request.replace(/\s/g,''),d.id):b(Error('Missing parameters from server response'))})}olympe.auth.Yd.SAML=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.N=c}F(){return olympe.auth.Ec.j.SAML}te(a,b){Af(this,c=>{c?b(c,null):this.N.D(wf(a))})}};function Bf(a,b,c){const d=olympe.auth.ud.j.Du,e=olympe.auth.ud.j.Ab,f=olympe.auth.ud.j.Bw,g={I:b.xc()};cf(a.D,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.xc()}' invalid, or password does not match`));break;case f:h=k.payload;c(null,h.S,h.B);break;default:c(Error('Unknown response from server'))}})}
605
+ function Cf(a,b,c){const d=olympe.auth.ud.j.Gt,e=olympe.auth.ud.j.Ab,f=olympe.auth.ud.j.ij;b={A:b.get('a'),M:b.get('m1'),I:b.xc()};cf(a.D,d,b,(g,h)=>{if(null!==g)c(g,null);else switch(h.c){case e:a.G.debug('Login failed, invalid username or password');c(Error('Invalid username or password'),null);break;case f:g=h.payload;a.G.debug('Login successful, creating token');h=g.payload?JSON.parse(g.payload):void 0;c(null,new olympe.auth.eh(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
606
+ null)}})}olympe.auth.Yd.SRP=class extends olympe.auth.Ec{F(){return olympe.auth.Ec.j.SRP}te(a,b){const c=a.get('password');a.j.delete('password');this.G.debug('Sending SRP request');Bf(this,a,(d,e,f)=>{this.G.debug('Received Salt+B message');if(d)b(d,null);else{try{const g=new SRPClient;g.step1(a.xc(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g,null);return}this.G.debug('Sending SRP A+M (proof) message');Cf(this,a,b)}})}};olympe.auth.P={Fa:'auth.Manager',Da:'auth.Logger',hj:'auth.Storage',Fl:'auth.appNameToken',Hk:'auth.Redirector',Lr:'auth.ServerConnector'};olympe.auth.Config={bm:'auth.defaultProvider',mo:'auth.autoLogin',oo:'auth.autoUser',no:'auth.autoPassword',If:'auth.token',Ko:'auth.cacheTokenTimeout',bs:'auth.tokenDurationPercentage'};
607
+ olympe.V.config(function(a){E(a,olympe.auth.Config.bm,olympe.auth.Ec.j.SRP);E(a,olympe.auth.Config.mo,!1);E(a,olympe.auth.Config.oo,'');E(a,olympe.auth.Config.no,'');E(a,olympe.auth.Config.If,'');E(a,olympe.auth.Config.bs,50);E(a,olympe.auth.Config.Ko,3E5);D(a,olympe.auth.P.Da,[olympe.ga.P.Fa],b=>b.ad('auth'));C(a,olympe.auth.P.Fl,olympe.auth.so,olympe.Db.P.$g);C(a,olympe.auth.P.hj,olympe.auth.Mt,olympe.Db.P.qk,olympe.auth.P.Da,olympe.auth.P.Fl);C(a,olympe.auth.P.Lr,olympe.auth.ud,olympe.auth.P.Da,
608
+ olympe.L.P.Nk,olympe.L.P.pm,olympe.L.P.vf,olympe.auth.P.Hk,olympe.auth.P.hj);Xa(a,olympe.auth.P.Hk);D(a,olympe.auth.P.Fa,[olympe.auth.P.Da,olympe.L.P.vf,olympe.auth.P.Lr,olympe.host.P.He,olympe.host.P.Qk,new olympe.V.qb(olympe.auth.P.hj,olympe.V.Ah.j.Gm),new olympe.V.qb(olympe.auth.P.Hk,olympe.V.Ah.j.Gm),new olympe.V.oa(olympe.auth.Config.bm),new olympe.V.oa(olympe.auth.Config.mo),new olympe.V.oa(olympe.auth.Config.oo),new olympe.V.oa(olympe.auth.Config.no),new olympe.V.oa(olympe.auth.Config.If),
609
+ new olympe.V.oa(olympe.auth.Config.Ko)],(b,c,d,e,f,g,h,k,l,n,p,q,r)=>{const t=[new olympe.auth.Yd.Cv(b,d,g),new olympe.auth.Yd.SRP(b,d),new olympe.auth.Yd.SAML(b,d,h),new olympe.auth.Yd.Tv(b,d,h,se(d.Lh,olympe.L.Yb.wk))];if(!t.map(v=>v.F()).includes(k))throw Error(`Default provider name ${k} given by parameter ${olympe.auth.Config.bm} cannot be found`);return new olympe.auth.Ta(b,c,d,g,h,e,f,t,new Map([['defaultProvider',k],['autoLogin',l],['autoUser',n],['autoPassword',p],['autoToken',q],['cacheTokenTimeout',
610
+ r]]))},!0)},'olympe.auth');olympe.V.run([olympe.auth.P.Fa],a=>{olympe.auth.re=()=>a});olympe.Xa.node.auth={};olympe.Xa.node.auth.Nq=class{redirect(){console.warn('Redirection n/a in Node.JS')}D(){console.warn('Redirection n/a in Node.JS')}j(){console.warn('Redirection n/a in Node.JS');return''}};olympe.Xa.node.auth.Nq.ya=[olympe.auth.Lk];olympe.V.config(a=>{C(a,olympe.auth.P.Hk,olympe.Xa.node.auth.Nq)},'olympe.native.node.auth');olympe.Xa.node.Db={};function Df(){throw Error('Key-Value Database does not implement this in NodeJS');}
611
+ olympe.Xa.node.Db.Lq=class{constructor(a){this.G=a;this.j=new Map}X(){return 0}N(a){const b=this;return u(function*(){let c,d;return null!=(d=null==(c=b.j.get(a))?void 0:c.size)?d:0})}F(a){const b=this;return u(function*(){const c=b.j.get(a);return c?Array.from(c.values()):[]})}R(a){const b=this;return u(function*(){const c=b.j.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return u(function*(){let d;for(const [e,f]of null!=(d=c.j.get(a))?d:new Map)b(f,e)})}has(a,b){const c=this;
612
+ return u(function*(){let d,e;return null!=(e=null==(d=c.j.get(a))?void 0:d.has(b))?e:!1})}get(a,b){const c=this;return u(function*(){let d;return null==(d=c.j.get(a))?void 0:d.get(b)})}set(a,b,c){const d=this;return u(function*(){let e;return null==(e=d.j.get(a))?void 0:e.set(c,b)})}remove(a,b){const c=this;return u(function*(){let d;yield null==(d=c.j.get(a))?void 0:d.delete(b)})}ba(){Df();return Promise.resolve()}Z(){Df();return Promise.resolve()}clear(a){const b=this;return u(function*(){let c;
613
+ null==(c=b.j.get(a))||c.clear()})}H(){Df();return Promise.resolve([])}D(){return u(function*(){Df()})}};olympe.Xa.node.Db.Lq.ya=[olympe.Db.qv];olympe.Xa.node.Db.Mq=class{constructor(a){this.j=new Map;this.G=a}D(a){this.j.has(a)||this.j.set(a,new olympe.Xa.node.Db.Lq(this.G));return this.j.get(a)}};olympe.Xa.node.Db.Mq.ya=[olympe.Db.rv];olympe.V.config(function(a){C(a,olympe.Db.P.qk,olympe.Xa.node.Db.Mq,olympe.Db.P.Da)},'olympe.native.node.localstorage');olympe.Xa.node.storage={};olympe.Xa.node.storage.Storage=class{constructor(a){this.G=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Xa.node.storage.Storage.ya=[olympe.Db.Storage];olympe.V.config(function(a){Va(a,olympe.Db.P.hj,olympe.Xa.node.storage.Storage,olympe.host.P.Da)},'olympe.native.html.storage');olympe.xg={};olympe.xg.Config={VERSION:'version.version',Pt:'version.branch',uf:'version.commit',Jw:'version.tag',yp:'version.olympe-framework',Qt:'version.build'};olympe.V.config(function(a){E(a,olympe.xg.Config.VERSION,'');E(a,olympe.xg.Config.Pt,'');E(a,olympe.xg.Config.uf,'');E(a,olympe.xg.Config.Jw,'');E(a,olympe.xg.Config.yp,'');E(a,olympe.xg.Config.Qt,'')},'olympe.main');const Ef=require('fs'),Ff=require('fs/promises');let Gf;const Hf=null!=(Gf=process.env.EXTRA_CONFIG_PATH)?Gf:null;let If;const Gb=null!=(If=process.env.EXTRA_CONFIG_KEY_PREFIX)?If:'';function Fb(a){return Ff.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
614
+ function Jf(a){var b=Kf;console.debug(`Start watching config files for changes: ${b}`);b.forEach(c=>{Ff.access(c,Ef.constants.F_OK).then(()=>{Ef.watch(c,d=>u(function*(){if('change'===d){console.log(`Config file "${c}" has changed. Loading new configuration...`);try{const e=yield olympe.U.it([c]),f=olympe.V.Ss(e);for(const [g,h]of f)a.Ai(g,h)}catch(e){console.error(`Failed to updated config from file ${c} with message: ${e.message}`)}}}))}).catch(()=>{})})}
615
+ function Lf(){console.log('The node process received a signal for graceful shutdown');let a,b,c,d;(null!=(d=null==(b=(a=olympe.Xa.node.host).ll)?void 0:null==(c=b.call(a))?void 0:fd(c))?d:Promise.resolve()).then(()=>console.log('The node backend has stopped successfully')).catch(e=>console.warn(e)).finally(()=>process.exit(0))}process.on('SIGTERM',Lf);process.on('SIGINT',Lf);process.on('SIGBREAK',Lf);process.on('SIGHUP',Lf);
616
+ process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);Lf()});const Kf=['oConfig.json','conf.d/oConfig.json','version.json'];Hf&&Kf.push(Hf);
617
+ olympe.U.it(Kf).then(a=>{try{const b=Object.create(null),c=process.argv;for(let f=2;f<c.length;f++){const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(c[f]);!Array.isArray(g)||4>g.length?console.warn(`Malformed config parameter "${c[f]}" ignored. It should of the form 'a=b'`):b[g[1]]=olympe.U.As(g[3])}const d=new olympe.V.du(a,b);La(d);const e=d.compile();Na(e);Jf(e)}catch(b){console.error(`Failed to start Olympe: ${b}`),process.exit(1)}}).catch(a=>{console.error(`Failed to load config files: ${a.message}.`);
618
+ setInterval(()=>{},1073741824)});olympe.dc={};olympe.dc.ta={ORIGIN:'<',DESTINATION:'>'};w('olympe.dc.Direction',olympe.dc.ta);olympe.dc.fc={Zc:'ff022000000000000000',Li:'ff02200000000000000e',Zj:'ff02200000000000000f'};olympe.dc.lq={VERSION:'@v',Zg:'@s'};olympe.dc.he={Xe:'?',hg:'~'};olympe.dc.rD={cj:'online',Ef:'offline',WB:'invalidate'};olympe.dc.Ia={SELF:'self',SERVER:'server',Ze:'remote'};
619
+ olympe.dc.Lb={NONE:null,hp:'ff023000000000000037',Dc:'ff023000000000000137',kg:'ff023000000000000237',yw:'ff023000000000000337',ku:'ff023000000000000437',Vw:'ff023000000000000537',YB:olympe.dc.he.hg+'ff023000000000000037',ZB:olympe.dc.he.hg+'ff023000000000000237',XB:olympe.dc.he.hg+'ff023000000000000437',hE:olympe.dc.he.hg+'ff023000000000000537'};olympe.dc.Xq=class extends Error{constructor(a){var b=olympe.dc.ha(),c=olympe.dc.ee(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.jb(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.Qq=class extends Error{constructor(){var a=Mf();super('Try to access a resource not available yet: BusinessContainer, wait for it to be ready');this.j=a}};olympe.dc.Writable=class{Sc(){}Yc(){}D(){}Oa(){}hc(){}};olympe.dc.ir=class{qc(){}T(){}H(){}};olympe.dc.vc=class{constructor(a){this.tag='string'===typeof a?a:a.W()}W(){return this.tag}Ea(a){return a instanceof olympe.dc.vc&&this.tag===a.tag}};olympe.dc.vc.ya=[olympe.dc.Ye];olympe.dc.vc.prototype.Ea.K=olympe.C.J.j;olympe.dc.tu=class a{constructor(b,c,d,e,f,g){this.G=b;this.Z=c;this.db=c.view;this.ba=d;this.Jb=e;this.D=f;this.N=g;this.j=new Map;this.F=hb(new olympe.U.Zh(6E5),(h,k)=>{URL.revokeObjectURL(k);Nf(this.db,h,a.j(h))})}ia(b,c,d,e,f){this.Ua(c).then(g=>{this.lb(b,g,d,!!this.N,e,f)}).catch(g=>this.G.error(g))}H(b){const c=this;return u(function*(){const d=f=>{f=`Failed to download file ${b.W()}: ${f}`;c.G.error(f);throw Error(f);},e=b.W();if(fb(c.F.j,e)){const f=c.F.get(e);return c.D.F(f).then(g=>g.arrayBuffer()).then(g=>
618
620
  new Uint8Array(g,0,g.byteLength)).catch(d)}return c.downloadFileContent(b).then(f=>c.D.H(f)).then(f=>{if(c.N){let g;const h=null!=(g=b.get(olympe.dm.File.mimeTypeProp))?g:'application/data';c.R(e,new Blob([f],{type:h}))}return f}).catch(d)})}downloadFileContent(b){var c=b.W(),d=b.get(olympe.dm.File.j);const e=b.get(olympe.dm.File.urlProp);if(e.startsWith('stream:'))return this.X(c).then(()=>this.downloadFileContent(b));if(e.startsWith('blob:'))return this.D.F(e).then(f=>f.arrayBuffer()).then(f=>new Uint8Array(f,
619
- 0,f.byteLength));if(d)return d=this.db.model(b),c=new olympe.dc.Request(olympe.dc.Request.j.dg,olympe.dc.ee().Qe(b),{tag:c,model:d,url:e.valueOf()}),this.Jb.request(c);c=N(e);Hc(c,olympe.net.va.ResponseType.Hl);return Ic(this.da,c).then(f=>{const g=f.Jc();if(200<=g&&300>g)return f.getData();throw Error(`Failed to download file ${b}. Response code ${g}`);})}sa(b,c,d){c=new olympe.dc.Request(olympe.dc.Request.j.bg,d,{tag:b,model:c});return this.Jb.request(c).then(()=>this.G.debug(`Successfully deleted file: ${b}`)).catch(e=>
620
- {throw Error(`Failed to delete file ${b}: ${e.message}`);})}Ha(b){const c=new olympe.U.stream.lg;this.H(b).then(d=>{cb(d).pipeTo(c).catch(()=>{})});return c}yb(b,c){this.D.H(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.ec;e.Xc(b,(new Map).set(olympe.dm.File.urlProp.W(),d));this.Z.md(Mf(e));let f;null==(f=this.j.get(b))||f.forEach(g=>g(null))}).catch(d=>{let e;null==(e=this.j.get(b))||e.forEach(f=>f(d))}).finally(()=>{this.j.delete(b)})}X(b){return new Promise((c,d)=>{let e;
621
- const f=null!=(e=this.j.get(b))?e:[];f.push(g=>g?d(g):c());this.j.set(b,f)})}nb(b,c,d,e,f,g){const h=e?k=>{this.R(b,new Blob([c],{type:d}));f(k)}:f;e=this.db.model(b);e=new olympe.dc.Request(olympe.dc.Request.j.ng,olympe.dc.ee().Qe(b),{tag:b,model:e,content:c,mimeType:d});this.Jb.request(e).then(k=>h(null!=k?k:'')).catch(null!=g?g:this.G.error.bind(this.G))}Wa(b){return u(function*(){var c=b instanceof olympe.C.Sa?b.valueOf():b;return'string'===typeof c?$a(c):c instanceof ArrayBuffer?new Uint8Array(c,
622
- 0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}R(b,c){const d=olympe.dc.ea(b);b=URL.createObjectURL(c);this.F.set(d,b);const e=a.j(d);Nf(this.db,d,f=>{f||(this.F.delete(d),Lf(this.db,d,e))},e)}static j(b){return`cacheBinary${b}`}};function Of(a,b){let c=Pf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.ff(b);if(null===b)break;c=Pf(b)}let e;return null!=(e=c)?e:null}olympe.dc.Lu=class{constructor(a,b,c){this.G=a;this.j=b;this.db=b.view;this.D=c;this.Ra=new FinalizationRegistry(d=>{this.G.F()&&this.G.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.j.detach([d],olympe.dc.db.Instance.j.$p)})}};function Qf(a,b){a.origin=b;return a}function Rf(a,b,c){a.D.set(b,c);return a}function Sf(a){let b;return null!=(b=a.D)?b:new Map}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Ia.SELF;this.j=b;this.content=null!=c?c:null;this.user=null!=d?d:ce(olympe.auth.qe()).te();this.D=new Map}getType(){return this.type}xc(){return this.user}ic(){return this.j}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.j}; content: ${this.content}`}};
623
- olympe.dc.Request.j={oc:1,Jg:10,uu:24,Kp:25,vu:28,Sg:30,Gk:31,MC:32,df:40,dh:41,wo:42,vr:43,bE:44,Fi:45,yo:46,jk:47,ng:50,dg:51,bg:52,Rw:60,fw:61,Fp:62,OB:63,Xt:64,yh:65,ck:91,wu:93,Cm:95,QUERY_RESULT:97};function Tf(a,b,c,d,e){const f=olympe.C.kh();a.sources.set(olympe.dc.Ia.SERVER,e.init(a));a.F?a.sources.set(olympe.dc.Ia.Ze,d.init(a)):Nf(b,a.j,()=>{a.sources.set(olympe.dc.Ia.Ze,d.init(a));const g=new Map;olympe.dc.la.from(a.j,a.j).bb(olympe.dm.DataSource.Mj).filter(olympe.dc.query.za.Ea(olympe.dm.DataSource.gi,!0)).observe(f).subscribe(h=>{var k=h.Ej();for(var l of k){const [p,q]=g.get(l);c.D(p);c.F(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=h.yj();for(const p of h)if(h=
624
- p.W(),!a.sources.has(h)){const q=new olympe.dc.sources.uq(a.G,p);a.sources.set(h,q);l=c.j(()=>q.healthCheck(),h,olympe.host.Je.j.READINESS);n=c.H(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});Lf(b,a.j,'router',!0)},'router')}function Uf(a,b,c){let d=a.D.get(b);void 0===d&&(d=[],a.D.set(b,d));d.push(c)}
625
- olympe.dc.kw=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=f;this.F=g;this.sources=new Map;this.D=new Map;Tf(this,d,e,b,c)}request(a){this.G.debug('Router: sends',a);return this.jb(a.ic()).request(a)}subscribe(a,b){this.G.debug('Router: subscribes',a);return this.jb(a.ic()).subscribe(a,b)}cd(a){if(a.ic()!==this.j)this.G.error(`Router: try to reply to a request that is not for this data cloud, ignore it: ${a}`);else{var b;null==(b=this.D.get(a.getType()))||b.forEach(c=>c(a))}}xi(a){let b;null==
626
- (b=this.D.get(a.getType()))||b.forEach(c=>c(a));return this.jb(olympe.dc.Ia.Ze).xi(a)}jb(a){let b;return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Ia.Ze)}};function Mf(a,b){b=new olympe.dc.Hg(a.T(),null!=b?b:null);b.j=a;return b}function Vf(a,b,c,d){c=new olympe.dc.Hg(null!=d?d:olympe.U.Kc(),null!=c?c:null);c.D=b;c.Ga=a;return c}
627
- olympe.dc.Hg=class{constructor(a,b){this.id=a;this.Ga=this.j=this.D=null;this.dl=b}static j(a){return Vf(a.p,a.s,a.t,a.i)}T(){return this.id}qc(a){return this.j instanceof olympe.dc.db.ec?this.j.qc(a):Array.isArray(this.Ga)?(new olympe.dc.transaction.dj(this.D)).D(this.Ga,a):a}H(){let a,b,c,d;return null!=(d=null!=(c=null==(a=this.Ga)?void 0:a.length)?c:null==(b=this.j)?void 0:b.H())?d:0}ac(){return this.j instanceof olympe.dc.db.ec?this.j:Array.isArray(this.Ga)?(this.j=(new olympe.dc.transaction.dj(this.D)).j(this.Ga,
628
- this.id),this.Ga=null,this.j):new olympe.dc.db.ec(this.id)}jl(){if(Array.isArray(this.Ga))return this.Ga;if(this.j instanceof olympe.dc.db.ec){const a=new olympe.dc.transaction.He;this.j.qc(a);return Wf(a)}return[]}fa(){return{p:this.jl(),t:this.dl,s:this.D,i:this.id}}};olympe.dc.Hg.ya=[olympe.dc.hr];olympe.dc.Ra={};const Xf=olympe.dc.ua.ORIGIN,Yf=olympe.dc.ua.DESTINATION,Zf=new Map,$f=new Map,ag=new Map,bg=new Map;function Pf(a){let b;return null!=(b=Zf.get(a))?b:null}function cg(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.bo||[])];return olympe.dc.na.j(b,c,...a)}function dg(a,b){bg.set(a,b);return a}function eg(a){let b,c;return null!=(c=null==(b=Zf.get(a))?void 0:b.D)?c:olympe.dc.CloudObject}
629
- function fg(a,b,c){const d=a+'@'+(b===Yf?Xf:Yf);if($f.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);$f.set(d,c)}function gg(a){a=a.W()+'@'+a.La();return $f.get(a)||olympe.dc.CloudObject}function P(a,b){b.NAME=a;ag.set(a,b)}function Q(a){let b;return null!=(b=a.NAME)?b:null}
630
- olympe.dc.na=class{constructor(){}static j(a,b,...c){if(Zf.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${Zf.get(a).D.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.V.qb(g):g}}b=new olympe.dc.Ra.Entry(a,b,d);Zf.set(a,b);return b.D.entry=b}static Vb(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.W())?c:null}};function hg(a,b){a.j=b}function R(a,b){b=b.$b();fg(b.W(),b.La(),a.D);return b}function ig(a){a.F=!0;return a}
631
- olympe.dc.Ra.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.bo=c||null;this.j=null;this.F=!1}W(){return this.tag}instantiate(a,b){const c=this.D;if(this.Nn()&&b.getParameter(olympe.dc.Config.pp)){var d=olympe.dc.ga();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.W()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ha.Xa('dc').error(d)}return this.bo?(a=[void 0,a].concat(Oa(b,this.bo)),new c(...a)):
632
- new c(void 0,a)}ja(a){return new olympe.dc.Ra.Property(a)}ra(a,b=olympe.dc.ua.DESTINATION){fg(a,b,this.D);return new olympe.dc.aa.$e(a,b)}Nn(){return this.F}};w('olympe.dc.registry.Entry',olympe.dc.Ra.Entry);olympe.dc.Ra.Entry.prototype.addRelation=olympe.dc.Ra.Entry.prototype.ra;olympe.dc.Ra.Entry.prototype.addProperty=olympe.dc.Ra.Entry.prototype.ja;olympe.dc.Ra.Entry.ya=[olympe.dc.Ye];olympe.dc.Ra.Property=class{constructor(a){this.tag=a}W(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Ra.Property.prototype.getTag=olympe.dc.Ra.Property.prototype.W;olympe.dc.Ra.Property.ya=[olympe.dc.Ye];olympe.dc.Ra.Relation=class{constructor(a,b=olympe.dc.ua.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.ea(a);this.direction=b;this.origin=c;this.H=d}W(){return this.tag}La(){return this.direction}type(){return this.H}$b(){return new olympe.dc.Ra.Relation(this.tag,this.direction===olympe.dc.ua.DESTINATION?olympe.dc.ua.ORIGIN:olympe.dc.ua.DESTINATION,this.H,this.origin)}Ea(a){return a instanceof olympe.dc.Ra.Relation?a.W()===this.W()&&a.La()===this.La():!1}toString(){return`${this.direction}${olympe.dc.ga().name(this.tag)} (${this.tag})`}};
633
- olympe.dc.Ra.Relation.prototype.getInverse=olympe.dc.Ra.Relation.prototype.$b;olympe.dc.Ra.Relation.prototype.getDirection=olympe.dc.Ra.Relation.prototype.La;olympe.dc.Ra.Relation.prototype.getTag=olympe.dc.Ra.Relation.prototype.W;olympe.dc.Ra.Relation.ya=[olympe.dc.Ye];olympe.dc.db={};function jg(a,b){const c=a.H,d=olympe.dc.ga(),e=olympe.dc.db.Database.D.ej,f=olympe.dc.db.Database.D.Xe,g=olympe.dc.db.Database.D.ORIGIN,h=olympe.dc.db.Database.D.DESTINATION,k=new olympe.dc.db.ec('rev-'+b.T());a.G.debug('Generate the reverse graphLayer of',b.T());b.Bb.forEach((l,n)=>{if(l.D()){k.D(n,olympe.dc.Lb.NONE);for(const [r,t]of l.Id())k.hc(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.yd())for(const r of kg(d,n,l.F())){l=c.get(r);const t=new Map;l.forEach((v,x)=>{const y=x[0],z=x.substring(1);
634
- y===e?t.set(z,v):y===f?t.set(x,v):y===g?v.forEach((A,K)=>{k.Oa(z,K,r)}):y===h&&v.forEach((A,K)=>{k.Oa(z,r,K)})});l=l.source();k.Rc(r,l,t)}else{const r=new Map;for(const t of l.zb().keys()){var q=t[0]===f;const v=q?t.substring(1):t;q=q?lg(p,v,!0):p.Pa(v,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Xc(n,r);for(const [t,v,x]of l.Id())x?k.hc(t,n,v):k.Oa(t,n,v)}}});return k}
635
- function mg(a,b,c){const d=b.T();if(a.F.has(d))throw Error(`You try to execute the patch ${d} a second times whereas the first execution has not been validated yet.`);const e=new ng(b,jg(a,b));a.D.unshift(d);a.F.set(d,e);a.H.bt(c);a.write(b,!1,!1)}
636
- function og(a,b,c){if(0>=a.N||null===c)return b;var d=a.j.findIndex(h=>h.T()===b.T()),e=a.j[d];-1<d&&a.j.splice(d,1);d=0<a.j.length?a.j.findIndex(h=>c>=h.D):0;d=-1<d?d:a.j.length;const f=a.j.slice(0,d).reduce((h,k)=>k.md(h),b);let g;e=null!=(g=null==e?void 0:e.update(f,c))?g:new pg(f,c,a.j,a.N);a.j.splice(d,0,e);a.G.F()&&a.G.debug('CommitController buffer:\n',a.j.map(h=>`${h.T()} at ${h.D}`).join('\n'));return f}
637
- function qg(a,b,c){return a.D.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>{let f;return null!=(f=null==e?void 0:e.md(d))?f:d},b)}function rg(a,b,c,d=!1){return u(function*(){const e=new olympe.dc.db.en(a.G,a.H,a.ga,c);e.open(d);for(const f=ha(b);;){const g=yield f.next();if(g.done)break;e.write(g.value,a.R)}e.close()})}
638
- function sg(a,b,c,d){b=b.pipeThrough(olympe.U.stream.tap(e=>{0<a.D.length&&og(a,qg(a,e.ac(),a.D.length),e.dl)}));return rg(a,b,c,d).then(()=>a.G.debug('Rebase stream completed')).catch(e=>a.G.error('Rebase stream failed:',e))}
639
- olympe.dc.db.au=class{constructor(a,b,c,d){this.G=a;this.H=b;this.ga=c;let e;this.R=null!=(e=d.get('debug'))?e:!1;let f;this.N=null!=(f=d.get('bufferTimeout'))?f:0;this.D=[];this.F=new Map;this.j=[];b.addEventListener(olympe.dc.db.Database.j.Bp,g=>{this.j.forEach(h=>{for(const k of g)h.j.j(k)})})}md(a,b,c){const d=a.T(),e=a.dl;this.F.has(d)?this.push(d,e):(a=og(this,qg(this,a.ac(),this.D.length),e),this.write(a,b,c))}push(a,b){const c=this.D.indexOf(a);if(-1<c){const d=this.F.get(a);this.D.splice(c,
640
- 1);og(this,qg(this,d.D,c),b);this.F.delete(a)}}write(a,b,c=!1){b=new olympe.dc.db.en(this.G,this.H,this.ga,b);b.open(c);b.write(a,this.R);b.close()}};class tg{T(){}md(){}}function ug(a,b,c,d){const e=olympe.dc.ua.DESTINATION;c=c.tag();const f=a.j.Tc(c);b.zb().forEach((g,h)=>{f.ja(h,g);b.Z(h)});for(const [g,h,k,l]of b.da()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.j.Oa(g,n,p);d.N(g,n,p)}}
641
- function vg(a,b,c,d){const e=olympe.dc.ua.DESTINATION,f=c.tag(),g=a.j.Tc(f);b.zb().forEach((h,k)=>{void 0!==c.Pa(k)&&(g.ja(k,h),b.Z(k))});for(const [h,k,l]of b.Id()){const n=c.nb(h,e,k);void 0!==n&&(d.N(h,f,k),n===l&&a.j.N(h,f,k))}}
642
- class ng extends tg{constructor(a,b){super();this.D=a;this.j=b;this.db=olympe.dc.ga()}T(){return this.D.T()}md(a){for(const [b,c]of this.D.da(a)){const d=b.tag();c.yd()?b.D()?a.j(d,b.F()):(this.D.j(d,c.F()),this.j.j(d,c.F())):b.yd()?(ug(this,c,b,a),a.j(d,b.F())):vg(this,c,b,a)}return a}}function wg(a){clearTimeout(a.F);a.F=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.H)}
643
- class pg extends tg{constructor(a,b,c,d){super();this.j=a;this.D=b;this.buffer=c;this.H=d;this.F=null;wg(this)}T(){return this.j.T()}md(a){return a.R(this.j)}update(a,b){this.D=b;a.qc(this.j);wg(this);return this}};const xg=olympe.dc.fc.Zc,yg=olympe.dc.fc.Li,zg=olympe.dc.ua.ORIGIN,Ag=olympe.dc.ua.DESTINATION;let Bg=0;
644
- olympe.dc.db.Database=class a extends Map{constructor(b,c,d){super();let e;this.id=null!=(e=d.get('selfTag'))?e:olympe.dc.Ia.SELF;this.G=b;this.vd=olympe.C.Za();this.state=olympe.dc.db.Database.F.IDLE;this.ia=new Map;this.Yb=[];this.X=new Map;this.H=null;this.da=new Set;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.zf.j.am;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Fd=new olympe.dc.db.zf(c,this,b,f);d.get('debug')&&this.$s()}T(){return this.id}getState(){return this.state}Xa(){return this.G}create(b,
645
- c,d,e=!1){var f=this.N(b,!0);if(!f.e&&null!==c&&(null===f.H||f.H===c)){f.H=c;let g;(null==(g=f.model())?0:g.e)&&f.db.Z(f,!0)}e&&f.persist();this.state===a.F.Gl&&Cg(f,!0);d&&this.Qc(f,d);this.D(a.j.aq,b)}update(b,c){c&&(b=this.N(b,!0),this.Qc(b,c))}sa(b){const c=this.get(b);void 0!==c&&(this.Z(c,!1),this.D(a.j.bq,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case xg:Dg(c,d);break;case yg:Eg(c,d);break;default:c.link(b,d)}}unlink(b,c,d){c=this.get(c);d=this.get(d);if(void 0!==c&&void 0!==
646
- d)switch(b){case xg:Fg(c,d);break;case yg:Gg(c,d);break;default:c.unlink(b,d)}}sg(b,c){for(const d of b)this.N(d).ne(c)}mi(b,c){for(const d of b)(b=this.get(d))&&b.detach(c)}Kj(...b){for(const c of b)null!=(b=this.get(c))&&(b.e=!1)}bt(b){b.forEach(c=>{this.N(c).persist()})}Md(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.D(a.j.np,b))}N(b,c=!1){let d;return null!=(d=this.get(b))?d:this.Rc(b,c)}Rc(b,c){const d=new olympe.dc.db.Instance(b,this);this.set(b,d);this.D(a.j.mp,b);c&&
647
- this.state!==a.F.Gl&&this.D(a.j.dn,b);return d}yb(b){var c=olympe.U.ni();this.H?Hg(this.H,c,b):b()}R(b){let c;null!=(c=this.H)&&c.j.delete(b)}Ha(b,...c){this.ia.has(b)&&this.ia.get(b).forEach(d=>{d(...c)})}D(b,c,...d){this.Ha(b,c,...d)}Z(b,c){let d;null!=(d=this.H)&&d.H.set(b,c)}Pe(b,c,d,e){let f;null!=(f=this.H)&&Ig(f,b).ja(e?Jg+c:c,d)}ef(b,c,d,e,f){let g;null!=(g=this.H)&&(d===Kg?f?Ig(g,b).link(c,e):Ig(g,b).unlink(c,e):f?Ig(g,b).yb(c,e):Ig(g,b).Gc(c,e))}Wa(b,c,d){let e;null!=(e=this.H)&&Ig(e,b).Md(c,
648
- d)}addEventListener(b,c){let d=this.ia.get(b);void 0===d&&(d=[],this.ia.set(b,d));d.push(c)}j(b,c){this.addEventListener(b,c)}nb(b){this.Yb.push(b)}F(b){for(const c of this.X.values())if(c.R.has(b))return!0;return!1}tg(b=!1){const c=Bg++;this.state=a.F.Al;this.da.add(c);b||this.X.set(c,new olympe.dc.db.ou(c,this,this.vd));return c}ht(b,c){if(!this.da.has(b))throw Error('Database: cannot use a transaction that has not been started');let d;this.H=null!=(d=this.X.get(b))?d:null;b=this.state;this.state=
649
- null===this.H?a.F.Gl:a.F.Xv;c();this.state=b;this.H=null}ke(b){this.state=a.F.tf;const c=this.X.get(b);c&&(this.H=c,Lg(this.H),Mg(this.H),this.X.delete(b),this.H=null);this.da.delete(b);0===this.da.size&&(this.state=a.F.IDLE,this.Yb.forEach(d=>{d()}),Ng(this.Fd))}Qc(b,c){const d=a.D.Xe;for(const [e,f]of c)void 0!==f&&(e[0]===d?Og(b,e.substring(1),f):b.update(e,f))}Gc(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(zg+xg)))for(const f of c.values())null!==f.source()&&this.Gc(b,
650
- f,d);return d}$s(){const b=a.j.em,c=a.j.Ik,d=new Set,e=new Map;this.j(a.j.aq,f=>{d.add(f)});this.j(b,f=>{d.delete(f);e.delete(f)});this.j(c,(f,...g)=>{if(g[0]===yg&&g[1]===Ag){const h=g[2];this.get(h).Ja()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.nb(()=>{d.forEach(f=>{const g=this.get(f);g&&null===g.model()&&this.G.error(`\n[DEBUG - DATABASE]\nInstance ${f} created but does not exist !\n${g.toString()}`)});d.clear();e.forEach((f,g)=>{const h=this.get(g);h&&this.G.error(`\n[DEBUG - DATABASE]\nThe model ${g} is extended by other models but does not exist !`+
651
- `\nExtension models: ${Array.from(f.values()).join(', ')}`+`\n\n ${h.toString()}`)});e.clear()})}};olympe.dc.db.Database.D={ej:'$',Hu:'~',Xe:'?',Bl:'=',Xp:'|',Hi:'@',ORIGIN:olympe.dc.ua.ORIGIN,DESTINATION:olympe.dc.ua.DESTINATION};olympe.dc.db.Database.j={mp:0,np:1,hs:2,dn:3,Ko:4,Lo:5,em:6,Dc:7,Ik:8,Tm:9,aq:10,bq:11,qr:12,KA:13,JA:14,Mw:15,Bp:16};olympe.dc.db.Database.F={IDLE:0,Al:1,Xv:2,Gl:3,tf:4};function Pg(a,b,c=[]){const d=b.T();mg(a.j,b,c);return e=>{if(null!==e)a.j.push(d,e);else{e=a.j;var f=e.F.get(d);if(void 0!==f){const g=e.D.indexOf(d);e.D.splice(g,1);f=qg(e,f.j,e.D.length);e.write(og(e,f,Date.now()),!1);e.F.delete(d)}}}}function Qg(a,b,c={}){let d,e;return sg(a.j,b,null!=(d=c.persist)?d:!0,null!=(e=c.pn)?e:!1)}function Rg(a,b){a.D.nb(b)}
652
- olympe.dc.db.ku=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.view=c;this.j=new olympe.dc.db.au(a,b,c,d);this.yz=new olympe.dc.db.Gv(a,c,b,e)}Xa(){return this.G}md(a,b={}){let c,d;this.j.md(a,null!=(c=b.persist)?c:!0,null!=(d=b.pn)?d:!1)}ne(a,b){this.D.sg(a,b)}detach(a,b){this.D.mi(a,b);return this}Kj(...a){this.D.Kj(...a.map(olympe.dc.ea))}};const Sg=olympe.dc.db.Database.D.ORIGIN,Tg=olympe.dc.db.Database.D.DESTINATION,Ug=olympe.dc.db.Database.D.ej,Vg=olympe.dc.db.Database.D.Xe,Wg=olympe.dc.db.Database.D.Bl,Xg=olympe.dc.db.Database.D.Xp,Yg=Sg+Tg,Zg=Ug+Ug,$g=olympe.dc.db.Database.F;let ah=0;function Lf(a,b,c,d=!1){const e=S(a,b);if(null!==e){const f=bh(e,'',c);void 0!==f&&(a.j.getState()!==$g.tf||e.F()&&!d||a.j.R(c),d||!e.Ja()&&!e.F()||f(!1,b))}}
653
- function Nf(a,b,c,d){a=a.j.N(ch(b));d=null!=d?d:dh();eh(a,'',d,c)&&a.Ja()&&c(!0,b);return d}function kg(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(olympe.dc.ea(e));for(const h of g)yield h,d.il(h,f).forEach(([k,,,l])=>{l&&g.add(k)})}.bind(null,a,b,c)}}function dh(){++ah;return String(ah)}function ch(a){if(a)return olympe.dc.ea(a);throw Error('DBView: Impossible to transform tag to string, provided tag is empty, null or undefined.');}
654
- function fh(a,b,c,d,e){a=a.j.N(ch(b));c=ch(c);b=Ug+c;e=null!=e?e:dh();if(eh(a,b,e,d)&&a.Ja()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(Wg+c));void 0!==b&&d(b,f)}return e}function S(a,b,c=!1){if(b)return a=a.j.get(olympe.dc.ea(b)),!a||c&&!a.Ja()?null:a;throw Error('DBView: Impossible to get instance, provided tag is empty, null or undefined.');}function gh(a,b,c,d){b=S(a,b);null!==b&&(c=olympe.dc.ea(c),bh(b,Ug+c,d),a.j.getState()===$g.tf&&a.j.R(d))}
655
- function hh(a,b,c,d){a=a.j.N(ch(b));d=null!=d?d:dh();eh(a,Zg,d,c)&&a.Ja()&&a.forEach((e,f)=>{const g=f[0];g!==Ug&&g!==Wg||c(f.substring(1),e,g===Wg)});return d}function ih(a,b,c){b=S(a,b);null!==b&&(bh(b,Zg,c),a.j.getState()===$g.tf&&a.j.R(c))}function jh(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ja()||!c&&g.F())e?d(b.substring(1),b[0],c,h):d(c,h)})}function T(a,b,c,d,e){a=a.j.N(ch(b));c=c.La()+c.W();e=null!=e?e:dh();(d=kh(a,c,e,d))&&a.Ja()&&jh(a,c,!0,d,!1);return e}
656
- function lh(a,b,c,d){const e=a.j.N(ch(b));a=null!=d?d:dh();const f=kh(e,Yg,a,c);f&&e.Ja()&&e.forEach((g,h)=>{g=h[0];g!==Sg&&g!==Tg||jh(e,h,!0,f,!0)})}function mh(a,b,c){const d=S(a,b);if(null!==d){const e=bh(d,Yg,c);void 0!==e&&(a.j.getState()!==$g.tf||d.F()||a.j.R(c),!d.Ja()&&!d.F()||d.forEach((f,g)=>{f=g[0];(f===Sg||f===Tg)&&e&&jh(d,g,!1,e,!0)}))}}
657
- function nh(a,b,c){b=S(a,b,!1);if(!b||c===olympe.dc.Lb.NONE)return[];const d=c.charAt(0)===olympe.dc.he.gg,e=[];b.forEach((f,g)=>{const h=g.charAt(0);if(!d&&f instanceof olympe.dc.vc&&(h===Ug||h===Vg))(f=a.j.get(f.W()))&&e.push([f,g.substring(1),null,!0]);else if(h===Sg||h===Tg){const k=g.substring(1),l=(h===Sg?12:3)&oh(a,k,c);l&&f.forEach(n=>{e.push([n,k,h,!!(l&10)])})}});if(d&&void 0!==b.D){const [f,g]=void 0!==b.D?[b.D.tag,b.D.Da]:null;b=a.j.get(f);e.push([b,g,null,!0])}return e}
658
- function ph(a,b,c,d,e){const f=a.j.N(ch(b));e=null!=e?e:dh();const g=kh(f,Xg+c,e,d);g&&f.Ja()&&nh(a,b,c).forEach(([h,...k])=>{h.Ja()&&g(...k,!0,h.tag())})}function qh(a,b,c,d){const e=S(a,b);if(null!==e){const f=bh(e,Xg+c,d);void 0!==f&&(a.j.getState()!==$g.tf||e.F()||a.j.R(d),!e.Ja()&&!e.F()||nh(a,b,c).forEach(([g,...h])=>{(g.Ja()||g.F())&&f(...h,!1,g.tag())}))}}function rh(a,b){a=S(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===Vg&&b.set(c.substring(1),d);return b}
659
- function oh(a,b,c){if(c===olympe.dc.Lb.NONE)return 0;const d=c[0]===olympe.dc.he.gg;c=d?c.substring(1):c;a=a.Pa(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function sh(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===Sg||c===Tg){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(S(a,b,!0))}
660
- function th(a,b,c){if(!a.Ja(b))return a.G.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ea(b)];for(const f of e){const g=a.cb(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.G.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.ea(b)}`);return d}function uh(a,b,c,d){return(c=(a=S(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ja()).length:0}
661
- olympe.dc.kb=class{constructor(a,b){this.G=a;this.j=b}T(){return this.j.T()}D(a,b,c,d=!1){a=S(this,a);if(null!==a){b=b.La()+b.W();const e=bh(a,b,c);void 0!==e&&(this.j.getState()!==$g.tf||a.F()&&!d||this.j.R(c),d||!a.Ja()&&!a.F()||jh(a,b,!1,e,!1))}}Ja(a){a=this.j.get(olympe.dc.ea(a));return!(null==a||!a.Ja())}name(a){let b,c;return null!=(c=null==(b=S(this,a))?void 0:b.Pa(olympe.dc.CloudObject.nameProp.W()))?c:''}model(a){return(a=(a=S(this,a,!0))?a.model():null)?a.tag():null}ff(a){return(a=(a=S(this,
662
- a,!0))&&a.ff())?a.tag():null}vi(a){a=S(this,a,!0);return!(!a||!a.ff())}Nb(a,b){a=(a=S(this,a,!0))&&a.model();return!(!a||!this.Tf(a.tag(),b))}source(a){return(a=S(this,a,!0))&&a.source()}Re(a){a=S(this,a,!1);return!a||a.N}Pa(a,b,c){a=S(this,a,!0);b=olympe.dc.ea(b);let d;return null!=(d=null==a?void 0:a.Pa(b,c))?d:null}zb(a,b=!1){var c=S(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===Ug||!b&&c===Wg)&&a.set(d.substring(1),e);return a}il(a,b){return nh(this,a,b).filter(([c])=>c.Ja()).map(([c,
663
- ...d])=>[c.tag(),...d])}cb(a,b){a=S(this,a,!0);b=b.La()+b.W();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ja()&&a.push(c.tag());return a}gt(a,b,c){let d,e;a=null==(d=S(this,a,!0))?void 0:null==(e=d.get(b.La()+b.W()))?void 0:e.get(olympe.dc.ea(c));return!(null==a||!a.Ja())}In(a,b){a=S(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=S(this,d,!0).get(c.La()+c.W()),void 0!==a)for(const e of a.values())e.Ja()&&b.push(e.tag());a=b}return a}Ib(a,b){var c=
664
- S(this,a,!0);const d=b.La()+b.W();c=null==c?void 0:c.get(d);if(1<(null==c?void 0:c.size))return this.G.warn(`Relation ${b.W()} to instance ${a} is not unique: found ${c.size} related items`),null;a=null==c?void 0:c.values().next().value;return(null==a?0:a.Ja())?a.tag():null}nh(a,b,c){a=olympe.dc.ea(a);const d=th(this,a,b);d.delete(a);return c?(c=olympe.dc.ea(c),d.has(c)?Array.from(th(this,c,b.$b()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Js(a,b,c){if(!this.Ja(a))return null;b=th(this,
665
- a,b);const d=[olympe.dc.ea(a)];for(const e of d){if(c(e))return e;if(a=b.get(e))for(const f of a.filter(g=>!d.includes(g)))d.push(f)}return null}An(a,b,c){return this.In(a,b).find(c)||null}Ux(a,b,c){return this.In(a,b).filter(c)}Ps(a,b=olympe.dc.CloudObject){var c=S(this,a,!0);const d=b&&S(this,b,!0),e=[c];for(;c&&c!==d;){c=c.ff();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ja())throw a=`Try to get all extensions of the model ${olympe.dc.ea(a)} but one of them does not exists (${c.tag()})`,
666
- Error(a);null!==c&&e.push(c)}c=S(this,olympe.dc.CloudObject,!0);if(d!==c&&e[e.length-1]===c)throw Error(`The model "${this.name(a)}" (tag = ${a}) does not extend the expected model "${this.name(b)}" (tag = ${b}).`);return e.map(f=>f.tag())}Tf(a,b){const c=olympe.dc.ea(b);return!!this.Js(a,olympe.dc.CloudObject.extendRel,d=>d===c)}Uc(a){return this.cb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.kb.prototype.getInstances=olympe.dc.kb.prototype.Uc;olympe.dc.kb.prototype.isExtending=olympe.dc.kb.prototype.Tf;
667
- olympe.dc.kb.prototype.getExtendedModels=olympe.dc.kb.prototype.Ps;olympe.dc.kb.prototype.findAllRelated=olympe.dc.kb.prototype.Ux;olympe.dc.kb.prototype.findRelated=olympe.dc.kb.prototype.An;olympe.dc.kb.prototype.findRecursive=olympe.dc.kb.prototype.Js;olympe.dc.kb.prototype.getRecursiveRelated=olympe.dc.kb.prototype.nh;olympe.dc.kb.prototype.getUniqueRelated=olympe.dc.kb.prototype.Ib;olympe.dc.kb.prototype.getMultiRelated=olympe.dc.kb.prototype.In;olympe.dc.kb.prototype.isRelated=olympe.dc.kb.prototype.gt;
621
+ 0,f.byteLength));if(d)return d=this.db.model(b),c=new olympe.dc.Request(olympe.dc.Request.j.eg,olympe.dc.ee().pe(b),{tag:c,model:d,url:e.valueOf()}),this.Jb.request(c);c=N(e);Hc(c,olympe.net.ua.ResponseType.Kl);return Ic(this.ba,c).then(f=>{const g=f.Kc();if(200<=g&&300>g)return f.getData();throw Error(`Failed to download file ${b}. Response code ${g}`);})}wa(b,c,d){c=new olympe.dc.Request(olympe.dc.Request.j.cg,d,{tag:b,model:c});return this.Jb.request(c).then(()=>this.G.debug(`Successfully deleted file: ${b}`)).catch(e=>
622
+ {throw Error(`Failed to delete file ${b}: ${e.message}`);})}Ha(b){const c=new olympe.U.stream.mg;this.H(b).then(d=>{cb(d).pipeTo(c).catch(()=>{})});return c}vb(b,c){this.D.H(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.ec;e.Yc(b,(new Map).set(olympe.dm.File.urlProp.W(),d));this.Z.nd(Of(e));let f;null==(f=this.j.get(b))||f.forEach(g=>g(null))}).catch(d=>{let e;null==(e=this.j.get(b))||e.forEach(f=>f(d))}).finally(()=>{this.j.delete(b)})}X(b){return new Promise((c,d)=>{let e;
623
+ const f=null!=(e=this.j.get(b))?e:[];f.push(g=>g?d(g):c());this.j.set(b,f)})}lb(b,c,d,e,f,g){const h=e?k=>{this.R(b,new Blob([c],{type:d}));f(k)}:f;e=this.db.model(b);e=new olympe.dc.Request(olympe.dc.Request.j.og,olympe.dc.ee().pe(b),{tag:b,model:e,content:c,mimeType:d});this.Jb.request(e).then(k=>h(null!=k?k:'')).catch(null!=g?g:this.G.error.bind(this.G))}Ua(b){return u(function*(){var c=b instanceof olympe.C.Sa?b.valueOf():b;return'string'===typeof c?$a(c):c instanceof ArrayBuffer?new Uint8Array(c,
624
+ 0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}R(b,c){const d=olympe.dc.ea(b);b=URL.createObjectURL(c);this.F.set(d,b);const e=a.j(d);Pf(this.db,d,f=>{f||(this.F.delete(d),Nf(this.db,d,e))},e)}static j(b){return`cacheBinary${b}`}};function Qf(a,b){let c=Rf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.ff(b);if(null===b)break;c=Rf(b)}let e;return null!=(e=c)?e:null}olympe.dc.Mu=class{constructor(a,b,c){this.G=a;this.j=b;this.db=b.view;this.D=c;this.Ra=new FinalizationRegistry(d=>{this.G.F()&&this.G.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.j.detach([d],olympe.dc.db.Instance.j.aq)})}};function Sf(a,b){a.origin=b;return a}function Tf(a,b,c){a.D.set(b,c);return a}function Uf(a){let b;return null!=(b=a.D)?b:new Map}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Ia.SELF;this.j=b;this.content=null!=c?c:null;this.user=null!=d?d:ee(olympe.auth.re()).ue();this.D=new Map}getType(){return this.type}xc(){return this.user}ic(){return this.j}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.j}; content: ${this.content}`}};
625
+ olympe.dc.Request.j={oc:1,Jg:10,vu:24,Lp:25,wu:28,Sg:30,Gk:31,NC:32,df:40,dh:41,xo:42,wr:43,cE:44,Fi:45,zo:46,jk:47,og:50,eg:51,cg:52,Sw:60,gw:61,Gp:62,PB:63,Xt:64,yh:65,ck:91,xu:93,Fm:95,QUERY_RESULT:97};function Vf(a,b,c,d,e){const f=olympe.C.kh();a.sources.set(olympe.dc.Ia.SERVER,e.init(a));a.F?a.sources.set(olympe.dc.Ia.Ze,d.init(a)):Pf(b,a.j,()=>{a.sources.set(olympe.dc.Ia.Ze,d.init(a));const g=new Map;olympe.dc.la.from(a.j,a.j).bb(olympe.dm.DataSource.Mj).filter(olympe.dc.query.za.Ea(olympe.dm.DataSource.gi,!0)).observe(f).subscribe(h=>{var k=h.Ej();for(var l of k){const [p,q]=g.get(l);c.D(p);c.F(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=h.yj();for(const p of h)if(h=
626
+ p.W(),!a.sources.has(h)){const q=new olympe.dc.sources.vq(a.G,p);a.sources.set(h,q);l=c.j(()=>q.healthCheck(),h,olympe.host.Ke.j.READINESS);n=c.H(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});Nf(b,a.j,'router',!0)},'router')}function Wf(a,b,c){let d=a.D.get(b);void 0===d&&(d=[],a.D.set(b,d));d.push(c)}
627
+ olympe.dc.lw=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=f;this.F=g;this.sources=new Map;this.D=new Map;Vf(this,d,e,b,c)}request(a){this.G.debug('Router: sends',a);return this.jb(a.ic()).request(a)}subscribe(a,b){this.G.debug('Router: subscribes',a);return this.jb(a.ic()).subscribe(a,b)}cd(a){if(a.ic()!==this.j)this.G.error(`Router: try to reply to a request that is not for this data cloud, ignore it: ${a}`);else{var b;null==(b=this.D.get(a.getType()))||b.forEach(c=>c(a))}}xi(a){let b;null==
628
+ (b=this.D.get(a.getType()))||b.forEach(c=>c(a));return this.jb(olympe.dc.Ia.Ze).xi(a)}jb(a){let b;return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Ia.Ze)}};function Of(a,b){b=new olympe.dc.Hg(a.T(),null!=b?b:null);b.j=a;return b}function Xf(a,b,c,d){c=new olympe.dc.Hg(null!=d?d:olympe.U.Lc(),null!=c?c:null);c.D=b;c.Ga=a;return c}
629
+ olympe.dc.Hg=class{constructor(a,b){this.id=a;this.Ga=this.j=this.D=null;this.dl=b}static j(a){return Xf(a.p,a.s,a.t,a.i)}T(){return this.id}qc(a){return this.j instanceof olympe.dc.db.ec?this.j.qc(a):Array.isArray(this.Ga)?(new olympe.dc.transaction.dj(this.D)).D(this.Ga,a):a}H(){let a,b,c,d;return null!=(d=null!=(c=null==(a=this.Ga)?void 0:a.length)?c:null==(b=this.j)?void 0:b.H())?d:0}ac(){return this.j instanceof olympe.dc.db.ec?this.j:Array.isArray(this.Ga)?(this.j=(new olympe.dc.transaction.dj(this.D)).j(this.Ga,
630
+ this.id),this.Ga=null,this.j):new olympe.dc.db.ec(this.id)}jl(){if(Array.isArray(this.Ga))return this.Ga;if(this.j instanceof olympe.dc.db.ec){const a=new olympe.dc.transaction.Ie;this.j.qc(a);return Yf(a)}return[]}fa(){return{p:this.jl(),t:this.dl,s:this.D,i:this.id}}};olympe.dc.Hg.ya=[olympe.dc.ir];olympe.dc.Ra={};const Zf=olympe.dc.ta.ORIGIN,$f=olympe.dc.ta.DESTINATION,ag=new Map,bg=new Map,cg=new Map,dg=new Map;function Rf(a){let b;return null!=(b=ag.get(a))?b:null}function eg(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.co||[])];return olympe.dc.na.j(b,c,...a)}function fg(a,b){dg.set(a,b);return a}function gg(a){let b,c;return null!=(c=null==(b=ag.get(a))?void 0:b.D)?c:olympe.dc.CloudObject}
631
+ function hg(a,b,c){const d=a+'@'+(b===$f?Zf:$f);if(bg.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);bg.set(d,c)}function ig(a){a=a.W()+'@'+a.La();return bg.get(a)||olympe.dc.CloudObject}function P(a,b){b.NAME=a;cg.set(a,b)}function Q(a){let b;return null!=(b=a.NAME)?b:null}
632
+ olympe.dc.na=class{constructor(){}static j(a,b,...c){if(ag.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${ag.get(a).D.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.V.qb(g):g}}b=new olympe.dc.Ra.Entry(a,b,d);ag.set(a,b);return b.D.entry=b}static Wb(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.W())?c:null}};function jg(a,b){a.j=b}function R(a,b){b=b.$b();hg(b.W(),b.La(),a.D);return b}function kg(a){a.F=!0;return a}
633
+ olympe.dc.Ra.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.co=c||null;this.j=null;this.F=!1}W(){return this.tag}instantiate(a,b){const c=this.D;if(this.Qn()&&b.getParameter(olympe.dc.Config.qp)){var d=olympe.dc.ha();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.W()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ga.Wa('dc').error(d)}return this.co?(a=[void 0,a].concat(Oa(b,this.co)),new c(...a)):
634
+ new c(void 0,a)}ja(a){return new olympe.dc.Ra.Property(a)}ra(a,b=olympe.dc.ta.DESTINATION){hg(a,b,this.D);return new olympe.dc.aa.$e(a,b)}Qn(){return this.F}};w('olympe.dc.registry.Entry',olympe.dc.Ra.Entry);olympe.dc.Ra.Entry.prototype.addRelation=olympe.dc.Ra.Entry.prototype.ra;olympe.dc.Ra.Entry.prototype.addProperty=olympe.dc.Ra.Entry.prototype.ja;olympe.dc.Ra.Entry.ya=[olympe.dc.Ye];olympe.dc.Ra.Property=class{constructor(a){this.tag=a}W(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Ra.Property.prototype.getTag=olympe.dc.Ra.Property.prototype.W;olympe.dc.Ra.Property.ya=[olympe.dc.Ye];olympe.dc.Ra.Relation=class{constructor(a,b=olympe.dc.ta.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.ea(a);this.direction=b;this.origin=c;this.H=d}W(){return this.tag}La(){return this.direction}type(){return this.H}$b(){return new olympe.dc.Ra.Relation(this.tag,this.direction===olympe.dc.ta.DESTINATION?olympe.dc.ta.ORIGIN:olympe.dc.ta.DESTINATION,this.H,this.origin)}Ea(a){return a instanceof olympe.dc.Ra.Relation?a.W()===this.W()&&a.La()===this.La():!1}toString(){return`${this.direction}${olympe.dc.ha().name(this.tag)} (${this.tag})`}};
635
+ olympe.dc.Ra.Relation.prototype.getInverse=olympe.dc.Ra.Relation.prototype.$b;olympe.dc.Ra.Relation.prototype.getDirection=olympe.dc.Ra.Relation.prototype.La;olympe.dc.Ra.Relation.prototype.getTag=olympe.dc.Ra.Relation.prototype.W;olympe.dc.Ra.Relation.ya=[olympe.dc.Ye];olympe.dc.db={};function lg(a,b){const c=a.H,d=olympe.dc.ha(),e=olympe.dc.db.Database.D.ej,f=olympe.dc.db.Database.D.Xe,g=olympe.dc.db.Database.D.ORIGIN,h=olympe.dc.db.Database.D.DESTINATION,k=new olympe.dc.db.ec('rev-'+b.T());a.G.debug('Generate the reverse graphLayer of',b.T());b.Bb.forEach((l,n)=>{if(l.D()){k.D(n,olympe.dc.Lb.NONE);for(const [r,t]of l.Id())k.hc(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.yd())for(const r of mg(d,n,l.F())){l=c.get(r);const t=new Map;l.forEach((v,x)=>{const y=x[0],z=x.substring(1);
636
+ y===e?t.set(z,v):y===f?t.set(x,v):y===g?v.forEach((A,K)=>{k.Oa(z,K,r)}):y===h&&v.forEach((A,K)=>{k.Oa(z,r,K)})});l=l.source();k.Sc(r,l,t)}else{const r=new Map;for(const t of l.zb().keys()){var q=t[0]===f;const v=q?t.substring(1):t;q=q?ng(p,v,!0):p.Pa(v,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Yc(n,r);for(const [t,v,x]of l.Id())x?k.hc(t,n,v):k.Oa(t,n,v)}}});return k}
637
+ function og(a,b,c){const d=b.T();if(a.F.has(d))throw Error(`You try to execute the patch ${d} a second times whereas the first execution has not been validated yet.`);const e=new pg(b,lg(a,b));a.D.unshift(d);a.F.set(d,e);a.H.bt(c);a.write(b,!1,!1)}
638
+ function qg(a,b,c){if(0>=a.N||null===c)return b;var d=a.j.findIndex(h=>h.T()===b.T()),e=a.j[d];-1<d&&a.j.splice(d,1);d=0<a.j.length?a.j.findIndex(h=>c>=h.D):0;d=-1<d?d:a.j.length;const f=a.j.slice(0,d).reduce((h,k)=>k.nd(h),b);let g;e=null!=(g=null==e?void 0:e.update(f,c))?g:new rg(f,c,a.j,a.N);a.j.splice(d,0,e);a.G.F()&&a.G.debug('CommitController buffer:\n',a.j.map(h=>`${h.T()} at ${h.D}`).join('\n'));return f}
639
+ function sg(a,b,c){return a.D.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>{let f;return null!=(f=null==e?void 0:e.nd(d))?f:d},b)}function tg(a,b,c,d=!1){return u(function*(){const e=new olympe.dc.db.hn(a.G,a.H,a.ha,c);e.open(d);for(const f=ha(b);;){const g=yield f.next();if(g.done)break;e.write(g.value,a.R)}e.close()})}
640
+ function ug(a,b,c,d){b=b.pipeThrough(olympe.U.stream.tap(e=>{0<a.D.length&&qg(a,sg(a,e.ac(),a.D.length),e.dl)}));return tg(a,b,c,d).then(()=>a.G.debug('Rebase stream completed')).catch(e=>a.G.error('Rebase stream failed:',e))}
641
+ olympe.dc.db.bu=class{constructor(a,b,c,d){this.G=a;this.H=b;this.ha=c;let e;this.R=null!=(e=d.get('debug'))?e:!1;let f;this.N=null!=(f=d.get('bufferTimeout'))?f:0;this.D=[];this.F=new Map;this.j=[];b.addEventListener(olympe.dc.db.Database.j.Cp,g=>{this.j.forEach(h=>{for(const k of g)h.j.j(k)})})}nd(a,b,c){const d=a.T(),e=a.dl;this.F.has(d)?this.push(d,e):(a=qg(this,sg(this,a.ac(),this.D.length),e),this.write(a,b,c))}push(a,b){const c=this.D.indexOf(a);if(-1<c){const d=this.F.get(a);this.D.splice(c,
642
+ 1);qg(this,sg(this,d.D,c),b);this.F.delete(a)}}write(a,b,c=!1){b=new olympe.dc.db.hn(this.G,this.H,this.ha,b);b.open(c);b.write(a,this.R);b.close()}};class vg{T(){}nd(){}}function wg(a,b,c,d){const e=olympe.dc.ta.DESTINATION;c=c.tag();const f=a.j.Uc(c);b.zb().forEach((g,h)=>{f.ja(h,g);b.Z(h)});for(const [g,h,k,l]of b.ba()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.j.Oa(g,n,p);d.N(g,n,p)}}
643
+ function xg(a,b,c,d){const e=olympe.dc.ta.DESTINATION,f=c.tag(),g=a.j.Uc(f);b.zb().forEach((h,k)=>{void 0!==c.Pa(k)&&(g.ja(k,h),b.Z(k))});for(const [h,k,l]of b.Id()){const n=c.lb(h,e,k);void 0!==n&&(d.N(h,f,k),n===l&&a.j.N(h,f,k))}}
644
+ class pg extends vg{constructor(a,b){super();this.D=a;this.j=b;this.db=olympe.dc.ha()}T(){return this.D.T()}nd(a){for(const [b,c]of this.D.ba(a)){const d=b.tag();c.yd()?b.D()?a.j(d,b.F()):(this.D.j(d,c.F()),this.j.j(d,c.F())):b.yd()?(wg(this,c,b,a),a.j(d,b.F())):xg(this,c,b,a)}return a}}function yg(a){clearTimeout(a.F);a.F=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.H)}
645
+ class rg extends vg{constructor(a,b,c,d){super();this.j=a;this.D=b;this.buffer=c;this.H=d;this.F=null;yg(this)}T(){return this.j.T()}nd(a){return a.R(this.j)}update(a,b){this.D=b;a.qc(this.j);yg(this);return this}};const zg=olympe.dc.fc.Zc,Ag=olympe.dc.fc.Li,Bg=olympe.dc.ta.ORIGIN,Cg=olympe.dc.ta.DESTINATION;let Dg=0;
646
+ olympe.dc.db.Database=class a extends Map{constructor(b,c,d){super();let e;this.id=null!=(e=d.get('selfTag'))?e:olympe.dc.Ia.SELF;this.G=b;this.hd=olympe.C.Za();this.state=olympe.dc.db.Database.F.IDLE;this.ia=new Map;this.Ub=[];this.X=new Map;this.H=null;this.ba=new Set;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.Af.j.em;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Fd=new olympe.dc.db.Af(c,this,b,f);d.get('debug')&&this.ol()}T(){return this.id}getState(){return this.state}Wa(){return this.G}create(b,
647
+ c,d,e=!1){var f=this.N(b,!0);if(!f.e&&null!==c&&(null===f.H||f.H===c)){f.H=c;let g;(null==(g=f.model())?0:g.e)&&f.db.Z(f,!0)}e&&f.persist();this.state===a.F.Jl&&Eg(f,!0);d&&this.Hc(f,d);this.D(a.j.bq,b)}update(b,c){c&&(b=this.N(b,!0),this.Hc(b,c))}wa(b){const c=this.get(b);void 0!==c&&(this.Z(c,!1),this.D(a.j.cq,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case zg:Fg(c,d);break;case Ag:Gg(c,d);break;default:c.link(b,d)}}unlink(b,c,d){c=this.get(c);d=this.get(d);if(void 0!==c&&void 0!==
648
+ d)switch(b){case zg:Hg(c,d);break;case Ag:Ig(c,d);break;default:c.unlink(b,d)}}Pf(b,c){for(const d of b)this.N(d).ne(c)}mi(b,c){for(const d of b)(b=this.get(d))&&b.detach(c)}Kj(...b){for(const c of b)null!=(b=this.get(c))&&(b.e=!1)}bt(b){b.forEach(c=>{this.N(c).persist()})}Md(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.D(a.j.op,b))}N(b,c=!1){let d;return null!=(d=this.get(b))?d:this.Sc(b,c)}Sc(b,c){const d=new olympe.dc.db.Instance(b,this);this.set(b,d);this.D(a.j.np,b);c&&
649
+ this.state!==a.F.Jl&&this.D(a.j.gn,b);return d}vb(b){var c=olympe.U.ni();this.H?Jg(this.H,c,b):b()}R(b){let c;null!=(c=this.H)&&c.j.delete(b)}Ha(b,...c){this.ia.has(b)&&this.ia.get(b).forEach(d=>{d(...c)})}D(b,c,...d){this.Ha(b,c,...d)}Z(b,c){let d;null!=(d=this.H)&&d.H.set(b,c)}Qe(b,c,d,e){let f;null!=(f=this.H)&&Kg(f,b).ja(e?Lg+c:c,d)}ef(b,c,d,e,f){let g;null!=(g=this.H)&&(d===Mg?f?Kg(g,b).link(c,e):Kg(g,b).unlink(c,e):f?Kg(g,b).vb(c,e):Kg(g,b).Gc(c,e))}Ua(b,c,d){let e;null!=(e=this.H)&&Kg(e,b).Md(c,
650
+ d)}addEventListener(b,c){let d=this.ia.get(b);void 0===d&&(d=[],this.ia.set(b,d));d.push(c)}j(b,c){this.addEventListener(b,c)}lb(b){this.Ub.push(b)}F(b){for(const c of this.X.values())if(c.R.has(b))return!0;return!1}tg(b=!1){const c=Dg++;this.state=a.F.Dl;this.ba.add(c);b||this.X.set(c,new olympe.dc.db.pu(c,this,this.hd));return c}ht(b,c){if(!this.ba.has(b))throw Error('Database: cannot use a transaction that has not been started');let d;this.H=null!=(d=this.X.get(b))?d:null;b=this.state;this.state=
651
+ null===this.H?a.F.Jl:a.F.Yv;c();this.state=b;this.H=null}ke(b){this.state=a.F.uf;const c=this.X.get(b);c&&(this.H=c,Ng(this.H),Og(this.H),this.X.delete(b),this.H=null);this.ba.delete(b);0===this.ba.size&&(this.state=a.F.IDLE,this.Ub.forEach(d=>{d()}),Pg(this.Fd))}Hc(b,c){const d=a.D.Xe;for(const [e,f]of c)void 0!==f&&(e[0]===d?Qg(b,e.substring(1),f):b.update(e,f))}Gc(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(Bg+zg)))for(const f of c.values())null!==f.source()&&this.Gc(b,
652
+ f,d);return d}ol(){const b=a.j.hm,c=a.j.Ik,d=new Set,e=new Map;this.j(a.j.bq,f=>{d.add(f)});this.j(b,f=>{d.delete(f);e.delete(f)});this.j(c,(f,...g)=>{if(g[0]===Ag&&g[1]===Cg){const h=g[2];this.get(h).Ja()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.lb(()=>{d.forEach(f=>{const g=this.get(f);g&&null===g.model()&&this.G.error(`\n[DEBUG - DATABASE]\nInstance ${f} created but does not exist !\n${g.toString()}`)});d.clear();e.forEach((f,g)=>{const h=this.get(g);h&&this.G.error(`\n[DEBUG - DATABASE]\nThe model ${g} is extended by other models but does not exist !`+
653
+ `\nExtension models: ${Array.from(f.values()).join(', ')}`+`\n\n ${h.toString()}`)});e.clear()})}};olympe.dc.db.Database.D={ej:'$',Iu:'~',Xe:'?',El:'=',Yp:'|',Hi:'@',ORIGIN:olympe.dc.ta.ORIGIN,DESTINATION:olympe.dc.ta.DESTINATION};olympe.dc.db.Database.j={np:0,op:1,js:2,gn:3,Lo:4,Mo:5,hm:6,Dc:7,Ik:8,Wm:9,bq:10,cq:11,rr:12,LA:13,KA:14,Nw:15,Cp:16};olympe.dc.db.Database.F={IDLE:0,Dl:1,Yv:2,Jl:3,uf:4};function Rg(a,b,c=[]){const d=b.T();og(a.j,b,c);return e=>{if(null!==e)a.j.push(d,e);else{e=a.j;var f=e.F.get(d);if(void 0!==f){const g=e.D.indexOf(d);e.D.splice(g,1);f=sg(e,f.j,e.D.length);e.write(qg(e,f,Date.now()),!1);e.F.delete(d)}}}}function Sg(a,b,c={}){let d,e;return ug(a.j,b,null!=(d=c.persist)?d:!0,null!=(e=c.sn)?e:!1)}function Tg(a,b){a.D.lb(b)}
654
+ olympe.dc.db.lu=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.view=c;this.j=new olympe.dc.db.bu(a,b,c,d);this.zz=new olympe.dc.db.Hv(a,c,b,e)}Wa(){return this.G}nd(a,b={}){let c,d;this.j.nd(a,null!=(c=b.persist)?c:!0,null!=(d=b.sn)?d:!1)}ne(a,b){this.D.Pf(a,b)}detach(a,b){this.D.mi(a,b);return this}Kj(...a){this.D.Kj(...a.map(olympe.dc.ea))}};const Ug=olympe.dc.db.Database.D.ORIGIN,Vg=olympe.dc.db.Database.D.DESTINATION,Wg=olympe.dc.db.Database.D.ej,Xg=olympe.dc.db.Database.D.Xe,Yg=olympe.dc.db.Database.D.El,Zg=olympe.dc.db.Database.D.Yp,$g=Ug+Vg,ah=Wg+Wg,bh=olympe.dc.db.Database.F;let ch=0;function Nf(a,b,c,d=!1){const e=S(a,b);if(null!==e){const f=dh(e,'',c);void 0!==f&&(a.j.getState()!==bh.uf||e.F()&&!d||a.j.R(c),d||!e.Ja()&&!e.F()||f(!1,b))}}
655
+ function Pf(a,b,c,d){a=a.j.N(eh(b));d=null!=d?d:fh();gh(a,'',d,c)&&a.Ja()&&c(!0,b);return d}function mg(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(olympe.dc.ea(e));for(const h of g)yield h,d.il(h,f).forEach(([k,,,l])=>{l&&g.add(k)})}.bind(null,a,b,c)}}function fh(){++ch;return String(ch)}function eh(a){if(a)return olympe.dc.ea(a);throw Error('DBView: Impossible to transform tag to string, provided tag is empty, null or undefined.');}
656
+ function hh(a,b,c,d,e){a=a.j.N(eh(b));c=eh(c);b=Wg+c;e=null!=e?e:fh();if(gh(a,b,e,d)&&a.Ja()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(Yg+c));void 0!==b&&d(b,f)}return e}function S(a,b,c=!1){if(b)return a=a.j.get(olympe.dc.ea(b)),!a||c&&!a.Ja()?null:a;throw Error('DBView: Impossible to get instance, provided tag is empty, null or undefined.');}function ih(a,b,c,d){b=S(a,b);null!==b&&(c=olympe.dc.ea(c),dh(b,Wg+c,d),a.j.getState()===bh.uf&&a.j.R(d))}
657
+ function jh(a,b,c,d){a=a.j.N(eh(b));d=null!=d?d:fh();gh(a,ah,d,c)&&a.Ja()&&a.forEach((e,f)=>{const g=f[0];g!==Wg&&g!==Yg||c(f.substring(1),e,g===Yg)});return d}function kh(a,b,c){b=S(a,b);null!==b&&(dh(b,ah,c),a.j.getState()===bh.uf&&a.j.R(c))}function lh(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ja()||!c&&g.F())e?d(b.substring(1),b[0],c,h):d(c,h)})}function T(a,b,c,d,e){a=a.j.N(eh(b));c=c.La()+c.W();e=null!=e?e:fh();(d=mh(a,c,e,d))&&a.Ja()&&lh(a,c,!0,d,!1);return e}
658
+ function nh(a,b,c,d){const e=a.j.N(eh(b));a=null!=d?d:fh();const f=mh(e,$g,a,c);f&&e.Ja()&&e.forEach((g,h)=>{g=h[0];g!==Ug&&g!==Vg||lh(e,h,!0,f,!0)})}function oh(a,b,c){const d=S(a,b);if(null!==d){const e=dh(d,$g,c);void 0!==e&&(a.j.getState()!==bh.uf||d.F()||a.j.R(c),!d.Ja()&&!d.F()||d.forEach((f,g)=>{f=g[0];(f===Ug||f===Vg)&&e&&lh(d,g,!1,e,!0)}))}}
659
+ function ph(a,b,c){b=S(a,b,!1);if(!b||c===olympe.dc.Lb.NONE)return[];const d=c.charAt(0)===olympe.dc.he.hg,e=[];b.forEach((f,g)=>{const h=g.charAt(0);if(!d&&f instanceof olympe.dc.vc&&(h===Wg||h===Xg))(f=a.j.get(f.W()))&&e.push([f,g.substring(1),null,!0]);else if(h===Ug||h===Vg){const k=g.substring(1),l=(h===Ug?12:3)&qh(a,k,c);l&&f.forEach(n=>{e.push([n,k,h,!!(l&10)])})}});if(d&&void 0!==b.D){const [f,g]=void 0!==b.D?[b.D.tag,b.D.Ca]:null;b=a.j.get(f);e.push([b,g,null,!0])}return e}
660
+ function rh(a,b,c,d,e){const f=a.j.N(eh(b));e=null!=e?e:fh();const g=mh(f,Zg+c,e,d);g&&f.Ja()&&ph(a,b,c).forEach(([h,...k])=>{h.Ja()&&g(...k,!0,h.tag())})}function sh(a,b,c,d){const e=S(a,b);if(null!==e){const f=dh(e,Zg+c,d);void 0!==f&&(a.j.getState()!==bh.uf||e.F()||a.j.R(d),!e.Ja()&&!e.F()||ph(a,b,c).forEach(([g,...h])=>{(g.Ja()||g.F())&&f(...h,!1,g.tag())}))}}function th(a,b){a=S(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===Xg&&b.set(c.substring(1),d);return b}
661
+ function qh(a,b,c){if(c===olympe.dc.Lb.NONE)return 0;const d=c[0]===olympe.dc.he.hg;c=d?c.substring(1):c;a=a.Pa(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function uh(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===Ug||c===Vg){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(S(a,b,!0))}
662
+ function vh(a,b,c){if(!a.Ja(b))return a.G.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ea(b)];for(const f of e){const g=a.cb(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.G.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.ea(b)}`);return d}function wh(a,b,c,d){return(c=(a=S(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ja()).length:0}
663
+ olympe.dc.kb=class{constructor(a,b){this.G=a;this.j=b}T(){return this.j.T()}D(a,b,c,d=!1){a=S(this,a);if(null!==a){b=b.La()+b.W();const e=dh(a,b,c);void 0!==e&&(this.j.getState()!==bh.uf||a.F()&&!d||this.j.R(c),d||!a.Ja()&&!a.F()||lh(a,b,!1,e,!1))}}Ja(a){a=this.j.get(olympe.dc.ea(a));return!(null==a||!a.Ja())}name(a){let b,c;return null!=(c=null==(b=S(this,a))?void 0:b.Pa(olympe.dc.CloudObject.nameProp.W()))?c:''}model(a){return(a=(a=S(this,a,!0))?a.model():null)?a.tag():null}ff(a){return(a=(a=S(this,
664
+ a,!0))&&a.ff())?a.tag():null}vi(a){a=S(this,a,!0);return!(!a||!a.ff())}Nb(a,b){a=(a=S(this,a,!0))&&a.model();return!(!a||!this.Vf(a.tag(),b))}source(a){return(a=S(this,a,!0))&&a.source()}Re(a){a=S(this,a,!1);return!a||a.N}Pa(a,b,c){a=S(this,a,!0);b=olympe.dc.ea(b);let d;return null!=(d=null==a?void 0:a.Pa(b,c))?d:null}zb(a,b=!1){var c=S(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===Wg||!b&&c===Yg)&&a.set(d.substring(1),e);return a}il(a,b){return ph(this,a,b).filter(([c])=>c.Ja()).map(([c,
665
+ ...d])=>[c.tag(),...d])}cb(a,b){a=S(this,a,!0);b=b.La()+b.W();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ja()&&a.push(c.tag());return a}gt(a,b,c){let d,e;a=null==(d=S(this,a,!0))?void 0:null==(e=d.get(b.La()+b.W()))?void 0:e.get(olympe.dc.ea(c));return!(null==a||!a.Ja())}Ln(a,b){a=S(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=S(this,d,!0).get(c.La()+c.W()),void 0!==a)for(const e of a.values())e.Ja()&&b.push(e.tag());a=b}return a}Ib(a,b){var c=
666
+ S(this,a,!0);const d=b.La()+b.W();c=null==c?void 0:c.get(d);if(1<(null==c?void 0:c.size))return this.G.warn(`Relation ${b.W()} to instance ${a} is not unique: found ${c.size} related items`),null;a=null==c?void 0:c.values().next().value;return(null==a?0:a.Ja())?a.tag():null}nh(a,b,c){a=olympe.dc.ea(a);const d=vh(this,a,b);d.delete(a);return c?(c=olympe.dc.ea(c),d.has(c)?Array.from(vh(this,c,b.$b()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Ks(a,b,c){if(!this.Ja(a))return null;b=vh(this,
667
+ a,b);const d=[olympe.dc.ea(a)];for(const e of d){if(c(e))return e;if(a=b.get(e))for(const f of a.filter(g=>!d.includes(g)))d.push(f)}return null}Dn(a,b,c){return this.Ln(a,b).find(c)||null}Vx(a,b,c){return this.Ln(a,b).filter(c)}Qs(a,b=olympe.dc.CloudObject){var c=S(this,a,!0);const d=b&&S(this,b,!0),e=[c];for(;c&&c!==d;){c=c.ff();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ja())throw a=`Try to get all extensions of the model ${olympe.dc.ea(a)} but one of them does not exists (${c.tag()})`,
668
+ Error(a);null!==c&&e.push(c)}c=S(this,olympe.dc.CloudObject,!0);if(d!==c&&e[e.length-1]===c)throw Error(`The model "${this.name(a)}" (tag = ${a}) does not extend the expected model "${this.name(b)}" (tag = ${b}).`);return e.map(f=>f.tag())}Vf(a,b){const c=olympe.dc.ea(b);return!!this.Ks(a,olympe.dc.CloudObject.extendRel,d=>d===c)}Vc(a){return this.cb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.kb.prototype.getInstances=olympe.dc.kb.prototype.Vc;olympe.dc.kb.prototype.isExtending=olympe.dc.kb.prototype.Vf;
669
+ olympe.dc.kb.prototype.getExtendedModels=olympe.dc.kb.prototype.Qs;olympe.dc.kb.prototype.findAllRelated=olympe.dc.kb.prototype.Vx;olympe.dc.kb.prototype.findRelated=olympe.dc.kb.prototype.Dn;olympe.dc.kb.prototype.findRecursive=olympe.dc.kb.prototype.Ks;olympe.dc.kb.prototype.getRecursiveRelated=olympe.dc.kb.prototype.nh;olympe.dc.kb.prototype.getUniqueRelated=olympe.dc.kb.prototype.Ib;olympe.dc.kb.prototype.getMultiRelated=olympe.dc.kb.prototype.Ln;olympe.dc.kb.prototype.isRelated=olympe.dc.kb.prototype.gt;
668
670
  olympe.dc.kb.prototype.getRelated=olympe.dc.kb.prototype.cb;olympe.dc.kb.prototype.getProperties=olympe.dc.kb.prototype.zb;olympe.dc.kb.prototype.getProperty=olympe.dc.kb.prototype.Pa;olympe.dc.kb.prototype.isPersisted=olympe.dc.kb.prototype.Re;olympe.dc.kb.prototype.instanceOf=olympe.dc.kb.prototype.Nb;olympe.dc.kb.prototype.isModel=olympe.dc.kb.prototype.vi;olympe.dc.kb.prototype.extension=olympe.dc.kb.prototype.ff;olympe.dc.kb.prototype.model=olympe.dc.kb.prototype.model;
669
- olympe.dc.kb.prototype.name=olympe.dc.kb.prototype.name;olympe.dc.kb.prototype.exist=olympe.dc.kb.prototype.Ja;const vh=olympe.dc.db.Database.D.ORIGIN,Kg=olympe.dc.db.Database.D.DESTINATION,Jg=olympe.dc.db.Database.D.Bl,wh=olympe.dc.db.Database.D.ej,xh=olympe.dc.db.Database.D.Xp,yh=olympe.dc.db.Database.D.Hi,zh=vh+Kg,Ah=wh+wh,Bh=Array.from(Object.values(olympe.dc.Lb)).filter(a=>null!==a);function Hg(a,b,c){let d=a.j.get(b);void 0===d&&(d=[],a.j.set(b,d));a.buffer.push([b,d.length]);d.push(c)}
670
- function Lg(a){for(const [b,c]of a.H)a.D.Gc(new Set,b).filter(d=>Cg(d,c)).forEach(d=>{d=d.tag();c?Ig(a,d).create():Ig(a,d).delete()})}
671
- function Mg(a){const b=a.D;a.F.forEach((c,d)=>{var e=b.get(d);if(c.D()||c.yd()){var f=e.get(yh);f&&Ch(a,f,c.D(),d);c.yd()&&a.R.add(d)}for(const [n,p]of c.zb()){var g=n[0]===Jg,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(yh+wh+h);q&&Ch(f,q,l,g);(k=k.get(yh+Ah))&&Ch(f,k,h,l,g)}for(const n of c.da())Dh(a,e,...n);(e=c.X)&&Eh(a,e,d,c.Yb,!c.yd())});a.H.clear();a.F.clear();a.N.clear();Fh(a)}function Ig(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.Jh(b),a.F.set(b,c));return c}
672
- function Ch(a,b,...c){b.forEach((d,e)=>{Hg(a,e,d.bind(null,...c))})}function Dh(a,b,c,d,e,f){var g=b.get(yh+d+c);g&&Ch(a,g,f,e);(g=b.get(yh+zh))&&Ch(a,g,c,d,f,e);Gh(a,c,d).forEach((h,k)=>{(k=b.get(yh+xh+k))&&Ch(a,k,c,d,h,f,e)})}function Eh(a,b,c,d,e){Bh.forEach(f=>{const g=f[0]===olympe.dc.he.gg;(f=a.D.get(g?c:b).get(yh+xh+f))&&Ch(a,f,d,null,!0,e,g?b:c)})}
673
- function Fh(a){a.X.run(()=>{const b=a.j;for(const [c,d]of a.buffer){let e,f,g;null==(e=b.get(c))||null==(g=(f=e)[d])||g.call(f)}});a.j.clear();a.buffer.length=0}function Gh(a,b,c){const d=b+c;let e=a.N.get(d);if(!e){const f=a.D.get(b);e=new Map;Bh.forEach(g=>{const h=g[0]===olympe.dc.he.gg;var k=h?g.substring(1):g;let l;k=null!=(l=null==f?void 0:f.get(wh+k))?l:0;k=h?((k&3)<<2)+((k&12)>>2):k;(c===vh?12:3)&k&&e.set(g,!!((c===vh?8:2)&k))});a.N.set(d,e)}return e}
674
- olympe.dc.db.ou=class{constructor(a,b,c){this.id=a;this.D=b;this.X=c;this.H=new Map;this.F=new Map;this.R=new Set;this.j=new Map;this.N=new Map;this.buffer=[]}T(){return this.id}};function Ng(a){if(!a.F&&0<a.D.size)switch(a.mode){case olympe.dc.db.zf.j.jo:a.F=!0;setTimeout(()=>{a.j.getState()===olympe.dc.db.Database.F.IDLE&&a.run()},a.delay);break;case olympe.dc.db.zf.j.zw:a.F=!0,a.run()}}
675
- olympe.dc.db.zf=class{constructor(a,b,c,d){this.G=a;this.j=b;this.D=new Set;this.mode=c;this.delay=d;this.F=!1;c!==olympe.dc.db.zf.j.am&&this.init()}run(){const a=this.j;this.G.debug('Start garbage collector with',this.D.size,'instances to check');const b=[];for(const c of this.D){const d=a.get(c);!d||0<d.c||(this.G.debug('Remove unused instance',c,'from database'),a.Md(c),b.push(c))}this.D.clear();this.j.Ha(olympe.dc.db.Database.j.Bp,b);this.F=!1}init(){const a=olympe.dc.db.Database.j.hs,b=olympe.dc.db.Database.j.bq,
676
- c=olympe.dc.db.Database.j.qr,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&Ng(this)};this.j.j(olympe.dc.db.Database.j.dn,e.bind(this));this.j.j(b,e.bind(this));this.j.j(a,f=>{this.D.delete(f)});this.j.addEventListener(olympe.dc.db.Database.j.Mw,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.zf.j={am:0,zw:1,jo:2};olympe.dc.db.zf.D=5E3;olympe.dc.db.ec=class{constructor(a){this.id=null!=a?a:olympe.U.hf();this.Bb=new Map}T(){return this.id}qc(a){const b=olympe.dc.db.Jh.j.Bm,c=olympe.dc.db.Jh.j.Dc,d=olympe.dc.db.Jh.j.Xk;this.Bb.forEach((e,f)=>{const g=e.Ub();switch(e.getState()){case b:const h=e.jb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.N()?e.zb():void 0;a.Rc(f,h,k,g);break;case d:e.N()&&a.Xc(f,e.zb(),g);break;case c:a.D(f,e.F(),g)}for(const [h,k,l]of e.Id())e=this.Bb.get(k),
677
- l?a.Oa(h,f,k,g,e.Ub()):a.hc(h,f,k,g,e.Ub())});return a}nf(){return 0===this.Bb.size}H(){let a=0;this.Bb.forEach(b=>{a+=b.vd()});return a}Rc(a,b,c,d=null){b=this.F(a).create(b);'string'===typeof d&&this.Oa(olympe.dc.fc.Zc,a,d,d,null);c&&b.mn(c)}Xc(a,b,c=null){b&&this.F(a,c).mn(b)}D(a,b=olympe.dc.Lb.NONE,c=null){const d=this.Bb.get(a);if(d&&d.D())this.j(a,b);else{this.F(a,c).delete(b);for(const e of this.il(a,b,!1))this.Bb.get(e).zb().clear(),this.X(e,!0)}}Oa(a,b,c,d=null,e=null){this.F(b,d).link(a,
678
- c);this.F(c,e).yb(a,b)}hc(a,b,c,d=null,e=null){this.F(b,d).unlink(a,c);this.F(c,e).Gc(a,b)}Z(a){var b=olympe.dc.ga();if(b.Ja(a)){const c=b.model(a),d=b.source(a),e=b.zb(a,!0);rh(b,a).forEach((f,g)=>{e.set(`${olympe.dc.he.Xe}${g}`,f)});this.Rc(a,d,e,c);(b=b.ff(a))&&this.Oa(olympe.dc.fc.Li,a,b);e.forEach(f=>{f instanceof olympe.dc.vc&&this.Z(f.W())})}}Uc(){return function*(a){for(const b of a.values())if(b.D()||b.yd()||b.N())yield b}(this.Bb)}Tc(a){let b;return null!=(b=this.Bb.get(olympe.dc.ea(a)))?
679
- b:null}j(a,b=olympe.dc.Lb.NONE){a=this.il(a,b);for(const c of a)this.X(c,!1),this.Bb.delete(c)}Id(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.Id((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.Bb.values())}nh(a,b,c=(d,e)=>[d,e]){return this.ia(a,b,c)}*ia(a,b,c,d=[]){d.push(a);a=this.Tc(a);for(const [e,f]of a.cb(b))d.includes(e)||(yield*this.ia(e,b,c,d),yield c(e,f))}N(a,b,c){const d=this.Bb.get(b),e=this.Bb.get(c);d&&d.H(a,olympe.dc.ua.DESTINATION,c);e&&e.H(a,olympe.dc.ua.ORIGIN,
680
- b)}X(a,b){const c=olympe.dc.ua.ORIGIN,d=olympe.dc.ua.DESTINATION,e=this.Bb.get(a);for(const [g,h,k]of e.Id())if(k||!b){e.H(g,d,h);var f=this.Bb.get(h);f&&f.H(g,c,a)}for(const [g,h,k]of e.Wa())if(k||!b)e.H(g,c,h),(f=this.Bb.get(h))&&f.H(g,d,a)}*Ts(a){let b;for(const [c,d]of(null==(b=this.Tc(a))?void 0:b.cb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.Bb.get(c),a.yd()||(yield a))}il(a,b,c=!0){const d=olympe.dm.Relation.j.xr,e=olympe.dm.Relation.j.ds,f=olympe.dc.ua.ORIGIN,g=olympe.dc.ga();a=new Set([a]);
681
- const h=new Set;for(const l of a){var k=this.Bb.get(l);if(void 0!==k){for(const [n,p,q]of k.Id())q&&oh(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.Wa())q&&oh(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of sh(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&oh(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.Bb.has(l))}F(a,b){let c=this.Bb.get(a);void 0===c&&(c=new olympe.dc.db.Jh(a),this.Bb.set(a,c));return b?c.sa(b):c}R(a){const b=
682
- olympe.dc.ua.DESTINATION;for(const [c,d]of this.da(a))if(a=c.tag(),d.yd())this.j(a,d.F());else if(c.yd())d.D()&&this.j(a,c.F());else{c.zb().forEach((e,f)=>{void 0!==d.Pa(f)&&c.Z(f)});for(const [e,f,g]of c.Id()){const h=d.nb(e,b,f);void 0!==h&&g!==h&&this.N(e,a,f)}}return this}*da(a){var b=this.Bb;const c=a.Bb,d=(a=a.H()>this.H())?c:b;b=a?b:c;for(const [e,f]of b)b=d.get(e),void 0!==b&&(yield[a?f:b,a?b:f])}};olympe.dc.db.ec.ya=[olympe.dc.Writable,olympe.dc.hr];const Hh=olympe.dc.db.Database.j,Ih=olympe.dc.db.Database.D.ej,Jh=olympe.dc.db.Database.D.Hu,Kh=olympe.dc.db.Database.D.Xe,Lh=olympe.dc.db.Database.D.Bl,Mh=olympe.dc.db.Database.D.Hi,U=olympe.dc.ua.ORIGIN,V=olympe.dc.ua.DESTINATION,Nh=olympe.dc.fc.Zc,Oh=olympe.dc.fc.Li;function lg(a,b,c=!1){const d=a.get(Kh+b);return c||void 0!==d?d:a.get(Jh+b)}function Cg(a,b){const c=a.e!==b;c&&(b?(a.e=b,Ph(a)):(Qh(a),a.e=b),a.db.D(b?Hh.em:Hh.Dc,a.j));return c}
683
- function Dg(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(Nh,c)}a.link(Nh,b);b.forEach((d,e)=>{if(e[0]===Kh||e[0]===Jh)e=e.substring(1),Rh(a,e,d)});null===a.H||!b.e&&b!==a||a.db.Z(a,!0)}function Eg(a,b){const c=a.ff();if(null!==c){if(c===b)return;a.unlink(Oh,c)}a.link(Oh,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===Kh||f[0]===Jh)f=f.substring(1),a.has(Kh+f)||(a.set(Jh+f,e),d.set(f,e))});Sh(a,d)}
684
- function Fg(a,b){a.unlink(Nh,b);a.forEach((c,d)=>{c=d.substring(1);Rh(a,c,null)});a.db.Z(a,!1)}function Gg(a,b){a.unlink(Oh,b);const c=new Map;a.forEach((d,e)=>{e[0]===Jh&&(a.delete(e),d=e.substring(1),c.set(d,null))});Sh(a,c)}
685
- function Og(a,b,c){const d=Kh+b;var e=a.get(d);e=void 0===e?null:e;if(!Th(e,c))if(Uh(a,b,e,c,!0),e=Jh+b,null===c){a.delete(d);let f;c=null==(f=a.ff())?void 0:lg(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);Sh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),Sh(a,(new Map).set(b,c))}function eh(a,b,c,d){const e=Vh(a,Mh+b);return e.has(c)?!1:(e.set(c,d),a.ne(olympe.dc.db.Instance.j.Hi+b),a.db.D(Hh.Ko,a.j,b,c),!0)}
686
- function bh(a,b,c){const d=Wh(a,Mh+b,c);void 0!==d&&(a.detach(olympe.dc.db.Instance.j.Hi+b),a.db.D(Hh.Lo,a.j,b,c));return d}function kh(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];if(g=a.db.get(f[g-1])){const k=olympe.dc.db.Instance.j.hw+b;h?g.ne(k):g.detach(k)}d(...f)};return eh(a,b,c,e)?e:null}function Th(a,b){return a instanceof Date?b instanceof Date&&a.getTime()===b.getTime():null!==a&&'function'===typeof a.Ea?a.Ea(b):a===b}
687
- function Uh(a,b,c,d,e){c instanceof olympe.dc.vc&&(Xh(a.db.get(c.W())),a.db.sa(c.W()));d instanceof olympe.dc.vc&&(c=a.db.N(d.W(),!0),c.D&&c.D.tag!==a.j&&a.db.Xa().fatal('Instance',d.W(),'referenced multiple times!\nThis instance is currently property of',c.D.tag,'(for the property '+c.D.Da+')','and is assigned as a property of',a.j,'(for the property '+b+')'),d=c,a=a.j,void 0===d.D&&(d.ne(olympe.dc.db.Instance.j.fj+a+':'+b),d.db.Wa(d.j,a,b)),d.D={tag:a,Da:b,kz:e})}
688
- function Yh(a,b,c,d){a.e&&a.db.Pe(a.j,b,c,d)}function Sh(a,b,c=[]){const d=a.get(U+Nh);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>Rh(e,g,f))});a=a.get(U+Oh);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(Kh+k)||(g.set(k,h),null!==h?e.set(Jh+k,h):e.delete(Jh+k))});Sh(e,g,[...c,f])}})}function Vh(a,b){let c;return null!=(c=a.get(b))?c:a.create(b)}function Zh(a,b,c,d,e){a.db.ef(a.j,b,c,d.j,e)}
689
- function Wh(a,b,c){const d=a.get(b);if(void 0!==d){const e=d.get(c);d.delete(c);0===d.size&&a.delete(b);return e}}function Rh(a,b,c){if(!a.has(Ih+b)){const d=Lh+b,e=a.get(d);Th(c,void 0!==e?e:null)||(null===c?a.delete(d):a.set(d,c),Yh(a,b,c,null!==c))}}function Ph(a){a.forEach((b,c)=>{const d=c[0];if(d===U||d===V){const e=c.substring(1),f=d===U?V:U;b.forEach(g=>{g.e&&(Zh(a,e,d,g,!0),Zh(g,e,f,a,!0))})}else if(d===Ih||d===Lh)c=c.substring(1),Yh(a,c,b,d===Lh)})}
690
- function Qh(a){a.forEach((b,c)=>{const d=c[0];if(d!==Mh){var e=c.substring(1);d===U?b.forEach(f=>{f.unlink(e,a)}):d===V?b.forEach(f=>{a.unlink(e,f)}):d===Ih?a.update(e,null):d===Kh&&Og(a,e,null);a.delete(c)}});if(void 0!==a.D){const b=a.db.get(a.D.tag),c=a.D.kz;let d,e;(null==(d=b.get(`${c?Kh:Ih}${a.D.Da}`))?void 0:null==(e=d.W)?void 0:e.call(d))===a.j&&(c?Og(b,a.D.Da,null):b.update(a.D.Da,null))}}
691
- function Xh(a){void 0!==a.D&&(a.detach(olympe.dc.db.Instance.j.fj+a.D.tag+':'+a.D.Da),a.db.Wa(a.j,a.D.tag,a.D.Da),a.D=void 0)}
692
- olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.j=a;this.H=null;this.e=!1;this.D=void 0;this.c=0;this.N=!1;this.db=b}tag(){return this.j}Ja(){return this.e}F(){return this.db.F(this.j)}source(){return this.H}model(){const a=this.get(V+Nh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}ff(){const a=this.get(V+Oh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Pa(olympe.dc.CloudObject.nameProp.W());a=`Instance: ${this.j}, Exist: ${this.e}, Name: ${a}`;
693
- var b=this.model();if(b){var c=b.Pa(olympe.dc.CloudObject.nameProp.W())||'No model name';a+=`\nModel: ${b.j}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.ff())?(c=b.Pa(olympe.dc.CloudObject.nameProp.W())||'No extension name',a+=`\nExtension: ${b.j}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Pa(a,b=!1){const c=this.get(Ih+a);return b||void 0!==c?c:this.get(Lh+a)}update(a,b){const c=Ih+a;var d=this.get(c);d=void 0===d?null:d;if(!Th(d,b))if(Uh(this,
694
- a,d,b,!1),d=Lh+a,null===b){this.delete(c);let e;b=null==(e=this.model())?void 0:lg(e,a);void 0!==b?(this.set(d,b),Yh(this,a,b,!0)):Yh(this,a,null,!1)}else this.set(c,b),this.delete(d),Yh(this,a,b,!1)}link(a,b){var c=U+a;const d=Vh(this,V+a);c=Vh(b,c);d.has(b.j)||(d.set(b.j,b),c.set(this.j,this),this.db.D(Hh.Ik,this.j,a,V,b.j),this.db.D(Hh.Ik,b.j,a,U,this.j),this.e&&b.e&&(Zh(this,a,V,b,!0),Zh(b,a,U,this,!0)))}unlink(a,b){const c=U+a;void 0!==Wh(this,V+a,b.j)&&(Wh(b,c,this.j),this.db.D(Hh.Tm,this.j,
695
- a,V,b.j),this.db.D(Hh.Tm,b.j,a,U,this.j),this.e&&b.e&&(Zh(this,a,V,b,!1),Zh(b,a,U,this,!1)))}persist(){this.N=!0;return this}ne(){this.c++;1===this.c&&this.db.D(Hh.hs,this.j)}detach(){0<this.c?--this.c:this.db.D(Hh.qr,this.j,`Try to decrease references on instance ${this.j} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===this.c&&this.db.D(Hh.dn,
696
- this.j)}clear(){this.forEach((a,b)=>{const c=b[0];if(c===U||c===V){const d=b.substring(1),e=c===U?V:U;a.forEach(f=>{const g=f.get(e+d);g.delete(this.j);0===g.size&&f.delete(e+d)})}c===Ih&&a instanceof olympe.dc.vc&&Xh(this.db.get(a.W()))});void 0!==this.D&&this.db.get(this.D.tag).delete(Ih+this.D.Da)}create(a){const b=new Map;this.set(a,b);return b}};olympe.dc.db.Instance.j={$p:'instance',hw:'rel',Hi:'cb',fj:'ref',TRANSACTION:'tx'};olympe.dc.db.Jh=class a{constructor(b){this.Qc=b;this.R=this.Ha=null;this.Ob=olympe.dc.Lb.NONE;this.state=a.j.Xk;this.j=this.ob=this.Yb=this.X=this.properties=null}tag(){return this.Qc}Ub(){return this.R}jb(){return this.Ha}getState(){return this.state}sa(b){if(null===this.R)this.R=b;else if(this.R!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.R}`);return this}F(){return this.state===a.j.Dc?this.Ob:olympe.dc.Lb.NONE}create(b){this.state=a.j.Bm;
697
- this.Ha=null!=b?b:null;return this}delete(b=olympe.dc.Lb.NONE){this.state=a.j.Dc;this.Ob=b;this.properties=null;return this}ja(b,c){if(this.state===a.j.Dc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}mn(b){this.state!==a.j.Dc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}Md(b,c){if(null!==this.X&&this.X!==b)throw Error('An instance should never be set as complex property of multiple instances');this.X=b;this.Yb=
698
- c}Z(b){let c;null==(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.fc.Zc&&this.sa(c);this.ra(this.ob,b,c,!0);return this}unlink(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.fc.Zc&&this.sa(c);this.ra(this.ob,b,c,!1);return this}yb(b,c){null===this.j&&(this.j=new Map);this.ra(this.j,b,c,!0)}Gc(b,c){null===this.j&&(this.j=new Map);this.ra(this.j,b,c,!1)}nb(b,c,d){if(c=c===olympe.dc.ua.ORIGIN?this.j:this.ob)return(b=
699
- c.get(b))&&b.get(d)}H(b,c,d){const e=(c=c===olympe.dc.ua.ORIGIN?this.j:this.ob)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}D(){return this.state===a.j.Bm}yd(){return this.state===a.j.Dc}vd(){let b=this.properties?this.properties.size:0,c;null==(c=this.ob)||c.forEach(d=>{b+=d.size});return b}N(){return null!==this.properties}Fd(){return null!==this.ob||null!==this.j}zb(){let b;return null!=(b=this.properties)?b:new Map}Pa(b){if(this.properties)return this.properties.get(b)}cb(b,c=(d,e)=>[d,
700
- e]){return function*(d){if(d=d&&d.get(b.W()))for(const [e,f]of d)yield c(e,f)}(b.La()===olympe.dc.ua.ORIGIN?this.j:this.ob)}Ib(b){const c=b.La()===olympe.dc.ua.ORIGIN?this.j:this.ob;return(b=c&&c.get(b.W()))&&0!==b.size?Array.from(b.keys())[0]:null}Id(b=(c,d,e)=>[c,d,e]){return this.ia(this.ob,b)}Wa(b=(c,d,e)=>[c,d,e]){return this.ia(this.j,b)}da(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.ua.ORIGIN,d=olympe.dc.ua.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>
701
- b(h,c,k,l))}(this.ia.bind(this),this.ob,this.j)}ra(b,c,d,e){if(this.state!==a.j.Dc||!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*ia(b,c){if(null!==b)for(const [d,e]of b){b=e.entries();for(const [f,g]of b)yield c(d,f,g)}}};olympe.dc.db.Jh.j={Bm:0,Xk:1,Dc:2};olympe.dc.db.Gv=class{constructor(a,b,c,d){this.G=a;this.view=b;this.j=c;(this.active=d.get('active'))&&this.init()}debug(a){const b=olympe.dc.ea(a);if(this.j.has(b)){var c=this.j.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ja()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.j.get(d[d.length-1]);const e=olympe.dc.db.Database.D.ej+olympe.dc.CloudObject.nameProp.W();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
702
- ' (name: '+c.get(e)+') has no model.\nList: '+d.join(' --M--\x3e ')}this.G.info(a)}else this.G.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.j.np,b=olympe.dc.db.Database.j.em,c=olympe.dc.db.Database.j.Dc,d=olympe.dc.db.Database.j.Ik,e=olympe.dc.db.Database.j.Tm,f=olympe.dc.db.Database.j.Ko,g=olympe.dc.db.Database.j.Lo,h=()=>{};this.j.j(olympe.dc.db.Database.j.mp,()=>{});this.j.j(a,()=>{});this.j.j(b,k=>{this.j.yb(()=>{lh(this.view,
703
- k,h,`monitorRelations${k}`)})});this.j.j(c,k=>{this.j.yb(()=>{mh(this.view,k,`monitorRelations${k}`)})});this.j.j(d,()=>{});this.j.j(e,()=>{});this.j.j(f,()=>{});this.j.j(g,()=>{})}};olympe.dc.db.en=class{constructor(a,b,c,d){this.G=a;this.j=b;this.ga=c;this.F=d;this.transactionId=null}open(a){if(null!==this.transactionId)throw Error('A transaction is already open');this.transactionId=this.j.tg(a);this.G.debug(`DB Writer: transaction ${this.transactionId} opened`)}write(a,b){b&&(b=new $h(this.ga),a.qc(b),this.G.info(b.flush()));if(null===this.transactionId)throw Error('You must first open a transaction before to write');this.G.debug('DB Writer: writing patch',a.T(),'for transaction',
704
- this.transactionId);this.j.ht(this.transactionId,()=>a.qc(this))}close(){if(null===this.transactionId)throw Error('No transaction is open');this.j.ke(this.transactionId);this.G.debug(`DB Writer: transaction ${this.transactionId} committed`);this.transactionId=null}Rc(a,b,c,d){this.j.create(a,b,c,this.F);d&&this.j.link(olympe.dc.fc.Zc,a,d)}Xc(a,b){this.j.update(a,b)}D(a,b=olympe.dc.Lb.NONE){for(const c of kg(this.ga,a,b))this.j.sa(c)}Oa(a,b,c){this.j.link(a,b,c)}hc(a,b,c){this.j.unlink(a,b,c)}};
705
- function ai(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)if(d+=(d?', "':'"')+e+'":',!f)d+=JSON.stringify(f);else if(f instanceof olympe.dc.vc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.W()+'")';else if(f instanceof olympe.C.Color)d+='Color("'+f.oh()+','+f.lh()+','+f.hh()+','+f.gh()+'")';else if(f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString'))d+=JSON.stringify(f.toString());else if('object'===typeof f){let g;d+=ai(a,f,
706
- (null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function bi(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function ci(a,b){let c;return b===olympe.dc.fc.Zc?'Model':null!=(c=a.db.name(b))?c:b}
707
- class $h{constructor(a){this.db=a;this.output='Applying patch on the local database'}flush(){const a=this.output;this.output='';return a}log(a,b){this.output+=`\ndb.${a};${b?`// ${b}`:''}`}Rc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${ai(this,c)})`,bi(this,d))}Xc(a,b,c){this.log(`updateInstance(tag: ${a}, ${ai(this,b)})`,bi(this,c))}D(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,bi(this,c))}Oa(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,ci(this,a))}hc(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
708
- ci(this,a))}}olympe.dc.db.en.ya=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.P={Ca:'dc.db.Logger',jm:'dc.db.gc.Logger',Fa:'dc.db.DatabaseManager',bk:'dc.db.Database',Xl:'dc.db.DBView',PB:'dc.db.Graph',RA:'dc.db.DatabaseWriter',EC:'dc.db.PermissionProcessor',Yi:'dc.db.GraphMonitor'};olympe.dc.db.Config={Cp:'db.garbageCollector',Dp:'db.garbageCollectorDelay',Pl:'db.commitBufferTimeout',Yi:'db.monitor',Fv:'db.monitorCounters',Ev:'db.monitorCallbacks',ep:'db.debug'};
709
- olympe.V.config(function(a){E(a,olympe.dc.db.Config.Cp,olympe.dc.db.zf.j.jo);E(a,olympe.dc.db.Config.Dp,5E3);E(a,olympe.dc.db.Config.Pl,3E4);E(a,olympe.dc.db.Config.Yi,!1);E(a,olympe.dc.db.Config.ep,!1);D(a,olympe.dc.db.P.Ca,[olympe.ha.P.Fa],b=>b.ad('db'));D(a,olympe.dc.db.P.jm,[olympe.ha.P.Fa],b=>b.ad('gc'));D(a,olympe.dc.db.P.bk,[olympe.dc.db.P.Ca,olympe.dc.db.P.jm,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.db.Config.Cp),new olympe.V.oa(olympe.dc.db.Config.Dp),new olympe.V.oa(olympe.dc.Config.Yh),
710
- new olympe.V.oa(olympe.dc.db.Config.ep)],(b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.zf.j.am:e;d=(new Map).set('selfTag',d).set('garbageCollector',e).set('garbageCollectorDelay',f).set('debug',h);return new olympe.dc.db.Database(b,c,d)});C(a,olympe.dc.db.P.Xl,olympe.dc.kb,olympe.dc.db.P.Ca,olympe.dc.db.P.bk);D(a,olympe.dc.db.P.Yi,[olympe.dc.db.P.Fa],b=>b.yz);D(a,olympe.dc.db.P.Fa,[olympe.dc.db.P.Ca,olympe.dc.db.P.bk,olympe.dc.db.P.Xl,new olympe.V.oa(olympe.dc.Config.ag),new olympe.V.oa(olympe.dc.db.Config.Pl),
711
- new olympe.V.oa(olympe.dc.db.Config.Yi),new olympe.V.oa(olympe.dc.db.Config.Fv),new olympe.V.oa(olympe.dc.db.Config.Ev)],(b,c,d,e,f,g,h,k)=>{g=(new Map).set('active',g).set('counters',h).set('callbacks',k);e=(new Map).set('debug',e).set('bufferTimeout',f);return new olympe.dc.db.ku(b,c,d,e,g)})},'olympe.dc.db');olympe.V.run([olympe.dc.db.P.bk,olympe.dc.db.P.Yi],(a,b)=>{olympe.de().db=a;olympe.de().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function di(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
712
- olympe.dc.query.wf=class{constructor(a,b,c){this.db=olympe.dc.ga();this.j=a;this.Da=b;this.Wi=c}fa(){return{p:this.Da.W(),o:this.Wi}}toString(){return'sortByQueryPart-'+this.Wi+this.Da.W()}jh(){const a=this.db.Ib(this.Da,olympe.dm.Property.typeRel),b=olympe.dc.ea;if(this.db.Tf(a,olympe.dm.String))return di((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return di((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return di((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return di((c,
713
- d)=>c.compare(d));olympe.ha.Xa('dc.query').warn(`No comparator found for type with tag ${a}`);return di(()=>-1)}Pa(){return this.Da}};olympe.dc.Ye=class{W(){}};olympe.dc.Ye.prototype.getTag=olympe.dc.Ye.prototype.W;olympe.dc.SB=olympe.dc.Ye;function ei(a){let b;if(null==(b=a.j)?0:b.nf())if(a=a.N,!a.N){let c;null==(c=a.R)||c.call(a)}}function fi(a,b,c,d,e){ei(a);let f,g;b?null==(f=a.j)||f.Oa(c,d,e):null==(g=a.j)||g.hc(c,d,e)}function gi(a){let b;const c=!(null==(b=a.j)?0:b.nf());a.F=c?a.j:null;a.H.forEach(d=>d());a.H=[];c&&(a.j=new olympe.dc.db.ec,a.G.j()&&a.G.debug(`Commit notification with ${a.F.H()} operations for query ${a.D}`))}
714
- olympe.dc.query.Mv=class{constructor(a,b,c,d){this.G=a;this.source=b;this.D=c;this.N=d;this.j=this.F=null;this.db=olympe.dc.ga();this.H=[]}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.D}:${a}:notif`;Nf(this.db,a,(d,e)=>{if(d){ei(this);let f;null==(f=this.j)||f.Z(e)}else if(b&&ih(this.db,e,c),!this.db.Ja(e)){ei(this);let f;null==(f=this.j)||f.D(e,olympe.dc.Lb.NONE)}},c);b&&hh(this.db,a,(d,e,f)=>{ei(this);let g;f||null!=(g=this.j)&&g.Xc(a,new Map([[d,e]]))},c)}}stop(a){this.H.push(()=>
715
- Lf(this.db,a,`${this.D}:${a}:notif`))}};olympe.dc.query.Bk={ASC:'ASC',DESC:'DESC'};function hi(a){const b=ii(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].T():a.F,g=0<e?b[e-1].j:'root',h=0<e&&b[e-1].R(),k=a.j.get(f),l=new Set(k.Uc()),n=new Map,p=a.H.has(f);let q=p?';':'';if(c.has(f)){const [r,t,v]=c.get(f);c.delete(f);q+=v;r.forEach((x,y)=>{for(const z of k.j(y)){let A;n.set(z,Array.from(x).map(K=>p?`${y};${K}`:K).reduce((K,Y)=>K.add(Y),null!=(A=n.get(z))?A:new Set))}l.delete(y)});t&&l.forEach(x=>{const y=p?`${x};${v}`:v;for(const z of k.j(x)){let A;n.set(z,
671
+ olympe.dc.kb.prototype.name=olympe.dc.kb.prototype.name;olympe.dc.kb.prototype.exist=olympe.dc.kb.prototype.Ja;const xh=olympe.dc.db.Database.D.ORIGIN,Mg=olympe.dc.db.Database.D.DESTINATION,Lg=olympe.dc.db.Database.D.El,yh=olympe.dc.db.Database.D.ej,zh=olympe.dc.db.Database.D.Yp,Ah=olympe.dc.db.Database.D.Hi,Bh=xh+Mg,Ch=yh+yh,Dh=Array.from(Object.values(olympe.dc.Lb)).filter(a=>null!==a);function Jg(a,b,c){let d=a.j.get(b);void 0===d&&(d=[],a.j.set(b,d));a.buffer.push([b,d.length]);d.push(c)}
672
+ function Ng(a){for(const [b,c]of a.H)a.D.Gc(new Set,b).filter(d=>Eg(d,c)).forEach(d=>{d=d.tag();c?Kg(a,d).create():Kg(a,d).delete()})}
673
+ function Og(a){const b=a.D;a.F.forEach((c,d)=>{var e=b.get(d);if(c.D()||c.yd()){var f=e.get(Ah);f&&Eh(a,f,c.D(),d);c.yd()&&a.R.add(d)}for(const [n,p]of c.zb()){var g=n[0]===Lg,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(Ah+yh+h);q&&Eh(f,q,l,g);(k=k.get(Ah+Ch))&&Eh(f,k,h,l,g)}for(const n of c.ba())Fh(a,e,...n);(e=c.X)&&Gh(a,e,d,c.Ub,!c.yd())});a.H.clear();a.F.clear();a.N.clear();Hh(a)}function Kg(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.Jh(b),a.F.set(b,c));return c}
674
+ function Eh(a,b,...c){b.forEach((d,e)=>{Jg(a,e,d.bind(null,...c))})}function Fh(a,b,c,d,e,f){var g=b.get(Ah+d+c);g&&Eh(a,g,f,e);(g=b.get(Ah+Bh))&&Eh(a,g,c,d,f,e);Ih(a,c,d).forEach((h,k)=>{(k=b.get(Ah+zh+k))&&Eh(a,k,c,d,h,f,e)})}function Gh(a,b,c,d,e){Dh.forEach(f=>{const g=f[0]===olympe.dc.he.hg;(f=a.D.get(g?c:b).get(Ah+zh+f))&&Eh(a,f,d,null,!0,e,g?b:c)})}
675
+ function Hh(a){a.X.run(()=>{const b=a.j;for(const [c,d]of a.buffer){let e,f,g;null==(e=b.get(c))||null==(g=(f=e)[d])||g.call(f)}});a.j.clear();a.buffer.length=0}function Ih(a,b,c){const d=b+c;let e=a.N.get(d);if(!e){const f=a.D.get(b);e=new Map;Dh.forEach(g=>{const h=g[0]===olympe.dc.he.hg;var k=h?g.substring(1):g;let l;k=null!=(l=null==f?void 0:f.get(yh+k))?l:0;k=h?((k&3)<<2)+((k&12)>>2):k;(c===xh?12:3)&k&&e.set(g,!!((c===xh?8:2)&k))});a.N.set(d,e)}return e}
676
+ olympe.dc.db.pu=class{constructor(a,b,c){this.id=a;this.D=b;this.X=c;this.H=new Map;this.F=new Map;this.R=new Set;this.j=new Map;this.N=new Map;this.buffer=[]}T(){return this.id}};function Pg(a){if(!a.F&&0<a.D.size)switch(a.mode){case olympe.dc.db.Af.j.ko:a.F=!0;setTimeout(()=>{a.j.getState()===olympe.dc.db.Database.F.IDLE&&a.run()},a.delay);break;case olympe.dc.db.Af.j.Aw:a.F=!0,a.run()}}
677
+ olympe.dc.db.Af=class{constructor(a,b,c,d){this.G=a;this.j=b;this.D=new Set;this.mode=c;this.delay=d;this.F=!1;c!==olympe.dc.db.Af.j.em&&this.init()}run(){const a=this.j;this.G.debug('Start garbage collector with',this.D.size,'instances to check');const b=[];for(const c of this.D){const d=a.get(c);!d||0<d.c||(this.G.debug('Remove unused instance',c,'from database'),a.Md(c),b.push(c))}this.D.clear();this.j.Ha(olympe.dc.db.Database.j.Cp,b);this.F=!1}init(){const a=olympe.dc.db.Database.j.js,b=olympe.dc.db.Database.j.cq,
678
+ c=olympe.dc.db.Database.j.rr,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&Pg(this)};this.j.j(olympe.dc.db.Database.j.gn,e.bind(this));this.j.j(b,e.bind(this));this.j.j(a,f=>{this.D.delete(f)});this.j.addEventListener(olympe.dc.db.Database.j.Nw,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.Af.j={em:0,Aw:1,ko:2};olympe.dc.db.Af.D=5E3;olympe.dc.db.ec=class{constructor(a){this.id=null!=a?a:olympe.U.hf();this.Bb=new Map}T(){return this.id}qc(a){const b=olympe.dc.db.Jh.j.Em,c=olympe.dc.db.Jh.j.Dc,d=olympe.dc.db.Jh.j.Xk;this.Bb.forEach((e,f)=>{const g=e.Vb();switch(e.getState()){case b:const h=e.jb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.N()?e.zb():void 0;a.Sc(f,h,k,g);break;case d:e.N()&&a.Yc(f,e.zb(),g);break;case c:a.D(f,e.F(),g)}for(const [h,k,l]of e.Id())e=this.Bb.get(k),
679
+ l?a.Oa(h,f,k,g,e.Vb()):a.hc(h,f,k,g,e.Vb())});return a}nf(){return 0===this.Bb.size}H(){let a=0;this.Bb.forEach(b=>{a+=b.hd()});return a}Sc(a,b,c,d=null){b=this.F(a).create(b);'string'===typeof d&&this.Oa(olympe.dc.fc.Zc,a,d,d,null);c&&b.qn(c)}Yc(a,b,c=null){b&&this.F(a,c).qn(b)}D(a,b=olympe.dc.Lb.NONE,c=null){const d=this.Bb.get(a);if(d&&d.D())this.j(a,b);else{this.F(a,c).delete(b);for(const e of this.il(a,b,!1))this.Bb.get(e).zb().clear(),this.X(e,!0)}}Oa(a,b,c,d=null,e=null){this.F(b,d).link(a,
680
+ c);this.F(c,e).vb(a,b)}hc(a,b,c,d=null,e=null){this.F(b,d).unlink(a,c);this.F(c,e).Gc(a,b)}Z(a){var b=olympe.dc.ha();if(b.Ja(a)){const c=b.model(a),d=b.source(a),e=b.zb(a,!0);th(b,a).forEach((f,g)=>{e.set(`${olympe.dc.he.Xe}${g}`,f)});this.Sc(a,d,e,c);(b=b.ff(a))&&this.Oa(olympe.dc.fc.Li,a,b);e.forEach(f=>{f instanceof olympe.dc.vc&&this.Z(f.W())})}}Vc(){return function*(a){for(const b of a.values())if(b.D()||b.yd()||b.N())yield b}(this.Bb)}Uc(a){let b;return null!=(b=this.Bb.get(olympe.dc.ea(a)))?
681
+ b:null}j(a,b=olympe.dc.Lb.NONE){a=this.il(a,b);for(const c of a)this.X(c,!1),this.Bb.delete(c)}Id(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.Id((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.Bb.values())}nh(a,b,c=(d,e)=>[d,e]){return this.ia(a,b,c)}*ia(a,b,c,d=[]){d.push(a);a=this.Uc(a);for(const [e,f]of a.cb(b))d.includes(e)||(yield*this.ia(e,b,c,d),yield c(e,f))}N(a,b,c){const d=this.Bb.get(b),e=this.Bb.get(c);d&&d.H(a,olympe.dc.ta.DESTINATION,c);e&&e.H(a,olympe.dc.ta.ORIGIN,
682
+ b)}X(a,b){const c=olympe.dc.ta.ORIGIN,d=olympe.dc.ta.DESTINATION,e=this.Bb.get(a);for(const [g,h,k]of e.Id())if(k||!b){e.H(g,d,h);var f=this.Bb.get(h);f&&f.H(g,c,a)}for(const [g,h,k]of e.Ua())if(k||!b)e.H(g,c,h),(f=this.Bb.get(h))&&f.H(g,d,a)}*Us(a){let b;for(const [c,d]of(null==(b=this.Uc(a))?void 0:b.cb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.Bb.get(c),a.yd()||(yield a))}il(a,b,c=!0){const d=olympe.dm.Relation.j.yr,e=olympe.dm.Relation.j.es,f=olympe.dc.ta.ORIGIN,g=olympe.dc.ha();a=new Set([a]);
683
+ const h=new Set;for(const l of a){var k=this.Bb.get(l);if(void 0!==k){for(const [n,p,q]of k.Id())q&&qh(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.Ua())q&&qh(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of uh(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&qh(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.Bb.has(l))}F(a,b){let c=this.Bb.get(a);void 0===c&&(c=new olympe.dc.db.Jh(a),this.Bb.set(a,c));return b?c.wa(b):c}R(a){const b=
684
+ olympe.dc.ta.DESTINATION;for(const [c,d]of this.ba(a))if(a=c.tag(),d.yd())this.j(a,d.F());else if(c.yd())d.D()&&this.j(a,c.F());else{c.zb().forEach((e,f)=>{void 0!==d.Pa(f)&&c.Z(f)});for(const [e,f,g]of c.Id()){const h=d.lb(e,b,f);void 0!==h&&g!==h&&this.N(e,a,f)}}return this}*ba(a){var b=this.Bb;const c=a.Bb,d=(a=a.H()>this.H())?c:b;b=a?b:c;for(const [e,f]of b)b=d.get(e),void 0!==b&&(yield[a?f:b,a?b:f])}};olympe.dc.db.ec.ya=[olympe.dc.Writable,olympe.dc.ir];const Jh=olympe.dc.db.Database.j,Kh=olympe.dc.db.Database.D.ej,Lh=olympe.dc.db.Database.D.Iu,Mh=olympe.dc.db.Database.D.Xe,Nh=olympe.dc.db.Database.D.El,Oh=olympe.dc.db.Database.D.Hi,U=olympe.dc.ta.ORIGIN,V=olympe.dc.ta.DESTINATION,Ph=olympe.dc.fc.Zc,Qh=olympe.dc.fc.Li;function ng(a,b,c=!1){const d=a.get(Mh+b);return c||void 0!==d?d:a.get(Lh+b)}function Eg(a,b){const c=a.e!==b;c&&(b?(a.e=b,Rh(a)):(Sh(a),a.e=b),a.db.D(b?Jh.hm:Jh.Dc,a.j));return c}
685
+ function Fg(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(Ph,c)}a.link(Ph,b);b.forEach((d,e)=>{if(e[0]===Mh||e[0]===Lh)e=e.substring(1),Th(a,e,d)});null===a.H||!b.e&&b!==a||a.db.Z(a,!0)}function Gg(a,b){const c=a.ff();if(null!==c){if(c===b)return;a.unlink(Qh,c)}a.link(Qh,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===Mh||f[0]===Lh)f=f.substring(1),a.has(Mh+f)||(a.set(Lh+f,e),d.set(f,e))});Uh(a,d)}
686
+ function Hg(a,b){a.unlink(Ph,b);a.forEach((c,d)=>{c=d.substring(1);Th(a,c,null)});a.db.Z(a,!1)}function Ig(a,b){a.unlink(Qh,b);const c=new Map;a.forEach((d,e)=>{e[0]===Lh&&(a.delete(e),d=e.substring(1),c.set(d,null))});Uh(a,c)}
687
+ function Qg(a,b,c){const d=Mh+b;var e=a.get(d);e=void 0===e?null:e;if(!Vh(e,c))if(Wh(a,b,e,c,!0),e=Lh+b,null===c){a.delete(d);let f;c=null==(f=a.ff())?void 0:ng(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);Uh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),Uh(a,(new Map).set(b,c))}function gh(a,b,c,d){const e=Xh(a,Oh+b);return e.has(c)?!1:(e.set(c,d),a.ne(olympe.dc.db.Instance.j.Hi+b),a.db.D(Jh.Lo,a.j,b,c),!0)}
688
+ function dh(a,b,c){const d=Yh(a,Oh+b,c);void 0!==d&&(a.detach(olympe.dc.db.Instance.j.Hi+b),a.db.D(Jh.Mo,a.j,b,c));return d}function mh(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];if(g=a.db.get(f[g-1])){const k=olympe.dc.db.Instance.j.iw+b;h?g.ne(k):g.detach(k)}d(...f)};return gh(a,b,c,e)?e:null}function Vh(a,b){return a instanceof Date?b instanceof Date&&a.getTime()===b.getTime():null!==a&&'function'===typeof a.Ea?a.Ea(b):a===b}
689
+ function Wh(a,b,c,d,e){c instanceof olympe.dc.vc&&(Zh(a.db.get(c.W())),a.db.wa(c.W()));d instanceof olympe.dc.vc&&(c=a.db.N(d.W(),!0),c.D&&c.D.tag!==a.j&&a.db.Wa().fatal('Instance',d.W(),'referenced multiple times!\nThis instance is currently property of',c.D.tag,'(for the property '+c.D.Ca+')','and is assigned as a property of',a.j,'(for the property '+b+')'),d=c,a=a.j,void 0===d.D&&(d.ne(olympe.dc.db.Instance.j.fj+a+':'+b),d.db.Ua(d.j,a,b)),d.D={tag:a,Ca:b,lz:e})}
690
+ function $h(a,b,c,d){a.e&&a.db.Qe(a.j,b,c,d)}function Uh(a,b,c=[]){const d=a.get(U+Ph);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>Th(e,g,f))});a=a.get(U+Qh);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(Mh+k)||(g.set(k,h),null!==h?e.set(Lh+k,h):e.delete(Lh+k))});Uh(e,g,[...c,f])}})}function Xh(a,b){let c;return null!=(c=a.get(b))?c:a.create(b)}function ai(a,b,c,d,e){a.db.ef(a.j,b,c,d.j,e)}
691
+ function Yh(a,b,c){const d=a.get(b);if(void 0!==d){const e=d.get(c);d.delete(c);0===d.size&&a.delete(b);return e}}function Th(a,b,c){if(!a.has(Kh+b)){const d=Nh+b,e=a.get(d);Vh(c,void 0!==e?e:null)||(null===c?a.delete(d):a.set(d,c),$h(a,b,c,null!==c))}}function Rh(a){a.forEach((b,c)=>{const d=c[0];if(d===U||d===V){const e=c.substring(1),f=d===U?V:U;b.forEach(g=>{g.e&&(ai(a,e,d,g,!0),ai(g,e,f,a,!0))})}else if(d===Kh||d===Nh)c=c.substring(1),$h(a,c,b,d===Nh)})}
692
+ function Sh(a){a.forEach((b,c)=>{const d=c[0];if(d!==Oh){var e=c.substring(1);d===U?b.forEach(f=>{f.unlink(e,a)}):d===V?b.forEach(f=>{a.unlink(e,f)}):d===Kh?a.update(e,null):d===Mh&&Qg(a,e,null);a.delete(c)}});if(void 0!==a.D){const b=a.db.get(a.D.tag),c=a.D.lz;let d,e;(null==(d=b.get(`${c?Mh:Kh}${a.D.Ca}`))?void 0:null==(e=d.W)?void 0:e.call(d))===a.j&&(c?Qg(b,a.D.Ca,null):b.update(a.D.Ca,null))}}
693
+ function Zh(a){void 0!==a.D&&(a.detach(olympe.dc.db.Instance.j.fj+a.D.tag+':'+a.D.Ca),a.db.Ua(a.j,a.D.tag,a.D.Ca),a.D=void 0)}
694
+ olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.j=a;this.H=null;this.e=!1;this.D=void 0;this.c=0;this.N=!1;this.db=b}tag(){return this.j}Ja(){return this.e}F(){return this.db.F(this.j)}source(){return this.H}model(){const a=this.get(V+Ph);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}ff(){const a=this.get(V+Qh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Pa(olympe.dc.CloudObject.nameProp.W());a=`Instance: ${this.j}, Exist: ${this.e}, Name: ${a}`;
695
+ var b=this.model();if(b){var c=b.Pa(olympe.dc.CloudObject.nameProp.W())||'No model name';a+=`\nModel: ${b.j}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.ff())?(c=b.Pa(olympe.dc.CloudObject.nameProp.W())||'No extension name',a+=`\nExtension: ${b.j}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Pa(a,b=!1){const c=this.get(Kh+a);return b||void 0!==c?c:this.get(Nh+a)}update(a,b){const c=Kh+a;var d=this.get(c);d=void 0===d?null:d;if(!Vh(d,b))if(Wh(this,
696
+ a,d,b,!1),d=Nh+a,null===b){this.delete(c);let e;b=null==(e=this.model())?void 0:ng(e,a);void 0!==b?(this.set(d,b),$h(this,a,b,!0)):$h(this,a,null,!1)}else this.set(c,b),this.delete(d),$h(this,a,b,!1)}link(a,b){var c=U+a;const d=Xh(this,V+a);c=Xh(b,c);d.has(b.j)||(d.set(b.j,b),c.set(this.j,this),this.db.D(Jh.Ik,this.j,a,V,b.j),this.db.D(Jh.Ik,b.j,a,U,this.j),this.e&&b.e&&(ai(this,a,V,b,!0),ai(b,a,U,this,!0)))}unlink(a,b){const c=U+a;void 0!==Yh(this,V+a,b.j)&&(Yh(b,c,this.j),this.db.D(Jh.Wm,this.j,
697
+ a,V,b.j),this.db.D(Jh.Wm,b.j,a,U,this.j),this.e&&b.e&&(ai(this,a,V,b,!1),ai(b,a,U,this,!1)))}persist(){this.N=!0;return this}ne(){this.c++;1===this.c&&this.db.D(Jh.js,this.j)}detach(){0<this.c?--this.c:this.db.D(Jh.rr,this.j,`Try to decrease references on instance ${this.j} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===this.c&&this.db.D(Jh.gn,
698
+ this.j)}clear(){this.forEach((a,b)=>{const c=b[0];if(c===U||c===V){const d=b.substring(1),e=c===U?V:U;a.forEach(f=>{const g=f.get(e+d);g.delete(this.j);0===g.size&&f.delete(e+d)})}c===Kh&&a instanceof olympe.dc.vc&&Zh(this.db.get(a.W()))});void 0!==this.D&&this.db.get(this.D.tag).delete(Kh+this.D.Ca)}create(a){const b=new Map;this.set(a,b);return b}};olympe.dc.db.Instance.j={aq:'instance',iw:'rel',Hi:'cb',fj:'ref',TRANSACTION:'tx'};olympe.dc.db.Jh=class a{constructor(b){this.Hc=b;this.R=this.Ha=null;this.Ob=olympe.dc.Lb.NONE;this.state=a.j.Xk;this.j=this.ob=this.Ub=this.X=this.properties=null}tag(){return this.Hc}Vb(){return this.R}jb(){return this.Ha}getState(){return this.state}wa(b){if(null===this.R)this.R=b;else if(this.R!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.R}`);return this}F(){return this.state===a.j.Dc?this.Ob:olympe.dc.Lb.NONE}create(b){this.state=a.j.Em;
699
+ this.Ha=null!=b?b:null;return this}delete(b=olympe.dc.Lb.NONE){this.state=a.j.Dc;this.Ob=b;this.properties=null;return this}ja(b,c){if(this.state===a.j.Dc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}qn(b){this.state!==a.j.Dc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}Md(b,c){if(null!==this.X&&this.X!==b)throw Error('An instance should never be set as complex property of multiple instances');this.X=b;this.Ub=
700
+ c}Z(b){let c;null==(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.fc.Zc&&this.wa(c);this.ra(this.ob,b,c,!0);return this}unlink(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.fc.Zc&&this.wa(c);this.ra(this.ob,b,c,!1);return this}vb(b,c){null===this.j&&(this.j=new Map);this.ra(this.j,b,c,!0)}Gc(b,c){null===this.j&&(this.j=new Map);this.ra(this.j,b,c,!1)}lb(b,c,d){if(c=c===olympe.dc.ta.ORIGIN?this.j:this.ob)return(b=
701
+ c.get(b))&&b.get(d)}H(b,c,d){const e=(c=c===olympe.dc.ta.ORIGIN?this.j:this.ob)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}D(){return this.state===a.j.Em}yd(){return this.state===a.j.Dc}hd(){let b=this.properties?this.properties.size:0,c;null==(c=this.ob)||c.forEach(d=>{b+=d.size});return b}N(){return null!==this.properties}Fd(){return null!==this.ob||null!==this.j}zb(){let b;return null!=(b=this.properties)?b:new Map}Pa(b){if(this.properties)return this.properties.get(b)}cb(b,c=(d,e)=>[d,
702
+ e]){return function*(d){if(d=d&&d.get(b.W()))for(const [e,f]of d)yield c(e,f)}(b.La()===olympe.dc.ta.ORIGIN?this.j:this.ob)}Ib(b){const c=b.La()===olympe.dc.ta.ORIGIN?this.j:this.ob;return(b=c&&c.get(b.W()))&&0!==b.size?Array.from(b.keys())[0]:null}Id(b=(c,d,e)=>[c,d,e]){return this.ia(this.ob,b)}Ua(b=(c,d,e)=>[c,d,e]){return this.ia(this.j,b)}ba(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.ta.ORIGIN,d=olympe.dc.ta.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>
703
+ b(h,c,k,l))}(this.ia.bind(this),this.ob,this.j)}ra(b,c,d,e){if(this.state!==a.j.Dc||!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*ia(b,c){if(null!==b)for(const [d,e]of b){b=e.entries();for(const [f,g]of b)yield c(d,f,g)}}};olympe.dc.db.Jh.j={Em:0,Xk:1,Dc:2};olympe.dc.db.Hv=class{constructor(a,b,c,d){this.G=a;this.view=b;this.j=c;(this.active=d.get('active'))&&this.init()}debug(a){const b=olympe.dc.ea(a);if(this.j.has(b)){var c=this.j.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ja()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.j.get(d[d.length-1]);const e=olympe.dc.db.Database.D.ej+olympe.dc.CloudObject.nameProp.W();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
704
+ ' (name: '+c.get(e)+') has no model.\nList: '+d.join(' --M--\x3e ')}this.G.info(a)}else this.G.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.j.op,b=olympe.dc.db.Database.j.hm,c=olympe.dc.db.Database.j.Dc,d=olympe.dc.db.Database.j.Ik,e=olympe.dc.db.Database.j.Wm,f=olympe.dc.db.Database.j.Lo,g=olympe.dc.db.Database.j.Mo,h=()=>{};this.j.j(olympe.dc.db.Database.j.np,()=>{});this.j.j(a,()=>{});this.j.j(b,k=>{this.j.vb(()=>{nh(this.view,
705
+ k,h,`monitorRelations${k}`)})});this.j.j(c,k=>{this.j.vb(()=>{oh(this.view,k,`monitorRelations${k}`)})});this.j.j(d,()=>{});this.j.j(e,()=>{});this.j.j(f,()=>{});this.j.j(g,()=>{})}};olympe.dc.db.hn=class{constructor(a,b,c,d){this.G=a;this.j=b;this.ha=c;this.F=d;this.transactionId=null}open(a){if(null!==this.transactionId)throw Error('A transaction is already open');this.transactionId=this.j.tg(a);this.G.debug(`DB Writer: transaction ${this.transactionId} opened`)}write(a,b){b&&(b=new bi(this.ha),a.qc(b),this.G.info(b.flush()));if(null===this.transactionId)throw Error('You must first open a transaction before to write');this.G.debug('DB Writer: writing patch',a.T(),'for transaction',
706
+ this.transactionId);this.j.ht(this.transactionId,()=>a.qc(this))}close(){if(null===this.transactionId)throw Error('No transaction is open');this.j.ke(this.transactionId);this.G.debug(`DB Writer: transaction ${this.transactionId} committed`);this.transactionId=null}Sc(a,b,c,d){this.j.create(a,b,c,this.F);d&&this.j.link(olympe.dc.fc.Zc,a,d)}Yc(a,b){this.j.update(a,b)}D(a,b=olympe.dc.Lb.NONE){for(const c of mg(this.ha,a,b))this.j.wa(c)}Oa(a,b,c){this.j.link(a,b,c)}hc(a,b,c){this.j.unlink(a,b,c)}};
707
+ function ci(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)if(d+=(d?', "':'"')+e+'":',!f)d+=JSON.stringify(f);else if(f instanceof olympe.dc.vc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.W()+'")';else if(f instanceof olympe.C.Color)d+='Color("'+f.oh()+','+f.lh()+','+f.hh()+','+f.gh()+'")';else if(f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString'))d+=JSON.stringify(f.toString());else if('object'===typeof f){let g;d+=ci(a,f,
708
+ (null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function di(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function ei(a,b){let c;return b===olympe.dc.fc.Zc?'Model':null!=(c=a.db.name(b))?c:b}
709
+ class bi{constructor(a){this.db=a;this.output='Applying patch on the local database'}flush(){const a=this.output;this.output='';return a}log(a,b){this.output+=`\ndb.${a};${b?`// ${b}`:''}`}Sc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${ci(this,c)})`,di(this,d))}Yc(a,b,c){this.log(`updateInstance(tag: ${a}, ${ci(this,b)})`,di(this,c))}D(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,di(this,c))}Oa(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,ei(this,a))}hc(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
710
+ ei(this,a))}}olympe.dc.db.hn.ya=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.P={Da:'dc.db.Logger',nm:'dc.db.gc.Logger',Fa:'dc.db.DatabaseManager',bk:'dc.db.Database',$l:'dc.db.DBView',QB:'dc.db.Graph',SA:'dc.db.DatabaseWriter',FC:'dc.db.PermissionProcessor',Yi:'dc.db.GraphMonitor'};olympe.dc.db.Config={Dp:'db.garbageCollector',Ep:'db.garbageCollectorDelay',Sl:'db.commitBufferTimeout',Yi:'db.monitor',Gv:'db.monitorCounters',Fv:'db.monitorCallbacks',fp:'db.debug'};
711
+ olympe.V.config(function(a){E(a,olympe.dc.db.Config.Dp,olympe.dc.db.Af.j.ko);E(a,olympe.dc.db.Config.Ep,5E3);E(a,olympe.dc.db.Config.Sl,3E4);E(a,olympe.dc.db.Config.Yi,!1);E(a,olympe.dc.db.Config.fp,!1);D(a,olympe.dc.db.P.Da,[olympe.ga.P.Fa],b=>b.ad('db'));D(a,olympe.dc.db.P.nm,[olympe.ga.P.Fa],b=>b.ad('gc'));D(a,olympe.dc.db.P.bk,[olympe.dc.db.P.Da,olympe.dc.db.P.nm,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.db.Config.Dp),new olympe.V.oa(olympe.dc.db.Config.Ep),new olympe.V.oa(olympe.dc.Config.Yh),
712
+ new olympe.V.oa(olympe.dc.db.Config.fp)],(b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.Af.j.em:e;d=(new Map).set('selfTag',d).set('garbageCollector',e).set('garbageCollectorDelay',f).set('debug',h);return new olympe.dc.db.Database(b,c,d)});C(a,olympe.dc.db.P.$l,olympe.dc.kb,olympe.dc.db.P.Da,olympe.dc.db.P.bk);D(a,olympe.dc.db.P.Yi,[olympe.dc.db.P.Fa],b=>b.zz);D(a,olympe.dc.db.P.Fa,[olympe.dc.db.P.Da,olympe.dc.db.P.bk,olympe.dc.db.P.$l,new olympe.V.oa(olympe.dc.Config.bg),new olympe.V.oa(olympe.dc.db.Config.Sl),
713
+ new olympe.V.oa(olympe.dc.db.Config.Yi),new olympe.V.oa(olympe.dc.db.Config.Gv),new olympe.V.oa(olympe.dc.db.Config.Fv)],(b,c,d,e,f,g,h,k)=>{g=(new Map).set('active',g).set('counters',h).set('callbacks',k);e=(new Map).set('debug',e).set('bufferTimeout',f);return new olympe.dc.db.lu(b,c,d,e,g)})},'olympe.dc.db');olympe.V.run([olympe.dc.db.P.bk,olympe.dc.db.P.Yi],(a,b)=>{olympe.de().db=a;olympe.de().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function fi(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
714
+ olympe.dc.query.xf=class{constructor(a,b,c){this.db=olympe.dc.ha();this.j=a;this.Ca=b;this.Wi=c}fa(){return{p:this.Ca.W(),o:this.Wi}}toString(){return'sortByQueryPart-'+this.Wi+this.Ca.W()}jh(){const a=this.db.Ib(this.Ca,olympe.dm.Property.typeRel),b=olympe.dc.ea;if(this.db.Vf(a,olympe.dm.String))return fi((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return fi((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return fi((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return fi((c,
715
+ d)=>c.compare(d));olympe.ga.Wa('dc.query').warn(`No comparator found for type with tag ${a}`);return fi(()=>-1)}Pa(){return this.Ca}};olympe.dc.Ye=class{W(){}};olympe.dc.Ye.prototype.getTag=olympe.dc.Ye.prototype.W;olympe.dc.TB=olympe.dc.Ye;function gi(a){let b;if(null==(b=a.j)?0:b.nf())if(a=a.N,!a.N){let c;null==(c=a.R)||c.call(a)}}function hi(a,b,c,d,e){gi(a);let f,g;b?null==(f=a.j)||f.Oa(c,d,e):null==(g=a.j)||g.hc(c,d,e)}function ii(a){let b;const c=!(null==(b=a.j)?0:b.nf());a.F=c?a.j:null;a.H.forEach(d=>d());a.H=[];c&&(a.j=new olympe.dc.db.ec,a.G.j()&&a.G.debug(`Commit notification with ${a.F.H()} operations for query ${a.D}`))}
716
+ olympe.dc.query.Nv=class{constructor(a,b,c,d){this.G=a;this.source=b;this.D=c;this.N=d;this.j=this.F=null;this.db=olympe.dc.ha();this.H=[]}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.D}:${a}:notif`;Pf(this.db,a,(d,e)=>{if(d){gi(this);let f;null==(f=this.j)||f.Z(e)}else if(b&&kh(this.db,e,c),!this.db.Ja(e)){gi(this);let f;null==(f=this.j)||f.D(e,olympe.dc.Lb.NONE)}},c);b&&jh(this.db,a,(d,e,f)=>{gi(this);let g;f||null!=(g=this.j)&&g.Yc(a,new Map([[d,e]]))},c)}}stop(a){this.H.push(()=>
717
+ Nf(this.db,a,`${this.D}:${a}:notif`))}};olympe.dc.query.Bk={ASC:'ASC',DESC:'DESC'};function ji(a){const b=ki(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].T():a.F,g=0<e?b[e-1].j:'root',h=0<e&&b[e-1].R(),k=a.j.get(f),l=new Set(k.Vc()),n=new Map,p=a.H.has(f);let q=p?';':'';if(c.has(f)){const [r,t,v]=c.get(f);c.delete(f);q+=v;r.forEach((x,y)=>{for(const z of k.j(y)){let A;n.set(z,Array.from(x).map(K=>p?`${y};${K}`:K).reduce((K,Y)=>K.add(Y),null!=(A=n.get(z))?A:new Set))}l.delete(y)});t&&l.forEach(x=>{const y=p?`${x};${v}`:v;for(const z of k.j(x)){let A;n.set(z,
716
718
  (null!=(A=n.get(z))?A:new Set).add(y))}})}else l.forEach(r=>{const t=p?`${r};`:'';for(const v of k.j(r))n.has(v)?n.get(v).add(t):n.set(v,(new Set).add(t))});if(0<e&&c.has(g)){const [r,t,v]=c.get(g),x=new Map;n.forEach((y,z)=>{let A;null==(A=r.get(z))||A.forEach(K=>{let Y;const ya=null!=(Y=x.get(z))?Y:new Set;y.forEach(db=>ya.add(db+K));x.set(z,ya)});n.delete(z);r.delete(z)});t&&n.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>A+v)))});b[e-1].R()&&r.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>
717
- q+A)))});c.set(g,[x,t&&h,q+v])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function ji(a){if(null===a.D){const b={Gb:a.query.jh(),Ld:a.Ld,max:a.query.j.max,offset:a.query.j.offset};a.D=olympe.dc.Ka.from(a.X,hi(a),b)}return a.D}function ki(a,b){a.R=b}function li(a){if(!a.N){null!==a.D&&(a.X=a.D);a.D=null;a.N=!0;let b;null==(b=a.R)||b.call(a)}}
718
- function mi(a,b){let c;return null!=(c=a.j.get(b).Uc())?c:[]}function ni(a,b,c){let d,e;return null!=(e=null==(d=a.j.get(c))?void 0:d.has(b))?e:!1}function oi(a,b,c=a.F,d='root'){const e=a.j.get(c);if(!e)return a.G.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.D(b,d)&&li(a);let g;f&&(null==(g=a.Se)||g.watch(b,a.H.has(c)));return f}function pi(a,b,c,d,e,f){null!==a.Se&&(d===olympe.dc.ua.ORIGIN?fi(a.Se,b,c,f,e):fi(a.Se,b,c,e,f))}
719
- function qi(a){a.G.j()&&a.G.debug(`Start sending notifications for query ${a.query.T()}`);const b=new olympe.dc.query.Mv(a.G,a.query.jb(),a.query.T(),a);a.j.forEach((c,d)=>{for(const e of c.Uc())b.watch(e,a.H.has(d))});null!=b.j||(b.j=new olympe.dc.db.ec);a.Se=b}function ri(a){null!==a.Se&&(a.G.j()&&a.G.debug(`Stop sending notifications for query ${a.query.T()}`),a.j.forEach(b=>{for(const c of b.Uc())a.Se.stop(c)}),a.Se=null)}function si(a){a.N=!1;let b;null==(b=a.Se)||gi(b)}
720
- olympe.dc.query.fr=class{constructor(a,b){this.G=a;this.query=b;this.F=olympe.U.rb(b.D);this.ma=new Map;this.j=(new Map).set(this.F,new olympe.dc.query.ma.Zm);this.H=new Set(b.F);this.Ld=-1;this.N=!1;this.R=null;this.X=olympe.dc.Ka.empty();this.Se=this.D=null;a=ii(b);a.forEach(c=>{const d=c.T();this.ma.set(d,c.N());this.j.set(d,c.ia())});b=b.jh();if(null!==b){b=b.j;let c=-1;for(const d of[this.F].concat(a.map(e=>e.T())))if(c+=this.H.has(d)?1:0,b===d){this.Ld=c;break}}}remove(a,b=this.F,c='root'){b=
721
- this.j.get(b);if(null==b?0:b.remove(a,c))if(li(this),!b.has(a)){let d;null==(d=this.Se)||d.stop(a);return!0}return!1}Hc(a){const b=a.D,c=olympe.U.rb(b);a=ii(a);const d=[];for(const [f,g]of this.j){if(g.H(b))return!0;g.has(b)&&d.push(f)}const e=(new Map).set(c,d);return 0<d.length&&a.every(f=>{let g;const h=(null!=(g=e.get(f.j))?g:[]).flatMap(k=>f.Z(k,this.ma.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.ma.get(k))?void 0:l.Hc(f))?n:!1});e.set(f.T(),h);return 0<h.length})}};function ti(a){if(!olympe.dc.ga().Nb(a,olympe.dm.Property))throw new olympe.dc.query.Cd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
722
- function ui(a){var b=olympe.dc.query.za.j.Yr;const c=olympe.dc.query.za.j.op,d=olympe.dc.query.za.j.Zj,e=olympe.dc.query.za.j.Zp,f=olympe.dc.query.za.j.Cq,g=olympe.dc.query.za.j.rr,h=olympe.dc.query.za.j.ho,k=olympe.dc.query.za.j.Uq,l=olympe.dc.query.za.j.Yp;switch(a.pr){case b:return new olympe.dc.query.Y.bn(a.t);case c:b=a.v;switch(a.t){case 2:b=new Date(b);break;case 3:b=olympe.dc.CloudObject.get(b);break;case 4:b=olympe.C.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.Y.Be(a.p,b,olympe.dc.ga());
723
- case d:return new olympe.dc.query.Y.xf(a.p,a.s,olympe.dc.ga(),a.c);case e:return new olympe.dc.query.Y.Ti(olympe.dc.ga(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Y.ie(ui(a.v));case g:return new olympe.dc.query.Y.Gf(a.p,new RegExp(a.r),olympe.dc.ga(),a.c);case k:return new olympe.dc.query.Y.Fe(...a.p.map(n=>ui(n)));case h:return new olympe.dc.query.Y.Nd(...a.p.map(n=>ui(n)));case l:return b=4===a.t?a.v.map(n=>olympe.C.Color.create(n.r,n.g,n.b,n.a)):3===a.t?a.v.map(n=>olympe.dc.CloudObject.get(n)):
724
- 2===a.t?a.v.map(n=>new Date(n)):a.v,new olympe.dc.query.Y.iq(a.p,b);default:return null}}
725
- olympe.dc.query.za=class{observe(){}lb(){}compile(){return[[this]]}zd(){return new olympe.dc.query.Y.ie(this)}zb(){}Hc(){}clear(){}fa(){}Mc(){}toString(){}Ea(a){return this===a}static dt(...a){return new olympe.dc.query.Y.bn(a)}static Wz(a,b){ti(a);return new olympe.dc.query.Y.iq(a,b)}static Ea(a,b){ti(a);return new olympe.dc.query.Y.Be(a,b,olympe.dc.ga())}static contains(a,b,c=!0){ti(a);return new olympe.dc.query.Y.xf(a,b,olympe.dc.ga(),c)}static $z(a,b,c=!0){ti(a);return new olympe.dc.query.Y.Gf(a,
726
- b,olympe.dc.ga(),c)}static nl(a,b,c=!0){ti(a);return new olympe.dc.query.Y.Ti(olympe.dc.ga(),a,b,!1,c)}static Pj(a,b,c=!0){ti(a);return new olympe.dc.query.Y.Ti(olympe.dc.ga(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.za))throw new olympe.dc.query.Cd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Y.Nd(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.za))throw new olympe.dc.query.Cd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
727
- return new olympe.dc.query.Y.Fe(...a)}static zd(a){if(!(a instanceof olympe.dc.query.za))throw new olympe.dc.query.Cd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.Y.ie(a)}};olympe.dc.query.za.not=olympe.dc.query.za.zd;olympe.dc.query.za.or=olympe.dc.query.za.or;olympe.dc.query.za.and=olympe.dc.query.za.and;olympe.dc.query.za.smallerThan=olympe.dc.query.za.Pj;olympe.dc.query.za.greaterThan=olympe.dc.query.za.nl;
728
- olympe.dc.query.za.regex=olympe.dc.query.za.$z;olympe.dc.query.za.contains=olympe.dc.query.za.contains;olympe.dc.query.za.equals=olympe.dc.query.za.Ea;olympe.dc.query.za.propertyIn=olympe.dc.query.za.Wz;olympe.dc.query.za['in']=olympe.dc.query.za.dt;olympe.dc.query.za.j={Yr:0,op:1,Zj:2,Zp:3,Cq:4,rr:5,Uq:6,ho:7,Yp:8};function ii(a){return Array.from(a.ma)}
729
- function vi(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Ib(c,c.La()===olympe.dc.ua.ORIGIN?e:d);if(0>a.cursor)e=a.j.Te;else if(e=a.ma[a.cursor],null!==e.sa)e=e.sa;else{var f=olympe.dc.ua.ORIGIN;e=olympe.dc.ga().Ib(e.relation,e.relation.La()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(a.db.Ja(olympe.dc.CloudObject)&&(null===d||!a.db.Tf(d,e)&&!a.db.Tf(e,d)))throw new olympe.dc.query.Cd(`The specified relation "${c}" is invalid at the current level "${a.db.name(e)} (${e})" of the Query you are building. Please make sure you did not forget a .back() or another relation.`);d=
730
- b.T();for(c=a.cursor+1;c<a.ma.length&&a.ma[c].T()!==d;)c++;b=c<a.ma.length?a.ma:a.ma.concat(b);return new olympe.dc.la(a.D,a.source,b,c,a.F,a.j)}function wi(a,b=a.cursor){return 0<=b?a.ma[b].T():olympe.U.rb(a.D)}
731
- function xi(a,b,c,d={}){var e=olympe.dc.Lb.jg;const f=(null==d?0:d.ld)?d.ld:olympe.dc.la.nc.vf,g=(null==d?0:d.ao)?'__code-as-data__':void 0;b=olympe.dc.ea(b);const h=olympe.dc.ee().Qe(b);b=(new olympe.dc.la(b,h)).me();b.ma=[f===olympe.dc.la.nc.Qg?new olympe.dc.query.ma.im(wi(b),e,c):new olympe.dc.query.ma.Od(wi(b),e,c)];let k;b.H=null!=(k=null==d?void 0:d.ft)?k:!1;return b.observe(a,{ld:f,cl:g})}
732
- function yi(a){const b=0===a.F.size?a.me():a;if(null!==b.j.Ld&&!b.F.has(wi(a,b.j.Ld)))throw new olympe.dc.query.Cd('AndReturn was not called for the current level before sortBy operator');return b}function zi(a,b){let c,d;return b.H||(null!=(d=null==(c=a.N)?void 0:c.has(b.T()))?d:!1)}
733
- olympe.dc.la=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Ld:null,Te:null}){this.db=olympe.dc.ga();if('string'!==typeof a||''===a)throw new olympe.dc.query.Cd('The root of the query cannot be empty.');this.D=a;this.source=b;this.ma=c;this.cursor=d;this.F=e;this.j=f;this.N=this.id=null;this.H=!1}static from(a,b){a=olympe.dc.ea(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.Cd(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);
734
- b=null!=b?b:olympe.dc.ee().Qe(a);b=new olympe.dc.la(a,b);b.j.Te=olympe.dc.ga().model(a);return b}static Qe(a,b,c){if(!olympe.dc.CloudObject.exists(b)&&!c)throw new olympe.dc.query.Cd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ea(a);c=null!=c?c:olympe.dc.ee().fromModel(b);c=new olympe.dc.la(a,c);c.j.Te=olympe.dc.ea(b);return c}static pl(a,b=!0,c){const d=olympe.dc.ea(a);var e=olympe.dc.ga();if(!e.vi(d))throw new olympe.dc.query.Cd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);
735
- a=null!=c?c:olympe.dc.ee().fromModel(d);a=new olympe.dc.la(d,a);a.j.Te=e.model(d);b&&(a=vi(a,new olympe.dc.query.ma.Ce(wi(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.ma.Hh(wi(a),olympe.dc.CloudObject.instancesRel,!1);e.sa=d;return vi(b,e)}static Ob(a,b,c,d,e){var f;const g=null!=(f=null==e?void 0:e.ld)?f:olympe.dc.la.nc.vf;f=(null==e?0:e.ao)?'__code-as-data__':void 0;b=olympe.dc.ea(b);d=null!=d?d:olympe.dc.ee().Qe(b);d=(new olympe.dc.la(b,d)).me();b=g===olympe.dc.la.nc.Qg;
736
- d.ma=[b?new olympe.dc.query.ma.im(wi(d),c):new olympe.dc.query.ma.Od(wi(d),c)];let h;d.H=null!=(h=null==e?void 0:e.ft)?h:!1;let k;return d.observe(a,{ld:g,cl:f,rj:null!=(k=null==e?void 0:e.rj)?k:b})}bb(a,b=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.Cd(`The relation given to follow() is invalid: ${a}`);return vi(this,new olympe.dc.query.ma.Hh(wi(this),a,b))}ug(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.Cd(`The relation given to followRecursively() is invalid: ${a}`);
737
- return vi(this,new olympe.dc.query.ma.Ce(wi(this),a,b,c))}me(){const a=(new Set(this.F)).add(wi(this));return new olympe.dc.la(this.D,this.source,this.ma,this.cursor,a,this.j)}filter(a){if(!(a instanceof olympe.dc.query.za))throw new olympe.dc.query.Cd(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.ma);b[this.cursor]=b[this.cursor].filter(a);return new olympe.dc.la(this.D,this.source,b,this.cursor,this.F,this.j)}sj(){return this}Hj(a,b=0){return new olympe.dc.la(this.D,
738
- this.source,this.ma,this.cursor,this.F,{Ld:this.j.Ld,max:a,offset:b,Te:this.j.Te})}xl(a,b=olympe.dc.query.Bk.ASC){if(0>this.cursor)throw new olympe.dc.query.Cd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');if(!olympe.dc.ga().Nb(a,olympe.dm.Property))throw new olympe.dc.query.Cd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.ma[this.cursor],d={Ld:this.cursor,max:this.j.max,offset:this.j.offset,Te:this.j.Te},
739
- e=Array.from(this.ma);e[this.cursor]=c.sort(a,b);return new olympe.dc.la(this.D,this.source,e,this.cursor,this.F,d)}jh(){const a=this.j.Ld;let b;return null!==a?null==(b=this.ma[a])?void 0:b.jh():null}back(a=1){if(0>this.cursor||1>a)return this;let b=this.cursor;for(let c=0;c<a;c++){const d=this.ma[b].j;for(b--;-1<b&&wi(this,b)!==d;)b--}return new olympe.dc.la(this.D,this.source,Array.from(this.ma),b,this.F,this.j)}parse(){const a=new Map,b=wi(this,-1),c={limit:this.j.max,offset:this.j.offset,returned:this.F.has(b),
740
- filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.vi(this.D)?c.dataType=olympe.dc.ea(this.D):(c.root=olympe.dc.ea(this.D),c.dataType=this.j.Te);this.ma.forEach((d,e)=>{const f=d.T(),g=d.Mc();Object.assign(g,{returned:this.F.has(f),next:[]});a.set(f,g);g.sort&&this.j.Ld!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.ma.Hh&&d.relation.Ea(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.ma.Ce&&d.relation.Ea(olympe.dc.CloudObject.extendedByRel))Object.assign(c,
741
- g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}lb(a){const b=(null==a?0:a.ld)?a.ld:olympe.dc.la.nc.Ck;let c;return olympe.dc.query.ml().executeQuery(yi(this),b,{ii:null!=(c=null==a?void 0:a.cl)?c:null==a?void 0:a.cacheId,Bc:null==a?void 0:a.Bc}).then(d=>{let e;return null!=(e=null==d?void 0:ji(d))?e:olympe.dc.Ka.empty()})}Cc(){return ji(Ai(olympe.dc.query.ml(),yi(this)))}observe(a,b){const c=(null==b?0:b.ld)?b.ld:olympe.dc.la.nc.vf;a='function'===typeof a.Cb?a.Cb():
742
- a;let d;return Bi(olympe.dc.query.ml(),yi(this),a,olympe.dc.Ia.SELF,c,{ii:null!=(d=null==b?void 0:b.cl)?d:null==b?void 0:b.cacheId,Bc:null==b?void 0:b.Bc,rj:null==b?void 0:b.rj}).pipe(rxjs.operators.map(e=>ji(e)),rxjs.operators.distinctUntilChanged())}T(){null===this.id&&(this.id=olympe.U.rb(this.D+ii(this).map(a=>a.H()).join()+Array.from(new Set(this.F)).sort().toString()+this.j.Ld+this.j.max+this.j.offset));return this.id}jb(){return this.source}fa(){let a;return{b:this.D,p:this.ma.map(b=>b.fa()),
743
- r:Array.from(this.F),s:this.source,e:{m:this.j.max,o:this.j.offset,s:this.j.Ld,rm:null!=(a=this.j.Te)?a:this.db.model(this.D)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ja(this.D)?olympe.dc.CloudObject.get(this.D):this.D,relations:this.ma.map(a=>a.toJSON())}}};olympe.dc.la.prototype.observe=olympe.dc.la.prototype.observe;olympe.dc.la.prototype.executeFromCache=olympe.dc.la.prototype.Cc;olympe.dc.la.prototype.execute=olympe.dc.la.prototype.lb;
744
- olympe.dc.la.prototype.parse=olympe.dc.la.prototype.parse;olympe.dc.la.prototype.back=olympe.dc.la.prototype.back;olympe.dc.la.prototype.sortBy=olympe.dc.la.prototype.xl;olympe.dc.la.prototype.limit=olympe.dc.la.prototype.Hj;olympe.dc.la.prototype.cast=olympe.dc.la.prototype.sj;olympe.dc.la.prototype.filter=olympe.dc.la.prototype.filter;olympe.dc.la.prototype.andReturn=olympe.dc.la.prototype.me;olympe.dc.la.prototype.followRecursively=olympe.dc.la.prototype.ug;olympe.dc.la.prototype.follow=olympe.dc.la.prototype.bb;
745
- olympe.dc.la.followRule=olympe.dc.la.Ob;olympe.dc.la.instancesOf=olympe.dc.la.pl;olympe.dc.la.fromTag=olympe.dc.la.Qe;olympe.dc.la.from=olympe.dc.la.from;olympe.dc.la.nc={vf:1,Ck:2,Qg:3};olympe.dc.la.j={Ml:'cacheBucketName',gq:'isCacheable'};function Ci(a){null===a.Ga&&null===a.j&&(a.Ga=Wf(a.F))}
746
- olympe.dc.query.Dd=class extends olympe.dc.Hg{constructor(a){super(a,null);this.F=new olympe.dc.transaction.He}static xj(a){const b=new olympe.dc.query.Dd(`DataResult_${a.T()}`);b.D=a.jb();return b}static j(a){const b=new olympe.dc.query.Dd(a.i);let c;b.D=null!=(c=a.s)?c:null;let d;b.dl=null!=(d=a.t)?d:null;let e;b.Ga=null!=(e=a.p)?e:[];return b}qc(a){Ci(this);return super.qc(a)}ac(){Ci(this);return super.ac()}jl(){Ci(this);return super.jl()}create(a,b,c){this.F.Rc(a,this.D,c,b);return this}Oa(a,
747
- b,c){this.F.Oa(a,b,c,null,null);return this}fa(){return super.fa()}};olympe.dc.query.Dd.prototype.createRelation=olympe.dc.query.Dd.prototype.Oa;olympe.dc.query.Dd.prototype.create=olympe.dc.query.Dd.prototype.create;olympe.dc.query.Dd.fromQuery=olympe.dc.query.Dd.xj;function Ai(a,b){const c=new olympe.dc.query.fr(a.G,b);if(a.D.view.Ja(b.D)){oi(c,b.D);for(const d of ii(b))d.lb(c)}return c}
748
- function Bi(a,b,c,d,e,f){const g=b.T();let h=a.j.get(g);if(!h){var k=b.jb();a.G.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.Bc||a.H&&k===olympe.dc.Ia.SERVER?[]:Array.from(a.j.values());h=new olympe.dc.query.nr(a.G,a.D,b,e,a.R.bind(a,e,f));a.j.set(g,h);Di(h,l=>a.F.add(l));h.start(k)&&(null==f?0:f.ii)&&Ei(a,b,e,f).catch(l=>{a.G.error(`Was not able to get the result of the subscribed query ${g} to add it to the cache: ${l}`)})}return new rxjs.Observable(l=>
749
- {const n=()=>{p&&c.mt(p);l.complete();if(q){var r=q;const v=a.j.get(g);a.G.debug(`${d} unsubscribed from ${g}`);if(null==v)r=0;else{var t=v;t.H.delete(r)&&t.G.debug(`Remove subscriber ${d} for query ${t.query.T()}, now have ${t.H.size} subscribers`);d!==olympe.dc.Ia.SELF&&(t.Z--,0===t.Z&&ri(t.j));r=0===t.H.size}r&&(a.G.debug(`No more subscriber to ${g}, remove the subscription`),a.F.delete(g),a.j.delete(g),v.destroy())}},p=c.Xd(n),q=Fi(h,d,l);return n})}
750
- function Gi(a){a.F.forEach(b=>{let c;null==(c=a.j.get(b))||Hi(c)});a.F.clear()}function Ii(a,b,c,d){return u(function*(){const e=null!=d?d:c===olympe.dc.la.nc.Qg;if(b instanceof ReadableStream)yield Qg(a.D,b,{pn:e});else{var f;if(f=b instanceof olympe.dc.Hg)f=b.T(),f=!a.N.H.has(f);f&&a.D.md(b,{pn:e})}})}function Ji(a){a.G.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.j.Jg,olympe.dc.Ia.SERVER);return a.Jb.request(b).then(c=>{a.D.md(c)})}
751
- function Ki(a,b){const c=b.jb();if(c===olympe.dc.Ia.SELF||a.H&&c===olympe.dc.Ia.SERVER)return Promise.resolve(!0);a=Array.from(a.j.values()).filter(d=>d.Hc(b)).map(d=>new Promise(e=>d.jd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function Ei(a,b,c,d){return u(function*(){var e=b.jb();e=Rf(Rf(new olympe.dc.Request(olympe.dc.Request.j.Sg,e,b),olympe.dc.la.j.gq,c===olympe.dc.la.nc.Qg),olympe.dc.la.j.Ml,null==d?void 0:d.ii);return a.Jb.request(e)})}
752
- function Li(a,b,c){const d=[];for(const e of a.j.values())Mi(e,b,c)&&d.push(Ei(a,e.query,olympe.dc.la.nc.Ck,{}).then(f=>Ii(a,f,olympe.dc.la.nc.Ck)));return Promise.all(d).then(()=>{})}
753
- olympe.dc.query.dw=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Jb=d;this.H=e;this.j=new Map;this.F=new Set;Rg(b,()=>Gi(this));Uf(d,olympe.dc.Request.j.ck,f=>{Ii(this,f.content,olympe.dc.la.nc.vf).catch(g=>this.G.error(`Error while applying data notification on DB: ${g}`))})}executeQuery(a,b,c){const d=this;return u(function*(){const e='boolean'===typeof c.Bc?c.Bc:yield Ki(d,a);if(!e||(null==c?0:c.ii))try{const f=yield Ei(d,a,b,c);e||(yield Ii(d,f,b))}catch(f){return d.G.error(`Error while sending a query to data source ${a.jb()}: ${f}`),
754
- null}return Ai(d,a)})}R(a,b,c,d,e,f){const g=c.jb();if(g===olympe.dc.Ia.SELF||b.Bc||this.H&&g===olympe.dc.Ia.SERVER)return e(),null;if(a!==olympe.dc.la.nc.vf)return Ei(this,c,a,b).then(r=>{var t=r;r instanceof ReadableStream&&(t=(t=d())?r.pipeThrough(t):r);return Ii(this,t,a,b.rj)}).then(e).catch(f),null;let h,k=!1;const l=r=>{h=[];r&&this.G.debug(`Resend subscription ${c.T()} after detection of dead subscription in the remote service`);Ei(this,c,a,b).then(t=>{if(k)return this.G.warn(`Received data result after query subscription ${c.T()} has been destroyed. Could happen with queries observed multiple times successively quickly.`),
755
- Promise.resolve();var v=t;t instanceof ReadableStream&&(v=(v=d())?t.pipeThrough(v):t);return Ii(this,v,a,b.rj).then(()=>{h.forEach(x=>Ii(this,x,a))}).finally(()=>{h=null})}).then(e).catch(f)},n=c.T();l(!1);const p=Rf(new olympe.dc.Request(olympe.dc.Request.j.Gk,g,c),olympe.dc.la.j.Ml,null==b?void 0:b.ii),q=this.Jb.subscribe(p,l.bind(this,!0)).pipe(sb(olympe.error.Np,()=>{},0)).pipe(sb(olympe.error.Ho,(r,t)=>{this.G.debug(`Data Provider: Subscribe to topic ${r.T()} now that we are back online, after waiting for ${t}ms`);
756
- l(!0)},0)).subscribe(rxjs.Subscriber.create(r=>{Array.isArray(h)?h.push(r):Ii(this,r,a)},r=>{this.G.error(`An error occurred with the subscription ${n}: ${r}`);f(String(r))}));return()=>{k=!0;this.G.debug(`Unsubscribe to query ${n} from data source ${g}`);q.unsubscribe()}}};function Ni(a){const b=olympe.dc.ga();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ja(g)?olympe.dc.CloudObject.get(g):(olympe.ha.Xa('dc.query').error(`CloudObject with tag ${g} not present but required for deserialization`),c=!0,null));return[e,1===f.length?f[0]:f]});return c?null:olympe.dc.Ka.create(d,a.a,a.r)}
719
+ q+A)))});c.set(g,[x,t&&h,q+v])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function li(a){if(null===a.D){const b={Gb:a.query.jh(),Ld:a.Ld,max:a.query.j.max,offset:a.query.j.offset};a.D=olympe.dc.Ka.from(a.X,ji(a),b)}return a.D}function mi(a,b){a.R=b}function ni(a){if(!a.N){null!==a.D&&(a.X=a.D);a.D=null;a.N=!0;let b;null==(b=a.R)||b.call(a)}}
720
+ function oi(a,b){let c;return null!=(c=a.j.get(b).Vc())?c:[]}function pi(a,b,c){let d,e;return null!=(e=null==(d=a.j.get(c))?void 0:d.has(b))?e:!1}function qi(a,b,c=a.F,d='root'){const e=a.j.get(c);if(!e)return a.G.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.D(b,d)&&ni(a);let g;f&&(null==(g=a.Se)||g.watch(b,a.H.has(c)));return f}function ri(a,b,c,d,e,f){null!==a.Se&&(d===olympe.dc.ta.ORIGIN?hi(a.Se,b,c,f,e):hi(a.Se,b,c,e,f))}
721
+ function si(a){a.G.j()&&a.G.debug(`Start sending notifications for query ${a.query.T()}`);const b=new olympe.dc.query.Nv(a.G,a.query.jb(),a.query.T(),a);a.j.forEach((c,d)=>{for(const e of c.Vc())b.watch(e,a.H.has(d))});null!=b.j||(b.j=new olympe.dc.db.ec);a.Se=b}function ti(a){null!==a.Se&&(a.G.j()&&a.G.debug(`Stop sending notifications for query ${a.query.T()}`),a.j.forEach(b=>{for(const c of b.Vc())a.Se.stop(c)}),a.Se=null)}function ui(a){a.N=!1;let b;null==(b=a.Se)||ii(b)}
722
+ olympe.dc.query.gr=class{constructor(a,b){this.G=a;this.query=b;this.F=olympe.U.rb(b.D);this.ma=new Map;this.j=(new Map).set(this.F,new olympe.dc.query.ma.bn);this.H=new Set(b.F);this.Ld=-1;this.N=!1;this.R=null;this.X=olympe.dc.Ka.empty();this.Se=this.D=null;a=ki(b);a.forEach(c=>{const d=c.T();this.ma.set(d,c.N());this.j.set(d,c.ia())});b=b.jh();if(null!==b){b=b.j;let c=-1;for(const d of[this.F].concat(a.map(e=>e.T())))if(c+=this.H.has(d)?1:0,b===d){this.Ld=c;break}}}remove(a,b=this.F,c='root'){b=
723
+ this.j.get(b);if(null==b?0:b.remove(a,c))if(ni(this),!b.has(a)){let d;null==(d=this.Se)||d.stop(a);return!0}return!1}Ic(a){const b=a.D,c=olympe.U.rb(b);a=ki(a);const d=[];for(const [f,g]of this.j){if(g.H(b))return!0;g.has(b)&&d.push(f)}const e=(new Map).set(c,d);return 0<d.length&&a.every(f=>{let g;const h=(null!=(g=e.get(f.j))?g:[]).flatMap(k=>f.Z(k,this.ma.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.ma.get(k))?void 0:l.Ic(f))?n:!1});e.set(f.T(),h);return 0<h.length})}};function vi(a){if(!olympe.dc.ha().Nb(a,olympe.dm.Property))throw new olympe.dc.query.Cd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
724
+ function wi(a){var b=olympe.dc.query.za.j.Zr;const c=olympe.dc.query.za.j.pp,d=olympe.dc.query.za.j.Zj,e=olympe.dc.query.za.j.$p,f=olympe.dc.query.za.j.Dq,g=olympe.dc.query.za.j.sr,h=olympe.dc.query.za.j.io,k=olympe.dc.query.za.j.Vq,l=olympe.dc.query.za.j.Zp;switch(a.pr){case b:return new olympe.dc.query.Y.en(a.t);case c:b=a.v;switch(a.t){case 2:b=new Date(b);break;case 3:b=olympe.dc.CloudObject.get(b);break;case 4:b=olympe.C.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.Y.Ce(a.p,b,olympe.dc.ha());
725
+ case d:return new olympe.dc.query.Y.yf(a.p,a.s,olympe.dc.ha(),a.c);case e:return new olympe.dc.query.Y.Ti(olympe.dc.ha(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Y.ie(wi(a.v));case g:return new olympe.dc.query.Y.Hf(a.p,new RegExp(a.r),olympe.dc.ha(),a.c);case k:return new olympe.dc.query.Y.Ge(...a.p.map(n=>wi(n)));case h:return new olympe.dc.query.Y.Nd(...a.p.map(n=>wi(n)));case l:return b=4===a.t?a.v.map(n=>olympe.C.Color.create(n.r,n.g,n.b,n.a)):3===a.t?a.v.map(n=>olympe.dc.CloudObject.get(n)):
726
+ 2===a.t?a.v.map(n=>new Date(n)):a.v,new olympe.dc.query.Y.jq(a.p,b);default:return null}}
727
+ olympe.dc.query.za=class{observe(){}mb(){}compile(){return[[this]]}zd(){return new olympe.dc.query.Y.ie(this)}zb(){}Ic(){}clear(){}fa(){}Nc(){}toString(){}Ea(a){return this===a}static dt(...a){return new olympe.dc.query.Y.en(a)}static Xz(a,b){vi(a);return new olympe.dc.query.Y.jq(a,b)}static Ea(a,b){vi(a);return new olympe.dc.query.Y.Ce(a,b,olympe.dc.ha())}static contains(a,b,c=!0){vi(a);return new olympe.dc.query.Y.yf(a,b,olympe.dc.ha(),c)}static aA(a,b,c=!0){vi(a);return new olympe.dc.query.Y.Hf(a,
728
+ b,olympe.dc.ha(),c)}static nl(a,b,c=!0){vi(a);return new olympe.dc.query.Y.Ti(olympe.dc.ha(),a,b,!1,c)}static Pj(a,b,c=!0){vi(a);return new olympe.dc.query.Y.Ti(olympe.dc.ha(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.za))throw new olympe.dc.query.Cd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Y.Nd(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.za))throw new olympe.dc.query.Cd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
729
+ return new olympe.dc.query.Y.Ge(...a)}static zd(a){if(!(a instanceof olympe.dc.query.za))throw new olympe.dc.query.Cd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.Y.ie(a)}};olympe.dc.query.za.not=olympe.dc.query.za.zd;olympe.dc.query.za.or=olympe.dc.query.za.or;olympe.dc.query.za.and=olympe.dc.query.za.and;olympe.dc.query.za.smallerThan=olympe.dc.query.za.Pj;olympe.dc.query.za.greaterThan=olympe.dc.query.za.nl;
730
+ olympe.dc.query.za.regex=olympe.dc.query.za.aA;olympe.dc.query.za.contains=olympe.dc.query.za.contains;olympe.dc.query.za.equals=olympe.dc.query.za.Ea;olympe.dc.query.za.propertyIn=olympe.dc.query.za.Xz;olympe.dc.query.za['in']=olympe.dc.query.za.dt;olympe.dc.query.za.j={Zr:0,pp:1,Zj:2,$p:3,Dq:4,sr:5,Vq:6,io:7,Zp:8};function ki(a){return Array.from(a.ma)}
731
+ function xi(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Ib(c,c.La()===olympe.dc.ta.ORIGIN?e:d);if(0>a.cursor)e=a.j.Te;else if(e=a.ma[a.cursor],null!==e.wa)e=e.wa;else{var f=olympe.dc.ta.ORIGIN;e=olympe.dc.ha().Ib(e.relation,e.relation.La()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(a.db.Ja(olympe.dc.CloudObject)&&(null===d||!a.db.Vf(d,e)&&!a.db.Vf(e,d)))throw new olympe.dc.query.Cd(`The specified relation "${c}" is invalid at the current level "${a.db.name(e)} (${e})" of the Query you are building. Please make sure you did not forget a .back() or another relation.`);d=
732
+ b.T();for(c=a.cursor+1;c<a.ma.length&&a.ma[c].T()!==d;)c++;b=c<a.ma.length?a.ma:a.ma.concat(b);return new olympe.dc.la(a.D,a.source,b,c,a.F,a.j)}function yi(a,b=a.cursor){return 0<=b?a.ma[b].T():olympe.U.rb(a.D)}
733
+ function zi(a,b,c,d={}){var e=olympe.dc.Lb.kg;const f=(null==d?0:d.md)?d.md:olympe.dc.la.nc.wf,g=(null==d?0:d.bo)?'__code-as-data__':void 0;b=olympe.dc.ea(b);const h=olympe.dc.ee().pe(b);b=(new olympe.dc.la(b,h)).me();b.ma=[f===olympe.dc.la.nc.Qg?new olympe.dc.query.ma.mm(yi(b),e,c):new olympe.dc.query.ma.Od(yi(b),e,c)];let k;b.H=null!=(k=null==d?void 0:d.ft)?k:!1;return b.observe(a,{md:f,cl:g})}
734
+ function Ai(a){const b=0===a.F.size?a.me():a;if(null!==b.j.Ld&&!b.F.has(yi(a,b.j.Ld)))throw new olympe.dc.query.Cd('AndReturn was not called for the current level before sortBy operator');return b}function Bi(a,b){let c,d;return b.H||(null!=(d=null==(c=a.N)?void 0:c.has(b.T()))?d:!1)}
735
+ olympe.dc.la=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Ld:null,Te:null}){this.db=olympe.dc.ha();if('string'!==typeof a||''===a)throw new olympe.dc.query.Cd('The root of the query cannot be empty.');this.D=a;this.source=b;this.ma=c;this.cursor=d;this.F=e;this.j=f;this.N=this.id=null;this.H=!1}static from(a,b){a=olympe.dc.ea(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.Cd(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);
736
+ b=null!=b?b:olympe.dc.ee().pe(a);b=new olympe.dc.la(a,b);b.j.Te=olympe.dc.ha().model(a);return b}static pe(a,b,c){if(!olympe.dc.CloudObject.exists(b)&&!c)throw new olympe.dc.query.Cd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ea(a);c=null!=c?c:olympe.dc.ee().fromModel(b);c=new olympe.dc.la(a,c);c.j.Te=olympe.dc.ea(b);return c}static ql(a,b=!0,c){const d=olympe.dc.ea(a);var e=olympe.dc.ha();if(!e.vi(d))throw new olympe.dc.query.Cd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);
737
+ a=null!=c?c:olympe.dc.ee().fromModel(d);a=new olympe.dc.la(d,a);a.j.Te=e.model(d);b&&(a=xi(a,new olympe.dc.query.ma.De(yi(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.ma.Hh(yi(a),olympe.dc.CloudObject.instancesRel,!1);e.wa=d;return xi(b,e)}static Ob(a,b,c,d,e){var f;const g=null!=(f=null==e?void 0:e.md)?f:olympe.dc.la.nc.wf;f=(null==e?0:e.bo)?'__code-as-data__':void 0;b=olympe.dc.ea(b);d=null!=d?d:olympe.dc.ee().pe(b);d=(new olympe.dc.la(b,d)).me();b=g===olympe.dc.la.nc.Qg;
738
+ d.ma=[b?new olympe.dc.query.ma.mm(yi(d),c):new olympe.dc.query.ma.Od(yi(d),c)];let h;d.H=null!=(h=null==e?void 0:e.ft)?h:!1;let k;return d.observe(a,{md:g,cl:f,rj:null!=(k=null==e?void 0:e.rj)?k:b})}bb(a,b=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.Cd(`The relation given to follow() is invalid: ${a}`);return xi(this,new olympe.dc.query.ma.Hh(yi(this),a,b))}ug(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.Cd(`The relation given to followRecursively() is invalid: ${a}`);
739
+ return xi(this,new olympe.dc.query.ma.De(yi(this),a,b,c))}me(){const a=(new Set(this.F)).add(yi(this));return new olympe.dc.la(this.D,this.source,this.ma,this.cursor,a,this.j)}filter(a){if(!(a instanceof olympe.dc.query.za))throw new olympe.dc.query.Cd(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.ma);b[this.cursor]=b[this.cursor].filter(a);return new olympe.dc.la(this.D,this.source,b,this.cursor,this.F,this.j)}sj(){return this}Hj(a,b=0){return new olympe.dc.la(this.D,
740
+ this.source,this.ma,this.cursor,this.F,{Ld:this.j.Ld,max:a,offset:b,Te:this.j.Te})}Al(a,b=olympe.dc.query.Bk.ASC){if(0>this.cursor)throw new olympe.dc.query.Cd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');if(!olympe.dc.ha().Nb(a,olympe.dm.Property))throw new olympe.dc.query.Cd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.ma[this.cursor],d={Ld:this.cursor,max:this.j.max,offset:this.j.offset,Te:this.j.Te},
741
+ e=Array.from(this.ma);e[this.cursor]=c.sort(a,b);return new olympe.dc.la(this.D,this.source,e,this.cursor,this.F,d)}jh(){const a=this.j.Ld;let b;return null!==a?null==(b=this.ma[a])?void 0:b.jh():null}back(a=1){if(0>this.cursor||1>a)return this;let b=this.cursor;for(let c=0;c<a;c++){const d=this.ma[b].j;for(b--;-1<b&&yi(this,b)!==d;)b--}return new olympe.dc.la(this.D,this.source,Array.from(this.ma),b,this.F,this.j)}parse(){const a=new Map,b=yi(this,-1),c={limit:this.j.max,offset:this.j.offset,returned:this.F.has(b),
742
+ filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.vi(this.D)?c.dataType=olympe.dc.ea(this.D):(c.root=olympe.dc.ea(this.D),c.dataType=this.j.Te);this.ma.forEach((d,e)=>{const f=d.T(),g=d.Nc();Object.assign(g,{returned:this.F.has(f),next:[]});a.set(f,g);g.sort&&this.j.Ld!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.ma.Hh&&d.relation.Ea(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.ma.De&&d.relation.Ea(olympe.dc.CloudObject.extendedByRel))Object.assign(c,
743
+ g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}mb(a){const b=(null==a?0:a.md)?a.md:olympe.dc.la.nc.Ck;let c;return olympe.dc.query.ml().executeQuery(Ai(this),b,{ii:null!=(c=null==a?void 0:a.cl)?c:null==a?void 0:a.cacheId,Bc:null==a?void 0:a.Bc}).then(d=>{let e;return null!=(e=null==d?void 0:li(d))?e:olympe.dc.Ka.empty()})}Cc(){return li(Ci(olympe.dc.query.ml(),Ai(this)))}observe(a,b){const c=(null==b?0:b.md)?b.md:olympe.dc.la.nc.wf;a='function'===typeof a.Cb?a.Cb():
744
+ a;let d;return Di(olympe.dc.query.ml(),Ai(this),a,olympe.dc.Ia.SELF,c,{ii:null!=(d=null==b?void 0:b.cl)?d:null==b?void 0:b.cacheId,Bc:null==b?void 0:b.Bc,rj:null==b?void 0:b.rj}).pipe(rxjs.operators.map(e=>li(e)),rxjs.operators.distinctUntilChanged())}T(){null===this.id&&(this.id=olympe.U.rb(this.D+ki(this).map(a=>a.H()).join()+Array.from(new Set(this.F)).sort().toString()+this.j.Ld+this.j.max+this.j.offset));return this.id}jb(){return this.source}fa(){let a;return{b:this.D,p:this.ma.map(b=>b.fa()),
745
+ r:Array.from(this.F),s:this.source,e:{m:this.j.max,o:this.j.offset,s:this.j.Ld,rm:null!=(a=this.j.Te)?a:this.db.model(this.D)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ja(this.D)?olympe.dc.CloudObject.get(this.D):this.D,relations:this.ma.map(a=>a.toJSON())}}};olympe.dc.la.prototype.observe=olympe.dc.la.prototype.observe;olympe.dc.la.prototype.executeFromCache=olympe.dc.la.prototype.Cc;olympe.dc.la.prototype.execute=olympe.dc.la.prototype.mb;
746
+ olympe.dc.la.prototype.parse=olympe.dc.la.prototype.parse;olympe.dc.la.prototype.back=olympe.dc.la.prototype.back;olympe.dc.la.prototype.sortBy=olympe.dc.la.prototype.Al;olympe.dc.la.prototype.limit=olympe.dc.la.prototype.Hj;olympe.dc.la.prototype.cast=olympe.dc.la.prototype.sj;olympe.dc.la.prototype.filter=olympe.dc.la.prototype.filter;olympe.dc.la.prototype.andReturn=olympe.dc.la.prototype.me;olympe.dc.la.prototype.followRecursively=olympe.dc.la.prototype.ug;olympe.dc.la.prototype.follow=olympe.dc.la.prototype.bb;
747
+ olympe.dc.la.followRule=olympe.dc.la.Ob;olympe.dc.la.instancesOf=olympe.dc.la.ql;olympe.dc.la.fromTag=olympe.dc.la.pe;olympe.dc.la.from=olympe.dc.la.from;olympe.dc.la.nc={wf:1,Ck:2,Qg:3};olympe.dc.la.j={Pl:'cacheBucketName',hq:'isCacheable'};function Ei(a){null===a.Ga&&null===a.j&&(a.Ga=Yf(a.F))}
748
+ olympe.dc.query.Dd=class extends olympe.dc.Hg{constructor(a){super(a,null);this.F=new olympe.dc.transaction.Ie}static xj(a){const b=new olympe.dc.query.Dd(`DataResult_${a.T()}`);b.D=a.jb();return b}static j(a){const b=new olympe.dc.query.Dd(a.i);let c;b.D=null!=(c=a.s)?c:null;let d;b.dl=null!=(d=a.t)?d:null;let e;b.Ga=null!=(e=a.p)?e:[];return b}qc(a){Ei(this);return super.qc(a)}ac(){Ei(this);return super.ac()}jl(){Ei(this);return super.jl()}create(a,b,c){this.F.Sc(a,this.D,c,b);return this}Oa(a,
749
+ b,c){this.F.Oa(a,b,c,null,null);return this}fa(){return super.fa()}};olympe.dc.query.Dd.prototype.createRelation=olympe.dc.query.Dd.prototype.Oa;olympe.dc.query.Dd.prototype.create=olympe.dc.query.Dd.prototype.create;olympe.dc.query.Dd.fromQuery=olympe.dc.query.Dd.xj;function Ci(a,b){const c=new olympe.dc.query.gr(a.G,b);if(a.D.view.Ja(b.D)){qi(c,b.D);for(const d of ki(b))d.mb(c)}return c}
750
+ function Di(a,b,c,d,e,f){const g=b.T();let h=a.j.get(g);if(!h){var k=b.jb();a.G.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.Bc||a.H&&k===olympe.dc.Ia.SERVER?[]:Array.from(a.j.values());h=new olympe.dc.query.qr(a.G,a.D,b,e,a.R.bind(a,e,f));a.j.set(g,h);Fi(h,l=>a.F.add(l));h.start(k)&&(null==f?0:f.ii)&&Gi(a,b,e,f).catch(l=>{a.G.error(`Was not able to get the result of the subscribed query ${g} to add it to the cache: ${l}`)})}return new rxjs.Observable(l=>
751
+ {const n=()=>{p&&c.mt(p);l.complete();if(q){var r=q;const v=a.j.get(g);a.G.debug(`${d} unsubscribed from ${g}`);if(null==v)r=0;else{var t=v;t.H.delete(r)&&t.G.debug(`Remove subscriber ${d} for query ${t.query.T()}, now have ${t.H.size} subscribers`);d!==olympe.dc.Ia.SELF&&(t.Z--,0===t.Z&&ti(t.j));r=0===t.H.size}r&&(a.G.debug(`No more subscriber to ${g}, remove the subscription`),a.F.delete(g),a.j.delete(g),v.destroy())}},p=c.Xd(n),q=Hi(h,d,l);return n})}
752
+ function Ii(a){a.F.forEach(b=>{let c;null==(c=a.j.get(b))||Ji(c)});a.F.clear()}function Ki(a,b,c,d){return u(function*(){const e=null!=d?d:c===olympe.dc.la.nc.Qg;if(b instanceof ReadableStream)yield Sg(a.D,b,{sn:e});else{var f;if(f=b instanceof olympe.dc.Hg)f=b.T(),f=!a.N.H.has(f);f&&a.D.nd(b,{sn:e})}})}function Li(a){a.G.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.j.Jg,olympe.dc.Ia.SERVER);return a.Jb.request(b).then(c=>{a.D.nd(c)})}
753
+ function Mi(a,b){const c=b.jb();if(c===olympe.dc.Ia.SELF||a.H&&c===olympe.dc.Ia.SERVER)return Promise.resolve(!0);a=Array.from(a.j.values()).filter(d=>d.Ic(b)).map(d=>new Promise(e=>d.kd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function Gi(a,b,c,d){return u(function*(){var e=b.jb();e=Tf(Tf(new olympe.dc.Request(olympe.dc.Request.j.Sg,e,b),olympe.dc.la.j.hq,c===olympe.dc.la.nc.Qg),olympe.dc.la.j.Pl,null==d?void 0:d.ii);return a.Jb.request(e)})}
754
+ function Ni(a,b,c){const d=[];for(const e of a.j.values())Oi(e,b,c)&&d.push(Gi(a,e.query,olympe.dc.la.nc.Ck,{}).then(f=>Ki(a,f,olympe.dc.la.nc.Ck)));return Promise.all(d).then(()=>{})}
755
+ olympe.dc.query.ew=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Jb=d;this.H=e;this.j=new Map;this.F=new Set;Tg(b,()=>Ii(this));Wf(d,olympe.dc.Request.j.ck,f=>{Ki(this,f.content,olympe.dc.la.nc.wf).catch(g=>this.G.error(`Error while applying data notification on DB: ${g}`))})}executeQuery(a,b,c){const d=this;return u(function*(){const e='boolean'===typeof c.Bc?c.Bc:yield Mi(d,a);if(!e||(null==c?0:c.ii))try{const f=yield Gi(d,a,b,c);e||(yield Ki(d,f,b))}catch(f){return d.G.error(`Error while sending a query to data source ${a.jb()}: ${f}`),
756
+ null}return Ci(d,a)})}R(a,b,c,d,e,f){const g=c.jb();if(g===olympe.dc.Ia.SELF||b.Bc||this.H&&g===olympe.dc.Ia.SERVER)return e(),null;if(a!==olympe.dc.la.nc.wf)return Gi(this,c,a,b).then(r=>{var t=r;r instanceof ReadableStream&&(t=(t=d())?r.pipeThrough(t):r);return Ki(this,t,a,b.rj)}).then(e).catch(f),null;let h,k=!1;const l=r=>{h=[];r&&this.G.debug(`Resend subscription ${c.T()} after detection of dead subscription in the remote service`);Gi(this,c,a,b).then(t=>{if(k)return this.G.warn(`Received data result after query subscription ${c.T()} has been destroyed. Could happen with queries observed multiple times successively quickly.`),
757
+ Promise.resolve();var v=t;t instanceof ReadableStream&&(v=(v=d())?t.pipeThrough(v):t);return Ki(this,v,a,b.rj).then(()=>{h.forEach(x=>Ki(this,x,a))}).finally(()=>{h=null})}).then(e).catch(f)},n=c.T();l(!1);const p=Tf(new olympe.dc.Request(olympe.dc.Request.j.Gk,g,c),olympe.dc.la.j.Pl,null==b?void 0:b.ii),q=this.Jb.subscribe(p,l.bind(this,!0)).pipe(sb(olympe.error.Op,()=>{},0)).pipe(sb(olympe.error.Io,(r,t)=>{this.G.debug(`Data Provider: Subscribe to topic ${r.T()} now that we are back online, after waiting for ${t}ms`);
758
+ l(!0)},0)).subscribe(rxjs.Subscriber.create(r=>{Array.isArray(h)?h.push(r):Ki(this,r,a)},r=>{this.G.error(`An error occurred with the subscription ${n}: ${r}`);f(String(r))}));return()=>{k=!0;this.G.debug(`Unsubscribe to query ${n} from data source ${g}`);q.unsubscribe()}}};function Pi(a){const b=olympe.dc.ha();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ja(g)?olympe.dc.CloudObject.get(g):(olympe.ga.Wa('dc.query').error(`CloudObject with tag ${g} not present but required for deserialization`),c=!0,null));return[e,1===f.length?f[0]:f]});return c?null:olympe.dc.Ka.create(d,a.a,a.r)}
757
759
  olympe.dc.Ka=class{constructor(){this.j=[];this.D=new Map;this.F=[];this.H=[];this.hash=''}static empty(){return new olympe.dc.Ka}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.j.length&&(b=this.j[a],b={value:[b,this.D.get(b)],done:!1},a++);return b}}}entries(){return this.j.map(a=>[a,this.D.get(a)])}values(){return this.D.values()}keys(){return this.j.values()}Ue(){return this.j.map(a=>this.D.get(a))}size(){return this.j.length}has(a){return this.D.has(a)||this.Ue().includes(a)}indexOf(a){return null===
758
- a||void 0===a?-1:'string'===typeof a?this.j.indexOf(a):this.Ue().indexOf(a)}get(a){return(a=this.D.get(a))?a:null}Ic(){return this.pe(0)}pe(a){return a<this.j.length?this.D.get(this.j[a]):null}push(...a){const b=this.Ue();b.push(...a);return b}pop(){if(0===this.j.length)return[];const a=this.Ue();a.pop();return a}shift(){if(0<this.j.length){const a=this.Ue();a.shift();return a}return[]}filter(a){return this.Ue().filter(a)}find(a){return(a=this.Ue().find(a))?a:null}forEach(a){this.j.forEach((b,c)=>
760
+ a||void 0===a?-1:'string'===typeof a?this.j.indexOf(a):this.Ue().indexOf(a)}get(a){return(a=this.D.get(a))?a:null}Jc(){return this.qe(0)}qe(a){return a<this.j.length?this.D.get(this.j[a]):null}push(...a){const b=this.Ue();b.push(...a);return b}pop(){if(0===this.j.length)return[];const a=this.Ue();a.pop();return a}shift(){if(0<this.j.length){const a=this.Ue();a.shift();return a}return[]}filter(a){return this.Ue().filter(a)}find(a){return(a=this.Ue().find(a))?a:null}forEach(a){this.j.forEach((b,c)=>
759
761
  a(this.D.get(b),c))}map(a){return this.Ue().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Ka.create(b,Array.from(this.F),Array.from(this.H))}reduce(a,b){return this.Ue().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.F);for(const d of a)c=c.concat(d.F.map(e=>e+c.length));a=this.H.concat(...a.map(d=>d.H));return olympe.dc.Ka.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Ue()}yj(){return this.F.map(a=>
760
- this.D.get(this.j[a]))}Ej(){return this.H.map(a=>{a=a.split('.');return 1===a.length?a[0]:a})}static from(a,b,{Gb:c,Ld:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ga(),q=c.Wi===olympe.dc.query.Bk.ASC?1:-1,r=c.jh(),t=c.Pa();b.sort((v,x)=>{x=x[d];v=p.Pa(v[d],t);x=p.Pa(x,t);return null===v?-q:null===x?q:q*r(olympe.dc.ib.tc(v),olympe.dc.ib.tc(x))})}else b.sort((p,q)=>p.reduce((r,t,v)=>r||t.localeCompare(q[v]),0));if(0<e||-1<f)b=b.slice(e,-1<f?e+f:void 0);c=olympe.U.rb(b.flat().join(''));
762
+ this.D.get(this.j[a]))}Ej(){return this.H.map(a=>{a=a.split('.');return 1===a.length?a[0]:a})}static from(a,b,{Gb:c,Ld:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ha(),q=c.Wi===olympe.dc.query.Bk.ASC?1:-1,r=c.jh(),t=c.Pa();b.sort((v,x)=>{x=x[d];v=p.Pa(v[d],t);x=p.Pa(x,t);return null===v?-q:null===x?q:q*r(olympe.dc.ib.tc(v),olympe.dc.ib.tc(x))})}else b.sort((p,q)=>p.reduce((r,t,v)=>r||t.localeCompare(q[v]),0));if(0<e||-1<f)b=b.slice(e,-1<f?e+f:void 0);c=olympe.U.rb(b.flat().join(''));
761
763
  if(c===a.hash)return a;const g=p=>''===p?null:olympe.dc.CloudObject.get(p);e=b.map(p=>[p.join('.'),1===p.length?g(p[0]):p.map(g)]);const h=new Set(e.map(p=>p[0])),k=new Set(a.keys()),l=[],n=[];e.forEach(([p],q)=>{!k.has(p)&&l.push(q)});k.forEach(p=>{!h.has(p)&&n.push(p)});return olympe.dc.Ka.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Ka;e.j=a.map(f=>f[0]);e.D=new Map(a);e.hash=d||olympe.U.rb(e.j.join(''));e.F=b||e.j.map((f,g)=>g);e.H=c||[];return e}fa(a){a&&this.j.flatMap(b=>b.split('.')).forEach(a);
762
764
  return{k:this.j,a:this.F,r:this.H}}};olympe.dc.Ka.prototype.getRemoved=olympe.dc.Ka.prototype.Ej;olympe.dc.Ka.prototype.getAdded=olympe.dc.Ka.prototype.yj;olympe.dc.Ka.prototype.concat=olympe.dc.Ka.prototype.concat;olympe.dc.Ka.prototype.reduce=olympe.dc.Ka.prototype.reduce;olympe.dc.Ka.prototype.sort=olympe.dc.Ka.prototype.sort;olympe.dc.Ka.prototype.map=olympe.dc.Ka.prototype.map;olympe.dc.Ka.prototype.forEach=olympe.dc.Ka.prototype.forEach;olympe.dc.Ka.prototype.find=olympe.dc.Ka.prototype.find;
763
- olympe.dc.Ka.prototype.filter=olympe.dc.Ka.prototype.filter;olympe.dc.Ka.prototype.shift=olympe.dc.Ka.prototype.shift;olympe.dc.Ka.prototype.pop=olympe.dc.Ka.prototype.pop;olympe.dc.Ka.prototype.push=olympe.dc.Ka.prototype.push;olympe.dc.Ka.prototype.getAt=olympe.dc.Ka.prototype.pe;olympe.dc.Ka.prototype.getFirst=olympe.dc.Ka.prototype.Ic;olympe.dc.Ka.prototype.get=olympe.dc.Ka.prototype.get;olympe.dc.Ka.prototype.indexOf=olympe.dc.Ka.prototype.indexOf;olympe.dc.Ka.prototype.has=olympe.dc.Ka.prototype.has;
764
- olympe.dc.Ka.prototype.size=olympe.dc.Ka.prototype.size;olympe.dc.Ka.prototype.toArray=olympe.dc.Ka.prototype.Ue;olympe.dc.Ka.prototype.keys=olympe.dc.Ka.prototype.keys;olympe.dc.Ka.prototype.values=olympe.dc.Ka.prototype.values;olympe.dc.Ka.prototype.entries=olympe.dc.Ka.prototype.entries;olympe.dc.Ka.empty=olympe.dc.Ka.empty;function Oi(a){return 1<a.size()?(olympe.ha.Xa('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Ic()||null}olympe.dc.rd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.rd(olympe.dc.la.from(a))}bb(a){return new olympe.dc.rd(this.query.bb(a))}sj(){return this}lb(a){return this.query.lb(a).then(b=>Oi(b))}Cc(){return Oi(this.query.Cc())}};olympe.dc.rd.prototype.executeFromCache=olympe.dc.rd.prototype.Cc;
765
- olympe.dc.rd.prototype.execute=olympe.dc.rd.prototype.lb;olympe.dc.rd.prototype.cast=olympe.dc.rd.prototype.sj;olympe.dc.rd.prototype.follow=olympe.dc.rd.prototype.bb;const Pi=olympe.dc.ua.ORIGIN,Qi=olympe.dc.ua.DESTINATION;function Di(a,b){ki(a.j,()=>{a.fb()||null!==a.D||b(a.query.T())})}function Fi(a,b,c){const d=a.da;a.da++;a.H.set(d,c);b===olympe.dc.Ia.SELF?a.jd(e=>e?c.error(e):c.next(a.j)):(a.Z++,1===a.Z&&a.jd(()=>qi(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.H.size} subscribers`);return d}
766
- function Mi(a,b,c){if(a.query.jb()!==b)return!1;c.qc(a.ia);(b=a.ia.flush())&&a.G.debug(`Subscription ${a.query.T()} is considered as obsolete after the transaction ${c.T()} applied on DB`);return b}function Hi(a){si(a.j);a.H.forEach(b=>{b.next(a.j)})}
767
- function Ri(a,b,c){const d=[];let e=!1;const f=new olympe.async.Dk(olympe.C.kh());for(const g of b)if(g.Hc(a.query)&&(e||(e=!0),f.add(h=>g.jd(k=>{!k&&d.push(g);h()}))),null!==g.D&&zi(a.query,g.query)){let h;null==(h=a.R)||h.push(g)}td(f,g=>c(g?d:[]));f.start();return e}
768
- function Si(a){const b=a.query.T(),c=new Map,d=q=>{const r=c.get(q);return r?1===r.size?Array.from(r)[0]:(t,v,x,y)=>r.forEach(z=>z(t,v,x,y)):()=>{}},e=ii(a.query),f=a.j;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.T(),t=g.j;g=g.observe(f,d(r));let v;c.set(t,(null!=(v=c.get(t))?v:new Set).add(g))}const h=a.db,k=a.query.D,l=olympe.U.rb(k),n=Nf(h,k,(q,r)=>{q?oi(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.X)||p.push(()=>{Lf(h,k,n)});Ti(a)}
769
- function Ui(a){const b=a.Ha(a.query,a.Wa.bind(a),()=>{null===a.D||a.fb()||Si(a)},d=>{a.fb()||(a.G.error(`Error while getting data from data source (${a.query.jb()}) to ensure coverage of the query ${a.query.T()}: ${d}`),Ti(a))});let c;b&&(null==(c=a.X)||c.push(b))}function Vi(a,b){a.N.delete(b);0===a.N.size&&(a.N=null,Promise.resolve().then(()=>{!a.fb()&&Ui(a)}))}function Ti(a){const b=a.D;a.D=null;null==b||b.forEach(c=>c())}
770
- olympe.dc.query.nr=class{constructor(a,b,c,d,e){this.G=a;this.sa=b;this.db=b.view;this.query=c;this.ld=d;this.j=new olympe.dc.query.fr(this.G,c);this.Z=0;this.da=1;this.X=[];this.H=new Map;this.D=[()=>si(this.j)];this.Ha=e;this.ia=new Wi(a,this.db,c,this.j);this.F=this.N=null;this.R=[]}start(a){return Ri(this,a,b=>{0<b.length?(this.N=new Set(b),this.N.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),Si(this)):Ui(this)})}Hc(a){return!this.fb()&&this.query.jb()===a.jb()&&(this.query.T()===a.T()||
771
- (null===this.D||this.query.D===a.D)&&this.j.Hc(a))}jd(a){null!==this.D?this.D.push(a):a();return this}destroy(a){a?this.G.error(`Destroy subscription ${this.query.T()} after error: ${a}`):this.G.debug(`Destroy subscription ${this.query.T()}`);const b=this.X;this.X=null;this.H.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>Vi(e,this));let d;null==(d=this.N)||d.forEach(e=>{e.F.delete(this);0===e.F.size&&(e.F=null)});b.forEach(e=>e())}fb(){return null===this.X}Wa(){const a=
772
- olympe.dc.la.nc.Qg;if(this.ld===a)return olympe.U.stream.tap(c=>{c=c.jl().filter(e=>e.o===olympe.dc.Oc.j).map(e=>e.t);this.sa.ne(c,'Batch mode');const d=ii(this.query)[0];d instanceof olympe.dc.query.ma.im&&c.forEach(e=>oi(this.j,e,d.T(),d.j))});let b;if(0<(null==(b=this.R)?void 0:b.length)){const c=this.R.filter(e=>e.ld===a).map(e=>new Promise(f=>e.jd(f))),d=this.R.filter(e=>e.ld!==a).map(e=>new Promise(f=>e.jd(f)));this.R=void 0;return new TransformStream({start:()=>Promise.all(c),flush:()=>Promise.all(d)})}return null}};
773
- function Xi(a,b){return a.F.has(Qi+b)||a.F.has(Pi+b)}
774
- class Wi{constructor(a,b,c,d){this.G=a;this.db=b;this.H=d;this.R=[];this.N=-1<c.j.max||0<c.j.offset;this.F=new Map;this.j=!1;const e=new Map;for(const f of ii(c)){a=f.T();this.R.push(a);if(f instanceof olympe.dc.query.ma.Wh){a=f.relation;a=`${a.La()}${a.W()}`;let g;b=null!=(g=this.F.get(a))?g:[];b.push(f);this.F.set(a,b)}Yi(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.T());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.j;this.j=!1;return a}Rc(){}Xc(a,b){if(!(this.j||
775
- !this.N&&this.db.Ja(a))){var c;this.j||(this.j=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&ni(this.H,a,e)))}}D(a){this.j||this.db.Ja(a)&&!this.N||this.j||(this.j=this.R.some(b=>ni(this.H,a,b)))}Oa(a,b,c){if(!this.j&&Xi(this,a)){var d=this.db.Ja(b),e=this.db.Ja(c);if(d&&!e||!d&&e){const f=this.F.get(Qi+a);a=this.F.get(Pi+a);this.j||(this.j=d&&(null==f?void 0:f.some(g=>ni(this.H,b,g.j)))||e&&(null==a?void 0:a.some(g=>ni(this.H,c,g.j))))}}}hc(a,b,c){if(!this.j&&this.N&&Xi(this,a)&&this.db.gt(b,
776
- new olympe.dc.Ra.Relation(a),c)){const d=this.F.get(Qi+a);a=this.F.get(Pi+a);const e=this.H;this.j||(this.j=(null==d?void 0:d.some(f=>ni(e,b,f.j)&&ni(e,c,f.T())))||(null==a?void 0:a.some(f=>ni(e,c,f.j)&&ni(e,b,f.T()))))}}}olympe.dc.query.nr.ya=[olympe.dc.Writable];function Zi(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
777
- olympe.dc.query.Relation=class extends olympe.dc.Ra.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.W())+', ';a+='"direction": '+JSON.stringify(this.La())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a,b){return new olympe.dc.query.Relation(a.W(),a.La(),null!=b?b:a instanceof olympe.dc.aa.Ke)}$b(){const a=
778
- olympe.dc.ua.DESTINATION,b=olympe.dc.ua.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}T(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.P={Ca:'dc.query.Logger',Fk:'dc.query.QueryProcessor'};olympe.V.config(function(a){D(a,olympe.dc.query.P.Ca,[olympe.ha.P.Fa],b=>b.ad('query'));C(a,olympe.dc.query.P.Fk,olympe.dc.query.dw,olympe.dc.query.P.Ca,olympe.dc.db.P.Fa,olympe.dc.transaction.P.Fa,olympe.dc.P.Ug,new olympe.V.oa(olympe.dc.Config.Yh))});olympe.V.run([olympe.dc.query.P.Fk],a=>{olympe.dc.query.ml=()=>a});olympe.dc.query.Cd=class extends Error{};olympe.dc.query.Y={};olympe.dc.query.Y.Nd=class extends olympe.dc.query.za{constructor(...a){super();this.Y=a}compile(){return this.Y.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}zd(){return new olympe.dc.query.Y.Fe(...this.Y.map(a=>a.zd()))}zb(){return this.Y.flatMap(a=>a.zb())}Hc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}lb(a){return this.Y.reduce((b,c)=>b&&c.lb(a),!0)}observe(a,b,c){const d=
779
- Array(this.Y.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.Y.forEach((g,h)=>{g.observe(a,olympe.U.rb('AND-'+b+a+h),f.bind(null,h))})}fa(){return{pr:olympe.dc.query.za.j.ho,p:this.Y.map(a=>a.fa())}}Mc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Y.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.U.rb('AND-'+b+a+d))})}};olympe.dc.query.Y.xf=class extends olympe.dc.query.za{constructor(a,b,c,d=!1){super();this.Da=olympe.dc.ea(a);this.substring=b;this.db=c;this.j=d}zb(){return[this.Da]}Hc(a,b){return a instanceof olympe.dc.query.Y.xf&&a.Da===this.Da?b?a.j?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.j?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Pa(){return this.Da}lb(a){return this.apply(this.db.Pa(a,
780
- this.Da))}observe(a,b,c){fh(this.db,a,this.Da,d=>{c(this.apply(d))},olympe.U.rb(b+a+this.toString()))}apply(a){a=olympe.dc.ib.tc(a);return'string'===typeof a?this.j?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.Da+'-'+this.substring+'-'+this.j}clear(a,b){gh(this.db,a,this.Da,olympe.U.rb(b+a+this.toString()))}Mc(){return{name:'CONTAINS',property:this.Pa(),value:this.substring,caseSensitive:this.j}}fa(){return{pr:olympe.dc.query.za.j.Zj,
781
- p:this.Da,s:this.substring,c:this.j}}};olympe.dc.query.Y.Be=class extends olympe.dc.query.za{constructor(a,b,c){super();this.Da=olympe.dc.ea(a);this.j=olympe.dc.ib.tc(null!=b?b:null);this.db=c}zb(){return[this.Da]}Hc(a){if(a instanceof olympe.dc.query.Y.Be&&this.Da===a.Da)if('object'===typeof this.j&&null!==this.j){if(this.j instanceof olympe.dc.CloudObject)return this.j.Ea(a.j);if(this.j instanceof Date)return a.j instanceof Date&&this.j.getTime()===a.j.getTime();if(this.j instanceof olympe.C.Color)return this.j.Ea(a.j)}else return this.j===
782
- a.j;return!1}lb(a){return this.apply(this.db.Pa(a,this.Da))}observe(a,b,c){fh(this.db,a,this.Da,d=>{c(this.apply(d))},olympe.U.rb(b+a+this.toString()));null===this.j&&null===this.db.Pa(a,this.Da)&&c(!0)}clear(a,b){gh(this.db,a,this.Da,olympe.U.rb(b+a+this.toString()))}apply(a){a=olympe.dc.ib.tc(a);return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Ea(this.j):a instanceof Date?this.j instanceof Date&&this.j.getTime()===a.getTime():a instanceof olympe.C.Color?a.Ea(this.j):!1:a===
783
- this.j}toString(){let a,b;const c=null!=(b=null==(a=this.j)?void 0:a.toString())?b:'null';return'Equals-'+this.Da+'-'+c}Mc(){return{name:'EQUALS',property:this.Da,value:this.j}}fa(){let a=1,b=this.j;switch(!0){case this.j instanceof Date:a=2;b=this.j.toJSON();break;case this.j instanceof olympe.dc.CloudObject:a=3;b=this.j.W();break;case this.j instanceof olympe.C.Color:a=4,b=this.j.toJSON()}return{pr:olympe.dc.query.za.j.op,p:this.Da,t:a,v:b}}};olympe.dc.query.Y.iq=class extends olympe.dc.query.za{constructor(a,b){var c=olympe.dc.ga();super();this.Da=olympe.dc.ea(a);this.values=b.map(d=>olympe.dc.ib.tc(null!=d?d:null));this.db=c}zb(){return[this.Da]}Hc(){return!1}lb(a){return this.apply(this.db.Pa(a,this.Da))}observe(a,b,c){fh(this.db,a,this.Da,d=>{c(this.apply(d))},olympe.U.rb(b+a+this.toString()))}clear(a,b){gh(this.db,a,this.Da,olympe.U.rb(b+a+this.toString()))}apply(a){const b=olympe.dc.ib.tc(a);return'object'===typeof b&&null!==b?b instanceof
784
- olympe.dc.CloudObject||b instanceof olympe.C.Color?this.values.some(c=>b.Ea(c)):b instanceof Date?this.values.some(c=>c instanceof Date&&c.getTime()===b.getTime()):!1:this.values.includes(b)}toString(){const a=this.values.map(b=>{let c;return null!=(c=null==b?void 0:b.toString())?c:'null'}).join('');return'In-'+this.Da+'-'+a}Mc(){return{name:'IN',property:this.Da,values:this.values}}fa(){var a,b=null!=(a=this.values[0])?a:null;a=b instanceof olympe.C.Color?4:b instanceof olympe.dc.CloudObject?3:b instanceof
785
- Date?2:1;b=4===a||2===a?this.values.map(c=>c.toJSON()):3===a?this.values.map(c=>c.W()):this.values;return{pr:olympe.dc.query.za.j.Yp,p:this.Da,t:a,v:b}}};function $i(a,b,c){return olympe.U.rb(c+b+a.j+a.Da)}
786
- olympe.dc.query.Y.Ti=class extends olympe.dc.query.za{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Da=olympe.dc.ea(b);this.j=(this.F=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.ea(c):c;this.D=d;this.H=e}zd(){return new olympe.dc.query.Y.Ti(this.db,this.Da,this.j,!this.D,!this.H)}zb(){return[this.Da]}Hc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Y.Ti&&this.Da===a.Da?
787
- typeof this.j!==typeof a.j||this.D!==a.D?!1:this.F?this.j===a.j:this.D&&this.j>=a.j||!this.D&&this.j<=a.j:!1}Pa(){return this.Da}lb(a){return this.compare(this.db.Pa(a,this.Da),this.F?this.db.Pa(a,this.j):this.j)}observe(a,b,c){this.F&&fh(this.db,a,this.j,d=>{const e=this.db.Pa(a,this.Da);null!==e&&c(this.compare(e,d))},$i(this,a,b));fh(this.db,a,this.Da,d=>{const e=this.F?this.db.Pa(a,this.j):this.j;c(null!==e?this.compare(d,e):!0)},$i(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.H?
788
- this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){gh(this.db,a,this.Da,$i(this,a,b));this.F&&gh(this.db,a,this.j,$i(this,a,b))}Mc(){return{name:'INEQUALITY_OPERATOR',property:this.Pa(),operator:this.D?'<':'>',strict:this.H,value:this.j}}fa(){return{pr:olympe.dc.query.za.j.Zp,p:this.Da,b:this.j,l:this.D,s:this.H}}toString(){return(this.D?'LowerThan-':'GreaterThan-')+this.Da+'-'+this.H+'-'+this.j}};olympe.dc.query.Y.ie=class extends olympe.dc.query.za{constructor(a){super();this.j=a}compile(){const a=this.j.zd();return this.Ea(a)?super.compile():a.compile()}zd(){return this.j}zb(){return this.j.zb()}Hc(a,b){return a instanceof olympe.dc.query.Y.ie?this.j.Hc(a.j,b):this.j.Hc(a,!b)}lb(a){return!this.j.lb(a)}observe(a,b,c){let d=null;this.j.observe(a,olympe.U.rb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Mc(){return{name:'NOT',predicate:this.j.Mc()}}fa(){return{pr:olympe.dc.query.za.j.Cq,v:this.j.fa()}}toString(){return`NOT-${this.j.toString()}`}clear(a,
789
- b){this.j.clear(a,olympe.U.rb('NOT'+b+a))}Ea(a){return a instanceof olympe.dc.query.Y.ie?this.j.Ea(a.j):!1}};olympe.dc.query.Y.Fe=class extends olympe.dc.query.za{constructor(...a){super();this.Y=a}compile(){return this.Y.map(a=>a.compile()).flat()}zd(){return new olympe.dc.query.Y.Nd(...this.Y.map(a=>a.zd()))}zb(){return this.Y.flatMap(a=>a.zb())}Hc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}lb(a){return this.Y.reduce((b,c)=>b||c.lb(a),!1)}observe(a,b,c){const d=Array(this.Y.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
790
- k);e!==g&&(e=g,c(g))};this.Y.forEach((g,h)=>{g.observe(a,olympe.U.rb('OR-'+b+a+h),f.bind(null,h))})}Mc(){throw Error('toObject for OR predicate should not be called');}fa(){return{pr:olympe.dc.query.za.j.Uq,p:this.Y.map(a=>a.fa())}}toString(){return'And-'+this.Y.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.U.rb('OR-'+b+a+d))})}};olympe.dc.query.Y.Gf=class extends olympe.dc.query.za{constructor(a,b,c,d=!0){super();this.Da=olympe.dc.ea(a);this.j='string'===typeof b?new RegExp(d?b:b.toLowerCase()):d?b:new RegExp(b.source.toLowerCase());this.db=c;this.D=d}zb(){return[this.Da]}Hc(a){return a instanceof olympe.dc.query.Y.Gf&&this.Da===a.Da&&this.j.toString()===a.j.toString()}lb(a){return this.apply(this.db.Pa(a,this.Da))}observe(a,b,c){fh(this.db,a,this.Da,d=>{c(this.apply(d))},olympe.U.rb(b+a+this.toString()))}apply(a){a=olympe.dc.ib.tc(a);
791
- return'string'===typeof a?(a=this.j.test(this.D?a:a.toLowerCase()),this.j.lastIndex=0,a):!1}toString(){return'Regex'+this.Da+'-'+this.j.toString()+'-'+this.D}Mc(){return{name:'REGEX',property:this.Da,pattern:this.j,caseSensitive:this.D}}fa(){return{pr:olympe.dc.query.za.j.rr,p:this.Da,r:this.j.source,c:this.D}}clear(a,b){gh(this.db,a,this.Da,olympe.U.rb(b+a+this.toString()))}};olympe.dc.query.Y.bn=class extends olympe.dc.query.za{constructor(a){super();this.j=new Set(a.map(olympe.dc.ea))}zb(){return[]}Hc(a){return a instanceof olympe.dc.query.Y.bn&&Array.from(a.j).every(b=>this.j.has(b))}lb(a){return this.j.has(a)}observe(a,b,c){c(this.j.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.j)}Mc(){return{name:'IS',tags:Array.from(this.j)}}fa(){return{pr:olympe.dc.query.za.j.Yr,t:Array.from(this.j)}}};olympe.dc.query.ma={};function Yi(a){let b,c;const d=new Set(null!=(c=null==(b=a.D)?void 0:b.zb())?c:[]);let e;a.Gb&&d.add(null==(e=a.Gb)?void 0:e.Pa().W());return d}function aj(a){if(!a.da){let b,c;a.da=null!=(c=null==(b=a.D)?void 0:b.compile())?c:[]}return a.da}function bj(a,b){for(const c of b)if(a.some(d=>d.Hc(c,!1)))return!0;return!1}
792
- function cj(a,b){if(null===a.D)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.U.rb(h+f+d);e?a.D.observe(f,k,l=>{c||b(l,f,g,k)}):(c=!0,a.D.clear(f,k),c=!1,b(!1,f,g,k))}}function dj(a,b,c){if(null===a.Gb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Gb.Pa();h=olympe.U.rb(h+d);e?fh(a.db,f,k,()=>{li(b)},h):gh(a.db,f,k,h);c(e,f,g,h)}}
793
- olympe.dc.query.ma.Pm=class{constructor(a,b){this.db=olympe.dc.ga();this.j=a;this.optional=b;this.da=this.Gb=this.D=this.id=null}static j(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.ma.Od(b,a.f);var c=a.o;const d=new olympe.dc.Ra.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.ma.Ce(b,d,a.s,c):new olympe.dc.query.ma.Hh(b,d,c);void 0!==a.p&&(b.D=ui(a.p));void 0!==a.c&&(c=b.T(),a=a.c,a=new olympe.dc.query.wf(c,new olympe.dc.Ra.Property(a.p),a.o),b.Gb=a);return b}N(){}H(){let a,
794
- b,c,d;return`${this.j}-${this.optional}${null!=(c=null==(a=this.D)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Gb)?void 0:b.toString())?d:''}`}Mc(){}toJSON(){}fa(){const a={i:this.j,o:this.optional};null!==this.D&&(a.p=this.D.fa());null!==this.Gb&&(a.c=this.Gb.fa());return a}X(){}ia(){return new olympe.dc.query.ma.Zm}Z(){}T(){this.id||(this.id=this.X());return this.id}R(){return this.optional}Hc(a){const b=aj(this);if(0===b.length)return!0;a=aj(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
795
- bj(d,c)))return!1;return!0}filter(a){const b=this.N(),c=b.D;null===c?b.D=a:b.D=c instanceof olympe.dc.query.Y.Nd?new olympe.dc.query.Y.Nd(...Array.from(c.Y),a):new olympe.dc.query.Y.Nd(b.D,a);return b}sort(a,b){const c=this.N();c.Gb=new olympe.dc.query.wf(this.T(),a,b);return c}jh(){return this.Gb}lb(a){if(null!==this.D){var b=this.T();for(const c of mi(a,b))this.D.lb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.T();return cj(this,dj(this,a,(d,e,f,g)=>{(d?oi(a,e,c,f):a.remove(e,c,f))&&b(d,e,
796
- f,g)}))}Ea(){}};olympe.dc.query.ma.Wh=class extends olympe.dc.query.ma.Pm{constructor(a,b,c){super(a,c);this.relation=b;this.sa=null}};olympe.dc.query.ma.Qm=class{has(){}H(){}j(){}Uc(){}D(){}remove(){}};olympe.dc.query.ma.Od=class extends olympe.dc.query.ma.Pm{constructor(a,b,c){super(a,!1);this.Ob=b;this.F=null!=c?c:null}N(){return new olympe.dc.query.ma.Od(this.j,this.Ob,this.F)}X(){return olympe.U.rb(this.j+'followRules')}ia(){return new olympe.dc.query.ma.hq(this.db,this.F)}Z(a,b){return b instanceof olympe.dc.query.ma.Od?[a]:[olympe.U.rb(a+'followRules')]}Hc(a){if(a instanceof olympe.dc.query.ma.Wh){const b=olympe.dc.ua.ORIGIN,c=olympe.dc.ua.DESTINATION,d=olympe.dc.fc.Zc,e=olympe.dc.fc.Li,f=
797
- olympe.dm.Relation.j.xr,g=olympe.dm.Relation.j.ds;a=a.relation;const h=a.La(),k=a.W();return h!==c||k!==d&&k!==e?!!(oh(this.db,a,this.Ob)&(a.La()===b?f:g)):!0}return a instanceof olympe.dc.query.ma.Od?this.Ob===a.Ob:!1}lb(a){const b=this.T();for(const c of mi(a,this.j))for(const d of kg(this.db,c,this.Ob))oi(a,d,b,c)}observe(a,b){const c=this.T(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?ph(this.db,g,this.Ob,(l,n,p,q,r)=>{p&&(p=q?oi(a,r,c,g):a.remove(r,c,g),null!==n&&pi(a,q,l,n,g,r),p&&d(e,q,r,h))},k):
798
- qh(this.db,g,this.Ob,k);b(f,g,e,k)};return(e,f,g,h)=>{(e?oi(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,olympe.U.rb(h+f+this.toString()))}}fa(){return Object.assign(super.fa(),{f:this.Ob})}H(){return`followRulePart-${this.Ob}-${super.H()}`}Mc(){throw Error('Try to parse a part of an implicit query. Data connectors do not support those queries.');}toString(){return`FollowRule Part: ${this.db.name(this.Ob)} (${this.Ob})`}Ea(a){return a instanceof olympe.dc.query.ma.Od&&this.Ob===a.Ob}toJSON(){return{type:'follow rule',
799
- rule:`${this.db.name(this.Ob)} (${this.Ob})`}}R(){return!1}filter(){olympe.ha.Xa('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ha.Xa('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.ma.Od.D='followRules';olympe.dc.query.ma.Hh=class extends olympe.dc.query.ma.Wh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.ma.Hh(this.j,this.relation,this.optional);a.D=this.D;a.Gb=this.Gb;return a}X(){return olympe.U.rb(this.j+this.relation.T())}Z(a,b){if(b instanceof olympe.dc.query.ma.Od)return[a];const c=[a+this.relation.T(),a+Zi(this.relation).T()+!1,a+Zi(this.relation).T()+!0,a+'followRules'].map(d=>olympe.U.rb(d));b instanceof olympe.dc.query.ma.Ce&&b.relation.Ea(this.relation)&&
800
- c.push(a);return c}lb(a){const b=this.T();for(const c of mi(a,this.j))this.db.cb(c,this.relation).forEach(d=>{oi(a,d,b,c)});super.lb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.W(),e=this.relation.La(),f=this.toString();return(g,h,k,l)=>{const n=olympe.U.rb(l+h+f);g?T(this.db,h,this.relation,(p,q)=>{pi(a,p,d,e,h,q);c(p,q,h,n)},n):this.db.D(h,this.relation,n)}}fa(){return Object.assign(super.fa(),{t:this.relation.W(),d:this.relation.La()})}H(){return`followPart-${this.relation.T()}-${super.H()}`}Mc(){const a=
801
- {recursive:!1,relation:this.relation,filter:aj(this).map(b=>b.map(c=>c.Mc())),optional:this.R()};this.Gb&&(a.sort={property:this.Gb.Pa(),order:this.Gb.Wi});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.W()})`,direction:this.relation.La()}}Ea(a){return a instanceof olympe.dc.query.ma.Hh&&this.relation.Ea(a.relation)}};olympe.dc.query.ma.Ce=class extends olympe.dc.query.ma.Wh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.F=c}ia(){return new olympe.dc.query.ma.Br}N(){const a=new olympe.dc.query.ma.Ce(this.j,this.relation,this.F,this.optional);a.D=this.D;a.Gb=this.Gb;return a}X(){return olympe.U.rb(this.j+this.relation.T()+this.F)}Z(a,b){if(b instanceof olympe.dc.query.ma.Od)return[a];const c=[a+this.relation.T()+this.F,a+'followRules'].map(d=>olympe.U.rb(d));b instanceof olympe.dc.query.ma.Ce&&
802
- b.relation.Ea(this.relation)&&c.push(a);return c}lb(a){const b=this.T();for(const c of mi(a,this.j))this.F&&oi(a,c,b,c),this.db.nh(c,this.relation).forEach(d=>{oi(a,d,b,c)});super.lb(a)}observe(a,b){const c=this.relation.W(),d=this.relation.La(),e=(f,g,h,k)=>{const l=olympe.U.rb(k+g);f?T(this.db,g,this.relation,(n,p)=>{pi(a,n,c,d,g,p);super.observe(a,(q,r,t,v)=>{b(q,r,t,v);e(q,r,t,k)})(n,p,h,l)},l):this.db.D(g,this.relation,l)};return(f,g,h,k)=>{h=k+this.toString();this.F&&super.observe(a,b)(f,g,
803
- g,olympe.U.rb(h+g));e(f,g,g,h)}}fa(){return Object.assign(super.fa(),{s:this.F,t:this.relation.W(),d:this.relation.La()})}H(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.H()}`}Mc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:aj(this).map(b=>b.map(c=>c.Mc())),optional:this.R()};this.Gb&&(a.sort={property:this.Gb.Pa(),order:this.Gb.Wi});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',
804
- relation:`${this.db.name(this.relation)} (${this.relation.W()})`,direction:this.relation.La()}}Ea(a){return a instanceof olympe.dc.query.ma.Ce&&this.relation.Ea(a.relation)&&this.F===a.F}};olympe.dc.query.ma.im=class extends olympe.dc.query.ma.Od{observe(a,b){const c=this.T();return(d,e,f,g)=>{d?oi(a,e,c,e):a.remove(e,c,e);b(d,e,e,g)}}};olympe.dc.query.ma.hq=class{constructor(a,b){this.db=a;this.origin=null;this.content=new Map;this.F=null!=b?b:null}Uc(){return this.content.keys()}j(a){return this.content.has(a)&&null!==this.origin?[this.origin].values():[].values()}has(a){return this.content.has(a)}H(a){let b;return(null==(b=this.F)?void 0:b.call(this,a))||!1}D(a,b){null===this.origin&&(this.origin=b);const c=this.content.get(a);if(!c)return this.content.set(a,(new Map).set(b,1)),!0;let d;a=null!=(d=c.get(b))?d:0;c.set(b,a+1);return!1}remove(a,
805
- b){a===this.origin&&(this.origin=null);if(null===this.origin||!this.db.Ja(a)||!b)return this.content.delete(a);var c=this.content.get(a);if(!c)return!1;const d=c.get(b);if(1<d)return c.set(b,d-1),!0;b=c.delete(b);if(0===c.size)return this.content.delete(a);if(b){c=new Set(c.keys());for(const e of c){if(this.origin===e)return!0;let f,g;for(const h of null!=(g=null==(f=this.content.get(e))?void 0:f.keys())?g:[])c.add(h)}return this.content.delete(a)}return!1}};olympe.dc.query.ma.hq.ya=[olympe.dc.query.ma.Qm];olympe.dc.query.ma.Br=class{constructor(){this.content=new Map}Uc(){return this.content.keys()}j(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.keys())?c:[]}has(a){return this.content.has(a)}H(){return!1}D(a,b){let c=this.content.get(a);c||(c=new Map,this.content.set(a,c));let d;a=null!=(d=c.get(b))?d:0;c.set(b,a+1);return 0===a}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a),d=null==c?void 0:c.get(b);if(1<d)return c.set(b,d-1),!1;let e;b=null!=
806
- (e=null==c?void 0:c.delete(b))?e:!1;0===(null==c?void 0:c.size)&&this.content.delete(a);return b}};olympe.dc.query.ma.Br.ya=[olympe.dc.query.ma.Qm];olympe.dc.query.ma.Zm=class{constructor(){this.content=new Map}Uc(){return this.content.keys()}j(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.values())?c:[]}has(a){return this.content.has(a)}H(){return!1}D(a,b){let c=this.content.get(a);c||(c=new Set,this.content.set(a,c));a=c.size;c.add(b);return a<c.size}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a);let d;b=null!=(d=null==c?void 0:c.delete(b))?d:!1;0===(null==c?void 0:c.size)&&this.content.delete(a);
807
- return b}};olympe.dc.query.ma.Zm.ya=[olympe.dc.query.ma.Qm];olympe.dc.sources={};olympe.dc.sources.fk=class{T(){}init(){}destroy(){}request(){return u(function*(){})}subscribe(){}};const ej=olympe.net.va.Rd.GET,fj=olympe.net.va.Rd.Sh,gj=olympe.net.va.Rd.Dc,hj=olympe.net.va.Rd.er,ij=olympe.net.va.Headers.Ii,jj=olympe.net.va.Headers.uo,kj=olympe.net.va.Tb.Qh,lj=olympe.net.va.Tb.Oo,mj=olympe.net.va.Tb.kk,nj=olympe.net.va.Tb.gj,oj=olympe.net.va.Tb.Zi;
808
- function pj(a){const b=`/${olympe.V.getParameter(olympe.dc.sources.Config.km)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.R.D('_DataSourcesHTTPService',b,[ej,fj,gj,hj],(c,d,e)=>u(function*(){const f=d.get('sourceId');var g=a.F.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ga().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.pd(`No handler found for datasource ${f} called '${g}'`,oj,'Invalid source id'))}h=c.method;const k=c.Cj();try{var l=
809
- yield qj(a,k[jj])}catch(r){return new olympe.net.pd(`Invalid token ${r}`,mj,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.j.oc,t=olympe.dc.Request.j.Sg,v=olympe.dc.Request.j.df,x=olympe.dc.Request.j.dh,y=olympe.dc.Request.j.yh,z=olympe.dc.Request.j.bg,A=olympe.dc.Request.j.dg,K=olympe.dc.Request.j.ng;let Y;switch(n){case r:break;case t:case v:case y:case x:Y=a.D.N(p);break;case K:case z:case A:Y={tag:e.get('tag'),model:e.get('model'),mimeType:k[ij]};p instanceof
810
- Uint8Array&&(Y.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let ya;const db=null!=(ya=k['X-Source-Origin'])?ya:olympe.dc.Ia.Ze;var q=Qf(new olympe.dc.Request(n,f,Y,l),db);const Qa=yield g(q);let dd;void 0===Qa?dd='':Qa instanceof Blob||Qa instanceof Uint8Array||Qa instanceof ArrayBuffer||'function'===typeof(null==Qa?void 0:Qa.pipe)?dd=Qa:dd=JSON.stringify(a.D.fa(Qa));return new olympe.net.pd(dd,h===hj?lj:kj)}catch(r){return r instanceof olympe.error.uk?new olympe.net.pd(`Authorization error: ${r}`,
811
- mj,'Forbidden'):new olympe.net.pd(`Internal server error: ${r}`,nj,'Internal server error')}})).catch(c=>a.G.error(`Error while starting the HTTP Service: ${c}`));a.G.debug(`Started HTTP service with path: ${b}`)}function rj(a){a.R.R('_DataSourcesHTTPService').catch(b=>{a.G.error(`An error occurred while stopping the data sources http service: ${b}`)})}function sj(a,b,c){0===a.F.size&&pj(a);a.F.set(b,c);return()=>{a.F.delete(b);0===a.F.size&&rj(a)}}
812
- function tj(a,b,c){c=b instanceof olympe.dm.DataSource?b.Of(c):uj(b,c);null===c&&a.G.error(`Impossible to build URL for data source ${b}`);return c}
813
- function vj(a,b,c){if(b===olympe.dc.Ia.SERVER){var d;return null!=(d=qe(a.H,a.da.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.Z.jb(b);e=olympe.dc.sources.Config.Ih;const f=olympe.dc.sources.Config.Af,g=olympe.dc.sources.Config.Qi,h=olympe.dc.sources.Config.km;let k;e=`${tj(a,null!=d?d:b,g)?'https':'http'}://${tj(a,null!=d?d:b,e)}:${null!=(k=tj(a,null!=d?d:b,f))?k:tj(a,null!=d?d:b,g)?443:80}`+`/${tj(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.N.set(b,e)}return`${e}/${c}`}
814
- function wj(a,b){return b instanceof olympe.net.Si?se(a.H,b,ce(a.X).Gd()):Promise.reject('No http request to send')}function xj(a,b){var c=vj(a,b.ic(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.ic()}`);const d=b.content,e=JSON.stringify(a.D.fa(d));c=N(c,fj,e,olympe.net.va.ResponseType.JSON);Fc(c,{['X-Source-Origin']:b.origin,[ij]:'application/json'});return wj(a,c).then(f=>(f=f.getData())?a.D.N(f):olympe.dc.query.Dd.xj(d))}
815
- function yj(a,b){var c=vj(a,b.ic(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.ic()}`);const d=JSON.stringify(a.D.fa(b.content));c=N(c,fj,d);Fc(c,{['X-Source-Origin']:b.origin,[ij]:'application/json'});return wj(a,c).then(e=>Number.parseInt(e.getData(),10))}function qj(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.X.qh(b,(e,f)=>{e?d(e):c(f)})})}
816
- olympe.dc.sources.zu=class{constructor(a,b,c,d,e,f){this.G=a;this.R=b;this.H=c;this.X=d;this.Z=e;this.D=f;this.F=new Map;new olympe.C.Wb('Http service of remote data provider');this.N=new Map;this.j=new Map;this.da=new Map([[olympe.dc.Request.j.Jg,olympe.L.Xb.Jg],[olympe.dc.Request.j.dg,olympe.L.Xb.ik],[olympe.dc.Request.j.ng,olympe.L.Xb.ik],[olympe.dc.Request.j.bg,olympe.L.Xb.ik],[olympe.dc.Request.j.wo,olympe.L.Xb.vo],[olympe.dc.Request.j.vr,olympe.L.Xb.ur],[olympe.dc.Request.j.Kp,olympe.L.Xb.Jp],
817
- [olympe.dc.Request.j.Sg,olympe.L.Xb.Io],[olympe.dc.Request.j.dh,olympe.L.Xb.TRANSACTION]])}Jc(a){var b=vj(this,a.ic(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.ic()}`);b=Hc(N(b,ej),olympe.net.va.ResponseType.JSON);Fc(b,{['X-Source-Origin']:a.origin});return wj(this,b).then(c=>c.getData())}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.ic(),f=vj(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);
818
- const g=N(e===olympe.dc.Ia.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,hj,d);Fc(g,{[ij]:'application/octet-stream'});e!==olympe.dc.Ia.SERVER&&Fc(g,{['X-Source-Origin']:a.origin});return wj(this,g).then(()=>(new URL(g.j())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=vj(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Ia.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,gj,b);d!==olympe.dc.Ia.SERVER&&Fc(e,
819
- {['X-Source-Origin']:a.origin});return wj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=vj(this,d,a.getType());if(!e)return Promise.reject(Error(`No destination URL to download the file. ${b}`));var f;const g=null!=(f=this.j.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,li:k})});if(this.j.has(b))return f;this.j.set(b,g);e=N(d===olympe.dc.Ia.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,ej,void 0,olympe.net.va.ResponseType.$h);d!==olympe.dc.Ia.SERVER&&
820
- Fc(e,{['X-Source-Origin']:a.origin});wj(this,e).then(h=>{let k;null==(k=this.j.get(b))||k.forEach(l=>l.done(h.getData()))}).catch(h=>{let k;null==(k=this.j.get(b))||k.forEach(l=>l.li(`${h}`))}).finally(()=>{this.j.delete(b)});return f}};olympe.dc.sources.fq=class{constructor(a,b){this.G=a;this.Jb=b}};olympe.dc.sources.fq.Tb={ij:0,VC:1,WC:3,pC:4};const zj=olympe.dc.Request.j.oc,Aj=olympe.dc.Request.j.Sg,Bj=olympe.dc.Request.j.Gk,Cj=olympe.dc.Request.j.ng,Dj=olympe.dc.Request.j.dg,Ej=olympe.dc.Request.j.bg,Fj=olympe.dc.Request.j.Fi,Gj=olympe.dc.Request.j.yh,Hj=olympe.dc.Request.j.df,Ij=olympe.dc.Request.j.dh,Jj=olympe.dc.Request.j.ck;
821
- function Kj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.U.Zh(6E4),hb(a.D,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),ib(a.D,()=>{a.D=null}));let d;const e=null!=(d=a.D.get(c))?d:new olympe.dc.db.ec(c);b.qc(e);fb(a.D.j,c)||a.D.set(c,e)}function Lj(a,b){return u(function*(){const c=Qf(new olympe.dc.Request(olympe.dc.Request.j.ck,a.T(),b),olympe.dc.Ia.SELF);let d;yield null==(d=a.Jb)?void 0:d.xi(c)})}
822
- function Mj(a,b){const c=b.T();let d,e;const f=null!=(e=null==(d=a.D)?void 0:d.get(c))?e:new olympe.dc.db.ec(c);let g;null==(g=a.D)||g.delete(c);b.qc(f);return a.applyTransaction(f,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function Nj(a,b){const c=rxjs.defer(()=>a.j.executeQuery(b));return 0<a.N?rxjs.interval(a.N).pipe(rxjs.operators.switchMap(()=>c)):c}
823
- olympe.dc.sources.uq=class{constructor(a,b){this.G=a;this.j=b;this.Jb=null;this.H=olympe.dc.query.ml();this.F=new olympe.C.Wb('Context of source '+this.T());let c;this.N=null!=(c=b.Of(olympe.dc.sources.Config.Nm))?c:-1;this.D=null}T(){return this.j.T()}init(a){this.Jb=a;if(this.T()===olympe.dc.Ia.SELF)return this;(new Promise((b,c)=>{let d=!0;Oj(this.j,this.F).subscribe(rxjs.Subscriber.create(e=>{if(this.G.j()){this.G.debug(`Data source ${this.j.name()} has loaded ${e.size()} data types in its cache:`);
824
- for(const [f,g]of e)this.G.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.j.init(this.F)).catch(b=>{this.G.error(`Error while initialization of DataSource ${this.j.name()} (${this.T()}): ${b}`)});return this}healthCheck(){return this.j.healthCheck().then(()=>`Data source ${this.j.name()} (${this.j.T()}) OK`)}destroy(){this.F.destroy();return this.j.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case zj:const d=olympe.dm.DataSource.oc.Ab,e=olympe.dm.DataSource.oc.Vh;
825
- return this.j.healthCheck().then(()=>({s:e})).catch(h=>({s:d,r:String(h)}));case Aj:return this.j.executeQuery(b);case Fj:const f=b.ac();Kj(this,f);Lj(this,Mf(f)).catch(h=>{this.G.warn(`Error occurred when applying burst transaction ${f.T()} to the data source: ${h}`)});return Promise.resolve();case Hj:case Ij:const g=b.ac();return this.applyTransaction(g,c===Ij).finally(()=>{if(a.origin===olympe.dc.Ia.SELF){var h=g.T();h=Qf(new olympe.dc.Request(olympe.dc.Request.j.jk,olympe.dc.Ia.SELF,{id:h,finalize:olympe.dc.transaction.If.j.$i,
826
- error:null}),this.T());let k;null==(k=this.Jb)||k.cd(h)}});case Gj:return Mj(this,b.ac());case Cj:return b.content instanceof Uint8Array?this.j.uploadFileContent(b.tag,b.model,b.content).then(()=>`datasource://${b.tag}`):Promise.reject('File content is undefined');case Dj:return this.j.downloadFileContent(b.tag,b.model);case Ej:return this.j.deleteFileContent(b.tag,b.model);case Jj:return c=Qf(new olympe.dc.Request(Jj,olympe.dc.Ia.SELF,b,a.xc()),this.T()),this.Jb.cd(c);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===
827
- Bj){const b=a.content;a=a.origin;return a===olympe.dc.Ia.SELF?Nj(this,b):Bi(this.H,b,this.F,a,olympe.dc.la.nc.vf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Se)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>Mf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return u(function*(){var d=Pj(a);yield c.j.applyTransaction(d,{batch:b});d=Date.now();yield Li(c.H,c.T(),a);const e=
828
- Mf(a,d);yield Lj(c,e);return d})}};olympe.dc.sources.uq.ya=[olympe.dc.sources.fk];function Pj(a){const b=olympe.dc.sources.kg.j.Yt,c=olympe.dc.sources.kg.j.Tw,d=olympe.dc.sources.kg.j.du,e=olympe.dc.sources.kg.j.Zt,f=olympe.dc.sources.kg.j.eu,g=[],h=[],k=[],l=[],n=[];a.Bb.forEach((p,q)=>{const r=p.Ub();p.D()?g.push(Qj(b,q,r,p.N()?p.zb():null)):p.yd()?k.push(Qj(d,q,r,null,p.F())):p.N()&&h.push(Qj(c,q,r,p.zb()));for(const [t,v,x]of p.Id())p=a.Tc(v),x?l.push(new Rj(e,t,q,v,r,p.Ub())):n.push(new Rj(f,t,q,v,r,p.Ub()))});return n.concat(k,g,h,l)}
829
- function Qj(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new Sj(a,b,c,d,e)}olympe.dc.sources.kg=class{constructor(a){this.type=a}};class Sj extends olympe.dc.sources.kg{constructor(a,b,c,d,e){super(a);this.object=b;this.model=c;this.properties=null!=d?d:null;this.deleteRules=null!=e?e:olympe.dc.Lb.NONE}}
830
- class Rj extends olympe.dc.sources.kg{constructor(a,b,c,d,e,f){super(a);this.relation=b;this.from=c;this.to=d;this.fromModel=e;this.toModel=f}}olympe.dc.sources.kg.j={Yt:'CREATE',Tw:'UPDATE',du:'DELETE',Zt:'CREATE_RELATION',eu:'DELETE_RELATION'};function Tj(a,b){b=Qf(new olympe.dc.Request(olympe.dc.Request.j.jk,olympe.dc.Ia.SELF,{id:b,finalize:olympe.dc.transaction.If.j.$i,error:null}),a.T());let c;null==(c=a.Jb)||c.cd(b)}
831
- olympe.dc.sources.Rl=class{constructor(a,b){this.G=a;this.D=b;this.Jb=null}T(){}X(){}Z(){}init(a){this.Jb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return u(function*(){if(!b.D.j)return b.X(a);var c=olympe.dc.Request.j.oc,d=olympe.dc.Request.j.Sg;const e=olympe.dc.Request.j.df,f=olympe.dc.Request.j.dh;var g=olympe.dc.Request.j.Fi;const h=olympe.dc.Request.j.yh,k=olympe.dc.Request.j.ng;var l=olympe.dc.Request.j.dg;const n=olympe.dc.Request.j.bg,p=olympe.dc.sources.ce(),
832
- q=a.getType(),r=a.ic();if(Qd(b.D)){q===d&&(c=a.content,(g=Sf(a).get(olympe.dc.la.j.Ml))&&(yield Uj(p,c.T(),g)),b.G.debug(`Data Provider: Query ${c.T()} will be executed with its default Remote or Server provider`));if(q===l&&(l=a.content,'string'===typeof(null==l?void 0:l.url)&&l.url.startsWith('offline://')))return p.downloadFileContent(l.tag);l=yield b.X(a);if(q===d){const t=a.content;d=l;const v=new olympe.dc.db.ec(`fullResult_${t.T()}`);l=d.pipeThrough(new TransformStream({transform:(x,y)=>u(function*(){const z=
833
- x.ac();yield Vj(p,z);z.qc(v);b.G.j()&&b.G.debug(`Data Provider: Data result for query ${t.T()}`,z.Bb.size,'instances',Array.from(z.Id()).length,'relations');y.enqueue(x)}),flush:()=>u(function*(){yield Wj(p,t.T(),r,v,!0)})}))}else if(q===e||q===f||q===h)b.G.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield Xj(p,null,r,a.content.ac(),!1);return l}b.G.debug(`Data Provider: Request (type: ${q}) will be sent to the cache data provider: ${a.content}`);switch(q){case c:return{s:olympe.dm.DataSource.oc.Df};
834
- case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.ac().T();return p.applyTransaction(d,r).finally(()=>Tj(b,t));case g:return Promise.resolve();case k:return d=a.content,p.uploadFileContent(d.tag,d.content,d.mimeType);case l:return p.downloadFileContent(a.content.tag);case n:return p.deleteFileContent(a.content.tag);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${b.T()}`)}})}subscribe(a,b){if(!this.D.j)return this.Z(a,
835
- b);const c=olympe.dc.sources.ce(),d=a.content,e=a.ic();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(Qd(this.D)){const f=new rxjs.Observable(h=>{olympe.C.ot([this.D.Vf()],()=>{h.error(new olympe.error.Np('Go Offline',d.T()))})}),g=this.Z(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.C.ot([this.D.Vf()],()=>{f.error(new olympe.error.Ho('Back Online',d.T()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(Xj(c,d.T(),e,f.ac()).then(()=>f).catch(g=>{this.G.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);
836
- throw g;}))))}};olympe.dc.sources.Rl.ya=[olympe.dc.sources.fk];const Yj=olympe.dc.Request.j.oc,Zj=olympe.dc.Request.j.Sg,ak=olympe.dc.Request.j.Gk,bk=olympe.dc.Request.j.df,ck=olympe.dc.Request.j.dh,dk=olympe.dc.Request.j.Fi,ek=olympe.dc.Request.j.yh,fk=olympe.dc.Request.j.ng,gk=olympe.dc.Request.j.dg,hk=olympe.dc.Request.j.bg;function ik(a,b){let c;return(null==(c=a.Ha.jb(b))?void 0:c.Of(olympe.dc.sources.Config.Ve))!==olympe.dm.DataSource.Ve.Qp}
837
- function jk(a,b){let c;return(null==(c=a.Ha.jb(b))?void 0:c.Of(olympe.dc.sources.Config.Ve))!==olympe.dm.DataSource.Ve.zo}function kk(a,b,c){const d=c.content.ac().T();let e=a.da.get(d);e||(e=olympe.L.qb.Zs(b),a.da.set(d,e));return e.kd(c)}function lk(a,b){b=b.xc();if(b!==olympe.dm.User.j&&a.Of(olympe.dc.sources.Config.Um))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.T()}). Please use an admin account instead.`,new olympe.error.uk(a);}
838
- function mk(a,b,c,d,e){return u(function*(){var f=olympe.L.wa.j.SEND,g=olympe.L.wa.j.GET;const h=olympe.L.wa.j.PUBLISH,k=olympe.L.wa.j.SUBSCRIBE,l=d.qt();var n=d.body();if(e!==n.xc())throw Error('Access denied: try to impersonate a user');lk(c,n);let p;if(null==(p=a.Jb)||!p.sources.has(n.ic()))throw Error(`Try to process a message with destination data source ${n.ic()} coming from remote but not started here`);if(l===k){if(n.getType()===ak)f=n.content.T();else throw Error('Not supported type of subscription');
839
- g=yield d.Rn(f);a.ia.set(g,f);g=a.N.get(f);g||(g=new nk(a.G,f,b,Qf(n,olympe.dc.Ia.Ze)),a.N.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.cd(n):a.G.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.ack()):l===h&&(yield b.request(n))})}
840
- olympe.dc.sources.Er=class extends olympe.dc.sources.Rl{constructor(a,b,c,d,e,f){super(a,d);this.H=b;this.j=c;this.db=e;this.F=new olympe.C.Wb('Remote Provider Context');this.sa=new Map;this.R=new Map;this.N=new Map;this.ia=new Map;this.Ha=f;this.da=new Map}T(){return olympe.dc.Ia.Ze}X(a){var b=olympe.L.qb;const c=a.ic();var d=a.getType();this.G.j()&&this.G.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case Yj:const e=olympe.dm.DataSource.oc.Ab,f=
841
- olympe.dm.DataSource.oc.Vh;b=ik(this,c)?b.get(c,a):Promise.resolve({s:f});a=jk(this,c)?this.j.Jc(a):Promise.resolve({s:f});return Promise.all([b,a]).then(([k,l])=>{if((null==k?void 0:k.s)===e||(null==l?void 0:l.s)===e){let n,p;return{s:e,r:`${null!=(n=null==k?void 0:k.r)?n:''} ${null!=(p=null==l?void 0:l.r)?p:''}`}}return{s:f}});case Zj:return jk(this,c)?xj(this.j,a):b.get(c,a);case bk:const g=a.content.ac().T();return(ik(this,c)?b.get(c,a):yj(this.j,a)).finally(()=>Tj(this,g));case ck:const h=a.content.ac().T();
842
- return(jk(this,c)?yj(this.j,a):b.get(c,a)).finally(()=>Tj(this,h));case dk:return ik(this,c)?kk(this,c,a).catch(k=>{this.G.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case ek:return d=a.content.ac().T(),this.da.delete(d),ik(this,c)?b.get(c,a):yj(this.j,a);case fk:return jk(this,c)?this.j.uploadFileContent(a):b.get(c,a);case gk:return jk(this,c)?this.j.downloadFileContent(a):b.get(c,a);case hk:return jk(this,c)?this.j.deleteFileContent(a):
843
- b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.T()}`)}}Z(a,b){const c=a.ic(),d=a.getType();if(!ik(this,c))return rxjs.throwError(()=>Error(`Subscription request not supported for data source ${this.db.name(c)} (${c}) which uses HTTP only.`));this.G.j()&&this.G.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===ak?olympe.L.qb.observe(c,this.F,a,{onRetry:b}).observable:rxjs.throwError(()=>
844
- Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.F)return this;olympe.dc.la.from(this.H,this.H).bb(olympe.dm.DataSource.Mj).filter(olympe.dc.query.za.Ea(olympe.dm.DataSource.gi,!0)).filter(olympe.dc.query.za.Ea(olympe.dm.DataSource.Is,!0)).observe(this.F).subscribe(b=>{b.yj().forEach(this.nb.bind(this,a));b.Ej().forEach(c=>{let d;null==(d=this.sa.get(c))||d.destroy();this.sa.delete(c)})});this.db.Pa(this.H,olympe.dm.DataSource.Is)&&(new olympe.L.qb(this.H,this.F)).listen().subscribe(b=>
845
- {b=b.body();b instanceof olympe.dc.Request?a.cd(b):this.G.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return u(function*(){})}nb(a,b){const c=b.W(),d=new olympe.C.Wb(`Published data provider context ${c}`,this.F);this.sa.set(c,d);let e;ok(b,d).subscribe(f=>{let g;null==(g=e)||g();let h;null==(h=this.R.get(c))||h.stop();this.R.delete(c);f!==olympe.dm.DataSource.Ve.zo&&(e=sj(this.j,c,k=>{lk(b,k);return a.request(k)}),d.onDestroy(()=>{let k;return null==
846
- (k=e)?void 0:k()}));f!==olympe.dm.DataSource.Ve.Qp&&(f=new olympe.C.Wb(`Bus Service of data source ${c}`,d),f=(new olympe.L.qb(c,f)).yt(this.Wa.bind(this)),this.R.set(c,f),f.listen().subscribe(k=>{k.Bi().then(l=>mk(this,a,b,k,l)).catch(l=>{this.G.warn(`Error occurred while processing request from ${k.source()}: ${l}`);return k.li(l instanceof Error?l:Error(l))})}))})}xi(a){const b=this;return u(function*(){let c;yield null==(c=b.R.get(a.ic()))?void 0:c.xi(a)})}Wa(a){const b=this.ia.get(a);this.ia.delete(a);
765
+ olympe.dc.Ka.prototype.filter=olympe.dc.Ka.prototype.filter;olympe.dc.Ka.prototype.shift=olympe.dc.Ka.prototype.shift;olympe.dc.Ka.prototype.pop=olympe.dc.Ka.prototype.pop;olympe.dc.Ka.prototype.push=olympe.dc.Ka.prototype.push;olympe.dc.Ka.prototype.getAt=olympe.dc.Ka.prototype.qe;olympe.dc.Ka.prototype.getFirst=olympe.dc.Ka.prototype.Jc;olympe.dc.Ka.prototype.get=olympe.dc.Ka.prototype.get;olympe.dc.Ka.prototype.indexOf=olympe.dc.Ka.prototype.indexOf;olympe.dc.Ka.prototype.has=olympe.dc.Ka.prototype.has;
766
+ olympe.dc.Ka.prototype.size=olympe.dc.Ka.prototype.size;olympe.dc.Ka.prototype.toArray=olympe.dc.Ka.prototype.Ue;olympe.dc.Ka.prototype.keys=olympe.dc.Ka.prototype.keys;olympe.dc.Ka.prototype.values=olympe.dc.Ka.prototype.values;olympe.dc.Ka.prototype.entries=olympe.dc.Ka.prototype.entries;olympe.dc.Ka.empty=olympe.dc.Ka.empty;function Qi(a){return 1<a.size()?(olympe.ga.Wa('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Jc()||null}olympe.dc.sd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.sd(olympe.dc.la.from(a))}bb(a){return new olympe.dc.sd(this.query.bb(a))}sj(){return this}mb(a){return this.query.mb(a).then(b=>Qi(b))}Cc(){return Qi(this.query.Cc())}};olympe.dc.sd.prototype.executeFromCache=olympe.dc.sd.prototype.Cc;
767
+ olympe.dc.sd.prototype.execute=olympe.dc.sd.prototype.mb;olympe.dc.sd.prototype.cast=olympe.dc.sd.prototype.sj;olympe.dc.sd.prototype.follow=olympe.dc.sd.prototype.bb;const Ri=olympe.dc.ta.ORIGIN,Si=olympe.dc.ta.DESTINATION;function Fi(a,b){mi(a.j,()=>{a.fb()||null!==a.D||b(a.query.T())})}function Hi(a,b,c){const d=a.ba;a.ba++;a.H.set(d,c);b===olympe.dc.Ia.SELF?a.kd(e=>e?c.error(e):c.next(a.j)):(a.Z++,1===a.Z&&a.kd(()=>si(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.H.size} subscribers`);return d}
768
+ function Oi(a,b,c){if(a.query.jb()!==b)return!1;c.qc(a.ia);(b=a.ia.flush())&&a.G.debug(`Subscription ${a.query.T()} is considered as obsolete after the transaction ${c.T()} applied on DB`);return b}function Ji(a){ui(a.j);a.H.forEach(b=>{b.next(a.j)})}
769
+ function Ti(a,b,c){const d=[];let e=!1;const f=new olympe.async.Dk(olympe.C.kh());for(const g of b)if(g.Ic(a.query)&&(e||(e=!0),f.add(h=>g.kd(k=>{!k&&d.push(g);h()}))),null!==g.D&&Bi(a.query,g.query)){let h;null==(h=a.R)||h.push(g)}sd(f,g=>c(g?d:[]));f.start();return e}
770
+ function Ui(a){const b=a.query.T(),c=new Map,d=q=>{const r=c.get(q);return r?1===r.size?Array.from(r)[0]:(t,v,x,y)=>r.forEach(z=>z(t,v,x,y)):()=>{}},e=ki(a.query),f=a.j;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.T(),t=g.j;g=g.observe(f,d(r));let v;c.set(t,(null!=(v=c.get(t))?v:new Set).add(g))}const h=a.db,k=a.query.D,l=olympe.U.rb(k),n=Pf(h,k,(q,r)=>{q?qi(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.X)||p.push(()=>{Nf(h,k,n)});Vi(a)}
771
+ function Wi(a){const b=a.Ha(a.query,a.Ua.bind(a),()=>{null===a.D||a.fb()||Ui(a)},d=>{a.fb()||(a.G.error(`Error while getting data from data source (${a.query.jb()}) to ensure coverage of the query ${a.query.T()}: ${d}`),Vi(a))});let c;b&&(null==(c=a.X)||c.push(b))}function Xi(a,b){a.N.delete(b);0===a.N.size&&(a.N=null,Promise.resolve().then(()=>{!a.fb()&&Wi(a)}))}function Vi(a){const b=a.D;a.D=null;null==b||b.forEach(c=>c())}
772
+ olympe.dc.query.qr=class{constructor(a,b,c,d,e){this.G=a;this.wa=b;this.db=b.view;this.query=c;this.md=d;this.j=new olympe.dc.query.gr(this.G,c);this.Z=0;this.ba=1;this.X=[];this.H=new Map;this.D=[()=>ui(this.j)];this.Ha=e;this.ia=new Yi(a,this.db,c,this.j);this.F=this.N=null;this.R=[]}start(a){return Ti(this,a,b=>{0<b.length?(this.N=new Set(b),this.N.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),Ui(this)):Wi(this)})}Ic(a){return!this.fb()&&this.query.jb()===a.jb()&&(this.query.T()===a.T()||
773
+ (null===this.D||this.query.D===a.D)&&this.j.Ic(a))}kd(a){null!==this.D?this.D.push(a):a();return this}destroy(a){a?this.G.error(`Destroy subscription ${this.query.T()} after error: ${a}`):this.G.debug(`Destroy subscription ${this.query.T()}`);const b=this.X;this.X=null;this.H.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>Xi(e,this));let d;null==(d=this.N)||d.forEach(e=>{e.F.delete(this);0===e.F.size&&(e.F=null)});b.forEach(e=>e())}fb(){return null===this.X}Ua(){const a=
774
+ olympe.dc.la.nc.Qg;if(this.md===a)return olympe.U.stream.tap(c=>{c=c.jl().filter(e=>e.o===olympe.dc.Qc.j).map(e=>e.t);this.wa.ne(c,'Batch mode');const d=ki(this.query)[0];d instanceof olympe.dc.query.ma.mm&&c.forEach(e=>qi(this.j,e,d.T(),d.j))});let b;if(0<(null==(b=this.R)?void 0:b.length)){const c=this.R.filter(e=>e.md===a).map(e=>new Promise(f=>e.kd(f))),d=this.R.filter(e=>e.md!==a).map(e=>new Promise(f=>e.kd(f)));this.R=void 0;return new TransformStream({start:()=>Promise.all(c),flush:()=>Promise.all(d)})}return null}};
775
+ function Zi(a,b){return a.F.has(Si+b)||a.F.has(Ri+b)}
776
+ class Yi{constructor(a,b,c,d){this.G=a;this.db=b;this.H=d;this.R=[];this.N=-1<c.j.max||0<c.j.offset;this.F=new Map;this.j=!1;const e=new Map;for(const f of ki(c)){a=f.T();this.R.push(a);if(f instanceof olympe.dc.query.ma.Wh){a=f.relation;a=`${a.La()}${a.W()}`;let g;b=null!=(g=this.F.get(a))?g:[];b.push(f);this.F.set(a,b)}$i(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.T());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.j;this.j=!1;return a}Sc(){}Yc(a,b){if(!(this.j||
777
+ !this.N&&this.db.Ja(a))){var c;this.j||(this.j=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&pi(this.H,a,e)))}}D(a){this.j||this.db.Ja(a)&&!this.N||this.j||(this.j=this.R.some(b=>pi(this.H,a,b)))}Oa(a,b,c){if(!this.j&&Zi(this,a)){var d=this.db.Ja(b),e=this.db.Ja(c);if(d&&!e||!d&&e){const f=this.F.get(Si+a);a=this.F.get(Ri+a);this.j||(this.j=d&&(null==f?void 0:f.some(g=>pi(this.H,b,g.j)))||e&&(null==a?void 0:a.some(g=>pi(this.H,c,g.j))))}}}hc(a,b,c){if(!this.j&&this.N&&Zi(this,a)&&this.db.gt(b,
778
+ new olympe.dc.Ra.Relation(a),c)){const d=this.F.get(Si+a);a=this.F.get(Ri+a);const e=this.H;this.j||(this.j=(null==d?void 0:d.some(f=>pi(e,b,f.j)&&pi(e,c,f.T())))||(null==a?void 0:a.some(f=>pi(e,c,f.j)&&pi(e,b,f.T()))))}}}olympe.dc.query.qr.ya=[olympe.dc.Writable];function aj(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
779
+ olympe.dc.query.Relation=class extends olympe.dc.Ra.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.W())+', ';a+='"direction": '+JSON.stringify(this.La())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a,b){return new olympe.dc.query.Relation(a.W(),a.La(),null!=b?b:a instanceof olympe.dc.aa.Le)}$b(){const a=
780
+ olympe.dc.ta.DESTINATION,b=olympe.dc.ta.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}T(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.P={Da:'dc.query.Logger',Fk:'dc.query.QueryProcessor'};olympe.V.config(function(a){D(a,olympe.dc.query.P.Da,[olympe.ga.P.Fa],b=>b.ad('query'));C(a,olympe.dc.query.P.Fk,olympe.dc.query.ew,olympe.dc.query.P.Da,olympe.dc.db.P.Fa,olympe.dc.transaction.P.Fa,olympe.dc.P.Ug,new olympe.V.oa(olympe.dc.Config.Yh))});olympe.V.run([olympe.dc.query.P.Fk],a=>{olympe.dc.query.ml=()=>a});olympe.dc.query.Cd=class extends Error{};olympe.dc.query.Y={};olympe.dc.query.Y.Nd=class extends olympe.dc.query.za{constructor(...a){super();this.Y=a}compile(){return this.Y.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}zd(){return new olympe.dc.query.Y.Ge(...this.Y.map(a=>a.zd()))}zb(){return this.Y.flatMap(a=>a.zb())}Ic(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}mb(a){return this.Y.reduce((b,c)=>b&&c.mb(a),!0)}observe(a,b,c){const d=
781
+ Array(this.Y.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.Y.forEach((g,h)=>{g.observe(a,olympe.U.rb('AND-'+b+a+h),f.bind(null,h))})}fa(){return{pr:olympe.dc.query.za.j.io,p:this.Y.map(a=>a.fa())}}Nc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Y.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.U.rb('AND-'+b+a+d))})}};olympe.dc.query.Y.yf=class extends olympe.dc.query.za{constructor(a,b,c,d=!1){super();this.Ca=olympe.dc.ea(a);this.substring=b;this.db=c;this.j=d}zb(){return[this.Ca]}Ic(a,b){return a instanceof olympe.dc.query.Y.yf&&a.Ca===this.Ca?b?a.j?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.j?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Pa(){return this.Ca}mb(a){return this.apply(this.db.Pa(a,
782
+ this.Ca))}observe(a,b,c){hh(this.db,a,this.Ca,d=>{c(this.apply(d))},olympe.U.rb(b+a+this.toString()))}apply(a){a=olympe.dc.ib.tc(a);return'string'===typeof a?this.j?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.Ca+'-'+this.substring+'-'+this.j}clear(a,b){ih(this.db,a,this.Ca,olympe.U.rb(b+a+this.toString()))}Nc(){return{name:'CONTAINS',property:this.Pa(),value:this.substring,caseSensitive:this.j}}fa(){return{pr:olympe.dc.query.za.j.Zj,
783
+ p:this.Ca,s:this.substring,c:this.j}}};olympe.dc.query.Y.Ce=class extends olympe.dc.query.za{constructor(a,b,c){super();this.Ca=olympe.dc.ea(a);this.j=olympe.dc.ib.tc(null!=b?b:null);this.db=c}zb(){return[this.Ca]}Ic(a){if(a instanceof olympe.dc.query.Y.Ce&&this.Ca===a.Ca)if('object'===typeof this.j&&null!==this.j){if(this.j instanceof olympe.dc.CloudObject)return this.j.Ea(a.j);if(this.j instanceof Date)return a.j instanceof Date&&this.j.getTime()===a.j.getTime();if(this.j instanceof olympe.C.Color)return this.j.Ea(a.j)}else return this.j===
784
+ a.j;return!1}mb(a){return this.apply(this.db.Pa(a,this.Ca))}observe(a,b,c){hh(this.db,a,this.Ca,d=>{c(this.apply(d))},olympe.U.rb(b+a+this.toString()));null===this.j&&null===this.db.Pa(a,this.Ca)&&c(!0)}clear(a,b){ih(this.db,a,this.Ca,olympe.U.rb(b+a+this.toString()))}apply(a){a=olympe.dc.ib.tc(a);return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Ea(this.j):a instanceof Date?this.j instanceof Date&&this.j.getTime()===a.getTime():a instanceof olympe.C.Color?a.Ea(this.j):!1:a===
785
+ this.j}toString(){let a,b;const c=null!=(b=null==(a=this.j)?void 0:a.toString())?b:'null';return'Equals-'+this.Ca+'-'+c}Nc(){return{name:'EQUALS',property:this.Ca,value:this.j}}fa(){let a=1,b=this.j;switch(!0){case this.j instanceof Date:a=2;b=this.j.toJSON();break;case this.j instanceof olympe.dc.CloudObject:a=3;b=this.j.W();break;case this.j instanceof olympe.C.Color:a=4,b=this.j.toJSON()}return{pr:olympe.dc.query.za.j.pp,p:this.Ca,t:a,v:b}}};olympe.dc.query.Y.jq=class extends olympe.dc.query.za{constructor(a,b){var c=olympe.dc.ha();super();this.Ca=olympe.dc.ea(a);this.values=b.map(d=>olympe.dc.ib.tc(null!=d?d:null));this.db=c}zb(){return[this.Ca]}Ic(){return!1}mb(a){return this.apply(this.db.Pa(a,this.Ca))}observe(a,b,c){hh(this.db,a,this.Ca,d=>{c(this.apply(d))},olympe.U.rb(b+a+this.toString()))}clear(a,b){ih(this.db,a,this.Ca,olympe.U.rb(b+a+this.toString()))}apply(a){const b=olympe.dc.ib.tc(a);return'object'===typeof b&&null!==b?b instanceof
786
+ olympe.dc.CloudObject||b instanceof olympe.C.Color?this.values.some(c=>b.Ea(c)):b instanceof Date?this.values.some(c=>c instanceof Date&&c.getTime()===b.getTime()):!1:this.values.includes(b)}toString(){const a=this.values.map(b=>{let c;return null!=(c=null==b?void 0:b.toString())?c:'null'}).join('');return'In-'+this.Ca+'-'+a}Nc(){return{name:'IN',property:this.Ca,values:this.values}}fa(){var a,b=null!=(a=this.values[0])?a:null;a=b instanceof olympe.C.Color?4:b instanceof olympe.dc.CloudObject?3:b instanceof
787
+ Date?2:1;b=4===a||2===a?this.values.map(c=>c.toJSON()):3===a?this.values.map(c=>c.W()):this.values;return{pr:olympe.dc.query.za.j.Zp,p:this.Ca,t:a,v:b}}};function bj(a,b,c){return olympe.U.rb(c+b+a.j+a.Ca)}
788
+ olympe.dc.query.Y.Ti=class extends olympe.dc.query.za{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Ca=olympe.dc.ea(b);this.j=(this.F=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.ea(c):c;this.D=d;this.H=e}zd(){return new olympe.dc.query.Y.Ti(this.db,this.Ca,this.j,!this.D,!this.H)}zb(){return[this.Ca]}Ic(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Y.Ti&&this.Ca===a.Ca?
789
+ typeof this.j!==typeof a.j||this.D!==a.D?!1:this.F?this.j===a.j:this.D&&this.j>=a.j||!this.D&&this.j<=a.j:!1}Pa(){return this.Ca}mb(a){return this.compare(this.db.Pa(a,this.Ca),this.F?this.db.Pa(a,this.j):this.j)}observe(a,b,c){this.F&&hh(this.db,a,this.j,d=>{const e=this.db.Pa(a,this.Ca);null!==e&&c(this.compare(e,d))},bj(this,a,b));hh(this.db,a,this.Ca,d=>{const e=this.F?this.db.Pa(a,this.j):this.j;c(null!==e?this.compare(d,e):!0)},bj(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.H?
790
+ this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){ih(this.db,a,this.Ca,bj(this,a,b));this.F&&ih(this.db,a,this.j,bj(this,a,b))}Nc(){return{name:'INEQUALITY_OPERATOR',property:this.Pa(),operator:this.D?'<':'>',strict:this.H,value:this.j}}fa(){return{pr:olympe.dc.query.za.j.$p,p:this.Ca,b:this.j,l:this.D,s:this.H}}toString(){return(this.D?'LowerThan-':'GreaterThan-')+this.Ca+'-'+this.H+'-'+this.j}};olympe.dc.query.Y.ie=class extends olympe.dc.query.za{constructor(a){super();this.j=a}compile(){const a=this.j.zd();return this.Ea(a)?super.compile():a.compile()}zd(){return this.j}zb(){return this.j.zb()}Ic(a,b){return a instanceof olympe.dc.query.Y.ie?this.j.Ic(a.j,b):this.j.Ic(a,!b)}mb(a){return!this.j.mb(a)}observe(a,b,c){let d=null;this.j.observe(a,olympe.U.rb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Nc(){return{name:'NOT',predicate:this.j.Nc()}}fa(){return{pr:olympe.dc.query.za.j.Dq,v:this.j.fa()}}toString(){return`NOT-${this.j.toString()}`}clear(a,
791
+ b){this.j.clear(a,olympe.U.rb('NOT'+b+a))}Ea(a){return a instanceof olympe.dc.query.Y.ie?this.j.Ea(a.j):!1}};olympe.dc.query.Y.Ge=class extends olympe.dc.query.za{constructor(...a){super();this.Y=a}compile(){return this.Y.map(a=>a.compile()).flat()}zd(){return new olympe.dc.query.Y.Nd(...this.Y.map(a=>a.zd()))}zb(){return this.Y.flatMap(a=>a.zb())}Ic(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}mb(a){return this.Y.reduce((b,c)=>b||c.mb(a),!1)}observe(a,b,c){const d=Array(this.Y.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
792
+ k);e!==g&&(e=g,c(g))};this.Y.forEach((g,h)=>{g.observe(a,olympe.U.rb('OR-'+b+a+h),f.bind(null,h))})}Nc(){throw Error('toObject for OR predicate should not be called');}fa(){return{pr:olympe.dc.query.za.j.Vq,p:this.Y.map(a=>a.fa())}}toString(){return'And-'+this.Y.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.U.rb('OR-'+b+a+d))})}};olympe.dc.query.Y.Hf=class extends olympe.dc.query.za{constructor(a,b,c,d=!0){super();this.Ca=olympe.dc.ea(a);this.j='string'===typeof b?new RegExp(d?b:b.toLowerCase()):d?b:new RegExp(b.source.toLowerCase());this.db=c;this.D=d}zb(){return[this.Ca]}Ic(a){return a instanceof olympe.dc.query.Y.Hf&&this.Ca===a.Ca&&this.j.toString()===a.j.toString()}mb(a){return this.apply(this.db.Pa(a,this.Ca))}observe(a,b,c){hh(this.db,a,this.Ca,d=>{c(this.apply(d))},olympe.U.rb(b+a+this.toString()))}apply(a){a=olympe.dc.ib.tc(a);
793
+ return'string'===typeof a?(a=this.j.test(this.D?a:a.toLowerCase()),this.j.lastIndex=0,a):!1}toString(){return'Regex'+this.Ca+'-'+this.j.toString()+'-'+this.D}Nc(){return{name:'REGEX',property:this.Ca,pattern:this.j,caseSensitive:this.D}}fa(){return{pr:olympe.dc.query.za.j.sr,p:this.Ca,r:this.j.source,c:this.D}}clear(a,b){ih(this.db,a,this.Ca,olympe.U.rb(b+a+this.toString()))}};olympe.dc.query.Y.en=class extends olympe.dc.query.za{constructor(a){super();this.j=new Set(a.map(olympe.dc.ea))}zb(){return[]}Ic(a){return a instanceof olympe.dc.query.Y.en&&Array.from(a.j).every(b=>this.j.has(b))}mb(a){return this.j.has(a)}observe(a,b,c){c(this.j.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.j)}Nc(){return{name:'IS',tags:Array.from(this.j)}}fa(){return{pr:olympe.dc.query.za.j.Zr,t:Array.from(this.j)}}};olympe.dc.query.ma={};function $i(a){let b,c;const d=new Set(null!=(c=null==(b=a.D)?void 0:b.zb())?c:[]);let e;a.Gb&&d.add(null==(e=a.Gb)?void 0:e.Pa().W());return d}function cj(a){if(!a.ba){let b,c;a.ba=null!=(c=null==(b=a.D)?void 0:b.compile())?c:[]}return a.ba}function dj(a,b){for(const c of b)if(a.some(d=>d.Ic(c,!1)))return!0;return!1}
794
+ function ej(a,b){if(null===a.D)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.U.rb(h+f+d);e?a.D.observe(f,k,l=>{c||b(l,f,g,k)}):(c=!0,a.D.clear(f,k),c=!1,b(!1,f,g,k))}}function fj(a,b,c){if(null===a.Gb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Gb.Pa();h=olympe.U.rb(h+d);e?hh(a.db,f,k,()=>{ni(b)},h):ih(a.db,f,k,h);c(e,f,g,h)}}
795
+ olympe.dc.query.ma.Sm=class{constructor(a,b){this.db=olympe.dc.ha();this.j=a;this.optional=b;this.ba=this.Gb=this.D=this.id=null}static j(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.ma.Od(b,a.f);var c=a.o;const d=new olympe.dc.Ra.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.ma.De(b,d,a.s,c):new olympe.dc.query.ma.Hh(b,d,c);void 0!==a.p&&(b.D=wi(a.p));void 0!==a.c&&(c=b.T(),a=a.c,a=new olympe.dc.query.xf(c,new olympe.dc.Ra.Property(a.p),a.o),b.Gb=a);return b}N(){}H(){let a,
796
+ b,c,d;return`${this.j}-${this.optional}${null!=(c=null==(a=this.D)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Gb)?void 0:b.toString())?d:''}`}Nc(){}toJSON(){}fa(){const a={i:this.j,o:this.optional};null!==this.D&&(a.p=this.D.fa());null!==this.Gb&&(a.c=this.Gb.fa());return a}X(){}ia(){return new olympe.dc.query.ma.bn}Z(){}T(){this.id||(this.id=this.X());return this.id}R(){return this.optional}Ic(a){const b=cj(this);if(0===b.length)return!0;a=cj(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
797
+ dj(d,c)))return!1;return!0}filter(a){const b=this.N(),c=b.D;null===c?b.D=a:b.D=c instanceof olympe.dc.query.Y.Nd?new olympe.dc.query.Y.Nd(...Array.from(c.Y),a):new olympe.dc.query.Y.Nd(b.D,a);return b}sort(a,b){const c=this.N();c.Gb=new olympe.dc.query.xf(this.T(),a,b);return c}jh(){return this.Gb}mb(a){if(null!==this.D){var b=this.T();for(const c of oi(a,b))this.D.mb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.T();return ej(this,fj(this,a,(d,e,f,g)=>{(d?qi(a,e,c,f):a.remove(e,c,f))&&b(d,e,
798
+ f,g)}))}Ea(){}};olympe.dc.query.ma.Wh=class extends olympe.dc.query.ma.Sm{constructor(a,b,c){super(a,c);this.relation=b;this.wa=null}};olympe.dc.query.ma.Tm=class{has(){}H(){}j(){}Vc(){}D(){}remove(){}};olympe.dc.query.ma.Od=class extends olympe.dc.query.ma.Sm{constructor(a,b,c){super(a,!1);this.Ob=b;this.F=null!=c?c:null}N(){return new olympe.dc.query.ma.Od(this.j,this.Ob,this.F)}X(){return olympe.U.rb(this.j+'followRules')}ia(){return new olympe.dc.query.ma.iq(this.db,this.F)}Z(a,b){return b instanceof olympe.dc.query.ma.Od?[a]:[olympe.U.rb(a+'followRules')]}Ic(a){if(a instanceof olympe.dc.query.ma.Wh){const b=olympe.dc.ta.ORIGIN,c=olympe.dc.ta.DESTINATION,d=olympe.dc.fc.Zc,e=olympe.dc.fc.Li,f=
799
+ olympe.dm.Relation.j.yr,g=olympe.dm.Relation.j.es;a=a.relation;const h=a.La(),k=a.W();return h!==c||k!==d&&k!==e?!!(qh(this.db,a,this.Ob)&(a.La()===b?f:g)):!0}return a instanceof olympe.dc.query.ma.Od?this.Ob===a.Ob:!1}mb(a){const b=this.T();for(const c of oi(a,this.j))for(const d of mg(this.db,c,this.Ob))qi(a,d,b,c)}observe(a,b){const c=this.T(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?rh(this.db,g,this.Ob,(l,n,p,q,r)=>{p&&(p=q?qi(a,r,c,g):a.remove(r,c,g),null!==n&&ri(a,q,l,n,g,r),p&&d(e,q,r,h))},k):
800
+ sh(this.db,g,this.Ob,k);b(f,g,e,k)};return(e,f,g,h)=>{(e?qi(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,olympe.U.rb(h+f+this.toString()))}}fa(){return Object.assign(super.fa(),{f:this.Ob})}H(){return`followRulePart-${this.Ob}-${super.H()}`}Nc(){throw Error('Try to parse a part of an implicit query. Data connectors do not support those queries.');}toString(){return`FollowRule Part: ${this.db.name(this.Ob)} (${this.Ob})`}Ea(a){return a instanceof olympe.dc.query.ma.Od&&this.Ob===a.Ob}toJSON(){return{type:'follow rule',
801
+ rule:`${this.db.name(this.Ob)} (${this.Ob})`}}R(){return!1}filter(){olympe.ga.Wa('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ga.Wa('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.ma.Od.D='followRules';olympe.dc.query.ma.Hh=class extends olympe.dc.query.ma.Wh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.ma.Hh(this.j,this.relation,this.optional);a.D=this.D;a.Gb=this.Gb;return a}X(){return olympe.U.rb(this.j+this.relation.T())}Z(a,b){if(b instanceof olympe.dc.query.ma.Od)return[a];const c=[a+this.relation.T(),a+aj(this.relation).T()+!1,a+aj(this.relation).T()+!0,a+'followRules'].map(d=>olympe.U.rb(d));b instanceof olympe.dc.query.ma.De&&b.relation.Ea(this.relation)&&
802
+ c.push(a);return c}mb(a){const b=this.T();for(const c of oi(a,this.j))this.db.cb(c,this.relation).forEach(d=>{qi(a,d,b,c)});super.mb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.W(),e=this.relation.La(),f=this.toString();return(g,h,k,l)=>{const n=olympe.U.rb(l+h+f);g?T(this.db,h,this.relation,(p,q)=>{ri(a,p,d,e,h,q);c(p,q,h,n)},n):this.db.D(h,this.relation,n)}}fa(){return Object.assign(super.fa(),{t:this.relation.W(),d:this.relation.La()})}H(){return`followPart-${this.relation.T()}-${super.H()}`}Nc(){const a=
803
+ {recursive:!1,relation:this.relation,filter:cj(this).map(b=>b.map(c=>c.Nc())),optional:this.R()};this.Gb&&(a.sort={property:this.Gb.Pa(),order:this.Gb.Wi});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.W()})`,direction:this.relation.La()}}Ea(a){return a instanceof olympe.dc.query.ma.Hh&&this.relation.Ea(a.relation)}};olympe.dc.query.ma.De=class extends olympe.dc.query.ma.Wh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.F=c}ia(){return new olympe.dc.query.ma.Cr}N(){const a=new olympe.dc.query.ma.De(this.j,this.relation,this.F,this.optional);a.D=this.D;a.Gb=this.Gb;return a}X(){return olympe.U.rb(this.j+this.relation.T()+this.F)}Z(a,b){if(b instanceof olympe.dc.query.ma.Od)return[a];const c=[a+this.relation.T()+this.F,a+'followRules'].map(d=>olympe.U.rb(d));b instanceof olympe.dc.query.ma.De&&
804
+ b.relation.Ea(this.relation)&&c.push(a);return c}mb(a){const b=this.T();for(const c of oi(a,this.j))this.F&&qi(a,c,b,c),this.db.nh(c,this.relation).forEach(d=>{qi(a,d,b,c)});super.mb(a)}observe(a,b){const c=this.relation.W(),d=this.relation.La(),e=(f,g,h,k)=>{const l=olympe.U.rb(k+g);f?T(this.db,g,this.relation,(n,p)=>{ri(a,n,c,d,g,p);super.observe(a,(q,r,t,v)=>{b(q,r,t,v);e(q,r,t,k)})(n,p,h,l)},l):this.db.D(g,this.relation,l)};return(f,g,h,k)=>{h=k+this.toString();this.F&&super.observe(a,b)(f,g,
805
+ g,olympe.U.rb(h+g));e(f,g,g,h)}}fa(){return Object.assign(super.fa(),{s:this.F,t:this.relation.W(),d:this.relation.La()})}H(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.H()}`}Nc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:cj(this).map(b=>b.map(c=>c.Nc())),optional:this.R()};this.Gb&&(a.sort={property:this.Gb.Pa(),order:this.Gb.Wi});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',
806
+ relation:`${this.db.name(this.relation)} (${this.relation.W()})`,direction:this.relation.La()}}Ea(a){return a instanceof olympe.dc.query.ma.De&&this.relation.Ea(a.relation)&&this.F===a.F}};olympe.dc.query.ma.mm=class extends olympe.dc.query.ma.Od{observe(a,b){const c=this.T();return(d,e,f,g)=>{d?qi(a,e,c,e):a.remove(e,c,e);b(d,e,e,g)}}};olympe.dc.query.ma.iq=class{constructor(a,b){this.db=a;this.origin=null;this.content=new Map;this.F=null!=b?b:null}Vc(){return this.content.keys()}j(a){return this.content.has(a)&&null!==this.origin?[this.origin].values():[].values()}has(a){return this.content.has(a)}H(a){let b;return(null==(b=this.F)?void 0:b.call(this,a))||!1}D(a,b){null===this.origin&&(this.origin=b);const c=this.content.get(a);if(!c)return this.content.set(a,(new Map).set(b,1)),!0;let d;a=null!=(d=c.get(b))?d:0;c.set(b,a+1);return!1}remove(a,
807
+ b){a===this.origin&&(this.origin=null);if(null===this.origin||!this.db.Ja(a)||!b)return this.content.delete(a);var c=this.content.get(a);if(!c)return!1;const d=c.get(b);if(1<d)return c.set(b,d-1),!0;b=c.delete(b);if(0===c.size)return this.content.delete(a);if(b){c=new Set(c.keys());for(const e of c){if(this.origin===e)return!0;let f,g;for(const h of null!=(g=null==(f=this.content.get(e))?void 0:f.keys())?g:[])c.add(h)}return this.content.delete(a)}return!1}};olympe.dc.query.ma.iq.ya=[olympe.dc.query.ma.Tm];olympe.dc.query.ma.Cr=class{constructor(){this.content=new Map}Vc(){return this.content.keys()}j(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.keys())?c:[]}has(a){return this.content.has(a)}H(){return!1}D(a,b){let c=this.content.get(a);c||(c=new Map,this.content.set(a,c));let d;a=null!=(d=c.get(b))?d:0;c.set(b,a+1);return 0===a}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a),d=null==c?void 0:c.get(b);if(1<d)return c.set(b,d-1),!1;let e;b=null!=
808
+ (e=null==c?void 0:c.delete(b))?e:!1;0===(null==c?void 0:c.size)&&this.content.delete(a);return b}};olympe.dc.query.ma.Cr.ya=[olympe.dc.query.ma.Tm];olympe.dc.query.ma.bn=class{constructor(){this.content=new Map}Vc(){return this.content.keys()}j(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.values())?c:[]}has(a){return this.content.has(a)}H(){return!1}D(a,b){let c=this.content.get(a);c||(c=new Set,this.content.set(a,c));a=c.size;c.add(b);return a<c.size}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a);let d;b=null!=(d=null==c?void 0:c.delete(b))?d:!1;0===(null==c?void 0:c.size)&&this.content.delete(a);
809
+ return b}};olympe.dc.query.ma.bn.ya=[olympe.dc.query.ma.Tm];olympe.dc.sources={};olympe.dc.sources.fk=class{T(){}init(){}destroy(){}request(){return u(function*(){})}subscribe(){}};const gj=olympe.net.ua.Rd.GET,hj=olympe.net.ua.Rd.Sh,ij=olympe.net.ua.Rd.Dc,jj=olympe.net.ua.Rd.fr,kj=olympe.net.ua.Headers.Ii,lj=olympe.net.ua.Headers.vo,mj=olympe.net.ua.Tb.Qh,nj=olympe.net.ua.Tb.Po,oj=olympe.net.ua.Tb.kk,pj=olympe.net.ua.Tb.gj,qj=olympe.net.ua.Tb.Zi;
810
+ function rj(a){const b=`/${olympe.V.getParameter(olympe.dc.sources.Config.om)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.R.D('_DataSourcesHTTPService',b,[gj,hj,ij,jj],(c,d,e)=>u(function*(){const f=d.get('sourceId');var g=a.F.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ha().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.qd(`No handler found for datasource ${f} called '${g}'`,qj,'Invalid source id'))}h=c.method;const k=c.Cj();try{var l=
811
+ yield sj(a,k[lj])}catch(r){return new olympe.net.qd(`Invalid token ${r}`,oj,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.j.oc,t=olympe.dc.Request.j.Sg,v=olympe.dc.Request.j.df,x=olympe.dc.Request.j.dh,y=olympe.dc.Request.j.yh,z=olympe.dc.Request.j.cg,A=olympe.dc.Request.j.eg,K=olympe.dc.Request.j.og;let Y;switch(n){case r:break;case t:case v:case y:case x:Y=a.D.N(p);break;case K:case z:case A:Y={tag:e.get('tag'),model:e.get('model'),mimeType:k[kj]};p instanceof
812
+ Uint8Array&&(Y.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let ya;const db=null!=(ya=k['X-Source-Origin'])?ya:olympe.dc.Ia.Ze;var q=Sf(new olympe.dc.Request(n,f,Y,l),db);const Qa=yield g(q);let dd;void 0===Qa?dd='':Qa instanceof Blob||Qa instanceof Uint8Array||Qa instanceof ArrayBuffer||'function'===typeof(null==Qa?void 0:Qa.pipe)?dd=Qa:dd=JSON.stringify(a.D.fa(Qa));return new olympe.net.qd(dd,h===jj?nj:mj)}catch(r){return r instanceof olympe.error.uk?new olympe.net.qd(`Authorization error: ${r}`,
813
+ oj,'Forbidden'):new olympe.net.qd(`Internal server error: ${r}`,pj,'Internal server error')}})).catch(c=>a.G.error(`Error while starting the HTTP Service: ${c}`));a.G.debug(`Started HTTP service with path: ${b}`)}function tj(a){a.R.R('_DataSourcesHTTPService').catch(b=>{a.G.error(`An error occurred while stopping the data sources http service: ${b}`)})}function uj(a,b,c){0===a.F.size&&rj(a);a.F.set(b,c);return()=>{a.F.delete(b);0===a.F.size&&tj(a)}}
814
+ function vj(a,b,c){c=b instanceof olympe.dm.DataSource?b.Qf(c):wj(b,c);null===c&&a.G.error(`Impossible to build URL for data source ${b}`);return c}
815
+ function xj(a,b,c){if(b===olympe.dc.Ia.SERVER){var d;return null!=(d=se(a.H,a.ba.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.Z.jb(b);e=olympe.dc.sources.Config.Ih;const f=olympe.dc.sources.Config.Bf,g=olympe.dc.sources.Config.Qi,h=olympe.dc.sources.Config.om;let k;e=`${vj(a,null!=d?d:b,g)?'https':'http'}://${vj(a,null!=d?d:b,e)}:${null!=(k=vj(a,null!=d?d:b,f))?k:vj(a,null!=d?d:b,g)?443:80}`+`/${vj(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.N.set(b,e)}return`${e}/${c}`}
816
+ function yj(a,b){return b instanceof olympe.net.Si?ue(a.H,b,ee(a.X).Gd()):Promise.reject('No http request to send')}function zj(a,b){var c=xj(a,b.ic(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.ic()}`);const d=b.content,e=JSON.stringify(a.D.fa(d));c=N(c,hj,e,olympe.net.ua.ResponseType.JSON);Fc(c,{['X-Source-Origin']:b.origin,[kj]:'application/json'});return yj(a,c).then(f=>(f=f.getData())?a.D.N(f):olympe.dc.query.Dd.xj(d))}
817
+ function Aj(a,b){var c=xj(a,b.ic(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.ic()}`);const d=JSON.stringify(a.D.fa(b.content));c=N(c,hj,d);Fc(c,{['X-Source-Origin']:b.origin,[kj]:'application/json'});return yj(a,c).then(e=>Number.parseInt(e.getData(),10))}function sj(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.X.qh(b,(e,f)=>{e?d(e):c(f)})})}
818
+ olympe.dc.sources.Au=class{constructor(a,b,c,d,e,f){this.G=a;this.R=b;this.H=c;this.X=d;this.Z=e;this.D=f;this.F=new Map;new olympe.C.Xb('Http service of remote data provider');this.N=new Map;this.j=new Map;this.ba=new Map([[olympe.dc.Request.j.Jg,olympe.L.Yb.Jg],[olympe.dc.Request.j.eg,olympe.L.Yb.ik],[olympe.dc.Request.j.og,olympe.L.Yb.ik],[olympe.dc.Request.j.cg,olympe.L.Yb.ik],[olympe.dc.Request.j.xo,olympe.L.Yb.wo],[olympe.dc.Request.j.wr,olympe.L.Yb.vr],[olympe.dc.Request.j.Lp,olympe.L.Yb.Kp],
819
+ [olympe.dc.Request.j.Sg,olympe.L.Yb.Jo],[olympe.dc.Request.j.dh,olympe.L.Yb.TRANSACTION]])}Kc(a){var b=xj(this,a.ic(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.ic()}`);b=Hc(N(b,gj),olympe.net.ua.ResponseType.JSON);Fc(b,{['X-Source-Origin']:a.origin});return yj(this,b).then(c=>c.getData())}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.ic(),f=xj(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);
820
+ const g=N(e===olympe.dc.Ia.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,jj,d);Fc(g,{[kj]:'application/octet-stream'});e!==olympe.dc.Ia.SERVER&&Fc(g,{['X-Source-Origin']:a.origin});return yj(this,g).then(()=>(new URL(g.j())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=xj(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Ia.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,ij,b);d!==olympe.dc.Ia.SERVER&&Fc(e,
821
+ {['X-Source-Origin']:a.origin});return yj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=xj(this,d,a.getType());if(!e)return Promise.reject(Error(`No destination URL to download the file. ${b}`));var f;const g=null!=(f=this.j.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,li:k})});if(this.j.has(b))return f;this.j.set(b,g);e=N(d===olympe.dc.Ia.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,gj,void 0,olympe.net.ua.ResponseType.$h);d!==olympe.dc.Ia.SERVER&&
822
+ Fc(e,{['X-Source-Origin']:a.origin});yj(this,e).then(h=>{let k;null==(k=this.j.get(b))||k.forEach(l=>l.done(h.getData()))}).catch(h=>{let k;null==(k=this.j.get(b))||k.forEach(l=>l.li(`${h}`))}).finally(()=>{this.j.delete(b)});return f}};olympe.dc.sources.gq=class{constructor(a,b){this.G=a;this.Jb=b}};olympe.dc.sources.gq.Tb={ij:0,WC:1,XC:3,qC:4};const Bj=olympe.dc.Request.j.oc,Cj=olympe.dc.Request.j.Sg,Dj=olympe.dc.Request.j.Gk,Ej=olympe.dc.Request.j.og,Fj=olympe.dc.Request.j.eg,Gj=olympe.dc.Request.j.cg,Hj=olympe.dc.Request.j.Fi,Ij=olympe.dc.Request.j.yh,Jj=olympe.dc.Request.j.df,Kj=olympe.dc.Request.j.dh,Lj=olympe.dc.Request.j.ck;
823
+ function Mj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.U.Zh(6E4),hb(a.D,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),ib(a.D,()=>{a.D=null}));let d;const e=null!=(d=a.D.get(c))?d:new olympe.dc.db.ec(c);b.qc(e);fb(a.D.j,c)||a.D.set(c,e)}function Nj(a,b){return u(function*(){const c=Sf(new olympe.dc.Request(olympe.dc.Request.j.ck,a.T(),b),olympe.dc.Ia.SELF);let d;yield null==(d=a.Jb)?void 0:d.xi(c)})}
824
+ function Oj(a,b){const c=b.T();let d,e;const f=null!=(e=null==(d=a.D)?void 0:d.get(c))?e:new olympe.dc.db.ec(c);let g;null==(g=a.D)||g.delete(c);b.qc(f);return a.applyTransaction(f,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function Pj(a,b){const c=rxjs.defer(()=>a.j.executeQuery(b));return 0<a.N?rxjs.interval(a.N).pipe(rxjs.operators.switchMap(()=>c)):c}
825
+ olympe.dc.sources.vq=class{constructor(a,b){this.G=a;this.j=b;this.Jb=null;this.H=olympe.dc.query.ml();this.F=new olympe.C.Xb('Context of source '+this.T());let c;this.N=null!=(c=b.Qf(olympe.dc.sources.Config.Qm))?c:-1;this.D=null}T(){return this.j.T()}init(a){this.Jb=a;if(this.T()===olympe.dc.Ia.SELF)return this;(new Promise((b,c)=>{let d=!0;Qj(this.j,this.F).subscribe(rxjs.Subscriber.create(e=>{if(this.G.j()){this.G.debug(`Data source ${this.j.name()} has loaded ${e.size()} data types in its cache:`);
826
+ for(const [f,g]of e)this.G.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.j.init(this.F)).catch(b=>{this.G.error(`Error while initialization of DataSource ${this.j.name()} (${this.T()}): ${b}`)});return this}healthCheck(){return this.j.healthCheck().then(()=>`Data source ${this.j.name()} (${this.j.T()}) OK`)}destroy(){this.F.destroy();return this.j.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case Bj:const d=olympe.dm.DataSource.oc.Ab,e=olympe.dm.DataSource.oc.Vh;
827
+ return this.j.healthCheck().then(()=>({s:e})).catch(h=>({s:d,r:String(h)}));case Cj:return this.j.executeQuery(b);case Hj:const f=b.ac();Mj(this,f);Nj(this,Of(f)).catch(h=>{this.G.warn(`Error occurred when applying burst transaction ${f.T()} to the data source: ${h}`)});return Promise.resolve();case Jj:case Kj:const g=b.ac();return this.applyTransaction(g,c===Kj).finally(()=>{if(a.origin===olympe.dc.Ia.SELF){var h=g.T();h=Sf(new olympe.dc.Request(olympe.dc.Request.j.jk,olympe.dc.Ia.SELF,{id:h,finalize:olympe.dc.transaction.Jf.j.$i,
828
+ error:null}),this.T());let k;null==(k=this.Jb)||k.cd(h)}});case Ij:return Oj(this,b.ac());case Ej:return b.content instanceof Uint8Array?this.j.uploadFileContent(b.tag,b.model,b.content).then(()=>`datasource://${b.tag}`):Promise.reject('File content is undefined');case Fj:return this.j.downloadFileContent(b.tag,b.model);case Gj:return this.j.deleteFileContent(b.tag,b.model);case Lj:return c=Sf(new olympe.dc.Request(Lj,olympe.dc.Ia.SELF,b,a.xc()),this.T()),this.Jb.cd(c);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===
829
+ Dj){const b=a.content;a=a.origin;return a===olympe.dc.Ia.SELF?Pj(this,b):Di(this.H,b,this.F,a,olympe.dc.la.nc.wf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Se)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>Of(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return u(function*(){var d=Rj(a);yield c.j.applyTransaction(d,{batch:b});d=Date.now();yield Ni(c.H,c.T(),a);const e=
830
+ Of(a,d);yield Nj(c,e);return d})}};olympe.dc.sources.vq.ya=[olympe.dc.sources.fk];function Rj(a){const b=olympe.dc.sources.lg.j.Zt,c=olympe.dc.sources.lg.j.Uw,d=olympe.dc.sources.lg.j.eu,e=olympe.dc.sources.lg.j.$t,f=olympe.dc.sources.lg.j.fu,g=[],h=[],k=[],l=[],n=[];a.Bb.forEach((p,q)=>{const r=p.Vb();p.D()?g.push(Sj(b,q,r,p.N()?p.zb():null)):p.yd()?k.push(Sj(d,q,r,null,p.F())):p.N()&&h.push(Sj(c,q,r,p.zb()));for(const [t,v,x]of p.Id())p=a.Uc(v),x?l.push(new Tj(e,t,q,v,r,p.Vb())):n.push(new Tj(f,t,q,v,r,p.Vb()))});return n.concat(k,g,h,l)}
831
+ function Sj(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new Uj(a,b,c,d,e)}olympe.dc.sources.lg=class{constructor(a){this.type=a}};class Uj extends olympe.dc.sources.lg{constructor(a,b,c,d,e){super(a);this.object=b;this.model=c;this.properties=null!=d?d:null;this.deleteRules=null!=e?e:olympe.dc.Lb.NONE}}
832
+ class Tj extends olympe.dc.sources.lg{constructor(a,b,c,d,e,f){super(a);this.relation=b;this.from=c;this.to=d;this.fromModel=e;this.toModel=f}}olympe.dc.sources.lg.j={Zt:'CREATE',Uw:'UPDATE',eu:'DELETE',$t:'CREATE_RELATION',fu:'DELETE_RELATION'};function Vj(a,b){b=Sf(new olympe.dc.Request(olympe.dc.Request.j.jk,olympe.dc.Ia.SELF,{id:b,finalize:olympe.dc.transaction.Jf.j.$i,error:null}),a.T());let c;null==(c=a.Jb)||c.cd(b)}
833
+ olympe.dc.sources.Ul=class{constructor(a,b){this.G=a;this.D=b;this.Jb=null}T(){}X(){}Z(){}init(a){this.Jb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return u(function*(){if(!b.D.j)return b.X(a);var c=olympe.dc.Request.j.oc,d=olympe.dc.Request.j.Sg;const e=olympe.dc.Request.j.df,f=olympe.dc.Request.j.dh;var g=olympe.dc.Request.j.Fi;const h=olympe.dc.Request.j.yh,k=olympe.dc.Request.j.og;var l=olympe.dc.Request.j.eg;const n=olympe.dc.Request.j.cg,p=olympe.dc.sources.ce(),
834
+ q=a.getType(),r=a.ic();if(Pd(b.D)){q===d&&(c=a.content,(g=Uf(a).get(olympe.dc.la.j.Pl))&&(yield Wj(p,c.T(),g)),b.G.debug(`Data Provider: Query ${c.T()} will be executed with its default Remote or Server provider`));if(q===l&&(l=a.content,'string'===typeof(null==l?void 0:l.url)&&l.url.startsWith('offline://')))return p.downloadFileContent(l.tag);l=yield b.X(a);if(q===d){const t=a.content;d=l;const v=new olympe.dc.db.ec(`fullResult_${t.T()}`);l=d.pipeThrough(new TransformStream({transform:(x,y)=>u(function*(){const z=
835
+ x.ac();yield Xj(p,z);z.qc(v);b.G.j()&&b.G.debug(`Data Provider: Data result for query ${t.T()}`,z.Bb.size,'instances',Array.from(z.Id()).length,'relations');y.enqueue(x)}),flush:()=>u(function*(){yield Yj(p,t.T(),r,v,!0)})}))}else if(q===e||q===f||q===h)b.G.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield Zj(p,null,r,a.content.ac(),!1);return l}b.G.debug(`Data Provider: Request (type: ${q}) will be sent to the cache data provider: ${a.content}`);switch(q){case c:return{s:olympe.dm.DataSource.oc.Ef};
836
+ case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.ac().T();return p.applyTransaction(d,r).finally(()=>Vj(b,t));case g:return Promise.resolve();case k:return d=a.content,p.uploadFileContent(d.tag,d.content,d.mimeType);case l:return p.downloadFileContent(a.content.tag);case n:return p.deleteFileContent(a.content.tag);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${b.T()}`)}})}subscribe(a,b){if(!this.D.j)return this.Z(a,
837
+ b);const c=olympe.dc.sources.ce(),d=a.content,e=a.ic();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(Pd(this.D)){const f=new rxjs.Observable(h=>{olympe.C.ot([this.D.qf()],()=>{h.error(new olympe.error.Op('Go Offline',d.T()))})}),g=this.Z(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.C.ot([this.D.qf()],()=>{f.error(new olympe.error.Io('Back Online',d.T()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(Zj(c,d.T(),e,f.ac()).then(()=>f).catch(g=>{this.G.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);
838
+ throw g;}))))}};olympe.dc.sources.Ul.ya=[olympe.dc.sources.fk];const ak=olympe.dc.Request.j.oc,bk=olympe.dc.Request.j.Sg,ck=olympe.dc.Request.j.Gk,dk=olympe.dc.Request.j.df,ek=olympe.dc.Request.j.dh,fk=olympe.dc.Request.j.Fi,gk=olympe.dc.Request.j.yh,hk=olympe.dc.Request.j.og,ik=olympe.dc.Request.j.eg,jk=olympe.dc.Request.j.cg;function kk(a,b){let c;return(null==(c=a.Ha.jb(b))?void 0:c.Qf(olympe.dc.sources.Config.Ve))!==olympe.dm.DataSource.Ve.Rp}
839
+ function lk(a,b){let c;return(null==(c=a.Ha.jb(b))?void 0:c.Qf(olympe.dc.sources.Config.Ve))!==olympe.dm.DataSource.Ve.Ao}function mk(a,b,c){const d=c.content.ac().T();let e=a.ba.get(d);e||(e=olympe.L.qb.$s(b),a.ba.set(d,e));return e.ld(c)}function nk(a,b){b=b.xc();if(b!==olympe.dm.User.j&&a.Qf(olympe.dc.sources.Config.Xm))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.T()}). Please use an admin account instead.`,new olympe.error.uk(a);}
840
+ function ok(a,b,c,d,e){return u(function*(){var f=olympe.L.va.j.SEND,g=olympe.L.va.j.GET;const h=olympe.L.va.j.PUBLISH,k=olympe.L.va.j.SUBSCRIBE,l=d.qt();var n=d.body();if(e!==n.xc())throw Error('Access denied: try to impersonate a user');nk(c,n);let p;if(null==(p=a.Jb)||!p.sources.has(n.ic()))throw Error(`Try to process a message with destination data source ${n.ic()} coming from remote but not started here`);if(l===k){if(n.getType()===ck)f=n.content.T();else throw Error('Not supported type of subscription');
841
+ g=yield d.Un(f);a.ia.set(g,f);g=a.N.get(f);g||(g=new pk(a.G,f,b,Sf(n,olympe.dc.Ia.Ze)),a.N.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.cd(n):a.G.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.ack()):l===h&&(yield b.request(n))})}
842
+ olympe.dc.sources.Fr=class extends olympe.dc.sources.Ul{constructor(a,b,c,d,e,f){super(a,d);this.H=b;this.j=c;this.db=e;this.F=new olympe.C.Xb('Remote Provider Context');this.wa=new Map;this.R=new Map;this.N=new Map;this.ia=new Map;this.Ha=f;this.ba=new Map}T(){return olympe.dc.Ia.Ze}X(a){var b=olympe.L.qb;const c=a.ic();var d=a.getType();this.G.j()&&this.G.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case ak:const e=olympe.dm.DataSource.oc.Ab,f=
843
+ olympe.dm.DataSource.oc.Vh;b=kk(this,c)?b.get(c,a):Promise.resolve({s:f});a=lk(this,c)?this.j.Kc(a):Promise.resolve({s:f});return Promise.all([b,a]).then(([k,l])=>{if((null==k?void 0:k.s)===e||(null==l?void 0:l.s)===e){let n,p;return{s:e,r:`${null!=(n=null==k?void 0:k.r)?n:''} ${null!=(p=null==l?void 0:l.r)?p:''}`}}return{s:f}});case bk:return lk(this,c)?zj(this.j,a):b.get(c,a);case dk:const g=a.content.ac().T();return(kk(this,c)?b.get(c,a):Aj(this.j,a)).finally(()=>Vj(this,g));case ek:const h=a.content.ac().T();
844
+ return(lk(this,c)?Aj(this.j,a):b.get(c,a)).finally(()=>Vj(this,h));case fk:return kk(this,c)?mk(this,c,a).catch(k=>{this.G.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case gk:return d=a.content.ac().T(),this.ba.delete(d),kk(this,c)?b.get(c,a):Aj(this.j,a);case hk:return lk(this,c)?this.j.uploadFileContent(a):b.get(c,a);case ik:return lk(this,c)?this.j.downloadFileContent(a):b.get(c,a);case jk:return lk(this,c)?this.j.deleteFileContent(a):
845
+ b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.T()}`)}}Z(a,b){const c=a.ic(),d=a.getType();if(!kk(this,c))return rxjs.throwError(()=>Error(`Subscription request not supported for data source ${this.db.name(c)} (${c}) which uses HTTP only.`));this.G.j()&&this.G.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===ck?olympe.L.qb.observe(c,this.F,a,{onRetry:b}).observable:rxjs.throwError(()=>
846
+ Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.F)return this;olympe.dc.la.from(this.H,this.H).bb(olympe.dm.DataSource.Mj).filter(olympe.dc.query.za.Ea(olympe.dm.DataSource.gi,!0)).filter(olympe.dc.query.za.Ea(olympe.dm.DataSource.Js,!0)).observe(this.F).subscribe(b=>{b.yj().forEach(this.lb.bind(this,a));b.Ej().forEach(c=>{let d;null==(d=this.wa.get(c))||d.destroy();this.wa.delete(c)})});this.db.Pa(this.H,olympe.dm.DataSource.Js)&&(new olympe.L.qb(this.H,this.F)).listen().subscribe(b=>
847
+ {b=b.body();b instanceof olympe.dc.Request?a.cd(b):this.G.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return u(function*(){})}lb(a,b){const c=b.W(),d=new olympe.C.Xb(`Published data provider context ${c}`,this.F);this.wa.set(c,d);let e;qk(b,d).subscribe(f=>{let g;null==(g=e)||g();let h;null==(h=this.R.get(c))||h.stop();this.R.delete(c);f!==olympe.dm.DataSource.Ve.Ao&&(e=uj(this.j,c,k=>{nk(b,k);return a.request(k)}),d.onDestroy(()=>{let k;return null==
848
+ (k=e)?void 0:k()}));f!==olympe.dm.DataSource.Ve.Rp&&(f=new olympe.C.Xb(`Bus Service of data source ${c}`,d),f=(new olympe.L.qb(c,f)).yt(this.Ua.bind(this)),this.R.set(c,f),f.listen().subscribe(k=>{k.Bi().then(l=>ok(this,a,b,k,l)).catch(l=>{this.G.warn(`Error occurred while processing request from ${k.source()}: ${l}`);return k.li(l instanceof Error?l:Error(l))})}))})}xi(a){const b=this;return u(function*(){let c;yield null==(c=b.R.get(a.ic()))?void 0:c.xi(a)})}Ua(a){const b=this.ia.get(a);this.ia.delete(a);
847
849
  if(a=b)null==(a=this.N.get(b))?a=0:(0<a.j&&--a.j,0===a.j?(a.G.debug(`Data subscription ${a.D} has more subscriber: unsubscribe`),a.F.unsubscribe(),a=!0):(a.G.debug(`Data subscription ${a.D} has ${a.j} subscribers`),a=!1));a&&this.N.delete(b)}};
848
- class nk{constructor(a,b,c,d){this.G=a;this.D=b;this.j=0;this.F=c.subscribe(d).subscribe({next:e=>{olympe.L.qb.kd(b,e).catch(f=>a.error(`Error occurred while publishing a data notification: ${f}`))},error:e=>a.error(`Error occurred while trying to subscribe to topic ${b} for a datasource: ${e}`)})}subscribe(){this.j++;this.G.debug(`Data subscription ${this.D} has ${this.j} subscribers`);return this}}olympe.dc.sources.Er.ya=[olympe.dc.sources.fk];const W={ss:10,No:11,tp:12,kr:13,QUERY_RESULT:14,Lp:15,bp:16,df:17,lr:18,ap:19,fj:20};function pk(a,b){const c=new olympe.dc.transaction.He,d=new olympe.dc.transaction.He;b.forEach(e=>{const f=new Map(Array.from(Object.entries(e.p).map(([h,k])=>[h,a.j(k)]))),g=e.v?d:c;g.Rc(e.t,e.s,f,e.m);e.r.forEach(h=>g.Oa(h.r,h.o,h.d))});a.Z.md(Vf(Wf(d),olympe.dc.Ia.SELF),{persist:!1});a.Z.md(Vf(Wf(c),olympe.dc.Ia.SELF))}
849
- olympe.dc.sources.cc=class extends olympe.L.cc{constructor(a){super();this.Z=a;this.db=a.view;this.F=new Map}fa(a){a=super.fa(a);if(0<this.F.size){const b=Array.from(this.F.values());this.F.clear();return Object.assign(this.format(W.ss,a),{i:b})}return a}N(a){return(null==a?void 0:a.t)===W.ss&&Array.isArray(null==a?void 0:a.i)?(pk(this,a.i),this.j(a.v)):this.j(a)}D(a){switch(!0){case a instanceof olympe.dm.File:var b=this.format,c=W.tp;{const d=a.W(),e={t:d};if(!this.F.has(d)&&(this.H(d),!this.db.Re(d))){const f=
850
- a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))a=olympe.dc.Qs().Ha(a),this.F.get(d).p[olympe.dm.File.urlProp.W()]='stream://'+d,e.s=this.D(a)}a=e}return b.call(this,c,a);case a instanceof olympe.dc.CloudObject:return this.format(W.No,this.H(a.W()));case a instanceof olympe.dc.la:return this.format(W.kr,a.fa());case a instanceof olympe.dc.Ka:return this.format(W.QUERY_RESULT,a.fa(this.H.bind(this)));case a instanceof olympe.dc.db.ec:return b=new olympe.dc.transaction.He,
851
- a.qc(b),this.format(W.Lp,{i:a.T(),p:Wf(b)});case a instanceof olympe.dc.Request:return this.format(W.bp,{r:a.getType(),o:a.origin,d:a.ic(),u:a.xc(),c:this.D(a.content)});case a instanceof olympe.dc.transaction.lj:return this.format(W.df,{r:a.th(),p:this.D(a.ac())});case a instanceof olympe.dc.query.Dd:return this.format(W.lr,a.fa());case a instanceof olympe.dc.Hg:return this.format(W.ap,a.fa());case a instanceof olympe.dc.vc:return this.format(W.fj,this.H(a.W()));default:return super.D(a)}}j(a){if(null===
852
- a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case W.tp:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.Qs().yb(d,a));return olympe.dc.CloudObject.get(d);case W.No:return olympe.dc.CloudObject.get(c);case W.kr:return d=c.p.map(olympe.dc.query.ma.Pm.j),a=c.e,new olympe.dc.la(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Ld:a.s,Te:a.rm});case W.QUERY_RESULT:return Ni(c);case W.Lp:return(new olympe.dc.transaction.dj).j(c.p,c.i);case W.bp:return a=null!=(d=this.j(c.c))?d:void 0,
853
- Qf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case W.df:return d=this.j(c.p),new olympe.dc.transaction.lj(d,c.r);case W.lr:return olympe.dc.query.Dd.j(c);case W.ap:return olympe.dc.Hg.j(c);case W.fj:return new olympe.dc.vc(c);default:return super.j(a)}}H(a){if(this.F.has(a))return a;if(!this.db.Ja(a))throw new olympe.dc.Wq(a);const b={};this.db.zb(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of sh(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.ua.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
854
- d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.Re(a)||(c.v=!0);this.F.set(a,c);return a}};const qk=olympe.dc.Request.j.Jg,rk=olympe.dc.Request.j.df,sk=olympe.dc.Request.j.dh,tk=olympe.dc.Request.j.Fi,uk=olympe.dc.Request.j.wo,vk=olympe.dc.Request.j.vr,wk=olympe.dc.Request.j.Sg,xk=olympe.dc.Request.j.Gk,yk=olympe.dc.Request.j.Kp,zk=olympe.dc.Request.j.uu,Ak=olympe.dc.Request.j.vu,Bk=olympe.dc.Request.j.wu,Ck=olympe.dc.Request.j.bg,Dk=olympe.dc.Request.j.dg,Ek=olympe.dc.Request.j.ng,Fk=olympe.dc.Request.j.jk,Gk=olympe.dc.Request.j.Rw,Hk=olympe.dc.Request.j.fw,Ik=olympe.dc.Request.j.Fp,Jk=
855
- olympe.dc.Request.j.yh,Kk=olympe.dc.Request.j.Xt,Lk=olympe.dc.Request.j.oc;function Mk(a){return Nk(a,olympe.dc.Request.j.Jg).then(b=>{b=b.getData().p;const c=Vf(b,a.T());a.G.j()&&a.G.debug('< Get Context result',b);a.G.N()&&a.G.log('< Get Context result has',b.length,'operations');return c})}function Ok(a,b){const c=new olympe.dc.transaction.He({le:!1,hi:!1}),d=b.ac(),e=b.j;d.qc(c);return Pk(a,rk,{i:d.T(),r:b.th(),p:Wf(c),bd:e?!0:void 0}).then(f=>f.ct)}
856
- function Qk(a,b){const c=b.ac(),d=new olympe.dc.transaction.He({wl:!0,le:!1,hi:!1});c.qc(d);b=b.j?'bd=true':'';return Nk(a,sk,Wf(d),b,olympe.net.va.ResponseType.Zr).then(e=>{try{const f=e.getData();let g;return null!=(g=JSON.parse(f).ct)?g:Date.now()}catch(f){return Date.now()}}).finally(()=>{Rk(a,Fk,{id:c.T(),finalize:olympe.dc.transaction.If.j.$i})})}
857
- function Sk(a,b){const c=new olympe.dc.transaction.He({le:!1,hi:!1}),d=b.ac();d.qc(c);return Pk(a,tk,{i:d.T(),r:b.th(),p:Wf(c)},!1).catch(e=>a.G.error(`Error while publishing burst transaction: ${e}`))}function Tk(a,b){const c=new olympe.dc.transaction.He({le:!1,hi:!1});b=b.ac();b.qc(c);return Pk(a,Jk,{i:b.T(),p:Wf(c)}).then(d=>d.ct)}
858
- function Uk(a,b){const c=encodeURI(ab(olympe.U.jf(),JSON.stringify(Vk(a,b))));a.G.j()&&a.G.debug(`Static GraphDef query ${b} sent to orchestrator`);return Nk(a,wk,void 0,`query=${c}&v=${a.version}`,olympe.net.va.ResponseType.je).then(d=>Wk(a,d))}function Xk(a,b){const c=b.T();a.G.j()&&a.G.debug(`Query (${c}) sent to orchestrator: ${b}`);const d=Vk(a,b);return vb(a.sa,()=>Nk(a,yk,d,void 0,olympe.net.va.ResponseType.je)).then(e=>Wk(a,e))}
859
- function Yk(a,b){if(!ye(a.F))return a.G.error(`Server is disconnected, backup of instance ${b} is canceled.`),Promise.reject('Server is disconnected');b=Vk(a,olympe.dc.la.from(b));b.f=olympe.dc.Lb.gp;b=N(vj(a.j,olympe.dc.Ia.SERVER,uk),olympe.net.va.Rd.Sh,JSON.stringify(b),olympe.net.va.ResponseType.$h);Fc(b,{[olympe.net.va.Headers.Ii]:olympe.net.va.Ul.JSON});return wj(a.j,b).then(c=>c.getData())}
860
- function Zk(a,b,c,d){if(!ye(a.F))return a.G.error('Server is disconnected, restore of instance is canceled.'),Promise.reject('Server is disconnected');const e=vj(a.j,olympe.dc.Ia.SERVER,vk);b=N(e+`?debug=${c}&optional=${d}`,olympe.net.va.Rd.Sh,b);Fc(b,{[olympe.net.va.Headers.Ii]:olympe.net.va.Ul.ax});return wj(a.j,b).then(f=>f.getData())}
861
- function Pk(a,b,c,d=!0){const e=olympe.L.Ee.Gg,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{Be(a.F,e,f,(k,l)=>{k?h(k):g(l)})});Be(a.F,e,f);return Promise.resolve()}
862
- function Vk(a,b){var c=ii(b);b={i:b.T(),b:[b.D],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.ma.Od)Object.assign(b,{f:c[0].Ob,q:[]});else{const d=(h,k)=>{h.every(l=>!l.Ea(k))&&h.push(k);return h},e=new Map;for(let h=c.length-1;0<=h;h--){const k=c[h],l=k.j;let n;const p=d(null!=(n=e.get(l))?n:[],k);if(k instanceof olympe.dc.query.ma.Ce&&k.F){let q;null==(q=e.get(k.T()))||q.forEach(r=>d(p,r))}e.set(l,p)}let f,g;c=null!=(g=e.get(null==(f=c[0])?void 0:f.j))?g:[];Object.assign(b,{f:olympe.dc.Lb.NONE,q:c.map(a.da.bind(a,
863
- e))})}return b}function Rk(a,b,c){b=Qf(new olympe.dc.Request(b,olympe.dc.Ia.SELF,c),a.T());let d;null==(d=a.Jb)||d.cd(b)}
864
- function Nk(a,b,c,d,e){const f=vj(a.j,a.T(),b);if('string'!==typeof f)return Promise.reject(`ServerProvider: no url for type ${b}`);b=N(`${f}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.va.Rd.Sh:olympe.net.va.Rd.GET,c&&JSON.stringify(c));Fc(b,{[olympe.net.va.Headers.Ii]:'application/json'});Hc(b,null!=e?e:olympe.net.va.ResponseType.JSON);return wj(a.j,b)}
865
- function Wk(a,b){return u(function*(){const c=b.headers.graphId,d=b.getData();let e,f;return(null!=(f=null==(e=a.Ha)?void 0:wb(e,d))?f:olympe.U.stream.Ak.transform(b.getData())).pipeThrough(new TransformStream({transform:(g,h)=>{a.G.debug(`Received ${g.length} operations for patch ${c}`);h.enqueue(Vf(g,a.T(),null,c))}}))})}
866
- function $k(a,b,c){return u(function*(){const d=b.pi;let e;if(c instanceof olympe.U.stream.lg){e=new olympe.dc.db.ec(d);try{for(const f=ha(c);;){const g=yield f.next();if(g.done)break;a.R.j(g.value.p,d).qc(e)}}catch(f){a.G.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.ec(d)}}else e=a.R.j(b.p,d);return Mf(e,b.ct)})}
867
- olympe.dc.sources.Sr=class extends olympe.dc.sources.Rl{constructor(a,b,c,d,e,f,g){super(a,c);this.F=b;this.j=d;this.R=new olympe.dc.transaction.dj(this.T());this.H=new Map;this.N=new Set;this.version=e||'unknown';this.Ha=g?new olympe.U.stream.$w:null;this.sa=new olympe.U.promise.Wr(f);olympe.C.Gj(this.D.Vf(),()=>{this.H.forEach((h,k)=>{h.error(new olympe.error.Ph('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ia.SERVER}X(a){var b=a.getType();const c=a.content,d=Sf(a);switch(b){case Lk:return a=
868
- olympe.dm.DataSource.oc.Ab,b=olympe.dm.DataSource.oc.Vh,Promise.resolve(ye(this.F)?{s:b}:{s:a,r:'Disconnected'});case qk:return Mk(this);case rk:return Ok(this,c);case sk:return Qk(this,c);case tk:return Sk(this,c);case Jk:return Tk(this,c);case wk:return d.get(olympe.dc.la.j.gq)?Uk(this,c):Xk(this,c);case uk:return Yk(this,c);case vk:return Zk(this,c.DF,c.debug,c.optional);case Gk:case Hk:case Ik:case Kk:return Pk(this,b,{});case Dk:return this.j.downloadFileContent(a);case Ck:return this.j.deleteFileContent(a);
869
- case Ek:return this.j.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Z(a,b){if(a.getType()===xk){const c=a.content,d=c.T();return(new rxjs.Observable(e=>{const f=Vk(this,c);this.N.delete(d);this.H.set(d,e);Pk(this,zk,f).catch(g=>e.error(g))})).pipe(sb(olympe.error.Ph,(e,f)=>{this.G.debug(`Subscribe to topic ${e.T()} now that we are back online, after waiting for ${f}ms`);b()}),rxjs.operators.finalize(()=>{this.N.add(d);Pk(this,Ak,{i:d}).catch(e=>
870
- {this.G.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.N.has(d)&&this.H.delete(d);this.N.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);we(this.F,olympe.L.Ee.Gg,this.ia.bind(this));return this}destroy(){return u(function*(){})}ia(a,b){const c=olympe.dc.Request.j.yo,d=olympe.dc.Request.j.Cm,e=a.c;if(e===olympe.dc.Request.j.ck)$k(this,a,b).then(f=>{Rk(this,e,f)});else if(e===c)b=this.R.j(a.p,a.i),
871
- b=Mf(b,a.ct),Rk(this,e,{rollback:b,error:a.error});else if(e===Bk){const f=a.i;$k(this,a,b).then(g=>{let h;null==(h=this.H.get(f))||h.next(g)})}else e===d&&Rk(this,Fk,{id:a.i,finalize:olympe.dc.transaction.If.j.Cm,error:0<a.s?a.error:null})}da(a,b){if(b instanceof olympe.dc.query.ma.Wh){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.W(),d:c.La()===olympe.dc.ua.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.da.bind(this,a))}}return{}}};olympe.dc.sources.Sr.ya=[olympe.dc.sources.fk];function al(a,b,c){const d=new olympe.C.Wb(`Source solver ${b.W()}`);b.bb(olympe.dm.Ad.F.$b()).bb(olympe.dm.Ad.D).me().back().bb(olympe.dm.Ad.j).me().observe(d,{ld:c,Bc:!0}).subscribe(e=>{e.yj().forEach(([f,g])=>{a.D.set(f.W(),g.T())});e.Ej().forEach(([f])=>{a.D.delete(f)})});b.bb(olympe.dm.hb.D).observe(d,{ld:c,Bc:!0}).subscribe(e=>{let f,g;a.F=null!=(g=null==(f=e.Ic())?void 0:f.T())?g:null});d.onDestroy(()=>{a.D.clear();a.F=null})}
872
- olympe.dc.sources.Sk=class{constructor(a,b,c){this.db=a;this.j=b;this.N=c;this.D=new Map;this.F=null;this.H=!1}fromModel(a){a=olympe.dc.ea(a);return this.D.has(a)?this.D.get(a):this.F&&this.R(a)?this.F:this.N}Qe(a){let b;return null!=(b=this.db.source(a))?b:this.N}jb(a){return a===this.j?olympe.dc.CloudObject.get(this.j):a===olympe.dc.Ia.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ja(a)&&this.db.Nb(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}R(){return!1}init(){if(!this.H){this.H=
873
- !0;var a=new olympe.dc.Ya;X(a.create(olympe.dm.DataSource,this.j).yi(this.j),olympe.dm.DataSource.gi,!0);a.Oa(olympe.dm.DataSource.Mj,this.j,this.j);a.lb(()=>{olympe.dc.la.from(this.j).observe(olympe.C.kh()).subscribe(()=>{})})}}};olympe.dc.sources.P={Ca:'dc.sources.Logger',nm:'dc.sources.HTTPService',Ku:'dc.sources.IOService',tr:'dc.sources.RemoteProvider',Lr:'dc.sources.ServerProvider',rC:'dc.sources.OfflineProvider',af:'dc.sources.SourceSolver',Le:'dc.sources.Serializer',Zo:'dc.sources.cache.Cache',$o:'dc.sources.cache.DATABASE',Nl:'dc.sources.cache.Logger'};
874
- olympe.dc.sources.Config={Ih:'data.httpHost',Af:'data.httpPort',Qi:'data.httpSSL',km:'data.httpBasePath',Nm:'data.pollingFrequency',Ve:'data.communicationMode',Um:'data.restrictedUse',VERSION:'version.version',Qr:'data.streamWorker',Vq:'data.queryConcurrencyLimit'};olympe.dc.sources.Kh={Wv:'olympe.internal.data.',Ih:'olympe.internal.data.httpHost',Af:'olympe.internal.data.httpPort',Qi:'olympe.internal.data.httpSSL'};
875
- olympe.V.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.Config.ym),d=`-${olympe.host.Wg.Th}`;E(a,olympe.dc.sources.Config.Ih,null);E(a,olympe.dc.sources.Config.Af,null);E(a,olympe.dc.sources.Config.Qi,null);E(a,olympe.dc.sources.Config.km,'runtime/data');E(a,olympe.dc.sources.Config.Qr,!1);E(a,olympe.dc.sources.Config.Vq,10);Ya(a,olympe.dc.sources.Kh.Ih,[olympe.host.Config.Jk,olympe.L.Config.Yl,olympe.dc.sources.Config.Ih],(e,f,g)=>{if(g)return g;e=e===olympe.host.Wg.Th;
876
- return f.endsWith(c)&&e?f+d:f});Ya(a,olympe.dc.sources.Kh.Af,[olympe.dc.sources.Kh.Ih,olympe.dc.sources.Config.Af],(e,f)=>{if(f)return f;f=b.includes(e);const g=e.endsWith(d);e=e.endsWith(c);return f?3141:g?85:e?80:443});Ya(a,olympe.dc.sources.Kh.Qi,[olympe.dc.sources.Kh.Af,olympe.dc.sources.Config.Qi],(e,f)=>null!==f?f:443===e);E(a,olympe.dc.sources.Config.Nm,null);E(a,olympe.dc.sources.Config.Ve,null);E(a,olympe.dc.sources.Config.Um,null);D(a,olympe.dc.sources.P.Ca,[olympe.ha.P.Fa],e=>e.ad('data'));
877
- C(a,olympe.dc.sources.P.Le,olympe.dc.sources.cc,olympe.dc.db.P.Fa);Wa(a,olympe.L.P.Le,olympe.dc.sources.P.Le);C(a,olympe.dc.sources.P.nm,olympe.dc.sources.zu,olympe.dc.sources.P.Ca,olympe.net.P.nj,olympe.L.P.mm,olympe.auth.P.Fa,olympe.dc.sources.P.af,olympe.L.P.Le,new olympe.V.oa(olympe.L.Config.Il));C(a,olympe.dc.sources.P.Ku,olympe.dc.sources.fq,olympe.dc.sources.P.Ca,olympe.dc.P.Ug,olympe.net.P.Fa,olympe.auth.P.Fa);C(a,olympe.dc.sources.P.tr,olympe.dc.sources.Er,olympe.dc.sources.P.Ca,new olympe.V.oa(olympe.dc.Config.Xg),
878
- olympe.dc.sources.P.nm,olympe.L.P.uf,olympe.dc.P.Ch,olympe.dc.sources.P.af);C(a,olympe.dc.sources.P.Lr,olympe.dc.sources.Sr,olympe.dc.sources.P.Ca,olympe.L.P.Nk,olympe.L.P.uf,olympe.dc.sources.P.nm,new olympe.V.oa(olympe.dc.sources.Config.VERSION),new olympe.V.oa(olympe.dc.sources.Config.Vq),new olympe.V.oa(olympe.dc.sources.Config.Qr));C(a,olympe.dc.sources.P.af,olympe.dc.sources.Sk,olympe.dc.P.Ch,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.Config.$l));D(a,olympe.dc.sources.P.Nl,
879
- [olympe.ha.P.Fa],e=>e.ad('datacache'));C(a,olympe.dc.sources.P.Zo,olympe.dc.sources.cache.Cache,olympe.dc.sources.P.Nl,olympe.dc.P.Ug,olympe.dc.sources.P.$o,olympe.dc.db.P.Fa,olympe.net.P.Fa,olympe.L.P.uf,olympe.Db.P.zm,olympe.U.P.Dg,new olympe.V.oa(olympe.net.Config.Sq),new olympe.V.oa(olympe.dc.sources.Config.VERSION));C(a,olympe.dc.sources.P.$o,olympe.dc.sources.cache.yk,olympe.Db.P.$g,olympe.dc.sources.P.Nl,olympe.Db.P.qk)},'olympe.dc.sources');
880
- olympe.V.run([olympe.dc.sources.P.af,olympe.dc.sources.P.Zo],(a,b)=>{olympe.dc.ee=()=>a;olympe.dc.sources.ce=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.an=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.bu=class extends olympe.dc.sources.cache.errors.an{};olympe.dc.sources.cache.errors.Ow=class extends olympe.dc.sources.cache.errors.an{};olympe.dc.sources.cache.errors.Xw=class extends olympe.dc.sources.cache.errors.an{};function bl(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a}switch(a.t){case 1:return new Date(a.d);case 2:return olympe.C.Color.Pb(a);case 17:return new olympe.dc.vc(a.v);case 13:return(new olympe.dc.transaction.dj).j(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
881
- olympe.dc.sources.cache.Up=class{fa(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.C.eb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.C.Color:return Object.assign({t:2},a.toJSON());case a instanceof olympe.dc.vc:return{t:17,v:a.W()};case a instanceof olympe.dc.db.ec:const b=new olympe.dc.transaction.He;a.qc(b);
882
- return{t:13,i:a.T(),v:Wf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function Uj(a,b,c){return u(function*(){cl(a,'queries',b);yield a.init();const d=a.D.has(c)?a.D.get(c):new Set;d.has(b)||(d.add(b),a.D.set(c,d),a.N.next(dl(a)));return el(a.j,b,c)})}function Vj(a,b){return u(function*(){yield a.init();a.G.debug(`Cache: subtract pending transaction operations from ${b.T()}`);b.R(a.F)})}
883
- function Wj(a,b,c,d,e=!1){(()=>u(function*(){a.G.debug(`Cache: handle query ${b} graph patch: ${d.T()}`);try{const f=null===b?[]:Array.from(a.D.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.Z)a.G.debug('Cache: persist graph patch',d.T()),e&&b&&(Array.from(d.Uc()).filter(h=>!h.yd()).map(h=>h.tag()),yield fl(a.j)),yield gl(a.j,d,0<f.length?b:null),hl(a,d,c).catch(h=>{a.G.error(`Cache: Failed to download files of a graph patch: ${h}`)})}catch(f){a.G.error(`Cache: Failed to handle graph patch ${d.T()} with message: ${f}`),
884
- a.vd.next(f)}finally{b&&il(a,'queries',b)}}))().then(()=>{})}function Xj(a,b,c,d,e=!1){return u(function*(){yield Vj(a,d);Wj(a,b,c,d,e)})}function jl(){var a=olympe.dc.sources.ce();a.Z=!0;a.yb=!0}function cl(a,b,c){const d=a.status.getValue();b in d||(d[b]={total:0,processed:0,values:new Set});d[b].total+=1;d[b].values.add(c);d.processing=!0;a.status.next(d)}
885
- function il(a,b,c){const d=a.status.getValue();let e,f;null!=(f=null==(e=d[b])?void 0:e.values)&&f.delete(c)&&(d[b].processed+=1,0===d[b].values.size&&(delete d[b],('queries'===b?'files':'queries')in d||(d.processing=!1)),a.status.next(d))}function kl(a){return u(function*(){a.F=new olympe.dc.db.ec;const b=yield ll(a.j);for(const c of b)c.qc(a.F);a.da.next(0<b.length)})}
886
- function hl(a,b,c){return u(function*(){const d=ml(b),e=[];for(const g of d){const h=g.tag();if(!(yield nl(a.j,h)))if(cl(a,'files',h),!1===g.Pa(olympe.dm.File.j.W())&&g.Pa(olympe.dm.File.urlProp.W())){var f=g.Pa(olympe.dm.File.urlProp.W());f=N(f);Hc(f,olympe.net.va.ResponseType.Hl);e.push(Ic(a.Fd,f).then(k=>{k=k.Jc();if(200>k||300<=k)throw Error(`Failed to download file ${g}. Response code ${k}`);}).finally(()=>il(a,'files',h)))}else{let k;const l=null!=(k=g.Pa(olympe.dm.File.mimeTypeProp.W()))?k:
887
- 'application/octet-stream';f={tag:h,model:g.Ub(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.j.dg,c,f);f=vb(a.Md,()=>a.Jb.request(n).then(p=>ol(a.j,h,p,l))).finally(()=>il(a,'files',h));e.push(f)}}yield Promise.allSettled(e).then(g=>{g.forEach((h,k)=>{if('rejected'===h.status){let l;a.G.warn(`Cache: File content for ${null==(l=d[k])?void 0:l.tag()} was not found`)}})})})}
888
- function ml(a){const b=[olympe.dc.ea(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.la.from(olympe.dm.File).ug(olympe.dc.CloudObject.extendedByRel).Cc().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Tc(c))?void 0:d.cb(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.Tc(d))?void 0:e.cb(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Tc(g));return c.concat(d)},[])}
889
- function pl(a,b){return Array.from(a.D.values()).some(c=>c.has(b))}function dl(a){return Array.from(a.D.keys()).filter(b=>'__code-as-data__'!==b)}function ql(a,b){return u(function*(){yield a.init();if(b){var c,d=Array.from(null!=(c=a.D.get(b))?c:[]);a.D.delete(b);var e=Array.from(a.D.values()).reduce((f,g)=>{g.forEach(h=>f.add(h));return f},new Set);yield rl(a.j,b);a.N.next(dl(a));d.filter(f=>!e.has(f));yield fl(a.j)}else yield Promise.all(dl(a).map(f=>ql(a,f)))})}
890
- function sl(a){if(!(2>a.length))for(let b=a.length-1;0<b;b--)for(let c=b-1;0<=c;c--)a[c].R(a[b])}
891
- function tl(a,b,c){return u(function*(){var d=olympe.dc.Request.j.df;const e=olympe.dc.Request.j.bg,f=olympe.dc.Request.j.ng;a.G.debug('Sync Cache: Applying transaction patch to destination',c,b.T());const g=ml(b);a.G.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>u(function*(){const k=h.tag();var l=h.Ub();if(h.yd())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield ul(a.j,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.j})}if(!Qd(a.nb))throw Error('Lost connection, stop syncing');
892
- l=yield a.Jb.request(l);b.Xc(k,new Map([[olympe.dm.File.urlProp.W(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.lj(b,!1));if(!Qd(a.nb))throw Error('Lost connection, stop syncing');yield a.Jb.request(d)})}
893
- function vl(a,b,c){return c instanceof olympe.error.Vk||c instanceof olympe.error.Uo?(a.G.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.bu('The connection has been lost. It can happen when the application loose connectivity or when the remote server is not responding correctly',c.message)):c instanceof olympe.error.Dr?(a.G.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.Ow('The transaction has been rejected by the datasource',
894
- c.message)):new olympe.dc.sources.cache.errors.Xw('Synchronisation error',c.message)}
895
- function wl(){var a=olympe.dc.sources.ce();if(a.R)return rxjs.throwError(()=>Error('Another synchronisation is in progress'));a.R=!0;a.G.info('Sync Cache: Start synchronising transactions');const b=new rxjs.BehaviorSubject([null,null]);(()=>u(function*(){yield a.init();const c=yield xl(a.j);let d=0;const e=Array.from(c.values()).reduce((f,g)=>f+g.length,0);0<e&&b.next([e,d]);for(const [f,g]of c){sl(g);for(const h of g){a.G.debug(`Sync Cache: Processing patch ${d+1}/${e} (${h.T()})`);try{yield tl(a,
896
- h,f),yield yl(a.j,h)}catch(k){throw vl(a,f,k);}d+=1;b.next([e,d])}}a.H=null}))().then(()=>{a.R=!1;b.complete()}).catch(c=>{b.error(c.message)}).finally(()=>{kl(a).finally(()=>{a.R=!1})});return b.asObservable()}
897
- function zl(){const a=olympe.dc.sources.ce();return u(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=ml(a.F);for(const e of d)b.has(e.tag())||(d=yield ul(a.j,e.tag()),c.files.push({t:e.tag(),m:d.j,c:a.sa.j(d.content)}),b.add(e.tag()));b=yield Al(a.j);c.patches.push(...b);return JSON.stringify(c)})}
898
- function Bl(a){const b=olympe.dc.sources.ce();return u(function*(){let c;try{c=JSON.parse(a)}catch(e){throw Error('Invalid pending changes, must be a JSON string');}var d=c.files;if(!Array.isArray(c.patches)||!Array.isArray(d))throw Error('Invalid pending changes, must contain a `patches` array and a `files` array');for(const e of c.files)d=b.sa.D(e.c),yield ol(b.j,e.t,d,e.m);yield Cl(b.j,c.patches);yield kl(b);b.Ha.md(Mf(b.F))})}
899
- function Dl(){const a=olympe.dc.sources.ce();return u(function*(){yield El(a.j);yield kl(a)})}
900
- olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.Jb=b;this.j=c;this.Ha=d;this.Fd=e;this.nb=f;this.Wa=g;this.sa=h;this.version=l;this.Z=this.version!==this.Wa.get('__code-as-data-version__');this.Yb=this.yb=!1;this.D=new Map;this.N=new rxjs.BehaviorSubject([]);this.H=null;this.da=new rxjs.BehaviorSubject(!1);this.F=new olympe.dc.db.ec;this.Qc=this.Gc=!1;this.ia=[];this.X=0;this.ke=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});this.R=
901
- !1;this.vd=new rxjs.Subject;this.Md=new olympe.U.promise.Wr(k)}Jc(){return this.status.asObservable()}init(){const a=this;return u(function*(){if(!a.Gc)if(a.Qc)yield new Promise(b=>{a.ia.push(b)});else{a.Qc=!0;(yield Fl(a.j)).forEach(b=>{a.D.set(b.name,new Set(b.j))});a.N.next(dl(a));yield kl(a);a.Ha.md(Mf(a.F));for(const b of a.ia)b();a.Gc=!0;a.ia=[]}})}executeQuery(a){const b=this;return u(function*(){yield b.init();return pl(b,a.T())&&ii(a).some(c=>c instanceof olympe.dc.query.ma.Od)?Gl(b.j,a).then(olympe.U.stream.Ls):
902
- b.j.executeQuery(a).then(olympe.U.stream.Ls)})}applyTransaction(a,b){const c=this;return u(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.ac(),e=Array.from(d.Bb.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.H)?void 0:f.j.Bb.keys())?g:[]);let k;b!==(null==(k=c.H)?void 0:k.D)||e.some(l=>!h.includes(l))?(yield Hl(c.j,d,b),c.H=new olympe.dc.sources.cache.$t(d,b),c.da.next(!0)):(d.qc(c.H.j),yield Hl(c.j,c.H.j,b));d.qc(c.F);yield gl(c.j,d,'local-transaction')})}uploadFileContent(a,
903
- b,c){const d=this;return u(function*(){yield d.init();yield ol(d.j,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return u(function*(){yield b.init();return ul(b.j,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return u(function*(){yield b.init();yield Il(b.j,[a])})}};olympe.dc.sources.cache.$t=class{constructor(a,b){this.j=a;this.D=b}};olympe.dc.sources.cache.Cache.D='__code-as-data-version__';olympe.dc.sources.cache.Cache.j='__code-as-data__';function Fl(a){return u(function*(){return(yield a.db.F('buckets')).map(b=>olympe.dc.sources.cache.Xq.Pb(b))})}function ll(a){return u(function*(){return(yield a.db.F('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.Rh.Pb(b);return bl(b.j)})})}function el(a,b,c){return u(function*(){a.G.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.D()})}function fl(a){return u(function*(){return a.db.D()})}
904
- function gl(a,b,c){a.G.debug(`Offline DB: Apply patch ${b.T()} on local offline db`);Array.from(b.Bb.keys());return a.db.D().then(()=>{null===c&&(b.Bb.forEach((d,e)=>a.D.add(e)),a.F().then(()=>{}))})}function nl(a,b){return new Promise((c,d)=>{null!==a.files?c(a.files.has(b)):a.j.push(e=>{let f;return e?d(e):c(!(null==(f=a.files)||!f.has(b)))})})}
905
- function ol(a,b,c,d){c=new olympe.dc.sources.cache.Km(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function rl(a,b){return u(function*(){return a.db.remove('buckets',b).then(()=>{})})}function xl(a){return u(function*(){return(yield a.db.F('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.Rh.Pb(c);const d=c.D;let e;const f=null!=(e=b.get(d))?e:[];f.push(bl(c.j));b.set(d,f);return b},new Map)})}
906
- function yl(a,b){return u(function*(){return a.db.remove('pending-transactions',b.T()).then(()=>{})})}function ul(a,b){return u(function*(){const c=yield a.db.get('files',b);if(!c)throw Error(`File ${b} not found in offline cache database`);return olympe.dc.sources.cache.Km.Pb(c)})}function Al(a){return u(function*(){return a.db.F('pending-transactions')})}
907
- function Cl(a,b){return u(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.Rh.Pb(d);e&&c.set(e.j.i,d)}yield a.db.da()})}function El(a){return u(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
908
- function Gl(a,b){return u(function*(){const c=b.jb();a.G.debug(`Offline DB: Executing query ${b.T()} by ID with source ${c}`);const d=olympe.dc.query.Dd.xj(b);var e=(yield a.db.H(b.T())).map(f=>olympe.dc.sources.cache.Pg.Pb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.yk.Vb(f);const g=Jl(f.Kd);d.create(f.tag,e,g);for(const h of f.ob)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.fc.Zc&&!0===e||d.Oa(k,e?n:f.tag,e?f.tag:n)}}a.G.j()&&
909
- a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.ac().Bb.size,'instances',Array.from(d.ac().Id()).length,'relations');return d})}function Hl(a,b,c){b=a.N.fa(b);a.G.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.Rh(c,b,Date.now())).toJSON())}function Kl(a){return u(function*(){return a.db.N('pending-transactions')})}function Il(a,b){return u(function*(){b.forEach(c=>a.files.delete(c));yield a.db.Z()})}
910
- function Jl(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,bl(d)),new Map)}
911
- olympe.dc.sources.cache.yk=class{constructor(a,b,c){this.H=`Olympe_Cache_${a}`;this.G=b;this.N=new olympe.dc.sources.cache.Up;this.db=c.D(this.H);this.D=new Set;this.j=[];this.files=null;this.db.R('files').then(d=>{this.files=new Set(d);this.j.forEach(e=>e(null))}).catch(d=>{this.j.forEach(e=>e(d))});this.F=olympe.U.Promise.uj(()=>{const d=this;return u(function*(){if(!(0===d.D.size||0<(yield Kl(d))))if(0<d.db.X())d.F().then(()=>{}),d.G.debug('Offline DB GC: Postponing round while the stack is busy');
912
- else{d.G.debug(`Offline DB GC: Round with ${d.D.size} candidates`);var e=Date.now();yield d.db.D().then(()=>{});d.G.debug(`Offline DB GC: has taken ${Date.now()-e}ms to run`)}})},5E3)}static Vb(a){const b=new RegExp(`^(${olympe.dc.fc.Zc})>([a-z0-9]*)$`);for(const c of a.ob)if(a=c.match(b))return a[2];return null}executeQuery(a){const b=this;return u(function*(){const c=Date.now();b.G.debug(`Offline DB: Executing query ${a.T()} with source ${a.jb()}`);const d=olympe.dc.query.Dd.xj(a),e=a.jb();var f=
913
- yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Pg.Pb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.yk.Vb(g),Jl(g.Kd));for(const p of ii(a))if(p instanceof olympe.dc.query.ma.Wh){var k=p.relation;g=k.La()===olympe.dc.ua.ORIGIN;const q=k.W(),r=k.$b();k=new Set;f.set(p.T(),k);const t=[f.has(p.j)?new Set(f.get(p.j)):new Set([a.D])];for(const v of t){const x=new Map;var l=yield Promise.all(Array.from(v).map(y=>{if(!h.has(y))return b.G.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
914
- Promise.resolve([]);r.W();return b.db.H().then(z=>z.map(A=>olympe.dc.sources.cache.Pg.Pb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.ma.Ce&&p.F&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.ma.Ce&&!k.has(l)){var n=t[t.length-1];n||(n=new Set,t.push(n));n.add(l)}k.add(l);h.has(l)||(h.add(l),n=olympe.dc.sources.cache.yk.Vb(A),d.create(l,n,Jl(A.Kd)));q===olympe.dc.fc.Zc&&!0===g||d.Oa(q,g?l:y,g?y:l)}}}}else p instanceof
850
+ class pk{constructor(a,b,c,d){this.G=a;this.D=b;this.j=0;this.F=c.subscribe(d).subscribe({next:e=>{olympe.L.qb.ld(b,e).catch(f=>a.error(`Error occurred while publishing a data notification: ${f}`))},error:e=>a.error(`Error occurred while trying to subscribe to topic ${b} for a datasource: ${e}`)})}subscribe(){this.j++;this.G.debug(`Data subscription ${this.D} has ${this.j} subscribers`);return this}}olympe.dc.sources.Fr.ya=[olympe.dc.sources.fk];const W={us:10,Oo:11,up:12,lr:13,QUERY_RESULT:14,Mp:15,cp:16,df:17,mr:18,bp:19,fj:20};function rk(a,b){const c=new olympe.dc.transaction.Ie,d=new olympe.dc.transaction.Ie;b.forEach(e=>{const f=new Map(Array.from(Object.entries(e.p).map(([h,k])=>[h,a.j(k)]))),g=e.v?d:c;g.Sc(e.t,e.s,f,e.m);e.r.forEach(h=>g.Oa(h.r,h.o,h.d))});a.Z.nd(Xf(Yf(d),olympe.dc.Ia.SELF),{persist:!1});a.Z.nd(Xf(Yf(c),olympe.dc.Ia.SELF))}
851
+ olympe.dc.sources.cc=class extends olympe.L.cc{constructor(a){super();this.Z=a;this.db=a.view;this.F=new Map}fa(a){a=super.fa(a);if(0<this.F.size){const b=Array.from(this.F.values());this.F.clear();return Object.assign(this.format(W.us,a),{i:b})}return a}N(a){return(null==a?void 0:a.t)===W.us&&Array.isArray(null==a?void 0:a.i)?(rk(this,a.i),this.j(a.v)):this.j(a)}D(a){switch(!0){case a instanceof olympe.dm.File:var b=this.format,c=W.up;{const d=a.W(),e={t:d};if(!this.F.has(d)&&(this.H(d),!this.db.Re(d))){const f=
852
+ a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))a=olympe.dc.Rs().Ha(a),this.F.get(d).p[olympe.dm.File.urlProp.W()]='stream://'+d,e.s=this.D(a)}a=e}return b.call(this,c,a);case a instanceof olympe.dc.CloudObject:return this.format(W.Oo,this.H(a.W()));case a instanceof olympe.dc.la:return this.format(W.lr,a.fa());case a instanceof olympe.dc.Ka:return this.format(W.QUERY_RESULT,a.fa(this.H.bind(this)));case a instanceof olympe.dc.db.ec:return b=new olympe.dc.transaction.Ie,
853
+ a.qc(b),this.format(W.Mp,{i:a.T(),p:Yf(b)});case a instanceof olympe.dc.Request:return this.format(W.cp,{r:a.getType(),o:a.origin,d:a.ic(),u:a.xc(),c:this.D(a.content)});case a instanceof olympe.dc.transaction.lj:return this.format(W.df,{r:a.th(),p:this.D(a.ac())});case a instanceof olympe.dc.query.Dd:return this.format(W.mr,a.fa());case a instanceof olympe.dc.Hg:return this.format(W.bp,a.fa());case a instanceof olympe.dc.vc:return this.format(W.fj,this.H(a.W()));default:return super.D(a)}}j(a){if(null===
854
+ a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case W.up:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.Rs().vb(d,a));return olympe.dc.CloudObject.get(d);case W.Oo:return olympe.dc.CloudObject.get(c);case W.lr:return d=c.p.map(olympe.dc.query.ma.Sm.j),a=c.e,new olympe.dc.la(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Ld:a.s,Te:a.rm});case W.QUERY_RESULT:return Pi(c);case W.Mp:return(new olympe.dc.transaction.dj).j(c.p,c.i);case W.cp:return a=null!=(d=this.j(c.c))?d:void 0,
855
+ Sf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case W.df:return d=this.j(c.p),new olympe.dc.transaction.lj(d,c.r);case W.mr:return olympe.dc.query.Dd.j(c);case W.bp:return olympe.dc.Hg.j(c);case W.fj:return new olympe.dc.vc(c);default:return super.j(a)}}H(a){if(this.F.has(a))return a;if(!this.db.Ja(a))throw new olympe.dc.Xq(a);const b={};this.db.zb(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of uh(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.ta.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
856
+ d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.Re(a)||(c.v=!0);this.F.set(a,c);return a}};const sk=olympe.dc.Request.j.Jg,tk=olympe.dc.Request.j.df,uk=olympe.dc.Request.j.dh,vk=olympe.dc.Request.j.Fi,wk=olympe.dc.Request.j.xo,xk=olympe.dc.Request.j.wr,yk=olympe.dc.Request.j.Sg,zk=olympe.dc.Request.j.Gk,Ak=olympe.dc.Request.j.Lp,Bk=olympe.dc.Request.j.vu,Ck=olympe.dc.Request.j.wu,Dk=olympe.dc.Request.j.xu,Ek=olympe.dc.Request.j.cg,Fk=olympe.dc.Request.j.eg,Gk=olympe.dc.Request.j.og,Hk=olympe.dc.Request.j.jk,Ik=olympe.dc.Request.j.Sw,Jk=olympe.dc.Request.j.gw,Kk=olympe.dc.Request.j.Gp,Lk=
857
+ olympe.dc.Request.j.yh,Mk=olympe.dc.Request.j.Xt,Nk=olympe.dc.Request.j.oc;function Ok(a){return Pk(a,olympe.dc.Request.j.Jg).then(b=>{b=b.getData().p;const c=Xf(b,a.T());a.G.j()&&a.G.debug('< Get Context result',b);a.G.N()&&a.G.log('< Get Context result has',b.length,'operations');return c})}function Qk(a,b){const c=new olympe.dc.transaction.Ie({le:!1,hi:!1}),d=b.ac(),e=b.j;d.qc(c);return Rk(a,tk,{i:d.T(),r:b.th(),p:Yf(c),bd:e?!0:void 0}).then(f=>f.ct)}
858
+ function Sk(a,b){const c=b.ac(),d=new olympe.dc.transaction.Ie({xl:!0,le:!1,hi:!1});c.qc(d);b=b.j?'bd=true':'';return Pk(a,uk,Yf(d),b,olympe.net.ua.ResponseType.$r).then(e=>{try{const f=e.getData();let g;return null!=(g=JSON.parse(f).ct)?g:Date.now()}catch(f){return Date.now()}}).finally(()=>{Tk(a,Hk,{id:c.T(),finalize:olympe.dc.transaction.Jf.j.$i})})}
859
+ function Uk(a,b){const c=new olympe.dc.transaction.Ie({le:!1,hi:!1}),d=b.ac();d.qc(c);return Rk(a,vk,{i:d.T(),r:b.th(),p:Yf(c)},!1).catch(e=>a.G.error(`Error while publishing burst transaction: ${e}`))}function Vk(a,b){const c=new olympe.dc.transaction.Ie({le:!1,hi:!1});b=b.ac();b.qc(c);return Rk(a,Lk,{i:b.T(),p:Yf(c)}).then(d=>d.ct)}
860
+ function Wk(a,b){const c=encodeURI(ab(olympe.U.jf(),JSON.stringify(Xk(a,b))));a.G.j()&&a.G.debug(`Static GraphDef query ${b} sent to orchestrator`);return Pk(a,yk,void 0,`query=${c}&v=${a.version}`,olympe.net.ua.ResponseType.je).then(d=>Yk(a,d))}function Zk(a,b){const c=b.T();a.G.j()&&a.G.debug(`Query (${c}) sent to orchestrator: ${b}`);const d=Xk(a,b);return vb(a.wa,()=>Pk(a,Ak,d,void 0,olympe.net.ua.ResponseType.je)).then(e=>Yk(a,e))}
861
+ function $k(a,b){if(!Ae(a.F))return a.G.error(`Server is disconnected, backup of instance ${b} is canceled.`),Promise.reject('Server is disconnected');b=Xk(a,olympe.dc.la.from(b));b.f=olympe.dc.Lb.hp;b=N(xj(a.j,olympe.dc.Ia.SERVER,wk),olympe.net.ua.Rd.Sh,JSON.stringify(b),olympe.net.ua.ResponseType.$h);Fc(b,{[olympe.net.ua.Headers.Ii]:olympe.net.ua.Xl.JSON});return yj(a.j,b).then(c=>c.getData())}
862
+ function al(a,b,c,d){if(!Ae(a.F))return a.G.error('Server is disconnected, restore of instance is canceled.'),Promise.reject('Server is disconnected');const e=xj(a.j,olympe.dc.Ia.SERVER,xk);b=N(e+`?debug=${c}&optional=${d}`,olympe.net.ua.Rd.Sh,b);Fc(b,{[olympe.net.ua.Headers.Ii]:olympe.net.ua.Xl.bx});return yj(a.j,b).then(f=>f.getData())}
863
+ function Rk(a,b,c,d=!0){const e=olympe.L.Fe.Gg,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{De(a.F,e,f,(k,l)=>{k?h(k):g(l)})});De(a.F,e,f);return Promise.resolve()}
864
+ function Xk(a,b){var c=ki(b);b={i:b.T(),b:[b.D],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.ma.Od)Object.assign(b,{f:c[0].Ob,q:[]});else{const d=(h,k)=>{h.every(l=>!l.Ea(k))&&h.push(k);return h},e=new Map;for(let h=c.length-1;0<=h;h--){const k=c[h],l=k.j;let n;const p=d(null!=(n=e.get(l))?n:[],k);if(k instanceof olympe.dc.query.ma.De&&k.F){let q;null==(q=e.get(k.T()))||q.forEach(r=>d(p,r))}e.set(l,p)}let f,g;c=null!=(g=e.get(null==(f=c[0])?void 0:f.j))?g:[];Object.assign(b,{f:olympe.dc.Lb.NONE,q:c.map(a.ba.bind(a,
865
+ e))})}return b}function Tk(a,b,c){b=Sf(new olympe.dc.Request(b,olympe.dc.Ia.SELF,c),a.T());let d;null==(d=a.Jb)||d.cd(b)}
866
+ function Pk(a,b,c,d,e){const f=xj(a.j,a.T(),b);if('string'!==typeof f)return Promise.reject(`ServerProvider: no url for type ${b}`);b=N(`${f}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.ua.Rd.Sh:olympe.net.ua.Rd.GET,c&&JSON.stringify(c));Fc(b,{[olympe.net.ua.Headers.Ii]:'application/json'});Hc(b,null!=e?e:olympe.net.ua.ResponseType.JSON);return yj(a.j,b)}
867
+ function Yk(a,b){return u(function*(){const c=b.headers.graphId,d=b.getData();let e,f;return(null!=(f=null==(e=a.Ha)?void 0:wb(e,d))?f:olympe.U.stream.Ak.transform(b.getData())).pipeThrough(new TransformStream({transform:(g,h)=>{a.G.debug(`Received ${g.length} operations for patch ${c}`);h.enqueue(Xf(g,a.T(),null,c))}}))})}
868
+ function bl(a,b,c){return u(function*(){const d=b.pi;let e;if(c instanceof olympe.U.stream.mg){e=new olympe.dc.db.ec(d);try{for(const f=ha(c);;){const g=yield f.next();if(g.done)break;a.R.j(g.value.p,d).qc(e)}}catch(f){a.G.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.ec(d)}}else e=a.R.j(b.p,d);return Of(e,b.ct)})}
869
+ olympe.dc.sources.Tr=class extends olympe.dc.sources.Ul{constructor(a,b,c,d,e,f,g){super(a,c);this.F=b;this.j=d;this.R=new olympe.dc.transaction.dj(this.T());this.H=new Map;this.N=new Set;this.version=e||'unknown';this.Ha=g?new olympe.U.stream.ax:null;this.wa=new olympe.U.promise.Xr(f);olympe.C.Gj(this.D.qf(),()=>{this.H.forEach((h,k)=>{h.error(new olympe.error.Ph('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ia.SERVER}X(a){var b=a.getType();const c=a.content,d=Uf(a);switch(b){case Nk:return a=
870
+ olympe.dm.DataSource.oc.Ab,b=olympe.dm.DataSource.oc.Vh,Promise.resolve(Ae(this.F)?{s:b}:{s:a,r:'Disconnected'});case sk:return Ok(this);case tk:return Qk(this,c);case uk:return Sk(this,c);case vk:return Uk(this,c);case Lk:return Vk(this,c);case yk:return d.get(olympe.dc.la.j.hq)?Wk(this,c):Zk(this,c);case wk:return $k(this,c);case xk:return al(this,c.EF,c.debug,c.optional);case Ik:case Jk:case Kk:case Mk:return Rk(this,b,{});case Fk:return this.j.downloadFileContent(a);case Ek:return this.j.deleteFileContent(a);
871
+ case Gk:return this.j.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Z(a,b){if(a.getType()===zk){const c=a.content,d=c.T();return(new rxjs.Observable(e=>{const f=Xk(this,c);this.N.delete(d);this.H.set(d,e);Rk(this,Bk,f).catch(g=>e.error(g))})).pipe(sb(olympe.error.Ph,(e,f)=>{this.G.debug(`Subscribe to topic ${e.T()} now that we are back online, after waiting for ${f}ms`);b()}),rxjs.operators.finalize(()=>{this.N.add(d);Rk(this,Ck,{i:d}).catch(e=>
872
+ {this.G.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.N.has(d)&&this.H.delete(d);this.N.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);ye(this.F,olympe.L.Fe.Gg,this.ia.bind(this));return this}destroy(){return u(function*(){})}ia(a,b){const c=olympe.dc.Request.j.zo,d=olympe.dc.Request.j.Fm,e=a.c;if(e===olympe.dc.Request.j.ck)bl(this,a,b).then(f=>{Tk(this,e,f)});else if(e===c)b=this.R.j(a.p,a.i),
873
+ b=Of(b,a.ct),Tk(this,e,{rollback:b,error:a.error});else if(e===Dk){const f=a.i;bl(this,a,b).then(g=>{let h;null==(h=this.H.get(f))||h.next(g)})}else e===d&&Tk(this,Hk,{id:a.i,finalize:olympe.dc.transaction.Jf.j.Fm,error:0<a.s?a.error:null})}ba(a,b){if(b instanceof olympe.dc.query.ma.Wh){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.W(),d:c.La()===olympe.dc.ta.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.ba.bind(this,a))}}return{}}};olympe.dc.sources.Tr.ya=[olympe.dc.sources.fk];function cl(a,b,c){const d=new olympe.C.Xb(`Source solver ${b.W()}`);b.bb(olympe.dm.Ad.F.$b()).bb(olympe.dm.Ad.D).me().back().bb(olympe.dm.Ad.j).me().observe(d,{md:c,Bc:!0}).subscribe(e=>{e.yj().forEach(([f,g])=>{a.D.set(f.W(),g.T())});e.Ej().forEach(([f])=>{a.D.delete(f)})});b.bb(olympe.dm.hb.D).observe(d,{md:c,Bc:!0}).subscribe(e=>{let f,g;a.F=null!=(g=null==(f=e.Jc())?void 0:f.T())?g:null});d.onDestroy(()=>{a.D.clear();a.F=null})}
874
+ olympe.dc.sources.Sk=class{constructor(a,b,c){this.db=a;this.j=b;this.N=c;this.D=new Map;this.F=null;this.H=!1}fromModel(a){a=olympe.dc.ea(a);return this.D.has(a)?this.D.get(a):this.F&&this.R(a)?this.F:this.N}pe(a){let b;return null!=(b=this.db.source(a))?b:this.N}jb(a){return a===this.j?olympe.dc.CloudObject.get(this.j):a===olympe.dc.Ia.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ja(a)&&this.db.Nb(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}R(){return!1}init(){if(!this.H){this.H=
875
+ !0;var a=new olympe.dc.Ya;X(a.create(olympe.dm.DataSource,this.j).yi(this.j),olympe.dm.DataSource.gi,!0);a.Oa(olympe.dm.DataSource.Mj,this.j,this.j);a.mb(()=>{olympe.dc.la.from(this.j).observe(olympe.C.kh()).subscribe(()=>{})})}}};olympe.dc.sources.P={Da:'dc.sources.Logger',qm:'dc.sources.HTTPService',Lu:'dc.sources.IOService',ur:'dc.sources.RemoteProvider',Mr:'dc.sources.ServerProvider',sC:'dc.sources.OfflineProvider',af:'dc.sources.SourceSolver',Me:'dc.sources.Serializer',$o:'dc.sources.cache.Cache',ap:'dc.sources.cache.DATABASE',Ql:'dc.sources.cache.Logger'};
876
+ olympe.dc.sources.Config={Ih:'data.httpHost',Bf:'data.httpPort',Qi:'data.httpSSL',om:'data.httpBasePath',Qm:'data.pollingFrequency',Ve:'data.communicationMode',Xm:'data.restrictedUse',VERSION:'version.version',Rr:'data.streamWorker',Wq:'data.queryConcurrencyLimit'};olympe.dc.sources.Kh={Xv:'olympe.internal.data.',Ih:'olympe.internal.data.httpHost',Bf:'olympe.internal.data.httpPort',Qi:'olympe.internal.data.httpSSL'};
877
+ olympe.V.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.Config.Bm),d=`-${olympe.host.Wg.Th}`;E(a,olympe.dc.sources.Config.Ih,null);E(a,olympe.dc.sources.Config.Bf,null);E(a,olympe.dc.sources.Config.Qi,null);E(a,olympe.dc.sources.Config.om,'runtime/data');E(a,olympe.dc.sources.Config.Rr,!1);E(a,olympe.dc.sources.Config.Wq,10);Ya(a,olympe.dc.sources.Kh.Ih,[olympe.host.Config.Jk,olympe.L.Config.am,olympe.dc.sources.Config.Ih],(e,f,g)=>{if(g)return g;e=e===olympe.host.Wg.Th;
878
+ return f.endsWith(c)&&e?f+d:f});Ya(a,olympe.dc.sources.Kh.Bf,[olympe.dc.sources.Kh.Ih,olympe.dc.sources.Config.Bf],(e,f)=>{if(f)return f;f=b.includes(e);const g=e.endsWith(d);e=e.endsWith(c);return f?3141:g?85:e?80:443});Ya(a,olympe.dc.sources.Kh.Qi,[olympe.dc.sources.Kh.Bf,olympe.dc.sources.Config.Qi],(e,f)=>null!==f?f:443===e);E(a,olympe.dc.sources.Config.Qm,null);E(a,olympe.dc.sources.Config.Ve,null);E(a,olympe.dc.sources.Config.Xm,null);D(a,olympe.dc.sources.P.Da,[olympe.ga.P.Fa],e=>e.ad('data'));
879
+ C(a,olympe.dc.sources.P.Me,olympe.dc.sources.cc,olympe.dc.db.P.Fa);Wa(a,olympe.L.P.Me,olympe.dc.sources.P.Me);C(a,olympe.dc.sources.P.qm,olympe.dc.sources.Au,olympe.dc.sources.P.Da,olympe.net.P.nj,olympe.L.P.pm,olympe.auth.P.Fa,olympe.dc.sources.P.af,olympe.L.P.Me,new olympe.V.oa(olympe.L.Config.Ll));C(a,olympe.dc.sources.P.Lu,olympe.dc.sources.gq,olympe.dc.sources.P.Da,olympe.dc.P.Ug,olympe.net.P.Fa,olympe.auth.P.Fa);C(a,olympe.dc.sources.P.ur,olympe.dc.sources.Fr,olympe.dc.sources.P.Da,new olympe.V.oa(olympe.dc.Config.Xg),
880
+ olympe.dc.sources.P.qm,olympe.L.P.vf,olympe.dc.P.Ch,olympe.dc.sources.P.af);C(a,olympe.dc.sources.P.Mr,olympe.dc.sources.Tr,olympe.dc.sources.P.Da,olympe.L.P.Nk,olympe.L.P.vf,olympe.dc.sources.P.qm,new olympe.V.oa(olympe.dc.sources.Config.VERSION),new olympe.V.oa(olympe.dc.sources.Config.Wq),new olympe.V.oa(olympe.dc.sources.Config.Rr));C(a,olympe.dc.sources.P.af,olympe.dc.sources.Sk,olympe.dc.P.Ch,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.Config.cm));D(a,olympe.dc.sources.P.Ql,
881
+ [olympe.ga.P.Fa],e=>e.ad('datacache'));C(a,olympe.dc.sources.P.$o,olympe.dc.sources.cache.Cache,olympe.dc.sources.P.Ql,olympe.dc.P.Ug,olympe.dc.sources.P.ap,olympe.dc.db.P.Fa,olympe.net.P.Fa,olympe.L.P.vf,olympe.Db.P.Cm,olympe.U.P.Dg,new olympe.V.oa(olympe.net.Config.Tq),new olympe.V.oa(olympe.dc.sources.Config.VERSION));C(a,olympe.dc.sources.P.ap,olympe.dc.sources.cache.yk,olympe.Db.P.$g,olympe.dc.sources.P.Ql,olympe.Db.P.qk)},'olympe.dc.sources');
882
+ olympe.V.run([olympe.dc.sources.P.af,olympe.dc.sources.P.$o],(a,b)=>{olympe.dc.ee=()=>a;olympe.dc.sources.ce=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.dn=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.cu=class extends olympe.dc.sources.cache.errors.dn{};olympe.dc.sources.cache.errors.Pw=class extends olympe.dc.sources.cache.errors.dn{};olympe.dc.sources.cache.errors.Yw=class extends olympe.dc.sources.cache.errors.dn{};function dl(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a}switch(a.t){case 1:return new Date(a.d);case 2:return olympe.C.Color.Pb(a);case 17:return new olympe.dc.vc(a.v);case 13:return(new olympe.dc.transaction.dj).j(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
883
+ olympe.dc.sources.cache.Vp=class{fa(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.C.eb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.C.Color:return Object.assign({t:2},a.toJSON());case a instanceof olympe.dc.vc:return{t:17,v:a.W()};case a instanceof olympe.dc.db.ec:const b=new olympe.dc.transaction.Ie;a.qc(b);
884
+ return{t:13,i:a.T(),v:Yf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function Wj(a,b,c){return u(function*(){el(a,'queries',b);yield a.init();const d=a.D.has(c)?a.D.get(c):new Set;d.has(b)||(d.add(b),a.D.set(c,d),a.N.next(fl(a)));return gl(a.j,b,c)})}function Xj(a,b){return u(function*(){yield a.init();a.G.debug(`Cache: subtract pending transaction operations from ${b.T()}`);b.R(a.F)})}
885
+ function Yj(a,b,c,d,e=!1){(()=>u(function*(){a.G.debug(`Cache: handle query ${b} graph patch: ${d.T()}`);try{const f=null===b?[]:Array.from(a.D.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.Z)a.G.debug('Cache: persist graph patch',d.T()),e&&b&&(Array.from(d.Vc()).filter(h=>!h.yd()).map(h=>h.tag()),yield hl(a.j)),yield il(a.j,d,0<f.length?b:null),jl(a,d,c).catch(h=>{a.G.error(`Cache: Failed to download files of a graph patch: ${h}`)})}catch(f){a.G.error(`Cache: Failed to handle graph patch ${d.T()} with message: ${f}`),
886
+ a.hd.next(f)}finally{b&&kl(a,'queries',b)}}))().then(()=>{})}function Zj(a,b,c,d,e=!1){return u(function*(){yield Xj(a,d);Yj(a,b,c,d,e)})}function ll(){var a=olympe.dc.sources.ce();a.Z=!0;a.vb=!0}function el(a,b,c){const d=a.status.getValue();b in d||(d[b]={total:0,processed:0,values:new Set});d[b].total+=1;d[b].values.add(c);d.processing=!0;a.status.next(d)}
887
+ function kl(a,b,c){const d=a.status.getValue();let e,f;null!=(f=null==(e=d[b])?void 0:e.values)&&f.delete(c)&&(d[b].processed+=1,0===d[b].values.size&&(delete d[b],('queries'===b?'files':'queries')in d||(d.processing=!1)),a.status.next(d))}function ml(a){return u(function*(){a.F=new olympe.dc.db.ec;const b=yield nl(a.j);for(const c of b)c.qc(a.F);a.ba.next(0<b.length)})}
888
+ function jl(a,b,c){return u(function*(){const d=ol(b),e=[];for(const g of d){const h=g.tag();if(!(yield pl(a.j,h)))if(el(a,'files',h),!1===g.Pa(olympe.dm.File.j.W())&&g.Pa(olympe.dm.File.urlProp.W())){var f=g.Pa(olympe.dm.File.urlProp.W());f=N(f);Hc(f,olympe.net.ua.ResponseType.Kl);e.push(Ic(a.Fd,f).then(k=>{k=k.Kc();if(200>k||300<=k)throw Error(`Failed to download file ${g}. Response code ${k}`);}).finally(()=>kl(a,'files',h)))}else{let k;const l=null!=(k=g.Pa(olympe.dm.File.mimeTypeProp.W()))?k:
889
+ 'application/octet-stream';f={tag:h,model:g.Vb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.j.eg,c,f);f=vb(a.Md,()=>a.Jb.request(n).then(p=>ql(a.j,h,p,l))).finally(()=>kl(a,'files',h));e.push(f)}}yield Promise.allSettled(e).then(g=>{g.forEach((h,k)=>{if('rejected'===h.status){let l;a.G.warn(`Cache: File content for ${null==(l=d[k])?void 0:l.tag()} was not found`)}})})})}
890
+ function ol(a){const b=[olympe.dc.ea(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.la.from(olympe.dm.File).ug(olympe.dc.CloudObject.extendedByRel).Cc().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Uc(c))?void 0:d.cb(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.Uc(d))?void 0:e.cb(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Uc(g));return c.concat(d)},[])}
891
+ function rl(a,b){return Array.from(a.D.values()).some(c=>c.has(b))}function fl(a){return Array.from(a.D.keys()).filter(b=>'__code-as-data__'!==b)}function sl(a,b){return u(function*(){yield a.init();if(b){var c,d=Array.from(null!=(c=a.D.get(b))?c:[]);a.D.delete(b);var e=Array.from(a.D.values()).reduce((f,g)=>{g.forEach(h=>f.add(h));return f},new Set);yield tl(a.j,b);a.N.next(fl(a));d.filter(f=>!e.has(f));yield hl(a.j)}else yield Promise.all(fl(a).map(f=>sl(a,f)))})}
892
+ function ul(a){if(!(2>a.length))for(let b=a.length-1;0<b;b--)for(let c=b-1;0<=c;c--)a[c].R(a[b])}
893
+ function vl(a,b,c){return u(function*(){var d=olympe.dc.Request.j.df;const e=olympe.dc.Request.j.cg,f=olympe.dc.Request.j.og;a.G.debug('Sync Cache: Applying transaction patch to destination',c,b.T());const g=ol(b);a.G.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>u(function*(){const k=h.tag();var l=h.Vb();if(h.yd())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield wl(a.j,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.j})}if(!Pd(a.lb))throw Error('Lost connection, stop syncing');
894
+ l=yield a.Jb.request(l);b.Yc(k,new Map([[olympe.dm.File.urlProp.W(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.lj(b,!1));if(!Pd(a.lb))throw Error('Lost connection, stop syncing');yield a.Jb.request(d)})}
895
+ function xl(a,b,c){return c instanceof olympe.error.Vk||c instanceof olympe.error.Vo?(a.G.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.cu('The connection has been lost. It can happen when the application loose connectivity or when the remote server is not responding correctly',c.message)):c instanceof olympe.error.Er?(a.G.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.Pw('The transaction has been rejected by the datasource',
896
+ c.message)):new olympe.dc.sources.cache.errors.Yw('Synchronisation error',c.message)}
897
+ function yl(){var a=olympe.dc.sources.ce();if(a.R)return rxjs.throwError(()=>Error('Another synchronisation is in progress'));a.R=!0;a.G.info('Sync Cache: Start synchronising transactions');const b=new rxjs.BehaviorSubject([null,null]);(()=>u(function*(){yield a.init();const c=yield zl(a.j);let d=0;const e=Array.from(c.values()).reduce((f,g)=>f+g.length,0);0<e&&b.next([e,d]);for(const [f,g]of c){ul(g);for(const h of g){a.G.debug(`Sync Cache: Processing patch ${d+1}/${e} (${h.T()})`);try{yield vl(a,
898
+ h,f),yield Al(a.j,h)}catch(k){throw xl(a,f,k);}d+=1;b.next([e,d])}}a.H=null}))().then(()=>{a.R=!1;b.complete()}).catch(c=>{b.error(c.message)}).finally(()=>{ml(a).finally(()=>{a.R=!1})});return b.asObservable()}
899
+ function Bl(){const a=olympe.dc.sources.ce();return u(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=ol(a.F);for(const e of d)b.has(e.tag())||(d=yield wl(a.j,e.tag()),c.files.push({t:e.tag(),m:d.j,c:a.wa.j(d.content)}),b.add(e.tag()));b=yield Cl(a.j);c.patches.push(...b);return JSON.stringify(c)})}
900
+ function Dl(a){const b=olympe.dc.sources.ce();return u(function*(){let c;try{c=JSON.parse(a)}catch(e){throw Error('Invalid pending changes, must be a JSON string');}var d=c.files;if(!Array.isArray(c.patches)||!Array.isArray(d))throw Error('Invalid pending changes, must contain a `patches` array and a `files` array');for(const e of c.files)d=b.wa.D(e.c),yield ql(b.j,e.t,d,e.m);yield El(b.j,c.patches);yield ml(b);b.Ha.nd(Of(b.F))})}
901
+ function Fl(){const a=olympe.dc.sources.ce();return u(function*(){yield Gl(a.j);yield ml(a)})}
902
+ olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.Jb=b;this.j=c;this.Ha=d;this.Fd=e;this.lb=f;this.Ua=g;this.wa=h;this.version=l;this.Z=this.version!==this.Ua.get('__code-as-data-version__');this.Ub=this.vb=!1;this.D=new Map;this.N=new rxjs.BehaviorSubject([]);this.H=null;this.ba=new rxjs.BehaviorSubject(!1);this.F=new olympe.dc.db.ec;this.Hc=this.Gc=!1;this.ia=[];this.X=0;this.ke=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});this.R=
903
+ !1;this.hd=new rxjs.Subject;this.Md=new olympe.U.promise.Xr(k)}Kc(){return this.status.asObservable()}init(){const a=this;return u(function*(){if(!a.Gc)if(a.Hc)yield new Promise(b=>{a.ia.push(b)});else{a.Hc=!0;(yield Hl(a.j)).forEach(b=>{a.D.set(b.name,new Set(b.j))});a.N.next(fl(a));yield ml(a);a.Ha.nd(Of(a.F));for(const b of a.ia)b();a.Gc=!0;a.ia=[]}})}executeQuery(a){const b=this;return u(function*(){yield b.init();return rl(b,a.T())&&ki(a).some(c=>c instanceof olympe.dc.query.ma.Od)?Il(b.j,a).then(olympe.U.stream.Ms):
904
+ b.j.executeQuery(a).then(olympe.U.stream.Ms)})}applyTransaction(a,b){const c=this;return u(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.ac(),e=Array.from(d.Bb.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.H)?void 0:f.j.Bb.keys())?g:[]);let k;b!==(null==(k=c.H)?void 0:k.D)||e.some(l=>!h.includes(l))?(yield Jl(c.j,d,b),c.H=new olympe.dc.sources.cache.au(d,b),c.ba.next(!0)):(d.qc(c.H.j),yield Jl(c.j,c.H.j,b));d.qc(c.F);yield il(c.j,d,'local-transaction')})}uploadFileContent(a,
905
+ b,c){const d=this;return u(function*(){yield d.init();yield ql(d.j,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return u(function*(){yield b.init();return wl(b.j,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return u(function*(){yield b.init();yield Kl(b.j,[a])})}};olympe.dc.sources.cache.au=class{constructor(a,b){this.j=a;this.D=b}};olympe.dc.sources.cache.Cache.D='__code-as-data-version__';olympe.dc.sources.cache.Cache.j='__code-as-data__';function Hl(a){return u(function*(){return(yield a.db.F('buckets')).map(b=>olympe.dc.sources.cache.Yq.Pb(b))})}function nl(a){return u(function*(){return(yield a.db.F('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.Rh.Pb(b);return dl(b.j)})})}function gl(a,b,c){return u(function*(){a.G.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.D()})}function hl(a){return u(function*(){return a.db.D()})}
906
+ function il(a,b,c){a.G.debug(`Offline DB: Apply patch ${b.T()} on local offline db`);Array.from(b.Bb.keys());return a.db.D().then(()=>{null===c&&(b.Bb.forEach((d,e)=>a.D.add(e)),a.F().then(()=>{}))})}function pl(a,b){return new Promise((c,d)=>{null!==a.files?c(a.files.has(b)):a.j.push(e=>{let f;return e?d(e):c(!(null==(f=a.files)||!f.has(b)))})})}
907
+ function ql(a,b,c,d){c=new olympe.dc.sources.cache.Nm(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function tl(a,b){return u(function*(){return a.db.remove('buckets',b).then(()=>{})})}function zl(a){return u(function*(){return(yield a.db.F('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.Rh.Pb(c);const d=c.D;let e;const f=null!=(e=b.get(d))?e:[];f.push(dl(c.j));b.set(d,f);return b},new Map)})}
908
+ function Al(a,b){return u(function*(){return a.db.remove('pending-transactions',b.T()).then(()=>{})})}function wl(a,b){return u(function*(){const c=yield a.db.get('files',b);if(!c)throw Error(`File ${b} not found in offline cache database`);return olympe.dc.sources.cache.Nm.Pb(c)})}function Cl(a){return u(function*(){return a.db.F('pending-transactions')})}
909
+ function El(a,b){return u(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.Rh.Pb(d);e&&c.set(e.j.i,d)}yield a.db.ba()})}function Gl(a){return u(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
910
+ function Il(a,b){return u(function*(){const c=b.jb();a.G.debug(`Offline DB: Executing query ${b.T()} by ID with source ${c}`);const d=olympe.dc.query.Dd.xj(b);var e=(yield a.db.H(b.T())).map(f=>olympe.dc.sources.cache.Pg.Pb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.yk.Wb(f);const g=Ll(f.Kd);d.create(f.tag,e,g);for(const h of f.ob)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.fc.Zc&&!0===e||d.Oa(k,e?n:f.tag,e?f.tag:n)}}a.G.j()&&
911
+ a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.ac().Bb.size,'instances',Array.from(d.ac().Id()).length,'relations');return d})}function Jl(a,b,c){b=a.N.fa(b);a.G.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.Rh(c,b,Date.now())).toJSON())}function Ml(a){return u(function*(){return a.db.N('pending-transactions')})}function Kl(a,b){return u(function*(){b.forEach(c=>a.files.delete(c));yield a.db.Z()})}
912
+ function Ll(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,dl(d)),new Map)}
913
+ olympe.dc.sources.cache.yk=class{constructor(a,b,c){this.H=`Olympe_Cache_${a}`;this.G=b;this.N=new olympe.dc.sources.cache.Vp;this.db=c.D(this.H);this.D=new Set;this.j=[];this.files=null;this.db.R('files').then(d=>{this.files=new Set(d);this.j.forEach(e=>e(null))}).catch(d=>{this.j.forEach(e=>e(d))});this.F=olympe.U.Promise.uj(()=>{const d=this;return u(function*(){if(!(0===d.D.size||0<(yield Ml(d))))if(0<d.db.X())d.F().then(()=>{}),d.G.debug('Offline DB GC: Postponing round while the stack is busy');
914
+ else{d.G.debug(`Offline DB GC: Round with ${d.D.size} candidates`);var e=Date.now();yield d.db.D().then(()=>{});d.G.debug(`Offline DB GC: has taken ${Date.now()-e}ms to run`)}})},5E3)}static Wb(a){const b=new RegExp(`^(${olympe.dc.fc.Zc})>([a-z0-9]*)$`);for(const c of a.ob)if(a=c.match(b))return a[2];return null}executeQuery(a){const b=this;return u(function*(){const c=Date.now();b.G.debug(`Offline DB: Executing query ${a.T()} with source ${a.jb()}`);const d=olympe.dc.query.Dd.xj(a),e=a.jb();var f=
915
+ yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Pg.Pb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.yk.Wb(g),Ll(g.Kd));for(const p of ki(a))if(p instanceof olympe.dc.query.ma.Wh){var k=p.relation;g=k.La()===olympe.dc.ta.ORIGIN;const q=k.W(),r=k.$b();k=new Set;f.set(p.T(),k);const t=[f.has(p.j)?new Set(f.get(p.j)):new Set([a.D])];for(const v of t){const x=new Map;var l=yield Promise.all(Array.from(v).map(y=>{if(!h.has(y))return b.G.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
916
+ Promise.resolve([]);r.W();return b.db.H().then(z=>z.map(A=>olympe.dc.sources.cache.Pg.Pb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.ma.De&&p.F&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.ma.De&&!k.has(l)){var n=t[t.length-1];n||(n=new Set,t.push(n));n.add(l)}k.add(l);h.has(l)||(h.add(l),n=olympe.dc.sources.cache.yk.Wb(A),d.create(l,n,Ll(A.Kd)));q===olympe.dc.fc.Zc&&!0===g||d.Oa(q,g?l:y,g?y:l)}}}}else p instanceof
915
917
  olympe.dc.query.ma.Od&&b.G.warn(`Offline DB: Trying to execute a query ${a.T()} on the Cache DB that contains a FollowRule part. This is not supported and designed not to happen.`);b.G.j()&&(b.G.debug(`Offline DB: Data result for query ${a.T()}`,d.ac().Bb.size,'instances',Array.from(d.ac().Id()).length,'relations'),b.G.debug(`Offline DB: Data result for query ${a.T()} took ${Date.now()-c}ms to be executed`));return d})}};
916
- olympe.dc.sources.cache.Xq=class{constructor(a,b){this.name=a;this.j=b}static Pb(a){return a?new olympe.dc.sources.cache.Xq(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.j}}};
918
+ olympe.dc.sources.cache.Yq=class{constructor(a,b){this.name=a;this.j=b}static Pb(a){return a?new olympe.dc.sources.cache.Yq(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.j}}};
917
919
  olympe.dc.sources.cache.Pg=class{constructor(a,b,c,d,e){this.tag=a;this.source=b;this.Kd=null!=c?c:{};this.ob=null!=d?d:[];this.j=null!=e?e:[]}static Pb(a){return a?new olympe.dc.sources.cache.Pg(a.tag,a.source,a.props,a.relations,a.queryIds):null}toJSON(){return{tag:this.tag,source:this.source,props:this.Kd,relations:this.ob,queryIds:this.j}}};
918
920
  olympe.dc.sources.cache.Rh=class{constructor(a,b,c){this.D=a;this.j=b;this.timestamp=c}static Pb(a){return a?new olympe.dc.sources.cache.Rh(a.destination,a.patch,a.timestamp):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp}}};
919
- olympe.dc.sources.cache.Rv=class extends olympe.dc.sources.cache.Rh{constructor(a,b,c,d){super(a,b,c);this.error=d}static Pb(a){return a?new olympe.dc.sources.cache.Rv(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp,error:this.error}}};
920
- olympe.dc.sources.cache.Km=class{constructor(a,b,c){this.tag=a;this.content=b;this.j=c}static Pb(a){return a?new olympe.dc.sources.cache.Km(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.j}}};function Ll(a,b){let c=a.N.get(b);c||(c=new Set(a.j.get(b).ob),a.N.set(b,c));return c}
921
- olympe.dc.sources.cache.Du=class{constructor(a,b){this.G=a;this.F=b;this.j=new Map;this.R=new Set;this.X=new Set;this.H=new olympe.dc.sources.cache.Up;this.N=new Map}Uc(){this.R.forEach(a=>this.j.delete(a));Array.from(this.j.entries()).forEach(([a,b])=>{b||this.j.delete(a)});return this.j}Rc(a,b,c){const d=this.j.get(a);d||this.X.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.H.fa(k[1]);return h},null!=(e=null==d?void 0:d.Kd)?e:{});let f;e=null!=(f=null==d?void 0:d.j)?f:[];null===
922
- this.F||e.includes(this.F)||e.push(this.F);let g;b=new olympe.dc.sources.cache.Pg(a,b,c,null!=(g=null==d?void 0:d.ob)?g:[],e);this.j.set(a,b)}Xc(a,b){const c=this.j.get(a);if(c){var d;c.Kd=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.H.fa(g);return e},null!=(d=c.Kd)?d:{})}else this.G.warn(`Trying to update an instance (${a}) which do not exists in the cache database: ignoring.`)}D(a){this.R.add(a)}Oa(a,b,c){var d;const e=null!=(d=this.j.get(b))?d:new olympe.dc.sources.cache.Pg(b,
923
- 'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Pg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.ua.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=Ll(this,g.tag);k.has(h)||(g.ob.push(h),k.add(h));null===this.F||g.j.includes(this.F)||g.j.push(this.F)};f(e,`${a}${olympe.dc.ua.DESTINATION}${c}`);f(d,b)}hc(a,b,c){const d=this.j.get(b),e=this.j.get(c);c=`${a}${olympe.dc.ua.DESTINATION}${c}`;a=`${a}${olympe.dc.ua.ORIGIN}${b}`;b=(f,g)=>{const h=Ll(this,f.tag);if(h.has(g)){const k=
924
- f.ob.indexOf(g);f.ob.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.Du.ya=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.Gi=class a{constructor(b,c){this.id=null!=b?b:olympe.U.Kc();this.D=new olympe.C.Wb('BurstTransaction#'+this.id,c);this.yb=Ml(this);this.R=!1;this.D.onDestroy(()=>this.N());this.X=new Set;this.F=new Map;this.H=new Set;this.j=null;let d;this.Wa=null!=(d=olympe.V.getParameter(olympe.dc.transaction.Config.xo))?d:30;this.ia=[]}static j(b,c){return`${b},${c}`}Yb(b){for(const c of this.ia)c(b);this.stop()}Ha(){null!==this.j&&(clearTimeout(this.j),this.j=null);const b=this.da(this.H);0<b.size&&
925
- Nl(this,b,!1);this.H.clear()}da(b){const c=new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.F.get(d))});return c}Z(b,c,d){this.sa(b,c,d);this.yb(b,c,d);null===this.j&&(this.j=setTimeout(this.Ha.bind(this),this.Wa))}sa(b,c,d){b=a.j(b,c);this.F.set(b,d);this.H.add(b)}nb(b,c){return this.F.get(a.j(b,c))}push(b,c){const d=olympe.dc.ea(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ea(f),this.nb(d,e)!==g&&this.Z(d,e,g.valueOf())});
926
- this.X.add(b)}complete(){return new Promise((b,c)=>{this.N((d,e)=>{for(const f of this.X)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ea(b),f=olympe.dc.ea(c);void 0===e||void 0===f?olympe.ha.Xa('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.Tn([d],g=>{this.R=!0;if(g instanceof olympe.dc.vc)olympe.ha.Xa('dc').error('Cannot send complex property values in burst transactions');else{var h;this.Z(e,f,null!=(h=null==g?void 0:g.valueOf())?
927
- h:null)}})}),this.D.Xd(()=>{this.N()}))}stop(){this.D.destroy();this.ia.length=0}getContext(){return this.D}T(){return this.id}th(){return!1}N(b){if(this.R){this.R=!1;null!==this.j&&(clearTimeout(this.j),this.j=null);this.H.clear();const c=this.da(new Set(this.F.keys()));Nl(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.Gi.prototype.complete=olympe.dc.Gi.prototype.complete;olympe.dc.Gi.prototype.push=olympe.dc.Gi.prototype.push;olympe.dc.Oc=class{j(){}toString(){}};olympe.dc.Oc.j=1;olympe.dc.Oc.D=2;olympe.dc.Oc.H=3;olympe.dc.Oc.F=4;olympe.dc.Oc.N=5;olympe.dc.transaction.dj=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ia.SERVER}static j(b){const c=new Map;for(const [d,e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.he.Xe+b.substring(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':case 'boolean':case 'number':c.set(b,e);break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,
928
- e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.C.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.vc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}j(b,c){return this.D(b,new olympe.dc.db.ec(c))}D(b,c){for(const d of b)switch(d.o){case olympe.dc.Oc.j:b=a.j(d.p||{});let e;c.Rc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case olympe.dc.Oc.D:c.Xc(d.t,
929
- a.j(d.p),d.m);break;case olympe.dc.Oc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Oc.F:c.Oa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Oc.N:c.hc(d.m,d.l,d.r,d.lm,d.rm);break;default:throw Error('Undefined patch operation: '+d.o);}return c}};function Ol(a,b){let c;return null!=(c=a.sources.get(b))?c:a.H.Qe(b)}function Pl(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.j.Tc(b))?void 0:c.Ub())?d:a.db.model(b))?e:null}function Z(a,b){let c;return null!=(c=a.F.get(b))?c:a.db.Re(b)||!a.db.Ja(b)}function Ql(a,b){0===a.F.size?a.F=b:b.forEach((c,d)=>a.F.set(d,c))}function Rl(a){return Array.from(a.j.Uc()).filter(b=>!b.yd()).map(b=>b.tag())}function Sl(a){return Array.from(a.j.Uc()).filter(b=>b.yd()).map(b=>b.tag())}
930
- function Tl(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ia.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.ec(a.id),a.D.set(b,c)),d(c))}function Ul(a,b,c){const d=Ol(a,b),e=Z(a,b),f=Pl(a,b);Tl(a,d,e,g=>{g.D(b,c,f)})}
931
- olympe.dc.transaction.$v=class{constructor(a,b,c){this.id=null!=c?c:olympe.U.Kc();this.H=b;this.db=a;this.D=new Map;this.j=new olympe.dc.db.ec(this.id);this.sources=new Map;this.F=new Map}nf(){return 0===this.j.Bb.size}Rc(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.H.fromModel(b);c=Z(this,a);this.sources.set(a,f);Tl(this,f,c,g=>{g.Rc(a,f,d,b)})}Xc(a,b){const c=Ol(this,a),d=Z(this,a),e=Pl(this,a);Tl(this,c,d,f=>{f.Xc(a,null!=b?b:new Map,e)})}Oa(a,b,c){const d=Ol(this,b),e=
932
- Ol(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.fc.Zc&&(f=g=>{let h;return null!=(h=olympe.dc.ga().name(g))?h:g},olympe.ha.Xa('dc').warn(`Try to create a relation between 2 objects that have different locations: \n ${f(b)} (${b})-[${f(a)} (${a})]->${f(c)} (${c}), originSrc: ${f(d)} (${d}), destinationSrc: ${f(e)} (${e})`),f=!1);Tl(this,d,f,g=>{g.Oa(a,b,c,Pl(this,b),Pl(this,c))})}hc(a,b,c){const d=Ol(this,b),e=Ol(this,c);let f=Z(this,b)&&
933
- Z(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.fc.Zc&&(olympe.ha.Xa('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);Tl(this,d,f,g=>{g.hc(a,b,c,Pl(this,b),Pl(this,c))})}};function Vl(a,b,c){const d=Object.create(null);if(!b)return d;for(const f of Array.from(b.keys()).sort()){let g=f;var e=b.get(f);if(g===olympe.dc.kq.Zg)if(e===olympe.dc.Ia.SELF)d[g]=olympe.dc.ga().T();else{if(e===olympe.dc.Ia.SERVER)continue}else g.startsWith(olympe.dc.he.Xe)&&(g='fd'+g.substring(1));e=a.R(e);c&&e instanceof Object&&8===e.c?a.N.set(g,e):d[g]=e}return d}function Wl(a){if(0===a.N.size)return null;const b=Object.create(null);a.N.forEach((c,d)=>{b[d]=c});a.N.clear();return b}
934
- class Xl{constructor(){this.N=new Map}R(a){return a instanceof olympe.C.Sa||a instanceof olympe.C.ba||a instanceof olympe.C.$?a.valueOf():a instanceof Date||a instanceof olympe.C.eb?(a=a instanceof olympe.C.eb?a.valueOf():a,{c:4,y:a.getUTCFullYear(),M:a.getUTCMonth()+1,d:a.getUTCDate(),h:a.getUTCHours(),m:a.getUTCMinutes(),s:a.getUTCSeconds(),S:a.getUTCMilliseconds(),z:0}):a instanceof olympe.C.Color?{c:7,r:a.oh().valueOf(),g:a.lh().valueOf(),b:a.hh().valueOf(),a:a.gh().valueOf()}:a&&'function'===
935
- typeof a.W?{c:8,t:a.W()}:a}}function Wf(a){const b=a.H.concat(a.F).concat(a.N).concat(a.j).concat(a.R);a.N=[];a.F=[];a.j=[];a.R=[];a.H=[];return b}
936
- olympe.dc.transaction.He=class{constructor({wl:a=!1,hi:b=!0,le:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.H=[];this.wl=null!=a?a:!1;this.le=null!=c?c:!0;this.hi=null!=b?b:!0;this.X=olympe.C?new Xl:new class extends Xl{R(d){return d&&'function'===typeof d.W?{c:8,t:d.W()}:d}}}flush(){return JSON.stringify(Wf(this))}Rc(a,b,c,d=null){c=Vl(this.X,null!=c?c:null,this.wl);c={o:olympe.dc.Oc.j,t:a,p:c};this.hi&&(c.s=b);this.le&&d&&(c.m=d);this.N.push(c);this.wl&&(b=Wl(this.X))&&this.j.push({o:olympe.dc.Oc.D,
937
- t:a,p:b})}Xc(a,b,c=null){b=Vl(this.X,b||null,!1);a={o:olympe.dc.Oc.D,t:a,p:b};this.le&&c&&(a.m=c);this.j.push(a)}D(a,b,c=null){a={o:olympe.dc.Oc.H,t:a,f:b};this.le&&c&&(a.m=c);this.F.push(a)}Oa(a,b,c,d=null,e=null){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);a={o:olympe.dc.Oc.F,m:a,l:b,r:c};this.le&&d&&(a.lm=d);this.le&&
938
- e&&(a.rm=e);this.R.push(a)}hc(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:olympe.dc.Oc.N,m:a,l:b,r:c};this.le&&d&&(a.lm=d);this.le&&e&&(a.rm=e);this.H.push(a)}};olympe.dc.transaction.He.ya=[olympe.dc.Writable];function Yl(a){var b=new olympe.dc.Ya;b.X=a;return b}function Zl(a,b){b instanceof olympe.dc.Ya&&b.D.forEach((c,d)=>a.D.set(d,c));a.Ga.push(b);return b}
939
- function $l(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',X(c,olympe.dc.CloudObject.nameProp.W(),b);else for(const [f,g]of Object.entries(b))X(c,f,g);b=c.W();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.W();Zl(a,new olympe.dc.transaction.Ga.ip(e,b));Zl(a,new olympe.dc.transaction.Ga.Vl(e,b,d));return c}
940
- function am(a,b){if(a.H)throw Error('Operation not permitted: this transaction has already been executed');a.H=!0;const c=[d=>{a.H=d},...a.Z,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
941
- olympe.dc.Ya=class{constructor(a){this.id=null!=a?a:olympe.U.Kc();this.Ga=[];this.F=new Map;this.X=!0;this.D=new Map;this.Z=[];this.H=this.N=!1;this.R=[...olympe.dc.Fj().Z]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.ea(a)))?b:olympe.dc.ga().model(a)}j(a){Ql(a,this.D);for(const b of this.Ga)b.j(a);try{this.R.forEach(b=>b(a))}catch(b){throw Error(`Transaction compilation error: ${b.message}`);}}create(a,b){b=Zl(this,new olympe.dc.transaction.Ga.Xo(a,b));const c=b.W();this.F.set(c,
942
- olympe.dc.ea(a));let d;this.persist(c,null!=(d=this.D.get(c))?d:this.X);return b}persist(a,b=!0){const c=olympe.dc.ea(a);var d=olympe.dc.ga();this.D.set(c,b);if(b){let f;b=null!=(f=this.F.get(c))?f:d.model(c);if(null===b)throw Error(`Try to persist an instance that does not exist: ${c}`);var e;d=null!=(e=d.source(a))?e:olympe.dc.ee().fromModel(b);Zl(this,new olympe.dc.transaction.Ga.aw(c,d))}else{if((e=d.Ja(c))&&d.Re(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
943
- if(!e&&!this.F.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Lb.Dc){Zl(this,new olympe.dc.transaction.Ga.jp(a,b))}update(a,b,c){return Zl(this,new olympe.dc.transaction.Ga.Zw(a,b,c))}Oa(a,b,c){Zl(this,new olympe.dc.transaction.Ga.Vl(a,b,c))}hc(a,b,c){Zl(this,new olympe.dc.transaction.Ga.lu(a,b,c))}xn(a,b){Zl(this,new olympe.dc.transaction.Ga.ip(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
944
- f);X(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.he.Xe+d.W(),e);this.Oa(olympe.dc.CloudObject.propertyRel,a,d);this.Oa(olympe.dm.Property.typeRel,d,b);this.Oa(olympe.dc.CloudObject.containsRel,a,d);return d}Fs(a,b,c='',{NE:d=olympe.dm.Relation.H.Nv,ZE:e=olympe.dm.Relation.j.gw,UE:f=olympe.dm.Relation.j.Ot,wF:g=olympe.dm.Relation.j.Wp,KE:h=olympe.dm.Dl.NONE,vF:k=olympe.dm.Relation.N|h}={},l=olympe.U.Kc()){c=X(X(X(X(X(X(X(X(X(X(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
945
- c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.da,e),olympe.dm.Relation.sa,e),olympe.dm.Relation.Z,e),olympe.dm.Relation.X,f),olympe.dm.Relation.ia,g),olympe.dm.Relation.Ha,olympe.dm.Relation.j.Wp),olympe.dm.Relation.R,h);this.Oa(olympe.dc.CloudObject.Lj,a,c);this.Oa(olympe.dm.Relation.destinationModelRel,c,b);this.Oa(olympe.dc.CloudObject.containsRel,a,c);return c}th(){return!1}nn(a){this.Z.push(olympe.C.Za().rc(a))}lb(a,b){bm(olympe.dc.Fj(),this,am(this,a),b)}yn(a){a=
946
- am(this,a);cm(olympe.dc.Fj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Ya.ya=[olympe.dc.Oc];function Ml(a){var b=olympe.dc.Fj();const c=a.T();b.H.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.ec(c);g.Xc(d,(new Map).set(e,f),b.db.model(d));b.j.md(Mf(g,Infinity))}}
947
- function Nl(a,b,c,d){var e=olympe.dc.Fj();const f=olympe.dc.Request.j.Fi,g=olympe.dc.Request.j.yh,h=a.T();a=a.th();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ia.SELF||!e.db.Re(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.ec(h),k.set(n,p));p.Xc(l,b.get(l),e.db.model(l))}for(const [l,n]of k)b=new olympe.dc.Request(c?g:f,l,new olympe.dc.transaction.lj(n,a)),b=e.Jb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.j.md(Mf(n,p));null==d||d(!0)})}
948
- function bm(a,b,c,d){if(d){const e=b.T();a.D.set(e,c);cm(a,b,(f,g)=>{f||(a.D.delete(e),c(f,g))},!1)}else cm(a,b,c,!1)}function dm(a){const b=olympe.dc.Request.j.jk;Uf(a.Jb,olympe.dc.Request.j.yo,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.T(),f=a.H.get(e);void 0!==f&&(a.H.delete(e),f.Yb(d));a.j.md(c);a.G.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});Uf(a.Jb,b,c=>{c=c.content;em(a,c.id,c.finalize,c.error)})}
949
- function fm(a,b,c){if(!c)throw Error('Transaction compiler id is required');a.sa.has(c)||a.Z.push(b);return a}
950
- function cm(a,b,c,d=!1){const e=b.T(),f=new olympe.dc.transaction.$v(a.db,a.ia,e);try{b.j(f)}catch(q){if(q instanceof olympe.dc.Pq){q.j.then(()=>cm(a,b,c,d));return}c(!1,q.message);return}if(f.nf()){c(!0);var g;null==(g=a.D.get(e))||g(!0);a.D.delete(e)}else{a.F.set(e,[]);var h=Rl(f);a.j.ne(h,olympe.dc.db.Instance.j.TRANSACTION);g=h.filter(q=>Z(f,q));var k=Sl(f).filter(q=>a.db.Re(q)&&a.db.Nb(q,olympe.dm.File)&&a.db.source(q)!==olympe.dc.Ia.SERVER).map(q=>[q,a.db.model(q),a.db.source(q)]),l=Pg(a.j,
951
- f.j,g),n=olympe.C.Za().rc((q,r)=>c(null!==q,r)),p=[l,n];gm(a,f,g).then(q=>{p.splice(1,0,q);hm(a,e,h,f.D.size+1);return im(a,f.D,d,b.th(),b.N)}).then(q=>Promise.allSettled(k.map(([r,t,v])=>a.N.sa(r,t,v))).then(r=>{r.forEach(t=>{'rejected'===t.status&&a.G.warn('Some binary files have not been deleted after the transaction:',t.reason)});return q})).then(q=>{p.forEach(r=>r(q));em(a,e,olympe.dc.transaction.If.j.$i)}).catch(q=>{a.G.error(q);p.forEach(r=>r(null,`${q}`));jm(a,e)})}}
952
- function gm(a,b,c){const d=b.j,e=olympe.dm.File.urlProp.W();c=c.filter(n=>{let p;return a.db.Nb(n,olympe.dm.File)&&void 0!==(null==(p=d.Tc(n))?void 0:p.Pa(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.j.W(),g=olympe.dm.File.modificationDateProp.W(),h=Array.from(b.D.values()),k=[],l=olympe.U.jf();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return l.F(p).then(q=>new Promise((r,t)=>{if(null===q)URL.revokeObjectURL(p),
953
- r();else{var v=n.W(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.N.ia(v,q,y,z=>{const A=h.reduce((K,Y)=>K||Y.Tc(v),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.mn(z),k.push([v,z]));URL.revokeObjectURL(p);r()},t)}}));2048<p.length&&a.G.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',n.W());return Promise.resolve([])})).then(()=>{const n=k.reduce((p,[q,r])=>{p.Xc(q,r);return p},
954
- new olympe.dc.db.ec);return Pg(a.j,n)})}function hm(a,b,c,d){const e=olympe.C.kh(),f=new olympe.async.Dk(e);0<a.R&&f.Zf(a.R);const g=olympe.dc.transaction.If.j.Iv;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.rc((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});td(f,(l,n)=>{l||a.G.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.j.detach(c,olympe.dc.db.Instance.j.TRANSACTION);jm(a,b)});f.start()}
955
- function im(a,b,c,d,e){if(c&&olympe.C.Qa(a.da.state)!==olympe.auth.Ta.j.rf)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.j.dh:olympe.dc.Request.j.df;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.lj(h,d,e));return a.Jb.request(g)})).then(g=>g[0])}
956
- function em(a,b,c,d){let e,f;null==(f=null==(e=a.F.get(b))?void 0:e.pop())||f(c,null!=d?d:null)}function jm(a,b){var c;null==(c=a.F.get(b))||c.forEach(d=>{d(olympe.dc.transaction.If.j.$i,null)});a.F.delete(b);if(0===a.F.size){for(const d of a.X)d();a.X=[]}a.D.has(b)&&(c=a.D.get(b),a.D.delete(b),c(!0))}
957
- olympe.dc.transaction.If=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Jb=c;this.ia=d;this.N=e;this.da=f;this.R=g.get('notificationTimeout');this.Z=[];let h;this.sa=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.H=new olympe.U.Zh(g.get('burstHoldTime'));this.F=new Map;this.X=[];this.D=new Map;this.Ha=new olympe.U.promise.Tk;dm(this)}re(a){vb(this.Ha,()=>this.Jb.request(new olympe.dc.Request(olympe.dc.Request.j.Fp,olympe.dc.Ia.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
958
- b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.If.j={Cm:0,$i:1,Iv:2};olympe.dc.transaction.lj=class{constructor(a,b=!1,c=!1){this.D=a;this.F=b;this.j=c}th(){return this.F}ac(){return this.D}};olympe.dc.transaction.P={Ca:'dc.transaction.Logger',Fa:'dc.transaction.Manager'};olympe.dc.transaction.Config={Dq:'dc.transaction.timeout',xo:'dc.transaction.burstInterval',bm:'dc.transaction.disabledCompilers'};
959
- olympe.V.config(function(a){E(a,olympe.dc.transaction.Config.Dq,9E4);E(a,olympe.dc.transaction.Config.xo,30);E(a,olympe.dc.transaction.Config.bm,[]);D(a,olympe.dc.transaction.P.Ca,[olympe.ha.P.Fa],b=>b.ad('dc'));D(a,'olympe.dc.transaction.Config',[new olympe.V.oa(olympe.dc.transaction.Config.Dq),new olympe.V.oa(olympe.dc.transaction.Config.bm),new olympe.V.oa(olympe.dc.db.Config.Pl)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));C(a,olympe.dc.transaction.P.Fa,
960
- olympe.dc.transaction.If,olympe.dc.transaction.P.Ca,olympe.dc.db.P.Fa,olympe.dc.P.Ug,olympe.dc.sources.P.af,olympe.dc.P.hk,olympe.auth.P.Fa,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Ga={};function km(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Qa(e));return c}olympe.dc.transaction.Ga.Cg=class{constructor(){this.ga=olympe.dc.ga()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Qa(a){a=olympe.C.Qa(a);return void 0===a||null===a?null:olympe.C.et(a)?a.valueOf():a}};olympe.dc.transaction.Ga.Cg.ya=[olympe.dc.Oc];olympe.dc.transaction.Ga.po=class extends olympe.dc.transaction.Ga.Cg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Ra.Relation?a:new olympe.dc.Ra.Relation(olympe.dc.ea(a));this.origin=this.ga.Ja(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.W()}La(){return this.relation.La()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function X(a,b,c){a.Kd.set(olympe.dc.ea(b),c);return a}olympe.dc.transaction.Ga.Xo=class extends olympe.dc.transaction.Ga.Cg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ea(b))?c:olympe.U.hf();this.model=olympe.dc.ea(a);this.source=null;this.Kd=new Map}W(){return this.tag}Vb(){return this.model}yi(a){this.source=a;return this}j(a){const b=this.Vb(),c=this.W();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Rc(c,b,this.source,km(this,this.Kd))}toString(){return`CreateInstance(${this.Vb()}, ${this.W()})`}};
961
- olympe.dc.transaction.Ga.Xo.ya=[olympe.dc.Ye];olympe.dc.transaction.Ga.Vl=class extends olympe.dc.transaction.Ga.po{constructor(a,b,c){super(a,b);this.D=this.ga.Ja(c)?olympe.dc.CloudObject.get(c):c}j(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.fc.Zc)throw Error('OperationError: Cannot create the instance -> model relation');if(!this.origin)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
962
- if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.La()===olympe.dc.ua.DESTINATION?a.Oa(b,olympe.dc.ea(this.origin),olympe.dc.ea(this.D)):a.Oa(b,olympe.dc.ea(this.D),olympe.dc.ea(this.origin))}toString(){return`CreateRelation('${this.relation.La()}${this.relation.W()}, ${olympe.dc.ea(this.origin)}, ${olympe.dc.ea(this.D)})`}};olympe.dc.transaction.Ga.bB=class extends olympe.dc.transaction.Ga.Cg{constructor(a,b=olympe.dc.Lb.Dc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Ob=b}j(a){for(const b of this.ga.Uc(this.model))b!==olympe.dc.ea(this.model)&&(new olympe.dc.transaction.Ga.jp(b,this.Ob)).j(a)}toString(){return`DeleteAllInstances(${this.model.W()}, ${this.Ob})`}};olympe.dc.transaction.Ga.ip=class extends olympe.dc.transaction.Ga.po{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Zc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ea(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.La(),e=this.ga.cb(c,this.relation);for(const f of e)d===olympe.dc.ua.DESTINATION?
963
- a.hc(b,c,f):a.hc(b,f,c)}toString(){return`DeleteAllRelations(${this.La()}${this.getType()})`}};olympe.dc.transaction.Ga.jp=class extends olympe.dc.transaction.Ga.Cg{constructor(a,b=olympe.dc.Lb.Dc){super();this.tag=this.ga.Ja(a)?olympe.dc.CloudObject.get(a):a;this.Ob=b}W(){return olympe.dc.ea(this.tag)}j(a){const b=this.W();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ga.Ja(b)&&Ul(a,b,this.Ob)}toString(){return'DeleteInstance('+this.W()+', '+this.Ob+')'}};olympe.dc.transaction.Ga.lu=class extends olympe.dc.transaction.Ga.Vl{j(a){const b=this.relation.W();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Zc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ea(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.ea(this.D);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
964
- this.relation.La()===olympe.dc.ua.DESTINATION?a.hc(b,c,d):a.hc(b,d,c)}toString(){return'DeleteRelation('+this.relation.La()+this.relation.W()+', '+olympe.dc.ea(this.origin)+', '+olympe.dc.ea(this.D)+')'}};olympe.dc.transaction.Ga.Zw=class extends olympe.dc.transaction.Ga.Cg{constructor(a,b,c){super();this.tag=this.ga.Ja(a)?olympe.dc.CloudObject.get(a):a;this.Kd=new Map;void 0!==b&&this.Kd.set(olympe.dc.ea(b),c)}W(){return olympe.dc.ea(this.tag)}j(a){const b=this.W();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.j.Tc(b))&&c.D()||this.ga.Ja(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=km(this,this.Kd);
965
- for(const [e,f]of c){var d=this.ga.Pa(b,e,!0);d instanceof olympe.dc.vc&&Ul(a,d.W(),olympe.dc.Lb.Dc);f instanceof olympe.dc.vc&&!Z(a,f.W())&&(d=new olympe.dc.Ya,d.persist(f.W()),d.j(a))}a.Xc(b,c)}toString(){return'UpdateInstance('+this.W()+', '+km(this,this.Kd)+')'}};olympe.dc.transaction.Ga.aw=class a extends olympe.dc.transaction.Ga.Cg{constructor(b,c){super();this.tag=b;this.source=c}j(b){const c=olympe.dc.ga();if(Z(b,this.tag)&&c.Ja(this.tag)&&!c.Re(this.tag)){const e=c.zb(this.tag,!0);var d;let f;null==(f=null==(d=b.j.Tc(this.tag))?void 0:d.zb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.vc&&c.Ja(g.W())&&(new a(g.W(),this.source)).j(b);d=c.model(this.tag);b.Rc(this.tag,d,this.source,e);for(const [g,h,k]of sh(c,this.tag))Z(b,
966
- k)&&(h===olympe.dc.ua.ORIGIN?b.Oa(g,k,this.tag):b.Oa(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.ea=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.W)&&(null==a||!a.fh))b=a.W();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.na.Vb(a))?d:''}else if(olympe.C.pf(a)){let d;b=olympe.dc.ea(null==(d=olympe.C.Qa(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};w('olympe.dc.instanceToTag',olympe.dc.ea);olympe.dc.ga=function(){return olympe.dc.Ms().view};olympe.dc.register=function(a,b){olympe.dc.na.j(a,b)};
967
- olympe.dc.defineProperty=function(a){return new olympe.dc.Ra.Property(a)};olympe.dc.Fs=function(a,b=olympe.dc.ua.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.ua.DESTINATION){const e=olympe.dc.ua.DESTINATION;return b===olympe.dc.ua.ORIGIN||b===e?new olympe.dc.Ra.Relation(a,b):new olympe.dc.Ra.Relation(a,d,b,c)};olympe.dc.Jx=function(a){return a.$b()};olympe.dc.ib={};olympe.dc.ib.un=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.C.wb(a):a instanceof olympe.C.Sa?a:null;olympe.dc.ib.rn=a=>'boolean'===typeof a||a instanceof Boolean?olympe.C.Rb(a):a instanceof olympe.C.ba?a:null;olympe.dc.ib.tn=a=>'number'===typeof a||a instanceof Number?olympe.C.qa(a):'string'===typeof a||a instanceof String?olympe.C.qa(Number.parseFloat(a.valueOf())):a instanceof olympe.C.$?a:null;
968
- olympe.dc.ib.sn=a=>'number'===typeof a||a instanceof Number?nc(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.C.eb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.C.eb(a):a instanceof olympe.C.eb?a:null;olympe.dc.ib.As=function(a){return a instanceof olympe.C.Color?a:'string'===typeof a||a instanceof String?rc(a.valueOf()):null};olympe.dc.ib.Bs=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.vc?olympe.dc.CloudObject.get(a.tag):null;
921
+ olympe.dc.sources.cache.Sv=class extends olympe.dc.sources.cache.Rh{constructor(a,b,c,d){super(a,b,c);this.error=d}static Pb(a){return a?new olympe.dc.sources.cache.Sv(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp,error:this.error}}};
922
+ olympe.dc.sources.cache.Nm=class{constructor(a,b,c){this.tag=a;this.content=b;this.j=c}static Pb(a){return a?new olympe.dc.sources.cache.Nm(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.j}}};function Nl(a,b){let c=a.N.get(b);c||(c=new Set(a.j.get(b).ob),a.N.set(b,c));return c}
923
+ olympe.dc.sources.cache.Eu=class{constructor(a,b){this.G=a;this.F=b;this.j=new Map;this.R=new Set;this.X=new Set;this.H=new olympe.dc.sources.cache.Vp;this.N=new Map}Vc(){this.R.forEach(a=>this.j.delete(a));Array.from(this.j.entries()).forEach(([a,b])=>{b||this.j.delete(a)});return this.j}Sc(a,b,c){const d=this.j.get(a);d||this.X.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.H.fa(k[1]);return h},null!=(e=null==d?void 0:d.Kd)?e:{});let f;e=null!=(f=null==d?void 0:d.j)?f:[];null===
924
+ this.F||e.includes(this.F)||e.push(this.F);let g;b=new olympe.dc.sources.cache.Pg(a,b,c,null!=(g=null==d?void 0:d.ob)?g:[],e);this.j.set(a,b)}Yc(a,b){const c=this.j.get(a);if(c){var d;c.Kd=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.H.fa(g);return e},null!=(d=c.Kd)?d:{})}else this.G.warn(`Trying to update an instance (${a}) which do not exists in the cache database: ignoring.`)}D(a){this.R.add(a)}Oa(a,b,c){var d;const e=null!=(d=this.j.get(b))?d:new olympe.dc.sources.cache.Pg(b,
925
+ 'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Pg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.ta.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=Nl(this,g.tag);k.has(h)||(g.ob.push(h),k.add(h));null===this.F||g.j.includes(this.F)||g.j.push(this.F)};f(e,`${a}${olympe.dc.ta.DESTINATION}${c}`);f(d,b)}hc(a,b,c){const d=this.j.get(b),e=this.j.get(c);c=`${a}${olympe.dc.ta.DESTINATION}${c}`;a=`${a}${olympe.dc.ta.ORIGIN}${b}`;b=(f,g)=>{const h=Nl(this,f.tag);if(h.has(g)){const k=
926
+ f.ob.indexOf(g);f.ob.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.Eu.ya=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.Gi=class a{constructor(b,c){this.id=null!=b?b:olympe.U.Lc();this.D=new olympe.C.Xb('BurstTransaction#'+this.id,c);this.vb=Ol(this);this.R=!1;this.D.onDestroy(()=>this.N());this.X=new Set;this.F=new Map;this.H=new Set;this.j=null;let d;this.Ua=null!=(d=olympe.V.getParameter(olympe.dc.transaction.Config.yo))?d:30;this.ia=[]}static j(b,c){return`${b},${c}`}Ub(b){for(const c of this.ia)c(b);this.stop()}Ha(){null!==this.j&&(clearTimeout(this.j),this.j=null);const b=this.ba(this.H);0<b.size&&
927
+ Pl(this,b,!1);this.H.clear()}ba(b){const c=new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.F.get(d))});return c}Z(b,c,d){this.wa(b,c,d);this.vb(b,c,d);null===this.j&&(this.j=setTimeout(this.Ha.bind(this),this.Ua))}wa(b,c,d){b=a.j(b,c);this.F.set(b,d);this.H.add(b)}lb(b,c){return this.F.get(a.j(b,c))}push(b,c){const d=olympe.dc.ea(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ea(f),this.lb(d,e)!==g&&this.Z(d,e,g.valueOf())});
928
+ this.X.add(b)}complete(){return new Promise((b,c)=>{this.N((d,e)=>{for(const f of this.X)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ea(b),f=olympe.dc.ea(c);void 0===e||void 0===f?olympe.ga.Wa('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.Wn([d],g=>{this.R=!0;if(g instanceof olympe.dc.vc)olympe.ga.Wa('dc').error('Cannot send complex property values in burst transactions');else{var h;this.Z(e,f,null!=(h=null==g?void 0:g.valueOf())?
929
+ h:null)}})}),this.D.Xd(()=>{this.N()}))}stop(){this.D.destroy();this.ia.length=0}getContext(){return this.D}T(){return this.id}th(){return!1}N(b){if(this.R){this.R=!1;null!==this.j&&(clearTimeout(this.j),this.j=null);this.H.clear();const c=this.ba(new Set(this.F.keys()));Pl(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.Gi.prototype.complete=olympe.dc.Gi.prototype.complete;olympe.dc.Gi.prototype.push=olympe.dc.Gi.prototype.push;olympe.dc.Qc=class{j(){}toString(){}};olympe.dc.Qc.j=1;olympe.dc.Qc.D=2;olympe.dc.Qc.H=3;olympe.dc.Qc.F=4;olympe.dc.Qc.N=5;olympe.dc.transaction.dj=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ia.SERVER}static j(b){const c=new Map;for(const [d,e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.he.Xe+b.substring(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':case 'boolean':case 'number':c.set(b,e);break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,
930
+ e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.C.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.vc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}j(b,c){return this.D(b,new olympe.dc.db.ec(c))}D(b,c){for(const d of b)switch(d.o){case olympe.dc.Qc.j:b=a.j(d.p||{});let e;c.Sc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case olympe.dc.Qc.D:c.Yc(d.t,
931
+ a.j(d.p),d.m);break;case olympe.dc.Qc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Qc.F:c.Oa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Qc.N:c.hc(d.m,d.l,d.r,d.lm,d.rm);break;default:throw Error('Undefined patch operation: '+d.o);}return c}};function Ql(a,b){let c;return null!=(c=a.sources.get(b))?c:a.H.pe(b)}function Rl(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.j.Uc(b))?void 0:c.Vb())?d:a.db.model(b))?e:null}function Z(a,b){let c;return null!=(c=a.F.get(b))?c:a.db.Re(b)||!a.db.Ja(b)}function Sl(a,b){0===a.F.size?a.F=b:b.forEach((c,d)=>a.F.set(d,c))}function Tl(a){return Array.from(a.j.Vc()).filter(b=>!b.yd()).map(b=>b.tag())}function Ul(a){return Array.from(a.j.Vc()).filter(b=>b.yd()).map(b=>b.tag())}
932
+ function Vl(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ia.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.ec(a.id),a.D.set(b,c)),d(c))}function Wl(a,b,c){const d=Ql(a,b),e=Z(a,b),f=Rl(a,b);Vl(a,d,e,g=>{g.D(b,c,f)})}
933
+ olympe.dc.transaction.aw=class{constructor(a,b,c){this.id=null!=c?c:olympe.U.Lc();this.H=b;this.db=a;this.D=new Map;this.j=new olympe.dc.db.ec(this.id);this.sources=new Map;this.F=new Map}nf(){return 0===this.j.Bb.size}Sc(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.H.fromModel(b);c=Z(this,a);this.sources.set(a,f);Vl(this,f,c,g=>{g.Sc(a,f,d,b)})}Yc(a,b){const c=Ql(this,a),d=Z(this,a),e=Rl(this,a);Vl(this,c,d,f=>{f.Yc(a,null!=b?b:new Map,e)})}Oa(a,b,c){const d=Ql(this,b),e=
934
+ Ql(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.fc.Zc&&(f=g=>{let h;return null!=(h=olympe.dc.ha().name(g))?h:g},olympe.ga.Wa('dc').warn(`Try to create a relation between 2 objects that have different locations: \n ${f(b)} (${b})-[${f(a)} (${a})]->${f(c)} (${c}), originSrc: ${f(d)} (${d}), destinationSrc: ${f(e)} (${e})`),f=!1);Vl(this,d,f,g=>{g.Oa(a,b,c,Rl(this,b),Rl(this,c))})}hc(a,b,c){const d=Ql(this,b),e=Ql(this,c);let f=Z(this,b)&&
935
+ Z(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.fc.Zc&&(olympe.ga.Wa('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);Vl(this,d,f,g=>{g.hc(a,b,c,Rl(this,b),Rl(this,c))})}};function Xl(a,b,c){const d=Object.create(null);if(!b)return d;for(const f of Array.from(b.keys()).sort()){let g=f;var e=b.get(f);if(g===olympe.dc.lq.Zg)if(e===olympe.dc.Ia.SELF)d[g]=olympe.dc.ha().T();else{if(e===olympe.dc.Ia.SERVER)continue}else g.startsWith(olympe.dc.he.Xe)&&(g='fd'+g.substring(1));e=a.R(e);c&&e instanceof Object&&8===e.c?a.N.set(g,e):d[g]=e}return d}function Yl(a){if(0===a.N.size)return null;const b=Object.create(null);a.N.forEach((c,d)=>{b[d]=c});a.N.clear();return b}
936
+ class Zl{constructor(){this.N=new Map}R(a){return a instanceof olympe.C.Sa||a instanceof olympe.C.da||a instanceof olympe.C.$?a.valueOf():a instanceof Date||a instanceof olympe.C.eb?(a=a instanceof olympe.C.eb?a.valueOf():a,{c:4,y:a.getUTCFullYear(),M:a.getUTCMonth()+1,d:a.getUTCDate(),h:a.getUTCHours(),m:a.getUTCMinutes(),s:a.getUTCSeconds(),S:a.getUTCMilliseconds(),z:0}):a instanceof olympe.C.Color?{c:7,r:a.oh().valueOf(),g:a.lh().valueOf(),b:a.hh().valueOf(),a:a.gh().valueOf()}:a&&'function'===
937
+ typeof a.W?{c:8,t:a.W()}:a}}function Yf(a){const b=a.H.concat(a.F).concat(a.N).concat(a.j).concat(a.R);a.N=[];a.F=[];a.j=[];a.R=[];a.H=[];return b}
938
+ olympe.dc.transaction.Ie=class{constructor({xl:a=!1,hi:b=!0,le:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.H=[];this.xl=null!=a?a:!1;this.le=null!=c?c:!0;this.hi=null!=b?b:!0;this.X=olympe.C?new Zl:new class extends Zl{R(d){return d&&'function'===typeof d.W?{c:8,t:d.W()}:d}}}flush(){return JSON.stringify(Yf(this))}Sc(a,b,c,d=null){c=Xl(this.X,null!=c?c:null,this.xl);c={o:olympe.dc.Qc.j,t:a,p:c};this.hi&&(c.s=b);this.le&&d&&(c.m=d);this.N.push(c);this.xl&&(b=Yl(this.X))&&this.j.push({o:olympe.dc.Qc.D,
939
+ t:a,p:b})}Yc(a,b,c=null){b=Xl(this.X,b||null,!1);a={o:olympe.dc.Qc.D,t:a,p:b};this.le&&c&&(a.m=c);this.j.push(a)}D(a,b,c=null){a={o:olympe.dc.Qc.H,t:a,f:b};this.le&&c&&(a.m=c);this.F.push(a)}Oa(a,b,c,d=null,e=null){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);a={o:olympe.dc.Qc.F,m:a,l:b,r:c};this.le&&d&&(a.lm=d);this.le&&
940
+ e&&(a.rm=e);this.R.push(a)}hc(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:olympe.dc.Qc.N,m:a,l:b,r:c};this.le&&d&&(a.lm=d);this.le&&e&&(a.rm=e);this.H.push(a)}};olympe.dc.transaction.Ie.ya=[olympe.dc.Writable];function $l(a){var b=new olympe.dc.Ya;b.X=a;return b}function am(a,b){b instanceof olympe.dc.Ya&&b.D.forEach((c,d)=>a.D.set(d,c));a.Ga.push(b);return b}
941
+ function bm(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',X(c,olympe.dc.CloudObject.nameProp.W(),b);else for(const [f,g]of Object.entries(b))X(c,f,g);b=c.W();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.W();am(a,new olympe.dc.transaction.Ga.jp(e,b));am(a,new olympe.dc.transaction.Ga.Yl(e,b,d));return c}
942
+ function cm(a,b){if(a.H)throw Error('Operation not permitted: this transaction has already been executed');a.H=!0;const c=[d=>{a.H=d},...a.Z,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
943
+ olympe.dc.Ya=class{constructor(a){this.id=null!=a?a:olympe.U.Lc();this.Ga=[];this.F=new Map;this.X=!0;this.D=new Map;this.Z=[];this.H=this.N=!1;this.R=[...olympe.dc.Fj().Z]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.ea(a)))?b:olympe.dc.ha().model(a)}j(a){Sl(a,this.D);for(const b of this.Ga)b.j(a);try{this.R.forEach(b=>b(a))}catch(b){throw Error(`Transaction compilation error: ${b.message}`);}}create(a,b){b=am(this,new olympe.dc.transaction.Ga.Yo(a,b));const c=b.W();this.F.set(c,
944
+ olympe.dc.ea(a));let d;this.persist(c,null!=(d=this.D.get(c))?d:this.X);return b}persist(a,b=!0){const c=olympe.dc.ea(a);var d=olympe.dc.ha();this.D.set(c,b);if(b){let f;b=null!=(f=this.F.get(c))?f:d.model(c);if(null===b)throw Error(`Try to persist an instance that does not exist: ${c}`);var e;d=null!=(e=d.source(a))?e:olympe.dc.ee().fromModel(b);am(this,new olympe.dc.transaction.Ga.bw(c,d))}else{if((e=d.Ja(c))&&d.Re(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
945
+ if(!e&&!this.F.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Lb.Dc){am(this,new olympe.dc.transaction.Ga.kp(a,b))}update(a,b,c){return am(this,new olympe.dc.transaction.Ga.$w(a,b,c))}Oa(a,b,c){am(this,new olympe.dc.transaction.Ga.Yl(a,b,c))}hc(a,b,c){am(this,new olympe.dc.transaction.Ga.mu(a,b,c))}An(a,b){am(this,new olympe.dc.transaction.Ga.jp(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
946
+ f);X(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.he.Xe+d.W(),e);this.Oa(olympe.dc.CloudObject.propertyRel,a,d);this.Oa(olympe.dm.Property.typeRel,d,b);this.Oa(olympe.dc.CloudObject.containsRel,a,d);return d}Gs(a,b,c='',{OE:d=olympe.dm.Relation.H.Ov,$E:e=olympe.dm.Relation.j.hw,VE:f=olympe.dm.Relation.j.Ot,xF:g=olympe.dm.Relation.j.Xp,LE:h=olympe.dm.Gl.NONE,wF:k=olympe.dm.Relation.N|h}={},l=olympe.U.Lc()){c=X(X(X(X(X(X(X(X(X(X(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
947
+ c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.ba,e),olympe.dm.Relation.wa,e),olympe.dm.Relation.Z,e),olympe.dm.Relation.X,f),olympe.dm.Relation.ia,g),olympe.dm.Relation.Ha,olympe.dm.Relation.j.Xp),olympe.dm.Relation.R,h);this.Oa(olympe.dc.CloudObject.Lj,a,c);this.Oa(olympe.dm.Relation.destinationModelRel,c,b);this.Oa(olympe.dc.CloudObject.containsRel,a,c);return c}th(){return!1}rn(a){this.Z.push(olympe.C.Za().rc(a))}mb(a,b){dm(olympe.dc.Fj(),this,cm(this,a),b)}Bn(a){a=
948
+ cm(this,a);em(olympe.dc.Fj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Ya.ya=[olympe.dc.Qc];function Ol(a){var b=olympe.dc.Fj();const c=a.T();b.H.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.ec(c);g.Yc(d,(new Map).set(e,f),b.db.model(d));b.j.nd(Of(g,Infinity))}}
949
+ function Pl(a,b,c,d){var e=olympe.dc.Fj();const f=olympe.dc.Request.j.Fi,g=olympe.dc.Request.j.yh,h=a.T();a=a.th();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ia.SELF||!e.db.Re(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.ec(h),k.set(n,p));p.Yc(l,b.get(l),e.db.model(l))}for(const [l,n]of k)b=new olympe.dc.Request(c?g:f,l,new olympe.dc.transaction.lj(n,a)),b=e.Jb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.j.nd(Of(n,p));null==d||d(!0)})}
950
+ function dm(a,b,c,d){if(d){const e=b.T();a.D.set(e,c);em(a,b,(f,g)=>{f||(a.D.delete(e),c(f,g))},!1)}else em(a,b,c,!1)}function fm(a){const b=olympe.dc.Request.j.jk;Wf(a.Jb,olympe.dc.Request.j.zo,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.T(),f=a.H.get(e);void 0!==f&&(a.H.delete(e),f.Ub(d));a.j.nd(c);a.G.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});Wf(a.Jb,b,c=>{c=c.content;gm(a,c.id,c.finalize,c.error)})}
951
+ function hm(a,b,c){if(!c)throw Error('Transaction compiler id is required');a.wa.has(c)||a.Z.push(b);return a}
952
+ function em(a,b,c,d=!1){const e=b.T(),f=new olympe.dc.transaction.aw(a.db,a.ia,e);try{b.j(f)}catch(q){if(q instanceof olympe.dc.Qq){q.j.then(()=>em(a,b,c,d));return}c(!1,q.message);return}if(f.nf()){c(!0);var g;null==(g=a.D.get(e))||g(!0);a.D.delete(e)}else{a.F.set(e,[]);var h=Tl(f);a.j.ne(h,olympe.dc.db.Instance.j.TRANSACTION);g=h.filter(q=>Z(f,q));var k=Ul(f).filter(q=>a.db.Re(q)&&a.db.Nb(q,olympe.dm.File)&&a.db.source(q)!==olympe.dc.Ia.SERVER).map(q=>[q,a.db.model(q),a.db.source(q)]),l=Rg(a.j,
953
+ f.j,g),n=olympe.C.Za().rc((q,r)=>c(null!==q,r)),p=[l,n];im(a,f,g).then(q=>{p.splice(1,0,q);jm(a,e,h,f.D.size+1);return km(a,f.D,d,b.th(),b.N)}).then(q=>Promise.allSettled(k.map(([r,t,v])=>a.N.wa(r,t,v))).then(r=>{r.forEach(t=>{'rejected'===t.status&&a.G.warn('Some binary files have not been deleted after the transaction:',t.reason)});return q})).then(q=>{p.forEach(r=>r(q));gm(a,e,olympe.dc.transaction.Jf.j.$i)}).catch(q=>{a.G.error(q);p.forEach(r=>r(null,`${q}`));lm(a,e)})}}
954
+ function im(a,b,c){const d=b.j,e=olympe.dm.File.urlProp.W();c=c.filter(n=>{let p;return a.db.Nb(n,olympe.dm.File)&&void 0!==(null==(p=d.Uc(n))?void 0:p.Pa(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.j.W(),g=olympe.dm.File.modificationDateProp.W(),h=Array.from(b.D.values()),k=[],l=olympe.U.jf();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return l.F(p).then(q=>new Promise((r,t)=>{if(null===q)URL.revokeObjectURL(p),
955
+ r();else{var v=n.W(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.N.ia(v,q,y,z=>{const A=h.reduce((K,Y)=>K||Y.Uc(v),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.qn(z),k.push([v,z]));URL.revokeObjectURL(p);r()},t)}}));2048<p.length&&a.G.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',n.W());return Promise.resolve([])})).then(()=>{const n=k.reduce((p,[q,r])=>{p.Yc(q,r);return p},
956
+ new olympe.dc.db.ec);return Rg(a.j,n)})}function jm(a,b,c,d){const e=olympe.C.kh(),f=new olympe.async.Dk(e);0<a.R&&f.$f(a.R);const g=olympe.dc.transaction.Jf.j.Jv;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.rc((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});sd(f,(l,n)=>{l||a.G.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.j.detach(c,olympe.dc.db.Instance.j.TRANSACTION);lm(a,b)});f.start()}
957
+ function km(a,b,c,d,e){if(c&&olympe.C.Qa(a.ba.state)!==olympe.auth.Ta.j.sf)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.j.dh:olympe.dc.Request.j.df;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.lj(h,d,e));return a.Jb.request(g)})).then(g=>g[0])}
958
+ function gm(a,b,c,d){let e,f;null==(f=null==(e=a.F.get(b))?void 0:e.pop())||f(c,null!=d?d:null)}function lm(a,b){var c;null==(c=a.F.get(b))||c.forEach(d=>{d(olympe.dc.transaction.Jf.j.$i,null)});a.F.delete(b);if(0===a.F.size){for(const d of a.X)d();a.X=[]}a.D.has(b)&&(c=a.D.get(b),a.D.delete(b),c(!0))}
959
+ olympe.dc.transaction.Jf=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Jb=c;this.ia=d;this.N=e;this.ba=f;this.R=g.get('notificationTimeout');this.Z=[];let h;this.wa=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.H=new olympe.U.Zh(g.get('burstHoldTime'));this.F=new Map;this.X=[];this.D=new Map;this.Ha=new olympe.U.promise.Tk;fm(this)}se(a){vb(this.Ha,()=>this.Jb.request(new olympe.dc.Request(olympe.dc.Request.j.Gp,olympe.dc.Ia.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
960
+ b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.Jf.j={Fm:0,$i:1,Jv:2};olympe.dc.transaction.lj=class{constructor(a,b=!1,c=!1){this.D=a;this.F=b;this.j=c}th(){return this.F}ac(){return this.D}};olympe.dc.transaction.P={Da:'dc.transaction.Logger',Fa:'dc.transaction.Manager'};olympe.dc.transaction.Config={Eq:'dc.transaction.timeout',yo:'dc.transaction.burstInterval',fm:'dc.transaction.disabledCompilers'};
961
+ olympe.V.config(function(a){E(a,olympe.dc.transaction.Config.Eq,9E4);E(a,olympe.dc.transaction.Config.yo,30);E(a,olympe.dc.transaction.Config.fm,[]);D(a,olympe.dc.transaction.P.Da,[olympe.ga.P.Fa],b=>b.ad('dc'));D(a,'olympe.dc.transaction.Config',[new olympe.V.oa(olympe.dc.transaction.Config.Eq),new olympe.V.oa(olympe.dc.transaction.Config.fm),new olympe.V.oa(olympe.dc.db.Config.Sl)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));C(a,olympe.dc.transaction.P.Fa,
962
+ olympe.dc.transaction.Jf,olympe.dc.transaction.P.Da,olympe.dc.db.P.Fa,olympe.dc.P.Ug,olympe.dc.sources.P.af,olympe.dc.P.hk,olympe.auth.P.Fa,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Ga={};function mm(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Qa(e));return c}olympe.dc.transaction.Ga.Cg=class{constructor(){this.ha=olympe.dc.ha()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Qa(a){a=olympe.C.Qa(a);return void 0===a||null===a?null:olympe.C.et(a)?a.valueOf():a}};olympe.dc.transaction.Ga.Cg.ya=[olympe.dc.Qc];olympe.dc.transaction.Ga.qo=class extends olympe.dc.transaction.Ga.Cg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Ra.Relation?a:new olympe.dc.Ra.Relation(olympe.dc.ea(a));this.origin=this.ha.Ja(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.W()}La(){return this.relation.La()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function X(a,b,c){a.Kd.set(olympe.dc.ea(b),c);return a}olympe.dc.transaction.Ga.Yo=class extends olympe.dc.transaction.Ga.Cg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ea(b))?c:olympe.U.hf();this.model=olympe.dc.ea(a);this.source=null;this.Kd=new Map}W(){return this.tag}Wb(){return this.model}yi(a){this.source=a;return this}j(a){const b=this.Wb(),c=this.W();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Sc(c,b,this.source,mm(this,this.Kd))}toString(){return`CreateInstance(${this.Wb()}, ${this.W()})`}};
963
+ olympe.dc.transaction.Ga.Yo.ya=[olympe.dc.Ye];olympe.dc.transaction.Ga.Yl=class extends olympe.dc.transaction.Ga.qo{constructor(a,b,c){super(a,b);this.D=this.ha.Ja(c)?olympe.dc.CloudObject.get(c):c}j(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.fc.Zc)throw Error('OperationError: Cannot create the instance -> model relation');if(!this.origin)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
964
+ if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.La()===olympe.dc.ta.DESTINATION?a.Oa(b,olympe.dc.ea(this.origin),olympe.dc.ea(this.D)):a.Oa(b,olympe.dc.ea(this.D),olympe.dc.ea(this.origin))}toString(){return`CreateRelation('${this.relation.La()}${this.relation.W()}, ${olympe.dc.ea(this.origin)}, ${olympe.dc.ea(this.D)})`}};olympe.dc.transaction.Ga.cB=class extends olympe.dc.transaction.Ga.Cg{constructor(a,b=olympe.dc.Lb.Dc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Ob=b}j(a){for(const b of this.ha.Vc(this.model))b!==olympe.dc.ea(this.model)&&(new olympe.dc.transaction.Ga.kp(b,this.Ob)).j(a)}toString(){return`DeleteAllInstances(${this.model.W()}, ${this.Ob})`}};olympe.dc.transaction.Ga.jp=class extends olympe.dc.transaction.Ga.qo{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Zc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ea(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.La(),e=this.ha.cb(c,this.relation);for(const f of e)d===olympe.dc.ta.DESTINATION?
965
+ a.hc(b,c,f):a.hc(b,f,c)}toString(){return`DeleteAllRelations(${this.La()}${this.getType()})`}};olympe.dc.transaction.Ga.kp=class extends olympe.dc.transaction.Ga.Cg{constructor(a,b=olympe.dc.Lb.Dc){super();this.tag=this.ha.Ja(a)?olympe.dc.CloudObject.get(a):a;this.Ob=b}W(){return olympe.dc.ea(this.tag)}j(a){const b=this.W();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ha.Ja(b)&&Wl(a,b,this.Ob)}toString(){return'DeleteInstance('+this.W()+', '+this.Ob+')'}};olympe.dc.transaction.Ga.mu=class extends olympe.dc.transaction.Ga.Yl{j(a){const b=this.relation.W();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Zc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ea(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.ea(this.D);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
966
+ this.relation.La()===olympe.dc.ta.DESTINATION?a.hc(b,c,d):a.hc(b,d,c)}toString(){return'DeleteRelation('+this.relation.La()+this.relation.W()+', '+olympe.dc.ea(this.origin)+', '+olympe.dc.ea(this.D)+')'}};olympe.dc.transaction.Ga.$w=class extends olympe.dc.transaction.Ga.Cg{constructor(a,b,c){super();this.tag=this.ha.Ja(a)?olympe.dc.CloudObject.get(a):a;this.Kd=new Map;void 0!==b&&this.Kd.set(olympe.dc.ea(b),c)}W(){return olympe.dc.ea(this.tag)}j(a){const b=this.W();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.j.Uc(b))&&c.D()||this.ha.Ja(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=mm(this,this.Kd);
967
+ for(const [e,f]of c){var d=this.ha.Pa(b,e,!0);d instanceof olympe.dc.vc&&Wl(a,d.W(),olympe.dc.Lb.Dc);f instanceof olympe.dc.vc&&!Z(a,f.W())&&(d=new olympe.dc.Ya,d.persist(f.W()),d.j(a))}a.Yc(b,c)}toString(){return'UpdateInstance('+this.W()+', '+mm(this,this.Kd)+')'}};olympe.dc.transaction.Ga.bw=class a extends olympe.dc.transaction.Ga.Cg{constructor(b,c){super();this.tag=b;this.source=c}j(b){const c=olympe.dc.ha();if(Z(b,this.tag)&&c.Ja(this.tag)&&!c.Re(this.tag)){const e=c.zb(this.tag,!0);var d;let f;null==(f=null==(d=b.j.Uc(this.tag))?void 0:d.zb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.vc&&c.Ja(g.W())&&(new a(g.W(),this.source)).j(b);d=c.model(this.tag);b.Sc(this.tag,d,this.source,e);for(const [g,h,k]of uh(c,this.tag))Z(b,
968
+ k)&&(h===olympe.dc.ta.ORIGIN?b.Oa(g,k,this.tag):b.Oa(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.ea=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.W)&&(null==a||!a.fh))b=a.W();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.na.Wb(a))?d:''}else if(olympe.C.pf(a)){let d;b=olympe.dc.ea(null==(d=olympe.C.Qa(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};w('olympe.dc.instanceToTag',olympe.dc.ea);olympe.dc.ha=function(){return olympe.dc.Ns().view};olympe.dc.register=function(a,b){olympe.dc.na.j(a,b)};
969
+ olympe.dc.defineProperty=function(a){return new olympe.dc.Ra.Property(a)};olympe.dc.Gs=function(a,b=olympe.dc.ta.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.ta.DESTINATION){const e=olympe.dc.ta.DESTINATION;return b===olympe.dc.ta.ORIGIN||b===e?new olympe.dc.Ra.Relation(a,b):new olympe.dc.Ra.Relation(a,d,b,c)};olympe.dc.Kx=function(a){return a.$b()};olympe.dc.ib={};olympe.dc.ib.xn=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.C.xb(a):a instanceof olympe.C.Sa?a:null;olympe.dc.ib.un=a=>'boolean'===typeof a||a instanceof Boolean?olympe.C.Rb(a):a instanceof olympe.C.da?a:null;olympe.dc.ib.wn=a=>'number'===typeof a||a instanceof Number?olympe.C.qa(a):'string'===typeof a||a instanceof String?olympe.C.qa(Number.parseFloat(a.valueOf())):a instanceof olympe.C.$?a:null;
970
+ olympe.dc.ib.vn=a=>'number'===typeof a||a instanceof Number?nc(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.C.eb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.C.eb(a):a instanceof olympe.C.eb?a:null;olympe.dc.ib.Bs=function(a){return a instanceof olympe.C.Color?a:'string'===typeof a||a instanceof String?rc(a.valueOf()):null};olympe.dc.ib.Cs=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.vc?olympe.dc.CloudObject.get(a.tag):null;
969
971
  olympe.dc.ib.tj=a=>a instanceof olympe.dc.vc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.ib.tc=a=>{a=a instanceof olympe.dc.vc?olympe.dc.CloudObject.get(a.tag):a;let b;return null!=(b=a instanceof olympe.dc.CloudObject?a.tc():a)?b:null};
970
- olympe.dc.ib.ey=a=>{switch(a){case olympe.C.ba:return olympe.dc.ib.rn;case olympe.C.Sa:return olympe.dc.ib.un;case olympe.C.$:return olympe.dc.ib.tn;case olympe.C.eb:return olympe.dc.ib.sn;case olympe.C.Color:return olympe.dc.ib.As;case olympe.dc.CloudObject:return olympe.dc.ib.Bs;default:return olympe.dc.ib.tj}};olympe.dc.jc={};olympe.dc.wf=class{ka(){}F(){}compare(){}H(){}fa(){}toString(){}};function lm(a){let b=null;for(a=[...a.aa];null===b&&0<a.length;)b=a.pop().Mb();return b}function mm(a,b){a.N()||(a=`Calling "${b}" on subscription with id ${a.T()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback. You can also consider to use Queries API instead of ListDefs (which are deprecated)',olympe.ha.Xa('dc').warn(a))}
971
- olympe.dc.Aa=class{constructor(a,b,c){void 0===a||null===a?olympe.ha.Xa('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.D=olympe.C.ta([a],olympe.dc.ea,String),this.aa=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||lm(this),this.j=null,this.Bc=void 0)}qe(){return olympe.dc.qe()}lb(){if(null===this.j){const a=olympe.dc.jc.Ey();this.j=nm(a,this,this.Bc);null!==this.valueType&&this.j.Qd(this.valueType);olympe.C.Za().Xd(()=>
972
- {var b=this.j.T();a.G.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.j.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.j.release(),a.j.delete(b));this.j=null})}return this}mc(){null===this.j&&this.lb();return this.j}Qd(a){this.valueType=a;null!==this.j&&this.j.Qd(this.valueType)}Mb(){return null!==this.j?this.j.Mb():null===this.valueType?olympe.dc.CloudObject:this.valueType}be(){return this.D}um(){return this.aa}jd(a,b){return this.mc().jd(a,b)}tl(a){this.mc().tl(a)}Wu(){return this.mc().Fd()}Vu(){return this.mc().N()}get(a){return this.mc().get(a)}si(){return this.mc().si()}oi(a){const b=
973
- this.mc();mm(b,'getCurrent');return b.oi(a)}has(a){return this.mc().has(a)}rh(a){const b=this.mc();mm(b,'hasCurrent');return b.rh(a)}pe(a){return this.mc().pe(a)}Ez(a){return this.pe(a).asObservable()}lf(a){const b=this.mc();mm(b,'getCurrentAt');return b.lf(a)}mf(a){return this.mc().mf(a)}Pf(a){const b=this.mc();mm(b,'getCurrentKeyAt');return b.Pf(a)}Hd(a){return this.mc().Hd(a)}Jz(a){return this.Hd(a).asObservable()}Qf(a){const b=this.mc();mm(b,'getCurrentRank');return b.Qf(a)}Ic(){return this.mc().Ic()}Fz(){return this.Ic().asObservable()}Rf(){return this.mc().Rf()}Bf(){return this.mc().Bf()}Kz(){return this.Bf().asObservable()}wg(){const a=
974
- this.mc();mm(a,'getCurrentSize');return a.wg()}forEach(a,b){this.mc().forEach(a,b)}oe(a){const b=this.mc();mm(b,'forEachCurrentValue');return b.oe(a)}wj(a,b,c,d){a=new olympe.dc.aa.Mh(a,b);(new olympe.dc.Aa(this.D,[...this.aa,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.aa];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
975
- if(c instanceof olympe.dc.Ra.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.j)break;a.push(c)}b=new olympe.dc.Aa(this.D,a);b.Bc=this.Bc;b.Qd(lm(b)||this.valueType||Object);return b}zl(a){return this.transform(new olympe.dc.aa.Kf(a))}filter(a){return this.transform(new olympe.dc.aa.yf(a))}bl(){const a=new olympe.dc.rk(this.D,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.Bc&&(a.Bc=this.Bc);
976
- let b=this.aa;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.aa;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.C.Qa(this.D)+a+')'}Uu(){return this.mc().Lg()}Wc(){return olympe.C.ta([this.Bf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.lf(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.C.wb(b+']')},olympe.C.Sa)}};olympe.dc.Aa.prototype.filter=olympe.dc.Aa.prototype.filter;olympe.dc.Aa.prototype.union=olympe.dc.Aa.prototype.zl;
977
- olympe.dc.Aa.prototype.transform=olympe.dc.Aa.prototype.transform;olympe.dc.Aa.prototype.forEachCurrentValue=olympe.dc.Aa.prototype.oe;olympe.dc.Aa.prototype.forEach=olympe.dc.Aa.prototype.forEach;olympe.dc.Aa.prototype.getCurrentSize=olympe.dc.Aa.prototype.wg;olympe.dc.Aa.prototype.observeSize=olympe.dc.Aa.prototype.Kz;olympe.dc.Aa.prototype.observeFirst=olympe.dc.Aa.prototype.Fz;olympe.dc.Aa.prototype.getCurrentRank=olympe.dc.Aa.prototype.Qf;olympe.dc.Aa.prototype.observeRank=olympe.dc.Aa.prototype.Jz;
978
- olympe.dc.Aa.prototype.getCurrentAt=olympe.dc.Aa.prototype.lf;olympe.dc.Aa.prototype.observeAt=olympe.dc.Aa.prototype.Ez;olympe.dc.Aa.prototype.offReady=olympe.dc.Aa.prototype.tl;olympe.dc.Aa.prototype.onReady=olympe.dc.Aa.prototype.jd;olympe.dc.Aa.prototype.getBaseTag=olympe.dc.Aa.prototype.be;olympe.dc.Aa.ya=[olympe.C.ud];m=olympe.dc.Aa.prototype;m.qe.K=olympe.C.J.j;m.lb.K=olympe.C.J.H();m.mc.K=new olympe.C.J(()=>olympe.dc.jc.Subscription,[]);m.Qd.K=new olympe.C.J(()=>{},[]);
979
- m.be.K=new olympe.C.J(()=>String,[]);m.um.K=new olympe.C.J(()=>Array,[]);m.jd.K=new olympe.C.J(()=>String,[]);m.tl.K=new olympe.C.J(()=>{},[]);m.Wu.K=olympe.C.J.N;m.Vu.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.si.K=new olympe.C.J(()=>Array,[]);m.oi.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.rh.K=olympe.C.J.j;m.pe.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.lf.K=olympe.C.J.j;m.mf.K=new olympe.C.J(()=>String,[]);m.Pf.K=olympe.C.J.j;m.Hd.K=olympe.C.J.F;
980
- m.Qf.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.Rf.K=new olympe.C.J(()=>String,[]);m.Bf.K=olympe.C.J.F;m.wg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.oe.K=olympe.C.J.j;m.wj.K=new olympe.C.J(()=>{},[]);m.transform.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.zl.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.filter.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.bl.K=new olympe.C.J(()=>olympe.dc.rk,[]);m.toString.K=olympe.C.J.j;m.Uu.K=olympe.C.J.j;m.Wc.K=olympe.C.J.D;const om={tA:'append',gm:'filter_not',vp:'filter_and',wp:'filter_or'};function pm(a,b){a=qm(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.ab.qo(a,b)).D}
981
- olympe.dc.rk=class{constructor(a,b){this.j=qm(a);this.G=olympe.ha.Xa('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.aa=[];this.Ga=[];this.Bc=void 0}Xi(){const a=new olympe.dc.Aa(this.j,this.aa,this.valueType);'boolean'===typeof this.Bc&&(a.Bc=this.Bc);return a}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new rm('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Ra.Property)throw new rm('transform','Properties cannot be used as transformer, unlike relations '+
982
- d);if(!d||'function'!==typeof d.j)throw new rm('transform','one of the argument is not a Transformer '+d);const e=d.Mb();null!==e&&(this.valueType=e);this.aa.push(d)}return this}zl(a){this.aa.push(new olympe.dc.aa.Kf(a));return this}qA(a){this.aa.push(new olympe.dc.aa.Kf(qm(a)));return this}Yu(a){this.valueType=a;return this}bb(a){this.aa.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Xx(a){for(const b of a)this.aa.push(b),this.valueType=b.Mb()||olympe.dc.CloudObject;return this}Wx(a,
983
- b,c){a=new olympe.dc.aa.Ke(a,a.La(),b,c);this.aa.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Vx(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.W());void 0===c&&(c=e.La())}a=new olympe.dc.aa.tk(b,c);this.aa.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Xu(){this.bb(olympe.dc.CloudObject.instancesRel);return this}gf(a){var b=this.Ga.pop();b===om.gm&&(a=new olympe.dc.Y.ie(a),b=this.Ga.pop());switch(b){case om.vp:b=this.aa.pop().D;b instanceof
984
- olympe.dc.Y.Nd?(b=b.Y,b.push(a),a=new olympe.dc.Y.Nd(...b)):a=new olympe.dc.Y.Nd(b,a);b=this.Ga.pop();break;case om.wp:b=this.aa.pop().D,b instanceof olympe.dc.Y.Fe?(b=b.Y,b.push(a),a=new olympe.dc.Y.Fe(...b)):a=new olympe.dc.Y.Fe(b,a),b=this.Ga.pop()}b===om.gm&&(a=new olympe.dc.Y.ie(a),this.Ga.pop());this.aa.push(new olympe.dc.aa.yf(a));return this}Rx(a,b,c){return this.gf(new olympe.dc.Y.Be(pm(a,c),new olympe.dc.ab.We(b)))}contains(a,b,c=!1,d){return this.gf(new olympe.dc.Y.xf(pm(a,d),new olympe.dc.ab.We(b),
985
- c))}Nb(a){if(!(a instanceof Array))throw new rm('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(qm(a[c]));return this.gf(new olympe.dc.Y.Ui(b))}ol(a){return this.gf(new olympe.dc.Y.Be(new olympe.dc.ab.kj,new olympe.dc.ab.We(qm(a))))}Sx(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.zd().ol(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().zd().ol(a[b])}return this}dz(a,b){if(!(a instanceof
986
- Array))throw new rm('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.La())});return this.gf(new olympe.dc.Y.Ri(c,d,b))}nl(a,b,c){a=pm(a,c);return this.gf(new olympe.dc.Y.mk(a,new olympe.dc.ab.We(b)))}Pj(a,b,c){a=pm(a,c);return this.gf(new olympe.dc.Y.Rk(a,new olympe.dc.ab.We(b)))}vz(a,b,c,d){a=pm(a,d);return this.gf(new olympe.dc.Y.Gf(a,b,c))}filter(a){const b=new class extends olympe.dc.Y.Bg{j(c,d){return a(olympe.dc.CloudObject.get(d))}};
987
- return this.gf(b)}zd(){this.Ga.push(om.gm);return this}and(){this.aa[this.aa.length-1]instanceof olympe.dc.aa.yf&&this.Ga.push(om.vp);return this}or(){this.aa[this.aa.length-1]instanceof olympe.dc.aa.yf&&this.Ga.push(om.wp);return this}xl(a,b,c){a=qm(a);let d=null;switch(olympe.dc.ga().Ib(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.W():d=new olympe.dc.wc.String(new olympe.dc.ab.jj(a,c));break;case olympe.dm.Number.O.W():d=new olympe.dc.wc.Number(new olympe.dc.ab.aj(a,c));break;case olympe.dm.DateTime.O.W():d=
988
- new olympe.dc.wc.DateTime(new olympe.dc.ab.Ji(a,c))}c=d;null!==c&&this.aa.push(new olympe.dc.aa.ah(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.wc.Bg{F(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.aa.push(new olympe.dc.aa.ah(d,c));return this}Nx(){this.aa.push(new olympe.dc.aa.Ki);return this}Hj(a,b){this.aa.push(new olympe.dc.aa.Mh(a,b));return this}};class rm extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
989
- function qm(a){return'string'===typeof a||a instanceof olympe.C.Sa?a:'function'===typeof a?olympe.dc.na.Vb(a):olympe.C.gb(a)?a.di===olympe.C.Sa?a:olympe.C.ta([a],b=>olympe.C.wb(olympe.dc.ea(b)),olympe.C.Sa):a.W()}m=olympe.dc.rk.prototype;m.Xi.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.transform.K=olympe.C.J.H();m.zl.K=olympe.C.J.H();m.qA.K=olympe.C.J.H();m.Yu.K=olympe.C.J.H();m.bb.K=olympe.C.J.H();m.Xx.K=olympe.C.J.H();m.Wx.K=olympe.C.J.H();m.Vx.K=olympe.C.J.H();m.Xu.K=olympe.C.J.H();m.gf.K=olympe.C.J.H();
990
- m.Rx.K=olympe.C.J.H();m.contains.K=olympe.C.J.H();m.Nb.K=olympe.C.J.H();m.ol.K=olympe.C.J.H();m.Sx.K=olympe.C.J.H();m.dz.K=olympe.C.J.H();m.nl.K=olympe.C.J.H();m.Pj.K=olympe.C.J.H();m.vz.K=olympe.C.J.H();m.filter.K=olympe.C.J.H();m.zd.K=olympe.C.J.H();m.and.K=olympe.C.J.H();m.or.K=olympe.C.J.H();m.xl.K=olympe.C.J.H();m.sort.K=olympe.C.J.H();m.Nx.K=olympe.C.J.H();m.Hj.K=olympe.C.J.H();function nm(a,b,c){const d=b.be();var e=new olympe.dc.query.Zv;let f;f=d;olympe.C.gb(f)&&(f=e.add(d));b=(b=b.um())?Array.isArray(b)?b:[b]:null;e=olympe.dc.jc.Subscription.F(f,b,e);let g,h,k=null!=(h=null==(g=a.j.get(e))?void 0:g.j)?h:null;null===k&&(a.G.debug('QueryMGR: new',a.D?'local':'remote','subscription "',e,'": #',`${f},`,b),k=new olympe.dc.jc.Subscription(e,d,b,a.F));k.getContext().run(()=>a.process(k,c));return k}
991
- function sm(a,b){if(b.N())a.G.debug('ListProcessor: [ID:',b.T(),'] - Subscription already booted, ignoring');else{a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting subscription');var c=new olympe.dc.kc.Xr(a.db,a.G),d=b.T();olympe.C.Vc([b.be()],e=>{const f=olympe.dc.ea(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.sg()||b.mi();Nf(a.db,f,tm(a,b,c),d);olympe.C.Za().Xd(()=>Lf(a.db,f,d));a.db.Ja(f.valueOf())||um(c);b.N()||(um(c),b.Qc([]))})}}
992
- function vm(a,b,c,d,e){const f=[b.be()],g=l=>l instanceof olympe.dc.aa.Kf;let h;const k=(null!=(h=b.ph())?h:[]).filter(g);for(const l of k){f.push(l.be());let n;k.push(...(null!=(n=l.ph())?n:[]).filter(g))}olympe.C.Vc(f,()=>{const l=b.ke(c);wm(a,l,b.T(),d,e)})}
993
- function wm(a,b,c,d,e){a.G.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.C.Za(),g=new olympe.async.Dk(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;Bi(a.H,h,f,olympe.dc.Ia.SELF,olympe.dc.la.nc.vf,{Bc:e}).subscribe(rxjs.Subscriber.create(()=>{n||(n=!0,f.run(k))},p=>f.run(()=>l(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${h.T()} has encountered an error: ${p}`))))})});td(g,(h,k)=>d(k));g.start()}
994
- function tm(a,b,c){const d=new olympe.dc.kc.Vj;let e=!1;const f=olympe.C.Za(),g=b.ph(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.hd()||f.fb()||(k?b.rh(n)?a.G.warn('Adding the same index twice (should never happen) for sub #',b.T(),', index #',n,', tag #',l):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Adding Instance',l,'to the subscription'),b.Md(n,l)):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Removing Instance',l,'from the subscription'),b.tg(n)),e||(xm(c,()=>{p.og();um(c)}),f.run(()=>p.qe().zg(b.Qc.bind(b))),
995
- e=!0),ym(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].j(f,c,h[k+1]);return(k,l)=>{const n=b.T();c.register(n,null);const p=d.j(k,l,n,null);if(null!==p)h[0](k,l,n,zm(p,k,l,n))}}
996
- olympe.dc.jc.yv=class{constructor(a,b,c,d,e,f){this.G=a;this.db=b;this.D=f||e;this.H=d;this.j=new Map;this.F=new olympe.C.Wb('Legacy ListDef processor')}process(a,b){const c=a.T();var d=this.j.get(c);d||(d=new olympe.dc.jc.Gw(a),this.j.set(c,d));d.counter++;Am(d)?this.G.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.G.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.ef(),b||this.D&&d===olympe.dc.Ia.SERVER||d===olympe.dc.Ia.SELF?(this.G.debug('QueryMGR: [ID:',c,'] - Local subscription, no need for coverage check, booting subscription '),
997
- sm(this,a)):vm(this,a,d,e=>{e?this.G.error(e):sm(this,a)},b))}};function Bm(a){return olympe.C.gb(a)?'Node#'+a.Ba.T():String(a)}function Cm(a,b){return olympe.C.gb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
998
- olympe.dc.query.Zv=class{constructor(){this.j=0;this.values=null}add(a){let b;b=olympe.C.gb(a)?'n'+a.Ba.T():'p'+ ++this.j;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.za=class{ka(){}j(){}D(){}fa(){}toString(){}};olympe.dc.jc.Subscription=class a extends olympe.C.Tj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.C.Wb('context subscription '+b,e));this.id=b;this.vd=c;this.aa=d||null;this.state=this.H.run(()=>olympe.C.fe(olympe.dc.jc.Subscription.j.INIT));this.Gc=!1;this.X=this.Yb=null}static F(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].fa(d);else e+='|null';e=olympe.U.rb(e)}catch(f){e=olympe.U.Kc()}return e}T(){return this.id}be(){return this.vd}ph(){return this.aa}ef(){const b=
999
- olympe.dc.ee(),c=olympe.C.Qa(this.be());let d;return olympe.dc.CloudObject.instancesRel.Ea(null==(d=this.aa)?void 0:d[0])?b.fromModel(c):b.Qe(c)}sg(){const b=olympe.C.Qa(this.state);return b&&b.valueOf()>=olympe.dc.jc.Subscription.j.Rr}mi(){if(this.state.Ba.fb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.Yb;this.Yb=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);kc(this.state,olympe.C.fe(olympe.dc.jc.Subscription.j.Rr))}Fd(){return olympe.C.ta([this.state],
1000
- ()=>{},olympe.C.ba)}N(){const b=this.state.Ba.Eb;return b&&b.valueOf()>=olympe.dc.jc.Subscription.j.Vh}jd(b,c){this.N()?b(this):(null===this.X&&(this.X=new Map),void 0===c&&(c=olympe.U.Kc()),this.X.set(c,olympe.C.Za().rc(b)));return c||''}tl(b){null!==this.X&&b&&this.X.delete(b)}yb(){const b=olympe.dc.jc.Subscription.j.Vh;if(!this.state.Ba.fb()&&olympe.C.Qa(this.state)!==b&&(this.Mf(),kc(this.state,b),null!==this.X)){for(const c of this.X.values())c(this);this.X=null}}onDestroy(b){this.H.onDestroy(b)}release(){this.H.destroy()}Qc(b){if(!this.state.Ba.fb()){for(let c=
1001
- 0,d=b.length;c<d;c++)this.jn(b[c],c);if(this.N())this.Mf();else{this.Gc=b=!0;for(let c in this.D)if(Object.prototype.hasOwnProperty.call(this.D,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.yb()}}}Md(b,c){if(!this.state.Ba.fb()&&(this.al(b,olympe.dc.CloudObject.get(c)),b=this.N(),this.Gc&&!b)){b=!0;for(let d in this.D)if(Object.prototype.hasOwnProperty.call(this.D,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.yb()}}tg(b){this.state.Ba.fb()||
1002
- (this.hn(b),this.pj(b,!this.N()))}Lg(){return this.N()?super.Lg():'Subscription is not ready!'}ke(b){const c=olympe.C.Qa(this.be());return olympe.dc.jc.Subscription.D(c,b,this.ph())}static D(b,c,d){var e=olympe.dc.la.from(b,c).me();if(null===d)return[e];b=[];b.push(e);for(let f=0,g=d.length;f<g;f++)if(e=d[f],e instanceof olympe.dc.aa.$e){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.bb(h,!0))}else if(e instanceof olympe.dc.aa.Ke){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.ug(h,
1003
- !0,!0))}else if(e instanceof olympe.dc.aa.Kf)e=a.D(olympe.C.Qa(e.be()),c,e.ph()),b.push(...e);else if(e instanceof olympe.dc.aa.yf||e instanceof olympe.dc.aa.ah){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.ug(n,!0,!0):k.bb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.jc.Subscription.j={INIT:0,Rr:1,Vh:2};olympe.dc.jc.Subscription.prototype.Lg.K=olympe.C.J.j;function Am(a){const b=a.D;a.D=!0;return b}olympe.dc.jc.Gw=class{constructor(a){this.counter=0;this.D=!1;this.j=a}};olympe.dc.Jf=class{ka(){}Mb(){}j(){}fa(){}toString(){}};olympe.dc.ir=class{F(){}};olympe.dc.Yk=class{ka(){}getValue(){}j(){}fa(){}toString(){}};olympe.dc.wc={};let Dm=0;olympe.dc.wc.Bg=class{constructor(){this.id=Dm++}ka(){return'CustomLocalComparator#'+Dm}H(){return[]}F(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}fa(){return`{"c":"${this.ka()}"}`}toString(){return this.ka()+'()'}};olympe.dc.wc.Bg.ya=[olympe.dc.wf];olympe.dc.wc.DateTime=class{constructor(a){this.j=a}ka(){return Q(olympe.dc.wc.DateTime)}H(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}fa(a){return'{"c":"'+this.ka()+'",a:['+this.j.fa(a)+']}'}toString(){return'Number('+this.j.toString()+')'}};P('olympe.dc.comparators.DateTime',olympe.dc.wc.DateTime);olympe.dc.wc.DateTime.ya=[olympe.dc.wf];olympe.dc.wc.Number=class{constructor(a){this.j=a}ka(){return Q(olympe.dc.wc.Number)}H(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(a,b){return a!==b?a>b?1:-1:0}fa(a){return`{"c":"${this.ka()}",a:[${this.j.fa(a)}]}`}toString(){return`Number(${this.j.toString()})`}};P('olympe.dc.comparators.Number',olympe.dc.wc.Number);olympe.dc.wc.Number.ya=[olympe.dc.wf];olympe.dc.wc.String=class{constructor(a){this.j=a}ka(){return Q(olympe.dc.wc.String)}H(){return this.j.j()}F(a,b){return olympe.C.ta([this.j.getValue(a,b)],c=>c.toLowerCase(),olympe.C.Sa)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}fa(a){return`{"c":"${this.ka()}",a:[${this.j.fa(a)}]}`}toString(){return`String(${this.j.toString()})`}};P('olympe.dc.comparators.String',olympe.dc.wc.String);olympe.dc.wc.String.ya=[olympe.dc.wf];olympe.dc.Y={};let Em=0;olympe.dc.Y.Bg=class{constructor(){this.id=Em++}ka(){return'CustomLocalPredicate#'+this.id}D(){return[]}j(){throw Error('Test function was not implemented.');}fa(){return`{"c":"${this.ka()}"}`}toString(){return this.ka()+'()'}};olympe.dc.Y.Bg.ya=[olympe.dc.za];olympe.dc.Y.El=class{constructor(a,b){this.F=a;this.H=b}ka(){}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ta([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.C.Rb(this.N('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.C.ba))}N(){}fa(a){return'{"c":"'+this.ka()+'","a":['+this.F.fa(a)+','+this.H.fa(a)+']}'}toString(){return this.ka().replace(/^.+\./,'')+'('+this.F.toString()+','+this.H.toString()+')'}};
1004
- olympe.dc.Y.El.ya=[olympe.dc.za];olympe.dc.Y.Nd=class{constructor(a){this.Y=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Y=this.Y.concat(arguments[c]):this.Y.push(arguments[c])}ka(){return Q(olympe.dc.Y.Nd)}D(){return this.Y.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Y.map(c=>c.j(a,b)),(...c)=>olympe.C.Rb(c.every(d=>d.valueOf())),olympe.C.ba))}fa(a){const b=this.Y.map(c=>c.fa(a));return'{"c":"'+this.ka()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.Y.map(a=>
1005
- a.toString()).join(',')+')'}};P('olympe.dc.predicates.And',olympe.dc.Y.Nd);olympe.dc.Y.Nd.ya=[olympe.dc.za];olympe.dc.Y.Kl=class{constructor(a,b){this.F=a;this.value=b}j(a,b){return a.run(()=>olympe.C.ta([this.F,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.C.Rb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.C.ba))}ka(){return Q(olympe.dc.Y.Kl)}D(){return[this.value.j()]}fa(a){const b=olympe.C.gb(this.F)?this.F.Ba.Eb.valueOf():this.F.valueOf();return'{"c":"'+this.ka()+'","a":['+b+','+this.value.fa(a)+']}'}toString(){const a=olympe.C.gb(this.F)?this.F.Ba.Eb.valueOf():this.F.valueOf();
1006
- return this.ka().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};P('olympe.dc.predicates.BitMask',olympe.dc.Y.Kl);olympe.dc.Y.Kl.ya=[olympe.dc.za];olympe.dc.Y.xf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}ka(){return Q(olympe.dc.Y.xf)}D(){return[this.source.j(),this.value.j()]}jb(){return this.source}getValue(){return this.value}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.value.getValue(a,b),this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Rb(c.includes(d))},olympe.C.ba))}fa(a){const b=this.source.fa(a),c=this.value.fa(a);a=Cm(a,this.F);
1007
- return'{"c":"'+this.ka()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Bm(this.F);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};P('olympe.dc.predicates.Contains',olympe.dc.Y.xf);olympe.dc.Y.xf.ya=[olympe.dc.za];olympe.dc.Y.Be=class{constructor(a,b){this.F=a;this.H=b}ka(){return Q(olympe.dc.Y.Be)}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ta([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Jd?c.Jd(d):'object'===typeof d&&void 0!==d.Jd?d.Jd(c):olympe.C.Rb(c.valueOf()===d.valueOf()),olympe.C.ba,'Test equal predicate'))}fa(a){return'{"c":"'+this.ka()+'","a":['+this.F.fa(a)+','+this.H.fa(a)+']}'}toString(){return'Equals('+this.F.toString()+','+this.H.toString()+
1008
- ')'}};P('olympe.dc.predicates.Equals',olympe.dc.Y.Be);olympe.dc.Y.Be.ya=[olympe.dc.za];olympe.dc.Y.nu=class extends olympe.dc.Y.Be{constructor(a,b){super(a,new olympe.dc.ab.We(b))}};olympe.dc.Y.nu.ya=[olympe.dc.za];olympe.dc.Y.mk=class extends olympe.dc.Y.El{constructor(a,b){super(a,b)}ka(){return Q(olympe.dc.Y.mk)}N(a,b){return a>b}};P('olympe.dc.predicates.Greater',olympe.dc.Y.mk);olympe.dc.Y.Ri=class{constructor(a,b,c){this.ob=[];this.F=c instanceof Array?c:void 0!==c?[olympe.dc.ea(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.aa.Ke?this.ob.push(new Fm(c.W(),c.La(),c.F,c.D)):this.ob.push(new Fm(olympe.dc.ea(c),b[d],1,1))}ka(){return Q(olympe.dc.Y.Ri)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>lc(olympe.C.bc(Boolean),!1)),d=olympe.U.Kc(),e=olympe.dc.ga();let f=0;a=(h,k)=>{0!==this.F.length&&!this.F.includes(k)||
1009
- c.getContext().fb()||c.getContext().hd()||(f+=h?1:-1,c.update(0<f))};const g=this.ob;for(let h=g.length-1;0<=h;h--)a=Gm(g[h],e,a,d+h);Nf(e,b,a,d);c.getContext().onDestroy(()=>{Lf(e,b,d)});return c.tb()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(this.ob.map(a=>a.fa()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.ob.map(a=>a.fa())+')'}};P('olympe.dc.predicates.HasRelated',olympe.dc.Y.Ri);
1010
- function Gm(a,b,c,d){const e=Object.create(null);d+=olympe.U.ni();const f=(g,h,k)=>{k>=a.D&&c(g,h);if(!(0<=a.j&&k>=a.j)){var l=d+k;g?e[h]||(e[h]=!0,T(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.D(h,a,l))}};return(g,h)=>f(g,h,0)}class Fm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d}fa(){return`${this.W()}, ${this.La()}, ${this.D}, ${this.j}`}}olympe.dc.Y.Ri.ya=[olympe.dc.za];olympe.dc.Y.om=class{constructor(a,b,c){this.ob=[];this.F=void 0!==c?c.map(olympe.dc.ea):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.aa.Ke?this.ob.push(new Hm(c.W(),c.La(),c.F,c.D)):this.ob.push(new Hm(olympe.dc.ea(c),b[d],1,1))}ka(){return Q(olympe.dc.Y.om)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>lc(olympe.C.bc(Boolean),!1)),d=olympe.dc.ga(),e=olympe.U.ni();let f=(k,l,n)=>{l&&(null===this.F||this.F.includes(n))&&k(1)};
1011
- const g=this.ob;for(let k=g.length-1;0<=k;k--)f=Im(g[k],d,f,e+k);let h=0;Nf(d,b,f.bind(null,k=>{c.getContext().hd()||c.getContext().fb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>Lf(d,b,e));return c.tb()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(this.ob.map(a=>a.fa()))+(null!==this.F?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.F?'#['+this.F.toString()+'], ':'')+this.ob.map(a=>a.fa())+')'}};P('olympe.dc.predicates.HasRelatedTree',olympe.dc.Y.om);
1012
- function Im(a,b,c,d){const e=a.F,f=a.N,g=new Set,h=(l,n,p)=>{f.has(n)?f.get(n).set(d+p,l):f.set(n,(new Map).set(d+p,l))},k=(l,n,p,q,r)=>{const t=olympe.U.ni();if(q){const v=p+r,x=y=>{const z=f.get(r);if(g.has(v))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${p} and ${r}`);void 0!==z&&null!==z&&(g.add(v),e.set(r,(e.get(r)||0)+y),Array.from(z.values()).forEach(A=>A(y)));g.delete(v)};h(l,r,p);e.has(r)?l(e.get(r)):(n>=a.D&&c(y=>
1013
- {e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.j||n<=a.j)&&r!==p&&T(b,r,a,k.bind(a,x,n+1,r),t))}else l(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.D(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class Hm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d;this.N=new Map;this.F=new Map}fa(){return`${this.W()}, ${this.La()}, ${this.D}, ${this.j}`}}olympe.dc.Y.om.ya=[olympe.dc.za];olympe.dc.Y.Ui=class{constructor(a){this.F=new Set;a instanceof Array?a.forEach(b=>{this.F.add(olympe.dc.ea(b))}):this.F.add(olympe.dc.ea(a))}ka(){return Q(olympe.dc.Y.Ui)}D(){return[]}j(a,b){const c=a.run(()=>lc(olympe.C.bc(olympe.C.ba),olympe.C.ba.j)),d=olympe.dc.ga();let e=[];const f=()=>{e.forEach(h=>{d.D(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.ea(olympe.dc.CloudObject))c.update(olympe.C.Rb(this.F.has(k))),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);
1014
- this.F.has(k)?(c.update(olympe.C.ba.D),f()):(h=new Jm(k,olympe.dc.CloudObject.extendRel),e.push(h),T(d,h.tag,h.relation,g,h.id))}};a=new Jm(b,olympe.dc.CloudObject.modelRel);e.push(a);T(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.tb()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(Array.from(this.F))+']}'}toString(){return'InstanceOf('+Array.from(this.F).join(', ')+')'}};class Jm{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.U.ni()}}
1015
- P('olympe.dc.predicates.InstanceOf',olympe.dc.Y.Ui);olympe.dc.Y.Ui.ya=[olympe.dc.za];olympe.dc.Y.ie=class{constructor(a){this.F=a}ka(){return Q(olympe.dc.Y.ie)}D(){return this.F.D()}j(a,b){return a.run(()=>olympe.C.ta([this.F.j(a,b)],c=>olympe.C.Rb(!c.valueOf()),olympe.C.ba))}fa(a){return`{"c":"${this.ka()}","a":[${this.F.fa(a)}]}`}toString(){return'Not('+this.F.toString()+')'}};P('olympe.dc.predicates.Not',olympe.dc.Y.ie);olympe.dc.Y.ie.ya=[olympe.dc.za];olympe.dc.Y.Fe=class{constructor(a){this.Y=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Y=this.Y.concat(arguments[c]):this.Y.push(arguments[c])}ka(){return Q(olympe.dc.Y.Fe)}D(){return this.Y.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Y.map(c=>c.j(a,b)),(...c)=>olympe.C.Rb(c.some(d=>d.valueOf())),olympe.C.ba))}fa(a){const b=this.Y.map(c=>c.fa(a));return'{"c":"'+this.ka()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.Y.map(a=>a.toString()).join(',')+
1016
- ')'}};P('olympe.dc.predicates.Or',olympe.dc.Y.Fe);olympe.dc.Y.Fe.ya=[olympe.dc.za];olympe.dc.Y.Gf=class{constructor(a,b,c){this.source=a;this.H=b;this.F=void 0===c?!0:c}ka(){return Q(olympe.dc.Y.Gf)}D(){return[this.source.j()]}jb(){return this.source}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.H,this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Rb((new RegExp(d)).test(c))},olympe.C.ba))}fa(a){const b=this.source.fa(a),c=Cm(a,this.H);a=Cm(a,this.F);return'{"c":"'+this.ka()+'","a":['+b+','+c+','+a+
1017
- ']}'}toString(){const a=Bm(this.F);return'Regex('+this.source.toString()+','+this.H+','+a+')'}};P('olympe.dc.predicates.Regex',olympe.dc.Y.Gf);olympe.dc.Y.Gf.ya=[olympe.dc.za];olympe.dc.Y.Rk=class extends olympe.dc.Y.El{constructor(a,b){super(a,b)}ka(){return Q(olympe.dc.Y.Rk)}N(a,b){return a<b}};P('olympe.dc.predicates.Smaller',olympe.dc.Y.Rk);olympe.dc.kc={};olympe.dc.kc.Vj=class{constructor(){this.Z=this.H=this.R=this.D=null}N(){return null!==this.D}X(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}j(a,b,c){b=this.H;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.kc.gk(this),this.R=c,this.H=b):this.H=this.R=null;return b}F(){if(null===this.D)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.Z){const a=[];null!==this.H&&
1018
- (0<=this.D?Km(Lm(this.H,this.D),a):a.push(this.R));this.Z(a)}}zg(a){this.Z=a}};olympe.dc.kc.Vj.ya=[olympe.dc.kc.Ta];function zm(a,b,c,d){b?a.N[d]=c:delete a.N[d];null===a.D&&(a.D=new olympe.dc.kc.gk(a.j,a));return a.D}function Lm(a,b){for(let c=0;c<b;c++)if(null!==a.D)a=a.D;else break;return a}function Km(a,b){a=a.N;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.kc.gk=class{constructor(a,b){this.j=a;this.depth=b?b.depth+1:0;this.N=Object.create(null);this.D=null}qe(){return this.j}og(){this.j.N()?this.j.F():this.j.X(this.depth-1)}};class Mm extends olympe.dc.kc.gk{constructor(a,b,c){super(a);this.R=b;this.tag=c;this.Z=this.X=this.H=!1;this.F=null}}
1019
- function Nm(a,b,c,d,e){const f=Object.create(null),g=a.ia,h=a.H;let k,l,n;a.da=!0;l=0;for(n=g.length;l<n;l++)f[g[l]]=null;g.length=0;l=c;for(n=Math.min(b.length,d);l<n;l++)k=b[l],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.H||(c.H=!0,e(!0,c.tag,c.R,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.H&&(c.H=!1,e(!1,c.tag,c.R,c)),c.X&&(c.F=null,delete h[k]),delete f[k]);a.da=!1;null!==a.D&&a.F()}
1020
- olympe.dc.kc.Am=class{constructor(){this.H={};this.ia=[];this.D=null;this.da=!1;this.R=[];this.Z=null}N(){return null!==this.D}X(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}F(){if(null===this.D)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.da){var a=this.ia,b=a.length,c=this.H,d;for(d=this.R.length=0;d<b;d++){var e=c[a[d]];if(0>this.D)this.R.push(e.R);else{if(!e.Z){var f=e,g=this.D;f.Z=!0;f.F=Lm(f,g)}null!==
1021
- e.F&&Km(e.F,this.R)}}this.Z&&this.Z(this.R)}}zg(a){this.Z=a}j(a,b,c){let d=this.H[c];a?void 0===d?(d=new Mm(this,c,b),this.H[c]=d):(d.tag=b,d.X=!1):void 0!==d&&(d.X=!0);return d}};olympe.dc.kc.Am.ya=[olympe.dc.kc.Ta];olympe.dc.kc.Ta=class{constructor(){}j(){}N(){}X(){}F(){}zg(){}};function Om(a,b){olympe.C.pf(a.value)?(a.node=olympe.C.Sn(a.value,b),Sb(a.node)||b()):b()}function Pm(a,b){if(olympe.C.pf(a.value)){const c=olympe.C.Za(),d=a.H;olympe.C.Vc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>Om(a,b)),olympe.C.Za().destroy())})}}
1022
- class Qm extends olympe.dc.kc.gk{constructor(a,b,c){super(a);this.X=b;this.value=c;this.H=this.Qa();this.position=this.node=null;this.R=!1;this.F=null}Qa(){const a=olympe.C.Qa(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.F=this.value=null}fb(){return null===this.value}}
1023
- function Rm(a,b){if(!b.fb()){var c=a.D;var d=a.ia,e=b.Qa(),f=0;let g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].H,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].H,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.H=b.Qa();if(c!==b.position){d=a.D;e=d.length;f=b.position;null===f&&(f=e);if(c<f)for(e=f;e>c;e--)d[e]=d[e-1],d[e].position=e;else for(e=f;e<c;e++)d[e]=d[e+1],d[e].position=e;d[c]=b;d[c].position=c;b.R&&a.F()}}}
1024
- function Sm(a){const b=a.ia;a.D.sort((c,d)=>b(c.Qa(),d.Qa()))}
1025
- olympe.dc.kc.Vr=class{constructor(a){this.ia=a;this.H=null;this.D=[];this.R=[];this.Z=null;this.da=new Map}j(a,b,c,d){b='$'+c;const e=this.D;let f;if(a)f=new Qm(this,c,d),this.da.set(b,f),this.N()?Om(f,()=>Rm(this,f)):(f.position=e.length,e.push(f));else{f=this.da.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.da.delete(b);null!==f.position&&(this.N()?this.remove(f):delete e[f.position]);f.destroy()}return f}N(){return null!==this.H}X(a){if(null!==this.H)throw Error('Manager already activated (depth='+
1026
- this.H+')');this.H=a;Sm(this);for(let b=0,c=this.D.length;b<c;b++){const d=this.D[b];d.position=b;Pm(d,()=>Rm(this,d))}this.F()}F(){if(null===this.H)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.D.length;this.R.length=0;for(let d=0;d<a;d++){let e=this.D[d];if(!e.R){var b=e,c=this.H;b.R=!0;b.F=Lm(b,c)}0>this.H?this.R.push(e.X):e.F&&Km(e.F,this.R)}this.Z&&this.Z(this.R)}zg(a){this.Z=a}remove(a){const b=this.D,c=b.length-1;if(null!==a.position){for(a=a.position;a<
1027
- c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.kc.Vr.ya=[olympe.dc.kc.Ta];function um(a){if(!a.D){for(let b in a.F)Tm(a.F[b]);a.D=!0}a.H=null;a.N=null}function xm(a,b,c){a.F[c||'root'].R=b}function ym(a,b,c){a.F[c||'root'].og(b)}function Um(a,b,c,d){const e=a.N,f=b+d+c;let g=e[f];void 0===g&&(g=uh(a.db,b,c,d),e[f]=g);return g}function Vm(a,b){a.D||a.j.og(b)}function Wm(a,b,c,d,e){if(!a.D){let f=Um(a,c,d,e||olympe.dc.ua.DESTINATION);e||(f+=Um(a,c,d,olympe.dc.ua.ORIGIN));0===f&&Vm(a,b)}}
1028
- function Xm(a,b){const c=a.F[b];void 0!==c?(a.G&&a.G.debug('Set current block to',b,null!==c.F?'parent = '+c.F.T():''),a.j=c):a.G&&a.G.error('Try to set a block that does not exists:',b)}function Ym(a){const b=String(++a.R),c=a.j;a.F[b]=new Zm(b,c);$m(c,b);c.H||(c.H=()=>Xm(a,c.T()));return b}function an(a,b){const c=a.j;a.j.H=()=>{Xm(a,c.T());b()}}function bn(a,b){Tm(b?a.F[b]:a.j)}
1029
- olympe.dc.kc.Xr=class{constructor(a,b){this.db=a;this.G=b||null;this.H=Object.create(null);this.N=Object.create(null);this.D=!1;this.R=0;this.j=new Zm('root');this.F=Object.create(null);this.F.root=this.j}register(a,b,c,d,e){this.D||(null!==b&&c&&d&&e?(c=Um(this,c,d,e),d=this.H[b]||0,this.H[b]=++d,this.j.j===b&&c<=d&&(this.j.j=a)):this.j.j=a)}};function $m(a,b){null===a.D&&(a.D=Object.create(null));a.D[b]=!1}function Tm(a){a.N=!0;null!==a.F&&a.F.notify(a.id)}
1030
- class Zm{constructor(a,b){this.id=a;this.F=b||null;this.j=this.R=this.H=this.D=null;this.N=!1}T(){return this.id}og(a){const b=this.R;if(this.N||this.j===a||null===a)b&&b(),!b&&Tm(this)}notify(a){const b=this.H,c=this.D;if(this.N)b&&b();else if(!c[a]){a=c[a]=!0;for(let d in c)if(!c[d]){a=!1;break}a&&b&&b()}}};olympe.dc.ab={};function cn(a,b,c,d){const e=olympe.dc.ga(),f=new olympe.dc.kc.Vj,g=new olympe.dc.kc.Xr(e);let h=!1;const k=Object.create(null),l=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,v)=>{a.hd()||a.fb()||(h||(xm(g,()=>{v.og();um(g)}),v.qe().zg(l),h=!0),q?k[t]=r:delete k[t],ym(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].j(a,g,n);const p=olympe.U.Kc();Nf(e,b,(q,r)=>{g.register(p,null);const t=f.j(q,b,p,null);n(q,r,p,zm(t,q,b,p))},p);a.onDestroy(()=>{Lf(e,b,p)});e.Ja(b)||um(g)}
1031
- function dn(a,b,c){const d=c.getContext(),e=olympe.dc.ga(),f=a.F(),g=fh(e,b,a.H,d.rc(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>gh(e,b,a.H,g))}
1032
- olympe.dc.ab.Di=class{constructor(a,b,c){this.H=a&&a.W?a.W():a;this.aa=b&&b.filter(d=>d instanceof olympe.dc.aa.$e||d instanceof olympe.dc.aa.Ke)||null;this.D=c||null;this.defaultValue=null}ka(){}Mb(){}F(){}j(){return(this.aa||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}wh(a){this.defaultValue=a;return this}ph(){return this.aa}be(){return this.D}getValue(a,b){const c=a.run(()=>olympe.C.bc(this.Mb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&lc(c,this.defaultValue);
1033
- b=this.D||b;null!==this.aa?cn(a,b,this.aa,d=>{dn(this,d,c)}):dn(this,b,c);return c.tb()}fa(a){const b=Cm(a,this.H),c=Cm(a,this.D);let d='null';this.aa&&(d=this.aa.map(function(e){return e.fa(a)}).join(','));return`{"c":"${this.ka()}","a":["${b}",${d},${c}]}`}toString(){const a=Bm(this.H),b=this.D?','+Bm(this.D):'';let c='';this.aa&&(c=','+this.aa.join(','));return this.ka().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.ab.Di.ya=[olympe.dc.Yk];olympe.dc.ab.qo=class{constructor(a,b){if(olympe.C.pf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.W();var d=olympe.dc.ga();const e=d.Ib(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.nh(e,olympe.dc.CloudObject.extendRel,olympe.dm.Ie);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.W():d=new olympe.dc.ab.jj(c,b);break;case olympe.dm.Number.O.W():d=new olympe.dc.ab.aj(c,
1034
- b);break;case olympe.dm.Boolean.O.W():d=new olympe.dc.ab.Wj(c,b);break;case olympe.dm.DateTime.O.W():d=new olympe.dc.ab.Ji(c,b)}this.D=d}ka(){return this.D.ka()}j(){return this.D.j()}getValue(a,b){return this.D.getValue(a,b)}fa(a){return this.D.fa(a)}toString(){return this.D.toString()}};olympe.dc.ab.qo.ya=[olympe.dc.Yk];olympe.dc.ab.Wj=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.Wj)}F(){return olympe.dc.ib.rn}Mb(){return olympe.C.ba}};P('olympe.dc.valuedefs.BooleanProperty',olympe.dc.ab.Wj);olympe.dc.ab.We=class{constructor(a){this.value=a}ka(){return Q(olympe.dc.ab.We)}j(){return[]}getValue(){return this.value}fa(a){a=Cm(a,this.value);return`{"c":"${this.ka()}","a":[${a}]}`}toString(){return`Constant(${Bm(this.value)})`}};P('olympe.dc.valuedefs.Constant',olympe.dc.ab.We);olympe.dc.ab.We.ya=[olympe.dc.Yk];olympe.dc.ab.Ji=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.Ji)}F(){return olympe.dc.ib.sn}Mb(){return olympe.C.eb}};P('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.ab.Ji);olympe.dc.ab.aj=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.aj)}F(){return olympe.dc.ib.tn}Mb(){return olympe.C.$}};P('olympe.dc.valuedefs.NumberProperty',olympe.dc.ab.aj);olympe.dc.ab.jj=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.jj)}F(){return olympe.dc.ib.un}Mb(){return olympe.C.Sa}};P('olympe.dc.valuedefs.StringProperty',olympe.dc.ab.jj);olympe.dc.ab.kj=class{ka(){return Q(olympe.dc.ab.kj)}j(){return[]}getValue(a,b){return b}fa(){return'{"c":"'+this.ka()+'","a":[]}'}toString(){return'Tag()'}};P('olympe.dc.valuedefs.Tag',olympe.dc.ab.kj);olympe.dc.ab.kj.ya=[olympe.dc.Yk];olympe.dc.aa={};olympe.dc.aa.Ki=class{Mb(){return null}ka(){return Q(olympe.dc.aa.Ki)}j(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.j.j!==g||b.D||(b.j.j=f),c(!0,f,f,zm(h,!0,f,f))):(d[f]++,Vm(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,zm(h,!1,f,f)))}}fa(){return'{"c":"'+this.ka()+'"}'}toString(){return'Distinct()'}};P('olympe.dc.transformers.Distinct',olympe.dc.aa.Ki);olympe.dc.aa.Ki.ya=[olympe.dc.Jf];olympe.dc.aa.yf=class{constructor(a){this.D=a}Mb(){return null}ka(){return Q(olympe.dc.aa.yf)}F(){return this.D.D()}j(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&Vm(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,zm(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;if(f){let n=this.D.j(a,g);olympe.C.gb(n)&&(n=n.Ba);olympe.C.Uf(n)?(b.D||void 0!==olympe.C.Qa(n)||Vm(b,h),e[l]=n,a.run(()=>{olympe.C.Vc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
1035
- d(g,h,k,!1),delete e[h]}}fa(a){return'{"c":"'+this.ka()+'","a":['+this.D.fa(a)+']}'}toString(){return'Filter('+this.D.toString()+')'}};P('olympe.dc.transformers.Filter',olympe.dc.aa.yf);olympe.dc.aa.yf.ya=[olympe.dc.Jf,olympe.dc.ir];olympe.dc.aa.hm=class{constructor(a,b,c,d){this.D=new olympe.dc.Ra.Relation(olympe.dc.ea(a),c||olympe.dc.ua.DESTINATION);this.F=new olympe.dc.Ra.Relation(olympe.dc.ea(b),d||olympe.dc.ua.DESTINATION)}Mb(){return gg(this.D)}ka(){return Q(olympe.dc.aa.hm)}j(a,b,c){const d=olympe.dc.ga(),e={},f=this.D.W(),g=this.D.La(),h=this.F.W(),k=this.F.La();let l=null,n=null;const p=(r,t,v,x,y,z)=>{if(y){if(y=()=>{const A=olympe.U.rb(v+g+(f+'_'+r)+z,20),K=zm(t,!0,z,A);l=r;n=()=>{c(!1,z,A,zm(t,!1,z,A))};b.register(A,
1036
- v,x,f,g);c(!0,z,A,K)},y.at=r,e[x]=y,null===l||r<l)n&&n(),y()}else if(l===r){n();e[x]=!0;y=Infinity;let A=null;for(let K=Object.keys(e),Y=K.length,ya=0;ya<Y;ya++){let db=e[K[ya]];db.at<y&&(y=db.at,A=db)}A&&A()}},q=(r,t,v,x,y)=>{x?e[y]||(e[y]=!0,Wm(b,v,y,f,g),Wm(b,v,y,h,k),T(d,y,this.D,p.bind(this,r,t,v,y),v+'_val'),T(d,y,this.F,q.bind(this,r+1,t,v),v+'_follow')):(d.D(y,this.F,v+'_follow'),d.D(y,this.D,v+'_val'),delete e[y])};return(r,t,v,x)=>q(0,x,v,r,t)}fa(){return'{"c":"'+this.ka()+'","a":["'+this.D.toString()+
1037
- '","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.D.toString()+', '+this.F.toString()+')'}};P('olympe.dc.transformers.FirstRelated',olympe.dc.aa.hm);olympe.dc.aa.hm.ya=[olympe.dc.Jf];olympe.dc.aa.Mh=class{constructor(a,b){this.start=a;this.D=b}Mb(){return null}ka(){return Q(olympe.dc.aa.Mh)}j(a,b,c){const d=new olympe.dc.kc.Am;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.D||(b.j.j=e[0>n-1?0:Math.min(e.length,n)-1]);Nm(d,e,f,n,c)}};a.run(()=>olympe.C.Vc([this.start,this.D],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));an(b,k);const l=Ym(b);Xm(b,l);return(n,p,q,r)=>{h||(r.qe().zg(t=>{e=t;bn(b,l)}),xm(b,()=>r.og(),l),h=!0);d.j(n,p,q,null);ym(b,q,l)}}fa(a){return'{"c":"'+
1038
- this.ka()+'","a":['+Cm(a,this.start)+','+Cm(a,this.D)+']}'}toString(){return`Limit(${olympe.C.Qa(this.start)},${olympe.C.Qa(this.D)})`}};P('olympe.dc.transformers.Limit',olympe.dc.aa.Mh);olympe.dc.aa.Mh.ya=[olympe.dc.Jf];function en(a){return a.ob.map(b=>b.W())}
1039
- olympe.dc.aa.tk=class{constructor(a,b){this.direction=b||olympe.dc.ua.DESTINATION;this.ob=a.map(c=>new olympe.dc.Ra.Relation(c,this.direction))}Mb(){return olympe.dc.CloudObject}ka(){return Q(olympe.dc.aa.tk)}La(){return this.direction}j(a,b,c){const d=olympe.dc.ga(),e=(f,g,h,k)=>T(d,f,k,(l,n)=>{var p=k.W();p=olympe.U.rb(g+k.La()+p+n,20);const q=zm(h,l,n,p);l&&b.register(p,g,f,k.W(),k.La());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.ob.forEach(l=>{Wm(b,h,g,l.W(),l.La());e(g,h,k,l)}):this.ob.forEach(l=>
1040
- {d.D(g,l,h)})}}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(en(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.La()+'['+en(this).join(',')+'])'}};P('olympe.dc.transformers.MultiRelated',olympe.dc.aa.tk);olympe.dc.aa.tk.ya=[olympe.dc.Jf];olympe.dc.aa.Ke=class extends olympe.dc.Ra.Relation{constructor(a,b=olympe.dc.ua.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.D=d}Mb(){return gg(this)}ka(){return Q(olympe.dc.aa.Ke)}j(a,b,c){const d=olympe.dc.ga(),e=Object.create(null),f=olympe.dc.ua.ORIGIN,g=olympe.dc.ua.DESTINATION,h=this.W(),k=this.La(),l=(p,q,r)=>{if(!(0<=this.D&&p>=this.D)){var t=d.cb(r,this);p+=1;for(let v=0,x=t.length;v<x;v++){if(void 0!==e[t[v]]||r===t[v])continue;const y=olympe.U.rb(q+k+(h+'_'+p)+t[v],20);b.register(y,
1041
- q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,v,x)=>{v&&!b.D&&l(p,t,x);p>=this.F?c(v,x,t,zm(r,v,x,t)):Wm(b,t,x,h,k);0<=this.D&&p>=this.D||(v?e[x]||(e[x]=!0,T(d,x,this,(y,z)=>{const A=p+1,K=olympe.U.rb(t+k+(h+'_'+A)+z,20);n(A,x,r,K,y,z)},t)):(d.D(x,this,t),delete e[x]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}fa(){return'{"c":"'+this.ka()+'","a":["'+this.W()+'","'+this.La()+'",'+this.F+','+this.D+']}'}toString(){return'RecursiveRelated('+this.La()+this.W()+'['+this.F+'..'+this.D+'])'}};
1042
- P('olympe.dc.transformers.RecursiveRelated',olympe.dc.aa.Ke);olympe.dc.aa.Ke.ya=[olympe.dc.Jf];olympe.dc.aa.$e=class extends olympe.dc.Ra.Relation{constructor(a,b){super(a,b||olympe.dc.ua.DESTINATION)}Mb(){return gg(this)}ka(){return Q(olympe.dc.aa.$e)}$b(){return new olympe.dc.aa.$e(this.tag,this.direction===olympe.dc.ua.DESTINATION?olympe.dc.ua.ORIGIN:olympe.dc.ua.DESTINATION)}j(a,b,c){const d=olympe.dc.ga(),e=this.W(),f=this.La();return(g,h,k,l)=>{Wm(b,k,h,e,f);g?T(d,h,this,(n,p)=>{const q=olympe.U.rb(k+f+e+p,20),r=zm(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.D(h,this,k)}}fa(){return'{"c":"'+
1043
- this.ka()+'","a":["'+this.W()+'","'+this.La()+'"]}'}toString(){return'Related('+this.La()+this.W()+')'}};P('olympe.dc.transformers.Related',olympe.dc.aa.$e);olympe.dc.aa.$e.ya=[olympe.dc.Jf];olympe.dc.aa.ah=class{constructor(a,b){this.Gb=a;this.D=void 0===b?!0:!!b}Mb(){return null}ka(){return Q(olympe.dc.aa.ah)}jh(){return this.Gb}F(){return[this.Gb.H()]}j(a,b,c){const d=new olympe.dc.kc.Vr(a.rc(this.D?this.Gb.compare.bind(this.Gb):(e,f)=>this.Gb.compare(f,e)));return(e,f,g)=>{var h=e?this.Gb.F(a,f):void 0;h=d.j(e,f,g,h);c(e,f,g,h)}}fa(a){return'{"c":"'+this.ka()+'","a":['+this.Gb.fa(a)+','+JSON.stringify(this.D)+']}'}toString(){return'Sort('+this.Gb.toString()+','+JSON.stringify(this.D)+
1044
- ')'}};P('olympe.dc.transformers.Sort',olympe.dc.aa.ah);olympe.dc.aa.ah.ya=[olympe.dc.Jf,olympe.dc.ir];function fn(a,b,c,d,e,f){function g(n,p){if(l)for(var q=l.length-1;0<=q;q--)f=l[q].j(b,e,f);e.register(h,null);q=d.j(n,p,c,null);f(n,p,h,zm(q,n,p,h))}const h=olympe.U.Kc(),k=olympe.dc.ga(),l=a.aa;b.run(()=>olympe.C.Vc([a.D],n=>{gn(k,n,g,h);void 0===k.model(n)&&um(e)}))}function gn(a,b,c,d){const e=b&&b.valueOf();e&&(Nf(a,e,c,d),olympe.C.Za().Xd(()=>Lf(a,e,d)))}
1045
- olympe.dc.aa.Kf=class{constructor(a,b){this.aa=this.D=null;a instanceof olympe.dc.Aa?(this.D=a.be(),this.aa=a.um()):(this.D=a,b&&(this.aa=b))}Mb(){return null}ka(){return Q(olympe.dc.aa.Kf)||''}ph(){return this.aa}be(){return this.D}j(a,b,c){const d=new olympe.dc.kc.Am,e=new olympe.dc.kc.Vj;let f=[],g=[],h=!1,k=!1;const l=Ym(b),n=Ym(b);an(b,()=>{const p=f.concat(g);0<p.length?b.D||(b.j.j=p[p.length-1]):bn(b);Nm(d,p,0,p.length,c)});Xm(b,n);fn(this,a,this.D,e,b,(p,q,r,t)=>{const v=olympe.C.Za();v.hd()||
1046
- v.fb()||(k||(t.qe().zg(x=>{g=x;bn(b,n)}),xm(b,()=>t.og(),n),k=!0),d.j(p,q,r),ym(b,r,n))});Xm(b,l);return(p,q,r,t)=>{h||(t.qe().zg(v=>{f=v;bn(b,l)}),xm(b,()=>t.og(),l),h=!0);d.j(p,q,r,l);ym(b,r,l)}}fa(a){const b=this.aa?'['+this.aa.map(c=>c.fa(a)).join(',')+']':'null';return'{"c":"'+this.ka()+'","a":['+Cm(a,this.D)+','+b+']}'}toString(){const a=olympe.C.gb(this.D)?'N:'+this.D.Ba.T():this.D.valueOf(),b=this.aa?','+this.aa.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
1047
- P('olympe.dc.transformers.Union',olympe.dc.aa.Kf);olympe.dc.aa.Kf.ya=[olympe.dc.Jf];olympe.dc.aa.Cr={MB:1,Fu:-1,Eu:0};olympe.dc.aa.pD={uA:!0,VA:!1};olympe.dc.jc.P={rq:'dc.legacy.listdefProcessor'};olympe.dc.jc.Config={qq:'dc.legacy.listdefsCovered'};olympe.V.config(a=>{E(a,olympe.dc.jc.Config.qq,!1);C(a,olympe.dc.jc.P.rq,olympe.dc.jc.yv,olympe.dc.query.P.Ca,olympe.dc.P.Ch,olympe.dc.transaction.P.Fa,olympe.dc.query.P.Fk,new olympe.V.oa(olympe.dc.Config.Yh),new olympe.V.oa(olympe.dc.jc.Config.qq))});olympe.V.run([olympe.dc.jc.P.rq],a=>{olympe.dc.jc.Ey=()=>a});function hn(a){const b=olympe.dc.ga(),c=new Map;b.Ps(a).forEach(d=>{b.cb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
1048
- olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ga();Object.defineProperty(this,'db',{enumerable:!1});this.model=null;Object.defineProperties(this,{db:{enumerable:!1}})}static Rc(a,b,c,...d){b=olympe.dc.ea(b);var e=Pf(b);if(e=e&&e.j)return e(a,c,...d);a=a.create(b);void 0!==c&&null!==c&&X(a,olympe.dc.CloudObject.nameProp,c);return a.W()}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.Ss();a=olympe.dc.ea(a);var c=b.db.model(a);c=Of(b,c);if(null===
1049
- c)throw new olympe.dc.Wq(a);c=c.instantiate(a,b.D);b.j.ne([a],olympe.dc.db.Instance.j.$p);b.Ra.register(c,a);b=c}return b}static exists(a){return olympe.dc.ga().Ja(olympe.dc.ea(a))}static Kj(...a){olympe.dc.Ms().Kj(...a)}static Ix(a,b,c){const d=olympe.dc.ga();let e=null;const f=k=>{null===e&&(e=hn(b||this));return e.has(k)?e.get(k):null},g=Yl(!1),h=g.create(null!=b?b:this);void 0!==c&&h.yi(c);a.forEach((k,l)=>{d.Ja(olympe.dc.ea(l))?X(h,l,k):(l=f(l))&&X(h,l,k)});g.lb((k,l)=>{k||olympe.ha.Xa('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});
1050
- return this.get(h)}static sx(){return this.get(this)}static pl(a){return olympe.dc.la.pl(a)}static zb(){return olympe.dc.ga().cb(this,olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Ra.Property(a))}static Id(){const a=olympe.dc.ga();return a.cb(this,olympe.dc.CloudObject.Lj).map(b=>new olympe.dc.Ra.Relation(b)).concat(a.cb(this,olympe.dc.CloudObject.Hs).map(b=>new olympe.dc.Ra.Relation(b,olympe.dc.ua.ORIGIN)))}static Tc(a){return olympe.dc.CloudObject.get(a)}static Ts(a){var b=Of(olympe.dc.Ss(),
1051
- olympe.dc.ea(a));b=b&&b.D;return new olympe.dc.Aa(olympe.dc.ea(a),olympe.dc.CloudObject.instancesRel,b)}W(){return this.tag}name(){return this.db.name(this)}ka(){return this.vb(olympe.dc.CloudObject.nameProp)}Ub(){this.model||(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.la.from(this)}Re(){return this.db.Re(this)}jb(){return this.db.source(this)}By(){return this.db.vi(this)?olympe.dc.ee().fromModel(this):null}Os(){return olympe.C.ta([this.ka()],
1052
- a=>olympe.C.wb(a),olympe.C.Sa,'getDisplayName',olympe.C.wb('('+this.toString()+')'))}Vb(){return this.model?this.model.W():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.Cb?a.Cb():a;return new rxjs.Observable(e=>{const f=olympe.dc.ib.tc(this.db.Pa(this.tag,b));c||null!==f||e.next(f);const g=fh(this.db,this.tag,b,h=>{e.next(olympe.dc.ib.tc(h))});d.Xd(()=>{e.complete();gh(this.db,this.tag,b,g)});return()=>gh(this.db,this.tag,b,g)})}Hz(a){const b='function'===typeof a.Cb?a.Cb():
1053
- a;return new rxjs.Observable(c=>{const d=hh(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Ra.Property(e),null]):c.next([new olympe.dc.Ra.Property(e),f])});b.Xd(()=>{c.complete();ih(this.db,this.tag,d)});return()=>ih(this.db,this.tag,d)})}Iz(a){return this.observe(olympe.C.Za(),a)}get(a){return olympe.dc.ib.tc(this.db.Pa(this.tag,a))}Pa(a){return this.get(a)}bb(a){return olympe.dc.la.from(this).bb(a)}vg(a){return olympe.dc.rd.from(this).bb(a)}tc(){return this}ky(){return this.Sc(olympe.dc.CloudObject.Ex,
1054
- olympe.dc.CloudObject)}Dn(){return this.cb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Sf(a,b,c){const d=olympe.C.bc(c,'Sync valueType'),e=fh(this.db,this.tag,a,olympe.C.Za().rc(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>gh(this.db,this.tag,a,e));return d.getContext()}vb(a){return M(this.Sf(a,olympe.dc.ib.un,olympe.C.Sa))}xd(a){return M(this.Sf(a,olympe.dc.ib.tn,olympe.C.$))}mh(a){return M(this.Sf(a,olympe.dc.ib.rn,
1055
- olympe.C.ba))}Dj(a){return M(this.Sf(a,olympe.dc.ib.sn,olympe.C.eb))}Xs(){return M(this.Sf(olympe.dm.Color.valueProp,olympe.dc.ib.As,olympe.C.Color))}Ys(){return M(this.Sf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.ib.Bs,olympe.dc.CloudObject))}cb(a,b){a=a instanceof olympe.dc.aa.$e?a:new olympe.dc.aa.$e(a.W(),a.La());return new olympe.dc.Aa(this.W(),a,b)}Sc(a,b){return this.cb(a,b).Ic()}Ks(a,b){const c=this.db,d=olympe.U.Kc(),e=olympe.C.Za(),f=new Map;T(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,
1056
- olympe.dc.CloudObject.get(h)))&&f.set(h,g);else{let k;null==(k=f.get(h))||k();f.delete(h)}},d);e.onDestroy(()=>{c.D(this.tag,a,d)})}mA(){return new olympe.dc.Aa(this.W(),[],eg(this.W()))}transform(...a){return(new olympe.dc.Aa(this.W(),[],this.constructor)).transform(...a)}Wc(){return this.Os()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ja(this.tag)?Object.assign({'#tag':this.W(),'#type':this.Ub().name()},this.Mc(!0,!0)):{'#tag':this.W(),'#error':'The object does not exist in the local database.'}}Mc(a=
1057
- !1,b=!0){const c={};this.db.zb(this,b).forEach((d,e)=>{this.db.Ja(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.ib.tc(d))});return c}Ea(a){return a instanceof olympe.dc.CloudObject?this.W()===a.W():'function'===typeof a?olympe.dc.na.Vb(a)===this.W():!1}Jd(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.Ea(b)),olympe.C.ba)}Lx(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Ya,c=!0;const d=olympe.dc.ua.ORIGIN;for(const [e,f,g]of sh(b,this))f===d?a.hc(e,g,this):e!==olympe.dc.CloudObject.modelRel.W()&&
1058
- a.hc(e,this,g);a.delete(this,olympe.dc.Lb.NONE);c&&a.lb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Ea;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Mc;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.vg;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.bb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Pa;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;
1059
- olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Iz;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.Hz;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.Vb;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.jb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Re;
1060
- olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Ub;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.W;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Ts;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Tc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.Id;
1061
- olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.zb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.pl;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.sx;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Ix;olympe.dc.CloudObject.markObsolete=olympe.dc.CloudObject.Kj;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.O=olympe.dc.na.j('ff021000000000000001',olympe.dc.CloudObject);
1062
- olympe.dc.CloudObject.BF=olympe.dc.CloudObject.O.ja(olympe.dc.kq.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.O.ja('ff023000000000000011');w('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.mF=olympe.dc.CloudObject.O.ja('ff023000000000000012');olympe.dc.CloudObject.Lj=olympe.dc.CloudObject.O.ra('ff02200000000000000a');olympe.dc.CloudObject.Hs=olympe.dc.CloudObject.O.ra('ff02200000000000000b',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.WE=olympe.dc.CloudObject.O.ra('017e9c4ba4c847d71cbf');
1063
- olympe.dc.CloudObject.ME=olympe.dc.CloudObject.O.ra('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.ra('ff02200000000000000c');w('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.O.ra('ff02200000000000000d',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.O.ra(olympe.dc.fc.Zc);w('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);
972
+ olympe.dc.ib.gy=a=>{switch(a){case olympe.C.da:return olympe.dc.ib.un;case olympe.C.Sa:return olympe.dc.ib.xn;case olympe.C.$:return olympe.dc.ib.wn;case olympe.C.eb:return olympe.dc.ib.vn;case olympe.C.Color:return olympe.dc.ib.Bs;case olympe.dc.CloudObject:return olympe.dc.ib.Cs;default:return olympe.dc.ib.tj}};olympe.dc.jc={};olympe.dc.xf=class{ka(){}F(){}compare(){}H(){}fa(){}toString(){}};function nm(a){let b=null;for(a=[...a.aa];null===b&&0<a.length;)b=a.pop().Mb();return b}function om(a,b){a.N()||(a=`Calling "${b}" on subscription with id ${a.T()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback. You can also consider to use Queries API instead of ListDefs (which are deprecated)',olympe.ga.Wa('dc').warn(a))}
973
+ olympe.dc.Aa=class{constructor(a,b,c){void 0===a||null===a?olympe.ga.Wa('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.D=olympe.C.sa([a],olympe.dc.ea,String),this.aa=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||nm(this),this.j=null,this.Bc=void 0)}re(){return olympe.dc.re()}mb(){if(null===this.j){const a=olympe.dc.jc.Fy();this.j=pm(a,this,this.Bc);null!==this.valueType&&this.j.Qd(this.valueType);olympe.C.Za().Xd(()=>
974
+ {var b=this.j.T();a.G.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.j.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.j.release(),a.j.delete(b));this.j=null})}return this}mc(){null===this.j&&this.mb();return this.j}Qd(a){this.valueType=a;null!==this.j&&this.j.Qd(this.valueType)}Mb(){return null!==this.j?this.j.Mb():null===this.valueType?olympe.dc.CloudObject:this.valueType}be(){return this.D}xm(){return this.aa}kd(a,b){return this.mc().kd(a,b)}ul(a){this.mc().ul(a)}Xu(){return this.mc().Fd()}Wu(){return this.mc().N()}get(a){return this.mc().get(a)}si(){return this.mc().si()}oi(a){const b=
975
+ this.mc();om(b,'getCurrent');return b.oi(a)}has(a){return this.mc().has(a)}rh(a){const b=this.mc();om(b,'hasCurrent');return b.rh(a)}qe(a){return this.mc().qe(a)}Fz(a){return this.qe(a).asObservable()}lf(a){const b=this.mc();om(b,'getCurrentAt');return b.lf(a)}mf(a){return this.mc().mf(a)}Rf(a){const b=this.mc();om(b,'getCurrentKeyAt');return b.Rf(a)}Hd(a){return this.mc().Hd(a)}Kz(a){return this.Hd(a).asObservable()}Sf(a){const b=this.mc();om(b,'getCurrentRank');return b.Sf(a)}Jc(){return this.mc().Jc()}Gz(){return this.Jc().asObservable()}Tf(){return this.mc().Tf()}Cf(){return this.mc().Cf()}Lz(){return this.Cf().asObservable()}wg(){const a=
976
+ this.mc();om(a,'getCurrentSize');return a.wg()}forEach(a,b){this.mc().forEach(a,b)}oe(a){const b=this.mc();om(b,'forEachCurrentValue');return b.oe(a)}wj(a,b,c,d){a=new olympe.dc.aa.Mh(a,b);(new olympe.dc.Aa(this.D,[...this.aa,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.aa];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
977
+ if(c instanceof olympe.dc.Ra.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.j)break;a.push(c)}b=new olympe.dc.Aa(this.D,a);b.Bc=this.Bc;b.Qd(nm(b)||this.valueType||Object);return b}Cl(a){return this.transform(new olympe.dc.aa.Lf(a))}filter(a){return this.transform(new olympe.dc.aa.zf(a))}bl(){const a=new olympe.dc.rk(this.D,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.Bc&&(a.Bc=this.Bc);
978
+ let b=this.aa;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.aa;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.C.Qa(this.D)+a+')'}Vu(){return this.mc().Lg()}Xc(){return olympe.C.sa([this.Cf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.lf(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.C.xb(b+']')},olympe.C.Sa)}};olympe.dc.Aa.prototype.filter=olympe.dc.Aa.prototype.filter;olympe.dc.Aa.prototype.union=olympe.dc.Aa.prototype.Cl;
979
+ olympe.dc.Aa.prototype.transform=olympe.dc.Aa.prototype.transform;olympe.dc.Aa.prototype.forEachCurrentValue=olympe.dc.Aa.prototype.oe;olympe.dc.Aa.prototype.forEach=olympe.dc.Aa.prototype.forEach;olympe.dc.Aa.prototype.getCurrentSize=olympe.dc.Aa.prototype.wg;olympe.dc.Aa.prototype.observeSize=olympe.dc.Aa.prototype.Lz;olympe.dc.Aa.prototype.observeFirst=olympe.dc.Aa.prototype.Gz;olympe.dc.Aa.prototype.getCurrentRank=olympe.dc.Aa.prototype.Sf;olympe.dc.Aa.prototype.observeRank=olympe.dc.Aa.prototype.Kz;
980
+ olympe.dc.Aa.prototype.getCurrentAt=olympe.dc.Aa.prototype.lf;olympe.dc.Aa.prototype.observeAt=olympe.dc.Aa.prototype.Fz;olympe.dc.Aa.prototype.offReady=olympe.dc.Aa.prototype.ul;olympe.dc.Aa.prototype.onReady=olympe.dc.Aa.prototype.kd;olympe.dc.Aa.prototype.getBaseTag=olympe.dc.Aa.prototype.be;olympe.dc.Aa.ya=[olympe.C.vd];m=olympe.dc.Aa.prototype;m.re.K=olympe.C.J.j;m.mb.K=olympe.C.J.H();m.mc.K=new olympe.C.J(()=>olympe.dc.jc.Subscription,[]);m.Qd.K=new olympe.C.J(()=>{},[]);
981
+ m.be.K=new olympe.C.J(()=>String,[]);m.xm.K=new olympe.C.J(()=>Array,[]);m.kd.K=new olympe.C.J(()=>String,[]);m.ul.K=new olympe.C.J(()=>{},[]);m.Xu.K=olympe.C.J.N;m.Wu.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.si.K=new olympe.C.J(()=>Array,[]);m.oi.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.rh.K=olympe.C.J.j;m.qe.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.lf.K=olympe.C.J.j;m.mf.K=new olympe.C.J(()=>String,[]);m.Rf.K=olympe.C.J.j;m.Hd.K=olympe.C.J.F;
982
+ m.Sf.K=olympe.C.J.j;m.Jc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.Tf.K=new olympe.C.J(()=>String,[]);m.Cf.K=olympe.C.J.F;m.wg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.oe.K=olympe.C.J.j;m.wj.K=new olympe.C.J(()=>{},[]);m.transform.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Cl.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.filter.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.bl.K=new olympe.C.J(()=>olympe.dc.rk,[]);m.toString.K=olympe.C.J.j;m.Vu.K=olympe.C.J.j;m.Xc.K=olympe.C.J.D;const qm={uA:'append',jm:'filter_not',wp:'filter_and',xp:'filter_or'};function rm(a,b){a=sm(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.ab.ro(a,b)).D}
983
+ olympe.dc.rk=class{constructor(a,b){this.j=sm(a);this.G=olympe.ga.Wa('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.aa=[];this.Ga=[];this.Bc=void 0}Xi(){const a=new olympe.dc.Aa(this.j,this.aa,this.valueType);'boolean'===typeof this.Bc&&(a.Bc=this.Bc);return a}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new tm('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Ra.Property)throw new tm('transform','Properties cannot be used as transformer, unlike relations '+
984
+ d);if(!d||'function'!==typeof d.j)throw new tm('transform','one of the argument is not a Transformer '+d);const e=d.Mb();null!==e&&(this.valueType=e);this.aa.push(d)}return this}Cl(a){this.aa.push(new olympe.dc.aa.Lf(a));return this}rA(a){this.aa.push(new olympe.dc.aa.Lf(sm(a)));return this}Zu(a){this.valueType=a;return this}bb(a){this.aa.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Yx(a){for(const b of a)this.aa.push(b),this.valueType=b.Mb()||olympe.dc.CloudObject;return this}Xx(a,
985
+ b,c){a=new olympe.dc.aa.Le(a,a.La(),b,c);this.aa.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Wx(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.W());void 0===c&&(c=e.La())}a=new olympe.dc.aa.tk(b,c);this.aa.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Yu(){this.bb(olympe.dc.CloudObject.instancesRel);return this}gf(a){var b=this.Ga.pop();b===qm.jm&&(a=new olympe.dc.Y.ie(a),b=this.Ga.pop());switch(b){case qm.wp:b=this.aa.pop().D;b instanceof
986
+ olympe.dc.Y.Nd?(b=b.Y,b.push(a),a=new olympe.dc.Y.Nd(...b)):a=new olympe.dc.Y.Nd(b,a);b=this.Ga.pop();break;case qm.xp:b=this.aa.pop().D,b instanceof olympe.dc.Y.Ge?(b=b.Y,b.push(a),a=new olympe.dc.Y.Ge(...b)):a=new olympe.dc.Y.Ge(b,a),b=this.Ga.pop()}b===qm.jm&&(a=new olympe.dc.Y.ie(a),this.Ga.pop());this.aa.push(new olympe.dc.aa.zf(a));return this}Sx(a,b,c){return this.gf(new olympe.dc.Y.Ce(rm(a,c),new olympe.dc.ab.We(b)))}contains(a,b,c=!1,d){return this.gf(new olympe.dc.Y.yf(rm(a,d),new olympe.dc.ab.We(b),
987
+ c))}Nb(a){if(!(a instanceof Array))throw new tm('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(sm(a[c]));return this.gf(new olympe.dc.Y.Ui(b))}pl(a){return this.gf(new olympe.dc.Y.Ce(new olympe.dc.ab.kj,new olympe.dc.ab.We(sm(a))))}Tx(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.zd().pl(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().zd().pl(a[b])}return this}ez(a,b){if(!(a instanceof
988
+ Array))throw new tm('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.La())});return this.gf(new olympe.dc.Y.Ri(c,d,b))}nl(a,b,c){a=rm(a,c);return this.gf(new olympe.dc.Y.mk(a,new olympe.dc.ab.We(b)))}Pj(a,b,c){a=rm(a,c);return this.gf(new olympe.dc.Y.Rk(a,new olympe.dc.ab.We(b)))}wz(a,b,c,d){a=rm(a,d);return this.gf(new olympe.dc.Y.Hf(a,b,c))}filter(a){const b=new class extends olympe.dc.Y.Bg{j(c,d){return a(olympe.dc.CloudObject.get(d))}};
989
+ return this.gf(b)}zd(){this.Ga.push(qm.jm);return this}and(){this.aa[this.aa.length-1]instanceof olympe.dc.aa.zf&&this.Ga.push(qm.wp);return this}or(){this.aa[this.aa.length-1]instanceof olympe.dc.aa.zf&&this.Ga.push(qm.xp);return this}Al(a,b,c){a=sm(a);let d=null;switch(olympe.dc.ha().Ib(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.W():d=new olympe.dc.wc.String(new olympe.dc.ab.jj(a,c));break;case olympe.dm.Number.O.W():d=new olympe.dc.wc.Number(new olympe.dc.ab.aj(a,c));break;case olympe.dm.DateTime.O.W():d=
990
+ new olympe.dc.wc.DateTime(new olympe.dc.ab.Ji(a,c))}c=d;null!==c&&this.aa.push(new olympe.dc.aa.ah(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.wc.Bg{F(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.aa.push(new olympe.dc.aa.ah(d,c));return this}Ox(){this.aa.push(new olympe.dc.aa.Ki);return this}Hj(a,b){this.aa.push(new olympe.dc.aa.Mh(a,b));return this}};class tm extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
991
+ function sm(a){return'string'===typeof a||a instanceof olympe.C.Sa?a:'function'===typeof a?olympe.dc.na.Wb(a):olympe.C.gb(a)?a.di===olympe.C.Sa?a:olympe.C.sa([a],b=>olympe.C.xb(olympe.dc.ea(b)),olympe.C.Sa):a.W()}m=olympe.dc.rk.prototype;m.Xi.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.transform.K=olympe.C.J.H();m.Cl.K=olympe.C.J.H();m.rA.K=olympe.C.J.H();m.Zu.K=olympe.C.J.H();m.bb.K=olympe.C.J.H();m.Yx.K=olympe.C.J.H();m.Xx.K=olympe.C.J.H();m.Wx.K=olympe.C.J.H();m.Yu.K=olympe.C.J.H();m.gf.K=olympe.C.J.H();
992
+ m.Sx.K=olympe.C.J.H();m.contains.K=olympe.C.J.H();m.Nb.K=olympe.C.J.H();m.pl.K=olympe.C.J.H();m.Tx.K=olympe.C.J.H();m.ez.K=olympe.C.J.H();m.nl.K=olympe.C.J.H();m.Pj.K=olympe.C.J.H();m.wz.K=olympe.C.J.H();m.filter.K=olympe.C.J.H();m.zd.K=olympe.C.J.H();m.and.K=olympe.C.J.H();m.or.K=olympe.C.J.H();m.Al.K=olympe.C.J.H();m.sort.K=olympe.C.J.H();m.Ox.K=olympe.C.J.H();m.Hj.K=olympe.C.J.H();function pm(a,b,c){const d=b.be();var e=new olympe.dc.query.$v;let f;f=d;olympe.C.gb(f)&&(f=e.add(d));b=(b=b.xm())?Array.isArray(b)?b:[b]:null;e=olympe.dc.jc.Subscription.F(f,b,e);let g,h,k=null!=(h=null==(g=a.j.get(e))?void 0:g.j)?h:null;null===k&&(a.G.debug('QueryMGR: new',a.D?'local':'remote','subscription "',e,'": #',`${f},`,b),k=new olympe.dc.jc.Subscription(e,d,b,a.F));k.getContext().run(()=>a.process(k,c));return k}
993
+ function um(a,b){if(b.N())a.G.debug('ListProcessor: [ID:',b.T(),'] - Subscription already booted, ignoring');else{a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting subscription');var c=new olympe.dc.kc.Yr(a.db,a.G),d=b.T();olympe.C.Wc([b.be()],e=>{const f=olympe.dc.ea(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.Pf()||b.mi();Pf(a.db,f,vm(a,b,c),d);olympe.C.Za().Xd(()=>Nf(a.db,f,d));a.db.Ja(f.valueOf())||wm(c);b.N()||(wm(c),b.Hc([]))})}}
994
+ function xm(a,b,c,d,e){const f=[b.be()],g=l=>l instanceof olympe.dc.aa.Lf;let h;const k=(null!=(h=b.ph())?h:[]).filter(g);for(const l of k){f.push(l.be());let n;k.push(...(null!=(n=l.ph())?n:[]).filter(g))}olympe.C.Wc(f,()=>{const l=b.ke(c);ym(a,l,b.T(),d,e)})}
995
+ function ym(a,b,c,d,e){a.G.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.C.Za(),g=new olympe.async.Dk(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;Di(a.H,h,f,olympe.dc.Ia.SELF,olympe.dc.la.nc.wf,{Bc:e}).subscribe(rxjs.Subscriber.create(()=>{n||(n=!0,f.run(k))},p=>f.run(()=>l(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${h.T()} has encountered an error: ${p}`))))})});sd(g,(h,k)=>d(k));g.start()}
996
+ function vm(a,b,c){const d=new olympe.dc.kc.Vj;let e=!1;const f=olympe.C.Za(),g=b.ph(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.jd()||f.fb()||(k?b.rh(n)?a.G.warn('Adding the same index twice (should never happen) for sub #',b.T(),', index #',n,', tag #',l):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Adding Instance',l,'to the subscription'),b.Md(n,l)):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Removing Instance',l,'from the subscription'),b.tg(n)),e||(zm(c,()=>{p.pg();wm(c)}),f.run(()=>p.re().zg(b.Hc.bind(b))),
997
+ e=!0),Am(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].j(f,c,h[k+1]);return(k,l)=>{const n=b.T();c.register(n,null);const p=d.j(k,l,n,null);if(null!==p)h[0](k,l,n,Bm(p,k,l,n))}}
998
+ olympe.dc.jc.zv=class{constructor(a,b,c,d,e,f){this.G=a;this.db=b;this.D=f||e;this.H=d;this.j=new Map;this.F=new olympe.C.Xb('Legacy ListDef processor')}process(a,b){const c=a.T();var d=this.j.get(c);d||(d=new olympe.dc.jc.Hw(a),this.j.set(c,d));d.counter++;Cm(d)?this.G.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.G.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.ef(),b||this.D&&d===olympe.dc.Ia.SERVER||d===olympe.dc.Ia.SELF?(this.G.debug('QueryMGR: [ID:',c,'] - Local subscription, no need for coverage check, booting subscription '),
999
+ um(this,a)):xm(this,a,d,e=>{e?this.G.error(e):um(this,a)},b))}};function Dm(a){return olympe.C.gb(a)?'Node#'+a.Ba.T():String(a)}function Em(a,b){return olympe.C.gb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
1000
+ olympe.dc.query.$v=class{constructor(){this.j=0;this.values=null}add(a){let b;b=olympe.C.gb(a)?'n'+a.Ba.T():'p'+ ++this.j;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.za=class{ka(){}j(){}D(){}fa(){}toString(){}};olympe.dc.jc.Subscription=class a extends olympe.C.Tj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.C.Xb('context subscription '+b,e));this.id=b;this.hd=c;this.aa=d||null;this.state=this.H.run(()=>olympe.C.fe(olympe.dc.jc.Subscription.j.INIT));this.Gc=!1;this.X=this.Ub=null}static F(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].fa(d);else e+='|null';e=olympe.U.rb(e)}catch(f){e=olympe.U.Lc()}return e}T(){return this.id}be(){return this.hd}ph(){return this.aa}ef(){const b=
1001
+ olympe.dc.ee(),c=olympe.C.Qa(this.be());let d;return olympe.dc.CloudObject.instancesRel.Ea(null==(d=this.aa)?void 0:d[0])?b.fromModel(c):b.pe(c)}Pf(){const b=olympe.C.Qa(this.state);return b&&b.valueOf()>=olympe.dc.jc.Subscription.j.Sr}mi(){if(this.state.Ba.fb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.Ub;this.Ub=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);kc(this.state,olympe.C.fe(olympe.dc.jc.Subscription.j.Sr))}Fd(){return olympe.C.sa([this.state],
1002
+ ()=>{},olympe.C.da)}N(){const b=this.state.Ba.Eb;return b&&b.valueOf()>=olympe.dc.jc.Subscription.j.Vh}kd(b,c){this.N()?b(this):(null===this.X&&(this.X=new Map),void 0===c&&(c=olympe.U.Lc()),this.X.set(c,olympe.C.Za().rc(b)));return c||''}ul(b){null!==this.X&&b&&this.X.delete(b)}vb(){const b=olympe.dc.jc.Subscription.j.Vh;if(!this.state.Ba.fb()&&olympe.C.Qa(this.state)!==b&&(this.Nf(),kc(this.state,b),null!==this.X)){for(const c of this.X.values())c(this);this.X=null}}onDestroy(b){this.H.onDestroy(b)}release(){this.H.destroy()}Hc(b){if(!this.state.Ba.fb()){for(let c=
1003
+ 0,d=b.length;c<d;c++)this.mn(b[c],c);if(this.N())this.Nf();else{this.Gc=b=!0;for(let c in this.D)if(Object.prototype.hasOwnProperty.call(this.D,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.vb()}}}Md(b,c){if(!this.state.Ba.fb()&&(this.al(b,olympe.dc.CloudObject.get(c)),b=this.N(),this.Gc&&!b)){b=!0;for(let d in this.D)if(Object.prototype.hasOwnProperty.call(this.D,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.vb()}}tg(b){this.state.Ba.fb()||
1004
+ (this.ln(b),this.pj(b,!this.N()))}Lg(){return this.N()?super.Lg():'Subscription is not ready!'}ke(b){const c=olympe.C.Qa(this.be());return olympe.dc.jc.Subscription.D(c,b,this.ph())}static D(b,c,d){var e=olympe.dc.la.from(b,c).me();if(null===d)return[e];b=[];b.push(e);for(let f=0,g=d.length;f<g;f++)if(e=d[f],e instanceof olympe.dc.aa.$e){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.bb(h,!0))}else if(e instanceof olympe.dc.aa.Le){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.ug(h,
1005
+ !0,!0))}else if(e instanceof olympe.dc.aa.Lf)e=a.D(olympe.C.Qa(e.be()),c,e.ph()),b.push(...e);else if(e instanceof olympe.dc.aa.zf||e instanceof olympe.dc.aa.ah){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.ug(n,!0,!0):k.bb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.jc.Subscription.j={INIT:0,Sr:1,Vh:2};olympe.dc.jc.Subscription.prototype.Lg.K=olympe.C.J.j;function Cm(a){const b=a.D;a.D=!0;return b}olympe.dc.jc.Hw=class{constructor(a){this.counter=0;this.D=!1;this.j=a}};olympe.dc.Kf=class{ka(){}Mb(){}j(){}fa(){}toString(){}};olympe.dc.jr=class{F(){}};olympe.dc.Yk=class{ka(){}getValue(){}j(){}fa(){}toString(){}};olympe.dc.wc={};let Fm=0;olympe.dc.wc.Bg=class{constructor(){this.id=Fm++}ka(){return'CustomLocalComparator#'+Fm}H(){return[]}F(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}fa(){return`{"c":"${this.ka()}"}`}toString(){return this.ka()+'()'}};olympe.dc.wc.Bg.ya=[olympe.dc.xf];olympe.dc.wc.DateTime=class{constructor(a){this.j=a}ka(){return Q(olympe.dc.wc.DateTime)}H(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}fa(a){return'{"c":"'+this.ka()+'",a:['+this.j.fa(a)+']}'}toString(){return'Number('+this.j.toString()+')'}};P('olympe.dc.comparators.DateTime',olympe.dc.wc.DateTime);olympe.dc.wc.DateTime.ya=[olympe.dc.xf];olympe.dc.wc.Number=class{constructor(a){this.j=a}ka(){return Q(olympe.dc.wc.Number)}H(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(a,b){return a!==b?a>b?1:-1:0}fa(a){return`{"c":"${this.ka()}",a:[${this.j.fa(a)}]}`}toString(){return`Number(${this.j.toString()})`}};P('olympe.dc.comparators.Number',olympe.dc.wc.Number);olympe.dc.wc.Number.ya=[olympe.dc.xf];olympe.dc.wc.String=class{constructor(a){this.j=a}ka(){return Q(olympe.dc.wc.String)}H(){return this.j.j()}F(a,b){return olympe.C.sa([this.j.getValue(a,b)],c=>c.toLowerCase(),olympe.C.Sa)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}fa(a){return`{"c":"${this.ka()}",a:[${this.j.fa(a)}]}`}toString(){return`String(${this.j.toString()})`}};P('olympe.dc.comparators.String',olympe.dc.wc.String);olympe.dc.wc.String.ya=[olympe.dc.xf];olympe.dc.Y={};let Gm=0;olympe.dc.Y.Bg=class{constructor(){this.id=Gm++}ka(){return'CustomLocalPredicate#'+this.id}D(){return[]}j(){throw Error('Test function was not implemented.');}fa(){return`{"c":"${this.ka()}"}`}toString(){return this.ka()+'()'}};olympe.dc.Y.Bg.ya=[olympe.dc.za];olympe.dc.Y.Hl=class{constructor(a,b){this.F=a;this.H=b}ka(){}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.sa([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.C.Rb(this.N('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.C.da))}N(){}fa(a){return'{"c":"'+this.ka()+'","a":['+this.F.fa(a)+','+this.H.fa(a)+']}'}toString(){return this.ka().replace(/^.+\./,'')+'('+this.F.toString()+','+this.H.toString()+')'}};
1006
+ olympe.dc.Y.Hl.ya=[olympe.dc.za];olympe.dc.Y.Nd=class{constructor(a){this.Y=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Y=this.Y.concat(arguments[c]):this.Y.push(arguments[c])}ka(){return Q(olympe.dc.Y.Nd)}D(){return this.Y.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.sa(this.Y.map(c=>c.j(a,b)),(...c)=>olympe.C.Rb(c.every(d=>d.valueOf())),olympe.C.da))}fa(a){const b=this.Y.map(c=>c.fa(a));return'{"c":"'+this.ka()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.Y.map(a=>
1007
+ a.toString()).join(',')+')'}};P('olympe.dc.predicates.And',olympe.dc.Y.Nd);olympe.dc.Y.Nd.ya=[olympe.dc.za];olympe.dc.Y.Nl=class{constructor(a,b){this.F=a;this.value=b}j(a,b){return a.run(()=>olympe.C.sa([this.F,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.C.Rb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.C.da))}ka(){return Q(olympe.dc.Y.Nl)}D(){return[this.value.j()]}fa(a){const b=olympe.C.gb(this.F)?this.F.Ba.Eb.valueOf():this.F.valueOf();return'{"c":"'+this.ka()+'","a":['+b+','+this.value.fa(a)+']}'}toString(){const a=olympe.C.gb(this.F)?this.F.Ba.Eb.valueOf():this.F.valueOf();
1008
+ return this.ka().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};P('olympe.dc.predicates.BitMask',olympe.dc.Y.Nl);olympe.dc.Y.Nl.ya=[olympe.dc.za];olympe.dc.Y.yf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}ka(){return Q(olympe.dc.Y.yf)}D(){return[this.source.j(),this.value.j()]}jb(){return this.source}getValue(){return this.value}j(a,b){return a.run(()=>olympe.C.sa([this.source.getValue(a,b),this.value.getValue(a,b),this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Rb(c.includes(d))},olympe.C.da))}fa(a){const b=this.source.fa(a),c=this.value.fa(a);a=Em(a,this.F);
1009
+ return'{"c":"'+this.ka()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Dm(this.F);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};P('olympe.dc.predicates.Contains',olympe.dc.Y.yf);olympe.dc.Y.yf.ya=[olympe.dc.za];olympe.dc.Y.Ce=class{constructor(a,b){this.F=a;this.H=b}ka(){return Q(olympe.dc.Y.Ce)}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.sa([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Jd?c.Jd(d):'object'===typeof d&&void 0!==d.Jd?d.Jd(c):olympe.C.Rb(c.valueOf()===d.valueOf()),olympe.C.da,'Test equal predicate'))}fa(a){return'{"c":"'+this.ka()+'","a":['+this.F.fa(a)+','+this.H.fa(a)+']}'}toString(){return'Equals('+this.F.toString()+','+this.H.toString()+
1010
+ ')'}};P('olympe.dc.predicates.Equals',olympe.dc.Y.Ce);olympe.dc.Y.Ce.ya=[olympe.dc.za];olympe.dc.Y.ou=class extends olympe.dc.Y.Ce{constructor(a,b){super(a,new olympe.dc.ab.We(b))}};olympe.dc.Y.ou.ya=[olympe.dc.za];olympe.dc.Y.mk=class extends olympe.dc.Y.Hl{constructor(a,b){super(a,b)}ka(){return Q(olympe.dc.Y.mk)}N(a,b){return a>b}};P('olympe.dc.predicates.Greater',olympe.dc.Y.mk);olympe.dc.Y.Ri=class{constructor(a,b,c){this.ob=[];this.F=c instanceof Array?c:void 0!==c?[olympe.dc.ea(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.aa.Le?this.ob.push(new Hm(c.W(),c.La(),c.F,c.D)):this.ob.push(new Hm(olympe.dc.ea(c),b[d],1,1))}ka(){return Q(olympe.dc.Y.Ri)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>lc(olympe.C.bc(Boolean),!1)),d=olympe.U.Lc(),e=olympe.dc.ha();let f=0;a=(h,k)=>{0!==this.F.length&&!this.F.includes(k)||
1011
+ c.getContext().fb()||c.getContext().jd()||(f+=h?1:-1,c.update(0<f))};const g=this.ob;for(let h=g.length-1;0<=h;h--)a=Im(g[h],e,a,d+h);Pf(e,b,a,d);c.getContext().onDestroy(()=>{Nf(e,b,d)});return c.tb()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(this.ob.map(a=>a.fa()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.ob.map(a=>a.fa())+')'}};P('olympe.dc.predicates.HasRelated',olympe.dc.Y.Ri);
1012
+ function Im(a,b,c,d){const e=Object.create(null);d+=olympe.U.ni();const f=(g,h,k)=>{k>=a.D&&c(g,h);if(!(0<=a.j&&k>=a.j)){var l=d+k;g?e[h]||(e[h]=!0,T(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.D(h,a,l))}};return(g,h)=>f(g,h,0)}class Hm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d}fa(){return`${this.W()}, ${this.La()}, ${this.D}, ${this.j}`}}olympe.dc.Y.Ri.ya=[olympe.dc.za];olympe.dc.Y.sm=class{constructor(a,b,c){this.ob=[];this.F=void 0!==c?c.map(olympe.dc.ea):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.aa.Le?this.ob.push(new Jm(c.W(),c.La(),c.F,c.D)):this.ob.push(new Jm(olympe.dc.ea(c),b[d],1,1))}ka(){return Q(olympe.dc.Y.sm)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>lc(olympe.C.bc(Boolean),!1)),d=olympe.dc.ha(),e=olympe.U.ni();let f=(k,l,n)=>{l&&(null===this.F||this.F.includes(n))&&k(1)};
1013
+ const g=this.ob;for(let k=g.length-1;0<=k;k--)f=Km(g[k],d,f,e+k);let h=0;Pf(d,b,f.bind(null,k=>{c.getContext().jd()||c.getContext().fb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>Nf(d,b,e));return c.tb()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(this.ob.map(a=>a.fa()))+(null!==this.F?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.F?'#['+this.F.toString()+'], ':'')+this.ob.map(a=>a.fa())+')'}};P('olympe.dc.predicates.HasRelatedTree',olympe.dc.Y.sm);
1014
+ function Km(a,b,c,d){const e=a.F,f=a.N,g=new Set,h=(l,n,p)=>{f.has(n)?f.get(n).set(d+p,l):f.set(n,(new Map).set(d+p,l))},k=(l,n,p,q,r)=>{const t=olympe.U.ni();if(q){const v=p+r,x=y=>{const z=f.get(r);if(g.has(v))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${p} and ${r}`);void 0!==z&&null!==z&&(g.add(v),e.set(r,(e.get(r)||0)+y),Array.from(z.values()).forEach(A=>A(y)));g.delete(v)};h(l,r,p);e.has(r)?l(e.get(r)):(n>=a.D&&c(y=>
1015
+ {e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.j||n<=a.j)&&r!==p&&T(b,r,a,k.bind(a,x,n+1,r),t))}else l(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.D(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class Jm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d;this.N=new Map;this.F=new Map}fa(){return`${this.W()}, ${this.La()}, ${this.D}, ${this.j}`}}olympe.dc.Y.sm.ya=[olympe.dc.za];olympe.dc.Y.Ui=class{constructor(a){this.F=new Set;a instanceof Array?a.forEach(b=>{this.F.add(olympe.dc.ea(b))}):this.F.add(olympe.dc.ea(a))}ka(){return Q(olympe.dc.Y.Ui)}D(){return[]}j(a,b){const c=a.run(()=>lc(olympe.C.bc(olympe.C.da),olympe.C.da.j)),d=olympe.dc.ha();let e=[];const f=()=>{e.forEach(h=>{d.D(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.ea(olympe.dc.CloudObject))c.update(olympe.C.Rb(this.F.has(k))),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);
1016
+ this.F.has(k)?(c.update(olympe.C.da.D),f()):(h=new Lm(k,olympe.dc.CloudObject.extendRel),e.push(h),T(d,h.tag,h.relation,g,h.id))}};a=new Lm(b,olympe.dc.CloudObject.modelRel);e.push(a);T(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.tb()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(Array.from(this.F))+']}'}toString(){return'InstanceOf('+Array.from(this.F).join(', ')+')'}};class Lm{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.U.ni()}}
1017
+ P('olympe.dc.predicates.InstanceOf',olympe.dc.Y.Ui);olympe.dc.Y.Ui.ya=[olympe.dc.za];olympe.dc.Y.ie=class{constructor(a){this.F=a}ka(){return Q(olympe.dc.Y.ie)}D(){return this.F.D()}j(a,b){return a.run(()=>olympe.C.sa([this.F.j(a,b)],c=>olympe.C.Rb(!c.valueOf()),olympe.C.da))}fa(a){return`{"c":"${this.ka()}","a":[${this.F.fa(a)}]}`}toString(){return'Not('+this.F.toString()+')'}};P('olympe.dc.predicates.Not',olympe.dc.Y.ie);olympe.dc.Y.ie.ya=[olympe.dc.za];olympe.dc.Y.Ge=class{constructor(a){this.Y=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Y=this.Y.concat(arguments[c]):this.Y.push(arguments[c])}ka(){return Q(olympe.dc.Y.Ge)}D(){return this.Y.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.sa(this.Y.map(c=>c.j(a,b)),(...c)=>olympe.C.Rb(c.some(d=>d.valueOf())),olympe.C.da))}fa(a){const b=this.Y.map(c=>c.fa(a));return'{"c":"'+this.ka()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.Y.map(a=>a.toString()).join(',')+
1018
+ ')'}};P('olympe.dc.predicates.Or',olympe.dc.Y.Ge);olympe.dc.Y.Ge.ya=[olympe.dc.za];olympe.dc.Y.Hf=class{constructor(a,b,c){this.source=a;this.H=b;this.F=void 0===c?!0:c}ka(){return Q(olympe.dc.Y.Hf)}D(){return[this.source.j()]}jb(){return this.source}j(a,b){return a.run(()=>olympe.C.sa([this.source.getValue(a,b),this.H,this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Rb((new RegExp(d)).test(c))},olympe.C.da))}fa(a){const b=this.source.fa(a),c=Em(a,this.H);a=Em(a,this.F);return'{"c":"'+this.ka()+'","a":['+b+','+c+','+a+
1019
+ ']}'}toString(){const a=Dm(this.F);return'Regex('+this.source.toString()+','+this.H+','+a+')'}};P('olympe.dc.predicates.Regex',olympe.dc.Y.Hf);olympe.dc.Y.Hf.ya=[olympe.dc.za];olympe.dc.Y.Rk=class extends olympe.dc.Y.Hl{constructor(a,b){super(a,b)}ka(){return Q(olympe.dc.Y.Rk)}N(a,b){return a<b}};P('olympe.dc.predicates.Smaller',olympe.dc.Y.Rk);olympe.dc.kc={};olympe.dc.kc.Vj=class{constructor(){this.Z=this.H=this.R=this.D=null}N(){return null!==this.D}X(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}j(a,b,c){b=this.H;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.kc.gk(this),this.R=c,this.H=b):this.H=this.R=null;return b}F(){if(null===this.D)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.Z){const a=[];null!==this.H&&
1020
+ (0<=this.D?Mm(Nm(this.H,this.D),a):a.push(this.R));this.Z(a)}}zg(a){this.Z=a}};olympe.dc.kc.Vj.ya=[olympe.dc.kc.Ta];function Bm(a,b,c,d){b?a.N[d]=c:delete a.N[d];null===a.D&&(a.D=new olympe.dc.kc.gk(a.j,a));return a.D}function Nm(a,b){for(let c=0;c<b;c++)if(null!==a.D)a=a.D;else break;return a}function Mm(a,b){a=a.N;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.kc.gk=class{constructor(a,b){this.j=a;this.depth=b?b.depth+1:0;this.N=Object.create(null);this.D=null}re(){return this.j}pg(){this.j.N()?this.j.F():this.j.X(this.depth-1)}};class Om extends olympe.dc.kc.gk{constructor(a,b,c){super(a);this.R=b;this.tag=c;this.Z=this.X=this.H=!1;this.F=null}}
1021
+ function Pm(a,b,c,d,e){const f=Object.create(null),g=a.ia,h=a.H;let k,l,n;a.ba=!0;l=0;for(n=g.length;l<n;l++)f[g[l]]=null;g.length=0;l=c;for(n=Math.min(b.length,d);l<n;l++)k=b[l],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.H||(c.H=!0,e(!0,c.tag,c.R,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.H&&(c.H=!1,e(!1,c.tag,c.R,c)),c.X&&(c.F=null,delete h[k]),delete f[k]);a.ba=!1;null!==a.D&&a.F()}
1022
+ olympe.dc.kc.Dm=class{constructor(){this.H={};this.ia=[];this.D=null;this.ba=!1;this.R=[];this.Z=null}N(){return null!==this.D}X(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}F(){if(null===this.D)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.ba){var a=this.ia,b=a.length,c=this.H,d;for(d=this.R.length=0;d<b;d++){var e=c[a[d]];if(0>this.D)this.R.push(e.R);else{if(!e.Z){var f=e,g=this.D;f.Z=!0;f.F=Nm(f,g)}null!==
1023
+ e.F&&Mm(e.F,this.R)}}this.Z&&this.Z(this.R)}}zg(a){this.Z=a}j(a,b,c){let d=this.H[c];a?void 0===d?(d=new Om(this,c,b),this.H[c]=d):(d.tag=b,d.X=!1):void 0!==d&&(d.X=!0);return d}};olympe.dc.kc.Dm.ya=[olympe.dc.kc.Ta];olympe.dc.kc.Ta=class{constructor(){}j(){}N(){}X(){}F(){}zg(){}};function Qm(a,b){olympe.C.pf(a.value)?(a.node=olympe.C.Vn(a.value,b),Sb(a.node)||b()):b()}function Rm(a,b){if(olympe.C.pf(a.value)){const c=olympe.C.Za(),d=a.H;olympe.C.Wc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>Qm(a,b)),olympe.C.Za().destroy())})}}
1024
+ class Sm extends olympe.dc.kc.gk{constructor(a,b,c){super(a);this.X=b;this.value=c;this.H=this.Qa();this.position=this.node=null;this.R=!1;this.F=null}Qa(){const a=olympe.C.Qa(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.F=this.value=null}fb(){return null===this.value}}
1025
+ function Tm(a,b){if(!b.fb()){var c=a.D;var d=a.ia,e=b.Qa(),f=0;let g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].H,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].H,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.H=b.Qa();if(c!==b.position){d=a.D;e=d.length;f=b.position;null===f&&(f=e);if(c<f)for(e=f;e>c;e--)d[e]=d[e-1],d[e].position=e;else for(e=f;e<c;e++)d[e]=d[e+1],d[e].position=e;d[c]=b;d[c].position=c;b.R&&a.F()}}}
1026
+ function Um(a){const b=a.ia;a.D.sort((c,d)=>b(c.Qa(),d.Qa()))}
1027
+ olympe.dc.kc.Wr=class{constructor(a){this.ia=a;this.H=null;this.D=[];this.R=[];this.Z=null;this.ba=new Map}j(a,b,c,d){b='$'+c;const e=this.D;let f;if(a)f=new Sm(this,c,d),this.ba.set(b,f),this.N()?Qm(f,()=>Tm(this,f)):(f.position=e.length,e.push(f));else{f=this.ba.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ba.delete(b);null!==f.position&&(this.N()?this.remove(f):delete e[f.position]);f.destroy()}return f}N(){return null!==this.H}X(a){if(null!==this.H)throw Error('Manager already activated (depth='+
1028
+ this.H+')');this.H=a;Um(this);for(let b=0,c=this.D.length;b<c;b++){const d=this.D[b];d.position=b;Rm(d,()=>Tm(this,d))}this.F()}F(){if(null===this.H)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.D.length;this.R.length=0;for(let d=0;d<a;d++){let e=this.D[d];if(!e.R){var b=e,c=this.H;b.R=!0;b.F=Nm(b,c)}0>this.H?this.R.push(e.X):e.F&&Mm(e.F,this.R)}this.Z&&this.Z(this.R)}zg(a){this.Z=a}remove(a){const b=this.D,c=b.length-1;if(null!==a.position){for(a=a.position;a<
1029
+ c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.kc.Wr.ya=[olympe.dc.kc.Ta];function wm(a){if(!a.D){for(let b in a.F)Vm(a.F[b]);a.D=!0}a.H=null;a.N=null}function zm(a,b,c){a.F[c||'root'].R=b}function Am(a,b,c){a.F[c||'root'].pg(b)}function Wm(a,b,c,d){const e=a.N,f=b+d+c;let g=e[f];void 0===g&&(g=wh(a.db,b,c,d),e[f]=g);return g}function Xm(a,b){a.D||a.j.pg(b)}function Ym(a,b,c,d,e){if(!a.D){let f=Wm(a,c,d,e||olympe.dc.ta.DESTINATION);e||(f+=Wm(a,c,d,olympe.dc.ta.ORIGIN));0===f&&Xm(a,b)}}
1030
+ function Zm(a,b){const c=a.F[b];void 0!==c?(a.G&&a.G.debug('Set current block to',b,null!==c.F?'parent = '+c.F.T():''),a.j=c):a.G&&a.G.error('Try to set a block that does not exists:',b)}function $m(a){const b=String(++a.R),c=a.j;a.F[b]=new an(b,c);bn(c,b);c.H||(c.H=()=>Zm(a,c.T()));return b}function cn(a,b){const c=a.j;a.j.H=()=>{Zm(a,c.T());b()}}function dn(a,b){Vm(b?a.F[b]:a.j)}
1031
+ olympe.dc.kc.Yr=class{constructor(a,b){this.db=a;this.G=b||null;this.H=Object.create(null);this.N=Object.create(null);this.D=!1;this.R=0;this.j=new an('root');this.F=Object.create(null);this.F.root=this.j}register(a,b,c,d,e){this.D||(null!==b&&c&&d&&e?(c=Wm(this,c,d,e),d=this.H[b]||0,this.H[b]=++d,this.j.j===b&&c<=d&&(this.j.j=a)):this.j.j=a)}};function bn(a,b){null===a.D&&(a.D=Object.create(null));a.D[b]=!1}function Vm(a){a.N=!0;null!==a.F&&a.F.notify(a.id)}
1032
+ class an{constructor(a,b){this.id=a;this.F=b||null;this.j=this.R=this.H=this.D=null;this.N=!1}T(){return this.id}pg(a){const b=this.R;if(this.N||this.j===a||null===a)b&&b(),!b&&Vm(this)}notify(a){const b=this.H,c=this.D;if(this.N)b&&b();else if(!c[a]){a=c[a]=!0;for(let d in c)if(!c[d]){a=!1;break}a&&b&&b()}}};olympe.dc.ab={};function en(a,b,c,d){const e=olympe.dc.ha(),f=new olympe.dc.kc.Vj,g=new olympe.dc.kc.Yr(e);let h=!1;const k=Object.create(null),l=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,v)=>{a.jd()||a.fb()||(h||(zm(g,()=>{v.pg();wm(g)}),v.re().zg(l),h=!0),q?k[t]=r:delete k[t],Am(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].j(a,g,n);const p=olympe.U.Lc();Pf(e,b,(q,r)=>{g.register(p,null);const t=f.j(q,b,p,null);n(q,r,p,Bm(t,q,b,p))},p);a.onDestroy(()=>{Nf(e,b,p)});e.Ja(b)||wm(g)}
1033
+ function fn(a,b,c){const d=c.getContext(),e=olympe.dc.ha(),f=a.F(),g=hh(e,b,a.H,d.rc(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>ih(e,b,a.H,g))}
1034
+ olympe.dc.ab.Di=class{constructor(a,b,c){this.H=a&&a.W?a.W():a;this.aa=b&&b.filter(d=>d instanceof olympe.dc.aa.$e||d instanceof olympe.dc.aa.Le)||null;this.D=c||null;this.defaultValue=null}ka(){}Mb(){}F(){}j(){return(this.aa||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}wh(a){this.defaultValue=a;return this}ph(){return this.aa}be(){return this.D}getValue(a,b){const c=a.run(()=>olympe.C.bc(this.Mb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&lc(c,this.defaultValue);
1035
+ b=this.D||b;null!==this.aa?en(a,b,this.aa,d=>{fn(this,d,c)}):fn(this,b,c);return c.tb()}fa(a){const b=Em(a,this.H),c=Em(a,this.D);let d='null';this.aa&&(d=this.aa.map(function(e){return e.fa(a)}).join(','));return`{"c":"${this.ka()}","a":["${b}",${d},${c}]}`}toString(){const a=Dm(this.H),b=this.D?','+Dm(this.D):'';let c='';this.aa&&(c=','+this.aa.join(','));return this.ka().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.ab.Di.ya=[olympe.dc.Yk];olympe.dc.ab.ro=class{constructor(a,b){if(olympe.C.pf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.W();var d=olympe.dc.ha();const e=d.Ib(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.nh(e,olympe.dc.CloudObject.extendRel,olympe.dm.Je);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.W():d=new olympe.dc.ab.jj(c,b);break;case olympe.dm.Number.O.W():d=new olympe.dc.ab.aj(c,
1036
+ b);break;case olympe.dm.Boolean.O.W():d=new olympe.dc.ab.Wj(c,b);break;case olympe.dm.DateTime.O.W():d=new olympe.dc.ab.Ji(c,b)}this.D=d}ka(){return this.D.ka()}j(){return this.D.j()}getValue(a,b){return this.D.getValue(a,b)}fa(a){return this.D.fa(a)}toString(){return this.D.toString()}};olympe.dc.ab.ro.ya=[olympe.dc.Yk];olympe.dc.ab.Wj=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.Wj)}F(){return olympe.dc.ib.un}Mb(){return olympe.C.da}};P('olympe.dc.valuedefs.BooleanProperty',olympe.dc.ab.Wj);olympe.dc.ab.We=class{constructor(a){this.value=a}ka(){return Q(olympe.dc.ab.We)}j(){return[]}getValue(){return this.value}fa(a){a=Em(a,this.value);return`{"c":"${this.ka()}","a":[${a}]}`}toString(){return`Constant(${Dm(this.value)})`}};P('olympe.dc.valuedefs.Constant',olympe.dc.ab.We);olympe.dc.ab.We.ya=[olympe.dc.Yk];olympe.dc.ab.Ji=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.Ji)}F(){return olympe.dc.ib.vn}Mb(){return olympe.C.eb}};P('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.ab.Ji);olympe.dc.ab.aj=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.aj)}F(){return olympe.dc.ib.wn}Mb(){return olympe.C.$}};P('olympe.dc.valuedefs.NumberProperty',olympe.dc.ab.aj);olympe.dc.ab.jj=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.jj)}F(){return olympe.dc.ib.xn}Mb(){return olympe.C.Sa}};P('olympe.dc.valuedefs.StringProperty',olympe.dc.ab.jj);olympe.dc.ab.kj=class{ka(){return Q(olympe.dc.ab.kj)}j(){return[]}getValue(a,b){return b}fa(){return'{"c":"'+this.ka()+'","a":[]}'}toString(){return'Tag()'}};P('olympe.dc.valuedefs.Tag',olympe.dc.ab.kj);olympe.dc.ab.kj.ya=[olympe.dc.Yk];olympe.dc.aa={};olympe.dc.aa.Ki=class{Mb(){return null}ka(){return Q(olympe.dc.aa.Ki)}j(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.j.j!==g||b.D||(b.j.j=f),c(!0,f,f,Bm(h,!0,f,f))):(d[f]++,Xm(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,Bm(h,!1,f,f)))}}fa(){return'{"c":"'+this.ka()+'"}'}toString(){return'Distinct()'}};P('olympe.dc.transformers.Distinct',olympe.dc.aa.Ki);olympe.dc.aa.Ki.ya=[olympe.dc.Kf];olympe.dc.aa.zf=class{constructor(a){this.D=a}Mb(){return null}ka(){return Q(olympe.dc.aa.zf)}F(){return this.D.D()}j(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&Xm(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,Bm(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;if(f){let n=this.D.j(a,g);olympe.C.gb(n)&&(n=n.Ba);olympe.C.Wf(n)?(b.D||void 0!==olympe.C.Qa(n)||Xm(b,h),e[l]=n,a.run(()=>{olympe.C.Wc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
1037
+ d(g,h,k,!1),delete e[h]}}fa(a){return'{"c":"'+this.ka()+'","a":['+this.D.fa(a)+']}'}toString(){return'Filter('+this.D.toString()+')'}};P('olympe.dc.transformers.Filter',olympe.dc.aa.zf);olympe.dc.aa.zf.ya=[olympe.dc.Kf,olympe.dc.jr];olympe.dc.aa.km=class{constructor(a,b,c,d){this.D=new olympe.dc.Ra.Relation(olympe.dc.ea(a),c||olympe.dc.ta.DESTINATION);this.F=new olympe.dc.Ra.Relation(olympe.dc.ea(b),d||olympe.dc.ta.DESTINATION)}Mb(){return ig(this.D)}ka(){return Q(olympe.dc.aa.km)}j(a,b,c){const d=olympe.dc.ha(),e={},f=this.D.W(),g=this.D.La(),h=this.F.W(),k=this.F.La();let l=null,n=null;const p=(r,t,v,x,y,z)=>{if(y){if(y=()=>{const A=olympe.U.rb(v+g+(f+'_'+r)+z,20),K=Bm(t,!0,z,A);l=r;n=()=>{c(!1,z,A,Bm(t,!1,z,A))};b.register(A,
1038
+ v,x,f,g);c(!0,z,A,K)},y.at=r,e[x]=y,null===l||r<l)n&&n(),y()}else if(l===r){n();e[x]=!0;y=Infinity;let A=null;for(let K=Object.keys(e),Y=K.length,ya=0;ya<Y;ya++){let db=e[K[ya]];db.at<y&&(y=db.at,A=db)}A&&A()}},q=(r,t,v,x,y)=>{x?e[y]||(e[y]=!0,Ym(b,v,y,f,g),Ym(b,v,y,h,k),T(d,y,this.D,p.bind(this,r,t,v,y),v+'_val'),T(d,y,this.F,q.bind(this,r+1,t,v),v+'_follow')):(d.D(y,this.F,v+'_follow'),d.D(y,this.D,v+'_val'),delete e[y])};return(r,t,v,x)=>q(0,x,v,r,t)}fa(){return'{"c":"'+this.ka()+'","a":["'+this.D.toString()+
1039
+ '","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.D.toString()+', '+this.F.toString()+')'}};P('olympe.dc.transformers.FirstRelated',olympe.dc.aa.km);olympe.dc.aa.km.ya=[olympe.dc.Kf];olympe.dc.aa.Mh=class{constructor(a,b){this.start=a;this.D=b}Mb(){return null}ka(){return Q(olympe.dc.aa.Mh)}j(a,b,c){const d=new olympe.dc.kc.Dm;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.D||(b.j.j=e[0>n-1?0:Math.min(e.length,n)-1]);Pm(d,e,f,n,c)}};a.run(()=>olympe.C.Wc([this.start,this.D],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));cn(b,k);const l=$m(b);Zm(b,l);return(n,p,q,r)=>{h||(r.re().zg(t=>{e=t;dn(b,l)}),zm(b,()=>r.pg(),l),h=!0);d.j(n,p,q,null);Am(b,q,l)}}fa(a){return'{"c":"'+
1040
+ this.ka()+'","a":['+Em(a,this.start)+','+Em(a,this.D)+']}'}toString(){return`Limit(${olympe.C.Qa(this.start)},${olympe.C.Qa(this.D)})`}};P('olympe.dc.transformers.Limit',olympe.dc.aa.Mh);olympe.dc.aa.Mh.ya=[olympe.dc.Kf];function gn(a){return a.ob.map(b=>b.W())}
1041
+ olympe.dc.aa.tk=class{constructor(a,b){this.direction=b||olympe.dc.ta.DESTINATION;this.ob=a.map(c=>new olympe.dc.Ra.Relation(c,this.direction))}Mb(){return olympe.dc.CloudObject}ka(){return Q(olympe.dc.aa.tk)}La(){return this.direction}j(a,b,c){const d=olympe.dc.ha(),e=(f,g,h,k)=>T(d,f,k,(l,n)=>{var p=k.W();p=olympe.U.rb(g+k.La()+p+n,20);const q=Bm(h,l,n,p);l&&b.register(p,g,f,k.W(),k.La());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.ob.forEach(l=>{Ym(b,h,g,l.W(),l.La());e(g,h,k,l)}):this.ob.forEach(l=>
1042
+ {d.D(g,l,h)})}}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(gn(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.La()+'['+gn(this).join(',')+'])'}};P('olympe.dc.transformers.MultiRelated',olympe.dc.aa.tk);olympe.dc.aa.tk.ya=[olympe.dc.Kf];olympe.dc.aa.Le=class extends olympe.dc.Ra.Relation{constructor(a,b=olympe.dc.ta.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.D=d}Mb(){return ig(this)}ka(){return Q(olympe.dc.aa.Le)}j(a,b,c){const d=olympe.dc.ha(),e=Object.create(null),f=olympe.dc.ta.ORIGIN,g=olympe.dc.ta.DESTINATION,h=this.W(),k=this.La(),l=(p,q,r)=>{if(!(0<=this.D&&p>=this.D)){var t=d.cb(r,this);p+=1;for(let v=0,x=t.length;v<x;v++){if(void 0!==e[t[v]]||r===t[v])continue;const y=olympe.U.rb(q+k+(h+'_'+p)+t[v],20);b.register(y,
1043
+ q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,v,x)=>{v&&!b.D&&l(p,t,x);p>=this.F?c(v,x,t,Bm(r,v,x,t)):Ym(b,t,x,h,k);0<=this.D&&p>=this.D||(v?e[x]||(e[x]=!0,T(d,x,this,(y,z)=>{const A=p+1,K=olympe.U.rb(t+k+(h+'_'+A)+z,20);n(A,x,r,K,y,z)},t)):(d.D(x,this,t),delete e[x]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}fa(){return'{"c":"'+this.ka()+'","a":["'+this.W()+'","'+this.La()+'",'+this.F+','+this.D+']}'}toString(){return'RecursiveRelated('+this.La()+this.W()+'['+this.F+'..'+this.D+'])'}};
1044
+ P('olympe.dc.transformers.RecursiveRelated',olympe.dc.aa.Le);olympe.dc.aa.Le.ya=[olympe.dc.Kf];olympe.dc.aa.$e=class extends olympe.dc.Ra.Relation{constructor(a,b){super(a,b||olympe.dc.ta.DESTINATION)}Mb(){return ig(this)}ka(){return Q(olympe.dc.aa.$e)}$b(){return new olympe.dc.aa.$e(this.tag,this.direction===olympe.dc.ta.DESTINATION?olympe.dc.ta.ORIGIN:olympe.dc.ta.DESTINATION)}j(a,b,c){const d=olympe.dc.ha(),e=this.W(),f=this.La();return(g,h,k,l)=>{Ym(b,k,h,e,f);g?T(d,h,this,(n,p)=>{const q=olympe.U.rb(k+f+e+p,20),r=Bm(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.D(h,this,k)}}fa(){return'{"c":"'+
1045
+ this.ka()+'","a":["'+this.W()+'","'+this.La()+'"]}'}toString(){return'Related('+this.La()+this.W()+')'}};P('olympe.dc.transformers.Related',olympe.dc.aa.$e);olympe.dc.aa.$e.ya=[olympe.dc.Kf];olympe.dc.aa.ah=class{constructor(a,b){this.Gb=a;this.D=void 0===b?!0:!!b}Mb(){return null}ka(){return Q(olympe.dc.aa.ah)}jh(){return this.Gb}F(){return[this.Gb.H()]}j(a,b,c){const d=new olympe.dc.kc.Wr(a.rc(this.D?this.Gb.compare.bind(this.Gb):(e,f)=>this.Gb.compare(f,e)));return(e,f,g)=>{var h=e?this.Gb.F(a,f):void 0;h=d.j(e,f,g,h);c(e,f,g,h)}}fa(a){return'{"c":"'+this.ka()+'","a":['+this.Gb.fa(a)+','+JSON.stringify(this.D)+']}'}toString(){return'Sort('+this.Gb.toString()+','+JSON.stringify(this.D)+
1046
+ ')'}};P('olympe.dc.transformers.Sort',olympe.dc.aa.ah);olympe.dc.aa.ah.ya=[olympe.dc.Kf,olympe.dc.jr];function hn(a,b,c,d,e,f){function g(n,p){if(l)for(var q=l.length-1;0<=q;q--)f=l[q].j(b,e,f);e.register(h,null);q=d.j(n,p,c,null);f(n,p,h,Bm(q,n,p,h))}const h=olympe.U.Lc(),k=olympe.dc.ha(),l=a.aa;b.run(()=>olympe.C.Wc([a.D],n=>{jn(k,n,g,h);void 0===k.model(n)&&wm(e)}))}function jn(a,b,c,d){const e=b&&b.valueOf();e&&(Pf(a,e,c,d),olympe.C.Za().Xd(()=>Nf(a,e,d)))}
1047
+ olympe.dc.aa.Lf=class{constructor(a,b){this.aa=this.D=null;a instanceof olympe.dc.Aa?(this.D=a.be(),this.aa=a.xm()):(this.D=a,b&&(this.aa=b))}Mb(){return null}ka(){return Q(olympe.dc.aa.Lf)||''}ph(){return this.aa}be(){return this.D}j(a,b,c){const d=new olympe.dc.kc.Dm,e=new olympe.dc.kc.Vj;let f=[],g=[],h=!1,k=!1;const l=$m(b),n=$m(b);cn(b,()=>{const p=f.concat(g);0<p.length?b.D||(b.j.j=p[p.length-1]):dn(b);Pm(d,p,0,p.length,c)});Zm(b,n);hn(this,a,this.D,e,b,(p,q,r,t)=>{const v=olympe.C.Za();v.jd()||
1048
+ v.fb()||(k||(t.re().zg(x=>{g=x;dn(b,n)}),zm(b,()=>t.pg(),n),k=!0),d.j(p,q,r),Am(b,r,n))});Zm(b,l);return(p,q,r,t)=>{h||(t.re().zg(v=>{f=v;dn(b,l)}),zm(b,()=>t.pg(),l),h=!0);d.j(p,q,r,l);Am(b,r,l)}}fa(a){const b=this.aa?'['+this.aa.map(c=>c.fa(a)).join(',')+']':'null';return'{"c":"'+this.ka()+'","a":['+Em(a,this.D)+','+b+']}'}toString(){const a=olympe.C.gb(this.D)?'N:'+this.D.Ba.T():this.D.valueOf(),b=this.aa?','+this.aa.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
1049
+ P('olympe.dc.transformers.Union',olympe.dc.aa.Lf);olympe.dc.aa.Lf.ya=[olympe.dc.Kf];olympe.dc.aa.Dr={NB:1,Gu:-1,Fu:0};olympe.dc.aa.qD={vA:!0,WA:!1};olympe.dc.jc.P={sq:'dc.legacy.listdefProcessor'};olympe.dc.jc.Config={rq:'dc.legacy.listdefsCovered'};olympe.V.config(a=>{E(a,olympe.dc.jc.Config.rq,!1);C(a,olympe.dc.jc.P.sq,olympe.dc.jc.zv,olympe.dc.query.P.Da,olympe.dc.P.Ch,olympe.dc.transaction.P.Fa,olympe.dc.query.P.Fk,new olympe.V.oa(olympe.dc.Config.Yh),new olympe.V.oa(olympe.dc.jc.Config.rq))});olympe.V.run([olympe.dc.jc.P.sq],a=>{olympe.dc.jc.Fy=()=>a});function kn(a){const b=olympe.dc.ha(),c=new Map;b.Qs(a).forEach(d=>{b.cb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
1050
+ olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ha();Object.defineProperty(this,'db',{enumerable:!1});this.model=null;Object.defineProperties(this,{db:{enumerable:!1}})}static Sc(a,b,c,...d){b=olympe.dc.ea(b);var e=Rf(b);if(e=e&&e.j)return e(a,c,...d);a=a.create(b);void 0!==c&&null!==c&&X(a,olympe.dc.CloudObject.nameProp,c);return a.W()}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.Ts();a=olympe.dc.ea(a);var c=b.db.model(a);c=Qf(b,c);if(null===
1051
+ c)throw new olympe.dc.Xq(a);c=c.instantiate(a,b.D);b.j.ne([a],olympe.dc.db.Instance.j.aq);b.Ra.register(c,a);b=c}return b}static exists(a){return olympe.dc.ha().Ja(olympe.dc.ea(a))}static Kj(...a){olympe.dc.Ns().Kj(...a)}static Jx(a,b,c){const d=olympe.dc.ha();let e=null;const f=k=>{null===e&&(e=kn(b||this));return e.has(k)?e.get(k):null},g=$l(!1),h=g.create(null!=b?b:this);void 0!==c&&h.yi(c);a.forEach((k,l)=>{d.Ja(olympe.dc.ea(l))?X(h,l,k):(l=f(l))&&X(h,l,k)});g.mb((k,l)=>{k||olympe.ga.Wa('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});
1052
+ return this.get(h)}static tx(){return this.get(this)}static ql(a){return olympe.dc.la.ql(a)}static zb(){return olympe.dc.ha().cb(this,olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Ra.Property(a))}static Id(){const a=olympe.dc.ha();return a.cb(this,olympe.dc.CloudObject.Lj).map(b=>new olympe.dc.Ra.Relation(b)).concat(a.cb(this,olympe.dc.CloudObject.Is).map(b=>new olympe.dc.Ra.Relation(b,olympe.dc.ta.ORIGIN)))}static Uc(a){return olympe.dc.CloudObject.get(a)}static Us(a){var b=Qf(olympe.dc.Ts(),
1053
+ olympe.dc.ea(a));b=b&&b.D;return new olympe.dc.Aa(olympe.dc.ea(a),olympe.dc.CloudObject.instancesRel,b)}W(){return this.tag}name(){return this.db.name(this)}ka(){return this.wb(olympe.dc.CloudObject.nameProp)}Vb(){this.model||(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.la.from(this)}Re(){return this.db.Re(this)}jb(){return this.db.source(this)}Cy(){return this.db.vi(this)?olympe.dc.ee().fromModel(this):null}Ps(){return olympe.C.sa([this.ka()],
1054
+ a=>olympe.C.xb(a),olympe.C.Sa,'getDisplayName',olympe.C.xb('('+this.toString()+')'))}Wb(){return this.model?this.model.W():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.Cb?a.Cb():a;return new rxjs.Observable(e=>{const f=olympe.dc.ib.tc(this.db.Pa(this.tag,b));c||null!==f||e.next(f);const g=hh(this.db,this.tag,b,h=>{e.next(olympe.dc.ib.tc(h))});d.Xd(()=>{e.complete();ih(this.db,this.tag,b,g)});return()=>ih(this.db,this.tag,b,g)})}Iz(a){const b='function'===typeof a.Cb?a.Cb():
1055
+ a;return new rxjs.Observable(c=>{const d=jh(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Ra.Property(e),null]):c.next([new olympe.dc.Ra.Property(e),f])});b.Xd(()=>{c.complete();kh(this.db,this.tag,d)});return()=>kh(this.db,this.tag,d)})}Jz(a){return this.observe(olympe.C.Za(),a)}get(a){return olympe.dc.ib.tc(this.db.Pa(this.tag,a))}Pa(a){return this.get(a)}bb(a){return olympe.dc.la.from(this).bb(a)}vg(a){return olympe.dc.sd.from(this).bb(a)}tc(){return this}ly(){return this.Tc(olympe.dc.CloudObject.Fx,
1056
+ olympe.dc.CloudObject)}Gn(){return this.cb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Uf(a,b,c){const d=olympe.C.bc(c,'Sync valueType'),e=hh(this.db,this.tag,a,olympe.C.Za().rc(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>ih(this.db,this.tag,a,e));return d.getContext()}wb(a){return M(this.Uf(a,olympe.dc.ib.xn,olympe.C.Sa))}xd(a){return M(this.Uf(a,olympe.dc.ib.wn,olympe.C.$))}mh(a){return M(this.Uf(a,olympe.dc.ib.un,
1057
+ olympe.C.da))}Dj(a){return M(this.Uf(a,olympe.dc.ib.vn,olympe.C.eb))}Ys(){return M(this.Uf(olympe.dm.Color.valueProp,olympe.dc.ib.Bs,olympe.C.Color))}Zs(){return M(this.Uf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.ib.Cs,olympe.dc.CloudObject))}cb(a,b){a=a instanceof olympe.dc.aa.$e?a:new olympe.dc.aa.$e(a.W(),a.La());return new olympe.dc.Aa(this.W(),a,b)}Tc(a,b){return this.cb(a,b).Jc()}Ls(a,b){const c=this.db,d=olympe.U.Lc(),e=olympe.C.Za(),f=new Map;T(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,
1058
+ olympe.dc.CloudObject.get(h)))&&f.set(h,g);else{let k;null==(k=f.get(h))||k();f.delete(h)}},d);e.onDestroy(()=>{c.D(this.tag,a,d)})}nA(){return new olympe.dc.Aa(this.W(),[],gg(this.W()))}transform(...a){return(new olympe.dc.Aa(this.W(),[],this.constructor)).transform(...a)}Xc(){return this.Ps()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ja(this.tag)?Object.assign({'#tag':this.W(),'#type':this.Vb().name()},this.Nc(!0,!0)):{'#tag':this.W(),'#error':'The object does not exist in the local database.'}}Nc(a=
1059
+ !1,b=!0){const c={};this.db.zb(this,b).forEach((d,e)=>{this.db.Ja(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.ib.tc(d))});return c}Ea(a){return a instanceof olympe.dc.CloudObject?this.W()===a.W():'function'===typeof a?olympe.dc.na.Wb(a)===this.W():!1}Jd(a){return olympe.C.sa([a],b=>olympe.C.Rb(this.Ea(b)),olympe.C.da)}Mx(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Ya,c=!0;const d=olympe.dc.ta.ORIGIN;for(const [e,f,g]of uh(b,this))f===d?a.hc(e,g,this):e!==olympe.dc.CloudObject.modelRel.W()&&
1060
+ a.hc(e,this,g);a.delete(this,olympe.dc.Lb.NONE);c&&a.mb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Ea;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Nc;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.vg;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.bb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Pa;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;
1061
+ olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Jz;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.Iz;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.Wb;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.jb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Re;
1062
+ olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Vb;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.W;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Us;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Uc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.Id;
1063
+ olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.zb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.ql;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.tx;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Jx;olympe.dc.CloudObject.markObsolete=olympe.dc.CloudObject.Kj;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.O=olympe.dc.na.j('ff021000000000000001',olympe.dc.CloudObject);
1064
+ olympe.dc.CloudObject.CF=olympe.dc.CloudObject.O.ja(olympe.dc.lq.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.O.ja('ff023000000000000011');w('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.nF=olympe.dc.CloudObject.O.ja('ff023000000000000012');olympe.dc.CloudObject.Lj=olympe.dc.CloudObject.O.ra('ff02200000000000000a');olympe.dc.CloudObject.Is=olympe.dc.CloudObject.O.ra('ff02200000000000000b',olympe.dc.ta.ORIGIN);olympe.dc.CloudObject.XE=olympe.dc.CloudObject.O.ra('017e9c4ba4c847d71cbf');
1065
+ olympe.dc.CloudObject.NE=olympe.dc.CloudObject.O.ra('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.ra('ff02200000000000000c');w('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.O.ra('ff02200000000000000d',olympe.dc.ta.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.O.ra(olympe.dc.fc.Zc);w('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);
1064
1066
  olympe.dc.CloudObject.instancesRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);w('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.ra(olympe.dc.fc.Li);w('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.extendRel);w('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);
1065
- olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.ra(olympe.dc.fc.Zj);w('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Ex=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Kx=olympe.dc.CloudObject.O.ra('018282d3ac0a474a0bf4');w('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.Kx);olympe.dc.rD=olympe.dc.CloudObject;olympe.dc.CloudObject.ya=[olympe.dc.Ye];m=olympe.dc.CloudObject.prototype;
1066
- m.W.K=new olympe.C.J(()=>String,[]);m.name.K=new olympe.C.J(()=>String,[]);m.ka.K=olympe.C.J.D;m.Ub.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.jb.K=new olympe.C.J(()=>String,[]);m.By.K=new olympe.C.J(()=>String,[]);m.Os.K=olympe.C.J.D;m.Vb.K=new olympe.C.J(()=>String,[]);m.ky.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Dn.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Sf.K=new olympe.C.J(()=>olympe.C.Node,[]);m.vb.K=olympe.C.J.D;m.xd.K=olympe.C.J.F;m.mh.K=olympe.C.J.N;
1067
- m.Dj.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Xs.K=new olympe.C.J(()=>olympe.C.Color,[]);m.Ys.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.cb.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Sc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Ks.K=new olympe.C.J(()=>Function,[]);m.mA.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.transform.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Wc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;m.Jd.K=olympe.C.J.N;m.Lx.K=new olympe.C.J(()=>{},[]);olympe.dc.P={Ch:'dc.DBView',cq:'dc.InstanceManager',Ca:'dc.Logger',Lw:'dc.TransactionLogger',hk:'dc.FileServiceManager',Ug:'dc.Router'};olympe.dc.Config={Xg:'dc.tag',ag:'dc.debug',Yh:'dc.subscribeAll',$l:'dc.defaultSource',up:'dc.fileCache',Yo:'dc.dataConsumerOnly',pp:'dc.errorOnAbstractInstantiation'};
1068
- olympe.V.config(function(a){const b='object'===typeof window;E(a,olympe.dc.Config.ag,!1);E(a,olympe.dc.Config.Yh,!1);E(a,olympe.dc.Config.$l,olympe.dc.Ia.SERVER);E(a,olympe.dc.Config.Yo,b);E(a,olympe.dc.Config.up,b);E(a,olympe.dc.Config.pp,!0);E(a,olympe.dc.Config.Xg,olympe.U.Kc());D(a,olympe.dc.P.Ca,[olympe.ha.P.Fa],c=>c.ad('dc'));Wa(a,olympe.dc.P.Lw,olympe.dc.transaction.P.Ca);Wa(a,olympe.dc.P.Ch,olympe.dc.db.P.Xl);C(a,olympe.dc.P.hk,olympe.dc.su,olympe.dc.P.Ca,olympe.dc.db.P.Fa,olympe.net.P.Fa,
1069
- olympe.dc.P.Ug,olympe.U.P.Dg,new olympe.V.oa(olympe.dc.Config.up));C(a,olympe.dc.P.Ug,olympe.dc.kw,olympe.dc.P.Ca,olympe.dc.sources.P.tr,olympe.dc.sources.P.Lr,olympe.dc.P.Ch,olympe.host.P.Ge,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.Config.Yo));C(a,olympe.dc.P.cq,olympe.dc.Lu,olympe.dc.db.P.jm,olympe.dc.db.P.Fa,olympe.V.P.Eg)},'olympe.dc');
1070
- olympe.V.run([olympe.dc.db.P.Fa,olympe.dc.transaction.P.Fa,olympe.dc.P.cq,olympe.dc.P.hk,new olympe.V.oa(olympe.dc.Config.Xg)],(a,b,c,d,e)=>{olympe.dc.Ms=()=>a;olympe.dc.Fj=()=>b;olympe.dc.Ss=()=>c;olympe.dc.Qs=()=>d;olympe.dc.Ia.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Ud=class extends olympe.dc.CloudObject{ka(){return this.vb(olympe.dc.CloudObject.nameProp)}j(){return olympe.C.Sa.EMPTY}D(){return olympe.C.ba.j}};olympe.dm.Ud.O=olympe.dc.na.j('ff021000000000000002',olympe.dm.Ud);olympe.dm.Ud.N=olympe.dm.Ud.O.ja('ff023000000000000035');olympe.dm.Ud.j=olympe.dm.Ud.O.ra('ff022000000000000005');olympe.dm.Ud.F=dg('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Ud.H=dg('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
1071
- olympe.dm.Ud.D=dg('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Ud.prototype.ka.K=olympe.C.J.D;olympe.dm.Ud.prototype.j.K=olympe.C.J.D;olympe.dm.Ud.prototype.D.K=olympe.C.J.N;olympe.dm.Dl={NONE:0,ZA:1,fu:2,$A:4,WA:8,YA:16,XA:31,wC:32,tC:64,xC:128,uC:256,Pv:512,vC:992,NB:1023};olympe.dm.User=class extends olympe.dc.CloudObject{yy(){return this.Hn()}ka(){return this.Hn()}Hn(){return this.vb(olympe.dm.User.loginProp)}$u(){return this.vb(olympe.dm.User.D)}Zu(){return olympe.C.Sa.EMPTY}Ty(){return this.vb(olympe.dm.User.saltProp)}bz(){return this.vb(olympe.dm.User.verifierProp)}Ry(){return this.cb(olympe.dm.User.F,olympe.dm.Ud)}};olympe.dm.User.O=olympe.dc.na.j('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.O.ja('ff023000000000000001');
1067
+ olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.ra(olympe.dc.fc.Zj);w('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Fx=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Lx=olympe.dc.CloudObject.O.ra('018282d3ac0a474a0bf4');w('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.Lx);olympe.dc.sD=olympe.dc.CloudObject;olympe.dc.CloudObject.ya=[olympe.dc.Ye];m=olympe.dc.CloudObject.prototype;
1068
+ m.W.K=new olympe.C.J(()=>String,[]);m.name.K=new olympe.C.J(()=>String,[]);m.ka.K=olympe.C.J.D;m.Vb.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.jb.K=new olympe.C.J(()=>String,[]);m.Cy.K=new olympe.C.J(()=>String,[]);m.Ps.K=olympe.C.J.D;m.Wb.K=new olympe.C.J(()=>String,[]);m.ly.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Gn.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Uf.K=new olympe.C.J(()=>olympe.C.Node,[]);m.wb.K=olympe.C.J.D;m.xd.K=olympe.C.J.F;m.mh.K=olympe.C.J.N;
1069
+ m.Dj.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Ys.K=new olympe.C.J(()=>olympe.C.Color,[]);m.Zs.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.cb.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Tc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Ls.K=new olympe.C.J(()=>Function,[]);m.nA.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.transform.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Xc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;m.Jd.K=olympe.C.J.N;m.Mx.K=new olympe.C.J(()=>{},[]);olympe.dc.P={Ch:'dc.DBView',eq:'dc.InstanceManager',Da:'dc.Logger',Mw:'dc.TransactionLogger',hk:'dc.FileServiceManager',Ug:'dc.Router'};olympe.dc.Config={Xg:'dc.tag',bg:'dc.debug',Yh:'dc.subscribeAll',cm:'dc.defaultSource',vp:'dc.fileCache',Zo:'dc.dataConsumerOnly',qp:'dc.errorOnAbstractInstantiation'};
1070
+ olympe.V.config(function(a){const b='object'===typeof window;E(a,olympe.dc.Config.bg,!1);E(a,olympe.dc.Config.Yh,!1);E(a,olympe.dc.Config.cm,olympe.dc.Ia.SERVER);E(a,olympe.dc.Config.Zo,b);E(a,olympe.dc.Config.vp,b);E(a,olympe.dc.Config.qp,!0);E(a,olympe.dc.Config.Xg,olympe.U.Lc());D(a,olympe.dc.P.Da,[olympe.ga.P.Fa],c=>c.ad('dc'));Wa(a,olympe.dc.P.Mw,olympe.dc.transaction.P.Da);Wa(a,olympe.dc.P.Ch,olympe.dc.db.P.$l);C(a,olympe.dc.P.hk,olympe.dc.tu,olympe.dc.P.Da,olympe.dc.db.P.Fa,olympe.net.P.Fa,
1071
+ olympe.dc.P.Ug,olympe.U.P.Dg,new olympe.V.oa(olympe.dc.Config.vp));C(a,olympe.dc.P.Ug,olympe.dc.lw,olympe.dc.P.Da,olympe.dc.sources.P.ur,olympe.dc.sources.P.Mr,olympe.dc.P.Ch,olympe.host.P.He,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.Config.Zo));C(a,olympe.dc.P.eq,olympe.dc.Mu,olympe.dc.db.P.nm,olympe.dc.db.P.Fa,olympe.V.P.Eg)},'olympe.dc');
1072
+ olympe.V.run([olympe.dc.db.P.Fa,olympe.dc.transaction.P.Fa,olympe.dc.P.eq,olympe.dc.P.hk,new olympe.V.oa(olympe.dc.Config.Xg)],(a,b,c,d,e)=>{olympe.dc.Ns=()=>a;olympe.dc.Fj=()=>b;olympe.dc.Ts=()=>c;olympe.dc.Rs=()=>d;olympe.dc.Ia.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Ud=class extends olympe.dc.CloudObject{ka(){return this.wb(olympe.dc.CloudObject.nameProp)}j(){return olympe.C.Sa.EMPTY}D(){return olympe.C.da.j}};olympe.dm.Ud.O=olympe.dc.na.j('ff021000000000000002',olympe.dm.Ud);olympe.dm.Ud.N=olympe.dm.Ud.O.ja('ff023000000000000035');olympe.dm.Ud.j=olympe.dm.Ud.O.ra('ff022000000000000005');olympe.dm.Ud.F=fg('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Ud.H=fg('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
1073
+ olympe.dm.Ud.D=fg('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Ud.prototype.ka.K=olympe.C.J.D;olympe.dm.Ud.prototype.j.K=olympe.C.J.D;olympe.dm.Ud.prototype.D.K=olympe.C.J.N;olympe.dm.Gl={NONE:0,$A:1,gu:2,aB:4,XA:8,ZA:16,YA:31,xC:32,uC:64,yC:128,vC:256,Qv:512,wC:992,OB:1023};olympe.dm.User=class extends olympe.dc.CloudObject{zy(){return this.Kn()}ka(){return this.Kn()}Kn(){return this.wb(olympe.dm.User.loginProp)}av(){return this.wb(olympe.dm.User.D)}$u(){return olympe.C.Sa.EMPTY}Uy(){return this.wb(olympe.dm.User.saltProp)}cz(){return this.wb(olympe.dm.User.verifierProp)}Sy(){return this.cb(olympe.dm.User.F,olympe.dm.Ud)}};olympe.dm.User.O=olympe.dc.na.j('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.O.ja('ff023000000000000001');
1072
1074
  w('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.D=olympe.dm.User.O.ja('ff023000000000000002');olympe.dm.User.R=olympe.dm.User.O.ja('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.O.ja('ff023000000000000004');w('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.O.ja('ff023000000000000005');w('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.N=olympe.dm.User.O.ja('ff023000000000000020');
1073
- olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.ja('ff023000000000000036');w('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.F=R(olympe.dm.User.O,olympe.dm.Ud.j);olympe.dm.User.X=olympe.dm.User.O.ra('ff022000000000000002');olympe.dm.User.j=dg('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.H=dg('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.yy.K=olympe.C.J.D;m.ka.K=olympe.C.J.D;m.Hn.K=olympe.C.J.D;m.$u.K=olympe.C.J.D;m.Zu.K=olympe.C.J.D;m.Ty.K=olympe.C.J.D;
1074
- m.bz.K=olympe.C.J.D;m.Ry.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.eg=class extends olympe.dc.CloudObject{X(){return this.Dn()}Ha(){return this.vb(olympe.dm.eg.sa)}};olympe.dm.eg.O=olympe.dc.na.j('01621fb84e3300000000',olympe.dm.eg);olympe.dm.eg.sa=olympe.dm.eg.O.ja('01609de3f292e3c2c6ff');olympe.dm.eg.prototype.X.K=new olympe.C.J(()=>olympe.C.ud,[]);olympe.dm.eg.prototype.Ha.K=olympe.C.J.D;olympe.dm.BrickMetadata=class extends olympe.dm.eg{cz(){return this.vb(olympe.dm.BrickMetadata.Gc)}Jc(){return this.vb(olympe.dm.BrickMetadata.da)}getType(){return this.vb(olympe.dm.BrickMetadata.Yb)}mz(){return this.mh(olympe.dm.BrickMetadata.yb)}ue(){return null}hy(){return this.cb(olympe.sc.ui.Dx.Comment.PE.$b(),olympe.sc.ui.Dx.Comment)}kl(){return this.vg(olympe.dm.BrickMetadata.Ha).Cc().kl()}};olympe.dm.BrickMetadata.O=ig(olympe.dc.na.j('01621fb84e3500000000',olympe.dm.BrickMetadata));
1075
- olympe.dm.BrickMetadata.Gc=olympe.dm.BrickMetadata.O.ja('01621fb84e320000f001');olympe.dm.BrickMetadata.da=olympe.dm.BrickMetadata.O.ja('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Yb=olympe.dm.BrickMetadata.O.ja('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.yb=olympe.dm.BrickMetadata.O.ja('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.Ha=olympe.dm.BrickMetadata.O.ra('0161ae97622bb21f335b');olympe.dm.BrickMetadata.ke={FC:'private',HC:'public'};
1076
- olympe.dm.BrickMetadata.Tb={gB:'experimental',XC:'stable',UA:'deprecated'};olympe.dm.BrickMetadata.Md={GA:'business',sD:'technical'};m=olympe.dm.BrickMetadata.prototype;m.cz.K=olympe.C.J.D;m.Jc.K=olympe.C.J.D;m.getType.K=olympe.C.J.D;m.mz.K=olympe.C.J.N;m.ue.K=new olympe.C.J(()=>String,[]);m.hy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.kl.K=olympe.C.J.R;function uj(a,b){b=b.startsWith('data.')?b.substring(5):b;let c,d;return null!=(d=null!=(c=olympe.V.getParameter(`${'data.'}${a}.${b}`))?c:olympe.V.getParameter(`${'data.'}${b}`))?d:olympe.V.getParameter(`${olympe.dc.sources.Kh.Wv}${b}`)}
1077
- function Oj(a,b){const c=a.query().bb(olympe.dm.Ad.j.$b()).bb(olympe.dm.Ad.D);a=a.query().bb(olympe.dm.hb.D.$b()).ug(olympe.dm.hb.F,!0).bb(olympe.sc.Ac.j.$b());const d=e=>e.me().ug(olympe.dc.CloudObject.extendRel,!0).bb(olympe.dc.CloudObject.Lj,!0).bb(olympe.dm.Relation.destinationModelRel).back(2).bb(olympe.dc.CloudObject.propertyRel,!0).bb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
1078
- function ok(a,b){return a.observe(b,olympe.dm.DataSource.Cs).pipe(rxjs.operators.map(()=>a.Of(olympe.dc.sources.Config.Ve)),rxjs.operators.distinctUntilChanged())}
1079
- olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Jb=c;this.Es=new Map([[olympe.dc.sources.Config.Nm,olympe.dm.DataSource.Uz],[olympe.dc.sources.Config.Ve,olympe.dm.DataSource.Cs],[olympe.dc.sources.Config.Um,olympe.dm.DataSource.aA]])}T(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ia.SERVER:this.tag}Of(a){const b=a.startsWith('data.')?a.split('.')[1]:a,c=`${'data.'}${b}`;let d,e;return null!=(e=null!=(d=olympe.V.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
1080
- '_')}.${b}`))?d:uj(this.W(),a))?e:this.Es.has(c)?this.get(this.Es.get(c)):null}Jc(){const a=this;return u(function*(){const b=olympe.dm.DataSource.oc.iu,c=olympe.dm.DataSource.oc.Ab,d=new olympe.dc.Request(olympe.dc.Request.j.oc,a.T());return a.Jb.request(d).then(e=>{let f;const g=null!=(f=null==e?void 0:e.s)?f:c;(e=null==e?void 0:e.r)&&olympe.ha.Xa('dc').warn(`Source ${a.name()} (${a.T()}) has encountered issues: ${e}`);return g}).catch(e=>e instanceof olympe.error.Vk||e instanceof olympe.error.Em?
1075
+ olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.ja('ff023000000000000036');w('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.F=R(olympe.dm.User.O,olympe.dm.Ud.j);olympe.dm.User.X=olympe.dm.User.O.ra('ff022000000000000002');olympe.dm.User.j=fg('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.H=fg('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.zy.K=olympe.C.J.D;m.ka.K=olympe.C.J.D;m.Kn.K=olympe.C.J.D;m.av.K=olympe.C.J.D;m.$u.K=olympe.C.J.D;m.Uy.K=olympe.C.J.D;
1076
+ m.cz.K=olympe.C.J.D;m.Sy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.fg=class extends olympe.dc.CloudObject{Z(){return this.Gn()}Ha(){return this.wb(olympe.dm.fg.wa)}};olympe.dm.fg.O=olympe.dc.na.j('01621fb84e3300000000',olympe.dm.fg);olympe.dm.fg.wa=olympe.dm.fg.O.ja('01609de3f292e3c2c6ff');olympe.dm.fg.prototype.Z.K=new olympe.C.J(()=>olympe.C.vd,[]);olympe.dm.fg.prototype.Ha.K=olympe.C.J.D;olympe.dm.BrickMetadata=class extends olympe.dm.fg{dz(){return this.wb(olympe.dm.BrickMetadata.Gc)}Kc(){return this.wb(olympe.dm.BrickMetadata.ba)}getType(){return this.wb(olympe.dm.BrickMetadata.Ub)}nz(){return this.mh(olympe.dm.BrickMetadata.vb)}ve(){return null}iy(){return this.cb(olympe.sc.ui.Ex.Comment.QE.$b(),olympe.sc.ui.Ex.Comment)}kl(){return this.vg(olympe.dm.BrickMetadata.Ha).Cc().kl()}};olympe.dm.BrickMetadata.O=kg(olympe.dc.na.j('01621fb84e3500000000',olympe.dm.BrickMetadata));
1077
+ olympe.dm.BrickMetadata.Gc=olympe.dm.BrickMetadata.O.ja('01621fb84e320000f001');olympe.dm.BrickMetadata.ba=olympe.dm.BrickMetadata.O.ja('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Ub=olympe.dm.BrickMetadata.O.ja('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.vb=olympe.dm.BrickMetadata.O.ja('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.Ha=olympe.dm.BrickMetadata.O.ra('0161ae97622bb21f335b');olympe.dm.BrickMetadata.ke={GC:'private',IC:'public'};
1078
+ olympe.dm.BrickMetadata.Tb={hB:'experimental',YC:'stable',VA:'deprecated'};olympe.dm.BrickMetadata.Md={HA:'business',tD:'technical'};m=olympe.dm.BrickMetadata.prototype;m.dz.K=olympe.C.J.D;m.Kc.K=olympe.C.J.D;m.getType.K=olympe.C.J.D;m.nz.K=olympe.C.J.N;m.ve.K=new olympe.C.J(()=>String,[]);m.iy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.kl.K=olympe.C.J.R;function wj(a,b){b=b.startsWith('data.')?b.substring(5):b;let c,d;return null!=(d=null!=(c=olympe.V.getParameter(`${'data.'}${a}.${b}`))?c:olympe.V.getParameter(`${'data.'}${b}`))?d:olympe.V.getParameter(`${olympe.dc.sources.Kh.Xv}${b}`)}
1079
+ function Qj(a,b){const c=a.query().bb(olympe.dm.Ad.j.$b()).bb(olympe.dm.Ad.D);a=a.query().bb(olympe.dm.hb.D.$b()).ug(olympe.dm.hb.F,!0).bb(olympe.sc.Ac.j.$b());const d=e=>e.me().ug(olympe.dc.CloudObject.extendRel,!0).bb(olympe.dc.CloudObject.Lj,!0).bb(olympe.dm.Relation.destinationModelRel).back(2).bb(olympe.dc.CloudObject.propertyRel,!0).bb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
1080
+ function qk(a,b){return a.observe(b,olympe.dm.DataSource.Ds).pipe(rxjs.operators.map(()=>a.Qf(olympe.dc.sources.Config.Ve)),rxjs.operators.distinctUntilChanged())}
1081
+ olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Jb=c;this.Fs=new Map([[olympe.dc.sources.Config.Qm,olympe.dm.DataSource.Vz],[olympe.dc.sources.Config.Ve,olympe.dm.DataSource.Ds],[olympe.dc.sources.Config.Xm,olympe.dm.DataSource.bA]])}T(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ia.SERVER:this.tag}Qf(a){const b=a.startsWith('data.')?a.split('.')[1]:a,c=`${'data.'}${b}`;let d,e;return null!=(e=null!=(d=olympe.V.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
1082
+ '_')}.${b}`))?d:wj(this.W(),a))?e:this.Fs.has(c)?this.get(this.Fs.get(c)):null}Kc(){const a=this;return u(function*(){const b=olympe.dm.DataSource.oc.ju,c=olympe.dm.DataSource.oc.Ab,d=new olympe.dc.Request(olympe.dc.Request.j.oc,a.T());return a.Jb.request(d).then(e=>{let f;const g=null!=(f=null==e?void 0:e.s)?f:c;(e=null==e?void 0:e.r)&&olympe.ga.Wa('dc').warn(`Source ${a.name()} (${a.T()}) has encountered issues: ${e}`);return g}).catch(e=>e instanceof olympe.error.Vk||e instanceof olympe.error.Hm?
1081
1083
  b:c)})}init(){const a=this;return u(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return u(function*(){})}healthCheck(){return u(function*(){})}executeQuery(a){return u(function*(){return olympe.dc.query.Dd.xj(a)})}applyTransaction(){return u(function*(){})}uploadFileContent(){return u(function*(){throw Error('Should not try to upload files with SELF source');})}downloadFileContent(){return u(function*(){throw Error('Should not try to download files with SELF source');
1082
1084
  })}deleteFileContent(){return u(function*(){})}};olympe.dm.DataSource.prototype.deleteFileContent=olympe.dm.DataSource.prototype.deleteFileContent;olympe.dm.DataSource.prototype.downloadFileContent=olympe.dm.DataSource.prototype.downloadFileContent;olympe.dm.DataSource.prototype.uploadFileContent=olympe.dm.DataSource.prototype.uploadFileContent;olympe.dm.DataSource.prototype.applyTransaction=olympe.dm.DataSource.prototype.applyTransaction;olympe.dm.DataSource.prototype.executeQuery=olympe.dm.DataSource.prototype.executeQuery;
1083
- olympe.dm.DataSource.prototype.healthCheck=olympe.dm.DataSource.prototype.healthCheck;olympe.dm.DataSource.prototype.destroy=olympe.dm.DataSource.prototype.destroy;olympe.dm.DataSource.prototype.init=olympe.dm.DataSource.prototype.init;olympe.dm.DataSource.prototype.getConfig=olympe.dm.DataSource.prototype.Of;olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.T;olympe.dm.DataSource.O=olympe.dc.na.j('ff021000000000000060',olympe.dm.DataSource,olympe.dc.P.Ug);
1084
- olympe.dm.DataSource.gi=olympe.dm.DataSource.O.ja('ff023000000000000060');w('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.gi);olympe.dm.DataSource.SE=olympe.dm.DataSource.O.ja('ff023000000000000061');olympe.dm.DataSource.Uz=olympe.dm.DataSource.O.ja('ff023000000000000062');olympe.dm.DataSource.Cs=olympe.dm.DataSource.O.ja('ff023000000000000063');olympe.dm.DataSource.Is=olympe.dm.DataSource.O.ja('ff023000000000000064');olympe.dm.DataSource.aA=olympe.dm.DataSource.O.ja('ff023000000000000065');
1085
- olympe.dm.DataSource.Mj=olympe.dm.DataSource.O.ra('ff022000000000000060');olympe.dm.DataSource.SERVER=dg('00000000000000000060','Server source');olympe.dm.DataSource.Ve={RB:'hybrid',zo:'bus',Qp:'http'};olympe.dm.DataSource.oc={Vh:'ready',Ab:'error',iu:'down',Df:'offline'};olympe.dm.Ad=class extends olympe.dc.CloudObject{};olympe.dm.Ad.O=olympe.dc.na.j('ff021000000000000070',olympe.dm.Ad);olympe.dm.Ad.j=olympe.dm.Ad.O.ra('ff023000000000000071');olympe.dm.Ad.D=olympe.dm.Ad.O.ra('ff023000000000000072');olympe.dm.Ad.F=olympe.dm.Ad.O.ra('ff023000000000000073');olympe.dm.Kb=class extends olympe.dm.BrickMetadata{H(){return new olympe.dc.Aa(this.W(),[new olympe.dc.aa.Ke(olympe.dm.Kb.j.W(),olympe.dc.ua.DESTINATION,olympe.dc.aa.Cr.Eu,olympe.dc.aa.Cr.Fu),olympe.dm.Kb.H])}ue(){return olympe.sc.we.Ne.ru}j(){return this.cb(olympe.dm.Kb.j,olympe.dm.Kb)}N(){return this.cb(olympe.dm.Kb.H)}};olympe.dm.Kb.O=olympe.dc.na.j('01612df1db9749227626',olympe.dm.Kb);olympe.dm.Kb.j=olympe.dm.Kb.O.ra('016a697ef00ce7554691');olympe.dm.Kb.ia=R(olympe.dm.Kb.O,olympe.dm.Kb.j);
1086
- olympe.dm.Kb.H=olympe.dm.Kb.O.ra('016a697ef00ce7554692');R(olympe.dc.CloudObject.O,olympe.dm.Kb.H);olympe.dm.Kb.prototype.H.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Kb.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Kb.prototype.N.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Pc=class extends olympe.dm.Kb{j(){return this.W()===olympe.dm.Pc.Z?this.cb(olympe.dm.Pc.N,olympe.dm.Kb):this.cb(olympe.dm.Pc.R,olympe.dm.Kb)}};olympe.dm.Pc.O=olympe.dc.na.j('ff021000000000000020',olympe.dm.Pc);olympe.dm.Pc.R=olympe.dm.Pc.O.ra('017e9c34cf48bd6965c1');olympe.dm.Pc.N=olympe.dm.Pc.O.ra('017e9c2e013e06bfffd9');olympe.dm.Pc.mi=olympe.dm.Pc.O.ra('01811f12ad77673770d4');olympe.dm.Pc.Z=dg('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Pc.vd=dg('10000000000000000001','OLYMPE_FOLDER');
1087
- olympe.dm.Pc.Qc=dg('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Pc.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{xy(){return this.vb(olympe.dm.Module.N)}Iy(){return this.xd(olympe.dm.Module.R)}av(){return this.vb(olympe.dm.Module.D)}My(){return this.vb(olympe.dm.Module.X)}iy(){return this.vb(olympe.dm.Module.F)}Jy(){return this.cb(olympe.dm.Module.H,olympe.dm.Module)}Uy(){return this.cb(olympe.dm.Module.j,olympe.dm.Pd)}};olympe.dm.Module.O=olympe.dc.na.j('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.N=olympe.dm.Module.O.ja('ff023000000000000042');
1085
+ olympe.dm.DataSource.prototype.healthCheck=olympe.dm.DataSource.prototype.healthCheck;olympe.dm.DataSource.prototype.destroy=olympe.dm.DataSource.prototype.destroy;olympe.dm.DataSource.prototype.init=olympe.dm.DataSource.prototype.init;olympe.dm.DataSource.prototype.getConfig=olympe.dm.DataSource.prototype.Qf;olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.T;olympe.dm.DataSource.O=olympe.dc.na.j('ff021000000000000060',olympe.dm.DataSource,olympe.dc.P.Ug);
1086
+ olympe.dm.DataSource.gi=olympe.dm.DataSource.O.ja('ff023000000000000060');w('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.gi);olympe.dm.DataSource.TE=olympe.dm.DataSource.O.ja('ff023000000000000061');olympe.dm.DataSource.Vz=olympe.dm.DataSource.O.ja('ff023000000000000062');olympe.dm.DataSource.Ds=olympe.dm.DataSource.O.ja('ff023000000000000063');olympe.dm.DataSource.Js=olympe.dm.DataSource.O.ja('ff023000000000000064');olympe.dm.DataSource.bA=olympe.dm.DataSource.O.ja('ff023000000000000065');
1087
+ olympe.dm.DataSource.Mj=olympe.dm.DataSource.O.ra('ff022000000000000060');olympe.dm.DataSource.SERVER=fg('00000000000000000060','Server source');olympe.dm.DataSource.Ve={SB:'hybrid',Ao:'bus',Rp:'http'};olympe.dm.DataSource.oc={Vh:'ready',Ab:'error',ju:'down',Ef:'offline'};olympe.dm.Ad=class extends olympe.dc.CloudObject{};olympe.dm.Ad.O=olympe.dc.na.j('ff021000000000000070',olympe.dm.Ad);olympe.dm.Ad.j=olympe.dm.Ad.O.ra('ff023000000000000071');olympe.dm.Ad.D=olympe.dm.Ad.O.ra('ff023000000000000072');olympe.dm.Ad.F=olympe.dm.Ad.O.ra('ff023000000000000073');olympe.dm.Kb=class extends olympe.dm.BrickMetadata{H(){return new olympe.dc.Aa(this.W(),[new olympe.dc.aa.Le(olympe.dm.Kb.j.W(),olympe.dc.ta.DESTINATION,olympe.dc.aa.Dr.Fu,olympe.dc.aa.Dr.Gu),olympe.dm.Kb.H])}ve(){return olympe.sc.xe.Oe.su}j(){return this.cb(olympe.dm.Kb.j,olympe.dm.Kb)}N(){return this.cb(olympe.dm.Kb.H)}};olympe.dm.Kb.O=olympe.dc.na.j('01612df1db9749227626',olympe.dm.Kb);olympe.dm.Kb.j=olympe.dm.Kb.O.ra('016a697ef00ce7554691');olympe.dm.Kb.ia=R(olympe.dm.Kb.O,olympe.dm.Kb.j);
1088
+ olympe.dm.Kb.H=olympe.dm.Kb.O.ra('016a697ef00ce7554692');R(olympe.dc.CloudObject.O,olympe.dm.Kb.H);olympe.dm.Kb.prototype.H.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Kb.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Kb.prototype.N.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Rc=class extends olympe.dm.Kb{j(){return this.W()===olympe.dm.Rc.Z?this.cb(olympe.dm.Rc.N,olympe.dm.Kb):this.cb(olympe.dm.Rc.R,olympe.dm.Kb)}};olympe.dm.Rc.O=olympe.dc.na.j('ff021000000000000020',olympe.dm.Rc);olympe.dm.Rc.R=olympe.dm.Rc.O.ra('017e9c34cf48bd6965c1');olympe.dm.Rc.N=olympe.dm.Rc.O.ra('017e9c2e013e06bfffd9');olympe.dm.Rc.mi=olympe.dm.Rc.O.ra('01811f12ad77673770d4');olympe.dm.Rc.Z=fg('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Rc.hd=fg('10000000000000000001','OLYMPE_FOLDER');
1089
+ olympe.dm.Rc.Hc=fg('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Rc.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{yy(){return this.wb(olympe.dm.Module.N)}Jy(){return this.xd(olympe.dm.Module.R)}bv(){return this.wb(olympe.dm.Module.D)}Ny(){return this.wb(olympe.dm.Module.X)}jy(){return this.wb(olympe.dm.Module.F)}Ky(){return this.cb(olympe.dm.Module.H,olympe.dm.Module)}Vy(){return this.cb(olympe.dm.Module.j,olympe.dm.Pd)}};olympe.dm.Module.O=olympe.dc.na.j('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.N=olympe.dm.Module.O.ja('ff023000000000000042');
1088
1090
  olympe.dm.Module.R=olympe.dm.Module.O.ja('ff023000000000000043');olympe.dm.Module.D=olympe.dm.Module.O.ja('ff023000000000000044');olympe.dm.Module.X=olympe.dm.Module.O.ja('ff023000000000000045');olympe.dm.Module.F=olympe.dm.Module.O.ja('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.O.ja('ff023000000000000049');olympe.dm.Module.j=olympe.dm.Module.O.ra('ff022000000000000013');olympe.dm.Module.H=olympe.dm.Module.O.ra('ff022000000000000014');
1089
- olympe.dm.Module.Z=dg('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.xy.K=olympe.C.J.D;m.Iy.K=olympe.C.J.F;m.av.K=olympe.C.J.D;m.My.K=olympe.C.J.D;m.iy.K=olympe.C.J.D;m.Jy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Uy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.File=class extends olympe.dc.CloudObject{static D(a,b,c,d,e,f,g){e=e||'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));g=null!=g?g:olympe.dc.ee().fromModel(a);a=b.create(a,f).yi(g);b=olympe.C.eb.now();X(X(X(X(X(X(a,olympe.dm.File.fileNameProp,null!=c?c:'file'),olympe.dm.File.urlProp,d),olympe.dm.File.creationDateProp,b),olympe.dm.File.modificationDateProp,b),olympe.dm.File.mimeTypeProp,e||'application/data'),olympe.dm.File.j,!1);return a.W()}constructor(a,b,c,d,e){super(a,
1090
- b);this.j=c;this.F=d;this.D=e}Us(){return this.vb(olympe.dm.File.mimeTypeProp)}gl(a,b){void 0===a&&void 0===b||olympe.ha.Xa('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Za().rc(a),d=b&&olympe.C.Za().rc(e=>null==b?void 0:b(`${e}`));return this.j.H(this).then(e=>{e=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}Cn(a,b){void 0===a&&
1091
- void 0===b||olympe.ha.Xa('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Za().rc(a),d=b&&olympe.C.Za().rc(e=>null==b?void 0:b(`${e}`));return this.gl().then(e=>{e=bb(e);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}hl(a,b){void 0===a&&void 0===b||olympe.ha.Xa('File.getContentUrl').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&
1091
+ olympe.dm.Module.Z=fg('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.yy.K=olympe.C.J.D;m.Jy.K=olympe.C.J.F;m.bv.K=olympe.C.J.D;m.Ny.K=olympe.C.J.D;m.jy.K=olympe.C.J.D;m.Ky.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Vy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.File=class extends olympe.dc.CloudObject{static D(a,b,c,d,e,f,g){e=e||'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));g=null!=g?g:olympe.dc.ee().fromModel(a);a=b.create(a,f).yi(g);b=olympe.C.eb.now();X(X(X(X(X(X(a,olympe.dm.File.fileNameProp,null!=c?c:'file'),olympe.dm.File.urlProp,d),olympe.dm.File.creationDateProp,b),olympe.dm.File.modificationDateProp,b),olympe.dm.File.mimeTypeProp,e||'application/data'),olympe.dm.File.j,!1);return a.W()}constructor(a,b,c,d,e){super(a,
1092
+ b);this.j=c;this.F=d;this.D=e}Vs(){return this.wb(olympe.dm.File.mimeTypeProp)}gl(a,b){void 0===a&&void 0===b||olympe.ga.Wa('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Za().rc(a),d=b&&olympe.C.Za().rc(e=>null==b?void 0:b(`${e}`));return this.j.H(this).then(e=>{e=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}Fn(a,b){void 0===a&&
1093
+ void 0===b||olympe.ga.Wa('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Za().rc(a),d=b&&olympe.C.Za().rc(e=>null==b?void 0:b(`${e}`));return this.gl().then(e=>{e=bb(e);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}hl(a,b){void 0===a&&void 0===b||olympe.ga.Wa('File.getContentUrl').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&
1092
1094
  olympe.C.Za().rc(a),d=b&&olympe.C.Za().rc(g=>null==b?void 0:b(`${g}`));a=this.get(olympe.dm.File.j);const e=this.get(olympe.dm.File.urlProp),f=this.get(olympe.dm.File.mimeTypeProp);if(a||(null==e?0:e.startsWith('blob:'))||(null==e?0:e.startsWith('stream:')))return this.j.H(this).then(g=>{g=`data:${f};base64,${this.D.j(g)}`;null==c||c(g);return g}).catch(g=>{null==d||d(g.message);throw g;});if('string'===typeof e)return null==c||c(e),Promise.resolve(e);a=`No content nor URL associated to the file ${this.W()}`;
1093
- null==d||d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.C.Za().rc(b);olympe.C.nt([a],d=>{const e=new olympe.dc.Ya;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.lb(f=>{c&&c(f)})})}tt(a){this.get(olympe.dm.File.urlProp).startsWith('stream:')?this.j.X(this.tag).then(()=>this.tt(a)).catch(b=>this.G.error(`Error while getting the content of a streamed file: ${b}`)):this.F.H(this.get(olympe.dm.File.mimeTypeProp))}nq(){return this.vb(olympe.dm.File.urlProp)}mq(){return this.vb(olympe.dm.File.fileNameProp)}my(){return this.Dj(olympe.dm.File.creationDateProp)}Hy(){return this.Dj(olympe.dm.File.modificationDateProp)}lz(){return this.mh(olympe.dm.File.j)}};
1094
- olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.tt;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.hl;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Cn;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.gl;olympe.dm.File.O=olympe.dc.na.j('ff021000000000000030',olympe.dm.File,olympe.dc.P.hk,olympe.net.P.Fa,olympe.U.P.Dg);olympe.dm.File.nameProp=olympe.dm.File.O.ja('ff023000000000000050');w('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
1095
+ null==d||d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.C.Za().rc(b);olympe.C.nt([a],d=>{const e=new olympe.dc.Ya;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.mb(f=>{c&&c(f)})})}tt(a){this.get(olympe.dm.File.urlProp).startsWith('stream:')?this.j.X(this.tag).then(()=>this.tt(a)).catch(b=>this.G.error(`Error while getting the content of a streamed file: ${b}`)):this.F.H(this.get(olympe.dm.File.mimeTypeProp))}oq(){return this.wb(olympe.dm.File.urlProp)}nq(){return this.wb(olympe.dm.File.fileNameProp)}ny(){return this.Dj(olympe.dm.File.creationDateProp)}Iy(){return this.Dj(olympe.dm.File.modificationDateProp)}mz(){return this.mh(olympe.dm.File.j)}};
1096
+ olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.tt;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.hl;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Fn;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.gl;olympe.dm.File.O=olympe.dc.na.j('ff021000000000000030',olympe.dm.File,olympe.dc.P.hk,olympe.net.P.Fa,olympe.U.P.Dg);olympe.dm.File.nameProp=olympe.dm.File.O.ja('ff023000000000000050');w('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
1095
1097
  olympe.dm.File.fileNameProp=olympe.dm.File.O.ja('ff023000000000000050');w('olympe.dm.File.fileNameProp',olympe.dm.File.fileNameProp);olympe.dm.File.creationDateProp=olympe.dm.File.O.ja('ff023000000000000051');w('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.O.ja('ff023000000000000055');w('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.O.ja('ff023000000000000052');
1096
- w('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.O.ja('ff023000000000000053');w('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.j=olympe.dm.File.O.ja('ff023000000000000054');olympe.dm.File.O.j=olympe.dm.File.D.bind(null,olympe.dm.File);olympe.dm.File.N='application/data';olympe.dm.File.ya=[olympe.C.File];m=olympe.dm.File.prototype;m.Us.K=olympe.C.J.D;m.gl.K=olympe.C.J.j;m.Cn.K=olympe.C.J.j;m.hl.K=olympe.C.J.j;m.rename.K=olympe.C.J.j;
1097
- m.nq.K=olympe.C.J.D;m.mq.K=olympe.C.J.D;m.my.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Hy.K=new olympe.C.J(()=>olympe.C.eb,[]);m.lz.K=olympe.C.J.N;olympe.dm.Pd=class extends olympe.dc.CloudObject{j(){return this.vb(olympe.dm.Pd.D)}F(){return this.xd(olympe.dm.Pd.F)}D(){return this.cb(olympe.dm.Pd.j,olympe.dm.Module)}};olympe.dm.Pd.O=olympe.dc.na.j('ff021000000000000041',olympe.dm.Pd);olympe.dm.Pd.D=olympe.dm.Pd.O.ja('ff023000000000000047');olympe.dm.Pd.F=olympe.dm.Pd.O.ja('ff023000000000000048');olympe.dm.Pd.j=olympe.dm.Module.j.$b();olympe.dm.Pd.prototype.j.K=olympe.C.J.D;olympe.dm.Pd.prototype.F.K=olympe.C.J.F;
1098
- olympe.dm.Pd.prototype.D.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.hb=class extends olympe.dm.Pc{j(){return this.cb(olympe.dm.Kb.j,olympe.dm.Kb)}F(){return this.vb(olympe.dm.hb.X)}R(){return this.vb(olympe.dm.hb.nb)}D(){return this.cb(olympe.dm.hb.F,olympe.dm.hb)}};olympe.dm.hb.O=olympe.dc.na.j('0163d9594700fcf61e54',olympe.dm.hb);olympe.dm.hb.X=olympe.dm.hb.O.ja('017869c7d2833c9492c1');olympe.dm.hb.ht=olympe.dm.hb.O.ja('017869c7d2833c9492c2');olympe.dm.hb.Pe=olympe.dm.hb.O.ja('017869c7d2833c9492c3');olympe.dm.hb.nb=olympe.dm.hb.O.ja('017869c80bb9929c76d0');
1099
- olympe.dm.hb.Wa=olympe.dm.hb.O.ra('ff02200000000000002a');olympe.dm.hb.F=olympe.dm.hb.O.ra('ff02200000000000002b');olympe.dm.hb.sg=R(olympe.dm.hb.O,olympe.dm.hb.F);olympe.dm.hb.D=olympe.dm.hb.O.ra('ff02200000000000002c');olympe.dm.hb.tg=olympe.dm.hb.O.ra('017e9c412e2b944bc48f');olympe.dm.hb.ef=olympe.dm.hb.O.ra('017e9c412e2b944bd590');olympe.dm.hb.bt=olympe.dm.hb.O.ra('017e9c416872a89d3415');olympe.dm.hb.$s=olympe.dm.hb.O.ra('017ebf8fe5c506662098');R(olympe.dc.CloudObject.O,olympe.dm.hb.Wa);
1100
- olympe.dm.hb.Fd=dg('100000000000000000dd','PRIMORDIAL');olympe.dm.hb.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.hb.prototype.F.K=olympe.C.J.D;olympe.dm.hb.prototype.R.K=olympe.C.J.D;olympe.dm.hb.prototype.D.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{j(){return this.Sc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Sc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}D(){return this.vg(olympe.dm.Property.typeRel).Cc()}Wc(){return this.j().ka().Ds(this.ka())}};olympe.dm.Property.O=olympe.dc.na.j('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.propertyRel);
1101
- w('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);w('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.D.K=olympe.C.J.j;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Dy(){return olympe.C.Sa.EMPTY}by(){return this.xd(olympe.dm.Relation.D)}Ny(){return this.xd(olympe.dm.Relation.F)}Ns(){return this.cb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Ic()}Ws(){return this.cb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Ic()}Wc(){return this.Ws().ka().concat(['-',this.ka(),'->',this.Ns().ka()])}};olympe.dm.Relation.O=olympe.dc.na.j('ff021000000000000006',olympe.dm.Relation);
1102
- olympe.dm.Relation.F=olympe.dm.Relation.O.ja('ff023000000000000030');olympe.dm.Relation.D=olympe.dm.Relation.O.ja('ff023000000000000034');olympe.dm.Relation.da=olympe.dm.Relation.O.ja(olympe.dc.Lb.gp);olympe.dm.Relation.X=olympe.dm.Relation.O.ja(olympe.dc.Lb.Dc);olympe.dm.Relation.ia=olympe.dm.Relation.O.ja(olympe.dc.Lb.jg);olympe.dm.Relation.sa=olympe.dm.Relation.O.ja(olympe.dc.Lb.xw);olympe.dm.Relation.Z=olympe.dm.Relation.O.ja(olympe.dc.Lb.ju);olympe.dm.Relation.Ha=olympe.dm.Relation.O.ja(olympe.dc.Lb.Uw);
1103
- olympe.dm.Relation.R=olympe.dm.Relation.O.ja('ff023000000000000031');olympe.dm.Relation.originModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Lj);w('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Hs);w('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.j={Wp:0,Ot:5,gw:1,RC:4,ds:2,xr:8,fB:10,OC:6,PC:9,Xe:6,QC:9};
1104
- olympe.dm.Relation.H={sC:3,Nv:4,dC:5,cC:6};olympe.dm.Relation.N=olympe.dm.Dl.Pv+olympe.dm.Dl.fu;m=olympe.dm.Relation.prototype;m.Dy.K=olympe.C.J.D;m.by.K=olympe.C.J.F;m.Ny.K=olympe.C.J.F;m.Ns.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Ws.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);function jn(a){a=olympe.dc.ea(a);if(olympe.dc.ga().Tf(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.O.W():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.O.W():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.O.W():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.O.W():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.Ie=class extends olympe.dc.CloudObject{getValue(){}};
1105
- olympe.dm.Ie.O=olympe.dc.na.j('ff021000000000000019',olympe.dm.Ie);olympe.dm.String=class extends olympe.dm.Ie{getValue(){return this.vb(olympe.dm.String.valueProp)}tc(){return this.get(olympe.dm.String.valueProp)}toString(){let a;return null!=(a=this.get(olympe.dm.String.valueProp))?a:''}};olympe.dm.String.O=olympe.dc.na.j('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.O.ja('ff023000000000000026');w('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.C.J.D;
1106
- olympe.dm.String.prototype.toString.K=olympe.C.J.j;olympe.dm.Boolean=class extends olympe.dm.Ie{getValue(){return this.mh(olympe.dm.Boolean.valueProp)}tc(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.O=olympe.dc.na.j('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.O.ja('ff023000000000000027');w('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.C.J.N;olympe.dm.Color=class extends olympe.dm.Ie{getValue(){return this.Xs()}tc(){return this.get(olympe.dm.Color.valueProp)}};olympe.dm.Color.O=olympe.dc.na.j('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.O.ja('ff023000000000000032');w('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.C.J(()=>olympe.C.Color,[]);olympe.dm.DateTime=class extends olympe.dm.Ie{getValue(){return this.Dj(olympe.dm.DateTime.valueProp)}tc(){return this.get(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.O=olympe.dc.na.j('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.O.ja('ff023000000000000029');w('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.C.J(()=>olympe.C.eb,[]);olympe.dm.Enum=class extends olympe.dm.String{ka(){return olympe.C.ta([super.ka(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Sa)}Hd(){return this.xd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.O=olympe.dc.na.j('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.ja('017a7690c915975ea995');olympe.dm.Enum.prototype.Hd.K=olympe.C.J.F;olympe.dm.fg=class extends olympe.dm.BrickMetadata{az(){return this.bb(olympe.dc.CloudObject.instancesRel).xl(olympe.dm.Enum.rankProp,olympe.dc.query.Bk.ASC).Cc()}static create(a,b){b=a.create(olympe.dm.fg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.fg.create=olympe.dm.fg.create;olympe.dm.fg.prototype.getValues=olympe.dm.fg.prototype.az;olympe.dm.fg.O=olympe.dc.na.j('017a768f966fc08ebb98',olympe.dm.fg);olympe.dm.Number=class extends olympe.dm.Ie{getValue(){return this.xd(olympe.dm.Number.valueProp)}tc(){return this.get(olympe.dm.Number.valueProp)}};olympe.dm.Number.O=olympe.dc.na.j('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.O.ja('ff023000000000000028');w('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.C.J.F;olympe.sc={};olympe.sc.P={Ca:'sc.Logger',Kk:'sc.RootContext',Le:'sc.Serializer'};olympe.sc.Config={ye:'sc.app',ag:'sc.debug',ko:'sc.autostartProfiler',cp:'sc.debugger',gu:'sc.disableTheme',PRODUCTION:'sc.production',Ov:'sc.onstartTimeout',sr:'sc.remoteActionTimeout'};
1107
- olympe.V.config(a=>{E(a,olympe.sc.Config.ye,'');E(a,olympe.sc.Config.ag,!1);E(a,olympe.sc.Config.gu,!0);E(a,olympe.sc.Config.PRODUCTION,!1);E(a,olympe.sc.Config.Ov,2E4);E(a,olympe.sc.Config.sr,3E4);E(a,olympe.sc.Config.ko,!1);D(a,olympe.sc.P.Ca,[olympe.ha.P.Fa],b=>b.ad('sc'));C(a,olympe.sc.P.Le,olympe.sc.cc,olympe.dc.db.P.Fa);Wa(a,olympe.dc.sources.P.Le,olympe.sc.P.Le);D(a,olympe.sc.P.Kk,[new olympe.V.oa(olympe.sc.Config.PRODUCTION)],b=>{const c=new olympe.sc.Fg('root','root',null);olympe.sc.Un=c;
1108
- c.set(olympe.sc.xa.j.PRODUCTION,b);return new olympe.sc.xa(c)})},'olympe.sc');olympe.V.run([olympe.sc.P.Kk,new olympe.V.oa(olympe.L.Config.Ol)],(a,b)=>{olympe.de().ctx=a;olympe.de().oVersion=()=>b});olympe.sc.On=()=>null!==olympe.dc.ga().Ib(void 0,olympe.sc.Runnable.j.$b());olympe.sc.QE=(a,b,c,d)=>{c=X(X(a.create(olympe.sc.gd),olympe.sc.gd.j,c||null),olympe.sc.gd.F,d||null);a.Oa(olympe.sc.gd.D,c,b);a.Oa(olympe.dc.CloudObject.containsRel,b,c);return c.W()};olympe.sc.tj=(a,b)=>{a=olympe.dc.ib.ey(b)(a);return a instanceof olympe.sc.Td?a.j():a};
1109
- olympe.sc.hF=function(a){const b=olympe.dc.CloudObject.containsRel.$b();var c=olympe.dc.ea(a);if(void 0===c)return[];a=olympe.dc.ga();const d=[];let e=[];const f=new Set;for(;!a.Nb(c,olympe.dm.Kb);){f.add(c);const g=a.Ib(c,b);if(null===g)return olympe.ha.Xa('sc').warn(`Object ${c} has no container`),[];a.Nb(c,olympe.sc.logic.pb)||g===a.Ib(c,olympe.sc.Runnable.j.$b())||d.push(c);c=g;if(f.has(c))throw Error(`Instance ${c} (${a.name(c)}) is part of a cyclic contain pattern`);}e.push(c);e=e.concat(a.nh(e[0],
1110
- olympe.dm.Kb.ia));e=e.concat(a.nh(e[e.length-1],olympe.dm.Pc.R.$b()));e=e.concat(a.nh(e[e.length-1],olympe.dm.Pc.N.$b()));return[...d,...e].reverse()};olympe.sc.iF=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Kg:a.startsWith('video/')?olympe.sc.bi:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Nc:olympe.dm.File};
1111
- olympe.sc.gF=a=>a instanceof olympe.sc.Kg?'image/*':a instanceof olympe.sc.bi?'video/*':a instanceof olympe.sc.Nc?'font/*,application/font-woff':null;olympe.sc.$a={};function kn(a,b){var c=olympe.sc.xa,d=a.state;a=a.Cb();b=olympe.dc.ea(b);let e,f=null==(e=d.j)?void 0:e.get(b);if(!f){f=d.ji(a,void 0,b);for(d=f.getParent();d&&d.ia&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||ln(g,b,f)}return new c(f)}function mn(a,b){let c,d;return(a=null!=(d=null==(c=a.state.j)?void 0:c.get(olympe.dc.ea(b)))?d:null)?new olympe.sc.xa(a):null}function nn(a){let b;return null!=(b=a.Qa(olympe.sc.xa.j.PRODUCTION))?b:!1}
1112
- olympe.sc.xa=class{constructor(a=olympe.sc.Un){this.state=a;this.G=olympe.ha.Xa('sc');this.j=null}T(){return this.state.T()}getParent(){if(null===this.j){const a=this.state.getParent();this.j=null===a?null:new olympe.sc.xa(a)}return this.j}gy(a){const b=olympe.dc.ga();let c=this.getParent();if(!c)return this;const d=e=>{e=e.kf();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Pa(f,olympe.sc.Ua.Z)||a.modelTag&&!b.Nb(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;
1113
- c=e}return c}kf(){return this.state.kf()}Cb(){return this.state.Cb()}set(a,b){this.state.set(a,b);return this}eo(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}tb(a,b,c=!1){const d=olympe.dc.ea(a),e=olympe.C.bc(null!=b?b:Object,`Get context value flow source of ${d}`);e.getContext().onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.state.T():void 0));return e.tb()}get(a,b=!1){a=this.Qa(a,b);return void 0!==a?a:null}has(a,b=!1){return this.state.has(a,b)}observe(a,b=!0,c=
1114
- !1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.state.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=on(this.state,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.vh(a.unsubscribe.bind(a));return this}cA(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.ji(`Runner ${a.name()}`);a.run(b);return b}Dt(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,
1115
- b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.ea(a)})\``+`on the context ${this.T()}:\nStack: ${this.re()}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.T()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.ea(a)})\` `+`has never received any value:\nStack: ${this.re()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;
1116
- const d=(null==(c=a.re)?void 0:c.call(a))||this.re();let e,f;c=null!=(f=null==(e=a.Aj)?void 0:e.call(a))?f:0;b=pn(b,c,d);b.stack=a.stack}else b=pn(b,0,this.re());qn(this.state,b);return this}dA(a){this.set(olympe.sc.xa.j.Eg,a);return this}Qa(a,b=!0){return this.state.Qa(a,b)}on(a,b,c,d=!0){return this.state.on(a,b,c,d)}ji(a){return new olympe.sc.xa(this.state.ji(this.Cb(),a))}ul(a,b){return this.state.ul(a,c=>{b(new olympe.sc.xa(c))})}Ly(a){a=rn(this.state,a);return a===this.state?this:a&&new olympe.sc.xa(a)}destroy(){this.state.destroy()}vh(a,
1117
- b){return this.state.vh(a,b)}sl(a){this.state.sl(a)}onDestroy(a){return this.fb()?(a(),'noId'):this.Cb().onDestroy(a)}Wf(a){this.fb()||this.Cb().Wf(a)}clear(){this.state.clear()}fb(){return this.Cb().fb()||this.Cb().hd()}Pa(a){a=sn(this.state,a);return null!==a?new olympe.sc.ui.NA(a,this):null}wy(a){a=sn(this.state,a);return null!==a?new olympe.sc.ui.MA(a,this):null}Gz(...a){return rxjs.combineLatest(a.map(b=>{b=sn(this.state,b);return null!==b?this.observe(b):rxjs.of(null)}))}Ea(a){return(null==
1118
- a?void 0:a.constructor)!==this.constructor?!1:this.state===a.state}re(){const a=olympe.dc.ga();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.state!==olympe.sc.Un;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.kf();return null!==f?(e=a.model(f),`${a.name(f)||e&&a.name(e)||f} (${e})`):e.T()}).join('\n> ')}catch(c){b=`No stack available for context ${this.T()}: ${c}`,this.G.warn(b)}return b}};olympe.sc.xa.prototype.observeMany=olympe.sc.xa.prototype.Gz;
1119
- olympe.sc.xa.prototype.getEvent=olympe.sc.xa.prototype.wy;olympe.sc.xa.prototype.getProperty=olympe.sc.xa.prototype.Pa;olympe.sc.xa.prototype.isDestroyed=olympe.sc.xa.prototype.fb;olympe.sc.xa.prototype.clear=olympe.sc.xa.prototype.clear;olympe.sc.xa.prototype.offDestroy=olympe.sc.xa.prototype.Wf;olympe.sc.xa.prototype.onDestroy=olympe.sc.xa.prototype.onDestroy;olympe.sc.xa.prototype.offClear=olympe.sc.xa.prototype.sl;olympe.sc.xa.prototype.onClear=olympe.sc.xa.prototype.vh;
1120
- olympe.sc.xa.prototype.destroy=olympe.sc.xa.prototype.destroy;olympe.sc.xa.prototype.getOtherContext=olympe.sc.xa.prototype.Ly;olympe.sc.xa.prototype.onContext=olympe.sc.xa.prototype.ul;olympe.sc.xa.prototype.createChild=olympe.sc.xa.prototype.ji;olympe.sc.xa.prototype.setParentElement=olympe.sc.xa.prototype.dA;olympe.sc.xa.prototype['throw']=olympe.sc.xa.prototype.throw;olympe.sc.xa.prototype.waitFor=olympe.sc.xa.prototype.Dt;olympe.sc.xa.prototype.runner=olympe.sc.xa.prototype.cA;
1121
- olympe.sc.xa.prototype.repeat=olympe.sc.xa.prototype.repeat;olympe.sc.xa.prototype.observe=olympe.sc.xa.prototype.observe;olympe.sc.xa.prototype.has=olympe.sc.xa.prototype.has;olympe.sc.xa.prototype.get=olympe.sc.xa.prototype.get;olympe.sc.xa.prototype.remove=olympe.sc.xa.prototype.remove;olympe.sc.xa.prototype.trigger=olympe.sc.xa.prototype.eo;olympe.sc.xa.prototype.set=olympe.sc.xa.prototype.set;olympe.sc.xa.prototype.getClosest=olympe.sc.xa.prototype.gy;olympe.sc.xa.prototype.getParent=olympe.sc.xa.prototype.getParent;
1122
- olympe.sc.xa.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',REDELIVERED:'__redelivered',Eg:'__htmlContainer',aB:'__dockableElement',io:'__appHasStarted'};olympe.sc.Yw=class extends olympe.sc.xa{constructor(a){super(a);this.D=new olympe.C.Wb('SC Update Context',super.Cb());const b=a.vh(()=>{b&&a.sl(b);this.D.destroy()})}Cb(){return this.D}vh(a,b){return this.Cb().onDestroy(a,null!=b?b:olympe.U.Kc())}};let tn=0;function on(a,b){b=olympe.dc.ea(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.Z)?void 0:c.get('I#'+b))?e:null==(d=a.Z)?void 0:d.get('IO#'+b))?f:b}function qn(a,b){if(null===a.H)a.G.error(`An error occurred in a brick: ${b.toString()}`);else if(a.da&&olympe.dc.ga().Ja(a.da)){var c=un(olympe.dc.CloudObject.get(a.da));null!==c&&vn(a,c).some(d=>{let e,f;return 0<(null==(e=a.F)?void 0:null==(f=e.get(d))?void 0:f.size)})&&!a.N.has('$'+c)?a.set(c,b):qn(a.H,b)}else qn(a.H,b)}
1123
- function rn(a,b){if(b===a.id||a.R.has(b)||!b)return a;for(a=a.H;a;){if(b===a.T()||a.R.has(b))return a;const c=wn(a.j,b);if(c)return c;a=a.getParent()}return null}function xn(a,b,c=0){null===a.$a&&(a.$a=new Map);a.$a.has(b.T())||(a.$a.set(b.T(),{vl:b,depth:c}),yn(a,d=>{(-1===b.F||c<b.F)&&xn(d,b,c+1)}),a.onDestroy(()=>{zn(a,b.T())}));return b.T()}
1124
- function zn(a,b){if(null===a.$a||!a.$a.has(b))return!1;const {vl:c,depth:d}=a.$a.get(b);yn(a,f=>{zn(f,b)});0===d&&c.D();const e=a.$a.delete(b);0===a.$a.size&&(a.$a=null);return e}function sn(a,b){let c;return(null==(c=a.Z)?void 0:c.get('IO#'+b))||null}
1125
- function An(a){a.D.Xd(()=>{yn(a,c=>c.destroy())});a.D.onDestroy(()=>{void 0!==a.Qa(olympe.sc.xa.j.TRANSACTION,!1)&&a.G.warn(`The context ${a.T()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);a.clear();let c;if(null!=(c=a.H)){let d;null==(d=c.j)||d.delete(a.T());let e;0===(null==(e=c.j)?void 0:e.size)&&(c.j=null)}a.R.clear()});let b;null==(b=a.H)||Bn(b,a)}
1126
- function wn(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ia&&!c.id.startsWith('_')&&(a=wn(c.j,b)))return a;return null}function Cn(a,b,...c){if(null!==a.$a)for(const {vl:d,depth:e}of a.$a.values())d.process(a,b,e,...c)}function Dn(a,b){a.da=olympe.dc.ea(b);a.ia=b.wd().On();b.H().forEach(c=>{a.id===c||a.R.has(c)||(a.R.add(c),ln(a,c,a))});a.Z=b.D();Cn(a,olympe.sc.$a.pc.j.INIT)}function En(a){a.sa=!0;let b;null==(b=a.j)||b.forEach(c=>{En(c)})}
1127
- function Fn(a){a.sa=!1;let b;null==(b=a.j)||b.forEach(c=>{Fn(c)})}function vn(a,b){return['*',a.id,...a.R].map(c=>`${'@'}${c}.${b}`)}function Gn(a,b,c,d){c.forEach(f=>{let g,h;null==(g=a.F)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});let e;null==(e=a.j)||e.forEach(f=>{!f.sa&&f.data.has(b)||Gn(f,b,c,d)})}function Hn(a,b,c){a.F||(a.F=new Map);let d=a.F.get(b);void 0===d&&(d=new Map,a.F.set(b,d));tn++;const e=tn;d.set(e,c);return()=>{const f=a.F.get(b);f&&(f.delete(e),0===f.size&&a.F.delete(b))}}
1128
- function ln(a,b,c){a.N.add(b);let d,e;null==(d=a.F)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});yn(a,f=>{f.N.has(b)||ln(f,b,c)});a.N.delete(b)}function yn(a,b){let c;null==(c=a.j)||c.forEach(b)}function In(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function Jn(a){var b=olympe.sc.$a.pc.D.Ze;const c=[];if(null!==a.$a)for(const {vl:d}of a.$a.values())d.getType()===b&&(c.push(d.T()),d.D(),zn(a,d.T()))}function Bn(a,b){null===a.j&&(a.j=new Map);a.j.set(b.id,b)}
1129
- olympe.sc.Fg=class{constructor(a,b='no name',c=olympe.sc.Un){this.id=a;this.$c=b;this.R=new Set;this.H=c;this.D=new olympe.C.Wb('SC Context');this.data=new Map;this.da=this.X=this.j=this.F=null;this.ia=!1;this.N=new Set;this.sa=!1;this.Z=null;this.G=olympe.ha.Xa('sc');this.$a=null;An(this)}T(){return this.id}getParent(){return this.H}kf(){return this.da}set(a,b){if(!this.D.hd()&&!this.D.fb()){const g=olympe.dc.ea(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.Z)?void 0:c.get('O#'+g))?h:null==
1130
- (d=this.Z)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.N.has(c)){a:{if('function'===typeof(null==b?void 0:b.Ea))try{var f=b.Ea(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.$a&&0<this.$a.size&&Cn(this,olympe.sc.$a.pc.j.Yg,a,b),f=vn(this,a),this.N.add(c),Gn(this,c,f,b),this.N.delete(c))}}on(a,b,c,d=!0){if(this.D.fb()||this.D.hd())return()=>{};const e=on(this,a),f=c?olympe.dc.ea(c):
1131
- '*';a=Hn(this,'@'+f+'.'+e,b);c=c?(c=rn(this,f))?c.Qa(e,!1):void 0:this.Qa(e);void 0!==c&&b(c);if(d)olympe.C.Za().onDestroy(a);return a}has(a,b=!1){a='$'+on(this,a);let c=this.data.has(a),d=this.getParent();if(b)for(;!c&&d;)c=d.data.has(a),d=d.getParent();return c}ji(a,b,c){const d=null!=c?c:'_'+olympe.U.Kc();if(a.fb()||a.hd())throw Error(`Try to create new child context in a destroyed context ${a.T()}, probably because \`runner()\` is called on a destroyed context`);const e=a.run(()=>new olympe.sc.Fg(d,
1132
- b,this));null!==this.$a&&0<this.$a.size&&this.$a.forEach(({vl:f,depth:g})=>{(-1===f.F||g<f.F)&&xn(e,f,g+1)});return e}ul(a,b){const c=rn(this,a);if(c)return b(c),()=>{};const d=Hn(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Qa(a,b=!0){a='$'+on(this,a);let c=this.data.get(a),d=this.getParent();if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.getParent();return c}destroy(){this.D.hd()||this.D.fb()||(Cn(this,olympe.sc.$a.pc.j.dk),this.D.destroy(),Cn(this,olympe.sc.$a.pc.j.Zd))}vh(a,b){if(this.D.fb())a();
1133
- else return tn++,b=null!=b?b:String(tn),null===this.X&&(this.X=new Map),this.X.set(b,a),b;return b||'noId'}sl(a){null!==this.X&&this.X.delete(a)}onDestroy(a){return this.fb()?(a(),'noId'):this.D.onDestroy(a)}clear(){if(!this.D.fb()){Cn(this,olympe.sc.$a.pc.j.Xj);let a;null==(a=this.X)||a.forEach(b=>b());Cn(this,olympe.sc.$a.pc.j.Yj)}}fb(){return this.D.fb()}Cb(){return this.D}};olympe.sc.Fg.prototype.getParent=olympe.sc.Fg.prototype.getParent;olympe.sc.Fg.j={qm:'I#',Im:'O#',UB:'IO#'};function Kn(a,b,c){return(c=c.kf())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.$a.pc=class{constructor(a=-1){this.id=olympe.U.hf();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.$a.pc.j={INIT:'INIT',Yg:'SET',Xj:'CLEAR',Yj:'CLEARED',dk:'DESTROY',Zd:'DESTROYED'};olympe.sc.$a.pc.D={Ze:'REMOTE',rv:'LOCAL',ig:'PROFILER'};olympe.sc.$d=class a{constructor(){this.D=this.H=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.U.cn(1E4);gb(this.j,b=>{Jn(b)})}Z(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.$d.j.Tv:c=this.F.get(e.f);b.cd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.$d.j.Uv:const h=f+c,k=(l,n,p=0)=>{In(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.F(q):t=q;let v;q=null!=(v=l.kf())?v:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
1134
- t])})};b.Rn(h).then(()=>{const l=[];k(g,l,0);yn(g,p=>{k(p,l,1)});olympe.L.qb.kd(h,{t:olympe.sc.$d.j.Iu,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.$a.jw(h);xn(g,n);this.j.has(g)?fb(this.j,g):this.j.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.$d.j.Vv:void 0!==g&&this.j.has(g)&&fb(this.j,g);break;case olympe.sc.$d.j.Eh:void 0!==g&&(this.j.delete(g),Jn(g))}}da(b,c,d){this.N=new olympe.L.qb('discovery_debug_id',
1135
- c);this.N.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.$d.j.hu){e=f.i;f=f.f;if(!this.F.has(f)){const g=this.X(f,c,b);if(0!==g.length)this.F.set(f,g);else return}null===this.D&&(this.D=olympe.U.hf(),f=new olympe.C.Wb(this.D,c.Cb()),this.H=new olympe.L.qb(this.D,f),this.H.listen().subscribe(g=>{this.Z(g,b,d)}));olympe.L.qb.kd(e,{t:olympe.sc.$d.j.Et,n:olympe.V.getParameter(olympe.sc.Config.cp)||'no name',a:b,s:this.D}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}X(b,c,
1136
- d){const e=[],f=olympe.dc.ga(),g=(h,k)=>{yn(h,l=>{if(null!==l.kf()){const n=olympe.dc.CloudObject.get(l.kf()).vg(olympe.sc.Runnable.D).Cc();if(null!==n){const p=k+'/'+f.name(n);n.W()===b&&(e.push([p,l.T()]),this.R.set(l.T(),l));g(l,p)}}})};g(c.state,f.name(d));return e}static D(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.F(d));olympe.L.qb.kd(b,{t:olympe.sc.$d.j.Xk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ha.Xa('Debugger').error('Error publishing on service : ',f)})}static F(b){if(null===
1137
- b||void 0===b)return'<null>';const c=olympe.dc.ga();if(b instanceof olympe.dc.CloudObject){var d=b.Vb();if(!c.Nb(d,olympe.sc.Ac))return b.toString();let f=`${b.Ub().name()} (${b.W()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.la.from(e).ug(olympe.dc.CloudObject.extendRel,!0).me().bb(olympe.dc.CloudObject.propertyRel).me().Cc();e=olympe.dc.la.from(e).ug(olympe.dc.CloudObject.extendRel,!0).me().bb(olympe.dc.CloudObject.Lj).me().Cc();d=d.filter(([g])=>g instanceof olympe.sc.Ac);0!==d.length&&(f+=
1138
- '<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Pa(b.W(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.Ac);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.$d.H='discovery_debug_id';olympe.sc.$d.j={hu:0,Et:1,Tv:2,Uv:3,Iu:4,Xk:5,Vv:6,Eh:7};olympe.sc.$a.bC=class extends olympe.sc.$a.pc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.$a.pc.D.rv}process(a,b,c,...d){if(this.active&&b===olympe.sc.$a.pc.j.Yg){a=Kn(c,on(a,d[0]),a);d=d[1];let e;null==(e=this.j.get(a))||e(d)}}on(a,b){this.j.set(a,b)}};function Ln(a,b,c,d=new Map){for(var e=[];b;){const n=b.kf();if(!n)break;e.push(n);b=b.getParent()}rb(a.j,c,d.set('context',e));var f;let g;for(const n of[...e,null==(f=d)?void 0:f.get('propId'),null==(g=d)?void 0:g.get('type')])if(c=n,'string'===typeof c&&!a.H.has(c)){e=a;f=c;e.ga||(e.ga=olympe.dc.ga());d=e.ga.name(f);e=(f=e.ga.model(f))?e.ga.name(f):'';var [h,k,l]=[d,f,e];d=a.j;e=(new Map).set(c,h).set(k,l);c=(new Map).set(c,k);for(const [p,q]of e.entries())d.N.set(p,q);for(const [p,q]of c.entries())d.H.set(p,
1098
+ w('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.O.ja('ff023000000000000053');w('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.j=olympe.dm.File.O.ja('ff023000000000000054');olympe.dm.File.O.j=olympe.dm.File.D.bind(null,olympe.dm.File);olympe.dm.File.N='application/data';olympe.dm.File.ya=[olympe.C.File];m=olympe.dm.File.prototype;m.Vs.K=olympe.C.J.D;m.gl.K=olympe.C.J.j;m.Fn.K=olympe.C.J.j;m.hl.K=olympe.C.J.j;m.rename.K=olympe.C.J.j;
1099
+ m.oq.K=olympe.C.J.D;m.nq.K=olympe.C.J.D;m.ny.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Iy.K=new olympe.C.J(()=>olympe.C.eb,[]);m.mz.K=olympe.C.J.N;olympe.dm.Pd=class extends olympe.dc.CloudObject{j(){return this.wb(olympe.dm.Pd.D)}F(){return this.xd(olympe.dm.Pd.F)}D(){return this.cb(olympe.dm.Pd.j,olympe.dm.Module)}};olympe.dm.Pd.O=olympe.dc.na.j('ff021000000000000041',olympe.dm.Pd);olympe.dm.Pd.D=olympe.dm.Pd.O.ja('ff023000000000000047');olympe.dm.Pd.F=olympe.dm.Pd.O.ja('ff023000000000000048');olympe.dm.Pd.j=olympe.dm.Module.j.$b();olympe.dm.Pd.prototype.j.K=olympe.C.J.D;olympe.dm.Pd.prototype.F.K=olympe.C.J.F;
1100
+ olympe.dm.Pd.prototype.D.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.hb=class extends olympe.dm.Rc{j(){return this.cb(olympe.dm.Kb.j,olympe.dm.Kb)}F(){return this.wb(olympe.dm.hb.X)}R(){return this.wb(olympe.dm.hb.lb)}D(){return this.cb(olympe.dm.hb.F,olympe.dm.hb)}};olympe.dm.hb.O=olympe.dc.na.j('0163d9594700fcf61e54',olympe.dm.hb);olympe.dm.hb.X=olympe.dm.hb.O.ja('017869c7d2833c9492c1');olympe.dm.hb.ht=olympe.dm.hb.O.ja('017869c7d2833c9492c2');olympe.dm.hb.Qe=olympe.dm.hb.O.ja('017869c7d2833c9492c3');olympe.dm.hb.lb=olympe.dm.hb.O.ja('017869c80bb9929c76d0');
1101
+ olympe.dm.hb.Ua=olympe.dm.hb.O.ra('ff02200000000000002a');olympe.dm.hb.F=olympe.dm.hb.O.ra('ff02200000000000002b');olympe.dm.hb.Pf=R(olympe.dm.hb.O,olympe.dm.hb.F);olympe.dm.hb.D=olympe.dm.hb.O.ra('ff02200000000000002c');olympe.dm.hb.tg=olympe.dm.hb.O.ra('017e9c412e2b944bc48f');olympe.dm.hb.ef=olympe.dm.hb.O.ra('017e9c412e2b944bd590');olympe.dm.hb.bt=olympe.dm.hb.O.ra('017e9c416872a89d3415');olympe.dm.hb.ol=olympe.dm.hb.O.ra('017ebf8fe5c506662098');R(olympe.dc.CloudObject.O,olympe.dm.hb.Ua);
1102
+ olympe.dm.hb.Fd=fg('100000000000000000dd','PRIMORDIAL');olympe.dm.hb.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.hb.prototype.F.K=olympe.C.J.D;olympe.dm.hb.prototype.R.K=olympe.C.J.D;olympe.dm.hb.prototype.D.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{j(){return this.Tc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Tc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}D(){return this.vg(olympe.dm.Property.typeRel).Cc()}Xc(){return this.j().ka().Es(this.ka())}};olympe.dm.Property.O=olympe.dc.na.j('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.propertyRel);
1103
+ w('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);w('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.D.K=olympe.C.J.j;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Ey(){return olympe.C.Sa.EMPTY}ey(){return this.xd(olympe.dm.Relation.D)}Oy(){return this.xd(olympe.dm.Relation.F)}Os(){return this.cb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Jc()}Xs(){return this.cb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Jc()}Xc(){return this.Xs().ka().concat(['-',this.ka(),'->',this.Os().ka()])}};olympe.dm.Relation.O=olympe.dc.na.j('ff021000000000000006',olympe.dm.Relation);
1104
+ olympe.dm.Relation.F=olympe.dm.Relation.O.ja('ff023000000000000030');olympe.dm.Relation.D=olympe.dm.Relation.O.ja('ff023000000000000034');olympe.dm.Relation.ba=olympe.dm.Relation.O.ja(olympe.dc.Lb.hp);olympe.dm.Relation.X=olympe.dm.Relation.O.ja(olympe.dc.Lb.Dc);olympe.dm.Relation.ia=olympe.dm.Relation.O.ja(olympe.dc.Lb.kg);olympe.dm.Relation.wa=olympe.dm.Relation.O.ja(olympe.dc.Lb.yw);olympe.dm.Relation.Z=olympe.dm.Relation.O.ja(olympe.dc.Lb.ku);olympe.dm.Relation.Ha=olympe.dm.Relation.O.ja(olympe.dc.Lb.Vw);
1105
+ olympe.dm.Relation.R=olympe.dm.Relation.O.ja('ff023000000000000031');olympe.dm.Relation.originModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Lj);w('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Is);w('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.j={Xp:0,Ot:5,hw:1,SC:4,es:2,yr:8,gB:10,PC:6,QC:9,Xe:6,RC:9};
1106
+ olympe.dm.Relation.H={tC:3,Ov:4,eC:5,dC:6};olympe.dm.Relation.N=olympe.dm.Gl.Qv+olympe.dm.Gl.gu;m=olympe.dm.Relation.prototype;m.Ey.K=olympe.C.J.D;m.ey.K=olympe.C.J.F;m.Oy.K=olympe.C.J.F;m.Os.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Xs.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);function ln(a){a=olympe.dc.ea(a);if(olympe.dc.ha().Vf(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.O.W():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.O.W():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.O.W():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.O.W():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.Je=class extends olympe.dc.CloudObject{getValue(){}};
1107
+ olympe.dm.Je.O=olympe.dc.na.j('ff021000000000000019',olympe.dm.Je);olympe.dm.String=class extends olympe.dm.Je{getValue(){return this.wb(olympe.dm.String.valueProp)}tc(){return this.get(olympe.dm.String.valueProp)}toString(){let a;return null!=(a=this.get(olympe.dm.String.valueProp))?a:''}};olympe.dm.String.O=olympe.dc.na.j('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.O.ja('ff023000000000000026');w('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.C.J.D;
1108
+ olympe.dm.String.prototype.toString.K=olympe.C.J.j;olympe.dm.Boolean=class extends olympe.dm.Je{getValue(){return this.mh(olympe.dm.Boolean.valueProp)}tc(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.O=olympe.dc.na.j('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.O.ja('ff023000000000000027');w('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.C.J.N;olympe.dm.Color=class extends olympe.dm.Je{getValue(){return this.Ys()}tc(){return this.get(olympe.dm.Color.valueProp)}};olympe.dm.Color.O=olympe.dc.na.j('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.O.ja('ff023000000000000032');w('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.C.J(()=>olympe.C.Color,[]);olympe.dm.DateTime=class extends olympe.dm.Je{getValue(){return this.Dj(olympe.dm.DateTime.valueProp)}tc(){return this.get(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.O=olympe.dc.na.j('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.O.ja('ff023000000000000029');w('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.C.J(()=>olympe.C.eb,[]);olympe.dm.Enum=class extends olympe.dm.String{ka(){return olympe.C.sa([super.ka(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Sa)}Hd(){return this.xd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.O=olympe.dc.na.j('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.ja('017a7690c915975ea995');olympe.dm.Enum.prototype.Hd.K=olympe.C.J.F;olympe.dm.gg=class extends olympe.dm.BrickMetadata{bz(){return this.bb(olympe.dc.CloudObject.instancesRel).Al(olympe.dm.Enum.rankProp,olympe.dc.query.Bk.ASC).Cc()}static create(a,b){b=a.create(olympe.dm.gg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.gg.create=olympe.dm.gg.create;olympe.dm.gg.prototype.getValues=olympe.dm.gg.prototype.bz;olympe.dm.gg.O=olympe.dc.na.j('017a768f966fc08ebb98',olympe.dm.gg);olympe.dm.Number=class extends olympe.dm.Je{getValue(){return this.xd(olympe.dm.Number.valueProp)}tc(){return this.get(olympe.dm.Number.valueProp)}};olympe.dm.Number.O=olympe.dc.na.j('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.O.ja('ff023000000000000028');w('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.C.J.F;olympe.sc={};olympe.sc.P={Da:'sc.Logger',Kk:'sc.RootContext',Me:'sc.Serializer'};olympe.sc.Config={ze:'sc.app',bg:'sc.debug',lo:'sc.autostartProfiler',ep:'sc.debugger',hu:'sc.disableTheme',PRODUCTION:'sc.production',Pv:'sc.onstartTimeout',tr:'sc.remoteActionTimeout'};
1109
+ olympe.V.config(a=>{E(a,olympe.sc.Config.ze,'');E(a,olympe.sc.Config.bg,!1);E(a,olympe.sc.Config.hu,!0);E(a,olympe.sc.Config.PRODUCTION,!1);E(a,olympe.sc.Config.Pv,2E4);E(a,olympe.sc.Config.tr,3E4);E(a,olympe.sc.Config.lo,!1);D(a,olympe.sc.P.Da,[olympe.ga.P.Fa],b=>b.ad('sc'));C(a,olympe.sc.P.Me,olympe.sc.cc,olympe.dc.db.P.Fa);Wa(a,olympe.dc.sources.P.Me,olympe.sc.P.Me);D(a,olympe.sc.P.Kk,[new olympe.V.oa(olympe.sc.Config.PRODUCTION)],b=>{const c=new olympe.sc.Fg('root','root',null);olympe.sc.Xn=c;
1110
+ c.set(olympe.sc.xa.j.PRODUCTION,b);return new olympe.sc.xa(c)})},'olympe.sc');olympe.V.run([olympe.sc.P.Kk,new olympe.V.oa(olympe.L.Config.Rl)],(a,b)=>{olympe.de().ctx=a;olympe.de().oVersion=()=>b});olympe.sc.Rn=()=>null!==olympe.dc.ha().Ib(void 0,olympe.sc.Runnable.j.$b());olympe.sc.RE=(a,b,c,d)=>{c=X(X(a.create(olympe.sc.gd),olympe.sc.gd.j,c||null),olympe.sc.gd.F,d||null);a.Oa(olympe.sc.gd.D,c,b);a.Oa(olympe.dc.CloudObject.containsRel,b,c);return c.W()};olympe.sc.tj=(a,b)=>{a=olympe.dc.ib.gy(b)(a);return a instanceof olympe.sc.Td?a.j():a};
1111
+ olympe.sc.iF=function(a){const b=olympe.dc.CloudObject.containsRel.$b();var c=olympe.dc.ea(a);if(void 0===c)return[];a=olympe.dc.ha();const d=[];let e=[];const f=new Set;for(;!a.Nb(c,olympe.dm.Kb);){f.add(c);const g=a.Ib(c,b);if(null===g)return olympe.ga.Wa('sc').warn(`Object ${c} has no container`),[];a.Nb(c,olympe.sc.logic.pb)||g===a.Ib(c,olympe.sc.Runnable.j.$b())||d.push(c);c=g;if(f.has(c))throw Error(`Instance ${c} (${a.name(c)}) is part of a cyclic contain pattern`);}e.push(c);e=e.concat(a.nh(e[0],
1112
+ olympe.dm.Kb.ia));e=e.concat(a.nh(e[e.length-1],olympe.dm.Rc.R.$b()));e=e.concat(a.nh(e[e.length-1],olympe.dm.Rc.N.$b()));return[...d,...e].reverse()};olympe.sc.jF=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Kg:a.startsWith('video/')?olympe.sc.bi:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Pc:olympe.dm.File};
1113
+ olympe.sc.hF=a=>a instanceof olympe.sc.Kg?'image/*':a instanceof olympe.sc.bi?'video/*':a instanceof olympe.sc.Pc?'font/*,application/font-woff':null;olympe.sc.$a={};function mn(a,b){var c=olympe.sc.xa,d=a.state;a=a.Cb();b=olympe.dc.ea(b);let e,f=null==(e=d.j)?void 0:e.get(b);if(!f){f=d.ji(a,void 0,b);for(d=f.getParent();d&&d.ia&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||nn(g,b,f)}return new c(f)}function on(a,b){let c,d;return(a=null!=(d=null==(c=a.state.j)?void 0:c.get(olympe.dc.ea(b)))?d:null)?new olympe.sc.xa(a):null}function pn(a){let b;return null!=(b=a.Qa(olympe.sc.xa.j.PRODUCTION))?b:!1}
1114
+ olympe.sc.xa=class{constructor(a=olympe.sc.Xn){this.state=a;this.G=olympe.ga.Wa('sc');this.j=null}T(){return this.state.T()}getParent(){if(null===this.j){const a=this.state.getParent();this.j=null===a?null:new olympe.sc.xa(a)}return this.j}hy(a){const b=olympe.dc.ha();let c=this.getParent();if(!c)return this;const d=e=>{e=e.kf();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Pa(f,olympe.sc.Va.Z)||a.modelTag&&!b.Nb(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;
1115
+ c=e}return c}kf(){return this.state.kf()}Cb(){return this.state.Cb()}set(a,b){this.state.set(a,b);return this}fo(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}tb(a,b,c=!1){const d=olympe.dc.ea(a),e=olympe.C.bc(null!=b?b:Object,`Get context value flow source of ${d}`);e.getContext().onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.state.T():void 0));return e.tb()}get(a,b=!1){a=this.Qa(a,b);return void 0!==a?a:null}has(a,b=!1){return this.state.has(a,b)}observe(a,b=!0,c=
1116
+ !1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.state.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=qn(this.state,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.vh(a.unsubscribe.bind(a));return this}dA(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.ji(`Runner ${a.name()}`);a.run(b);return b}Dt(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,
1117
+ b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.ea(a)})\``+`on the context ${this.T()}:\nStack: ${this.se()}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.T()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.ea(a)})\` `+`has never received any value:\nStack: ${this.se()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;
1118
+ const d=(null==(c=a.se)?void 0:c.call(a))||this.se();let e,f;c=null!=(f=null==(e=a.Aj)?void 0:e.call(a))?f:0;b=rn(b,c,d);b.stack=a.stack}else b=rn(b,0,this.se());sn(this.state,b);return this}eA(a){this.set(olympe.sc.xa.j.Eg,a);return this}Qa(a,b=!0){return this.state.Qa(a,b)}on(a,b,c,d=!0){return this.state.on(a,b,c,d)}ji(a){return new olympe.sc.xa(this.state.ji(this.Cb(),a))}vl(a,b){return this.state.vl(a,c=>{b(new olympe.sc.xa(c))})}My(a){a=tn(this.state,a);return a===this.state?this:a&&new olympe.sc.xa(a)}destroy(){this.state.destroy()}vh(a,
1119
+ b){return this.state.vh(a,b)}tl(a){this.state.tl(a)}onDestroy(a){return this.fb()?(a(),'noId'):this.Cb().onDestroy(a)}Xf(a){this.fb()||this.Cb().Xf(a)}clear(){this.state.clear()}fb(){return this.Cb().fb()||this.Cb().jd()}Pa(a){a=un(this.state,a);return null!==a?new olympe.sc.ui.OA(a,this):null}xy(a){a=un(this.state,a);return null!==a?new olympe.sc.ui.NA(a,this):null}Hz(...a){return rxjs.combineLatest(a.map(b=>{b=un(this.state,b);return null!==b?this.observe(b):rxjs.of(null)}))}Ea(a){return(null==
1120
+ a?void 0:a.constructor)!==this.constructor?!1:this.state===a.state}se(){const a=olympe.dc.ha();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.state!==olympe.sc.Xn;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.kf();return null!==f?(e=a.model(f),`${a.name(f)||e&&a.name(e)||f} (${e})`):e.T()}).join('\n> ')}catch(c){b=`No stack available for context ${this.T()}: ${c}`,this.G.warn(b)}return b}};olympe.sc.xa.prototype.observeMany=olympe.sc.xa.prototype.Hz;
1121
+ olympe.sc.xa.prototype.getEvent=olympe.sc.xa.prototype.xy;olympe.sc.xa.prototype.getProperty=olympe.sc.xa.prototype.Pa;olympe.sc.xa.prototype.isDestroyed=olympe.sc.xa.prototype.fb;olympe.sc.xa.prototype.clear=olympe.sc.xa.prototype.clear;olympe.sc.xa.prototype.offDestroy=olympe.sc.xa.prototype.Xf;olympe.sc.xa.prototype.onDestroy=olympe.sc.xa.prototype.onDestroy;olympe.sc.xa.prototype.offClear=olympe.sc.xa.prototype.tl;olympe.sc.xa.prototype.onClear=olympe.sc.xa.prototype.vh;
1122
+ olympe.sc.xa.prototype.destroy=olympe.sc.xa.prototype.destroy;olympe.sc.xa.prototype.getOtherContext=olympe.sc.xa.prototype.My;olympe.sc.xa.prototype.onContext=olympe.sc.xa.prototype.vl;olympe.sc.xa.prototype.createChild=olympe.sc.xa.prototype.ji;olympe.sc.xa.prototype.setParentElement=olympe.sc.xa.prototype.eA;olympe.sc.xa.prototype['throw']=olympe.sc.xa.prototype.throw;olympe.sc.xa.prototype.waitFor=olympe.sc.xa.prototype.Dt;olympe.sc.xa.prototype.runner=olympe.sc.xa.prototype.dA;
1123
+ olympe.sc.xa.prototype.repeat=olympe.sc.xa.prototype.repeat;olympe.sc.xa.prototype.observe=olympe.sc.xa.prototype.observe;olympe.sc.xa.prototype.has=olympe.sc.xa.prototype.has;olympe.sc.xa.prototype.get=olympe.sc.xa.prototype.get;olympe.sc.xa.prototype.remove=olympe.sc.xa.prototype.remove;olympe.sc.xa.prototype.trigger=olympe.sc.xa.prototype.fo;olympe.sc.xa.prototype.set=olympe.sc.xa.prototype.set;olympe.sc.xa.prototype.getClosest=olympe.sc.xa.prototype.hy;olympe.sc.xa.prototype.getParent=olympe.sc.xa.prototype.getParent;
1124
+ olympe.sc.xa.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',REDELIVERED:'__redelivered',Eg:'__htmlContainer',bB:'__dockableElement',jo:'__appHasStarted'};olympe.sc.Zw=class extends olympe.sc.xa{constructor(a){super(a);this.D=new olympe.C.Xb('SC Update Context',super.Cb());const b=a.vh(()=>{b&&a.tl(b);this.D.destroy()})}Cb(){return this.D}vh(a,b){return this.Cb().onDestroy(a,null!=b?b:olympe.U.Lc())}};let vn=0;function qn(a,b){b=olympe.dc.ea(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.Z)?void 0:c.get('I#'+b))?e:null==(d=a.Z)?void 0:d.get('IO#'+b))?f:b}function sn(a,b){if(null===a.H)a.G.error(`An error occurred in a brick: ${b.toString()}`);else if(a.ba&&olympe.dc.ha().Ja(a.ba)){var c=wn(olympe.dc.CloudObject.get(a.ba));null!==c&&xn(a,c).some(d=>{let e,f;return 0<(null==(e=a.F)?void 0:null==(f=e.get(d))?void 0:f.size)})&&!a.N.has('$'+c)?a.set(c,b):sn(a.H,b)}else sn(a.H,b)}
1125
+ function tn(a,b){if(b===a.id||a.R.has(b)||!b)return a;for(a=a.H;a;){if(b===a.T()||a.R.has(b))return a;const c=yn(a.j,b);if(c)return c;a=a.getParent()}return null}function zn(a,b,c=0){null===a.$a&&(a.$a=new Map);a.$a.has(b.T())||(a.$a.set(b.T(),{wl:b,depth:c}),An(a,d=>{(-1===b.F||c<b.F)&&zn(d,b,c+1)}),a.onDestroy(()=>{Bn(a,b.T())}));return b.T()}
1126
+ function Bn(a,b){if(null===a.$a||!a.$a.has(b))return!1;const {wl:c,depth:d}=a.$a.get(b);An(a,f=>{Bn(f,b)});0===d&&c.D();const e=a.$a.delete(b);0===a.$a.size&&(a.$a=null);return e}function un(a,b){let c;return(null==(c=a.Z)?void 0:c.get('IO#'+b))||null}
1127
+ function Cn(a){a.D.Xd(()=>{An(a,c=>c.destroy())});a.D.onDestroy(()=>{void 0!==a.Qa(olympe.sc.xa.j.TRANSACTION,!1)&&a.G.warn(`The context ${a.T()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);a.clear();let c;if(null!=(c=a.H)){let d;null==(d=c.j)||d.delete(a.T());let e;0===(null==(e=c.j)?void 0:e.size)&&(c.j=null)}a.R.clear()});let b;null==(b=a.H)||Dn(b,a)}
1128
+ function yn(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ia&&!c.id.startsWith('_')&&(a=yn(c.j,b)))return a;return null}function En(a,b,...c){if(null!==a.$a)for(const {wl:d,depth:e}of a.$a.values())d.process(a,b,e,...c)}function Fn(a,b){a.ba=olympe.dc.ea(b);a.ia=b.wd().Rn();b.H().forEach(c=>{a.id===c||a.R.has(c)||(a.R.add(c),nn(a,c,a))});a.Z=b.D();En(a,olympe.sc.$a.pc.j.INIT)}function Gn(a){a.wa=!0;let b;null==(b=a.j)||b.forEach(c=>{Gn(c)})}
1129
+ function Hn(a){a.wa=!1;let b;null==(b=a.j)||b.forEach(c=>{Hn(c)})}function xn(a,b){return['*',a.id,...a.R].map(c=>`${'@'}${c}.${b}`)}function In(a,b,c,d){c.forEach(f=>{let g,h;null==(g=a.F)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});let e;null==(e=a.j)||e.forEach(f=>{!f.wa&&f.data.has(b)||In(f,b,c,d)})}function Jn(a,b,c){a.F||(a.F=new Map);let d=a.F.get(b);void 0===d&&(d=new Map,a.F.set(b,d));vn++;const e=vn;d.set(e,c);return()=>{const f=a.F.get(b);f&&(f.delete(e),0===f.size&&a.F.delete(b))}}
1130
+ function nn(a,b,c){a.N.add(b);let d,e;null==(d=a.F)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});An(a,f=>{f.N.has(b)||nn(f,b,c)});a.N.delete(b)}function An(a,b){let c;null==(c=a.j)||c.forEach(b)}function Kn(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function Ln(a){var b=olympe.sc.$a.pc.D.Ze;const c=[];if(null!==a.$a)for(const {wl:d}of a.$a.values())d.getType()===b&&(c.push(d.T()),d.D(),Bn(a,d.T()))}function Dn(a,b){null===a.j&&(a.j=new Map);a.j.set(b.id,b)}
1131
+ olympe.sc.Fg=class{constructor(a,b='no name',c=olympe.sc.Xn){this.id=a;this.$c=b;this.R=new Set;this.H=c;this.D=new olympe.C.Xb('SC Context');this.data=new Map;this.ba=this.X=this.j=this.F=null;this.ia=!1;this.N=new Set;this.wa=!1;this.Z=null;this.G=olympe.ga.Wa('sc');this.$a=null;Cn(this)}T(){return this.id}getParent(){return this.H}kf(){return this.ba}set(a,b){if(!this.D.jd()&&!this.D.fb()){const g=olympe.dc.ea(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.Z)?void 0:c.get('O#'+g))?h:null==
1132
+ (d=this.Z)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.N.has(c)){a:{if('function'===typeof(null==b?void 0:b.Ea))try{var f=b.Ea(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.$a&&0<this.$a.size&&En(this,olympe.sc.$a.pc.j.Yg,a,b),f=xn(this,a),this.N.add(c),In(this,c,f,b),this.N.delete(c))}}on(a,b,c,d=!0){if(this.D.fb()||this.D.jd())return()=>{};const e=qn(this,a),f=c?olympe.dc.ea(c):
1133
+ '*';a=Jn(this,'@'+f+'.'+e,b);c=c?(c=tn(this,f))?c.Qa(e,!1):void 0:this.Qa(e);void 0!==c&&b(c);if(d)olympe.C.Za().onDestroy(a);return a}has(a,b=!1){a='$'+qn(this,a);let c=this.data.has(a),d=this.getParent();if(b)for(;!c&&d;)c=d.data.has(a),d=d.getParent();return c}ji(a,b,c){const d=null!=c?c:'_'+olympe.U.Lc();if(a.fb()||a.jd())throw Error(`Try to create new child context in a destroyed context ${a.T()}, probably because \`runner()\` is called on a destroyed context`);const e=a.run(()=>new olympe.sc.Fg(d,
1134
+ b,this));null!==this.$a&&0<this.$a.size&&this.$a.forEach(({wl:f,depth:g})=>{(-1===f.F||g<f.F)&&zn(e,f,g+1)});return e}vl(a,b){const c=tn(this,a);if(c)return b(c),()=>{};const d=Jn(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Qa(a,b=!0){a='$'+qn(this,a);let c=this.data.get(a),d=this.getParent();if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.getParent();return c}destroy(){this.D.jd()||this.D.fb()||(En(this,olympe.sc.$a.pc.j.dk),this.D.destroy(),En(this,olympe.sc.$a.pc.j.Zd))}vh(a,b){if(this.D.fb())a();
1135
+ else return vn++,b=null!=b?b:String(vn),null===this.X&&(this.X=new Map),this.X.set(b,a),b;return b||'noId'}tl(a){null!==this.X&&this.X.delete(a)}onDestroy(a){return this.fb()?(a(),'noId'):this.D.onDestroy(a)}clear(){if(!this.D.fb()){En(this,olympe.sc.$a.pc.j.Xj);let a;null==(a=this.X)||a.forEach(b=>b());En(this,olympe.sc.$a.pc.j.Yj)}}fb(){return this.D.fb()}Cb(){return this.D}};olympe.sc.Fg.prototype.getParent=olympe.sc.Fg.prototype.getParent;olympe.sc.Fg.j={um:'I#',Lm:'O#',VB:'IO#'};function Mn(a,b,c){return(c=c.kf())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.$a.pc=class{constructor(a=-1){this.id=olympe.U.hf();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.$a.pc.j={INIT:'INIT',Yg:'SET',Xj:'CLEAR',Yj:'CLEARED',dk:'DESTROY',Zd:'DESTROYED'};olympe.sc.$a.pc.D={Ze:'REMOTE',tv:'LOCAL',jg:'PROFILER'};olympe.sc.$d=class a{constructor(){this.D=this.H=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.U.fn(1E4);gb(this.j,b=>{Ln(b)})}Z(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.$d.j.Uv:c=this.F.get(e.f);b.cd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.$d.j.Vv:const h=f+c,k=(l,n,p=0)=>{Kn(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.F(q):t=q;let v;q=null!=(v=l.kf())?v:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
1136
+ t])})};b.Un(h).then(()=>{const l=[];k(g,l,0);An(g,p=>{k(p,l,1)});olympe.L.qb.ld(h,{t:olympe.sc.$d.j.Ju,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.$a.kw(h);zn(g,n);this.j.has(g)?fb(this.j,g):this.j.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.$d.j.Wv:void 0!==g&&this.j.has(g)&&fb(this.j,g);break;case olympe.sc.$d.j.Eh:void 0!==g&&(this.j.delete(g),Ln(g))}}ba(b,c,d){this.N=new olympe.L.qb('discovery_debug_id',
1137
+ c);this.N.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.$d.j.iu){e=f.i;f=f.f;if(!this.F.has(f)){const g=this.X(f,c,b);if(0!==g.length)this.F.set(f,g);else return}null===this.D&&(this.D=olympe.U.hf(),f=new olympe.C.Xb(this.D,c.Cb()),this.H=new olympe.L.qb(this.D,f),this.H.listen().subscribe(g=>{this.Z(g,b,d)}));olympe.L.qb.ld(e,{t:olympe.sc.$d.j.Et,n:olympe.V.getParameter(olympe.sc.Config.ep)||'no name',a:b,s:this.D}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}X(b,c,
1138
+ d){const e=[],f=olympe.dc.ha(),g=(h,k)=>{An(h,l=>{if(null!==l.kf()){const n=olympe.dc.CloudObject.get(l.kf()).vg(olympe.sc.Runnable.D).Cc();if(null!==n){const p=k+'/'+f.name(n);n.W()===b&&(e.push([p,l.T()]),this.R.set(l.T(),l));g(l,p)}}})};g(c.state,f.name(d));return e}static D(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.F(d));olympe.L.qb.ld(b,{t:olympe.sc.$d.j.Xk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ga.Wa('Debugger').error('Error publishing on service : ',f)})}static F(b){if(null===
1139
+ b||void 0===b)return'<null>';const c=olympe.dc.ha();if(b instanceof olympe.dc.CloudObject){var d=b.Wb();if(!c.Nb(d,olympe.sc.Ac))return b.toString();let f=`${b.Vb().name()} (${b.W()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.la.from(e).ug(olympe.dc.CloudObject.extendRel,!0).me().bb(olympe.dc.CloudObject.propertyRel).me().Cc();e=olympe.dc.la.from(e).ug(olympe.dc.CloudObject.extendRel,!0).me().bb(olympe.dc.CloudObject.Lj).me().Cc();d=d.filter(([g])=>g instanceof olympe.sc.Ac);0!==d.length&&(f+=
1140
+ '<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Pa(b.W(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.Ac);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.$d.H='discovery_debug_id';olympe.sc.$d.j={iu:0,Et:1,Uv:2,Vv:3,Ju:4,Xk:5,Wv:6,Eh:7};olympe.sc.$a.cC=class extends olympe.sc.$a.pc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.$a.pc.D.tv}process(a,b,c,...d){if(this.active&&b===olympe.sc.$a.pc.j.Yg){a=Mn(c,qn(a,d[0]),a);d=d[1];let e;null==(e=this.j.get(a))||e(d)}}on(a,b){this.j.set(a,b)}};function Nn(a,b,c,d=new Map){for(var e=[];b;){const n=b.kf();if(!n)break;e.push(n);b=b.getParent()}rb(a.j,c,d.set('context',e));var f;let g;for(const n of[...e,null==(f=d)?void 0:f.get('propId'),null==(g=d)?void 0:g.get('type')])if(c=n,'string'===typeof c&&!a.H.has(c)){e=a;f=c;e.ha||(e.ha=olympe.dc.ha());d=e.ha.name(f);e=(f=e.ha.model(f))?e.ha.name(f):'';var [h,k,l]=[d,f,e];d=a.j;e=(new Map).set(c,h).set(k,l);c=(new Map).set(c,k);for(const [p,q]of e.entries())d.N.set(p,q);for(const [p,q]of c.entries())d.H.set(p,
1139
1141
  q)}}
1140
- olympe.sc.$a.cw=class extends olympe.sc.$a.pc{constructor(a){super();this.j=a;this.ga=olympe.dc.ga();this.H=new Set}getType(){return olympe.sc.$a.pc.D.ig}process(a,b,c,...d){var e=Mn.qm,f=Mn.Im,g=Mn.Yv;const h=Mn.INIT,k=Mn.Xj,l=Mn.Yj,n=Mn.dk,p=Mn.Zd;c=Mn.Qv;if(b===olympe.sc.$a.pc.j.Yg){const [q,r]=d;b=(d=a.kf())?olympe.dc.ga().Nb(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ga().Nb(d,olympe.sc.ui.TC):!1;b?(g=this.ga.Ib(q,olympe.dm.Property.typeRel),b=this.ga.Nb(q,olympe.sc.logic.ub),d=this.ga.Nb(q,olympe.sc.logic.Fb),
1141
- Ln(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ga.Nb(q,olympe.dm.Property),f=this.ga.Ib(q,olympe.dm.Property.typeRel),Ln(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.$a.pc.j.INIT?Ln(this,a,h):b===olympe.sc.$a.pc.j.Xj?Ln(this,a,k):b===olympe.sc.$a.pc.j.Yj?Ln(this,a,l):b===olympe.sc.$a.pc.j.dk?Ln(this,a,n):b===olympe.sc.$a.pc.j.Zd&&Ln(this,a,p)}};
1142
- const Mn={qm:'input',Im:'output',Yv:'prop',INIT:'init',Xj:'clear',Yj:'cleared',dk:'destroy',Zd:'destroyed',Qv:'other'};olympe.sc.$a.jw=class extends olympe.sc.$a.pc{constructor(a){super(1);this.H=a;this.j=new Map;this.db=olympe.dc.ga()}getType(){return olympe.sc.$a.pc.D.Ze}D(){super.D();for(const a of this.j.values())a();this.j.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.$a.pc.j.Yg&&void 0!==d[0]&&null!==d[0]){const e=Kn(c,on(a,d[0]),a),f=d[1];let g;null==(g=this.j.get(e))||g();this.j.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Ub()instanceof olympe.sc.Ac){const h=hh(this.db,f,()=>{olympe.sc.$d.D(this.H,
1143
- e,f)});this.j.set(e,()=>{ih(this.db,f,h)})}olympe.sc.$d.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{bv(){return this.xd(this.Jn())}dv(){return this.xd(this.Kn())}kl(){return new olympe.C.Zb(this.xd(this.Jn()),this.xd(this.Kn()))}Jn(){}Kn(){}};olympe.sc.Metadata.O=olympe.dc.na.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.bv.K=olympe.C.J.F;m.dv.K=olympe.C.J.F;m.kl.K=olympe.C.J.R;m.Jn.K=olympe.C.J.j;m.Kn.K=olympe.C.J.j;olympe.sc.gd=class extends olympe.dc.CloudObject{D(){return this.vb(olympe.sc.gd.F)}j(){return this.vb(olympe.sc.gd.j)}};olympe.sc.gd.O=olympe.dc.na.j('01703376c4a81c0e9d90',olympe.sc.gd);olympe.sc.gd.F=olympe.sc.gd.O.ja('01703376c4a81c0e9d91');olympe.sc.gd.j=olympe.sc.gd.O.ja('01703376c4a81c0e9d92');olympe.sc.gd.D=olympe.sc.gd.O.ra('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.gd.D);olympe.sc.gd.prototype.D.K=olympe.C.J.D;olympe.sc.gd.prototype.j.K=olympe.C.J.D;olympe.sc.we={};olympe.sc.we.Ne={ru:'folders',nw:'screenflow',Pw:'ui-design',Pr:'software-intelligence',Bh:'data-management',GC:'projects'};olympe.sc.Ff=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Hd(){return this.xd(olympe.sc.Ff.D)}};olympe.sc.Ff.O=olympe.dc.na.j('019131fb930466a1ad79',olympe.sc.Ff);olympe.sc.Ff.D=olympe.sc.Ff.O.ja('016d1bb681929c2cc3f1');olympe.sc.Ff.j=olympe.sc.Ff.O.ra('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.Ff.j);olympe.sc.Ff.prototype.Hd.K=olympe.C.J.F;olympe.sc.sd=class extends olympe.dm.BrickMetadata{ue(){return olympe.sc.we.Ne.Pr}j(){return this.cb(olympe.sc.sd.j,olympe.sc.logic.Uh)}D(){return this.cb(olympe.sc.sd.D,olympe.sc.logic.Rg)}};olympe.sc.sd.O=olympe.dc.na.j('011100000000000adef0',olympe.sc.sd);olympe.sc.sd.j=olympe.sc.sd.O.ra('016ac4f59a2917fdef01');olympe.sc.sd.D=olympe.sc.sd.O.ra('016ac4f59a2917fdef02');olympe.sc.sd.O.j=(a,b)=>$l(a,b||'New function signature',olympe.sc.sd,olympe.sc.logic.Bd).W();
1144
- olympe.sc.sd.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.sd.prototype.D.K=new olympe.C.J(()=>olympe.dc.Aa,[]);function Nn(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function On(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Nb(c,olympe.sc.logic.Sb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Pa(c,olympe.sc.logic.Sb.j,!0))?e:0;let f;d=null!=(f=a.db.Pa(d,olympe.sc.logic.Sb.j,!0))?f:0;return c-d});return b}function Pn(a){return On(a,a.db.cb(a.tag,olympe.sc.Ua.F))}function Qn(a){return On(a,a.db.cb(a.tag,olympe.sc.Ua.D))}
1145
- olympe.sc.Ua=class extends olympe.dm.BrickMetadata{fv(a,b,c,d,e=!0){e||olympe.ha.Xa('sc').error('parameter own= false ignored, investigate');return olympe.C.wh(M(this.Sf(a,olympe.dc.ib.tj,c)),d)}H(){return[]}F(){return rxjs.of([])}Sy(){return this.cb(olympe.sc.Ua.H,olympe.sc.Runnable)}jy(){return this.cb(olympe.sc.Ua.R,olympe.sc.Runnable)}ti(){return this.db.Pa(this,olympe.sc.Ua.Z)}On(){return null!==this.db.Ib(this.tag,olympe.sc.Runnable.j.$b())}ev(){return this.cb(olympe.sc.Ua.F,olympe.sc.logic.ub)}oq(){return this.cb(olympe.sc.Ua.D,
1146
- olympe.sc.logic.Fb)}N(){return[olympe.sc.Ua.Wa]}};olympe.sc.Ua.O=olympe.dc.na.j('0112000000000000def0',olympe.sc.Ua);olympe.sc.Ua.Z=olympe.sc.Ua.O.ja('01692aa71f3108454479');olympe.sc.Ua.nb=olympe.sc.Ua.O.ja('0166446c1f128ebc903a');olympe.sc.Ua.Wa=olympe.sc.Ua.O.ja('0166446c1f128ebc904e');olympe.sc.Ua.H=olympe.sc.Ua.O.ra('01692a4af82e8984742c');olympe.sc.Ua.R=olympe.sc.Ua.O.ra('01692a4af82e8984742d');olympe.sc.Ua.X=olympe.sc.Ua.O.ra('01692a4af82e8984742e');olympe.sc.Ua.F=olympe.sc.Ua.O.ra('01621fb84e320000f00a');
1147
- olympe.sc.Ua.D=olympe.sc.Ua.O.ra('01621fb84e320000f00b');olympe.sc.Ua.Fd=olympe.sc.Ua.O.ra('0171838bcfed0000e00e');olympe.sc.Ua.vd=olympe.sc.Ua.O.ra('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.fv.K=olympe.C.J.j;m.Sy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.jy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.ti.K=olympe.C.J.j;m.On.K=olympe.C.J.j;m.ev.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.oq.K=new olympe.C.J(()=>olympe.dc.Aa,[]);function un(a){let b;return null!=(b=a.wd().N().map(olympe.dc.ea)[0])?b:null}function Rn(a){const b=new olympe.dc.Ya;a=b.create(a);b.persist(a,!1);b.lb((d,e)=>{d||olympe.ha.Xa('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.Za().onDestroy(()=>{const d=new olympe.dc.Ya;d.delete(c);d.lb()});return c}
1148
- function Sn(a,b){Dn(b.state,a);Nn(a.wd(),b);const c=a.R(),d=Tn(b,c),e=[];c.forEach((f,g)=>{f===a.da?e[0]=g:f===a.Z&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(Un(a,b,d[e[0]],d[e[1]]),c[e[0]]=null,c[e[1]]=null);c.forEach((f,g)=>{f&&f.call(a,b,d[g])})}
1149
- function Vn(a,b){let c,d,e;a.G.j()&&(e=a.db.name(a.Vb()),c=`Brick ${e} successfully run`,d=`Brick ${e} successfully cleared`);const f=Wn(a,b),g=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.fb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.Yw(b.state);l.Cb().run(()=>u(function*(){try{yield a.update(l,k,f)}catch(n){l.throw(n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.G.debug(c):a.G.debug(d),h=>b.throw(h),()=>a.G.debug(`Brick ${e} completed`)));
1150
- b.onDestroy(g.unsubscribe.bind(g))}function Xn(a,b,c,d){let e=[];const f=T(a.db,b,c,(g,h)=>{if(g){const k=kn(d,h),l=olympe.dc.CloudObject.get(h);l instanceof olympe.sc.logic.ed&&null!==e?e.push(()=>l.run(k)):l.run(k)}else{let k;null==(k=mn(d,h))||k.destroy()}});e.forEach(g=>g());e=null;d.Cb().onDestroy(a.db.D.bind(a.db,b,c,f))}function Wn(a,b){return a.wd().H(b)}
1151
- function Tn(a,b){if(1===b.length)return[(d,e)=>{null!==e?a.set(d,e):a.remove(d)}];const c=b.map(()=>new Map);return c.map(d=>(e,f)=>{null!==f?d.set(e,f):d.delete(e);a:{for(const g of c)if(f=g.get(e),void 0!==f){a.set(e,f);break a}a.remove(e)}})}function Un(a,b,c,d){b=b.Cb();const e=hh(a.db,a.tag,b.rc((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.ib.tc(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{ih(a.db,a.tag,e)})}
1152
- olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.Cb().run(()=>{Sn(this,a);this.init(a);a.vh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));Vn(this,a);this.F(a)})}wd(){return this.Ub()}init(a){this.onInit(a)}update(a,b,c){const d=this.wd();if(d.ti())this.onUpdate(a,b,c);else this.G.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.T()}`),Xn(this,d,olympe.sc.Ua.H,a),this.ia()&&Xn(this,
1153
- d,olympe.sc.Ua.X,a)}F(a){a.eo(olympe.sc.Ua.nb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.wd().F(a)}onInit(){}onUpdate(){const a=this.Vb(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.G.error(`No code was found for ${b} (${c}: ${a})\n\n`+'This is probably because the code has not yet been deployed to the environment, or because the package.json does not import the required dependencies.')}onDestroy(){}getInputs(){return Pn(this.wd())}getOutputs(){return Qn(this.wd())}H(){return[]}D(){return null}ia(){return!1}N(a,
1154
- b,c,d){a=b.tb(a,c,!0);void 0!==d&&olympe.C.wh(a,d);return a}Wa(a,b,c,d,e){olympe.C.Tn([d],f=>{b.set(a,olympe.C.et(f)?f.valueOf():f)});return this.N(a,b,c,e)}R(){return[this.da,this.Z]}da(a,b){Un(this,a,b,null)}Z(a,b){Un(this,a,null,b)}nb(a,b){const c=this.db,d=olympe.sc.logic.pb.F.$b(),e=olympe.sc.logic.pb.D,f=olympe.sc.logic.pb.j;this.Ks(d,g=>{var h=g.W();if(h=c.Ib(h,e)||c.Ib(h,f))return Yn(g,a,b.bind(null,h))})}};olympe.sc.Runnable.O=ig(olympe.dc.na.j('01130000000000ca1100',olympe.sc.Runnable));
1155
- olympe.sc.Runnable.D=olympe.sc.Runnable.O.ra('01692a4af82e8984742b');olympe.sc.Runnable.j=olympe.sc.Runnable.O.ra('01756a18d4921c103111');olympe.sc.Runnable.N=R(olympe.sc.Runnable.O,olympe.sc.Ua.H);olympe.sc.Runnable.R=R(olympe.sc.Runnable.O,olympe.sc.Ua.R);olympe.sc.Runnable.X=R(olympe.sc.Runnable.O,olympe.sc.Ua.X);R(olympe.sc.Ua.O,olympe.sc.Runnable.D);R(olympe.sc.Ua.O,olympe.sc.Runnable.j);olympe.sc.Runnable.prototype.wd.K=new olympe.C.J(()=>olympe.sc.Ua,[]);
1156
- olympe.sc.Runnable.prototype.N.K=new olympe.C.J(()=>Object,[]);olympe.sc.Runnable.prototype.Wa.K=olympe.C.J.j;function Zn(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Td)return(a=a.D())?a.valueOf():null;if('function'===typeof a.W)return a.W()}return null}olympe.sc.Td=class extends olympe.dc.CloudObject{D(){return this.db.cb(this,olympe.sc.Td.j)[0]}j(){const a=Zn(this);return olympe.dc.CloudObject.get(a)}tc(){return this.j().tc()}toString(){const a=Zn(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Td.O=olympe.dc.na.j('0163c9ae01f2d6e9ca49',olympe.sc.Td);
1157
- olympe.sc.Td.j=olympe.sc.Td.O.ra('0169b5a8a33144fb0b49');R(olympe.dc.CloudObject.O,olympe.sc.Td.j);olympe.sc.Td.prototype.D.K=new olympe.C.J(()=>String,[]);olympe.sc.Td.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.hp=class extends olympe.dm.Kb{ue(){return olympe.sc.we.Ne.Bh}};olympe.sc.hp.O=olympe.dc.na.j('0163a68ce44f3d1fa84c',olympe.sc.hp);olympe.sc.Ac=class extends olympe.dm.BrickMetadata{};olympe.sc.Ac.O=olympe.dc.na.j('016324fde11a836f76c2',olympe.sc.Ac);olympe.sc.Ac.j=olympe.sc.Ac.O.ra('016324fde11a836087c2');olympe.sc.Ac.O.j=function(a,b){return $l(a,null!=b?b:'New type',olympe.sc.Ac).W()};let $n=null,ao=null,bo=[];
1158
- function co(a,b){$n=a;const c=olympe.C.Za();return olympe.dc.rd.from(a).bb(olympe.sc.pa.Yc.j).bb(olympe.sc.sf.j.$b()).lb({ii:'__code-as-data__'}).then(d=>{let e;null==(e=bo)||e.forEach(f=>f());bo=null;ao=d;if(null!==d){if(b){const f=olympe.dc.ga();return new Promise(g=>{xi(c,d,h=>{h=f.vi(h)?h:f.model(h);return null!==h&&f.Nb(h,olympe.sc.Ac)},{ao:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ha.Xa('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
1159
- g()}))})}olympe.ha.Xa('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ha.Xa('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{bo=null;throw d;})}function Kf(){return null===bo?Promise.resolve():new Promise(a=>{bo.push(()=>a())})}olympe.sc.sf=class extends olympe.dc.CloudObject{};olympe.sc.sf.O=olympe.dc.na.j('017b3aa8fae1e3d044dc',olympe.sc.sf);olympe.sc.sf.j=olympe.sc.sf.O.ra('017b3aa8fd1659291b92');
1160
- olympe.sc.sf.D=olympe.sc.sf.O.ra('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.na.j('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Og=class extends olympe.sc.Map{};olympe.sc.Og.O=olympe.dc.na.j('01631aacd8276ea98490',olympe.sc.Og);olympe.sc.File=class extends olympe.dm.File{static Fx(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.vt(a,e,b,c,d);return e}static Gx(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.$n(a,e,b,c,d);return e}static vt(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.$n(a,b,c,d,e)}static $n(a,b,c,d,e){const f=olympe.dc.ga(),g=f.Ja(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Tf(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
1161
- h=new Date;c=(new Map).set(olympe.dm.File.fileNameProp,null!=c?c:'file').set(olympe.dm.File.urlProp,d).set(olympe.dm.File.modificationDateProp,h).set(olympe.dm.File.mimeTypeProp,null!=e?e:'application/data');g&&null!==f.Pa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.j,!1);a.lt(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.$n;olympe.sc.File.setContent=olympe.sc.File.vt;olympe.sc.File.createFromURL=olympe.sc.File.Gx;olympe.sc.File.createFromContent=olympe.sc.File.Fx;
1162
- olympe.sc.File.O=cg(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Kg=class extends olympe.sc.File{H(){const a=olympe.C.bc(olympe.C.Sa);this.hl(b=>{a.update(olympe.C.wb(b))});return a.tb()}};olympe.sc.Kg.O=cg(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Kg);olympe.sc.Kg.O.j=olympe.sc.File.D.bind(null,olympe.sc.Kg);olympe.sc.Kg.prototype.H.K=olympe.C.J.D;olympe.sc.Nc=class extends olympe.sc.File{H(){return this.vb(olympe.sc.Nc.fontFamilyProp)}N(){return this.vb(olympe.sc.Nc.F)}R(){return this.xd(olympe.sc.Nc.H)}};olympe.sc.Nc.O=cg(olympe.sc.File,'01647e113043c637b541',olympe.sc.Nc);olympe.sc.Nc.fontFamilyProp=olympe.sc.Nc.O.ja('01647e35ecd24ef0b88d');olympe.sc.Nc.F=olympe.sc.Nc.O.ja('01647e677f5d1cfbdf42');olympe.sc.Nc.H=olympe.sc.Nc.O.ja('01647e6780999bf8bd25');
1163
- olympe.sc.Nc.O.j=(a,b,c,d)=>{c=olympe.sc.File.D(olympe.sc.Nc,a,b,c,d);a.update(c,olympe.sc.Nc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Nc.prototype.H.K=olympe.C.J.D;olympe.sc.Nc.prototype.N.K=olympe.C.J.D;olympe.sc.Nc.prototype.R.K=olympe.C.J.F;olympe.sc.bi=class extends olympe.sc.File{};olympe.sc.bi.O=cg(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.bi);olympe.sc.bi.O.j=olympe.sc.File.D.bind(null,olympe.sc.bi);olympe.sc.ns=class extends olympe.dc.CloudObject{};olympe.sc.ns.O=olympe.dc.na.j('016421bb3797e22d1c4e',olympe.sc.ns);olympe.sc.logic={};olympe.sc.logic.Mp=(a,b)=>a===b?0:a>b?1:-1;
1164
- olympe.sc.logic.aC=(a,b,c,d,e,f,g)=>{const h=b.W();b=olympe.C.Qa(b.getType().W());let k,l;if(b===olympe.dc.ea(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.vb(h).toLowerCase();else if(b===olympe.dc.ea(olympe.dm.Number))k=c.valueOf(),l=p=>p.xd(h);else if(b===olympe.dc.ea(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.C.ta([p.Dj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ga().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
1165
- return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.Mp(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.Mp(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.bl().filter(p=>olympe.C.ta([l(p)],q=>{q=n(q.valueOf(),k);return olympe.C.Rb(d.valueOf()?1===q:0<=q)},olympe.C.ba,'FilterList ListDefBuilder Filter TransformFlows')).Xi())};
1166
- olympe.sc.logic.OE=(a,b)=>{if(a instanceof olympe.C.$)return a;if(a instanceof olympe.C.Sa)return a.zt();if(a instanceof olympe.C.ba)return a.Vs();if('string'===typeof a||'number'===typeof a)return olympe.C.qa(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.C.$.Aq};olympe.sc.logic.Ra={};function eo(a){hg(a.O,(b,c)=>{b=b.create(a.O.D);X(b,olympe.dc.CloudObject.nameProp,c);return b.W()})}olympe.sc.logic.Ra.Ap=class{constructor(a,b,c){this.O=olympe.dc.na.j(a,b,...c);eo(this)}W(){return this.O.W()}};olympe.sc.logic.Ra.Ap.ya=[olympe.dc.Ye];const fo=Object.create(null),go=new Map;function ho(a){if(void 0===fo[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return eg(a)}function io(a,b,c=olympe.sc.logic.Function){if(go.has(a))throw c=ho(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.na.j(a,b,...[]);go.set(a,{O:d,eF:b,LE:c});return d}
1167
- olympe.sc.logic.na=class{constructor(){}static j(a,b,...c){if(fo[a])throw c=ho(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Ra.Ap(a,b,[olympe.sc.P.Ca].concat(c));return fo[a]=b}};olympe.sc.logic.QA=class{};olympe.sc.logic.ak=class extends olympe.dc.CloudObject{};olympe.sc.logic.ak.O=olympe.dc.na.j('01621fb84e320000cf00',olympe.sc.logic.ak);function pn(a,b,c){return new olympe.sc.logic.Error(a,b,c)}olympe.sc.logic.Error=class extends Error{constructor(a,b,c){super(a);this.code=b;this.j=null!=c?c:null}static create(a,b){return new olympe.sc.logic.Error(a,b)}Gy(){return this.message}Aj(){return this.code}re(){let a;return null!=(a=this.j)?a:''}toString(){return`${this.message}\nError found in:\n${this.re()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.re;
1168
- olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Aj;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Gy;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.Ni=class extends olympe.sc.logic.ak{};olympe.sc.logic.Ni.O=olympe.dc.na.j('016eeb5ede9f3094d8f0',olympe.sc.logic.Ni);olympe.sc.logic.qd=class extends olympe.dc.CloudObject{j(){return this.Sc(olympe.sc.logic.qd.j,olympe.dc.CloudObject)}};olympe.sc.logic.qd.O=olympe.dc.na.j('016ac4f59ee8ea2081ba',olympe.sc.logic.qd);olympe.sc.logic.qd.D=olympe.sc.logic.qd.O.ja('017bc044aeacce7ffc8f');olympe.sc.logic.qd.j=olympe.sc.logic.qd.O.ra('016ac4f5a0091c4790e2');R(olympe.dc.CloudObject.O,olympe.sc.logic.qd.j);olympe.sc.logic.qd.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Uh=class extends olympe.sc.logic.qd{};olympe.sc.logic.Uh.O=olympe.dc.na.j('016ac4f59c592b862457',olympe.sc.logic.Uh);olympe.sc.logic.Uh.F=olympe.sc.sd.j.$b();olympe.sc.logic.Uh.O.j=(a,b,c,d,e)=>{b=$l(a,b||'New Predefined Input',olympe.sc.logic.Uh,olympe.sc.logic.ub);X(b,olympe.sc.logic.qd.D,e);a.Oa(olympe.sc.logic.qd.j,b,c);a.Oa(olympe.sc.sd.j,d,b);return b.W()};olympe.sc.logic.Rg=class extends olympe.sc.logic.qd{};olympe.sc.logic.Rg.O=olympe.dc.na.j('016ac4f59dd99f5df3e1',olympe.sc.logic.Rg);olympe.sc.logic.Rg.F=R(olympe.sc.logic.Rg.O,olympe.sc.sd.D);olympe.sc.logic.Rg.O.j=(a,b,c,d,e)=>{b=$l(a,b||'New Predefined Output',olympe.sc.logic.Rg,olympe.sc.logic.Fb);X(b,olympe.sc.logic.qd.D,e);a.Oa(olympe.sc.logic.qd.j,b,c);a.Oa(olympe.sc.sd.D,d,b);return b.W()};olympe.sc.logic.Bd=class extends olympe.sc.Ua{ue(){return olympe.sc.we.Ne.Pr}X(){return this.Dn().bl().Nb([olympe.sc.logic.Function]).and().zd().Nb([olympe.sc.logic.nd,olympe.sc.logic.ed]).Xi()}N(){const a=olympe.dc.ea(olympe.sc.logic.Ni);return this.db.cb(this,olympe.sc.logic.Bd.D).filter(b=>this.db.Ib(b,olympe.sc.logic.Sb.typeRel)===a)}j(a){const b=this.db.An(this,[olympe.sc.Ua.F],c=>this.db.model(c)===olympe.dc.ea(a));return b?olympe.dc.CloudObject.get(b):null}D(a){const b=this.db.An(this,[olympe.sc.Ua.D],
1169
- c=>this.db.model(c)===olympe.dc.ea(a));return b?olympe.dc.CloudObject.get(b):null}H(a){if(!this.ti())return super.H(a);const b=olympe.dc.ea(olympe.sc.logic.ak),c=olympe.dc.ea(olympe.sc.logic.Ni);return Qn(this).map(d=>{switch(this.db.Ib(d,olympe.sc.logic.Sb.typeRel)){case b:return a.eo.bind(a,d);case c:return a.throw.bind(a);default:return a.set.bind(a,d)}})}F(a){if(!this.ti())return super.F(a);const b=Pn(this);return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
1170
- c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Bd.O=io('01621fb84e320000f000',olympe.sc.logic.Bd,olympe.sc.logic.Function);olympe.sc.logic.Bd.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Bd.prototype.D.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);let jo=null;function ko(){if(null===jo){let a;jo=null!=(a=olympe.V.getParameter('sc.action.experimental'))?a:!1}return jo}
1171
- olympe.sc.logic.$f=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63229782039429f')}Z(){return this.D('016ac6322acf67eebfe7')}da(){return this.oq().bl().bb(olympe.sc.logic.Sb.typeRel).ol(olympe.sc.logic.Ni).Xi().Bf().Pn(olympe.C.$.ZERO)}F(a){if(this.ti()||ko()){const b=this.R().W();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:Pn(this).filter(d=>d!==b).map(d=>a.get(d))))}return super.F(a)}};olympe.sc.logic.$f.j='016ac63229782039429f';olympe.sc.logic.$f.N='016ac6322acf67eebfe7';
1172
- olympe.sc.logic.$f.O=io('01621fb84e320000a000',olympe.sc.logic.$f,olympe.sc.logic.Action);olympe.sc.logic.$f.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.$f.prototype.Z.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.$f.prototype.da.K=olympe.C.J.N;olympe.sc.logic.So=class extends olympe.sc.logic.Bd{};olympe.sc.logic.So.O=io('01621fb84e320000f011',olympe.sc.logic.So);olympe.sc.logic.Ro=class extends olympe.sc.logic.$f{};olympe.sc.logic.Ro.O=io('01621fb84e320000f012',olympe.sc.logic.Ro);olympe.sc.logic.Function=class extends olympe.sc.Runnable{R(){return[this.nb]}D(){if(!this.wd().ti())return super.D();const a=olympe.sc.Fg.j.qm,b=olympe.sc.Fg.j.Im,c=this.db,d=new Map,e=this.Vb();c.cb(e,olympe.sc.Ua.F).forEach(f=>{d.set(a+c.name(f),f)});c.cb(e,olympe.sc.Ua.D).forEach(f=>{d.set(b+c.name(f),f)});return d}};olympe.sc.logic.Function.O=olympe.dc.na.j('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.P.Ca);olympe.sc.logic.Sb=class extends olympe.dc.CloudObject{getType(){return this.Sc(olympe.sc.logic.Sb.typeRel,olympe.dc.CloudObject)}j(){return this.xd(olympe.sc.logic.Sb.j)}};olympe.sc.logic.Sb.O=olympe.dc.na.j('0168a431d25001540000',olympe.sc.logic.Sb);olympe.sc.logic.Sb.j=olympe.sc.logic.Sb.O.ja('01740c5d4ae4b520dd01');olympe.sc.logic.Sb.typeRel=olympe.sc.logic.Sb.O.ra('0168a431d3b9b7438424');R(olympe.dc.CloudObject.O,olympe.sc.logic.Sb.typeRel);
1173
- olympe.sc.logic.Sb.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Sb.prototype.j.K=olympe.C.J.F;olympe.sc.logic.ub=class extends olympe.sc.logic.Sb{};olympe.sc.logic.ub.O=olympe.dc.na.j('0168a431d25001540001',olympe.sc.logic.ub);olympe.sc.logic.ub.R=olympe.sc.logic.Sb.O.ja('01740c5d4ae4b520dd02');olympe.sc.logic.ub.N=R(olympe.sc.logic.ub.O,olympe.sc.Ua.F);olympe.sc.logic.ub.D=olympe.sc.logic.ub.O.ra('0168a431d91f2578000b',olympe.dc.ua.ORIGIN);olympe.sc.logic.ub.F=olympe.sc.logic.ub.O.ra('01621fb84e32000000a1',olympe.dc.ua.ORIGIN);
1174
- olympe.sc.logic.ub.H=olympe.sc.logic.ub.O.ra('01621fb84e32000000d1',olympe.dc.ua.ORIGIN);olympe.sc.logic.ub.O.j=function(a,b,c,d,e,f=olympe.sc.logic.ub){f=a.create(f);X(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Oa(olympe.sc.logic.Sb.typeRel,f,c);void 0!==e&&X(f,olympe.sc.logic.Sb.j,e);d&&a.Oa(olympe.sc.Ua.F,d,f);return f.W()};olympe.sc.logic.Fb=class extends olympe.sc.logic.Sb{};olympe.sc.logic.Fb.O=olympe.dc.na.j('0168a431d25001540002',olympe.sc.logic.Fb);olympe.sc.logic.Fb.N=R(olympe.sc.logic.Fb.O,olympe.sc.Ua.D);olympe.sc.logic.Fb.D=olympe.sc.logic.Fb.O.ra('0168a431d91f25780003',olympe.dc.ua.ORIGIN);olympe.sc.logic.Fb.H=olympe.sc.logic.Fb.O.ra('01621fb84e32000000a2',olympe.dc.ua.ORIGIN);olympe.sc.logic.Fb.F=olympe.sc.logic.Fb.O.ra('01621fb84e32000000d2',olympe.dc.ua.ORIGIN);
1175
- olympe.sc.logic.Fb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.Fb){f=a.create(f);X(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Oa(olympe.sc.logic.Sb.typeRel,f,c);void 0!==e&&X(f,olympe.sc.logic.Sb.j,e);d&&a.Oa(olympe.sc.Ua.D,d,f);return f.W()};olympe.sc.logic.nd=class extends olympe.sc.logic.Function{run(a){Sn(this,a);const b=a.getParent(),c=this.db.Ib(this,olympe.sc.logic.nd.H),d=this.db.Ib(this,olympe.sc.logic.nd.F);a.on(c,e=>b.set(d,e),this.tag)}j(){return this.vg(olympe.sc.logic.nd.H).Cc()}sa(){return this.vg(olympe.sc.logic.nd.F).Cc()}};olympe.sc.logic.nd.O=olympe.dc.na.j('01621fb84e32000000a0',olympe.sc.logic.nd,olympe.sc.P.Ca);olympe.sc.logic.nd.H=R(olympe.sc.logic.nd.O,olympe.sc.logic.ub.F);
1176
- olympe.sc.logic.nd.F=R(olympe.sc.logic.nd.O,olympe.sc.logic.Fb.H);olympe.sc.logic.nd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.nd);a.Oa(olympe.sc.logic.nd.F,b,c);return b.W()};olympe.sc.logic.nd.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.nd.prototype.sa.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.ed=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Ib(this,olympe.sc.logic.ed.F),d=this.db.Ib(this,olympe.sc.logic.ed.H);b.on(c,e=>a.set(d,e),b.T())}sa(){return this.vg(olympe.sc.logic.ed.F).Cc()}j(){return this.vg(olympe.sc.logic.ed.H).Cc()}};olympe.sc.logic.ed.O=olympe.dc.na.j('01621fb84e32000000d0',olympe.sc.logic.ed,olympe.sc.P.Ca);olympe.sc.logic.ed.F=R(olympe.sc.logic.ed.O,olympe.sc.logic.ub.H);olympe.sc.logic.ed.H=R(olympe.sc.logic.ed.O,olympe.sc.logic.Fb.F);
1177
- olympe.sc.logic.ed.O.j=function(a,b,c){b=a.create(olympe.sc.logic.ed);a.Oa(olympe.sc.logic.ed.F,b,c);return b.W()};olympe.sc.logic.ed.prototype.sa.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.ed.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);function Yn(a,b,c){var d;const e=null!=(d=a.db.Ib(a,olympe.sc.logic.pb.R))?d:a.db.Ib(a,olympe.sc.logic.pb.H),f=a.db.Ib(a,olympe.sc.logic.pb.N);if(null!==e&&null!==f){d=a.db.Tf(lo(a),olympe.dm.Ie)?new olympe.C.Wb('Pipe Context'):null;const k=a.j.bind(a,c,d);let l;const n=b.ul(f,p=>{let q;null==(q=l)||q();l=p.on(e,k,f)});return()=>{k(null);n();let p;null==(p=l)||p()}}const g=k=>c(olympe.dc.ib.tc(k)),h=fh(a.db,a,olympe.sc.logic.pb.valueProp,g);return()=>{g(null);gh(a.db,a,olympe.sc.logic.pb.valueProp,
1178
- h)}}function lo(a){let b=null,c=a.db.Ib(a,olympe.sc.logic.pb.D);c?b=a.db.Ib(c,olympe.dm.Property.typeRel):(c=a.db.Ib(a,olympe.sc.logic.pb.j))&&(b=a.db.Ib(c,olympe.sc.logic.Sb.typeRel));return b||olympe.dc.ea(olympe.dc.CloudObject)}
1179
- olympe.sc.logic.pb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.G=c}j(a,b,c){const d=olympe.sc.tj(c);null==b||b.rg();b&&d instanceof olympe.dm.Ie?null==b||b.run(()=>{olympe.C.Vc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.Sf(olympe.sc.logic.pb.valueProp,a||olympe.dc.ib.tj,Object)}getType(){const a=this.transform(olympe.sc.logic.pb.j,olympe.sc.logic.Sb.typeRel);a.Qd(olympe.dc.CloudObject);return a.Ic()}Yy(){return this.Sc(olympe.sc.logic.pb.N,olympe.dc.CloudObject)}Wy(){return this.Sc(olympe.sc.logic.pb.R,
1180
- olympe.sc.logic.Fb)}Xy(){return this.Sc(olympe.sc.logic.pb.H,olympe.dm.Property)}ty(){return this.Sc(olympe.sc.logic.pb.F,olympe.dc.CloudObject)}qy(){return this.Sc(olympe.sc.logic.pb.j,olympe.sc.logic.ub)}sy(){return this.Sc(olympe.sc.logic.pb.D,olympe.dm.Property)}};olympe.sc.logic.pb.O=olympe.dc.na.j('0168a431d91f25780000',olympe.sc.logic.pb,olympe.sc.P.Ca);olympe.sc.logic.pb.valueProp=olympe.sc.logic.pb.O.ja('0168a431d91f25780001');olympe.sc.logic.pb.N=olympe.sc.logic.pb.O.ra('0168a431d91f25780002');
1142
+ olympe.sc.$a.dw=class extends olympe.sc.$a.pc{constructor(a){super();this.j=a;this.ha=olympe.dc.ha();this.H=new Set}getType(){return olympe.sc.$a.pc.D.jg}process(a,b,c,...d){var e=On.um,f=On.Lm,g=On.Zv;const h=On.INIT,k=On.Xj,l=On.Yj,n=On.dk,p=On.Zd;c=On.Rv;if(b===olympe.sc.$a.pc.j.Yg){const [q,r]=d;b=(d=a.kf())?olympe.dc.ha().Nb(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ha().Nb(d,olympe.sc.ui.UC):!1;b?(g=this.ha.Ib(q,olympe.dm.Property.typeRel),b=this.ha.Nb(q,olympe.sc.logic.ub),d=this.ha.Nb(q,olympe.sc.logic.Fb),
1143
+ Nn(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ha.Nb(q,olympe.dm.Property),f=this.ha.Ib(q,olympe.dm.Property.typeRel),Nn(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.$a.pc.j.INIT?Nn(this,a,h):b===olympe.sc.$a.pc.j.Xj?Nn(this,a,k):b===olympe.sc.$a.pc.j.Yj?Nn(this,a,l):b===olympe.sc.$a.pc.j.dk?Nn(this,a,n):b===olympe.sc.$a.pc.j.Zd&&Nn(this,a,p)}};
1144
+ const On={um:'input',Lm:'output',Zv:'prop',INIT:'init',Xj:'clear',Yj:'cleared',dk:'destroy',Zd:'destroyed',Rv:'other'};olympe.sc.$a.kw=class extends olympe.sc.$a.pc{constructor(a){super(1);this.H=a;this.j=new Map;this.db=olympe.dc.ha()}getType(){return olympe.sc.$a.pc.D.Ze}D(){super.D();for(const a of this.j.values())a();this.j.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.$a.pc.j.Yg&&void 0!==d[0]&&null!==d[0]){const e=Mn(c,qn(a,d[0]),a),f=d[1];let g;null==(g=this.j.get(e))||g();this.j.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Vb()instanceof olympe.sc.Ac){const h=jh(this.db,f,()=>{olympe.sc.$d.D(this.H,
1145
+ e,f)});this.j.set(e,()=>{kh(this.db,f,h)})}olympe.sc.$d.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{dv(){return this.xd(this.Mn())}ev(){return this.xd(this.Nn())}kl(){return new olympe.C.Zb(this.xd(this.Mn()),this.xd(this.Nn()))}Mn(){}Nn(){}};olympe.sc.Metadata.O=olympe.dc.na.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.dv.K=olympe.C.J.F;m.ev.K=olympe.C.J.F;m.kl.K=olympe.C.J.R;m.Mn.K=olympe.C.J.j;m.Nn.K=olympe.C.J.j;olympe.sc.gd=class extends olympe.dc.CloudObject{D(){return this.wb(olympe.sc.gd.F)}j(){return this.wb(olympe.sc.gd.j)}};olympe.sc.gd.O=olympe.dc.na.j('01703376c4a81c0e9d90',olympe.sc.gd);olympe.sc.gd.F=olympe.sc.gd.O.ja('01703376c4a81c0e9d91');olympe.sc.gd.j=olympe.sc.gd.O.ja('01703376c4a81c0e9d92');olympe.sc.gd.D=olympe.sc.gd.O.ra('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.gd.D);olympe.sc.gd.prototype.D.K=olympe.C.J.D;olympe.sc.gd.prototype.j.K=olympe.C.J.D;olympe.sc.xe={};olympe.sc.xe.Oe={su:'folders',ow:'screenflow',Qw:'ui-design',Qr:'software-intelligence',Bh:'data-management',HC:'projects'};olympe.sc.Gf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Hd(){return this.xd(olympe.sc.Gf.D)}};olympe.sc.Gf.O=olympe.dc.na.j('019131fb930466a1ad79',olympe.sc.Gf);olympe.sc.Gf.D=olympe.sc.Gf.O.ja('016d1bb681929c2cc3f1');olympe.sc.Gf.j=olympe.sc.Gf.O.ra('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.Gf.j);olympe.sc.Gf.prototype.Hd.K=olympe.C.J.F;olympe.sc.td=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Oe.Qr}j(){return this.cb(olympe.sc.td.j,olympe.sc.logic.Uh)}D(){return this.cb(olympe.sc.td.D,olympe.sc.logic.Rg)}};olympe.sc.td.O=olympe.dc.na.j('011100000000000adef0',olympe.sc.td);olympe.sc.td.j=olympe.sc.td.O.ra('016ac4f59a2917fdef01');olympe.sc.td.D=olympe.sc.td.O.ra('016ac4f59a2917fdef02');olympe.sc.td.O.j=(a,b)=>bm(a,b||'New function signature',olympe.sc.td,olympe.sc.logic.Bd).W();
1146
+ olympe.sc.td.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.td.prototype.D.K=new olympe.C.J(()=>olympe.dc.Aa,[]);function Pn(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function Qn(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Nb(c,olympe.sc.logic.Sb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Pa(c,olympe.sc.logic.Sb.j,!0))?e:0;let f;d=null!=(f=a.db.Pa(d,olympe.sc.logic.Sb.j,!0))?f:0;return c-d});return b}function Rn(a){return Qn(a,a.db.cb(a.tag,olympe.sc.Va.F))}function Sn(a){return Qn(a,a.db.cb(a.tag,olympe.sc.Va.D))}
1147
+ olympe.sc.Va=class extends olympe.dm.BrickMetadata{gv(a,b,c,d,e=!0){e||olympe.ga.Wa('sc').error('parameter own= false ignored, investigate');return olympe.C.wh(M(this.Uf(a,olympe.dc.ib.tj,c)),d)}H(){return[]}F(){return rxjs.of([])}Ty(){return this.cb(olympe.sc.Va.H,olympe.sc.Runnable)}ky(){return this.cb(olympe.sc.Va.R,olympe.sc.Runnable)}ti(){return this.db.Pa(this,olympe.sc.Va.Z)}Rn(){return null!==this.db.Ib(this.tag,olympe.sc.Runnable.j.$b())}fv(){return this.cb(olympe.sc.Va.F,olympe.sc.logic.ub)}pq(){return this.cb(olympe.sc.Va.D,
1148
+ olympe.sc.logic.Fb)}N(){return[olympe.sc.Va.Ua]}};olympe.sc.Va.O=olympe.dc.na.j('0112000000000000def0',olympe.sc.Va);olympe.sc.Va.Z=olympe.sc.Va.O.ja('01692aa71f3108454479');olympe.sc.Va.lb=olympe.sc.Va.O.ja('0166446c1f128ebc903a');olympe.sc.Va.Ua=olympe.sc.Va.O.ja('0166446c1f128ebc904e');olympe.sc.Va.H=olympe.sc.Va.O.ra('01692a4af82e8984742c');olympe.sc.Va.R=olympe.sc.Va.O.ra('01692a4af82e8984742d');olympe.sc.Va.X=olympe.sc.Va.O.ra('01692a4af82e8984742e');olympe.sc.Va.F=olympe.sc.Va.O.ra('01621fb84e320000f00a');
1149
+ olympe.sc.Va.D=olympe.sc.Va.O.ra('01621fb84e320000f00b');olympe.sc.Va.Fd=olympe.sc.Va.O.ra('0171838bcfed0000e00e');olympe.sc.Va.hd=olympe.sc.Va.O.ra('0171838bcfed0000a00a');m=olympe.sc.Va.prototype;m.gv.K=olympe.C.J.j;m.Ty.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.ky.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.ti.K=olympe.C.J.j;m.Rn.K=olympe.C.J.j;m.fv.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.pq.K=new olympe.C.J(()=>olympe.dc.Aa,[]);function wn(a){let b;return null!=(b=a.wd().N().map(olympe.dc.ea)[0])?b:null}function Tn(a){const b=new olympe.dc.Ya;a=b.create(a);b.persist(a,!1);b.mb((d,e)=>{d||olympe.ga.Wa('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.Za().onDestroy(()=>{const d=new olympe.dc.Ya;d.delete(c);d.mb()});return c}
1150
+ function Un(a,b){Fn(b.state,a);Pn(a.wd(),b);const c=a.R(),d=Vn(b,c),e=[];c.forEach((f,g)=>{f===a.ia?e[0]=g:f===a.ba&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(Wn(a,b,d[e[0]],d[e[1]]),c[e[0]]=null,c[e[1]]=null);c.forEach((f,g)=>{f&&f.call(a,b,d[g])})}
1151
+ function Xn(a,b){let c,d,e;a.G.j()&&(e=a.db.name(a.Wb()),c=`Brick ${e} successfully run`,d=`Brick ${e} successfully cleared`);const f=Yn(a,b),g=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.fb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.Zw(b.state);l.Cb().run(()=>u(function*(){try{yield a.update(l,k,f)}catch(n){l.throw(n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.G.debug(c):a.G.debug(d),h=>b.throw(h),()=>a.G.debug(`Brick ${e} completed`)));
1152
+ b.onDestroy(g.unsubscribe.bind(g))}function Zn(a,b,c,d){let e=[];const f=T(a.db,b,c,(g,h)=>{if(g){const k=mn(d,h),l=olympe.dc.CloudObject.get(h);l instanceof olympe.sc.logic.ed&&null!==e?e.push(()=>l.run(k)):l.run(k)}else{let k;null==(k=on(d,h))||k.destroy()}});e.forEach(g=>g());e=null;d.Cb().onDestroy(a.db.D.bind(a.db,b,c,f))}function Yn(a,b){return a.wd().H(b)}
1153
+ function Vn(a,b){if(1===b.length)return[(d,e)=>{null!==e?a.set(d,e):a.remove(d)}];const c=b.map(()=>new Map);return c.map(d=>(e,f)=>{null!==f?d.set(e,f):d.delete(e);a:{for(const g of c)if(f=g.get(e),void 0!==f){a.set(e,f);break a}a.remove(e)}})}function Wn(a,b,c,d){b=b.Cb();const e=jh(a.db,a.tag,b.rc((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.ib.tc(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{kh(a.db,a.tag,e)})}
1154
+ olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.Cb().run(()=>{Un(this,a);this.init(a);a.vh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));Xn(this,a);this.F(a)})}wd(){return this.Vb()}init(a){this.onInit(a)}update(a,b,c){const d=this.wd();if(d.ti())this.onUpdate(a,b,c);else this.G.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.T()}`),Zn(this,d,olympe.sc.Va.H,a),this.wa()&&Zn(this,
1155
+ d,olympe.sc.Va.X,a)}F(a){a.fo(olympe.sc.Va.lb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.wd().F(a)}onInit(){}onUpdate(){const a=this.Wb(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.G.error(`No code was found for ${b} (${c}: ${a})\n\n`+'This is probably because the code has not yet been deployed to the environment, or because the package.json does not import the required dependencies.')}onDestroy(){}getInputs(){return Rn(this.wd())}getOutputs(){return Sn(this.wd())}H(){return[]}D(){return null}wa(){return!1}N(a,
1156
+ b,c,d){a=b.tb(a,c,!0);void 0!==d&&olympe.C.wh(a,d);return a}Ua(a,b,c,d,e){olympe.C.Wn([d],f=>{b.set(a,olympe.C.et(f)?f.valueOf():f)});return this.N(a,b,c,e)}R(){return[this.ia,this.ba]}ia(a,b){Wn(this,a,b,null)}ba(a,b){Wn(this,a,null,b)}lb(a,b){const c=this.db,d=olympe.sc.logic.pb.F.$b(),e=olympe.sc.logic.pb.D,f=olympe.sc.logic.pb.j;this.Ls(d,g=>{var h=g.W();if(h=c.Ib(h,e)||c.Ib(h,f))return $n(g,a,b.bind(null,h))})}};olympe.sc.Runnable.O=kg(olympe.dc.na.j('01130000000000ca1100',olympe.sc.Runnable));
1157
+ olympe.sc.Runnable.D=olympe.sc.Runnable.O.ra('01692a4af82e8984742b');olympe.sc.Runnable.j=olympe.sc.Runnable.O.ra('01756a18d4921c103111');olympe.sc.Runnable.N=R(olympe.sc.Runnable.O,olympe.sc.Va.H);olympe.sc.Runnable.R=R(olympe.sc.Runnable.O,olympe.sc.Va.R);olympe.sc.Runnable.X=R(olympe.sc.Runnable.O,olympe.sc.Va.X);R(olympe.sc.Va.O,olympe.sc.Runnable.D);R(olympe.sc.Va.O,olympe.sc.Runnable.j);olympe.sc.Runnable.prototype.wd.K=new olympe.C.J(()=>olympe.sc.Va,[]);
1158
+ olympe.sc.Runnable.prototype.N.K=new olympe.C.J(()=>Object,[]);olympe.sc.Runnable.prototype.Ua.K=olympe.C.J.j;function ao(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Td)return(a=a.D())?a.valueOf():null;if('function'===typeof a.W)return a.W()}return null}olympe.sc.Td=class extends olympe.dc.CloudObject{D(){return this.db.cb(this,olympe.sc.Td.j)[0]}j(){const a=ao(this);return olympe.dc.CloudObject.get(a)}tc(){return this.j().tc()}toString(){const a=ao(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Td.O=olympe.dc.na.j('0163c9ae01f2d6e9ca49',olympe.sc.Td);
1159
+ olympe.sc.Td.j=olympe.sc.Td.O.ra('0169b5a8a33144fb0b49');R(olympe.dc.CloudObject.O,olympe.sc.Td.j);olympe.sc.Td.prototype.D.K=new olympe.C.J(()=>String,[]);olympe.sc.Td.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.ip=class extends olympe.dm.Kb{ve(){return olympe.sc.xe.Oe.Bh}};olympe.sc.ip.O=olympe.dc.na.j('0163a68ce44f3d1fa84c',olympe.sc.ip);olympe.sc.Ac=class extends olympe.dm.BrickMetadata{};olympe.sc.Ac.O=olympe.dc.na.j('016324fde11a836f76c2',olympe.sc.Ac);olympe.sc.Ac.j=olympe.sc.Ac.O.ra('016324fde11a836087c2');olympe.sc.Ac.O.j=function(a,b){return bm(a,null!=b?b:'New type',olympe.sc.Ac).W()};let bo=null,co=null,eo=[];
1160
+ function fo(a,b){bo=a;const c=olympe.C.Za();return olympe.dc.sd.from(a).bb(olympe.sc.pa.Oc.j).bb(olympe.sc.tf.j.$b()).mb({ii:'__code-as-data__'}).then(d=>{let e;null==(e=eo)||e.forEach(f=>f());eo=null;co=d;if(null!==d){if(b){const f=olympe.dc.ha();return new Promise(g=>{zi(c,d,h=>{h=f.vi(h)?h:f.model(h);return null!==h&&f.Nb(h,olympe.sc.Ac)},{bo:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ga.Wa('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
1161
+ g()}))})}olympe.ga.Wa('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ga.Wa('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{eo=null;throw d;})}function Mf(){return null===eo?Promise.resolve():new Promise(a=>{eo.push(()=>a())})}olympe.sc.tf=class extends olympe.dc.CloudObject{};olympe.sc.tf.O=olympe.dc.na.j('017b3aa8fae1e3d044dc',olympe.sc.tf);olympe.sc.tf.j=olympe.sc.tf.O.ra('017b3aa8fd1659291b92');
1162
+ olympe.sc.tf.D=olympe.sc.tf.O.ra('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.na.j('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Og=class extends olympe.sc.Map{};olympe.sc.Og.O=olympe.dc.na.j('01631aacd8276ea98490',olympe.sc.Og);olympe.sc.File=class extends olympe.dm.File{static Gx(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.vt(a,e,b,c,d);return e}static Hx(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.ao(a,e,b,c,d);return e}static vt(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.ao(a,b,c,d,e)}static ao(a,b,c,d,e){const f=olympe.dc.ha(),g=f.Ja(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Vf(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
1163
+ h=new Date;c=(new Map).set(olympe.dm.File.fileNameProp,null!=c?c:'file').set(olympe.dm.File.urlProp,d).set(olympe.dm.File.modificationDateProp,h).set(olympe.dm.File.mimeTypeProp,null!=e?e:'application/data');g&&null!==f.Pa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.j,!1);a.lt(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.ao;olympe.sc.File.setContent=olympe.sc.File.vt;olympe.sc.File.createFromURL=olympe.sc.File.Hx;olympe.sc.File.createFromContent=olympe.sc.File.Gx;
1164
+ olympe.sc.File.O=eg(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Kg=class extends olympe.sc.File{H(){const a=olympe.C.bc(olympe.C.Sa);this.hl(b=>{a.update(olympe.C.xb(b))});return a.tb()}};olympe.sc.Kg.O=eg(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Kg);olympe.sc.Kg.O.j=olympe.sc.File.D.bind(null,olympe.sc.Kg);olympe.sc.Kg.prototype.H.K=olympe.C.J.D;olympe.sc.Pc=class extends olympe.sc.File{H(){return this.wb(olympe.sc.Pc.fontFamilyProp)}N(){return this.wb(olympe.sc.Pc.F)}R(){return this.xd(olympe.sc.Pc.H)}};olympe.sc.Pc.O=eg(olympe.sc.File,'01647e113043c637b541',olympe.sc.Pc);olympe.sc.Pc.fontFamilyProp=olympe.sc.Pc.O.ja('01647e35ecd24ef0b88d');olympe.sc.Pc.F=olympe.sc.Pc.O.ja('01647e677f5d1cfbdf42');olympe.sc.Pc.H=olympe.sc.Pc.O.ja('01647e6780999bf8bd25');
1165
+ olympe.sc.Pc.O.j=(a,b,c,d)=>{c=olympe.sc.File.D(olympe.sc.Pc,a,b,c,d);a.update(c,olympe.sc.Pc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Pc.prototype.H.K=olympe.C.J.D;olympe.sc.Pc.prototype.N.K=olympe.C.J.D;olympe.sc.Pc.prototype.R.K=olympe.C.J.F;olympe.sc.bi=class extends olympe.sc.File{};olympe.sc.bi.O=eg(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.bi);olympe.sc.bi.O.j=olympe.sc.File.D.bind(null,olympe.sc.bi);olympe.sc.ps=class extends olympe.dc.CloudObject{};olympe.sc.ps.O=olympe.dc.na.j('016421bb3797e22d1c4e',olympe.sc.ps);olympe.sc.logic={};olympe.sc.logic.Np=(a,b)=>a===b?0:a>b?1:-1;
1166
+ olympe.sc.logic.bC=(a,b,c,d,e,f,g)=>{const h=b.W();b=olympe.C.Qa(b.getType().W());let k,l;if(b===olympe.dc.ea(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.wb(h).toLowerCase();else if(b===olympe.dc.ea(olympe.dm.Number))k=c.valueOf(),l=p=>p.xd(h);else if(b===olympe.dc.ea(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.C.sa([p.Dj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ha().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
1167
+ return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.Np(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.Np(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.bl().filter(p=>olympe.C.sa([l(p)],q=>{q=n(q.valueOf(),k);return olympe.C.Rb(d.valueOf()?1===q:0<=q)},olympe.C.da,'FilterList ListDefBuilder Filter TransformFlows')).Xi())};
1168
+ olympe.sc.logic.PE=(a,b)=>{if(a instanceof olympe.C.$)return a;if(a instanceof olympe.C.Sa)return a.zt();if(a instanceof olympe.C.da)return a.Ws();if('string'===typeof a||'number'===typeof a)return olympe.C.qa(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.C.$.Bq};olympe.sc.logic.Ra={};function go(a){jg(a.O,(b,c)=>{b=b.create(a.O.D);X(b,olympe.dc.CloudObject.nameProp,c);return b.W()})}olympe.sc.logic.Ra.Bp=class{constructor(a,b,c){this.O=olympe.dc.na.j(a,b,...c);go(this)}W(){return this.O.W()}};olympe.sc.logic.Ra.Bp.ya=[olympe.dc.Ye];const ho=Object.create(null),io=new Map;function jo(a){if(void 0===ho[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return gg(a)}function ko(a,b,c=olympe.sc.logic.Function){if(io.has(a))throw c=jo(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.na.j(a,b,...[]);io.set(a,{O:d,fF:b,ME:c});return d}
1169
+ olympe.sc.logic.na=class{constructor(){}static j(a,b,...c){if(ho[a])throw c=jo(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Ra.Bp(a,b,[olympe.sc.P.Da].concat(c));return ho[a]=b}};olympe.sc.logic.RA=class{};olympe.sc.logic.ak=class extends olympe.dc.CloudObject{};olympe.sc.logic.ak.O=olympe.dc.na.j('01621fb84e320000cf00',olympe.sc.logic.ak);function rn(a,b,c){return new olympe.sc.logic.Error(a,b,c)}olympe.sc.logic.Error=class extends Error{constructor(a,b,c){super(a);this.code=b;this.j=null!=c?c:null}static create(a,b){return new olympe.sc.logic.Error(a,b)}Hy(){return this.message}Aj(){return this.code}se(){let a;return null!=(a=this.j)?a:''}toString(){return`${this.message}\nError found in:\n${this.se()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.se;
1170
+ olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Aj;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Hy;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.Ni=class extends olympe.sc.logic.ak{};olympe.sc.logic.Ni.O=olympe.dc.na.j('016eeb5ede9f3094d8f0',olympe.sc.logic.Ni);olympe.sc.logic.rd=class extends olympe.dc.CloudObject{j(){return this.Tc(olympe.sc.logic.rd.j,olympe.dc.CloudObject)}};olympe.sc.logic.rd.O=olympe.dc.na.j('016ac4f59ee8ea2081ba',olympe.sc.logic.rd);olympe.sc.logic.rd.D=olympe.sc.logic.rd.O.ja('017bc044aeacce7ffc8f');olympe.sc.logic.rd.j=olympe.sc.logic.rd.O.ra('016ac4f5a0091c4790e2');R(olympe.dc.CloudObject.O,olympe.sc.logic.rd.j);olympe.sc.logic.rd.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Uh=class extends olympe.sc.logic.rd{};olympe.sc.logic.Uh.O=olympe.dc.na.j('016ac4f59c592b862457',olympe.sc.logic.Uh);olympe.sc.logic.Uh.F=olympe.sc.td.j.$b();olympe.sc.logic.Uh.O.j=(a,b,c,d,e)=>{b=bm(a,b||'New Predefined Input',olympe.sc.logic.Uh,olympe.sc.logic.ub);X(b,olympe.sc.logic.rd.D,e);a.Oa(olympe.sc.logic.rd.j,b,c);a.Oa(olympe.sc.td.j,d,b);return b.W()};olympe.sc.logic.Rg=class extends olympe.sc.logic.rd{};olympe.sc.logic.Rg.O=olympe.dc.na.j('016ac4f59dd99f5df3e1',olympe.sc.logic.Rg);olympe.sc.logic.Rg.F=R(olympe.sc.logic.Rg.O,olympe.sc.td.D);olympe.sc.logic.Rg.O.j=(a,b,c,d,e)=>{b=bm(a,b||'New Predefined Output',olympe.sc.logic.Rg,olympe.sc.logic.Fb);X(b,olympe.sc.logic.rd.D,e);a.Oa(olympe.sc.logic.rd.j,b,c);a.Oa(olympe.sc.td.D,d,b);return b.W()};olympe.sc.logic.Bd=class extends olympe.sc.Va{ve(){return olympe.sc.xe.Oe.Qr}Z(){return this.Gn().bl().Nb([olympe.sc.logic.Function]).and().zd().Nb([olympe.sc.logic.od,olympe.sc.logic.ed]).Xi()}N(){const a=olympe.dc.ea(olympe.sc.logic.Ni);return this.db.cb(this,olympe.sc.logic.Bd.D).filter(b=>this.db.Ib(b,olympe.sc.logic.Sb.typeRel)===a)}j(a){const b=this.db.Dn(this,[olympe.sc.Va.F],c=>this.db.model(c)===olympe.dc.ea(a));return b?olympe.dc.CloudObject.get(b):null}D(a){const b=this.db.Dn(this,[olympe.sc.Va.D],
1171
+ c=>this.db.model(c)===olympe.dc.ea(a));return b?olympe.dc.CloudObject.get(b):null}H(a){if(!this.ti())return super.H(a);const b=olympe.dc.ea(olympe.sc.logic.ak),c=olympe.dc.ea(olympe.sc.logic.Ni);return Sn(this).map(d=>{switch(this.db.Ib(d,olympe.sc.logic.Sb.typeRel)){case b:return a.fo.bind(a,d);case c:return a.throw.bind(a);default:return a.set.bind(a,d)}})}F(a){if(!this.ti())return super.F(a);const b=Rn(this);return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
1172
+ c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Bd.O=ko('01621fb84e320000f000',olympe.sc.logic.Bd,olympe.sc.logic.Function);olympe.sc.logic.Bd.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Bd.prototype.D.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);let lo=null;function mo(){if(null===lo){let a;lo=null!=(a=olympe.V.getParameter('sc.action.experimental'))?a:!1}return lo}
1173
+ olympe.sc.logic.ag=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63229782039429f')}X(){return this.D('016ac6322acf67eebfe7')}ba(){return this.pq().bl().bb(olympe.sc.logic.Sb.typeRel).pl(olympe.sc.logic.Ni).Xi().Cf().Sn(olympe.C.$.ZERO)}F(a){if(this.ti()||mo()){const b=this.R().W();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:Rn(this).filter(d=>d!==b).map(d=>a.get(d))))}return super.F(a)}};olympe.sc.logic.ag.j='016ac63229782039429f';olympe.sc.logic.ag.N='016ac6322acf67eebfe7';
1174
+ olympe.sc.logic.ag.O=ko('01621fb84e320000a000',olympe.sc.logic.ag,olympe.sc.logic.Action);olympe.sc.logic.ag.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.ag.prototype.X.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.ag.prototype.ba.K=olympe.C.J.N;olympe.sc.logic.To=class extends olympe.sc.logic.Bd{};olympe.sc.logic.To.O=ko('01621fb84e320000f011',olympe.sc.logic.To);olympe.sc.logic.So=class extends olympe.sc.logic.ag{};olympe.sc.logic.So.O=ko('01621fb84e320000f012',olympe.sc.logic.So);olympe.sc.logic.Function=class extends olympe.sc.Runnable{R(){return[this.lb]}D(){if(!this.wd().ti())return super.D();const a=olympe.sc.Fg.j.um,b=olympe.sc.Fg.j.Lm,c=this.db,d=new Map,e=this.Wb();c.cb(e,olympe.sc.Va.F).forEach(f=>{d.set(a+c.name(f),f)});c.cb(e,olympe.sc.Va.D).forEach(f=>{d.set(b+c.name(f),f)});return d}};olympe.sc.logic.Function.O=olympe.dc.na.j('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.P.Da);olympe.sc.logic.Sb=class extends olympe.dc.CloudObject{getType(){return this.Tc(olympe.sc.logic.Sb.typeRel,olympe.dc.CloudObject)}j(){return this.xd(olympe.sc.logic.Sb.j)}};olympe.sc.logic.Sb.O=olympe.dc.na.j('0168a431d25001540000',olympe.sc.logic.Sb);olympe.sc.logic.Sb.j=olympe.sc.logic.Sb.O.ja('01740c5d4ae4b520dd01');olympe.sc.logic.Sb.typeRel=olympe.sc.logic.Sb.O.ra('0168a431d3b9b7438424');R(olympe.dc.CloudObject.O,olympe.sc.logic.Sb.typeRel);
1175
+ olympe.sc.logic.Sb.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Sb.prototype.j.K=olympe.C.J.F;olympe.sc.logic.ub=class extends olympe.sc.logic.Sb{};olympe.sc.logic.ub.O=olympe.dc.na.j('0168a431d25001540001',olympe.sc.logic.ub);olympe.sc.logic.ub.R=olympe.sc.logic.Sb.O.ja('01740c5d4ae4b520dd02');olympe.sc.logic.ub.N=R(olympe.sc.logic.ub.O,olympe.sc.Va.F);olympe.sc.logic.ub.D=olympe.sc.logic.ub.O.ra('0168a431d91f2578000b',olympe.dc.ta.ORIGIN);olympe.sc.logic.ub.F=olympe.sc.logic.ub.O.ra('01621fb84e32000000a1',olympe.dc.ta.ORIGIN);
1176
+ olympe.sc.logic.ub.H=olympe.sc.logic.ub.O.ra('01621fb84e32000000d1',olympe.dc.ta.ORIGIN);olympe.sc.logic.ub.O.j=function(a,b,c,d,e,f=olympe.sc.logic.ub){f=a.create(f);X(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Oa(olympe.sc.logic.Sb.typeRel,f,c);void 0!==e&&X(f,olympe.sc.logic.Sb.j,e);d&&a.Oa(olympe.sc.Va.F,d,f);return f.W()};olympe.sc.logic.Fb=class extends olympe.sc.logic.Sb{};olympe.sc.logic.Fb.O=olympe.dc.na.j('0168a431d25001540002',olympe.sc.logic.Fb);olympe.sc.logic.Fb.N=R(olympe.sc.logic.Fb.O,olympe.sc.Va.D);olympe.sc.logic.Fb.D=olympe.sc.logic.Fb.O.ra('0168a431d91f25780003',olympe.dc.ta.ORIGIN);olympe.sc.logic.Fb.H=olympe.sc.logic.Fb.O.ra('01621fb84e32000000a2',olympe.dc.ta.ORIGIN);olympe.sc.logic.Fb.F=olympe.sc.logic.Fb.O.ra('01621fb84e32000000d2',olympe.dc.ta.ORIGIN);
1177
+ olympe.sc.logic.Fb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.Fb){f=a.create(f);X(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Oa(olympe.sc.logic.Sb.typeRel,f,c);void 0!==e&&X(f,olympe.sc.logic.Sb.j,e);d&&a.Oa(olympe.sc.Va.D,d,f);return f.W()};olympe.sc.logic.od=class extends olympe.sc.logic.Function{run(a){Un(this,a);const b=a.getParent(),c=this.db.Ib(this,olympe.sc.logic.od.H),d=this.db.Ib(this,olympe.sc.logic.od.F);a.on(c,e=>b.set(d,e),this.tag)}j(){return this.vg(olympe.sc.logic.od.H).Cc()}X(){return this.vg(olympe.sc.logic.od.F).Cc()}};olympe.sc.logic.od.O=olympe.dc.na.j('01621fb84e32000000a0',olympe.sc.logic.od,olympe.sc.P.Da);olympe.sc.logic.od.H=R(olympe.sc.logic.od.O,olympe.sc.logic.ub.F);
1178
+ olympe.sc.logic.od.F=R(olympe.sc.logic.od.O,olympe.sc.logic.Fb.H);olympe.sc.logic.od.O.j=function(a,b,c){b=a.create(olympe.sc.logic.od);a.Oa(olympe.sc.logic.od.F,b,c);return b.W()};olympe.sc.logic.od.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.od.prototype.X.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.ed=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Ib(this,olympe.sc.logic.ed.F),d=this.db.Ib(this,olympe.sc.logic.ed.H);b.on(c,e=>a.set(d,e),b.T())}X(){return this.vg(olympe.sc.logic.ed.F).Cc()}j(){return this.vg(olympe.sc.logic.ed.H).Cc()}};olympe.sc.logic.ed.O=olympe.dc.na.j('01621fb84e32000000d0',olympe.sc.logic.ed,olympe.sc.P.Da);olympe.sc.logic.ed.F=R(olympe.sc.logic.ed.O,olympe.sc.logic.ub.H);olympe.sc.logic.ed.H=R(olympe.sc.logic.ed.O,olympe.sc.logic.Fb.F);
1179
+ olympe.sc.logic.ed.O.j=function(a,b,c){b=a.create(olympe.sc.logic.ed);a.Oa(olympe.sc.logic.ed.F,b,c);return b.W()};olympe.sc.logic.ed.prototype.X.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.ed.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);function $n(a,b,c){var d;const e=null!=(d=a.db.Ib(a,olympe.sc.logic.pb.R))?d:a.db.Ib(a,olympe.sc.logic.pb.H),f=a.db.Ib(a,olympe.sc.logic.pb.N);if(null!==e&&null!==f){d=a.db.Vf(no(a),olympe.dm.Je)?new olympe.C.Xb('Pipe Context'):null;const k=a.j.bind(a,c,d);let l;const n=b.vl(f,p=>{let q;null==(q=l)||q();l=p.on(e,k,f)});return()=>{k(null);n();let p;null==(p=l)||p()}}const g=k=>c(olympe.dc.ib.tc(k)),h=hh(a.db,a,olympe.sc.logic.pb.valueProp,g);return()=>{g(null);ih(a.db,a,olympe.sc.logic.pb.valueProp,
1180
+ h)}}function no(a){let b=null,c=a.db.Ib(a,olympe.sc.logic.pb.D);c?b=a.db.Ib(c,olympe.dm.Property.typeRel):(c=a.db.Ib(a,olympe.sc.logic.pb.j))&&(b=a.db.Ib(c,olympe.sc.logic.Sb.typeRel));return b||olympe.dc.ea(olympe.dc.CloudObject)}
1181
+ olympe.sc.logic.pb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.G=c}j(a,b,c){const d=olympe.sc.tj(c);null==b||b.sg();b&&d instanceof olympe.dm.Je?null==b||b.run(()=>{olympe.C.Wc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.Uf(olympe.sc.logic.pb.valueProp,a||olympe.dc.ib.tj,Object)}getType(){const a=this.transform(olympe.sc.logic.pb.j,olympe.sc.logic.Sb.typeRel);a.Qd(olympe.dc.CloudObject);return a.Jc()}Zy(){return this.Tc(olympe.sc.logic.pb.N,olympe.dc.CloudObject)}Xy(){return this.Tc(olympe.sc.logic.pb.R,
1182
+ olympe.sc.logic.Fb)}Yy(){return this.Tc(olympe.sc.logic.pb.H,olympe.dm.Property)}uy(){return this.Tc(olympe.sc.logic.pb.F,olympe.dc.CloudObject)}sy(){return this.Tc(olympe.sc.logic.pb.j,olympe.sc.logic.ub)}ty(){return this.Tc(olympe.sc.logic.pb.D,olympe.dm.Property)}};olympe.sc.logic.pb.O=olympe.dc.na.j('0168a431d91f25780000',olympe.sc.logic.pb,olympe.sc.P.Da);olympe.sc.logic.pb.valueProp=olympe.sc.logic.pb.O.ja('0168a431d91f25780001');olympe.sc.logic.pb.N=olympe.sc.logic.pb.O.ra('0168a431d91f25780002');
1181
1183
  olympe.sc.logic.pb.R=R(olympe.sc.logic.pb.O,olympe.sc.logic.Fb.D);olympe.sc.logic.pb.H=olympe.sc.logic.pb.O.ra('0168a431d91f25780004');olympe.sc.logic.pb.F=olympe.sc.logic.pb.O.ra('0168a431d91f2578000a');olympe.sc.logic.pb.j=R(olympe.sc.logic.pb.O,olympe.sc.logic.ub.D);olympe.sc.logic.pb.D=olympe.sc.logic.pb.O.ra('0168a431d91f2578000c');R(olympe.dc.CloudObject.O,olympe.sc.logic.pb.N);R(olympe.dm.Property.O,olympe.sc.logic.pb.H);R(olympe.dc.CloudObject.O,olympe.sc.logic.pb.F);
1182
- R(olympe.dm.Property.O,olympe.sc.logic.pb.D);m=olympe.sc.logic.pb.prototype;m.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Yy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Wy.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.Xy.K=new olympe.C.J(()=>olympe.dm.Property,[]);m.ty.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.qy.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.sy.K=new olympe.C.J(()=>olympe.dm.Property,[]);function mo(a,b){const c=a.wd(),d=c.vm().W(),e=c.wm().W(),f=c.xm().W();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.L.qb.get(a.Vb(),g,h).then(k=>{for(const [l,n]of k)l!==e&&l!==f&&b.set(l,n);b.set(e,k.get(e));k=k.get(f);k instanceof olympe.sc.logic.Error&&(k=pn(k.message,k.Aj(),k.re()+'\n===== Remote Call =====\n'+b.re()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Ub().name()}" (${a.tag}) encountered an error:\n${k}`;a.G.error(k);b.throw(olympe.sc.logic.Error.create(k,
1183
- 400))})}},b.T())}function no(a,b){const c=a.j.ia(()=>new Promise(d=>{b.onDestroy(()=>d())}),void 0,a.timeout);b.onDestroy(()=>a.j.F(c))}
1184
- function oo(a,b,c,d,e,f){const g=n=>u(function*(){if(null!==n){e.cancel();let p;null==(p=k)||p();let q;null==(q=l)||q();try{const r=new Map(a.getOutputs().map(t=>[t,b.get(t)]));yield f.cd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Ub().name()} (${a.Vb()}): ${r}`);f.li(t).catch(v=>{a.G.error(`Cannot reply with an error to a remote action call ${a.Ub().name()} (${a.Vb()}): ${v}`)})}finally{b.destroy()}}}),h=b.T(),k=b.on(c,g,h),l=b.on(d,g,h)}
1185
- olympe.sc.logic.Xh=class extends olympe.sc.logic.Function{constructor(a,b,c,d,e,f){super(a,b,c);this.timeout=e;this.j=d;this.sa=f}run(a){let b;null!=(b=a.Qa(olympe.sc.xa.j.EDITION))&&b||(this.db.Pa(this,olympe.sc.logic.Xh.F)?(Dn(a.state,this),this.yb(a)):0<olympe.dc.la.from(this.sa).bb(olympe.sc.Ua.H).bb(olympe.sc.Runnable.D).filter(olympe.dc.query.za.dt(this.Vb())).Cc().size()?super.run(a):(Sn(this,a),mo(this,a)))}yb(a){const b=this.Vb(),c=this.wd(),d=c.pq().W(),e=c.vm().W(),f=c.wm().W(),g=c.xm().W(),
1186
- h=new olympe.L.qb(b,a);this.j.ia(()=>u(function*(){return h.stop()}),`RemoteAction_${this.tag}`);h.listen().subscribe(rxjs.Subscriber.create(k=>{const l=a.ji('remote call'),n=k.body();l.set(olympe.sc.xa.j.REDELIVERED,k.wi());no(this,l);const p=Bc(()=>{k.li(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`)).catch();l.destroy()},this.timeout);oo(this,l,f,g,p,k);super.run(l);for(const [q,r]of n)q!==e&&l.set(q,r);k.Bi().then(q=>{var r=l.get(d);null!==r&&olympe.dc.ea(r)!==q&&
1187
- (r=this.Vb(),this.G.warn(`Remote action ${this.db.name(r)} ${r}: try to run it with an input user that is not the real authenticated user.`));l.set(d,q);l.set(e,n.get(e))}).catch(q=>{const r=this.Vb();this.G.warn(`Remote action ${this.db.name(r)} ${r} Triggered by unrecognized user: ${q}.`);l.set(g,olympe.sc.logic.Error.create('Unrecognized User',1))})},k=>{const l=this.Vb();this.G.error(`Error while listening on remote action ${this.db.name(l)} (${l}): ${k.message}`)}))}};
1188
- olympe.sc.logic.Xh.O=olympe.dc.na.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.Xh,olympe.sc.P.Ca,olympe.host.P.Ge,new olympe.V.oa(olympe.sc.Config.sr),new olympe.V.oa(olympe.sc.Config.ye));olympe.sc.logic.Xh.F=olympe.sc.logic.Xh.O.ja('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.sm=class{constructor(a){this.db=olympe.dc.ga();this.typeRel=a}};olympe.sc.logic.controllers.sm.j={TA:-1,TB:1};olympe.sc.logic.controllers.LC=class extends olympe.sc.logic.controllers.sm{constructor(){super(olympe.sc.logic.qd.j)}};olympe.sc.logic.controllers.UC=class extends olympe.sc.logic.controllers.sm{constructor(){super(olympe.sc.logic.Sb.typeRel)}};olympe.sc.logic.fl={};olympe.sc.logic.fl.Fw=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ea(b);d?olympe.dc.la.Ob(a,d,olympe.dc.Lb.jg).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.G.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.na.j('0174bf4b7e006e4b788a',olympe.sc.logic.fl.Fw);olympe.sc.logic.actions={};olympe.sc.logic.fl.zv=class extends olympe.sc.logic.Function{run(a){Sn(this,a);const [b,c,d]=Wn(this,a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.G.warn('No list to iter upon'),this.G.info(a.T())):f<e?(b(g.lf(f)),f++,c(Date.now())):(Fn(h.state),d(Date.now()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.wg();f=0;En(h.state);k();break;case 2:k();break;default:this.G.error('Unhandled input')}},this.tag))}};
1189
- olympe.sc.logic.na.j('0171889b060b6cd54300',olympe.sc.logic.fl.zv);olympe.sc.logic.Qb={};olympe.sc.logic.Qb.fm=class extends olympe.sc.logic.Bd{R(){return this.j('016ac638085357047a2d')}};olympe.sc.logic.Qb.fm.O=io('0169b6876a03f14ae61b',olympe.sc.logic.Qb.fm);olympe.sc.logic.Qb.fm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);let po=null;olympe.sc.logic.Qb.tm=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63808535703691c')}F(a){if(null===po){let b;po=null!=(b=olympe.V.getParameter('sc.event.experimental'))?b:!1}return po?a.observe(Pn(this)[0]):super.F(a)}};olympe.sc.logic.Qb.tm.O=io('0169b6876a03f139d50a',olympe.sc.logic.Qb.tm);olympe.sc.logic.Qb.tm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Jm=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63809a9a8e6db96')}Z(){return this.D('016ac6380ab003363b3e')}};io('01646ad602f933b8caaf',olympe.sc.logic.Qb.Jm);olympe.sc.logic.Qb.Jm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Jm.prototype.Z.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.Qb.xk=class extends olympe.sc.logic.Bd{R(){return this.j('016ac6380bd98f1d91a0')}da(){return this.D('016ac63c589ae38ca3ae')}Z(){return this.D('016ac63c5a377fceabaa')}};io('0168ec42fc01747a98b6',olympe.sc.logic.Qb.xk);olympe.sc.logic.Qb.xk.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.xk.prototype.da.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.Qb.xk.prototype.Z.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.Qb.Vg=class extends olympe.sc.logic.Bd{vm(){return this.j('017a7b07b09e3b22c8b4')}pq(){return this.j('017a7b07ba05807a74b0')}wm(){return this.D('017a7b0818c12388d731')}xm(){return this.D('017a7b085146d5e69aec')}gv(){return olympe.C.ba.D}};olympe.sc.logic.Qb.Vg.N='017a7b07b09e3b22c8b4';olympe.sc.logic.Qb.Vg.Qc='017a7b07ba05807a74b0';olympe.sc.logic.Qb.Vg.ia='017a7b0818c12388d731';olympe.sc.logic.Qb.Vg.j='017a7b085146d5e69aec';
1190
- olympe.sc.logic.Qb.Vg.O=io('017a7b07a948e30508fa',olympe.sc.logic.Qb.Vg,olympe.sc.logic.Xh);m=olympe.sc.logic.Qb.Vg.prototype;m.vm.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.pq.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.wm.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.xm.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.gv.K=olympe.C.J.N;olympe.sc.logic.Qb.Tr=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63c5b3ed0562740')}};io('016a9766c230916ea5ec',olympe.sc.logic.Qb.Tr);olympe.sc.logic.Qb.Tr.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.query={};olympe.sc.query.so=class extends olympe.sc.Og{};olympe.sc.query.so.O=olympe.dc.na.j('01631aacd8276ea98491',olympe.sc.query.so);olympe.sc.query.Zq=class extends olympe.dm.Enum{};olympe.sc.query.Zq.O=olympe.dc.na.j('01631aacd8276ea98495',olympe.sc.query.Zq);olympe.sc.query.jr=class extends olympe.dm.Enum{};olympe.sc.query.jr.O=olympe.dc.na.j('01631aacd8276ea98494',olympe.sc.query.jr);olympe.sc.query.mr=class extends olympe.sc.Og{};olympe.sc.query.mr.O=olympe.dc.na.j('01631aacd8276ea98492',olympe.sc.query.mr);olympe.sc.query.nc=class extends olympe.dc.CloudObject{};olympe.sc.query.nc.O=olympe.dc.na.j('01631aacd8276ea98493',olympe.sc.query.nc);olympe.sc.Wo=class extends olympe.dc.CloudObject{};olympe.sc.Wo.O=olympe.dc.na.j('018312ceeb3e93618a85',olympe.sc.Wo);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.O=olympe.dc.na.j('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13a');
1191
- olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.ra('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.ra('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Ef=class extends olympe.sc.logic.Bd{hv(){return this.j('017ffe02381f9fac5060')}lv(){return this.j('017ffe02381f9fac5061')}mv(){return this.j('017ffe02381f9fac5062')}oy(){return this.j('017ffe02381f9fac5065')}jv(){return this.D('017ffe02381f9fac5063')}kv(){return this.D('017ffe02381f9fac5064')}};olympe.sc.workflow.Ef.O=io('017ffde21f5fe0f704ce',olympe.sc.workflow.Ef);olympe.sc.workflow.Ef.j='017ffe02381f9fac5060';olympe.sc.workflow.Ef.Pe='017ffe02381f9fac5061';
1192
- olympe.sc.workflow.Ef.ef='017ffe02381f9fac5062';olympe.sc.workflow.Ef.ia='017ffe02381f9fac5065';olympe.sc.workflow.Ef.N='017ffe02381f9fac5063';olympe.sc.workflow.Ef.Qc='017ffe02381f9fac5064';m=olympe.sc.workflow.Ef.prototype;m.hv.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.lv.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.mv.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.oy.K=new olympe.C.J(()=>Map,[]);m.jv.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.kv.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.workflow.cf=class extends olympe.dm.BrickMetadata{Wc(){return this.Sc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).ka().concat(['.',this.ka()])}};olympe.sc.workflow.cf.O=olympe.dc.na.j('017ffdc2dda51d46b430',olympe.sc.workflow.cf);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{D(){return this.Ys()}j(){return this.Sc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.cf)}F(){return this.Sc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.cf)}Wc(){const a=this.Sc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.cf);return a.Sc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).ka().concat(['.',a.ka(),'->',this.ka()])}};
1184
+ R(olympe.dm.Property.O,olympe.sc.logic.pb.D);m=olympe.sc.logic.pb.prototype;m.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Zy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Xy.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.Yy.K=new olympe.C.J(()=>olympe.dm.Property,[]);m.uy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.sy.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.ty.K=new olympe.C.J(()=>olympe.dm.Property,[]);function oo(a,b){const c=a.wd(),d=c.ym().W(),e=c.zm().W(),f=c.Am().W();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.L.qb.get(a.Wb(),g,h).then(k=>{for(const [l,n]of k)l!==e&&l!==f&&b.set(l,n);b.set(e,k.get(e));k=k.get(f);k instanceof olympe.sc.logic.Error&&(k=rn(k.message,k.Aj(),k.se()+'\n===== Remote Call =====\n'+b.se()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Vb().name()}" (${a.tag}) encountered an error:\n${k}`;a.G.error(k);b.throw(olympe.sc.logic.Error.create(k,
1185
+ 400))})}},b.T())}function po(a,b){const c=a.j.ia(()=>new Promise(d=>{b.onDestroy(()=>d())}),void 0,a.timeout);b.onDestroy(()=>a.j.F(c))}
1186
+ function qo(a,b,c,d,e,f){const g=n=>u(function*(){if(null!==n){e.cancel();let p;null==(p=k)||p();let q;null==(q=l)||q();try{const r=new Map(a.getOutputs().map(t=>[t,b.get(t)]));yield f.cd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Vb().name()} (${a.Wb()}): ${r}`);f.li(t).catch(v=>{a.G.error(`Cannot reply with an error to a remote action call ${a.Vb().name()} (${a.Wb()}): ${v}`)})}finally{b.destroy()}}}),h=b.T(),k=b.on(c,g,h),l=b.on(d,g,h)}
1187
+ olympe.sc.logic.Xh=class extends olympe.sc.logic.Function{constructor(a,b,c,d,e,f){super(a,b,c);this.timeout=e;this.j=d;this.X=f}run(a){let b;null!=(b=a.Qa(olympe.sc.xa.j.EDITION))&&b||(this.db.Pa(this,olympe.sc.logic.Xh.F)?(Fn(a.state,this),this.vb(a)):this.X&&0<olympe.dc.la.pe(this.X,olympe.sc.pa.Oc).bb(olympe.sc.Va.H).bb(olympe.sc.Runnable.D).filter(olympe.dc.query.za.dt(this.Wb())).Cc().size()?super.run(a):(Un(this,a),oo(this,a)))}vb(a){const b=this.Wb(),c=this.wd(),d=c.qq().W(),e=c.ym().W(),
1188
+ f=c.zm().W(),g=c.Am().W(),h=new olympe.L.qb(b,a);this.j.ia(()=>u(function*(){return h.stop()}),`RemoteAction_${this.tag}`);h.listen().subscribe(rxjs.Subscriber.create(k=>{const l=a.ji('remote call'),n=k.body();l.set(olympe.sc.xa.j.REDELIVERED,k.wi());po(this,l);const p=Bc(()=>{k.li(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`)).catch();l.destroy()},this.timeout);qo(this,l,f,g,p,k);super.run(l);for(const [q,r]of n)q!==e&&l.set(q,r);k.Bi().then(q=>{var r=l.get(d);null!==
1189
+ r&&olympe.dc.ea(r)!==q&&(r=this.Wb(),this.G.warn(`Remote action ${this.db.name(r)} ${r}: try to run it with an input user that is not the real authenticated user.`));l.set(d,q);l.set(e,n.get(e))}).catch(q=>{const r=this.Wb();this.G.warn(`Remote action ${this.db.name(r)} ${r} Triggered by unrecognized user: ${q}.`);l.set(g,olympe.sc.logic.Error.create('Unrecognized User',1))})},k=>{const l=this.Wb();this.G.error(`Error while listening on remote action ${this.db.name(l)} (${l}): ${k.message}`)}))}};
1190
+ olympe.sc.logic.Xh.O=olympe.dc.na.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.Xh,olympe.sc.P.Da,olympe.host.P.He,new olympe.V.oa(olympe.sc.Config.tr),new olympe.V.oa(olympe.sc.Config.ze));olympe.sc.logic.Xh.F=olympe.sc.logic.Xh.O.ja('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.vm=class{constructor(a){this.db=olympe.dc.ha();this.typeRel=a}};olympe.sc.logic.controllers.vm.j={UA:-1,UB:1};olympe.sc.logic.controllers.MC=class extends olympe.sc.logic.controllers.vm{constructor(){super(olympe.sc.logic.rd.j)}};olympe.sc.logic.controllers.VC=class extends olympe.sc.logic.controllers.vm{constructor(){super(olympe.sc.logic.Sb.typeRel)}};olympe.sc.logic.fl={};olympe.sc.logic.fl.Gw=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ea(b);d?olympe.dc.la.Ob(a,d,olympe.dc.Lb.kg).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.G.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.na.j('0174bf4b7e006e4b788a',olympe.sc.logic.fl.Gw);olympe.sc.logic.actions={};olympe.sc.logic.fl.Av=class extends olympe.sc.logic.Function{run(a){Un(this,a);const [b,c,d]=Yn(this,a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.G.warn('No list to iter upon'),this.G.info(a.T())):f<e?(b(g.lf(f)),f++,c(Date.now())):(Hn(h.state),d(Date.now()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.wg();f=0;Gn(h.state);k();break;case 2:k();break;default:this.G.error('Unhandled input')}},this.tag))}};
1191
+ olympe.sc.logic.na.j('0171889b060b6cd54300',olympe.sc.logic.fl.Av);olympe.sc.logic.Qb={};olympe.sc.logic.Qb.im=class extends olympe.sc.logic.Bd{R(){return this.j('016ac638085357047a2d')}};olympe.sc.logic.Qb.im.O=ko('0169b6876a03f14ae61b',olympe.sc.logic.Qb.im);olympe.sc.logic.Qb.im.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);let ro=null;olympe.sc.logic.Qb.wm=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63808535703691c')}F(a){if(null===ro){let b;ro=null!=(b=olympe.V.getParameter('sc.event.experimental'))?b:!1}return ro?a.observe(Rn(this)[0]):super.F(a)}};olympe.sc.logic.Qb.wm.O=ko('0169b6876a03f139d50a',olympe.sc.logic.Qb.wm);olympe.sc.logic.Qb.wm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Mm=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63809a9a8e6db96')}X(){return this.D('016ac6380ab003363b3e')}};ko('01646ad602f933b8caaf',olympe.sc.logic.Qb.Mm);olympe.sc.logic.Qb.Mm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Mm.prototype.X.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.Qb.xk=class extends olympe.sc.logic.Bd{R(){return this.j('016ac6380bd98f1d91a0')}ba(){return this.D('016ac63c589ae38ca3ae')}X(){return this.D('016ac63c5a377fceabaa')}};ko('0168ec42fc01747a98b6',olympe.sc.logic.Qb.xk);olympe.sc.logic.Qb.xk.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.xk.prototype.ba.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.Qb.xk.prototype.X.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.Qb.Vg=class extends olympe.sc.logic.Bd{ym(){return this.j('017a7b07b09e3b22c8b4')}qq(){return this.j('017a7b07ba05807a74b0')}zm(){return this.D('017a7b0818c12388d731')}Am(){return this.D('017a7b085146d5e69aec')}hv(){return olympe.C.da.D}};olympe.sc.logic.Qb.Vg.N='017a7b07b09e3b22c8b4';olympe.sc.logic.Qb.Vg.Hc='017a7b07ba05807a74b0';olympe.sc.logic.Qb.Vg.ia='017a7b0818c12388d731';olympe.sc.logic.Qb.Vg.j='017a7b085146d5e69aec';
1192
+ olympe.sc.logic.Qb.Vg.O=ko('017a7b07a948e30508fa',olympe.sc.logic.Qb.Vg,olympe.sc.logic.Xh);m=olympe.sc.logic.Qb.Vg.prototype;m.ym.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.qq.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.zm.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.Am.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.hv.K=olympe.C.J.N;olympe.sc.logic.Qb.Ur=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63c5b3ed0562740')}};ko('016a9766c230916ea5ec',olympe.sc.logic.Qb.Ur);olympe.sc.logic.Qb.Ur.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.query={};olympe.sc.query.uo=class extends olympe.sc.Og{};olympe.sc.query.uo.O=olympe.dc.na.j('01631aacd8276ea98491',olympe.sc.query.uo);olympe.sc.query.$q=class extends olympe.dm.Enum{};olympe.sc.query.$q.O=olympe.dc.na.j('01631aacd8276ea98495',olympe.sc.query.$q);olympe.sc.query.kr=class extends olympe.dm.Enum{};olympe.sc.query.kr.O=olympe.dc.na.j('01631aacd8276ea98494',olympe.sc.query.kr);olympe.sc.query.nr=class extends olympe.sc.Og{};olympe.sc.query.nr.O=olympe.dc.na.j('01631aacd8276ea98492',olympe.sc.query.nr);olympe.sc.query.nc=class extends olympe.dc.CloudObject{};olympe.sc.query.nc.O=olympe.dc.na.j('01631aacd8276ea98493',olympe.sc.query.nc);olympe.sc.Xo=class extends olympe.dc.CloudObject{};olympe.sc.Xo.O=olympe.dc.na.j('018312ceeb3e93618a85',olympe.sc.Xo);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.O=olympe.dc.na.j('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13a');
1193
+ olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.ra('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.ra('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Ff=class extends olympe.sc.logic.Bd{jv(){return this.j('017ffe02381f9fac5060')}mv(){return this.j('017ffe02381f9fac5061')}nv(){return this.j('017ffe02381f9fac5062')}py(){return this.j('017ffe02381f9fac5065')}kv(){return this.D('017ffe02381f9fac5063')}lv(){return this.D('017ffe02381f9fac5064')}};olympe.sc.workflow.Ff.O=ko('017ffde21f5fe0f704ce',olympe.sc.workflow.Ff);olympe.sc.workflow.Ff.j='017ffe02381f9fac5060';olympe.sc.workflow.Ff.Qe='017ffe02381f9fac5061';
1194
+ olympe.sc.workflow.Ff.ef='017ffe02381f9fac5062';olympe.sc.workflow.Ff.ia='017ffe02381f9fac5065';olympe.sc.workflow.Ff.N='017ffe02381f9fac5063';olympe.sc.workflow.Ff.Hc='017ffe02381f9fac5064';m=olympe.sc.workflow.Ff.prototype;m.jv.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.mv.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.nv.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.py.K=new olympe.C.J(()=>Map,[]);m.kv.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.lv.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.workflow.cf=class extends olympe.dm.BrickMetadata{Xc(){return this.Tc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).ka().concat(['.',this.ka()])}};olympe.sc.workflow.cf.O=olympe.dc.na.j('017ffdc2dda51d46b430',olympe.sc.workflow.cf);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{D(){return this.Zs()}j(){return this.Tc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.cf)}F(){return this.Tc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.cf)}Xc(){const a=this.Tc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.cf);return a.Tc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).ka().concat(['.',a.ka(),'->',this.ka()])}};
1193
1195
  olympe.sc.workflow.Transition.O=olympe.dc.na.j('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.O.ja('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.O.ra('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.O.ra('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.D.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);
1194
- olympe.sc.workflow.Transition.prototype.j.K=new olympe.C.J(()=>olympe.sc.workflow.cf,[]);olympe.sc.workflow.Transition.prototype.F.K=new olympe.C.J(()=>olympe.sc.workflow.cf,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{ue(){return olympe.sc.we.Ne.Bh}F(){return this.mh(olympe.sc.workflow.Workflow.serializationEnabledProp)}j(){return this.Sc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.Ac)}D(){return this.Sc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.cf)}};olympe.sc.workflow.Workflow.O=olympe.dc.na.j('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.O.ja('017ffdc010e5bcc9c972');
1196
+ olympe.sc.workflow.Transition.prototype.j.K=new olympe.C.J(()=>olympe.sc.workflow.cf,[]);olympe.sc.workflow.Transition.prototype.F.K=new olympe.C.J(()=>olympe.sc.workflow.cf,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Oe.Bh}F(){return this.mh(olympe.sc.workflow.Workflow.serializationEnabledProp)}j(){return this.Tc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.Ac)}D(){return this.Tc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.cf)}};olympe.sc.workflow.Workflow.O=olympe.dc.na.j('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.O.ja('017ffdc010e5bcc9c972');
1195
1197
  olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.O.ra('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.O.ra('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.O.ra('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.F.K=olympe.C.J.N;olympe.sc.workflow.Workflow.prototype.j.K=new olympe.C.J(()=>olympe.sc.Ac,[]);
1196
- olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.J(()=>olympe.sc.workflow.cf,[]);olympe.sc.pa={};olympe.sc.pa.Yc=class extends olympe.sc.Ua{ue(){return olympe.sc.we.Ne.nw}};olympe.sc.pa.Yc.O=olympe.dc.na.j('01120300000000adef00',olympe.sc.pa.Yc);olympe.sc.pa.Yc.j=olympe.sc.pa.Yc.O.ra('0171bc1f15da96dfdb89');olympe.sc.pa.Yc.ia=olympe.sc.pa.Yc.O.ra('0171bc1f15da96dfdb90');R(olympe.dm.Pc.O,olympe.sc.pa.Yc.j);olympe.sc.pa.Ei=class extends olympe.sc.Runnable{H(){return[this.Vb()]}j(){return olympe.dc.rd.from(this.Vb()).bb(olympe.sc.pa.Yc.j).Cc()}};olympe.sc.pa.Ei.O=ig(olympe.dc.na.j('0113030000000aca1100',olympe.sc.pa.Ei));olympe.sc.pa.Ei.prototype.j.K=new olympe.C.J(()=>olympe.dm.hb,[]);olympe.sc.pa.mb=class extends olympe.dc.CloudObject{ov(){return this.mh(olympe.sc.pa.mb.gi)}Az(){return this.mh(olympe.sc.pa.mb.ia)}Jc(){return this.xd(olympe.sc.pa.mb.j)}vy(){return this.vb(olympe.sc.pa.mb.H)}Qy(){return this.vb(olympe.sc.pa.mb.da)}Py(){return this.vb(olympe.sc.pa.mb.X)}Of(){return this.vb(olympe.sc.pa.mb.Z)}Fy(){return this.vb(olympe.sc.pa.mb.N)}ay(){return this.vb(olympe.sc.pa.mb.D)}Oy(){return this.vb(olympe.sc.pa.mb.R)}nv(){return this.vb(olympe.sc.pa.mb.F)}};
1197
- olympe.sc.pa.mb.O=olympe.dc.na.j('011203300000000adef5',olympe.sc.pa.mb);olympe.sc.pa.mb.gi=olympe.sc.pa.mb.O.ja('011203300000000adef6');olympe.sc.pa.mb.ia=olympe.sc.pa.mb.O.ja('011203300000000adef7');olympe.sc.pa.mb.j=olympe.sc.pa.mb.O.ja('011203300000000adef8');olympe.sc.pa.mb.H=olympe.sc.pa.mb.O.ja('011203300000000adef9');olympe.sc.pa.mb.da=olympe.sc.pa.mb.O.ja('011203300000000adefa');olympe.sc.pa.mb.X=olympe.sc.pa.mb.O.ja('011203300000000adefb');olympe.sc.pa.mb.D=olympe.sc.pa.mb.O.ja('011203300000000adefc');
1198
- olympe.sc.pa.mb.Z=olympe.sc.pa.mb.O.ja('011203300000000adefd');olympe.sc.pa.mb.N=olympe.sc.pa.mb.O.ja('011203300000000adefe');olympe.sc.pa.mb.R=olympe.sc.pa.mb.O.ja('011203300000000adeff');olympe.sc.pa.mb.F=olympe.sc.pa.mb.O.ja('011203300000000adee0');olympe.sc.pa.mb.oc={INIT:0,FA:1,Pk:2,Ok:3,Xm:4,nD:5,Ab:9};m=olympe.sc.pa.mb.prototype;m.ov.K=olympe.C.J.N;m.Az.K=olympe.C.J.N;m.Jc.K=olympe.C.J.F;m.vy.K=olympe.C.J.D;m.Qy.K=olympe.C.J.D;m.Py.K=olympe.C.J.D;m.Of.K=olympe.C.J.D;m.Fy.K=olympe.C.J.D;
1199
- m.ay.K=olympe.C.J.D;m.Oy.K=olympe.C.J.D;m.nv.K=olympe.C.J.D;olympe.sc.pa.pm=class extends olympe.sc.pa.Ei{F(a){a.set(olympe.sc.xa.j.io,!0);super.F(a)}ia(){return!0}};olympe.sc.pa.pm.O=olympe.dc.na.j('0113032000000aca1102',olympe.sc.pa.pm,olympe.sc.P.Ca);olympe.sc.pa.bf=class extends olympe.sc.pa.Yc{j(){return(new olympe.dc.rk(this.W(),olympe.sc.pa.mb)).bb(olympe.sc.pa.bf.N).Xi().Ic()}};olympe.sc.pa.bf.O=olympe.dc.na.j('011203300000000adef3',olympe.sc.pa.bf);olympe.sc.pa.bf.N=olympe.sc.pa.bf.O.ra('011203300000000adef4');R(olympe.sc.pa.mb.O,olympe.sc.pa.bf.N);
1200
- olympe.sc.pa.bf.O.j=(a,b,c)=>{b=$l(a,b||'New Service Application model',olympe.sc.pa.bf,olympe.sc.pa.pm);a.Oa(olympe.sc.pa.Yc.j,b,c);c=a.create(olympe.sc.pa.mb).W();a.Oa(olympe.sc.pa.bf.N,b,c);return b.W()};olympe.sc.pa.bf.prototype.j.K=new olympe.C.J(()=>olympe.sc.pa.mb,[]);olympe.sc.bh=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.bh.O=olympe.dc.na.j('011203300000000adf00',olympe.sc.bh);olympe.sc.bh.D=olympe.sc.bh.O.ja('011203300000000adf01');olympe.sc.bh.j=olympe.sc.bh.O.ja('011203300000000adf02');olympe.sc.bh.F='011203300000000adf0f';olympe.sc.Ag={};olympe.sc.Ag.oz=a=>{var b=a.j;const c=olympe.dc.ga();var d=null;var e=null===bo;for(const f of b.Uc())if((b=f.Ub())&&f.D()&&f.jb()===olympe.dc.Ia.SERVER&&Z(a,f.tag())&&c.Nb(b,olympe.sc.Ac)){if(!e)throw new olympe.dc.Pq;let g,h;null==d&&(d=null,null!==ao?d=ao:'string'===typeof $n&&(d=olympe.dc.rd.from($n).bb(olympe.sc.pa.Yc.j).bb(olympe.sc.sf.j.$b()).Cc()),d=null==(g=d)?void 0:g.W());d=null!=(h=d)?h:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.ea(b)}`);a.Oa(olympe.sc.sf.D.W(),
1198
+ olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.J(()=>olympe.sc.workflow.cf,[]);olympe.sc.pa={};olympe.sc.pa.Oc=class extends olympe.sc.Va{ve(){return olympe.sc.xe.Oe.ow}};olympe.sc.pa.Oc.O=olympe.dc.na.j('01120300000000adef00',olympe.sc.pa.Oc);olympe.sc.pa.Oc.j=olympe.sc.pa.Oc.O.ra('0171bc1f15da96dfdb89');olympe.sc.pa.Oc.ia=olympe.sc.pa.Oc.O.ra('0171bc1f15da96dfdb90');R(olympe.dm.Rc.O,olympe.sc.pa.Oc.j);olympe.sc.pa.Ei=class extends olympe.sc.Runnable{H(){return[this.Wb()]}j(){return olympe.dc.sd.from(this.Wb()).bb(olympe.sc.pa.Oc.j).Cc()}};olympe.sc.pa.Ei.O=kg(olympe.dc.na.j('0113030000000aca1100',olympe.sc.pa.Ei));olympe.sc.pa.Ei.prototype.j.K=new olympe.C.J(()=>olympe.dm.hb,[]);olympe.sc.pa.nb=class extends olympe.dc.CloudObject{pv(){return this.mh(olympe.sc.pa.nb.gi)}Bz(){return this.mh(olympe.sc.pa.nb.ia)}Kc(){return this.xd(olympe.sc.pa.nb.j)}wy(){return this.wb(olympe.sc.pa.nb.H)}Ry(){return this.wb(olympe.sc.pa.nb.ba)}Qy(){return this.wb(olympe.sc.pa.nb.X)}Qf(){return this.wb(olympe.sc.pa.nb.Z)}Gy(){return this.wb(olympe.sc.pa.nb.N)}by(){return this.wb(olympe.sc.pa.nb.D)}Py(){return this.wb(olympe.sc.pa.nb.R)}ov(){return this.wb(olympe.sc.pa.nb.F)}};
1199
+ olympe.sc.pa.nb.O=olympe.dc.na.j('011203300000000adef5',olympe.sc.pa.nb);olympe.sc.pa.nb.gi=olympe.sc.pa.nb.O.ja('011203300000000adef6');olympe.sc.pa.nb.ia=olympe.sc.pa.nb.O.ja('011203300000000adef7');olympe.sc.pa.nb.j=olympe.sc.pa.nb.O.ja('011203300000000adef8');olympe.sc.pa.nb.H=olympe.sc.pa.nb.O.ja('011203300000000adef9');olympe.sc.pa.nb.ba=olympe.sc.pa.nb.O.ja('011203300000000adefa');olympe.sc.pa.nb.X=olympe.sc.pa.nb.O.ja('011203300000000adefb');olympe.sc.pa.nb.D=olympe.sc.pa.nb.O.ja('011203300000000adefc');
1200
+ olympe.sc.pa.nb.Z=olympe.sc.pa.nb.O.ja('011203300000000adefd');olympe.sc.pa.nb.N=olympe.sc.pa.nb.O.ja('011203300000000adefe');olympe.sc.pa.nb.R=olympe.sc.pa.nb.O.ja('011203300000000adeff');olympe.sc.pa.nb.F=olympe.sc.pa.nb.O.ja('011203300000000adee0');olympe.sc.pa.nb.oc={INIT:0,GA:1,Pk:2,Ok:3,$m:4,oD:5,Ab:9};m=olympe.sc.pa.nb.prototype;m.pv.K=olympe.C.J.N;m.Bz.K=olympe.C.J.N;m.Kc.K=olympe.C.J.F;m.wy.K=olympe.C.J.D;m.Ry.K=olympe.C.J.D;m.Qy.K=olympe.C.J.D;m.Qf.K=olympe.C.J.D;m.Gy.K=olympe.C.J.D;
1201
+ m.by.K=olympe.C.J.D;m.Py.K=olympe.C.J.D;m.ov.K=olympe.C.J.D;olympe.sc.pa.tm=class extends olympe.sc.pa.Ei{F(a){a.set(olympe.sc.xa.j.jo,!0);super.F(a)}wa(){return!0}};olympe.sc.pa.tm.O=olympe.dc.na.j('0113032000000aca1102',olympe.sc.pa.tm,olympe.sc.P.Da);olympe.sc.pa.bf=class extends olympe.sc.pa.Oc{j(){return(new olympe.dc.rk(this.W(),olympe.sc.pa.nb)).bb(olympe.sc.pa.bf.N).Xi().Jc()}};olympe.sc.pa.bf.O=olympe.dc.na.j('011203300000000adef3',olympe.sc.pa.bf);olympe.sc.pa.bf.N=olympe.sc.pa.bf.O.ra('011203300000000adef4');R(olympe.sc.pa.nb.O,olympe.sc.pa.bf.N);
1202
+ olympe.sc.pa.bf.O.j=(a,b,c)=>{b=bm(a,b||'New Service Application model',olympe.sc.pa.bf,olympe.sc.pa.tm);a.Oa(olympe.sc.pa.Oc.j,b,c);c=a.create(olympe.sc.pa.nb).W();a.Oa(olympe.sc.pa.bf.N,b,c);return b.W()};olympe.sc.pa.bf.prototype.j.K=new olympe.C.J(()=>olympe.sc.pa.nb,[]);olympe.sc.bh=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.bh.O=olympe.dc.na.j('011203300000000adf00',olympe.sc.bh);olympe.sc.bh.D=olympe.sc.bh.O.ja('011203300000000adf01');olympe.sc.bh.j=olympe.sc.bh.O.ja('011203300000000adf02');olympe.sc.bh.F='011203300000000adf0f';olympe.sc.Ag={};olympe.sc.Ag.pz=a=>{var b=a.j;const c=olympe.dc.ha();var d=null;var e=null===eo;for(const f of b.Vc())if((b=f.Vb())&&f.D()&&f.jb()===olympe.dc.Ia.SERVER&&Z(a,f.tag())&&c.Nb(b,olympe.sc.Ac)){if(!e)throw new olympe.dc.Qq;let g,h;null==d&&(d=null,null!==co?d=co:'string'===typeof bo&&(d=olympe.dc.sd.from(bo).bb(olympe.sc.pa.Oc.j).bb(olympe.sc.tf.j.$b()).Cc()),d=null==(g=d)?void 0:g.W());d=null!=(h=d)?h:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.ea(b)}`);a.Oa(olympe.sc.tf.D.W(),
1201
1203
  d,f.tag())}};
1202
- olympe.sc.Ag.Cz=a=>{const b=a.j,c=olympe.dc.ga();for(const d of b.Uc()){const e=d.Ub();e&&!d.yd()&&c.Nb(e,olympe.sc.Ac)&&d.zb().forEach((f,g)=>{if(f instanceof olympe.dc.vc){const l=b.Tc(f.W());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.W()}`);var h;f=null!=(h=null==l?void 0:l.Ub())?h:null;h=l.tag();let n;if(f===olympe.dc.ea(olympe.sc.Td)){h=l.Ib(olympe.sc.Td.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
1203
- let p;f=null!=(p=null==(k=b.Tc(h))?void 0:k.Ub())?p:c.model(h)}if(c.Tf(f,olympe.dm.Ie)){k=jn(f);let p;n=null!=(p=l.Pa(k.W()))?p:c.Pa(h,k)}if(void 0===n)throw Error(`Try to set a complex property to an instance of a DataType: ${c.name(e)} (${e})`);a.Xc(d.tag(),new Map([[g,n]]));Ul(a,l.tag(),olympe.dc.Lb.Dc)}})}};
1204
- olympe.sc.Ag.Ax=a=>{const b=a.j,c=olympe.dc.ga(),d=new Set;for(var e of b.Bb.values()){a=e.tag();let f;const g=null!=(f=e.Ub())?f:c.model(a);if(null!==g&&e.Fd()&&(d.has(g)||c.Nb(g,olympe.sc.Ac))){d.add(g);const h=Array.from(e.da()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.fc.Zc?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Tc(k))?void 0:l.Ub())?n:c.model(k);return!p||!(d.has(p)||c.Nb(p,olympe.sc.Ac))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Tc(h))?void 0:k.Ub())?l:c.model(h))?
1205
- n:'unknown';throw Error(`Try to link an instance (${a}) of DataType ${c.name(g)} (${g}) to an instance which is not (${h}) a DataType: ${c.name(e)} (${e})`);}}}};olympe.sc.Ag.Sz=a=>{var b=a.j;const c=olympe.dc.ga();for(const d of b.Uc()){b=d.tag();const e=d.Ub();if(e&&!c.Nb(e,olympe.sc.Ac)&&Z(a,b))throw Error(`You are trying to persist an instance of : ${c.name(e)} (${e}), but only instances of DataType can be persisted`);}};
1206
- olympe.V.run([olympe.dc.transaction.P.Fa],a=>{fm(fm(fm(a,olympe.sc.Ag.Ax,'businessDataRelations'),olympe.sc.Ag.oz,'linkBusinessContainer'),olympe.sc.Ag.Cz,'noBusinessComplexProperty')});olympe.sc.$j=class extends olympe.dm.BrickMetadata{ue(){return olympe.sc.we.Ne.Bh}};olympe.sc.$j.O=olympe.dc.na.j('01645fe6873aeea59e64',olympe.sc.$j);olympe.sc.$j.j=olympe.sc.$j.O.ra('017ed8ac775f48d4d589');olympe.sc.To=class extends olympe.dm.Kb{ue(){return olympe.sc.we.Ne.Bh}};olympe.sc.To.O=olympe.dc.na.j('0163a68ce44f3d1fa95d',olympe.sc.To);olympe.sc.zh=class extends olympe.dm.BrickMetadata{};olympe.sc.zh.O=olympe.dc.na.j('016324fde11a836f77d3',olympe.sc.zh);olympe.sc.zh.j=olympe.sc.Ac.O.ra('016324fde11a836088d3');olympe.sc.zh.O.j=(a,b)=>$l(a,null!=b?b:'New config type',olympe.sc.zh).W();olympe.sc.PA=class{};olympe.sc.ek=class extends olympe.dm.BrickMetadata{ue(){return olympe.sc.we.Ne.Bh}};olympe.sc.ek.O=olympe.dc.na.j('017dc8d6c8fd8c8bd2ff',olympe.sc.ek);olympe.sc.ek.O.j=(a,b)=>$l(a,null!=b?b:'New data connector',olympe.sc.ek,olympe.dm.DataSource).W();olympe.sc.Ae=class extends olympe.sc.Runnable{sa(){return this.cb(olympe.sc.Ae.H,olympe.sc.Runnable)}j(){return this.cb(olympe.sc.Ae.F,olympe.dm.Property)}};olympe.sc.Ae.O=ig(olympe.dc.na.j('016c2d996d9ca27fa9d8',olympe.sc.Ae));olympe.sc.Ae.H=olympe.sc.Ae.O.ra('016c3cb7742ec9309e0b');olympe.sc.Ae.F=olympe.sc.Ae.O.ra('016c42d3454636f90533');olympe.sc.Ae.prototype.sa.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.Ae.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.rp=class extends olympe.dm.Kb{ue(){return olympe.sc.we.Ne.Bh}};olympe.sc.rp.O=olympe.dc.na.j('017a7a9ff057958e5678',olympe.sc.rp);olympe.sc.Mi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ga();e=void 0!==e?e:f.Ja(b)&&f.Uc(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.sc.Mi.create=olympe.sc.Mi.create;olympe.sc.Mi.O=olympe.dc.na.j('016cdd861b32d56c8208',olympe.sc.Mi);olympe.sc.yq=class extends olympe.dm.Kb{ue(){return olympe.sc.we.Ne.Pw}};olympe.sc.yq.O=olympe.dc.na.j('01644b6d4543b344b857',olympe.sc.yq);olympe.sc.zq=class extends olympe.dc.CloudObject{};olympe.sc.zq.O=olympe.dc.na.j('0162f672366be5ca7a86',olympe.sc.zq);const qo={qp:30};olympe.sc.cc=class extends olympe.dc.sources.cc{D(a){return a instanceof olympe.sc.logic.Error?this.format(qo.qp,{c:a.Aj(),m:a.message,s:a.re()}):super.D(a)}j(a){return(null==a?void 0:a.t)===qo.qp?(a=a.v,pn(a.m,a.c,a.s)):super.j(a)}H(a){super.H(a);if(this.db.model(a)===olympe.sc.Td.O.W()){const b=olympe.sc.Td.j;this.F.get(a).r.push({r:b.W(),o:a,d:this.db.Ib(a,b)})}return a}};olympe.sc.Ur=class extends olympe.sc.Ae{};olympe.sc.Ur.O=olympe.dc.na.j('016d3f37610ae4fc3962',olympe.sc.Ur);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.na.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Ya=class{constructor(a=!0){a=Yl(a);a.N=!0;var b=olympe.sc.Ag.Sz;let c;(null==(c=olympe.V.getParameter(olympe.dc.transaction.Config.bm))?0:c.includes('persistenceBusinessDataOnly'))||a.R.push(b);this.j=a;this.D=[];this.source=null}static from(a){const b=olympe.sc.xa.j.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Ya}static process(a,b){return a.has(olympe.sc.xa.j.TRANSACTION,!0)?Promise.resolve(!1):b.lb().then(()=>!0)}T(){return this.j.T()}create(a,b=new Map,c=this.source,d){c=
1207
- 'string'===typeof c?c:olympe.dc.ee().fromModel(a);a=this.j.create(a,d).yi(c);for(const [e,f]of b)X(a,e,f);b=a.W();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}lt(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Kd.set(olympe.dc.ea(c),b);return this}delete(a){this.j.delete(a);return this}Oa(a,b,c){this.j.Oa(a,b,c);return this}hc(a,b,c){this.j.hc(a,b,c);return this}xn(a,b){this.j.xn(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}Rz(a,b=!0){olympe.ha.Xa('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');
1208
- return this.persist(a,b)}yi(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){Zl(this.j,a.j);return this}nn(a){this.j.nn(a);return this}lb(){return new Promise((a,b)=>{this.j.lb((c,d)=>{c?a(new olympe.sc.mj(this.D)):b(d)})})}yn(){return new Promise((a,b)=>{this.j.yn((c,d)=>{c?a(new olympe.sc.mj(this.D)):b(d)})})}};olympe.sc.Ya.prototype.executeAsLarge=olympe.sc.Ya.prototype.yn;olympe.sc.Ya.prototype.execute=olympe.sc.Ya.prototype.lb;olympe.sc.Ya.prototype.afterExecution=olympe.sc.Ya.prototype.nn;
1209
- olympe.sc.Ya.prototype.merge=olympe.sc.Ya.prototype.merge;olympe.sc.Ya.prototype.model=olympe.sc.Ya.prototype.model;olympe.sc.Ya.prototype.setSource=olympe.sc.Ya.prototype.yi;olympe.sc.Ya.prototype.persistInstance=olympe.sc.Ya.prototype.Rz;olympe.sc.Ya.prototype.persist=olympe.sc.Ya.prototype.persist;olympe.sc.Ya.prototype.deleteAllRelations=olympe.sc.Ya.prototype.xn;olympe.sc.Ya.prototype.deleteRelation=olympe.sc.Ya.prototype.hc;olympe.sc.Ya.prototype.createRelation=olympe.sc.Ya.prototype.Oa;
1210
- olympe.sc.Ya.prototype['delete']=olympe.sc.Ya.prototype.delete;olympe.sc.Ya.prototype.multiUpdate=olympe.sc.Ya.prototype.lt;olympe.sc.Ya.prototype.update=olympe.sc.Ya.prototype.update;olympe.sc.Ya.prototype.create=olympe.sc.Ya.prototype.create;olympe.sc.Ya.prototype.getId=olympe.sc.Ya.prototype.T;olympe.sc.Ya.process=olympe.sc.Ya.process;olympe.sc.Ya.from=olympe.sc.Ya.from;olympe.sc.mj=class{constructor(a){this.j=a}ly(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.mj.prototype.getCreatedObjects=olympe.sc.mj.prototype.ly;olympe.yc={};olympe.yc.Lt=class{run(){}};function ro(a,b='default'){return a.j===b}
1204
+ olympe.sc.Ag.Dz=a=>{const b=a.j,c=olympe.dc.ha();for(const d of b.Vc()){const e=d.Vb();e&&!d.yd()&&c.Nb(e,olympe.sc.Ac)&&d.zb().forEach((f,g)=>{if(f instanceof olympe.dc.vc){const l=b.Uc(f.W());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.W()}`);var h;f=null!=(h=null==l?void 0:l.Vb())?h:null;h=l.tag();let n;if(f===olympe.dc.ea(olympe.sc.Td)){h=l.Ib(olympe.sc.Td.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
1205
+ let p;f=null!=(p=null==(k=b.Uc(h))?void 0:k.Vb())?p:c.model(h)}if(c.Vf(f,olympe.dm.Je)){k=ln(f);let p;n=null!=(p=l.Pa(k.W()))?p:c.Pa(h,k)}if(void 0===n)throw Error(`Try to set a complex property to an instance of a DataType: ${c.name(e)} (${e})`);a.Yc(d.tag(),new Map([[g,n]]));Wl(a,l.tag(),olympe.dc.Lb.Dc)}})}};
1206
+ olympe.sc.Ag.Bx=a=>{const b=a.j,c=olympe.dc.ha(),d=new Set;for(var e of b.Bb.values()){a=e.tag();let f;const g=null!=(f=e.Vb())?f:c.model(a);if(null!==g&&e.Fd()&&(d.has(g)||c.Nb(g,olympe.sc.Ac))){d.add(g);const h=Array.from(e.ba()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.fc.Zc?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Uc(k))?void 0:l.Vb())?n:c.model(k);return!p||!(d.has(p)||c.Nb(p,olympe.sc.Ac))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Uc(h))?void 0:k.Vb())?l:c.model(h))?
1207
+ n:'unknown';throw Error(`Try to link an instance (${a}) of DataType ${c.name(g)} (${g}) to an instance which is not (${h}) a DataType: ${c.name(e)} (${e})`);}}}};olympe.sc.Ag.Tz=a=>{var b=a.j;const c=olympe.dc.ha();for(const d of b.Vc()){b=d.tag();const e=d.Vb();if(e&&!c.Nb(e,olympe.sc.Ac)&&Z(a,b))throw Error(`You are trying to persist an instance of : ${c.name(e)} (${e}), but only instances of DataType can be persisted`);}};
1208
+ olympe.V.run([olympe.dc.transaction.P.Fa],a=>{hm(hm(hm(a,olympe.sc.Ag.Bx,'businessDataRelations'),olympe.sc.Ag.pz,'linkBusinessContainer'),olympe.sc.Ag.Dz,'noBusinessComplexProperty')});olympe.sc.$j=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Oe.Bh}};olympe.sc.$j.O=olympe.dc.na.j('01645fe6873aeea59e64',olympe.sc.$j);olympe.sc.$j.j=olympe.sc.$j.O.ra('017ed8ac775f48d4d589');olympe.sc.Uo=class extends olympe.dm.Kb{ve(){return olympe.sc.xe.Oe.Bh}};olympe.sc.Uo.O=olympe.dc.na.j('0163a68ce44f3d1fa95d',olympe.sc.Uo);olympe.sc.zh=class extends olympe.dm.BrickMetadata{};olympe.sc.zh.O=olympe.dc.na.j('016324fde11a836f77d3',olympe.sc.zh);olympe.sc.zh.j=olympe.sc.Ac.O.ra('016324fde11a836088d3');olympe.sc.zh.O.j=(a,b)=>bm(a,null!=b?b:'New config type',olympe.sc.zh).W();olympe.sc.QA=class{};olympe.sc.ek=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Oe.Bh}};olympe.sc.ek.O=olympe.dc.na.j('017dc8d6c8fd8c8bd2ff',olympe.sc.ek);olympe.sc.ek.O.j=(a,b)=>bm(a,null!=b?b:'New data connector',olympe.sc.ek,olympe.dm.DataSource).W();olympe.sc.Be=class extends olympe.sc.Runnable{X(){return this.cb(olympe.sc.Be.H,olympe.sc.Runnable)}j(){return this.cb(olympe.sc.Be.F,olympe.dm.Property)}};olympe.sc.Be.O=kg(olympe.dc.na.j('016c2d996d9ca27fa9d8',olympe.sc.Be));olympe.sc.Be.H=olympe.sc.Be.O.ra('016c3cb7742ec9309e0b');olympe.sc.Be.F=olympe.sc.Be.O.ra('016c42d3454636f90533');olympe.sc.Be.prototype.X.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.Be.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.sp=class extends olympe.dm.Kb{ve(){return olympe.sc.xe.Oe.Bh}};olympe.sc.sp.O=olympe.dc.na.j('017a7a9ff057958e5678',olympe.sc.sp);olympe.sc.Mi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ha();e=void 0!==e?e:f.Ja(b)&&f.Vc(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.sc.Mi.create=olympe.sc.Mi.create;olympe.sc.Mi.O=olympe.dc.na.j('016cdd861b32d56c8208',olympe.sc.Mi);olympe.sc.zq=class extends olympe.dm.Kb{ve(){return olympe.sc.xe.Oe.Qw}};olympe.sc.zq.O=olympe.dc.na.j('01644b6d4543b344b857',olympe.sc.zq);olympe.sc.Aq=class extends olympe.dc.CloudObject{};olympe.sc.Aq.O=olympe.dc.na.j('0162f672366be5ca7a86',olympe.sc.Aq);const so={rp:30};olympe.sc.cc=class extends olympe.dc.sources.cc{D(a){return a instanceof olympe.sc.logic.Error?this.format(so.rp,{c:a.Aj(),m:a.message,s:a.se()}):super.D(a)}j(a){return(null==a?void 0:a.t)===so.rp?(a=a.v,rn(a.m,a.c,a.s)):super.j(a)}H(a){super.H(a);if(this.db.model(a)===olympe.sc.Td.O.W()){const b=olympe.sc.Td.j;this.F.get(a).r.push({r:b.W(),o:a,d:this.db.Ib(a,b)})}return a}};olympe.sc.Vr=class extends olympe.sc.Be{};olympe.sc.Vr.O=olympe.dc.na.j('016d3f37610ae4fc3962',olympe.sc.Vr);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.na.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Ya=class{constructor(a=!0){a=$l(a);a.N=!0;var b=olympe.sc.Ag.Tz;let c;(null==(c=olympe.V.getParameter(olympe.dc.transaction.Config.fm))?0:c.includes('persistenceBusinessDataOnly'))||a.R.push(b);this.j=a;this.D=[];this.source=null}static from(a){const b=olympe.sc.xa.j.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Ya}static process(a,b){return a.has(olympe.sc.xa.j.TRANSACTION,!0)?Promise.resolve(!1):b.mb().then(()=>!0)}T(){return this.j.T()}create(a,b=new Map,c=this.source,d){c=
1209
+ 'string'===typeof c?c:olympe.dc.ee().fromModel(a);a=this.j.create(a,d).yi(c);for(const [e,f]of b)X(a,e,f);b=a.W();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}lt(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Kd.set(olympe.dc.ea(c),b);return this}delete(a){this.j.delete(a);return this}Oa(a,b,c){this.j.Oa(a,b,c);return this}hc(a,b,c){this.j.hc(a,b,c);return this}An(a,b){this.j.An(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}Sz(a,b=!0){olympe.ga.Wa('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');
1210
+ return this.persist(a,b)}yi(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){am(this.j,a.j);return this}rn(a){this.j.rn(a);return this}mb(){return new Promise((a,b)=>{this.j.mb((c,d)=>{c?a(new olympe.sc.mj(this.D)):b(d)})})}Bn(){return new Promise((a,b)=>{this.j.Bn((c,d)=>{c?a(new olympe.sc.mj(this.D)):b(d)})})}};olympe.sc.Ya.prototype.executeAsLarge=olympe.sc.Ya.prototype.Bn;olympe.sc.Ya.prototype.execute=olympe.sc.Ya.prototype.mb;olympe.sc.Ya.prototype.afterExecution=olympe.sc.Ya.prototype.rn;
1211
+ olympe.sc.Ya.prototype.merge=olympe.sc.Ya.prototype.merge;olympe.sc.Ya.prototype.model=olympe.sc.Ya.prototype.model;olympe.sc.Ya.prototype.setSource=olympe.sc.Ya.prototype.yi;olympe.sc.Ya.prototype.persistInstance=olympe.sc.Ya.prototype.Sz;olympe.sc.Ya.prototype.persist=olympe.sc.Ya.prototype.persist;olympe.sc.Ya.prototype.deleteAllRelations=olympe.sc.Ya.prototype.An;olympe.sc.Ya.prototype.deleteRelation=olympe.sc.Ya.prototype.hc;olympe.sc.Ya.prototype.createRelation=olympe.sc.Ya.prototype.Oa;
1212
+ olympe.sc.Ya.prototype['delete']=olympe.sc.Ya.prototype.delete;olympe.sc.Ya.prototype.multiUpdate=olympe.sc.Ya.prototype.lt;olympe.sc.Ya.prototype.update=olympe.sc.Ya.prototype.update;olympe.sc.Ya.prototype.create=olympe.sc.Ya.prototype.create;olympe.sc.Ya.prototype.getId=olympe.sc.Ya.prototype.T;olympe.sc.Ya.process=olympe.sc.Ya.process;olympe.sc.Ya.from=olympe.sc.Ya.from;olympe.sc.mj=class{constructor(a){this.j=a}my(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.mj.prototype.getCreatedObjects=olympe.sc.mj.prototype.my;olympe.yc={};olympe.yc.Lt=class{run(){}};function to(a,b='default'){return a.j===b}
1211
1213
  olympe.yc.Ta=class{constructor(a,b){this.j=a;this.G=b;this.D=null;this.F='';this.G.info('HC Manager will execute application registered as:',this.j)}Nj(a,b,c=''){b||(b='default');b===this.j?(null===this.D?this.G.log('Application',c,'designated to be launched'):this.G.log('OVERRIDE: Application',c,'designated to be launched'),this.D=a,this.F=c):this.G.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.j)}run(){null!==this.D?(this.G.info('Running application:',this.F),
1212
- this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.yc.Nj=function(a,b,c='default'){const d=a.Xa();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.yc.Config.ye+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.wd(olympe.yc.P.Fa).config(c,[b],(e,f)=>f.Nj(e,c,b),e=>ro(e,c),'olympe.hc.registerApp')};olympe.yc.P={Fa:'hc.Manager',Ca:'hc.Logger'};olympe.yc.Config={ye:'hc.app',Ip:'hc.globalToken'};olympe.V.config(function(a){E(a,olympe.yc.Config.ye,'default');E(a,olympe.yc.Config.Ip,!1);D(a,olympe.yc.P.Ca,[olympe.ha.P.Fa],b=>b.ad('hc'));D(a,olympe.Db.P.$g,[new olympe.V.oa(olympe.yc.Config.ye)],b=>b);D(a,olympe.auth.P.Cl,[olympe.Db.P.$g,new olympe.V.oa(olympe.yc.Config.Ip)],(b,c)=>new olympe.auth.ro(c?'':b));C(a,olympe.yc.P.Fa,olympe.yc.Ta,new olympe.V.oa(olympe.yc.Config.ye),olympe.yc.P.Ca)},'olympe.hc');
1213
- olympe.V.run([olympe.yc.P.Fa],a=>a.run(),'olympe.hc');olympe.sc.Hb={};function so(a){a.X=a.F.H(()=>u(function*(){return to(a)}),'Stop application')}function uo(a){a.R=a.F.j(()=>olympe.C.Qa(a.Z)===olympe.C.ba.D?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.Je.j.READINESS)}
1214
- function vo(a){if(a.sa)return a.G.debug('Sending getContext request'),Ji(a.Ha).then(()=>{a.G.debug('synchronisation request successful');var f=a.j;bo=null;$n=f}).catch(f=>{a.G.error('failed to synchronise (authenticated) with server: '+f.message)});const b=nn(a.D);!b&&jl();a.G.debug((b?'PULLING':'SUBSCRIBING')+' application '+a.j);const c=a.D.Cb(),d=new Promise((f,g)=>{const h=olympe.dc.ga(),k=new olympe.C.Wb('Primordial Subscription Context',c);xi(k,a.j,l=>{l=h.vi(l)?l:h.model(l);return null!==l&&
1215
- h.Nb(l,olympe.sc.zh)},{ld:b?olympe.dc.la.nc.Qg:olympe.dc.la.nc.vf,ao:!0,ft:!0}).subscribe(rxjs.Subscriber.create(c.rc(()=>{h.Nb(a.j,olympe.sc.pa.Yc)?(a.Wa.X(a.j,b),f()):Qd(a.N)?g(Error(`The specified application tag (${a.j}) is not an application or does not exist`)):(k.destroy(),a.N.connect().catch(l=>{g(Error(`Failed to load the app while offline, you might want to try again when online: ${l}`))}))}),l=>g(l)))}),e=new Promise(f=>{olympe.C.Vc([a.ia.te()],g=>{olympe.dc.la.Qe(g,olympe.dm.User,olympe.dc.Ia.SERVER).observe(c,
1216
- {ld:olympe.dc.la.nc.Ck,cl:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.da)return wo(a);wo(a).then(()=>{})})}
1217
- function xo(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ga();if(0<a.j.length){const c=Nf(b,a.j,a.D.Cb().rc((f,g)=>{if(f)if(f=Rn(g),f instanceof olympe.sc.pa.Ei){a.G.debug('application retrieved: running');g=kn(a.D,f);const h=new olympe.sc.$a.cw(a.H);ob(a.H,()=>xn(a.D.state,h));pb(a.H,()=>{var k=h.T();return zn(a.D.state,k)});a.nb&&a.H.start();f.run(g);'string'===typeof a.yb&&(new olympe.sc.$d).da(f.W(),g,a.G);g.Dt(olympe.sc.xa.j.io).then(()=>{var k;null==(k=d)||k.cancel();a.Z.update(olympe.C.ba.D);
1218
- a.G.info(`Application ${olympe.dc.ga().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.ce();k.Yb=!0;k.X+=0;k.ke.next(0<k.X);0===k.X&&k.Z&&k.Yb&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.Wa.set('__code-as-data-version__',k.version),k.yb||(k.Z=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else to(a)}));olympe.C.Za().onDestroy(()=>{Lf(b,a.j,c)});const d=Bc(()=>{a.G.warn(`requested application ${a.j} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
1219
- 3E4);let e;null==(e=a.Yb)||e.start()}}function wo(a){return u(function*(){yo(a.j)&&(yield co(a.j,a.da).catch(b=>{throw Error(`Failed to load the business container for the application ${a.j}: ${b}`);}))})}function to(a){a.G.info('Stop the application');a.D.Cb().rg();a.F.D(a.R);a.F.F(a.X)}
1220
- olympe.sc.Hb.Vm=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.ia=b;this.N=c;this.Ha=d;this.F=e;this.X=this.R='';this.D=f;this.Wa=g;this.H=h;this.Yb=l;this.j=k.get('appTag');this.sa=k.get('getContextMode');let n;this.yb=null!=(n=k.get('debuggerName'))?n:null;this.nb=k.get('autostartProfiler');this.da=k.get('requireBusinessContainer');this.Z=olympe.C.bc(olympe.C.ba).update(olympe.C.ba.j)}run(){this.G.debug('runtime starting for app #'+this.j);let a=!1;so(this);uo(this);const b=olympe.L.uc.j.cj,
1221
- c=olympe.L.uc.j.Df,d=olympe.L.uc.j.zc;olympe.C.Vc([this.N.getState()],e=>{switch(e){case b:case c:this.G.debug('Server session opened or working offline, start the application');a||(a=!0,vo(this).then(olympe.C.Za().rc(()=>xo(this))));break;case d:this.G.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Hb.Vm.j='app_instance';olympe.sc.Hb.Vm.ya=[olympe.yc.Lt];olympe.sc.Hb.lw=class{constructor(a,b,c,d){this.G=a;this.D=b;this.F=d.get('httpManifestPath');this.j=d.get('manifestCommon');if(!this.j)this.j={};else if('string'===typeof this.j)try{this.j=JSON.parse(this.j)}catch(e){this.G.warn('Invalid manifest common config'),this.j={}}}start(){const a=b=>{this.G.debug('Request URL',b.j());const c=(new URL(b.j())).searchParams.get('origin');if(c)return c;b=b.Cj();this.G.debug('Request headers',b);return b.origin?b.origin:b.Zz?(new URL(b.Zz)).origin:b[olympe.net.va.Headers.yp]&&
1222
- b[olympe.net.va.Headers.zp]?b[olympe.net.va.Headers.zp]+'://'+b[olympe.net.va.Headers.yp]:null};this.D.D('manifest',`${this.F}/:${'appTag'}`,[olympe.net.va.Rd.GET],(b,c)=>{const d=this;return u(function*(){var e=c.get('appTag');d.G.debug('Processing request to serve manifest for app',e);if(20!==e.length)return new olympe.net.pd('Invalid appTag',olympe.net.va.Tb.Fl);try{var f=yield olympe.dc.la.Qe(e,olympe.sc.pa.Yc).lb()}catch(h){return new olympe.net.pd(`Something went wrong: ${'string'===typeof h?
1223
- h:h.message}`,olympe.net.va.Tb.Fl)}if(0===f.size())return new olympe.net.pd('App not found',olympe.net.va.Tb.Zi);var g=a(b);f=f.Ic();g={name:f.name(),short_name:f.name(),id:e,start_url:g?`${g}?hc.app=sc.runtime&sc.app=${e}`:void 0,display:'standalone',backgroundColor:'#fff',icons:g?[{src:`${g}/images/logo.svg`,sizes:'150x150',type:'image/png'},{src:`${g}/images/logo.png`,sizes:'1024x1024',type:'image/png',purpose:'maskable any'}]:void 0};f=olympe.V.getParameter(`app.manifest.${e}`);if(!f)f={};else if('string'===
1224
- typeof f)try{f=JSON.parse(f)}catch(h){d.G.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.j,f);return new olympe.net.pd(JSON.stringify(e),olympe.net.va.Tb.Qh,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function yo(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.la.from(a).bb(olympe.sc.pa.Yc.j).bb(olympe.dm.Ad.F.$b()).bb(olympe.dm.Ad.j).Cc();a=olympe.dc.la.from(a).bb(olympe.sc.pa.Yc.j).bb(olympe.dm.hb.D).Cc();return c.concat(a).has(b)}
1225
- olympe.sc.Hb.Sk=class extends olympe.dc.sources.Sk{R(a){return this.db.Nb(a,olympe.sc.Ac)}X(a,b){if(!this.H){super.init();var c=olympe.dc.rd.from(a).bb(olympe.sc.pa.Yc.j).Cc();if(!(c instanceof olympe.dm.hb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.la.nc.Qg:olympe.dc.la.nc.vf;al(this,c,b);c=new olympe.C.Wb('deployed data sources');olympe.dc.la.from(a).bb(olympe.sc.pa.Yc.ia).observe(c,{ld:b}).subscribe(d=>{const e=
1226
- new olympe.dc.Ya;d.yj().forEach(f=>{e.Oa(olympe.dm.DataSource.Mj,this.j,f)});d.Ej().forEach(f=>{e.hc(olympe.dm.DataSource.Mj,this.j,f)});e.lb()})}}};olympe.sc.Hb.P={jg:'sc.runtime.Main',af:'sc.runtime.SourceSolver',yr:'sc.runtime.appConfig',Ar:'sc.runtime.runtimeHTTPServiceConfig',zr:'sc.runtime.RuntimeHTTPService',Rq:'sc.runtime.OfflineAppConfig'};olympe.sc.Hb.Config={Tp:'app.httpManifestPath',wq:'app.manifest.common',sq:'sc.loadBusinessContainer'};
1227
- olympe.V.config(function(a){E(a,olympe.sc.Hb.Config.Tp,'/runtime/manifest');E(a,olympe.sc.Hb.Config.wq,null);E(a,olympe.sc.Hb.Config.sq,!1);D(a,olympe.Db.P.$g,[new olympe.V.oa(olympe.yc.Config.ye),new olympe.V.oa(olympe.sc.Config.ye)],(b,c)=>`${b}${c?'-'+c:''}`);D(a,olympe.sc.Hb.P.Rq,[new olympe.V.oa(olympe.sc.Config.ye),new olympe.V.oa(olympe.net.Config.bj),new olympe.V.oa(olympe.net.Config.Fm)],(b,c,d)=>{let e;const f=null!=(e=a.getParameter(`offline.${b}.enabled`))?e:c;let g;b=null!=(g=a.getParameter(`offline.${b}.autoBackOnline`))?
1228
- g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Wa(a,olympe.net.P.Gm,olympe.sc.Hb.P.Rq);C(a,olympe.sc.Hb.P.af,olympe.sc.Hb.Sk,olympe.dc.P.Ch,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.Config.$l));Wa(a,olympe.dc.sources.P.af,olympe.sc.Hb.P.af);D(a,olympe.sc.Hb.P.yr,[new olympe.V.oa(olympe.sc.Config.ye),new olympe.V.oa(olympe.dc.Config.Yh),new olympe.V.oa(olympe.sc.Config.cp),new olympe.V.oa(olympe.sc.Config.ko),new olympe.V.oa(olympe.sc.Hb.Config.sq)],
1229
- (b,c,d,e,f)=>new Map([['appTag',b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['requireBusinessContainer',f]]));C(a,olympe.sc.Hb.P.jg,olympe.sc.Hb.Vm,olympe.sc.P.Ca,olympe.auth.P.Fa,olympe.L.P.uf,olympe.dc.query.P.Fk,olympe.host.P.Ge,olympe.sc.P.Kk,olympe.sc.Hb.P.af,olympe.U.P.ig,olympe.sc.Hb.P.yr,olympe.sc.Hb.P.zr);D(a,olympe.sc.Hb.P.Ar,[new olympe.V.oa(olympe.sc.Hb.Config.Tp),new olympe.V.oa(olympe.sc.Hb.Config.wq)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));
1230
- C(a,olympe.sc.Hb.P.zr,olympe.sc.Hb.lw,olympe.sc.P.Ca,olympe.net.P.nj,olympe.sc.P.Kk,olympe.sc.Hb.P.Ar);olympe.yc.Nj(a,olympe.sc.Hb.P.jg,'sc.runtime');olympe.yc.Nj(a,olympe.sc.Hb.P.jg,'sc.headless');olympe.yc.Nj(a,olympe.sc.Hb.P.jg)},'olympe.sc.runtime');olympe.public={};olympe.public.Ma=class a{static Zx(b,c){const d=new SRPClient,e=d.generateRandomSalt();return{username:b,login:b,salt:e,verifier:d.generateVerifier(e,b,c)}}static getState(){return qf(olympe.public.Ma.get())}static ql(b){return a.D(olympe.public.Ma.get().ql(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static ny(){return olympe.C.Qa(olympe.public.Ma.get().te())}static Lz(b){return a.D(olympe.public.Ma.get().te(),b)}static se(){var b=olympe.C,c=b.Qa;var d=olympe.public.Ma.get().dd.tb().Gd();return c.call(b,
1231
- d)}static yg(){return new Promise((b,c)=>{olympe.public.Ma.get().yg(d=>d?c(d):b())})}static Ay(){return olympe.C.Qa(olympe.public.Ma.get().ri())||void 0}static $y(){const b=ce(olympe.public.Ma.get());return{user:b.xc(),userTag:b.te(),nonce:b.Gd(),payload:b.Vi(),idpName:b.Cf(),protocol:b.Mg()}}static zy(){return Array.from(rf().keys())}static qf(){olympe.public.Ma.get().qf()}static qh(b){return new Promise((c,d)=>{olympe.public.Ma.get().qh(b,e=>e?d(e):c())})}static rz(b,c){return olympe.public.Ma.j((new Map).set('username',
1232
- b).set('password',c),olympe.auth.Ec.j.SRP)}static sz(b){const c=rf();if(0===c.size||b&&!c.has(b)){var d=0===c.size?'There are no available IDPs':`The IDP name ${b} is not valid, the valid names are ${Array.from(c.keys())}`;return Promise.reject(d)}b?(d=b,b=c.get(b)):(b=Array.from(c)[0],d=b[0],b=b[1]);return olympe.public.Ma.j((new Map).set('idpName',d),b)}static qz(){return olympe.public.Ma.j(new Map,olympe.auth.Ec.j.SAML)}static uz(b,c){return olympe.public.Ma.j((new Map).set('username',b).set('nonce',
1233
- c),olympe.auth.Ec.j.Hm)}static pz(){return olympe.public.Ma.j(new Map,olympe.auth.Ec.j.OAUTH2)}static Jj(){return olympe.public.Ma.get().Jj()}static j(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{pf(olympe.public.Ma.get(),d,c,()=>{e()})})}static get(){return olympe.auth.qe()}static D(b,c){return b.asObservable('function'===typeof c.Cb?c.Cb():c)}};olympe.public.Ma.logout=olympe.public.Ma.Jj;olympe.public.Ma.loginOpenID=olympe.public.Ma.pz;
1234
- olympe.public.Ma.loginToken=olympe.public.Ma.uz;olympe.public.Ma.loginSAML=olympe.public.Ma.qz;olympe.public.Ma.loginSSO=olympe.public.Ma.sz;olympe.public.Ma.loginSRP=olympe.public.Ma.rz;olympe.public.Ma.getUserFromToken=olympe.public.Ma.qh;olympe.public.Ma.sendKeepAlive=olympe.public.Ma.qf;olympe.public.Ma.getIDPNames=olympe.public.Ma.zy;olympe.public.Ma.getUserToken=olympe.public.Ma.$y;olympe.public.Ma.getIDPToken=olympe.public.Ma.Ay;olympe.public.Ma.refreshToken=olympe.public.Ma.yg;
1235
- olympe.public.Ma.getToken=olympe.public.Ma.se;olympe.public.Ma.observeUser=olympe.public.Ma.Lz;olympe.public.Ma.getCurrentUser=olympe.public.Ma.ny;olympe.public.Ma.isAuthenticated=olympe.public.Ma.ql;olympe.public.Ma.getState=olympe.public.Ma.getState;olympe.public.Ma.generateSRPData=olympe.public.Ma.Zx;olympe.public.Config=class{static getParameter(a){return olympe.V.getParameter(a)}static setParameter(a,b){return olympe.V.Ai(a,b)}};olympe.public.Config.setParameter=olympe.public.Config.setParameter;olympe.public.Config.getParameter=olympe.public.Config.getParameter;olympe.public.za=class{static create(a){return new class extends olympe.dc.Y.Bg{j(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.C.bc(olympe.C.ba),e=b.subscribe(f=>d.update(olympe.C.Rb(f)));olympe.C.Za().Xd(()=>e.unsubscribe());return d.tb()}}}};
1236
- olympe.public.wf=class{static create(a){return new class extends olympe.dc.wc.Bg{F(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.C.bc(olympe.C.$),e=b.subscribe(f=>d.update(olympe.C.qa(f)));olympe.C.Za().Xd(()=>e.unsubscribe());return d.tb()}}}};olympe.public.Process=class{static Nz(a,b){if('string'===typeof b)throw Error('When registering a health check, the options parameter should be an object: string is not supported anymore.');const c=olympe.host.ll(),d=c.j(a,void 0,null==b?void 0:b.type);return()=>c.D(d)}static Oz(a,b,c){const d=olympe.host.ll(),e=d.ia(a,b,c);return()=>d.F(e)}static connect(){return olympe.L.Bn().connect()}static disconnect(){return olympe.L.Bn().disconnect()}static Vf(a){a='function'===typeof a.Cb?a.Cb():a;return olympe.L.Bn().Vf().asObservable(a).pipe(rxjs.operators.map(b=>
1237
- b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Vf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.Oz;olympe.public.Process.onHealthCheck=olympe.public.Process.Nz;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Ra.Relation,Direction:olympe.dc.ua,generateTag:olympe.U.hf,tagToString:olympe.dc.ea,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Fs,defineInverseRelation:olympe.dc.Jx,BrickContext:olympe.sc.xa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Function,GlobalProperties:olympe.sc.xa.j,registerBrick:olympe.sc.logic.na.j,FunctionBrick:olympe.sc.logic.Function,
1238
- Context:olympe.sc.xa,Entry:olympe.dc.Ra.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.sc.File,User:olympe.dm.User,Enum:olympe.dm.fg,EnumValue:olympe.sc.Mi,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.Dd,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.cf,WorkflowTransition:olympe.sc.workflow.Transition,
1239
- WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Ya,BurstTransaction:olympe.dc.Gi,TransactionResult:olympe.sc.mj,PredefinedDataSource:olympe.dc.Ia,QueryResult:olympe.dc.Ka,Query:olympe.dc.la,QuerySingle:olympe.dc.rd,Predicate:olympe.dc.query.za,Order:olympe.dc.query.Bk,Config:olympe.public.Config,Process:olympe.public.Process,ProbeType:olympe.host.Je.j,Cache:{getCacheEntries:()=>olympe.dc.sources.ce().N,clearCache:a=>ql(olympe.dc.sources.ce(),a),getProcessingStatus:()=>olympe.dc.sources.ce().Jc(),
1240
- getProcessingErrors:()=>olympe.dc.sources.ce().vd.asObservable(),hasPendingChanges:()=>olympe.dc.sources.ce().da.asObservable(),synchroniseChanges:()=>wl(),getPendingChanges:()=>zl(),clearPendingChanges:()=>Dl(),loadPendingChanges:a=>Bl(a)},Color:olympe.C.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.L.wa.j,ServiceRequest:olympe.L.Fc,Service:olympe.L.qb,Auth:olympe.public.Ma,AuthState:{INIT:olympe.auth.Ta.j.INIT,AUTHENTICATING:olympe.auth.Ta.j.Sj,GUEST:olympe.auth.Ta.j.Pi,AUTHENTICATED:olympe.auth.Ta.j.rf,
1241
- ERROR:olympe.auth.Ta.j.Ab},AuthProtocol:olympe.auth.Ec.j,Sync:olympe.dc.CloudObject,BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.kb{static get(){return olympe.dc.ga()}},ListDef:olympe.dc.Aa,instanceToTag:olympe.dc.ea,registerSync:olympe.dc.na.j,
1242
- getUniqueTag:olympe.U.hf,onDestroy:a=>olympe.C.Za().onDestroy(a),offDestroy:a=>olympe.C.Za().Wf(a),FollowRules:olympe.dc.Lb,transformers:{Related:olympe.dc.aa.$e,RecursiveRelated:olympe.dc.aa.Ke,Distinct:olympe.dc.aa.Ki,Filter:olympe.dc.aa.yf,Limit:olympe.dc.aa.Mh,Sort:olympe.dc.aa.ah,Union:olympe.dc.aa.Kf},ListDefPredicate:olympe.public.za,predicates:{And:olympe.dc.Y.Nd,Or:olympe.dc.Y.Fe,Not:olympe.dc.Y.ie,Equals:olympe.dc.Y.Be,Contains:olympe.dc.Y.xf,Greater:olympe.dc.Y.mk,Smaller:olympe.dc.Y.Rk,
1243
- HasRelated:olympe.dc.Y.Ri,InstanceOf:olympe.dc.Y.Ui,Regex:olympe.dc.Y.Gf},Comparator:olympe.public.wf,comparators:{Number:olympe.dc.wc.Number,String:olympe.dc.wc.String,DateTime:olympe.dc.wc.DateTime},valuedefs:{BooleanProperty:olympe.dc.ab.Wj,StringProperty:olympe.dc.ab.jj,NumberProperty:olympe.dc.ab.aj,DateTimeProperty:olympe.dc.ab.Ji,Constant:olympe.dc.ab.We,Tag:olympe.dc.ab.kj}});
1214
+ this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.yc.Nj=function(a,b,c='default'){const d=a.Wa();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.yc.Config.ze+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.wd(olympe.yc.P.Fa).config(c,[b],(e,f)=>f.Nj(e,c,b),e=>to(e,c),'olympe.hc.registerApp')};olympe.yc.P={Fa:'hc.Manager',Da:'hc.Logger'};olympe.yc.Config={ze:'hc.app',Jp:'hc.globalToken'};olympe.V.config(function(a){E(a,olympe.yc.Config.ze,'default');E(a,olympe.yc.Config.Jp,!1);D(a,olympe.yc.P.Da,[olympe.ga.P.Fa],b=>b.ad('hc'));D(a,olympe.Db.P.$g,[new olympe.V.oa(olympe.yc.Config.ze)],b=>b);D(a,olympe.auth.P.Fl,[olympe.Db.P.$g,new olympe.V.oa(olympe.yc.Config.Jp)],(b,c)=>new olympe.auth.so(c?'':b));C(a,olympe.yc.P.Fa,olympe.yc.Ta,new olympe.V.oa(olympe.yc.Config.ze),olympe.yc.P.Da)},'olympe.hc');
1215
+ olympe.V.run([olympe.yc.P.Fa],a=>a.run(),'olympe.hc');olympe.sc.Hb={};function uo(a){a.X=a.F.H(()=>u(function*(){return vo(a)}),'Stop application')}function wo(a){a.R=a.F.j(()=>olympe.C.Qa(a.Z)===olympe.C.da.D?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.Ke.j.READINESS)}
1216
+ function xo(a){if(a.wa)return a.G.debug('Sending getContext request'),Li(a.Ha).then(()=>{a.G.debug('synchronisation request successful');var f=a.j;eo=null;bo=f}).catch(f=>{a.G.error('failed to synchronise (authenticated) with server: '+f.message)});const b=pn(a.D);!b&&ll();a.G.debug((b?'PULLING':'SUBSCRIBING')+' application '+a.j);const c=a.D.Cb(),d=new Promise((f,g)=>{const h=olympe.dc.ha(),k=new olympe.C.Xb('Primordial Subscription Context',c);zi(k,a.j,l=>{l=h.vi(l)?l:h.model(l);return null!==l&&
1217
+ h.Nb(l,olympe.sc.zh)},{md:b?olympe.dc.la.nc.Qg:olympe.dc.la.nc.wf,bo:!0,ft:!0}).subscribe(rxjs.Subscriber.create(c.rc(()=>{h.Nb(a.j,olympe.sc.pa.Oc)?(a.Ua.X(a.j,b),f()):Pd(a.N)?g(Error(`The specified application tag (${a.j}) is not an application or does not exist`)):(k.destroy(),a.N.connect().catch(l=>{g(Error(`Failed to load the app while offline, you might want to try again when online: ${l}`))}))}),l=>g(l)))}),e=new Promise(f=>{olympe.C.Wc([a.ia.ue()],g=>{olympe.dc.la.pe(g,olympe.dm.User,olympe.dc.Ia.SERVER).observe(c,
1218
+ {md:olympe.dc.la.nc.Ck,cl:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.ba)return yo(a);yo(a).then(()=>{})})}
1219
+ function zo(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ha();if(0<a.j.length){const c=Pf(b,a.j,a.D.Cb().rc((f,g)=>{if(f)if(f=Tn(g),f instanceof olympe.sc.pa.Ei){a.G.debug('application retrieved: running');g=mn(a.D,f);const h=new olympe.sc.$a.dw(a.H);ob(a.H,()=>zn(a.D.state,h));pb(a.H,()=>{var k=h.T();return Bn(a.D.state,k)});a.lb&&a.H.start();f.run(g);'string'===typeof a.vb&&(new olympe.sc.$d).ba(f.W(),g,a.G);g.Dt(olympe.sc.xa.j.jo).then(()=>{var k;null==(k=d)||k.cancel();a.Z.update(olympe.C.da.D);
1220
+ a.G.info(`Application ${olympe.dc.ha().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.ce();k.Ub=!0;k.X+=0;k.ke.next(0<k.X);0===k.X&&k.Z&&k.Ub&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.Ua.set('__code-as-data-version__',k.version),k.vb||(k.Z=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else vo(a)}));olympe.C.Za().onDestroy(()=>{Nf(b,a.j,c)});const d=Bc(()=>{a.G.warn(`requested application ${a.j} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
1221
+ 3E4);let e;null==(e=a.Ub)||e.start()}}function yo(a){return u(function*(){Ao(a.j)&&(yield fo(a.j,a.ba).catch(b=>{throw Error(`Failed to load the business container for the application ${a.j}: ${b}`);}))})}function vo(a){a.G.info('Stop the application');a.D.Cb().sg();a.F.D(a.R);a.F.F(a.X)}
1222
+ olympe.sc.Hb.Ym=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.ia=b;this.N=c;this.Ha=d;this.F=e;this.X=this.R='';this.D=f;this.Ua=g;this.H=h;this.Ub=l;this.j=k.get('appTag');this.wa=k.get('getContextMode');let n;this.vb=null!=(n=k.get('debuggerName'))?n:null;this.lb=k.get('autostartProfiler');this.ba=k.get('requireBusinessContainer');this.Z=olympe.C.bc(olympe.C.da).update(olympe.C.da.j)}run(){this.G.debug('runtime starting for app #'+this.j);let a=!1;uo(this);wo(this);const b=olympe.L.uc.j.cj,
1223
+ c=olympe.L.uc.j.Ef,d=olympe.L.uc.j.zc;olympe.C.Wc([this.N.getState()],e=>{switch(e){case b:case c:this.G.debug('Server session opened or working offline, start the application');a||(a=!0,xo(this).then(olympe.C.Za().rc(()=>zo(this))));break;case d:this.G.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Hb.Ym.j='app_instance';olympe.sc.Hb.Ym.ya=[olympe.yc.Lt];olympe.sc.Hb.mw=class{constructor(a,b,c,d){this.G=a;this.D=b;this.F=d.get('httpManifestPath');this.j=d.get('manifestCommon');if(!this.j)this.j={};else if('string'===typeof this.j)try{this.j=JSON.parse(this.j)}catch(e){this.G.warn('Invalid manifest common config'),this.j={}}}start(){const a=b=>{this.G.debug('Request URL',b.j());const c=(new URL(b.j())).searchParams.get('origin');if(c)return c;b=b.Cj();this.G.debug('Request headers',b);return b.origin?b.origin:b.$z?(new URL(b.$z)).origin:b[olympe.net.ua.Headers.zp]&&
1224
+ b[olympe.net.ua.Headers.Ap]?b[olympe.net.ua.Headers.Ap]+'://'+b[olympe.net.ua.Headers.zp]:null};this.D.D('manifest',`${this.F}/:${'appTag'}`,[olympe.net.ua.Rd.GET],(b,c)=>{const d=this;return u(function*(){var e=c.get('appTag');d.G.debug('Processing request to serve manifest for app',e);if(20!==e.length)return new olympe.net.qd('Invalid appTag',olympe.net.ua.Tb.Il);try{var f=yield olympe.dc.la.pe(e,olympe.sc.pa.Oc).mb()}catch(h){return new olympe.net.qd(`Something went wrong: ${'string'===typeof h?
1225
+ h:h.message}`,olympe.net.ua.Tb.Il)}if(0===f.size())return new olympe.net.qd('App not found',olympe.net.ua.Tb.Zi);var g=a(b);f=f.Jc();g={name:f.name(),short_name:f.name(),id:e,start_url:g?`${g}?hc.app=sc.runtime&sc.app=${e}`:void 0,display:'standalone',backgroundColor:'#fff',icons:g?[{src:`${g}/images/logo.svg`,sizes:'150x150',type:'image/png'},{src:`${g}/images/logo.png`,sizes:'1024x1024',type:'image/png',purpose:'maskable any'}]:void 0};f=olympe.V.getParameter(`app.manifest.${e}`);if(!f)f={};else if('string'===
1226
+ typeof f)try{f=JSON.parse(f)}catch(h){d.G.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.j,f);return new olympe.net.qd(JSON.stringify(e),olympe.net.ua.Tb.Qh,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function Ao(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.la.from(a).bb(olympe.sc.pa.Oc.j).bb(olympe.dm.Ad.F.$b()).bb(olympe.dm.Ad.j).Cc();a=olympe.dc.la.from(a).bb(olympe.sc.pa.Oc.j).bb(olympe.dm.hb.D).Cc();return c.concat(a).has(b)}
1227
+ olympe.sc.Hb.Sk=class extends olympe.dc.sources.Sk{R(a){return this.db.Nb(a,olympe.sc.Ac)}X(a,b){if(!this.H){super.init();var c=olympe.dc.sd.from(a).bb(olympe.sc.pa.Oc.j).Cc();if(!(c instanceof olympe.dm.hb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.la.nc.Qg:olympe.dc.la.nc.wf;cl(this,c,b);c=new olympe.C.Xb('deployed data sources');olympe.dc.la.from(a).bb(olympe.sc.pa.Oc.ia).observe(c,{md:b}).subscribe(d=>{const e=
1228
+ new olympe.dc.Ya;d.yj().forEach(f=>{e.Oa(olympe.dm.DataSource.Mj,this.j,f)});d.Ej().forEach(f=>{e.hc(olympe.dm.DataSource.Mj,this.j,f)});e.mb()})}}};olympe.sc.Hb.P={kg:'sc.runtime.Main',af:'sc.runtime.SourceSolver',zr:'sc.runtime.appConfig',Br:'sc.runtime.runtimeHTTPServiceConfig',Ar:'sc.runtime.RuntimeHTTPService',Sq:'sc.runtime.OfflineAppConfig'};olympe.sc.Hb.Config={Up:'app.httpManifestPath',xq:'app.manifest.common',tq:'sc.loadBusinessContainer'};
1229
+ olympe.V.config(function(a){E(a,olympe.sc.Hb.Config.Up,'/runtime/manifest');E(a,olympe.sc.Hb.Config.xq,null);E(a,olympe.sc.Hb.Config.tq,!1);D(a,olympe.Db.P.$g,[new olympe.V.oa(olympe.yc.Config.ze),new olympe.V.oa(olympe.sc.Config.ze)],(b,c)=>`${b}${c?'-'+c:''}`);D(a,olympe.sc.Hb.P.Sq,[new olympe.V.oa(olympe.sc.Config.ze),new olympe.V.oa(olympe.net.Config.bj),new olympe.V.oa(olympe.net.Config.Im)],(b,c,d)=>{let e;const f=null!=(e=a.getParameter(`offline.${b}.enabled`))?e:c;let g;b=null!=(g=a.getParameter(`offline.${b}.autoBackOnline`))?
1230
+ g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Wa(a,olympe.net.P.Jm,olympe.sc.Hb.P.Sq);C(a,olympe.sc.Hb.P.af,olympe.sc.Hb.Sk,olympe.dc.P.Ch,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.Config.cm));Wa(a,olympe.dc.sources.P.af,olympe.sc.Hb.P.af);D(a,olympe.sc.Hb.P.zr,[new olympe.V.oa(olympe.sc.Config.ze),new olympe.V.oa(olympe.dc.Config.Yh),new olympe.V.oa(olympe.sc.Config.ep),new olympe.V.oa(olympe.sc.Config.lo),new olympe.V.oa(olympe.sc.Hb.Config.tq)],
1231
+ (b,c,d,e,f)=>new Map([['appTag',b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['requireBusinessContainer',f]]));C(a,olympe.sc.Hb.P.kg,olympe.sc.Hb.Ym,olympe.sc.P.Da,olympe.auth.P.Fa,olympe.L.P.vf,olympe.dc.query.P.Fk,olympe.host.P.He,olympe.sc.P.Kk,olympe.sc.Hb.P.af,olympe.U.P.jg,olympe.sc.Hb.P.zr,olympe.sc.Hb.P.Ar);D(a,olympe.sc.Hb.P.Br,[new olympe.V.oa(olympe.sc.Hb.Config.Up),new olympe.V.oa(olympe.sc.Hb.Config.xq)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));
1232
+ C(a,olympe.sc.Hb.P.Ar,olympe.sc.Hb.mw,olympe.sc.P.Da,olympe.net.P.nj,olympe.sc.P.Kk,olympe.sc.Hb.P.Br);olympe.yc.Nj(a,olympe.sc.Hb.P.kg,'sc.runtime');olympe.yc.Nj(a,olympe.sc.Hb.P.kg,'sc.headless');olympe.yc.Nj(a,olympe.sc.Hb.P.kg)},'olympe.sc.runtime');olympe.public={};olympe.public.Ma=class a{static $x(b,c){const d=new SRPClient,e=d.generateRandomSalt();return{username:b,login:b,salt:e,verifier:d.generateVerifier(e,b,c)}}static getState(){return sf(olympe.public.Ma.get())}static rl(b){return a.D(olympe.public.Ma.get().rl(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static oy(){return olympe.C.Qa(olympe.public.Ma.get().ue())}static Mz(b){return a.D(olympe.public.Ma.get().ue(),b)}static te(){var b=olympe.C,c=b.Qa;var d=olympe.public.Ma.get().dd.tb().Gd();return c.call(b,
1233
+ d)}static yg(){return new Promise((b,c)=>{olympe.public.Ma.get().yg(d=>d?c(d):b())})}static By(){return olympe.C.Qa(olympe.public.Ma.get().ri())||void 0}static az(){const b=ee(olympe.public.Ma.get());return{user:b.xc(),userTag:b.ue(),nonce:b.Gd(),payload:b.Vi(),idpName:b.Df(),protocol:b.Mg()}}static Ay(){return Array.from(tf().keys())}static rf(){olympe.public.Ma.get().rf()}static qh(b){return new Promise((c,d)=>{olympe.public.Ma.get().qh(b,e=>e?d(e):c())})}static sz(b,c){return olympe.public.Ma.j((new Map).set('username',
1234
+ b).set('password',c),olympe.auth.Ec.j.SRP)}static uz(b){const c=tf();if(0===c.size||b&&!c.has(b)){var d=0===c.size?'There are no available IDPs':`The IDP name ${b} is not valid, the valid names are ${Array.from(c.keys())}`;return Promise.reject(d)}b?(d=b,b=c.get(b)):(b=Array.from(c)[0],d=b[0],b=b[1]);return olympe.public.Ma.j((new Map).set('idpName',d),b)}static rz(){return olympe.public.Ma.j(new Map,olympe.auth.Ec.j.SAML)}static vz(b,c){return olympe.public.Ma.j((new Map).set('username',b).set('nonce',
1235
+ c),olympe.auth.Ec.j.Km)}static qz(){return olympe.public.Ma.j(new Map,olympe.auth.Ec.j.OAUTH2)}static Jj(){return olympe.public.Ma.get().Jj()}static j(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{rf(olympe.public.Ma.get(),d,c,()=>{e()})})}static get(){return olympe.auth.re()}static D(b,c){return b.asObservable('function'===typeof c.Cb?c.Cb():c)}};olympe.public.Ma.logout=olympe.public.Ma.Jj;olympe.public.Ma.loginOpenID=olympe.public.Ma.qz;
1236
+ olympe.public.Ma.loginToken=olympe.public.Ma.vz;olympe.public.Ma.loginSAML=olympe.public.Ma.rz;olympe.public.Ma.loginSSO=olympe.public.Ma.uz;olympe.public.Ma.loginSRP=olympe.public.Ma.sz;olympe.public.Ma.getUserFromToken=olympe.public.Ma.qh;olympe.public.Ma.sendKeepAlive=olympe.public.Ma.rf;olympe.public.Ma.getIDPNames=olympe.public.Ma.Ay;olympe.public.Ma.getUserToken=olympe.public.Ma.az;olympe.public.Ma.getIDPToken=olympe.public.Ma.By;olympe.public.Ma.refreshToken=olympe.public.Ma.yg;
1237
+ olympe.public.Ma.getToken=olympe.public.Ma.te;olympe.public.Ma.observeUser=olympe.public.Ma.Mz;olympe.public.Ma.getCurrentUser=olympe.public.Ma.oy;olympe.public.Ma.isAuthenticated=olympe.public.Ma.rl;olympe.public.Ma.getState=olympe.public.Ma.getState;olympe.public.Ma.generateSRPData=olympe.public.Ma.$x;olympe.public.Config=class{static getParameter(a){return olympe.V.getParameter(a)}static setParameter(a,b){return olympe.V.Ai(a,b)}};olympe.public.Config.setParameter=olympe.public.Config.setParameter;olympe.public.Config.getParameter=olympe.public.Config.getParameter;olympe.public.za=class{static create(a){return new class extends olympe.dc.Y.Bg{j(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.C.bc(olympe.C.da),e=b.subscribe(f=>d.update(olympe.C.Rb(f)));olympe.C.Za().Xd(()=>e.unsubscribe());return d.tb()}}}};
1238
+ olympe.public.xf=class{static create(a){return new class extends olympe.dc.wc.Bg{F(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.C.bc(olympe.C.$),e=b.subscribe(f=>d.update(olympe.C.qa(f)));olympe.C.Za().Xd(()=>e.unsubscribe());return d.tb()}}}};olympe.public.Process=class{static Oz(a,b){if('string'===typeof b)throw Error('When registering a health check, the options parameter should be an object: string is not supported anymore.');const c=olympe.host.ll(),d=c.j(a,void 0,null==b?void 0:b.type);return()=>c.D(d)}static Pz(a,b,c){const d=olympe.host.ll(),e=d.ia(a,b,c);return()=>d.F(e)}static connect(){return olympe.L.En().connect()}static disconnect(){return olympe.L.En().disconnect()}static qf(a){a='function'===typeof a.Cb?a.Cb():a;return olympe.L.En().qf().asObservable(a).pipe(rxjs.operators.map(b=>
1239
+ b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.qf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.Pz;olympe.public.Process.onHealthCheck=olympe.public.Process.Oz;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Ra.Relation,Direction:olympe.dc.ta,generateTag:olympe.U.hf,tagToString:olympe.dc.ea,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Gs,defineInverseRelation:olympe.dc.Kx,BrickContext:olympe.sc.xa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Function,GlobalProperties:olympe.sc.xa.j,registerBrick:olympe.sc.logic.na.j,FunctionBrick:olympe.sc.logic.Function,
1240
+ Context:olympe.sc.xa,Entry:olympe.dc.Ra.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.sc.File,User:olympe.dm.User,Enum:olympe.dm.gg,EnumValue:olympe.sc.Mi,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.Dd,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.cf,WorkflowTransition:olympe.sc.workflow.Transition,
1241
+ WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Ya,BurstTransaction:olympe.dc.Gi,TransactionResult:olympe.sc.mj,PredefinedDataSource:olympe.dc.Ia,QueryResult:olympe.dc.Ka,Query:olympe.dc.la,QuerySingle:olympe.dc.sd,Predicate:olympe.dc.query.za,Order:olympe.dc.query.Bk,Config:olympe.public.Config,Process:olympe.public.Process,ProbeType:olympe.host.Ke.j,Cache:{getCacheEntries:()=>olympe.dc.sources.ce().N,clearCache:a=>sl(olympe.dc.sources.ce(),a),getProcessingStatus:()=>olympe.dc.sources.ce().Kc(),
1242
+ getProcessingErrors:()=>olympe.dc.sources.ce().hd.asObservable(),hasPendingChanges:()=>olympe.dc.sources.ce().ba.asObservable(),synchroniseChanges:()=>yl(),getPendingChanges:()=>Bl(),clearPendingChanges:()=>Fl(),loadPendingChanges:a=>Dl(a)},Color:olympe.C.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.L.va.j,ServiceRequest:olympe.L.Fc,Service:olympe.L.qb,Auth:olympe.public.Ma,AuthState:{INIT:olympe.auth.Ta.j.INIT,AUTHENTICATING:olympe.auth.Ta.j.Sj,GUEST:olympe.auth.Ta.j.Pi,AUTHENTICATED:olympe.auth.Ta.j.sf,
1243
+ ERROR:olympe.auth.Ta.j.Ab},AuthProtocol:olympe.auth.Ec.j,Sync:olympe.dc.CloudObject,BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.kb{static get(){return olympe.dc.ha()}},ListDef:olympe.dc.Aa,instanceToTag:olympe.dc.ea,registerSync:olympe.dc.na.j,
1244
+ getUniqueTag:olympe.U.hf,onDestroy:a=>olympe.C.Za().onDestroy(a),offDestroy:a=>olympe.C.Za().Xf(a),FollowRules:olympe.dc.Lb,transformers:{Related:olympe.dc.aa.$e,RecursiveRelated:olympe.dc.aa.Le,Distinct:olympe.dc.aa.Ki,Filter:olympe.dc.aa.zf,Limit:olympe.dc.aa.Mh,Sort:olympe.dc.aa.ah,Union:olympe.dc.aa.Lf},ListDefPredicate:olympe.public.za,predicates:{And:olympe.dc.Y.Nd,Or:olympe.dc.Y.Ge,Not:olympe.dc.Y.ie,Equals:olympe.dc.Y.Ce,Contains:olympe.dc.Y.yf,Greater:olympe.dc.Y.mk,Smaller:olympe.dc.Y.Rk,
1245
+ HasRelated:olympe.dc.Y.Ri,InstanceOf:olympe.dc.Y.Ui,Regex:olympe.dc.Y.Hf},Comparator:olympe.public.xf,comparators:{Number:olympe.dc.wc.Number,String:olympe.dc.wc.String,DateTime:olympe.dc.wc.DateTime},valuedefs:{BooleanProperty:olympe.dc.ab.Wj,StringProperty:olympe.dc.ab.jj,NumberProperty:olympe.dc.ab.aj,DateTimeProperty:olympe.dc.ab.Ji,Constant:olympe.dc.ab.We,Tag:olympe.dc.ab.kj}});
1244
1246
 
1245
1247
 
1246
1248
  }.bind(this))();