@olympeio/runtime-node 9.11.0 → 9.11.2

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
@@ -240,11 +240,11 @@ function ca(a){a=['object'==typeof globalThis&&globalThis,a,'object'==typeof win
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
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}
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
- 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
- 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)}}
243
+ function ma(){this.D=this.j=null}ma.prototype.pf=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
+ 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.pf();a.j.enqueue(new ka(b,c,d,e));f&&pa(a)})}oa.prototype.next=function(a){return sa(this,'next',a)};
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.pf())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
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}});
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.pf()||(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}});
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+''}
@@ -252,19 +252,19 @@ function wa(a,b){a=void 0!==a?String(a):' ';return 0<b&&a?a.repeat(Math.ceil(b/a
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
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={ee:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.ee())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.ee().olympe=olympe;olympe.XE=(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.W={};olympe.W.Nf={};olympe.W.Nf.Oo=class{process(a){for(const b of Object.keys(a.De))if(a.xd(b).Mn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.Nf.Oo.za=[olympe.W.Nf.er];olympe.W.Nf.Po=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.xd(e);c(e.Aj(),f);for(const g of Ia(e))c(g.Aj(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.rb&&b(g.T(),f)}const d=new Set(Object.keys(a.De));for(const e of d)b(e,[])}};olympe.W.Nf.Po.za=[olympe.W.Nf.er];olympe.W.Nf.er=class{process(){}};const Ja=[],Ka=[];function La(a){const b=a.Za();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.Za();b.debug('Running run callbacks of container...');b.j++;Ka.forEach(c=>{const d=Oa(a,c.Aj());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.W.Uo=class{constructor(){}static j(a,b){Ja.push(new olympe.W.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.W.Sl(b,c,a))}};olympe.W.config=olympe.W.Uo.j;olympe.W.run=olympe.W.Uo.D;olympe.W.Os=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.W.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.W.Sl=class{constructor(a,b,c){this.D=a;this.Wd=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.W.rb(d):d);this.j=null!=b?b:'no name di callback';this.F=null}Aj(){return this.Wd}};function Ra(a,b){var c=olympe.W.P.Fg;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.W.Bh.j.Cm)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}
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.W={};olympe.W.Of={};olympe.W.Of.Oo=class{process(a){for(const b of Object.keys(a.De))if(a.xd(b).Mn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.Of.Oo.za=[olympe.W.Of.er];olympe.W.Of.Po=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.xd(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.W.rb&&b(g.T(),f)}const d=new Set(Object.keys(a.De));for(const e of d)b(e,[])}};olympe.W.Of.Po.za=[olympe.W.Of.er];olympe.W.Of.er=class{process(){}};const Ja=[],Ka=[];function La(a){const b=a.Ya();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.Ya();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.W.Uo=class{constructor(){}static j(a,b){Ja.push(new olympe.W.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.W.Sl(b,c,a))}};olympe.W.config=olympe.W.Uo.j;olympe.W.run=olympe.W.Uo.D;olympe.W.Os=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.W.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.W.Sl=class{constructor(a,b,c){this.D=a;this.Wd=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.W.rb(d):d);this.j=null!=b?b:'no name di callback';this.F=null}zj(){return this.Wd}};function Ra(a,b){var c=olympe.W.P.Fg;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.W.Bh.j.Cm)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.W.Uj?f.getValue(a):f,Ma(a.G);return d}
258
- olympe.W.Bh=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.W.tq(e);this.D=new Map;Ra(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Sa(this,f).subscribe(this.Qj.bind(this,f)))}Za(){return this.G}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}Qj(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.G.debug(`Updating parameter ${a} to ${b} and notify ${null!=
258
+ olympe.W.Bh=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.W.tq(e);this.D=new Map;Ra(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Sa(this,f).subscribe(this.Qj.bind(this,f)))}Ya(){return this.G}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}Qj(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
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.W.Bh.j={iu:'exception',Cm:'null'};function Ua(a,b){b=olympe.W.Os(b);for(const [c,d]of b)Va(a,c,d)}function C(a,b,c,...d){B(a.G,'Defining service '+b);a.j(b,c,d,!1,!1)}function Wa(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 Xa(a,b,c,d=!1){B(a.G,'Defining service alias '+b);a.j(b,e=>e,[c],!0,d)}function Ya(a,b){B(a.G,'Defining abstract service '+b);a.j(b).D=!0}function Va(a,b,c){a.parameters[b.toLowerCase()]=c}
260
260
  function Za(a,b,c,d){a.F.push(b);Va(a,b,d(...c.map(e=>a.getParameter(e))));D(a,b,c.map(e=>new olympe.W.Eh(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.W.Zt=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.W.Nf.Oo,new olympe.W.Nf.Po];this.H=[];a=this.getParameter(olympe.W.U.pv);this.N=void 0!==a?a:3;this.G=new olympe.W.tq(this.N)}Za(){return this.G}j(a,b,c,d,e){const f=a instanceof olympe.W.rb?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!`);
261
+ olympe.W.Zt=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.W.Of.Oo,new olympe.W.Of.Po];this.H=[];a=this.getParameter(olympe.W.U.pv);this.N=void 0!==a?a:3;this.G=new olympe.W.tq(this.N)}Ya(){return this.G}j(a,b,c,d,e){const f=a instanceof olympe.W.rb?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
262
  var g=this.De[f];g.id=g.id+'!!'+ ++olympe.W.cm.j;g.F=!0;g=g.id;c[h]=g;this.De[g]=this.De[f]}}this.De[f]=new olympe.W.cm(b,c,d||!1,f);return this.De[f]}xd(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=>{B(this.G,'Calling callback');this.G.j++;b(this);Ma(this.G)});
263
263
  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.W.Bh(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.W.cm=class{constructor(a,b,c,d){this.H=a||null;this.N=!!c;this.Wd=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.rb(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.Za();b.debug('Resolving arguments for '+this.id);const c=this.H;let d=Oa(a,this.Wd);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.lh().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.Aj()),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}Aj(){return this.Wd}Mn(){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.W.Sl(c,e,b);b.F=d;g.call(f,a,b)}};olympe.W.cm.j=0;olympe.W.Eh=class extends olympe.W.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&&$a(a,'log','DI: '+b)}function $a(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.j;e++)d+=' ';console[b](d+c)}}olympe.W.tq=class{constructor(a){this.D=a;this.j=0}debug(a){2>=this.D&&$a(this,'log','DI: '+a)}info(a){3>=this.D&&$a(this,'info','DI: '+a)}warn(a){4>=this.D&&$a(this,'warn','DI: '+a)}error(a){5>=this.D&&$a(this,'error','DI: '+a)}};olympe.W.pa=class extends olympe.W.Uj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.W.rb=class extends olympe.W.Uj{constructor(a,b){super();this.id=a;this.j=b||olympe.W.Bh.j.iu}T(){return this.id}getValue(a){return Sa(a,this.id,this.j)}};olympe.W.P={Fg:'di.Container',FC:'di.PublicContainer'};olympe.W.U={pv:'logging.di'};olympe.W.run([olympe.W.P.Fg],a=>{olympe.W.getParameter=b=>a.getParameter(b);olympe.W.Qj=(b,c)=>a.Qj(b,c);olympe.ee().getConfig=b=>a.getParameter(b);olympe.ee().getConfigNames=()=>Object.keys(a.parameters);olympe.ee().updateConfig=(b,c)=>a.Qj(b,c)});olympe.V={};olympe.V.hq=class{constructor(a){this.id=a||olympe.V.hq.j++}Fa(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.V.hq.j=0;olympe.V.iC=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.V.Oh=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.V.Oh.D=function(a){return new olympe.V.Oh(.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.V.Oh.j=function(){return new olympe.V.Oh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.V.Oh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.V.Oh.prototype.get=function(a,b){return this.values[5*a+b]};function ab(a){return(new TextEncoder).encode(a)}function bb(a,b){return a.j(ab(b))}function cb(a){return(new TextDecoder('utf8')).decode(a)}function eb(a){const b=new olympe.V.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.V.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 ab(a);if(a instanceof Blob)return new Uint8Array(yield a.arrayBuffer());if(a instanceof olympe.V.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(){}};
264
+ olympe.W.cm=class{constructor(a,b,c,d){this.H=a||null;this.N=!!c;this.Wd=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.rb(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.Ya();b.debug('Resolving arguments for '+this.id);const c=this.H;let d=Oa(a,this.Wd);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.lh().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.Wd}Mn(){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.W.Sl(c,e,b);b.F=d;g.call(f,a,b)}};olympe.W.cm.j=0;olympe.W.Eh=class extends olympe.W.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&&$a(a,'log','DI: '+b)}function $a(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.j;e++)d+=' ';console[b](d+c)}}olympe.W.tq=class{constructor(a){this.D=a;this.j=0}debug(a){2>=this.D&&$a(this,'log','DI: '+a)}info(a){3>=this.D&&$a(this,'info','DI: '+a)}warn(a){4>=this.D&&$a(this,'warn','DI: '+a)}error(a){5>=this.D&&$a(this,'error','DI: '+a)}};olympe.W.pa=class extends olympe.W.Uj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.W.rb=class extends olympe.W.Uj{constructor(a,b){super();this.id=a;this.j=b||olympe.W.Bh.j.iu}T(){return this.id}getValue(a){return Sa(a,this.id,this.j)}};olympe.W.P={Fg:'di.Container',FC:'di.PublicContainer'};olympe.W.U={pv:'logging.di'};olympe.W.run([olympe.W.P.Fg],a=>{olympe.W.getParameter=b=>a.getParameter(b);olympe.W.Qj=(b,c)=>a.Qj(b,c);olympe.ee().getConfig=b=>a.getParameter(b);olympe.ee().getConfigNames=()=>Object.keys(a.parameters);olympe.ee().updateConfig=(b,c)=>a.Qj(b,c)});olympe.V={};olympe.V.hq=class{constructor(a){this.id=a||olympe.V.hq.j++}Fa(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.V.hq.j=0;olympe.V.iC=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.V.Oh=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.V.Oh.D=function(a){return new olympe.V.Oh(.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.V.Oh.j=function(){return new olympe.V.Oh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.V.Oh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.V.Oh.prototype.get=function(a,b){return this.values[5*a+b]};function ab(a){return(new TextEncoder).encode(a)}function bb(a,b){return a.j(ab(b))}function cb(a){return(new TextDecoder('utf8')).decode(a)}function eb(a){const b=new olympe.V.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.V.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 ab(a);if(a instanceof Blob)return new Uint8Array(yield a.arrayBuffer());if(a instanceof olympe.V.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
268
  olympe.V.ws=a=>a.replace('+','-').replace('/','_');olympe.V.ox=a=>a.replace('-','+').replace('_','/');function fb(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)fb(a);else{let d;null==(d=a.F)||d.call(a)}},a.H)}function gb(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function hb(a,b){a.D=b;return a}
269
269
  olympe.V.bn=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&&fb(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 ib(a,b){a.D=b;return a}function jb(a,b){a.j.F=b}
270
270
  olympe.V.$h=class{constructor(a){this.j=hb(new olympe.V.bn(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.Y.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}`);
@@ -273,9 +273,9 @@ function mb(a,b){let c=null;return(new Promise((d,e)=>{if(a.F.getValue()===b)d()
273
273
  function nb(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.Y.set(b,d?new Set(d):null)}function ob(a,b,c){nb(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 kb(a){return u(function*(){if(0!==a.D.length){var {state:b,Wd: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());kb(a).then()}catch(e){a.G.debug(`Error while processing transition ${d} -> ${b}: ${e}`),F(a,a.j,e)}}})}
275
275
  olympe.V.Aw=class{constructor(a){this.G=a;this.N=!1;this.F=new rxjs.BehaviorSubject(null);this.R=new Map;this.Y=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 pb(a,b){a.R.push(b)}function qb(a,b){a.Y.push(b)}function rb(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=>rb(a,d)):c='N/A';return c}function sb(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]=rb(a,g);a.F.push(b)}
276
- olympe.V.Yv=class{constructor(){this.F=[];this.R=[];this.Y=[];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.Y.forEach(a=>a()),this.j=!1)}};function tb(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.V.operators={xF(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.V.Promise={};olympe.V.Promise.vj=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.V.Promise.Bg=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)})})};
276
+ olympe.V.Yv=class{constructor(){this.F=[];this.R=[];this.Y=[];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.Y.forEach(a=>a()),this.j=!1)}};function tb(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.V.operators={xF(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.V.Promise={};olympe.V.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.V.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
277
  olympe.V.Promise.nt=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.V.promise={};function ub(a){if(0===a.size())a.D.next(!1);else if(a.F()){a.j++;var b=vb(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);ub(a)})}}function wb(a,b){return new Promise((c,d)=>{a.Ga.push(new olympe.V.promise.zw(c,d,b));ub(a)})}function vb(a){a.D.next(!0);let b;return null!=(b=a.Ga.shift())?b:null}
278
- olympe.V.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'));ub(this)}size(){return this.Ga.length}};olympe.V.promise.zw=class{constructor(a,b,c){this.resolve=a;this.j=b;this.D=c}};olympe.V.promise.Ur=class extends olympe.V.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.Ij=a}F(){return this.j<this.Ij}};olympe.V.promise.$D=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([`
278
+ olympe.V.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'));ub(this)}size(){return this.Ga.length}};olympe.V.promise.zw=class{constructor(a,b,c){this.resolve=a;this.j=b;this.D=c}};olympe.V.promise.Ur=class extends olympe.V.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.V.promise.$D=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,9 +286,9 @@ olympe.V.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.V.stream={};olympe.V.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.V.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.V.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.V.stream.lg.za=[olympe.V.stream.ReadableStream,olympe.V.stream.WritableStream];olympe.V.stream.ReadableStream=class{[Symbol.asyncIterator](){return new oa(function*(){}())}pipeTo(){}map(){}concat(){}};function xb(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.V.stream.Ww=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.V.stream={};olympe.V.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.V.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.V.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.V.stream.mg.za=[olympe.V.stream.ReadableStream,olympe.V.stream.WritableStream];olympe.V.stream.ReadableStream=class{[Symbol.asyncIterator](){return new oa(function*(){}())}pipeTo(){}map(){}concat(){}};function xb(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.V.stream.Ww=class{constructor(){this.j=URL.createObjectURL(new Blob([`self.onmessage = ({ data: stream }) => {
292
292
  const transformedStream = (${olympe.V.stream.Ak.toString()}).transform(stream);
293
293
  self.postMessage(transformedStream, [transformedStream]);
294
294
  };`],{type:'application/javascript'}))}destroy(){URL.revokeObjectURL(this.j)}};olympe.V.stream.WritableStream=class{write(){return u(function*(){})}throw(){}complete(){}};olympe.V.stream.Js=(...a)=>new ReadableStream({start(){this.cursor=0},pull(b){this.cursor<a.length?b.enqueue(a[this.cursor++]):b.close()}});olympe.V.stream.tap=a=>new TransformStream({transform(b,c){a(b);c.enqueue(b)}});
@@ -300,7 +300,7 @@ 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,
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]=yb(c,a[0]);a[1]=yb(d,a[1]);a[2]=yb(e,a[2]);a[3]=yb(f,a[3])}function I(a,b,c,d,e,f){b=yb(yb(b,a),yb(d,f));return yb(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 Ab(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);zb(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(zb(a,g),f=0;16>f;f++)g[f]=0;g[14]=8*e;
303
- zb(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'!==Ab('hello')&&(yb=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.V.ub=Ab;function Bb(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function Cb(){var a=Math.random();return Bb((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}const Db=Math.pow(2,32)-1;olympe.V.Kc=function(){return Cb()};olympe.V.Of=function(){return Cb()};olympe.V.iF=function(a,b=1){const c=a.substr(12,a.length-12);return Bb(parseInt(a.substr(0,12),16)+b)+c};
303
+ zb(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'!==Ab('hello')&&(yb=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.V.ub=Ab;function Bb(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function Cb(){var a=Math.random();return Bb((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}const Db=Math.pow(2,32)-1;olympe.V.Kc=function(){return Cb()};olympe.V.jf=function(){return Cb()};olympe.V.iF=function(a,b=1){const c=a.substr(12,a.length-12);return Bb(parseInt(a.substr(0,12),16)+b)+c};
304
304
  olympe.V.hF=function(a){return Bb(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Eb=0,Fb=0;olympe.V.Ux=function(){var a=(new Date).getTime();a<=Eb?4294967295===Fb?(Fb=Math.floor(Math.random()/4*Db),Eb+=1):Fb=Math.floor(Fb+(4294967295-Fb)/2):(Fb=Math.floor(Math.random()/4*Db),Eb=a);a='00000000'+Fb.toString(16);return Bb(Eb)+a.substr(a.length-8,8)};olympe.V.yF=function(){for(let a=0;1E4>a;a++)console.log(olympe.V.Ux())};
305
305
  olympe.V.oi=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.V.cF=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.V.ZE=function(a,b){return(b?b:'UI')+'-'+a};
306
306
  olympe.V.Oz=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):
@@ -308,64 +308,64 @@ r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,GE:g||null,yt:l||null,ho
308
308
  olympe.V.vF=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.V.gF=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};
309
309
  olympe.V.et=a=>{var b=Gb,c=Hb;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[l.slice(g.length)]=olympe.V.xs(n);return h},{})}}).reduce((d,e,f)=>{olympe.V.gt(d,e,'version.json'===a[f]?'version.':'');
310
310
  return d},Object.create(null))})};olympe.V.xs=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.V.gt=(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.V.gt(a[e],f,''):a[e]=f}};olympe.V.FE=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Fn(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.V.tv=class{constructor(a,b){this.start=a;this.end=b}};olympe.V.tv.j={XB:'left',PC:'right',BA:'bottom',YD:'top'};function Ib(a){return`${a.j}.${a.D}.${a.F}`}
311
- olympe.V.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.V.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.V.Lf.j:new olympe.V.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}Oj(a){return this.j!==a.j?this.j<a.j:this.D!==a.D?this.D<a.D:this.F<
312
- a.F}Fa(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.V.Lf.j=new olympe.V.Lf(Number.NaN,Number.NaN,Number.NaN);olympe.V.P={Eg:'utils.binaryConverter',Jt:'utils.base64Converter',ig:'utils.Profiler'};olympe.W.config(a=>{Ya(a,olympe.V.P.Eg);Xa(a,olympe.V.P.Jt,olympe.V.P.Eg,!0);C(a,olympe.V.P.ig,olympe.V.Yv)},'Utils services');olympe.W.run([olympe.V.P.Eg,olympe.V.P.ig],(a,b)=>{olympe.V.jf=()=>a;olympe.ee().isProfilerEnabled=()=>b.j;olympe.ee().startProfiler=()=>b.start();olympe.ee().stopProfiler=()=>b.stop();olympe.ee().getProfilerEvents=()=>({events:b.F,names:Object.fromEntries(b.N.entries()),models:Object.fromEntries(b.H.entries())})});olympe.ia={};olympe.ia.yb=class{la(){}H(){}F(){}j(){}ja(){}N(){}ta(){}$(){}ea(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ia.yb.prototype.fatal=olympe.ia.yb.prototype.fatal;olympe.ia.yb.prototype.error=olympe.ia.yb.prototype.error;olympe.ia.yb.prototype.warn=olympe.ia.yb.prototype.warn;olympe.ia.yb.prototype.info=olympe.ia.yb.prototype.info;olympe.ia.yb.prototype.log=olympe.ia.yb.prototype.log;olympe.ia.yb.prototype.debug=olympe.ia.yb.prototype.debug;olympe.ia.yb.prototype.trace=olympe.ia.yb.prototype.trace;
313
- olympe.ia.yb.j={Gw:0,ag:1,ov:2,pk:3,ms:4,zb:5,lu:6,lC:7};olympe.ia.yb.D={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ia.Ua=class{cd(){}};olympe.ia.we={};function Jb(a,b,c){a.Ja[b](`[OLYMPE.${a.Y}]:`,...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.Y,b,...c)}}
314
- olympe.ia.we.yb=class{constructor(a,b){this.name=a;const c=b instanceof rxjs.Observable;this.D=c?olympe.ia.yb.j.pk:b;c&&b.subscribe(d=>{this.D=d});this.Y=a.toUpperCase();this.R=new Map;this.Ja=console}la(){return this.name}H(){return this.D}F(){return this.D<=olympe.ia.yb.j.Gw}j(){return this.D<=olympe.ia.yb.j.ag}N(){return this.D<=olympe.ia.yb.j.ov}ja(){return this.D<=olympe.ia.yb.j.pk}ta(){return this.D<=olympe.ia.yb.j.ms}$(){return this.D<=olympe.ia.yb.j.zb}ea(){return this.D<=olympe.ia.yb.j.lu}trace(...a){this.F()&&
311
+ olympe.V.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.V.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.V.Mf.j:new olympe.V.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}Oj(a){return this.j!==a.j?this.j<a.j:this.D!==a.D?this.D<a.D:this.F<
312
+ a.F}Fa(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.V.Mf.j=new olympe.V.Mf(Number.NaN,Number.NaN,Number.NaN);olympe.V.P={Eg:'utils.binaryConverter',Jt:'utils.base64Converter',jg:'utils.Profiler'};olympe.W.config(a=>{Ya(a,olympe.V.P.Eg);Xa(a,olympe.V.P.Jt,olympe.V.P.Eg,!0);C(a,olympe.V.P.jg,olympe.V.Yv)},'Utils services');olympe.W.run([olympe.V.P.Eg,olympe.V.P.jg],(a,b)=>{olympe.V.kf=()=>a;olympe.ee().isProfilerEnabled=()=>b.j;olympe.ee().startProfiler=()=>b.start();olympe.ee().stopProfiler=()=>b.stop();olympe.ee().getProfilerEvents=()=>({events:b.F,names:Object.fromEntries(b.N.entries()),models:Object.fromEntries(b.H.entries())})});olympe.ia={};olympe.ia.yb=class{la(){}H(){}F(){}j(){}ja(){}N(){}ta(){}$(){}ea(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ia.yb.prototype.fatal=olympe.ia.yb.prototype.fatal;olympe.ia.yb.prototype.error=olympe.ia.yb.prototype.error;olympe.ia.yb.prototype.warn=olympe.ia.yb.prototype.warn;olympe.ia.yb.prototype.info=olympe.ia.yb.prototype.info;olympe.ia.yb.prototype.log=olympe.ia.yb.prototype.log;olympe.ia.yb.prototype.debug=olympe.ia.yb.prototype.debug;olympe.ia.yb.prototype.trace=olympe.ia.yb.prototype.trace;
313
+ olympe.ia.yb.j={Gw:0,bg:1,ov:2,pk:3,ms:4,zb:5,lu:6,lC:7};olympe.ia.yb.D={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ia.Ua=class{cd(){}};olympe.ia.we={};function Jb(a,b,c){a.Ha[b](`[OLYMPE.${a.Y}]:`,...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.Y,b,...c)}}
314
+ olympe.ia.we.yb=class{constructor(a,b){this.name=a;const c=b instanceof rxjs.Observable;this.D=c?olympe.ia.yb.j.pk:b;c&&b.subscribe(d=>{this.D=d});this.Y=a.toUpperCase();this.R=new Map;this.Ha=console}la(){return this.name}H(){return this.D}F(){return this.D<=olympe.ia.yb.j.Gw}j(){return this.D<=olympe.ia.yb.j.bg}N(){return this.D<=olympe.ia.yb.j.ov}ja(){return this.D<=olympe.ia.yb.j.pk}ta(){return this.D<=olympe.ia.yb.j.ms}$(){return this.D<=olympe.ia.yb.j.zb}ea(){return this.D<=olympe.ia.yb.j.lu}trace(...a){this.F()&&
315
315
  Jb(this,'trace',a)}debug(...a){this.j()&&Jb(this,'debug',a)}log(...a){this.N()&&Jb(this,'log',a)}info(...a){this.ja()&&Jb(this,'info',a)}warn(...a){this.ta()&&Jb(this,'warn',a)}error(...a){this.$()&&Jb(this,'error',a)}fatal(...a){this.ea()&&Jb(this,'error',a)}};olympe.ia.we.yb.za=[olympe.ia.yb];olympe.ia.we.Ua=class{constructor(a,b,c){this.j=a;this.D=parseInt(b,10);this.F=c;this.channels=new Map;this.G=this.cd('logging');this.G.log('Logging initialized, global log level is '+olympe.ia.yb.D[b])}cd(a){var b=this.channels.get(a);if(!b){b=`${olympe.ia.U.St}.${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.ia.U.rw}`;Object.prototype.hasOwnProperty.call(this.j.parameters,b.toLowerCase())&&(c=!0===this.j.getParameter(b));
316
- b=new olympe.ia.we.yb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ia.we.Ua.za=[olympe.ia.Ua];olympe.ia.P={Ea:'logging.Manager'};olympe.ia.U={Gp:'logging',Hp:'logging.showLogLevel',St:'logging',rw:'showLogLevel'};olympe.W.config(function(a){E(a,olympe.ia.U.Gp,olympe.ia.yb.j.pk);E(a,olympe.ia.U.Hp,!0);Wa(a,olympe.ia.P.Ea,olympe.ia.we.Ua,olympe.W.P.Fg,new olympe.W.pa(olympe.ia.U.Gp),new olympe.W.pa(olympe.ia.U.Hp))},'olympe.logging');olympe.W.run([olympe.ia.P.Ea],a=>{olympe.ia.Za=b=>a.cd(b)},'Logging singleton getter initialization');olympe.C={};olympe.C.U={zq:'df.nodeCreationThreshold'};const Kb=[];function Lb(){}function Mb(){}olympe.C.J=class a{constructor(b,c,d){this.j=void 0===b?Lb:b;this.D=void 0===c?Kb:c;this.Y=d}static H(){var b=[];return void 0===b||0===b.length?olympe.C.J.$:new a(Mb,b)}H(){return this.j?this.j():void 0}F(){return this.D?this.D:Kb}N(){return null===this.j&&null===this.D}R(){return this.j===Mb}};olympe.C.J.Y=new olympe.C.J;olympe.C.J.j=new olympe.C.J(null,null);olympe.C.J.$=new olympe.C.J(Mb);olympe.C.J.F=new olympe.C.J(()=>olympe.C.aa);
317
- olympe.C.J.D=new olympe.C.J(()=>olympe.C.Ta);olympe.C.J.N=new olympe.C.J(()=>olympe.C.da);olympe.C.J.R=new olympe.C.J(()=>olympe.C.Zb);olympe.C.Gh=class{T(){return''}Dn(){return''}destroy(){}gb(){return!1}jd(){return!1}run(a,...b){return a(...b)}tc(a){return a}getParent(){return null}tt(){}oe(){}detach(){}el(){}rg(){}onDestroy(){return''}Xf(){}Yd(){return''}it(){}};olympe.C.Gh.prototype.offDestroy=olympe.C.Gh.prototype.Xf;olympe.C.Gh.prototype.onDestroy=olympe.C.Gh.prototype.onDestroy;let Nb=0;olympe.W.run([new olympe.W.pa(olympe.C.U.zq)],()=>{});
318
- olympe.C.Wb=class{constructor(a='SimpleContext',b){++Nb;this.ea=new Map;this.$=new Map;this.Y=new Map;this.Ja=0;this.name=a;this.id=String(Nb);this.F=this.ja=!1;(this.N=void 0===b?olympe.C.Ya():b)&&this.N.oe(this);this.debug=!1}T(){return this.id}Dn(){return this.name}run(a,...b){if(!this.ja){var c=olympe.C.st(this);a=a(...b);c&&olympe.C.st(c);return a}}tc(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.ja&&!this.F){this.F=!0;this.rg();for(const a of this.$.keys())this.$.has(a)&&this.$.get(a)();
319
- this.$.clear();this.Y.clear();this.N&&(this.N.detach(this,!1),this.N=null);this.ja=!0;this.F=!1;this.rg()}}gb(){return this.ja}jd(){return this.F}oe(a){if(!this.ja){var b;olympe.C.hb(a)?b=a.Ca:olympe.C.Pn(a)&&(b=a);b&&this.ea.set(b.T(),b)}}detach(a,b=!0){let c;olympe.C.hb(a)?c=a.Ca:olympe.C.Pn(a)&&(c=a);c&&this.ea.has(c.T())&&(b&&c.el(this),this.ea.delete(c.T()))}el(){this.N=null;this.destroy()}rg(){const a=this.ea;for(const b of a.keys())a.has(b)&&a.get(b).el(this);this.ea.clear();for(const b of this.Y.keys())this.Y.has(b)&&
320
- this.Y.get(b)();this.Y.clear()}onDestroy(a,b){void 0===b&&(++this.Ja,b=String(this.Ja));this.$.set(b,a);return b}Xf(a){this.$.delete(a)}Yd(a){if(void 0===b){++this.Ja;var b=String(this.Ja)}this.Y.set(b,a);return b}it(a){this.Y.delete(a)}tt(a){this.N&&this.N.detach(this,!1);(this.N=a||null)&&this.N.oe(this)}getParent(){return this.N}};olympe.C.Dr=class extends olympe.C.Wb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Xf(){}};olympe.C.Gh.za=[olympe.C.Gh];let Ob=0;
321
- function Pb(a,b){a.R||(a.R=new Map);a.R.set(b.T(),b);switch(b.Jc()){case olympe.C.Node.j.Ph:break;case olympe.C.Node.j.bi: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.Hh:Qb(a,olympe.C.Node.j.Hh);break;case olympe.C.Node.j.OBSOLETE:a.mb=!0;a.j!==olympe.C.Node.j.Hh&&Qb(a,olympe.C.Node.j.OBSOLETE);break;case olympe.C.Node.j.$d:olympe.C.G.warn('Adding a destroyed node as upstream => should never happen!');break;
316
+ b=new olympe.ia.we.yb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ia.we.Ua.za=[olympe.ia.Ua];olympe.ia.P={Ea:'logging.Manager'};olympe.ia.U={Gp:'logging',Hp:'logging.showLogLevel',St:'logging',rw:'showLogLevel'};olympe.W.config(function(a){E(a,olympe.ia.U.Gp,olympe.ia.yb.j.pk);E(a,olympe.ia.U.Hp,!0);Wa(a,olympe.ia.P.Ea,olympe.ia.we.Ua,olympe.W.P.Fg,new olympe.W.pa(olympe.ia.U.Gp),new olympe.W.pa(olympe.ia.U.Hp))},'olympe.logging');olympe.W.run([olympe.ia.P.Ea],a=>{olympe.ia.Ya=b=>a.cd(b)},'Logging singleton getter initialization');olympe.C={};olympe.C.U={zq:'df.nodeCreationThreshold'};const Kb=[];function Lb(){}function Mb(){}olympe.C.J=class a{constructor(b,c,d){this.j=void 0===b?Lb:b;this.D=void 0===c?Kb:c;this.Y=d}static H(){var b=[];return void 0===b||0===b.length?olympe.C.J.$:new a(Mb,b)}H(){return this.j?this.j():void 0}F(){return this.D?this.D:Kb}N(){return null===this.j&&null===this.D}R(){return this.j===Mb}};olympe.C.J.Y=new olympe.C.J;olympe.C.J.j=new olympe.C.J(null,null);olympe.C.J.$=new olympe.C.J(Mb);olympe.C.J.F=new olympe.C.J(()=>olympe.C.aa);
317
+ olympe.C.J.D=new olympe.C.J(()=>olympe.C.Ta);olympe.C.J.N=new olympe.C.J(()=>olympe.C.da);olympe.C.J.R=new olympe.C.J(()=>olympe.C.Zb);olympe.C.Gh=class{T(){return''}Dn(){return''}destroy(){}gb(){return!1}jd(){return!1}run(a,...b){return a(...b)}tc(a){return a}getParent(){return null}tt(){}oe(){}detach(){}el(){}sg(){}onDestroy(){return''}Xf(){}Yd(){return''}it(){}};olympe.C.Gh.prototype.offDestroy=olympe.C.Gh.prototype.Xf;olympe.C.Gh.prototype.onDestroy=olympe.C.Gh.prototype.onDestroy;let Nb=0;olympe.W.run([new olympe.W.pa(olympe.C.U.zq)],()=>{});
318
+ olympe.C.Wb=class{constructor(a='SimpleContext',b){++Nb;this.ea=new Map;this.$=new Map;this.Y=new Map;this.Ha=0;this.name=a;this.id=String(Nb);this.F=this.ja=!1;(this.N=void 0===b?olympe.C.$a():b)&&this.N.oe(this);this.debug=!1}T(){return this.id}Dn(){return this.name}run(a,...b){if(!this.ja){var c=olympe.C.st(this);a=a(...b);c&&olympe.C.st(c);return a}}tc(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.ja&&!this.F){this.F=!0;this.sg();for(const a of this.$.keys())this.$.has(a)&&this.$.get(a)();
319
+ this.$.clear();this.Y.clear();this.N&&(this.N.detach(this,!1),this.N=null);this.ja=!0;this.F=!1;this.sg()}}gb(){return this.ja}jd(){return this.F}oe(a){if(!this.ja){var b;olympe.C.hb(a)?b=a.Ca:olympe.C.Pn(a)&&(b=a);b&&this.ea.set(b.T(),b)}}detach(a,b=!0){let c;olympe.C.hb(a)?c=a.Ca:olympe.C.Pn(a)&&(c=a);c&&this.ea.has(c.T())&&(b&&c.el(this),this.ea.delete(c.T()))}el(){this.N=null;this.destroy()}sg(){const a=this.ea;for(const b of a.keys())a.has(b)&&a.get(b).el(this);this.ea.clear();for(const b of this.Y.keys())this.Y.has(b)&&
320
+ this.Y.get(b)();this.Y.clear()}onDestroy(a,b){void 0===b&&(++this.Ha,b=String(this.Ha));this.$.set(b,a);return b}Xf(a){this.$.delete(a)}Yd(a){if(void 0===b){++this.Ha;var b=String(this.Ha)}this.Y.set(b,a);return b}it(a){this.Y.delete(a)}tt(a){this.N&&this.N.detach(this,!1);(this.N=a||null)&&this.N.oe(this)}getParent(){return this.N}};olympe.C.Dr=class extends olympe.C.Wb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Xf(){}};olympe.C.Gh.za=[olympe.C.Gh];let Ob=0;
321
+ function Pb(a,b){a.R||(a.R=new Map);a.R.set(b.T(),b);switch(b.Jc()){case olympe.C.Node.j.Ph:break;case olympe.C.Node.j.bi: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.Hh:Qb(a,olympe.C.Node.j.Hh);break;case olympe.C.Node.j.OBSOLETE:a.mb=!0;a.j!==olympe.C.Node.j.Hh&&Qb(a,olympe.C.Node.j.OBSOLETE);break;case olympe.C.Node.j.$d:olympe.C.G.warn('Adding a destroyed node as upstream => should never happen!');break;
322
322
  default:olympe.C.G.warn('Unknown state, investigate: ',b.Jc())}Rb(b,a)}
323
- function Sb(a){if(a.Lc){var b=[],c=[];if(a.Yf)if(a.Yf instanceof olympe.C.Node)if(Tb(a.Yf))b=a.Yf.Fb;else return;else b=a.Yf;else b=null;if(null!==a.Wd){const e=a.qg;for(let f=0,g=a.Wd.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.Wd[f];if(Tb(h))c.push(h.Fb);else return}else c.push(a.Wd[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.rs?
324
- Ub(a,e.Ca):e instanceof olympe.C.Node?Ub(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&Qb(a,olympe.C.Node.j.bi))}else Vb(a)})}}function M(a){void 0===a.bb&&(a.bb=a.valueType===olympe.C.Proxy?Wb(void 0,a.Eb):Wb(a.valueType,a.Eb),a.bb.Ca=a);return a.bb}function Xb(a){void 0!==a.D&&(Yb(a.D,a),a.D=void 0)}function Zb(a){if(a.j===olympe.C.Node.j.OBSOLETE&&(a.j=olympe.C.Node.j.bi,null!==a.H))for(const b of a.H.values())$b(b)}function Qb(a,b){b!==a.j&&(a.j=b)}
325
- function ac(a){if(a.j!==olympe.C.Node.j.OBSOLETE&&a.j!==olympe.C.Node.j.vk&&a.j!==olympe.C.Node.j.Ph&&a.j!==olympe.C.Node.j.Hh){Qb(a,olympe.C.Node.j.vk);var b=a.H;if(b)for(const c of b.values())b.has(c.T())&&ac(c);Qb(a,olympe.C.Node.j.OBSOLETE)}}function bc(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.mb=!0;Sb(a)}}
323
+ function Sb(a){if(a.Lc){var b=[],c=[];if(a.Yf)if(a.Yf instanceof olympe.C.Node)if(Tb(a.Yf))b=a.Yf.Fb;else return;else b=a.Yf;else b=null;if(null!==a.Wd){const e=a.rg;for(let f=0,g=a.Wd.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.Wd[f];if(Tb(h))c.push(h.Fb);else return}else c.push(a.Wd[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.sg();if(void 0!==d){const e=d.apply(b,c);e&&e.rs?
324
+ Ub(a,e.Ca):e instanceof olympe.C.Node?Ub(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&Qb(a,olympe.C.Node.j.bi))}else Vb(a)})}}function M(a){void 0===a.Wa&&(a.Wa=a.valueType===olympe.C.Proxy?Wb(void 0,a.Eb):Wb(a.valueType,a.Eb),a.Wa.Ca=a);return a.Wa}function Xb(a){void 0!==a.D&&(Yb(a.D,a),a.D=void 0)}function Zb(a){if(a.j===olympe.C.Node.j.OBSOLETE&&(a.j=olympe.C.Node.j.bi,null!==a.H))for(const b of a.H.values())$b(b)}function Qb(a,b){b!==a.j&&(a.j=b)}
325
+ function ac(a){if(a.j!==olympe.C.Node.j.OBSOLETE&&a.j!==olympe.C.Node.j.vk&&a.j!==olympe.C.Node.j.Ph&&a.j!==olympe.C.Node.j.Hh){Qb(a,olympe.C.Node.j.vk);var b=a.H;if(b)for(const c of b.values())b.has(c.T())&&ac(c);Qb(a,olympe.C.Node.j.OBSOLETE)}}function bc(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.mb=!0;Sb(a)}}
326
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.Fb);a.ta||c||void 0===a.D||Xb(a);if(void 0!==b){if((a.ta||a.j===olympe.C.Node.j.bi||a.j===olympe.C.Node.j.OBSOLETE)&&!olympe.C.hb(b)&&void 0!==a.Fb){if(null===b&&null===a.Fb){Zb(a);return}if(null!==b&&null!==a.Fb&&(b.valueOf()===a.Fb.valueOf()||a.Fb.Fa&&a.Fb.Fa(b))){Zb(a);return}}if(!0===a.ta)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.$d&&olympe.C.G.warn(`trying to set a value on a destroyed node (#${a.T()} ${a.ad?', '+a.ad:''})`);a.j===olympe.C.Node.j.cg&&olympe.C.G.warn(`trying to set a value on a node being destroyed (#${a.T()} ${a.ad?', '+a.ad:''})`);a.ta=!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
327
+ a.T()+') value to get updated !');else{a.j===olympe.C.Node.j.$d&&olympe.C.G.warn(`trying to set a value on a destroyed node (#${a.T()} ${a.ad?', '+a.ad:''})`);a.j===olympe.C.Node.j.dg&&olympe.C.G.warn(`trying to set a value on a node being destroyed (#${a.T()} ${a.ad?', '+a.ad:''})`);a.ta=!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
328
  Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.C.Ta?(c=olympe.C.xb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.C.aa?(c=olympe.C.ra(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.C.da&&(c=olympe.C.Sb(c),d=!1)));a.Fb=c;Qb(a,olympe.C.Node.j.bi);if(b=a.H){d=0;for(const f of b.values())0<d&&ac(f),d++;for(const f of b.values())bc(f,a,c)}a.ta=!1}}}
329
- function cc(a,b){if(a.j!==olympe.C.Node.j.cg&&a.j!==olympe.C.Node.j.$d&&(a.j!==olympe.C.Node.j.Ph||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.Fb=void 0,Qb(a,olympe.C.Node.j.Ph),b=a.H)for(const d of b.values())cc(d,a)}}function Vb(a){if(a.j!==olympe.C.Node.j.Hh){Qb(a,olympe.C.Node.j.Hh);var b=a.H;if(b)for(const c of b.values())Vb(c);a.rg();void 0!==a.D&&Xb(a);a.Fb=a.defaultValue}}function Tb(a){return a.j===olympe.C.Node.j.bi}
329
+ function cc(a,b){if(a.j!==olympe.C.Node.j.dg&&a.j!==olympe.C.Node.j.$d&&(a.j!==olympe.C.Node.j.Ph||a.Lc)){var c=void 0!==a.defaultValue;a.Lc&&b!==a.D&&a.sg();if(c)L(a,a.defaultValue,!0);else if(a.Fb=void 0,Qb(a,olympe.C.Node.j.Ph),b=a.H)for(const d of b.values())cc(d,a)}}function Vb(a){if(a.j!==olympe.C.Node.j.Hh){Qb(a,olympe.C.Node.j.Hh);var b=a.H;if(b)for(const c of b.values())Vb(c);a.sg();void 0!==a.D&&Xb(a);a.Fb=a.defaultValue}}function Tb(a){return a.j===olympe.C.Node.j.bi}
330
330
  function Ub(a,b){b===a?olympe.C.G.error('Setting a node as provider of itself. Ignoring'):(a.D&&a.D!==b&&Xb(a),Rb(b,a),Tb(b)?L(a,b.Fb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):cc(a),a.D=b)}function dc(a,b){a.Lc&&(a.Lc=void 0);a.ad='Repeater';Ub(a,b)}function $b(a){a.D?Zb(a):null!==a.R&&0===Array.from(a.R.values()).filter(b=>!Tb(b)).length&&(a.mb&&(a.mb=!1,Sb(a)),Zb(a))}
331
331
  function Rb(a,b){a.H||(a.H=new Map);a.H.set(b.T(),b);a.j===olympe.C.Node.j.$d&&olympe.C.G.warn('adding a downstream node on a deleted one (#'+a.T()+') !')}function Yb(a,b){a.H&&(b=b.T(),a.H.has(b)&&(a.H.delete(b),ec(a)))}function ec(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,Tz:c=!0,Yf:d,Ln:e,debug:f=!1,qg:g=null,ad:h='Node',rj:k}={}){++Ob;super(String(Ob));this.debug=!!f;this.ad=h;h&&'string'===typeof h||(b?this.ad=b.name?b.name:'anon()':this.ad='Node');this.Wd=e&&0<e.length?e:null;this.qg=g&&0<g.length?g:null;this.valueType=a;this.Fb=void 0;this.ta=!1;this.j=olympe.C.Node.j.Ph;this.mb=!1;this.H=this.R=null;this.Lc=b;this.Yf=d||null;this.defaultValue=this.bb=this.D=void 0;this.rj=k;d&&d instanceof
333
- olympe.C.Node&&Pb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Pb(this,a);c&&Sb(this)}xh(a){this.defaultValue=a;this.j===olympe.C.Node.j.Ph&&L(this,a,!0);return this}tj(a){this.valueType=a}Nb(){return this.valueType||Object}asObservable(a=olympe.C.Ya()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.C.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.ad}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Jc(){return this.j}gb(){return this.j===olympe.C.Node.j.$d}jd(){return this.j===
334
- olympe.C.Node.j.cg}Eb(...a){if(this.rj instanceof Function)return this.rj(...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.$d||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.hb(g)&&b.push(g.Ca);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.gh&&(e[g]=f.Ca,b.push(g));return M(new olympe.C.Node({valueType:d.H(),
335
- Lc:c,Yf:this,Ln:e,debug:!1,qg:b,ad:'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.tt(null);ec(this)}destroy(){var a=this.j;if(a!==olympe.C.Node.j.cg&&a!==olympe.C.Node.j.$d){Qb(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())&&Yb(c,this);this.R.clear()}this.R=null;this.D&&(Yb(this.D,this),this.D=void 0);this.Fb=void 0;this.Wd&&(this.Wd.length=0,this.Wd=null);this.qg&&(this.qg.length=0,this.qg=null);this.rj=this.Lc=void 0;this.defaultValue=this.Yf=null;this.ad=`** Destroyed ** ${this.ad}`;Qb(this,olympe.C.Node.j.$d)}}Dn(){return this.ad}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.ad?' '+this.ad:'')+'>'+(a?' '+a+'()':'')}};olympe.C.Node.D='rootNode';olympe.C.Node.j={Ph:0,bi:1,Hh:3,vk:4,OBSOLETE:5,cg:6,$d:7};function Wb(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(fc(c,a.prototype));c.ei=a;c.ss=b;return c}function fc(a,b){Object.prototype.hasOwnProperty.call(b,olympe.C.Proxy.Nm)||Object.defineProperty(b,olympe.C.Proxy.Nm,{enumerable:!1,configurable:!1,writable:!1,value:gc(a,b)});return b[olympe.C.Proxy.Nm]}
338
- function hc(a,b){if(a.ei!==b){a.ei=b;b.prototype||olympe.C.G.error('Cast not possible, provided type is not a valid type!');var c=fc(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Ca&&a.Ca.tj(b)}}
332
+ olympe.C.Node=class extends olympe.C.Wb{constructor({valueType:a,Lc:b,Tz:c=!0,Yf:d,Ln:e,debug:f=!1,rg:g=null,ad:h='Node',qj:k}={}){++Ob;super(String(Ob));this.debug=!!f;this.ad=h;h&&'string'===typeof h||(b?this.ad=b.name?b.name:'anon()':this.ad='Node');this.Wd=e&&0<e.length?e:null;this.rg=g&&0<g.length?g:null;this.valueType=a;this.Fb=void 0;this.ta=!1;this.j=olympe.C.Node.j.Ph;this.mb=!1;this.H=this.R=null;this.Lc=b;this.Yf=d||null;this.defaultValue=this.Wa=this.D=void 0;this.qj=k;d&&d instanceof
333
+ olympe.C.Node&&Pb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Pb(this,a);c&&Sb(this)}xh(a){this.defaultValue=a;this.j===olympe.C.Node.j.Ph&&L(this,a,!0);return this}sj(a){this.valueType=a}Nb(){return this.valueType||Object}asObservable(a=olympe.C.$a()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.C.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.ad}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Jc(){return this.j}gb(){return this.j===olympe.C.Node.j.$d}jd(){return this.j===
334
+ olympe.C.Node.j.dg}Eb(...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.dg&&a!==olympe.C.Node.j.$d||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.hb(g)&&b.push(g.Ca);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.gh&&(e[g]=f.Ca,b.push(g));return M(new olympe.C.Node({valueType:d.H(),
335
+ Lc:c,Yf:this,Ln:e,debug:!1,rg:b,ad:'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.tt(null);ec(this)}destroy(){var a=this.j;if(a!==olympe.C.Node.j.dg&&a!==olympe.C.Node.j.$d){Qb(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())&&Yb(c,this);this.R.clear()}this.R=null;this.D&&(Yb(this.D,this),this.D=void 0);this.Fb=void 0;this.Wd&&(this.Wd.length=0,this.Wd=null);this.rg&&(this.rg.length=0,this.rg=null);this.qj=this.Lc=void 0;this.defaultValue=this.Yf=null;this.ad=`** Destroyed ** ${this.ad}`;Qb(this,olympe.C.Node.j.$d)}}Dn(){return this.ad}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.ad?' '+this.ad:'')+'>'+(a?' '+a+'()':'')}};olympe.C.Node.D='rootNode';olympe.C.Node.j={Ph:0,bi:1,Hh:3,vk:4,OBSOLETE:5,dg:6,$d:7};function Wb(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(fc(c,a.prototype));c.ei=a;c.ss=b;return c}function fc(a,b){Object.prototype.hasOwnProperty.call(b,olympe.C.Proxy.Nm)||Object.defineProperty(b,olympe.C.Proxy.Nm,{enumerable:!1,configurable:!1,writable:!1,value:gc(a,b)});return b[olympe.C.Proxy.Nm]}
338
+ function hc(a,b){if(a.ei!==b){a.ei=b;b.prototype||olympe.C.G.error('Cast not possible, provided type is not a valid type!');var c=fc(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Ca&&a.Ca.sj(b)}}
339
339
  function gc(a,b){let c={};if(b.prototype)olympe.C.G.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(fc(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.Ca;if(g&&Tb(g)&&(g=g.Fb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.C.J.Y,c[d]=function(...f){f=this.ss.call(this.Ca,
340
340
  ...f,e,d);const g=e.Y;if(g){const h=this.Ca.Fb;h&&h[g]&&hc(f,h[g])}return e.R()?this:f})}});return c}function ic(a,b){L(a.Ca,b)}function jc(a){cc(a.Ca)}function kc(a,b){dc(a.Ca,olympe.C.Vf(b)?b:b.Ca)}function lc(a,b){olympe.C.hb(b)||olympe.C.Vf(b)?kc(a,b):ic(a,b)}
341
341
  olympe.C.Proxy=class{constructor(a,b){this.Ca=null;this.ei=a;this.ss=b}static hb(a){return!(!a||!a.gh)}Fa(a){return olympe.C.ua([this,a],(b,c)=>b===c,Boolean)}Kd(a){return olympe.C.ua([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.Ca.asObservable(a)}rs(){return this.Ca}};olympe.C.Proxy.Nm='__opp__';olympe.C.Proxy.prototype.gh=!0;function mc(a,b){a.node.xh(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.hb(a)?L(this.node,olympe.C.Qa(a)):L(this.node,a);return this}repeat(a){dc(this.node,olympe.C.hb(a)?a.Ca:a);return this}clear(){cc(this.node);return this}tb(){return M(this.node)}getContext(){return this.node}};function nc(a,b,c=1E3,d,e){const f=olympe.C.cc(olympe.C.aa),g=d||olympe.C.aa.kp.rq;let h,k,l,n;f.update(olympe.C.ra(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.getContext().gb()||(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.ra(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.tb()}
342
342
  olympe.C.aa=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.ra(b.value)}eo(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.C.Sb(!this.eo())}Wc(){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
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.eo()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.C.cc(olympe.C.aa,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.C.ra(c))};a.forEach((f,g)=>{olympe.C.Vc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().gb()){var g=b.get(f);b.delete(f);
344
- g===c&&e()}});return d.tb()}he(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ra(b.valueOf()+c.valueOf()),olympe.C.aa,'ONumber.plus')}vh(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ra(b.valueOf()-c.valueOf()),olympe.C.aa,'ONumber.minus')}round(){return olympe.C.ra(Math.round(this.valueOf()))}Pj(){return olympe.C.ra(-this.valueOf())}rl(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ra(b.valueOf()*c.valueOf()),olympe.C.aa,'ONumber.mul')}wj(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ra(b.valueOf()/
344
+ g===c&&e()}});return d.tb()}he(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ra(b.valueOf()+c.valueOf()),olympe.C.aa,'ONumber.plus')}vh(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ra(b.valueOf()-c.valueOf()),olympe.C.aa,'ONumber.minus')}round(){return olympe.C.ra(Math.round(this.valueOf()))}Pj(){return olympe.C.ra(-this.valueOf())}rl(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ra(b.valueOf()*c.valueOf()),olympe.C.aa,'ONumber.mul')}vj(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ra(b.valueOf()/
345
345
  c.valueOf()),olympe.C.aa,'ONumber.div')}vz(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ra(b.valueOf()%c.valueOf()),olympe.C.aa,'ONumber.div')}floor(){return olympe.C.ra(Math.floor(this.valueOf()))}ceil(){return olympe.C.ra(Math.ceil(this.valueOf()))}trunc(){return olympe.C.ra(Math.trunc(this.valueOf()))}log(){return olympe.C.ra(Math.log(this.valueOf()))}pow(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ra(Math.pow(b.valueOf(),c.valueOf())),olympe.C.aa,'ONumber.pow')}exp(){return olympe.C.ra(Math.exp(this.valueOf()))}Kd(a){return olympe.C.ua([this,
346
346
  a],(b,c)=>olympe.C.Sb(b.Fa(c)),olympe.C.da,'ONumber.oEquals')}Fa(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Hy(){return this.valueOf()}On(a){return olympe.C.ua([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.C.da.D:olympe.C.da.j,olympe.C.da,'ONumber.isBiggerThan')}Zz(a){return olympe.C.ua([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.C.ra(c),olympe.C.aa,'ONumber.returnsBiggest')}ot(a){return olympe.C.ua([this,
347
- a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.C.ra(c),olympe.C.aa,'ONumber.returnsSmallest')}lz(a){return olympe.C.ua([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.ra(Math.sin(this.valueOf()))}cos(){return olympe.C.ra(Math.cos(this.valueOf()))}atan2(a){return olympe.C.hb(a)?olympe.C.ye([a],b=>olympe.C.ra(Math.atan2(this.valueOf(),b.valueOf())),olympe.C.aa):olympe.C.ra(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.C.ra(Math.abs(this.valueOf()))}Jj(a,
348
- b){return olympe.C.hb(a)||olympe.C.hb(b)?olympe.C.ye([a,b],(c,d)=>olympe.C.ra(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.C.aa):olympe.C.ra(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static Zw(a,b,c,d){'number'===typeof a&&(a=olympe.C.ge(a));'number'===typeof b&&(b=olympe.C.ge(b));'number'===typeof c&&(c=olympe.C.ge(c));let e=0;const f=olympe.C.ge(0);let g,h;void 0!==b&&void 0!==c&&olympe.C.Hj(b.On(c),()=>{olympe.ia.Za('df').warn('You have a min bigger than max, cap your inputs')});
347
+ a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.C.ra(c),olympe.C.aa,'ONumber.returnsSmallest')}lz(a){return olympe.C.ua([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.ra(Math.sin(this.valueOf()))}cos(){return olympe.C.ra(Math.cos(this.valueOf()))}atan2(a){return olympe.C.hb(a)?olympe.C.ye([a],b=>olympe.C.ra(Math.atan2(this.valueOf(),b.valueOf())),olympe.C.aa):olympe.C.ra(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.C.ra(Math.abs(this.valueOf()))}Ij(a,
348
+ b){return olympe.C.hb(a)||olympe.C.hb(b)?olympe.C.ye([a,b],(c,d)=>olympe.C.ra(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.C.aa):olympe.C.ra(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static Zw(a,b,c,d){'number'===typeof a&&(a=olympe.C.ge(a));'number'===typeof b&&(b=olympe.C.ge(b));'number'===typeof c&&(c=olympe.C.ge(c));let e=0;const f=olympe.C.ge(0);let g,h;void 0!==b&&void 0!==c&&olympe.C.Gj(b.On(c),()=>{olympe.ia.Ya('df').warn('You have a min bigger than max, cap your inputs')});
349
349
  const k=(l,n)=>{n=olympe.C.ge(n);const p=olympe.C.aa.animate(n,500);kc(f,p);ic(n,olympe.C.ra(l));e=l};olympe.C.ye([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):kc(f,olympe.C.ge(e))},olympe.C.aa);void 0!==b&&olympe.C.Rn(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.C.ge(e),p=olympe.C.aa.animate(n,400,d);l=olympe.C.ra(g);L(n.Ca,l);e=g;kc(f,p)}});void 0!==c&&olympe.C.Rn(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.C.ge(e),p=olympe.C.aa.animate(n,400,d);l=olympe.C.ra(h);L(n.Ca,l);e=h;kc(f,
350
350
  p)}});return f}static offset(a){let b;return olympe.C.ye([a],c=>{void 0===b&&(b=c);return olympe.C.ra(c-b)},olympe.C.aa,'offset')}static Es(a){let b,c,d;return olympe.C.ua([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.C.ra(0);d=window.performance.now();const f=olympe.C.ra((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.C.aa,'derivative')}static dz(a){let b=olympe.C.ra(0),c,d,e;return olympe.C.ua([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.C.ra(0);
351
351
  e=window.performance.now();b=b.he((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.C.aa,'integrate')}static Ix(a){let b;return olympe.C.ua([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.C.ra(c.valueOf()-b.valueOf());b=c;return d},olympe.C.aa,'diff')}static xx(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.ra(d>=e?d<=f?d:f:e)},olympe.C.aa)}static animate(a,b,c,d){let e;
352
352
  return e=olympe.C.ua([a],f=>{const g=olympe.C.Qa(b,1E3),h=olympe.C.Qa(e);return void 0===h?olympe.C.ra(f):nc(h,f,g,c,k=>{d&&d(k)})},olympe.C.aa)}static mx(a,b,c){let d,e,f,g,h,k,l=olympe.C.ge(),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);ic(l,olympe.C.ra(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Wc(a){return olympe.C.hb(a)?
353
353
  olympe.C.ua([a],b=>olympe.C.xb(b.valueOf().toString()),olympe.C.Ta):olympe.C.xb(a)}static Pj(a){return olympe.C.hb(a)?olympe.C.ua([a],b=>olympe.C.ra(-b.valueOf()),olympe.C.aa):olympe.C.ra(-a.valueOf())}static he(a,b){return olympe.C.hb(a)||olympe.C.hb(b)?olympe.C.ua([a,b],(c,d)=>olympe.C.ra(c.valueOf()+d.valueOf()),olympe.C.aa,'plus'):olympe.C.ra(a.valueOf()+b.valueOf())}static vh(a,b){return olympe.C.hb(a)||olympe.C.hb(b)?olympe.C.ye([a,b],(c,d)=>olympe.C.ra(c.valueOf()-d.valueOf()),olympe.C.aa,
354
- 'minus'):olympe.C.ra(a.valueOf()-b.valueOf())}static wj(a,b){return olympe.C.hb(a)||olympe.C.hb(b)?olympe.C.ye([a,b],(c,d)=>olympe.C.ra(c.valueOf()/d.valueOf()),olympe.C.aa,'div'):olympe.C.ra(a.valueOf()/b.valueOf())}static Rz(a,b){if(void 0===b)return a;olympe.C.Vc([b],c=>{c=olympe.C.ra(a.Ca.Fb.valueOf()+c.valueOf());L(a.Ca,c)},'plusEqual');return a}};olympe.C.aa.ZERO=new olympe.C.aa(0);olympe.C.aa.ONE=new olympe.C.aa(1);olympe.C.aa.Jw=new olympe.C.aa(2);olympe.C.aa.PI=new olympe.C.aa(Math.PI);
354
+ 'minus'):olympe.C.ra(a.valueOf()-b.valueOf())}static vj(a,b){return olympe.C.hb(a)||olympe.C.hb(b)?olympe.C.ye([a,b],(c,d)=>olympe.C.ra(c.valueOf()/d.valueOf()),olympe.C.aa,'div'):olympe.C.ra(a.valueOf()/b.valueOf())}static Rz(a,b){if(void 0===b)return a;olympe.C.Vc([b],c=>{c=olympe.C.ra(a.Ca.Fb.valueOf()+c.valueOf());L(a.Ca,c)},'plusEqual');return a}};olympe.C.aa.ZERO=new olympe.C.aa(0);olympe.C.aa.ONE=new olympe.C.aa(1);olympe.C.aa.Jw=new olympe.C.aa(2);olympe.C.aa.PI=new olympe.C.aa(Math.PI);
355
355
  olympe.C.aa.Cu=new olympe.C.aa(Infinity);olympe.C.aa.zv=new olympe.C.aa(-Infinity);olympe.C.aa.yq=new olympe.C.aa(NaN);olympe.C.aa.HC=olympe.C.aa.Rz;olympe.C.aa.sA=olympe.C.aa.Zw;olympe.C.aa.vC=olympe.C.aa.offset;olympe.C.aa.$A=olympe.C.aa.Es;olympe.C.aa.SE=olympe.C.aa.Es;olympe.C.aa.WB=olympe.C.aa.dz;olympe.C.aa.aB=olympe.C.aa.Ix;olympe.C.aa.IA=olympe.C.aa.xx;olympe.C.aa.tA=olympe.C.aa.animate;olympe.C.aa.uA=olympe.C.aa.mx;olympe.C.aa.aE=olympe.C.aa.Wc;olympe.C.aa.bE=olympe.C.aa.Pj;
356
- olympe.C.aa.GC=olympe.C.aa.he;olympe.C.aa.jC=olympe.C.aa.vh;olympe.C.aa.bB=olympe.C.aa.wj;
356
+ olympe.C.aa.GC=olympe.C.aa.he;olympe.C.aa.jC=olympe.C.aa.vh;olympe.C.aa.bB=olympe.C.aa.vj;
357
357
  olympe.C.aa.kp={rq:function(a,b,c,d){return c*a/d+b},vB:function(a,b,c,d){a/=d;return c*a*a+b},FB:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},rB: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},kB:function(a,b,c,d){a/=d;return c*a*a*a+b},BB:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},pB: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},wB:function(a,b,c,d){a/=d;return c*a*a*a*a+b},GB:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
358
358
  sB: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},xB:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},HB:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},tB: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},yB:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},IB:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},uB:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},nB:function(a,b,c,d){return c*Math.pow(2,
359
359
  10*(a/d-1))+b},EB:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},qB: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},jB:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},AB:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},oB: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},eB:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},fB:function(a,b,c,d){d=(a/=d)*a;return b+
360
360
  c*(2*d*d+2*d*a+-3*d)},gB:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},hB:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},DB: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)},CB: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)},mB:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},lB:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},zB:function(a,
361
361
  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},iB: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.aa.prototype;m.toJSON.K=olympe.C.J.j;m.eo.K=olympe.C.J.j;m.isNaN.K=olympe.C.J.N;m.Wc.K=olympe.C.J.D;
362
- m.toString.K=new olympe.C.J(()=>String,[]);m.toFixed.K=new olympe.C.J(()=>String,[]);m.he.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.vh.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.round.K=olympe.C.J.F;m.Pj.K=olympe.C.J.F;m.rl.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.wj.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.vz.K=new olympe.C.J(()=>olympe.C.aa,[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.aa,[0]);m.exp.K=olympe.C.J.F;
363
- m.Kd.K=new olympe.C.J(()=>olympe.C.da,[0]);m.Fa.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.Hy.K=olympe.C.J.j;m.On.K=new olympe.C.J(()=>olympe.C.da,[0]);m.Zz.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.ot.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.lz.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.aa,[0]);m.abs.K=olympe.C.J.F;m.Jj.K=new olympe.C.J(()=>olympe.C.aa,[0,1]);olympe.C.Ta=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.xb(b.value)}Bs(a){return olympe.C.Ta.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.C.ua([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.Ta,'OString.concat')}Wc(){return this}lA(a){return olympe.C.ra(parseInt(this.value,
364
- a))}vt(){return olympe.C.ra(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Fa(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Kd(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.Sb(c&&b.valueOf()===c.valueOf()),olympe.C.da,'OString.oEquals')}nf(){return olympe.C.Sb(!this.value||0===this.value.length)}contains(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.Sb((c instanceof olympe.C.Ta||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
362
+ m.toString.K=new olympe.C.J(()=>String,[]);m.toFixed.K=new olympe.C.J(()=>String,[]);m.he.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.vh.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.round.K=olympe.C.J.F;m.Pj.K=olympe.C.J.F;m.rl.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.vj.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.vz.K=new olympe.C.J(()=>olympe.C.aa,[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.aa,[0]);m.exp.K=olympe.C.J.F;
363
+ m.Kd.K=new olympe.C.J(()=>olympe.C.da,[0]);m.Fa.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.Hy.K=olympe.C.J.j;m.On.K=new olympe.C.J(()=>olympe.C.da,[0]);m.Zz.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.ot.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.lz.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.aa,[0]);m.abs.K=olympe.C.J.F;m.Ij.K=new olympe.C.J(()=>olympe.C.aa,[0,1]);olympe.C.Ta=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.xb(b.value)}Bs(a){return olympe.C.Ta.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.C.ua([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.Ta,'OString.concat')}Wc(){return this}lA(a){return olympe.C.ra(parseInt(this.value,
364
+ a))}vt(){return olympe.C.ra(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Fa(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Kd(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.Sb(c&&b.valueOf()===c.valueOf()),olympe.C.da,'OString.oEquals')}pf(){return olympe.C.Sb(!this.value||0===this.value.length)}contains(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.Sb((c instanceof olympe.C.Ta||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
365
365
  olympe.C.da,'OString.contains')}startsWith(a,b){return olympe.C.ua([this,a,b||0],(c,d,e)=>olympe.C.Sb(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.C.da,'OString.startsWith')}endsWith(a,b){return olympe.C.ua([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Fn().valueOf()+e.valueOf()+1;return olympe.C.Sb(c.valueOf().endsWith(d.valueOf(),e))},olympe.C.da,'OString.endsWith')}indexOf(a,b){return olympe.C.ua([this,a,b||0],(c,d,e)=>olympe.C.ra(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
366
366
  olympe.C.aa,'OString.indexOf')}lastIndexOf(a,b){return olympe.C.ua([this,a,b||Infinity],(c,d,e)=>olympe.C.ra(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.C.aa,'OString.lastIndexOf')}slice(a,b){return olympe.C.ua([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.C.Ta,'OString.slice')}Fn(){return olympe.C.ra(this.value.length)}threshold(a){return olympe.C.ua([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.C.Ta.EMPTY,olympe.C.Ta,'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,
367
367
  b){return olympe.C.ua([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.C.Ta,'OString.padStart')}padEnd(a,b){return olympe.C.ua([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.C.Ta,'OString.padEnd')}replace(a,b){return olympe.C.ua([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.C.Ta,'OString.replace')}hA(a,b){return olympe.C.ua([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().substr(d.valueOf(),
368
- e.valueOf())),olympe.C.Ta,'OString.subOStr')}static concat(...a){return olympe.C.xb('').concat(...a)}};olympe.C.Ta.EMPTY=new olympe.C.Ta('');olympe.C.Ta.uw=new olympe.C.Ta(' ');m=olympe.C.Ta.prototype;m.toJSON.K=olympe.C.J.j;m.Bs.K=new olympe.C.J(()=>olympe.C.Ta,[0,1]);m.concat.K=olympe.C.J.D;m.Wc.K=olympe.C.J.D;m.lA.K=olympe.C.J.F;m.vt.K=olympe.C.J.F;m.toString.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.Fa.K=olympe.C.J.j;m.Kd.K=new olympe.C.J(()=>olympe.C.da,[0]);m.nf.K=olympe.C.J.N;
368
+ e.valueOf())),olympe.C.Ta,'OString.subOStr')}static concat(...a){return olympe.C.xb('').concat(...a)}};olympe.C.Ta.EMPTY=new olympe.C.Ta('');olympe.C.Ta.uw=new olympe.C.Ta(' ');m=olympe.C.Ta.prototype;m.toJSON.K=olympe.C.J.j;m.Bs.K=new olympe.C.J(()=>olympe.C.Ta,[0,1]);m.concat.K=olympe.C.J.D;m.Wc.K=olympe.C.J.D;m.lA.K=olympe.C.J.F;m.vt.K=olympe.C.J.F;m.toString.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.Fa.K=olympe.C.J.j;m.Kd.K=new olympe.C.J(()=>olympe.C.da,[0]);m.pf.K=olympe.C.J.N;
369
369
  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.aa,[0,1]);m.lastIndexOf.K=new olympe.C.J(()=>olympe.C.aa,[0,1]);m.slice.K=new olympe.C.J(()=>olympe.C.Ta,[0,1]);m.Fn.K=olympe.C.J.F;m.threshold.K=new olympe.C.J(()=>olympe.C.Ta,[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;
370
370
  m.replace.K=olympe.C.J.D;m.hA.K=olympe.C.J.D;olympe.C.da=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static Qb(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.hb(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}Fa(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Kd(a){if(void 0!==a)return olympe.C.hb(a)?
371
371
  olympe.C.ye([a],b=>new olympe.C.da(this.valueOf()===b.valueOf()),olympe.C.da,'oEquals'):this.Fa(a)?olympe.C.da.D:olympe.C.da.j}Ad(){return this.value?olympe.C.da.j:olympe.C.da.D}lx(a){if(void 0!==a)return olympe.C.hb(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.hb(a)?olympe.C.ye([a],b=>new olympe.C.da(this.valueOf()||b.valueOf()),olympe.C.da,'or'):this.value||a.valueOf()?
@@ -373,73 +373,73 @@ olympe.C.da.D:olympe.C.da.j}xor(a){return olympe.C.ua([this,a],(b,c)=>{b=b.value
373
373
  m.and.K=new olympe.C.J(()=>olympe.C.da,[0]);m.Fa.K=olympe.C.J.j;m.Kd.K=new olympe.C.J(()=>olympe.C.da,[0]);m.Ad.K=olympe.C.J.N;m.lx.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.Wx.K=new olympe.C.J(()=>Boolean,[]);m.Ss.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 oc(a){return new olympe.C.eb(new Date(a))}
374
374
  olympe.C.eb=class{constructor(a){this.sb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.sb.toJSON()+'" }'}static Qb(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)}jq(){return this.sb&&!isNaN(this.sb.getTime())?olympe.C.da.D:olympe.C.da.j}Ju(){return olympe.C.ra(this.sb.getMilliseconds())}Lu(){return olympe.C.ra(this.sb.getSeconds())}Ku(){return olympe.C.ra(this.sb.getMinutes())}Iu(){return olympe.C.ra(this.sb.getHours())}my(){return olympe.C.ra(this.sb.getDate())}getMonth(){return olympe.C.ra(this.sb.getMonth()+1)}Mu(){return olympe.C.ra(this.sb.getFullYear())}getTime(){return this.sb.getTime()}eA(){var a=
375
375
  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.ua([this,a],(b,c)=>olympe.C.xb(b.sb.toLocaleString(c.valueOf())),olympe.C.Ta)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.sb.toLocaleDateString(a)):olympe.C.ua([this,a],(b,c)=>olympe.C.xb(b.sb.toLocaleDateString(c.valueOf())),
376
- olympe.C.Ta)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.sb.toLocaleTimeString(a)):olympe.C.ua([this,a],(b,c)=>olympe.C.xb(b.sb.toLocaleTimeString(c.valueOf())),olympe.C.Ta)}Wc(){return olympe.C.xb(this.sb.toISOString())}iA(){return new Date(this.getTime())}kA(){return this}mA(){return this}pg(a,b){return olympe.C.ua([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)}ax(a){return this.pg('Milliseconds',
377
- a)}ix(a){return this.pg('Seconds',a)}bx(a){return this.pg('Minutes',a)}$w(a){return this.pg('Hours',a)}kn(a){return this.pg('Date',a)}jx(a){return'number'===typeof a?this.kn(7*a):this.kn(a.rl(7))}ex(a){return this.pg('Month',a)}kx(a){return this.pg('FullYear',a)}fA(){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))}gA(){return new olympe.C.eb(new Date(this.sb.getFullYear(),this.sb.getMonth()))}Kd(a){return olympe.C.ua([a],
376
+ olympe.C.Ta)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.sb.toLocaleTimeString(a)):olympe.C.ua([this,a],(b,c)=>olympe.C.xb(b.sb.toLocaleTimeString(c.valueOf())),olympe.C.Ta)}Wc(){return olympe.C.xb(this.sb.toISOString())}iA(){return new Date(this.getTime())}kA(){return this}mA(){return this}qg(a,b){return olympe.C.ua([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)}ax(a){return this.qg('Milliseconds',
377
+ a)}ix(a){return this.qg('Seconds',a)}bx(a){return this.qg('Minutes',a)}$w(a){return this.qg('Hours',a)}kn(a){return this.qg('Date',a)}jx(a){return'number'===typeof a?this.kn(7*a):this.kn(a.rl(7))}ex(a){return this.qg('Month',a)}kx(a){return this.qg('FullYear',a)}fA(){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))}gA(){return new olympe.C.eb(new Date(this.sb.getFullYear(),this.sb.getMonth()))}Kd(a){return olympe.C.ua([a],
378
378
  b=>olympe.C.Sb(this.Fa(b)),olympe.C.da)}Fa(a){return a instanceof olympe.C.eb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}zy(){let a=this.sb.getDay();0===a&&(a=7);return olympe.C.ra(a)}qy(a,b){return olympe.C.ua([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],
379
- void 0===d&&(olympe.ia.Za('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.ra(c)},olympe.C.aa)}gz(a){return olympe.C.ua([a],b=>olympe.C.Sb(this.getTime()<b.getTime()),olympe.C.da)}ez(a){return olympe.C.ua([a],b=>olympe.C.Sb(this.getTime()>b.getTime()),olympe.C.da)}hz(a,b){return olympe.C.ua([a,b],(c,d)=>olympe.C.Sb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.C.da)}valueOf(){return this.jq().valueOf()?
379
+ void 0===d&&(olympe.ia.Ya('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.ra(c)},olympe.C.aa)}gz(a){return olympe.C.ua([a],b=>olympe.C.Sb(this.getTime()<b.getTime()),olympe.C.da)}ez(a){return olympe.C.ua([a],b=>olympe.C.Sb(this.getTime()>b.getTime()),olympe.C.da)}hz(a,b){return olympe.C.ua([a,b],(c,d)=>olympe.C.Sb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.C.da)}valueOf(){return this.jq().valueOf()?
380
380
  new Date(this.getTime()):new Date(0)}};olympe.C.eb.j=oc(0);olympe.C.eb.D=oc(Number.NaN);m=olympe.C.eb.prototype;m.jq.K=olympe.C.J.N;m.Ju.K=olympe.C.J.F;m.Lu.K=olympe.C.J.F;m.Ku.K=olympe.C.J.F;m.Iu.K=olympe.C.J.F;m.my.K=olympe.C.J.F;m.getMonth.K=olympe.C.J.F;m.Mu.K=olympe.C.J.F;m.getTime.K=olympe.C.J.j;m.eA.K=new olympe.C.J(()=>olympe.C.Ta,[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.iA.K=olympe.C.J.j;
381
- m.kA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.mA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.pg.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ax.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ix.K=new olympe.C.J(()=>olympe.C.eb,[]);m.bx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.$w.K=new olympe.C.J(()=>olympe.C.eb,[]);m.kn.K=new olympe.C.J(()=>olympe.C.eb,[0]);m.jx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ex.K=new olympe.C.J(()=>olympe.C.eb,[]);m.kx.K=new olympe.C.J(()=>olympe.C.eb,[0]);
382
- m.fA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.gA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Kd.K=olympe.C.J.N;m.Fa.K=olympe.C.J.j;m.zy.K=olympe.C.J.F;m.qy.K=new olympe.C.J(()=>olympe.C.aa,[0,1]);m.gz.K=new olympe.C.J(()=>olympe.C.da,[0]);m.ez.K=new olympe.C.J(()=>olympe.C.da,[0]);m.hz.K=new olympe.C.J(()=>olympe.C.da,[0,1]);m.valueOf.K=olympe.C.J.j;const pc=new Map,qc=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,rc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function sc(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=rc.exec(c)):(d=1,c=qc.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)}
381
+ m.kA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.mA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.qg.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ax.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ix.K=new olympe.C.J(()=>olympe.C.eb,[]);m.bx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.$w.K=new olympe.C.J(()=>olympe.C.eb,[]);m.kn.K=new olympe.C.J(()=>olympe.C.eb,[0]);m.jx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ex.K=new olympe.C.J(()=>olympe.C.eb,[]);m.kx.K=new olympe.C.J(()=>olympe.C.eb,[0]);
382
+ m.fA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.gA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Kd.K=olympe.C.J.N;m.Fa.K=olympe.C.J.j;m.zy.K=olympe.C.J.F;m.qy.K=new olympe.C.J(()=>olympe.C.aa,[0,1]);m.gz.K=new olympe.C.J(()=>olympe.C.da,[0]);m.ez.K=new olympe.C.J(()=>olympe.C.da,[0]);m.hz.K=new olympe.C.J(()=>olympe.C.da,[0,1]);m.valueOf.K=olympe.C.J.j;const pc=new Map,qc=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,rc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function sc(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=rc.exec(c)):(d=1,c=qc.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.qf(a)?olympe.C.ye([a],b,olympe.C.Color):b(a)}
383
383
  olympe.C.Color=class{constructor(a,b,c,d){this.j=olympe.C.ra(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.D=olympe.C.ra(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.C.ra(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.C.ra(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 Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.Color.create(b.r,
384
384
  b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.C.ua([a,b,c,d],(e,f,g,h)=>{e=olympe.C.ra(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.C.ra(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.C.ra(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.C.ra(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of pc.values())if(k&&k.j.Fa(e)&&k.D.Fa(f)&&k.b.Fa(g)&&k.a.Fa(h))return k;return new olympe.C.Color(e,f,g,h)},olympe.C.Color)}ph(){return this.j}ih(){return this.b}mh(){return this.D}hh(){return this.a}px(a,
385
- b){return olympe.C.Color.create(this.j.Jj(a.ph(),b),this.D.Jj(a.mh(),b),this.b.Jj(a.ih(),b),this.a.Jj(a.hh(),b))}Px(a){return olympe.C.Color.create(this.j,this.D,this.b,a)}wt(){return`rgba(${this.j},${this.D},${this.b},${this.a})`}bo(){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.bo()}Fa(a){return a instanceof olympe.C.Color?this.j.valueOf()===a.j.valueOf()&&
385
+ b){return olympe.C.Color.create(this.j.Ij(a.ph(),b),this.D.Ij(a.mh(),b),this.b.Ij(a.ih(),b),this.a.Ij(a.hh(),b))}Px(a){return olympe.C.Color.create(this.j,this.D,this.b,a)}wt(){return`rgba(${this.j},${this.D},${this.b},${this.a})`}bo(){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.bo()}Fa(a){return a instanceof olympe.C.Color?this.j.valueOf()===a.j.valueOf()&&
386
386
  this.D.valueOf()===a.D.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}compare(a){const b=(this.ph().valueOf()<<16|this.mh().valueOf()<<8|this.ih().valueOf())-(a.ph().valueOf()<<16|a.mh().valueOf()<<8|a.ih().valueOf());return 0===b?this.hh().valueOf()-a.hh().valueOf():b}};olympe.C.Color.prototype.equals=olympe.C.Color.prototype.Fa;olympe.C.Color.prototype.toHexString=olympe.C.Color.prototype.bo;olympe.C.Color.prototype.toRGBString=olympe.C.Color.prototype.wt;
387
387
  olympe.C.Color.prototype.getAlpha=olympe.C.Color.prototype.hh;olympe.C.Color.prototype.getGreen=olympe.C.Color.prototype.mh;olympe.C.Color.prototype.getBlue=olympe.C.Color.prototype.ih;olympe.C.Color.prototype.getRed=olympe.C.Color.prototype.ph;olympe.C.Color.create=olympe.C.Color.create;m=olympe.C.Color.prototype;m.toJSON.K=olympe.C.J.j;m.ph.K=olympe.C.J.F;m.ih.K=olympe.C.J.F;m.mh.K=olympe.C.J.F;m.hh.K=olympe.C.J.F;m.px.K=new olympe.C.J(()=>olympe.C.Color,[]);
388
388
  m.Px.K=new olympe.C.J(()=>olympe.C.Color,[]);m.wt.K=new olympe.C.J(()=>String,[]);m.bo.K=new olympe.C.J(()=>String,[]);m.Fa.K=olympe.C.J.j;m.compare.K=olympe.C.J.j;olympe.C.File=class{la(){}kq(){}lq(){}Rs(){}gl(){}Bn(){}hl(){}rename(){}};olympe.C.Zb=class{constructor(a,b){this.x=olympe.C.ge(a);this.y=olympe.C.ge(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.C.Qa(this.x).valueOf())+', "y": '+JSON.stringify(olympe.C.Qa(this.y).valueOf())+' }'}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.C.Zb(b.x,b.y)}Nu(){return this.x}cA(a){lc(this.x,a)}Ou(){return this.y}dA(a){lc(this.y,a)}Sy(){return this.x.ot(this.y)}he(a){return olympe.C.ua([this,a],(b,c)=>new olympe.C.Zb(b.x.he(c.x),b.y.he(c.y)),
389
- olympe.C.Zb,'Vector2.plus')}vh(a){return olympe.C.ua([this,a],(b,c)=>new olympe.C.Zb(b.x.vh(c.x),b.y.vh(c.y)),olympe.C.Zb,'Vector2.minus')}xz(a){return new olympe.C.Zb(this.x.rl(a),this.y.rl(a))}Kx(a){return new olympe.C.Zb(this.x.wj(a),this.y.wj(a))}zz(){return new olympe.C.Zb(this.x.Pj(),this.y.Pj())}Lx(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ua([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.C.ra(d*f+e*g),olympe.C.aa),olympe.C.aa)}length(){return olympe.C.ua([this.x,this.y],(a,b)=>olympe.C.ra(Math.sqrt(a*
389
+ olympe.C.Zb,'Vector2.plus')}vh(a){return olympe.C.ua([this,a],(b,c)=>new olympe.C.Zb(b.x.vh(c.x),b.y.vh(c.y)),olympe.C.Zb,'Vector2.minus')}xz(a){return new olympe.C.Zb(this.x.rl(a),this.y.rl(a))}Kx(a){return new olympe.C.Zb(this.x.vj(a),this.y.vj(a))}zz(){return new olympe.C.Zb(this.x.Pj(),this.y.Pj())}Lx(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ua([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.C.ra(d*f+e*g),olympe.C.aa),olympe.C.aa)}length(){return olympe.C.ua([this.x,this.y],(a,b)=>olympe.C.ra(Math.sqrt(a*
390
390
  a+b*b)),olympe.C.aa)}normalize(){return olympe.C.ua([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.ua([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.floor(a),Math.floor(b)),olympe.C.Zb)}ceil(){return olympe.C.ua([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.ceil(a),Math.ceil(b)),olympe.C.Zb)}round(){return olympe.C.ua([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.round(a),Math.round(b)),olympe.C.Zb)}gx(a){return new olympe.C.Zb(this.x.he(a),
391
391
  this.y.he(a))}hx(a,b){return new olympe.C.Zb(this.x.he(a),this.y.he(b))}Wc(){return olympe.C.ua([this.x,this.y],(a,b)=>olympe.C.xb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.C.Ta)}toString(){return`Vector2[${this.x.Ca.Fb}, ${this.y.Ca.Fb}]`}Fa(a){return this===a?!0:!1}};m=olympe.C.Zb.prototype;m.toJSON.K=olympe.C.J.j;m.Nu.K=olympe.C.J.F;m.cA.K=olympe.C.J.j;m.Ou.K=olympe.C.J.F;m.dA.K=olympe.C.J.j;m.Sy.K=olympe.C.J.F;m.he.K=new olympe.C.J(()=>olympe.C.Zb,[0]);
392
- m.vh.K=new olympe.C.J(()=>olympe.C.Zb,[0]);m.xz.K=olympe.C.J.R;m.Kx.K=olympe.C.J.R;m.zz.K=olympe.C.J.R;m.Lx.K=new olympe.C.J(()=>olympe.C.aa,[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.gx.K=olympe.C.J.R;m.hx.K=olympe.C.J.R;m.Wc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Fa.K=olympe.C.J.j;olympe.C.Jg=class{constructor(){}Nb(){}Rd(){}get(){}ri(){}has(){}sh(){}Ic(){}Sf(){}Bf(){}wg(){}forEach(){}pe(){}};olympe.C.Jg.prototype.forEachCurrentValue=olympe.C.Jg.prototype.pe;olympe.C.Jg.prototype.forEach=olympe.C.Jg.prototype.forEach;m=olympe.C.Jg.prototype;m.has.K=olympe.C.J.N;m.sh.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>Object,[]);m.Sf.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.pe.K=olympe.C.J.j;olympe.C.vd=class extends olympe.C.Jg{Id(){}Rf(){}mf(){}Qf(){}qe(){}lf(){}xj(){}ti(){}};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.Qf;olympe.C.vd.prototype.getKeyAt=olympe.C.vd.prototype.mf;olympe.C.vd.prototype.getCurrentRank=olympe.C.vd.prototype.Rf;olympe.C.vd.prototype.getRank=olympe.C.vd.prototype.Id;m=olympe.C.vd.prototype;m.Id.K=olympe.C.J.F;m.Rf.K=olympe.C.J.j;
393
- m.mf.K=new olympe.C.J(()=>String,[]);m.Qf.K=olympe.C.J.j;m.qe.K=new olympe.C.J(()=>Object,[]);m.lf.K=olympe.C.J.j;m.xj.K=olympe.C.J.j;m.ti.K=new olympe.C.J(()=>Array,[]);olympe.C.Di=class{constructor(a,b){this.H=b||olympe.C.Ya();this.valueType=a||Object;this.values={};this.bb=this.ja=null;this.Pe=0;this.R=Object.create(null);this.mb=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}Nb(){return this.valueType}Rd(a){this.valueType=a;const b=this.ja;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
394
- c)&&hc(b[c],a)}get(a){const b=c=>{null===this.ja&&(this.ja={});return this.Cj(this.ja,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.C.ua([a],c=>b(c),this.valueType)}ri(a){a=this.values[a];return olympe.C.hb(a)?Tb(a.Ca)?a.Ca.Fb:void 0:a}has(a){const b=c=>{null===this.bb&&(this.bb={});return this.Cj(this.bb,c,c in this.values?olympe.C.da.D:olympe.C.da.j,olympe.C.da,'Map.has('+c+')')};return olympe.C.ua([a],c=>b(c),olympe.C.da)}sh(a){return a in this.values}Cj(a,b,c,d,e){let f=a[b];
395
- f||this.H.run(()=>{f=olympe.C.Xd(d,void 0,e);a[b]=f;f.Ca.onDestroy(()=>delete a[b]);olympe.C.hb(c)?kc(f,c):ic(f,c)});return f}Ic(){throw Error('Abstract method getFirstKey needs to be overridden');}Sf(){throw Error('Abstract method getFirstKey needs to be overridden');}Bf(){null===this.F&&this.H.run(()=>{this.F=olympe.C.Xd(olympe.C.aa,olympe.C.ra(this.size));this.F.Ca.onDestroy(()=>{this.F=null})});return this.F}wg(){return this.size}forEach(a,b){const c=this.fn();a=this.us(c,a,b);this.en(c,a)}fn(){return String(++this.Pe)}en(a,
396
- b){this.mb[a]=b;olympe.C.Ya().Yd(()=>{const c=this.R;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.mb[a]});this.pe(b)}us(a,b,c){const d=olympe.C.Ya();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.jn(a,f,g)})}}jn(a,b,c){void 0===this.R[b]&&(this.R[b]={});this.R[b][a]=c}pe(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
397
- a(b[c],c,this))break}al(a,b){void 0!==this.values[a]&&this.qj(a,!0);this.values[a]=b;var c=this.ja;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.C.Proxy?kc(c[a],b):ic(c[a],b));c=this.bb;null!==c&&void 0!==c[a]&&lc(c[a],!0);this.size++;c=this.mb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}qj(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.gh?d.Ca.Fb:d;var e=this.ja;null!==e&&void 0!==e[a]&&jc(e[a]);e=this.bb;null!==e&&void 0!==
398
- e[a]&&lc(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&&lc(this.F,this.size)}gi(){var a=this.ja;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&jc(a[c]);a=this.bb;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&lc(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,
399
- 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&&lc(this.F,this.size)}Mg(){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.Di.za=[olympe.C.Jg];m=olympe.C.Di.prototype;m.getContext.K=olympe.C.J.j;m.Nb.K=olympe.C.J.j;m.Rd.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>Object,[],'valueType');m.ri.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.sh.K=olympe.C.J.j;m.Cj.K=olympe.C.J.j;
400
- m.Bf.K=olympe.C.J.F;m.wg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.fn.K=olympe.C.J.j;m.en.K=olympe.C.J.j;m.us.K=olympe.C.J.j;m.jn.K=olympe.C.J.j;m.pe.K=olympe.C.J.j;m.al.K=olympe.C.J.j;m.qj.K=olympe.C.J.j;m.Mf.K=olympe.C.J.j;m.gi.K=olympe.C.J.j;m.Mg.K=olympe.C.J.j;olympe.C.Tj=class extends olympe.C.Di{constructor(a,b){super(a,b);this.D=Object.create(null);this.j=[];this.ea=this.ta=this.Ja=this.$=null}Rd(a){super.Rd(a);if(null!==this.ea)for(let b of this.ea.values())hc(b,a)}Ic(){return this.qe(0)}Sf(){return this.mf(0)}Id(a){const b=c=>{null===this.Ja&&(this.Ja=Object.create(null));let d=this.Rf(a);d=void 0!==d?olympe.C.ra(d):void 0;return this.Cj(this.Ja,c,d,olympe.C.aa,`List.getRank(${c})`)};return olympe.C.hb(a)?M(olympe.C.createNode(olympe.C.aa,b,null,[a.Ca],
401
- [0],'onResolved('+(b.name||'')+')')):b(a)}Rf(a){return this.D[a]}mf(a){const b=c=>{const d=c.valueOf(),e=this.Qf(d);null===this.ta&&(this.ta=Object.create(null));return this.Cj(this.ta,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.C.ua([a],c=>b(c),String)}Qf(a){return this.j[a.valueOf()]}qe(a){if(olympe.C.hb(a))return this.get(olympe.C.ua([a],c=>{c=this.mf(c);if(!Tb(c.Ca)){const d=olympe.C.Ya();olympe.C.Vf(d)&&cc(d)}return c},String));null===this.ea&&(this.ea=new Map);let b=this.ea.get(a);
402
- b||this.H.run(()=>{b=this.get(this.mf(a));this.ea.set(a,b);b.Ca.onDestroy(()=>this.ea.delete(a))});return b}lf(a){return this.ri(this.Qf(a))}xj(a,b,c,d){let e=this.fn();a=this.ft(e,a,b,c,d);this.en(e,a)}ft(a,b,c,d,e){return olympe.C.Ya().tc((f,g)=>{let h=!1,k=olympe.C.Bi([b,c,this.Id(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.jn(a,g,k)})}ti(){null===this.$&&this.H.run(()=>{this.$=olympe.C.Xd(Array,this.j.filter(a=>void 0!==a));this.$.Ca.onDestroy(()=>
403
- {this.F=null})});return this.$}pe(a){if(this.j.length!==this.size)super.pe(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}}hn(a,b){const c=this.Ja,d=this.ta,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]&&jc(c[g]),void 0!==c[a]&&ic(c[a],olympe.C.ra(f)));
404
- null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&jc(d[e]),void 0!==d[b]&&ic(d[b],a))}}gn(a){var b=this.ta,c=this.D[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ca.Fb===a&&jc(b));delete this.D[a];this.j.splice(c,1);c=this.Ja;null!==c&&void 0!==c[a]&&jc(c[a])}vs(){if(null!==this.$){const a=this.j,b=this.$.Ca.Fb;b&&a.join(',')!==b.join(',')&&ic(this.$,a)}}Mf(){this.vs();super.Mf()}gi(){var a=this.D;for(b in a)delete a[b];this.j.length=0;a=this.Ja;if(null!==a)for(b in a)jc(a[b]);a=this.ta;
405
- if(null!==a)for(b in a)jc(a[parseInt(b,10)]);var b=this.$;null!==b&&(ac(b.Ca),ic(b,this.j));return olympe.C.Di.prototype.gi.call(this)}Mg(){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.za=[olympe.C.vd];m=olympe.C.Tj.prototype;m.Rd.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>Object,[]);m.Sf.K=new olympe.C.J(()=>String,[]);m.Id.K=olympe.C.J.F;m.Rf.K=olympe.C.J.j;m.mf.K=new olympe.C.J(()=>String,[]);
406
- m.Qf.K=olympe.C.J.j;m.qe.K=new olympe.C.J(()=>Object,[]);m.lf.K=olympe.C.J.j;m.xj.K=new olympe.C.J(()=>{},[]);m.ft.K=olympe.C.J.j;m.ti.K=new olympe.C.J(()=>Array,[]);m.pe.K=olympe.C.J.j;m.hn.K=olympe.C.J.j;m.gn.K=olympe.C.J.j;m.vs.K=olympe.C.J.j;m.Mf.K=olympe.C.J.j;m.gi.K=olympe.C.J.j;m.Mg.K=olympe.C.J.j;olympe.C.Map=class extends olympe.C.Di{constructor(a){a===olympe.C.Proxy&&(a=Object);super(a);this.j=this.D=null}Rd(a){a===olympe.C.Proxy&&(a=Object);null!==this.D&&hc(this.D,a);super.Rd(a)}Ic(){null===this.D&&this.vn();return this.D}Sf(){null===this.j&&this.vn();return this.j}vn(){this.getContext().run(()=>{this.D=olympe.C.Xd(this.Nb());this.j=olympe.C.Xd(String);this.Nj(this.yn())})}yn(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}Nj(a){if(void 0!==
407
- a){const b=this.values[a];b&&b instanceof olympe.C.Proxy?kc(this.D,b):ic(this.D,b);ic(this.j,a)}else void 0!==this.D.Ca.Fb&&(jc(this.D),jc(this.j))}set(a,b){this.al(a,b);1===this.size&&null!==this.j&&this.Nj(a);this.Mf()}remove(a){const b=this.qj(a);null!==this.j&&this.j.Ca.Fb===a&&this.Nj(this.yn());return b}clear(){this.gi();null!==this.j&&this.Nj()}};m=olympe.C.Map.prototype;m.Rd.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>Object,[]);m.Sf.K=new olympe.C.J(()=>String,[]);m.vn.K=olympe.C.J.j;
408
- m.yn.K=olympe.C.J.j;m.Nj.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.Pg=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.hn(a,d)});this.Mf()}remove(a){this.gn(a);return this.qj(a)}clear(){this.gi()}};olympe.C.Pg.prototype.remove.K=olympe.C.J.j;olympe.C.Pg.prototype.clear.K=olympe.C.J.j;olympe.C.Gt=class extends olympe.C.lk{constructor(a,b){super(olympe.C.aa,'animatedFlowSource');this.duration=a;this.j=b||olympe.C.aa.kp.rq}tb(){return olympe.C.Bz(this.node,this.duration,this.j,void 0)}};let tc=null;olympe.C.G=void 0;olympe.C.Un=void 0;olympe.C.li=void 0;olympe.C.fi=new Map;olympe.C.fi.set(0,olympe.C.aa.ZERO);olympe.C.fi.set(1,olympe.C.aa.ONE);olympe.C.fi.set(2,olympe.C.aa.Jw);olympe.C.$k=new Map;olympe.C.$k.set('',olympe.C.Ta.EMPTY);olympe.C.$k.set(' ',olympe.C.Ta.uw);olympe.C.createNode=function(a,b,c,d,e,f,g,h){return new olympe.C.Node({valueType:a,Lc:b,Yf:c,Ln:d,debug:g,qg:e,ad:f,rj:h})};olympe.C.Vf=function(a){return a instanceof olympe.C.Node};
409
- olympe.C.Xd=function(a,b,c){a=olympe.C.createNode(a,void 0,void 0,void 0,void 0,c);olympe.C.Vf(b)?dc(a,b):olympe.C.hb(b)?dc(a,b.Ca):L(a,b);return M(a)};olympe.C.hb=function(a){return!(!a||!a.gh)};olympe.C.pf=function(a){return!(!a||!(a instanceof olympe.C.Node||a.gh))};olympe.C.Pn=function(a){return a instanceof olympe.C.Wb||a instanceof olympe.C.Dr||a instanceof olympe.C.Node};olympe.C.th=function(a){return a instanceof olympe.C.lk};
410
- olympe.C.Rn=function(a,b){if(void 0!==a){olympe.C.th(a)&&(a=a.tb().Ca);if(!olympe.C.pf(a))return b(a);var c=[];olympe.C.hb(a)?c.push(a.Ca):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.hb(a)?c=a.Ca.Fb:olympe.C.Vf(a)?c=a.Fb:olympe.C.th(a)&&(c=a.tb().Ca.Fb);return void 0===c?b:c};
411
- olympe.C.xh=function(a,b){let c;olympe.C.hb(a)?c=a.Ca:olympe.C.Vf(a)?c=a:olympe.C.th(a)&&(c=a.tb().Ca);c&&olympe.C.Vc([b],d=>{c.xh(d)},'setDefaultValue');return a};olympe.C.Bi=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.rs?(h=h.Ca,g.push(k)):h instanceof olympe.C.Node?g.push(k):olympe.C.th(h)&&(h=h.tb().Ca,g.push(k))),f[k]=h;return olympe.C.createNode(c,b,null,f,g,d||'syncNodes')};
412
- olympe.C.ye=function(a,b,c,d){return M(olympe.C.Bi(a,b,c,d||'syncProxies'))};const uc=a=>{for(const b of a)if(olympe.C.pf(b)||olympe.C.th(b))return!1;return!0};olympe.C.ua=function(a,b,c,d,e){if(uc(a))return b(...a);const f=olympe.C.Bi(a,b,c,d||'TransformFlows');e&&olympe.C.Vc([e],g=>{f.xh(g)},'setDefaultValue');return M(f)};olympe.C.Vc=function(a,b,c){uc(a)?b(...a):olympe.C.Bi(a,b,void 0,c||'processFlows')};
413
- olympe.C.QE=function(a,b,c){const d=olympe.C.Vf(a)?a.Nb():olympe.C.th(a)?a.tb().ei:a.ei,e=olympe.C.cc(d,c),f=olympe.V.Promise.vj(g=>{e.getContext().gb()||e.update(g)},b);olympe.C.Vc([a],g=>f(g).then());return e.tb()};olympe.C.jt=function(a,b){if(uc(a))b(...a);else{const c=olympe.C.Ya();olympe.C.Bi(a,(...d)=>{olympe.C.Ya().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
414
- olympe.C.Sn=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.hb(g)?(g=g.Ca,f.push(h)):g instanceof olympe.C.Node?f.push(h):olympe.C.th(g)&&(g=g.tb().Ca,f.push(h))),e[h]=g;0!==f.length&&new olympe.C.Node({Lc:b,Ln:e,qg:f,Tz:!1,ad:c})};olympe.C.kt=function(a,b){const c=olympe.C.Ya();olympe.C.Sn(a,(...d)=>{olympe.C.Ya().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.C.OE=function(a,b,c){a=new olympe.C.lk(a,c);b(a);return a.tb()};
415
- olympe.C.cc=function(a,b='flowSource'){return new olympe.C.lk(a,b)};olympe.C.wF=function(a,b,c,d){const e=olympe.C.Ya();olympe.C.Bi(a,(...f)=>{olympe.C.Ya().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.C.Hj=function(a,b,c){olympe.C.ua([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.C.aF=function(a,b,c='from observable'){const d=olympe.C.cc(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.tb()};
416
- olympe.C.YE=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.C.AF=function(a){return olympe.C.Ya().tc(a)};olympe.C.VE=function(a,b,c){olympe.C.Mx(a?a.Ca:a,b,c)};
392
+ m.vh.K=new olympe.C.J(()=>olympe.C.Zb,[0]);m.xz.K=olympe.C.J.R;m.Kx.K=olympe.C.J.R;m.zz.K=olympe.C.J.R;m.Lx.K=new olympe.C.J(()=>olympe.C.aa,[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.gx.K=olympe.C.J.R;m.hx.K=olympe.C.J.R;m.Wc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Fa.K=olympe.C.J.j;olympe.C.Jg=class{constructor(){}Nb(){}Rd(){}get(){}ri(){}has(){}sh(){}Ic(){}Sf(){}Cf(){}xg(){}forEach(){}pe(){}};olympe.C.Jg.prototype.forEachCurrentValue=olympe.C.Jg.prototype.pe;olympe.C.Jg.prototype.forEach=olympe.C.Jg.prototype.forEach;m=olympe.C.Jg.prototype;m.has.K=olympe.C.J.N;m.sh.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>Object,[]);m.Sf.K=new olympe.C.J(()=>String,[]);m.Cf.K=olympe.C.J.F;m.xg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.pe.K=olympe.C.J.j;olympe.C.vd=class extends olympe.C.Jg{Id(){}Rf(){}nf(){}Qf(){}qe(){}mf(){}wj(){}ti(){}};olympe.C.vd.prototype.getCurrentAt=olympe.C.vd.prototype.mf;olympe.C.vd.prototype.getAt=olympe.C.vd.prototype.qe;olympe.C.vd.prototype.getCurrentKeyAt=olympe.C.vd.prototype.Qf;olympe.C.vd.prototype.getKeyAt=olympe.C.vd.prototype.nf;olympe.C.vd.prototype.getCurrentRank=olympe.C.vd.prototype.Rf;olympe.C.vd.prototype.getRank=olympe.C.vd.prototype.Id;m=olympe.C.vd.prototype;m.Id.K=olympe.C.J.F;m.Rf.K=olympe.C.J.j;
393
+ m.nf.K=new olympe.C.J(()=>String,[]);m.Qf.K=olympe.C.J.j;m.qe.K=new olympe.C.J(()=>Object,[]);m.mf.K=olympe.C.J.j;m.wj.K=olympe.C.J.j;m.ti.K=new olympe.C.J(()=>Array,[]);olympe.C.Ci=class{constructor(a,b){this.H=b||olympe.C.$a();this.valueType=a||Object;this.values={};this.Wa=this.ja=null;this.Pe=0;this.R=Object.create(null);this.mb=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}Nb(){return this.valueType}Rd(a){this.valueType=a;const b=this.ja;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
394
+ c)&&hc(b[c],a)}get(a){const b=c=>{null===this.ja&&(this.ja={});return this.Bj(this.ja,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.C.ua([a],c=>b(c),this.valueType)}ri(a){a=this.values[a];return olympe.C.hb(a)?Tb(a.Ca)?a.Ca.Fb: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.da.D:olympe.C.da.j,olympe.C.da,'Map.has('+c+')')};return olympe.C.ua([a],c=>b(c),olympe.C.da)}sh(a){return a in this.values}Bj(a,b,c,d,e){let f=a[b];
395
+ f||this.H.run(()=>{f=olympe.C.Xd(d,void 0,e);a[b]=f;f.Ca.onDestroy(()=>delete a[b]);olympe.C.hb(c)?kc(f,c):ic(f,c)});return f}Ic(){throw Error('Abstract method getFirstKey needs to be overridden');}Sf(){throw Error('Abstract method getFirstKey needs to be overridden');}Cf(){null===this.F&&this.H.run(()=>{this.F=olympe.C.Xd(olympe.C.aa,olympe.C.ra(this.size));this.F.Ca.onDestroy(()=>{this.F=null})});return this.F}xg(){return this.size}forEach(a,b){const c=this.fn();a=this.us(c,a,b);this.en(c,a)}fn(){return String(++this.Pe)}en(a,
396
+ b){this.mb[a]=b;olympe.C.$a().Yd(()=>{const c=this.R;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.mb[a]});this.pe(b)}us(a,b,c){const d=olympe.C.$a();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.jn(a,f,g)})}}jn(a,b,c){void 0===this.R[b]&&(this.R[b]={});this.R[b][a]=c}pe(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
397
+ 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.ja;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.C.Proxy?kc(c[a],b):ic(c[a],b));c=this.Wa;null!==c&&void 0!==c[a]&&lc(c[a],!0);this.size++;c=this.mb;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.gh?d.Ca.Fb:d;var e=this.ja;null!==e&&void 0!==e[a]&&jc(e[a]);e=this.Wa;null!==e&&void 0!==
398
+ e[a]&&lc(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&&lc(this.F,this.size)}gi(){var a=this.ja;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&jc(a[c]);a=this.Wa;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&lc(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,
399
+ 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&&lc(this.F,this.size)}Mg(){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.za=[olympe.C.Jg];m=olympe.C.Ci.prototype;m.getContext.K=olympe.C.J.j;m.Nb.K=olympe.C.J.j;m.Rd.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>Object,[],'valueType');m.ri.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.sh.K=olympe.C.J.j;m.Bj.K=olympe.C.J.j;
400
+ m.Cf.K=olympe.C.J.F;m.xg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.fn.K=olympe.C.J.j;m.en.K=olympe.C.J.j;m.us.K=olympe.C.J.j;m.jn.K=olympe.C.J.j;m.pe.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.gi.K=olympe.C.J.j;m.Mg.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.ea=this.ta=this.Ha=this.$=null}Rd(a){super.Rd(a);if(null!==this.ea)for(let b of this.ea.values())hc(b,a)}Ic(){return this.qe(0)}Sf(){return this.nf(0)}Id(a){const b=c=>{null===this.Ha&&(this.Ha=Object.create(null));let d=this.Rf(a);d=void 0!==d?olympe.C.ra(d):void 0;return this.Bj(this.Ha,c,d,olympe.C.aa,`List.getRank(${c})`)};return olympe.C.hb(a)?M(olympe.C.createNode(olympe.C.aa,b,null,[a.Ca],
401
+ [0],'onResolved('+(b.name||'')+')')):b(a)}Rf(a){return this.D[a]}nf(a){const b=c=>{const d=c.valueOf(),e=this.Qf(d);null===this.ta&&(this.ta=Object.create(null));return this.Bj(this.ta,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.C.ua([a],c=>b(c),String)}Qf(a){return this.j[a.valueOf()]}qe(a){if(olympe.C.hb(a))return this.get(olympe.C.ua([a],c=>{c=this.nf(c);if(!Tb(c.Ca)){const d=olympe.C.$a();olympe.C.Vf(d)&&cc(d)}return c},String));null===this.ea&&(this.ea=new Map);let b=this.ea.get(a);
402
+ b||this.H.run(()=>{b=this.get(this.nf(a));this.ea.set(a,b);b.Ca.onDestroy(()=>this.ea.delete(a))});return b}mf(a){return this.ri(this.Qf(a))}wj(a,b,c,d){let e=this.fn();a=this.ft(e,a,b,c,d);this.en(e,a)}ft(a,b,c,d,e){return olympe.C.$a().tc((f,g)=>{let h=!1,k=olympe.C.Ai([b,c,this.Id(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.jn(a,g,k)})}ti(){null===this.$&&this.H.run(()=>{this.$=olympe.C.Xd(Array,this.j.filter(a=>void 0!==a));this.$.Ca.onDestroy(()=>
403
+ {this.F=null})});return this.$}pe(a){if(this.j.length!==this.size)super.pe(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}}hn(a,b){const c=this.Ha,d=this.ta,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]&&jc(c[g]),void 0!==c[a]&&ic(c[a],olympe.C.ra(f)));
404
+ null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&jc(d[e]),void 0!==d[b]&&ic(d[b],a))}}gn(a){var b=this.ta,c=this.D[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ca.Fb===a&&jc(b));delete this.D[a];this.j.splice(c,1);c=this.Ha;null!==c&&void 0!==c[a]&&jc(c[a])}vs(){if(null!==this.$){const a=this.j,b=this.$.Ca.Fb;b&&a.join(',')!==b.join(',')&&ic(this.$,a)}}Nf(){this.vs();super.Nf()}gi(){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)jc(a[b]);a=this.ta;
405
+ if(null!==a)for(b in a)jc(a[parseInt(b,10)]);var b=this.$;null!==b&&(ac(b.Ca),ic(b,this.j));return olympe.C.Ci.prototype.gi.call(this)}Mg(){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.za=[olympe.C.vd];m=olympe.C.Tj.prototype;m.Rd.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>Object,[]);m.Sf.K=new olympe.C.J(()=>String,[]);m.Id.K=olympe.C.J.F;m.Rf.K=olympe.C.J.j;m.nf.K=new olympe.C.J(()=>String,[]);
406
+ m.Qf.K=olympe.C.J.j;m.qe.K=new olympe.C.J(()=>Object,[]);m.mf.K=olympe.C.J.j;m.wj.K=new olympe.C.J(()=>{},[]);m.ft.K=olympe.C.J.j;m.ti.K=new olympe.C.J(()=>Array,[]);m.pe.K=olympe.C.J.j;m.hn.K=olympe.C.J.j;m.gn.K=olympe.C.J.j;m.vs.K=olympe.C.J.j;m.Nf.K=olympe.C.J.j;m.gi.K=olympe.C.J.j;m.Mg.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}Rd(a){a===olympe.C.Proxy&&(a=Object);null!==this.D&&hc(this.D,a);super.Rd(a)}Ic(){null===this.D&&this.vn();return this.D}Sf(){null===this.j&&this.vn();return this.j}vn(){this.getContext().run(()=>{this.D=olympe.C.Xd(this.Nb());this.j=olympe.C.Xd(String);this.Nj(this.yn())})}yn(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}Nj(a){if(void 0!==
407
+ a){const b=this.values[a];b&&b instanceof olympe.C.Proxy?kc(this.D,b):ic(this.D,b);ic(this.j,a)}else void 0!==this.D.Ca.Fb&&(jc(this.D),jc(this.j))}set(a,b){this.al(a,b);1===this.size&&null!==this.j&&this.Nj(a);this.Nf()}remove(a){const b=this.pj(a);null!==this.j&&this.j.Ca.Fb===a&&this.Nj(this.yn());return b}clear(){this.gi();null!==this.j&&this.Nj()}};m=olympe.C.Map.prototype;m.Rd.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>Object,[]);m.Sf.K=new olympe.C.J(()=>String,[]);m.vn.K=olympe.C.J.j;
408
+ m.yn.K=olympe.C.J.j;m.Nj.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.Pg=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.hn(a,d)});this.Nf()}remove(a){this.gn(a);return this.pj(a)}clear(){this.gi()}};olympe.C.Pg.prototype.remove.K=olympe.C.J.j;olympe.C.Pg.prototype.clear.K=olympe.C.J.j;olympe.C.Gt=class extends olympe.C.lk{constructor(a,b){super(olympe.C.aa,'animatedFlowSource');this.duration=a;this.j=b||olympe.C.aa.kp.rq}tb(){return olympe.C.Bz(this.node,this.duration,this.j,void 0)}};let tc=null;olympe.C.G=void 0;olympe.C.Un=void 0;olympe.C.li=void 0;olympe.C.fi=new Map;olympe.C.fi.set(0,olympe.C.aa.ZERO);olympe.C.fi.set(1,olympe.C.aa.ONE);olympe.C.fi.set(2,olympe.C.aa.Jw);olympe.C.$k=new Map;olympe.C.$k.set('',olympe.C.Ta.EMPTY);olympe.C.$k.set(' ',olympe.C.Ta.uw);olympe.C.createNode=function(a,b,c,d,e,f,g,h){return new olympe.C.Node({valueType:a,Lc:b,Yf:c,Ln:d,debug:g,rg:e,ad:f,qj:h})};olympe.C.Vf=function(a){return a instanceof olympe.C.Node};
409
+ olympe.C.Xd=function(a,b,c){a=olympe.C.createNode(a,void 0,void 0,void 0,void 0,c);olympe.C.Vf(b)?dc(a,b):olympe.C.hb(b)?dc(a,b.Ca):L(a,b);return M(a)};olympe.C.hb=function(a){return!(!a||!a.gh)};olympe.C.qf=function(a){return!(!a||!(a instanceof olympe.C.Node||a.gh))};olympe.C.Pn=function(a){return a instanceof olympe.C.Wb||a instanceof olympe.C.Dr||a instanceof olympe.C.Node};olympe.C.th=function(a){return a instanceof olympe.C.lk};
410
+ olympe.C.Rn=function(a,b){if(void 0!==a){olympe.C.th(a)&&(a=a.tb().Ca);if(!olympe.C.qf(a))return b(a);var c=[];olympe.C.hb(a)?c.push(a.Ca):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.hb(a)?c=a.Ca.Fb:olympe.C.Vf(a)?c=a.Fb:olympe.C.th(a)&&(c=a.tb().Ca.Fb);return void 0===c?b:c};
411
+ olympe.C.xh=function(a,b){let c;olympe.C.hb(a)?c=a.Ca:olympe.C.Vf(a)?c=a:olympe.C.th(a)&&(c=a.tb().Ca);c&&olympe.C.Vc([b],d=>{c.xh(d)},'setDefaultValue');return a};olympe.C.Ai=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.rs?(h=h.Ca,g.push(k)):h instanceof olympe.C.Node?g.push(k):olympe.C.th(h)&&(h=h.tb().Ca,g.push(k))),f[k]=h;return olympe.C.createNode(c,b,null,f,g,d||'syncNodes')};
412
+ olympe.C.ye=function(a,b,c,d){return M(olympe.C.Ai(a,b,c,d||'syncProxies'))};const uc=a=>{for(const b of a)if(olympe.C.qf(b)||olympe.C.th(b))return!1;return!0};olympe.C.ua=function(a,b,c,d,e){if(uc(a))return b(...a);const f=olympe.C.Ai(a,b,c,d||'TransformFlows');e&&olympe.C.Vc([e],g=>{f.xh(g)},'setDefaultValue');return M(f)};olympe.C.Vc=function(a,b,c){uc(a)?b(...a):olympe.C.Ai(a,b,void 0,c||'processFlows')};
413
+ olympe.C.QE=function(a,b,c){const d=olympe.C.Vf(a)?a.Nb():olympe.C.th(a)?a.tb().ei:a.ei,e=olympe.C.cc(d,c),f=olympe.V.Promise.uj(g=>{e.getContext().gb()||e.update(g)},b);olympe.C.Vc([a],g=>f(g).then());return e.tb()};olympe.C.jt=function(a,b){if(uc(a))b(...a);else{const c=olympe.C.$a();olympe.C.Ai(a,(...d)=>{olympe.C.$a().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
414
+ olympe.C.Sn=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.hb(g)?(g=g.Ca,f.push(h)):g instanceof olympe.C.Node?f.push(h):olympe.C.th(g)&&(g=g.tb().Ca,f.push(h))),e[h]=g;0!==f.length&&new olympe.C.Node({Lc:b,Ln:e,rg:f,Tz:!1,ad:c})};olympe.C.kt=function(a,b){const c=olympe.C.$a();olympe.C.Sn(a,(...d)=>{olympe.C.$a().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.C.OE=function(a,b,c){a=new olympe.C.lk(a,c);b(a);return a.tb()};
415
+ olympe.C.cc=function(a,b='flowSource'){return new olympe.C.lk(a,b)};olympe.C.wF=function(a,b,c,d){const e=olympe.C.$a();olympe.C.Ai(a,(...f)=>{olympe.C.$a().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.C.Gj=function(a,b,c){olympe.C.ua([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.C.aF=function(a,b,c='from observable'){const d=olympe.C.cc(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.tb()};
416
+ olympe.C.YE=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.C.AF=function(a){return olympe.C.$a().tc(a)};olympe.C.VE=function(a,b,c){olympe.C.Mx(a?a.Ca:a,b,c)};
417
417
  olympe.C.Mx=function(a,b,c){if(a){var d=a.T();null===tc&&(tc={});if(tc[d])olympe.C.G.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{tc[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}`:
418
- ''))});c.onDestroy(()=>{delete tc[d]})}}else olympe.C.G.log('NOT starting node dump, node is '+String(a))};olympe.C.UE=function(){let a='',b=olympe.C.Ya();for(;null!==b;)a+=b.Dn()+' --\x3e ',b=b.getParent();olympe.C.G.log(a)};
418
+ ''))});c.onDestroy(()=>{delete tc[d]})}}else olympe.C.G.log('NOT starting node dump, node is '+String(a))};olympe.C.UE=function(){let a='',b=olympe.C.$a();for(;null!==b;)a+=b.Dn()+' --\x3e ',b=b.getParent();olympe.C.G.log(a)};
419
419
  olympe.C.ra=function(a){if(void 0===a)return olympe.C.aa.ZERO;if(a instanceof olympe.C.aa)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.C.aa.yq;if(a===Math.PI)return olympe.C.aa.PI;if(Infinity===a)return olympe.C.aa.Cu;if(-Infinity===a)return olympe.C.aa.zv;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.C.fi.has(a)||olympe.C.fi.set(a,new olympe.C.aa(a)),olympe.C.fi.get(a)):new olympe.C.aa(a)}return null};
420
- olympe.C.ge=function(a){return void 0===a?olympe.C.Xd(olympe.C.aa):olympe.C.Xd(olympe.C.aa,olympe.C.pf(a)?a:olympe.C.ra(a))};olympe.C.Bz=olympe.C.aa.animate;olympe.C.lF=function(a,b){return new olympe.C.Gt(a,b)};olympe.C.xb=function(a){if(a instanceof olympe.C.Ta)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.Ta(a)};
421
- olympe.C.qF=function(a){return void 0===a?olympe.C.Xd(olympe.C.Ta):olympe.C.Xd(olympe.C.Ta,olympe.C.pf(a)?a:olympe.C.xb(a))};olympe.C.Sb=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.nF=function(a){return void 0===a?olympe.C.Xd(olympe.C.da):olympe.C.Xd(olympe.C.da,olympe.C.pf(a)?a:olympe.C.Sb(a))};olympe.C.mF=function(a){if(a instanceof Date)return new olympe.C.eb(a)};
420
+ olympe.C.ge=function(a){return void 0===a?olympe.C.Xd(olympe.C.aa):olympe.C.Xd(olympe.C.aa,olympe.C.qf(a)?a:olympe.C.ra(a))};olympe.C.Bz=olympe.C.aa.animate;olympe.C.lF=function(a,b){return new olympe.C.Gt(a,b)};olympe.C.xb=function(a){if(a instanceof olympe.C.Ta)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.Ta(a)};
421
+ olympe.C.qF=function(a){return void 0===a?olympe.C.Xd(olympe.C.Ta):olympe.C.Xd(olympe.C.Ta,olympe.C.qf(a)?a:olympe.C.xb(a))};olympe.C.Sb=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.nF=function(a){return void 0===a?olympe.C.Xd(olympe.C.da):olympe.C.Xd(olympe.C.da,olympe.C.qf(a)?a:olympe.C.Sb(a))};olympe.C.mF=function(a){if(a instanceof Date)return new olympe.C.eb(a)};
422
422
  olympe.C.pF=function(a){return olympe.C.Xd(olympe.C.eb,void 0!==a?new olympe.C.eb(a):null)};olympe.C.$s=a=>a instanceof olympe.C.da||a instanceof olympe.C.aa||a instanceof olympe.C.Ta||a instanceof olympe.C.eb;olympe.C.rF=function(a,b){return olympe.C.Xd(olympe.C.Zb,void 0===a&&void 0===b?void 0:new olympe.C.Zb(a,b))};olympe.C.Nz=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.Xd(olympe.C.Color,e)};olympe.C.oF=olympe.C.Nz;
423
- olympe.C.Dx=function(a){olympe.C.G=a;olympe.C.li=olympe.C.lh()};olympe.C.lh=function(){olympe.C.Un||(olympe.C.Un=new olympe.C.Dr);return olympe.C.Un};olympe.C.Ya=function(){olympe.C.li||(olympe.C.li=olympe.C.lh());return olympe.C.li};olympe.C.st=function(a){const b=olympe.C.li;olympe.C.Pn(a)&&(olympe.C.li=a);return null!=b?b:null};
423
+ olympe.C.Dx=function(a){olympe.C.G=a;olympe.C.li=olympe.C.lh()};olympe.C.lh=function(){olympe.C.Un||(olympe.C.Un=new olympe.C.Dr);return olympe.C.Un};olympe.C.$a=function(){olympe.C.li||(olympe.C.li=olympe.C.lh());return olympe.C.li};olympe.C.st=function(a){const b=olympe.C.li;olympe.C.Pn(a)&&(olympe.C.li=a);return null!=b?b:null};
424
424
  olympe.C.Qb=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.C.eb.Qb(a);break;case 'number':b=olympe.C.aa.Qb(a);break;case 'string':b=olympe.C.Ta.Qb(a);break;case 'vector2':b=olympe.C.Zb.Qb(a);break;case 'color':b=olympe.C.Color.Qb(a);break;case 'boolean':b=olympe.C.da.Qb(a)}return b}return null};function vc(a){a.j.gb()||(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)}
425
425
  olympe.C.lD=class{constructor(){this.j=new olympe.C.Wb('Slot Manager context');this.F=new Map;this.j.run(()=>{this.D=olympe.C.cc(wc,'Last slot manager entry');this.size=mc(olympe.C.cc(olympe.C.aa,'SlotManager size').repeat(this.D.tb().En()),olympe.C.aa.ZERO);this.N=mc(olympe.C.cc(olympe.C.aa,'last valid slots'),olympe.C.ra(-1))});this.R=[];this.H=[];this.j.onDestroy(()=>{vc(this)})}};
426
426
  class wc{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=mc(olympe.C.cc(olympe.C.aa),olympe.C.aa.ZERO);olympe.C.hb(b)?e.repeat(b):e.update(b);this.j=olympe.C.cc(olympe.C.aa);this.F=this.j.tb().he(e.tb())});this.next=null}T(){return this.id}Wy(){return this.j.tb()}En(){return this.F}Id(){return this.H}fz(){return this.N}oA(a){this.H=a}bA(a){null===a?this.j.update(olympe.C.aa.ZERO):(this.j.repeat(a.En()),a.next=this)}Pu(){this.j.clear();
427
- this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=wc.prototype;m.T.K=olympe.C.J.j;m.Wy.K=new olympe.C.J(()=>olympe.C.aa);m.En.K=new olympe.C.J(()=>olympe.C.aa);m.Id.K=olympe.C.J.j;m.fz.K=olympe.C.J.j;m.oA.K=olympe.C.J.j;m.bA.K=olympe.C.J.j;m.Pu.K=olympe.C.J.j;m.destroy.K=olympe.C.J.j;olympe.C.P={Da:'df.Logger'};olympe.W.config(a=>{E(a,olympe.C.U.zq,Number.POSITIVE_INFINITY);D(a,olympe.C.P.Da,[olympe.ia.P.Ea],b=>b.cd('df'))},'olympe.df');olympe.W.run([olympe.C.P.Da],a=>{olympe.C.Dx(a)},'olympe.df');olympe.host={};const xc=new Map,yc=new Map;olympe.host.Gq=class{static register(a,b,...c){xc.set(a,b);0<c.length&&yc.set(a,c)}static create(a,b,c,d){const e=xc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=yc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Sa(d,f))):new e(b,c)}};function zc(a,b,c){a.G.debug('CREATE #',b,', type=',c);a.j.set(b,olympe.host.Gq.create(c,b,a.G,a.H))}function Ac(a,b,c,...d){const e=a.j.get(b);if(void 0!==e){a.G.H()<=olympe.ia.yb.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.hb(f))b.push(a.j.get(f.Yw)||null);else if('function'===typeof f){const g=f,h=olympe.C.Ya();b.push((...k)=>{h.gb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
427
+ this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=wc.prototype;m.T.K=olympe.C.J.j;m.Wy.K=new olympe.C.J(()=>olympe.C.aa);m.En.K=new olympe.C.J(()=>olympe.C.aa);m.Id.K=olympe.C.J.j;m.fz.K=olympe.C.J.j;m.oA.K=olympe.C.J.j;m.bA.K=olympe.C.J.j;m.Pu.K=olympe.C.J.j;m.destroy.K=olympe.C.J.j;olympe.C.P={Da:'df.Logger'};olympe.W.config(a=>{E(a,olympe.C.U.zq,Number.POSITIVE_INFINITY);D(a,olympe.C.P.Da,[olympe.ia.P.Ea],b=>b.cd('df'))},'olympe.df');olympe.W.run([olympe.C.P.Da],a=>{olympe.C.Dx(a)},'olympe.df');olympe.host={};const xc=new Map,yc=new Map;olympe.host.Gq=class{static register(a,b,...c){xc.set(a,b);0<c.length&&yc.set(a,c)}static create(a,b,c,d){const e=xc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=yc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Sa(d,f))):new e(b,c)}};function zc(a,b,c){a.G.debug('CREATE #',b,', type=',c);a.j.set(b,olympe.host.Gq.create(c,b,a.G,a.H))}function Ac(a,b,c,...d){const e=a.j.get(b);if(void 0!==e){a.G.H()<=olympe.ia.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.hb(f))b.push(a.j.get(f.Yw)||null);else if('function'===typeof f){const g=f,h=olympe.C.$a();b.push((...k)=>{h.gb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
428
428
  function Bc(a){var b=olympe.host.Oe.Fd,c=olympe.host.Oe.Fq.js;++a.F;const d=a.F;zc(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.hb(p)?(h.push(n),p=p.Ca):olympe.C.Vf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{Ac(this,d,k,...g)}):(f=olympe.C.createNode(void 0,(...n)=>{e.run(()=>
429
- {Ac(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.Yd(a.N.bind(a,d));a=M(e);a.Yw=d;L(e,a);return a}olympe.host.Ua=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')}Za(){return this.G}N(a){this.G.debug('DESTROY #',a);const b=this.j.get(a);this.j.delete(a);b.destroy()}};olympe.host.Td=class{constructor(a){this.j=a;this.D=olympe.C.Ya()}F(){return this.j}jd(){return this.j.Ca.jd()||this.D.jd()}gb(){return this.j.Ca.gb()}};olympe.host.Td.prototype.F.K=new olympe.C.J(()=>olympe.host.Oe.Td,[]);olympe.host.Uk=class{j(){}D(){}};olympe.host.wu=class{};function Cc(a,b){var c=olympe.host.Zf;const d=olympe.V.Kc(),e=new olympe.C.Wb('onTimeout context');c.j.Y(b,d,()=>{e.gb()||e.jd()||e.run(a);c.j.F(d)});return new olympe.host.Fd.D(c.j,d,e)}function Dc(a,b){var c=olympe.host.Zf;const d=olympe.V.Kc(),e=new olympe.C.Wb('onInterval context');c.j.R(b,d,()=>{e.gb()||e.jd()?c.j.D(d):e.run(a)})}olympe.host.Fd=class{constructor(a){this.j=Bc(a)}};olympe.host.Fd.j=class{constructor(a,b,c){this.Zf=a;this.id=b;this.j=null!=c?c:null}T(){return this.id}cancel(){}};
430
- olympe.host.Fd.H=class extends olympe.host.Fd.j{cancel(){this.Zf.N(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Fd.D=class extends olympe.host.Fd.j{cancel(){this.Zf.F(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Fd.F=class extends olympe.host.Fd.j{cancel(){this.Zf.D(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Je=class{j(a,b){return null!=b?b:''}ja(a,b){return null!=b?b:''}H(){}D(a,b){return null!=b?b:''}F(){}};olympe.host.Je.j={LIVENESS:'liveness',READINESS:'readiness',ALL:'all'};olympe.host.Oe={};olympe.host.Oe.Td=class{destroy(){}};olympe.host.Oe.Td.prototype.destroy=olympe.host.Oe.Td.prototype.destroy;olympe.host.Oe.Fq={wA:100,yA:101,xA:102,AA:103,zA:104,vA:105,cD:201,aD:202,YC:204,fD:205,XC:206,$C:207,dD:208,gD:209,hD:210,iD:211,ZC:212,eD:218,bD:219,jD:220,WC:221,VC:222,qD:300,rD:301,sD:302,wD:303,xD:304,yD:305,tD:310,uD:311,vD:312,wC:400,xC:401,yC:402,kC:450,dC:500,bC:501,gC:502,fC:503,cC:504,eC:505,RD:600,ID:601,MD:602,ED:603,FD:604,CD:605,HD:606,XD:607,PD:608,zD:609,DD:610,GD:611,OD:612,TD:613,AD:614,SD:615,ND:616,WD:617,JD:618,KD:619,LD:620,QD:630,BD:631,UD:632,VD:633,CE:700,fE:701,gE:702,
429
+ {Ac(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.Yd(a.N.bind(a,d));a=M(e);a.Yw=d;L(e,a);return a}olympe.host.Ua=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')}Ya(){return this.G}N(a){this.G.debug('DESTROY #',a);const b=this.j.get(a);this.j.delete(a);b.destroy()}};olympe.host.Td=class{constructor(a){this.j=a;this.D=olympe.C.$a()}F(){return this.j}jd(){return this.j.Ca.jd()||this.D.jd()}gb(){return this.j.Ca.gb()}};olympe.host.Td.prototype.F.K=new olympe.C.J(()=>olympe.host.Oe.Td,[]);olympe.host.Uk=class{j(){}D(){}};olympe.host.wu=class{};function Cc(a,b){var c=olympe.host.Zf;const d=olympe.V.Kc(),e=new olympe.C.Wb('onTimeout context');c.j.Y(b,d,()=>{e.gb()||e.jd()||e.run(a);c.j.F(d)});return new olympe.host.Fd.D(c.j,d,e)}function Dc(a,b){var c=olympe.host.Zf;const d=olympe.V.Kc(),e=new olympe.C.Wb('onInterval context');c.j.R(b,d,()=>{e.gb()||e.jd()?c.j.D(d):e.run(a)})}olympe.host.Fd=class{constructor(a){this.j=Bc(a)}};olympe.host.Fd.j=class{constructor(a,b,c){this.Zf=a;this.id=b;this.j=null!=c?c:null}T(){return this.id}cancel(){}};
430
+ olympe.host.Fd.H=class extends olympe.host.Fd.j{cancel(){this.Zf.N(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Fd.D=class extends olympe.host.Fd.j{cancel(){this.Zf.F(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Fd.F=class extends olympe.host.Fd.j{cancel(){this.Zf.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:''}ja(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.Td=class{destroy(){}};olympe.host.Oe.Td.prototype.destroy=olympe.host.Oe.Td.prototype.destroy;olympe.host.Oe.Fq={wA:100,yA:101,xA:102,AA:103,zA:104,vA:105,cD:201,aD:202,YC:204,fD:205,XC:206,$C:207,dD:208,gD:209,hD:210,iD:211,ZC:212,eD:218,bD:219,jD:220,WC:221,VC:222,qD:300,rD:301,sD:302,wD:303,xD:304,yD:305,tD:310,uD:311,vD:312,wC:400,xC:401,yC:402,kC:450,dC:500,bC:501,gC:502,fC:503,cC:504,eC:505,RD:600,ID:601,MD:602,ED:603,FD:604,CD:605,HD:606,XD:607,PD:608,zD:609,DD:610,GD:611,OD:612,TD:613,AD:614,SD:615,ND:616,WD:617,JD:618,KD:619,LD:620,QD:630,BD:631,UD:632,VD:633,CE:700,fE:701,gE:702,
431
431
  hE:703,jE:704,kE:705,lE:706,iE:707,nE:708,mE:709,oE:710,sE:711,AE:712,pE:713,qE:714,tE:715,uE:716,wE:717,xE:718,zE:719,vE:720,yE:721,BE:722,rE:723,DE:724,EE:725,js:800};olympe.host.Oe.Fd=class{N(){}Y(){}F(){}R(){}D(){}};olympe.host.P={Qk:'host.System',Op:'host.HistoryManager',Fr:'host.Scheduler',Da:'host.platform.Logger',Ea:'host.Manager',Ge:'host.ProcessManager'};olympe.host.U={Jk:'role',Pp:'host.currentHost',br:'host.processProbe',Lr:'host.gracefulShutdownTimeout'};olympe.host.Xg={Al:'active',Uh:'preview'};olympe.host.Zf=null;
432
432
  olympe.W.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';Va(a,olympe.host.U.Pp,d);b=olympe.host.Xg.Al;c=olympe.host.Xg.Uh;E(a,olympe.host.U.Jk,d.startsWith(`${c}.`)?c:b);Ya(a,olympe.host.P.Qk);Ya(a,olympe.host.P.Op);C(a,olympe.host.P.Ge,olympe.host.Je);D(a,olympe.host.P.Da,[olympe.ia.P.Ea],e=>e.cd('host'));C(a,olympe.host.P.Ea,olympe.host.Ua,olympe.host.P.Da,olympe.W.P.Fg);D(a,olympe.host.P.Fr,[olympe.host.P.Ea],
433
- e=>{null===olympe.host.Zf&&(olympe.host.Zf=new olympe.host.Fd(e));return olympe.host.Zf},!0)},'olympe.host');olympe.W.run([olympe.host.P.Fr],a=>a,'olympe.host.scheduler');olympe.W.run([olympe.host.P.Ea],a=>a,'olympe.host');olympe.W.run([olympe.host.P.Ge],a=>{olympe.host.ll=()=>a});olympe.error={};olympe.error.pd=class extends Error{constructor(a,b=olympe.error.mc.Wk){super(a);this.code=b}Bj(){return this.code}};olympe.error.mc={Wk:0,Pi:1,Dq:401,kk:403,$i:404,Dv:406,TIMEOUT:408,pw:503,Cq:530,Ql:600,Eq:1006};olympe.error.Vk=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.TIMEOUT)}};olympe.error.Zq=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.pw)}};olympe.error.uk=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Dq)}};olympe.error.Dm=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.$i)}};
434
- olympe.error.Mq=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Pi)}};olympe.error.Lq=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Dv)}};olympe.error.nC=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Cq)}};olympe.error.Tl=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Ql)}};olympe.error.jp=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Pi)}};
435
- olympe.error.Wq=class extends olympe.error.pd{constructor(){super('Working offline',olympe.error.mc.Pi)}};olympe.error.To=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Pi)}};olympe.error.Br=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Pi)}};olympe.error.Zm=class extends olympe.error.pd{constructor(a,b){super(a);this.id=b}T(){return this.id}};olympe.error.Qh=class extends olympe.error.Zm{};olympe.error.Go=class extends olympe.error.Zm{};
436
- olympe.error.Np=class extends olympe.error.Zm{};olympe.net={};olympe.net.wa={};olympe.net.wa.Sd={Th:'POST',GET:'GET',tu:'HEAD',cr:'PUT',Dc:'DELETE',Rq:'OPTIONS',zC:'PATCH'};olympe.net.wa.ResponseType={Xr:'text',JSON:'json',Hl:'blob',ai:'uint8array',ke:'stream'};olympe.net.wa.Headers={Ji:'content-type',LA:'content-length',so:'authorization',Ft:'access-control-allow-origin',Dt:'access-control-allow-headers',Et:'access-control-allow-methods',yp:'x-forwarded-host',zp:'x-forwarded-proto'};
437
- olympe.net.wa.Ul={NB:'text/html',JSON:'application/json',Xw:'application/zip',ke:'application/octet-stream'};olympe.net.wa.Ub={Lo:0,Rh:200,No:201,Rj:202,Fl:400,Mw:401,kk:403,$i:404,hC:405,hj:500,lw:503};function Ec(a){return a.host&&encodeURI(a.host)}function Fc(a){return encodeURI(a.path).replace(olympe.net.pj.j,(b,c)=>'%'+c)}olympe.net.pj=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.yh=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.yh=d)}j(){return`${(void 0===this.yh?443===this.port:this.yh)?'wss':'ws'}://${Ec(this)}:${this.port}/${Fc(this)}`}toString(){return`${Ec(this)}:${this.port}/${Fc(this)}`}};
438
- olympe.net.pj.j=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ea(){}$(){}Y(){}D(){}};function N(a,b,c,d){a=olympe.V.Oz(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Ti(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.yt&&(c=a.yt.split(':'),2===c.length&&(c=bb(olympe.V.jf(),`${c[0]}:${c[1]}`),Gc(b,{Authorization:`Basic ${c}`})));return b}function Hc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Ic(a,b){a.D=b;return a}function Gc(a,b){Object.assign(a.headers,b)}
439
- olympe.net.Ti=class extends olympe.net.pj{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=null!=e?e:olympe.net.wa.Sd.GET;this.query=h;this.headers={};this.body=f;this.D=null!=g?g:olympe.net.wa.ResponseType.Xr}Dj(){return this.headers}j(){let a=Hc(this);a=a?`?${a}`:'';if(!Ec(this))return`${Fc(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${(void 0===this.yh?443===this.port:this.yh)?'https':'http'}://${Ec(this)}${b}/${Fc(this)}${a}`}toString(){return this.j()}};
440
- olympe.net.Ti.Sd={Th:'POST',GET:'GET',tu:'HEAD',cr:'PUT',Dc:'DELETE',Rq:'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}Jc(){return this.status}Dj(){return this.headers}};function Jc(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.Ya(),e=d.onDestroy(()=>{var f=a.j;const g=f.j.get(c);f.j.delete(c);null==g||g()});return Kc(a.j,c,b).finally(()=>{d.Xf(e);a.j.j.delete(c)})}olympe.net.Ua=class{constructor(a){this.G=a;this.j=new olympe.net.we.xu(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(){}Wf(){}R(){}};function Lc(a){const b=olympe.net.AMQPClient.j.ze,c=olympe.net.AMQPClient.j.CONNECTING,d=olympe.net.AMQPClient.j.vc,e=olympe.net.AMQPClient.j.zb;nb(a.state,b,a.ja.bind(a),[c]);nb(a.state,c,()=>{a.G.debug('Connecting to the AMQP Client..');a.F=!0;F(a.state,b)},[d]);nb(a.state,d,(f,g)=>u(function*(){a.F=null!=g?g:a.F;a.F||a.D.clear();yield Mc(a);if(a.F&&!a.Y&&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.lt)?k:5E3)}}),
433
+ e=>{null===olympe.host.Zf&&(olympe.host.Zf=new olympe.host.Fd(e));return olympe.host.Zf},!0)},'olympe.host');olympe.W.run([olympe.host.P.Fr],a=>a,'olympe.host.scheduler');olympe.W.run([olympe.host.P.Ea],a=>a,'olympe.host');olympe.W.run([olympe.host.P.Ge],a=>{olympe.host.ll=()=>a});olympe.error={};olympe.error.pd=class extends Error{constructor(a,b=olympe.error.mc.Wk){super(a);this.code=b}Aj(){return this.code}};olympe.error.mc={Wk:0,Oi:1,Dq:401,kk:403,Zi:404,Dv:406,TIMEOUT:408,pw:503,Cq:530,Ql:600,Eq:1006};olympe.error.Vk=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.TIMEOUT)}};olympe.error.Zq=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.pw)}};olympe.error.uk=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Dq)}};olympe.error.Dm=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Zi)}};
434
+ olympe.error.Mq=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Oi)}};olympe.error.Lq=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Dv)}};olympe.error.nC=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Cq)}};olympe.error.Tl=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Ql)}};olympe.error.jp=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Oi)}};
435
+ olympe.error.Wq=class extends olympe.error.pd{constructor(){super('Working offline',olympe.error.mc.Oi)}};olympe.error.To=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Oi)}};olympe.error.Br=class extends olympe.error.pd{constructor(a){super(a,olympe.error.mc.Oi)}};olympe.error.Zm=class extends olympe.error.pd{constructor(a,b){super(a);this.id=b}T(){return this.id}};olympe.error.Qh=class extends olympe.error.Zm{};olympe.error.Go=class extends olympe.error.Zm{};
436
+ olympe.error.Np=class extends olympe.error.Zm{};olympe.net={};olympe.net.wa={};olympe.net.wa.Sd={Th:'POST',GET:'GET',tu:'HEAD',cr:'PUT',Dc:'DELETE',Rq:'OPTIONS',zC:'PATCH'};olympe.net.wa.ResponseType={Xr:'text',JSON:'json',Hl:'blob',ai:'uint8array',ke:'stream'};olympe.net.wa.Headers={Ii:'content-type',LA:'content-length',so:'authorization',Ft:'access-control-allow-origin',Dt:'access-control-allow-headers',Et:'access-control-allow-methods',yp:'x-forwarded-host',zp:'x-forwarded-proto'};
437
+ olympe.net.wa.Ul={NB:'text/html',JSON:'application/json',Xw:'application/zip',ke:'application/octet-stream'};olympe.net.wa.Ub={Lo:0,Rh:200,No:201,Rj:202,Fl:400,Mw:401,kk:403,Zi:404,hC:405,gj:500,lw:503};function Ec(a){return a.host&&encodeURI(a.host)}function Fc(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.yh=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.yh=d)}j(){return`${(void 0===this.yh?443===this.port:this.yh)?'wss':'ws'}://${Ec(this)}:${this.port}/${Fc(this)}`}toString(){return`${Ec(this)}:${this.port}/${Fc(this)}`}};
438
+ olympe.net.oj.j=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ea(){}$(){}Y(){}D(){}};function N(a,b,c,d){a=olympe.V.Oz(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.yt&&(c=a.yt.split(':'),2===c.length&&(c=bb(olympe.V.kf(),`${c[0]}:${c[1]}`),Gc(b,{Authorization:`Basic ${c}`})));return b}function Hc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Ic(a,b){a.D=b;return a}function Gc(a,b){Object.assign(a.headers,b)}
439
+ 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.wa.Sd.GET;this.query=h;this.headers={};this.body=f;this.D=null!=g?g:olympe.net.wa.ResponseType.Xr}Cj(){return this.headers}j(){let a=Hc(this);a=a?`?${a}`:'';if(!Ec(this))return`${Fc(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${(void 0===this.yh?443===this.port:this.yh)?'https':'http'}://${Ec(this)}${b}/${Fc(this)}${a}`}toString(){return this.j()}};
440
+ olympe.net.Si.Sd={Th:'POST',GET:'GET',tu:'HEAD',cr:'PUT',Dc:'DELETE',Rq:'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}Jc(){return this.status}Cj(){return this.headers}};function Jc(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.$a(),e=d.onDestroy(()=>{var f=a.j;const g=f.j.get(c);f.j.delete(c);null==g||g()});return Kc(a.j,c,b).finally(()=>{d.Xf(e);a.j.j.delete(c)})}olympe.net.Ua=class{constructor(a){this.G=a;this.j=new olympe.net.we.xu(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(){}Wf(){}R(){}};function Lc(a){const b=olympe.net.AMQPClient.j.ze,c=olympe.net.AMQPClient.j.CONNECTING,d=olympe.net.AMQPClient.j.vc,e=olympe.net.AMQPClient.j.zb;nb(a.state,b,a.ja.bind(a),[c]);nb(a.state,c,()=>{a.G.debug('Connecting to the AMQP Client..');a.F=!0;F(a.state,b)},[d]);nb(a.state,d,(f,g)=>u(function*(){a.F=null!=g?g:a.F;a.F||a.D.clear();yield Mc(a);if(a.F&&!a.Y&&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.lt)?k:5E3)}}),
441
441
  [b,c,e]);ob(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 Nc(a,b){lb(a.state,olympe.net.AMQPClient.j.ze,b)}function Oc(a,b){lb(a.state,olympe.net.AMQPClient.j.CONNECTING,b)}function Pc(a,b){lb(a.state,olympe.net.AMQPClient.j.vc,b)}
442
- function Mc(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.V.Promise.Bg(c.close(),500,'AMQPClient close timeout').catch(d=>{a.G.debug(`Error while closing client: ${d}`)}))})}function Qc(a){return null!==a.H&&!a.H.closed&&null!==a.j&&!a.j.closed&&a.F}function Rc(a,b){if(!Qc(a))throw new olympe.error.Tl(null!=b?b:'Not connected to the bus');}
442
+ function Mc(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.V.Promise.$f(c.close(),500,'AMQPClient close timeout').catch(d=>{a.G.debug(`Error while closing client: ${d}`)}))})}function Qc(a){return null!==a.H&&!a.H.closed&&null!==a.j&&!a.j.closed&&a.F}function Rc(a,b){if(!Qc(a))throw new olympe.error.Tl(null!=b?b:'Not connected to the bus');}
443
443
  function Sc(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)}
444
444
  function Tc(a,b,c,d){return u(function*(){try{yield Uc(a,b,c)}catch(e){if(e instanceof olympe.error.Lq)return a.G.debug(`Queue ${b} already exists with different parameters, deleting it..`),yield Vc(a,b),new Promise((f,g)=>setTimeout(()=>{a.G.debug(`Redeclare queue ${b} with new parameters..`);Tc(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.un)?void 0:f.cancel()}catch(e){}try{yield Wc(a,b,c,d)}catch(e){throw Error(`Fail to consume queue ${b}: ${e}`);
445
445
  }})}function Xc(a,b,c,d){return u(function*(){Rc(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]),un:null,Kn:d,exclusive:c});yield Tc(a,b,c,d);a.G.debug(`Subscribed queue: ${b}.`)})}
@@ -451,74 +451,74 @@ if(h===olympe.net.AMQPClient.D.Qm||h===olympe.net.AMQPClient.D.Wk)h=Math.round(5
451
451
  function Zc(a,{id:b,Kz: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})}
452
452
  function $c(a,b,c){return u(function*(){Rc(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 Zc(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()}})}
453
453
  function ad(a,b,c){return u(function*(){Rc(a,'Cannot unbind a queue without being connected to the bus');const d=yield Zc(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){}}})}
454
- olympe.net.AMQPClient=class{constructor(a,b){this.G=olympe.ia.Za('AMQP');this.Y=this.F=!1;this.N=null;this.name=b;this.j=this.H=null;this.state=new olympe.V.Aw(this.G);this.D=new Map;this.R=new Map;this.Ja=new olympe.V.promise.Tk;const c=olympe.V.Promise.vj(()=>{this.state.getState()===olympe.net.AMQPClient.j.vc?this.F&&F(this.state,olympe.net.AMQPClient.j.CONNECTING):F(this.state,olympe.net.AMQPClient.j.vc,this.F)},0);a.subscribe(d=>{this.G.j()&&this.G.debug('New AMQP configuration received',d);
454
+ olympe.net.AMQPClient=class{constructor(a,b){this.G=olympe.ia.Ya('AMQP');this.Y=this.F=!1;this.N=null;this.name=b;this.j=this.H=null;this.state=new olympe.V.Aw(this.G);this.D=new Map;this.R=new Map;this.ta=new olympe.V.promise.Tk;const c=olympe.V.Promise.uj(()=>{this.state.getState()===olympe.net.AMQPClient.j.vc?this.F&&F(this.state,olympe.net.AMQPClient.j.CONNECTING):F(this.state,olympe.net.AMQPClient.j.vc,this.F)},0);a.subscribe(d=>{this.G.j()&&this.G.debug('New AMQP configuration received',d);
455
455
  this.N=d;null!==d&&(this.Y=!1,c().then())});Lc(this)}connect(){const a=this;return u(function*(){if(Qc(a))return a;a.state.getState()===olympe.net.AMQPClient.j.vc&&F(a.state,olympe.net.AMQPClient.j.CONNECTING);yield mb(a.state,olympe.net.AMQPClient.j.ze);return a})}disconnect(){const a=this;return u(function*(){const b=olympe.net.AMQPClient.j.vc;a.state.getState()!==b&&(F(a.state,b,!1),yield mb(a.state,b))})}ld(a,b,c,d={mandatory:!1,xt:!1}){const e=this;return u(function*(){Rc(e,'Cannot publish a message without being connected to the bus');
456
- const f=JSON.stringify(c);e.G.j()&&e.G.debug(`AMQP > [${b}]: ${f}`);return(new Promise((g,h)=>{e.R.set(a,k=>h(new olympe.error.Mq(`Impossible to deliver message to topic "${b}": ${k}`)));e.j.basicPublish(d.xt?'amq.topic':'',b,f,{messageId:String(a)},d.mandatory).then(()=>g()).catch(k=>{k=Sc(k)===olympe.net.AMQPClient.D.Qm?new olympe.error.Dm(`Topic ${b} not deployed.`):Error(`Failed to publish a message ${f} to topic ${b}: ${k}`);h(k)})})).finally(()=>e.R.delete(a))})}ja(){const a=this;return u(function*(){if(null===
457
- a.N)throw Error('Cannot connect to the bus without a configuration');a.H=a.$(a.N,a.name);try{let b;yield olympe.V.Promise.nt(a.ta.bind(a),(null!=(b=a.N.lt)?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;}})}ta(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=olympe.error.mc.Ql;
458
- const f=olympe.error.mc.Eq,g=Sc(d);if(g===e||g===f){b.G.debug(`Connection closed by network: ${d}`);F(b.state,olympe.net.AMQPClient.j.vc,b.F);return}}else b.F=!1;e=b.state;F(e,e.j,d)};try{yield b.H.connect(),b.ea(b.H,d=>{b.G.debug(`AMQP connection closed ${d?'with error':'without error'}`);d||F(b.state,olympe.net.AMQPClient.j.vc,b.F)})}catch(d){if(d instanceof Error)switch(Sc(d)){case olympe.error.mc.Ql:case olympe.error.mc.Eq:throw new olympe.error.Tl(d);case olympe.error.mc.Cq:case olympe.error.mc.Dq:case olympe.error.mc.kk:throw b.Y=
456
+ 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.Mq(`Impossible to deliver message to topic "${b}": ${l}`)));const k={messageId:String(a)};e.push(()=>e.j.basicPublish(d.xt?'amq.topic':'',b,f,k,d.mandatory)).then(()=>g()).catch(l=>{l=Sc(l)===olympe.net.AMQPClient.D.Qm?new olympe.error.Dm(`Topic ${b} not deployed.`):Error(`Failed to publish a message ${f} to topic ${b}: ${l}`);h(l)})})).finally(()=>e.R.delete(a))})}ja(){const a=
457
+ this;return u(function*(){if(null===a.N)throw Error('Cannot connect to the bus without a configuration');a.H=a.$(a.N,a.name);try{let b;yield olympe.V.Promise.nt(a.Ha.bind(a),(null!=(b=a.N.lt)?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=
458
+ olympe.error.mc.Ql;const f=olympe.error.mc.Eq,g=Sc(d);if(g===e||g===f){b.G.debug(`Connection closed by network: ${d}`);F(b.state,olympe.net.AMQPClient.j.vc,b.F);return}}else b.F=!1;e=b.state;F(e,e.j,d)};try{yield b.H.connect(),b.ea(b.H,d=>{b.G.debug(`AMQP connection closed ${d?'with error':'without error'}`);d||F(b.state,olympe.net.AMQPClient.j.vc,b.F)})}catch(d){if(d instanceof Error)switch(Sc(d)){case olympe.error.mc.Ql:case olympe.error.mc.Eq:throw new olympe.error.Tl(d);case olympe.error.mc.Cq:case olympe.error.mc.Dq:case olympe.error.mc.kk:throw b.Y=
459
459
  !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 Zc(b,{id:1,Kz:e=>{b.G.debug(`Error with channel 0: ${e}`);b.j=null;e=Sc(e);e!==olympe.net.AMQPClient.D.Qm&&e!==olympe.net.AMQPClient.D.ar||olympe.V.Promise.nt(f=>{b.G.warn(`Trying to recreate channel after being closed, tentative ${f+1}..`);return c()},500).catch(f=>
460
- {var g=b.state;F(g,g.j,f)})}});yield b.j.confirmSelect();let d;yield b.j.prefetch(null!=(d=b.N.Vz)?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.kF,10)))||g(f)};b.D.forEach(({Kn:e,exclusive:f},g)=>{Tc(b,g,f,e)})});yield c()})}push(a){return wb(this.Ja,a)}$(){}ea(){}};olympe.net.AMQPClient.j={CONNECTING:'CONNECTING',ze:'CONNECTED',vc:'DISCONNECTED',zb:'ERROR'};
461
- olympe.net.AMQPClient.D={Wk:0,Qm:404,KC:405,ar:406,EA:504,cq:541};function bd(a){let b;return null!=(b=a.F)?b:{}}function cd(a){return!1===a.j.closed?a.j.basicNack(a.D,!1,void 0).catch(b=>{olympe.ia.Za('amqp').error(`Failed to reject message ${a.D}: ${b}`)}):Promise.resolve()}
462
- olympe.net.AMQPMessage=class{constructor(a,b,c){this.H=a.redelivered;this.D=a.deliveryTag;this.N=a.routingKey;this.R=b;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}`)}}xi(){return this.H}ack(){return!1===this.j.closed?this.j.basicAck(this.D,!1).catch(a=>{olympe.ia.Za('amqp').error(`Failed to ack message ${this.D}: ${a}`)}):Promise.resolve()}};olympe.net.di=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.di.ALL='*';olympe.net.yw=class{register(){return u(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.P={Ea:'net.Manager',Da:'net.Logger',oj:'net.WebServer',qw:'net.ServiceWorkerManager',Fm:'net.OfflineConfig'};olympe.net.U={Af:'net.httpPort',Sp:'net.httpBodyLimit',hs:'net.http2',Rp:'net.httpsCertificatesPath',xm:'net.localNetworkSuffix',cj:'offline.enabled',Em:'offline.autoBackOnline',Qq:'offline.downloadBatchSize'};
464
- olympe.W.config(function(a){E(a,olympe.net.U.Af,3141);E(a,olympe.net.U.Sp,100);E(a,olympe.net.U.hs,!1);E(a,olympe.net.U.Rp,null);E(a,olympe.net.U.xm,'frontend');E(a,olympe.net.U.cj,!1);E(a,olympe.net.U.Em,!1);E(a,olympe.net.U.Qq,20);Ya(a,olympe.net.P.Ea);D(a,olympe.net.P.Da,[olympe.ia.P.Ea],b=>b.cd('net'));C(a,olympe.net.P.oj,olympe.net.di,olympe.net.P.Da);C(a,olympe.net.P.qw,olympe.net.yw);D(a,olympe.net.P.Fm,[new olympe.W.pa(olympe.net.U.cj),new olympe.W.pa(olympe.net.U.Em)],(b,c)=>new Map([['offlineEnabled',
465
- b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Va.node.host={};olympe.Va.node.host.Td=function(a,b){this.G=b};olympe.Va.node.host.Td.prototype.constructor=olympe.Va.node.host.Td;olympe.Va.node.host.Td.prototype.destroy=function(){};olympe.Va.node.host.Td.prototype.destroy=olympe.Va.node.host.Td.prototype.destroy;olympe.Va.node.host.Td.prototype.Za=function(){return this.G};olympe.Va.node.host.Td.za=[olympe.host.Oe.Td];olympe.Va.node.host.Hq=class{constructor(a){this.G=a}};olympe.Va.node.host.Hq.za=[olympe.host.wu];olympe.Va.node.host.Fd=class{constructor(){this.j={};this.H={}}destroy(){}N(a){clearTimeout(this.j[a]);delete this.j[a]}Y(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.Gq.register(olympe.host.Oe.Fq.js,olympe.Va.node.host.Fd);olympe.Va.node.host.Fd.za=[olympe.host.Oe.Fd];olympe.Va.node.host.Uk=class{constructor(a){this.G=a}j(){return olympe.C.da.D}D(){return!0}};olympe.Va.node.host.Uk.za=[olympe.host.Uk];function dd(a){a.ea.D('readinessProbe','/readiness',[olympe.net.wa.Sd.GET],()=>fd(a,a.$)).catch(b=>a.G.error(`Failed to add readiness health check route ${b}`));a.ea.D('livenessProbe','/liveness',[olympe.net.wa.Sd.GET],()=>fd(a,a.Y)).catch(b=>a.G.error(`Failed to add liveness health check route ${b}`));a.j(()=>a.ea.stop())}
466
- function gd(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 hd(a){return u(function*(){try{const b=yield gd(a,a.N),c=yield gd(a,a.R);if(b||c)throw Error('Failed to gracefully close the backend');}finally{a.N.clear(),a.R.clear()}})}
467
- function fd(a,b){const c=olympe.net.wa.Ub.Rh,d=olympe.net.wa.Ub.hj;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.Va.node.host.Je=class extends olympe.host.Je{constructor(a,b,c,d=!0){super();this.G=a;this.ea=b;this.ta=c;this.Y=new Map;this.$=new Map;this.N=new Map;this.R=new Map;d&&dd(this)}D(a,b=olympe.V.Of(),c=olympe.host.Je.j.ALL){switch(c){case olympe.host.Je.j.LIVENESS:this.Y.set(b,a);break;case olympe.host.Je.j.READINESS:this.$.set(b,a);break;default:this.Y.set(b,a),this.$.set(b,a)}return b}F(a){this.$.delete(a);this.Y.delete(a)}j(a,b=olympe.V.Of(),c){this.N.set(b,this.Bg(b,a,null!=c?c:this.ta));
469
- return b}ja(a,b=olympe.V.Of()){this.R.set(b,this.Bg(b,a,this.ta));return b}H(a){this.N.has(a)?this.N.delete(a):this.R.delete(a)}Bg(a,b,c){return()=>olympe.V.Promise.Bg(b(),c,`Shutdown hook ${a} has timeout`)}};olympe.W.config(function(a){E(a,olympe.host.U.br,!0);E(a,olympe.host.U.Lr,1E4);Wa(a,olympe.host.P.Op,olympe.Va.node.host.Hq,olympe.host.P.Da);Wa(a,olympe.host.P.Qk,olympe.Va.node.host.Uk,olympe.host.P.Da);C(a,olympe.host.P.Ge,olympe.Va.node.host.Je,olympe.host.P.Da,olympe.net.P.oj,new olympe.W.pa(olympe.host.U.Lr),new olympe.W.pa(olympe.host.U.br))},'olympe.native.node.host');olympe.W.run([olympe.host.P.Ge],a=>{olympe.Va.node.host.ll=()=>a});olympe.net.we={};function Kc(a,b,c){const d=olympe.net.wa.Ub.Lo,e=olympe.net.wa.Ub.hj,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.Dj(),body:null!=(k=c.body)?k:void 0,signal:f.signal}).then(l=>l.ok?id(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'===
460
+ {var g=b.state;F(g,g.j,f)})}});yield b.j.confirmSelect();let d;yield b.j.prefetch(null!=(d=b.N.Vz)?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.kF,10)))||g(f)};b.D.forEach(({Kn:e,exclusive:f},g)=>{Tc(b,g,f,e)})});yield c()})}push(a){return wb(this.ta,a)}$(){}ea(){}};olympe.net.AMQPClient.j={CONNECTING:'CONNECTING',ze:'CONNECTED',vc:'DISCONNECTED',zb:'ERROR'};
461
+ olympe.net.AMQPClient.D={Wk:0,Qm:404,KC:405,ar:406,EA:504,cq:541};function bd(a){let b;return null!=(b=a.F)?b:{}}function cd(a){return!1===a.j.closed?a.j.basicNack(a.D,!1,void 0).catch(b=>{olympe.ia.Ya('amqp').error(`Failed to reject message ${a.D}: ${b}`)}):Promise.resolve()}
462
+ olympe.net.AMQPMessage=class{constructor(a,b,c){this.H=a.redelivered;this.D=a.deliveryTag;this.N=a.routingKey;this.R=b;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}`)}}xi(){return this.H}ack(){return!1===this.j.closed?this.j.basicAck(this.D,!1).catch(a=>{olympe.ia.Ya('amqp').error(`Failed to ack message ${this.D}: ${a}`)}):Promise.resolve()}};olympe.net.di=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.di.ALL='*';olympe.net.yw=class{register(){return u(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.P={Ea:'net.Manager',Da:'net.Logger',nj:'net.WebServer',qw:'net.ServiceWorkerManager',Fm:'net.OfflineConfig'};olympe.net.U={Bf:'net.httpPort',Sp:'net.httpBodyLimit',hs:'net.http2',Rp:'net.httpsCertificatesPath',xm:'net.localNetworkSuffix',bj:'offline.enabled',Em:'offline.autoBackOnline',Qq:'offline.downloadBatchSize'};
464
+ olympe.W.config(function(a){E(a,olympe.net.U.Bf,3141);E(a,olympe.net.U.Sp,100);E(a,olympe.net.U.hs,!1);E(a,olympe.net.U.Rp,null);E(a,olympe.net.U.xm,'frontend');E(a,olympe.net.U.bj,!1);E(a,olympe.net.U.Em,!1);E(a,olympe.net.U.Qq,20);Ya(a,olympe.net.P.Ea);D(a,olympe.net.P.Da,[olympe.ia.P.Ea],b=>b.cd('net'));C(a,olympe.net.P.nj,olympe.net.di,olympe.net.P.Da);C(a,olympe.net.P.qw,olympe.net.yw);D(a,olympe.net.P.Fm,[new olympe.W.pa(olympe.net.U.bj),new olympe.W.pa(olympe.net.U.Em)],(b,c)=>new Map([['offlineEnabled',
465
+ b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Va.node.host={};olympe.Va.node.host.Td=function(a,b){this.G=b};olympe.Va.node.host.Td.prototype.constructor=olympe.Va.node.host.Td;olympe.Va.node.host.Td.prototype.destroy=function(){};olympe.Va.node.host.Td.prototype.destroy=olympe.Va.node.host.Td.prototype.destroy;olympe.Va.node.host.Td.prototype.Ya=function(){return this.G};olympe.Va.node.host.Td.za=[olympe.host.Oe.Td];olympe.Va.node.host.Hq=class{constructor(a){this.G=a}};olympe.Va.node.host.Hq.za=[olympe.host.wu];olympe.Va.node.host.Fd=class{constructor(){this.j={};this.H={}}destroy(){}N(a){clearTimeout(this.j[a]);delete this.j[a]}Y(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.Gq.register(olympe.host.Oe.Fq.js,olympe.Va.node.host.Fd);olympe.Va.node.host.Fd.za=[olympe.host.Oe.Fd];olympe.Va.node.host.Uk=class{constructor(a){this.G=a}j(){return olympe.C.da.D}D(){return!0}};olympe.Va.node.host.Uk.za=[olympe.host.Uk];function dd(a){a.ta.D('readinessProbe','/readiness',[olympe.net.wa.Sd.GET],()=>fd(a,a.ea)).catch(b=>a.G.error(`Failed to add readiness health check route ${b}`));a.ta.D('livenessProbe','/liveness',[olympe.net.wa.Sd.GET],()=>fd(a,a.$)).catch(b=>a.G.error(`Failed to add liveness health check route ${b}`));a.H(()=>a.ta.stop())}
466
+ function gd(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 hd(a){return u(function*(){try{const b=yield gd(a,a.N),c=yield gd(a,a.R),d=yield gd(a,a.Y);if(b||c||d)throw Error('Failed to gracefully close the backend');}finally{a.N.clear(),a.R.clear(),a.Y.clear()}})}
467
+ function fd(a,b){const c=olympe.net.wa.Ub.Rh,d=olympe.net.wa.Ub.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.Va.node.host.Je=class extends olympe.host.Je{constructor(a,b,c,d=!0){super();this.G=a;this.ta=b;this.Wa=c;this.$=new Map;this.ea=new Map;this.R=new Map;this.N=new Map;this.Y=new Map;d&&dd(this)}j(a,b=olympe.V.jf(),c=olympe.host.Je.j.ALL){switch(c){case olympe.host.Je.j.LIVENESS:this.$.set(b,a);break;case olympe.host.Je.j.READINESS:this.ea.set(b,a);break;default:this.$.set(b,a),this.ea.set(b,a)}return b}D(a){this.ea.delete(a);this.$.delete(a)}H(a,b=olympe.V.jf()){this.R.set(b,this.$f(b,a,this.Wa));
469
+ return b}ja(a,b=olympe.V.jf(),c){this.N.set(b,this.$f(b,a,null!=c?c:this.Wa));return b}Ha(a,b=olympe.V.jf()){this.Y.set(b,this.$f(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.Y.delete(a)}$f(a,b,c){return()=>olympe.V.Promise.$f(b(),c,`Shutdown hook ${a} has timeout`)}};olympe.W.config(function(a){E(a,olympe.host.U.br,!0);E(a,olympe.host.U.Lr,1E4);Wa(a,olympe.host.P.Op,olympe.Va.node.host.Hq,olympe.host.P.Da);Wa(a,olympe.host.P.Qk,olympe.Va.node.host.Uk,olympe.host.P.Da);C(a,olympe.host.P.Ge,olympe.Va.node.host.Je,olympe.host.P.Da,olympe.net.P.nj,new olympe.W.pa(olympe.host.U.Lr),new olympe.W.pa(olympe.host.U.br))},'olympe.native.node.host');olympe.W.run([olympe.host.P.Ge],a=>{olympe.Va.node.host.ll=()=>a});olympe.net.we={};function Kc(a,b,c){const d=olympe.net.wa.Ub.Lo,e=olympe.net.wa.Ub.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?id(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
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
471
  function id(a,b){return u(function*(){switch(b){case olympe.net.wa.ResponseType.Hl:var c=yield a.blob();break;case olympe.net.wa.ResponseType.ai:c=yield a.arrayBuffer();c=new Uint8Array(c,0,c.byteLength);break;case olympe.net.wa.ResponseType.JSON:c=yield a.json();break;case olympe.net.wa.ResponseType.ke:c=a.body;break;default:c=yield a.text()}return new olympe.net.qd(c,a.status,a.statusText,a.headers)})}olympe.net.we.xu=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.ja(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));
472
472
  this.buffer.length=0});c.addEventListener('message',d=>{d='string'===typeof d.data?String(d.data):cb(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()||
473
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}`}`);
474
474
  this.j.close(1E3);return}}this.G.debug('Try to force close native websocket, but not open nor connecting')}ea(a){this.R=a||null}$(a){this.F=a||null}D(a){this.N=a||null}Y(a){this.H=a||null}ja(){}};olympe.net.we.WebSocket.za=[olympe.net.WebSocket];olympe.Va.node.net={};olympe.Va.node.net.Fv=class extends olympe.net.Ua{R(){return'NodeJS'}Wf(){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.Va.node.net.Hv(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.Gv(a,b)}};olympe.Va.node.net.Gv=class extends olympe.net.AMQPClient{$(a,b='olympe-node'){var c=a.host;const d=a.port,e=a.path,f=a.pA,g=a.bz;var h=URL,k=a.yh?'amqps':'amqp';var l=a.user;a=a.ed;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())}ea(a,b){a.socket.on('close',
475
- b)}};olympe.Va.node.net.Hv=class extends olympe.net.we.WebSocket{ja(a){return new (require('ws'))(a)}};olympe.Va.node.net.U={eE:'native.html.net.useWorkers'};olympe.W.config(function(a){a.getParameter(olympe.net.U.cj)&&Va(a,olympe.net.U.cj,!1);Wa(a,olympe.net.P.Ea,olympe.Va.node.net.Fv,olympe.net.P.Da,olympe.host.P.Ea)},'olympe.native.node.net');olympe.Va.node.net.http={};const jd=require('fastify'),{Readable:kd}=require('stream'),ld={Pk:0,Ok:1,Wm:2},md=olympe.net.wa.Sd.Rq,nd=olympe.net.wa.Headers.Ft,od=olympe.net.wa.Headers.Dt,pd=olympe.net.wa.Headers.Et,qd=olympe.net.wa.Ub.Rh;
475
+ b)}};olympe.Va.node.net.Hv=class extends olympe.net.we.WebSocket{ja(a){return new (require('ws'))(a)}};olympe.Va.node.net.U={eE:'native.html.net.useWorkers'};olympe.W.config(function(a){a.getParameter(olympe.net.U.bj)&&Va(a,olympe.net.U.bj,!1);Wa(a,olympe.net.P.Ea,olympe.Va.node.net.Fv,olympe.net.P.Da,olympe.host.P.Ea)},'olympe.native.node.net');olympe.Va.node.net.http={};const jd=require('fastify'),{Readable:kd}=require('stream'),ld={Pk:0,Ok:1,Wm:2},md=olympe.net.wa.Sd.Rq,nd=olympe.net.wa.Headers.Ft,od=olympe.net.wa.Headers.Dt,pd=olympe.net.wa.Headers.Et,qd=olympe.net.wa.Ub.Rh;
476
476
  function rd(a,b){const c=b.methods,d=b.Kn,e=b.headers,f=b.origin;a.j.route({bodyLimit:a.Y<<20,url:b.path,method:[...c,md],handler:(g,h)=>{a.G.debug('Incoming request:','hostname:',g.hostname,'headers:',g.headers);var k=g.method;const l={[nd]:f,[pd]:c,[od]:e};if(k===md)return a.G.debug('< HTTP: OPTIONS'),h.code(qd).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.Ti(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 kd)&&h.type(olympe.net.wa.Ul.ke);if(v>=olympe.net.wa.Ub.hj)throw Error(x);v>=olympe.net.wa.Ub.Fl?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.Dj())).send(x)}).catch(t=>{a.G.error('> HTTP: reply with internal server error:',t);return h.code(olympe.net.wa.Ub.hj).headers(Object.assign(l,{[olympe.net.wa.Headers.Ji]:'text/plain'})).send('Internal server error')})}})}
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.Jc(),x=t.getData();(x instanceof Uint8Array||x instanceof ArrayBuffer||x instanceof kd)&&h.type(olympe.net.wa.Ul.ke);if(v>=olympe.net.wa.Ub.gj)throw Error(x);v>=olympe.net.wa.Ub.Fl?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.wa.Ub.gj).headers(Object.assign(l,{[olympe.net.wa.Headers.Ii]:'text/plain'})).send('Internal server error')})}})}
479
479
  olympe.Va.node.net.http.di=class extends olympe.net.di{constructor(a,b,c,d,e){super(a);this.Y=c;this.port=b;this.$=d;this.N=e;this.j=this.createServer();this.H=new Map;this.state=ld.Pk;this.kd=new Set;this.timer=null}D(a,b,c,d){const e=olympe.net.di.ALL;this.H.set(a,{path:b,methods:c,Kn: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===ld.Pk)return this.F();if(this.state===ld.Ok){for(const a of this.H.values())rd(this,
480
- a);return this.j.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.state=ld.Wm;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===ld.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.vj(()=>{const c=this;return u(function*(){c.state=
480
+ a);return this.j.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.state=ld.Wm;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===ld.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
481
  ld.Ok;yield c.j.close();c.j=c.createServer();yield c.start()})})})}stop(){return this.state===ld.Wm?this.j.close().then(()=>{this.state=ld.Pk}):Promise.resolve()}createServer(){var a=olympe.ia.yb.j.ms,b=this.G.H();a={logger:{level:olympe.ia.yb.D[b===olympe.ia.yb.j.pk?a:b].toLowerCase()},http2:this.$};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
- jd(a);a.addContentTypeParser('*',{parseAs:'buffer'},(c,d,e)=>{e(null,d)});return a}vj(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.W.config(function(a){C(a,olympe.net.P.oj,olympe.Va.node.net.http.di,olympe.net.P.Da,new olympe.W.pa(olympe.net.U.Af),new olympe.W.pa(olympe.net.U.Sp),new olympe.W.pa(olympe.net.U.hs),new olympe.W.pa(olympe.net.U.Rp))},'olympe.native.node.net.http');olympe.Va.node.V={};const sd=require('stream').Readable,td=require('buffer');
482
+ jd(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.W.config(function(a){C(a,olympe.net.P.nj,olympe.Va.node.net.http.di,olympe.net.P.Da,new olympe.W.pa(olympe.net.U.Bf),new olympe.W.pa(olympe.net.U.Sp),new olympe.W.pa(olympe.net.U.hs),new olympe.W.pa(olympe.net.U.Rp))},'olympe.native.node.net.http');olympe.Va.node.V={};const sd=require('stream').Readable,td=require('buffer');
483
483
  olympe.Va.node.V.Jl=class extends olympe.V.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 sd){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(()=>td.resolveObjectURL(a)).catch(b=>
484
484
  {throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.W.config(function(a){Wa(a,olympe.V.P.Eg,olympe.Va.node.V.Jl)},'olympe.native.node.utils');olympe.async={};function ud(a,b){a.H||a.Y.push(a.F.tc(b))}
485
- olympe.async.rp=class{constructor(a,b=void 0===a){this.D=[];this.Y=[];this.F=a||new olympe.C.Wb('Async executor context');this.ja=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.$=olympe.V.Kc()}Bg(a){0<=a&&(this.timeout=a);return this}Za(){return this.G}add(a){this.H||this.D.push(this.F.tc(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
+ olympe.async.rp=class{constructor(a,b=void 0===a){this.D=[];this.Y=[];this.F=a||new olympe.C.Wb('Async executor context');this.ja=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.$=olympe.V.Kc()}$f(a){0<=a&&(this.timeout=a);return this}Ya(){return this.G}add(a){this.H||this.D.push(this.F.tc(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
486
  this.$),0<this.timeout&&(this.timer=setTimeout(()=>{this.j='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.D=[];this.Y=[];this.env.clear();this.ja&&this.F.destroy()}complete(a){this.F.Xf(this.$);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.Y)b(a,a?null:this.j,this.env);this.clear()}}getContext(){return this.F}};
487
487
  function vd(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(()=>{vd(a)})},c=>{c&&(a.j=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.xw=class extends olympe.async.rp{static create(){return new olympe.async.xw(new olympe.C.Wb('SequencedExecutor'),!0)}start(){this.N||(super.start(),vd(this))}};
488
488
  olympe.async.Dk=class extends olympe.async.rp{constructor(a,b){super(a,b);this.R=0;this.ea=!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.ea=!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.ea)}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.lv=class{D(){return u(function*(){})}Y(){}N(){}F(){}R(){}forEach(){}has(){}get(){}set(){}remove(){}ea(){}$(){}clear(){}H(){}};olympe.Db.mv=class{D(){}};olympe.Db.Storage=class{open(){}write(){}close(){}};olympe.Db.wv=class{get(){return null}set(){return this}delete(){}};olympe.Db.P={qk:'localStorage.KeyValueDatabaseManager',ij:'localStorage.Storage',PA:'localStorage.DatacloudStorage',ym:'localStorage.LocalStorage',Da:'localStorage.Logger',ah:'localStorage.prefix'};olympe.W.config(function(a){Ya(a,olympe.Db.P.qk);D(a,olympe.Db.P.ah,[],()=>'olympe');D(a,olympe.Db.P.Da,[olympe.ia.P.Ea],b=>b.cd('localstorage'));C(a,olympe.Db.P.ym,olympe.Db.wv)},'olympe.localstorage');olympe.L={};olympe.L.Xb={ik:'urls.FileSvc',uo:'urls.BackupSvc',sr:'urls.RestoreBackupSvc',Kg:'urls.GetContext',Jp:'urls.GraphDef',Ho:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',gs:'urls.UserTagFromToken',Sw:'urls.UserNameFromTag',Rw:'urls.UserRoles',ew:'urls.RoleMembers',wk:'urls.OpenIDSvc'};
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.lv=class{D(){return u(function*(){})}Y(){}N(){}F(){}R(){}forEach(){}has(){}get(){}set(){}remove(){}ea(){}$(){}clear(){}H(){}};olympe.Db.mv=class{D(){}};olympe.Db.Storage=class{open(){}write(){}close(){}};olympe.Db.wv=class{get(){return null}set(){return this}delete(){}};olympe.Db.P={qk:'localStorage.KeyValueDatabaseManager',hj:'localStorage.Storage',PA:'localStorage.DatacloudStorage',ym:'localStorage.LocalStorage',Da:'localStorage.Logger',ah:'localStorage.prefix'};olympe.W.config(function(a){Ya(a,olympe.Db.P.qk);D(a,olympe.Db.P.ah,[],()=>'olympe');D(a,olympe.Db.P.Da,[olympe.ia.P.Ea],b=>b.cd('localstorage'));C(a,olympe.Db.P.ym,olympe.Db.wv)},'olympe.localstorage');olympe.L={};olympe.L.Xb={ik:'urls.FileSvc',uo:'urls.BackupSvc',sr:'urls.RestoreBackupSvc',Kg:'urls.GetContext',Jp:'urls.GraphDef',Ho:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',gs:'urls.UserTagFromToken',Sw:'urls.UserNameFromTag',Rw:'urls.UserRoles',ew:'urls.RoleMembers',wk:'urls.OpenIDSvc'};
490
490
  olympe.W.config(a=>{E(a,olympe.L.Xb.ik,'rest/filesvc');E(a,olympe.L.Xb.uo,'rest/backupsvc');E(a,olympe.L.Xb.sr,'rest/backupsvc/restore');E(a,olympe.L.Xb.wk,'rest/openid');E(a,olympe.L.Xb.Kg,'rest/initialData');E(a,olympe.L.Xb.Jp,'rest/querysvc/graphDef');E(a,olympe.L.Xb.Ho,'rest/querysvc/graphDef/static');E(a,olympe.L.Xb.TRANSACTION,'rest/transaction');E(a,olympe.L.Xb.gs,'rest/token');E(a,olympe.L.Xb.Sw,'rest/authorization/getUserTag');E(a,olympe.L.Xb.Rw,'rest/authorization/getUserRoles');E(a,olympe.L.Xb.ew,
491
491
  'rest/authorization/roleMembers')});function wd(a,b){a.validate=b.ack.bind(b);a.H=b.xi();return a}
492
- olympe.L.xa=class{constructor(a,b,c,d,e,f){this.be=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.xa.D.Km,e=bd(a);let f;var g=olympe.L.xa,h=e[olympe.L.xa.D.DESTINATION],k=e[olympe.L.xa.D.$g],l=e[olympe.L.xa.D.Mk],n=e[olympe.L.xa.D.mg],p=e[olympe.L.xa.D.TYPE];b.R=c;return wd(new g(h,k,l,n,p,b.N(null!=(f=e[d])?f:null)),a)}xi(){return this.H}jc(){return this.F}jb(){return this.source}getType(){return this.messageType}ack(){return this.validate()}ga(a,b){const c=
493
- olympe.L.xa.D.Km,d={[olympe.L.xa.D.DESTINATION]:this.F,[olympe.L.xa.D.$g]:this.source,[olympe.L.xa.D.Mk]:this.be,[olympe.L.xa.D.mg]:this.D,[olympe.L.xa.D.TYPE]:this.messageType};null!==this.j&&(a.Y=b,d[c]=a.ga(this.j));return d}toString(){return`Message(dest: ${this.F}, src: ${this.source}, seqId: ${this.be}, topic: ${this.D}, type: ${this.messageType}, payload: ${this.j})`}};olympe.L.xa.D={DESTINATION:'d',$g:'s',Mk:'i',mg:'tp',TYPE:'t',Km:'p',Hf:'tk'};
494
- olympe.L.xa.j={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,ks:4,ke:5,mg:6,zb:7,Gr:10,Zr:11,hg:12,cs:13,Vm:14,Ep:15};olympe.L.Xm=class extends olympe.L.xa{constructor(a,b,c,d,e,f,g){super(a,b,d,e,f,g);this.ed=c}static F(a,b,c){const d=olympe.L.xa.D.Km,e=bd(a);let f;var g=olympe.L.Xm,h=e[olympe.L.xa.D.DESTINATION],k=e[olympe.L.xa.D.$g],l=e[olympe.L.xa.D.Hf],n=e[olympe.L.xa.D.Mk],p=e[olympe.L.xa.D.mg],q=e[olympe.L.xa.D.TYPE];b.R=c;b=new g(h,k,l,n,p,q,b.N(null!=(f=e[d])?f:null));wd(b,a);return b}te(){return this.ed}ga(a,b){return Object.assign(super.ga(a,b),{[olympe.L.xa.D.Hf]:this.ed})}toString(){return`SignedMessage{dest: ${this.F}, src: ${this.source}, seqId: ${this.be}, topic: ${this.D}, type: ${this.messageType}, token: ${this.ed}, payload: ${this.j}}`}};const xd=olympe.L.xa.j.SEND,yd=olympe.L.xa.j.GET,zd=olympe.L.xa.j.SUBSCRIBE,Ad=olympe.L.xa.j.hg,Bd=olympe.L.xa.j.Gr,Cd=olympe.L.xa.j.zb,Dd=olympe.L.xa.j.ks,Ed=olympe.L.xa.j.mg,Fd=olympe.L.xa.j.Zr;
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}})}Ci(){return null!==this.user?Promise.resolve(this.user):Gd(this.D,this.j).then(a=>this.user=a)}xi(){return this.j.xi()}mt(){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()!==xd)throw Error('Should only call `ack` on SEND requests');yield a.j.ack();yield a.D.dd(a.j,Bd)})}dd(a){const b=
492
+ olympe.L.xa=class{constructor(a,b,c,d,e,f){this.be=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.xa.D.Km,e=bd(a);let f;var g=olympe.L.xa,h=e[olympe.L.xa.D.DESTINATION],k=e[olympe.L.xa.D.$g],l=e[olympe.L.xa.D.Mk],n=e[olympe.L.xa.D.ng],p=e[olympe.L.xa.D.TYPE];b.R=c;return wd(new g(h,k,l,n,p,b.N(null!=(f=e[d])?f:null)),a)}xi(){return this.H}jc(){return this.F}jb(){return this.source}getType(){return this.messageType}ack(){return this.validate()}ga(a,b){const c=
493
+ olympe.L.xa.D.Km,d={[olympe.L.xa.D.DESTINATION]:this.F,[olympe.L.xa.D.$g]:this.source,[olympe.L.xa.D.Mk]:this.be,[olympe.L.xa.D.ng]:this.D,[olympe.L.xa.D.TYPE]:this.messageType};null!==this.j&&(a.Y=b,d[c]=a.ga(this.j));return d}toString(){return`Message(dest: ${this.F}, src: ${this.source}, seqId: ${this.be}, topic: ${this.D}, type: ${this.messageType}, payload: ${this.j})`}};olympe.L.xa.D={DESTINATION:'d',$g:'s',Mk:'i',ng:'tp',TYPE:'t',Km:'p',If:'tk'};
494
+ olympe.L.xa.j={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,ks:4,ke:5,ng:6,zb:7,Gr:10,Zr:11,ig:12,cs:13,Vm:14,Ep:15};olympe.L.Xm=class extends olympe.L.xa{constructor(a,b,c,d,e,f,g){super(a,b,d,e,f,g);this.ed=c}static F(a,b,c){const d=olympe.L.xa.D.Km,e=bd(a);let f;var g=olympe.L.Xm,h=e[olympe.L.xa.D.DESTINATION],k=e[olympe.L.xa.D.$g],l=e[olympe.L.xa.D.If],n=e[olympe.L.xa.D.Mk],p=e[olympe.L.xa.D.ng],q=e[olympe.L.xa.D.TYPE];b.R=c;b=new g(h,k,l,n,p,q,b.N(null!=(f=e[d])?f:null));wd(b,a);return b}te(){return this.ed}ga(a,b){return Object.assign(super.ga(a,b),{[olympe.L.xa.D.If]:this.ed})}toString(){return`SignedMessage{dest: ${this.F}, src: ${this.source}, seqId: ${this.be}, topic: ${this.D}, type: ${this.messageType}, token: ${this.ed}, payload: ${this.j}}`}};const xd=olympe.L.xa.j.SEND,yd=olympe.L.xa.j.GET,zd=olympe.L.xa.j.SUBSCRIBE,Ad=olympe.L.xa.j.ig,Bd=olympe.L.xa.j.Gr,Cd=olympe.L.xa.j.zb,Dd=olympe.L.xa.j.ks,Ed=olympe.L.xa.j.ng,Fd=olympe.L.xa.j.Zr;
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):Gd(this.D,this.j).then(a=>this.user=a)}xi(){return this.j.xi()}mt(){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()!==xd)throw Error('Should only call `ack` on SEND requests');yield a.j.ack();yield a.D.dd(a.j,Bd)})}dd(a){const b=
496
496
  this;return u(function*(){const c=b.j.getType();if(c===yd||c===Ad)yield b.j.ack(),yield b.D.dd(b.j,Dd,a);else throw Error('Should only call `reply` on GET requests');})}Qn(a){return this.j.getType()!==zd?Promise.reject(Error('Should only call `notifyOn` on SUBSCRIBE requests')):new Promise((b,c)=>{const d=`sub_${olympe.V.Kc()}`,e={seq:Hd(this.D,f=>{switch(f.getType()){case Fd:Id(this.F,d);b(d);break;case Cd:c(f.j.reason);break;default:c('Unsupported response type for a SUBSCRIBE request')}}),topic:a,
497
497
  id:d,refresh:this.D.ff};this.j.ack().then(()=>this.D.dd(this.j,Ed,e)).catch(c)})}mi(a){const b=this;return u(function*(){yield b.D.dd(b.j,Cd,{reason:a.message})})}};olympe.L.Fc.prototype.fail=olympe.L.Fc.prototype.mi;olympe.L.Fc.prototype.notifyOn=olympe.L.Fc.prototype.Qn;olympe.L.Fc.prototype.reply=olympe.L.Fc.prototype.dd;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.mt;olympe.L.Fc.prototype.isRedelivered=olympe.L.Fc.prototype.xi;olympe.L.Fc.prototype.userTag=olympe.L.Fc.prototype.Ci;function Jd(a,b){b&&a.qf();null===a.D&&(a.D=setInterval(a.qf.bind(a),a.F))}function Kd(a){if(null!==a.D){var b=a.D;a.D=null;clearInterval(b)}}function Ld(a){return Array.from(a.j.values()).reduce((b,c)=>b+c.size,0)}function Md(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&&Kd(a);return c}function Nd(a){a.j.forEach((b,c)=>{b.forEach((d,e)=>{Md(a,c,e);null==d||d(new olympe.error.Qh(`Subscription ${e} to be refreshed`,e))})})}
498
+ olympe.L.Fc.prototype.requestType=olympe.L.Fc.prototype.mt;olympe.L.Fc.prototype.isRedelivered=olympe.L.Fc.prototype.xi;olympe.L.Fc.prototype.userTag=olympe.L.Fc.prototype.Bi;function Jd(a,b){b&&a.rf();null===a.D&&(a.D=setInterval(a.rf.bind(a),a.F))}function Kd(a){if(null!==a.D){var b=a.D;a.D=null;clearInterval(b)}}function Ld(a){return Array.from(a.j.values()).reduce((b,c)=>b+c.size,0)}function Md(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&&Kd(a);return c}function Nd(a){a.j.forEach((b,c)=>{b.forEach((d,e)=>{Md(a,c,e);null==d||d(new olympe.error.Qh(`Subscription ${e} to be refreshed`,e))})})}
499
499
  function Od(a,b,c){let d;null==(d=a.j.get(b))||d.forEach((e,f)=>{Md(a,b,f);e(c)})}
500
- olympe.L.Dw=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(Pd(this.H)){var a=olympe.L.xa.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);Md(this,c,e);null==g||g(new olympe.error.Qh('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.Mq?d=new olympe.error.Qh('Subscriptions must be re-subscribed.'):(this.G.error(e),d=Error(e));Od(this,c,d)})})}else Kd(this)}};const Qd=new Set([olympe.L.xa.j.SUBSCRIBE,olympe.L.xa.j.GET,olympe.L.xa.j.SEND,olympe.L.xa.j.mg,olympe.L.xa.j.ke,olympe.L.xa.j.hg]);function Gd(a,b){return new Promise((c,d)=>{a.H.rh(b.te(),(e,f)=>{e?d(e):c(f)})})}function Hd(a,b){a.ta++;const c=a.ta;a.Y.set(c,d=>{a.Y.delete(c);b(d)});return c}function Pd(a){return Rd(a.wd)&&Qc(a.F)}
502
- function Sd(a){Pc(a.F,()=>{a.Ja&&Td(a);a.Ja=!1});Oc(a.F,()=>{a.Ja&&a.G.info('Reconnecting to bus...');a.N=!0});Nc(a.F,()=>{Ud(a).then(()=>{a.Ja=!0;a.N=!1;Vd(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}`)})})})}
500
+ olympe.L.Dw=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(Pd(this.H)){var a=olympe.L.xa.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);Md(this,c,e);null==g||g(new olympe.error.Qh('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.Mq?d=new olympe.error.Qh('Subscriptions must be re-subscribed.'):(this.G.error(e),d=Error(e));Od(this,c,d)})})}else Kd(this)}};const Qd=new Set([olympe.L.xa.j.SUBSCRIBE,olympe.L.xa.j.GET,olympe.L.xa.j.SEND,olympe.L.xa.j.ng,olympe.L.xa.j.ke,olympe.L.xa.j.ig]);function Gd(a,b){return new Promise((c,d)=>{a.H.rh(b.te(),(e,f)=>{e?d(e):c(f)})})}function Hd(a,b){a.ta++;const c=a.ta;a.Y.set(c,d=>{a.Y.delete(c);b(d)});return c}function Pd(a){return Rd(a.wd)&&Qc(a.F)}
502
+ function Sd(a){Pc(a.F,()=>{a.Ha&&Td(a);a.Ha=!1});Oc(a.F,()=>{a.Ha&&a.G.info('Reconnecting to bus...');a.N=!0});Nc(a.F,()=>{Ud(a).then(()=>{a.Ha=!0;a.N=!1;Vd(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
503
  function Wd(a,b){return u(function*(){var c;const d=null==(c=a.D)?void 0:c.get(b);d&&(Kd(d),a.D.delete(b));a.G.debug(`Bus: Unsubscribe from ${b}`);c=a.Eb.delete(b)?[a.j,b]:[a.j];yield Promise.all(c.map(e=>u(function*(){if(b!==e)try{yield ad(a.F,e,b)}catch(f){a.G.debug(`Failed to unbind topic ${b} from queue ${e}: ${f}`)}else try{a.$.delete(b),yield Yc(a.F,e)}catch(f){a.G.debug(`Failed to unsubscribe from queue ${e}: ${f}`)}})))})}
504
- function Xd(a,b,c,d=!0){return u(function*(){Pd(a)||(yield a.connect());const e=d?[a.j]:[a.j,b];a.$.set(b,c);!d&&a.Eb.add(b);yield Promise.all(e.map(f=>u(function*(){a.F.D.has(f)||(a.G.debug(`Bus: Subscribe to queue ${f}..`),yield Xc(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 $c(a.F,f,b));a.G.debug(`Subscribed to topic ${b} over queue: ${f}`)})))})}
504
+ function Xd(a,b,c,d=!0){return u(function*(){Pd(a)||(yield a.connect());const e=d?[a.j]:[a.j,b];a.$.set(b,c);!d&&a.Eb.add(b);yield Promise.all(e.map(f=>u(function*(){a.F.D.has(f)||(a.G.debug(`Bus: Subscribe to queue ${f}..`),yield Xc(a.F,f,f===a.j,a.tg.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 $c(a.F,f,b));a.G.debug(`Subscribed to topic ${b} over queue: ${f}`)})))})}
505
505
  function Td(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 ${Ld(c)} subscriptions for ${d} service.`),Kd(c))})}function Ud(a){return u(function*(){a.G.debug('Connection to bus established. Listening to responses on topic',a.j);yield Xd(a,a.j,b=>{let c;null==(c=a.Y.get(b.be))||c(b)},!0)})}
506
- function Vd(a){a.G.j()?a.G.debug(`Connected to bus: subscribe to ${a.$.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 ${Ld(c)} subscriptions for ${d} service.`),Jd(c,!0))});a.R.forEach(c=>c(null));a.R=[]}function Yd(a){a.Gd=a.ja.D(()=>Pd(a)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}
506
+ function Vd(a){a.G.j()?a.G.debug(`Connected to bus: subscribe to ${a.$.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 ${Ld(c)} subscriptions for ${d} service.`),Jd(c,!0))});a.R.forEach(c=>c(null));a.R=[]}function Yd(a){a.Gd=a.ja.j(()=>Pd(a)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}
507
507
  function Zd(a,b,c,d=new Map){a.Nd.j&&sb(a.Nd,'com',d.set('id',`${b}`).set('channel','bus').set('eventType',c))}function $d(a,b,c){const d=`${b}:${c}`;b=a.ea.get(d);b||(b=new olympe.L.Yq(()=>a.ea.delete(d)),a.ea.set(d,b));return b}
508
508
  function ae(a,b){const c=olympe.L.Me.Hg,d=olympe.L.Me.Fh,e=olympe.L.Me.zb,f=b.j,{id:g,e:h}=f,k=`${b.jb()}:${g}`,l=$d(a,b.jb(),g);if(h===c){gb(a.ea.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}`))}
509
- function be(a,b,c){return u(function*(){let d;if('number'===typeof c)d=c;else{const f=ce(a,b,b,olympe.L.xa.j.Ep);d=f.be;yield a.ld(f)}let e=a.bb.get(d);e||(e=[],a.bb.set(d,e));return olympe.V.Promise.Bg(new Promise(f=>{e.push(g=>f(g))}),15E3,`Timeout while getting the destination (sessionId) for message ${d}.`)})}function ce(a,b,c,d,e){const f=de(a.H).Hd();a.ta++;return new olympe.L.Xm(b,a.j,f,a.ta,c,d,e)}
509
+ function be(a,b,c){return u(function*(){let d;if('number'===typeof c)d=c;else{const f=ce(a,b,b,olympe.L.xa.j.Ep);d=f.be;yield a.ld(f)}let e=a.Wa.get(d);e||(e=[],a.Wa.set(d,e));return olympe.V.Promise.$f(new Promise(f=>{e.push(g=>f(g))}),15E3,`Timeout while getting the destination (sessionId) for message ${d}.`)})}function ce(a,b,c,d,e){const f=de(a.H).Hd();a.ta++;return new olympe.L.Xm(b,a.j,f,a.ta,c,d,e)}
510
510
  function ee(a,b,c,d){const e=b.be,f=h=>{g&&clearTimeout(g);a.Y.delete(e);c(h)};a.Y.set(e,f);const g=setTimeout(()=>f(new olympe.L.xa(a.j,a.j,e,b.D,olympe.L.xa.j.zb,{reason:'Timeout',code:olympe.error.mc.TIMEOUT})),d)}function fe(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&&(Kd(a),Jd(a,!1)))):(g=new olympe.L.Dw(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&&Jd(e,!1)}
511
511
  function ge(a,b,c,d){var e;const f=null==(e=a.D)?void 0:e.get(b);if(null==f?0:Md(f,c,d))e=olympe.L.xa.j.cs,Pd(a)&&a.ld(ce(a,c,b,e,d)).catch(g=>a.G.error(`Impossible to keep alive subscriptions: ${g}`)),0===Ld(f)&&(a.D.delete(b),0===a.D.size&&(a.D=null))}
512
512
  olympe.L.Ll=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.wd=c;this.H=d;this.ja=e;this.le=f;this.Nd=g;this.Y=new Map;this.j=`${'olympe-runtime'}-${olympe.V.Kc()}`;this.mb=h.get('requestTimeout');this.ff=h.get('subscriptionsRefreshRate');this.Pc=h.get('allowGuest');a=h.get('connection');d=this.H.ed.tb().asObservable();c=c.Wf().asObservable();c=rxjs.combineLatest([a,d,c]).pipe(rxjs.operators.map(([k,l,n])=>n.valueOf()?Object.assign({},k,{user:l.yc(),ed:l.Hd()}):null));this.F=b.N(c,this.j);Sd(this);
513
513
  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&&Pd(this)){this.G.debug(`Resubscribe to queues with new topic prefix: ${k}`);Promise.all(Array.from(this.$).map(([p,q])=>{const r=this;return u(function*(){yield Wd(r,p);yield Xd(r,p,q,r.Eb.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=>{Nd(p)})}});this.ni=this.ta=0;this.D=null;this.N=
514
- !1;this.R=[];this.$=new Map;this.Eb=new Set;this.bb=new Map;this.ea=new olympe.V.$h(this.mb);this.Pe=this.Gd='';this.Ja=this.Gc=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.R.forEach(e=>e(d));this.R=[]};Pd(this)?a():this.N||this.Gc?this.R.push(d=>d?b(d):a()):Rd(this.wd)?(this.Gc=!0,olympe.C.jt([this.H.ql()],d=>{Yd(this);this.Gc=!1;d.valueOf()||this.Pc?(this.Pc||he(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)}),
515
- this.Pe=this.ja.ja(()=>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.Y.delete('busLogoutCallback');a.ja.F(a.Gd);a.ja.H(a.Pe);yield a.F.disconnect()})}ld(a,b=!1){const c=this;return u(function*(){if(!c.N||a.getType()!==olympe.L.xa.j.hg){Pd(c)||
516
- (yield c.connect());var d=a.F.startsWith('olympe-runtime'),e=d?a.jc():c.Yb+a.jc();try{Zd(c,a.be.toString(),'serialize');var f=a.ga(c.le,c.tg.bind(c,a.D,a.be));c.G.j()&&c.G.debug(`BUS > #${e}:`,JSON.stringify(f))}catch(h){throw Error(`An error occurred while serializing the message (seqId=${a.be}): ${h}`);}var g=Qd.has(a.getType());yield c.F.ld(a.be,e,f,{mandatory:g,xt:!(d||b)});Zd(c,a.be.toString(),'publish',(new Map).set('destination',a.jc()).set('messageType',a.getType().toString()))}})}tg(a,b,
514
+ !1;this.R=[];this.$=new Map;this.Eb=new Set;this.Wa=new Map;this.ea=new olympe.V.$h(this.mb);this.Pe=this.Gd='';this.Ha=this.Gc=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.R.forEach(e=>e(d));this.R=[]};Pd(this)?a():this.N||this.Gc?this.R.push(d=>d?b(d):a()):Rd(this.wd)?(this.Gc=!0,olympe.C.jt([this.H.ql()],d=>{Yd(this);this.Gc=!1;d.valueOf()||this.Pc?(this.Pc||he(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)}),
515
+ this.Pe=this.ja.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.ja.D(a.Gd);a.ja.F(a.Pe);yield a.F.disconnect()})}ld(a,b=!1){const c=this;return u(function*(){if(!c.N||a.getType()!==olympe.L.xa.j.ig){Pd(c)||
516
+ (yield c.connect());var d=a.F.startsWith('olympe-runtime'),e=d?a.jc():c.Yb+a.jc();try{Zd(c,a.be.toString(),'serialize');var f=a.ga(c.le,c.ug.bind(c,a.D,a.be));c.G.j()&&c.G.debug(`BUS > #${e}:`,JSON.stringify(f))}catch(h){throw Error(`An error occurred while serializing the message (seqId=${a.be}): ${h}`);}var g=Qd.has(a.getType());yield c.F.ld(a.be,e,f,{mandatory:g,xt:!(d||b)});Zd(c,a.be.toString(),'publish',(new Map).set('destination',a.jc()).set('messageType',a.getType().toString()))}})}ug(a,b,
517
517
  c){const d=this.ni++;(()=>{const e=this;return u(function*(){let f;try{f=yield be(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.xa(f,e.j,b,a,olympe.L.xa.j.ke,p)),h=olympe.L.Me.Hg,k=olympe.L.Me.Fh,l=olympe.L.Me.zb;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}`})}})})();
518
- return d}dd(a,b,c){return this.send(a.be,a.jb(),a.jb(),b,c)}send(a,b,c,d,e){return this.ld(new olympe.L.xa(c,this.j,a,b,d,e))}request(a,b,c,d,e,f){const g=ce(this,a,b,c,d);return c===olympe.L.xa.j.PUBLISH?this.ld(g,e):new Promise((h,k)=>{ee(this,g,h,null!=f?f:this.mb);this.ld(g,e).catch(k)})}sg(a,b){const c=olympe.L.xa.D.$g;a=olympe.L.xa.D.Mk;var d=olympe.L.xa.D.Hf;const e=b.R,f=bd(b);if(f[c]===this.j&&e===this.j)this.G.debug('Received and ignore a message sent by the same runtime.'),b.ack().catch(k=>
518
+ return d}dd(a,b,c){return this.send(a.be,a.jb(),a.jb(),b,c)}send(a,b,c,d,e){return this.ld(new olympe.L.xa(c,this.j,a,b,d,e))}request(a,b,c,d,e,f){const g=ce(this,a,b,c,d);return c===olympe.L.xa.j.PUBLISH?this.ld(g,e):new Promise((h,k)=>{ee(this,g,h,null!=f?f:this.mb);this.ld(g,e).catch(k)})}tg(a,b){const c=olympe.L.xa.D.$g;a=olympe.L.xa.D.Mk;var d=olympe.L.xa.D.If;const e=b.R,f=bd(b);if(f[c]===this.j&&e===this.j)this.G.debug('Received and ignore a message sent by the same runtime.'),b.ack().catch(k=>
519
519
  this.G.error(`Failed to ack message: ${k}`));else{this.G.j()&&this.G.debug(`BUS < #${b.N}:`,JSON.stringify(f));Zd(this,f[a],'consumed');a=void 0===f[d]?olympe.L.xa.F:olympe.L.Xm.F;d=null;var g=!1;try{d=a.call(null,b,this.le,k=>{g=!0;return $d(this,f[c],k).stream}),Qd.has(d.getType())||b.ack().catch(k=>this.G.error(`Failed to ack message: ${k}`))}catch(k){this.G.error(`An error occurred while trying to deserialize the message: ${JSON.stringify(f)} with error ${k}`);cd(b).catch(l=>this.G.error(`Failed to reject message: ${l}`));
520
- return}var h=d;b=h.be;Zd(this,b.toString(),'deserialized',(new Map).set('source',h.jb()).set('messageType',h.getType().toString()));switch(h.getType()){case olympe.L.xa.j.ke:ae(this,h);break;case olympe.L.xa.j.Ep:this.dd(h,olympe.L.xa.j.Vm).catch(l=>this.G.error(`Failed to reply to get session message: ${l}`));break;case olympe.L.xa.j.Vm:let k;null==(k=this.bb.get(b))||k.forEach(l=>l(h.jb()));break;default:g&&this.dd(h,olympe.L.xa.j.Vm).catch(l=>this.G.error(`Failed to send session id for stream publishing: ${l}`));
521
- try{let l;null==(l=this.$.get(h.D))||l(h)}catch(l){this.G.error(`An error occurred while trying to handle the message: ${l}`)}}}}};olympe.L.Ll.D='Timeout';olympe.L.Ll.j='olympe-runtime';const ie=olympe.net.wa.Headers.so,je=olympe.net.wa.Ub.Rh,ke=olympe.net.wa.Ub.No,le=olympe.net.wa.Ub.Rj,me=olympe.net.wa.Ub.lw,ne=olympe.net.wa.Ub.Lo,oe=olympe.net.wa.Ub.kk,pe=olympe.net.wa.Ub.Mw,qe=olympe.net.wa.Ub.$i;function re(a,b){let c;return null!=(c=a.F.get(b))?c:''}function se(a,b,c,d=new Map){a.j.j&&sb(a.j,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
520
+ return}var h=d;b=h.be;Zd(this,b.toString(),'deserialized',(new Map).set('source',h.jb()).set('messageType',h.getType().toString()));switch(h.getType()){case olympe.L.xa.j.ke:ae(this,h);break;case olympe.L.xa.j.Ep:this.dd(h,olympe.L.xa.j.Vm).catch(l=>this.G.error(`Failed to reply to get session message: ${l}`));break;case olympe.L.xa.j.Vm:let k;null==(k=this.Wa.get(b))||k.forEach(l=>l(h.jb()));break;default:g&&this.dd(h,olympe.L.xa.j.Vm).catch(l=>this.G.error(`Failed to send session id for stream publishing: ${l}`));
521
+ try{let l;null==(l=this.$.get(h.D))||l(h)}catch(l){this.G.error(`An error occurred while trying to handle the message: ${l}`)}}}}};olympe.L.Ll.D='Timeout';olympe.L.Ll.j='olympe-runtime';const ie=olympe.net.wa.Headers.so,je=olympe.net.wa.Ub.Rh,ke=olympe.net.wa.Ub.No,le=olympe.net.wa.Ub.Rj,me=olympe.net.wa.Ub.lw,ne=olympe.net.wa.Ub.Lo,oe=olympe.net.wa.Ub.kk,pe=olympe.net.wa.Ub.Mw,qe=olympe.net.wa.Ub.Zi;function re(a,b){let c;return null!=(c=a.F.get(b))?c:''}function se(a,b,c,d=new Map){a.j.j&&sb(a.j,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
522
522
  function te(a,b,c){if(null===b)return Promise.reject('No http request to send');Gc(b,{[ie]: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}`)}se(a,e,'request',(new Map).set('destination',b.j()).set('messageType',b.method.toString()));return Jc(a.H,b).then(f=>{se(a,e,'reply');switch(f.Jc()){case je:case ke:case le:var g=f.getData();a.G.j()&&a.G.debug('HTTP <',f.Jc(),`content: ${'string'===
523
523
  typeof g?g:typeof g}`);return f;case me:throw f=`HTTP < Service provider for http request to ${b.j()} is overloaded, retry later`,a.G.warn(f),new olympe.error.Zq(f);case ne:return a.G.debug(`HTTP < request canceled (${b.j()}).`),f;case oe:case pe:throw f=`HTTP < request authorization denied: ${b.j()}, ${f.statusText}`,a.G.error(f),new olympe.error.uk(f);case qe:throw f=`HTTP < requested resource not found: ${b.j()}`,a.G.error(f),new olympe.error.Dm(f);default:g=`HTTP < Error: ${f.Jc()}, ${f.statusText}`;
524
524
  a.G.error(g);if(500===f.Jc()&&'Connection refused'===f.statusText)throw new olympe.error.To(g);throw new olympe.error.pd(g);}})}).pipe(tb(olympe.error.Zq,(e,f)=>{a.G.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.N)))}olympe.L.uu=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.Eb.forEach(c=>c(b)),b){case olympe.L.Oa.j.Zk:case olympe.L.Oa.j.CONNECTING:case olympe.L.Oa.j.ep:break;case olympe.L.Oa.j.ze:a.connected.update(olympe.C.da.D);break;case olympe.L.Oa.j.Ug:a.F=[0,0,a.F[2]];ue(a);break;case olympe.L.Oa.j.zb: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.Oa.j.no:ue(a);break;case olympe.L.Oa.j.vc:a.connected.update(olympe.C.da.j);
@@ -526,111 +526,111 @@ break;default:throw Error('State machine error in server manager. Should not get
526
526
  function ve(a){const b=olympe.L.Oa.j.no,c=olympe.L.Oa.j.Zk,d=olympe.L.Oa.j.vc,e=Fc(a.$);a.G.info(`Trying to wakeup orchestrator with ${e}`);O(a,c);const f=a.Gc.D(a.$);f.$(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(),
527
527
  O(a,d)}});f.D(()=>{a.G.warn(`Communication with ${e} failed.`);f.close();O(a,d)});f.ea(()=>{a.G.info(`Checking orchestrator status with ${e}`);f.send('{"action": "status"}')})}
528
528
  function we(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'))}xe(a,olympe.L.Ee.zb,d=>{switch(d.c){case olympe.L.sk.Ow:a.G.error('Unknown message sent to the server:',olympe.L.Oa.pc[d.s]);break;case olympe.L.sk.mu:a.G.error('Fatal error, the last message is probably too big according to the websocket config.'),a.D.forEach((e,f)=>{null!==e.Vn&&ye(a,f,d.i)})}});xe(a,olympe.L.Ee.pc,d=>
529
- {d.c===olympe.L.sk.aw&&'boolean'===typeof d.a&&a.tg.update(olympe.C.Sb(d.a))});olympe.C.Hj(a.connected,()=>{let d=!1;olympe.C.Hj(a.bb.j(),()=>{d&&(a.Pc(),a.mb(),d=!1);Dc(a.Pc.bind(a),a.Nd);Dc(a.mb.bind(a),a.ta)},()=>{a.F=[0,0,a.F[2]];d=!0})},()=>{a.R=null;Cc(a.mb.bind(a),a.ta)});c.D(()=>ze(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.state}`));c.ja(()=>a.disconnect(),'Orchestrator websocket');ib(a.H,(d,e)=>{e.throw(Error('Stream timeout'))});
529
+ {d.c===olympe.L.sk.aw&&'boolean'===typeof d.a&&a.ug.update(olympe.C.Sb(d.a))});olympe.C.Gj(a.connected,()=>{let d=!1;olympe.C.Gj(a.Wa.j(),()=>{d&&(a.Pc(),a.mb(),d=!1);Dc(a.Pc.bind(a),a.Nd);Dc(a.mb.bind(a),a.ta)},()=>{a.F=[0,0,a.F[2]];d=!0})},()=>{a.R=null;Cc(a.mb.bind(a),a.ta)});c.j(()=>ze(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.state}`));c.Ha(()=>a.disconnect(),'Orchestrator websocket');ib(a.H,(d,e)=>{e.throw(Error('Stream timeout'))});
530
530
  a.G.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}function ze(a){return a.state===olympe.L.Oa.j.ze}function Ae(a,b,c,d=!1){const e=f=>{if(0===b.length||b.includes(f))d&&a.Eb.delete(e),c(f)};a.Eb.add(e);e(a.state)}function Be(a,b,c,d,e){a.ea.j&&sb(a.ea,'com',d.set('id',`${b}`).set('channel','ws').set('eventType',c),e)}
531
531
  function ue(a){const b=olympe.L.Oa.j.INIT,c=olympe.L.Oa.j.CONNECTING,d=olympe.L.Oa.j.ze,e=olympe.L.Oa.j.vc,f=olympe.L.Oa.j.Ug,g=olympe.L.Oa.j.Zk,h=olympe.L.Oa.j.zb;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.Y(null),a.j.close());var k,l;a.G.log(`Asking NET layer for a connection to ${null==(k=a.N)?void 0:Ec(k)}:${null==(l=a.N)?void 0:l.port}...`);a.j=a.Gc.D(a.N);a.j.ea(a.le.bind(a));a.j.$(a.ff.bind(a));
532
532
  a.j.Y(()=>{a.j=null;a.state===d?O(a,f):a.state!==h&&a.state!==g&&O(a,e)});a.$&&a.state===b&&a.j.D(()=>{a.j.D(null);a.state===c&&ve(a);a.$=null});a.state!==f&&O(a,c)}}function Ce(a,b,c,d){const e=a.Pe;a.Pe++;c={message:{seqId:e,messageFamily:b,payload:c},pn:d?De(d):null,Vn:null};a.D.set(e,c);Be(a,e,'publish',(new Map).set('family',b));d=[olympe.L.Oa.j.CONNECTING,olympe.L.Oa.j.Ug];(ze(a)||b===olympe.L.Ee.nk&&d.includes(a.state))&&Ee(a,e,c)}
533
- function De(a){const b=olympe.L.Oa.D.jj;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.Oa.pc[e]?`Status code = ${e} [${olympe.L.Oa.pc[e]}]`:`Status code = ${e}`;e=olympe.error.Br;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)}}}
534
- function Ee(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.pn?a.D.delete(b):c.Vn=Date.now():olympe.C.Qa(a.bb.j()).valueOf()&&O(a,olympe.L.Oa.j.Ug);return d}function xe(a,b,c,d){void 0===d&&(d=olympe.V.Kc());let e=a.ja.get(b);void 0===e&&(e=new Map,a.ja.set(b,e));e.set(d,c)}function Fe(a){a=a.ja.get(olympe.L.Ee.Og);void 0!==a&&a.delete('logoutHandler')}
533
+ function De(a){const b=olympe.L.Oa.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.Oa.pc[e]?`Status code = ${e} [${olympe.L.Oa.pc[e]}]`:`Status code = ${e}`;e=olympe.error.Br;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)}}}
534
+ function Ee(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.pn?a.D.delete(b):c.Vn=Date.now():olympe.C.Qa(a.Wa.j()).valueOf()&&O(a,olympe.L.Oa.j.Ug);return d}function xe(a,b,c,d){void 0===d&&(d=olympe.V.Kc());let e=a.ja.get(b);void 0===e&&(e=new Map,a.ja.set(b,e));e.set(d,c)}function Fe(a){a=a.ja.get(olympe.L.Ee.Og);void 0!==a&&a.delete('logoutHandler')}
535
535
  function ye(a,b,c){if(a.D.has(b)){const {pn:d}=a.D.get(b);a.D.delete(b);null==d||d({s:olympe.L.Oa.D.cq,error:c})}}function Ge(a,b){a.G.error(b);O(a,olympe.L.Oa.j.zb)}function He(a,b,c){a.wd=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(!Ee(a,e,f))return;O(a,olympe.L.Oa.j.ze)}
536
536
  function Ie(a,b){const c=olympe.L.Me.Hg,d=olympe.L.Me.Fh,e=olympe.L.Me.zb,{id:f,e:g}=b;let h=a.H.get(f);h||(h=new olympe.L.Yq(()=>a.H.delete(f)),a.H.set(f,h));if(g===c){gb(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}`))}
537
- olympe.L.Oa=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.Oa.j.CONNECTING;if(this.state===olympe.L.Oa.j.ze||this.state===k){let l;null==(l=this.j)||l.close()}});this.$=this.j=null;e.subscribe(k=>{this.$=k;k=olympe.L.Oa.j.vc;this.state===olympe.L.Oa.j.Zk&&(O(this,k),ve(this))});this.ea=g;this.Nd=h.get('pingInterval');this.ta=h.get('messageTimeout');this.Y=olympe.V.Lf.parse(h.get('clientVersion'));this.Ja=olympe.V.Lf.parse(h.get('serverVersion'));
538
- this.state=olympe.L.Oa.j.INIT;this.bb=d;this.Yb=h.get('getContextMode');this.Pe=1;this.R=null;this.F=[0,0,0];this.ja=new Map;this.connected=olympe.C.cc(olympe.C.da,'Server is connected');this.tg=mc(olympe.C.cc(olympe.C.da,'Server is readonly'),olympe.C.da.j);this.Eb=new Set;this.D=new Map;this.H=new olympe.V.$h(this.ta);this.Gd=new Map;this.wd=-1;we(this,h,c)}connect(){const a=olympe.L.Oa.j.ze,b=olympe.L.Oa.j.vc,c=olympe.L.Oa.j.zb,d=olympe.L.Oa.j.INIT;return new Promise((e,f)=>{this.state!==d&&this.state!==
537
+ olympe.L.Oa=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.Oa.j.CONNECTING;if(this.state===olympe.L.Oa.j.ze||this.state===k){let l;null==(l=this.j)||l.close()}});this.$=this.j=null;e.subscribe(k=>{this.$=k;k=olympe.L.Oa.j.vc;this.state===olympe.L.Oa.j.Zk&&(O(this,k),ve(this))});this.ea=g;this.Nd=h.get('pingInterval');this.ta=h.get('messageTimeout');this.Y=olympe.V.Mf.parse(h.get('clientVersion'));this.Ha=olympe.V.Mf.parse(h.get('serverVersion'));
538
+ this.state=olympe.L.Oa.j.INIT;this.Wa=d;this.Yb=h.get('getContextMode');this.Pe=1;this.R=null;this.F=[0,0,0];this.ja=new Map;this.connected=olympe.C.cc(olympe.C.da,'Server is connected');this.ug=mc(olympe.C.cc(olympe.C.da,'Server is readonly'),olympe.C.da.j);this.Eb=new Set;this.D=new Map;this.H=new olympe.V.$h(this.ta);this.Gd=new Map;this.wd=-1;we(this,h,c)}connect(){const a=olympe.L.Oa.j.ze,b=olympe.L.Oa.j.vc,c=olympe.L.Oa.j.zb,d=olympe.L.Oa.j.INIT;return new Promise((e,f)=>{this.state!==d&&this.state!==
539
539
  b||ue(this);Ae(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.Oa.j.ep,d=olympe.L.Oa.j.vc,e=olympe.L.Oa.j.CONNECTING,f=olympe.L.Oa.j.zb;this.state===olympe.L.Oa.j.ze||this.state===e||this.state===c?(Ae(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())})}le(){this.G.debug('Websocket connected, sending handshake. Client version:',
540
- Ib(this.Y),'subscribeEverything:',this.Yb?'NO':'YES');Ce(this,olympe.L.Ee.nk,{c:olympe.L.sk.nk,cv:Ib(this.Y),m:this.Yb?0:1,s:this.R,b:this.bb.D()},this.sg.bind(this))}sg(a,b){if(a)Ge(this,'Error in receiving handshake response: '+a.message);else{this.G.debug('Handshake response received');var c=olympe.L.Oa.F;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.Fu:Ge(this,`Framework version (${Ib(this.Y)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
541
- return;case c.Fw:Ge(this,`Framework version (${Ib(this.Y)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.pu:Ge(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.Ja.Fa(olympe.V.Lf.j))this.G.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.V.Lf.parse(a);if(e.Oj(this.Ja)){Ge(this,`Framework v${Ib(this.Y)} is expecting Orchestrator to be at least in v${Ib(this.Ja)}`);
542
- return}this.G.log('Handshake successful. Orchestrator version: ',JSON.stringify(e),'required:',Ib(this.Ja))}catch(f){Ge(this,f);return}e=olympe.L.Oa.j.vc;if(this.state===olympe.L.Oa.j.Ug&&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.Gd.set(f,g);this.R=b.sessionId||null;He(this,a,d)}}}Pc(){this.F[0]-this.F[1]>this.Nd/2?
543
- (this.G.debug('Ping did not get answer, try to reconnect'),O(this,olympe.L.Oa.j.Ug)):(this.F[0]=Date.now(),this.j.send('ping')||(this.G.debug('Impossible to send ping, try to reconnect'),O(this,olympe.L.Oa.j.Ug)))}ff(a){this.F[2]=Date.now();if(a.startsWith('pong'))return olympe.C.Qa(this.bb.j()).valueOf()&&(this.F[1]=this.F[2]),null;var b=0;this.ea.j&&(b=performance.now()-this.ea.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=
540
+ Ib(this.Y),'subscribeEverything:',this.Yb?'NO':'YES');Ce(this,olympe.L.Ee.nk,{c:olympe.L.sk.nk,cv:Ib(this.Y),m:this.Yb?0:1,s:this.R,b:this.Wa.D()},this.tg.bind(this))}tg(a,b){if(a)Ge(this,'Error in receiving handshake response: '+a.message);else{this.G.debug('Handshake response received');var c=olympe.L.Oa.F;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.Fu:Ge(this,`Framework version (${Ib(this.Y)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
541
+ return;case c.Fw:Ge(this,`Framework version (${Ib(this.Y)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.pu:Ge(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.Ha.Fa(olympe.V.Mf.j))this.G.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.V.Mf.parse(a);if(e.Oj(this.Ha)){Ge(this,`Framework v${Ib(this.Y)} is expecting Orchestrator to be at least in v${Ib(this.Ha)}`);
542
+ return}this.G.log('Handshake successful. Orchestrator version: ',JSON.stringify(e),'required:',Ib(this.Ha))}catch(f){Ge(this,f);return}e=olympe.L.Oa.j.vc;if(this.state===olympe.L.Oa.j.Ug&&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.Gd.set(f,g);this.R=b.sessionId||null;He(this,a,d)}}}Pc(){this.F[0]-this.F[1]>this.Nd/2?
543
+ (this.G.debug('Ping did not get answer, try to reconnect'),O(this,olympe.L.Oa.j.Ug)):(this.F[0]=Date.now(),this.j.send('ping')||(this.G.debug('Impossible to send ping, try to reconnect'),O(this,olympe.L.Oa.j.Ug)))}ff(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.ea.j&&(b=performance.now()-this.ea.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=
544
544
  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.Hg?`stream[${h}][${k}]: ${JSON.stringify(n)}`:l===olympe.L.Me.Fh?`stream[${h}]:END`:`stream[${h}]:ERROR`;this.G.debug(`WS < ${JSON.stringify(c)}, ${d?g(d):''}`)}Be(this,a,'consumed',new Map,b);Be(this,a,'deserialized',(new Map).set('family',e));if(void 0!==d){var f=d.id;b=this.H.has(f);Ie(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}`),
545
- null;f=d.stream}this.D.has(a)&&({pn:d}=this.D.get(a),this.D.delete(a),null==d||d(c,f));a=this.ja.get(e);if(void 0!==a)for(const g of a.values())g(c,f);return null}mb(){const a=Date.now();for(const [b,{Vn:c}]of this.D)null!==c&&a-c>this.ta&&(this.G.warn(`No response was received from the server for the seqId = ${b}`),ye(this,b,'Message timeout: never receive acknowledge'))}};function Rd(a){return olympe.C.Qa(a.state)===olympe.L.uc.j.dj}
546
- function Je(a,b){const c=olympe.L.uc.j.Lm,d=olympe.L.uc.j.Df,e=olympe.L.uc.j.vc,f=olympe.L.uc.j.sw,g=b.get('reconnectionDelay');Ae(a.D,[olympe.L.Oa.j.INIT],()=>{Ke(a)?(a.state.update(c),a.connect().catch(h=>a.G.error(h))):a.D.disconnect().catch(h=>a.G.error(h))},!0);Ae(a.D,[olympe.L.Oa.j.vc],()=>{if(olympe.C.Qa(a.state)===f)a.G.info('Disconnected, from orchestrator for shutdown');else if(a.state.update(a.j?d:e),Ke(a)&&a.N){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.j?a.G.log(h):
547
- a.G.error(h);setTimeout(()=>a.connect().catch(k=>a.G.error(k)),g)}else a.G.info('Disconnected, stay offline.')});a.H.j(()=>{a.state.update(f);return Promise.resolve()},'Connectivity manager: shutdown state')}function Ke(a){return null===a.storage.get(a.F+'olympe_manual_offline')}
548
- 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.cc(Number).update(olympe.L.uc.j.INIT);this.j=f.get('offlineEnabled');this.N=f.get('offlineAutoBackOnline');this.F=f.get('storagePrefix');Je(this,f)}Wf(){const a=olympe.L.uc.j.dj,b=olympe.L.uc.j.Df,c=olympe.L.uc.j.vc;let d=olympe.C.da.j;return olympe.C.ua([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=
549
- this;return u(function*(){const b=olympe.L.uc.j.dj,c=olympe.L.uc.j.Lm;olympe.C.Qa(a.state)!==b&&(a.state.update(c),a.storage.delete(a.F+'olympe_manual_offline'),yield a.D.connect(),yield Le(),a.state.update(b))})}disconnect(){const a=this;return u(function*(){const b=olympe.L.uc.j.Df,c=olympe.L.uc.j.Lm;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)!==
550
- b&&(a.state.update(c),yield olympe.L.jh().disconnect(),yield a.D.disconnect())})}};olympe.L.uc.j={INIT:0,Lm:1,dj:2,Df:3,vc:4,sw:5};olympe.L.uc.D='olympe_manual_offline';olympe.L.ec=class{constructor(){this.R=this.Y=null}ga(a){a=this.D(a);this.Y=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.ec.j.Wl,a.valueOf().toISOString());case a instanceof Date:return this.format(olympe.L.ec.j.Wl,a.toISOString());case a instanceof olympe.C.Color:return this.format(olympe.L.ec.j.COLOR,
551
- a.toJSON());case a instanceof Map:return a=Object.fromEntries(Array.from(a).map(([c,d])=>[c,this.D(d)])),this.format(olympe.L.ec.j.vq,a);case a instanceof Set:return a=Array.from(a).map(this.D.bind(this)),this.format(olympe.L.ec.j.Zg,a);case Array.isArray(a):return a.map(this.D.bind(this));case a instanceof ArrayBuffer:return a=olympe.V.jf().j(new Uint8Array(a)),this.format(olympe.L.ec.j.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.V.jf().j(a),this.format(olympe.L.ec.j.ai,a);case Symbol.asyncIterator in
545
+ null;f=d.stream}this.D.has(a)&&({pn:d}=this.D.get(a),this.D.delete(a),null==d||d(c,f));a=this.ja.get(e);if(void 0!==a)for(const g of a.values())g(c,f);return null}mb(){const a=Date.now();for(const [b,{Vn:c}]of this.D)null!==c&&a-c>this.ta&&(this.G.warn(`No response was received from the server for the seqId = ${b}`),ye(this,b,'Message timeout: never receive acknowledge'))}};function Rd(a){return olympe.C.Qa(a.state)===olympe.L.uc.j.cj}
546
+ function Je(a,b){const c=olympe.L.uc.j.Lm,d=olympe.L.uc.j.Ef,e=olympe.L.uc.j.vc,f=olympe.L.uc.j.sw,g=b.get('reconnectionDelay');Ae(a.D,[olympe.L.Oa.j.INIT],()=>{Ke(a)?(a.state.update(c),a.connect().catch(h=>a.G.error(h))):a.D.disconnect().catch(h=>a.G.error(h))},!0);Ae(a.D,[olympe.L.Oa.j.vc],()=>{if(olympe.C.Qa(a.state)===f)a.G.info('Disconnected, from orchestrator for shutdown');else if(a.state.update(a.j?d:e),Ke(a)&&a.N){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.j?a.G.log(h):
547
+ 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 Ke(a){return null===a.storage.get(a.F+'olympe_manual_offline')}
548
+ 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.cc(Number).update(olympe.L.uc.j.INIT);this.j=f.get('offlineEnabled');this.N=f.get('offlineAutoBackOnline');this.F=f.get('storagePrefix');Je(this,f)}Wf(){const a=olympe.L.uc.j.cj,b=olympe.L.uc.j.Ef,c=olympe.L.uc.j.vc;let d=olympe.C.da.j;return olympe.C.ua([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=
549
+ this;return u(function*(){const b=olympe.L.uc.j.cj,c=olympe.L.uc.j.Lm;olympe.C.Qa(a.state)!==b&&(a.state.update(c),a.storage.delete(a.F+'olympe_manual_offline'),yield a.D.connect(),yield Le(),a.state.update(b))})}disconnect(){const a=this;return u(function*(){const b=olympe.L.uc.j.Ef,c=olympe.L.uc.j.Lm;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)!==
550
+ b&&(a.state.update(c),yield olympe.L.jh().disconnect(),yield a.D.disconnect())})}};olympe.L.uc.j={INIT:0,Lm:1,cj:2,Ef:3,vc:4,sw:5};olympe.L.uc.D='olympe_manual_offline';olympe.L.ec=class{constructor(){this.R=this.Y=null}ga(a){a=this.D(a);this.Y=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.ec.j.Wl,a.valueOf().toISOString());case a instanceof Date:return this.format(olympe.L.ec.j.Wl,a.toISOString());case a instanceof olympe.C.Color:return this.format(olympe.L.ec.j.COLOR,
551
+ a.toJSON());case a instanceof Map:return a=Object.fromEntries(Array.from(a).map(([c,d])=>[c,this.D(d)])),this.format(olympe.L.ec.j.vq,a);case a instanceof Set:return a=Array.from(a).map(this.D.bind(this)),this.format(olympe.L.ec.j.Zg,a);case Array.isArray(a):return a.map(this.D.bind(this));case a instanceof ArrayBuffer:return a=olympe.V.kf().j(new Uint8Array(a)),this.format(olympe.L.ec.j.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.V.kf().j(a),this.format(olympe.L.ec.j.ai,a);case Symbol.asyncIterator in
552
552
  a:if(!this.Y)throw Error('No stream handler has been set, so cannot serialize the asyncIterable.');let b;return this.format(olympe.L.ec.j.ke,null==(b=this.Y)?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.ec.j.Oq,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'===
553
- typeof a:return a}if(Array.isArray(a))return a.map(d=>this.j(d));if('object'!==typeof a)throw new olympe.error.jp(`Impossible to deserialize the following value: ${a}`);const {t:b,v:c}=a;switch(b){case olympe.L.ec.j.Wl:return new Date(c);case olympe.L.ec.j.COLOR:return olympe.C.Color.Qb(c);case olympe.L.ec.j.vq:return new Map(Object.entries(c).map(([e,f])=>[e,this.j(f)]));case olympe.L.ec.j.Zg:return new Set(c.map(e=>this.j(e)));case olympe.L.ec.j.ARRAY_BUFFER:return olympe.V.jf().D(c).buffer;case olympe.L.ec.j.ai:return olympe.V.jf().D(c);
554
- case olympe.L.ec.j.ke: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.ec.j.Oq:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.error.jp(`Impossible to deserialize the following value: ${c}`);}}format(a,b){return{t:a,v:b}}};olympe.L.ec.j={Wl:1,COLOR:2,vq:3,Zg:4,ARRAY_BUFFER:5,ai:6,ke:7,Oq:8};const Me=olympe.L.xa.j.SEND,Ne=olympe.L.xa.j.GET,Oe=olympe.L.xa.j.PUBLISH,Pe=olympe.L.xa.j.SUBSCRIBE,Qe=olympe.L.xa.j.hg,Re=olympe.L.xa.j.cs,Se=olympe.L.xa.j.Gr,Te=olympe.L.xa.j.zb,Ue=olympe.L.xa.j.ks,Ve=olympe.L.xa.j.mg;function Id(a,b){a.j||(a.j=hb(new olympe.V.bn(a.D.ff+3E4),c=>{let d;null==(d=a.H)||d.call(a,c)}));a.j.add(b)}
555
- function We(a){let b,c;const d=null!=(c=null==(b=a.j)?void 0:b.code)?c:olympe.error.mc.Wk;let e,f;a=null!=(f=null==(e=a.j)?void 0:e.reason)?f:'Unknown Error';return d===olympe.error.mc.TIMEOUT?new olympe.error.Vk(a):new olympe.error.pd(a,d)}function Xe(a,b){const c=olympe.L.xa.j.mg,d=olympe.L.xa.j.Zr;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.j.seq,b.jb(),b.jb(),d)}
556
- olympe.L.rb=class{constructor(a,b){this.D=olympe.L.jh();this.F=a;this.H=this.j=null;this.N=new olympe.C.Wb(`Service ${a}`,'function'===typeof b.Bb?b.Bb():b);this.G=olympe.ia.Za(`Service ${this.F}`)}ut(a){this.H=a;return this}stop(){this.N.destroy()}clear(){Wd(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.jh().request(a,
557
- a,Oe,b,!1)})}static Ws(a){const b=olympe.L.jh(),c=new olympe.L.Ek(a,b);be(b,a).then(d=>Ye(c,d)).catch(d=>olympe.ia.Za('Publisher for service '+a).error('Failed to get session id for publisher',d));return c}static send(a,b,c={}){return olympe.L.jh().request(a,a,Me,b,!0,c.timeout).then(d=>{switch(d.getType()){case Se:break;case Te:throw We(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.L.jh().request(a,a,Ne,b,!0,c.timeout).then(d=>{switch(d.getType()){case Ue:d=
558
- d.j;if(null!==d)return d;throw Error('No payload after request to service: '+a);case Te:throw We(d);default:throw Error('Unsupported response type for a GET request');}})}static observe(a,b,c,d={}){const e='function'===typeof b.Bb?b.Bb():b,f=olympe.L.jh(),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&&(ge(f,a,n,l),l=n=null);k&&(Wd(f,k).catch(q=>olympe.ia.Za('Service '+a).error('Failed to unsubscribe from a topic '+q)),k=null)};
559
- e.Yd(p);f.request(a,a,Pe,c,!0,d.timeout).then(q=>{switch(q.getType()){case Ve:Ye(g,q.jb());const r=q.j;k=r.topic;Xd(f,k,t=>{t.getType()===Oe?h.next(t.j):(h.error('Unsupported notification message. It should be a publish'),p())}).then(()=>{l=r.id;n=q.jb();fe(f,a,n,l,r.refresh,t=>h.error(t));Xe(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}`);p()});break;case Te:h.error(We(q));break;default:h.error('Unsupported response type for a SUBSCRIBE request')}}).catch(q=>
560
- h.error(q));return p})).pipe(tb(olympe.error.Qh,(h,k)=>{olympe.ia.Za(`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);Xd(this.D,this.F,this.R.bind(this,a),!1).catch(c=>{c='Failed to connect to the bus: '+c;this.G.error(c);a.error(Error(c))});return b})}zi(a){const b=this;return u(function*(){yield b.D.request(b.F,
561
- b.F,Oe,a,!1,b.D.mb)})}R(a,b){var c=new olympe.L.Fc(b,this.D,this);switch(b.getType()){case Qe:var d=c.body().filter(f=>{let g;return!(null==(g=this.j)?0:gb(g,f))});c.dd(d).catch(f=>this.G.error('Not able to validate subscription keep alive',f));break;case Re: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)}}};olympe.L.rb.prototype.multicast=olympe.L.rb.prototype.zi;olympe.L.rb.prototype.listen=olympe.L.rb.prototype.listen;
562
- olympe.L.rb.observe=olympe.L.rb.observe;olympe.L.rb.get=olympe.L.rb.get;olympe.L.rb.send=olympe.L.rb.send;olympe.L.rb.getPublisher=olympe.L.rb.Ws;olympe.L.rb.publish=olympe.L.rb.ld;olympe.L.rb.prototype.stop=olympe.L.rb.prototype.stop;olympe.L.rb.prototype.setUnsubscriptionHandler=olympe.L.rb.prototype.ut;olympe.L.Yq=class{constructor(a){this.j=0;this.buffer=[];this.size=null;this.stream=new olympe.V.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!==
563
- 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 Ye(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.xa.j.PUBLISH,a,!0)})}};olympe.L.Ek.prototype.publish=olympe.L.Ek.prototype.ld;olympe.L.Ee={Hg:1,ag:2,zb:3,Og:4,FA:5,nk:6,pc:7};olympe.L.sk={nk:1,Ow:2,mu:3,hg:5,aw:1,cE:2};olympe.L.Me={Hg:0,Fh:1,zb:2};olympe.L.Oa.j={INIT:'initialize',CONNECTING:'connecting',vc:'disconnected',ep:'disconnecting',ze:'connected',Ug:'reconnecting',Zk:'waking',no:'awake',zb:'error'};olympe.L.Oa.F={Rh:1,pu:-1,Fu:-2,Fw:-3};olympe.L.Oa.D={jj:0,cq:23};
553
+ typeof a:return a}if(Array.isArray(a))return a.map(d=>this.j(d));if('object'!==typeof a)throw new olympe.error.jp(`Impossible to deserialize the following value: ${a}`);const {t:b,v:c}=a;switch(b){case olympe.L.ec.j.Wl:return new Date(c);case olympe.L.ec.j.COLOR:return olympe.C.Color.Qb(c);case olympe.L.ec.j.vq:return new Map(Object.entries(c).map(([e,f])=>[e,this.j(f)]));case olympe.L.ec.j.Zg:return new Set(c.map(e=>this.j(e)));case olympe.L.ec.j.ARRAY_BUFFER:return olympe.V.kf().D(c).buffer;case olympe.L.ec.j.ai:return olympe.V.kf().D(c);
554
+ case olympe.L.ec.j.ke: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.ec.j.Oq:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.error.jp(`Impossible to deserialize the following value: ${c}`);}}format(a,b){return{t:a,v:b}}};olympe.L.ec.j={Wl:1,COLOR:2,vq:3,Zg:4,ARRAY_BUFFER:5,ai:6,ke:7,Oq:8};const Me=olympe.L.xa.j.SEND,Ne=olympe.L.xa.j.GET,Oe=olympe.L.xa.j.PUBLISH,Pe=olympe.L.xa.j.SUBSCRIBE,Qe=olympe.L.xa.j.ig,Re=olympe.L.xa.j.cs,Se=olympe.L.xa.j.Gr,Te=olympe.L.xa.j.zb,Ue=olympe.L.xa.j.ks,Ve=olympe.L.xa.j.ng;function Id(a,b){a.j||(a.j=hb(new olympe.V.bn(a.D.ff+3E4),c=>{let d;null==(d=a.H)||d.call(a,c)}));a.j.add(b)}
555
+ function We(a){let b,c;const d=null!=(c=null==(b=a.j)?void 0:b.code)?c:olympe.error.mc.Wk;let e,f;a=null!=(f=null==(e=a.j)?void 0:e.reason)?f:'Unknown Error';return d===olympe.error.mc.TIMEOUT?new olympe.error.Vk(a):new olympe.error.pd(a,d)}function Xe(a,b){const c=olympe.L.xa.j.ng,d=olympe.L.xa.j.Zr;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.j.seq,b.jb(),b.jb(),d)}
556
+ olympe.L.rb=class{constructor(a,b){this.D=olympe.L.jh();this.F=a;this.H=this.j=null;this.N=new olympe.C.Wb(`Service ${a}`,'function'===typeof b.Bb?b.Bb():b);this.G=olympe.ia.Ya(`Service ${this.F}`)}ut(a){this.H=a;return this}stop(){this.N.destroy()}clear(){Wd(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.jh().request(a,
557
+ a,Oe,b,!1)})}static Ws(a){const b=olympe.L.jh(),c=new olympe.L.Ek(a,b);be(b,a).then(d=>Ye(c,d)).catch(d=>olympe.ia.Ya('Publisher for service '+a).error('Failed to get session id for publisher',d));return c}static send(a,b,c={}){return olympe.L.jh().request(a,a,Me,b,!0,c.timeout).then(d=>{switch(d.getType()){case Se:break;case Te:throw We(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.L.jh().request(a,a,Ne,b,!0,c.timeout).then(d=>{switch(d.getType()){case Ue:d=
558
+ d.j;if(null!==d)return d;throw Error('No payload after request to service: '+a);case Te:throw We(d);default:throw Error('Unsupported response type for a GET request');}})}static observe(a,b,c,d={}){const e='function'===typeof b.Bb?b.Bb():b,f=olympe.L.jh(),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&&(ge(f,a,n,l),l=n=null);k&&(Wd(f,k).catch(q=>olympe.ia.Ya('Service '+a).error('Failed to unsubscribe from a topic '+q)),k=null)};
559
+ e.Yd(p);f.request(a,a,Pe,c,!0,d.timeout).then(q=>{switch(q.getType()){case Ve:Ye(g,q.jb());const r=q.j;k=r.topic;q.ack().catch(()=>olympe.ia.Ya('Service '+a).error('Failed to ack the msg'));Xd(f,k,t=>{t.getType()===Oe?h.next(t.j):(h.error('Unsupported notification message. It should be a publish'),p())}).then(()=>{l=r.id;n=q.jb();fe(f,a,n,l,r.refresh,t=>h.error(t));Xe(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}`);
560
+ p()});break;case Te:h.error(We(q));break;default:h.error('Unsupported response type for a SUBSCRIBE request')}}).catch(q=>h.error(q));return p})).pipe(tb(olympe.error.Qh,(h,k)=>{olympe.ia.Ya(`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);Xd(this.D,this.F,this.R.bind(this,a),!1).catch(c=>
561
+ {c='Failed to connect to the bus: '+c;this.G.error(c);a.error(Error(c))});return b})}yi(a){const b=this;return u(function*(){yield b.D.request(b.F,b.F,Oe,a,!1,b.D.mb)})}R(a,b){var c=new olympe.L.Fc(b,this.D,this);switch(b.getType()){case Qe:var d=c.body().filter(f=>{let g;return!(null==(g=this.j)?0:gb(g,f))});c.dd(d).catch(f=>this.G.error('Not able to validate subscription keep alive',f));break;case Re: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)}}};
562
+ olympe.L.rb.prototype.multicast=olympe.L.rb.prototype.yi;olympe.L.rb.prototype.listen=olympe.L.rb.prototype.listen;olympe.L.rb.observe=olympe.L.rb.observe;olympe.L.rb.get=olympe.L.rb.get;olympe.L.rb.send=olympe.L.rb.send;olympe.L.rb.getPublisher=olympe.L.rb.Ws;olympe.L.rb.publish=olympe.L.rb.ld;olympe.L.rb.prototype.stop=olympe.L.rb.prototype.stop;olympe.L.rb.prototype.setUnsubscriptionHandler=olympe.L.rb.prototype.ut;olympe.L.Yq=class{constructor(a){this.j=0;this.buffer=[];this.size=null;this.stream=new olympe.V.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!==
563
+ 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 Ye(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.xa.j.PUBLISH,a,!0)})}};olympe.L.Ek.prototype.publish=olympe.L.Ek.prototype.ld;olympe.L.Ee={Hg:1,bg:2,zb:3,Og:4,FA:5,nk:6,pc:7};olympe.L.sk={nk:1,Ow:2,mu:3,ig:5,aw:1,cE:2};olympe.L.Me={Hg:0,Fh:1,zb:2};olympe.L.Oa.j={INIT:'initialize',CONNECTING:'connecting',vc:'disconnected',ep:'disconnecting',ze:'connected',Ug:'reconnecting',Zk:'waking',no:'awake',zb:'error'};olympe.L.Oa.F={Rh:1,pu:-1,Fu:-2,Fw:-3};olympe.L.Oa.D={ij:0,cq:23};
564
564
  olympe.L.Oa.pc={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',
565
- 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',Ao:'com.BusManager',km:'com.HttpManager',Le:'com.Serializer',Da:'com.Logger',$g:'com.Source',ds:'com.Urls',AC:'com.peerFileSvcUrl'};
565
+ 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',Ao:'com.BusManager',km:'com.HttpManager',Le:'com.Serializer',Da:'com.Logger',$g:'com.Source',ds:'com.Urls',AC:'com.peerFileSvcUrl'};
566
566
  olympe.L.U={Yl:'defaultHost',kw:'server.host',mw:'server.port',nw:'server.ssl',Hr:'server.basePath',ps:'server.wsPath',Rm:'server.reconnectionDelay',$q:'server.pingInterval',ns:'server.messageTimeout',ur:'server.retryHttpOnOverload',Ol:'server.clientVersion',Kr:'server.serverVersion',ow:'server.wakeUpService',Nt:'bus.host',Ot:'bus.path',Pt:'bus.port',Rt:'bus.vhost',Qt:'bus.ssl',Eo:'bus.requestTimeout',Fo:'bus.subscriptionRefreshRate',Do:'bus.reconnectionDelay',zo:'bus.heartbeat',Bo:'bus.queueExpiration',
567
567
  Co:'bus.queuePrefetch',Il:'bus.allowGuest',$r:'bus.topicPrefix'};
568
568
  olympe.W.config(function(a){const b=olympe.host.Xg.Uh;E(a,olympe.L.U.Yl,a.getParameter(olympe.host.U.Pp));E(a,olympe.L.U.Hr,'OlympeServer');E(a,olympe.L.U.$r,'');Za(a,'com.hostConfig',[olympe.host.U.Jk,olympe.L.U.Yl,olympe.L.U.kw,olympe.L.U.mw,olympe.L.U.nw,olympe.L.U.Hr,olympe.L.U.Nt,olympe.L.U.Rt,olympe.L.U.Pt,olympe.L.U.Ot,olympe.L.U.Qt],(e,f,g,h,k,l,n,p,q,r,t)=>{var v=a.getParameter(olympe.net.U.xm);e=e===olympe.host.Xg.Uh;var x=['localhost','127.0.0.1'],y=f.endsWith(v),z=y&&e?`${f}-${b}`:f;const A=
569
569
  '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{Wn:g,Xn:null!=h?h:v?8080:z?e?85:80:443,Yn:null!=k?k:!z,qt:l,qx:n,vx:null!=p?p:f,tx:null!=q?q:A?x?15670:y?e?85:80:443:y?5672:5671,sx:null!=r?r:!x&&A?'/amqp/ws':'',ux:null!=t?t:!y}});E(a,olympe.L.U.ps,'websocket');E(a,olympe.L.U.Rm,5E3);E(a,olympe.L.U.$q,5E3);E(a,olympe.L.U.ns,3E4);E(a,olympe.L.U.ur,4E3);E(a,olympe.L.U.Kr,'7.5.2');
570
- E(a,olympe.L.U.Eo,6E4);E(a,olympe.L.U.Fo,6E4);E(a,olympe.L.U.Il,!1);E(a,olympe.L.U.Do,a.getParameter(olympe.L.U.Rm));E(a,olympe.L.U.zo,15);E(a,olympe.L.U.Bo,3E5);E(a,olympe.L.U.Co,20);const c=a.getParameter(olympe.xg.U.wp);if(void 0!==c)Va(a,olympe.L.U.Ol,c);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');D(a,olympe.L.P.Da,[olympe.ia.P.Ea],e=>e.cd('communication'));D(a,'server.WebSocketRequest',[new olympe.W.Eh('com.hostConfig'),new olympe.W.pa(olympe.L.U.ps)],
571
- (e,f)=>e.pipe(rxjs.operators.map(({Wn:g,Xn:h,Yn:k,qt:l})=>new olympe.net.pj(g,h,(l+'/'+f).replace(/\/+/g,'/').replace(/\/$/,''),k))).pipe(rxjs.operators.shareReplay(1)));D(a,'server.wakeUpRequest',[new olympe.W.Eh('com.hostConfig'),new olympe.W.pa(olympe.L.U.ow)],(e,f)=>e.pipe(rxjs.operators.map(({Wn:g,Xn:h,Yn:k})=>{if(null===f||void 0===f)return null;const l=f.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.pj(g,h,l,k)})).pipe(rxjs.operators.shareReplay(1)));const d=Array.from(Object.values(olympe.L.Xb));
572
- D(a,olympe.L.P.ds,[new olympe.W.Eh('com.hostConfig'),...d.map(e=>new olympe.W.pa(e))],(e,...f)=>e.pipe(rxjs.operators.map(({Wn:g,Xn:h,Yn:k,qt:l})=>{const n=d.map((p,q)=>{q=f[q];q=(new olympe.net.Ti(g,h,`${l}${q?'/'+q:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).j();return[p,q]});return new Map(n)})).pipe(rxjs.operators.shareReplay(1)));C(a,olympe.L.P.Le,olympe.L.ec);C(a,olympe.L.P.km,olympe.L.uu,olympe.L.P.Da,olympe.net.P.Ea,olympe.V.P.ig,olympe.L.P.ds,new olympe.W.pa(olympe.L.U.ur));D(a,'com.server.ManagerConfig',
573
- [new olympe.W.pa(olympe.L.U.$q),new olympe.W.pa(olympe.L.U.ns),new olympe.W.pa(olympe.L.U.Ol),new olympe.W.pa(olympe.L.U.Kr),new olympe.W.pa(olympe.dc.U.Zh)],(...e)=>{const f=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],g=new Map;e.forEach((h,k)=>g.set(f[k],h));return g});C(a,olympe.L.P.Nk,olympe.L.Oa,olympe.L.P.Da,olympe.net.P.Ea,olympe.host.P.Ge,olympe.host.P.Qk,'server.WebSocketRequest','server.wakeUpRequest',olympe.V.P.ig,'com.server.ManagerConfig');Za(a,
570
+ E(a,olympe.L.U.Eo,6E4);E(a,olympe.L.U.Fo,6E4);E(a,olympe.L.U.Il,!1);E(a,olympe.L.U.Do,a.getParameter(olympe.L.U.Rm));E(a,olympe.L.U.zo,15);E(a,olympe.L.U.Bo,3E5);E(a,olympe.L.U.Co,20);const c=a.getParameter(olympe.yg.U.wp);if(void 0!==c)Va(a,olympe.L.U.Ol,c);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');D(a,olympe.L.P.Da,[olympe.ia.P.Ea],e=>e.cd('communication'));D(a,'server.WebSocketRequest',[new olympe.W.Eh('com.hostConfig'),new olympe.W.pa(olympe.L.U.ps)],
571
+ (e,f)=>e.pipe(rxjs.operators.map(({Wn:g,Xn:h,Yn:k,qt:l})=>new olympe.net.oj(g,h,(l+'/'+f).replace(/\/+/g,'/').replace(/\/$/,''),k))).pipe(rxjs.operators.shareReplay(1)));D(a,'server.wakeUpRequest',[new olympe.W.Eh('com.hostConfig'),new olympe.W.pa(olympe.L.U.ow)],(e,f)=>e.pipe(rxjs.operators.map(({Wn:g,Xn:h,Yn:k})=>{if(null===f||void 0===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));
572
+ D(a,olympe.L.P.ds,[new olympe.W.Eh('com.hostConfig'),...d.map(e=>new olympe.W.pa(e))],(e,...f)=>e.pipe(rxjs.operators.map(({Wn:g,Xn:h,Yn:k,qt: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)));C(a,olympe.L.P.Le,olympe.L.ec);C(a,olympe.L.P.km,olympe.L.uu,olympe.L.P.Da,olympe.net.P.Ea,olympe.V.P.jg,olympe.L.P.ds,new olympe.W.pa(olympe.L.U.ur));D(a,'com.server.ManagerConfig',
573
+ [new olympe.W.pa(olympe.L.U.$q),new olympe.W.pa(olympe.L.U.ns),new olympe.W.pa(olympe.L.U.Ol),new olympe.W.pa(olympe.L.U.Kr),new olympe.W.pa(olympe.dc.U.Zh)],(...e)=>{const f=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],g=new Map;e.forEach((h,k)=>g.set(f[k],h));return g});C(a,olympe.L.P.Nk,olympe.L.Oa,olympe.L.P.Da,olympe.net.P.Ea,olympe.host.P.Ge,olympe.host.P.Qk,'server.WebSocketRequest','server.wakeUpRequest',olympe.V.P.jg,'com.server.ManagerConfig');Za(a,
574
574
  'com.bus.TopicPrefix',[olympe.host.U.Jk,olympe.L.U.$r],(e,f)=>e===olympe.host.Xg.Uh?`${b}-${f}`:f);D(a,'com.bus.ManagerConfig',[new olympe.W.Eh('com.hostConfig'),new olympe.W.Eh('com.bus.TopicPrefix'),new olympe.W.pa(olympe.L.U.Il),new olympe.W.pa(olympe.L.U.Eo),new olympe.W.pa(olympe.L.U.Fo),new olympe.W.pa(olympe.L.U.Do),new olympe.W.pa(olympe.L.U.Bo),new olympe.W.pa(olympe.L.U.Co),new olympe.W.pa(olympe.L.U.zo)],(e,f,g,h,k,l,n,p,q)=>{e=e.pipe(rxjs.operators.map(({qx:r,sx:t,tx:v,vx:x,ux:y})=>({host:r,
575
- yh:y,port:v,path:t,pA:x,lt:l,Uz:n,Vz:p,uz:h+3E4,bz:q})),rxjs.operators.shareReplay(1));return new Map([['connection',e],['topicPrefix',f],['allowGuest',g],['requestTimeout',h],['subscriptionsRefreshRate',k]])});C(a,olympe.L.P.Ao,olympe.L.Ll,olympe.L.P.Da,olympe.net.P.Ea,olympe.L.P.uf,olympe.auth.P.Ea,olympe.host.P.Ge,olympe.L.P.Le,olympe.V.P.ig,'com.bus.ManagerConfig');D(a,'com.connectivity.ManagerConfig',[olympe.net.P.Fm,olympe.Db.P.ah,new olympe.W.pa(olympe.L.U.Rm)],(e,...f)=>['storagePrefix','reconnectionDelay'].reduce((g,
576
- h,k)=>g.set(h,f[k]),e));C(a,olympe.L.P.uf,olympe.L.uc,olympe.L.P.Da,olympe.L.P.Nk,olympe.net.P.Ea,olympe.host.P.Ge,olympe.Db.P.ym,'com.connectivity.ManagerConfig')},'olympe.communication');olympe.W.run([olympe.L.P.Ao,olympe.L.P.uf],(a,b)=>{olympe.L.jh=()=>a;olympe.L.An=()=>b});olympe.auth={};function Ze(a,b){Fe(a.j);xe(a.j,olympe.L.Ee.Og,c=>{const d=c.c;d===olympe.auth.ud.j.qv?(a.j.le(),b(olympe.auth.Ua.D.Rj,c)):d===olympe.auth.ud.j.iw&&b(olympe.auth.Ua.D.Vp,c)},'logoutHandler')}
577
- function $e(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.Hd();h.access_token=af(b);g=`${re(a.Mh,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 Ce(a.j,
578
- olympe.L.Ee.Og,Object.assign({},{c:olympe.auth.ud.j.rv},d&&{idpName:d}),c)}function bf(a,b,c,d){olympe.C.Qa(a.H.getState())===olympe.L.uc.j.Df?d(new olympe.error.Wq,'Working offline'):(c.c=b,Ce(a.j,olympe.L.Ee.Og,c,d))}
579
- function cf(a,b,c){if(b.Ng()!==olympe.auth.Ec.j.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.Cf()}&access_token=${af(b)}`;d=`${re(a.Mh,olympe.L.Xb.wk)}/refresh${d}`;d=Ic(N(d),olympe.net.wa.ResponseType.JSON);te(a.Mh,d,b.Hd()).then(e=>{(e=e.getData())?(e=new olympe.auth.zk(b.yc(),b.ue(),b.Hd(),e,b.Cf()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
580
- olympe.auth.ud=class{constructor(a,b,c,d,e,f){this.G=a;this.j=b;this.Mh=c;this.H=d;this.D=e;this.F=f;df(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){Ce(this.j,olympe.L.Ee.Og,{c:olympe.auth.ud.j.hg},b=>a(b))}rh(a,b,c){const d=re(this.Mh,olympe.L.Xb.gs);
581
- a=N(`${d}/${a}`);te(this.Mh,a,b).then(e=>c(null,e.getData())).catch(e=>c(Error(e)))}};olympe.auth.ud.j={Og:1,rv:2,zb:3,hg:5,jj:6,yu:10,ww:11,Ct:12,SAML:13,iw:14,qv:20};function he(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.V.oi());a.Y.set(c,b)}function de(a){return olympe.C.Qa(a.ed.tb())}
582
- function Le(){var a=olympe.auth.re();const b=olympe.auth.Ua.j.Sj,c=olympe.auth.Ua.j.INIT;ef(a,b);a.ja?(a.j=olympe.auth.Ua.F.Bt,a.G.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),ff(a)):(a.j=olympe.auth.Ua.F.Hf,a.G.log('Connector online, attempting to log with token'),gf(a));return rxjs.firstValueFrom(a.state.tb().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
583
- function hf(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&&jf(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.ta.getState()],c=>{switch(c){case olympe.L.uc.j.Df:a.j=olympe.auth.Ua.F.Hf;a.G.log('Connector offline, attempting to recover sessions from current token');
584
- gf(a);break;case olympe.L.uc.j.vc:switch(olympe.C.Qa(a.state)){case olympe.auth.Ua.j.rf:c=olympe.C.Qa(a.ed).yc();kf(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ua.j.Qi:a.G.info('Disconnected from server - guest session lost');break;case olympe.auth.Ua.j.Sj:kf(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Ua.j.INIT:kf(a,'Cannot open auth session - no server connection');break;default:kf(a,'Should not get there, investigate',!0)}}});
585
- Ze(a.D,(c,d)=>{if(c===olympe.auth.Ua.D.Rj){kf(a,'authentication revoked');let e;null==(e=a.storage)||lf(e).catch(f=>a.G.error('Failed to clear token',f));a.Y.forEach(f=>{f(c,d)})}else if(c===olympe.auth.Ua.D.Vp){a.G.info('Redirection to IDP to invalidate token (SAML)');de(a);let e;null==(e=a.storage)||lf(e).catch(f=>a.G.error('Failed to clear token',f));a.Ja.D()}else throw Error(`Unknown logout step coming from server : ${c}`);});a.ea=mf(a);a.H.j(()=>a.yi().catch(c=>a.G.error(`Failed to logout ${c}`)),
586
- 'Logout');a.G.log('DONE initializing AUTH layer (waiting for connector to be online)')}function nf(a,b){let c=null;olympe.C.Hj(a.state.tb().Kd(olympe.auth.Ua.j.rf).and(b),()=>{const d=de(a);!of(a)&&d&&(c=a.Zd.get(d.Ng()).H(d,(e,f)=>{e?(a.G.error('Failed to refresh token, error message: ',e.message),a.yi().catch(g=>a.G.error(`Failed to logout after wrong refresh ${g}`))):f&&pf(a,f)}))},()=>{let d;null==(d=c)||d()})}
587
- function gf(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.yc();e.set('username',c);c=e;var d=b.Hd();c.set('nonce',d);'string'===typeof b.Cf()&&e.set('idpName',b.Cf());a.G.debug('Token found, trying login with',e);qf(a,e,olympe.auth.Ec.j.Gm)}else kf(a,'No token found, cannot perform auto login')}).catch(b=>{kf(a,b.message,!0)})):kf(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
588
- !0)}function kf(a,b,c=!1){a.ed.update(a.R);ef(a,olympe.auth.Ua.j.Qi);b=`Authenticated as guest (${b})`;c?a.G.error(b):a.G.info(b)}function mf(a){const b=[olympe.auth.Ua.j.rf];a.ja||b.push(olympe.auth.Ua.j.Qi);return a.H.D(()=>{const c=rf(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 ef(a,b){a.G.log('State change: ',rf(a),'--\x3e',b);a.state.update(b)}
589
- function ff(a){if(a.N){const b=new olympe.auth.Request;b.set('username',a.N);b.set('password',a.bb);a.G.log('Autologin with user "'+a.N+'"');qf(a,b)}else kf(a,'No user specified for auto login',!0)}function of(a){return olympe.C.Qa(a.ed)===a.R}function pf(a,b){if(b){a.ed.update(b);let c;null==(c=a.storage)||jf(c,b).catch(d=>a.G.error(d));a.G.debug('Token updated')}}function rf(a){return olympe.C.Qa(a.state.tb())}function sf(){var a=olympe.public.Na.get();return new Map(a.D.j.Gd)}
575
+ yh:y,port:v,path:t,pA:x,lt:l,Uz:n,Vz:p,uz:h+3E4,bz:q})),rxjs.operators.shareReplay(1));return new Map([['connection',e],['topicPrefix',f],['allowGuest',g],['requestTimeout',h],['subscriptionsRefreshRate',k]])});C(a,olympe.L.P.Ao,olympe.L.Ll,olympe.L.P.Da,olympe.net.P.Ea,olympe.L.P.vf,olympe.auth.P.Ea,olympe.host.P.Ge,olympe.L.P.Le,olympe.V.P.jg,'com.bus.ManagerConfig');D(a,'com.connectivity.ManagerConfig',[olympe.net.P.Fm,olympe.Db.P.ah,new olympe.W.pa(olympe.L.U.Rm)],(e,...f)=>['storagePrefix','reconnectionDelay'].reduce((g,
576
+ 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.Ea,olympe.host.P.Ge,olympe.Db.P.ym,'com.connectivity.ManagerConfig')},'olympe.communication');olympe.W.run([olympe.L.P.Ao,olympe.L.P.vf],(a,b)=>{olympe.L.jh=()=>a;olympe.L.An=()=>b});olympe.auth={};function Ze(a,b){Fe(a.j);xe(a.j,olympe.L.Ee.Og,c=>{const d=c.c;d===olympe.auth.ud.j.qv?(a.j.le(),b(olympe.auth.Ua.D.Rj,c)):d===olympe.auth.ud.j.iw&&b(olympe.auth.Ua.D.Vp,c)},'logoutHandler')}
577
+ function $e(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.Hd();h.access_token=af(b);g=`${re(a.Mh,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 Ce(a.j,
578
+ olympe.L.Ee.Og,Object.assign({},{c:olympe.auth.ud.j.rv},d&&{idpName:d}),c)}function bf(a,b,c,d){olympe.C.Qa(a.H.getState())===olympe.L.uc.j.Ef?d(new olympe.error.Wq,'Working offline'):(c.c=b,Ce(a.j,olympe.L.Ee.Og,c,d))}
579
+ function cf(a,b,c){if(b.Ng()!==olympe.auth.Ec.j.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.Df()}&access_token=${af(b)}`;d=`${re(a.Mh,olympe.L.Xb.wk)}/refresh${d}`;d=Ic(N(d),olympe.net.wa.ResponseType.JSON);te(a.Mh,d,b.Hd()).then(e=>{(e=e.getData())?(e=new olympe.auth.zk(b.yc(),b.ue(),b.Hd(),e,b.Df()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
580
+ olympe.auth.ud=class{constructor(a,b,c,d,e,f){this.G=a;this.j=b;this.Mh=c;this.H=d;this.D=e;this.F=f;df(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){Ce(this.j,olympe.L.Ee.Og,{c:olympe.auth.ud.j.ig},b=>a(b))}rh(a,b,c){const d=re(this.Mh,olympe.L.Xb.gs);
581
+ a=N(`${d}/${a}`);te(this.Mh,a,b).then(e=>c(null,e.getData())).catch(e=>c(Error(e)))}};olympe.auth.ud.j={Og:1,rv:2,zb:3,ig:5,ij:6,yu:10,ww:11,Ct:12,SAML:13,iw:14,qv:20};function he(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.V.oi());a.R.set(c,b)}function de(a){return olympe.C.Qa(a.ed.tb())}
582
+ function Le(){var a=olympe.auth.re();const b=olympe.auth.Ua.j.Sj,c=olympe.auth.Ua.j.INIT;ef(a,b);a.ja?(a.j=olympe.auth.Ua.F.Bt,a.G.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),ff(a)):(a.j=olympe.auth.Ua.F.If,a.G.log('Connector online, attempting to log with token'),gf(a));return rxjs.firstValueFrom(a.state.tb().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
583
+ function hf(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&&jf(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.ta.getState()],c=>{switch(c){case olympe.L.uc.j.Ef:a.j=olympe.auth.Ua.F.If;a.G.log('Connector offline, attempting to recover sessions from current token');
584
+ gf(a);break;case olympe.L.uc.j.vc:switch(olympe.C.Qa(a.state)){case olympe.auth.Ua.j.sf:c=olympe.C.Qa(a.ed).yc();kf(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ua.j.Pi:a.G.info('Disconnected from server - guest session lost');break;case olympe.auth.Ua.j.Sj:kf(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Ua.j.INIT:kf(a,'Cannot open auth session - no server connection');break;default:kf(a,'Should not get there, investigate',!0)}}});
585
+ Ze(a.D,(c,d)=>{if(c===olympe.auth.Ua.D.Rj){kf(a,'authentication revoked');let e;null==(e=a.storage)||lf(e).catch(f=>a.G.error('Failed to clear token',f));a.R.forEach(f=>{f(c,d)})}else if(c===olympe.auth.Ua.D.Vp){a.G.info('Redirection to IDP to invalidate token (SAML)');de(a);let e;null==(e=a.storage)||lf(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.$=mf(a);a.G.log('DONE initializing AUTH layer (waiting for connector to be online)')}
586
+ function nf(a,b){let c=null;olympe.C.Gj(a.state.tb().Kd(olympe.auth.Ua.j.sf).and(b),()=>{const d=de(a);!of(a)&&d&&(c=a.Zd.get(d.Ng()).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&&pf(a,f)}))},()=>{let d;null==(d=c)||d()})}
587
+ function gf(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.yc();e.set('username',c);c=e;var d=b.Hd();c.set('nonce',d);'string'===typeof b.Df()&&e.set('idpName',b.Df());a.G.debug('Token found, trying login with',e);qf(a,e,olympe.auth.Ec.j.Gm)}else kf(a,'No token found, cannot perform auto login')}).catch(b=>{kf(a,b.message,!0)})):kf(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
588
+ !0)}function kf(a,b,c=!1){a.ed.update(a.N);ef(a,olympe.auth.Ua.j.Pi);b=`Authenticated as guest (${b})`;c?a.G.error(b):a.G.info(b)}function mf(a){const b=[olympe.auth.Ua.j.sf];a.ja||b.push(olympe.auth.Ua.j.Pi);return a.ea.j(()=>{const c=rf(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 ef(a,b){a.G.log('State change: ',rf(a),'--\x3e',b);a.state.update(b)}
589
+ function ff(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+'"');qf(a,b)}else kf(a,'No user specified for auto login',!0)}function of(a){return olympe.C.Qa(a.ed)===a.N}function pf(a,b){if(b){a.ed.update(b);let c;null==(c=a.storage)||jf(c,b).catch(d=>a.G.error(d));a.G.debug('Token updated')}}function rf(a){return olympe.C.Qa(a.state.tb())}function sf(){var a=olympe.public.Na.get();return new Map(a.D.j.Gd)}
590
590
  function tf(a,b,c,d=!1){b=b+c?':'+c.message:'';a.G.error(b);a.error.update(olympe.C.xb(b));ef(a,olympe.auth.Ua.j.zb);if(d)throw Error(b);}function qf(a,b,c,d){void 0===c&&(c=a.mb);void 0===c&&tf(a,'No authentication provider specified',null,!0);const e=a.Zd.get(c);e||tf(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.Eb.bind(a));ef(a,olympe.auth.Ua.j.Sj)}
591
591
  function uf(a,b,c){a.F.forEach(d=>{d(b,c)})}
592
- olympe.auth.Ua=class{constructor(a,b,c,d,e,f,g,h,k){this.G=a;this.ta=b;this.D=c;this.storage=d;this.Ja=e;this.mb=k.get('defaultProvider');this.ja=!!k.get('autoLogin');this.N=k.get('autoUser');this.bb=k.get('autoPassword');this.Yb=k.get('autoToken');this.Zd=new Map;this.H=f;this.ea='';this.state=olympe.C.cc(String).update(olympe.auth.Ua.j.INIT);this.error=olympe.C.cc(olympe.C.Ta);this.j=null;this.R=new olympe.auth.fh('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.ed=olympe.C.cc(olympe.auth.fh).update(this.R);
593
- this.F=new Map;this.Y=new Map;this.$=new olympe.V.$h(k.get('cacheTokenTimeout'));h.forEach(l=>{const n=l.F();if(this.Zd.has(n))throw Error('Provider "'+n+'" has already been registered !');this.Zd.set(n,l)});hf(this);nf(this,g.j())}ql(){const a=olympe.auth.Ua.j.rf,b=olympe.auth.Ua.j.Qi,c=olympe.auth.Ua.j.zb,d=olympe.C.cc(olympe.C.da);olympe.C.Vc([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()});
594
- return d.tb()}yg(a){if(olympe.C.Qa(this.state)===olympe.auth.Ua.j.rf){var b=de(this);!of(this)&&b&&this.Zd.get(b.Ng()).yg(b,(c,d)=>{c?(this.G.error('Failed to refresh token, error message: ',c.message),this.yi().catch(e=>this.G.error(`Failed to logout after wrong refresh ${e}`))):d&&pf(this,d);a(c)})}}getState(){return this.state.tb()}yc(){return this.ed.tb().yc()}ue(){return this.ed.tb().ue()}si(){return this.ed.tb().si()}rh(a,b){if(gb(this.$.j,a))b(null,this.$.get(a));else{var c,d=null==(c=olympe.C.Qa(this.ed.tb()))?
595
- void 0:c.Hd();this.D.rh(a,d,(e,f)=>{'string'===typeof f&&this.$.set(a,f);b(e,f)})}}yi(){return of(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)||lf(c).catch(d=>this.G.error('Failed to clear token',d));$e(this.D,de(this),d=>{d?(tf(this,'Logout request rejected:',d),b(d)):(this.G.debug('Logout request acknowledged'),a())});this.H.F(this.ea)})}qf(a){rf(this)===olympe.auth.Ua.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)})}Eb(a,b){const c=null===this.j?olympe.auth.Ua.F.yv:this.j;this.j=null;if(!a||a instanceof olympe.error.Wq){null===a?this.G.info(`User ${b.yc()} (#${b.ue()}) successfully authenticated`):this.G.info(`User ${b.yc()} (#${b.ue()}) recovered from token, while offline`);this.ed.update(b);ef(this,olympe.auth.Ua.j.rf);uf(this,a,c);let d;null==(d=this.storage)||jf(d,b).catch(e=>this.G.error(e))}else{let d;
597
- null==(d=this.storage)||lf(d).catch(e=>this.G.error(e));this.error.update(olympe.C.xb(a.message));kf(this,'authentication rejected: '+a.message);uf(this,a,c)}this.F.has('login')&&this.F.delete('login')}};olympe.auth.Ua.j={INIT:'init',Sj:'authenticating',Qi:'guest',rf:'authenticated',zb:'error'};olympe.auth.Ua.F={yv:'manual',Bt:'auto',Hf:'tokenOnFirstConnection'};olympe.auth.Ua.D={Rj:'accepted',Vp:'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.qf(d=>{d?b(d,null):(b(null,null),c())}),this.D.j.wd)};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',Gm:'olympeToken'};function vf(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.gh&&(a=a.Ca.Fb);return a?a.valueOf():a}yc(){return this.get('username')}Hd(){return this.get('nonce')}toString(){return this.yc()+(this.Hd()?' with nonce':'')+(this.get('password')?' with password':'')+(vf(this)?` with idp name ${vf(this)}`:'')}};olympe.auth.fh=class{constructor(a,b,c,d={},e=null){this.user=a;this.Ci=b;this.D=c;this.j=e;this.F=d}yc(){return this.user}ue(){return this.Ci}Hd(){return this.D}Wi(){return this.F}si(){return null}Cf(){return this.j}ga(){const a=olympe.V.jf(),b=Object.assign({},{user:this.user,userTag:this.Ci,nonce:this.D},this.j&&{idpName:this.j},{payload:this.F});return olympe.V.ws(bb(a,JSON.stringify(b)))}Ng(){return olympe.auth.Ec.j.SRP}};m=olympe.auth.fh.prototype;m.yc.K=new olympe.C.J(()=>String,[]);
598
- m.ue.K=new olympe.C.J(()=>String,[]);m.Hd.K=new olympe.C.J(()=>String,[]);m.Wi.K=new olympe.C.J(()=>Object,[]);m.si.K=new olympe.C.J(()=>String,[]);m.Cf.K=new olympe.C.J(()=>String,[]);m.ga.K=new olympe.C.J(()=>String,[]);m.Ng.K=new olympe.C.J(()=>String,[]);function af(a){return a.Wi().access_token||null}function wf(a){return 1E3*parseInt(a.Wi().access_token_exp||'0',10)}olympe.auth.zk=class extends olympe.auth.fh{constructor(a,b,c,d,e){super(a,b,c,d,e);this.H=Date.now()}si(){return af(this)}Ng(){return olympe.auth.Ec.j.OAUTH2}};olympe.auth.Er=class extends olympe.auth.fh{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.H=d}si(){return this.H}Ng(){return olympe.auth.Ec.j.SAML}ga(){const a=olympe.V.jf(),b=Object.assign({},{user:this.yc(),userTag:this.ue(),nonce:this.Hd()},this.Cf()&&{idpName:this.Cf()},{payload:this.Wi(),fullToken:this.H});return olympe.V.ws(bb(a,JSON.stringify(b)))}};function df(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function jf(a,b){return wb(a.D,()=>a.db.set('main','string'===typeof b?b:b.ga(),a.j).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function lf(a){return wb(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}`)}))}
592
+ olympe.auth.Ua=class{constructor(a,b,c,d,e,f,g,h,k){this.G=a;this.ta=b;this.D=c;this.storage=d;this.Ha=e;this.mb=k.get('defaultProvider');this.ja=!!k.get('autoLogin');this.H=k.get('autoUser');this.Wa=k.get('autoPassword');this.Yb=k.get('autoToken');this.Zd=new Map;this.ea=f;this.$='';this.state=olympe.C.cc(String).update(olympe.auth.Ua.j.INIT);this.error=olympe.C.cc(olympe.C.Ta);this.j=null;this.N=new olympe.auth.fh('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.ed=olympe.C.cc(olympe.auth.fh).update(this.N);
593
+ this.F=new Map;this.R=new Map;this.Y=new olympe.V.$h(k.get('cacheTokenTimeout'));h.forEach(l=>{const n=l.F();if(this.Zd.has(n))throw Error('Provider "'+n+'" has already been registered !');this.Zd.set(n,l)});hf(this);nf(this,g.j())}ql(){const a=olympe.auth.Ua.j.sf,b=olympe.auth.Ua.j.Pi,c=olympe.auth.Ua.j.zb,d=olympe.C.cc(olympe.C.da);olympe.C.Vc([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()});
594
+ return d.tb()}zg(a){if(olympe.C.Qa(this.state)===olympe.auth.Ua.j.sf){var b=de(this);!of(this)&&b&&this.Zd.get(b.Ng()).zg(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&&pf(this,d);a(c)})}}getState(){return this.state.tb()}yc(){return this.ed.tb().yc()}ue(){return this.ed.tb().ue()}si(){return this.ed.tb().si()}rh(a,b){if(gb(this.Y.j,a))b(null,this.Y.get(a));else{var c,d=null==(c=olympe.C.Qa(this.ed.tb()))?
595
+ void 0:c.Hd();this.D.rh(a,d,(e,f)=>{'string'===typeof f&&this.Y.set(a,f);b(e,f)})}}Jj(){return of(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)||lf(c).catch(d=>this.G.error('Failed to clear token',d));$e(this.D,de(this),d=>{d?(tf(this,'Logout request rejected:',d),b(d)):(this.G.debug('Logout request acknowledged'),a())});this.ea.D(this.$)})}rf(a){rf(this)===olympe.auth.Ua.j.sf&&
596
+ this.D.rf(b=>{b&&this.G.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}Eb(a,b){const c=null===this.j?olympe.auth.Ua.F.yv:this.j;this.j=null;if(!a||a instanceof olympe.error.Wq){null===a?this.G.info(`User ${b.yc()} (#${b.ue()}) successfully authenticated`):this.G.info(`User ${b.yc()} (#${b.ue()}) recovered from token, while offline`);this.ed.update(b);ef(this,olympe.auth.Ua.j.sf);uf(this,a,c);let d;null==(d=this.storage)||jf(d,b).catch(e=>this.G.error(e))}else{let d;
597
+ null==(d=this.storage)||lf(d).catch(e=>this.G.error(e));this.error.update(olympe.C.xb(a.message));kf(this,'authentication rejected: '+a.message);uf(this,a,c)}this.F.has('login')&&this.F.delete('login')}};olympe.auth.Ua.j={INIT:'init',Sj:'authenticating',Pi:'guest',sf:'authenticated',zb:'error'};olympe.auth.Ua.F={yv:'manual',Bt:'auto',If:'tokenOnFirstConnection'};olympe.auth.Ua.D={Rj:'accepted',Vp:'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.wd)};c();return()=>{this.j&&clearTimeout(this.j);this.j=null}}zg(a,b){this.D.rf(c=>{b(c,null)})}};olympe.auth.Ec.j={SAML:'saml',OAUTH2:'openID',SRP:'srp',Gm:'olympeToken'};function vf(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.gh&&(a=a.Ca.Fb);return a?a.valueOf():a}yc(){return this.get('username')}Hd(){return this.get('nonce')}toString(){return this.yc()+(this.Hd()?' with nonce':'')+(this.get('password')?' with password':'')+(vf(this)?` with idp name ${vf(this)}`:'')}};olympe.auth.fh=class{constructor(a,b,c,d={},e=null){this.user=a;this.Bi=b;this.D=c;this.j=e;this.F=d}yc(){return this.user}ue(){return this.Bi}Hd(){return this.D}Vi(){return this.F}si(){return null}Df(){return this.j}ga(){const a=olympe.V.kf(),b=Object.assign({},{user:this.user,userTag:this.Bi,nonce:this.D},this.j&&{idpName:this.j},{payload:this.F});return olympe.V.ws(bb(a,JSON.stringify(b)))}Ng(){return olympe.auth.Ec.j.SRP}};m=olympe.auth.fh.prototype;m.yc.K=new olympe.C.J(()=>String,[]);
598
+ m.ue.K=new olympe.C.J(()=>String,[]);m.Hd.K=new olympe.C.J(()=>String,[]);m.Vi.K=new olympe.C.J(()=>Object,[]);m.si.K=new olympe.C.J(()=>String,[]);m.Df.K=new olympe.C.J(()=>String,[]);m.ga.K=new olympe.C.J(()=>String,[]);m.Ng.K=new olympe.C.J(()=>String,[]);function af(a){return a.Vi().access_token||null}function wf(a){return 1E3*parseInt(a.Vi().access_token_exp||'0',10)}olympe.auth.zk=class extends olympe.auth.fh{constructor(a,b,c,d,e){super(a,b,c,d,e);this.H=Date.now()}si(){return af(this)}Ng(){return olympe.auth.Ec.j.OAUTH2}};olympe.auth.Er=class extends olympe.auth.fh{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.H=d}si(){return this.H}Ng(){return olympe.auth.Ec.j.SAML}ga(){const a=olympe.V.kf(),b=Object.assign({},{user:this.yc(),userTag:this.ue(),nonce:this.Hd()},this.Df()&&{idpName:this.Df()},{payload:this.Vi(),fullToken:this.H});return olympe.V.ws(bb(a,JSON.stringify(b)))}};function df(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function jf(a,b){return wb(a.D,()=>a.db.set('main','string'===typeof b?b:b.ga(),a.j).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function lf(a){return wb(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
599
  olympe.auth.It=class{constructor(a,b,c){this.F=a;this.G=b;this.j='OlympeToken-'+c.j;this.D=new olympe.V.promise.Tk;this.db=this.F.D('AUTH')}te(){this.G.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.j}`);return wb(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=cb(olympe.V.jf().D(olympe.V.ox(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.Er(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.fh(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',Th:'POST'};olympe.auth.qo=class{constructor(a){this.j=a||'default'}};olympe.auth.Zd={};function xf(a,b,c){bf(a.D,olympe.auth.ud.j.Og,{token:b.Hd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.ud.j.zb:c(Error('Invalid token'),null);break;case olympe.auth.ud.j.jj: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.Er(f,g,h,e.samlToken,k,vf(b)):'openid'===l&&(d=new olympe.auth.zk(f,g,h,k,vf(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
601
- olympe.auth.Zd.xv=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.storage=c}F(){return olympe.auth.Ec.j.Gm}te(a,b){this.storage.te().then(c=>{xf(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function yf(a,b,c){var d=wf(b);const e=Math.max(d-b.H,0),f=olympe.W.getParameter(olympe.auth.U.Yr);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.Zd.Ov=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=vf(a)?`idpName=${vf(a)}&`:'';this.N.redirect(`${this.R}/auth?${a}url=${b}`,null,olympe.auth.Lk.j.GET)}H(a,b){0<wf(a)?this.j=yf(this,a,b):b(null,a);return this.Y.bind(this)}yg(a,b){cf(this.D,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.j&&(this.j=yf(this,d,b)))})}Y(){this.j&&clearTimeout(this.j);this.j=null}};function zf(a,b){bf(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.Zd.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){zf(this,c=>{c?b(c,null):this.N.D(vf(a))})}};function Af(a,b,c){const d=olympe.auth.ud.j.yu,e=olympe.auth.ud.j.zb,f=olympe.auth.ud.j.ww,g={I:b.yc()};bf(a.D,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.yc()}' 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 Bf(a,b,c){const d=olympe.auth.ud.j.Ct,e=olympe.auth.ud.j.zb,f=olympe.auth.ud.j.jj;b={A:b.get('a'),M:b.get('m1'),I:b.yc()};bf(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.fh(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
604
- null)}})}olympe.auth.Zd.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');Af(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.yc(),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');Bf(this,a,b)}})}};olympe.auth.P={Ea:'auth.Manager',Da:'auth.Logger',ij:'auth.Storage',Cl:'auth.appNameToken',Hk:'auth.Redirector',Ir:'auth.ServerConnector'};olympe.auth.U={Zl:'auth.defaultProvider',ko:'auth.autoLogin',mo:'auth.autoUser',lo:'auth.autoPassword',Hf:'auth.token',Io:'auth.cacheTokenTimeout',Yr:'auth.tokenDurationPercentage'};
605
- olympe.W.config(function(a){E(a,olympe.auth.U.Zl,olympe.auth.Ec.j.SRP);E(a,olympe.auth.U.ko,!1);E(a,olympe.auth.U.mo,'');E(a,olympe.auth.U.lo,'');E(a,olympe.auth.U.Hf,'');E(a,olympe.auth.U.Yr,50);E(a,olympe.auth.U.Io,3E5);D(a,olympe.auth.P.Da,[olympe.ia.P.Ea],b=>b.cd('auth'));C(a,olympe.auth.P.Cl,olympe.auth.qo,olympe.Db.P.ah);C(a,olympe.auth.P.ij,olympe.auth.It,olympe.Db.P.qk,olympe.auth.P.Da,olympe.auth.P.Cl);C(a,olympe.auth.P.Ir,olympe.auth.ud,olympe.auth.P.Da,olympe.L.P.Nk,olympe.L.P.km,olympe.L.P.uf,
606
- olympe.auth.P.Hk,olympe.auth.P.ij);Ya(a,olympe.auth.P.Hk);D(a,olympe.auth.P.Ea,[olympe.auth.P.Da,olympe.L.P.uf,olympe.auth.P.Ir,olympe.host.P.Ge,olympe.host.P.Qk,new olympe.W.rb(olympe.auth.P.ij,olympe.W.Bh.j.Cm),new olympe.W.rb(olympe.auth.P.Hk,olympe.W.Bh.j.Cm),new olympe.W.pa(olympe.auth.U.Zl),new olympe.W.pa(olympe.auth.U.ko),new olympe.W.pa(olympe.auth.U.mo),new olympe.W.pa(olympe.auth.U.lo),new olympe.W.pa(olympe.auth.U.Hf),new olympe.W.pa(olympe.auth.U.Io)],(b,c,d,e,f,g,h,k,l,n,p,q,r)=>{const t=
600
+ d.parse;var f=cb(olympe.V.kf().D(olympe.V.ox(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.Er(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.fh(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',Th:'POST'};olympe.auth.qo=class{constructor(a){this.j=a||'default'}};olympe.auth.Zd={};function xf(a,b,c){bf(a.D,olympe.auth.ud.j.Og,{token:b.Hd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.ud.j.zb: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.Er(f,g,h,e.samlToken,k,vf(b)):'openid'===l&&(d=new olympe.auth.zk(f,g,h,k,vf(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
601
+ olympe.auth.Zd.xv=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.storage=c}F(){return olympe.auth.Ec.j.Gm}te(a,b){this.storage.te().then(c=>{xf(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function yf(a,b,c){var d=wf(b);const e=Math.max(d-b.H,0),f=olympe.W.getParameter(olympe.auth.U.Yr);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.zg(b,c)},d);a.zg(b,c);return null}
602
+ olympe.auth.Zd.Ov=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=vf(a)?`idpName=${vf(a)}&`:'';this.N.redirect(`${this.R}/auth?${a}url=${b}`,null,olympe.auth.Lk.j.GET)}H(a,b){0<wf(a)?this.j=yf(this,a,b):b(null,a);return this.Y.bind(this)}zg(a,b){cf(this.D,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.j&&(this.j=yf(this,d,b)))})}Y(){this.j&&clearTimeout(this.j);this.j=null}};function zf(a,b){bf(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.Zd.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){zf(this,c=>{c?b(c,null):this.N.D(vf(a))})}};function Af(a,b,c){const d=olympe.auth.ud.j.yu,e=olympe.auth.ud.j.zb,f=olympe.auth.ud.j.ww,g={I:b.yc()};bf(a.D,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.yc()}' 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 Bf(a,b,c){const d=olympe.auth.ud.j.Ct,e=olympe.auth.ud.j.zb,f=olympe.auth.ud.j.ij;b={A:b.get('a'),M:b.get('m1'),I:b.yc()};bf(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.fh(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
604
+ null)}})}olympe.auth.Zd.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');Af(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.yc(),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');Bf(this,a,b)}})}};olympe.auth.P={Ea:'auth.Manager',Da:'auth.Logger',hj:'auth.Storage',Cl:'auth.appNameToken',Hk:'auth.Redirector',Ir:'auth.ServerConnector'};olympe.auth.U={Zl:'auth.defaultProvider',ko:'auth.autoLogin',mo:'auth.autoUser',lo:'auth.autoPassword',If:'auth.token',Io:'auth.cacheTokenTimeout',Yr:'auth.tokenDurationPercentage'};
605
+ olympe.W.config(function(a){E(a,olympe.auth.U.Zl,olympe.auth.Ec.j.SRP);E(a,olympe.auth.U.ko,!1);E(a,olympe.auth.U.mo,'');E(a,olympe.auth.U.lo,'');E(a,olympe.auth.U.If,'');E(a,olympe.auth.U.Yr,50);E(a,olympe.auth.U.Io,3E5);D(a,olympe.auth.P.Da,[olympe.ia.P.Ea],b=>b.cd('auth'));C(a,olympe.auth.P.Cl,olympe.auth.qo,olympe.Db.P.ah);C(a,olympe.auth.P.hj,olympe.auth.It,olympe.Db.P.qk,olympe.auth.P.Da,olympe.auth.P.Cl);C(a,olympe.auth.P.Ir,olympe.auth.ud,olympe.auth.P.Da,olympe.L.P.Nk,olympe.L.P.km,olympe.L.P.vf,
606
+ olympe.auth.P.Hk,olympe.auth.P.hj);Ya(a,olympe.auth.P.Hk);D(a,olympe.auth.P.Ea,[olympe.auth.P.Da,olympe.L.P.vf,olympe.auth.P.Ir,olympe.host.P.Ge,olympe.host.P.Qk,new olympe.W.rb(olympe.auth.P.hj,olympe.W.Bh.j.Cm),new olympe.W.rb(olympe.auth.P.Hk,olympe.W.Bh.j.Cm),new olympe.W.pa(olympe.auth.U.Zl),new olympe.W.pa(olympe.auth.U.ko),new olympe.W.pa(olympe.auth.U.mo),new olympe.W.pa(olympe.auth.U.lo),new olympe.W.pa(olympe.auth.U.If),new olympe.W.pa(olympe.auth.U.Io)],(b,c,d,e,f,g,h,k,l,n,p,q,r)=>{const t=
607
607
  [new olympe.auth.Zd.xv(b,d,g),new olympe.auth.Zd.SRP(b,d),new olympe.auth.Zd.SAML(b,d,h),new olympe.auth.Zd.Ov(b,d,h,re(d.Mh,olympe.L.Xb.wk))];if(!t.map(v=>v.F()).includes(k))throw Error(`Default provider name ${k} given by parameter ${olympe.auth.U.Zl} cannot be found`);return new olympe.auth.Ua(b,c,d,g,h,e,f,t,new Map([['defaultProvider',k],['autoLogin',l],['autoUser',n],['autoPassword',p],['autoToken',q],['cacheTokenTimeout',r]]))},!0)},'olympe.auth');
608
608
  olympe.W.run([olympe.auth.P.Ea],a=>{olympe.auth.re=()=>a});olympe.Va.node.auth={};olympe.Va.node.auth.Kq=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.Kq.za=[olympe.auth.Lk];olympe.W.config(a=>{C(a,olympe.auth.P.Hk,olympe.Va.node.auth.Kq)},'olympe.native.node.auth');olympe.Va.node.Db={};function Cf(){throw Error('Key-Value Database does not implement this in NodeJS');}
609
609
  olympe.Va.node.Db.Iq=class{constructor(a){this.G=a;this.j=new Map}Y(){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
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)})}ea(){Cf();return Promise.resolve()}$(){Cf();return Promise.resolve()}clear(a){const b=this;return u(function*(){let c;
611
- null==(c=b.j.get(a))||c.clear()})}H(){Cf();return Promise.resolve([])}D(){return u(function*(){Cf()})}};olympe.Va.node.Db.Iq.za=[olympe.Db.lv];olympe.Va.node.Db.Jq=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.Iq(this.G));return this.j.get(a)}};olympe.Va.node.Db.Jq.za=[olympe.Db.mv];olympe.W.config(function(a){C(a,olympe.Db.P.qk,olympe.Va.node.Db.Jq,olympe.Db.P.Da)},'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.za=[olympe.Db.Storage];olympe.W.config(function(a){Wa(a,olympe.Db.P.ij,olympe.Va.node.storage.Storage,olympe.host.P.Da)},'olympe.native.html.storage');olympe.xg={};olympe.xg.U={VERSION:'version.version',Lt:'version.branch',tf:'version.commit',Ew:'version.tag',wp:'version.olympe-framework',Mt:'version.build'};olympe.W.config(function(a){E(a,olympe.xg.U.VERSION,'');E(a,olympe.xg.U.Lt,'');E(a,olympe.xg.U.tf,'');E(a,olympe.xg.U.Ew,'');E(a,olympe.xg.U.wp,'');E(a,olympe.xg.U.Mt,'')},'olympe.main');const Df=require('fs'),Ef=require('fs/promises');let Ff;const Gf=null!=(Ff=process.env.EXTRA_CONFIG_PATH)?Ff:null;let Hf;const Hb=null!=(Hf=process.env.EXTRA_CONFIG_KEY_PREFIX)?Hf:'';function Gb(a){return Ef.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
611
+ null==(c=b.j.get(a))||c.clear()})}H(){Cf();return Promise.resolve([])}D(){return u(function*(){Cf()})}};olympe.Va.node.Db.Iq.za=[olympe.Db.lv];olympe.Va.node.Db.Jq=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.Iq(this.G));return this.j.get(a)}};olympe.Va.node.Db.Jq.za=[olympe.Db.mv];olympe.W.config(function(a){C(a,olympe.Db.P.qk,olympe.Va.node.Db.Jq,olympe.Db.P.Da)},'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.za=[olympe.Db.Storage];olympe.W.config(function(a){Wa(a,olympe.Db.P.hj,olympe.Va.node.storage.Storage,olympe.host.P.Da)},'olympe.native.html.storage');olympe.yg={};olympe.yg.U={VERSION:'version.version',Lt:'version.branch',uf:'version.commit',Ew:'version.tag',wp:'version.olympe-framework',Mt:'version.build'};olympe.W.config(function(a){E(a,olympe.yg.U.VERSION,'');E(a,olympe.yg.U.Lt,'');E(a,olympe.yg.U.uf,'');E(a,olympe.yg.U.Ew,'');E(a,olympe.yg.U.wp,'');E(a,olympe.yg.U.Mt,'')},'olympe.main');const Df=require('fs'),Ef=require('fs/promises');let Ff;const Gf=null!=(Ff=process.env.EXTRA_CONFIG_PATH)?Ff:null;let Hf;const Hb=null!=(Hf=process.env.EXTRA_CONFIG_KEY_PREFIX)?Hf:'';function Gb(a){return Ef.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
612
612
  function If(a){var b=Jf;console.debug(`Start watching config files for changes: ${b}`);b.forEach(c=>{Ef.access(c,Df.constants.F_OK).then(()=>{Df.watch(c,d=>u(function*(){if('change'===d){console.log(`Config file "${c}" has changed. Loading new configuration...`);try{const e=yield olympe.V.et([c]),f=olympe.W.Os(e);for(const [g,h]of f)a.Qj(g,h)}catch(e){console.error(`Failed to updated config from file ${c} with message: ${e.message}`)}}}))}).catch(()=>{})})}
613
613
  function Kf(){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:hd(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',Kf);process.on('SIGINT',Kf);process.on('SIGBREAK',Kf);process.on('SIGHUP',Kf);
614
614
  process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);Kf()});const Jf=['oConfig.json','conf.d/oConfig.json','version.json'];Gf&&Jf.push(Gf);
615
615
  olympe.V.et(Jf).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.V.xs(g[3])}const d=new olympe.W.Zt(a,b);La(d);const e=d.compile();Na(e);If(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.va={ORIGIN:'<',DESTINATION:'>'};w('olympe.dc.Direction',olympe.dc.va);olympe.dc.hc={$c:'ff022000000000000000',Mi:'ff02200000000000000e',Zj:'ff02200000000000000f'};olympe.dc.iq={VERSION:'@v',$g:'@s'};olympe.dc.ie={Ye:'?',gg:'~'};olympe.dc.nD={dj:'online',Df:'offline',SB:'invalidate'};olympe.dc.Ha={SELF:'self',SERVER:'server',$e:'remote'};
617
- olympe.dc.Mb={NONE:null,fp:'ff023000000000000037',Dc:'ff023000000000000137',jg:'ff023000000000000237',tw:'ff023000000000000337',fu:'ff023000000000000437',Qw:'ff023000000000000537',UB:olympe.dc.ie.gg+'ff023000000000000037',VB:olympe.dc.ie.gg+'ff023000000000000237',TB:olympe.dc.ie.gg+'ff023000000000000437',dE:olympe.dc.ie.gg+'ff023000000000000537'};olympe.dc.Uq=class extends Error{constructor(a){var b=olympe.dc.ha(),c=olympe.dc.fe(),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.Nq=class extends Error{constructor(){var a=Lf();super('Try to access a resource not available yet: BusinessContainer, wait for it to be ready');this.j=a}};olympe.dc.Writable=class{Rc(){}Yc(){}D(){}Pa(){}ic(){}};olympe.dc.fr=class{rc(){}T(){}H(){}};olympe.dc.wc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}Fa(a){return a instanceof olympe.dc.wc&&this.tag===a.tag}};olympe.dc.wc.za=[olympe.dc.Ze];olympe.dc.wc.prototype.Fa.K=olympe.C.J.j;olympe.dc.ou=class a{constructor(b,c,d,e,f,g){this.G=b;this.$=c;this.db=c.view;this.ea=d;this.Kb=e;this.D=f;this.N=g;this.j=new Map;this.F=ib(new olympe.V.$h(6E5),(h,k)=>{URL.revokeObjectURL(k);Mf(this.db,h,a.j(h))})}ja(b,c,d,e,f){this.bb(c).then(g=>{this.mb(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.X()}: ${f}`;c.G.error(f);throw Error(f);},e=b.X();if(gb(c.F.j,e)){const f=c.F.get(e);return c.D.F(f).then(g=>g.arrayBuffer()).then(g=>
616
+ setInterval(()=>{},1073741824)});olympe.dc={};olympe.dc.va={ORIGIN:'<',DESTINATION:'>'};w('olympe.dc.Direction',olympe.dc.va);olympe.dc.hc={$c:'ff022000000000000000',Li:'ff02200000000000000e',Zj:'ff02200000000000000f'};olympe.dc.iq={VERSION:'@v',$g:'@s'};olympe.dc.ie={Ye:'?',hg:'~'};olympe.dc.nD={cj:'online',Ef:'offline',SB:'invalidate'};olympe.dc.Ia={SELF:'self',SERVER:'server',$e:'remote'};
617
+ olympe.dc.Mb={NONE:null,fp:'ff023000000000000037',Dc:'ff023000000000000137',kg:'ff023000000000000237',tw:'ff023000000000000337',fu:'ff023000000000000437',Qw:'ff023000000000000537',UB:olympe.dc.ie.hg+'ff023000000000000037',VB:olympe.dc.ie.hg+'ff023000000000000237',TB:olympe.dc.ie.hg+'ff023000000000000437',dE:olympe.dc.ie.hg+'ff023000000000000537'};olympe.dc.Uq=class extends Error{constructor(a){var b=olympe.dc.ha(),c=olympe.dc.fe(),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.Nq=class extends Error{constructor(){var a=Lf();super('Try to access a resource not available yet: BusinessContainer, wait for it to be ready');this.j=a}};olympe.dc.Writable=class{Rc(){}Yc(){}D(){}Pa(){}ic(){}};olympe.dc.fr=class{rc(){}T(){}H(){}};olympe.dc.wc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}Fa(a){return a instanceof olympe.dc.wc&&this.tag===a.tag}};olympe.dc.wc.za=[olympe.dc.Ze];olympe.dc.wc.prototype.Fa.K=olympe.C.J.j;olympe.dc.ou=class a{constructor(b,c,d,e,f,g){this.G=b;this.$=c;this.db=c.view;this.ea=d;this.Kb=e;this.D=f;this.N=g;this.j=new Map;this.F=ib(new olympe.V.$h(6E5),(h,k)=>{URL.revokeObjectURL(k);Mf(this.db,h,a.j(h))})}ja(b,c,d,e,f){this.Wa(c).then(g=>{this.mb(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.X()}: ${f}`;c.G.error(f);throw Error(f);},e=b.X();if(gb(c.F.j,e)){const f=c.F.get(e);return c.D.F(f).then(g=>g.arrayBuffer()).then(g=>
618
618
  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.X(),d=b.get(olympe.dm.File.j);const e=b.get(olympe.dm.File.urlProp);if(e.startsWith('stream:'))return this.Y(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.fe().Qe(b),{tag:c,model:d,url:e.valueOf()}),this.Kb.request(c);c=N(e);Ic(c,olympe.net.wa.ResponseType.Hl);return Jc(this.ea,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}`);})}ta(b,c,d){c=new olympe.dc.Request(olympe.dc.Request.j.bg,d,{tag:b,model:c});return this.Kb.request(c).then(()=>this.G.debug(`Successfully deleted file: ${b}`)).catch(e=>
620
- {throw Error(`Failed to delete file ${b}: ${e.message}`);})}Ja(b){const c=new olympe.V.stream.lg;this.H(b).then(d=>{eb(d).pipeTo(c).catch(()=>{})});return c}Eb(b,c){this.D.H(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.fc;e.Yc(b,(new Map).set(olympe.dm.File.urlProp.X(),d));this.$.nd(Nf(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)})}Y(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)})}mb(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.fe().Qe(b),{tag:b,model:e,content:c,mimeType:d});this.Kb.request(e).then(k=>h(null!=k?k:'')).catch(null!=g?g:this.G.error.bind(this.G))}bb(b){return u(function*(){var c=b instanceof olympe.C.Ta?b.valueOf():b;return'string'===typeof c?ab(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.fa(b);b=URL.createObjectURL(c);this.F.set(d,b);const e=a.j(d);Of(this.db,d,f=>{f||(this.F.delete(d),Mf(this.db,d,e))},e)}static j(b){return`cacheBinary${b}`}};function Pf(a,b){let c=Qf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.gf(b);if(null===b)break;c=Qf(b)}let e;return null!=(e=c)?e:null}olympe.dc.Hu=class{constructor(a,b,c){this.G=a;this.j=b;this.db=b.view;this.D=c;this.Sa=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.Zp)})}};function Rf(a,b){a.origin=b;return a}function Sf(a,b,c){a.D.set(b,c);return a}function Tf(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.Ha.SELF;this.j=b;this.content=null!=c?c:null;this.user=null!=d?d:de(olympe.auth.re()).ue();this.D=new Map}getType(){return this.type}yc(){return this.user}jc(){return this.j}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.j}; content: ${this.content}`}};
623
- olympe.dc.Request.j={pc:1,Kg:10,qu:24,Kp:25,ru:28,Tg:30,Gk:31,JC:32,ef:40,eh:41,vo:42,tr:43,ZD:44,Gi:45,xo:46,jk:47,ng:50,dg:51,bg:52,Nw:60,bw:61,Fp:62,LB:63,Tt:64,zh:65,ck:91,su:93,Bm:95,QUERY_RESULT:97};function Uf(a,b,c,d,e){const f=olympe.C.lh();a.sources.set(olympe.dc.Ha.SERVER,e.init(a));a.F?a.sources.set(olympe.dc.Ha.$e,d.init(a)):Of(b,a.j,()=>{a.sources.set(olympe.dc.Ha.$e,d.init(a));const g=new Map;olympe.dc.ma.from(a.j,a.j).fb(olympe.dm.DataSource.Lj).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.hi,!0)).observe(f).subscribe(h=>{var k=h.Fj();for(var l of k){const [p,q]=g.get(l);c.F(p);c.H(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=h.zj();for(const p of h)if(h=
624
- p.X(),!a.sources.has(h)){const q=new olympe.dc.sources.sq(a.G,p);a.sources.set(h,q);l=c.D(()=>q.healthCheck(),h,olympe.host.Je.j.READINESS);n=c.j(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});Mf(b,a.j,'router',!0)},'router')}function Vf(a,b,c){let d=a.D.get(b);void 0===d&&(d=[],a.D.set(b,d));d.push(c)}
625
- olympe.dc.gw=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;Uf(this,d,e,b,c)}request(a){this.G.debug('Router: sends',a);return this.jb(a.jc()).request(a)}subscribe(a,b){this.G.debug('Router: subscribes',a);return this.jb(a.jc()).subscribe(a,b)}dd(a){if(a.jc()!==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))}}zi(a){let b;null==
626
- (b=this.D.get(a.getType()))||b.forEach(c=>c(a));return this.jb(olympe.dc.Ha.$e).zi(a)}jb(a){let b;return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Ha.$e)}};function Nf(a,b){b=new olympe.dc.Ig(a.T(),null!=b?b:null);b.j=a;return b}function Wf(a,b,c,d){c=new olympe.dc.Ig(null!=d?d:olympe.V.Kc(),null!=c?c:null);c.D=b;c.Ga=a;return c}
627
- olympe.dc.Ig=class{constructor(a,b){this.id=a;this.Ga=this.j=this.D=null;this.dl=b}static j(a){return Wf(a.p,a.s,a.t,a.i)}T(){return this.id}rc(a){return this.j instanceof olympe.dc.db.fc?this.j.rc(a):Array.isArray(this.Ga)?(new olympe.dc.transaction.ej(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}bc(){return this.j instanceof olympe.dc.db.fc?this.j:Array.isArray(this.Ga)?(this.j=(new olympe.dc.transaction.ej(this.D)).j(this.Ga,
619
+ 0,f.byteLength));if(d)return d=this.db.model(b),c=new olympe.dc.Request(olympe.dc.Request.j.eg,olympe.dc.fe().Qe(b),{tag:c,model:d,url:e.valueOf()}),this.Kb.request(c);c=N(e);Ic(c,olympe.net.wa.ResponseType.Hl);return Jc(this.ea,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}`);})}ta(b,c,d){c=new olympe.dc.Request(olympe.dc.Request.j.cg,d,{tag:b,model:c});return this.Kb.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.V.stream.mg;this.H(b).then(d=>{eb(d).pipeTo(c).catch(()=>{})});return c}Eb(b,c){this.D.H(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.fc;e.Yc(b,(new Map).set(olympe.dm.File.urlProp.X(),d));this.$.nd(Nf(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)})}Y(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)})}mb(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.fe().Qe(b),{tag:b,model:e,content:c,mimeType:d});this.Kb.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.Ta?b.valueOf():b;return'string'===typeof c?ab(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.fa(b);b=URL.createObjectURL(c);this.F.set(d,b);const e=a.j(d);Of(this.db,d,f=>{f||(this.F.delete(d),Mf(this.db,d,e))},e)}static j(b){return`cacheBinary${b}`}};function Pf(a,b){let c=Qf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.gf(b);if(null===b)break;c=Qf(b)}let e;return null!=(e=c)?e:null}olympe.dc.Hu=class{constructor(a,b,c){this.G=a;this.j=b;this.db=b.view;this.D=c;this.Sa=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.Zp)})}};function Rf(a,b){a.origin=b;return a}function Sf(a,b,c){a.D.set(b,c);return a}function Tf(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:de(olympe.auth.re()).ue();this.D=new Map}getType(){return this.type}yc(){return this.user}jc(){return this.j}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.j}; content: ${this.content}`}};
623
+ olympe.dc.Request.j={pc:1,Kg:10,qu:24,Kp:25,ru:28,Tg:30,Gk:31,JC:32,ef:40,eh:41,vo:42,tr:43,ZD:44,Fi:45,xo:46,jk:47,og:50,eg:51,cg:52,Nw:60,bw:61,Fp:62,LB:63,Tt:64,zh:65,ck:91,su:93,Bm:95,QUERY_RESULT:97};function Uf(a,b,c,d,e){const f=olympe.C.lh();a.sources.set(olympe.dc.Ia.SERVER,e.init(a));a.F?a.sources.set(olympe.dc.Ia.$e,d.init(a)):Of(b,a.j,()=>{a.sources.set(olympe.dc.Ia.$e,d.init(a));const g=new Map;olympe.dc.ma.from(a.j,a.j).fb(olympe.dm.DataSource.Lj).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.hi,!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.X(),!a.sources.has(h)){const q=new olympe.dc.sources.sq(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)}});Mf(b,a.j,'router',!0)},'router')}function Vf(a,b,c){let d=a.D.get(b);void 0===d&&(d=[],a.D.set(b,d));d.push(c)}
625
+ olympe.dc.gw=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;Uf(this,d,e,b,c)}request(a){this.G.debug('Router: sends',a);return this.jb(a.jc()).request(a)}subscribe(a,b){this.G.debug('Router: subscribes',a);return this.jb(a.jc()).subscribe(a,b)}dd(a){if(a.jc()!==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))}}yi(a){let b;null==
626
+ (b=this.D.get(a.getType()))||b.forEach(c=>c(a));return this.jb(olympe.dc.Ia.$e).yi(a)}jb(a){let b;return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Ia.$e)}};function Nf(a,b){b=new olympe.dc.Ig(a.T(),null!=b?b:null);b.j=a;return b}function Wf(a,b,c,d){c=new olympe.dc.Ig(null!=d?d:olympe.V.Kc(),null!=c?c:null);c.D=b;c.Ga=a;return c}
627
+ olympe.dc.Ig=class{constructor(a,b){this.id=a;this.Ga=this.j=this.D=null;this.dl=b}static j(a){return Wf(a.p,a.s,a.t,a.i)}T(){return this.id}rc(a){return this.j instanceof olympe.dc.db.fc?this.j.rc(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}bc(){return this.j instanceof olympe.dc.db.fc?this.j:Array.isArray(this.Ga)?(this.j=(new olympe.dc.transaction.dj(this.D)).j(this.Ga,
628
628
  this.id),this.Ga=null,this.j):new olympe.dc.db.fc(this.id)}jl(){if(Array.isArray(this.Ga))return this.Ga;if(this.j instanceof olympe.dc.db.fc){const a=new olympe.dc.transaction.He;this.j.rc(a);return Xf(a)}return[]}ga(){return{p:this.jl(),t:this.dl,s:this.D,i:this.id}}};olympe.dc.Ig.za=[olympe.dc.fr];olympe.dc.Sa={};const Yf=olympe.dc.va.ORIGIN,Zf=olympe.dc.va.DESTINATION,$f=new Map,ag=new Map,bg=new Map,cg=new Map;function Qf(a){let b;return null!=(b=$f.get(a))?b:null}function dg(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.ao||[])];return olympe.dc.na.j(b,c,...a)}function eg(a,b){cg.set(a,b);return a}function fg(a){let b,c;return null!=(c=null==(b=$f.get(a))?void 0:b.D)?c:olympe.dc.CloudObject}
629
629
  function gg(a,b,c){const d=a+'@'+(b===Zf?Yf:Zf);if(ag.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);ag.set(d,c)}function hg(a){a=a.X()+'@'+a.La();return ag.get(a)||olympe.dc.CloudObject}function P(a,b){b.NAME=a;bg.set(a,b)}function Q(a){let b;return null!=(b=a.NAME)?b:null}
630
630
  olympe.dc.na=class{constructor(){}static j(a,b,...c){if($f.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${$f.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.W.rb(g):g}}b=new olympe.dc.Sa.Entry(a,b,d);$f.set(a,b);return b.D.entry=b}static ac(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.X())?c:null}};function ig(a,b){a.j=b}function R(a,b){b=b.$b();gg(b.X(),b.La(),a.D);return b}function jg(a){a.F=!0;return a}
631
- olympe.dc.Sa.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.ao=c||null;this.j=null;this.F=!1}X(){return this.tag}instantiate(a,b){const c=this.D;if(this.Mn()&&b.getParameter(olympe.dc.U.op)){var d=olympe.dc.ha();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.X()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ia.Za('dc').error(d)}return this.ao?(a=[void 0,a].concat(Oa(b,this.ao)),new c(...a)):new c(void 0,
631
+ olympe.dc.Sa.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.ao=c||null;this.j=null;this.F=!1}X(){return this.tag}instantiate(a,b){const c=this.D;if(this.Mn()&&b.getParameter(olympe.dc.U.op)){var d=olympe.dc.ha();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.X()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ia.Ya('dc').error(d)}return this.ao?(a=[void 0,a].concat(Oa(b,this.ao)),new c(...a)):new c(void 0,
632
632
  a)}ka(a){return new olympe.dc.Sa.Property(a)}sa(a,b=olympe.dc.va.DESTINATION){gg(a,b,this.D);return new olympe.dc.ba.af(a,b)}Mn(){return this.F}};w('olympe.dc.registry.Entry',olympe.dc.Sa.Entry);olympe.dc.Sa.Entry.prototype.addRelation=olympe.dc.Sa.Entry.prototype.sa;olympe.dc.Sa.Entry.prototype.addProperty=olympe.dc.Sa.Entry.prototype.ka;olympe.dc.Sa.Entry.za=[olympe.dc.Ze];olympe.dc.Sa.Property=class{constructor(a){this.tag=a}X(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Sa.Property.prototype.getTag=olympe.dc.Sa.Property.prototype.X;olympe.dc.Sa.Property.za=[olympe.dc.Ze];olympe.dc.Sa.Relation=class{constructor(a,b=olympe.dc.va.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.fa(a);this.direction=b;this.origin=c;this.H=d}X(){return this.tag}La(){return this.direction}type(){return this.H}$b(){return new olympe.dc.Sa.Relation(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION,this.H,this.origin)}Fa(a){return a instanceof olympe.dc.Sa.Relation?a.X()===this.X()&&a.La()===this.La():!1}toString(){return`${this.direction}${olympe.dc.ha().name(this.tag)} (${this.tag})`}};
633
- olympe.dc.Sa.Relation.prototype.getInverse=olympe.dc.Sa.Relation.prototype.$b;olympe.dc.Sa.Relation.prototype.getDirection=olympe.dc.Sa.Relation.prototype.La;olympe.dc.Sa.Relation.prototype.getTag=olympe.dc.Sa.Relation.prototype.X;olympe.dc.Sa.Relation.za=[olympe.dc.Ze];olympe.dc.db={};function kg(a,b){const c=a.H,d=olympe.dc.ha(),e=olympe.dc.db.Database.D.fj,f=olympe.dc.db.Database.D.Ye,g=olympe.dc.db.Database.D.ORIGIN,h=olympe.dc.db.Database.D.DESTINATION,k=new olympe.dc.db.fc('rev-'+b.T());a.G.debug('Generate the reverse graphLayer of',b.T());b.Ab.forEach((l,n)=>{if(l.D()){k.D(n,olympe.dc.Mb.NONE);for(const [r,t]of l.Jd())k.ic(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.zd())for(const r of lg(d,n,l.F())){l=c.get(r);const t=new Map;l.forEach((v,x)=>{const y=x[0],z=x.substring(1);
633
+ olympe.dc.Sa.Relation.prototype.getInverse=olympe.dc.Sa.Relation.prototype.$b;olympe.dc.Sa.Relation.prototype.getDirection=olympe.dc.Sa.Relation.prototype.La;olympe.dc.Sa.Relation.prototype.getTag=olympe.dc.Sa.Relation.prototype.X;olympe.dc.Sa.Relation.za=[olympe.dc.Ze];olympe.dc.db={};function kg(a,b){const c=a.H,d=olympe.dc.ha(),e=olympe.dc.db.Database.D.ej,f=olympe.dc.db.Database.D.Ye,g=olympe.dc.db.Database.D.ORIGIN,h=olympe.dc.db.Database.D.DESTINATION,k=new olympe.dc.db.fc('rev-'+b.T());a.G.debug('Generate the reverse graphLayer of',b.T());b.Ab.forEach((l,n)=>{if(l.D()){k.D(n,olympe.dc.Mb.NONE);for(const [r,t]of l.Jd())k.ic(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.zd())for(const r of lg(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
634
  y===e?t.set(z,v):y===f?t.set(x,v):y===g?v.forEach((A,K)=>{k.Pa(z,K,r)}):y===h&&v.forEach((A,K)=>{k.Pa(z,r,K)})});l=l.source();k.Rc(r,l,t)}else{const r=new Map;for(const t of l.Cb().keys()){var q=t[0]===f;const v=q?t.substring(1):t;q=q?mg(p,v,!0):p.Ra(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.Jd())x?k.ic(t,n,v):k.Pa(t,n,v)}}});return k}
635
635
  function ng(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 og(b,kg(a,b));a.D.unshift(d);a.F.set(d,e);a.H.Zs(c);a.write(b,!1,!1)}
636
636
  function pg(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 qg(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}
@@ -640,271 +640,271 @@ olympe.dc.db.Xt=class{constructor(a,b,c,d){this.G=a;this.H=b;this.ha=c;let e;thi
640
640
  1);pg(this,rg(this,d.D,c),b);this.F.delete(a)}}write(a,b,c=!1){b=new olympe.dc.db.dn(this.G,this.H,this.ha,b);b.open(c);b.write(a,this.R);b.close()}};class ug{T(){}nd(){}}function vg(a,b,c,d){const e=olympe.dc.va.DESTINATION;c=c.tag();const f=a.j.Tc(c);b.Cb().forEach((g,h)=>{f.ka(h,g);b.$(h)});for(const [g,h,k,l]of b.ea()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.j.Pa(g,n,p);d.N(g,n,p)}}
641
641
  function wg(a,b,c,d){const e=olympe.dc.va.DESTINATION,f=c.tag(),g=a.j.Tc(f);b.Cb().forEach((h,k)=>{void 0!==c.Ra(k)&&(g.ka(k,h),b.$(k))});for(const [h,k,l]of b.Jd()){const n=c.mb(h,e,k);void 0!==n&&(d.N(h,f,k),n===l&&a.j.N(h,f,k))}}
642
642
  class og extends ug{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.ea(a)){const d=b.tag();c.zd()?b.D()?a.j(d,b.F()):(this.D.j(d,c.F()),this.j.j(d,c.F())):b.zd()?(vg(this,c,b,a),a.j(d,b.F())):wg(this,c,b,a)}return a}}function xg(a){clearTimeout(a.F);a.F=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.H)}
643
- class qg extends ug{constructor(a,b,c,d){super();this.j=a;this.D=b;this.buffer=c;this.H=d;this.F=null;xg(this)}T(){return this.j.T()}nd(a){return a.R(this.j)}update(a,b){this.D=b;a.rc(this.j);xg(this);return this}};const yg=olympe.dc.hc.$c,zg=olympe.dc.hc.Mi,Ag=olympe.dc.va.ORIGIN,Bg=olympe.dc.va.DESTINATION;let Cg=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.Ha.SELF;this.G=b;this.wd=olympe.C.Ya();this.state=olympe.dc.db.Database.F.IDLE;this.ja=new Map;this.Yb=[];this.Y=new Map;this.H=null;this.ea=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.Gd=new olympe.dc.db.zf(c,this,b,f);d.get('debug')&&this.Xs()}T(){return this.id}getState(){return this.state}Za(){return this.G}create(b,
643
+ class qg extends ug{constructor(a,b,c,d){super();this.j=a;this.D=b;this.buffer=c;this.H=d;this.F=null;xg(this)}T(){return this.j.T()}nd(a){return a.R(this.j)}update(a,b){this.D=b;a.rc(this.j);xg(this);return this}};const yg=olympe.dc.hc.$c,zg=olympe.dc.hc.Li,Ag=olympe.dc.va.ORIGIN,Bg=olympe.dc.va.DESTINATION;let Cg=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.wd=olympe.C.$a();this.state=olympe.dc.db.Database.F.IDLE;this.ja=new Map;this.Yb=[];this.Y=new Map;this.H=null;this.ea=new Set;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.Af.j.am;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Gd=new olympe.dc.db.Af(c,this,b,f);d.get('debug')&&this.Xs()}T(){return this.id}getState(){return this.state}Ya(){return this.G}create(b,
645
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.$(f,!0)}e&&f.persist();this.state===a.F.Gl&&Dg(f,!0);d&&this.Pc(f,d);this.D(a.j.$p,b)}update(b,c){c&&(b=this.N(b,!0),this.Pc(b,c))}ta(b){const c=this.get(b);void 0!==c&&(this.$(c,!1),this.D(a.j.aq,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case yg:Eg(c,d);break;case zg:Fg(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 yg:Gg(c,d);break;case zg:Hg(c,d);break;default:c.unlink(b,d)}}sg(b,c){for(const d of b)this.N(d).oe(c)}ni(b,c){for(const d of b)(b=this.get(d))&&b.detach(c)}Zs(b){b.forEach(c=>{this.N(c).persist()})}Nd(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.D(a.j.mp,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.lp,b);c&&this.state!==a.F.Gl&&this.D(a.j.cn,b);return d}Eb(b){var c=
647
- olympe.V.oi();this.H?Ig(this.H,c,b):b()}R(b){let c;null!=(c=this.H)&&c.j.delete(b)}Ja(b,...c){this.ja.has(b)&&this.ja.get(b).forEach(d=>{d(...c)})}D(b,c,...d){this.Ja(b,c,...d)}$(b,c){let d;null!=(d=this.H)&&d.H.set(b,c)}Pe(b,c,d,e){let f;null!=(f=this.H)&&Jg(f,b).ka(e?Kg+c:c,d)}ff(b,c,d,e,f){let g;null!=(g=this.H)&&(d===Lg?f?Jg(g,b).link(c,e):Jg(g,b).unlink(c,e):f?Jg(g,b).Eb(c,e):Jg(g,b).Gc(c,e))}bb(b,c,d){let e;null!=(e=this.H)&&Jg(e,b).Nd(c,d)}addEventListener(b,c){let d=this.ja.get(b);void 0===
648
- d&&(d=[],this.ja.set(b,d));d.push(c)}j(b,c){this.addEventListener(b,c)}mb(b){this.Yb.push(b)}F(b){for(const c of this.Y.values())if(c.R.has(b))return!0;return!1}tg(b=!1){const c=Cg++;this.state=a.F.Al;this.ea.add(c);b||this.Y.set(c,new olympe.dc.db.ku(c,this,this.wd));return c}dt(b,c){if(!this.ea.has(b))throw Error('Database: cannot use a transaction that has not been started');let d;this.H=null!=(d=this.Y.get(b))?d:null;b=this.state;this.state=null===this.H?a.F.Gl:a.F.Tv;c();this.state=b;this.H=
649
- null}le(b){this.state=a.F.tf;const c=this.Y.get(b);c&&(this.H=c,Mg(this.H),Ng(this.H),this.Y.delete(b),this.H=null);this.ea.delete(b);0===this.ea.size&&(this.state=a.F.IDLE,this.Yb.forEach(d=>{d()}),Og(this.Gd))}Pc(b,c){const d=a.D.Ye;for(const [e,f]of c)void 0!==f&&(e[0]===d?Pg(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(Ag+yg)))for(const f of c.values())null!==f.source()&&this.Gc(b,f,d);return d}Xs(){const b=a.j.em,c=a.j.Ik,d=new Set,
650
- e=new Map;this.j(a.j.$p,f=>{d.add(f)});this.j(b,f=>{d.delete(f);e.delete(f)});this.j(c,(f,...g)=>{if(g[0]===zg&&g[1]===Bg){const h=g[2];this.get(h).Ia()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.mb(()=>{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={fj:'$',Du:'~',Ye:'?',Bl:'=',Xp:'|',Ii:'@',ORIGIN:olympe.dc.va.ORIGIN,DESTINATION:olympe.dc.va.DESTINATION};olympe.dc.db.Database.j={lp:0,mp:1,es:2,cn:3,Jo:4,Ko:5,em:6,Dc:7,Ik:8,Sm:9,$p:10,aq:11,mr:12,HA:13,GA:14,Iw:15,Bp:16};olympe.dc.db.Database.F={IDLE:0,Al:1,Tv:2,Gl:3,tf:4};function Qg(a,b,c=[]){const d=b.T();ng(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=rg(e,f.j,e.D.length);e.write(pg(e,f,Date.now()),!1);e.F.delete(d)}}}}function Rg(a,b,c={}){let d,e;return tg(a.j,b,null!=(d=c.persist)?d:!0,null!=(e=c.nn)?e:!1)}function Sg(a,b){a.D.mb(b)}
652
- olympe.dc.db.gu=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.view=c;this.j=new olympe.dc.db.Xt(a,b,c,d);this.wz=new olympe.dc.db.Cv(a,c,b,e)}Za(){return this.G}nd(a,b={}){let c,d;this.j.nd(a,null!=(c=b.persist)?c:!0,null!=(d=b.nn)?d:!1)}oe(a,b){this.D.sg(a,b)}detach(a,b){this.D.ni(a,b);return this}};const Tg=olympe.dc.db.Database.D.ORIGIN,Ug=olympe.dc.db.Database.D.DESTINATION,Vg=olympe.dc.db.Database.D.fj,Wg=olympe.dc.db.Database.D.Ye,Xg=olympe.dc.db.Database.D.Bl,Yg=olympe.dc.db.Database.D.Xp,Zg=Tg+Ug,$g=Vg+Vg,ah=olympe.dc.db.Database.F;let bh=0;function Mf(a,b,c,d=!1){const e=S(a,b);if(null!==e){const f=ch(e,'',c);void 0!==f&&(a.j.getState()!==ah.tf||e.F()&&!d||a.j.R(c),d||!e.Ia()&&!e.F()||f(!1,b))}}
653
- function Of(a,b,c,d){a=a.j.N(dh(b));d=null!=d?d:eh();fh(a,'',d,c)&&a.Ia()&&c(!0,b);return d}function lg(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(olympe.dc.fa(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 eh(){++bh;return String(bh)}function dh(a){if(a)return olympe.dc.fa(a);throw Error('DBView: Impossible to transform tag to string, provided tag is empty, null or undefined.');}
654
- function gh(a,b,c,d,e){a=a.j.N(dh(b));c=dh(c);b=Vg+c;e=null!=e?e:eh();if(fh(a,b,e,d)&&a.Ia()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(Xg+c));void 0!==b&&d(b,f)}return e}function S(a,b,c=!1){if(b)return a=a.j.get(olympe.dc.fa(b)),!a||c&&!a.Ia()?null:a;throw Error('DBView: Impossible to get instance, provided tag is empty, null or undefined.');}function hh(a,b,c,d){b=S(a,b);null!==b&&(c=olympe.dc.fa(c),ch(b,Vg+c,d),a.j.getState()===ah.tf&&a.j.R(d))}
655
- function ih(a,b,c,d){a=a.j.N(dh(b));d=null!=d?d:eh();fh(a,$g,d,c)&&a.Ia()&&a.forEach((e,f)=>{const g=f[0];g!==Vg&&g!==Xg||c(f.substring(1),e,g===Xg)});return d}function jh(a,b,c){b=S(a,b);null!==b&&(ch(b,$g,c),a.j.getState()===ah.tf&&a.j.R(c))}function kh(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ia()||!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(dh(b));c=c.La()+c.X();e=null!=e?e:eh();(d=lh(a,c,e,d))&&a.Ia()&&kh(a,c,!0,d,!1);return e}
656
- function mh(a,b,c,d){const e=a.j.N(dh(b));a=null!=d?d:eh();const f=lh(e,Zg,a,c);f&&e.Ia()&&e.forEach((g,h)=>{g=h[0];g!==Tg&&g!==Ug||kh(e,h,!0,f,!0)})}function nh(a,b,c){const d=S(a,b);if(null!==d){const e=ch(d,Zg,c);void 0!==e&&(a.j.getState()!==ah.tf||d.F()||a.j.R(c),!d.Ia()&&!d.F()||d.forEach((f,g)=>{f=g[0];(f===Tg||f===Ug)&&e&&kh(d,g,!1,e,!0)}))}}
657
- function oh(a,b,c){b=S(a,b,!1);if(!b||c===olympe.dc.Mb.NONE)return[];const d=c.charAt(0)===olympe.dc.ie.gg,e=[];b.forEach((f,g)=>{const h=g.charAt(0);if(!d&&f instanceof olympe.dc.wc&&(h===Vg||h===Wg))(f=a.j.get(f.X()))&&e.push([f,g.substring(1),null,!0]);else if(h===Tg||h===Ug){const k=g.substring(1),l=(h===Tg?12:3)&ph(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.Ma]:null;b=a.j.get(f);e.push([b,g,null,!0])}return e}
658
- function qh(a,b,c,d,e){const f=a.j.N(dh(b));e=null!=e?e:eh();const g=lh(f,Yg+c,e,d);g&&f.Ia()&&oh(a,b,c).forEach(([h,...k])=>{h.Ia()&&g(...k,!0,h.tag())})}function rh(a,b,c,d){const e=S(a,b);if(null!==e){const f=ch(e,Yg+c,d);void 0!==f&&(a.j.getState()!==ah.tf||e.F()||a.j.R(d),!e.Ia()&&!e.F()||oh(a,b,c).forEach(([g,...h])=>{(g.Ia()||g.F())&&f(...h,!1,g.tag())}))}}function sh(a,b){a=S(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===Wg&&b.set(c.substring(1),d);return b}
659
- function ph(a,b,c){if(c===olympe.dc.Mb.NONE)return 0;const d=c[0]===olympe.dc.ie.gg;c=d?c.substring(1):c;a=a.Ra(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function th(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===Tg||c===Ug){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(S(a,b,!0))}
660
- function uh(a,b,c){if(!a.Ia(b))return a.G.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.fa(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.fa(b)}`);return d}function vh(a,b,c,d){return(c=(a=S(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ia()).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.X();const e=ch(a,b,c);void 0!==e&&(this.j.getState()!==ah.tf||a.F()&&!d||this.j.R(c),d||!a.Ia()&&!a.F()||kh(a,b,!1,e,!1))}}Ia(a){a=this.j.get(olympe.dc.fa(a));return!(null==a||!a.Ia())}name(a){let b,c;return null!=(c=null==(b=S(this,a))?void 0:b.Ra(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=S(this,a,!0))?a.model():null)?a.tag():null}gf(a){return(a=(a=S(this,
662
- a,!0))&&a.gf())?a.tag():null}wi(a){a=S(this,a,!0);return!(!a||!a.gf())}Ob(a,b){a=(a=S(this,a,!0))&&a.model();return!(!a||!this.Uf(a.tag(),b))}source(a){return(a=S(this,a,!0))&&a.source()}Re(a){a=S(this,a,!1);return!a||a.N}Ra(a,b,c){a=S(this,a,!0);b=olympe.dc.fa(b);let d;return null!=(d=null==a?void 0:a.Ra(b,c))?d:null}Cb(a,b=!1){var c=S(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===Vg||!b&&c===Xg)&&a.set(d.substring(1),e);return a}il(a,b){return oh(this,a,b).filter(([c])=>c.Ia()).map(([c,
663
- ...d])=>[c.tag(),...d])}cb(a,b){a=S(this,a,!0);b=b.La()+b.X();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ia()&&a.push(c.tag());return a}bt(a,b,c){let d,e;a=null==(d=S(this,a,!0))?void 0:null==(e=d.get(b.La()+b.X()))?void 0:e.get(olympe.dc.fa(c));return!(null==a||!a.Ia())}Hn(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.X()),void 0!==a)for(const e of a.values())e.Ia()&&b.push(e.tag());a=b}return a}Jb(a,b){var c=
664
- S(this,a,!0);const d=b.La()+b.X();c=null==c?void 0:c.get(d);if(1<(null==c?void 0:c.size))return this.G.warn(`Relation ${b.X()} 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.Ia())?a.tag():null}oh(a,b,c){a=olympe.dc.fa(a);const d=uh(this,a,b);d.delete(a);return c?(c=olympe.dc.fa(c),d.has(c)?Array.from(uh(this,c,b.$b()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Hs(a,b,c){if(!this.Ia(a))return null;b=uh(this,
665
- a,b);const d=[olympe.dc.fa(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}zn(a,b,c){return this.Hn(a,b).find(c)||null}Qx(a,b,c){return this.Hn(a,b).filter(c)}Ms(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.gf();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ia())throw a=`Try to get all extensions of the model ${olympe.dc.fa(a)} but one of them does not exists (${c.tag()})`,
646
+ d)switch(b){case yg:Gg(c,d);break;case zg:Hg(c,d);break;default:c.unlink(b,d)}}tg(b,c){for(const d of b)this.N(d).oe(c)}ni(b,c){for(const d of b)(b=this.get(d))&&b.detach(c)}Zs(b){b.forEach(c=>{this.N(c).persist()})}Nd(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.D(a.j.mp,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.lp,b);c&&this.state!==a.F.Gl&&this.D(a.j.cn,b);return d}Eb(b){var c=
647
+ olympe.V.oi();this.H?Ig(this.H,c,b):b()}R(b){let c;null!=(c=this.H)&&c.j.delete(b)}Ha(b,...c){this.ja.has(b)&&this.ja.get(b).forEach(d=>{d(...c)})}D(b,c,...d){this.Ha(b,c,...d)}$(b,c){let d;null!=(d=this.H)&&d.H.set(b,c)}Pe(b,c,d,e){let f;null!=(f=this.H)&&Jg(f,b).ka(e?Kg+c:c,d)}ff(b,c,d,e,f){let g;null!=(g=this.H)&&(d===Lg?f?Jg(g,b).link(c,e):Jg(g,b).unlink(c,e):f?Jg(g,b).Eb(c,e):Jg(g,b).Gc(c,e))}Wa(b,c,d){let e;null!=(e=this.H)&&Jg(e,b).Nd(c,d)}addEventListener(b,c){let d=this.ja.get(b);void 0===
648
+ d&&(d=[],this.ja.set(b,d));d.push(c)}j(b,c){this.addEventListener(b,c)}mb(b){this.Yb.push(b)}F(b){for(const c of this.Y.values())if(c.R.has(b))return!0;return!1}ug(b=!1){const c=Cg++;this.state=a.F.Al;this.ea.add(c);b||this.Y.set(c,new olympe.dc.db.ku(c,this,this.wd));return c}dt(b,c){if(!this.ea.has(b))throw Error('Database: cannot use a transaction that has not been started');let d;this.H=null!=(d=this.Y.get(b))?d:null;b=this.state;this.state=null===this.H?a.F.Gl:a.F.Tv;c();this.state=b;this.H=
649
+ null}le(b){this.state=a.F.uf;const c=this.Y.get(b);c&&(this.H=c,Mg(this.H),Ng(this.H),this.Y.delete(b),this.H=null);this.ea.delete(b);0===this.ea.size&&(this.state=a.F.IDLE,this.Yb.forEach(d=>{d()}),Og(this.Gd))}Pc(b,c){const d=a.D.Ye;for(const [e,f]of c)void 0!==f&&(e[0]===d?Pg(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(Ag+yg)))for(const f of c.values())null!==f.source()&&this.Gc(b,f,d);return d}Xs(){const b=a.j.em,c=a.j.Ik,d=new Set,
650
+ e=new Map;this.j(a.j.$p,f=>{d.add(f)});this.j(b,f=>{d.delete(f);e.delete(f)});this.j(c,(f,...g)=>{if(g[0]===zg&&g[1]===Bg){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.mb(()=>{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:'$',Du:'~',Ye:'?',Bl:'=',Xp:'|',Hi:'@',ORIGIN:olympe.dc.va.ORIGIN,DESTINATION:olympe.dc.va.DESTINATION};olympe.dc.db.Database.j={lp:0,mp:1,es:2,cn:3,Jo:4,Ko:5,em:6,Dc:7,Ik:8,Sm:9,$p:10,aq:11,mr:12,HA:13,GA:14,Iw:15,Bp:16};olympe.dc.db.Database.F={IDLE:0,Al:1,Tv:2,Gl:3,uf:4};function Qg(a,b,c=[]){const d=b.T();ng(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=rg(e,f.j,e.D.length);e.write(pg(e,f,Date.now()),!1);e.F.delete(d)}}}}function Rg(a,b,c={}){let d,e;return tg(a.j,b,null!=(d=c.persist)?d:!0,null!=(e=c.nn)?e:!1)}function Sg(a,b){a.D.mb(b)}
652
+ olympe.dc.db.gu=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.view=c;this.j=new olympe.dc.db.Xt(a,b,c,d);this.wz=new olympe.dc.db.Cv(a,c,b,e)}Ya(){return this.G}nd(a,b={}){let c,d;this.j.nd(a,null!=(c=b.persist)?c:!0,null!=(d=b.nn)?d:!1)}oe(a,b){this.D.tg(a,b)}detach(a,b){this.D.ni(a,b);return this}};const Tg=olympe.dc.db.Database.D.ORIGIN,Ug=olympe.dc.db.Database.D.DESTINATION,Vg=olympe.dc.db.Database.D.ej,Wg=olympe.dc.db.Database.D.Ye,Xg=olympe.dc.db.Database.D.Bl,Yg=olympe.dc.db.Database.D.Xp,Zg=Tg+Ug,$g=Vg+Vg,ah=olympe.dc.db.Database.F;let bh=0;function Mf(a,b,c,d=!1){const e=S(a,b);if(null!==e){const f=ch(e,'',c);void 0!==f&&(a.j.getState()!==ah.uf||e.F()&&!d||a.j.R(c),d||!e.Ja()&&!e.F()||f(!1,b))}}
653
+ function Of(a,b,c,d){a=a.j.N(dh(b));d=null!=d?d:eh();fh(a,'',d,c)&&a.Ja()&&c(!0,b);return d}function lg(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(olympe.dc.fa(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 eh(){++bh;return String(bh)}function dh(a){if(a)return olympe.dc.fa(a);throw Error('DBView: Impossible to transform tag to string, provided tag is empty, null or undefined.');}
654
+ function gh(a,b,c,d,e){a=a.j.N(dh(b));c=dh(c);b=Vg+c;e=null!=e?e:eh();if(fh(a,b,e,d)&&a.Ja()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(Xg+c));void 0!==b&&d(b,f)}return e}function S(a,b,c=!1){if(b)return a=a.j.get(olympe.dc.fa(b)),!a||c&&!a.Ja()?null:a;throw Error('DBView: Impossible to get instance, provided tag is empty, null or undefined.');}function hh(a,b,c,d){b=S(a,b);null!==b&&(c=olympe.dc.fa(c),ch(b,Vg+c,d),a.j.getState()===ah.uf&&a.j.R(d))}
655
+ function ih(a,b,c,d){a=a.j.N(dh(b));d=null!=d?d:eh();fh(a,$g,d,c)&&a.Ja()&&a.forEach((e,f)=>{const g=f[0];g!==Vg&&g!==Xg||c(f.substring(1),e,g===Xg)});return d}function jh(a,b,c){b=S(a,b);null!==b&&(ch(b,$g,c),a.j.getState()===ah.uf&&a.j.R(c))}function kh(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(dh(b));c=c.La()+c.X();e=null!=e?e:eh();(d=lh(a,c,e,d))&&a.Ja()&&kh(a,c,!0,d,!1);return e}
656
+ function mh(a,b,c,d){const e=a.j.N(dh(b));a=null!=d?d:eh();const f=lh(e,Zg,a,c);f&&e.Ja()&&e.forEach((g,h)=>{g=h[0];g!==Tg&&g!==Ug||kh(e,h,!0,f,!0)})}function nh(a,b,c){const d=S(a,b);if(null!==d){const e=ch(d,Zg,c);void 0!==e&&(a.j.getState()!==ah.uf||d.F()||a.j.R(c),!d.Ja()&&!d.F()||d.forEach((f,g)=>{f=g[0];(f===Tg||f===Ug)&&e&&kh(d,g,!1,e,!0)}))}}
657
+ function oh(a,b,c){b=S(a,b,!1);if(!b||c===olympe.dc.Mb.NONE)return[];const d=c.charAt(0)===olympe.dc.ie.hg,e=[];b.forEach((f,g)=>{const h=g.charAt(0);if(!d&&f instanceof olympe.dc.wc&&(h===Vg||h===Wg))(f=a.j.get(f.X()))&&e.push([f,g.substring(1),null,!0]);else if(h===Tg||h===Ug){const k=g.substring(1),l=(h===Tg?12:3)&ph(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.Ma]:null;b=a.j.get(f);e.push([b,g,null,!0])}return e}
658
+ function qh(a,b,c,d,e){const f=a.j.N(dh(b));e=null!=e?e:eh();const g=lh(f,Yg+c,e,d);g&&f.Ja()&&oh(a,b,c).forEach(([h,...k])=>{h.Ja()&&g(...k,!0,h.tag())})}function rh(a,b,c,d){const e=S(a,b);if(null!==e){const f=ch(e,Yg+c,d);void 0!==f&&(a.j.getState()!==ah.uf||e.F()||a.j.R(d),!e.Ja()&&!e.F()||oh(a,b,c).forEach(([g,...h])=>{(g.Ja()||g.F())&&f(...h,!1,g.tag())}))}}function sh(a,b){a=S(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===Wg&&b.set(c.substring(1),d);return b}
659
+ function ph(a,b,c){if(c===olympe.dc.Mb.NONE)return 0;const d=c[0]===olympe.dc.ie.hg;c=d?c.substring(1):c;a=a.Ra(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function th(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===Tg||c===Ug){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(S(a,b,!0))}
660
+ function uh(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.fa(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.fa(b)}`);return d}function vh(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.X();const e=ch(a,b,c);void 0!==e&&(this.j.getState()!==ah.uf||a.F()&&!d||this.j.R(c),d||!a.Ja()&&!a.F()||kh(a,b,!1,e,!1))}}Ja(a){a=this.j.get(olympe.dc.fa(a));return!(null==a||!a.Ja())}name(a){let b,c;return null!=(c=null==(b=S(this,a))?void 0:b.Ra(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=S(this,a,!0))?a.model():null)?a.tag():null}gf(a){return(a=(a=S(this,
662
+ a,!0))&&a.gf())?a.tag():null}wi(a){a=S(this,a,!0);return!(!a||!a.gf())}Ob(a,b){a=(a=S(this,a,!0))&&a.model();return!(!a||!this.Uf(a.tag(),b))}source(a){return(a=S(this,a,!0))&&a.source()}Re(a){a=S(this,a,!1);return!a||a.N}Ra(a,b,c){a=S(this,a,!0);b=olympe.dc.fa(b);let d;return null!=(d=null==a?void 0:a.Ra(b,c))?d:null}Cb(a,b=!1){var c=S(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===Vg||!b&&c===Xg)&&a.set(d.substring(1),e);return a}il(a,b){return oh(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.X();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}bt(a,b,c){let d,e;a=null==(d=S(this,a,!0))?void 0:null==(e=d.get(b.La()+b.X()))?void 0:e.get(olympe.dc.fa(c));return!(null==a||!a.Ja())}Hn(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.X()),void 0!==a)for(const e of a.values())e.Ja()&&b.push(e.tag());a=b}return a}Jb(a,b){var c=
664
+ S(this,a,!0);const d=b.La()+b.X();c=null==c?void 0:c.get(d);if(1<(null==c?void 0:c.size))return this.G.warn(`Relation ${b.X()} 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}oh(a,b,c){a=olympe.dc.fa(a);const d=uh(this,a,b);d.delete(a);return c?(c=olympe.dc.fa(c),d.has(c)?Array.from(uh(this,c,b.$b()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Hs(a,b,c){if(!this.Ja(a))return null;b=uh(this,
665
+ a,b);const d=[olympe.dc.fa(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}zn(a,b,c){return this.Hn(a,b).find(c)||null}Qx(a,b,c){return this.Hn(a,b).filter(c)}Ms(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.gf();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.fa(a)} but one of them does not exists (${c.tag()})`,
666
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())}Uf(a,b){const c=olympe.dc.fa(b);return!!this.Hs(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.Uf;
667
667
  olympe.dc.kb.prototype.getExtendedModels=olympe.dc.kb.prototype.Ms;olympe.dc.kb.prototype.findAllRelated=olympe.dc.kb.prototype.Qx;olympe.dc.kb.prototype.findRelated=olympe.dc.kb.prototype.zn;olympe.dc.kb.prototype.findRecursive=olympe.dc.kb.prototype.Hs;olympe.dc.kb.prototype.getRecursiveRelated=olympe.dc.kb.prototype.oh;olympe.dc.kb.prototype.getUniqueRelated=olympe.dc.kb.prototype.Jb;olympe.dc.kb.prototype.getMultiRelated=olympe.dc.kb.prototype.Hn;olympe.dc.kb.prototype.isRelated=olympe.dc.kb.prototype.bt;
668
668
  olympe.dc.kb.prototype.getRelated=olympe.dc.kb.prototype.cb;olympe.dc.kb.prototype.getProperties=olympe.dc.kb.prototype.Cb;olympe.dc.kb.prototype.getProperty=olympe.dc.kb.prototype.Ra;olympe.dc.kb.prototype.isPersisted=olympe.dc.kb.prototype.Re;olympe.dc.kb.prototype.instanceOf=olympe.dc.kb.prototype.Ob;olympe.dc.kb.prototype.isModel=olympe.dc.kb.prototype.wi;olympe.dc.kb.prototype.extension=olympe.dc.kb.prototype.gf;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.Ia;const wh=olympe.dc.db.Database.D.ORIGIN,Lg=olympe.dc.db.Database.D.DESTINATION,Kg=olympe.dc.db.Database.D.Bl,xh=olympe.dc.db.Database.D.fj,yh=olympe.dc.db.Database.D.Xp,zh=olympe.dc.db.Database.D.Ii,Ah=wh+Lg,Bh=xh+xh,Ch=Array.from(Object.values(olympe.dc.Mb)).filter(a=>null!==a);function Ig(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)}
669
+ olympe.dc.kb.prototype.name=olympe.dc.kb.prototype.name;olympe.dc.kb.prototype.exist=olympe.dc.kb.prototype.Ja;const wh=olympe.dc.db.Database.D.ORIGIN,Lg=olympe.dc.db.Database.D.DESTINATION,Kg=olympe.dc.db.Database.D.Bl,xh=olympe.dc.db.Database.D.ej,yh=olympe.dc.db.Database.D.Xp,zh=olympe.dc.db.Database.D.Hi,Ah=wh+Lg,Bh=xh+xh,Ch=Array.from(Object.values(olympe.dc.Mb)).filter(a=>null!==a);function Ig(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
670
  function Mg(a){for(const [b,c]of a.H)a.D.Gc(new Set,b).filter(d=>Dg(d,c)).forEach(d=>{d=d.tag();c?Jg(a,d).create():Jg(a,d).delete()})}
671
671
  function Ng(a){const b=a.D;a.F.forEach((c,d)=>{var e=b.get(d);if(c.D()||c.zd()){var f=e.get(zh);f&&Dh(a,f,c.D(),d);c.zd()&&a.R.add(d)}for(const [n,p]of c.Cb()){var g=n[0]===Kg,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(zh+xh+h);q&&Dh(f,q,l,g);(k=k.get(zh+Bh))&&Dh(f,k,h,l,g)}for(const n of c.ea())Eh(a,e,...n);(e=c.Y)&&Fh(a,e,d,c.Yb,!c.zd())});a.H.clear();a.F.clear();a.N.clear();Gh(a)}function Jg(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.Kh(b),a.F.set(b,c));return c}
672
- function Dh(a,b,...c){b.forEach((d,e)=>{Ig(a,e,d.bind(null,...c))})}function Eh(a,b,c,d,e,f){var g=b.get(zh+d+c);g&&Dh(a,g,f,e);(g=b.get(zh+Ah))&&Dh(a,g,c,d,f,e);Hh(a,c,d).forEach((h,k)=>{(k=b.get(zh+yh+k))&&Dh(a,k,c,d,h,f,e)})}function Fh(a,b,c,d,e){Ch.forEach(f=>{const g=f[0]===olympe.dc.ie.gg;(f=a.D.get(g?c:b).get(zh+yh+f))&&Dh(a,f,d,null,!0,e,g?b:c)})}
673
- function Gh(a){a.Y.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 Hh(a,b,c){const d=b+c;let e=a.N.get(d);if(!e){const f=a.D.get(b);e=new Map;Ch.forEach(g=>{const h=g[0]===olympe.dc.ie.gg;var k=h?g.substring(1):g;let l;k=null!=(l=null==f?void 0:f.get(xh+k))?l:0;k=h?((k&3)<<2)+((k&12)>>2):k;(c===wh?12:3)&k&&e.set(g,!!((c===wh?8:2)&k))});a.N.set(d,e)}return e}
674
- olympe.dc.db.ku=class{constructor(a,b,c){this.id=a;this.D=b;this.Y=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 Og(a){if(!a.F&&0<a.D.size)switch(a.mode){case olympe.dc.db.zf.j.io:a.F=!0;setTimeout(()=>{a.j.getState()===olympe.dc.db.Database.F.IDLE&&a.run()},a.delay);break;case olympe.dc.db.zf.j.vw: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.Nd(c),b.push(c))}this.D.clear();this.j.Ja(olympe.dc.db.Database.j.Bp,b);this.F=!1}init(){const a=olympe.dc.db.Database.j.es,b=olympe.dc.db.Database.j.aq,
676
- c=olympe.dc.db.Database.j.mr,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&Og(this)};this.j.j(olympe.dc.db.Database.j.cn,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.Iw,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.zf.j={am:0,vw:1,io:2};olympe.dc.db.zf.D=5E3;olympe.dc.db.fc=class{constructor(a){this.id=null!=a?a:olympe.V.Of();this.Ab=new Map}T(){return this.id}rc(a){const b=olympe.dc.db.Kh.j.Am,c=olympe.dc.db.Kh.j.Dc,d=olympe.dc.db.Kh.j.Xk;this.Ab.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.Cb():void 0;a.Rc(f,h,k,g);break;case d:e.N()&&a.Yc(f,e.Cb(),g);break;case c:a.D(f,e.F(),g)}for(const [h,k,l]of e.Jd())e=this.Ab.get(k),
677
- l?a.Pa(h,f,k,g,e.Vb()):a.ic(h,f,k,g,e.Vb())});return a}nf(){return 0===this.Ab.size}H(){let a=0;this.Ab.forEach(b=>{a+=b.wd()});return a}Rc(a,b,c,d=null){b=this.F(a).create(b);'string'===typeof d&&this.Pa(olympe.dc.hc.$c,a,d,d,null);c&&b.ln(c)}Yc(a,b,c=null){b&&this.F(a,c).ln(b)}D(a,b=olympe.dc.Mb.NONE,c=null){const d=this.Ab.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.Ab.get(e).Cb().clear(),this.Y(e,!0)}}Pa(a,b,c,d=null,e=null){this.F(b,d).link(a,
678
- c);this.F(c,e).Eb(a,b)}ic(a,b,c,d=null,e=null){this.F(b,d).unlink(a,c);this.F(c,e).Gc(a,b)}$(a){var b=olympe.dc.ha();if(b.Ia(a)){const c=b.model(a),d=b.source(a),e=b.Cb(a,!0);sh(b,a).forEach((f,g)=>{e.set(`${olympe.dc.ie.Ye}${g}`,f)});this.Rc(a,d,e,c);(b=b.gf(a))&&this.Pa(olympe.dc.hc.Mi,a,b);e.forEach(f=>{f instanceof olympe.dc.wc&&this.$(f.X())})}}Uc(){return function*(a){for(const b of a.values())if(b.D()||b.zd()||b.N())yield b}(this.Ab)}Tc(a){let b;return null!=(b=this.Ab.get(olympe.dc.fa(a)))?
672
+ function Dh(a,b,...c){b.forEach((d,e)=>{Ig(a,e,d.bind(null,...c))})}function Eh(a,b,c,d,e,f){var g=b.get(zh+d+c);g&&Dh(a,g,f,e);(g=b.get(zh+Ah))&&Dh(a,g,c,d,f,e);Hh(a,c,d).forEach((h,k)=>{(k=b.get(zh+yh+k))&&Dh(a,k,c,d,h,f,e)})}function Fh(a,b,c,d,e){Ch.forEach(f=>{const g=f[0]===olympe.dc.ie.hg;(f=a.D.get(g?c:b).get(zh+yh+f))&&Dh(a,f,d,null,!0,e,g?b:c)})}
673
+ function Gh(a){a.Y.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 Hh(a,b,c){const d=b+c;let e=a.N.get(d);if(!e){const f=a.D.get(b);e=new Map;Ch.forEach(g=>{const h=g[0]===olympe.dc.ie.hg;var k=h?g.substring(1):g;let l;k=null!=(l=null==f?void 0:f.get(xh+k))?l:0;k=h?((k&3)<<2)+((k&12)>>2):k;(c===wh?12:3)&k&&e.set(g,!!((c===wh?8:2)&k))});a.N.set(d,e)}return e}
674
+ olympe.dc.db.ku=class{constructor(a,b,c){this.id=a;this.D=b;this.Y=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 Og(a){if(!a.F&&0<a.D.size)switch(a.mode){case olympe.dc.db.Af.j.io:a.F=!0;setTimeout(()=>{a.j.getState()===olympe.dc.db.Database.F.IDLE&&a.run()},a.delay);break;case olympe.dc.db.Af.j.vw:a.F=!0,a.run()}}
675
+ 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.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.Nd(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.es,b=olympe.dc.db.Database.j.aq,
676
+ c=olympe.dc.db.Database.j.mr,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&Og(this)};this.j.j(olympe.dc.db.Database.j.cn,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.Iw,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.Af.j={am:0,vw:1,io:2};olympe.dc.db.Af.D=5E3;olympe.dc.db.fc=class{constructor(a){this.id=null!=a?a:olympe.V.jf();this.Ab=new Map}T(){return this.id}rc(a){const b=olympe.dc.db.Kh.j.Am,c=olympe.dc.db.Kh.j.Dc,d=olympe.dc.db.Kh.j.Xk;this.Ab.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.Cb():void 0;a.Rc(f,h,k,g);break;case d:e.N()&&a.Yc(f,e.Cb(),g);break;case c:a.D(f,e.F(),g)}for(const [h,k,l]of e.Jd())e=this.Ab.get(k),
677
+ l?a.Pa(h,f,k,g,e.Vb()):a.ic(h,f,k,g,e.Vb())});return a}pf(){return 0===this.Ab.size}H(){let a=0;this.Ab.forEach(b=>{a+=b.wd()});return a}Rc(a,b,c,d=null){b=this.F(a).create(b);'string'===typeof d&&this.Pa(olympe.dc.hc.$c,a,d,d,null);c&&b.ln(c)}Yc(a,b,c=null){b&&this.F(a,c).ln(b)}D(a,b=olympe.dc.Mb.NONE,c=null){const d=this.Ab.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.Ab.get(e).Cb().clear(),this.Y(e,!0)}}Pa(a,b,c,d=null,e=null){this.F(b,d).link(a,
678
+ c);this.F(c,e).Eb(a,b)}ic(a,b,c,d=null,e=null){this.F(b,d).unlink(a,c);this.F(c,e).Gc(a,b)}$(a){var b=olympe.dc.ha();if(b.Ja(a)){const c=b.model(a),d=b.source(a),e=b.Cb(a,!0);sh(b,a).forEach((f,g)=>{e.set(`${olympe.dc.ie.Ye}${g}`,f)});this.Rc(a,d,e,c);(b=b.gf(a))&&this.Pa(olympe.dc.hc.Li,a,b);e.forEach(f=>{f instanceof olympe.dc.wc&&this.$(f.X())})}}Uc(){return function*(a){for(const b of a.values())if(b.D()||b.zd()||b.N())yield b}(this.Ab)}Tc(a){let b;return null!=(b=this.Ab.get(olympe.dc.fa(a)))?
679
679
  b:null}j(a,b=olympe.dc.Mb.NONE){a=this.il(a,b);for(const c of a)this.Y(c,!1),this.Ab.delete(c)}Jd(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.Jd((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.Ab.values())}oh(a,b,c=(d,e)=>[d,e]){return this.ja(a,b,c)}*ja(a,b,c,d=[]){d.push(a);a=this.Tc(a);for(const [e,f]of a.cb(b))d.includes(e)||(yield*this.ja(e,b,c,d),yield c(e,f))}N(a,b,c){const d=this.Ab.get(b),e=this.Ab.get(c);d&&d.H(a,olympe.dc.va.DESTINATION,c);e&&e.H(a,olympe.dc.va.ORIGIN,
680
- b)}Y(a,b){const c=olympe.dc.va.ORIGIN,d=olympe.dc.va.DESTINATION,e=this.Ab.get(a);for(const [g,h,k]of e.Jd())if(k||!b){e.H(g,d,h);var f=this.Ab.get(h);f&&f.H(g,c,a)}for(const [g,h,k]of e.bb())if(k||!b)e.H(g,c,h),(f=this.Ab.get(h))&&f.H(g,d,a)}*Qs(a){let b;for(const [c,d]of(null==(b=this.Tc(a))?void 0:b.cb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.Ab.get(c),a.zd()||(yield a))}il(a,b,c=!0){const d=olympe.dm.Relation.j.vr,e=olympe.dm.Relation.j.bs,f=olympe.dc.va.ORIGIN,g=olympe.dc.ha();a=new Set([a]);
681
- const h=new Set;for(const l of a){var k=this.Ab.get(l);if(void 0!==k){for(const [n,p,q]of k.Jd())q&&ph(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.bb())q&&ph(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of th(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&ph(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.Ab.has(l))}F(a,b){let c=this.Ab.get(a);void 0===c&&(c=new olympe.dc.db.Kh(a),this.Ab.set(a,c));return b?c.ta(b):c}R(a){const b=
682
- olympe.dc.va.DESTINATION;for(const [c,d]of this.ea(a))if(a=c.tag(),d.zd())this.j(a,d.F());else if(c.zd())d.D()&&this.j(a,c.F());else{c.Cb().forEach((e,f)=>{void 0!==d.Ra(f)&&c.$(f)});for(const [e,f,g]of c.Jd()){const h=d.mb(e,b,f);void 0!==h&&g!==h&&this.N(e,a,f)}}return this}*ea(a){var b=this.Ab;const c=a.Ab,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.fc.za=[olympe.dc.Writable,olympe.dc.fr];const Ih=olympe.dc.db.Database.j,Jh=olympe.dc.db.Database.D.fj,Kh=olympe.dc.db.Database.D.Du,Lh=olympe.dc.db.Database.D.Ye,Mh=olympe.dc.db.Database.D.Bl,Nh=olympe.dc.db.Database.D.Ii,U=olympe.dc.va.ORIGIN,V=olympe.dc.va.DESTINATION,Oh=olympe.dc.hc.$c,Ph=olympe.dc.hc.Mi;function mg(a,b,c=!1){const d=a.get(Lh+b);return c||void 0!==d?d:a.get(Kh+b)}function Dg(a,b){const c=a.e!==b;c&&(b?(a.e=b,Qh(a)):(Rh(a),a.e=b),a.db.D(b?Ih.em:Ih.Dc,a.j));return c}
680
+ b)}Y(a,b){const c=olympe.dc.va.ORIGIN,d=olympe.dc.va.DESTINATION,e=this.Ab.get(a);for(const [g,h,k]of e.Jd())if(k||!b){e.H(g,d,h);var f=this.Ab.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.Ab.get(h))&&f.H(g,d,a)}*Qs(a){let b;for(const [c,d]of(null==(b=this.Tc(a))?void 0:b.cb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.Ab.get(c),a.zd()||(yield a))}il(a,b,c=!0){const d=olympe.dm.Relation.j.vr,e=olympe.dm.Relation.j.bs,f=olympe.dc.va.ORIGIN,g=olympe.dc.ha();a=new Set([a]);
681
+ const h=new Set;for(const l of a){var k=this.Ab.get(l);if(void 0!==k){for(const [n,p,q]of k.Jd())q&&ph(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.Wa())q&&ph(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of th(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&ph(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.Ab.has(l))}F(a,b){let c=this.Ab.get(a);void 0===c&&(c=new olympe.dc.db.Kh(a),this.Ab.set(a,c));return b?c.ta(b):c}R(a){const b=
682
+ olympe.dc.va.DESTINATION;for(const [c,d]of this.ea(a))if(a=c.tag(),d.zd())this.j(a,d.F());else if(c.zd())d.D()&&this.j(a,c.F());else{c.Cb().forEach((e,f)=>{void 0!==d.Ra(f)&&c.$(f)});for(const [e,f,g]of c.Jd()){const h=d.mb(e,b,f);void 0!==h&&g!==h&&this.N(e,a,f)}}return this}*ea(a){var b=this.Ab;const c=a.Ab,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.fc.za=[olympe.dc.Writable,olympe.dc.fr];const Ih=olympe.dc.db.Database.j,Jh=olympe.dc.db.Database.D.ej,Kh=olympe.dc.db.Database.D.Du,Lh=olympe.dc.db.Database.D.Ye,Mh=olympe.dc.db.Database.D.Bl,Nh=olympe.dc.db.Database.D.Hi,U=olympe.dc.va.ORIGIN,V=olympe.dc.va.DESTINATION,Oh=olympe.dc.hc.$c,Ph=olympe.dc.hc.Li;function mg(a,b,c=!1){const d=a.get(Lh+b);return c||void 0!==d?d:a.get(Kh+b)}function Dg(a,b){const c=a.e!==b;c&&(b?(a.e=b,Qh(a)):(Rh(a),a.e=b),a.db.D(b?Ih.em:Ih.Dc,a.j));return c}
683
683
  function Eg(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(Oh,c)}a.link(Oh,b);b.forEach((d,e)=>{if(e[0]===Lh||e[0]===Kh)e=e.substring(1),Sh(a,e,d)});null===a.H||!b.e&&b!==a||a.db.$(a,!0)}function Fg(a,b){const c=a.gf();if(null!==c){if(c===b)return;a.unlink(Ph,c)}a.link(Ph,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===Lh||f[0]===Kh)f=f.substring(1),a.has(Lh+f)||(a.set(Kh+f,e),d.set(f,e))});Th(a,d)}
684
684
  function Gg(a,b){a.unlink(Oh,b);a.forEach((c,d)=>{c=d.substring(1);Sh(a,c,null)});a.db.$(a,!1)}function Hg(a,b){a.unlink(Ph,b);const c=new Map;a.forEach((d,e)=>{e[0]===Kh&&(a.delete(e),d=e.substring(1),c.set(d,null))});Th(a,c)}
685
- function Pg(a,b,c){const d=Lh+b;var e=a.get(d);e=void 0===e?null:e;if(!Uh(e,c))if(Vh(a,b,e,c,!0),e=Kh+b,null===c){a.delete(d);let f;c=null==(f=a.gf())?void 0:mg(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);Th(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),Th(a,(new Map).set(b,c))}function fh(a,b,c,d){const e=Wh(a,Nh+b);return e.has(c)?!1:(e.set(c,d),a.oe(olympe.dc.db.Instance.j.Ii+b),a.db.D(Ih.Jo,a.j,b,c),!0)}
686
- function ch(a,b,c){const d=Xh(a,Nh+b,c);void 0!==d&&(a.detach(olympe.dc.db.Instance.j.Ii+b),a.db.D(Ih.Ko,a.j,b,c));return d}function lh(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.dw+b;h?g.oe(k):g.detach(k)}d(...f)};return fh(a,b,c,e)?e:null}function Uh(a,b){return a instanceof Date?b instanceof Date&&a.getTime()===b.getTime():null!==a&&'function'===typeof a.Fa?a.Fa(b):a===b}
687
- function Vh(a,b,c,d,e){c instanceof olympe.dc.wc&&(Yh(a.db.get(c.X())),a.db.ta(c.X()));d instanceof olympe.dc.wc&&(c=a.db.N(d.X(),!0),c.D&&c.D.tag!==a.j&&a.db.Za().fatal('Instance',d.X(),'referenced multiple times!\nThis instance is currently property of',c.D.tag,'(for the property '+c.D.Ma+')','and is assigned as a property of',a.j,'(for the property '+b+')'),d=c,a=a.j,void 0===d.D&&(d.oe(olympe.dc.db.Instance.j.gj+a+':'+b),d.db.bb(d.j,a,b)),d.D={tag:a,Ma:b,iz:e})}
685
+ function Pg(a,b,c){const d=Lh+b;var e=a.get(d);e=void 0===e?null:e;if(!Uh(e,c))if(Vh(a,b,e,c,!0),e=Kh+b,null===c){a.delete(d);let f;c=null==(f=a.gf())?void 0:mg(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);Th(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),Th(a,(new Map).set(b,c))}function fh(a,b,c,d){const e=Wh(a,Nh+b);return e.has(c)?!1:(e.set(c,d),a.oe(olympe.dc.db.Instance.j.Hi+b),a.db.D(Ih.Jo,a.j,b,c),!0)}
686
+ function ch(a,b,c){const d=Xh(a,Nh+b,c);void 0!==d&&(a.detach(olympe.dc.db.Instance.j.Hi+b),a.db.D(Ih.Ko,a.j,b,c));return d}function lh(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.dw+b;h?g.oe(k):g.detach(k)}d(...f)};return fh(a,b,c,e)?e:null}function Uh(a,b){return a instanceof Date?b instanceof Date&&a.getTime()===b.getTime():null!==a&&'function'===typeof a.Fa?a.Fa(b):a===b}
687
+ function Vh(a,b,c,d,e){c instanceof olympe.dc.wc&&(Yh(a.db.get(c.X())),a.db.ta(c.X()));d instanceof olympe.dc.wc&&(c=a.db.N(d.X(),!0),c.D&&c.D.tag!==a.j&&a.db.Ya().fatal('Instance',d.X(),'referenced multiple times!\nThis instance is currently property of',c.D.tag,'(for the property '+c.D.Ma+')','and is assigned as a property of',a.j,'(for the property '+b+')'),d=c,a=a.j,void 0===d.D&&(d.oe(olympe.dc.db.Instance.j.fj+a+':'+b),d.db.Wa(d.j,a,b)),d.D={tag:a,Ma:b,iz:e})}
688
688
  function Zh(a,b,c,d){a.e&&a.db.Pe(a.j,b,c,d)}function Th(a,b,c=[]){const d=a.get(U+Oh);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>Sh(e,g,f))});a=a.get(U+Ph);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(Lh+k)||(g.set(k,h),null!==h?e.set(Kh+k,h):e.delete(Kh+k))});Th(e,g,[...c,f])}})}function Wh(a,b){let c;return null!=(c=a.get(b))?c:a.create(b)}function $h(a,b,c,d,e){a.db.ff(a.j,b,c,d.j,e)}
689
689
  function Xh(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 Sh(a,b,c){if(!a.has(Jh+b)){const d=Mh+b,e=a.get(d);Uh(c,void 0!==e?e:null)||(null===c?a.delete(d):a.set(d,c),Zh(a,b,c,null!==c))}}function Qh(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&&($h(a,e,d,g,!0),$h(g,e,f,a,!0))})}else if(d===Jh||d===Mh)c=c.substring(1),Zh(a,c,b,d===Mh)})}
690
690
  function Rh(a){a.forEach((b,c)=>{const d=c[0];if(d!==Nh){var e=c.substring(1);d===U?b.forEach(f=>{f.unlink(e,a)}):d===V?b.forEach(f=>{a.unlink(e,f)}):d===Jh?a.update(e,null):d===Lh&&Pg(a,e,null);a.delete(c)}});if(void 0!==a.D){const b=a.db.get(a.D.tag),c=a.D.iz;let d,e;(null==(d=b.get(`${c?Lh:Jh}${a.D.Ma}`))?void 0:null==(e=d.X)?void 0:e.call(d))===a.j&&(c?Pg(b,a.D.Ma,null):b.update(a.D.Ma,null))}}
691
- function Yh(a){void 0!==a.D&&(a.detach(olympe.dc.db.Instance.j.gj+a.D.tag+':'+a.D.Ma),a.db.bb(a.j,a.D.tag,a.D.Ma),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}Ia(){return this.e}F(){return this.db.F(this.j)}source(){return this.H}model(){const a=this.get(V+Oh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}gf(){const a=this.get(V+Ph);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Ra(olympe.dc.CloudObject.nameProp.X());a=`Instance: ${this.j}, Exist: ${this.e}, Name: ${a}`;
691
+ function Yh(a){void 0!==a.D&&(a.detach(olympe.dc.db.Instance.j.fj+a.D.tag+':'+a.D.Ma),a.db.Wa(a.j,a.D.tag,a.D.Ma),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+Oh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}gf(){const a=this.get(V+Ph);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Ra(olympe.dc.CloudObject.nameProp.X());a=`Instance: ${this.j}, Exist: ${this.e}, Name: ${a}`;
693
693
  var b=this.model();if(b){var c=b.Ra(olympe.dc.CloudObject.nameProp.X())||'No model name';a+=`\nModel: ${b.j}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.gf())?(c=b.Ra(olympe.dc.CloudObject.nameProp.X())||'No extension name',a+=`\nExtension: ${b.j}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Ra(a,b=!1){const c=this.get(Jh+a);return b||void 0!==c?c:this.get(Mh+a)}update(a,b){const c=Jh+a;var d=this.get(c);d=void 0===d?null:d;if(!Uh(d,b))if(Vh(this,
694
694
  a,d,b,!1),d=Mh+a,null===b){this.delete(c);let e;b=null==(e=this.model())?void 0:mg(e,a);void 0!==b?(this.set(d,b),Zh(this,a,b,!0)):Zh(this,a,null,!1)}else this.set(c,b),this.delete(d),Zh(this,a,b,!1)}link(a,b){var c=U+a;const d=Wh(this,V+a);c=Wh(b,c);d.has(b.j)||(d.set(b.j,b),c.set(this.j,this),this.db.D(Ih.Ik,this.j,a,V,b.j),this.db.D(Ih.Ik,b.j,a,U,this.j),this.e&&b.e&&($h(this,a,V,b,!0),$h(b,a,U,this,!0)))}unlink(a,b){const c=U+a;void 0!==Xh(this,V+a,b.j)&&(Xh(b,c,this.j),this.db.D(Ih.Sm,this.j,
695
695
  a,V,b.j),this.db.D(Ih.Sm,b.j,a,U,this.j),this.e&&b.e&&($h(this,a,V,b,!1),$h(b,a,U,this,!1)))}persist(){this.N=!0;return this}oe(){this.c++;1===this.c&&this.db.D(Ih.es,this.j)}detach(){0<this.c?--this.c:this.db.D(Ih.mr,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(Ih.cn,
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===Jh&&a instanceof olympe.dc.wc&&Yh(this.db.get(a.X()))});void 0!==this.D&&this.db.get(this.D.tag).delete(Jh+this.D.Ma)}create(a){const b=new Map;this.set(a,b);return b}};olympe.dc.db.Instance.j={Zp:'instance',dw:'rel',Ii:'cb',gj:'ref',TRANSACTION:'tx'};olympe.dc.db.Kh=class a{constructor(b){this.Pc=b;this.R=this.Ja=null;this.Pb=olympe.dc.Mb.NONE;this.state=a.j.Xk;this.j=this.pb=this.Yb=this.Y=this.properties=null}tag(){return this.Pc}Vb(){return this.R}jb(){return this.Ja}getState(){return this.state}ta(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.Pb:olympe.dc.Mb.NONE}create(b){this.state=a.j.Am;
697
- this.Ja=null!=b?b:null;return this}delete(b=olympe.dc.Mb.NONE){this.state=a.j.Dc;this.Pb=b;this.properties=null;return this}ka(b,c){if(this.state===a.j.Dc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}ln(b){this.state!==a.j.Dc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}Nd(b,c){if(null!==this.Y&&this.Y!==b)throw Error('An instance should never be set as complex property of multiple instances');this.Y=b;this.Yb=
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===Jh&&a instanceof olympe.dc.wc&&Yh(this.db.get(a.X()))});void 0!==this.D&&this.db.get(this.D.tag).delete(Jh+this.D.Ma)}create(a){const b=new Map;this.set(a,b);return b}};olympe.dc.db.Instance.j={Zp:'instance',dw:'rel',Hi:'cb',fj:'ref',TRANSACTION:'tx'};olympe.dc.db.Kh=class a{constructor(b){this.Pc=b;this.R=this.Ha=null;this.Pb=olympe.dc.Mb.NONE;this.state=a.j.Xk;this.j=this.pb=this.Yb=this.Y=this.properties=null}tag(){return this.Pc}Vb(){return this.R}jb(){return this.Ha}getState(){return this.state}ta(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.Pb:olympe.dc.Mb.NONE}create(b){this.state=a.j.Am;
697
+ this.Ha=null!=b?b:null;return this}delete(b=olympe.dc.Mb.NONE){this.state=a.j.Dc;this.Pb=b;this.properties=null;return this}ka(b,c){if(this.state===a.j.Dc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}ln(b){this.state!==a.j.Dc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}Nd(b,c){if(null!==this.Y&&this.Y!==b)throw Error('An instance should never be set as complex property of multiple instances');this.Y=b;this.Yb=
698
698
  c}$(b){let c;null==(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.pb&&(this.pb=new Map);b===olympe.dc.hc.$c&&this.ta(c);this.sa(this.pb,b,c,!0);return this}unlink(b,c){null===this.pb&&(this.pb=new Map);b===olympe.dc.hc.$c&&this.ta(c);this.sa(this.pb,b,c,!1);return this}Eb(b,c){null===this.j&&(this.j=new Map);this.sa(this.j,b,c,!0)}Gc(b,c){null===this.j&&(this.j=new Map);this.sa(this.j,b,c,!1)}mb(b,c,d){if(c=c===olympe.dc.va.ORIGIN?this.j:this.pb)return(b=
699
699
  c.get(b))&&b.get(d)}H(b,c,d){const e=(c=c===olympe.dc.va.ORIGIN?this.j:this.pb)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}D(){return this.state===a.j.Am}zd(){return this.state===a.j.Dc}wd(){let b=this.properties?this.properties.size:0,c;null==(c=this.pb)||c.forEach(d=>{b+=d.size});return b}N(){return null!==this.properties}Gd(){return null!==this.pb||null!==this.j}Cb(){let b;return null!=(b=this.properties)?b:new Map}Ra(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.X()))for(const [e,f]of d)yield c(e,f)}(b.La()===olympe.dc.va.ORIGIN?this.j:this.pb)}Jb(b){const c=b.La()===olympe.dc.va.ORIGIN?this.j:this.pb;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}Jd(b=(c,d,e)=>[c,d,e]){return this.ja(this.pb,b)}bb(b=(c,d,e)=>[c,d,e]){return this.ja(this.j,b)}ea(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.va.ORIGIN,d=olympe.dc.va.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.ja.bind(this),this.pb,this.j)}sa(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)}}*ja(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.Kh.j={Am:0,Xk:1,Dc:2};olympe.dc.db.Cv=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.fa(a);if(this.j.has(b)){var c=this.j.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ia()){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.fj+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
700
+ e]){return function*(d){if(d=d&&d.get(b.X()))for(const [e,f]of d)yield c(e,f)}(b.La()===olympe.dc.va.ORIGIN?this.j:this.pb)}Jb(b){const c=b.La()===olympe.dc.va.ORIGIN?this.j:this.pb;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}Jd(b=(c,d,e)=>[c,d,e]){return this.ja(this.pb,b)}Wa(b=(c,d,e)=>[c,d,e]){return this.ja(this.j,b)}ea(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.va.ORIGIN,d=olympe.dc.va.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.ja.bind(this),this.pb,this.j)}sa(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)}}*ja(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.Kh.j={Am:0,Xk:1,Dc:2};olympe.dc.db.Cv=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.fa(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.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
702
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.mp,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.Sm,f=olympe.dc.db.Database.j.Jo,g=olympe.dc.db.Database.j.Ko,h=()=>{};this.j.j(olympe.dc.db.Database.j.lp,()=>{});this.j.j(a,()=>{});this.j.j(b,k=>{this.j.Eb(()=>{mh(this.view,
703
- k,h,`monitorRelations${k}`)})});this.j.j(c,k=>{this.j.Eb(()=>{nh(this.view,k,`monitorRelations${k}`)})});this.j.j(d,()=>{});this.j.j(e,()=>{});this.j.j(f,()=>{});this.j.j(g,()=>{})}};olympe.dc.db.dn=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 ai(this.ha),a.rc(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',
703
+ k,h,`monitorRelations${k}`)})});this.j.j(c,k=>{this.j.Eb(()=>{nh(this.view,k,`monitorRelations${k}`)})});this.j.j(d,()=>{});this.j.j(e,()=>{});this.j.j(f,()=>{});this.j.j(g,()=>{})}};olympe.dc.db.dn=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.ug(a);this.G.debug(`DB Writer: transaction ${this.transactionId} opened`)}write(a,b){b&&(b=new ai(this.ha),a.rc(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
704
  this.transactionId);this.j.dt(this.transactionId,()=>a.rc(this))}close(){if(null===this.transactionId)throw Error('No transaction is open');this.j.le(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.hc.$c,a,d)}Yc(a,b){this.j.update(a,b)}D(a,b=olympe.dc.Mb.NONE){for(const c of lg(this.ha,a,b))this.j.ta(c)}Pa(a,b,c){this.j.link(a,b,c)}ic(a,b,c){this.j.unlink(a,b,c)}};
705
705
  function bi(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.wc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.X()+'")';else if(f instanceof olympe.C.Color)d+='Color("'+f.ph()+','+f.mh()+','+f.ih()+','+f.hh()+'")';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+=bi(a,f,
706
706
  (null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function ci(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function di(a,b){let c;return b===olympe.dc.hc.$c?'Model':null!=(c=a.db.name(b))?c:b}
707
707
  class ai{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}, ${bi(this,c)})`,ci(this,d))}Yc(a,b,c){this.log(`updateInstance(tag: ${a}, ${bi(this,b)})`,ci(this,c))}D(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,ci(this,c))}Pa(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,di(this,a))}ic(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
708
- di(this,a))}}olympe.dc.db.dn.za=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.P={Da:'dc.db.Logger',im:'dc.db.gc.Logger',Ea:'dc.db.DatabaseManager',bk:'dc.db.Database',Xl:'dc.db.DBView',MB:'dc.db.Graph',OA:'dc.db.DatabaseWriter',BC:'dc.db.PermissionProcessor',Zi:'dc.db.GraphMonitor'};olympe.dc.db.U={Cp:'db.garbageCollector',Dp:'db.garbageCollectorDelay',Pl:'db.commitBufferTimeout',Zi:'db.monitor',Bv:'db.monitorCounters',Av:'db.monitorCallbacks',cp:'db.debug'};
709
- olympe.W.config(function(a){E(a,olympe.dc.db.U.Cp,olympe.dc.db.zf.j.io);E(a,olympe.dc.db.U.Dp,5E3);E(a,olympe.dc.db.U.Pl,3E4);E(a,olympe.dc.db.U.Zi,!1);E(a,olympe.dc.db.U.cp,!1);D(a,olympe.dc.db.P.Da,[olympe.ia.P.Ea],b=>b.cd('db'));D(a,olympe.dc.db.P.im,[olympe.ia.P.Ea],b=>b.cd('gc'));D(a,olympe.dc.db.P.bk,[olympe.dc.db.P.Da,olympe.dc.db.P.im,new olympe.W.pa(olympe.dc.U.Yg),new olympe.W.pa(olympe.dc.db.U.Cp),new olympe.W.pa(olympe.dc.db.U.Dp),new olympe.W.pa(olympe.dc.U.Zh),new olympe.W.pa(olympe.dc.db.U.cp)],
710
- (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.Da,olympe.dc.db.P.bk);D(a,olympe.dc.db.P.Zi,[olympe.dc.db.P.Ea],b=>b.wz);D(a,olympe.dc.db.P.Ea,[olympe.dc.db.P.Da,olympe.dc.db.P.bk,olympe.dc.db.P.Xl,new olympe.W.pa(olympe.dc.U.ag),new olympe.W.pa(olympe.dc.db.U.Pl),new olympe.W.pa(olympe.dc.db.U.Zi),new olympe.W.pa(olympe.dc.db.U.Bv),
711
- new olympe.W.pa(olympe.dc.db.U.Av)],(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.gu(b,c,d,e,g)})},'olympe.dc.db');olympe.W.run([olympe.dc.db.P.bk,olympe.dc.db.P.Zi],(a,b)=>{olympe.ee().db=a;olympe.ee().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function ei(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.ha();this.j=a;this.Ma=b;this.Xi=c}ga(){return{p:this.Ma.X(),o:this.Xi}}toString(){return'sortByQueryPart-'+this.Xi+this.Ma.X()}kh(){const a=this.db.Jb(this.Ma,olympe.dm.Property.typeRel),b=olympe.dc.fa;if(this.db.Uf(a,olympe.dm.String))return ei((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return ei((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return ei((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return ei((c,
713
- d)=>c.compare(d));olympe.ia.Za('dc.query').warn(`No comparator found for type with tag ${a}`);return ei(()=>-1)}Ra(){return this.Ma}};olympe.dc.Ze=class{X(){}};olympe.dc.Ze.prototype.getTag=olympe.dc.Ze.prototype.X;olympe.dc.PB=olympe.dc.Ze;function fi(a){let b;if(null==(b=a.j)?0:b.nf())if(a=a.H,!a.N){let c;null==(c=a.R)||c.call(a)}}function gi(a,b,c,d,e){fi(a);let f,g;b?null==(f=a.j)||f.Pa(c,d,e):null==(g=a.j)||g.ic(c,d,e)}
714
- olympe.dc.query.Iv=class{constructor(a,b,c,d){this.G=a;this.source=b;this.D=c;this.H=d;this.j=this.F=null;this.db=olympe.dc.ha()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.D}:${a}:notif`;Of(this.db,a,(d,e)=>{if(d){fi(this);let f;null==(f=this.j)||f.$(e)}else if(b&&jh(this.db,e,c),!this.db.Ia(e)){fi(this);let f;null==(f=this.j)||f.D(e,olympe.dc.Mb.NONE)}},c);b&&ih(this.db,a,(d,e,f)=>{fi(this);let g;f||null!=(g=this.j)&&g.Yc(a,new Map([[d,e]]))},c)}}stop(a){Mf(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,
708
+ di(this,a))}}olympe.dc.db.dn.za=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.P={Da:'dc.db.Logger',im:'dc.db.gc.Logger',Ea:'dc.db.DatabaseManager',bk:'dc.db.Database',Xl:'dc.db.DBView',MB:'dc.db.Graph',OA:'dc.db.DatabaseWriter',BC:'dc.db.PermissionProcessor',Yi:'dc.db.GraphMonitor'};olympe.dc.db.U={Cp:'db.garbageCollector',Dp:'db.garbageCollectorDelay',Pl:'db.commitBufferTimeout',Yi:'db.monitor',Bv:'db.monitorCounters',Av:'db.monitorCallbacks',cp:'db.debug'};
709
+ olympe.W.config(function(a){E(a,olympe.dc.db.U.Cp,olympe.dc.db.Af.j.io);E(a,olympe.dc.db.U.Dp,5E3);E(a,olympe.dc.db.U.Pl,3E4);E(a,olympe.dc.db.U.Yi,!1);E(a,olympe.dc.db.U.cp,!1);D(a,olympe.dc.db.P.Da,[olympe.ia.P.Ea],b=>b.cd('db'));D(a,olympe.dc.db.P.im,[olympe.ia.P.Ea],b=>b.cd('gc'));D(a,olympe.dc.db.P.bk,[olympe.dc.db.P.Da,olympe.dc.db.P.im,new olympe.W.pa(olympe.dc.U.Yg),new olympe.W.pa(olympe.dc.db.U.Cp),new olympe.W.pa(olympe.dc.db.U.Dp),new olympe.W.pa(olympe.dc.U.Zh),new olympe.W.pa(olympe.dc.db.U.cp)],
710
+ (b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.Af.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.Da,olympe.dc.db.P.bk);D(a,olympe.dc.db.P.Yi,[olympe.dc.db.P.Ea],b=>b.wz);D(a,olympe.dc.db.P.Ea,[olympe.dc.db.P.Da,olympe.dc.db.P.bk,olympe.dc.db.P.Xl,new olympe.W.pa(olympe.dc.U.bg),new olympe.W.pa(olympe.dc.db.U.Pl),new olympe.W.pa(olympe.dc.db.U.Yi),new olympe.W.pa(olympe.dc.db.U.Bv),
711
+ new olympe.W.pa(olympe.dc.db.U.Av)],(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.gu(b,c,d,e,g)})},'olympe.dc.db');olympe.W.run([olympe.dc.db.P.bk,olympe.dc.db.P.Yi],(a,b)=>{olympe.ee().db=a;olympe.ee().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function ei(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.xf=class{constructor(a,b,c){this.db=olympe.dc.ha();this.j=a;this.Ma=b;this.Wi=c}ga(){return{p:this.Ma.X(),o:this.Wi}}toString(){return'sortByQueryPart-'+this.Wi+this.Ma.X()}kh(){const a=this.db.Jb(this.Ma,olympe.dm.Property.typeRel),b=olympe.dc.fa;if(this.db.Uf(a,olympe.dm.String))return ei((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return ei((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return ei((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return ei((c,
713
+ d)=>c.compare(d));olympe.ia.Ya('dc.query').warn(`No comparator found for type with tag ${a}`);return ei(()=>-1)}Ra(){return this.Ma}};olympe.dc.Ze=class{X(){}};olympe.dc.Ze.prototype.getTag=olympe.dc.Ze.prototype.X;olympe.dc.PB=olympe.dc.Ze;function fi(a){let b;if(null==(b=a.j)?0:b.pf())if(a=a.H,!a.N){let c;null==(c=a.R)||c.call(a)}}function gi(a,b,c,d,e){fi(a);let f,g;b?null==(f=a.j)||f.Pa(c,d,e):null==(g=a.j)||g.ic(c,d,e)}
714
+ olympe.dc.query.Iv=class{constructor(a,b,c,d){this.G=a;this.source=b;this.D=c;this.H=d;this.j=this.F=null;this.db=olympe.dc.ha()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.D}:${a}:notif`;Of(this.db,a,(d,e)=>{if(d){fi(this);let f;null==(f=this.j)||f.$(e)}else if(b&&jh(this.db,e,c),!this.db.Ja(e)){fi(this);let f;null==(f=this.j)||f.D(e,olympe.dc.Mb.NONE)}},c);b&&ih(this.db,a,(d,e,f)=>{fi(this);let g;f||null!=(g=this.j)&&g.Yc(a,new Map([[d,e]]))},c)}}stop(a){Mf(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,
715
715
  (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=>
716
716
  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={Hb:a.query.kh(),Md:a.Md,max:a.query.j.max,offset:a.query.j.offset};a.D=olympe.dc.Ka.from(a.Y,hi(a),b)}return a.D}function ki(a,b){a.R=b}function li(a){if(!a.N){null!==a.D&&(a.Y=a.D);a.D=null;a.N=!0;let b;null==(b=a.R)||b.call(a)}}
717
717
  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.va.ORIGIN?gi(a.Se,b,c,f,e):gi(a.Se,b,c,e,f))}
718
718
  function qi(a){a.G.j()&&a.G.debug(`Start sending notifications for query ${a.query.T()}`);const b=new olympe.dc.query.Iv(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.fc);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)}
719
- function si(a){a.N=!1;if(null!=(a=a.Se)){let b;const c=!(null==(b=a.j)?0:b.nf());a.F=c?a.j:null;c&&(a.j=new olympe.dc.db.fc,a.G.j()&&a.G.debug(`Commit notification with ${a.F.H()} operations for query ${a.D}`))}}
719
+ function si(a){a.N=!1;if(null!=(a=a.Se)){let b;const c=!(null==(b=a.j)?0:b.pf());a.F=c?a.j:null;c&&(a.j=new olympe.dc.db.fc,a.G.j()&&a.G.debug(`Commit notification with ${a.F.H()} operations for query ${a.D}`))}}
720
720
  olympe.dc.query.dr=class{constructor(a,b){this.G=a;this.query=b;this.F=olympe.V.ub(b.D);this.oa=new Map;this.j=(new Map).set(this.F,new olympe.dc.query.oa.Ym);this.H=new Set(b.F);this.Md=-1;this.N=!1;this.R=null;this.Y=olympe.dc.Ka.empty();this.Se=this.D=null;a=ii(b);a.forEach(c=>{const d=c.T();this.oa.set(d,c.N());this.j.set(d,c.ja())});b=b.kh();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.Md=c;break}}}remove(a,b=this.F,c='root'){b=
721
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}Qc(a){const b=a.D,c=olympe.V.ub(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.$(k,this.oa.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.oa.get(k))?void 0:l.Qc(f))?n:!1});e.set(f.T(),h);return 0<h.length})}};function ti(a){if(!olympe.dc.ha().Ob(a,olympe.dm.Property))throw new olympe.dc.query.Dd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
722
- function ui(a){var b=olympe.dc.query.Ba.j.Wr;const c=olympe.dc.query.Ba.j.np,d=olympe.dc.query.Ba.j.Zj,e=olympe.dc.query.Ba.j.Yp,f=olympe.dc.query.Ba.j.Aq,g=olympe.dc.query.Ba.j.nr,h=olympe.dc.query.Ba.j.fo,k=olympe.dc.query.Ba.j.Sq;switch(a.pr){case b:return new olympe.dc.query.Z.an(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.Z.Be(a.p,b,olympe.dc.ha());case d:return new olympe.dc.query.Z.xf(a.p,
723
- a.s,olympe.dc.ha(),a.c);case e:return new olympe.dc.query.Z.Ui(olympe.dc.ha(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Z.je(ui(a.v));case g:return new olympe.dc.query.Z.Gf(a.p,new RegExp(a.r),olympe.dc.ha(),a.c);case k:return new olympe.dc.query.Z.Fe(...a.p.map(l=>ui(l)));case h:return new olympe.dc.query.Z.Od(...a.p.map(l=>ui(l)));default:return null}}
724
- olympe.dc.query.Ba=class{observe(){}ob(){}compile(){return[[this]]}Ad(){return new olympe.dc.query.Z.je(this)}Cb(){}Qc(){}clear(){}ga(){}Xc(){}toString(){}Fa(a){return this===a}static cz(...a){return new olympe.dc.query.Z.an(a)}static Fa(a,b){ti(a);return new olympe.dc.query.Z.Be(a,b,olympe.dc.ha())}static contains(a,b,c=!0){ti(a);return new olympe.dc.query.Z.xf(a,b,olympe.dc.ha(),c)}static Xz(a,b,c=!0){ti(a);return new olympe.dc.query.Z.Gf(a,b,olympe.dc.ha(),c)}static nl(a,b,c=!0){ti(a);return new olympe.dc.query.Z.Ui(olympe.dc.ha(),
725
- a,b,!1,c)}static Oj(a,b,c=!0){ti(a);return new olympe.dc.query.Z.Ui(olympe.dc.ha(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.Ba))throw new olympe.dc.query.Dd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Z.Od(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Ba))throw new olympe.dc.query.Dd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
722
+ function ui(a){var b=olympe.dc.query.Ba.j.Wr;const c=olympe.dc.query.Ba.j.np,d=olympe.dc.query.Ba.j.Zj,e=olympe.dc.query.Ba.j.Yp,f=olympe.dc.query.Ba.j.Aq,g=olympe.dc.query.Ba.j.nr,h=olympe.dc.query.Ba.j.fo,k=olympe.dc.query.Ba.j.Sq;switch(a.pr){case b:return new olympe.dc.query.Z.an(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.Z.Be(a.p,b,olympe.dc.ha());case d:return new olympe.dc.query.Z.yf(a.p,
723
+ a.s,olympe.dc.ha(),a.c);case e:return new olympe.dc.query.Z.Ti(olympe.dc.ha(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Z.je(ui(a.v));case g:return new olympe.dc.query.Z.Hf(a.p,new RegExp(a.r),olympe.dc.ha(),a.c);case k:return new olympe.dc.query.Z.Fe(...a.p.map(l=>ui(l)));case h:return new olympe.dc.query.Z.Od(...a.p.map(l=>ui(l)));default:return null}}
724
+ olympe.dc.query.Ba=class{observe(){}ob(){}compile(){return[[this]]}Ad(){return new olympe.dc.query.Z.je(this)}Cb(){}Qc(){}clear(){}ga(){}Xc(){}toString(){}Fa(a){return this===a}static cz(...a){return new olympe.dc.query.Z.an(a)}static Fa(a,b){ti(a);return new olympe.dc.query.Z.Be(a,b,olympe.dc.ha())}static contains(a,b,c=!0){ti(a);return new olympe.dc.query.Z.yf(a,b,olympe.dc.ha(),c)}static Xz(a,b,c=!0){ti(a);return new olympe.dc.query.Z.Hf(a,b,olympe.dc.ha(),c)}static nl(a,b,c=!0){ti(a);return new olympe.dc.query.Z.Ti(olympe.dc.ha(),
725
+ a,b,!1,c)}static Oj(a,b,c=!0){ti(a);return new olympe.dc.query.Z.Ti(olympe.dc.ha(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.Ba))throw new olympe.dc.query.Dd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Z.Od(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Ba))throw new olympe.dc.query.Dd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
726
726
  return new olympe.dc.query.Z.Fe(...a)}static Ad(a){if(!(a instanceof olympe.dc.query.Ba))throw new olympe.dc.query.Dd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.Z.je(a)}};olympe.dc.query.Ba.not=olympe.dc.query.Ba.Ad;olympe.dc.query.Ba.or=olympe.dc.query.Ba.or;olympe.dc.query.Ba.and=olympe.dc.query.Ba.and;olympe.dc.query.Ba.smallerThan=olympe.dc.query.Ba.Oj;olympe.dc.query.Ba.greaterThan=olympe.dc.query.Ba.nl;
727
727
  olympe.dc.query.Ba.regex=olympe.dc.query.Ba.Xz;olympe.dc.query.Ba.contains=olympe.dc.query.Ba.contains;olympe.dc.query.Ba.equals=olympe.dc.query.Ba.Fa;olympe.dc.query.Ba['in']=olympe.dc.query.Ba.cz;olympe.dc.query.Ba.j={Wr:0,np:1,Zj:2,Yp:3,Aq:4,nr:5,Sq:6,fo:7};function ii(a){return Array.from(a.oa)}
728
- function vi(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Jb(c,c.La()===olympe.dc.va.ORIGIN?e:d);if(0>a.cursor)e=a.j.Te;else if(e=a.oa[a.cursor],null!==e.ta)e=e.ta;else{var f=olympe.dc.va.ORIGIN;e=olympe.dc.ha().Jb(e.relation,e.relation.La()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(a.db.Ia(olympe.dc.CloudObject)&&(null===d||!a.db.Uf(d,e)&&!a.db.Uf(e,d)))throw new olympe.dc.query.Dd(`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=
728
+ function vi(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Jb(c,c.La()===olympe.dc.va.ORIGIN?e:d);if(0>a.cursor)e=a.j.Te;else if(e=a.oa[a.cursor],null!==e.ta)e=e.ta;else{var f=olympe.dc.va.ORIGIN;e=olympe.dc.ha().Jb(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.Uf(d,e)&&!a.db.Uf(e,d)))throw new olympe.dc.query.Dd(`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=
729
729
  b.T();for(c=a.cursor+1;c<a.oa.length&&a.oa[c].T()!==d;)c++;b=c<a.oa.length?a.oa:a.oa.concat(b);return new olympe.dc.ma(a.D,a.source,b,c,a.F,a.j)}function wi(a,b=a.cursor){return 0<=b?a.oa[b].T():olympe.V.ub(a.D)}
730
- function xi(a,b,c,d={}){var e=olympe.dc.Mb.jg;const f=(null==d?0:d.md)?d.md:olympe.dc.ma.oc.vf,g=(null==d?0:d.$n)?'__code-as-data__':void 0;b=olympe.dc.fa(b);const h=olympe.dc.fe().Qe(b);b=(new olympe.dc.ma(b,h)).ne();b.oa=[f===olympe.dc.ma.oc.Rg?new olympe.dc.query.oa.xp(wi(b),e,c):new olympe.dc.query.oa.Pd(wi(b),e,c)];let k;b.H=null!=(k=null==d?void 0:d.at)?k:!1;return b.observe(a,{md:f,cl:g})}
730
+ function xi(a,b,c,d={}){var e=olympe.dc.Mb.kg;const f=(null==d?0:d.md)?d.md:olympe.dc.ma.oc.wf,g=(null==d?0:d.$n)?'__code-as-data__':void 0;b=olympe.dc.fa(b);const h=olympe.dc.fe().Qe(b);b=(new olympe.dc.ma(b,h)).ne();b.oa=[f===olympe.dc.ma.oc.Rg?new olympe.dc.query.oa.xp(wi(b),e,c):new olympe.dc.query.oa.Pd(wi(b),e,c)];let k;b.H=null!=(k=null==d?void 0:d.at)?k:!1;return b.observe(a,{md:f,cl:g})}
731
731
  function yi(a){const b=0===a.F.size?a.ne():a;if(null!==b.j.Md&&!b.F.has(wi(a,b.j.Md)))throw new olympe.dc.query.Dd('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)}
732
732
  olympe.dc.ma=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Md:null,Te:null}){this.db=olympe.dc.ha();if('string'!==typeof a||''===a)throw new olympe.dc.query.Dd('The root of the query cannot be empty.');this.D=a;this.source=b;this.oa=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.fa(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.Dd(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);
733
733
  b=null!=b?b:olympe.dc.fe().Qe(a);b=new olympe.dc.ma(a,b);b.j.Te=olympe.dc.ha().model(a);return b}static Qe(a,b,c){if(!olympe.dc.CloudObject.exists(b)&&!c)throw new olympe.dc.query.Dd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.fa(a);c=null!=c?c:olympe.dc.fe().fromModel(b);c=new olympe.dc.ma(a,c);c.j.Te=olympe.dc.fa(b);return c}static pl(a,b=!0,c){const d=olympe.dc.fa(a);var e=olympe.dc.ha();if(!e.wi(d))throw new olympe.dc.query.Dd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);
734
- a=null!=c?c:olympe.dc.fe().fromModel(d);a=new olympe.dc.ma(d,a);a.j.Te=e.model(d);b&&(a=vi(a,new olympe.dc.query.oa.Ce(wi(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.oa.Ih(wi(a),olympe.dc.CloudObject.instancesRel,!1);e.ta=d;return vi(b,e)}static Pb(a,b,c,d,e){var f;const g=null!=(f=null==e?void 0:e.md)?f:olympe.dc.ma.oc.vf;f=(null==e?0:e.$n)?'__code-as-data__':void 0;b=olympe.dc.fa(b);d=null!=d?d:olympe.dc.fe().Qe(b);d=(new olympe.dc.ma(b,d)).ne();b=g===olympe.dc.ma.oc.Rg;
735
- d.oa=[b?new olympe.dc.query.oa.xp(wi(d),c):new olympe.dc.query.oa.Pd(wi(d),c)];let h;d.H=null!=(h=null==e?void 0:e.at)?h:!1;let k;return d.observe(a,{md:g,cl:f,sj:null!=(k=null==e?void 0:e.sj)?k:b})}fb(a,b=!1){if(!(a instanceof olympe.dc.Sa.Relation))throw new olympe.dc.query.Dd(`The relation given to follow() is invalid: ${a}`);return vi(this,new olympe.dc.query.oa.Ih(wi(this),a,b))}ug(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Sa.Relation))throw new olympe.dc.query.Dd(`The relation given to followRecursively() is invalid: ${a}`);
736
- return vi(this,new olympe.dc.query.oa.Ce(wi(this),a,b,c))}ne(){const a=(new Set(this.F)).add(wi(this));return new olympe.dc.ma(this.D,this.source,this.oa,this.cursor,a,this.j)}filter(a){if(!(a instanceof olympe.dc.query.Ba))throw new olympe.dc.query.Dd(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.oa);b[this.cursor]=b[this.cursor].filter(a);return new olympe.dc.ma(this.D,this.source,b,this.cursor,this.F,this.j)}tj(){return this}Ij(a,b=0){return new olympe.dc.ma(this.D,
734
+ a=null!=c?c:olympe.dc.fe().fromModel(d);a=new olympe.dc.ma(d,a);a.j.Te=e.model(d);b&&(a=vi(a,new olympe.dc.query.oa.Ce(wi(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.oa.Ih(wi(a),olympe.dc.CloudObject.instancesRel,!1);e.ta=d;return vi(b,e)}static Pb(a,b,c,d,e){var f;const g=null!=(f=null==e?void 0:e.md)?f:olympe.dc.ma.oc.wf;f=(null==e?0:e.$n)?'__code-as-data__':void 0;b=olympe.dc.fa(b);d=null!=d?d:olympe.dc.fe().Qe(b);d=(new olympe.dc.ma(b,d)).ne();b=g===olympe.dc.ma.oc.Rg;
735
+ d.oa=[b?new olympe.dc.query.oa.xp(wi(d),c):new olympe.dc.query.oa.Pd(wi(d),c)];let h;d.H=null!=(h=null==e?void 0:e.at)?h:!1;let k;return d.observe(a,{md:g,cl:f,rj:null!=(k=null==e?void 0:e.rj)?k:b})}fb(a,b=!1){if(!(a instanceof olympe.dc.Sa.Relation))throw new olympe.dc.query.Dd(`The relation given to follow() is invalid: ${a}`);return vi(this,new olympe.dc.query.oa.Ih(wi(this),a,b))}vg(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Sa.Relation))throw new olympe.dc.query.Dd(`The relation given to followRecursively() is invalid: ${a}`);
736
+ return vi(this,new olympe.dc.query.oa.Ce(wi(this),a,b,c))}ne(){const a=(new Set(this.F)).add(wi(this));return new olympe.dc.ma(this.D,this.source,this.oa,this.cursor,a,this.j)}filter(a){if(!(a instanceof olympe.dc.query.Ba))throw new olympe.dc.query.Dd(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.oa);b[this.cursor]=b[this.cursor].filter(a);return new olympe.dc.ma(this.D,this.source,b,this.cursor,this.F,this.j)}sj(){return this}Hj(a,b=0){return new olympe.dc.ma(this.D,
737
737
  this.source,this.oa,this.cursor,this.F,{Md:this.j.Md,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.Dd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');if(!olympe.dc.ha().Ob(a,olympe.dm.Property))throw new olympe.dc.query.Dd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.oa[this.cursor],d={Md:this.cursor,max:this.j.max,offset:this.j.offset,Te:this.j.Te},
738
738
  e=Array.from(this.oa);e[this.cursor]=c.sort(a,b);return new olympe.dc.ma(this.D,this.source,e,this.cursor,this.F,d)}kh(){const a=this.j.Md;let b;return null!==a?null==(b=this.oa[a])?void 0:b.kh():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.oa[b].j;for(b--;-1<b&&wi(this,b)!==d;)b--}return new olympe.dc.ma(this.D,this.source,Array.from(this.oa),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),
739
739
  filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.wi(this.D)?c.dataType=olympe.dc.fa(this.D):(c.root=olympe.dc.fa(this.D),c.dataType=this.j.Te);this.oa.forEach((d,e)=>{const f=d.T(),g=d.Xc();Object.assign(g,{returned:this.F.has(f),next:[]});a.set(f,g);g.sort&&this.j.Md!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.oa.Ih&&d.relation.Fa(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.oa.Ce&&d.relation.Fa(olympe.dc.CloudObject.extendedByRel))Object.assign(c,
740
- g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}ob(a){const b=(null==a?0:a.md)?a.md:olympe.dc.ma.oc.Ck;let c;return olympe.dc.query.ml().executeQuery(yi(this),b,{ji: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()})}Hc(){return ji(Ai(olympe.dc.query.ml(),yi(this)))}observe(a,b){const c=(null==b?0:b.md)?b.md:olympe.dc.ma.oc.vf;a='function'===typeof a.Bb?a.Bb():
741
- a;let d;return Bi(olympe.dc.query.ml(),yi(this),a,olympe.dc.Ha.SELF,c,{ji:null!=(d=null==b?void 0:b.cl)?d:null==b?void 0:b.cacheId,Bc:null==b?void 0:b.Bc,sj:null==b?void 0:b.sj}).pipe(rxjs.operators.map(e=>ji(e)),rxjs.operators.distinctUntilChanged())}T(){null===this.id&&(this.id=olympe.V.ub(this.D+ii(this).map(a=>a.H()).join()+Array.from(new Set(this.F)).sort().toString()+this.j.Md+this.j.max+this.j.offset));return this.id}jb(){return this.source}ga(){let a;return{b:this.D,p:this.oa.map(b=>b.ga()),
742
- r:Array.from(this.F),s:this.source,e:{m:this.j.max,o:this.j.offset,s:this.j.Md,rm:null!=(a=this.j.Te)?a:this.db.model(this.D)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ia(this.D)?olympe.dc.CloudObject.get(this.D):this.D,relations:this.oa.map(a=>a.toJSON())}}};olympe.dc.ma.prototype.observe=olympe.dc.ma.prototype.observe;olympe.dc.ma.prototype.executeFromCache=olympe.dc.ma.prototype.Hc;olympe.dc.ma.prototype.execute=olympe.dc.ma.prototype.ob;
743
- olympe.dc.ma.prototype.parse=olympe.dc.ma.prototype.parse;olympe.dc.ma.prototype.back=olympe.dc.ma.prototype.back;olympe.dc.ma.prototype.sortBy=olympe.dc.ma.prototype.xl;olympe.dc.ma.prototype.limit=olympe.dc.ma.prototype.Ij;olympe.dc.ma.prototype.cast=olympe.dc.ma.prototype.tj;olympe.dc.ma.prototype.filter=olympe.dc.ma.prototype.filter;olympe.dc.ma.prototype.andReturn=olympe.dc.ma.prototype.ne;olympe.dc.ma.prototype.followRecursively=olympe.dc.ma.prototype.ug;olympe.dc.ma.prototype.follow=olympe.dc.ma.prototype.fb;
744
- olympe.dc.ma.followRule=olympe.dc.ma.Pb;olympe.dc.ma.instancesOf=olympe.dc.ma.pl;olympe.dc.ma.fromTag=olympe.dc.ma.Qe;olympe.dc.ma.from=olympe.dc.ma.from;olympe.dc.ma.oc={vf:1,Ck:2,Rg:3};olympe.dc.ma.j={Ml:'cacheBucketName',fq:'isCacheable'};function Ci(a){null===a.Ga&&null===a.j&&(a.Ga=Xf(a.F))}
745
- olympe.dc.query.Ed=class extends olympe.dc.Ig{constructor(a){super(a,null);this.F=new olympe.dc.transaction.He}static yj(a){const b=new olympe.dc.query.Ed(`DataResult_${a.T()}`);b.D=a.jb();return b}static j(a){const b=new olympe.dc.query.Ed(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}rc(a){Ci(this);return super.rc(a)}bc(){Ci(this);return super.bc()}jl(){Ci(this);return super.jl()}create(a,b,c){this.F.Rc(a,this.D,c,b);return this}Pa(a,
746
- b,c){this.F.Pa(a,b,c,null,null);return this}ga(){return super.ga()}};olympe.dc.query.Ed.prototype.createRelation=olympe.dc.query.Ed.prototype.Pa;olympe.dc.query.Ed.prototype.create=olympe.dc.query.Ed.prototype.create;olympe.dc.query.Ed.fromQuery=olympe.dc.query.Ed.yj;function Ai(a,b){const c=new olympe.dc.query.dr(a.G,b);if(a.D.view.Ia(b.D)){oi(c,b.D);for(const d of ii(b))d.ob(c)}return c}
747
- 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.Ha.SERVER?[]:Array.from(a.j.values());h=new olympe.dc.query.lr(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.ji)&&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=>
748
- {const n=()=>{p&&c.it(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.Ha.SELF&&(t.$--,0===t.$&&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.Yd(n),q=Fi(h,d,l);return n})}
749
- 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.ma.oc.Rg;if(b instanceof ReadableStream)yield Rg(a.D,b,{nn:e});else{var f;if(f=b instanceof olympe.dc.Ig)f=b.T(),f=!a.N.H.has(f);f&&a.D.nd(b,{nn:e})}})}function Ji(a){a.G.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.j.Kg,olympe.dc.Ha.SERVER);return a.Kb.request(b).then(c=>{a.D.nd(c)})}
750
- function Ki(a,b){const c=b.jb();if(c===olympe.dc.Ha.SELF||a.H&&c===olympe.dc.Ha.SERVER)return Promise.resolve(!0);a=Array.from(a.j.values()).filter(d=>d.Qc(b)).map(d=>new Promise(e=>d.kd(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=Sf(Sf(new olympe.dc.Request(olympe.dc.Request.j.Tg,e,b),olympe.dc.ma.j.fq,c===olympe.dc.ma.oc.Rg),olympe.dc.ma.j.Ml,null==d?void 0:d.ji);return a.Kb.request(e)})}
740
+ g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}ob(a){const b=(null==a?0:a.md)?a.md:olympe.dc.ma.oc.Ck;let c;return olympe.dc.query.ml().executeQuery(yi(this),b,{ji: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()})}Hc(){return ji(Ai(olympe.dc.query.ml(),yi(this)))}observe(a,b){const c=(null==b?0:b.md)?b.md:olympe.dc.ma.oc.wf;a='function'===typeof a.Bb?a.Bb():
741
+ a;let d;return Bi(olympe.dc.query.ml(),yi(this),a,olympe.dc.Ia.SELF,c,{ji: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.V.ub(this.D+ii(this).map(a=>a.H()).join()+Array.from(new Set(this.F)).sort().toString()+this.j.Md+this.j.max+this.j.offset));return this.id}jb(){return this.source}ga(){let a;return{b:this.D,p:this.oa.map(b=>b.ga()),
742
+ r:Array.from(this.F),s:this.source,e:{m:this.j.max,o:this.j.offset,s:this.j.Md,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.oa.map(a=>a.toJSON())}}};olympe.dc.ma.prototype.observe=olympe.dc.ma.prototype.observe;olympe.dc.ma.prototype.executeFromCache=olympe.dc.ma.prototype.Hc;olympe.dc.ma.prototype.execute=olympe.dc.ma.prototype.ob;
743
+ olympe.dc.ma.prototype.parse=olympe.dc.ma.prototype.parse;olympe.dc.ma.prototype.back=olympe.dc.ma.prototype.back;olympe.dc.ma.prototype.sortBy=olympe.dc.ma.prototype.xl;olympe.dc.ma.prototype.limit=olympe.dc.ma.prototype.Hj;olympe.dc.ma.prototype.cast=olympe.dc.ma.prototype.sj;olympe.dc.ma.prototype.filter=olympe.dc.ma.prototype.filter;olympe.dc.ma.prototype.andReturn=olympe.dc.ma.prototype.ne;olympe.dc.ma.prototype.followRecursively=olympe.dc.ma.prototype.vg;olympe.dc.ma.prototype.follow=olympe.dc.ma.prototype.fb;
744
+ olympe.dc.ma.followRule=olympe.dc.ma.Pb;olympe.dc.ma.instancesOf=olympe.dc.ma.pl;olympe.dc.ma.fromTag=olympe.dc.ma.Qe;olympe.dc.ma.from=olympe.dc.ma.from;olympe.dc.ma.oc={wf:1,Ck:2,Rg:3};olympe.dc.ma.j={Ml:'cacheBucketName',fq:'isCacheable'};function Ci(a){null===a.Ga&&null===a.j&&(a.Ga=Xf(a.F))}
745
+ olympe.dc.query.Ed=class extends olympe.dc.Ig{constructor(a){super(a,null);this.F=new olympe.dc.transaction.He}static xj(a){const b=new olympe.dc.query.Ed(`DataResult_${a.T()}`);b.D=a.jb();return b}static j(a){const b=new olympe.dc.query.Ed(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}rc(a){Ci(this);return super.rc(a)}bc(){Ci(this);return super.bc()}jl(){Ci(this);return super.jl()}create(a,b,c){this.F.Rc(a,this.D,c,b);return this}Pa(a,
746
+ b,c){this.F.Pa(a,b,c,null,null);return this}ga(){return super.ga()}};olympe.dc.query.Ed.prototype.createRelation=olympe.dc.query.Ed.prototype.Pa;olympe.dc.query.Ed.prototype.create=olympe.dc.query.Ed.prototype.create;olympe.dc.query.Ed.fromQuery=olympe.dc.query.Ed.xj;function Ai(a,b){const c=new olympe.dc.query.dr(a.G,b);if(a.D.view.Ja(b.D)){oi(c,b.D);for(const d of ii(b))d.ob(c)}return c}
747
+ 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.lr(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.ji)&&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=>
748
+ {const n=()=>{p&&c.it(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.$--,0===t.$&&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.Yd(n),q=Fi(h,d,l);return n})}
749
+ 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.ma.oc.Rg;if(b instanceof ReadableStream)yield Rg(a.D,b,{nn:e});else{var f;if(f=b instanceof olympe.dc.Ig)f=b.T(),f=!a.N.H.has(f);f&&a.D.nd(b,{nn:e})}})}function Ji(a){a.G.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.j.Kg,olympe.dc.Ia.SERVER);return a.Kb.request(b).then(c=>{a.D.nd(c)})}
750
+ 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.Qc(b)).map(d=>new Promise(e=>d.kd(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=Sf(Sf(new olympe.dc.Request(olympe.dc.Request.j.Tg,e,b),olympe.dc.ma.j.fq,c===olympe.dc.ma.oc.Rg),olympe.dc.ma.j.Ml,null==d?void 0:d.ji);return a.Kb.request(e)})}
751
751
  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.ma.oc.Ck,{}).then(f=>Ii(a,f,olympe.dc.ma.oc.Ck)));return Promise.all(d).then(()=>{})}
752
- olympe.dc.query.$v=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Kb=d;this.H=e;this.j=new Map;this.F=new Set;Sg(b,()=>Gi(this));Vf(d,olympe.dc.Request.j.ck,f=>{Ii(this,f.content,olympe.dc.ma.oc.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.ji))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}`),
753
- null}return Ai(d,a)})}R(a,b,c,d,e,f){const g=c.jb();if(g===olympe.dc.Ha.SELF||b.Bc||this.H&&g===olympe.dc.Ha.SERVER)return e(),null;if(a!==olympe.dc.ma.oc.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.sj)}).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.`),
754
- Promise.resolve();var v=t;t instanceof ReadableStream&&(v=(v=d())?t.pipeThrough(v):t);return Ii(this,v,a,b.sj).then(()=>{h.forEach(x=>Ii(this,x,a))}).finally(()=>{h=null})}).then(e).catch(f)},n=c.T();l(!1);const p=Sf(new olympe.dc.Request(olympe.dc.Request.j.Gk,g,c),olympe.dc.ma.j.Ml,null==b?void 0:b.ji),q=this.Kb.subscribe(p,l.bind(this,!0)).pipe(tb(olympe.error.Np,()=>{},0)).pipe(tb(olympe.error.Go,(r,t)=>{this.G.debug(`Data Provider: Subscribe to topic ${r.T()} now that we are back online, after waiting for ${t}ms`);
755
- 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.ha();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ia(g)?olympe.dc.CloudObject.get(g):(olympe.ia.Za('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)}
752
+ olympe.dc.query.$v=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Kb=d;this.H=e;this.j=new Map;this.F=new Set;Sg(b,()=>Gi(this));Vf(d,olympe.dc.Request.j.ck,f=>{Ii(this,f.content,olympe.dc.ma.oc.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 Ki(d,a);if(!e||(null==c?0:c.ji))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}`),
753
+ 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.ma.oc.wf)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.`),
754
+ 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=Sf(new olympe.dc.Request(olympe.dc.Request.j.Gk,g,c),olympe.dc.ma.j.Ml,null==b?void 0:b.ji),q=this.Kb.subscribe(p,l.bind(this,!0)).pipe(tb(olympe.error.Np,()=>{},0)).pipe(tb(olympe.error.Go,(r,t)=>{this.G.debug(`Data Provider: Subscribe to topic ${r.T()} now that we are back online, after waiting for ${t}ms`);
755
+ 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.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.ia.Ya('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)}
756
756
  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===
757
757
  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.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)=>
758
- 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()}zj(){return this.F.map(a=>
759
- this.D.get(this.j[a]))}Fj(){return this.H.map(a=>{a=a.split('.');return 1===a.length?a[0]:a})}static from(a,b,{Hb:c,Md:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ha(),q=c.Xi===olympe.dc.query.Bk.ASC?1:-1,r=c.kh(),t=c.Ra();b.sort((v,x)=>{x=x[d];v=p.Ra(v[d],t);x=p.Ra(x,t);return null===v?-q:null===x?q:q*r(olympe.dc.nb.Cc(v),olympe.dc.nb.Cc(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.V.ub(b.flat().join(''));
758
+ 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=>
759
+ 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,{Hb:c,Md: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.kh(),t=c.Ra();b.sort((v,x)=>{x=x[d];v=p.Ra(v[d],t);x=p.Ra(x,t);return null===v?-q:null===x?q:q*r(olympe.dc.nb.Cc(v),olympe.dc.nb.Cc(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.V.ub(b.flat().join(''));
760
760
  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.V.ub(e.j.join(''));e.F=b||e.j.map((f,g)=>g);e.H=c||[];return e}ga(a){a&&this.j.flatMap(b=>b.split('.')).forEach(a);
761
- return{k:this.j,a:this.F,r:this.H}}};olympe.dc.Ka.prototype.getRemoved=olympe.dc.Ka.prototype.Fj;olympe.dc.Ka.prototype.getAdded=olympe.dc.Ka.prototype.zj;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;
761
+ 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;
762
762
  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.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;
763
- 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.ia.Za('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Ic()||null}olympe.dc.sd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.sd(olympe.dc.ma.from(a))}fb(a){return new olympe.dc.sd(this.query.fb(a))}tj(){return this}ob(a){return this.query.ob(a).then(b=>Oi(b))}Hc(){return Oi(this.query.Hc())}};olympe.dc.sd.prototype.executeFromCache=olympe.dc.sd.prototype.Hc;
764
- olympe.dc.sd.prototype.execute=olympe.dc.sd.prototype.ob;olympe.dc.sd.prototype.cast=olympe.dc.sd.prototype.tj;olympe.dc.sd.prototype.follow=olympe.dc.sd.prototype.fb;const Pi=olympe.dc.va.ORIGIN,Qi=olympe.dc.va.DESTINATION;function Di(a,b){ki(a.j,()=>{a.gb()||null!==a.D||b(a.query.T())})}function Fi(a,b,c){const d=a.ea;a.ea++;a.H.set(d,c);b===olympe.dc.Ha.SELF?a.kd(e=>e?c.error(e):c.next(a.j)):(a.$++,1===a.$&&a.kd(()=>qi(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.H.size} subscribers`);return d}
763
+ 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.ia.Ya('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Ic()||null}olympe.dc.sd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.sd(olympe.dc.ma.from(a))}fb(a){return new olympe.dc.sd(this.query.fb(a))}sj(){return this}ob(a){return this.query.ob(a).then(b=>Oi(b))}Hc(){return Oi(this.query.Hc())}};olympe.dc.sd.prototype.executeFromCache=olympe.dc.sd.prototype.Hc;
764
+ olympe.dc.sd.prototype.execute=olympe.dc.sd.prototype.ob;olympe.dc.sd.prototype.cast=olympe.dc.sd.prototype.sj;olympe.dc.sd.prototype.follow=olympe.dc.sd.prototype.fb;const Pi=olympe.dc.va.ORIGIN,Qi=olympe.dc.va.DESTINATION;function Di(a,b){ki(a.j,()=>{a.gb()||null!==a.D||b(a.query.T())})}function Fi(a,b,c){const d=a.ea;a.ea++;a.H.set(d,c);b===olympe.dc.Ia.SELF?a.kd(e=>e?c.error(e):c.next(a.j)):(a.$++,1===a.$&&a.kd(()=>qi(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.H.size} subscribers`);return d}
765
765
  function Mi(a,b,c){if(a.query.jb()!==b)return!1;c.rc(a.ja);(b=a.ja.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)})}
766
766
  function Ri(a,b,c){const d=[];let e=!1;const f=new olympe.async.Dk(olympe.C.lh());for(const g of b)if(g.Qc(a.query)&&(e||(e=!0),f.add(h=>g.kd(k=>{!k&&d.push(g);h()}))),null!==g.D&&zi(a.query,g.query)){let h;null==(h=a.R)||h.push(g)}ud(f,g=>c(g?d:[]));f.start();return e}
767
767
  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.V.ub(k),n=Of(h,k,(q,r)=>{q?oi(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.Y)||p.push(()=>{Mf(h,k,n)});Ti(a)}
768
- function Ui(a){const b=a.Ja(a.query,a.bb.bind(a),()=>{null===a.D||a.gb()||Si(a)},d=>{a.gb()||(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.Y)||c.push(b))}function Vi(a,b){a.N.delete(b);0===a.N.size&&(a.N=null,Promise.resolve().then(()=>{!a.gb()&&Ui(a)}))}function Ti(a){const b=a.D;a.D=null;null==b||b.forEach(c=>c())}
769
- olympe.dc.query.lr=class{constructor(a,b,c,d,e){this.G=a;this.ta=b;this.db=b.view;this.query=c;this.md=d;this.j=new olympe.dc.query.dr(this.G,c);this.$=0;this.ea=1;this.Y=[];this.H=new Map;this.D=[()=>si(this.j)];this.Ja=e;this.ja=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)})}Qc(a){return!this.gb()&&this.query.jb()===a.jb()&&(this.query.T()===a.T()||
770
- (null===this.D||this.query.D===a.D)&&this.j.Qc(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.Y;this.Y=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())}gb(){return null===this.Y}bb(){const a=
768
+ function Ui(a){const b=a.Ha(a.query,a.Wa.bind(a),()=>{null===a.D||a.gb()||Si(a)},d=>{a.gb()||(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.Y)||c.push(b))}function Vi(a,b){a.N.delete(b);0===a.N.size&&(a.N=null,Promise.resolve().then(()=>{!a.gb()&&Ui(a)}))}function Ti(a){const b=a.D;a.D=null;null==b||b.forEach(c=>c())}
769
+ olympe.dc.query.lr=class{constructor(a,b,c,d,e){this.G=a;this.ta=b;this.db=b.view;this.query=c;this.md=d;this.j=new olympe.dc.query.dr(this.G,c);this.$=0;this.ea=1;this.Y=[];this.H=new Map;this.D=[()=>si(this.j)];this.Ha=e;this.ja=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)})}Qc(a){return!this.gb()&&this.query.jb()===a.jb()&&(this.query.T()===a.T()||
770
+ (null===this.D||this.query.D===a.D)&&this.j.Qc(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.Y;this.Y=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())}gb(){return null===this.Y}Wa(){const a=
771
771
  olympe.dc.ma.oc.Rg;if(this.md===a)return olympe.V.stream.tap(c=>{c=c.jl().filter(d=>d.o===olympe.dc.Nc.j).map(d=>d.t);this.ta.oe(c,'Batch mode')});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}};function Xi(a,b){return a.F.has(Qi+b)||a.F.has(Pi+b)}
772
772
  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.oa.Xh){a=f.relation;a=`${a.La()}${a.X()}`;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(){}Yc(a,b){if(!(this.j||
773
- !this.N&&this.db.Ia(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.Ia(a)&&!this.N||this.j||(this.j=this.R.some(b=>ni(this.H,a,b)))}Pa(a,b,c){if(!this.j&&Xi(this,a)){var d=this.db.Ia(b),e=this.db.Ia(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))))}}}ic(a,b,c){if(!this.j&&this.N&&Xi(this,a)&&this.db.bt(b,
773
+ !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)))}Pa(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))))}}}ic(a,b,c){if(!this.j&&this.N&&Xi(this,a)&&this.db.bt(b,
774
774
  new olympe.dc.Sa.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.lr.za=[olympe.dc.Writable];function Zi(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
775
775
  olympe.dc.query.Relation=class extends olympe.dc.Sa.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.La())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Qb(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.X(),a.La(),null!=b?b:a instanceof olympe.dc.ba.Ke)}$b(){const a=
776
776
  olympe.dc.va.DESTINATION,b=olympe.dc.va.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.W.config(function(a){D(a,olympe.dc.query.P.Da,[olympe.ia.P.Ea],b=>b.cd('query'));C(a,olympe.dc.query.P.Fk,olympe.dc.query.$v,olympe.dc.query.P.Da,olympe.dc.db.P.Ea,olympe.dc.transaction.P.Ea,olympe.dc.P.Vg,new olympe.W.pa(olympe.dc.U.Zh))});olympe.W.run([olympe.dc.query.P.Fk],a=>{olympe.dc.query.ml=()=>a});olympe.dc.query.Dd=class extends Error{};olympe.dc.query.Z={};olympe.dc.query.Z.Od=class extends olympe.dc.query.Ba{constructor(...a){super();this.Z=a}compile(){return this.Z.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}Ad(){return new olympe.dc.query.Z.Fe(...this.Z.map(a=>a.Ad()))}Cb(){return this.Z.flatMap(a=>a.Cb())}Qc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}ob(a){return this.Z.reduce((b,c)=>b&&c.ob(a),!0)}observe(a,b,c){const d=
777
- Array(this.Z.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.Z.forEach((g,h)=>{g.observe(a,olympe.V.ub('AND-'+b+a+h),f.bind(null,h))})}ga(){return{pr:olympe.dc.query.Ba.j.fo,p:this.Z.map(a=>a.ga())}}Xc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Z.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Z.forEach((c,d)=>{c.clear(a,olympe.V.ub('AND-'+b+a+d))})}};olympe.dc.query.Z.xf=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!1){super();this.Ma=olympe.dc.fa(a);this.substring=b;this.db=c;this.j=d}Cb(){return[this.Ma]}Qc(a,b){return a instanceof olympe.dc.query.Z.xf&&a.Ma===this.Ma?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}Ra(){return this.Ma}ob(a){return this.apply(this.db.Ra(a,
777
+ Array(this.Z.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.Z.forEach((g,h)=>{g.observe(a,olympe.V.ub('AND-'+b+a+h),f.bind(null,h))})}ga(){return{pr:olympe.dc.query.Ba.j.fo,p:this.Z.map(a=>a.ga())}}Xc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Z.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Z.forEach((c,d)=>{c.clear(a,olympe.V.ub('AND-'+b+a+d))})}};olympe.dc.query.Z.yf=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!1){super();this.Ma=olympe.dc.fa(a);this.substring=b;this.db=c;this.j=d}Cb(){return[this.Ma]}Qc(a,b){return a instanceof olympe.dc.query.Z.yf&&a.Ma===this.Ma?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}Ra(){return this.Ma}ob(a){return this.apply(this.db.Ra(a,
778
778
  this.Ma))}observe(a,b,c){gh(this.db,a,this.Ma,d=>{c(this.apply(d))},olympe.V.ub(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Cc(a);return'string'===typeof a?this.j?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.Ma+'-'+this.substring+'-'+this.j}clear(a,b){hh(this.db,a,this.Ma,olympe.V.ub(b+a+this.toString()))}Xc(){return{name:'CONTAINS',property:this.Ra(),value:this.substring,caseSensitive:this.j}}ga(){return{pr:olympe.dc.query.Ba.j.Zj,
779
779
  p:this.Ma,s:this.substring,c:this.j}}};olympe.dc.query.Z.Be=class extends olympe.dc.query.Ba{constructor(a,b,c){super();this.Ma=olympe.dc.fa(a);this.j=olympe.dc.nb.Cc(null!=b?b:null);this.db=c}Cb(){return[this.Ma]}Qc(a){if(a instanceof olympe.dc.query.Z.Be&&this.Ma===a.Ma)if('object'===typeof this.j&&null!==this.j){if(this.j instanceof olympe.dc.CloudObject)return this.j.Fa(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.Fa(a.j)}else return this.j===
780
780
  a.j;return!1}ob(a){return this.apply(this.db.Ra(a,this.Ma))}observe(a,b,c){gh(this.db,a,this.Ma,d=>{c(this.apply(d))},olympe.V.ub(b+a+this.toString()));null===this.j&&null===this.db.Ra(a,this.Ma)&&c(!0)}clear(a,b){hh(this.db,a,this.Ma,olympe.V.ub(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Cc(a);return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Fa(this.j):a instanceof Date?this.j instanceof Date&&this.j.getTime()===a.getTime():a instanceof olympe.C.Color?a.Fa(this.j):!1:a===
781
781
  this.j}toString(){let a,b;const c=null!=(b=null==(a=this.j)?void 0:a.toString())?b:'null';return'Equals-'+this.Ma+'-'+c}Xc(){return{name:'EQUALS',property:this.Ma,value:this.j}}ga(){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.X();break;case this.j instanceof olympe.C.Color:a=4,b=this.j.toJSON()}return{pr:olympe.dc.query.Ba.j.np,p:this.Ma,t:a,v:b}}};function $i(a,b,c){return olympe.V.ub(c+b+a.j+a.Ma)}
782
- olympe.dc.query.Z.Ui=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Ma=olympe.dc.fa(b);this.j=(this.F=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.fa(c):c;this.D=d;this.H=e}Ad(){return new olympe.dc.query.Z.Ui(this.db,this.Ma,this.j,!this.D,!this.H)}Cb(){return[this.Ma]}Qc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Z.Ui&&this.Ma===a.Ma?
782
+ olympe.dc.query.Z.Ti=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Ma=olympe.dc.fa(b);this.j=(this.F=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.fa(c):c;this.D=d;this.H=e}Ad(){return new olympe.dc.query.Z.Ti(this.db,this.Ma,this.j,!this.D,!this.H)}Cb(){return[this.Ma]}Qc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Z.Ti&&this.Ma===a.Ma?
783
783
  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}Ra(){return this.Ma}ob(a){return this.compare(this.db.Ra(a,this.Ma),this.F?this.db.Ra(a,this.j):this.j)}observe(a,b,c){this.F&&gh(this.db,a,this.j,d=>{const e=this.db.Ra(a,this.Ma);null!==e&&c(this.compare(e,d))},$i(this,a,b));gh(this.db,a,this.Ma,d=>{const e=this.F?this.db.Ra(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?
784
784
  this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){hh(this.db,a,this.Ma,$i(this,a,b));this.F&&hh(this.db,a,this.j,$i(this,a,b))}Xc(){return{name:'INEQUALITY_OPERATOR',property:this.Ra(),operator:this.D?'<':'>',strict:this.H,value:this.j}}ga(){return{pr:olympe.dc.query.Ba.j.Yp,p:this.Ma,b:this.j,l:this.D,s:this.H}}toString(){return(this.D?'LowerThan-':'GreaterThan-')+this.Ma+'-'+this.H+'-'+this.j}};olympe.dc.query.Z.je=class extends olympe.dc.query.Ba{constructor(a){super();this.j=a}compile(){const a=this.j.Ad();return this.Fa(a)?super.compile():a.compile()}Ad(){return this.j}Cb(){return this.j.Cb()}Qc(a,b){return a instanceof olympe.dc.query.Z.je?this.j.Qc(a.j,b):this.j.Qc(a,!b)}ob(a){return!this.j.ob(a)}observe(a,b,c){let d=null;this.j.observe(a,olympe.V.ub('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Xc(){return{name:'NOT',predicate:this.j.Xc()}}ga(){return{pr:olympe.dc.query.Ba.j.Aq,v:this.j.ga()}}toString(){return`NOT-${this.j.toString()}`}clear(a,
785
785
  b){this.j.clear(a,olympe.V.ub('NOT'+b+a))}Fa(a){return a instanceof olympe.dc.query.Z.je?this.j.Fa(a.j):!1}};olympe.dc.query.Z.Fe=class extends olympe.dc.query.Ba{constructor(...a){super();this.Z=a}compile(){return this.Z.map(a=>a.compile()).flat()}Ad(){return new olympe.dc.query.Z.Od(...this.Z.map(a=>a.Ad()))}Cb(){return this.Z.flatMap(a=>a.Cb())}Qc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}ob(a){return this.Z.reduce((b,c)=>b||c.ob(a),!1)}observe(a,b,c){const d=Array(this.Z.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
786
- k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.ub('OR-'+b+a+h),f.bind(null,h))})}Xc(){throw Error('toObject for OR predicate should not be called');}ga(){return{pr:olympe.dc.query.Ba.j.Sq,p:this.Z.map(a=>a.ga())}}toString(){return'And-'+this.Z.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.Z.forEach((c,d)=>{c.clear(a,olympe.V.ub('OR-'+b+a+d))})}};olympe.dc.query.Z.Gf=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!0){super();this.Ma=olympe.dc.fa(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}Cb(){return[this.Ma]}Qc(a){return a instanceof olympe.dc.query.Z.Gf&&this.Ma===a.Ma&&this.j.toString()===a.j.toString()}ob(a){return this.apply(this.db.Ra(a,this.Ma))}observe(a,b,c){gh(this.db,a,this.Ma,d=>{c(this.apply(d))},olympe.V.ub(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Cc(a);
786
+ k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.ub('OR-'+b+a+h),f.bind(null,h))})}Xc(){throw Error('toObject for OR predicate should not be called');}ga(){return{pr:olympe.dc.query.Ba.j.Sq,p:this.Z.map(a=>a.ga())}}toString(){return'And-'+this.Z.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.Z.forEach((c,d)=>{c.clear(a,olympe.V.ub('OR-'+b+a+d))})}};olympe.dc.query.Z.Hf=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!0){super();this.Ma=olympe.dc.fa(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}Cb(){return[this.Ma]}Qc(a){return a instanceof olympe.dc.query.Z.Hf&&this.Ma===a.Ma&&this.j.toString()===a.j.toString()}ob(a){return this.apply(this.db.Ra(a,this.Ma))}observe(a,b,c){gh(this.db,a,this.Ma,d=>{c(this.apply(d))},olympe.V.ub(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Cc(a);
787
787
  return'string'===typeof a?(a=this.j.test(this.D?a:a.toLowerCase()),this.j.lastIndex=0,a):!1}toString(){return'Regex'+this.Ma+'-'+this.j.toString()+'-'+this.D}Xc(){return{name:'REGEX',property:this.Ma,pattern:this.j,caseSensitive:this.D}}ga(){return{pr:olympe.dc.query.Ba.j.nr,p:this.Ma,r:this.j.source,c:this.D}}clear(a,b){hh(this.db,a,this.Ma,olympe.V.ub(b+a+this.toString()))}};olympe.dc.query.Z.an=class extends olympe.dc.query.Ba{constructor(a){super();this.j=new Set(a.map(olympe.dc.fa))}Cb(){return[]}Qc(a){return a instanceof olympe.dc.query.Z.an&&Array.from(a.j).every(b=>this.j.has(b))}ob(a){return this.j.has(a)}observe(a,b,c){c(this.j.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.j)}Xc(){return{name:'IS',tags:Array.from(this.j)}}ga(){return{pr:olympe.dc.query.Ba.j.Wr,t:Array.from(this.j)}}};olympe.dc.query.oa={};function Yi(a){let b,c;const d=new Set(null!=(c=null==(b=a.D)?void 0:b.Cb())?c:[]);let e;a.Hb&&d.add(null==(e=a.Hb)?void 0:e.Ra().X());return d}function aj(a){if(!a.ea){let b,c;a.ea=null!=(c=null==(b=a.D)?void 0:b.compile())?c:[]}return a.ea}function bj(a,b){for(const c of b)if(a.some(d=>d.Qc(c,!1)))return!0;return!1}
788
788
  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.V.ub(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.Hb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Hb.Ra();h=olympe.V.ub(h+d);e?gh(a.db,f,k,()=>{li(b)},h):hh(a.db,f,k,h);c(e,f,g,h)}}
789
- olympe.dc.query.oa.Om=class{constructor(a,b){this.db=olympe.dc.ha();this.j=a;this.optional=b;this.ea=this.Hb=this.D=this.id=null}static j(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.oa.Pd(b,a.f);var c=a.o;const d=new olympe.dc.Sa.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.oa.Ce(b,d,a.s,c):new olympe.dc.query.oa.Ih(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.Sa.Property(a.p),a.o),b.Hb=a);return b}N(){}H(){let a,
789
+ olympe.dc.query.oa.Om=class{constructor(a,b){this.db=olympe.dc.ha();this.j=a;this.optional=b;this.ea=this.Hb=this.D=this.id=null}static j(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.oa.Pd(b,a.f);var c=a.o;const d=new olympe.dc.Sa.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.oa.Ce(b,d,a.s,c):new olympe.dc.query.oa.Ih(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.xf(c,new olympe.dc.Sa.Property(a.p),a.o),b.Hb=a);return b}N(){}H(){let a,
790
790
  b,c,d;return`${this.j}-${this.optional}${null!=(c=null==(a=this.D)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Hb)?void 0:b.toString())?d:''}`}Xc(){}toJSON(){}ga(){const a={i:this.j,o:this.optional};null!==this.D&&(a.p=this.D.ga());null!==this.Hb&&(a.c=this.Hb.ga());return a}Y(){}ja(){return new olympe.dc.query.oa.Ym}$(){}T(){this.id||(this.id=this.Y());return this.id}R(){return this.optional}Qc(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=>
791
- 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.Z.Od?new olympe.dc.query.Z.Od(...Array.from(c.Z),a):new olympe.dc.query.Z.Od(b.D,a);return b}sort(a,b){const c=this.N();c.Hb=new olympe.dc.query.wf(this.T(),a,b);return c}kh(){return this.Hb}ob(a){if(null!==this.D){var b=this.T();for(const c of mi(a,b))this.D.ob(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,
792
- f,g)}))}Fa(){}};olympe.dc.query.oa.Xh=class extends olympe.dc.query.oa.Om{constructor(a,b,c){super(a,c);this.relation=b;this.ta=null}};olympe.dc.query.oa.Pm=class{has(){}H(){}j(){}Uc(){}D(){}remove(){}};olympe.dc.query.oa.Pd=class extends olympe.dc.query.oa.Om{constructor(a,b,c){super(a,!1);this.Pb=b;this.F=null!=c?c:null}N(){return new olympe.dc.query.oa.Pd(this.j,this.Pb,this.F)}Y(){return olympe.V.ub(this.j+'followRules')}ja(){return new olympe.dc.query.oa.gq(this.db,this.F)}$(a,b){return b instanceof olympe.dc.query.oa.Pd?[a]:[olympe.V.ub(a+'followRules')]}Qc(a){if(a instanceof olympe.dc.query.oa.Xh){const b=olympe.dc.va.ORIGIN,c=olympe.dc.va.DESTINATION,d=olympe.dc.hc.$c,e=olympe.dc.hc.Mi,f=
791
+ 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.Z.Od?new olympe.dc.query.Z.Od(...Array.from(c.Z),a):new olympe.dc.query.Z.Od(b.D,a);return b}sort(a,b){const c=this.N();c.Hb=new olympe.dc.query.xf(this.T(),a,b);return c}kh(){return this.Hb}ob(a){if(null!==this.D){var b=this.T();for(const c of mi(a,b))this.D.ob(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,
792
+ f,g)}))}Fa(){}};olympe.dc.query.oa.Xh=class extends olympe.dc.query.oa.Om{constructor(a,b,c){super(a,c);this.relation=b;this.ta=null}};olympe.dc.query.oa.Pm=class{has(){}H(){}j(){}Uc(){}D(){}remove(){}};olympe.dc.query.oa.Pd=class extends olympe.dc.query.oa.Om{constructor(a,b,c){super(a,!1);this.Pb=b;this.F=null!=c?c:null}N(){return new olympe.dc.query.oa.Pd(this.j,this.Pb,this.F)}Y(){return olympe.V.ub(this.j+'followRules')}ja(){return new olympe.dc.query.oa.gq(this.db,this.F)}$(a,b){return b instanceof olympe.dc.query.oa.Pd?[a]:[olympe.V.ub(a+'followRules')]}Qc(a){if(a instanceof olympe.dc.query.oa.Xh){const b=olympe.dc.va.ORIGIN,c=olympe.dc.va.DESTINATION,d=olympe.dc.hc.$c,e=olympe.dc.hc.Li,f=
793
793
  olympe.dm.Relation.j.vr,g=olympe.dm.Relation.j.bs;a=a.relation;const h=a.La(),k=a.X();return h!==c||k!==d&&k!==e?!!(ph(this.db,a,this.Pb)&(a.La()===b?f:g)):!0}return a instanceof olympe.dc.query.oa.Pd?this.Pb===a.Pb:!1}ob(a){const b=this.T();for(const c of mi(a,this.j))for(const d of lg(this.db,c,this.Pb))oi(a,d,b,c)}observe(a,b){const c=this.T(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?qh(this.db,g,this.Pb,(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):
794
794
  rh(this.db,g,this.Pb,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.V.ub(h+f+this.toString()))}}ga(){return Object.assign(super.ga(),{f:this.Pb})}H(){return`followRulePart-${this.Pb}-${super.H()}`}Xc(){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.Pb)} (${this.Pb})`}Fa(a){return a instanceof olympe.dc.query.oa.Pd&&this.Pb===a.Pb}toJSON(){return{type:'follow rule',
795
- rule:`${this.db.name(this.Pb)} (${this.Pb})`}}R(){return!1}filter(){olympe.ia.Za('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ia.Za('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.oa.Pd.D='followRules';olympe.dc.query.oa.Ih=class extends olympe.dc.query.oa.Xh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.oa.Ih(this.j,this.relation,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.ub(this.j+this.relation.T())}$(a,b){if(b instanceof olympe.dc.query.oa.Pd)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.V.ub(d));b instanceof olympe.dc.query.oa.Ce&&b.relation.Fa(this.relation)&&
795
+ rule:`${this.db.name(this.Pb)} (${this.Pb})`}}R(){return!1}filter(){olympe.ia.Ya('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ia.Ya('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.oa.Pd.D='followRules';olympe.dc.query.oa.Ih=class extends olympe.dc.query.oa.Xh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.oa.Ih(this.j,this.relation,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.ub(this.j+this.relation.T())}$(a,b){if(b instanceof olympe.dc.query.oa.Pd)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.V.ub(d));b instanceof olympe.dc.query.oa.Ce&&b.relation.Fa(this.relation)&&
796
796
  c.push(a);return c}ob(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.ob(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.La(),f=this.toString();return(g,h,k,l)=>{const n=olympe.V.ub(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)}}ga(){return Object.assign(super.ga(),{t:this.relation.X(),d:this.relation.La()})}H(){return`followPart-${this.relation.T()}-${super.H()}`}Xc(){const a=
797
- {recursive:!1,relation:this.relation,filter:aj(this).map(b=>b.map(c=>c.Xc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Ra(),order:this.Hb.Xi});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.La()}}Fa(a){return a instanceof olympe.dc.query.oa.Ih&&this.relation.Fa(a.relation)}};olympe.dc.query.oa.Ce=class extends olympe.dc.query.oa.Xh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.F=c}ja(){return new olympe.dc.query.oa.zr}N(){const a=new olympe.dc.query.oa.Ce(this.j,this.relation,this.F,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.ub(this.j+this.relation.T()+this.F)}$(a,b){if(b instanceof olympe.dc.query.oa.Pd)return[a];const c=[a+this.relation.T()+this.F,a+'followRules'].map(d=>olympe.V.ub(d));b instanceof olympe.dc.query.oa.Ce&&
797
+ {recursive:!1,relation:this.relation,filter:aj(this).map(b=>b.map(c=>c.Xc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Ra(),order:this.Hb.Wi});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.La()}}Fa(a){return a instanceof olympe.dc.query.oa.Ih&&this.relation.Fa(a.relation)}};olympe.dc.query.oa.Ce=class extends olympe.dc.query.oa.Xh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.F=c}ja(){return new olympe.dc.query.oa.zr}N(){const a=new olympe.dc.query.oa.Ce(this.j,this.relation,this.F,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.ub(this.j+this.relation.T()+this.F)}$(a,b){if(b instanceof olympe.dc.query.oa.Pd)return[a];const c=[a+this.relation.T()+this.F,a+'followRules'].map(d=>olympe.V.ub(d));b instanceof olympe.dc.query.oa.Ce&&
798
798
  b.relation.Fa(this.relation)&&c.push(a);return c}ob(a){const b=this.T();for(const c of mi(a,this.j))this.F&&oi(a,c,b,c),this.db.oh(c,this.relation).forEach(d=>{oi(a,d,b,c)});super.ob(a)}observe(a,b){const c=this.relation.X(),d=this.relation.La(),e=(f,g,h,k)=>{const l=olympe.V.ub(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,
799
- g,olympe.V.ub(h+g));e(f,g,g,h)}}ga(){return Object.assign(super.ga(),{s:this.F,t:this.relation.X(),d:this.relation.La()})}H(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.H()}`}Xc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:aj(this).map(b=>b.map(c=>c.Xc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Ra(),order:this.Hb.Xi});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',
799
+ g,olympe.V.ub(h+g));e(f,g,g,h)}}ga(){return Object.assign(super.ga(),{s:this.F,t:this.relation.X(),d:this.relation.La()})}H(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.H()}`}Xc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:aj(this).map(b=>b.map(c=>c.Xc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Ra(),order:this.Hb.Wi});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',
800
800
  relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.La()}}Fa(a){return a instanceof olympe.dc.query.oa.Ce&&this.relation.Fa(a.relation)&&this.F===a.F}};olympe.dc.query.oa.xp=class extends olympe.dc.query.oa.Pd{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.oa.gq=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,
801
- b){a===this.origin&&(this.origin=null);if(null===this.origin||!this.db.Ia(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.oa.gq.za=[olympe.dc.query.oa.Pm];olympe.dc.query.oa.zr=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!=
801
+ 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.oa.gq.za=[olympe.dc.query.oa.Pm];olympe.dc.query.oa.zr=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!=
802
802
  (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.oa.zr.za=[olympe.dc.query.oa.Pm];olympe.dc.query.oa.Ym=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);
803
- return b}};olympe.dc.query.oa.Ym.za=[olympe.dc.query.oa.Pm];olympe.dc.sources={};olympe.dc.sources.fk=class{T(){}init(){}destroy(){}request(){return u(function*(){})}subscribe(){}};const ej=olympe.net.wa.Sd.GET,fj=olympe.net.wa.Sd.Th,gj=olympe.net.wa.Sd.Dc,hj=olympe.net.wa.Sd.cr,ij=olympe.net.wa.Headers.Ji,jj=olympe.net.wa.Headers.so,kj=olympe.net.wa.Ub.Rh,lj=olympe.net.wa.Ub.No,mj=olympe.net.wa.Ub.kk,nj=olympe.net.wa.Ub.hj,oj=olympe.net.wa.Ub.$i;
804
- function pj(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.U.jm)}/:${'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.ha().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.qd(`No handler found for datasource ${f} called '${g}'`,oj,'Invalid source id'))}h=c.method;const k=c.Dj();try{var l=yield qj(a,
805
- k[jj])}catch(r){return new olympe.net.qd(`Invalid token ${r}`,mj,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.j.pc,t=olympe.dc.Request.j.Tg,v=olympe.dc.Request.j.ef,x=olympe.dc.Request.j.eh,y=olympe.dc.Request.j.zh,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 Uint8Array&&
806
- (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.Ha.$e;var q=Rf(new olympe.dc.Request(n,f,Y,l),db);const Qa=yield g(q);let ed;void 0===Qa?ed='':Qa instanceof Blob||Qa instanceof Uint8Array||Qa instanceof ArrayBuffer||'function'===typeof(null==Qa?void 0:Qa.pipe)?ed=Qa:ed=JSON.stringify(a.D.ga(Qa));return new olympe.net.qd(ed,h===hj?lj:kj)}catch(r){return r instanceof olympe.error.uk?new olympe.net.qd(`Authorization error: ${r}`,
803
+ return b}};olympe.dc.query.oa.Ym.za=[olympe.dc.query.oa.Pm];olympe.dc.sources={};olympe.dc.sources.fk=class{T(){}init(){}destroy(){}request(){return u(function*(){})}subscribe(){}};const ej=olympe.net.wa.Sd.GET,fj=olympe.net.wa.Sd.Th,gj=olympe.net.wa.Sd.Dc,hj=olympe.net.wa.Sd.cr,ij=olympe.net.wa.Headers.Ii,jj=olympe.net.wa.Headers.so,kj=olympe.net.wa.Ub.Rh,lj=olympe.net.wa.Ub.No,mj=olympe.net.wa.Ub.kk,nj=olympe.net.wa.Ub.gj,oj=olympe.net.wa.Ub.Zi;
804
+ function pj(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.U.jm)}/:${'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.ha().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.qd(`No handler found for datasource ${f} called '${g}'`,oj,'Invalid source id'))}h=c.method;const k=c.Cj();try{var l=yield qj(a,
805
+ k[jj])}catch(r){return new olympe.net.qd(`Invalid token ${r}`,mj,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.j.pc,t=olympe.dc.Request.j.Tg,v=olympe.dc.Request.j.ef,x=olympe.dc.Request.j.eh,y=olympe.dc.Request.j.zh,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[ij]};p instanceof Uint8Array&&
806
+ (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.$e;var q=Rf(new olympe.dc.Request(n,f,Y,l),db);const Qa=yield g(q);let ed;void 0===Qa?ed='':Qa instanceof Blob||Qa instanceof Uint8Array||Qa instanceof ArrayBuffer||'function'===typeof(null==Qa?void 0:Qa.pipe)?ed=Qa:ed=JSON.stringify(a.D.ga(Qa));return new olympe.net.qd(ed,h===hj?lj:kj)}catch(r){return r instanceof olympe.error.uk?new olympe.net.qd(`Authorization error: ${r}`,
807
807
  mj,'Forbidden'):new olympe.net.qd(`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)}}
808
808
  function tj(a,b,c){c=b instanceof olympe.dm.DataSource?b.Pf(c):uj(b,c);null===c&&a.G.error(`Impossible to build URL for data source ${b}`);return c}
809
- function vj(a,b,c){if(b===olympe.dc.Ha.SERVER){var d;return null!=(d=re(a.H,a.ea.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.$.jb(b);e=olympe.dc.sources.U.Jh;const f=olympe.dc.sources.U.Af,g=olympe.dc.sources.U.Ri,h=olympe.dc.sources.U.jm;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}`}
810
- function wj(a,b){return b instanceof olympe.net.Ti?te(a.H,b,de(a.Y).Hd()):Promise.reject('No http request to send')}function xj(a,b){var c=vj(a,b.jc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.jc()}`);const d=b.content,e=JSON.stringify(a.D.ga(d));c=N(c,fj,e,olympe.net.wa.ResponseType.JSON);Gc(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.Ed.yj(d))}
809
+ function vj(a,b,c){if(b===olympe.dc.Ia.SERVER){var d;return null!=(d=re(a.H,a.ea.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.$.jb(b);e=olympe.dc.sources.U.Jh;const f=olympe.dc.sources.U.Bf,g=olympe.dc.sources.U.Qi,h=olympe.dc.sources.U.jm;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}`}
810
+ function wj(a,b){return b instanceof olympe.net.Si?te(a.H,b,de(a.Y).Hd()):Promise.reject('No http request to send')}function xj(a,b){var c=vj(a,b.jc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.jc()}`);const d=b.content,e=JSON.stringify(a.D.ga(d));c=N(c,fj,e,olympe.net.wa.ResponseType.JSON);Gc(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.Ed.xj(d))}
811
811
  function yj(a,b){var c=vj(a,b.jc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.jc()}`);const d=JSON.stringify(a.D.ga(b.content));c=N(c,fj,d);Gc(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.Y.rh(b,(e,f)=>{e?d(e):c(f)})})}
812
- olympe.dc.sources.vu=class{constructor(a,b,c,d,e,f){this.G=a;this.R=b;this.H=c;this.Y=d;this.$=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.ea=new Map([[olympe.dc.Request.j.Kg,olympe.L.Xb.Kg],[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.vo,olympe.L.Xb.uo],[olympe.dc.Request.j.tr,olympe.L.Xb.sr],[olympe.dc.Request.j.Kp,olympe.L.Xb.Jp],
812
+ olympe.dc.sources.vu=class{constructor(a,b,c,d,e,f){this.G=a;this.R=b;this.H=c;this.Y=d;this.$=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.ea=new Map([[olympe.dc.Request.j.Kg,olympe.L.Xb.Kg],[olympe.dc.Request.j.eg,olympe.L.Xb.ik],[olympe.dc.Request.j.og,olympe.L.Xb.ik],[olympe.dc.Request.j.cg,olympe.L.Xb.ik],[olympe.dc.Request.j.vo,olympe.L.Xb.uo],[olympe.dc.Request.j.tr,olympe.L.Xb.sr],[olympe.dc.Request.j.Kp,olympe.L.Xb.Jp],
813
813
  [olympe.dc.Request.j.Tg,olympe.L.Xb.Ho],[olympe.dc.Request.j.eh,olympe.L.Xb.TRANSACTION]])}Jc(a){var b=vj(this,a.jc(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.jc()}`);b=Ic(N(b,ej),olympe.net.wa.ResponseType.JSON);Gc(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.jc(),f=vj(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);
814
- const g=N(e===olympe.dc.Ha.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,hj,d);Gc(g,{[ij]:'application/octet-stream'});e!==olympe.dc.Ha.SERVER&&Gc(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.jc();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.Ha.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,gj,b);d!==olympe.dc.Ha.SERVER&&Gc(e,
815
- {['X-Source-Origin']:a.origin});return wj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.jc();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,mi:k})});if(this.j.has(b))return f;this.j.set(b,g);e=N(d===olympe.dc.Ha.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,ej,void 0,olympe.net.wa.ResponseType.ai);d!==olympe.dc.Ha.SERVER&&
816
- Gc(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.mi(`${h}`))}).finally(()=>{this.j.delete(b)});return f}};olympe.dc.sources.eq=class{constructor(a,b){this.G=a;this.Kb=b}};olympe.dc.sources.eq.Ub={jj:0,SC:1,TC:3,mC:4};const zj=olympe.dc.Request.j.pc,Aj=olympe.dc.Request.j.Tg,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.Gi,Gj=olympe.dc.Request.j.zh,Hj=olympe.dc.Request.j.ef,Ij=olympe.dc.Request.j.eh,Jj=olympe.dc.Request.j.ck;
817
- function Kj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.V.$h(6E4),ib(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}`)})}),jb(a.D,()=>{a.D=null}));let d;const e=null!=(d=a.D.get(c))?d:new olympe.dc.db.fc(c);b.rc(e);gb(a.D.j,c)||a.D.set(c,e)}function Lj(a,b){return u(function*(){const c=Rf(new olympe.dc.Request(olympe.dc.Request.j.ck,a.T(),b),olympe.dc.Ha.SELF);let d;yield null==(d=a.Kb)?void 0:d.zi(c)})}
814
+ const g=N(e===olympe.dc.Ia.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,hj,d);Gc(g,{[ij]:'application/octet-stream'});e!==olympe.dc.Ia.SERVER&&Gc(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.jc();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&&Gc(e,
815
+ {['X-Source-Origin']:a.origin});return wj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.jc();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,mi: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.wa.ResponseType.ai);d!==olympe.dc.Ia.SERVER&&
816
+ Gc(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.mi(`${h}`))}).finally(()=>{this.j.delete(b)});return f}};olympe.dc.sources.eq=class{constructor(a,b){this.G=a;this.Kb=b}};olympe.dc.sources.eq.Ub={ij:0,SC:1,TC:3,mC:4};const zj=olympe.dc.Request.j.pc,Aj=olympe.dc.Request.j.Tg,Bj=olympe.dc.Request.j.Gk,Cj=olympe.dc.Request.j.og,Dj=olympe.dc.Request.j.eg,Ej=olympe.dc.Request.j.cg,Fj=olympe.dc.Request.j.Fi,Gj=olympe.dc.Request.j.zh,Hj=olympe.dc.Request.j.ef,Ij=olympe.dc.Request.j.eh,Jj=olympe.dc.Request.j.ck;
817
+ function Kj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.V.$h(6E4),ib(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}`)})}),jb(a.D,()=>{a.D=null}));let d;const e=null!=(d=a.D.get(c))?d:new olympe.dc.db.fc(c);b.rc(e);gb(a.D.j,c)||a.D.set(c,e)}function Lj(a,b){return u(function*(){const c=Rf(new olympe.dc.Request(olympe.dc.Request.j.ck,a.T(),b),olympe.dc.Ia.SELF);let d;yield null==(d=a.Kb)?void 0:d.yi(c)})}
818
818
  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.fc(c);let g;null==(g=a.D)||g.delete(c);b.rc(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}
819
- olympe.dc.sources.sq=class{constructor(a,b){this.G=a;this.j=b;this.Kb=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.Pf(olympe.dc.sources.U.Mm))?c:-1;this.D=null}T(){return this.j.T()}init(a){this.Kb=a;if(this.T()===olympe.dc.Ha.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:`);
819
+ olympe.dc.sources.sq=class{constructor(a,b){this.G=a;this.j=b;this.Kb=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.Pf(olympe.dc.sources.U.Mm))?c:-1;this.D=null}T(){return this.j.T()}init(a){this.Kb=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:`);
820
820
  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.pc.zb,e=olympe.dm.DataSource.pc.Wh;
821
- 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.bc();Kj(this,f);Lj(this,Nf(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.bc();return this.applyTransaction(g,c===Ij).finally(()=>{if(a.origin===olympe.dc.Ha.SELF){var h=g.T();h=Rf(new olympe.dc.Request(olympe.dc.Request.j.jk,olympe.dc.Ha.SELF,{id:h,finalize:olympe.dc.transaction.If.j.aj,
822
- error:null}),this.T());let k;null==(k=this.Kb)||k.dd(h)}});case Gj:return Mj(this,b.bc());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=Rf(new olympe.dc.Request(Jj,olympe.dc.Ha.SELF,b,a.yc()),this.T()),this.Kb.dd(c);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===
823
- Bj){const b=a.content;a=a.origin;return a===olympe.dc.Ha.SELF?Nj(this,b):Bi(this.H,b,this.F,a,olympe.dc.ma.oc.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=>Nf(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=
824
- Nf(a,d);yield Lj(c,e);return d})}};olympe.dc.sources.sq.za=[olympe.dc.sources.fk];function Pj(a){const b=olympe.dc.sources.kg.j.Ut,c=olympe.dc.sources.kg.j.Pw,d=olympe.dc.sources.kg.j.$t,e=olympe.dc.sources.kg.j.Vt,f=olympe.dc.sources.kg.j.au,g=[],h=[],k=[],l=[],n=[];a.Ab.forEach((p,q)=>{const r=p.Vb();p.D()?g.push(Qj(b,q,r,p.N()?p.Cb():null)):p.zd()?k.push(Qj(d,q,r,null,p.F())):p.N()&&h.push(Qj(c,q,r,p.Cb()));for(const [t,v,x]of p.Jd())p=a.Tc(v),x?l.push(new Rj(e,t,q,v,r,p.Vb())):n.push(new Rj(f,t,q,v,r,p.Vb()))});return n.concat(k,g,h,l)}
825
- 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.Mb.NONE}}
826
- 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={Ut:'CREATE',Pw:'UPDATE',$t:'DELETE',Vt:'CREATE_RELATION',au:'DELETE_RELATION'};function Tj(a,b){b=Rf(new olympe.dc.Request(olympe.dc.Request.j.jk,olympe.dc.Ha.SELF,{id:b,finalize:olympe.dc.transaction.If.j.aj,error:null}),a.T());let c;null==(c=a.Kb)||c.dd(b)}
827
- olympe.dc.sources.Rl=class{constructor(a,b){this.G=a;this.D=b;this.Kb=null}T(){}Y(){}$(){}init(a){this.Kb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return u(function*(){if(!b.D.j)return b.Y(a);var c=olympe.dc.Request.j.pc,d=olympe.dc.Request.j.Tg;const e=olympe.dc.Request.j.ef,f=olympe.dc.Request.j.eh;var g=olympe.dc.Request.j.Gi;const h=olympe.dc.Request.j.zh,k=olympe.dc.Request.j.ng;var l=olympe.dc.Request.j.dg;const n=olympe.dc.Request.j.bg,p=olympe.dc.sources.de(),
821
+ 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.bc();Kj(this,f);Lj(this,Nf(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.bc();return this.applyTransaction(g,c===Ij).finally(()=>{if(a.origin===olympe.dc.Ia.SELF){var h=g.T();h=Rf(new olympe.dc.Request(olympe.dc.Request.j.jk,olympe.dc.Ia.SELF,{id:h,finalize:olympe.dc.transaction.Jf.j.$i,
822
+ error:null}),this.T());let k;null==(k=this.Kb)||k.dd(h)}});case Gj:return Mj(this,b.bc());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=Rf(new olympe.dc.Request(Jj,olympe.dc.Ia.SELF,b,a.yc()),this.T()),this.Kb.dd(c);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===
823
+ 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.ma.oc.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=>Nf(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=
824
+ Nf(a,d);yield Lj(c,e);return d})}};olympe.dc.sources.sq.za=[olympe.dc.sources.fk];function Pj(a){const b=olympe.dc.sources.lg.j.Ut,c=olympe.dc.sources.lg.j.Pw,d=olympe.dc.sources.lg.j.$t,e=olympe.dc.sources.lg.j.Vt,f=olympe.dc.sources.lg.j.au,g=[],h=[],k=[],l=[],n=[];a.Ab.forEach((p,q)=>{const r=p.Vb();p.D()?g.push(Qj(b,q,r,p.N()?p.Cb():null)):p.zd()?k.push(Qj(d,q,r,null,p.F())):p.N()&&h.push(Qj(c,q,r,p.Cb()));for(const [t,v,x]of p.Jd())p=a.Tc(v),x?l.push(new Rj(e,t,q,v,r,p.Vb())):n.push(new Rj(f,t,q,v,r,p.Vb()))});return n.concat(k,g,h,l)}
825
+ 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.lg=class{constructor(a){this.type=a}};class Sj 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.Mb.NONE}}
826
+ class Rj 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={Ut:'CREATE',Pw:'UPDATE',$t:'DELETE',Vt:'CREATE_RELATION',au:'DELETE_RELATION'};function Tj(a,b){b=Rf(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.Kb)||c.dd(b)}
827
+ olympe.dc.sources.Rl=class{constructor(a,b){this.G=a;this.D=b;this.Kb=null}T(){}Y(){}$(){}init(a){this.Kb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return u(function*(){if(!b.D.j)return b.Y(a);var c=olympe.dc.Request.j.pc,d=olympe.dc.Request.j.Tg;const e=olympe.dc.Request.j.ef,f=olympe.dc.Request.j.eh;var g=olympe.dc.Request.j.Fi;const h=olympe.dc.Request.j.zh,k=olympe.dc.Request.j.og;var l=olympe.dc.Request.j.eg;const n=olympe.dc.Request.j.cg,p=olympe.dc.sources.de(),
828
828
  q=a.getType(),r=a.jc();if(Rd(b.D)){q===d&&(c=a.content,(g=Tf(a).get(olympe.dc.ma.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.Y(a);if(q===d){const t=a.content;d=l;const v=new olympe.dc.db.fc(`fullResult_${t.T()}`);l=d.pipeThrough(new TransformStream({transform:(x,y)=>u(function*(){const z=
829
- x.bc();yield Vj(p,z);z.rc(v);b.G.j()&&b.G.debug(`Data Provider: Data result for query ${t.T()}`,z.Ab.size,'instances',Array.from(z.Jd()).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.bc(),!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.pc.Df};
829
+ x.bc();yield Vj(p,z);z.rc(v);b.G.j()&&b.G.debug(`Data Provider: Data result for query ${t.T()}`,z.Ab.size,'instances',Array.from(z.Jd()).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.bc(),!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.pc.Ef};
830
830
  case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.bc().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.$(a,
831
831
  b);const c=olympe.dc.sources.de(),d=a.content,e=a.jc();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(Rd(this.D)){const f=new rxjs.Observable(h=>{olympe.C.kt([this.D.Wf()],()=>{h.error(new olympe.error.Np('Go Offline',d.T()))})}),g=this.$(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.C.kt([this.D.Wf()],()=>{f.error(new olympe.error.Go('Back Online',d.T()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(Xj(c,d.T(),e,f.bc()).then(()=>f).catch(g=>{this.G.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);
832
- throw g;}))))}};olympe.dc.sources.Rl.za=[olympe.dc.sources.fk];const Yj=olympe.dc.Request.j.pc,Zj=olympe.dc.Request.j.Tg,ak=olympe.dc.Request.j.Gk,bk=olympe.dc.Request.j.ef,ck=olympe.dc.Request.j.eh,dk=olympe.dc.Request.j.Gi,ek=olympe.dc.Request.j.zh,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.Ja.jb(b))?void 0:c.Pf(olympe.dc.sources.U.We))!==olympe.dm.DataSource.We.Qp}function jk(a,b){let c;return(null==(c=a.Ja.jb(b))?void 0:c.Pf(olympe.dc.sources.U.We))!==olympe.dm.DataSource.We.yo}
832
+ throw g;}))))}};olympe.dc.sources.Rl.za=[olympe.dc.sources.fk];const Yj=olympe.dc.Request.j.pc,Zj=olympe.dc.Request.j.Tg,ak=olympe.dc.Request.j.Gk,bk=olympe.dc.Request.j.ef,ck=olympe.dc.Request.j.eh,dk=olympe.dc.Request.j.Fi,ek=olympe.dc.Request.j.zh,fk=olympe.dc.Request.j.og,gk=olympe.dc.Request.j.eg,hk=olympe.dc.Request.j.cg;function ik(a,b){let c;return(null==(c=a.Ha.jb(b))?void 0:c.Pf(olympe.dc.sources.U.We))!==olympe.dm.DataSource.We.Qp}function jk(a,b){let c;return(null==(c=a.Ha.jb(b))?void 0:c.Pf(olympe.dc.sources.U.We))!==olympe.dm.DataSource.We.yo}
833
833
  function kk(a,b,c){const d=c.content.bc().T();let e=a.ea.get(d);e||(e=olympe.L.rb.Ws(b),a.ea.set(d,e));return e.ld(c)}function lk(a,b){b=b.yc();if(b!==olympe.dm.User.j&&a.Pf(olympe.dc.sources.U.Tm))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);}
834
834
  function mk(a,b,c,d,e){return u(function*(){var f=olympe.L.xa.j.SEND,g=olympe.L.xa.j.GET;const h=olympe.L.xa.j.PUBLISH,k=olympe.L.xa.j.SUBSCRIBE,l=d.mt();var n=d.body();if(e!==n.yc())throw Error('Access denied: try to impersonate a user');lk(c,n);let p;if(null==(p=a.Kb)||!p.sources.has(n.jc()))throw Error(`Try to process a message with destination data source ${n.jc()} 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');
835
- g=yield d.Qn(f);a.ja.set(g,f);g=a.N.get(f);g||(g=new nk(a.G,f,b,Rf(n,olympe.dc.Ha.$e)),a.N.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.dd(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))})}
836
- olympe.dc.sources.Cr=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.ta=new Map;this.R=new Map;this.N=new Map;this.ja=new Map;this.Ja=f;this.ea=new Map}T(){return olympe.dc.Ha.$e}Y(a){var b=olympe.L.rb;const c=a.jc();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.pc.zb,f=
835
+ g=yield d.Qn(f);a.ja.set(g,f);g=a.N.get(f);g||(g=new nk(a.G,f,b,Rf(n,olympe.dc.Ia.$e)),a.N.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.dd(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))})}
836
+ olympe.dc.sources.Cr=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.ta=new Map;this.R=new Map;this.N=new Map;this.ja=new Map;this.Ha=f;this.ea=new Map}T(){return olympe.dc.Ia.$e}Y(a){var b=olympe.L.rb;const c=a.jc();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.pc.zb,f=
837
837
  olympe.dm.DataSource.pc.Wh;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.bc().T();return(ik(this,c)?b.get(c,a):yj(this.j,a)).finally(()=>Tj(this,g));case ck:const h=a.content.bc().T();
838
838
  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.bc().T(),this.ea.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):
839
839
  b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.T()}`)}}$(a,b){const c=a.jc(),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.rb.observe(c,this.F,a,{onRetry:b}).observable:rxjs.throwError(()=>
840
- Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.F)return this;olympe.dc.ma.from(this.H,this.H).fb(olympe.dm.DataSource.Lj).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.hi,!0)).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.Gs,!0)).observe(this.F).subscribe(b=>{b.zj().forEach(this.mb.bind(this,a));b.Fj().forEach(c=>{let d;null==(d=this.ta.get(c))||d.destroy();this.ta.delete(c)})});this.db.Ra(this.H,olympe.dm.DataSource.Gs)&&(new olympe.L.rb(this.H,this.F)).listen().subscribe(b=>
840
+ Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.F)return this;olympe.dc.ma.from(this.H,this.H).fb(olympe.dm.DataSource.Lj).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.hi,!0)).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.Gs,!0)).observe(this.F).subscribe(b=>{b.yj().forEach(this.mb.bind(this,a));b.Ej().forEach(c=>{let d;null==(d=this.ta.get(c))||d.destroy();this.ta.delete(c)})});this.db.Ra(this.H,olympe.dm.DataSource.Gs)&&(new olympe.L.rb(this.H,this.F)).listen().subscribe(b=>
841
841
  {b=b.body();b instanceof olympe.dc.Request?a.dd(b):this.G.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return u(function*(){})}mb(a,b){const c=b.X(),d=new olympe.C.Wb(`Published data provider context ${c}`,this.F);this.ta.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.We.yo&&(e=sj(this.j,c,k=>{lk(b,k);return a.request(k)}),d.onDestroy(()=>{let k;return null==
842
- (k=e)?void 0:k()}));f!==olympe.dm.DataSource.We.Qp&&(f=new olympe.C.Wb(`Bus Service of data source ${c}`,d),f=(new olympe.L.rb(c,f)).ut(this.bb.bind(this)),this.R.set(c,f),f.listen().subscribe(k=>{k.Ci().then(l=>mk(this,a,b,k,l)).catch(l=>{this.G.warn(`Error occurred while processing request from ${k.source()}: ${l}`);return k.mi(l instanceof Error?l:Error(l))})}))})}zi(a){const b=this;return u(function*(){let c;yield null==(c=b.R.get(a.jc()))?void 0:c.zi(a)})}bb(a){const b=this.ja.get(a);this.ja.delete(a);
842
+ (k=e)?void 0:k()}));f!==olympe.dm.DataSource.We.Qp&&(f=new olympe.C.Wb(`Bus Service of data source ${c}`,d),f=(new olympe.L.rb(c,f)).ut(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.mi(l instanceof Error?l:Error(l))})}))})}yi(a){const b=this;return u(function*(){let c;yield null==(c=b.R.get(a.jc()))?void 0:c.yi(a)})}Wa(a){const b=this.ja.get(a);this.ja.delete(a);
843
843
  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)}};
844
- 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.rb.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.Cr.za=[olympe.dc.sources.fk];const W={qs:10,Mo:11,sp:12,ir:13,QUERY_RESULT:14,Lp:15,ap:16,ef:17,jr:18,$o:19,gj: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.Pa(h.r,h.o,h.d))});a.$.nd(Wf(Xf(d),olympe.dc.Ha.SELF),{persist:!1});a.$.nd(Wf(Xf(c),olympe.dc.Ha.SELF))}
844
+ 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.rb.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.Cr.za=[olympe.dc.sources.fk];const W={qs:10,Mo:11,sp:12,ir:13,QUERY_RESULT:14,Lp:15,ap:16,ef:17,jr:18,$o: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.Pa(h.r,h.o,h.d))});a.$.nd(Wf(Xf(d),olympe.dc.Ia.SELF),{persist:!1});a.$.nd(Wf(Xf(c),olympe.dc.Ia.SELF))}
845
845
  olympe.dc.sources.ec=class extends olympe.L.ec{constructor(a){super();this.$=a;this.db=a.view;this.F=new Map}ga(a){a=super.ga(a);if(0<this.F.size){const b=Array.from(this.F.values());this.F.clear();return Object.assign(this.format(W.qs,a),{i:b})}return a}N(a){return(null==a?void 0:a.t)===W.qs&&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.sp;{const d=a.X(),e={t:d};if(!this.F.has(d)&&(this.H(d),!this.db.Re(d))){const f=
846
- a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))a=olympe.dc.Ns().Ja(a),this.F.get(d).p[olympe.dm.File.urlProp.X()]='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.Mo,this.H(a.X()));case a instanceof olympe.dc.ma:return this.format(W.ir,a.ga());case a instanceof olympe.dc.Ka:return this.format(W.QUERY_RESULT,a.ga(this.H.bind(this)));case a instanceof olympe.dc.db.fc:return b=new olympe.dc.transaction.He,
847
- a.rc(b),this.format(W.Lp,{i:a.T(),p:Xf(b)});case a instanceof olympe.dc.Request:return this.format(W.ap,{r:a.getType(),o:a.origin,d:a.jc(),u:a.yc(),c:this.D(a.content)});case a instanceof olympe.dc.transaction.mj:return this.format(W.ef,{r:a.uh(),p:this.D(a.bc())});case a instanceof olympe.dc.query.Ed:return this.format(W.jr,a.ga());case a instanceof olympe.dc.Ig:return this.format(W.$o,a.ga());case a instanceof olympe.dc.wc:return this.format(W.gj,this.H(a.X()));default:return super.D(a)}}j(a){if(null===
848
- a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case W.sp:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.Ns().Eb(d,a));return olympe.dc.CloudObject.get(d);case W.Mo:return olympe.dc.CloudObject.get(c);case W.ir:return d=c.p.map(olympe.dc.query.oa.Om.j),a=c.e,new olympe.dc.ma(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Md:a.s,Te:a.rm});case W.QUERY_RESULT:return Ni(c);case W.Lp:return(new olympe.dc.transaction.ej).j(c.p,c.i);case W.ap:return a=null!=(d=this.j(c.c))?d:void 0,
849
- Rf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case W.ef:return d=this.j(c.p),new olympe.dc.transaction.mj(d,c.r);case W.jr:return olympe.dc.query.Ed.j(c);case W.$o:return olympe.dc.Ig.j(c);case W.gj:return new olympe.dc.wc(c);default:return super.j(a)}}H(a){if(this.F.has(a))return a;if(!this.db.Ia(a))throw new olympe.dc.Uq(a);const b={};this.db.Cb(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of th(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.va.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
850
- 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.Kg,rk=olympe.dc.Request.j.ef,sk=olympe.dc.Request.j.eh,tk=olympe.dc.Request.j.Gi,uk=olympe.dc.Request.j.vo,vk=olympe.dc.Request.j.tr,wk=olympe.dc.Request.j.Tg,xk=olympe.dc.Request.j.Gk,yk=olympe.dc.Request.j.Kp,zk=olympe.dc.Request.j.qu,Ak=olympe.dc.Request.j.ru,Bk=olympe.dc.Request.j.su,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.Nw,Hk=olympe.dc.Request.j.bw,Ik=olympe.dc.Request.j.Fp,Jk=
846
+ a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))a=olympe.dc.Ns().Ha(a),this.F.get(d).p[olympe.dm.File.urlProp.X()]='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.Mo,this.H(a.X()));case a instanceof olympe.dc.ma:return this.format(W.ir,a.ga());case a instanceof olympe.dc.Ka:return this.format(W.QUERY_RESULT,a.ga(this.H.bind(this)));case a instanceof olympe.dc.db.fc:return b=new olympe.dc.transaction.He,
847
+ a.rc(b),this.format(W.Lp,{i:a.T(),p:Xf(b)});case a instanceof olympe.dc.Request:return this.format(W.ap,{r:a.getType(),o:a.origin,d:a.jc(),u:a.yc(),c:this.D(a.content)});case a instanceof olympe.dc.transaction.lj:return this.format(W.ef,{r:a.uh(),p:this.D(a.bc())});case a instanceof olympe.dc.query.Ed:return this.format(W.jr,a.ga());case a instanceof olympe.dc.Ig:return this.format(W.$o,a.ga());case a instanceof olympe.dc.wc:return this.format(W.fj,this.H(a.X()));default:return super.D(a)}}j(a){if(null===
848
+ a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case W.sp:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.Ns().Eb(d,a));return olympe.dc.CloudObject.get(d);case W.Mo:return olympe.dc.CloudObject.get(c);case W.ir:return d=c.p.map(olympe.dc.query.oa.Om.j),a=c.e,new olympe.dc.ma(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Md: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.ap:return a=null!=(d=this.j(c.c))?d:void 0,
849
+ Rf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case W.ef:return d=this.j(c.p),new olympe.dc.transaction.lj(d,c.r);case W.jr:return olympe.dc.query.Ed.j(c);case W.$o:return olympe.dc.Ig.j(c);case W.fj:return new olympe.dc.wc(c);default:return super.j(a)}}H(a){if(this.F.has(a))return a;if(!this.db.Ja(a))throw new olympe.dc.Uq(a);const b={};this.db.Cb(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of th(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.va.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
850
+ 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.Kg,rk=olympe.dc.Request.j.ef,sk=olympe.dc.Request.j.eh,tk=olympe.dc.Request.j.Fi,uk=olympe.dc.Request.j.vo,vk=olympe.dc.Request.j.tr,wk=olympe.dc.Request.j.Tg,xk=olympe.dc.Request.j.Gk,yk=olympe.dc.Request.j.Kp,zk=olympe.dc.Request.j.qu,Ak=olympe.dc.Request.j.ru,Bk=olympe.dc.Request.j.su,Ck=olympe.dc.Request.j.cg,Dk=olympe.dc.Request.j.eg,Ek=olympe.dc.Request.j.og,Fk=olympe.dc.Request.j.jk,Gk=olympe.dc.Request.j.Nw,Hk=olympe.dc.Request.j.bw,Ik=olympe.dc.Request.j.Fp,Jk=
851
851
  olympe.dc.Request.j.zh,Kk=olympe.dc.Request.j.Tt,Lk=olympe.dc.Request.j.pc;function Mk(a){return Nk(a,olympe.dc.Request.j.Kg).then(b=>{b=b.getData().p;const c=Wf(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({me:!1,ii:!1}),d=b.bc(),e=b.j;d.rc(c);return Pk(a,rk,{i:d.T(),r:b.uh(),p:Xf(c),bd:e?!0:void 0}).then(f=>f.ct)}
852
- function Qk(a,b){const c=b.bc(),d=new olympe.dc.transaction.He({wl:!0,me:!1,ii:!1});c.rc(d);b=b.j?'bd=true':'';return Nk(a,sk,Xf(d),b,olympe.net.wa.ResponseType.Xr).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.aj})})}
852
+ function Qk(a,b){const c=b.bc(),d=new olympe.dc.transaction.He({wl:!0,me:!1,ii:!1});c.rc(d);b=b.j?'bd=true':'';return Nk(a,sk,Xf(d),b,olympe.net.wa.ResponseType.Xr).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.Jf.j.$i})})}
853
853
  function Sk(a,b){const c=new olympe.dc.transaction.He({me:!1,ii:!1}),d=b.bc();d.rc(c);return Pk(a,tk,{i:d.T(),r:b.uh(),p:Xf(c)},!1).catch(e=>a.G.error(`Error while publishing burst transaction: ${e}`))}function Tk(a,b){const c=new olympe.dc.transaction.He({me:!1,ii:!1});b=b.bc();b.rc(c);return Pk(a,Jk,{i:b.T(),p:Xf(c)}).then(d=>d.ct)}
854
- function Uk(a,b){const c=encodeURI(bb(olympe.V.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.wa.ResponseType.ke).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 wb(a.ta,()=>Nk(a,yk,d,void 0,olympe.net.wa.ResponseType.ke)).then(e=>Wk(a,e))}
855
- function Yk(a,b){if(!ze(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.ma.from(b));b.f=olympe.dc.Mb.fp;b=N(vj(a.j,olympe.dc.Ha.SERVER,uk),olympe.net.wa.Sd.Th,JSON.stringify(b),olympe.net.wa.ResponseType.ai);Gc(b,{[olympe.net.wa.Headers.Ji]:olympe.net.wa.Ul.JSON});return wj(a.j,b).then(c=>c.getData())}
856
- function Zk(a,b,c,d){if(!ze(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.Ha.SERVER,vk);b=N(e+`?debug=${c}&optional=${d}`,olympe.net.wa.Sd.Th,b);Gc(b,{[olympe.net.wa.Headers.Ji]:olympe.net.wa.Ul.Xw});return wj(a.j,b).then(f=>f.getData())}
854
+ function Uk(a,b){const c=encodeURI(bb(olympe.V.kf(),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.wa.ResponseType.ke).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 wb(a.ta,()=>Nk(a,yk,d,void 0,olympe.net.wa.ResponseType.ke)).then(e=>Wk(a,e))}
855
+ function Yk(a,b){if(!ze(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.ma.from(b));b.f=olympe.dc.Mb.fp;b=N(vj(a.j,olympe.dc.Ia.SERVER,uk),olympe.net.wa.Sd.Th,JSON.stringify(b),olympe.net.wa.ResponseType.ai);Gc(b,{[olympe.net.wa.Headers.Ii]:olympe.net.wa.Ul.JSON});return wj(a.j,b).then(c=>c.getData())}
856
+ function Zk(a,b,c,d){if(!ze(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.wa.Sd.Th,b);Gc(b,{[olympe.net.wa.Headers.Ii]:olympe.net.wa.Ul.Xw});return wj(a.j,b).then(f=>f.getData())}
857
857
  function Pk(a,b,c,d=!0){const e=olympe.L.Ee.Hg,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{Ce(a.F,e,f,(k,l)=>{k?h(k):g(l)})});Ce(a.F,e,f);return Promise.resolve()}
858
858
  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.oa.Pd)Object.assign(b,{f:c[0].Pb,q:[]});else{const d=(h,k)=>{h.every(l=>!l.Fa(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.oa.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.Mb.NONE,q:c.map(a.ea.bind(a,
859
- e))})}return b}function Rk(a,b,c){b=Rf(new olympe.dc.Request(b,olympe.dc.Ha.SELF,c),a.T());let d;null==(d=a.Kb)||d.dd(b)}
860
- 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.wa.Sd.Th:olympe.net.wa.Sd.GET,c&&JSON.stringify(c));Gc(b,{[olympe.net.wa.Headers.Ji]:'application/json'});Ic(b,null!=e?e:olympe.net.wa.ResponseType.JSON);return wj(a.j,b)}
861
- function Wk(a,b){return u(function*(){const c=b.headers.graphId,d=b.getData();let e,f;return(null!=(f=null==(e=a.Ja)?void 0:xb(e,d))?f:olympe.V.stream.Ak.transform(b.getData())).pipeThrough(new TransformStream({transform:(g,h)=>{a.G.debug(`Received ${g.length} operations for patch ${c}`);h.enqueue(Wf(g,a.T(),null,c))}}))})}
862
- function $k(a,b,c){return u(function*(){const d=b.pi;let e;if(c instanceof olympe.V.stream.lg){e=new olympe.dc.db.fc(d);try{for(const f=ha(c);;){const g=yield f.next();if(g.done)break;a.R.j(g.value.p,d).rc(e)}}catch(f){a.G.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.fc(d)}}else e=a.R.j(b.p,d);return Nf(e,b.ct)})}
863
- olympe.dc.sources.Qr=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.ej(this.T());this.H=new Map;this.N=new Set;this.version=e||'unknown';this.Ja=g?new olympe.V.stream.Ww:null;this.ta=new olympe.V.promise.Ur(f);olympe.C.Hj(this.D.Wf(),()=>{this.H.forEach((h,k)=>{h.error(new olympe.error.Qh('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ha.SERVER}Y(a){var b=a.getType();const c=a.content,d=Tf(a);switch(b){case Lk:return a=
859
+ e))})}return b}function Rk(a,b,c){b=Rf(new olympe.dc.Request(b,olympe.dc.Ia.SELF,c),a.T());let d;null==(d=a.Kb)||d.dd(b)}
860
+ 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.wa.Sd.Th:olympe.net.wa.Sd.GET,c&&JSON.stringify(c));Gc(b,{[olympe.net.wa.Headers.Ii]:'application/json'});Ic(b,null!=e?e:olympe.net.wa.ResponseType.JSON);return wj(a.j,b)}
861
+ 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:xb(e,d))?f:olympe.V.stream.Ak.transform(b.getData())).pipeThrough(new TransformStream({transform:(g,h)=>{a.G.debug(`Received ${g.length} operations for patch ${c}`);h.enqueue(Wf(g,a.T(),null,c))}}))})}
862
+ function $k(a,b,c){return u(function*(){const d=b.pi;let e;if(c instanceof olympe.V.stream.mg){e=new olympe.dc.db.fc(d);try{for(const f=ha(c);;){const g=yield f.next();if(g.done)break;a.R.j(g.value.p,d).rc(e)}}catch(f){a.G.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.fc(d)}}else e=a.R.j(b.p,d);return Nf(e,b.ct)})}
863
+ olympe.dc.sources.Qr=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.V.stream.Ww:null;this.ta=new olympe.V.promise.Ur(f);olympe.C.Gj(this.D.Wf(),()=>{this.H.forEach((h,k)=>{h.error(new olympe.error.Qh('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ia.SERVER}Y(a){var b=a.getType();const c=a.content,d=Tf(a);switch(b){case Lk:return a=
864
864
  olympe.dm.DataSource.pc.zb,b=olympe.dm.DataSource.pc.Wh,Promise.resolve(ze(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.ma.j.fq)?Uk(this,c):Xk(this,c);case uk:return Yk(this,c);case vk:return Zk(this,c.BF,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);
865
865
  case Ek:return this.j.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}$(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(tb(olympe.error.Qh,(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=>
866
866
  {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);xe(this.F,olympe.L.Ee.Hg,this.ja.bind(this));return this}destroy(){return u(function*(){})}ja(a,b){const c=olympe.dc.Request.j.xo,d=olympe.dc.Request.j.Bm,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),
867
- b=Nf(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.Bm,error:0<a.s?a.error:null})}ea(a,b){if(b instanceof olympe.dc.query.oa.Xh){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.X(),d:c.La()===olympe.dc.va.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.ea.bind(this,a))}}return{}}};olympe.dc.sources.Qr.za=[olympe.dc.sources.fk];function al(a,b,c){const d=new olympe.C.Wb(`Source solver ${b.X()}`);b.fb(olympe.dm.Bd.F.$b()).fb(olympe.dm.Bd.D).ne().back().fb(olympe.dm.Bd.j).ne().observe(d,{md:c,Bc:!0}).subscribe(e=>{e.zj().forEach(([f,g])=>{a.D.set(f.X(),g.T())});e.Fj().forEach(([f])=>{a.D.delete(f)})});b.fb(olympe.dm.ib.D).observe(d,{md: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})}
868
- 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.fa(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.Ha.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ia(a)&&this.db.Ob(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}R(){return!1}init(){if(!this.H){this.H=
869
- !0;var a=new olympe.dc.Xa;X(a.create(olympe.dm.DataSource,this.j).Ai(this.j),olympe.dm.DataSource.hi,!0);a.Pa(olympe.dm.DataSource.Lj,this.j,this.j);a.ob(()=>{olympe.dc.ma.from(this.j).observe(olympe.C.lh()).subscribe(()=>{})})}}};olympe.dc.sources.P={Da:'dc.sources.Logger',mm:'dc.sources.HTTPService',Gu:'dc.sources.IOService',rr:'dc.sources.RemoteProvider',Jr:'dc.sources.ServerProvider',oC:'dc.sources.OfflineProvider',bf:'dc.sources.SourceSolver',Le:'dc.sources.Serializer',Yo:'dc.sources.cache.Cache',Zo:'dc.sources.cache.DATABASE',Nl:'dc.sources.cache.Logger'};
870
- olympe.dc.sources.U={Jh:'data.httpHost',Af:'data.httpPort',Ri:'data.httpSSL',jm:'data.httpBasePath',Mm:'data.pollingFrequency',We:'data.communicationMode',Tm:'data.restrictedUse',VERSION:'version.version',Nr:'data.streamWorker',Tq:'data.queryConcurrencyLimit'};olympe.dc.sources.Lh={Sv:'olympe.internal.data.',Jh:'olympe.internal.data.httpHost',Af:'olympe.internal.data.httpPort',Ri:'olympe.internal.data.httpSSL'};
871
- olympe.W.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.U.xm),d=`-${olympe.host.Xg.Uh}`;E(a,olympe.dc.sources.U.Jh,null);E(a,olympe.dc.sources.U.Af,null);E(a,olympe.dc.sources.U.Ri,null);E(a,olympe.dc.sources.U.jm,'runtime/data');E(a,olympe.dc.sources.U.Nr,!1);E(a,olympe.dc.sources.U.Tq,10);Za(a,olympe.dc.sources.Lh.Jh,[olympe.host.U.Jk,olympe.L.U.Yl,olympe.dc.sources.U.Jh],(e,f,g)=>{if(g)return g;e=e===olympe.host.Xg.Uh;return f.endsWith(c)&&e?f+d:f});Za(a,olympe.dc.sources.Lh.Af,
872
- [olympe.dc.sources.Lh.Jh,olympe.dc.sources.U.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});Za(a,olympe.dc.sources.Lh.Ri,[olympe.dc.sources.Lh.Af,olympe.dc.sources.U.Ri],(e,f)=>null!==f?f:443===e);E(a,olympe.dc.sources.U.Mm,null);E(a,olympe.dc.sources.U.We,null);E(a,olympe.dc.sources.U.Tm,null);D(a,olympe.dc.sources.P.Da,[olympe.ia.P.Ea],e=>e.cd('data'));C(a,olympe.dc.sources.P.Le,olympe.dc.sources.ec,olympe.dc.db.P.Ea);Xa(a,olympe.L.P.Le,
873
- olympe.dc.sources.P.Le);C(a,olympe.dc.sources.P.mm,olympe.dc.sources.vu,olympe.dc.sources.P.Da,olympe.net.P.oj,olympe.L.P.km,olympe.auth.P.Ea,olympe.dc.sources.P.bf,olympe.L.P.Le,new olympe.W.pa(olympe.L.U.Il));C(a,olympe.dc.sources.P.Gu,olympe.dc.sources.eq,olympe.dc.sources.P.Da,olympe.dc.P.Vg,olympe.net.P.Ea,olympe.auth.P.Ea);C(a,olympe.dc.sources.P.rr,olympe.dc.sources.Cr,olympe.dc.sources.P.Da,new olympe.W.pa(olympe.dc.U.Yg),olympe.dc.sources.P.mm,olympe.L.P.uf,olympe.dc.P.Dh,olympe.dc.sources.P.bf);
874
- C(a,olympe.dc.sources.P.Jr,olympe.dc.sources.Qr,olympe.dc.sources.P.Da,olympe.L.P.Nk,olympe.L.P.uf,olympe.dc.sources.P.mm,new olympe.W.pa(olympe.dc.sources.U.VERSION),new olympe.W.pa(olympe.dc.sources.U.Tq),new olympe.W.pa(olympe.dc.sources.U.Nr));C(a,olympe.dc.sources.P.bf,olympe.dc.sources.Sk,olympe.dc.P.Dh,new olympe.W.pa(olympe.dc.U.Yg),new olympe.W.pa(olympe.dc.U.$l));D(a,olympe.dc.sources.P.Nl,[olympe.ia.P.Ea],e=>e.cd('datacache'));C(a,olympe.dc.sources.P.Yo,olympe.dc.sources.cache.Cache,olympe.dc.sources.P.Nl,
875
- olympe.dc.P.Vg,olympe.dc.sources.P.Zo,olympe.dc.db.P.Ea,olympe.net.P.Ea,olympe.L.P.uf,olympe.Db.P.ym,olympe.V.P.Eg,new olympe.W.pa(olympe.net.U.Qq),new olympe.W.pa(olympe.dc.sources.U.VERSION));C(a,olympe.dc.sources.P.Zo,olympe.dc.sources.cache.yk,olympe.Db.P.ah,olympe.dc.sources.P.Nl,olympe.Db.P.qk)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.P.bf,olympe.dc.sources.P.Yo],(a,b)=>{olympe.dc.fe=()=>a;olympe.dc.sources.de=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.$m=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.Yt=class extends olympe.dc.sources.cache.errors.$m{};olympe.dc.sources.cache.errors.Kw=class extends olympe.dc.sources.cache.errors.$m{};olympe.dc.sources.cache.errors.Tw=class extends olympe.dc.sources.cache.errors.$m{};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.Qb(a);case 17:return new olympe.dc.wc(a.v);case 13:return(new olympe.dc.transaction.ej).j(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
867
+ b=Nf(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.Jf.j.Bm,error:0<a.s?a.error:null})}ea(a,b){if(b instanceof olympe.dc.query.oa.Xh){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.X(),d:c.La()===olympe.dc.va.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.ea.bind(this,a))}}return{}}};olympe.dc.sources.Qr.za=[olympe.dc.sources.fk];function al(a,b,c){const d=new olympe.C.Wb(`Source solver ${b.X()}`);b.fb(olympe.dm.Bd.F.$b()).fb(olympe.dm.Bd.D).ne().back().fb(olympe.dm.Bd.j).ne().observe(d,{md:c,Bc:!0}).subscribe(e=>{e.yj().forEach(([f,g])=>{a.D.set(f.X(),g.T())});e.Ej().forEach(([f])=>{a.D.delete(f)})});b.fb(olympe.dm.ib.D).observe(d,{md: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})}
868
+ 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.fa(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.Ob(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}R(){return!1}init(){if(!this.H){this.H=
869
+ !0;var a=new olympe.dc.Za;X(a.create(olympe.dm.DataSource,this.j).zi(this.j),olympe.dm.DataSource.hi,!0);a.Pa(olympe.dm.DataSource.Lj,this.j,this.j);a.ob(()=>{olympe.dc.ma.from(this.j).observe(olympe.C.lh()).subscribe(()=>{})})}}};olympe.dc.sources.P={Da:'dc.sources.Logger',mm:'dc.sources.HTTPService',Gu:'dc.sources.IOService',rr:'dc.sources.RemoteProvider',Jr:'dc.sources.ServerProvider',oC:'dc.sources.OfflineProvider',bf:'dc.sources.SourceSolver',Le:'dc.sources.Serializer',Yo:'dc.sources.cache.Cache',Zo:'dc.sources.cache.DATABASE',Nl:'dc.sources.cache.Logger'};
870
+ olympe.dc.sources.U={Jh:'data.httpHost',Bf:'data.httpPort',Qi:'data.httpSSL',jm:'data.httpBasePath',Mm:'data.pollingFrequency',We:'data.communicationMode',Tm:'data.restrictedUse',VERSION:'version.version',Nr:'data.streamWorker',Tq:'data.queryConcurrencyLimit'};olympe.dc.sources.Lh={Sv:'olympe.internal.data.',Jh:'olympe.internal.data.httpHost',Bf:'olympe.internal.data.httpPort',Qi:'olympe.internal.data.httpSSL'};
871
+ olympe.W.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.U.xm),d=`-${olympe.host.Xg.Uh}`;E(a,olympe.dc.sources.U.Jh,null);E(a,olympe.dc.sources.U.Bf,null);E(a,olympe.dc.sources.U.Qi,null);E(a,olympe.dc.sources.U.jm,'runtime/data');E(a,olympe.dc.sources.U.Nr,!1);E(a,olympe.dc.sources.U.Tq,10);Za(a,olympe.dc.sources.Lh.Jh,[olympe.host.U.Jk,olympe.L.U.Yl,olympe.dc.sources.U.Jh],(e,f,g)=>{if(g)return g;e=e===olympe.host.Xg.Uh;return f.endsWith(c)&&e?f+d:f});Za(a,olympe.dc.sources.Lh.Bf,
872
+ [olympe.dc.sources.Lh.Jh,olympe.dc.sources.U.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});Za(a,olympe.dc.sources.Lh.Qi,[olympe.dc.sources.Lh.Bf,olympe.dc.sources.U.Qi],(e,f)=>null!==f?f:443===e);E(a,olympe.dc.sources.U.Mm,null);E(a,olympe.dc.sources.U.We,null);E(a,olympe.dc.sources.U.Tm,null);D(a,olympe.dc.sources.P.Da,[olympe.ia.P.Ea],e=>e.cd('data'));C(a,olympe.dc.sources.P.Le,olympe.dc.sources.ec,olympe.dc.db.P.Ea);Xa(a,olympe.L.P.Le,
873
+ olympe.dc.sources.P.Le);C(a,olympe.dc.sources.P.mm,olympe.dc.sources.vu,olympe.dc.sources.P.Da,olympe.net.P.nj,olympe.L.P.km,olympe.auth.P.Ea,olympe.dc.sources.P.bf,olympe.L.P.Le,new olympe.W.pa(olympe.L.U.Il));C(a,olympe.dc.sources.P.Gu,olympe.dc.sources.eq,olympe.dc.sources.P.Da,olympe.dc.P.Vg,olympe.net.P.Ea,olympe.auth.P.Ea);C(a,olympe.dc.sources.P.rr,olympe.dc.sources.Cr,olympe.dc.sources.P.Da,new olympe.W.pa(olympe.dc.U.Yg),olympe.dc.sources.P.mm,olympe.L.P.vf,olympe.dc.P.Dh,olympe.dc.sources.P.bf);
874
+ C(a,olympe.dc.sources.P.Jr,olympe.dc.sources.Qr,olympe.dc.sources.P.Da,olympe.L.P.Nk,olympe.L.P.vf,olympe.dc.sources.P.mm,new olympe.W.pa(olympe.dc.sources.U.VERSION),new olympe.W.pa(olympe.dc.sources.U.Tq),new olympe.W.pa(olympe.dc.sources.U.Nr));C(a,olympe.dc.sources.P.bf,olympe.dc.sources.Sk,olympe.dc.P.Dh,new olympe.W.pa(olympe.dc.U.Yg),new olympe.W.pa(olympe.dc.U.$l));D(a,olympe.dc.sources.P.Nl,[olympe.ia.P.Ea],e=>e.cd('datacache'));C(a,olympe.dc.sources.P.Yo,olympe.dc.sources.cache.Cache,olympe.dc.sources.P.Nl,
875
+ olympe.dc.P.Vg,olympe.dc.sources.P.Zo,olympe.dc.db.P.Ea,olympe.net.P.Ea,olympe.L.P.vf,olympe.Db.P.ym,olympe.V.P.Eg,new olympe.W.pa(olympe.net.U.Qq),new olympe.W.pa(olympe.dc.sources.U.VERSION));C(a,olympe.dc.sources.P.Zo,olympe.dc.sources.cache.yk,olympe.Db.P.ah,olympe.dc.sources.P.Nl,olympe.Db.P.qk)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.P.bf,olympe.dc.sources.P.Yo],(a,b)=>{olympe.dc.fe=()=>a;olympe.dc.sources.de=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.$m=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.Yt=class extends olympe.dc.sources.cache.errors.$m{};olympe.dc.sources.cache.errors.Kw=class extends olympe.dc.sources.cache.errors.$m{};olympe.dc.sources.cache.errors.Tw=class extends olympe.dc.sources.cache.errors.$m{};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.Qb(a);case 17:return new olympe.dc.wc(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}`);}}
876
876
  olympe.dc.sources.cache.Up=class{ga(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.wc:return{t:17,v:a.X()};case a instanceof olympe.dc.db.fc:const b=new olympe.dc.transaction.He;a.rc(b);
877
877
  return{t:13,i:a.T(),v:Xf(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)})}
878
878
  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.$)a.G.debug('Cache: persist graph patch',d.T()),e&&b&&(Array.from(d.Uc()).filter(h=>!h.zd()).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}`),
879
879
  a.wd.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.de();a.$=!0;a.Eb=!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)}
880
880
  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.fc;const b=yield ll(a.j);for(const c of b)c.rc(a.F);a.ea.next(0<b.length)})}
881
881
  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.Ra(olympe.dm.File.j.X())&&g.Ra(olympe.dm.File.urlProp.X())){var f=g.Ra(olympe.dm.File.urlProp.X());f=N(f);Ic(f,olympe.net.wa.ResponseType.Hl);e.push(Jc(a.Gd,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.Ra(olympe.dm.File.mimeTypeProp.X()))?k:
882
- 'application/octet-stream';f={tag:h,model:g.Vb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.j.dg,c,f);f=wb(a.Nd,()=>a.Kb.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`)}})})})}
883
- function ml(a){const b=[olympe.dc.fa(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.ma.from(olympe.dm.File).ug(olympe.dc.CloudObject.extendedByRel).Hc().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)},[])}
882
+ '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=wb(a.Nd,()=>a.Kb.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`)}})})})}
883
+ function ml(a){const b=[olympe.dc.fa(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.ma.from(olympe.dm.File).vg(olympe.dc.CloudObject.extendedByRel).Hc().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)},[])}
884
884
  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)))})}
885
885
  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])}
886
- function tl(a,b,c){return u(function*(){var d=olympe.dc.Request.j.ef;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.Vb();if(h.zd())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(!Rd(a.mb))throw Error('Lost connection, stop syncing');
887
- l=yield a.Kb.request(l);b.Yc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.mj(b,!1));if(!Rd(a.mb))throw Error('Lost connection, stop syncing');yield a.Kb.request(d)})}
886
+ function tl(a,b,c){return u(function*(){var d=olympe.dc.Request.j.ef;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=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.Vb();if(h.zd())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(!Rd(a.mb))throw Error('Lost connection, stop syncing');
887
+ l=yield a.Kb.request(l);b.Yc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.lj(b,!1));if(!Rd(a.mb))throw Error('Lost connection, stop syncing');yield a.Kb.request(d)})}
888
888
  function vl(a,b,c){return c instanceof olympe.error.Vk||c instanceof olympe.error.To?(a.G.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.Yt('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.Br?(a.G.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.Kw('The transaction has been rejected by the datasource',
889
889
  c.message)):new olympe.dc.sources.cache.errors.Tw('Synchronisation error',c.message)}
890
890
  function wl(){var a=olympe.dc.sources.de();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,
891
891
  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()}
892
892
  function zl(){const a=olympe.dc.sources.de();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.ta.j(d.content)}),b.add(e.tag()));b=yield Al(a.j);c.patches.push(...b);return JSON.stringify(c)})}
893
- function Bl(a){const b=olympe.dc.sources.de();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.ta.D(e.c),yield ol(b.j,e.t,d,e.m);yield Cl(b.j,c.patches);yield kl(b);b.Ja.nd(Nf(b.F))})}
893
+ function Bl(a){const b=olympe.dc.sources.de();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.ta.D(e.c),yield ol(b.j,e.t,d,e.m);yield Cl(b.j,c.patches);yield kl(b);b.Ha.nd(Nf(b.F))})}
894
894
  function Dl(){const a=olympe.dc.sources.de();return u(function*(){yield El(a.j);yield kl(a)})}
895
- olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.Kb=b;this.j=c;this.Ja=d;this.Gd=e;this.mb=f;this.bb=g;this.ta=h;this.version=l;this.$=this.version!==this.bb.get('__code-as-data-version__');this.Yb=this.Eb=!1;this.D=new Map;this.N=new rxjs.BehaviorSubject([]);this.H=null;this.ea=new rxjs.BehaviorSubject(!1);this.F=new olympe.dc.db.fc;this.Pc=this.Gc=!1;this.ja=[];this.Y=0;this.le=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});this.R=
896
- !1;this.wd=new rxjs.Subject;this.Nd=new olympe.V.promise.Ur(k)}Jc(){return this.status.asObservable()}init(){const a=this;return u(function*(){if(!a.Gc)if(a.Pc)yield new Promise(b=>{a.ja.push(b)});else{a.Pc=!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.Ja.nd(Nf(a.F));for(const b of a.ja)b();a.Gc=!0;a.ja=[]}})}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.oa.Pd)?Gl(b.j,a).then(olympe.V.stream.Js):
895
+ olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.Kb=b;this.j=c;this.Ha=d;this.Gd=e;this.mb=f;this.Wa=g;this.ta=h;this.version=l;this.$=this.version!==this.Wa.get('__code-as-data-version__');this.Yb=this.Eb=!1;this.D=new Map;this.N=new rxjs.BehaviorSubject([]);this.H=null;this.ea=new rxjs.BehaviorSubject(!1);this.F=new olympe.dc.db.fc;this.Pc=this.Gc=!1;this.ja=[];this.Y=0;this.le=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});this.R=
896
+ !1;this.wd=new rxjs.Subject;this.Nd=new olympe.V.promise.Ur(k)}Jc(){return this.status.asObservable()}init(){const a=this;return u(function*(){if(!a.Gc)if(a.Pc)yield new Promise(b=>{a.ja.push(b)});else{a.Pc=!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.nd(Nf(a.F));for(const b of a.ja)b();a.Gc=!0;a.ja=[]}})}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.oa.Pd)?Gl(b.j,a).then(olympe.V.stream.Js):
897
897
  b.j.executeQuery(a).then(olympe.V.stream.Js)})}applyTransaction(a,b){const c=this;return u(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.bc(),e=Array.from(d.Ab.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.H)?void 0:f.j.Ab.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.Wt(d,b),c.ea.next(!0)):(d.rc(c.H.j),yield Hl(c.j,c.H.j,b));d.rc(c.F);yield gl(c.j,d,'local-transaction')})}uploadFileContent(a,
898
898
  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.Wt=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.Vq.Qb(b))})}function ll(a){return u(function*(){return(yield a.db.F('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.Sh.Qb(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()})}
899
899
  function gl(a,b,c){a.G.debug(`Offline DB: Apply patch ${b.T()} on local offline db`);Array.from(b.Ab.keys());return a.db.D().then(()=>{null===c&&(b.Ab.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)))})})}
900
900
  function ol(a,b,c,d){c=new olympe.dc.sources.cache.Jm(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.Sh.Qb(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)})}
901
901
  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.Jm.Qb(c)})}function Al(a){return u(function*(){return a.db.F('pending-transactions')})}
902
902
  function Cl(a,b){return u(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.Sh.Qb(d);e&&c.set(e.j.i,d)}yield a.db.ea()})}function El(a){return u(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
903
- 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.Ed.yj(b);var e=(yield a.db.H(b.T())).map(f=>olympe.dc.sources.cache.Qg.Qb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.yk.ac(f);const g=Jl(f.Ld);d.create(f.tag,e,g);for(const h of f.pb)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.hc.$c&&!0===e||d.Pa(k,e?n:f.tag,e?f.tag:n)}}a.G.j()&&
903
+ 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.Ed.xj(b);var e=(yield a.db.H(b.T())).map(f=>olympe.dc.sources.cache.Qg.Qb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.yk.ac(f);const g=Jl(f.Ld);d.create(f.tag,e,g);for(const h of f.pb)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.hc.$c&&!0===e||d.Pa(k,e?n:f.tag,e?f.tag:n)}}a.G.j()&&
904
904
  a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.bc().Ab.size,'instances',Array.from(d.bc().Jd()).length,'relations');return d})}function Hl(a,b,c){b=a.N.ga(b);a.G.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.Sh(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.$()})}
905
905
  function Jl(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,bl(d)),new Map)}
906
- 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.V.Promise.vj(()=>{const d=this;return u(function*(){if(!(0===d.D.size||0<(yield Kl(d))))if(0<d.db.Y())d.F().then(()=>{}),d.G.debug('Offline DB GC: Postponing round while the stack is busy');
907
- 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 ac(a){const b=new RegExp(`^(${olympe.dc.hc.$c})>([a-z0-9]*)$`);for(const c of a.pb)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.Ed.yj(a),e=a.jb();var f=
906
+ 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.V.Promise.uj(()=>{const d=this;return u(function*(){if(!(0===d.D.size||0<(yield Kl(d))))if(0<d.db.Y())d.F().then(()=>{}),d.G.debug('Offline DB GC: Postponing round while the stack is busy');
907
+ 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 ac(a){const b=new RegExp(`^(${olympe.dc.hc.$c})>([a-z0-9]*)$`);for(const c of a.pb)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.Ed.xj(a),e=a.jb();var f=
908
908
  yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Qg.Qb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.yk.ac(g),Jl(g.Ld));for(const p of ii(a))if(p instanceof olympe.dc.query.oa.Xh){var k=p.relation;g=k.La()===olympe.dc.va.ORIGIN;const q=k.X(),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`),
909
909
  Promise.resolve([]);r.X();return b.db.H().then(z=>z.map(A=>olympe.dc.sources.cache.Qg.Qb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.oa.Ce&&p.F&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.oa.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.ac(A),d.create(l,n,Jl(A.Ld)));q===olympe.dc.hc.$c&&!0===g||d.Pa(q,g?l:y,g?y:l)}}}}else p instanceof
910
910
  olympe.dc.query.oa.Pd&&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.bc().Ab.size,'instances',Array.from(d.bc().Jd()).length,'relations'),b.G.debug(`Offline DB: Data result for query ${a.T()} took ${Date.now()-c}ms to be executed`));return d})}};
@@ -916,325 +916,325 @@ olympe.dc.sources.cache.Jm=class{constructor(a,b,c){this.tag=a;this.content=b;th
916
916
  olympe.dc.sources.cache.zu=class{constructor(a,b){this.G=a;this.F=b;this.j=new Map;this.R=new Set;this.Y=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.Y.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.H.ga(k[1]);return h},null!=(e=null==d?void 0:d.Ld)?e:{});let f;e=null!=(f=null==d?void 0:d.j)?f:[];null===
917
917
  this.F||e.includes(this.F)||e.push(this.F);let g;b=new olympe.dc.sources.cache.Qg(a,b,c,null!=(g=null==d?void 0:d.pb)?g:[],e);this.j.set(a,b)}Yc(a,b){const c=this.j.get(a);if(c){var d;c.Ld=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.H.ga(g);return e},null!=(d=c.Ld)?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)}Pa(a,b,c){var d;const e=null!=(d=this.j.get(b))?d:new olympe.dc.sources.cache.Qg(b,
918
918
  'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Qg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.va.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=Ll(this,g.tag);k.has(h)||(g.pb.push(h),k.add(h));null===this.F||g.j.includes(this.F)||g.j.push(this.F)};f(e,`${a}${olympe.dc.va.DESTINATION}${c}`);f(d,b)}ic(a,b,c){const d=this.j.get(b),e=this.j.get(c);c=`${a}${olympe.dc.va.DESTINATION}${c}`;a=`${a}${olympe.dc.va.ORIGIN}${b}`;b=(f,g)=>{const h=Ll(this,f.tag);if(h.has(g)){const k=
919
- f.pb.indexOf(g);f.pb.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.zu.za=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.Hi=class a{constructor(b,c){this.id=null!=b?b:olympe.V.Kc();this.D=new olympe.C.Wb('BurstTransaction#'+this.id,c);this.Eb=Ml(this);this.R=!1;this.D.onDestroy(()=>this.N());this.Y=new Set;this.F=new Map;this.H=new Set;this.j=null;let d;this.bb=null!=(d=olympe.W.getParameter(olympe.dc.transaction.U.wo))?d:30;this.ja=[]}static j(b,c){return`${b},${c}`}Yb(b){for(const c of this.ja)c(b);this.stop()}Ja(){null!==this.j&&(clearTimeout(this.j),this.j=null);const b=this.ea(this.H);0<b.size&&Nl(this,
920
- b,!1);this.H.clear()}ea(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}$(b,c,d){this.ta(b,c,d);this.Eb(b,c,d);null===this.j&&(this.j=setTimeout(this.Ja.bind(this),this.bb))}ta(b,c,d){b=a.j(b,c);this.F.set(b,d);this.H.add(b)}mb(b,c){return this.F.get(a.j(b,c))}push(b,c){const d=olympe.dc.fa(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.fa(f),this.mb(d,e)!==g&&this.$(d,e,g.valueOf())});this.Y.add(b)}complete(){return new Promise((b,
921
- c)=>{this.N((d,e)=>{for(const f of this.Y)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.fa(b),f=olympe.dc.fa(c);void 0===e||void 0===f?olympe.ia.Za('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.Sn([d],g=>{this.R=!0;if(g instanceof olympe.dc.wc)olympe.ia.Za('dc').error('Cannot send complex property values in burst transactions');else{var h;this.$(e,f,null!=(h=null==g?void 0:g.valueOf())?h:null)}})}),this.D.Yd(()=>{this.N()}))}stop(){this.D.destroy();
922
- this.ja.length=0}getContext(){return this.D}T(){return this.id}uh(){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.ea(new Set(this.F.keys()));Nl(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.Hi.prototype.complete=olympe.dc.Hi.prototype.complete;olympe.dc.Hi.prototype.push=olympe.dc.Hi.prototype.push;olympe.dc.Nc=class{j(){}toString(){}};olympe.dc.Nc.j=1;olympe.dc.Nc.D=2;olympe.dc.Nc.H=3;olympe.dc.Nc.F=4;olympe.dc.Nc.N=5;olympe.dc.transaction.ej=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ha.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.ie.Ye+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,
919
+ f.pb.indexOf(g);f.pb.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.zu.za=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.Gi=class a{constructor(b,c){this.id=null!=b?b:olympe.V.Kc();this.D=new olympe.C.Wb('BurstTransaction#'+this.id,c);this.Eb=Ml(this);this.R=!1;this.D.onDestroy(()=>this.N());this.Y=new Set;this.F=new Map;this.H=new Set;this.j=null;let d;this.Wa=null!=(d=olympe.W.getParameter(olympe.dc.transaction.U.wo))?d:30;this.ja=[]}static j(b,c){return`${b},${c}`}Yb(b){for(const c of this.ja)c(b);this.stop()}Ha(){null!==this.j&&(clearTimeout(this.j),this.j=null);const b=this.ea(this.H);0<b.size&&Nl(this,
920
+ b,!1);this.H.clear()}ea(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}$(b,c,d){this.ta(b,c,d);this.Eb(b,c,d);null===this.j&&(this.j=setTimeout(this.Ha.bind(this),this.Wa))}ta(b,c,d){b=a.j(b,c);this.F.set(b,d);this.H.add(b)}mb(b,c){return this.F.get(a.j(b,c))}push(b,c){const d=olympe.dc.fa(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.fa(f),this.mb(d,e)!==g&&this.$(d,e,g.valueOf())});this.Y.add(b)}complete(){return new Promise((b,
921
+ c)=>{this.N((d,e)=>{for(const f of this.Y)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.fa(b),f=olympe.dc.fa(c);void 0===e||void 0===f?olympe.ia.Ya('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.Sn([d],g=>{this.R=!0;if(g instanceof olympe.dc.wc)olympe.ia.Ya('dc').error('Cannot send complex property values in burst transactions');else{var h;this.$(e,f,null!=(h=null==g?void 0:g.valueOf())?h:null)}})}),this.D.Yd(()=>{this.N()}))}stop(){this.D.destroy();
922
+ this.ja.length=0}getContext(){return this.D}T(){return this.id}uh(){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.ea(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.Nc=class{j(){}toString(){}};olympe.dc.Nc.j=1;olympe.dc.Nc.D=2;olympe.dc.Nc.H=3;olympe.dc.Nc.F=4;olympe.dc.Nc.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.ie.Ye+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,
923
923
  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.wc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}j(b,c){return this.D(b,new olympe.dc.db.fc(c))}D(b,c){for(const d of b)switch(d.o){case olympe.dc.Nc.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.Nc.D:c.Yc(d.t,
924
- a.j(d.p),d.m);break;case olympe.dc.Nc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Nc.F:c.Pa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Nc.N:c.ic(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.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.Ia(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.zd()).map(b=>b.tag())}function Sl(a){return Array.from(a.j.Uc()).filter(b=>b.zd()).map(b=>b.tag())}
925
- function Tl(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ha.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.fc(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)})}
926
- olympe.dc.transaction.Wv=class{constructor(a,b,c){this.id=null!=c?c:olympe.V.Kc();this.H=b;this.db=a;this.D=new Map;this.j=new olympe.dc.db.fc(this.id);this.sources=new Map;this.F=new Map}nf(){return 0===this.j.Ab.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)})}Yc(a,b){const c=Ol(this,a),d=Z(this,a),e=Pl(this,a);Tl(this,c,d,f=>{f.Yc(a,null!=b?b:new Map,e)})}Pa(a,b,c){const d=Ol(this,b),e=
927
- Ol(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ha.SELF&&e!==olympe.dc.Ha.SELF;f&&d!==e&&a!==olympe.dc.hc.$c&&(f=g=>{let h;return null!=(h=olympe.dc.ha().name(g))?h:g},olympe.ia.Za('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.Pa(a,b,c,Pl(this,b),Pl(this,c))})}ic(a,b,c){const d=Ol(this,b),e=Ol(this,c);let f=Z(this,b)&&
928
- Z(this,c)&&d!==olympe.dc.Ha.SELF&&e!==olympe.dc.Ha.SELF;f&&d!==e&&a!==olympe.dc.hc.$c&&(olympe.ia.Za('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.ic(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.iq.$g)if(e===olympe.dc.Ha.SELF)d[g]=olympe.dc.ha().T();else{if(e===olympe.dc.Ha.SERVER)continue}else g.startsWith(olympe.dc.ie.Ye)&&(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}
924
+ a.j(d.p),d.m);break;case olympe.dc.Nc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Nc.F:c.Pa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Nc.N:c.ic(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.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 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.zd()).map(b=>b.tag())}function Sl(a){return Array.from(a.j.Uc()).filter(b=>b.zd()).map(b=>b.tag())}
925
+ 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.fc(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)})}
926
+ olympe.dc.transaction.Wv=class{constructor(a,b,c){this.id=null!=c?c:olympe.V.Kc();this.H=b;this.db=a;this.D=new Map;this.j=new olympe.dc.db.fc(this.id);this.sources=new Map;this.F=new Map}pf(){return 0===this.j.Ab.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)})}Yc(a,b){const c=Ol(this,a),d=Z(this,a),e=Pl(this,a);Tl(this,c,d,f=>{f.Yc(a,null!=b?b:new Map,e)})}Pa(a,b,c){const d=Ol(this,b),e=
927
+ 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.hc.$c&&(f=g=>{let h;return null!=(h=olympe.dc.ha().name(g))?h:g},olympe.ia.Ya('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.Pa(a,b,c,Pl(this,b),Pl(this,c))})}ic(a,b,c){const d=Ol(this,b),e=Ol(this,c);let f=Z(this,b)&&
928
+ Z(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.hc.$c&&(olympe.ia.Ya('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.ic(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.iq.$g)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.ie.Ye)&&(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}
929
929
  class Xl{constructor(){this.N=new Map}R(a){return a instanceof olympe.C.Ta||a instanceof olympe.C.da||a instanceof olympe.C.aa?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.ph().valueOf(),g:a.mh().valueOf(),b:a.ih().valueOf(),a:a.hh().valueOf()}:a&&'function'===
930
930
  typeof a.X?{c:8,t:a.X()}:a}}function Xf(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}
931
931
  olympe.dc.transaction.He=class{constructor({wl:a=!1,ii:b=!0,me:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.H=[];this.wl=null!=a?a:!1;this.me=null!=c?c:!0;this.ii=null!=b?b:!0;this.Y=olympe.C?new Xl:new class extends Xl{R(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(Xf(this))}Rc(a,b,c,d=null){c=Vl(this.Y,null!=c?c:null,this.wl);c={o:olympe.dc.Nc.j,t:a,p:c};this.ii&&(c.s=b);this.me&&d&&(c.m=d);this.N.push(c);this.wl&&(b=Wl(this.Y))&&this.j.push({o:olympe.dc.Nc.D,
932
932
  t:a,p:b})}Yc(a,b,c=null){b=Vl(this.Y,b||null,!1);a={o:olympe.dc.Nc.D,t:a,p:b};this.me&&c&&(a.m=c);this.j.push(a)}D(a,b,c=null){a={o:olympe.dc.Nc.H,t:a,f:b};this.me&&c&&(a.m=c);this.F.push(a)}Pa(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.Nc.F,m:a,l:b,r:c};this.me&&d&&(a.lm=d);this.me&&
933
- e&&(a.rm=e);this.R.push(a)}ic(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.Nc.N,m:a,l:b,r:c};this.me&&d&&(a.lm=d);this.me&&e&&(a.rm=e);this.H.push(a)}};olympe.dc.transaction.He.za=[olympe.dc.Writable];function Yl(a){var b=new olympe.dc.Xa;b.Y=a;return b}function Zl(a,b){b instanceof olympe.dc.Xa&&b.D.forEach((c,d)=>a.D.set(d,c));a.Ga.push(b);return b}
933
+ e&&(a.rm=e);this.R.push(a)}ic(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.Nc.N,m:a,l:b,r:c};this.me&&d&&(a.lm=d);this.me&&e&&(a.rm=e);this.H.push(a)}};olympe.dc.transaction.He.za=[olympe.dc.Writable];function Yl(a){var b=new olympe.dc.Za;b.Y=a;return b}function Zl(a,b){b instanceof olympe.dc.Za&&b.D.forEach((c,d)=>a.D.set(d,c));a.Ga.push(b);return b}
934
934
  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.X(),b);else for(const [f,g]of Object.entries(b))X(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();Zl(a,new olympe.dc.transaction.Ga.hp(e,b));Zl(a,new olympe.dc.transaction.Ga.Vl(e,b,d));return c}
935
935
  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.$,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
936
- olympe.dc.Xa=class{constructor(a){this.id=null!=a?a:olympe.V.Kc();this.Ga=[];this.F=new Map;this.Y=!0;this.D=new Map;this.$=[];this.H=this.N=!1;this.R=[...olympe.dc.Gj().$]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.fa(a)))?b:olympe.dc.ha().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.Wo(a,b));const c=b.X();this.F.set(c,
937
- olympe.dc.fa(a));let d;this.persist(c,null!=(d=this.D.get(c))?d:this.Y);return b}persist(a,b=!0){const c=olympe.dc.fa(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.fe().fromModel(b);Zl(this,new olympe.dc.transaction.Ga.Xv(c,d))}else{if((e=d.Ia(c))&&d.Re(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
936
+ olympe.dc.Za=class{constructor(a){this.id=null!=a?a:olympe.V.Kc();this.Ga=[];this.F=new Map;this.Y=!0;this.D=new Map;this.$=[];this.H=this.N=!1;this.R=[...olympe.dc.Fj().$]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.fa(a)))?b:olympe.dc.ha().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.Wo(a,b));const c=b.X();this.F.set(c,
937
+ olympe.dc.fa(a));let d;this.persist(c,null!=(d=this.D.get(c))?d:this.Y);return b}persist(a,b=!0){const c=olympe.dc.fa(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.fe().fromModel(b);Zl(this,new olympe.dc.transaction.Ga.Xv(c,d))}else{if((e=d.Ja(c))&&d.Re(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
938
938
  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.Mb.Dc){Zl(this,new olympe.dc.transaction.Ga.ip(a,b))}update(a,b,c){return Zl(this,new olympe.dc.transaction.Ga.Vw(a,b,c))}Pa(a,b,c){Zl(this,new olympe.dc.transaction.Ga.Vl(a,b,c))}ic(a,b,c){Zl(this,new olympe.dc.transaction.Ga.hu(a,b,c))}wn(a,b){Zl(this,new olympe.dc.transaction.Ga.hp(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
939
939
  f);X(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.ie.Ye+d.X(),e);this.Pa(olympe.dc.CloudObject.propertyRel,a,d);this.Pa(olympe.dm.Property.typeRel,d,b);this.Pa(olympe.dc.CloudObject.containsRel,a,d);return d}Ds(a,b,c='',{KE:d=olympe.dm.Relation.H.Jv,WE:e=olympe.dm.Relation.j.cw,RE:f=olympe.dm.Relation.j.Kt,uF:g=olympe.dm.Relation.j.Wp,HE:h=olympe.dm.Dl.NONE,tF:k=olympe.dm.Relation.N|h}={},l=olympe.V.Kc()){c=X(X(X(X(X(X(X(X(X(X(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
940
- c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.ea,e),olympe.dm.Relation.ta,e),olympe.dm.Relation.$,e),olympe.dm.Relation.Y,f),olympe.dm.Relation.ja,g),olympe.dm.Relation.Ja,olympe.dm.Relation.j.Wp),olympe.dm.Relation.R,h);this.Pa(olympe.dc.CloudObject.Kj,a,c);this.Pa(olympe.dm.Relation.destinationModelRel,c,b);this.Pa(olympe.dc.CloudObject.containsRel,a,c);return c}uh(){return!1}mn(a){this.$.push(olympe.C.Ya().tc(a))}ob(a,b){bm(olympe.dc.Gj(),this,am(this,a),b)}xn(a){a=
941
- am(this,a);cm(olympe.dc.Gj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Xa.za=[olympe.dc.Nc];function Ml(a){var b=olympe.dc.Gj();const c=a.T();b.H.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.fc(c);g.Yc(d,(new Map).set(e,f),b.db.model(d));b.j.nd(Nf(g,Infinity))}}
942
- function Nl(a,b,c,d){var e=olympe.dc.Gj();const f=olympe.dc.Request.j.Gi,g=olympe.dc.Request.j.zh,h=a.T();a=a.uh();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ha.SELF||!e.db.Re(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.fc(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.mj(n,a)),b=e.Kb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.j.nd(Nf(n,p));null==d||d(!0)})}
940
+ c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.ea,e),olympe.dm.Relation.ta,e),olympe.dm.Relation.$,e),olympe.dm.Relation.Y,f),olympe.dm.Relation.ja,g),olympe.dm.Relation.Ha,olympe.dm.Relation.j.Wp),olympe.dm.Relation.R,h);this.Pa(olympe.dc.CloudObject.Kj,a,c);this.Pa(olympe.dm.Relation.destinationModelRel,c,b);this.Pa(olympe.dc.CloudObject.containsRel,a,c);return c}uh(){return!1}mn(a){this.$.push(olympe.C.$a().tc(a))}ob(a,b){bm(olympe.dc.Fj(),this,am(this,a),b)}xn(a){a=
941
+ am(this,a);cm(olympe.dc.Fj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Za.za=[olympe.dc.Nc];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.fc(c);g.Yc(d,(new Map).set(e,f),b.db.model(d));b.j.nd(Nf(g,Infinity))}}
942
+ function Nl(a,b,c,d){var e=olympe.dc.Fj();const f=olympe.dc.Request.j.Fi,g=olympe.dc.Request.j.zh,h=a.T();a=a.uh();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.fc(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.Kb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.j.nd(Nf(n,p));null==d||d(!0)})}
943
943
  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;Vf(a.Kb,olympe.dc.Request.j.xo,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.nd(c);a.G.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});Vf(a.Kb,b,c=>{c=c.content;em(a,c.id,c.finalize,c.error)})}
944
944
  function fm(a,b,c){if(!c)throw Error('Transaction compiler id is required');a.ta.has(c)||a.$.push(b);return a}
945
- function cm(a,b,c,d=!1){const e=b.T(),f=new olympe.dc.transaction.Wv(a.db,a.ja,e);try{b.j(f)}catch(q){if(q instanceof olympe.dc.Nq){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.oe(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.Ob(q,olympe.dm.File)&&a.db.source(q)!==olympe.dc.Ha.SERVER).map(q=>[q,a.db.model(q),a.db.source(q)]),l=Qg(a.j,
946
- f.j,g),n=olympe.C.Ya().tc((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.uh(),b.N)}).then(q=>Promise.allSettled(k.map(([r,t,v])=>a.N.ta(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.aj)}).catch(q=>{a.G.error(q);p.forEach(r=>r(null,`${q}`));jm(a,e)})}}
947
- function gm(a,b,c){const d=b.j,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.Ob(n,olympe.dm.File)&&void 0!==(null==(p=d.Tc(n))?void 0:p.Ra(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.j.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.D.values()),k=[],l=olympe.V.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),
945
+ function cm(a,b,c,d=!1){const e=b.T(),f=new olympe.dc.transaction.Wv(a.db,a.ja,e);try{b.j(f)}catch(q){if(q instanceof olympe.dc.Nq){q.j.then(()=>cm(a,b,c,d));return}c(!1,q.message);return}if(f.pf()){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.oe(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.Ob(q,olympe.dm.File)&&a.db.source(q)!==olympe.dc.Ia.SERVER).map(q=>[q,a.db.model(q),a.db.source(q)]),l=Qg(a.j,
946
+ f.j,g),n=olympe.C.$a().tc((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.uh(),b.N)}).then(q=>Promise.allSettled(k.map(([r,t,v])=>a.N.ta(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.Jf.j.$i)}).catch(q=>{a.G.error(q);p.forEach(r=>r(null,`${q}`));jm(a,e)})}}
947
+ function gm(a,b,c){const d=b.j,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.Ob(n,olympe.dm.File)&&void 0!==(null==(p=d.Tc(n))?void 0:p.Ra(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.j.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.D.values()),k=[],l=olympe.V.kf();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),
948
948
  r();else{var v=n.X(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.N.ja(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.ln(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.X());return Promise.resolve([])})).then(()=>{const n=k.reduce((p,[q,r])=>{p.Yc(q,r);return p},
949
- new olympe.dc.db.fc);return Qg(a.j,n)})}function hm(a,b,c,d){const e=olympe.C.lh(),f=new olympe.async.Dk(e);0<a.R&&f.Bg(a.R);const g=olympe.dc.transaction.If.j.Ev;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.tc((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});ud(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()}
950
- function im(a,b,c,d,e){if(c&&olympe.C.Qa(a.ea.state)!==olympe.auth.Ua.j.rf)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.j.eh:olympe.dc.Request.j.ef;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.mj(h,d,e));return a.Kb.request(g)})).then(g=>g[0])}
951
- 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.aj,null)});a.F.delete(b);if(0===a.F.size){for(const d of a.Y)d();a.Y=[]}a.D.has(b)&&(c=a.D.get(b),a.D.delete(b),c(!0))}
952
- olympe.dc.transaction.If=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Kb=c;this.ja=d;this.N=e;this.ea=f;this.R=g.get('notificationTimeout');this.$=[];let h;this.ta=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.H=new olympe.V.$h(g.get('burstHoldTime'));this.F=new Map;this.Y=[];this.D=new Map;this.Ja=new olympe.V.promise.Tk;dm(this)}se(a){wb(this.Ja,()=>this.Kb.request(new olympe.dc.Request(olympe.dc.Request.j.Fp,olympe.dc.Ha.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
953
- b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.If.j={Bm:0,aj:1,Ev:2};olympe.dc.transaction.mj=class{constructor(a,b=!1,c=!1){this.D=a;this.F=b;this.j=c}uh(){return this.F}bc(){return this.D}};olympe.dc.transaction.P={Da:'dc.transaction.Logger',Ea:'dc.transaction.Manager'};olympe.dc.transaction.U={Bq:'dc.transaction.timeout',wo:'dc.transaction.burstInterval',bm:'dc.transaction.disabledCompilers'};
954
- olympe.W.config(function(a){E(a,olympe.dc.transaction.U.Bq,9E4);E(a,olympe.dc.transaction.U.wo,30);E(a,olympe.dc.transaction.U.bm,[]);D(a,olympe.dc.transaction.P.Da,[olympe.ia.P.Ea],b=>b.cd('dc'));D(a,'olympe.dc.transaction.Config',[new olympe.W.pa(olympe.dc.transaction.U.Bq),new olympe.W.pa(olympe.dc.transaction.U.bm),new olympe.W.pa(olympe.dc.db.U.Pl)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));C(a,olympe.dc.transaction.P.Ea,olympe.dc.transaction.If,
955
- olympe.dc.transaction.P.Da,olympe.dc.db.P.Ea,olympe.dc.P.Vg,olympe.dc.sources.P.bf,olympe.dc.P.hk,olympe.auth.P.Ea,'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.Dg=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.$s(a)?a.valueOf():a}};olympe.dc.transaction.Ga.Dg.za=[olympe.dc.Nc];olympe.dc.transaction.Ga.oo=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Sa.Relation?a:new olympe.dc.Sa.Relation(olympe.dc.fa(a));this.origin=this.ha.Ia(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}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.Ld.set(olympe.dc.fa(b),c);return a}olympe.dc.transaction.Ga.Wo=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.fa(b))?c:olympe.V.Of();this.model=olympe.dc.fa(a);this.source=null;this.Ld=new Map}X(){return this.tag}ac(){return this.model}Ai(a){this.source=a;return this}j(a){const b=this.ac(),c=this.X();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Rc(c,b,this.source,km(this,this.Ld))}toString(){return`CreateInstance(${this.ac()}, ${this.X()})`}};
956
- olympe.dc.transaction.Ga.Wo.za=[olympe.dc.Ze];olympe.dc.transaction.Ga.Vl=class extends olympe.dc.transaction.Ga.oo{constructor(a,b,c){super(a,b);this.D=this.ha.Ia(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.hc.$c)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');
949
+ new olympe.dc.db.fc);return Qg(a.j,n)})}function hm(a,b,c,d){const e=olympe.C.lh(),f=new olympe.async.Dk(e);0<a.R&&f.$f(a.R);const g=olympe.dc.transaction.Jf.j.Ev;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.tc((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});ud(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()}
950
+ function im(a,b,c,d,e){if(c&&olympe.C.Qa(a.ea.state)!==olympe.auth.Ua.j.sf)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.j.eh:olympe.dc.Request.j.ef;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.Kb.request(g)})).then(g=>g[0])}
951
+ 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.Jf.j.$i,null)});a.F.delete(b);if(0===a.F.size){for(const d of a.Y)d();a.Y=[]}a.D.has(b)&&(c=a.D.get(b),a.D.delete(b),c(!0))}
952
+ olympe.dc.transaction.Jf=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Kb=c;this.ja=d;this.N=e;this.ea=f;this.R=g.get('notificationTimeout');this.$=[];let h;this.ta=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.H=new olympe.V.$h(g.get('burstHoldTime'));this.F=new Map;this.Y=[];this.D=new Map;this.Ha=new olympe.V.promise.Tk;dm(this)}se(a){wb(this.Ha,()=>this.Kb.request(new olympe.dc.Request(olympe.dc.Request.j.Fp,olympe.dc.Ia.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
953
+ b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.Jf.j={Bm:0,$i:1,Ev:2};olympe.dc.transaction.lj=class{constructor(a,b=!1,c=!1){this.D=a;this.F=b;this.j=c}uh(){return this.F}bc(){return this.D}};olympe.dc.transaction.P={Da:'dc.transaction.Logger',Ea:'dc.transaction.Manager'};olympe.dc.transaction.U={Bq:'dc.transaction.timeout',wo:'dc.transaction.burstInterval',bm:'dc.transaction.disabledCompilers'};
954
+ olympe.W.config(function(a){E(a,olympe.dc.transaction.U.Bq,9E4);E(a,olympe.dc.transaction.U.wo,30);E(a,olympe.dc.transaction.U.bm,[]);D(a,olympe.dc.transaction.P.Da,[olympe.ia.P.Ea],b=>b.cd('dc'));D(a,'olympe.dc.transaction.Config',[new olympe.W.pa(olympe.dc.transaction.U.Bq),new olympe.W.pa(olympe.dc.transaction.U.bm),new olympe.W.pa(olympe.dc.db.U.Pl)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));C(a,olympe.dc.transaction.P.Ea,olympe.dc.transaction.Jf,
955
+ olympe.dc.transaction.P.Da,olympe.dc.db.P.Ea,olympe.dc.P.Vg,olympe.dc.sources.P.bf,olympe.dc.P.hk,olympe.auth.P.Ea,'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.Dg=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.$s(a)?a.valueOf():a}};olympe.dc.transaction.Ga.Dg.za=[olympe.dc.Nc];olympe.dc.transaction.Ga.oo=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Sa.Relation?a:new olympe.dc.Sa.Relation(olympe.dc.fa(a));this.origin=this.ha.Ja(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}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.Ld.set(olympe.dc.fa(b),c);return a}olympe.dc.transaction.Ga.Wo=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.fa(b))?c:olympe.V.jf();this.model=olympe.dc.fa(a);this.source=null;this.Ld=new Map}X(){return this.tag}ac(){return this.model}zi(a){this.source=a;return this}j(a){const b=this.ac(),c=this.X();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Rc(c,b,this.source,km(this,this.Ld))}toString(){return`CreateInstance(${this.ac()}, ${this.X()})`}};
956
+ olympe.dc.transaction.Ga.Wo.za=[olympe.dc.Ze];olympe.dc.transaction.Ga.Vl=class extends olympe.dc.transaction.Ga.oo{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.hc.$c)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');
957
957
  if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.La()===olympe.dc.va.DESTINATION?a.Pa(b,olympe.dc.fa(this.origin),olympe.dc.fa(this.D)):a.Pa(b,olympe.dc.fa(this.D),olympe.dc.fa(this.origin))}toString(){return`CreateRelation('${this.relation.La()}${this.relation.X()}, ${olympe.dc.fa(this.origin)}, ${olympe.dc.fa(this.D)})`}};olympe.dc.transaction.Ga.ZA=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b=olympe.dc.Mb.Dc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Pb=b}j(a){for(const b of this.ha.Uc(this.model))b!==olympe.dc.fa(this.model)&&(new olympe.dc.transaction.Ga.ip(b,this.Pb)).j(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.Pb})`}};olympe.dc.transaction.Ga.hp=class extends olympe.dc.transaction.Ga.oo{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.hc.$c)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.fa(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.va.DESTINATION?
958
- a.ic(b,c,f):a.ic(b,f,c)}toString(){return`DeleteAllRelations(${this.La()}${this.getType()})`}};olympe.dc.transaction.Ga.ip=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b=olympe.dc.Mb.Dc){super();this.tag=this.ha.Ia(a)?olympe.dc.CloudObject.get(a):a;this.Pb=b}X(){return olympe.dc.fa(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ha.Ia(b)&&Ul(a,b,this.Pb)}toString(){return'DeleteInstance('+this.X()+', '+this.Pb+')'}};olympe.dc.transaction.Ga.hu=class extends olympe.dc.transaction.Ga.Vl{j(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.hc.$c)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.fa(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.fa(this.D);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
959
- this.relation.La()===olympe.dc.va.DESTINATION?a.ic(b,c,d):a.ic(b,d,c)}toString(){return'DeleteRelation('+this.relation.La()+this.relation.X()+', '+olympe.dc.fa(this.origin)+', '+olympe.dc.fa(this.D)+')'}};olympe.dc.transaction.Ga.Vw=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b,c){super();this.tag=this.ha.Ia(a)?olympe.dc.CloudObject.get(a):a;this.Ld=new Map;void 0!==b&&this.Ld.set(olympe.dc.fa(b),c)}X(){return olympe.dc.fa(this.tag)}j(a){const b=this.X();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.ha.Ia(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=km(this,this.Ld);
960
- for(const [e,f]of c){var d=this.ha.Ra(b,e,!0);d instanceof olympe.dc.wc&&Ul(a,d.X(),olympe.dc.Mb.Dc);f instanceof olympe.dc.wc&&!Z(a,f.X())&&(d=new olympe.dc.Xa,d.persist(f.X()),d.j(a))}a.Yc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+km(this,this.Ld)+')'}};olympe.dc.transaction.Ga.Xv=class a extends olympe.dc.transaction.Ga.Dg{constructor(b,c){super();this.tag=b;this.source=c}j(b){const c=olympe.dc.ha();if(Z(b,this.tag)&&c.Ia(this.tag)&&!c.Re(this.tag)){const e=c.Cb(this.tag,!0);var d;let f;null==(f=null==(d=b.j.Tc(this.tag))?void 0:d.Cb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.wc&&c.Ia(g.X())&&(new a(g.X(),this.source)).j(b);d=c.model(this.tag);b.Rc(this.tag,d,this.source,e);for(const [g,h,k]of th(c,this.tag))Z(b,
961
- k)&&(h===olympe.dc.va.ORIGIN?b.Pa(g,k,this.tag):b.Pa(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.fa=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.gh))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.na.ac(a))?d:''}else if(olympe.C.pf(a)){let d;b=olympe.dc.fa(null==(d=olympe.C.Qa(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};w('olympe.dc.instanceToTag',olympe.dc.fa);olympe.dc.ha=function(){return olympe.dc.ly().view};olympe.dc.register=function(a,b){olympe.dc.na.j(a,b)};
958
+ a.ic(b,c,f):a.ic(b,f,c)}toString(){return`DeleteAllRelations(${this.La()}${this.getType()})`}};olympe.dc.transaction.Ga.ip=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b=olympe.dc.Mb.Dc){super();this.tag=this.ha.Ja(a)?olympe.dc.CloudObject.get(a):a;this.Pb=b}X(){return olympe.dc.fa(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ha.Ja(b)&&Ul(a,b,this.Pb)}toString(){return'DeleteInstance('+this.X()+', '+this.Pb+')'}};olympe.dc.transaction.Ga.hu=class extends olympe.dc.transaction.Ga.Vl{j(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.hc.$c)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.fa(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.fa(this.D);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
959
+ this.relation.La()===olympe.dc.va.DESTINATION?a.ic(b,c,d):a.ic(b,d,c)}toString(){return'DeleteRelation('+this.relation.La()+this.relation.X()+', '+olympe.dc.fa(this.origin)+', '+olympe.dc.fa(this.D)+')'}};olympe.dc.transaction.Ga.Vw=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b,c){super();this.tag=this.ha.Ja(a)?olympe.dc.CloudObject.get(a):a;this.Ld=new Map;void 0!==b&&this.Ld.set(olympe.dc.fa(b),c)}X(){return olympe.dc.fa(this.tag)}j(a){const b=this.X();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.ha.Ja(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=km(this,this.Ld);
960
+ for(const [e,f]of c){var d=this.ha.Ra(b,e,!0);d instanceof olympe.dc.wc&&Ul(a,d.X(),olympe.dc.Mb.Dc);f instanceof olympe.dc.wc&&!Z(a,f.X())&&(d=new olympe.dc.Za,d.persist(f.X()),d.j(a))}a.Yc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+km(this,this.Ld)+')'}};olympe.dc.transaction.Ga.Xv=class a extends olympe.dc.transaction.Ga.Dg{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.Cb(this.tag,!0);var d;let f;null==(f=null==(d=b.j.Tc(this.tag))?void 0:d.Cb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.wc&&c.Ja(g.X())&&(new a(g.X(),this.source)).j(b);d=c.model(this.tag);b.Rc(this.tag,d,this.source,e);for(const [g,h,k]of th(c,this.tag))Z(b,
961
+ k)&&(h===olympe.dc.va.ORIGIN?b.Pa(g,k,this.tag):b.Pa(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.fa=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.gh))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.na.ac(a))?d:''}else if(olympe.C.qf(a)){let d;b=olympe.dc.fa(null==(d=olympe.C.Qa(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};w('olympe.dc.instanceToTag',olympe.dc.fa);olympe.dc.ha=function(){return olympe.dc.ly().view};olympe.dc.register=function(a,b){olympe.dc.na.j(a,b)};
962
962
  olympe.dc.defineProperty=function(a){return new olympe.dc.Sa.Property(a)};olympe.dc.Ds=function(a,b=olympe.dc.va.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.va.DESTINATION){const e=olympe.dc.va.DESTINATION;return b===olympe.dc.va.ORIGIN||b===e?new olympe.dc.Sa.Relation(a,b):new olympe.dc.Sa.Relation(a,d,b,c)};olympe.dc.Fx=function(a){return a.$b()};olympe.dc.nb={};olympe.dc.nb.tn=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.C.xb(a):a instanceof olympe.C.Ta?a:null;olympe.dc.nb.qn=a=>'boolean'===typeof a||a instanceof Boolean?olympe.C.Sb(a):a instanceof olympe.C.da?a:null;olympe.dc.nb.sn=a=>'number'===typeof a||a instanceof Number?olympe.C.ra(a):'string'===typeof a||a instanceof String?olympe.C.ra(Number.parseFloat(a.valueOf())):a instanceof olympe.C.aa?a:null;
963
963
  olympe.dc.nb.rn=a=>'number'===typeof a||a instanceof Number?oc(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.nb.ys=function(a){return a instanceof olympe.C.Color?a:'string'===typeof a||a instanceof String?sc(a.valueOf()):null};olympe.dc.nb.zs=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.wc?olympe.dc.CloudObject.get(a.tag):null;
964
- olympe.dc.nb.uj=a=>a instanceof olympe.dc.wc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.nb.Cc=a=>{a=a instanceof olympe.dc.wc?olympe.dc.CloudObject.get(a.tag):a;let b;return null!=(b=a instanceof olympe.dc.CloudObject?a.Cc():a)?b:null};
965
- olympe.dc.nb.Zx=a=>{switch(a){case olympe.C.da:return olympe.dc.nb.qn;case olympe.C.Ta:return olympe.dc.nb.tn;case olympe.C.aa:return olympe.dc.nb.sn;case olympe.C.eb:return olympe.dc.nb.rn;case olympe.C.Color:return olympe.dc.nb.ys;case olympe.dc.CloudObject:return olympe.dc.nb.zs;default:return olympe.dc.nb.uj}};olympe.dc.kc={};olympe.dc.wf=class{la(){}F(){}compare(){}H(){}ga(){}toString(){}};function lm(a){let b=null;for(a=[...a.ba];null===b&&0<a.length;)b=a.pop().Nb();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.ia.Za('dc').warn(a))}
966
- olympe.dc.Aa=class{constructor(a,b,c){void 0===a||null===a?olympe.ia.Za('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.D=olympe.C.ua([a],olympe.dc.fa,String),this.ba=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||lm(this),this.j=null,this.Bc=void 0)}re(){return olympe.dc.re()}ob(){if(null===this.j){const a=olympe.dc.kc.By();this.j=nm(a,this,this.Bc);null!==this.valueType&&this.j.Rd(this.valueType);olympe.C.Ya().Yd(()=>
964
+ olympe.dc.nb.tj=a=>a instanceof olympe.dc.wc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.nb.Cc=a=>{a=a instanceof olympe.dc.wc?olympe.dc.CloudObject.get(a.tag):a;let b;return null!=(b=a instanceof olympe.dc.CloudObject?a.Cc():a)?b:null};
965
+ olympe.dc.nb.Zx=a=>{switch(a){case olympe.C.da:return olympe.dc.nb.qn;case olympe.C.Ta:return olympe.dc.nb.tn;case olympe.C.aa:return olympe.dc.nb.sn;case olympe.C.eb:return olympe.dc.nb.rn;case olympe.C.Color:return olympe.dc.nb.ys;case olympe.dc.CloudObject:return olympe.dc.nb.zs;default:return olympe.dc.nb.tj}};olympe.dc.kc={};olympe.dc.xf=class{la(){}F(){}compare(){}H(){}ga(){}toString(){}};function lm(a){let b=null;for(a=[...a.ba];null===b&&0<a.length;)b=a.pop().Nb();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.ia.Ya('dc').warn(a))}
966
+ olympe.dc.Aa=class{constructor(a,b,c){void 0===a||null===a?olympe.ia.Ya('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.D=olympe.C.ua([a],olympe.dc.fa,String),this.ba=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||lm(this),this.j=null,this.Bc=void 0)}re(){return olympe.dc.re()}ob(){if(null===this.j){const a=olympe.dc.kc.By();this.j=nm(a,this,this.Bc);null!==this.valueType&&this.j.Rd(this.valueType);olympe.C.$a().Yd(()=>
967
967
  {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}nc(){null===this.j&&this.ob();return this.j}Rd(a){this.valueType=a;null!==this.j&&this.j.Rd(this.valueType)}Nb(){return null!==this.j?this.j.Nb():null===this.valueType?olympe.dc.CloudObject:this.valueType}ce(){return this.D}tm(){return this.ba}kd(a,b){return this.nc().kd(a,b)}tl(a){this.nc().tl(a)}Su(){return this.nc().Gd()}Ru(){return this.nc().N()}get(a){return this.nc().get(a)}ti(){return this.nc().ti()}ri(a){const b=
968
- this.nc();mm(b,'getCurrent');return b.ri(a)}has(a){return this.nc().has(a)}sh(a){const b=this.nc();mm(b,'hasCurrent');return b.sh(a)}qe(a){return this.nc().qe(a)}Cz(a){return this.qe(a).asObservable()}lf(a){const b=this.nc();mm(b,'getCurrentAt');return b.lf(a)}mf(a){return this.nc().mf(a)}Qf(a){const b=this.nc();mm(b,'getCurrentKeyAt');return b.Qf(a)}Id(a){return this.nc().Id(a)}Hz(a){return this.Id(a).asObservable()}Rf(a){const b=this.nc();mm(b,'getCurrentRank');return b.Rf(a)}Ic(){return this.nc().Ic()}Dz(){return this.Ic().asObservable()}Sf(){return this.nc().Sf()}Bf(){return this.nc().Bf()}Iz(){return this.Bf().asObservable()}wg(){const a=
969
- this.nc();mm(a,'getCurrentSize');return a.wg()}forEach(a,b){this.nc().forEach(a,b)}pe(a){const b=this.nc();mm(b,'forEachCurrentValue');return b.pe(a)}xj(a,b,c,d){a=new olympe.dc.ba.Nh(a,b);(new olympe.dc.Aa(this.D,[...this.ba,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.ba];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
970
- if(c instanceof olympe.dc.Sa.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.Rd(lm(b)||this.valueType||Object);return b}zl(a){return this.transform(new olympe.dc.ba.Kf(a))}filter(a){return this.transform(new olympe.dc.ba.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);
971
- let b=this.ba;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.ba;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.C.Qa(this.D)+a+')'}Qu(){return this.nc().Mg()}Wc(){return olympe.C.ua([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.xb(b+']')},olympe.C.Ta)}};olympe.dc.Aa.prototype.filter=olympe.dc.Aa.prototype.filter;olympe.dc.Aa.prototype.union=olympe.dc.Aa.prototype.zl;
972
- olympe.dc.Aa.prototype.transform=olympe.dc.Aa.prototype.transform;olympe.dc.Aa.prototype.forEachCurrentValue=olympe.dc.Aa.prototype.pe;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.Iz;olympe.dc.Aa.prototype.observeFirst=olympe.dc.Aa.prototype.Dz;olympe.dc.Aa.prototype.getCurrentRank=olympe.dc.Aa.prototype.Rf;olympe.dc.Aa.prototype.observeRank=olympe.dc.Aa.prototype.Hz;
973
- olympe.dc.Aa.prototype.getCurrentAt=olympe.dc.Aa.prototype.lf;olympe.dc.Aa.prototype.observeAt=olympe.dc.Aa.prototype.Cz;olympe.dc.Aa.prototype.offReady=olympe.dc.Aa.prototype.tl;olympe.dc.Aa.prototype.onReady=olympe.dc.Aa.prototype.kd;olympe.dc.Aa.prototype.getBaseTag=olympe.dc.Aa.prototype.ce;olympe.dc.Aa.za=[olympe.C.vd];m=olympe.dc.Aa.prototype;m.re.K=olympe.C.J.j;m.ob.K=olympe.C.J.H();m.nc.K=new olympe.C.J(()=>olympe.dc.kc.Subscription,[]);m.Rd.K=new olympe.C.J(()=>{},[]);
974
- m.ce.K=new olympe.C.J(()=>String,[]);m.tm.K=new olympe.C.J(()=>Array,[]);m.kd.K=new olympe.C.J(()=>String,[]);m.tl.K=new olympe.C.J(()=>{},[]);m.Su.K=olympe.C.J.N;m.Ru.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.ti.K=new olympe.C.J(()=>Array,[]);m.ri.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.sh.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.Qf.K=olympe.C.J.j;m.Id.K=olympe.C.J.F;
975
- m.Rf.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.Sf.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.pe.K=olympe.C.J.j;m.xj.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.Qu.K=olympe.C.J.j;m.Wc.K=olympe.C.J.D;const om={qA:'append',gm:'filter_not',up:'filter_and',vp:'filter_or'};function pm(a,b){a=qm(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.ab.po(a,b)).D}
976
- olympe.dc.rk=class{constructor(a,b){this.j=qm(a);this.G=olympe.ia.Za('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.ba=[];this.Ga=[];this.Bc=void 0}Yi(){const a=new olympe.dc.Aa(this.j,this.ba,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.Sa.Property)throw new rm('transform','Properties cannot be used as transformer, unlike relations '+
977
- d);if(!d||'function'!==typeof d.j)throw new rm('transform','one of the argument is not a Transformer '+d);const e=d.Nb();null!==e&&(this.valueType=e);this.ba.push(d)}return this}zl(a){this.ba.push(new olympe.dc.ba.Kf(a));return this}nA(a){this.ba.push(new olympe.dc.ba.Kf(qm(a)));return this}Uu(a){this.valueType=a;return this}fb(a){this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}Tx(a){for(const b of a)this.ba.push(b),this.valueType=b.Nb()||olympe.dc.CloudObject;return this}Sx(a,
968
+ this.nc();mm(b,'getCurrent');return b.ri(a)}has(a){return this.nc().has(a)}sh(a){const b=this.nc();mm(b,'hasCurrent');return b.sh(a)}qe(a){return this.nc().qe(a)}Cz(a){return this.qe(a).asObservable()}mf(a){const b=this.nc();mm(b,'getCurrentAt');return b.mf(a)}nf(a){return this.nc().nf(a)}Qf(a){const b=this.nc();mm(b,'getCurrentKeyAt');return b.Qf(a)}Id(a){return this.nc().Id(a)}Hz(a){return this.Id(a).asObservable()}Rf(a){const b=this.nc();mm(b,'getCurrentRank');return b.Rf(a)}Ic(){return this.nc().Ic()}Dz(){return this.Ic().asObservable()}Sf(){return this.nc().Sf()}Cf(){return this.nc().Cf()}Iz(){return this.Cf().asObservable()}xg(){const a=
969
+ this.nc();mm(a,'getCurrentSize');return a.xg()}forEach(a,b){this.nc().forEach(a,b)}pe(a){const b=this.nc();mm(b,'forEachCurrentValue');return b.pe(a)}wj(a,b,c,d){a=new olympe.dc.ba.Nh(a,b);(new olympe.dc.Aa(this.D,[...this.ba,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.ba];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
970
+ if(c instanceof olympe.dc.Sa.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.Rd(lm(b)||this.valueType||Object);return b}zl(a){return this.transform(new olympe.dc.ba.Lf(a))}filter(a){return this.transform(new olympe.dc.ba.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);
971
+ let b=this.ba;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.ba;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.C.Qa(this.D)+a+')'}Qu(){return this.nc().Mg()}Wc(){return olympe.C.ua([this.Cf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.mf(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.C.xb(b+']')},olympe.C.Ta)}};olympe.dc.Aa.prototype.filter=olympe.dc.Aa.prototype.filter;olympe.dc.Aa.prototype.union=olympe.dc.Aa.prototype.zl;
972
+ olympe.dc.Aa.prototype.transform=olympe.dc.Aa.prototype.transform;olympe.dc.Aa.prototype.forEachCurrentValue=olympe.dc.Aa.prototype.pe;olympe.dc.Aa.prototype.forEach=olympe.dc.Aa.prototype.forEach;olympe.dc.Aa.prototype.getCurrentSize=olympe.dc.Aa.prototype.xg;olympe.dc.Aa.prototype.observeSize=olympe.dc.Aa.prototype.Iz;olympe.dc.Aa.prototype.observeFirst=olympe.dc.Aa.prototype.Dz;olympe.dc.Aa.prototype.getCurrentRank=olympe.dc.Aa.prototype.Rf;olympe.dc.Aa.prototype.observeRank=olympe.dc.Aa.prototype.Hz;
973
+ olympe.dc.Aa.prototype.getCurrentAt=olympe.dc.Aa.prototype.mf;olympe.dc.Aa.prototype.observeAt=olympe.dc.Aa.prototype.Cz;olympe.dc.Aa.prototype.offReady=olympe.dc.Aa.prototype.tl;olympe.dc.Aa.prototype.onReady=olympe.dc.Aa.prototype.kd;olympe.dc.Aa.prototype.getBaseTag=olympe.dc.Aa.prototype.ce;olympe.dc.Aa.za=[olympe.C.vd];m=olympe.dc.Aa.prototype;m.re.K=olympe.C.J.j;m.ob.K=olympe.C.J.H();m.nc.K=new olympe.C.J(()=>olympe.dc.kc.Subscription,[]);m.Rd.K=new olympe.C.J(()=>{},[]);
974
+ m.ce.K=new olympe.C.J(()=>String,[]);m.tm.K=new olympe.C.J(()=>Array,[]);m.kd.K=new olympe.C.J(()=>String,[]);m.tl.K=new olympe.C.J(()=>{},[]);m.Su.K=olympe.C.J.N;m.Ru.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.ti.K=new olympe.C.J(()=>Array,[]);m.ri.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.sh.K=olympe.C.J.j;m.qe.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.mf.K=olympe.C.J.j;m.nf.K=new olympe.C.J(()=>String,[]);m.Qf.K=olympe.C.J.j;m.Id.K=olympe.C.J.F;
975
+ m.Rf.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.Sf.K=new olympe.C.J(()=>String,[]);m.Cf.K=olympe.C.J.F;m.xg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.pe.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.Qu.K=olympe.C.J.j;m.Wc.K=olympe.C.J.D;const om={qA:'append',gm:'filter_not',up:'filter_and',vp:'filter_or'};function pm(a,b){a=qm(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.bb.po(a,b)).D}
976
+ olympe.dc.rk=class{constructor(a,b){this.j=qm(a);this.G=olympe.ia.Ya('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.ba=[];this.Ga=[];this.Bc=void 0}Xi(){const a=new olympe.dc.Aa(this.j,this.ba,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.Sa.Property)throw new rm('transform','Properties cannot be used as transformer, unlike relations '+
977
+ d);if(!d||'function'!==typeof d.j)throw new rm('transform','one of the argument is not a Transformer '+d);const e=d.Nb();null!==e&&(this.valueType=e);this.ba.push(d)}return this}zl(a){this.ba.push(new olympe.dc.ba.Lf(a));return this}nA(a){this.ba.push(new olympe.dc.ba.Lf(qm(a)));return this}Uu(a){this.valueType=a;return this}fb(a){this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}Tx(a){for(const b of a)this.ba.push(b),this.valueType=b.Nb()||olympe.dc.CloudObject;return this}Sx(a,
978
978
  b,c){a=new olympe.dc.ba.Ke(a,a.La(),b,c);this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}Rx(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.X());void 0===c&&(c=e.La())}a=new olympe.dc.ba.tk(b,c);this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}Tu(){this.fb(olympe.dc.CloudObject.instancesRel);return this}hf(a){var b=this.Ga.pop();b===om.gm&&(a=new olympe.dc.Z.je(a),b=this.Ga.pop());switch(b){case om.up:b=this.ba.pop().D;b instanceof
979
- olympe.dc.Z.Od?(b=b.Z,b.push(a),a=new olympe.dc.Z.Od(...b)):a=new olympe.dc.Z.Od(b,a);b=this.Ga.pop();break;case om.vp:b=this.ba.pop().D,b instanceof olympe.dc.Z.Fe?(b=b.Z,b.push(a),a=new olympe.dc.Z.Fe(...b)):a=new olympe.dc.Z.Fe(b,a),b=this.Ga.pop()}b===om.gm&&(a=new olympe.dc.Z.je(a),this.Ga.pop());this.ba.push(new olympe.dc.ba.yf(a));return this}Nx(a,b,c){return this.hf(new olympe.dc.Z.Be(pm(a,c),new olympe.dc.ab.Xe(b)))}contains(a,b,c=!1,d){return this.hf(new olympe.dc.Z.xf(pm(a,d),new olympe.dc.ab.Xe(b),
980
- c))}Ob(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.hf(new olympe.dc.Z.Vi(b))}ol(a){return this.hf(new olympe.dc.Z.Be(new olympe.dc.ab.lj,new olympe.dc.ab.Xe(qm(a))))}Ox(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.Ad().ol(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().Ad().ol(a[b])}return this}az(a,b){if(!(a instanceof
981
- 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.hf(new olympe.dc.Z.Si(c,d,b))}nl(a,b,c){a=pm(a,c);return this.hf(new olympe.dc.Z.mk(a,new olympe.dc.ab.Xe(b)))}Oj(a,b,c){a=pm(a,c);return this.hf(new olympe.dc.Z.Rk(a,new olympe.dc.ab.Xe(b)))}sz(a,b,c,d){a=pm(a,d);return this.hf(new olympe.dc.Z.Gf(a,b,c))}filter(a){const b=new class extends olympe.dc.Z.Cg{j(c,d){return a(olympe.dc.CloudObject.get(d))}};
982
- return this.hf(b)}Ad(){this.Ga.push(om.gm);return this}and(){this.ba[this.ba.length-1]instanceof olympe.dc.ba.yf&&this.Ga.push(om.up);return this}or(){this.ba[this.ba.length-1]instanceof olympe.dc.ba.yf&&this.Ga.push(om.vp);return this}xl(a,b,c){a=qm(a);let d=null;switch(olympe.dc.ha().Jb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.X():d=new olympe.dc.xc.String(new olympe.dc.ab.kj(a,c));break;case olympe.dm.Number.O.X():d=new olympe.dc.xc.Number(new olympe.dc.ab.bj(a,c));break;case olympe.dm.DateTime.O.X():d=
983
- new olympe.dc.xc.DateTime(new olympe.dc.ab.Ki(a,c))}c=d;null!==c&&this.ba.push(new olympe.dc.ba.bh(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.xc.Cg{F(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.ba.push(new olympe.dc.ba.bh(d,c));return this}Jx(){this.ba.push(new olympe.dc.ba.Li);return this}Ij(a,b){this.ba.push(new olympe.dc.ba.Nh(a,b));return this}};class rm extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
984
- function qm(a){return'string'===typeof a||a instanceof olympe.C.Ta?a:'function'===typeof a?olympe.dc.na.ac(a):olympe.C.hb(a)?a.ei===olympe.C.Ta?a:olympe.C.ua([a],b=>olympe.C.xb(olympe.dc.fa(b)),olympe.C.Ta):a.X()}m=olympe.dc.rk.prototype;m.Yi.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.transform.K=olympe.C.J.H();m.zl.K=olympe.C.J.H();m.nA.K=olympe.C.J.H();m.Uu.K=olympe.C.J.H();m.fb.K=olympe.C.J.H();m.Tx.K=olympe.C.J.H();m.Sx.K=olympe.C.J.H();m.Rx.K=olympe.C.J.H();m.Tu.K=olympe.C.J.H();m.hf.K=olympe.C.J.H();
985
- m.Nx.K=olympe.C.J.H();m.contains.K=olympe.C.J.H();m.Ob.K=olympe.C.J.H();m.ol.K=olympe.C.J.H();m.Ox.K=olympe.C.J.H();m.az.K=olympe.C.J.H();m.nl.K=olympe.C.J.H();m.Oj.K=olympe.C.J.H();m.sz.K=olympe.C.J.H();m.filter.K=olympe.C.J.H();m.Ad.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.Jx.K=olympe.C.J.H();m.Ij.K=olympe.C.J.H();function nm(a,b,c){const d=b.ce();var e=new olympe.dc.query.Vv;let f;f=d;olympe.C.hb(f)&&(f=e.add(d));b=(b=b.tm())?Array.isArray(b)?b:[b]:null;e=olympe.dc.kc.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.kc.Subscription(e,d,b,a.F));k.getContext().run(()=>a.process(k,c));return k}
986
- 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.lc.Vr(a.db,a.G),d=b.T();olympe.C.Vc([b.ce()],e=>{const f=olympe.dc.fa(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.sg()||b.ni();Of(a.db,f,tm(a,b,c),d);olympe.C.Ya().Yd(()=>Mf(a.db,f,d));a.db.Ia(f.valueOf())||um(c);b.N()||(um(c),b.Pc([]))})}}
987
- function vm(a,b,c,d,e){const f=[b.ce()],g=l=>l instanceof olympe.dc.ba.Kf;let h;const k=(null!=(h=b.qh())?h:[]).filter(g);for(const l of k){f.push(l.ce());let n;k.push(...(null!=(n=l.qh())?n:[]).filter(g))}olympe.C.Vc(f,()=>{const l=b.le(c);wm(a,l,b.T(),d,e)})}
988
- 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.Ya(),g=new olympe.async.Dk(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;Bi(a.H,h,f,olympe.dc.Ha.SELF,olympe.dc.ma.oc.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}`))))})});ud(g,(h,k)=>d(k));g.start()}
989
- function tm(a,b,c){const d=new olympe.dc.lc.Vj;let e=!1;const f=olympe.C.Ya(),g=b.qh(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.jd()||f.gb()||(k?b.sh(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.Nd(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.re().zg(b.Pc.bind(b))),
979
+ olympe.dc.Z.Od?(b=b.Z,b.push(a),a=new olympe.dc.Z.Od(...b)):a=new olympe.dc.Z.Od(b,a);b=this.Ga.pop();break;case om.vp:b=this.ba.pop().D,b instanceof olympe.dc.Z.Fe?(b=b.Z,b.push(a),a=new olympe.dc.Z.Fe(...b)):a=new olympe.dc.Z.Fe(b,a),b=this.Ga.pop()}b===om.gm&&(a=new olympe.dc.Z.je(a),this.Ga.pop());this.ba.push(new olympe.dc.ba.zf(a));return this}Nx(a,b,c){return this.hf(new olympe.dc.Z.Be(pm(a,c),new olympe.dc.bb.Xe(b)))}contains(a,b,c=!1,d){return this.hf(new olympe.dc.Z.yf(pm(a,d),new olympe.dc.bb.Xe(b),
980
+ c))}Ob(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.hf(new olympe.dc.Z.Ui(b))}ol(a){return this.hf(new olympe.dc.Z.Be(new olympe.dc.bb.kj,new olympe.dc.bb.Xe(qm(a))))}Ox(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.Ad().ol(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().Ad().ol(a[b])}return this}az(a,b){if(!(a instanceof
981
+ 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.hf(new olympe.dc.Z.Ri(c,d,b))}nl(a,b,c){a=pm(a,c);return this.hf(new olympe.dc.Z.mk(a,new olympe.dc.bb.Xe(b)))}Oj(a,b,c){a=pm(a,c);return this.hf(new olympe.dc.Z.Rk(a,new olympe.dc.bb.Xe(b)))}sz(a,b,c,d){a=pm(a,d);return this.hf(new olympe.dc.Z.Hf(a,b,c))}filter(a){const b=new class extends olympe.dc.Z.Cg{j(c,d){return a(olympe.dc.CloudObject.get(d))}};
982
+ return this.hf(b)}Ad(){this.Ga.push(om.gm);return this}and(){this.ba[this.ba.length-1]instanceof olympe.dc.ba.zf&&this.Ga.push(om.up);return this}or(){this.ba[this.ba.length-1]instanceof olympe.dc.ba.zf&&this.Ga.push(om.vp);return this}xl(a,b,c){a=qm(a);let d=null;switch(olympe.dc.ha().Jb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.X():d=new olympe.dc.xc.String(new olympe.dc.bb.jj(a,c));break;case olympe.dm.Number.O.X():d=new olympe.dc.xc.Number(new olympe.dc.bb.aj(a,c));break;case olympe.dm.DateTime.O.X():d=
983
+ new olympe.dc.xc.DateTime(new olympe.dc.bb.Ji(a,c))}c=d;null!==c&&this.ba.push(new olympe.dc.ba.bh(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.xc.Cg{F(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.ba.push(new olympe.dc.ba.bh(d,c));return this}Jx(){this.ba.push(new olympe.dc.ba.Ki);return this}Hj(a,b){this.ba.push(new olympe.dc.ba.Nh(a,b));return this}};class rm extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
984
+ function qm(a){return'string'===typeof a||a instanceof olympe.C.Ta?a:'function'===typeof a?olympe.dc.na.ac(a):olympe.C.hb(a)?a.ei===olympe.C.Ta?a:olympe.C.ua([a],b=>olympe.C.xb(olympe.dc.fa(b)),olympe.C.Ta):a.X()}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.nA.K=olympe.C.J.H();m.Uu.K=olympe.C.J.H();m.fb.K=olympe.C.J.H();m.Tx.K=olympe.C.J.H();m.Sx.K=olympe.C.J.H();m.Rx.K=olympe.C.J.H();m.Tu.K=olympe.C.J.H();m.hf.K=olympe.C.J.H();
985
+ m.Nx.K=olympe.C.J.H();m.contains.K=olympe.C.J.H();m.Ob.K=olympe.C.J.H();m.ol.K=olympe.C.J.H();m.Ox.K=olympe.C.J.H();m.az.K=olympe.C.J.H();m.nl.K=olympe.C.J.H();m.Oj.K=olympe.C.J.H();m.sz.K=olympe.C.J.H();m.filter.K=olympe.C.J.H();m.Ad.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.Jx.K=olympe.C.J.H();m.Hj.K=olympe.C.J.H();function nm(a,b,c){const d=b.ce();var e=new olympe.dc.query.Vv;let f;f=d;olympe.C.hb(f)&&(f=e.add(d));b=(b=b.tm())?Array.isArray(b)?b:[b]:null;e=olympe.dc.kc.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.kc.Subscription(e,d,b,a.F));k.getContext().run(()=>a.process(k,c));return k}
986
+ 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.lc.Vr(a.db,a.G),d=b.T();olympe.C.Vc([b.ce()],e=>{const f=olympe.dc.fa(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.tg()||b.ni();Of(a.db,f,tm(a,b,c),d);olympe.C.$a().Yd(()=>Mf(a.db,f,d));a.db.Ja(f.valueOf())||um(c);b.N()||(um(c),b.Pc([]))})}}
987
+ function vm(a,b,c,d,e){const f=[b.ce()],g=l=>l instanceof olympe.dc.ba.Lf;let h;const k=(null!=(h=b.qh())?h:[]).filter(g);for(const l of k){f.push(l.ce());let n;k.push(...(null!=(n=l.qh())?n:[]).filter(g))}olympe.C.Vc(f,()=>{const l=b.le(c);wm(a,l,b.T(),d,e)})}
988
+ 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.$a(),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.ma.oc.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}`))))})});ud(g,(h,k)=>d(k));g.start()}
989
+ function tm(a,b,c){const d=new olympe.dc.lc.Vj;let e=!1;const f=olympe.C.$a(),g=b.qh(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.jd()||f.gb()||(k?b.sh(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.Nd(n,l)):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Removing Instance',l,'from the subscription'),b.ug(n)),e||(xm(c,()=>{p.pg();um(c)}),f.run(()=>p.re().Ag(b.Pc.bind(b))),
990
990
  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))}}
991
- olympe.dc.kc.uv=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.kc.Cw(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.ff(),b||this.D&&d===olympe.dc.Ha.SERVER||d===olympe.dc.Ha.SELF?(this.G.debug('QueryMGR: [ID:',c,'] - Local subscription, no need for coverage check, booting subscription '),
991
+ olympe.dc.kc.uv=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.kc.Cw(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.ff(),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 '),
992
992
  sm(this,a)):vm(this,a,d,e=>{e?this.G.error(e):sm(this,a)},b))}};function Bm(a){return olympe.C.hb(a)?'Node#'+a.Ca.T():String(a)}function Cm(a,b){return olympe.C.hb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
993
993
  olympe.dc.query.Vv=class{constructor(){this.j=0;this.values=null}add(a){let b;b=olympe.C.hb(a)?'n'+a.Ca.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.Ba=class{la(){}j(){}D(){}ga(){}toString(){}};olympe.dc.kc.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.wd=c;this.ba=d||null;this.state=this.H.run(()=>olympe.C.ge(olympe.dc.kc.Subscription.j.INIT));this.Gc=!1;this.Y=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].ga(d);else e+='|null';e=olympe.V.ub(e)}catch(f){e=olympe.V.Kc()}return e}T(){return this.id}ce(){return this.wd}qh(){return this.ba}ff(){const b=
994
- olympe.dc.fe(),c=olympe.C.Qa(this.ce());let d;return olympe.dc.CloudObject.instancesRel.Fa(null==(d=this.ba)?void 0:d[0])?b.fromModel(c):b.Qe(c)}sg(){const b=olympe.C.Qa(this.state);return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.Pr}ni(){if(this.state.Ca.gb())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);lc(this.state,olympe.C.ge(olympe.dc.kc.Subscription.j.Pr))}Gd(){return olympe.C.ua([this.state],
995
- ()=>{},olympe.C.da)}N(){const b=this.state.Ca.Fb;return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.Wh}kd(b,c){this.N()?b(this):(null===this.Y&&(this.Y=new Map),void 0===c&&(c=olympe.V.Kc()),this.Y.set(c,olympe.C.Ya().tc(b)));return c||''}tl(b){null!==this.Y&&b&&this.Y.delete(b)}Eb(){const b=olympe.dc.kc.Subscription.j.Wh;if(!this.state.Ca.gb()&&olympe.C.Qa(this.state)!==b&&(this.Mf(),lc(this.state,b),null!==this.Y)){for(const c of this.Y.values())c(this);this.Y=null}}onDestroy(b){this.H.onDestroy(b)}release(){this.H.destroy()}Pc(b){if(!this.state.Ca.gb()){for(let c=
996
- 0,d=b.length;c<d;c++)this.hn(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.Eb()}}}Nd(b,c){if(!this.state.Ca.gb()&&(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.Eb()}}tg(b){this.state.Ca.gb()||
997
- (this.gn(b),this.qj(b,!this.N()))}Mg(){return this.N()?super.Mg():'Subscription is not ready!'}le(b){const c=olympe.C.Qa(this.ce());return olympe.dc.kc.Subscription.D(c,b,this.qh())}static D(b,c,d){var e=olympe.dc.ma.from(b,c).ne();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.ba.af){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.fb(h,!0))}else if(e instanceof olympe.dc.ba.Ke){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.ug(h,
998
- !0,!0))}else if(e instanceof olympe.dc.ba.Kf)e=a.D(olympe.C.Qa(e.ce()),c,e.qh()),b.push(...e);else if(e instanceof olympe.dc.ba.yf||e instanceof olympe.dc.ba.bh){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.fb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.kc.Subscription.j={INIT:0,Pr:1,Wh:2};olympe.dc.kc.Subscription.prototype.Mg.K=olympe.C.J.j;function Am(a){const b=a.D;a.D=!0;return b}olympe.dc.kc.Cw=class{constructor(a){this.counter=0;this.D=!1;this.j=a}};olympe.dc.Jf=class{la(){}Nb(){}j(){}ga(){}toString(){}};olympe.dc.gr=class{F(){}};olympe.dc.Yk=class{la(){}getValue(){}j(){}ga(){}toString(){}};olympe.dc.xc={};let Dm=0;olympe.dc.xc.Cg=class{constructor(){this.id=Dm++}la(){return'CustomLocalComparator#'+Dm}H(){return[]}F(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.xc.Cg.za=[olympe.dc.wf];olympe.dc.xc.DateTime=class{constructor(a){this.j=a}la(){return Q(olympe.dc.xc.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}ga(a){return'{"c":"'+this.la()+'",a:['+this.j.ga(a)+']}'}toString(){return'Number('+this.j.toString()+')'}};P('olympe.dc.comparators.DateTime',olympe.dc.xc.DateTime);olympe.dc.xc.DateTime.za=[olympe.dc.wf];olympe.dc.xc.Number=class{constructor(a){this.j=a}la(){return Q(olympe.dc.xc.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}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`Number(${this.j.toString()})`}};P('olympe.dc.comparators.Number',olympe.dc.xc.Number);olympe.dc.xc.Number.za=[olympe.dc.wf];olympe.dc.xc.String=class{constructor(a){this.j=a}la(){return Q(olympe.dc.xc.String)}H(){return this.j.j()}F(a,b){return olympe.C.ua([this.j.getValue(a,b)],c=>c.toLowerCase(),olympe.C.Ta)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`String(${this.j.toString()})`}};P('olympe.dc.comparators.String',olympe.dc.xc.String);olympe.dc.xc.String.za=[olympe.dc.wf];olympe.dc.Z={};let Em=0;olympe.dc.Z.Cg=class{constructor(){this.id=Em++}la(){return'CustomLocalPredicate#'+this.id}D(){return[]}j(){throw Error('Test function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.Z.Cg.za=[olympe.dc.Ba];olympe.dc.Z.El=class{constructor(a,b){this.F=a;this.H=b}la(){}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ua([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.C.Sb(this.N('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.C.da))}N(){}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.H.ga(a)+']}'}toString(){return this.la().replace(/^.+\./,'')+'('+this.F.toString()+','+this.H.toString()+')'}};
994
+ olympe.dc.fe(),c=olympe.C.Qa(this.ce());let d;return olympe.dc.CloudObject.instancesRel.Fa(null==(d=this.ba)?void 0:d[0])?b.fromModel(c):b.Qe(c)}tg(){const b=olympe.C.Qa(this.state);return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.Pr}ni(){if(this.state.Ca.gb())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);lc(this.state,olympe.C.ge(olympe.dc.kc.Subscription.j.Pr))}Gd(){return olympe.C.ua([this.state],
995
+ ()=>{},olympe.C.da)}N(){const b=this.state.Ca.Fb;return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.Wh}kd(b,c){this.N()?b(this):(null===this.Y&&(this.Y=new Map),void 0===c&&(c=olympe.V.Kc()),this.Y.set(c,olympe.C.$a().tc(b)));return c||''}tl(b){null!==this.Y&&b&&this.Y.delete(b)}Eb(){const b=olympe.dc.kc.Subscription.j.Wh;if(!this.state.Ca.gb()&&olympe.C.Qa(this.state)!==b&&(this.Nf(),lc(this.state,b),null!==this.Y)){for(const c of this.Y.values())c(this);this.Y=null}}onDestroy(b){this.H.onDestroy(b)}release(){this.H.destroy()}Pc(b){if(!this.state.Ca.gb()){for(let c=
996
+ 0,d=b.length;c<d;c++)this.hn(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.Eb()}}}Nd(b,c){if(!this.state.Ca.gb()&&(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.Eb()}}ug(b){this.state.Ca.gb()||
997
+ (this.gn(b),this.pj(b,!this.N()))}Mg(){return this.N()?super.Mg():'Subscription is not ready!'}le(b){const c=olympe.C.Qa(this.ce());return olympe.dc.kc.Subscription.D(c,b,this.qh())}static D(b,c,d){var e=olympe.dc.ma.from(b,c).ne();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.ba.af){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.fb(h,!0))}else if(e instanceof olympe.dc.ba.Ke){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.vg(h,
998
+ !0,!0))}else if(e instanceof olympe.dc.ba.Lf)e=a.D(olympe.C.Qa(e.ce()),c,e.qh()),b.push(...e);else if(e instanceof olympe.dc.ba.zf||e instanceof olympe.dc.ba.bh){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.vg(n,!0,!0):k.fb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.kc.Subscription.j={INIT:0,Pr:1,Wh:2};olympe.dc.kc.Subscription.prototype.Mg.K=olympe.C.J.j;function Am(a){const b=a.D;a.D=!0;return b}olympe.dc.kc.Cw=class{constructor(a){this.counter=0;this.D=!1;this.j=a}};olympe.dc.Kf=class{la(){}Nb(){}j(){}ga(){}toString(){}};olympe.dc.gr=class{F(){}};olympe.dc.Yk=class{la(){}getValue(){}j(){}ga(){}toString(){}};olympe.dc.xc={};let Dm=0;olympe.dc.xc.Cg=class{constructor(){this.id=Dm++}la(){return'CustomLocalComparator#'+Dm}H(){return[]}F(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.xc.Cg.za=[olympe.dc.xf];olympe.dc.xc.DateTime=class{constructor(a){this.j=a}la(){return Q(olympe.dc.xc.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}ga(a){return'{"c":"'+this.la()+'",a:['+this.j.ga(a)+']}'}toString(){return'Number('+this.j.toString()+')'}};P('olympe.dc.comparators.DateTime',olympe.dc.xc.DateTime);olympe.dc.xc.DateTime.za=[olympe.dc.xf];olympe.dc.xc.Number=class{constructor(a){this.j=a}la(){return Q(olympe.dc.xc.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}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`Number(${this.j.toString()})`}};P('olympe.dc.comparators.Number',olympe.dc.xc.Number);olympe.dc.xc.Number.za=[olympe.dc.xf];olympe.dc.xc.String=class{constructor(a){this.j=a}la(){return Q(olympe.dc.xc.String)}H(){return this.j.j()}F(a,b){return olympe.C.ua([this.j.getValue(a,b)],c=>c.toLowerCase(),olympe.C.Ta)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`String(${this.j.toString()})`}};P('olympe.dc.comparators.String',olympe.dc.xc.String);olympe.dc.xc.String.za=[olympe.dc.xf];olympe.dc.Z={};let Em=0;olympe.dc.Z.Cg=class{constructor(){this.id=Em++}la(){return'CustomLocalPredicate#'+this.id}D(){return[]}j(){throw Error('Test function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.Z.Cg.za=[olympe.dc.Ba];olympe.dc.Z.El=class{constructor(a,b){this.F=a;this.H=b}la(){}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ua([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.C.Sb(this.N('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.C.da))}N(){}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.H.ga(a)+']}'}toString(){return this.la().replace(/^.+\./,'')+'('+this.F.toString()+','+this.H.toString()+')'}};
999
999
  olympe.dc.Z.El.za=[olympe.dc.Ba];olympe.dc.Z.Od=class{constructor(a){this.Z=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Z=this.Z.concat(arguments[c]):this.Z.push(arguments[c])}la(){return Q(olympe.dc.Z.Od)}D(){return this.Z.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ua(this.Z.map(c=>c.j(a,b)),(...c)=>olympe.C.Sb(c.every(d=>d.valueOf())),olympe.C.da))}ga(a){const b=this.Z.map(c=>c.ga(a));return'{"c":"'+this.la()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.Z.map(a=>
1000
1000
  a.toString()).join(',')+')'}};P('olympe.dc.predicates.And',olympe.dc.Z.Od);olympe.dc.Z.Od.za=[olympe.dc.Ba];olympe.dc.Z.Kl=class{constructor(a,b){this.F=a;this.value=b}j(a,b){return a.run(()=>olympe.C.ua([this.F,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.C.Sb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.C.da))}la(){return Q(olympe.dc.Z.Kl)}D(){return[this.value.j()]}ga(a){const b=olympe.C.hb(this.F)?this.F.Ca.Fb.valueOf():this.F.valueOf();return'{"c":"'+this.la()+'","a":['+b+','+this.value.ga(a)+']}'}toString(){const a=olympe.C.hb(this.F)?this.F.Ca.Fb.valueOf():this.F.valueOf();
1001
- return this.la().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};P('olympe.dc.predicates.BitMask',olympe.dc.Z.Kl);olympe.dc.Z.Kl.za=[olympe.dc.Ba];olympe.dc.Z.xf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}la(){return Q(olympe.dc.Z.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.ua([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.Sb(c.includes(d))},olympe.C.da))}ga(a){const b=this.source.ga(a),c=this.value.ga(a);a=Cm(a,this.F);
1002
- return'{"c":"'+this.la()+'","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.Z.xf);olympe.dc.Z.xf.za=[olympe.dc.Ba];olympe.dc.Z.Be=class{constructor(a,b){this.F=a;this.H=b}la(){return Q(olympe.dc.Z.Be)}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ua([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Kd?c.Kd(d):'object'===typeof d&&void 0!==d.Kd?d.Kd(c):olympe.C.Sb(c.valueOf()===d.valueOf()),olympe.C.da,'Test equal predicate'))}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.H.ga(a)+']}'}toString(){return'Equals('+this.F.toString()+','+this.H.toString()+
1003
- ')'}};P('olympe.dc.predicates.Equals',olympe.dc.Z.Be);olympe.dc.Z.Be.za=[olympe.dc.Ba];olympe.dc.Z.ju=class extends olympe.dc.Z.Be{constructor(a,b){super(a,new olympe.dc.ab.Xe(b))}};olympe.dc.Z.ju.za=[olympe.dc.Ba];olympe.dc.Z.mk=class extends olympe.dc.Z.El{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.mk)}N(a,b){return a>b}};P('olympe.dc.predicates.Greater',olympe.dc.Z.mk);olympe.dc.Z.Si=class{constructor(a,b,c){this.pb=[];this.F=c instanceof Array?c:void 0!==c?[olympe.dc.fa(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.ba.Ke?this.pb.push(new Fm(c.X(),c.La(),c.F,c.D)):this.pb.push(new Fm(olympe.dc.fa(c),b[d],1,1))}la(){return Q(olympe.dc.Z.Si)}D(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>mc(olympe.C.cc(Boolean),!1)),d=olympe.V.Kc(),e=olympe.dc.ha();let f=0;a=(h,k)=>{0!==this.F.length&&!this.F.includes(k)||
1004
- c.getContext().gb()||c.getContext().jd()||(f+=h?1:-1,c.update(0<f))};const g=this.pb;for(let h=g.length-1;0<=h;h--)a=Gm(g[h],e,a,d+h);Of(e,b,a,d);c.getContext().onDestroy(()=>{Mf(e,b,d)});return c.tb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.pb.map(a=>a.ga()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.pb.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelated',olympe.dc.Z.Si);
1005
- function Gm(a,b,c,d){const e=Object.create(null);d+=olympe.V.oi();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}ga(){return`${this.X()}, ${this.La()}, ${this.D}, ${this.j}`}}olympe.dc.Z.Si.za=[olympe.dc.Ba];olympe.dc.Z.nm=class{constructor(a,b,c){this.pb=[];this.F=void 0!==c?c.map(olympe.dc.fa):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.ba.Ke?this.pb.push(new Hm(c.X(),c.La(),c.F,c.D)):this.pb.push(new Hm(olympe.dc.fa(c),b[d],1,1))}la(){return Q(olympe.dc.Z.nm)}D(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>mc(olympe.C.cc(Boolean),!1)),d=olympe.dc.ha(),e=olympe.V.oi();let f=(k,l,n)=>{l&&(null===this.F||this.F.includes(n))&&k(1)};
1001
+ return this.la().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};P('olympe.dc.predicates.BitMask',olympe.dc.Z.Kl);olympe.dc.Z.Kl.za=[olympe.dc.Ba];olympe.dc.Z.yf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}la(){return Q(olympe.dc.Z.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.ua([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.Sb(c.includes(d))},olympe.C.da))}ga(a){const b=this.source.ga(a),c=this.value.ga(a);a=Cm(a,this.F);
1002
+ return'{"c":"'+this.la()+'","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.Z.yf);olympe.dc.Z.yf.za=[olympe.dc.Ba];olympe.dc.Z.Be=class{constructor(a,b){this.F=a;this.H=b}la(){return Q(olympe.dc.Z.Be)}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ua([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Kd?c.Kd(d):'object'===typeof d&&void 0!==d.Kd?d.Kd(c):olympe.C.Sb(c.valueOf()===d.valueOf()),olympe.C.da,'Test equal predicate'))}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.H.ga(a)+']}'}toString(){return'Equals('+this.F.toString()+','+this.H.toString()+
1003
+ ')'}};P('olympe.dc.predicates.Equals',olympe.dc.Z.Be);olympe.dc.Z.Be.za=[olympe.dc.Ba];olympe.dc.Z.ju=class extends olympe.dc.Z.Be{constructor(a,b){super(a,new olympe.dc.bb.Xe(b))}};olympe.dc.Z.ju.za=[olympe.dc.Ba];olympe.dc.Z.mk=class extends olympe.dc.Z.El{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.mk)}N(a,b){return a>b}};P('olympe.dc.predicates.Greater',olympe.dc.Z.mk);olympe.dc.Z.Ri=class{constructor(a,b,c){this.pb=[];this.F=c instanceof Array?c:void 0!==c?[olympe.dc.fa(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.ba.Ke?this.pb.push(new Fm(c.X(),c.La(),c.F,c.D)):this.pb.push(new Fm(olympe.dc.fa(c),b[d],1,1))}la(){return Q(olympe.dc.Z.Ri)}D(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>mc(olympe.C.cc(Boolean),!1)),d=olympe.V.Kc(),e=olympe.dc.ha();let f=0;a=(h,k)=>{0!==this.F.length&&!this.F.includes(k)||
1004
+ c.getContext().gb()||c.getContext().jd()||(f+=h?1:-1,c.update(0<f))};const g=this.pb;for(let h=g.length-1;0<=h;h--)a=Gm(g[h],e,a,d+h);Of(e,b,a,d);c.getContext().onDestroy(()=>{Mf(e,b,d)});return c.tb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.pb.map(a=>a.ga()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.pb.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelated',olympe.dc.Z.Ri);
1005
+ function Gm(a,b,c,d){const e=Object.create(null);d+=olympe.V.oi();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}ga(){return`${this.X()}, ${this.La()}, ${this.D}, ${this.j}`}}olympe.dc.Z.Ri.za=[olympe.dc.Ba];olympe.dc.Z.nm=class{constructor(a,b,c){this.pb=[];this.F=void 0!==c?c.map(olympe.dc.fa):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.ba.Ke?this.pb.push(new Hm(c.X(),c.La(),c.F,c.D)):this.pb.push(new Hm(olympe.dc.fa(c),b[d],1,1))}la(){return Q(olympe.dc.Z.nm)}D(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>mc(olympe.C.cc(Boolean),!1)),d=olympe.dc.ha(),e=olympe.V.oi();let f=(k,l,n)=>{l&&(null===this.F||this.F.includes(n))&&k(1)};
1006
1006
  const g=this.pb;for(let k=g.length-1;0<=k;k--)f=Im(g[k],d,f,e+k);let h=0;Of(d,b,f.bind(null,k=>{c.getContext().jd()||c.getContext().gb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>Mf(d,b,e));return c.tb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.pb.map(a=>a.ga()))+(null!==this.F?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.F?'#['+this.F.toString()+'], ':'')+this.pb.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelatedTree',olympe.dc.Z.nm);
1007
1007
  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.V.oi();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=>
1008
- {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}ga(){return`${this.X()}, ${this.La()}, ${this.D}, ${this.j}`}}olympe.dc.Z.nm.za=[olympe.dc.Ba];olympe.dc.Z.Vi=class{constructor(a){this.F=new Set;a instanceof Array?a.forEach(b=>{this.F.add(olympe.dc.fa(b))}):this.F.add(olympe.dc.fa(a))}la(){return Q(olympe.dc.Z.Vi)}D(){return[]}j(a,b){const c=a.run(()=>mc(olympe.C.cc(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.fa(olympe.dc.CloudObject))c.update(olympe.C.Sb(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})`);
1008
+ {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}ga(){return`${this.X()}, ${this.La()}, ${this.D}, ${this.j}`}}olympe.dc.Z.nm.za=[olympe.dc.Ba];olympe.dc.Z.Ui=class{constructor(a){this.F=new Set;a instanceof Array?a.forEach(b=>{this.F.add(olympe.dc.fa(b))}):this.F.add(olympe.dc.fa(a))}la(){return Q(olympe.dc.Z.Ui)}D(){return[]}j(a,b){const c=a.run(()=>mc(olympe.C.cc(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.fa(olympe.dc.CloudObject))c.update(olympe.C.Sb(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})`);
1009
1009
  this.F.has(k)?(c.update(olympe.C.da.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()}ga(){return'{"c":"'+this.la()+'","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.V.oi()}}
1010
- P('olympe.dc.predicates.InstanceOf',olympe.dc.Z.Vi);olympe.dc.Z.Vi.za=[olympe.dc.Ba];olympe.dc.Z.je=class{constructor(a){this.F=a}la(){return Q(olympe.dc.Z.je)}D(){return this.F.D()}j(a,b){return a.run(()=>olympe.C.ua([this.F.j(a,b)],c=>olympe.C.Sb(!c.valueOf()),olympe.C.da))}ga(a){return`{"c":"${this.la()}","a":[${this.F.ga(a)}]}`}toString(){return'Not('+this.F.toString()+')'}};P('olympe.dc.predicates.Not',olympe.dc.Z.je);olympe.dc.Z.je.za=[olympe.dc.Ba];olympe.dc.Z.Fe=class{constructor(a){this.Z=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Z=this.Z.concat(arguments[c]):this.Z.push(arguments[c])}la(){return Q(olympe.dc.Z.Fe)}D(){return this.Z.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ua(this.Z.map(c=>c.j(a,b)),(...c)=>olympe.C.Sb(c.some(d=>d.valueOf())),olympe.C.da))}ga(a){const b=this.Z.map(c=>c.ga(a));return'{"c":"'+this.la()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.Z.map(a=>a.toString()).join(',')+
1011
- ')'}};P('olympe.dc.predicates.Or',olympe.dc.Z.Fe);olympe.dc.Z.Fe.za=[olympe.dc.Ba];olympe.dc.Z.Gf=class{constructor(a,b,c){this.source=a;this.H=b;this.F=void 0===c?!0:c}la(){return Q(olympe.dc.Z.Gf)}D(){return[this.source.j()]}jb(){return this.source}j(a,b){return a.run(()=>olympe.C.ua([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.Sb((new RegExp(d)).test(c))},olympe.C.da))}ga(a){const b=this.source.ga(a),c=Cm(a,this.H);a=Cm(a,this.F);return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+
1012
- ']}'}toString(){const a=Bm(this.F);return'Regex('+this.source.toString()+','+this.H+','+a+')'}};P('olympe.dc.predicates.Regex',olympe.dc.Z.Gf);olympe.dc.Z.Gf.za=[olympe.dc.Ba];olympe.dc.Z.Rk=class extends olympe.dc.Z.El{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.Rk)}N(a,b){return a<b}};P('olympe.dc.predicates.Smaller',olympe.dc.Z.Rk);olympe.dc.lc={};olympe.dc.lc.Vj=class{constructor(){this.$=this.H=this.R=this.D=null}N(){return null!==this.D}Y(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.lc.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.$){const a=[];null!==this.H&&
1013
- (0<=this.D?Km(Lm(this.H,this.D),a):a.push(this.R));this.$(a)}}zg(a){this.$=a}};olympe.dc.lc.Vj.za=[olympe.dc.lc.Ua];function zm(a,b,c,d){b?a.N[d]=c:delete a.N[d];null===a.D&&(a.D=new olympe.dc.lc.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.lc.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}og(){this.j.N()?this.j.F():this.j.Y(this.depth-1)}};class Mm extends olympe.dc.lc.gk{constructor(a,b,c){super(a);this.R=b;this.tag=c;this.$=this.Y=this.H=!1;this.F=null}}
1010
+ P('olympe.dc.predicates.InstanceOf',olympe.dc.Z.Ui);olympe.dc.Z.Ui.za=[olympe.dc.Ba];olympe.dc.Z.je=class{constructor(a){this.F=a}la(){return Q(olympe.dc.Z.je)}D(){return this.F.D()}j(a,b){return a.run(()=>olympe.C.ua([this.F.j(a,b)],c=>olympe.C.Sb(!c.valueOf()),olympe.C.da))}ga(a){return`{"c":"${this.la()}","a":[${this.F.ga(a)}]}`}toString(){return'Not('+this.F.toString()+')'}};P('olympe.dc.predicates.Not',olympe.dc.Z.je);olympe.dc.Z.je.za=[olympe.dc.Ba];olympe.dc.Z.Fe=class{constructor(a){this.Z=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Z=this.Z.concat(arguments[c]):this.Z.push(arguments[c])}la(){return Q(olympe.dc.Z.Fe)}D(){return this.Z.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ua(this.Z.map(c=>c.j(a,b)),(...c)=>olympe.C.Sb(c.some(d=>d.valueOf())),olympe.C.da))}ga(a){const b=this.Z.map(c=>c.ga(a));return'{"c":"'+this.la()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.Z.map(a=>a.toString()).join(',')+
1011
+ ')'}};P('olympe.dc.predicates.Or',olympe.dc.Z.Fe);olympe.dc.Z.Fe.za=[olympe.dc.Ba];olympe.dc.Z.Hf=class{constructor(a,b,c){this.source=a;this.H=b;this.F=void 0===c?!0:c}la(){return Q(olympe.dc.Z.Hf)}D(){return[this.source.j()]}jb(){return this.source}j(a,b){return a.run(()=>olympe.C.ua([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.Sb((new RegExp(d)).test(c))},olympe.C.da))}ga(a){const b=this.source.ga(a),c=Cm(a,this.H);a=Cm(a,this.F);return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+
1012
+ ']}'}toString(){const a=Bm(this.F);return'Regex('+this.source.toString()+','+this.H+','+a+')'}};P('olympe.dc.predicates.Regex',olympe.dc.Z.Hf);olympe.dc.Z.Hf.za=[olympe.dc.Ba];olympe.dc.Z.Rk=class extends olympe.dc.Z.El{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.Rk)}N(a,b){return a<b}};P('olympe.dc.predicates.Smaller',olympe.dc.Z.Rk);olympe.dc.lc={};olympe.dc.lc.Vj=class{constructor(){this.$=this.H=this.R=this.D=null}N(){return null!==this.D}Y(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.lc.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.$){const a=[];null!==this.H&&
1013
+ (0<=this.D?Km(Lm(this.H,this.D),a):a.push(this.R));this.$(a)}}Ag(a){this.$=a}};olympe.dc.lc.Vj.za=[olympe.dc.lc.Ua];function zm(a,b,c,d){b?a.N[d]=c:delete a.N[d];null===a.D&&(a.D=new olympe.dc.lc.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.lc.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.Y(this.depth-1)}};class Mm extends olympe.dc.lc.gk{constructor(a,b,c){super(a);this.R=b;this.tag=c;this.$=this.Y=this.H=!1;this.F=null}}
1014
1014
  function Nm(a,b,c,d,e){const f=Object.create(null),g=a.ja,h=a.H;let k,l,n;a.ea=!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.Y&&(c.F=null,delete h[k]),delete f[k]);a.ea=!1;null!==a.D&&a.F()}
1015
1015
  olympe.dc.lc.zm=class{constructor(){this.H={};this.ja=[];this.D=null;this.ea=!1;this.R=[];this.$=null}N(){return null!==this.D}Y(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.ea){var a=this.ja,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.$){var f=e,g=this.D;f.$=!0;f.F=Lm(f,g)}null!==
1016
- e.F&&Km(e.F,this.R)}}this.$&&this.$(this.R)}}zg(a){this.$=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.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.lc.zm.za=[olympe.dc.lc.Ua];olympe.dc.lc.Ua=class{constructor(){}j(){}N(){}Y(){}F(){}zg(){}};function Om(a,b){olympe.C.pf(a.value)?(a.node=olympe.C.Rn(a.value,b),Tb(a.node)||b()):b()}function Pm(a,b){if(olympe.C.pf(a.value)){const c=olympe.C.Ya(),d=a.H;olympe.C.Vc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>Om(a,b)),olympe.C.Ya().destroy())})}}
1016
+ e.F&&Km(e.F,this.R)}}this.$&&this.$(this.R)}}Ag(a){this.$=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.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.lc.zm.za=[olympe.dc.lc.Ua];olympe.dc.lc.Ua=class{constructor(){}j(){}N(){}Y(){}F(){}Ag(){}};function Om(a,b){olympe.C.qf(a.value)?(a.node=olympe.C.Rn(a.value,b),Tb(a.node)||b()):b()}function Pm(a,b){if(olympe.C.qf(a.value)){const c=olympe.C.$a(),d=a.H;olympe.C.Vc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>Om(a,b)),olympe.C.$a().destroy())})}}
1017
1017
  class Qm extends olympe.dc.lc.gk{constructor(a,b,c){super(a);this.Y=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}gb(){return null===this.value}}
1018
1018
  function Rm(a,b){if(!b.gb()){var c=a.D;var d=a.ja,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()}}}
1019
1019
  function Sm(a){const b=a.ja;a.D.sort((c,d)=>b(c.Qa(),d.Qa()))}
1020
1020
  olympe.dc.lc.Tr=class{constructor(a){this.ja=a;this.H=null;this.D=[];this.R=[];this.$=null;this.ea=new Map}j(a,b,c,d){b='$'+c;const e=this.D;let f;if(a)f=new Qm(this,c,d),this.ea.set(b,f),this.N()?Om(f,()=>Rm(this,f)):(f.position=e.length,e.push(f));else{f=this.ea.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ea.delete(b);null!==f.position&&(this.N()?this.remove(f):delete e[f.position]);f.destroy()}return f}N(){return null!==this.H}Y(a){if(null!==this.H)throw Error('Manager already activated (depth='+
1021
- 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.Y):e.F&&Km(e.F,this.R)}this.$&&this.$(this.R)}zg(a){this.$=a}remove(a){const b=this.D,c=b.length-1;if(null!==a.position){for(a=a.position;a<
1022
- c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.lc.Tr.za=[olympe.dc.lc.Ua];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=vh(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.va.DESTINATION);e||(f+=Um(a,c,d,olympe.dc.va.ORIGIN));0===f&&Vm(a,b)}}
1021
+ 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.Y):e.F&&Km(e.F,this.R)}this.$&&this.$(this.R)}Ag(a){this.$=a}remove(a){const b=this.D,c=b.length-1;if(null!==a.position){for(a=a.position;a<
1022
+ c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.lc.Tr.za=[olympe.dc.lc.Ua];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'].pg(b)}function Um(a,b,c,d){const e=a.N,f=b+d+c;let g=e[f];void 0===g&&(g=vh(a.db,b,c,d),e[f]=g);return g}function Vm(a,b){a.D||a.j.pg(b)}function Wm(a,b,c,d,e){if(!a.D){let f=Um(a,c,d,e||olympe.dc.va.DESTINATION);e||(f+=Um(a,c,d,olympe.dc.va.ORIGIN));0===f&&Vm(a,b)}}
1023
1023
  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)}
1024
1024
  olympe.dc.lc.Vr=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)}
1025
- 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.ha(),f=new olympe.dc.lc.Vj,g=new olympe.dc.lc.Vr(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.gb()||(h||(xm(g,()=>{v.og();um(g)}),v.re().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.V.Kc();Of(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(()=>{Mf(e,b,p)});e.Ia(b)||um(g)}
1025
+ 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}pg(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.bb={};function cn(a,b,c,d){const e=olympe.dc.ha(),f=new olympe.dc.lc.Vj,g=new olympe.dc.lc.Vr(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.gb()||(h||(xm(g,()=>{v.pg();um(g)}),v.re().Ag(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.V.Kc();Of(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(()=>{Mf(e,b,p)});e.Ja(b)||um(g)}
1026
1026
  function dn(a,b,c){const d=c.getContext(),e=olympe.dc.ha(),f=a.F(),g=gh(e,b,a.H,d.tc(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>hh(e,b,a.H,g))}
1027
- olympe.dc.ab.Ei=class{constructor(a,b,c){this.H=a&&a.X?a.X():a;this.ba=b&&b.filter(d=>d instanceof olympe.dc.ba.af||d instanceof olympe.dc.ba.Ke)||null;this.D=c||null;this.defaultValue=null}la(){}Nb(){}F(){}j(){return(this.ba||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}xh(a){this.defaultValue=a;return this}qh(){return this.ba}ce(){return this.D}getValue(a,b){const c=a.run(()=>olympe.C.cc(this.Nb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&mc(c,this.defaultValue);
1028
- b=this.D||b;null!==this.ba?cn(a,b,this.ba,d=>{dn(this,d,c)}):dn(this,b,c);return c.tb()}ga(a){const b=Cm(a,this.H),c=Cm(a,this.D);let d='null';this.ba&&(d=this.ba.map(function(e){return e.ga(a)}).join(','));return`{"c":"${this.la()}","a":["${b}",${d},${c}]}`}toString(){const a=Bm(this.H),b=this.D?','+Bm(this.D):'';let c='';this.ba&&(c=','+this.ba.join(','));return this.la().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.ab.Ei.za=[olympe.dc.Yk];olympe.dc.ab.po=class{constructor(a,b){if(olympe.C.pf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ha();const e=d.Jb(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.oh(e,olympe.dc.CloudObject.extendRel,olympe.dm.Ie);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.X():d=new olympe.dc.ab.kj(c,b);break;case olympe.dm.Number.O.X():d=new olympe.dc.ab.bj(c,
1029
- b);break;case olympe.dm.Boolean.O.X():d=new olympe.dc.ab.Wj(c,b);break;case olympe.dm.DateTime.O.X():d=new olympe.dc.ab.Ki(c,b)}this.D=d}la(){return this.D.la()}j(){return this.D.j()}getValue(a,b){return this.D.getValue(a,b)}ga(a){return this.D.ga(a)}toString(){return this.D.toString()}};olympe.dc.ab.po.za=[olympe.dc.Yk];olympe.dc.ab.Wj=class extends olympe.dc.ab.Ei{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.ab.Wj)}F(){return olympe.dc.nb.qn}Nb(){return olympe.C.da}};P('olympe.dc.valuedefs.BooleanProperty',olympe.dc.ab.Wj);olympe.dc.ab.Xe=class{constructor(a){this.value=a}la(){return Q(olympe.dc.ab.Xe)}j(){return[]}getValue(){return this.value}ga(a){a=Cm(a,this.value);return`{"c":"${this.la()}","a":[${a}]}`}toString(){return`Constant(${Bm(this.value)})`}};P('olympe.dc.valuedefs.Constant',olympe.dc.ab.Xe);olympe.dc.ab.Xe.za=[olympe.dc.Yk];olympe.dc.ab.Ki=class extends olympe.dc.ab.Ei{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.ab.Ki)}F(){return olympe.dc.nb.rn}Nb(){return olympe.C.eb}};P('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.ab.Ki);olympe.dc.ab.bj=class extends olympe.dc.ab.Ei{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.ab.bj)}F(){return olympe.dc.nb.sn}Nb(){return olympe.C.aa}};P('olympe.dc.valuedefs.NumberProperty',olympe.dc.ab.bj);olympe.dc.ab.kj=class extends olympe.dc.ab.Ei{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.ab.kj)}F(){return olympe.dc.nb.tn}Nb(){return olympe.C.Ta}};P('olympe.dc.valuedefs.StringProperty',olympe.dc.ab.kj);olympe.dc.ab.lj=class{la(){return Q(olympe.dc.ab.lj)}j(){return[]}getValue(a,b){return b}ga(){return'{"c":"'+this.la()+'","a":[]}'}toString(){return'Tag()'}};P('olympe.dc.valuedefs.Tag',olympe.dc.ab.lj);olympe.dc.ab.lj.za=[olympe.dc.Yk];olympe.dc.ba={};olympe.dc.ba.Li=class{Nb(){return null}la(){return Q(olympe.dc.ba.Li)}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)))}}ga(){return'{"c":"'+this.la()+'"}'}toString(){return'Distinct()'}};P('olympe.dc.transformers.Distinct',olympe.dc.ba.Li);olympe.dc.ba.Li.za=[olympe.dc.Jf];olympe.dc.ba.yf=class{constructor(a){this.D=a}Nb(){return null}la(){return Q(olympe.dc.ba.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.hb(n)&&(n=n.Ca);olympe.C.Vf(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]),
1030
- d(g,h,k,!1),delete e[h]}}ga(a){return'{"c":"'+this.la()+'","a":['+this.D.ga(a)+']}'}toString(){return'Filter('+this.D.toString()+')'}};P('olympe.dc.transformers.Filter',olympe.dc.ba.yf);olympe.dc.ba.yf.za=[olympe.dc.Jf,olympe.dc.gr];olympe.dc.ba.hm=class{constructor(a,b,c,d){this.D=new olympe.dc.Sa.Relation(olympe.dc.fa(a),c||olympe.dc.va.DESTINATION);this.F=new olympe.dc.Sa.Relation(olympe.dc.fa(b),d||olympe.dc.va.DESTINATION)}Nb(){return hg(this.D)}la(){return Q(olympe.dc.ba.hm)}j(a,b,c){const d=olympe.dc.ha(),e={},f=this.D.X(),g=this.D.La(),h=this.F.X(),k=this.F.La();let l=null,n=null;const p=(r,t,v,x,y,z)=>{if(y){if(y=()=>{const A=olympe.V.ub(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,
1027
+ olympe.dc.bb.Di=class{constructor(a,b,c){this.H=a&&a.X?a.X():a;this.ba=b&&b.filter(d=>d instanceof olympe.dc.ba.af||d instanceof olympe.dc.ba.Ke)||null;this.D=c||null;this.defaultValue=null}la(){}Nb(){}F(){}j(){return(this.ba||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}xh(a){this.defaultValue=a;return this}qh(){return this.ba}ce(){return this.D}getValue(a,b){const c=a.run(()=>olympe.C.cc(this.Nb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&mc(c,this.defaultValue);
1028
+ b=this.D||b;null!==this.ba?cn(a,b,this.ba,d=>{dn(this,d,c)}):dn(this,b,c);return c.tb()}ga(a){const b=Cm(a,this.H),c=Cm(a,this.D);let d='null';this.ba&&(d=this.ba.map(function(e){return e.ga(a)}).join(','));return`{"c":"${this.la()}","a":["${b}",${d},${c}]}`}toString(){const a=Bm(this.H),b=this.D?','+Bm(this.D):'';let c='';this.ba&&(c=','+this.ba.join(','));return this.la().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.bb.Di.za=[olympe.dc.Yk];olympe.dc.bb.po=class{constructor(a,b){if(olympe.C.qf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ha();const e=d.Jb(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.oh(e,olympe.dc.CloudObject.extendRel,olympe.dm.Ie);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.X():d=new olympe.dc.bb.jj(c,b);break;case olympe.dm.Number.O.X():d=new olympe.dc.bb.aj(c,
1029
+ b);break;case olympe.dm.Boolean.O.X():d=new olympe.dc.bb.Wj(c,b);break;case olympe.dm.DateTime.O.X():d=new olympe.dc.bb.Ji(c,b)}this.D=d}la(){return this.D.la()}j(){return this.D.j()}getValue(a,b){return this.D.getValue(a,b)}ga(a){return this.D.ga(a)}toString(){return this.D.toString()}};olympe.dc.bb.po.za=[olympe.dc.Yk];olympe.dc.bb.Wj=class extends olympe.dc.bb.Di{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.bb.Wj)}F(){return olympe.dc.nb.qn}Nb(){return olympe.C.da}};P('olympe.dc.valuedefs.BooleanProperty',olympe.dc.bb.Wj);olympe.dc.bb.Xe=class{constructor(a){this.value=a}la(){return Q(olympe.dc.bb.Xe)}j(){return[]}getValue(){return this.value}ga(a){a=Cm(a,this.value);return`{"c":"${this.la()}","a":[${a}]}`}toString(){return`Constant(${Bm(this.value)})`}};P('olympe.dc.valuedefs.Constant',olympe.dc.bb.Xe);olympe.dc.bb.Xe.za=[olympe.dc.Yk];olympe.dc.bb.Ji=class extends olympe.dc.bb.Di{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.bb.Ji)}F(){return olympe.dc.nb.rn}Nb(){return olympe.C.eb}};P('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.bb.Ji);olympe.dc.bb.aj=class extends olympe.dc.bb.Di{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.bb.aj)}F(){return olympe.dc.nb.sn}Nb(){return olympe.C.aa}};P('olympe.dc.valuedefs.NumberProperty',olympe.dc.bb.aj);olympe.dc.bb.jj=class extends olympe.dc.bb.Di{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.bb.jj)}F(){return olympe.dc.nb.tn}Nb(){return olympe.C.Ta}};P('olympe.dc.valuedefs.StringProperty',olympe.dc.bb.jj);olympe.dc.bb.kj=class{la(){return Q(olympe.dc.bb.kj)}j(){return[]}getValue(a,b){return b}ga(){return'{"c":"'+this.la()+'","a":[]}'}toString(){return'Tag()'}};P('olympe.dc.valuedefs.Tag',olympe.dc.bb.kj);olympe.dc.bb.kj.za=[olympe.dc.Yk];olympe.dc.ba={};olympe.dc.ba.Ki=class{Nb(){return null}la(){return Q(olympe.dc.ba.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)))}}ga(){return'{"c":"'+this.la()+'"}'}toString(){return'Distinct()'}};P('olympe.dc.transformers.Distinct',olympe.dc.ba.Ki);olympe.dc.ba.Ki.za=[olympe.dc.Kf];olympe.dc.ba.zf=class{constructor(a){this.D=a}Nb(){return null}la(){return Q(olympe.dc.ba.zf)}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.hb(n)&&(n=n.Ca);olympe.C.Vf(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]),
1030
+ d(g,h,k,!1),delete e[h]}}ga(a){return'{"c":"'+this.la()+'","a":['+this.D.ga(a)+']}'}toString(){return'Filter('+this.D.toString()+')'}};P('olympe.dc.transformers.Filter',olympe.dc.ba.zf);olympe.dc.ba.zf.za=[olympe.dc.Kf,olympe.dc.gr];olympe.dc.ba.hm=class{constructor(a,b,c,d){this.D=new olympe.dc.Sa.Relation(olympe.dc.fa(a),c||olympe.dc.va.DESTINATION);this.F=new olympe.dc.Sa.Relation(olympe.dc.fa(b),d||olympe.dc.va.DESTINATION)}Nb(){return hg(this.D)}la(){return Q(olympe.dc.ba.hm)}j(a,b,c){const d=olympe.dc.ha(),e={},f=this.D.X(),g=this.D.La(),h=this.F.X(),k=this.F.La();let l=null,n=null;const p=(r,t,v,x,y,z)=>{if(y){if(y=()=>{const A=olympe.V.ub(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,
1031
1031
  v,x,f,g);c(!0,z,A,K)},y.Ys=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.Ys<y&&(y=db.Ys,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)}ga(){return'{"c":"'+this.la()+'","a":["'+this.D.toString()+
1032
- '","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.D.toString()+', '+this.F.toString()+')'}};P('olympe.dc.transformers.FirstRelated',olympe.dc.ba.hm);olympe.dc.ba.hm.za=[olympe.dc.Jf];olympe.dc.ba.Nh=class{constructor(a,b){this.start=a;this.D=b}Nb(){return null}la(){return Q(olympe.dc.ba.Nh)}j(a,b,c){const d=new olympe.dc.lc.zm;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.re().zg(t=>{e=t;bn(b,l)}),xm(b,()=>r.og(),l),h=!0);d.j(n,p,q,null);ym(b,q,l)}}ga(a){return'{"c":"'+
1033
- this.la()+'","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.ba.Nh);olympe.dc.ba.Nh.za=[olympe.dc.Jf];function en(a){return a.pb.map(b=>b.X())}
1032
+ '","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.D.toString()+', '+this.F.toString()+')'}};P('olympe.dc.transformers.FirstRelated',olympe.dc.ba.hm);olympe.dc.ba.hm.za=[olympe.dc.Kf];olympe.dc.ba.Nh=class{constructor(a,b){this.start=a;this.D=b}Nb(){return null}la(){return Q(olympe.dc.ba.Nh)}j(a,b,c){const d=new olympe.dc.lc.zm;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.re().Ag(t=>{e=t;bn(b,l)}),xm(b,()=>r.pg(),l),h=!0);d.j(n,p,q,null);ym(b,q,l)}}ga(a){return'{"c":"'+
1033
+ this.la()+'","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.ba.Nh);olympe.dc.ba.Nh.za=[olympe.dc.Kf];function en(a){return a.pb.map(b=>b.X())}
1034
1034
  olympe.dc.ba.tk=class{constructor(a,b){this.direction=b||olympe.dc.va.DESTINATION;this.pb=a.map(c=>new olympe.dc.Sa.Relation(c,this.direction))}Nb(){return olympe.dc.CloudObject}la(){return Q(olympe.dc.ba.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.X();p=olympe.V.ub(g+k.La()+p+n,20);const q=zm(h,l,n,p);l&&b.register(p,g,f,k.X(),k.La());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.pb.forEach(l=>{Wm(b,h,g,l.X(),l.La());e(g,h,k,l)}):this.pb.forEach(l=>
1035
- {d.D(g,l,h)})}}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(en(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.La()+'['+en(this).join(',')+'])'}};P('olympe.dc.transformers.MultiRelated',olympe.dc.ba.tk);olympe.dc.ba.tk.za=[olympe.dc.Jf];olympe.dc.ba.Ke=class extends olympe.dc.Sa.Relation{constructor(a,b=olympe.dc.va.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.D=d}Nb(){return hg(this)}la(){return Q(olympe.dc.ba.Ke)}j(a,b,c){const d=olympe.dc.ha(),e=Object.create(null),f=olympe.dc.va.ORIGIN,g=olympe.dc.va.DESTINATION,h=this.X(),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.V.ub(q+k+(h+'_'+p)+t[v],20);b.register(y,
1035
+ {d.D(g,l,h)})}}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(en(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.La()+'['+en(this).join(',')+'])'}};P('olympe.dc.transformers.MultiRelated',olympe.dc.ba.tk);olympe.dc.ba.tk.za=[olympe.dc.Kf];olympe.dc.ba.Ke=class extends olympe.dc.Sa.Relation{constructor(a,b=olympe.dc.va.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.D=d}Nb(){return hg(this)}la(){return Q(olympe.dc.ba.Ke)}j(a,b,c){const d=olympe.dc.ha(),e=Object.create(null),f=olympe.dc.va.ORIGIN,g=olympe.dc.va.DESTINATION,h=this.X(),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.V.ub(q+k+(h+'_'+p)+t[v],20);b.register(y,
1036
1036
  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.V.ub(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)}ga(){return'{"c":"'+this.la()+'","a":["'+this.X()+'","'+this.La()+'",'+this.F+','+this.D+']}'}toString(){return'RecursiveRelated('+this.La()+this.X()+'['+this.F+'..'+this.D+'])'}};
1037
- P('olympe.dc.transformers.RecursiveRelated',olympe.dc.ba.Ke);olympe.dc.ba.Ke.za=[olympe.dc.Jf];olympe.dc.ba.af=class extends olympe.dc.Sa.Relation{constructor(a,b){super(a,b||olympe.dc.va.DESTINATION)}Nb(){return hg(this)}la(){return Q(olympe.dc.ba.af)}$b(){return new olympe.dc.ba.af(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION)}j(a,b,c){const d=olympe.dc.ha(),e=this.X(),f=this.La();return(g,h,k,l)=>{Wm(b,k,h,e,f);g?T(d,h,this,(n,p)=>{const q=olympe.V.ub(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)}}ga(){return'{"c":"'+
1038
- this.la()+'","a":["'+this.X()+'","'+this.La()+'"]}'}toString(){return'Related('+this.La()+this.X()+')'}};P('olympe.dc.transformers.Related',olympe.dc.ba.af);olympe.dc.ba.af.za=[olympe.dc.Jf];olympe.dc.ba.bh=class{constructor(a,b){this.Hb=a;this.D=void 0===b?!0:!!b}Nb(){return null}la(){return Q(olympe.dc.ba.bh)}kh(){return this.Hb}F(){return[this.Hb.H()]}j(a,b,c){const d=new olympe.dc.lc.Tr(a.tc(this.D?this.Hb.compare.bind(this.Hb):(e,f)=>this.Hb.compare(f,e)));return(e,f,g)=>{var h=e?this.Hb.F(a,f):void 0;h=d.j(e,f,g,h);c(e,f,g,h)}}ga(a){return'{"c":"'+this.la()+'","a":['+this.Hb.ga(a)+','+JSON.stringify(this.D)+']}'}toString(){return'Sort('+this.Hb.toString()+','+JSON.stringify(this.D)+
1039
- ')'}};P('olympe.dc.transformers.Sort',olympe.dc.ba.bh);olympe.dc.ba.bh.za=[olympe.dc.Jf,olympe.dc.gr];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.V.Kc(),k=olympe.dc.ha(),l=a.ba;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&&(Of(a,e,c,d),olympe.C.Ya().Yd(()=>Mf(a,e,d)))}
1040
- olympe.dc.ba.Kf=class{constructor(a,b){this.ba=this.D=null;a instanceof olympe.dc.Aa?(this.D=a.ce(),this.ba=a.tm()):(this.D=a,b&&(this.ba=b))}Nb(){return null}la(){return Q(olympe.dc.ba.Kf)||''}qh(){return this.ba}ce(){return this.D}j(a,b,c){const d=new olympe.dc.lc.zm,e=new olympe.dc.lc.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.Ya();v.jd()||
1041
- v.gb()||(k||(t.re().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.re().zg(v=>{f=v;bn(b,l)}),xm(b,()=>t.og(),l),h=!0);d.j(p,q,r,l);ym(b,r,l)}}ga(a){const b=this.ba?'['+this.ba.map(c=>c.ga(a)).join(',')+']':'null';return'{"c":"'+this.la()+'","a":['+Cm(a,this.D)+','+b+']}'}toString(){const a=olympe.C.hb(this.D)?'N:'+this.D.Ca.T():this.D.valueOf(),b=this.ba?','+this.ba.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
1042
- P('olympe.dc.transformers.Union',olympe.dc.ba.Kf);olympe.dc.ba.Kf.za=[olympe.dc.Jf];olympe.dc.ba.Ar={JB:1,Bu:-1,Au:0};olympe.dc.ba.mD={rA:!0,SA:!1};olympe.dc.kc.P={pq:'dc.legacy.listdefProcessor'};olympe.dc.kc.U={oq:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{E(a,olympe.dc.kc.U.oq,!1);C(a,olympe.dc.kc.P.pq,olympe.dc.kc.uv,olympe.dc.query.P.Da,olympe.dc.P.Dh,olympe.dc.transaction.P.Ea,olympe.dc.query.P.Fk,new olympe.W.pa(olympe.dc.U.Zh),new olympe.W.pa(olympe.dc.kc.U.oq))});olympe.W.run([olympe.dc.kc.P.pq],a=>{olympe.dc.kc.By=()=>a});function hn(a){const b=olympe.dc.ha(),c=new Map;b.Ms(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}
1037
+ P('olympe.dc.transformers.RecursiveRelated',olympe.dc.ba.Ke);olympe.dc.ba.Ke.za=[olympe.dc.Kf];olympe.dc.ba.af=class extends olympe.dc.Sa.Relation{constructor(a,b){super(a,b||olympe.dc.va.DESTINATION)}Nb(){return hg(this)}la(){return Q(olympe.dc.ba.af)}$b(){return new olympe.dc.ba.af(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION)}j(a,b,c){const d=olympe.dc.ha(),e=this.X(),f=this.La();return(g,h,k,l)=>{Wm(b,k,h,e,f);g?T(d,h,this,(n,p)=>{const q=olympe.V.ub(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)}}ga(){return'{"c":"'+
1038
+ this.la()+'","a":["'+this.X()+'","'+this.La()+'"]}'}toString(){return'Related('+this.La()+this.X()+')'}};P('olympe.dc.transformers.Related',olympe.dc.ba.af);olympe.dc.ba.af.za=[olympe.dc.Kf];olympe.dc.ba.bh=class{constructor(a,b){this.Hb=a;this.D=void 0===b?!0:!!b}Nb(){return null}la(){return Q(olympe.dc.ba.bh)}kh(){return this.Hb}F(){return[this.Hb.H()]}j(a,b,c){const d=new olympe.dc.lc.Tr(a.tc(this.D?this.Hb.compare.bind(this.Hb):(e,f)=>this.Hb.compare(f,e)));return(e,f,g)=>{var h=e?this.Hb.F(a,f):void 0;h=d.j(e,f,g,h);c(e,f,g,h)}}ga(a){return'{"c":"'+this.la()+'","a":['+this.Hb.ga(a)+','+JSON.stringify(this.D)+']}'}toString(){return'Sort('+this.Hb.toString()+','+JSON.stringify(this.D)+
1039
+ ')'}};P('olympe.dc.transformers.Sort',olympe.dc.ba.bh);olympe.dc.ba.bh.za=[olympe.dc.Kf,olympe.dc.gr];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.V.Kc(),k=olympe.dc.ha(),l=a.ba;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&&(Of(a,e,c,d),olympe.C.$a().Yd(()=>Mf(a,e,d)))}
1040
+ olympe.dc.ba.Lf=class{constructor(a,b){this.ba=this.D=null;a instanceof olympe.dc.Aa?(this.D=a.ce(),this.ba=a.tm()):(this.D=a,b&&(this.ba=b))}Nb(){return null}la(){return Q(olympe.dc.ba.Lf)||''}qh(){return this.ba}ce(){return this.D}j(a,b,c){const d=new olympe.dc.lc.zm,e=new olympe.dc.lc.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.$a();v.jd()||
1041
+ v.gb()||(k||(t.re().Ag(x=>{g=x;bn(b,n)}),xm(b,()=>t.pg(),n),k=!0),d.j(p,q,r),ym(b,r,n))});Xm(b,l);return(p,q,r,t)=>{h||(t.re().Ag(v=>{f=v;bn(b,l)}),xm(b,()=>t.pg(),l),h=!0);d.j(p,q,r,l);ym(b,r,l)}}ga(a){const b=this.ba?'['+this.ba.map(c=>c.ga(a)).join(',')+']':'null';return'{"c":"'+this.la()+'","a":['+Cm(a,this.D)+','+b+']}'}toString(){const a=olympe.C.hb(this.D)?'N:'+this.D.Ca.T():this.D.valueOf(),b=this.ba?','+this.ba.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
1042
+ P('olympe.dc.transformers.Union',olympe.dc.ba.Lf);olympe.dc.ba.Lf.za=[olympe.dc.Kf];olympe.dc.ba.Ar={JB:1,Bu:-1,Au:0};olympe.dc.ba.mD={rA:!0,SA:!1};olympe.dc.kc.P={pq:'dc.legacy.listdefProcessor'};olympe.dc.kc.U={oq:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{E(a,olympe.dc.kc.U.oq,!1);C(a,olympe.dc.kc.P.pq,olympe.dc.kc.uv,olympe.dc.query.P.Da,olympe.dc.P.Dh,olympe.dc.transaction.P.Ea,olympe.dc.query.P.Fk,new olympe.W.pa(olympe.dc.U.Zh),new olympe.W.pa(olympe.dc.kc.U.oq))});olympe.W.run([olympe.dc.kc.P.pq],a=>{olympe.dc.kc.By=()=>a});function hn(a){const b=olympe.dc.ha(),c=new Map;b.Ms(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}
1043
1043
  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 Rc(a,b,c,...d){b=olympe.dc.fa(b);var e=Qf(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.X()}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.Ps();a=olympe.dc.fa(a);var c=b.db.model(a);c=Pf(b,c);if(null===
1044
- c)throw new olympe.dc.Uq(a);c=c.instantiate(a,b.D);b.j.oe([a],olympe.dc.db.Instance.j.Zp);b.Sa.register(c,a);b=c}return b}static exists(a){return olympe.dc.ha().Ia(olympe.dc.fa(a))}static Ex(a,b,c){const d=olympe.dc.ha();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.Ai(c);a.forEach((k,l)=>{d.Ia(olympe.dc.fa(l))?X(h,l,k):(l=f(l))&&X(h,l,k)});g.ob((k,l)=>{k||olympe.ia.Za('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});
1044
+ c)throw new olympe.dc.Uq(a);c=c.instantiate(a,b.D);b.j.oe([a],olympe.dc.db.Instance.j.Zp);b.Sa.register(c,a);b=c}return b}static exists(a){return olympe.dc.ha().Ja(olympe.dc.fa(a))}static Ex(a,b,c){const d=olympe.dc.ha();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.zi(c);a.forEach((k,l)=>{d.Ja(olympe.dc.fa(l))?X(h,l,k):(l=f(l))&&X(h,l,k)});g.ob((k,l)=>{k||olympe.ia.Ya('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});
1045
1045
  return this.get(h)}static nx(){return this.get(this)}static pl(a){return olympe.dc.ma.pl(a)}static Cb(){return olympe.dc.ha().cb(this,olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Sa.Property(a))}static Jd(){const a=olympe.dc.ha();return a.cb(this,olympe.dc.CloudObject.Kj).map(b=>new olympe.dc.Sa.Relation(b)).concat(a.cb(this,olympe.dc.CloudObject.Fs).map(b=>new olympe.dc.Sa.Relation(b,olympe.dc.va.ORIGIN)))}static Tc(a){return olympe.dc.CloudObject.get(a)}static Qs(a){var b=Pf(olympe.dc.Ps(),
1046
1046
  olympe.dc.fa(a));b=b&&b.D;return new olympe.dc.Aa(olympe.dc.fa(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}la(){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.ma.from(this)}Re(){return this.db.Re(this)}jb(){return this.db.source(this)}yy(){return this.db.wi(this)?olympe.dc.fe().fromModel(this):null}Ls(){return olympe.C.ua([this.la()],
1047
1047
  a=>olympe.C.xb(a),olympe.C.Ta,'getDisplayName',olympe.C.xb('('+this.toString()+')'))}ac(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.Bb?a.Bb():a;return new rxjs.Observable(e=>{const f=olympe.dc.nb.Cc(this.db.Ra(this.tag,b));c||null!==f||e.next(f);const g=gh(this.db,this.tag,b,h=>{e.next(olympe.dc.nb.Cc(h))});d.Yd(()=>{e.complete();hh(this.db,this.tag,b,g)});return()=>hh(this.db,this.tag,b,g)})}Fz(a){const b='function'===typeof a.Bb?a.Bb():
1048
- a;return new rxjs.Observable(c=>{const d=ih(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Sa.Property(e),null]):c.next([new olympe.dc.Sa.Property(e),f])});b.Yd(()=>{c.complete();jh(this.db,this.tag,d)});return()=>jh(this.db,this.tag,d)})}Gz(a){return this.observe(olympe.C.Ya(),a)}get(a){return olympe.dc.nb.Cc(this.db.Ra(this.tag,a))}Ra(a){return this.get(a)}fb(a){return olympe.dc.ma.from(this).fb(a)}vg(a){return olympe.dc.sd.from(this).fb(a)}Cc(){return this}gy(){return this.Sc(olympe.dc.CloudObject.Ax,
1049
- olympe.dc.CloudObject)}Cn(){return this.cb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Tf(a,b,c){const d=olympe.C.cc(c,'Sync valueType'),e=gh(this.db,this.tag,a,olympe.C.Ya().tc(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>hh(this.db,this.tag,a,e));return d.getContext()}wb(a){return M(this.Tf(a,olympe.dc.nb.tn,olympe.C.Ta))}yd(a){return M(this.Tf(a,olympe.dc.nb.sn,olympe.C.aa))}nh(a){return M(this.Tf(a,olympe.dc.nb.qn,
1050
- olympe.C.da))}Ej(a){return M(this.Tf(a,olympe.dc.nb.rn,olympe.C.eb))}Us(){return M(this.Tf(olympe.dm.Color.valueProp,olympe.dc.nb.ys,olympe.C.Color))}Vs(){return M(this.Tf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.nb.zs,olympe.dc.CloudObject))}cb(a,b){a=a instanceof olympe.dc.ba.af?a:new olympe.dc.ba.af(a.X(),a.La());return new olympe.dc.Aa(this.X(),a,b)}Sc(a,b){return this.cb(a,b).Ic()}Is(a,b){const c=this.db,d=olympe.V.Kc(),e=olympe.C.Ya(),f=new Map;T(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,
1051
- 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)})}jA(){return new olympe.dc.Aa(this.X(),[],fg(this.X()))}transform(...a){return(new olympe.dc.Aa(this.X(),[],this.constructor)).transform(...a)}Wc(){return this.Ls()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ia(this.tag)?Object.assign({'#tag':this.X(),'#type':this.Vb().name()},this.Xc(!0,!0)):{'#tag':this.X(),'#error':'The object does not exist in the local database.'}}Xc(a=
1052
- !1,b=!0){const c={};this.db.Cb(this,b).forEach((d,e)=>{this.db.Ia(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.nb.Cc(d))});return c}Fa(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():'function'===typeof a?olympe.dc.na.ac(a)===this.X():!1}Kd(a){return olympe.C.ua([a],b=>olympe.C.Sb(this.Fa(b)),olympe.C.da)}Hx(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Xa,c=!0;const d=olympe.dc.va.ORIGIN;for(const [e,f,g]of th(b,this))f===d?a.ic(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&
1053
- a.ic(e,this,g);a.delete(this,olympe.dc.Mb.NONE);c&&a.ob()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Fa;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Xc;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.vg;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.fb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Ra;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;
1048
+ a;return new rxjs.Observable(c=>{const d=ih(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Sa.Property(e),null]):c.next([new olympe.dc.Sa.Property(e),f])});b.Yd(()=>{c.complete();jh(this.db,this.tag,d)});return()=>jh(this.db,this.tag,d)})}Gz(a){return this.observe(olympe.C.$a(),a)}get(a){return olympe.dc.nb.Cc(this.db.Ra(this.tag,a))}Ra(a){return this.get(a)}fb(a){return olympe.dc.ma.from(this).fb(a)}wg(a){return olympe.dc.sd.from(this).fb(a)}Cc(){return this}gy(){return this.Sc(olympe.dc.CloudObject.Ax,
1049
+ olympe.dc.CloudObject)}Cn(){return this.cb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Tf(a,b,c){const d=olympe.C.cc(c,'Sync valueType'),e=gh(this.db,this.tag,a,olympe.C.$a().tc(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>hh(this.db,this.tag,a,e));return d.getContext()}wb(a){return M(this.Tf(a,olympe.dc.nb.tn,olympe.C.Ta))}yd(a){return M(this.Tf(a,olympe.dc.nb.sn,olympe.C.aa))}nh(a){return M(this.Tf(a,olympe.dc.nb.qn,
1050
+ olympe.C.da))}Dj(a){return M(this.Tf(a,olympe.dc.nb.rn,olympe.C.eb))}Us(){return M(this.Tf(olympe.dm.Color.valueProp,olympe.dc.nb.ys,olympe.C.Color))}Vs(){return M(this.Tf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.nb.zs,olympe.dc.CloudObject))}cb(a,b){a=a instanceof olympe.dc.ba.af?a:new olympe.dc.ba.af(a.X(),a.La());return new olympe.dc.Aa(this.X(),a,b)}Sc(a,b){return this.cb(a,b).Ic()}Is(a,b){const c=this.db,d=olympe.V.Kc(),e=olympe.C.$a(),f=new Map;T(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,
1051
+ 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)})}jA(){return new olympe.dc.Aa(this.X(),[],fg(this.X()))}transform(...a){return(new olympe.dc.Aa(this.X(),[],this.constructor)).transform(...a)}Wc(){return this.Ls()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ja(this.tag)?Object.assign({'#tag':this.X(),'#type':this.Vb().name()},this.Xc(!0,!0)):{'#tag':this.X(),'#error':'The object does not exist in the local database.'}}Xc(a=
1052
+ !1,b=!0){const c={};this.db.Cb(this,b).forEach((d,e)=>{this.db.Ja(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.nb.Cc(d))});return c}Fa(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():'function'===typeof a?olympe.dc.na.ac(a)===this.X():!1}Kd(a){return olympe.C.ua([a],b=>olympe.C.Sb(this.Fa(b)),olympe.C.da)}Hx(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Za,c=!0;const d=olympe.dc.va.ORIGIN;for(const [e,f,g]of th(b,this))f===d?a.ic(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&
1053
+ a.ic(e,this,g);a.delete(this,olympe.dc.Mb.NONE);c&&a.ob()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Fa;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Xc;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.wg;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.fb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Ra;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;
1054
1054
  olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Gz;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.Fz;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.ac;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.jb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Re;
1055
1055
  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.X;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Qs;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Tc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.Jd;
1056
1056
  olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Cb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.pl;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.nx;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Ex;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);olympe.dc.CloudObject.zF=olympe.dc.CloudObject.O.ka(olympe.dc.iq.VERSION);
1057
1057
  olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.O.ka('ff023000000000000011');w('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.jF=olympe.dc.CloudObject.O.ka('ff023000000000000012');olympe.dc.CloudObject.Kj=olympe.dc.CloudObject.O.sa('ff02200000000000000a');olympe.dc.CloudObject.Fs=olympe.dc.CloudObject.O.sa('ff02200000000000000b',olympe.dc.va.ORIGIN);olympe.dc.CloudObject.TE=olympe.dc.CloudObject.O.sa('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.JE=olympe.dc.CloudObject.O.sa('017ea013caf8e89cedb2');
1058
1058
  olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.sa('ff02200000000000000c');w('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.O.sa('ff02200000000000000d',olympe.dc.va.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.O.sa(olympe.dc.hc.$c);w('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);
1059
- w('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.sa(olympe.dc.hc.Mi);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);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.sa(olympe.dc.hc.Zj);
1059
+ w('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.sa(olympe.dc.hc.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);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.sa(olympe.dc.hc.Zj);
1060
1060
  w('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Ax=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Gx=olympe.dc.CloudObject.O.sa('018282d3ac0a474a0bf4');w('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.Gx);olympe.dc.oD=olympe.dc.CloudObject;olympe.dc.CloudObject.za=[olympe.dc.Ze];m=olympe.dc.CloudObject.prototype;m.X.K=new olympe.C.J(()=>String,[]);m.name.K=new olympe.C.J(()=>String,[]);m.la.K=olympe.C.J.D;
1061
- m.Vb.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.jb.K=new olympe.C.J(()=>String,[]);m.yy.K=new olympe.C.J(()=>String,[]);m.Ls.K=olympe.C.J.D;m.ac.K=new olympe.C.J(()=>String,[]);m.gy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Cn.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Tf.K=new olympe.C.J(()=>olympe.C.Node,[]);m.wb.K=olympe.C.J.D;m.yd.K=olympe.C.J.F;m.nh.K=olympe.C.J.N;m.Ej.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Us.K=new olympe.C.J(()=>olympe.C.Color,[]);
1062
- m.Vs.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.Is.K=new olympe.C.J(()=>Function,[]);m.jA.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.Fa.K=olympe.C.J.j;m.Kd.K=olympe.C.J.N;m.Hx.K=new olympe.C.J(()=>{},[]);olympe.dc.P={Dh:'dc.DBView',bq:'dc.InstanceManager',Da:'dc.Logger',Hw:'dc.TransactionLogger',hk:'dc.FileServiceManager',Vg:'dc.Router'};olympe.dc.U={Yg:'dc.tag',ag:'dc.debug',Zh:'dc.subscribeAll',$l:'dc.defaultSource',tp:'dc.fileCache',Xo:'dc.dataConsumerOnly',op:'dc.errorOnAbstractInstantiation'};
1063
- olympe.W.config(function(a){const b='object'===typeof window;E(a,olympe.dc.U.ag,!1);E(a,olympe.dc.U.Zh,!1);E(a,olympe.dc.U.$l,olympe.dc.Ha.SERVER);E(a,olympe.dc.U.Xo,b);E(a,olympe.dc.U.tp,b);E(a,olympe.dc.U.op,!0);E(a,olympe.dc.U.Yg,olympe.V.Kc());D(a,olympe.dc.P.Da,[olympe.ia.P.Ea],c=>c.cd('dc'));Xa(a,olympe.dc.P.Hw,olympe.dc.transaction.P.Da);Xa(a,olympe.dc.P.Dh,olympe.dc.db.P.Xl);C(a,olympe.dc.P.hk,olympe.dc.ou,olympe.dc.P.Da,olympe.dc.db.P.Ea,olympe.net.P.Ea,olympe.dc.P.Vg,olympe.V.P.Eg,new olympe.W.pa(olympe.dc.U.tp));
1061
+ m.Vb.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.jb.K=new olympe.C.J(()=>String,[]);m.yy.K=new olympe.C.J(()=>String,[]);m.Ls.K=olympe.C.J.D;m.ac.K=new olympe.C.J(()=>String,[]);m.gy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Cn.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Tf.K=new olympe.C.J(()=>olympe.C.Node,[]);m.wb.K=olympe.C.J.D;m.yd.K=olympe.C.J.F;m.nh.K=olympe.C.J.N;m.Dj.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Us.K=new olympe.C.J(()=>olympe.C.Color,[]);
1062
+ m.Vs.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.Is.K=new olympe.C.J(()=>Function,[]);m.jA.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.Fa.K=olympe.C.J.j;m.Kd.K=olympe.C.J.N;m.Hx.K=new olympe.C.J(()=>{},[]);olympe.dc.P={Dh:'dc.DBView',bq:'dc.InstanceManager',Da:'dc.Logger',Hw:'dc.TransactionLogger',hk:'dc.FileServiceManager',Vg:'dc.Router'};olympe.dc.U={Yg:'dc.tag',bg:'dc.debug',Zh:'dc.subscribeAll',$l:'dc.defaultSource',tp:'dc.fileCache',Xo:'dc.dataConsumerOnly',op:'dc.errorOnAbstractInstantiation'};
1063
+ olympe.W.config(function(a){const b='object'===typeof window;E(a,olympe.dc.U.bg,!1);E(a,olympe.dc.U.Zh,!1);E(a,olympe.dc.U.$l,olympe.dc.Ia.SERVER);E(a,olympe.dc.U.Xo,b);E(a,olympe.dc.U.tp,b);E(a,olympe.dc.U.op,!0);E(a,olympe.dc.U.Yg,olympe.V.Kc());D(a,olympe.dc.P.Da,[olympe.ia.P.Ea],c=>c.cd('dc'));Xa(a,olympe.dc.P.Hw,olympe.dc.transaction.P.Da);Xa(a,olympe.dc.P.Dh,olympe.dc.db.P.Xl);C(a,olympe.dc.P.hk,olympe.dc.ou,olympe.dc.P.Da,olympe.dc.db.P.Ea,olympe.net.P.Ea,olympe.dc.P.Vg,olympe.V.P.Eg,new olympe.W.pa(olympe.dc.U.tp));
1064
1064
  C(a,olympe.dc.P.Vg,olympe.dc.gw,olympe.dc.P.Da,olympe.dc.sources.P.rr,olympe.dc.sources.P.Jr,olympe.dc.P.Dh,olympe.host.P.Ge,new olympe.W.pa(olympe.dc.U.Yg),new olympe.W.pa(olympe.dc.U.Xo));C(a,olympe.dc.P.bq,olympe.dc.Hu,olympe.dc.db.P.im,olympe.dc.db.P.Ea,olympe.W.P.Fg)},'olympe.dc');
1065
- olympe.W.run([olympe.dc.db.P.Ea,olympe.dc.transaction.P.Ea,olympe.dc.P.bq,olympe.dc.P.hk,new olympe.W.pa(olympe.dc.U.Yg)],(a,b,c,d,e)=>{olympe.dc.ly=()=>a;olympe.dc.Gj=()=>b;olympe.dc.Ps=()=>c;olympe.dc.Ns=()=>d;olympe.dc.Ha.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Vd=class extends olympe.dc.CloudObject{la(){return this.wb(olympe.dc.CloudObject.nameProp)}j(){return olympe.C.Ta.EMPTY}D(){return olympe.C.da.j}};olympe.dm.Vd.O=olympe.dc.na.j('ff021000000000000002',olympe.dm.Vd);olympe.dm.Vd.N=olympe.dm.Vd.O.ka('ff023000000000000035');olympe.dm.Vd.j=olympe.dm.Vd.O.sa('ff022000000000000005');olympe.dm.Vd.F=eg('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Vd.H=eg('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
1065
+ olympe.W.run([olympe.dc.db.P.Ea,olympe.dc.transaction.P.Ea,olympe.dc.P.bq,olympe.dc.P.hk,new olympe.W.pa(olympe.dc.U.Yg)],(a,b,c,d,e)=>{olympe.dc.ly=()=>a;olympe.dc.Fj=()=>b;olympe.dc.Ps=()=>c;olympe.dc.Ns=()=>d;olympe.dc.Ia.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Vd=class extends olympe.dc.CloudObject{la(){return this.wb(olympe.dc.CloudObject.nameProp)}j(){return olympe.C.Ta.EMPTY}D(){return olympe.C.da.j}};olympe.dm.Vd.O=olympe.dc.na.j('ff021000000000000002',olympe.dm.Vd);olympe.dm.Vd.N=olympe.dm.Vd.O.ka('ff023000000000000035');olympe.dm.Vd.j=olympe.dm.Vd.O.sa('ff022000000000000005');olympe.dm.Vd.F=eg('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Vd.H=eg('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
1066
1066
  olympe.dm.Vd.D=eg('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Vd.prototype.la.K=olympe.C.J.D;olympe.dm.Vd.prototype.j.K=olympe.C.J.D;olympe.dm.Vd.prototype.D.K=olympe.C.J.N;olympe.dm.Dl={NONE:0,WA:1,bu:2,XA:4,TA:8,VA:16,UA:31,tC:32,qC:64,uC:128,rC:256,Lv:512,sC:992,KB:1023};olympe.dm.User=class extends olympe.dc.CloudObject{vy(){return this.Gn()}la(){return this.Gn()}Gn(){return this.wb(olympe.dm.User.loginProp)}Wu(){return this.wb(olympe.dm.User.D)}Vu(){return olympe.C.Ta.EMPTY}Qy(){return this.wb(olympe.dm.User.saltProp)}Zy(){return this.wb(olympe.dm.User.verifierProp)}Oy(){return this.cb(olympe.dm.User.F,olympe.dm.Vd)}};olympe.dm.User.O=olympe.dc.na.j('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.O.ka('ff023000000000000001');
1067
1067
  w('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.D=olympe.dm.User.O.ka('ff023000000000000002');olympe.dm.User.R=olympe.dm.User.O.ka('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.O.ka('ff023000000000000004');w('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.O.ka('ff023000000000000005');w('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.N=olympe.dm.User.O.ka('ff023000000000000020');
1068
1068
  olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.ka('ff023000000000000036');w('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.F=R(olympe.dm.User.O,olympe.dm.Vd.j);olympe.dm.User.Y=olympe.dm.User.O.sa('ff022000000000000002');olympe.dm.User.j=eg('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.H=eg('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.vy.K=olympe.C.J.D;m.la.K=olympe.C.J.D;m.Gn.K=olympe.C.J.D;m.Wu.K=olympe.C.J.D;m.Vu.K=olympe.C.J.D;m.Qy.K=olympe.C.J.D;
1069
- m.Zy.K=olympe.C.J.D;m.Oy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.eg=class extends olympe.dc.CloudObject{Y(){return this.Cn()}Ja(){return this.wb(olympe.dm.eg.ta)}};olympe.dm.eg.O=olympe.dc.na.j('01621fb84e3300000000',olympe.dm.eg);olympe.dm.eg.ta=olympe.dm.eg.O.ka('01609de3f292e3c2c6ff');olympe.dm.eg.prototype.Y.K=new olympe.C.J(()=>olympe.C.vd,[]);olympe.dm.eg.prototype.Ja.K=olympe.C.J.D;olympe.dm.BrickMetadata=class extends olympe.dm.eg{$y(){return this.wb(olympe.dm.BrickMetadata.Gc)}Jc(){return this.wb(olympe.dm.BrickMetadata.ea)}getType(){return this.wb(olympe.dm.BrickMetadata.Yb)}kz(){return this.nh(olympe.dm.BrickMetadata.Eb)}ve(){return null}ay(){return this.cb(olympe.sc.ui.zx.Comment.ME.$b(),olympe.sc.ui.zx.Comment)}kl(){return this.vg(olympe.dm.BrickMetadata.Ja).Hc().kl()}};olympe.dm.BrickMetadata.O=jg(olympe.dc.na.j('01621fb84e3500000000',olympe.dm.BrickMetadata));
1070
- olympe.dm.BrickMetadata.Gc=olympe.dm.BrickMetadata.O.ka('01621fb84e320000f001');olympe.dm.BrickMetadata.ea=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Yb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.Eb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.Ja=olympe.dm.BrickMetadata.O.sa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.le={CC:'private',EC:'public'};
1069
+ m.Zy.K=olympe.C.J.D;m.Oy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.fg=class extends olympe.dc.CloudObject{Y(){return this.Cn()}Ha(){return this.wb(olympe.dm.fg.ta)}};olympe.dm.fg.O=olympe.dc.na.j('01621fb84e3300000000',olympe.dm.fg);olympe.dm.fg.ta=olympe.dm.fg.O.ka('01609de3f292e3c2c6ff');olympe.dm.fg.prototype.Y.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{$y(){return this.wb(olympe.dm.BrickMetadata.Gc)}Jc(){return this.wb(olympe.dm.BrickMetadata.ea)}getType(){return this.wb(olympe.dm.BrickMetadata.Yb)}kz(){return this.nh(olympe.dm.BrickMetadata.Eb)}ve(){return null}ay(){return this.cb(olympe.sc.ui.zx.Comment.ME.$b(),olympe.sc.ui.zx.Comment)}kl(){return this.wg(olympe.dm.BrickMetadata.Ha).Hc().kl()}};olympe.dm.BrickMetadata.O=jg(olympe.dc.na.j('01621fb84e3500000000',olympe.dm.BrickMetadata));
1070
+ olympe.dm.BrickMetadata.Gc=olympe.dm.BrickMetadata.O.ka('01621fb84e320000f001');olympe.dm.BrickMetadata.ea=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Yb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.Eb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.Ha=olympe.dm.BrickMetadata.O.sa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.le={CC:'private',EC:'public'};
1071
1071
  olympe.dm.BrickMetadata.Ub={dB:'experimental',UC:'stable',RA:'deprecated'};olympe.dm.BrickMetadata.Nd={DA:'business',pD:'technical'};m=olympe.dm.BrickMetadata.prototype;m.$y.K=olympe.C.J.D;m.Jc.K=olympe.C.J.D;m.getType.K=olympe.C.J.D;m.kz.K=olympe.C.J.N;m.ve.K=new olympe.C.J(()=>String,[]);m.ay.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.W.getParameter(`${'data.'}${a}.${b}`))?c:olympe.W.getParameter(`${'data.'}${b}`))?d:olympe.W.getParameter(`${olympe.dc.sources.Lh.Sv}${b}`)}
1072
- function Oj(a,b){const c=a.query().fb(olympe.dm.Bd.j.$b()).fb(olympe.dm.Bd.D);a=a.query().fb(olympe.dm.ib.D.$b()).ug(olympe.dm.ib.F,!0).fb(olympe.sc.Ac.j.$b());const d=e=>e.ne().ug(olympe.dc.CloudObject.extendRel,!0).fb(olympe.dc.CloudObject.Kj,!0).fb(olympe.dm.Relation.destinationModelRel).back(2).fb(olympe.dc.CloudObject.propertyRel,!0).fb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
1072
+ function Oj(a,b){const c=a.query().fb(olympe.dm.Bd.j.$b()).fb(olympe.dm.Bd.D);a=a.query().fb(olympe.dm.ib.D.$b()).vg(olympe.dm.ib.F,!0).fb(olympe.sc.Ac.j.$b());const d=e=>e.ne().vg(olympe.dc.CloudObject.extendRel,!0).fb(olympe.dc.CloudObject.Kj,!0).fb(olympe.dm.Relation.destinationModelRel).back(2).fb(olympe.dc.CloudObject.propertyRel,!0).fb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
1073
1073
  function ok(a,b){return a.observe(b,olympe.dm.DataSource.As).pipe(rxjs.operators.map(()=>a.Pf(olympe.dc.sources.U.We)),rxjs.operators.distinctUntilChanged())}
1074
- olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Kb=c;this.Cs=new Map([[olympe.dc.sources.U.Mm,olympe.dm.DataSource.Sz],[olympe.dc.sources.U.We,olympe.dm.DataSource.As],[olympe.dc.sources.U.Tm,olympe.dm.DataSource.Yz]])}T(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ha.SERVER:this.tag}Pf(a){const b=a.startsWith('data.')?a.split('.')[1]:a,c=`${'data.'}${b}`;let d,e;return null!=(e=null!=(d=olympe.W.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
1075
- '_')}.${b}`))?d:uj(this.X(),a))?e:this.Cs.has(c)?this.get(this.Cs.get(c)):null}Jc(){const a=this;return u(function*(){const b=olympe.dm.DataSource.pc.eu,c=olympe.dm.DataSource.pc.zb,d=new olympe.dc.Request(olympe.dc.Request.j.pc,a.T());return a.Kb.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.ia.Za('dc').warn(`Source ${a.name()} (${a.T()}) has encountered issues: ${e}`);return g}).catch(e=>e instanceof olympe.error.Vk||e instanceof olympe.error.Dm?
1076
- 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.Ed.yj(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');
1074
+ olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Kb=c;this.Cs=new Map([[olympe.dc.sources.U.Mm,olympe.dm.DataSource.Sz],[olympe.dc.sources.U.We,olympe.dm.DataSource.As],[olympe.dc.sources.U.Tm,olympe.dm.DataSource.Yz]])}T(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ia.SERVER:this.tag}Pf(a){const b=a.startsWith('data.')?a.split('.')[1]:a,c=`${'data.'}${b}`;let d,e;return null!=(e=null!=(d=olympe.W.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
1075
+ '_')}.${b}`))?d:uj(this.X(),a))?e:this.Cs.has(c)?this.get(this.Cs.get(c)):null}Jc(){const a=this;return u(function*(){const b=olympe.dm.DataSource.pc.eu,c=olympe.dm.DataSource.pc.zb,d=new olympe.dc.Request(olympe.dc.Request.j.pc,a.T());return a.Kb.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.ia.Ya('dc').warn(`Source ${a.name()} (${a.T()}) has encountered issues: ${e}`);return g}).catch(e=>e instanceof olympe.error.Vk||e instanceof olympe.error.Dm?
1076
+ 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.Ed.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');
1077
1077
  })}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;
1078
1078
  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.Pf;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.Vg);
1079
1079
  olympe.dm.DataSource.hi=olympe.dm.DataSource.O.ka('ff023000000000000060');w('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.hi);olympe.dm.DataSource.PE=olympe.dm.DataSource.O.ka('ff023000000000000061');olympe.dm.DataSource.Sz=olympe.dm.DataSource.O.ka('ff023000000000000062');olympe.dm.DataSource.As=olympe.dm.DataSource.O.ka('ff023000000000000063');olympe.dm.DataSource.Gs=olympe.dm.DataSource.O.ka('ff023000000000000064');olympe.dm.DataSource.Yz=olympe.dm.DataSource.O.ka('ff023000000000000065');
1080
- olympe.dm.DataSource.Lj=olympe.dm.DataSource.O.sa('ff022000000000000060');olympe.dm.DataSource.SERVER=eg('00000000000000000060','Server source');olympe.dm.DataSource.We={OB:'hybrid',yo:'bus',Qp:'http'};olympe.dm.DataSource.pc={Wh:'ready',zb:'error',eu:'down',Df:'offline'};olympe.dm.Bd=class extends olympe.dc.CloudObject{};olympe.dm.Bd.O=olympe.dc.na.j('ff021000000000000070',olympe.dm.Bd);olympe.dm.Bd.j=olympe.dm.Bd.O.sa('ff023000000000000071');olympe.dm.Bd.D=olympe.dm.Bd.O.sa('ff023000000000000072');olympe.dm.Bd.F=olympe.dm.Bd.O.sa('ff023000000000000073');olympe.dm.Lb=class extends olympe.dm.BrickMetadata{H(){return new olympe.dc.Aa(this.X(),[new olympe.dc.ba.Ke(olympe.dm.Lb.j.X(),olympe.dc.va.DESTINATION,olympe.dc.ba.Ar.Au,olympe.dc.ba.Ar.Bu),olympe.dm.Lb.H])}ve(){return olympe.sc.xe.Ne.nu}j(){return this.cb(olympe.dm.Lb.j,olympe.dm.Lb)}N(){return this.cb(olympe.dm.Lb.H)}};olympe.dm.Lb.O=olympe.dc.na.j('01612df1db9749227626',olympe.dm.Lb);olympe.dm.Lb.j=olympe.dm.Lb.O.sa('016a697ef00ce7554691');olympe.dm.Lb.ja=R(olympe.dm.Lb.O,olympe.dm.Lb.j);
1080
+ olympe.dm.DataSource.Lj=olympe.dm.DataSource.O.sa('ff022000000000000060');olympe.dm.DataSource.SERVER=eg('00000000000000000060','Server source');olympe.dm.DataSource.We={OB:'hybrid',yo:'bus',Qp:'http'};olympe.dm.DataSource.pc={Wh:'ready',zb:'error',eu:'down',Ef:'offline'};olympe.dm.Bd=class extends olympe.dc.CloudObject{};olympe.dm.Bd.O=olympe.dc.na.j('ff021000000000000070',olympe.dm.Bd);olympe.dm.Bd.j=olympe.dm.Bd.O.sa('ff023000000000000071');olympe.dm.Bd.D=olympe.dm.Bd.O.sa('ff023000000000000072');olympe.dm.Bd.F=olympe.dm.Bd.O.sa('ff023000000000000073');olympe.dm.Lb=class extends olympe.dm.BrickMetadata{H(){return new olympe.dc.Aa(this.X(),[new olympe.dc.ba.Ke(olympe.dm.Lb.j.X(),olympe.dc.va.DESTINATION,olympe.dc.ba.Ar.Au,olympe.dc.ba.Ar.Bu),olympe.dm.Lb.H])}ve(){return olympe.sc.xe.Ne.nu}j(){return this.cb(olympe.dm.Lb.j,olympe.dm.Lb)}N(){return this.cb(olympe.dm.Lb.H)}};olympe.dm.Lb.O=olympe.dc.na.j('01612df1db9749227626',olympe.dm.Lb);olympe.dm.Lb.j=olympe.dm.Lb.O.sa('016a697ef00ce7554691');olympe.dm.Lb.ja=R(olympe.dm.Lb.O,olympe.dm.Lb.j);
1081
1081
  olympe.dm.Lb.H=olympe.dm.Lb.O.sa('016a697ef00ce7554692');R(olympe.dc.CloudObject.O,olympe.dm.Lb.H);olympe.dm.Lb.prototype.H.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Lb.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Lb.prototype.N.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Oc=class extends olympe.dm.Lb{j(){return this.X()===olympe.dm.Oc.$?this.cb(olympe.dm.Oc.N,olympe.dm.Lb):this.cb(olympe.dm.Oc.R,olympe.dm.Lb)}};olympe.dm.Oc.O=olympe.dc.na.j('ff021000000000000020',olympe.dm.Oc);olympe.dm.Oc.R=olympe.dm.Oc.O.sa('017e9c34cf48bd6965c1');olympe.dm.Oc.N=olympe.dm.Oc.O.sa('017e9c2e013e06bfffd9');olympe.dm.Oc.ni=olympe.dm.Oc.O.sa('01811f12ad77673770d4');olympe.dm.Oc.$=eg('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Oc.wd=eg('10000000000000000001','OLYMPE_FOLDER');
1082
1082
  olympe.dm.Oc.Pc=eg('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Oc.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{uy(){return this.wb(olympe.dm.Module.N)}Fy(){return this.yd(olympe.dm.Module.R)}Xu(){return this.wb(olympe.dm.Module.D)}Jy(){return this.wb(olympe.dm.Module.Y)}by(){return this.wb(olympe.dm.Module.F)}Gy(){return this.cb(olympe.dm.Module.H,olympe.dm.Module)}Ry(){return this.cb(olympe.dm.Module.j,olympe.dm.Qd)}};olympe.dm.Module.O=olympe.dc.na.j('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.N=olympe.dm.Module.O.ka('ff023000000000000042');
1083
1083
  olympe.dm.Module.R=olympe.dm.Module.O.ka('ff023000000000000043');olympe.dm.Module.D=olympe.dm.Module.O.ka('ff023000000000000044');olympe.dm.Module.Y=olympe.dm.Module.O.ka('ff023000000000000045');olympe.dm.Module.F=olympe.dm.Module.O.ka('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.O.ka('ff023000000000000049');olympe.dm.Module.j=olympe.dm.Module.O.sa('ff022000000000000013');olympe.dm.Module.H=olympe.dm.Module.O.sa('ff022000000000000014');
1084
- olympe.dm.Module.$=eg('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.uy.K=olympe.C.J.D;m.Fy.K=olympe.C.J.F;m.Xu.K=olympe.C.J.D;m.Jy.K=olympe.C.J.D;m.by.K=olympe.C.J.D;m.Gy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Ry.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.fe().fromModel(a);a=b.create(a,f).Ai(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.X()}constructor(a,b,c,d,e){super(a,
1085
- b);this.j=c;this.F=d;this.D=e}Rs(){return this.wb(olympe.dm.File.mimeTypeProp)}gl(a,b){void 0===a&&void 0===b||olympe.ia.Za('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Ya().tc(a),d=b&&olympe.C.Ya().tc(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;})}Bn(a,b){void 0===a&&
1086
- void 0===b||olympe.ia.Za('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Ya().tc(a),d=b&&olympe.C.Ya().tc(e=>null==b?void 0:b(`${e}`));return this.gl().then(e=>{e=cb(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.ia.Za('File.getContentUrl').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&
1087
- olympe.C.Ya().tc(a),d=b&&olympe.C.Ya().tc(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.X()}`;
1088
- null==d||d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.C.Ya().tc(b);olympe.C.jt([a],d=>{const e=new olympe.dc.Xa;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.ob(f=>{c&&c(f)})})}pt(a){this.get(olympe.dm.File.urlProp).startsWith('stream:')?this.j.Y(this.tag).then(()=>this.pt(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))}lq(){return this.wb(olympe.dm.File.urlProp)}kq(){return this.wb(olympe.dm.File.fileNameProp)}iy(){return this.Ej(olympe.dm.File.creationDateProp)}Ey(){return this.Ej(olympe.dm.File.modificationDateProp)}jz(){return this.nh(olympe.dm.File.j)}};
1084
+ olympe.dm.Module.$=eg('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.uy.K=olympe.C.J.D;m.Fy.K=olympe.C.J.F;m.Xu.K=olympe.C.J.D;m.Jy.K=olympe.C.J.D;m.by.K=olympe.C.J.D;m.Gy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Ry.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.fe().fromModel(a);a=b.create(a,f).zi(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.X()}constructor(a,b,c,d,e){super(a,
1085
+ b);this.j=c;this.F=d;this.D=e}Rs(){return this.wb(olympe.dm.File.mimeTypeProp)}gl(a,b){void 0===a&&void 0===b||olympe.ia.Ya('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.$a().tc(a),d=b&&olympe.C.$a().tc(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;})}Bn(a,b){void 0===a&&
1086
+ void 0===b||olympe.ia.Ya('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.$a().tc(a),d=b&&olympe.C.$a().tc(e=>null==b?void 0:b(`${e}`));return this.gl().then(e=>{e=cb(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.ia.Ya('File.getContentUrl').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&
1087
+ olympe.C.$a().tc(a),d=b&&olympe.C.$a().tc(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.X()}`;
1088
+ null==d||d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.C.$a().tc(b);olympe.C.jt([a],d=>{const e=new olympe.dc.Za;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.ob(f=>{c&&c(f)})})}pt(a){this.get(olympe.dm.File.urlProp).startsWith('stream:')?this.j.Y(this.tag).then(()=>this.pt(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))}lq(){return this.wb(olympe.dm.File.urlProp)}kq(){return this.wb(olympe.dm.File.fileNameProp)}iy(){return this.Dj(olympe.dm.File.creationDateProp)}Ey(){return this.Dj(olympe.dm.File.modificationDateProp)}jz(){return this.nh(olympe.dm.File.j)}};
1089
1089
  olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.pt;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.hl;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Bn;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.Ea,olympe.V.P.Eg);olympe.dm.File.nameProp=olympe.dm.File.O.ka('ff023000000000000050');w('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
1090
1090
  olympe.dm.File.fileNameProp=olympe.dm.File.O.ka('ff023000000000000050');w('olympe.dm.File.fileNameProp',olympe.dm.File.fileNameProp);olympe.dm.File.creationDateProp=olympe.dm.File.O.ka('ff023000000000000051');w('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.O.ka('ff023000000000000055');w('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.O.ka('ff023000000000000052');
1091
1091
  w('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.O.ka('ff023000000000000053');w('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.j=olympe.dm.File.O.ka('ff023000000000000054');olympe.dm.File.O.j=olympe.dm.File.D.bind(null,olympe.dm.File);olympe.dm.File.N='application/data';olympe.dm.File.za=[olympe.C.File];m=olympe.dm.File.prototype;m.Rs.K=olympe.C.J.D;m.gl.K=olympe.C.J.j;m.Bn.K=olympe.C.J.j;m.hl.K=olympe.C.J.j;m.rename.K=olympe.C.J.j;
1092
1092
  m.lq.K=olympe.C.J.D;m.kq.K=olympe.C.J.D;m.iy.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Ey.K=new olympe.C.J(()=>olympe.C.eb,[]);m.jz.K=olympe.C.J.N;olympe.dm.Qd=class extends olympe.dc.CloudObject{j(){return this.wb(olympe.dm.Qd.D)}F(){return this.yd(olympe.dm.Qd.F)}D(){return this.cb(olympe.dm.Qd.j,olympe.dm.Module)}};olympe.dm.Qd.O=olympe.dc.na.j('ff021000000000000041',olympe.dm.Qd);olympe.dm.Qd.D=olympe.dm.Qd.O.ka('ff023000000000000047');olympe.dm.Qd.F=olympe.dm.Qd.O.ka('ff023000000000000048');olympe.dm.Qd.j=olympe.dm.Module.j.$b();olympe.dm.Qd.prototype.j.K=olympe.C.J.D;olympe.dm.Qd.prototype.F.K=olympe.C.J.F;
1093
1093
  olympe.dm.Qd.prototype.D.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.ib=class extends olympe.dm.Oc{j(){return this.cb(olympe.dm.Lb.j,olympe.dm.Lb)}F(){return this.wb(olympe.dm.ib.Y)}R(){return this.wb(olympe.dm.ib.mb)}D(){return this.cb(olympe.dm.ib.F,olympe.dm.ib)}};olympe.dm.ib.O=olympe.dc.na.j('0163d9594700fcf61e54',olympe.dm.ib);olympe.dm.ib.Y=olympe.dm.ib.O.ka('017869c7d2833c9492c1');olympe.dm.ib.dt=olympe.dm.ib.O.ka('017869c7d2833c9492c2');olympe.dm.ib.Pe=olympe.dm.ib.O.ka('017869c7d2833c9492c3');olympe.dm.ib.mb=olympe.dm.ib.O.ka('017869c80bb9929c76d0');
1094
- olympe.dm.ib.bb=olympe.dm.ib.O.sa('ff02200000000000002a');olympe.dm.ib.F=olympe.dm.ib.O.sa('ff02200000000000002b');olympe.dm.ib.sg=R(olympe.dm.ib.O,olympe.dm.ib.F);olympe.dm.ib.D=olympe.dm.ib.O.sa('ff02200000000000002c');olympe.dm.ib.tg=olympe.dm.ib.O.sa('017e9c412e2b944bc48f');olympe.dm.ib.ff=olympe.dm.ib.O.sa('017e9c412e2b944bd590');olympe.dm.ib.Zs=olympe.dm.ib.O.sa('017e9c416872a89d3415');olympe.dm.ib.Xs=olympe.dm.ib.O.sa('017ebf8fe5c506662098');R(olympe.dc.CloudObject.O,olympe.dm.ib.bb);
1095
- olympe.dm.ib.Gd=eg('100000000000000000dd','PRIMORDIAL');olympe.dm.ib.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.ib.prototype.F.K=olympe.C.J.D;olympe.dm.ib.prototype.R.K=olympe.C.J.D;olympe.dm.ib.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).Hc()}Wc(){return this.j().la().Bs(this.la())}};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);
1094
+ olympe.dm.ib.Wa=olympe.dm.ib.O.sa('ff02200000000000002a');olympe.dm.ib.F=olympe.dm.ib.O.sa('ff02200000000000002b');olympe.dm.ib.tg=R(olympe.dm.ib.O,olympe.dm.ib.F);olympe.dm.ib.D=olympe.dm.ib.O.sa('ff02200000000000002c');olympe.dm.ib.ug=olympe.dm.ib.O.sa('017e9c412e2b944bc48f');olympe.dm.ib.ff=olympe.dm.ib.O.sa('017e9c412e2b944bd590');olympe.dm.ib.Zs=olympe.dm.ib.O.sa('017e9c416872a89d3415');olympe.dm.ib.Xs=olympe.dm.ib.O.sa('017ebf8fe5c506662098');R(olympe.dc.CloudObject.O,olympe.dm.ib.Wa);
1095
+ olympe.dm.ib.Gd=eg('100000000000000000dd','PRIMORDIAL');olympe.dm.ib.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.ib.prototype.F.K=olympe.C.J.D;olympe.dm.ib.prototype.R.K=olympe.C.J.D;olympe.dm.ib.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.wg(olympe.dm.Property.typeRel).Hc()}Wc(){return this.j().la().Bs(this.la())}};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);
1096
1096
  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)}Ay(){return olympe.C.Ta.EMPTY}Yx(){return this.yd(olympe.dm.Relation.D)}Ky(){return this.yd(olympe.dm.Relation.F)}Ks(){return this.cb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Ic()}Ts(){return this.cb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Ic()}Wc(){return this.Ts().la().concat(['-',this.la(),'->',this.Ks().la()])}};olympe.dm.Relation.O=olympe.dc.na.j('ff021000000000000006',olympe.dm.Relation);
1097
- olympe.dm.Relation.F=olympe.dm.Relation.O.ka('ff023000000000000030');olympe.dm.Relation.D=olympe.dm.Relation.O.ka('ff023000000000000034');olympe.dm.Relation.ea=olympe.dm.Relation.O.ka(olympe.dc.Mb.fp);olympe.dm.Relation.Y=olympe.dm.Relation.O.ka(olympe.dc.Mb.Dc);olympe.dm.Relation.ja=olympe.dm.Relation.O.ka(olympe.dc.Mb.jg);olympe.dm.Relation.ta=olympe.dm.Relation.O.ka(olympe.dc.Mb.tw);olympe.dm.Relation.$=olympe.dm.Relation.O.ka(olympe.dc.Mb.fu);olympe.dm.Relation.Ja=olympe.dm.Relation.O.ka(olympe.dc.Mb.Qw);
1097
+ olympe.dm.Relation.F=olympe.dm.Relation.O.ka('ff023000000000000030');olympe.dm.Relation.D=olympe.dm.Relation.O.ka('ff023000000000000034');olympe.dm.Relation.ea=olympe.dm.Relation.O.ka(olympe.dc.Mb.fp);olympe.dm.Relation.Y=olympe.dm.Relation.O.ka(olympe.dc.Mb.Dc);olympe.dm.Relation.ja=olympe.dm.Relation.O.ka(olympe.dc.Mb.kg);olympe.dm.Relation.ta=olympe.dm.Relation.O.ka(olympe.dc.Mb.tw);olympe.dm.Relation.$=olympe.dm.Relation.O.ka(olympe.dc.Mb.fu);olympe.dm.Relation.Ha=olympe.dm.Relation.O.ka(olympe.dc.Mb.Qw);
1098
1098
  olympe.dm.Relation.R=olympe.dm.Relation.O.ka('ff023000000000000031');olympe.dm.Relation.originModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Kj);w('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Fs);w('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.j={Wp:0,Kt:5,cw:1,OC:4,bs:2,vr:8,cB:10,LC:6,MC:9,Ye:6,NC:9};
1099
1099
  olympe.dm.Relation.H={pC:3,Jv:4,aC:5,$B:6};olympe.dm.Relation.N=olympe.dm.Dl.Lv+olympe.dm.Dl.bu;m=olympe.dm.Relation.prototype;m.Ay.K=olympe.C.J.D;m.Yx.K=olympe.C.J.F;m.Ky.K=olympe.C.J.F;m.Ks.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Ts.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);function jn(a){a=olympe.dc.fa(a);if(olympe.dc.ha().Uf(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.O.X():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.O.X():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.O.X():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.O.X():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.Ie=class extends olympe.dc.CloudObject{getValue(){}};
1100
1100
  olympe.dm.Ie.O=olympe.dc.na.j('ff021000000000000019',olympe.dm.Ie);olympe.dm.String=class extends olympe.dm.Ie{getValue(){return this.wb(olympe.dm.String.valueProp)}Cc(){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.ka('ff023000000000000026');w('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.C.J.D;
1101
- olympe.dm.String.prototype.toString.K=olympe.C.J.j;olympe.dm.Boolean=class extends olympe.dm.Ie{getValue(){return this.nh(olympe.dm.Boolean.valueProp)}Cc(){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.ka('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.Us()}Cc(){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.ka('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.Ej(olympe.dm.DateTime.valueProp)}Cc(){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.ka('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{la(){return olympe.C.ua([super.la(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Ta)}Id(){return this.yd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.O=olympe.dc.na.j('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.ka('017a7690c915975ea995');olympe.dm.Enum.prototype.Id.K=olympe.C.J.F;olympe.dm.fg=class extends olympe.dm.BrickMetadata{Yy(){return this.fb(olympe.dc.CloudObject.instancesRel).xl(olympe.dm.Enum.rankProp,olympe.dc.query.Bk.ASC).Hc()}static create(a,b){b=a.create(olympe.dm.fg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Pa(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.Yy;olympe.dm.fg.O=olympe.dc.na.j('017a768f966fc08ebb98',olympe.dm.fg);olympe.dm.Number=class extends olympe.dm.Ie{getValue(){return this.yd(olympe.dm.Number.valueProp)}Cc(){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.ka('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',Le:'sc.Serializer'};olympe.sc.U={Ve:'sc.app',ag:'sc.debug',jo:'sc.autostartProfiler',bp:'sc.debugger',cu:'sc.disableTheme',PRODUCTION:'sc.production',Kv:'sc.onstartTimeout',qr:'sc.remoteActionTimeout'};
1102
- olympe.W.config(a=>{E(a,olympe.sc.U.Ve,'');E(a,olympe.sc.U.ag,!1);E(a,olympe.sc.U.cu,!0);E(a,olympe.sc.U.PRODUCTION,!1);E(a,olympe.sc.U.Kv,2E4);E(a,olympe.sc.U.qr,3E4);E(a,olympe.sc.U.jo,!1);D(a,olympe.sc.P.Da,[olympe.ia.P.Ea],b=>b.cd('sc'));C(a,olympe.sc.P.Le,olympe.sc.ec,olympe.dc.db.P.Ea);Xa(a,olympe.dc.sources.P.Le,olympe.sc.P.Le);D(a,olympe.sc.P.Kk,[new olympe.W.pa(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.Gg('root','root',null);olympe.sc.Tn=c;c.set(olympe.sc.ya.j.PRODUCTION,b);return new olympe.sc.ya(c)})},
1103
- 'olympe.sc');olympe.W.run([olympe.sc.P.Kk,new olympe.W.pa(olympe.L.U.Ol)],(a,b)=>{olympe.ee().ctx=a;olympe.ee().oVersion=()=>b});olympe.sc.Nn=()=>null!==olympe.dc.ha().Jb(void 0,olympe.sc.Runnable.j.$b());olympe.sc.NE=(a,b,c,d)=>{c=X(X(a.create(olympe.sc.hd),olympe.sc.hd.j,c||null),olympe.sc.hd.F,d||null);a.Pa(olympe.sc.hd.D,c,b);a.Pa(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.uj=(a,b)=>{a=olympe.dc.nb.Zx(b)(a);return a instanceof olympe.sc.Ud?a.j():a};
1104
- olympe.sc.eF=function(a){const b=olympe.dc.CloudObject.containsRel.$b();var c=olympe.dc.fa(a);if(void 0===c)return[];a=olympe.dc.ha();const d=[];let e=[];const f=new Set;for(;!a.Ob(c,olympe.dm.Lb);){f.add(c);const g=a.Jb(c,b);if(null===g)return olympe.ia.Za('sc').warn(`Object ${c} has no container`),[];a.Ob(c,olympe.sc.logic.qb)||g===a.Jb(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.oh(e[0],
1101
+ olympe.dm.String.prototype.toString.K=olympe.C.J.j;olympe.dm.Boolean=class extends olympe.dm.Ie{getValue(){return this.nh(olympe.dm.Boolean.valueProp)}Cc(){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.ka('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.Us()}Cc(){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.ka('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)}Cc(){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.ka('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{la(){return olympe.C.ua([super.la(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Ta)}Id(){return this.yd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.O=olympe.dc.na.j('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.ka('017a7690c915975ea995');olympe.dm.Enum.prototype.Id.K=olympe.C.J.F;olympe.dm.gg=class extends olympe.dm.BrickMetadata{Yy(){return this.fb(olympe.dc.CloudObject.instancesRel).xl(olympe.dm.Enum.rankProp,olympe.dc.query.Bk.ASC).Hc()}static create(a,b){b=a.create(olympe.dm.gg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Pa(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.Yy;olympe.dm.gg.O=olympe.dc.na.j('017a768f966fc08ebb98',olympe.dm.gg);olympe.dm.Number=class extends olympe.dm.Ie{getValue(){return this.yd(olympe.dm.Number.valueProp)}Cc(){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.ka('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',Le:'sc.Serializer'};olympe.sc.U={Ve:'sc.app',bg:'sc.debug',jo:'sc.autostartProfiler',bp:'sc.debugger',cu:'sc.disableTheme',PRODUCTION:'sc.production',Kv:'sc.onstartTimeout',qr:'sc.remoteActionTimeout'};
1102
+ olympe.W.config(a=>{E(a,olympe.sc.U.Ve,'');E(a,olympe.sc.U.bg,!1);E(a,olympe.sc.U.cu,!0);E(a,olympe.sc.U.PRODUCTION,!1);E(a,olympe.sc.U.Kv,2E4);E(a,olympe.sc.U.qr,3E4);E(a,olympe.sc.U.jo,!1);D(a,olympe.sc.P.Da,[olympe.ia.P.Ea],b=>b.cd('sc'));C(a,olympe.sc.P.Le,olympe.sc.ec,olympe.dc.db.P.Ea);Xa(a,olympe.dc.sources.P.Le,olympe.sc.P.Le);D(a,olympe.sc.P.Kk,[new olympe.W.pa(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.Gg('root','root',null);olympe.sc.Tn=c;c.set(olympe.sc.ya.j.PRODUCTION,b);return new olympe.sc.ya(c)})},
1103
+ 'olympe.sc');olympe.W.run([olympe.sc.P.Kk,new olympe.W.pa(olympe.L.U.Ol)],(a,b)=>{olympe.ee().ctx=a;olympe.ee().oVersion=()=>b});olympe.sc.Nn=()=>null!==olympe.dc.ha().Jb(void 0,olympe.sc.Runnable.j.$b());olympe.sc.NE=(a,b,c,d)=>{c=X(X(a.create(olympe.sc.hd),olympe.sc.hd.j,c||null),olympe.sc.hd.F,d||null);a.Pa(olympe.sc.hd.D,c,b);a.Pa(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.tj=(a,b)=>{a=olympe.dc.nb.Zx(b)(a);return a instanceof olympe.sc.Ud?a.j():a};
1104
+ olympe.sc.eF=function(a){const b=olympe.dc.CloudObject.containsRel.$b();var c=olympe.dc.fa(a);if(void 0===c)return[];a=olympe.dc.ha();const d=[];let e=[];const f=new Set;for(;!a.Ob(c,olympe.dm.Lb);){f.add(c);const g=a.Jb(c,b);if(null===g)return olympe.ia.Ya('sc').warn(`Object ${c} has no container`),[];a.Ob(c,olympe.sc.logic.qb)||g===a.Jb(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.oh(e[0],
1105
1105
  olympe.dm.Lb.ja));e=e.concat(a.oh(e[e.length-1],olympe.dm.Oc.R.$b()));e=e.concat(a.oh(e[e.length-1],olympe.dm.Oc.N.$b()));return[...d,...e].reverse()};olympe.sc.fF=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Lg:a.startsWith('video/')?olympe.sc.ci:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Mc:olympe.dm.File};
1106
- olympe.sc.dF=a=>a instanceof olympe.sc.Lg?'image/*':a instanceof olympe.sc.ci?'video/*':a instanceof olympe.sc.Mc?'font/*,application/font-woff':null;olympe.sc.$a={};function kn(a,b){var c=olympe.sc.ya,d=a.state;a=a.Bb();b=olympe.dc.fa(b);let e,f=null==(e=d.j)?void 0:e.get(b);if(!f){f=d.ki(a,void 0,b);for(d=f.getParent();d&&d.ja&&!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.fa(b)))?d:null)?new olympe.sc.ya(a):null}function nn(a){let b;return null!=(b=a.Qa(olympe.sc.ya.j.PRODUCTION))?b:!1}
1107
- olympe.sc.ya=class{constructor(a=olympe.sc.Tn){this.state=a;this.G=olympe.ia.Za('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.ya(a)}return this.j}$x(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.Ra(f,olympe.sc.Wa.$)||a.modelTag&&!b.Ob(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;
1108
- c=e}return c}kf(){return this.state.kf()}Bb(){return this.state.Bb()}set(a,b){this.state.set(a,b);return this}co(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}tb(a,b,c=!1){const d=olympe.dc.fa(a),e=olympe.C.cc(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=
1106
+ olympe.sc.dF=a=>a instanceof olympe.sc.Lg?'image/*':a instanceof olympe.sc.ci?'video/*':a instanceof olympe.sc.Mc?'font/*,application/font-woff':null;olympe.sc.ab={};function kn(a,b){var c=olympe.sc.ya,d=a.state;a=a.Bb();b=olympe.dc.fa(b);let e,f=null==(e=d.j)?void 0:e.get(b);if(!f){f=d.ki(a,void 0,b);for(d=f.getParent();d&&d.ja&&!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.fa(b)))?d:null)?new olympe.sc.ya(a):null}function nn(a){let b;return null!=(b=a.Qa(olympe.sc.ya.j.PRODUCTION))?b:!1}
1107
+ olympe.sc.ya=class{constructor(a=olympe.sc.Tn){this.state=a;this.G=olympe.ia.Ya('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.ya(a)}return this.j}$x(a){const b=olympe.dc.ha();let c=this.getParent();if(!c)return this;const d=e=>{e=e.lf();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Ra(f,olympe.sc.Xa.$)||a.modelTag&&!b.Ob(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;
1108
+ c=e}return c}lf(){return this.state.lf()}Bb(){return this.state.Bb()}set(a,b){this.state.set(a,b);return this}co(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}tb(a,b,c=!1){const d=olympe.dc.fa(a),e=olympe.C.cc(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=
1109
1109
  !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.wh(a.unsubscribe.bind(a));return this}$z(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.ki(`Runner ${a.name()}`);a.run(b);return b}zt(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,
1110
1110
  b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.fa(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.fa(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;
1111
- const d=(null==(c=a.se)?void 0:c.call(a))||this.se();let e,f;c=null!=(f=null==(e=a.Bj)?void 0:e.call(a))?f:0;b=pn(b,c,d);b.stack=a.stack}else b=pn(b,0,this.se());qn(this.state,b);return this}aA(a){this.set(olympe.sc.ya.j.Fg,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)}ki(a){return new olympe.sc.ya(this.state.ki(this.Bb(),a))}ul(a,b){return this.state.ul(a,c=>{b(new olympe.sc.ya(c))})}Iy(a){a=rn(this.state,a);return a===this.state?this:a&&new olympe.sc.ya(a)}destroy(){this.state.destroy()}wh(a,
1111
+ 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=pn(b,c,d);b.stack=a.stack}else b=pn(b,0,this.se());qn(this.state,b);return this}aA(a){this.set(olympe.sc.ya.j.Fg,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)}ki(a){return new olympe.sc.ya(this.state.ki(this.Bb(),a))}ul(a,b){return this.state.ul(a,c=>{b(new olympe.sc.ya(c))})}Iy(a){a=rn(this.state,a);return a===this.state?this:a&&new olympe.sc.ya(a)}destroy(){this.state.destroy()}wh(a,
1112
1112
  b){return this.state.wh(a,b)}sl(a){this.state.sl(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.Bb().onDestroy(a)}Xf(a){this.gb()||this.Bb().Xf(a)}clear(){this.state.clear()}gb(){return this.Bb().gb()||this.Bb().jd()}Ra(a){a=sn(this.state,a);return null!==a?new olympe.sc.ui.KA(a,this):null}ty(a){a=sn(this.state,a);return null!==a?new olympe.sc.ui.JA(a,this):null}Ez(...a){return rxjs.combineLatest(a.map(b=>{b=sn(this.state,b);return null!==b?this.observe(b):rxjs.of(null)}))}Fa(a){return(null==
1113
- 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.Tn;)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.ya.prototype.observeMany=olympe.sc.ya.prototype.Ez;
1113
+ 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.Tn;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.lf();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.ya.prototype.observeMany=olympe.sc.ya.prototype.Ez;
1114
1114
  olympe.sc.ya.prototype.getEvent=olympe.sc.ya.prototype.ty;olympe.sc.ya.prototype.getProperty=olympe.sc.ya.prototype.Ra;olympe.sc.ya.prototype.isDestroyed=olympe.sc.ya.prototype.gb;olympe.sc.ya.prototype.clear=olympe.sc.ya.prototype.clear;olympe.sc.ya.prototype.offDestroy=olympe.sc.ya.prototype.Xf;olympe.sc.ya.prototype.onDestroy=olympe.sc.ya.prototype.onDestroy;olympe.sc.ya.prototype.offClear=olympe.sc.ya.prototype.sl;olympe.sc.ya.prototype.onClear=olympe.sc.ya.prototype.wh;
1115
1115
  olympe.sc.ya.prototype.destroy=olympe.sc.ya.prototype.destroy;olympe.sc.ya.prototype.getOtherContext=olympe.sc.ya.prototype.Iy;olympe.sc.ya.prototype.onContext=olympe.sc.ya.prototype.ul;olympe.sc.ya.prototype.createChild=olympe.sc.ya.prototype.ki;olympe.sc.ya.prototype.setParentElement=olympe.sc.ya.prototype.aA;olympe.sc.ya.prototype['throw']=olympe.sc.ya.prototype.throw;olympe.sc.ya.prototype.waitFor=olympe.sc.ya.prototype.zt;olympe.sc.ya.prototype.runner=olympe.sc.ya.prototype.$z;
1116
1116
  olympe.sc.ya.prototype.repeat=olympe.sc.ya.prototype.repeat;olympe.sc.ya.prototype.observe=olympe.sc.ya.prototype.observe;olympe.sc.ya.prototype.has=olympe.sc.ya.prototype.has;olympe.sc.ya.prototype.get=olympe.sc.ya.prototype.get;olympe.sc.ya.prototype.remove=olympe.sc.ya.prototype.remove;olympe.sc.ya.prototype.trigger=olympe.sc.ya.prototype.co;olympe.sc.ya.prototype.set=olympe.sc.ya.prototype.set;olympe.sc.ya.prototype.getClosest=olympe.sc.ya.prototype.$x;olympe.sc.ya.prototype.getParent=olympe.sc.ya.prototype.getParent;
1117
- olympe.sc.ya.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',REDELIVERED:'__redelivered',Fg:'__htmlContainer',YA:'__dockableElement',ho:'__appHasStarted'};olympe.sc.Uw=class extends olympe.sc.ya{constructor(a){super(a);this.D=new olympe.C.Wb('SC Update Context',super.Bb());const b=a.wh(()=>{b&&a.sl(b);this.D.destroy()})}Bb(){return this.D}wh(a,b){return this.Bb().onDestroy(a,null!=b?b:olympe.V.Kc())}};let tn=0;function on(a,b){b=olympe.dc.fa(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.$)?void 0:c.get('I#'+b))?e:null==(d=a.$)?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.ea&&olympe.dc.ha().Ia(a.ea)){var c=un(olympe.dc.CloudObject.get(a.ea));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)}
1118
- 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()}
1119
- 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.$)?void 0:c.get('IO#'+b))||null}
1117
+ olympe.sc.ya.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',REDELIVERED:'__redelivered',Fg:'__htmlContainer',YA:'__dockableElement',ho:'__appHasStarted'};olympe.sc.Uw=class extends olympe.sc.ya{constructor(a){super(a);this.D=new olympe.C.Wb('SC Update Context',super.Bb());const b=a.wh(()=>{b&&a.sl(b);this.D.destroy()})}Bb(){return this.D}wh(a,b){return this.Bb().onDestroy(a,null!=b?b:olympe.V.Kc())}};let tn=0;function on(a,b){b=olympe.dc.fa(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.$)?void 0:c.get('I#'+b))?e:null==(d=a.$)?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.ea&&olympe.dc.ha().Ja(a.ea)){var c=un(olympe.dc.CloudObject.get(a.ea));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)}
1118
+ 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.ab&&(a.ab=new Map);a.ab.has(b.T())||(a.ab.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()}
1119
+ function zn(a,b){if(null===a.ab||!a.ab.has(b))return!1;const {vl:c,depth:d}=a.ab.get(b);yn(a,f=>{zn(f,b)});0===d&&c.D();const e=a.ab.delete(b);0===a.ab.size&&(a.ab=null);return e}function sn(a,b){let c;return(null==(c=a.$)?void 0:c.get('IO#'+b))||null}
1120
1120
  function An(a){a.D.Yd(()=>{yn(a,c=>c.destroy())});a.D.onDestroy(()=>{void 0!==a.Qa(olympe.sc.ya.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)}
1121
- 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.ja&&!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.ea=olympe.dc.fa(b);a.ja=b.xd().Nn();b.H().forEach(c=>{a.id===c||a.R.has(c)||(a.R.add(c),ln(a,c,a))});a.$=b.D();Cn(a,olympe.sc.$a.qc.j.INIT)}function En(a){a.ta=!0;let b;null==(b=a.j)||b.forEach(c=>{En(c)})}
1121
+ 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.ja&&!c.id.startsWith('_')&&(a=wn(c.j,b)))return a;return null}function Cn(a,b,...c){if(null!==a.ab)for(const {vl:d,depth:e}of a.ab.values())d.process(a,b,e,...c)}function Dn(a,b){a.ea=olympe.dc.fa(b);a.ja=b.xd().Nn();b.H().forEach(c=>{a.id===c||a.R.has(c)||(a.R.add(c),ln(a,c,a))});a.$=b.D();Cn(a,olympe.sc.ab.qc.j.INIT)}function En(a){a.ta=!0;let b;null==(b=a.j)||b.forEach(c=>{En(c)})}
1122
1122
  function Fn(a){a.ta=!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.ta&&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))}}
1123
- 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.qc.D.$e;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)}
1124
- olympe.sc.Gg=class{constructor(a,b='no name',c=olympe.sc.Tn){this.id=a;this.ad=b;this.R=new Set;this.H=c;this.D=new olympe.C.Wb('SC Context');this.data=new Map;this.ea=this.Y=this.j=this.F=null;this.ja=!1;this.N=new Set;this.ta=!1;this.$=null;this.G=olympe.ia.Za('sc');this.$a=null;An(this)}T(){return this.id}getParent(){return this.H}kf(){return this.ea}set(a,b){if(!this.D.jd()&&!this.D.gb()){const g=olympe.dc.fa(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.$)?void 0:c.get('O#'+g))?h:null==
1125
- (d=this.$)?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.Fa))try{var f=b.Fa(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.qc.j.Zg,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.gb()||this.D.jd())return()=>{};const e=on(this,a),f=c?olympe.dc.fa(c):
1126
- '*';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.Ya().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}ki(a,b,c){const d=null!=c?c:'_'+olympe.V.Kc();if(a.gb()||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.Gg(d,
1127
- 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.jd()||this.D.gb()||(Cn(this,olympe.sc.$a.qc.j.dk),this.D.destroy(),Cn(this,olympe.sc.$a.qc.j.$d))}wh(a,b){if(this.D.gb())a();
1128
- else return tn++,b=null!=b?b:String(tn),null===this.Y&&(this.Y=new Map),this.Y.set(b,a),b;return b||'noId'}sl(a){null!==this.Y&&this.Y.delete(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.D.onDestroy(a)}clear(){if(!this.D.gb()){Cn(this,olympe.sc.$a.qc.j.Xj);let a;null==(a=this.Y)||a.forEach(b=>b());Cn(this,olympe.sc.$a.qc.j.Yj)}}gb(){return this.D.gb()}Bb(){return this.D}};olympe.sc.Gg.prototype.getParent=olympe.sc.Gg.prototype.getParent;olympe.sc.Gg.j={pm:'I#',Hm:'O#',RB:'IO#'};function Kn(a,b,c){return(c=c.kf())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.$a.qc=class{constructor(a=-1){this.id=olympe.V.Of();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.$a.qc.j={INIT:'INIT',Zg:'SET',Xj:'CLEAR',Yj:'CLEARED',dk:'DESTROY',$d:'DESTROYED'};olympe.sc.$a.qc.D={$e:'REMOTE',nv:'LOCAL',ig:'PROFILER'};olympe.sc.ae=class a{constructor(){this.D=this.H=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.V.bn(1E4);hb(this.j,b=>{Jn(b)})}$(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.ae.j.Pv:c=this.F.get(e.f);b.dd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.ae.j.Qv: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}`,
1129
- t])})};b.Qn(h).then(()=>{const l=[];k(g,l,0);yn(g,p=>{k(p,l,1)});olympe.L.rb.ld(h,{t:olympe.sc.ae.j.Eu,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.$a.fw(h);xn(g,n);this.j.has(g)?gb(this.j,g):this.j.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.ae.j.Rv:void 0!==g&&this.j.has(g)&&gb(this.j,g);break;case olympe.sc.ae.j.Fh:void 0!==g&&(this.j.delete(g),Jn(g))}}ea(b,c,d){this.N=new olympe.L.rb('discovery_debug_id',
1130
- c);this.N.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.ae.j.du){e=f.i;f=f.f;if(!this.F.has(f)){const g=this.Y(f,c,b);if(0!==g.length)this.F.set(f,g);else return}null===this.D&&(this.D=olympe.V.Of(),f=new olympe.C.Wb(this.D,c.Bb()),this.H=new olympe.L.rb(this.D,f),this.H.listen().subscribe(g=>{this.$(g,b,d)}));olympe.L.rb.ld(e,{t:olympe.sc.ae.j.At,n:olympe.W.getParameter(olympe.sc.U.bp)||'no name',a:b,s:this.D}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Y(b,c,d){const e=
1131
- [],f=olympe.dc.ha(),g=(h,k)=>{yn(h,l=>{if(null!==l.kf()){const n=olympe.dc.CloudObject.get(l.kf()).vg(olympe.sc.Runnable.H).Hc();if(null!==n){const p=k+'/'+f.name(n);n.X()===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.rb.ld(b,{t:olympe.sc.ae.j.Xk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ia.Za('Debugger').error('Error publishing on service : ',f)})}static F(b){if(null===b||void 0===
1132
- b)return'<null>';const c=olympe.dc.ha();if(b instanceof olympe.dc.CloudObject){var d=b.ac();if(!c.Ob(d,olympe.sc.Ac))return b.toString();let f=`${b.Vb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.ma.from(e).ug(olympe.dc.CloudObject.extendRel,!0).ne().fb(olympe.dc.CloudObject.propertyRel).ne().Hc();e=olympe.dc.ma.from(e).ug(olympe.dc.CloudObject.extendRel,!0).ne().fb(olympe.dc.CloudObject.Kj).ne().Hc();d=d.filter(([g])=>g instanceof olympe.sc.Ac);0!==d.length&&(f+='<br> ',
1133
- f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Ra(b.X(),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.ae.H='discovery_debug_id';olympe.sc.ae.j={du:0,At:1,Pv:2,Qv:3,Eu:4,Xk:5,Rv:6,Fh:7};olympe.sc.$a.ZB=class extends olympe.sc.$a.qc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.$a.qc.D.nv}process(a,b,c,...d){if(this.active&&b===olympe.sc.$a.qc.j.Zg){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()}sb(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,
1123
+ 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.ab.qc.D.$e;const c=[];if(null!==a.ab)for(const {vl:d}of a.ab.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)}
1124
+ olympe.sc.Gg=class{constructor(a,b='no name',c=olympe.sc.Tn){this.id=a;this.ad=b;this.R=new Set;this.H=c;this.D=new olympe.C.Wb('SC Context');this.data=new Map;this.ea=this.Y=this.j=this.F=null;this.ja=!1;this.N=new Set;this.ta=!1;this.$=null;this.G=olympe.ia.Ya('sc');this.ab=null;An(this)}T(){return this.id}getParent(){return this.H}lf(){return this.ea}set(a,b){if(!this.D.jd()&&!this.D.gb()){const g=olympe.dc.fa(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.$)?void 0:c.get('O#'+g))?h:null==
1125
+ (d=this.$)?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.Fa))try{var f=b.Fa(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.ab&&0<this.ab.size&&Cn(this,olympe.sc.ab.qc.j.Zg,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.gb()||this.D.jd())return()=>{};const e=on(this,a),f=c?olympe.dc.fa(c):
1126
+ '*';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.$a().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}ki(a,b,c){const d=null!=c?c:'_'+olympe.V.Kc();if(a.gb()||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.Gg(d,
1127
+ b,this));null!==this.ab&&0<this.ab.size&&this.ab.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.jd()||this.D.gb()||(Cn(this,olympe.sc.ab.qc.j.dk),this.D.destroy(),Cn(this,olympe.sc.ab.qc.j.$d))}wh(a,b){if(this.D.gb())a();
1128
+ else return tn++,b=null!=b?b:String(tn),null===this.Y&&(this.Y=new Map),this.Y.set(b,a),b;return b||'noId'}sl(a){null!==this.Y&&this.Y.delete(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.D.onDestroy(a)}clear(){if(!this.D.gb()){Cn(this,olympe.sc.ab.qc.j.Xj);let a;null==(a=this.Y)||a.forEach(b=>b());Cn(this,olympe.sc.ab.qc.j.Yj)}}gb(){return this.D.gb()}Bb(){return this.D}};olympe.sc.Gg.prototype.getParent=olympe.sc.Gg.prototype.getParent;olympe.sc.Gg.j={pm:'I#',Hm:'O#',RB:'IO#'};function Kn(a,b,c){return(c=c.lf())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.ab.qc=class{constructor(a=-1){this.id=olympe.V.jf();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.ab.qc.j={INIT:'INIT',Zg:'SET',Xj:'CLEAR',Yj:'CLEARED',dk:'DESTROY',$d:'DESTROYED'};olympe.sc.ab.qc.D={$e:'REMOTE',nv:'LOCAL',jg:'PROFILER'};olympe.sc.ae=class a{constructor(){this.D=this.H=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.V.bn(1E4);hb(this.j,b=>{Jn(b)})}$(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.ae.j.Pv:c=this.F.get(e.f);b.dd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.ae.j.Qv: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.lf())?v:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
1129
+ t])})};b.Qn(h).then(()=>{const l=[];k(g,l,0);yn(g,p=>{k(p,l,1)});olympe.L.rb.ld(h,{t:olympe.sc.ae.j.Eu,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.ab.fw(h);xn(g,n);this.j.has(g)?gb(this.j,g):this.j.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.ae.j.Rv:void 0!==g&&this.j.has(g)&&gb(this.j,g);break;case olympe.sc.ae.j.Fh:void 0!==g&&(this.j.delete(g),Jn(g))}}ea(b,c,d){this.N=new olympe.L.rb('discovery_debug_id',
1130
+ c);this.N.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.ae.j.du){e=f.i;f=f.f;if(!this.F.has(f)){const g=this.Y(f,c,b);if(0!==g.length)this.F.set(f,g);else return}null===this.D&&(this.D=olympe.V.jf(),f=new olympe.C.Wb(this.D,c.Bb()),this.H=new olympe.L.rb(this.D,f),this.H.listen().subscribe(g=>{this.$(g,b,d)}));olympe.L.rb.ld(e,{t:olympe.sc.ae.j.At,n:olympe.W.getParameter(olympe.sc.U.bp)||'no name',a:b,s:this.D}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Y(b,c,d){const e=
1131
+ [],f=olympe.dc.ha(),g=(h,k)=>{yn(h,l=>{if(null!==l.lf()){const n=olympe.dc.CloudObject.get(l.lf()).wg(olympe.sc.Runnable.H).Hc();if(null!==n){const p=k+'/'+f.name(n);n.X()===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.rb.ld(b,{t:olympe.sc.ae.j.Xk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ia.Ya('Debugger').error('Error publishing on service : ',f)})}static F(b){if(null===b||void 0===
1132
+ b)return'<null>';const c=olympe.dc.ha();if(b instanceof olympe.dc.CloudObject){var d=b.ac();if(!c.Ob(d,olympe.sc.Ac))return b.toString();let f=`${b.Vb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.ma.from(e).vg(olympe.dc.CloudObject.extendRel,!0).ne().fb(olympe.dc.CloudObject.propertyRel).ne().Hc();e=olympe.dc.ma.from(e).vg(olympe.dc.CloudObject.extendRel,!0).ne().fb(olympe.dc.CloudObject.Kj).ne().Hc();d=d.filter(([g])=>g instanceof olympe.sc.Ac);0!==d.length&&(f+='<br> ',
1133
+ f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Ra(b.X(),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.ae.H='discovery_debug_id';olympe.sc.ae.j={du:0,At:1,Pv:2,Qv:3,Eu:4,Xk:5,Rv:6,Fh:7};olympe.sc.ab.ZB=class extends olympe.sc.ab.qc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.ab.qc.D.nv}process(a,b,c,...d){if(this.active&&b===olympe.sc.ab.qc.j.Zg){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.lf();if(!n)break;e.push(n);b=b.getParent()}sb(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,
1134
1134
  q)}}
1135
- olympe.sc.$a.Zv=class extends olympe.sc.$a.qc{constructor(a){super();this.j=a;this.ha=olympe.dc.ha();this.H=new Set}getType(){return olympe.sc.$a.qc.D.ig}process(a,b,c,...d){var e=Mn.pm,f=Mn.Hm,g=Mn.Uv;const h=Mn.INIT,k=Mn.Xj,l=Mn.Yj,n=Mn.dk,p=Mn.$d;c=Mn.Mv;if(b===olympe.sc.$a.qc.j.Zg){const [q,r]=d;b=(d=a.kf())?olympe.dc.ha().Ob(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ha().Ob(d,olympe.sc.ui.QC):!1;b?(g=this.ha.Jb(q,olympe.dm.Property.typeRel),b=this.ha.Ob(q,olympe.sc.logic.vb),d=this.ha.Ob(q,olympe.sc.logic.Gb),
1136
- Ln(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ha.Ob(q,olympe.dm.Property),f=this.ha.Jb(q,olympe.dm.Property.typeRel),Ln(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.$a.qc.j.INIT?Ln(this,a,h):b===olympe.sc.$a.qc.j.Xj?Ln(this,a,k):b===olympe.sc.$a.qc.j.Yj?Ln(this,a,l):b===olympe.sc.$a.qc.j.dk?Ln(this,a,n):b===olympe.sc.$a.qc.j.$d&&Ln(this,a,p)}};
1137
- const Mn={pm:'input',Hm:'output',Uv:'prop',INIT:'init',Xj:'clear',Yj:'cleared',dk:'destroy',$d:'destroyed',Mv:'other'};olympe.sc.$a.fw=class extends olympe.sc.$a.qc{constructor(a){super(1);this.H=a;this.j=new Map;this.db=olympe.dc.ha()}getType(){return olympe.sc.$a.qc.D.$e}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.qc.j.Zg&&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.Vb()instanceof olympe.sc.Ac){const h=ih(this.db,f,()=>{olympe.sc.ae.D(this.H,
1138
- e,f)});this.j.set(e,()=>{jh(this.db,f,h)})}olympe.sc.ae.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{Yu(){return this.yd(this.In())}Zu(){return this.yd(this.Jn())}kl(){return new olympe.C.Zb(this.yd(this.In()),this.yd(this.Jn()))}In(){}Jn(){}};olympe.sc.Metadata.O=olympe.dc.na.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.Yu.K=olympe.C.J.F;m.Zu.K=olympe.C.J.F;m.kl.K=olympe.C.J.R;m.In.K=olympe.C.J.j;m.Jn.K=olympe.C.J.j;olympe.sc.hd=class extends olympe.dc.CloudObject{D(){return this.wb(olympe.sc.hd.F)}j(){return this.wb(olympe.sc.hd.j)}};olympe.sc.hd.O=olympe.dc.na.j('01703376c4a81c0e9d90',olympe.sc.hd);olympe.sc.hd.F=olympe.sc.hd.O.ka('01703376c4a81c0e9d91');olympe.sc.hd.j=olympe.sc.hd.O.ka('01703376c4a81c0e9d92');olympe.sc.hd.D=olympe.sc.hd.O.sa('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.hd.D);olympe.sc.hd.prototype.D.K=olympe.C.J.D;olympe.sc.hd.prototype.j.K=olympe.C.J.D;olympe.sc.xe={};olympe.sc.xe.Ne={nu:'folders',jw:'screenflow',Lw:'ui-design',Mr:'software-intelligence',Ch:'data-management',DC:'projects'};olympe.sc.Ff=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Id(){return this.yd(olympe.sc.Ff.D)}};olympe.sc.Ff.O=olympe.dc.na.j('019131fb930466a1ad79',olympe.sc.Ff);olympe.sc.Ff.D=olympe.sc.Ff.O.ka('016d1bb681929c2cc3f1');olympe.sc.Ff.j=olympe.sc.Ff.O.sa('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.Ff.j);olympe.sc.Ff.prototype.Id.K=olympe.C.J.F;olympe.sc.td=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Ne.Mr}j(){return this.cb(olympe.sc.td.j,olympe.sc.logic.Vh)}D(){return this.cb(olympe.sc.td.D,olympe.sc.logic.Sg)}};olympe.sc.td.O=olympe.dc.na.j('011100000000000adef0',olympe.sc.td);olympe.sc.td.j=olympe.sc.td.O.sa('016ac4f59a2917fdef01');olympe.sc.td.D=olympe.sc.td.O.sa('016ac4f59a2917fdef02');olympe.sc.td.O.j=(a,b)=>$l(a,b||'New function signature',olympe.sc.td,olympe.sc.logic.Cd).X();
1139
- 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 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.Ob(c,olympe.sc.logic.Tb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Ra(c,olympe.sc.logic.Tb.j,!0))?e:0;let f;d=null!=(f=a.db.Ra(d,olympe.sc.logic.Tb.j,!0))?f:0;return c-d});return b}function Pn(a){return On(a,a.db.cb(a.tag,olympe.sc.Wa.F))}function Qn(a){return On(a,a.db.cb(a.tag,olympe.sc.Wa.D))}
1140
- olympe.sc.Wa=class extends olympe.dm.BrickMetadata{av(a,b,c,d,e=!0){e||olympe.ia.Za('sc').error('parameter own= false ignored, investigate');return olympe.C.xh(M(this.Tf(a,olympe.dc.nb.uj,c)),d)}H(){return[]}F(){return rxjs.of([])}Py(){return this.cb(olympe.sc.Wa.N,olympe.sc.Runnable)}ey(){return this.cb(olympe.sc.Wa.R,olympe.sc.Runnable)}vi(){return this.db.Ra(this,olympe.sc.Wa.$)}Nn(){return null!==this.db.Jb(this.tag,olympe.sc.Runnable.j.$b())}$u(){return this.cb(olympe.sc.Wa.F,olympe.sc.logic.vb)}mq(){return this.cb(olympe.sc.Wa.D,
1141
- olympe.sc.logic.Gb)}N(){return[olympe.sc.Wa.bb]}};olympe.sc.Wa.O=olympe.dc.na.j('0112000000000000def0',olympe.sc.Wa);olympe.sc.Wa.$=olympe.sc.Wa.O.ka('01692aa71f3108454479');olympe.sc.Wa.mb=olympe.sc.Wa.O.ka('0166446c1f128ebc903a');olympe.sc.Wa.bb=olympe.sc.Wa.O.ka('0166446c1f128ebc904e');olympe.sc.Wa.N=olympe.sc.Wa.O.sa('01692a4af82e8984742c');olympe.sc.Wa.R=olympe.sc.Wa.O.sa('01692a4af82e8984742d');olympe.sc.Wa.Y=olympe.sc.Wa.O.sa('01692a4af82e8984742e');olympe.sc.Wa.F=olympe.sc.Wa.O.sa('01621fb84e320000f00a');
1142
- olympe.sc.Wa.D=olympe.sc.Wa.O.sa('01621fb84e320000f00b');olympe.sc.Wa.Gd=olympe.sc.Wa.O.sa('0171838bcfed0000e00e');olympe.sc.Wa.wd=olympe.sc.Wa.O.sa('0171838bcfed0000a00a');m=olympe.sc.Wa.prototype;m.av.K=olympe.C.J.j;m.Py.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.ey.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.vi.K=olympe.C.J.j;m.Nn.K=olympe.C.J.j;m.$u.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.mq.K=new olympe.C.J(()=>olympe.dc.Aa,[]);function un(a){let b;return null!=(b=a.xd().N().map(olympe.dc.fa)[0])?b:null}function Rn(a){const b=new olympe.dc.Xa;a=b.create(a);b.persist(a,!1);b.ob((d,e)=>{d||olympe.ia.Za('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.Ya().onDestroy(()=>{const d=new olympe.dc.Xa;d.delete(c);d.ob()});return c}
1135
+ olympe.sc.ab.Zv=class extends olympe.sc.ab.qc{constructor(a){super();this.j=a;this.ha=olympe.dc.ha();this.H=new Set}getType(){return olympe.sc.ab.qc.D.jg}process(a,b,c,...d){var e=Mn.pm,f=Mn.Hm,g=Mn.Uv;const h=Mn.INIT,k=Mn.Xj,l=Mn.Yj,n=Mn.dk,p=Mn.$d;c=Mn.Mv;if(b===olympe.sc.ab.qc.j.Zg){const [q,r]=d;b=(d=a.lf())?olympe.dc.ha().Ob(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ha().Ob(d,olympe.sc.ui.QC):!1;b?(g=this.ha.Jb(q,olympe.dm.Property.typeRel),b=this.ha.Ob(q,olympe.sc.logic.vb),d=this.ha.Ob(q,olympe.sc.logic.Gb),
1136
+ Ln(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ha.Ob(q,olympe.dm.Property),f=this.ha.Jb(q,olympe.dm.Property.typeRel),Ln(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.ab.qc.j.INIT?Ln(this,a,h):b===olympe.sc.ab.qc.j.Xj?Ln(this,a,k):b===olympe.sc.ab.qc.j.Yj?Ln(this,a,l):b===olympe.sc.ab.qc.j.dk?Ln(this,a,n):b===olympe.sc.ab.qc.j.$d&&Ln(this,a,p)}};
1137
+ const Mn={pm:'input',Hm:'output',Uv:'prop',INIT:'init',Xj:'clear',Yj:'cleared',dk:'destroy',$d:'destroyed',Mv:'other'};olympe.sc.ab.fw=class extends olympe.sc.ab.qc{constructor(a){super(1);this.H=a;this.j=new Map;this.db=olympe.dc.ha()}getType(){return olympe.sc.ab.qc.D.$e}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.ab.qc.j.Zg&&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.Vb()instanceof olympe.sc.Ac){const h=ih(this.db,f,()=>{olympe.sc.ae.D(this.H,
1138
+ e,f)});this.j.set(e,()=>{jh(this.db,f,h)})}olympe.sc.ae.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{Yu(){return this.yd(this.In())}Zu(){return this.yd(this.Jn())}kl(){return new olympe.C.Zb(this.yd(this.In()),this.yd(this.Jn()))}In(){}Jn(){}};olympe.sc.Metadata.O=olympe.dc.na.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.Yu.K=olympe.C.J.F;m.Zu.K=olympe.C.J.F;m.kl.K=olympe.C.J.R;m.In.K=olympe.C.J.j;m.Jn.K=olympe.C.J.j;olympe.sc.hd=class extends olympe.dc.CloudObject{D(){return this.wb(olympe.sc.hd.F)}j(){return this.wb(olympe.sc.hd.j)}};olympe.sc.hd.O=olympe.dc.na.j('01703376c4a81c0e9d90',olympe.sc.hd);olympe.sc.hd.F=olympe.sc.hd.O.ka('01703376c4a81c0e9d91');olympe.sc.hd.j=olympe.sc.hd.O.ka('01703376c4a81c0e9d92');olympe.sc.hd.D=olympe.sc.hd.O.sa('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.hd.D);olympe.sc.hd.prototype.D.K=olympe.C.J.D;olympe.sc.hd.prototype.j.K=olympe.C.J.D;olympe.sc.xe={};olympe.sc.xe.Ne={nu:'folders',jw:'screenflow',Lw:'ui-design',Mr:'software-intelligence',Ch:'data-management',DC:'projects'};olympe.sc.Gf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Id(){return this.yd(olympe.sc.Gf.D)}};olympe.sc.Gf.O=olympe.dc.na.j('019131fb930466a1ad79',olympe.sc.Gf);olympe.sc.Gf.D=olympe.sc.Gf.O.ka('016d1bb681929c2cc3f1');olympe.sc.Gf.j=olympe.sc.Gf.O.sa('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.Gf.j);olympe.sc.Gf.prototype.Id.K=olympe.C.J.F;olympe.sc.td=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Ne.Mr}j(){return this.cb(olympe.sc.td.j,olympe.sc.logic.Vh)}D(){return this.cb(olympe.sc.td.D,olympe.sc.logic.Sg)}};olympe.sc.td.O=olympe.dc.na.j('011100000000000adef0',olympe.sc.td);olympe.sc.td.j=olympe.sc.td.O.sa('016ac4f59a2917fdef01');olympe.sc.td.D=olympe.sc.td.O.sa('016ac4f59a2917fdef02');olympe.sc.td.O.j=(a,b)=>$l(a,b||'New function signature',olympe.sc.td,olympe.sc.logic.Cd).X();
1139
+ 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 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.Ob(c,olympe.sc.logic.Tb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Ra(c,olympe.sc.logic.Tb.j,!0))?e:0;let f;d=null!=(f=a.db.Ra(d,olympe.sc.logic.Tb.j,!0))?f:0;return c-d});return b}function Pn(a){return On(a,a.db.cb(a.tag,olympe.sc.Xa.F))}function Qn(a){return On(a,a.db.cb(a.tag,olympe.sc.Xa.D))}
1140
+ olympe.sc.Xa=class extends olympe.dm.BrickMetadata{av(a,b,c,d,e=!0){e||olympe.ia.Ya('sc').error('parameter own= false ignored, investigate');return olympe.C.xh(M(this.Tf(a,olympe.dc.nb.tj,c)),d)}H(){return[]}F(){return rxjs.of([])}Py(){return this.cb(olympe.sc.Xa.N,olympe.sc.Runnable)}ey(){return this.cb(olympe.sc.Xa.R,olympe.sc.Runnable)}vi(){return this.db.Ra(this,olympe.sc.Xa.$)}Nn(){return null!==this.db.Jb(this.tag,olympe.sc.Runnable.j.$b())}$u(){return this.cb(olympe.sc.Xa.F,olympe.sc.logic.vb)}mq(){return this.cb(olympe.sc.Xa.D,
1141
+ olympe.sc.logic.Gb)}N(){return[olympe.sc.Xa.Wa]}};olympe.sc.Xa.O=olympe.dc.na.j('0112000000000000def0',olympe.sc.Xa);olympe.sc.Xa.$=olympe.sc.Xa.O.ka('01692aa71f3108454479');olympe.sc.Xa.mb=olympe.sc.Xa.O.ka('0166446c1f128ebc903a');olympe.sc.Xa.Wa=olympe.sc.Xa.O.ka('0166446c1f128ebc904e');olympe.sc.Xa.N=olympe.sc.Xa.O.sa('01692a4af82e8984742c');olympe.sc.Xa.R=olympe.sc.Xa.O.sa('01692a4af82e8984742d');olympe.sc.Xa.Y=olympe.sc.Xa.O.sa('01692a4af82e8984742e');olympe.sc.Xa.F=olympe.sc.Xa.O.sa('01621fb84e320000f00a');
1142
+ olympe.sc.Xa.D=olympe.sc.Xa.O.sa('01621fb84e320000f00b');olympe.sc.Xa.Gd=olympe.sc.Xa.O.sa('0171838bcfed0000e00e');olympe.sc.Xa.wd=olympe.sc.Xa.O.sa('0171838bcfed0000a00a');m=olympe.sc.Xa.prototype;m.av.K=olympe.C.J.j;m.Py.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.ey.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.vi.K=olympe.C.J.j;m.Nn.K=olympe.C.J.j;m.$u.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.mq.K=new olympe.C.J(()=>olympe.dc.Aa,[]);function un(a){let b;return null!=(b=a.xd().N().map(olympe.dc.fa)[0])?b:null}function Rn(a){const b=new olympe.dc.Za;a=b.create(a);b.persist(a,!1);b.ob((d,e)=>{d||olympe.ia.Ya('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.$a().onDestroy(()=>{const d=new olympe.dc.Za;d.delete(c);d.ob()});return c}
1143
1143
  function Sn(a,b){Dn(b.state,a);Nn(a.xd(),b);const c=a.R(),d=Tn(b,c),e=[];c.forEach((f,g)=>{f===a.ea?e[0]=g:f===a.$&&(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])})}
1144
1144
  function Vn(a,b){let c,d,e;a.G.j()&&(e=a.db.name(a.ac()),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.gb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.Uw(b.state);l.Bb().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`)));
1145
1145
  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.gd&&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.Bb().onDestroy(a.db.D.bind(a.db,b,c,f))}function Wn(a,b){return a.xd().H(b)}
1146
1146
  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.Bb();const e=ih(a.db,a.tag,b.tc((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.nb.Cc(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{jh(a.db,a.tag,e)})}
1147
- olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.Bb().run(()=>{Sn(this,a);this.init(a);a.wh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));Vn(this,a);this.F(a)})}xd(){return this.Vb()}init(a){this.onInit(a)}update(a,b,c){const d=this.xd();if(d.vi())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.Wa.N,a),this.ja()&&Xn(this,
1148
- d,olympe.sc.Wa.Y,a)}F(a){a.co(olympe.sc.Wa.mb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.xd().F(a)}onInit(){}onUpdate(){const a=this.ac(),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.xd())}getOutputs(){return Qn(this.xd())}H(){return[]}D(){return null}ja(){return!1}N(a,
1149
- b,c,d){a=b.tb(a,c,!0);void 0!==d&&olympe.C.xh(a,d);return a}bb(a,b,c,d,e){olympe.C.Sn([d],f=>{b.set(a,olympe.C.$s(f)?f.valueOf():f)});return this.N(a,b,c,e)}R(){return[this.ea,this.$]}ea(a,b){Un(this,a,b,null)}$(a,b){Un(this,a,null,b)}mb(a,b){const c=this.db,d=olympe.sc.logic.qb.F.$b(),e=olympe.sc.logic.qb.D,f=olympe.sc.logic.qb.j;this.Is(d,g=>{var h=g.X();if(h=c.Jb(h,e)||c.Jb(h,f))return Yn(g,a,b.bind(null,h))})}};olympe.sc.Runnable.O=jg(olympe.dc.na.j('01130000000000ca1100',olympe.sc.Runnable));
1150
- olympe.sc.Runnable.H=olympe.sc.Runnable.O.sa('01692a4af82e8984742b');olympe.sc.Runnable.j=olympe.sc.Runnable.O.sa('01756a18d4921c103111');olympe.sc.Runnable.N=R(olympe.sc.Runnable.O,olympe.sc.Wa.N);olympe.sc.Runnable.R=R(olympe.sc.Runnable.O,olympe.sc.Wa.R);olympe.sc.Runnable.Y=R(olympe.sc.Runnable.O,olympe.sc.Wa.Y);R(olympe.sc.Wa.O,olympe.sc.Runnable.H);R(olympe.sc.Wa.O,olympe.sc.Runnable.j);olympe.sc.Runnable.prototype.xd.K=new olympe.C.J(()=>olympe.sc.Wa,[]);
1151
- olympe.sc.Runnable.prototype.N.K=new olympe.C.J(()=>Object,[]);olympe.sc.Runnable.prototype.bb.K=olympe.C.J.j;function Zn(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Ud)return(a=a.D())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.Ud=class extends olympe.dc.CloudObject{D(){return this.db.cb(this,olympe.sc.Ud.j)[0]}j(){const a=Zn(this);return olympe.dc.CloudObject.get(a)}Cc(){return this.j().Cc()}toString(){const a=Zn(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Ud.O=olympe.dc.na.j('0163c9ae01f2d6e9ca49',olympe.sc.Ud);
1147
+ olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.Bb().run(()=>{Sn(this,a);this.init(a);a.wh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));Vn(this,a);this.F(a)})}xd(){return this.Vb()}init(a){this.onInit(a)}update(a,b,c){const d=this.xd();if(d.vi())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.Xa.N,a),this.ja()&&Xn(this,
1148
+ d,olympe.sc.Xa.Y,a)}F(a){a.co(olympe.sc.Xa.mb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.xd().F(a)}onInit(){}onUpdate(){const a=this.ac(),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.xd())}getOutputs(){return Qn(this.xd())}H(){return[]}D(){return null}ja(){return!1}N(a,
1149
+ b,c,d){a=b.tb(a,c,!0);void 0!==d&&olympe.C.xh(a,d);return a}Wa(a,b,c,d,e){olympe.C.Sn([d],f=>{b.set(a,olympe.C.$s(f)?f.valueOf():f)});return this.N(a,b,c,e)}R(){return[this.ea,this.$]}ea(a,b){Un(this,a,b,null)}$(a,b){Un(this,a,null,b)}mb(a,b){const c=this.db,d=olympe.sc.logic.qb.F.$b(),e=olympe.sc.logic.qb.D,f=olympe.sc.logic.qb.j;this.Is(d,g=>{var h=g.X();if(h=c.Jb(h,e)||c.Jb(h,f))return Yn(g,a,b.bind(null,h))})}};olympe.sc.Runnable.O=jg(olympe.dc.na.j('01130000000000ca1100',olympe.sc.Runnable));
1150
+ olympe.sc.Runnable.H=olympe.sc.Runnable.O.sa('01692a4af82e8984742b');olympe.sc.Runnable.j=olympe.sc.Runnable.O.sa('01756a18d4921c103111');olympe.sc.Runnable.N=R(olympe.sc.Runnable.O,olympe.sc.Xa.N);olympe.sc.Runnable.R=R(olympe.sc.Runnable.O,olympe.sc.Xa.R);olympe.sc.Runnable.Y=R(olympe.sc.Runnable.O,olympe.sc.Xa.Y);R(olympe.sc.Xa.O,olympe.sc.Runnable.H);R(olympe.sc.Xa.O,olympe.sc.Runnable.j);olympe.sc.Runnable.prototype.xd.K=new olympe.C.J(()=>olympe.sc.Xa,[]);
1151
+ 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.Ud)return(a=a.D())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.Ud=class extends olympe.dc.CloudObject{D(){return this.db.cb(this,olympe.sc.Ud.j)[0]}j(){const a=Zn(this);return olympe.dc.CloudObject.get(a)}Cc(){return this.j().Cc()}toString(){const a=Zn(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Ud.O=olympe.dc.na.j('0163c9ae01f2d6e9ca49',olympe.sc.Ud);
1152
1152
  olympe.sc.Ud.j=olympe.sc.Ud.O.sa('0169b5a8a33144fb0b49');R(olympe.dc.CloudObject.O,olympe.sc.Ud.j);olympe.sc.Ud.prototype.D.K=new olympe.C.J(()=>String,[]);olympe.sc.Ud.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.gp=class extends olympe.dm.Lb{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.gp.O=olympe.dc.na.j('0163a68ce44f3d1fa84c',olympe.sc.gp);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.sa('016324fde11a836087c2');olympe.sc.Ac.O.j=function(a,b){return $l(a,null!=b?b:'New type',olympe.sc.Ac).X()};let $n=null,ao=null,bo=[];
1153
- function co(a,b){$n=a;const c=olympe.C.Ya();return olympe.dc.sd.from(a).fb(olympe.sc.qa.Zc.j).fb(olympe.sc.sf.j.$b()).ob({ji:'__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.ha();return new Promise(g=>{xi(c,d,h=>{h=f.wi(h)?h:f.model(h);return null!==h&&f.Ob(h,olympe.sc.Ac)},{$n:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ia.Za('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
1154
- g()}))})}olympe.ia.Za('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ia.Za('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{bo=null;throw d;})}function Lf(){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.sa('017b3aa8fd1659291b92');
1155
- olympe.sc.sf.D=olympe.sc.sf.O.sa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.na.j('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Pg=class extends olympe.sc.Map{};olympe.sc.Pg.O=olympe.dc.na.j('01631aacd8276ea98490',olympe.sc.Pg);olympe.sc.File=class extends olympe.dm.File{static Bx(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.rt(a,e,b,c,d);return e}static Cx(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Zn(a,e,b,c,d);return e}static rt(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.Zn(a,b,c,d,e)}static Zn(a,b,c,d,e){const f=olympe.dc.ha(),g=f.Ia(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Uf(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
1153
+ function co(a,b){$n=a;const c=olympe.C.$a();return olympe.dc.sd.from(a).fb(olympe.sc.qa.Zc.j).fb(olympe.sc.tf.j.$b()).ob({ji:'__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.ha();return new Promise(g=>{xi(c,d,h=>{h=f.wi(h)?h:f.model(h);return null!==h&&f.Ob(h,olympe.sc.Ac)},{$n:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ia.Ya('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
1154
+ g()}))})}olympe.ia.Ya('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ia.Ya('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{bo=null;throw d;})}function Lf(){return null===bo?Promise.resolve():new Promise(a=>{bo.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.sa('017b3aa8fd1659291b92');
1155
+ olympe.sc.tf.D=olympe.sc.tf.O.sa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.na.j('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Pg=class extends olympe.sc.Map{};olympe.sc.Pg.O=olympe.dc.na.j('01631aacd8276ea98490',olympe.sc.Pg);olympe.sc.File=class extends olympe.dm.File{static Bx(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.rt(a,e,b,c,d);return e}static Cx(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Zn(a,e,b,c,d);return e}static rt(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.Zn(a,b,c,d,e)}static Zn(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.Uf(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
1156
1156
  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.Ra(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.j,!1);a.ht(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.Zn;olympe.sc.File.setContent=olympe.sc.File.rt;olympe.sc.File.createFromURL=olympe.sc.File.Cx;olympe.sc.File.createFromContent=olympe.sc.File.Bx;
1157
1157
  olympe.sc.File.O=dg(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Lg=class extends olympe.sc.File{H(){const a=olympe.C.cc(olympe.C.Ta);this.hl(b=>{a.update(olympe.C.xb(b))});return a.tb()}};olympe.sc.Lg.O=dg(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Lg);olympe.sc.Lg.O.j=olympe.sc.File.D.bind(null,olympe.sc.Lg);olympe.sc.Lg.prototype.H.K=olympe.C.J.D;olympe.sc.Mc=class extends olympe.sc.File{H(){return this.wb(olympe.sc.Mc.fontFamilyProp)}N(){return this.wb(olympe.sc.Mc.F)}R(){return this.yd(olympe.sc.Mc.H)}};olympe.sc.Mc.O=dg(olympe.sc.File,'01647e113043c637b541',olympe.sc.Mc);olympe.sc.Mc.fontFamilyProp=olympe.sc.Mc.O.ka('01647e35ecd24ef0b88d');olympe.sc.Mc.F=olympe.sc.Mc.O.ka('01647e677f5d1cfbdf42');olympe.sc.Mc.H=olympe.sc.Mc.O.ka('01647e6780999bf8bd25');
1158
1158
  olympe.sc.Mc.O.j=(a,b,c,d)=>{c=olympe.sc.File.D(olympe.sc.Mc,a,b,c,d);a.update(c,olympe.sc.Mc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Mc.prototype.H.K=olympe.C.J.D;olympe.sc.Mc.prototype.N.K=olympe.C.J.D;olympe.sc.Mc.prototype.R.K=olympe.C.J.F;olympe.sc.ci=class extends olympe.sc.File{};olympe.sc.ci.O=dg(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.ci);olympe.sc.ci.O.j=olympe.sc.File.D.bind(null,olympe.sc.ci);olympe.sc.ls=class extends olympe.dc.CloudObject{};olympe.sc.ls.O=olympe.dc.na.j('016421bb3797e22d1c4e',olympe.sc.ls);olympe.sc.logic={};olympe.sc.logic.Mp=(a,b)=>a===b?0:a>b?1:-1;
1159
- olympe.sc.logic.YB=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.C.Qa(b.getType().X());let k,l;if(b===olympe.dc.fa(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.wb(h).toLowerCase();else if(b===olympe.dc.fa(olympe.dm.Number))k=c.valueOf(),l=p=>p.yd(h);else if(b===olympe.dc.fa(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.C.ua([p.Ej(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);
1160
- 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.ua([l(p)],q=>{q=n(q.valueOf(),k);return olympe.C.Sb(d.valueOf()?1===q:0<=q)},olympe.C.da,'FilterList ListDefBuilder Filter TransformFlows')).Yi())};
1159
+ olympe.sc.logic.YB=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.C.Qa(b.getType().X());let k,l;if(b===olympe.dc.fa(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.wb(h).toLowerCase();else if(b===olympe.dc.fa(olympe.dm.Number))k=c.valueOf(),l=p=>p.yd(h);else if(b===olympe.dc.fa(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.C.ua([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);
1160
+ 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.ua([l(p)],q=>{q=n(q.valueOf(),k);return olympe.C.Sb(d.valueOf()?1===q:0<=q)},olympe.C.da,'FilterList ListDefBuilder Filter TransformFlows')).Xi())};
1161
1161
  olympe.sc.logic.LE=(a,b)=>{if(a instanceof olympe.C.aa)return a;if(a instanceof olympe.C.Ta)return a.vt();if(a instanceof olympe.C.da)return a.Ss();if('string'===typeof a||'number'===typeof a)return olympe.C.ra(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.C.aa.yq};olympe.sc.logic.Sa={};function eo(a){ig(a.O,(b,c)=>{b=b.create(a.O.D);X(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Sa.Ap=class{constructor(a,b,c){this.O=olympe.dc.na.j(a,b,...c);eo(this)}X(){return this.O.X()}};olympe.sc.logic.Sa.Ap.za=[olympe.dc.Ze];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 fg(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,bF:b,IE:c});return d}
1162
- 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.Sa.Ap(a,b,[olympe.sc.P.Da].concat(c));return fo[a]=b}};olympe.sc.logic.NA=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)}Dy(){return this.message}Bj(){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;
1163
- olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Bj;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Dy;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.Oi=class extends olympe.sc.logic.ak{};olympe.sc.logic.Oi.O=olympe.dc.na.j('016eeb5ede9f3094d8f0',olympe.sc.logic.Oi);olympe.sc.logic.rd=class extends olympe.dc.CloudObject{j(){return this.Sc(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.ka('017bc044aeacce7ffc8f');olympe.sc.logic.rd.j=olympe.sc.logic.rd.O.sa('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.Vh=class extends olympe.sc.logic.rd{};olympe.sc.logic.Vh.O=olympe.dc.na.j('016ac4f59c592b862457',olympe.sc.logic.Vh);olympe.sc.logic.Vh.F=olympe.sc.td.j.$b();olympe.sc.logic.Vh.O.j=(a,b,c,d,e)=>{b=$l(a,b||'New Predefined Input',olympe.sc.logic.Vh,olympe.sc.logic.vb);X(b,olympe.sc.logic.rd.D,e);a.Pa(olympe.sc.logic.rd.j,b,c);a.Pa(olympe.sc.td.j,d,b);return b.X()};olympe.sc.logic.Sg=class extends olympe.sc.logic.rd{};olympe.sc.logic.Sg.O=olympe.dc.na.j('016ac4f59dd99f5df3e1',olympe.sc.logic.Sg);olympe.sc.logic.Sg.F=R(olympe.sc.logic.Sg.O,olympe.sc.td.D);olympe.sc.logic.Sg.O.j=(a,b,c,d,e)=>{b=$l(a,b||'New Predefined Output',olympe.sc.logic.Sg,olympe.sc.logic.Gb);X(b,olympe.sc.logic.rd.D,e);a.Pa(olympe.sc.logic.rd.j,b,c);a.Pa(olympe.sc.td.D,d,b);return b.X()};olympe.sc.logic.Cd=class extends olympe.sc.Wa{ve(){return olympe.sc.xe.Ne.Mr}Y(){return this.Cn().bl().Ob([olympe.sc.logic.Function]).and().Ad().Ob([olympe.sc.logic.od,olympe.sc.logic.gd]).Yi()}N(){const a=olympe.dc.fa(olympe.sc.logic.Oi);return this.db.cb(this,olympe.sc.logic.Cd.D).filter(b=>this.db.Jb(b,olympe.sc.logic.Tb.typeRel)===a)}j(a){const b=this.db.zn(this,[olympe.sc.Wa.F],c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}D(a){const b=this.db.zn(this,[olympe.sc.Wa.D],
1164
- c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}H(a){if(!this.vi())return super.H(a);const b=olympe.dc.fa(olympe.sc.logic.ak),c=olympe.dc.fa(olympe.sc.logic.Oi);return Qn(this).map(d=>{switch(this.db.Jb(d,olympe.sc.logic.Tb.typeRel)){case b:return a.co.bind(a,d);case c:return a.throw.bind(a);default:return a.set.bind(a,d)}})}F(a){if(!this.vi())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=>
1162
+ 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.Sa.Ap(a,b,[olympe.sc.P.Da].concat(c));return fo[a]=b}};olympe.sc.logic.NA=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)}Dy(){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;
1163
+ olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Aj;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Dy;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.Sc(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.ka('017bc044aeacce7ffc8f');olympe.sc.logic.rd.j=olympe.sc.logic.rd.O.sa('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.Vh=class extends olympe.sc.logic.rd{};olympe.sc.logic.Vh.O=olympe.dc.na.j('016ac4f59c592b862457',olympe.sc.logic.Vh);olympe.sc.logic.Vh.F=olympe.sc.td.j.$b();olympe.sc.logic.Vh.O.j=(a,b,c,d,e)=>{b=$l(a,b||'New Predefined Input',olympe.sc.logic.Vh,olympe.sc.logic.vb);X(b,olympe.sc.logic.rd.D,e);a.Pa(olympe.sc.logic.rd.j,b,c);a.Pa(olympe.sc.td.j,d,b);return b.X()};olympe.sc.logic.Sg=class extends olympe.sc.logic.rd{};olympe.sc.logic.Sg.O=olympe.dc.na.j('016ac4f59dd99f5df3e1',olympe.sc.logic.Sg);olympe.sc.logic.Sg.F=R(olympe.sc.logic.Sg.O,olympe.sc.td.D);olympe.sc.logic.Sg.O.j=(a,b,c,d,e)=>{b=$l(a,b||'New Predefined Output',olympe.sc.logic.Sg,olympe.sc.logic.Gb);X(b,olympe.sc.logic.rd.D,e);a.Pa(olympe.sc.logic.rd.j,b,c);a.Pa(olympe.sc.td.D,d,b);return b.X()};olympe.sc.logic.Cd=class extends olympe.sc.Xa{ve(){return olympe.sc.xe.Ne.Mr}Y(){return this.Cn().bl().Ob([olympe.sc.logic.Function]).and().Ad().Ob([olympe.sc.logic.od,olympe.sc.logic.gd]).Xi()}N(){const a=olympe.dc.fa(olympe.sc.logic.Ni);return this.db.cb(this,olympe.sc.logic.Cd.D).filter(b=>this.db.Jb(b,olympe.sc.logic.Tb.typeRel)===a)}j(a){const b=this.db.zn(this,[olympe.sc.Xa.F],c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}D(a){const b=this.db.zn(this,[olympe.sc.Xa.D],
1164
+ c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}H(a){if(!this.vi())return super.H(a);const b=olympe.dc.fa(olympe.sc.logic.ak),c=olympe.dc.fa(olympe.sc.logic.Ni);return Qn(this).map(d=>{switch(this.db.Jb(d,olympe.sc.logic.Tb.typeRel)){case b:return a.co.bind(a,d);case c:return a.throw.bind(a);default:return a.set.bind(a,d)}})}F(a){if(!this.vi())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=>
1165
1165
  c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Cd.O=io('01621fb84e320000f000',olympe.sc.logic.Cd,olympe.sc.logic.Function);olympe.sc.logic.Cd.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Cd.prototype.D.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);let jo=null;function ko(){if(null===jo){let a;jo=null!=(a=olympe.W.getParameter('sc.action.experimental'))?a:!1}return jo}
1166
- olympe.sc.logic.$f=class extends olympe.sc.logic.Cd{R(){return this.j('016ac63229782039429f')}$(){return this.D('016ac6322acf67eebfe7')}ea(){return this.mq().bl().fb(olympe.sc.logic.Tb.typeRel).ol(olympe.sc.logic.Oi).Yi().Bf().On(olympe.C.aa.ZERO)}F(a){if(this.vi()||ko()){const b=this.R().X();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.H='016ac6322acf67eebfe7';
1167
- 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.vb,[]);olympe.sc.logic.$f.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.$f.prototype.ea.K=olympe.C.J.N;olympe.sc.logic.Ro=class extends olympe.sc.logic.Cd{};olympe.sc.logic.Ro.O=io('01621fb84e320000f011',olympe.sc.logic.Ro);olympe.sc.logic.Qo=class extends olympe.sc.logic.$f{};olympe.sc.logic.Qo.O=io('01621fb84e320000f012',olympe.sc.logic.Qo);olympe.sc.logic.Function=class extends olympe.sc.Runnable{R(){return[this.mb]}D(){if(!this.xd().vi())return super.D();const a=olympe.sc.Gg.j.pm,b=olympe.sc.Gg.j.Hm,c=this.db,d=new Map,e=this.ac();c.cb(e,olympe.sc.Wa.F).forEach(f=>{d.set(a+c.name(f),f)});c.cb(e,olympe.sc.Wa.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.Tb=class extends olympe.dc.CloudObject{getType(){return this.Sc(olympe.sc.logic.Tb.typeRel,olympe.dc.CloudObject)}j(){return this.yd(olympe.sc.logic.Tb.j)}};olympe.sc.logic.Tb.O=olympe.dc.na.j('0168a431d25001540000',olympe.sc.logic.Tb);olympe.sc.logic.Tb.j=olympe.sc.logic.Tb.O.ka('01740c5d4ae4b520dd01');olympe.sc.logic.Tb.typeRel=olympe.sc.logic.Tb.O.sa('0168a431d3b9b7438424');R(olympe.dc.CloudObject.O,olympe.sc.logic.Tb.typeRel);
1168
- olympe.sc.logic.Tb.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Tb.prototype.j.K=olympe.C.J.F;olympe.sc.logic.vb=class extends olympe.sc.logic.Tb{};olympe.sc.logic.vb.O=olympe.dc.na.j('0168a431d25001540001',olympe.sc.logic.vb);olympe.sc.logic.vb.R=olympe.sc.logic.Tb.O.ka('01740c5d4ae4b520dd02');olympe.sc.logic.vb.N=R(olympe.sc.logic.vb.O,olympe.sc.Wa.F);olympe.sc.logic.vb.D=olympe.sc.logic.vb.O.sa('0168a431d91f2578000b',olympe.dc.va.ORIGIN);olympe.sc.logic.vb.F=olympe.sc.logic.vb.O.sa('01621fb84e32000000a1',olympe.dc.va.ORIGIN);
1169
- olympe.sc.logic.vb.H=olympe.sc.logic.vb.O.sa('01621fb84e32000000d1',olympe.dc.va.ORIGIN);olympe.sc.logic.vb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.vb){f=a.create(f);X(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Pa(olympe.sc.logic.Tb.typeRel,f,c);void 0!==e&&X(f,olympe.sc.logic.Tb.j,e);d&&a.Pa(olympe.sc.Wa.F,d,f);return f.X()};olympe.sc.logic.Gb=class extends olympe.sc.logic.Tb{};olympe.sc.logic.Gb.O=olympe.dc.na.j('0168a431d25001540002',olympe.sc.logic.Gb);olympe.sc.logic.Gb.N=R(olympe.sc.logic.Gb.O,olympe.sc.Wa.D);olympe.sc.logic.Gb.D=olympe.sc.logic.Gb.O.sa('0168a431d91f25780003',olympe.dc.va.ORIGIN);olympe.sc.logic.Gb.H=olympe.sc.logic.Gb.O.sa('01621fb84e32000000a2',olympe.dc.va.ORIGIN);olympe.sc.logic.Gb.F=olympe.sc.logic.Gb.O.sa('01621fb84e32000000d2',olympe.dc.va.ORIGIN);
1170
- olympe.sc.logic.Gb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.Gb){f=a.create(f);X(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Pa(olympe.sc.logic.Tb.typeRel,f,c);void 0!==e&&X(f,olympe.sc.logic.Tb.j,e);d&&a.Pa(olympe.sc.Wa.D,d,f);return f.X()};olympe.sc.logic.od=class extends olympe.sc.logic.Function{run(a){Sn(this,a);const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.od.F),d=this.db.Jb(this,olympe.sc.logic.od.D);a.on(c,e=>b.set(d,e),this.tag)}j(){return this.vg(olympe.sc.logic.od.F).Hc()}ta(){return this.vg(olympe.sc.logic.od.D).Hc()}};olympe.sc.logic.od.O=olympe.dc.na.j('01621fb84e32000000a0',olympe.sc.logic.od,olympe.sc.P.Da);olympe.sc.logic.od.F=R(olympe.sc.logic.od.O,olympe.sc.logic.vb.F);
1171
- olympe.sc.logic.od.D=R(olympe.sc.logic.od.O,olympe.sc.logic.Gb.H);olympe.sc.logic.od.O.j=function(a,b,c){b=a.create(olympe.sc.logic.od);a.Pa(olympe.sc.logic.od.D,b,c);return b.X()};olympe.sc.logic.od.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.od.prototype.ta.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.gd=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.gd.D),d=this.db.Jb(this,olympe.sc.logic.gd.F);b.on(c,e=>a.set(d,e),b.T())}ta(){return this.vg(olympe.sc.logic.gd.D).Hc()}j(){return this.vg(olympe.sc.logic.gd.F).Hc()}};olympe.sc.logic.gd.O=olympe.dc.na.j('01621fb84e32000000d0',olympe.sc.logic.gd,olympe.sc.P.Da);olympe.sc.logic.gd.D=R(olympe.sc.logic.gd.O,olympe.sc.logic.vb.H);olympe.sc.logic.gd.F=R(olympe.sc.logic.gd.O,olympe.sc.logic.Gb.F);
1166
+ olympe.sc.logic.ag=class extends olympe.sc.logic.Cd{R(){return this.j('016ac63229782039429f')}$(){return this.D('016ac6322acf67eebfe7')}ea(){return this.mq().bl().fb(olympe.sc.logic.Tb.typeRel).ol(olympe.sc.logic.Ni).Xi().Cf().On(olympe.C.aa.ZERO)}F(a){if(this.vi()||ko()){const b=this.R().X();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.ag.j='016ac63229782039429f';olympe.sc.logic.ag.H='016ac6322acf67eebfe7';
1167
+ olympe.sc.logic.ag.O=io('01621fb84e320000a000',olympe.sc.logic.ag,olympe.sc.logic.Action);olympe.sc.logic.ag.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.ag.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.ag.prototype.ea.K=olympe.C.J.N;olympe.sc.logic.Ro=class extends olympe.sc.logic.Cd{};olympe.sc.logic.Ro.O=io('01621fb84e320000f011',olympe.sc.logic.Ro);olympe.sc.logic.Qo=class extends olympe.sc.logic.ag{};olympe.sc.logic.Qo.O=io('01621fb84e320000f012',olympe.sc.logic.Qo);olympe.sc.logic.Function=class extends olympe.sc.Runnable{R(){return[this.mb]}D(){if(!this.xd().vi())return super.D();const a=olympe.sc.Gg.j.pm,b=olympe.sc.Gg.j.Hm,c=this.db,d=new Map,e=this.ac();c.cb(e,olympe.sc.Xa.F).forEach(f=>{d.set(a+c.name(f),f)});c.cb(e,olympe.sc.Xa.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.Tb=class extends olympe.dc.CloudObject{getType(){return this.Sc(olympe.sc.logic.Tb.typeRel,olympe.dc.CloudObject)}j(){return this.yd(olympe.sc.logic.Tb.j)}};olympe.sc.logic.Tb.O=olympe.dc.na.j('0168a431d25001540000',olympe.sc.logic.Tb);olympe.sc.logic.Tb.j=olympe.sc.logic.Tb.O.ka('01740c5d4ae4b520dd01');olympe.sc.logic.Tb.typeRel=olympe.sc.logic.Tb.O.sa('0168a431d3b9b7438424');R(olympe.dc.CloudObject.O,olympe.sc.logic.Tb.typeRel);
1168
+ olympe.sc.logic.Tb.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Tb.prototype.j.K=olympe.C.J.F;olympe.sc.logic.vb=class extends olympe.sc.logic.Tb{};olympe.sc.logic.vb.O=olympe.dc.na.j('0168a431d25001540001',olympe.sc.logic.vb);olympe.sc.logic.vb.R=olympe.sc.logic.Tb.O.ka('01740c5d4ae4b520dd02');olympe.sc.logic.vb.N=R(olympe.sc.logic.vb.O,olympe.sc.Xa.F);olympe.sc.logic.vb.D=olympe.sc.logic.vb.O.sa('0168a431d91f2578000b',olympe.dc.va.ORIGIN);olympe.sc.logic.vb.F=olympe.sc.logic.vb.O.sa('01621fb84e32000000a1',olympe.dc.va.ORIGIN);
1169
+ olympe.sc.logic.vb.H=olympe.sc.logic.vb.O.sa('01621fb84e32000000d1',olympe.dc.va.ORIGIN);olympe.sc.logic.vb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.vb){f=a.create(f);X(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Pa(olympe.sc.logic.Tb.typeRel,f,c);void 0!==e&&X(f,olympe.sc.logic.Tb.j,e);d&&a.Pa(olympe.sc.Xa.F,d,f);return f.X()};olympe.sc.logic.Gb=class extends olympe.sc.logic.Tb{};olympe.sc.logic.Gb.O=olympe.dc.na.j('0168a431d25001540002',olympe.sc.logic.Gb);olympe.sc.logic.Gb.N=R(olympe.sc.logic.Gb.O,olympe.sc.Xa.D);olympe.sc.logic.Gb.D=olympe.sc.logic.Gb.O.sa('0168a431d91f25780003',olympe.dc.va.ORIGIN);olympe.sc.logic.Gb.H=olympe.sc.logic.Gb.O.sa('01621fb84e32000000a2',olympe.dc.va.ORIGIN);olympe.sc.logic.Gb.F=olympe.sc.logic.Gb.O.sa('01621fb84e32000000d2',olympe.dc.va.ORIGIN);
1170
+ olympe.sc.logic.Gb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.Gb){f=a.create(f);X(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Pa(olympe.sc.logic.Tb.typeRel,f,c);void 0!==e&&X(f,olympe.sc.logic.Tb.j,e);d&&a.Pa(olympe.sc.Xa.D,d,f);return f.X()};olympe.sc.logic.od=class extends olympe.sc.logic.Function{run(a){Sn(this,a);const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.od.F),d=this.db.Jb(this,olympe.sc.logic.od.D);a.on(c,e=>b.set(d,e),this.tag)}j(){return this.wg(olympe.sc.logic.od.F).Hc()}ta(){return this.wg(olympe.sc.logic.od.D).Hc()}};olympe.sc.logic.od.O=olympe.dc.na.j('01621fb84e32000000a0',olympe.sc.logic.od,olympe.sc.P.Da);olympe.sc.logic.od.F=R(olympe.sc.logic.od.O,olympe.sc.logic.vb.F);
1171
+ olympe.sc.logic.od.D=R(olympe.sc.logic.od.O,olympe.sc.logic.Gb.H);olympe.sc.logic.od.O.j=function(a,b,c){b=a.create(olympe.sc.logic.od);a.Pa(olympe.sc.logic.od.D,b,c);return b.X()};olympe.sc.logic.od.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.od.prototype.ta.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.gd=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.gd.D),d=this.db.Jb(this,olympe.sc.logic.gd.F);b.on(c,e=>a.set(d,e),b.T())}ta(){return this.wg(olympe.sc.logic.gd.D).Hc()}j(){return this.wg(olympe.sc.logic.gd.F).Hc()}};olympe.sc.logic.gd.O=olympe.dc.na.j('01621fb84e32000000d0',olympe.sc.logic.gd,olympe.sc.P.Da);olympe.sc.logic.gd.D=R(olympe.sc.logic.gd.O,olympe.sc.logic.vb.H);olympe.sc.logic.gd.F=R(olympe.sc.logic.gd.O,olympe.sc.logic.Gb.F);
1172
1172
  olympe.sc.logic.gd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.gd);a.Pa(olympe.sc.logic.gd.D,b,c);return b.X()};olympe.sc.logic.gd.prototype.ta.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.gd.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);function Yn(a,b,c){var d;const e=null!=(d=a.db.Jb(a,olympe.sc.logic.qb.R))?d:a.db.Jb(a,olympe.sc.logic.qb.H),f=a.db.Jb(a,olympe.sc.logic.qb.N);if(null!==e&&null!==f){d=a.db.Uf(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.nb.Cc(k)),h=gh(a.db,a,olympe.sc.logic.qb.valueProp,g);return()=>{g(null);hh(a.db,a,olympe.sc.logic.qb.valueProp,
1173
1173
  h)}}function lo(a){let b=null,c=a.db.Jb(a,olympe.sc.logic.qb.D);c?b=a.db.Jb(c,olympe.dm.Property.typeRel):(c=a.db.Jb(a,olympe.sc.logic.qb.j))&&(b=a.db.Jb(c,olympe.sc.logic.Tb.typeRel));return b||olympe.dc.fa(olympe.dc.CloudObject)}
1174
- olympe.sc.logic.qb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.G=c}j(a,b,c){const d=olympe.sc.uj(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.Tf(olympe.sc.logic.qb.valueProp,a||olympe.dc.nb.uj,Object)}getType(){const a=this.transform(olympe.sc.logic.qb.j,olympe.sc.logic.Tb.typeRel);a.Rd(olympe.dc.CloudObject);return a.Ic()}Vy(){return this.Sc(olympe.sc.logic.qb.N,olympe.dc.CloudObject)}Ty(){return this.Sc(olympe.sc.logic.qb.R,
1174
+ olympe.sc.logic.qb=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.Ie?null==b||b.run(()=>{olympe.C.Vc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.Tf(olympe.sc.logic.qb.valueProp,a||olympe.dc.nb.tj,Object)}getType(){const a=this.transform(olympe.sc.logic.qb.j,olympe.sc.logic.Tb.typeRel);a.Rd(olympe.dc.CloudObject);return a.Ic()}Vy(){return this.Sc(olympe.sc.logic.qb.N,olympe.dc.CloudObject)}Ty(){return this.Sc(olympe.sc.logic.qb.R,
1175
1175
  olympe.sc.logic.Gb)}Uy(){return this.Sc(olympe.sc.logic.qb.H,olympe.dm.Property)}py(){return this.Sc(olympe.sc.logic.qb.F,olympe.dc.CloudObject)}ny(){return this.Sc(olympe.sc.logic.qb.j,olympe.sc.logic.vb)}oy(){return this.Sc(olympe.sc.logic.qb.D,olympe.dm.Property)}};olympe.sc.logic.qb.O=olympe.dc.na.j('0168a431d91f25780000',olympe.sc.logic.qb,olympe.sc.P.Da);olympe.sc.logic.qb.valueProp=olympe.sc.logic.qb.O.ka('0168a431d91f25780001');olympe.sc.logic.qb.N=olympe.sc.logic.qb.O.sa('0168a431d91f25780002');
1176
1176
  olympe.sc.logic.qb.R=R(olympe.sc.logic.qb.O,olympe.sc.logic.Gb.D);olympe.sc.logic.qb.H=olympe.sc.logic.qb.O.sa('0168a431d91f25780004');olympe.sc.logic.qb.F=olympe.sc.logic.qb.O.sa('0168a431d91f2578000a');olympe.sc.logic.qb.j=R(olympe.sc.logic.qb.O,olympe.sc.logic.vb.D);olympe.sc.logic.qb.D=olympe.sc.logic.qb.O.sa('0168a431d91f2578000c');R(olympe.dc.CloudObject.O,olympe.sc.logic.qb.N);R(olympe.dm.Property.O,olympe.sc.logic.qb.H);R(olympe.dc.CloudObject.O,olympe.sc.logic.qb.F);
1177
- R(olympe.dm.Property.O,olympe.sc.logic.qb.D);m=olympe.sc.logic.qb.prototype;m.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Vy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Ty.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.Uy.K=new olympe.C.J(()=>olympe.dm.Property,[]);m.py.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.ny.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.oy.K=new olympe.C.J(()=>olympe.dm.Property,[]);function mo(a,b){const c=a.xd(),d=c.um().X(),e=c.vm().X(),f=c.wm().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.L.rb.get(a.ac(),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.Bj(),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,
1178
- 400))})}},b.T())}function no(a,b){const c=a.j.j(()=>new Promise(d=>{b.onDestroy(()=>d())}),void 0,a.timeout);b.onDestroy(()=>a.j.H(c))}
1177
+ R(olympe.dm.Property.O,olympe.sc.logic.qb.D);m=olympe.sc.logic.qb.prototype;m.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Vy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Ty.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.Uy.K=new olympe.C.J(()=>olympe.dm.Property,[]);m.py.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.ny.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.oy.K=new olympe.C.J(()=>olympe.dm.Property,[]);function mo(a,b){const c=a.xd(),d=c.um().X(),e=c.vm().X(),f=c.wm().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.L.rb.get(a.ac(),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.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,
1178
+ 400))})}},b.T())}function no(a,b){const c=a.j.ja(()=>new Promise(d=>{b.onDestroy(()=>d())}),void 0,a.timeout);b.onDestroy(()=>a.j.F(c))}
1179
1179
  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.dd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Vb().name()} (${a.ac()}): ${r}`);f.mi(t).catch(v=>{a.G.error(`Cannot reply with an error to a remote action call ${a.Vb().name()} (${a.ac()}): ${v}`)})}finally{b.destroy()}}}),h=b.T(),k=b.on(c,g,h),l=b.on(d,g,h)}
1180
- olympe.sc.logic.Yh=class extends olympe.sc.logic.Function{constructor(a,b,c,d,e){super(a,b,c);this.timeout=e;this.j=d}run(a){let b;null!=(b=a.Qa(olympe.sc.ya.j.EDITION))&&b||(this.db.Ra(this,olympe.sc.logic.Yh.D)?(Dn(a.state,this),this.ta(a)):(Sn(this,a),mo(this,a)))}ta(a){const b=this.ac(),c=this.xd(),d=c.nq().X(),e=c.um().X(),f=c.vm().X(),g=c.wm().X(),h=new olympe.L.rb(b,a);this.j.j(()=>u(function*(){return h.stop()}),`RemoteAction_${this.tag}`);h.listen().subscribe(rxjs.Subscriber.create(k=>{const l=
1181
- a.ki('remote call'),n=k.body();l.set(olympe.sc.ya.j.REDELIVERED,k.xi());no(this,l);const p=Cc(()=>{k.mi(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.Ci().then(q=>{var r=l.get(d);null!==r&&olympe.dc.fa(r)!==q&&(r=this.ac(),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);
1182
- l.set(e,n.get(e))}).catch(q=>{const r=this.ac();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.ac();this.G.error(`Error while listening on remote action ${this.db.name(l)} (${l}): ${k.message}`)}))}};olympe.sc.logic.Yh.O=olympe.dc.na.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.Yh,olympe.sc.P.Da,olympe.host.P.Ge,new olympe.W.pa(olympe.sc.U.qr));olympe.sc.logic.Yh.D=olympe.sc.logic.Yh.O.ka('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.qm=class{constructor(a){this.db=olympe.dc.ha();this.typeRel=a}};olympe.sc.logic.controllers.qm.j={QA:-1,QB:1};olympe.sc.logic.controllers.IC=class extends olympe.sc.logic.controllers.qm{constructor(){super(olympe.sc.logic.rd.j)}};olympe.sc.logic.controllers.RC=class extends olympe.sc.logic.controllers.qm{constructor(){super(olympe.sc.logic.Tb.typeRel)}};olympe.sc.logic.fl={};olympe.sc.logic.fl.Bw=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.fa(b);d?olympe.dc.ma.Pb(a,d,olympe.dc.Mb.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.Bw);olympe.sc.logic.actions={};olympe.sc.logic.fl.vv=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))}};
1180
+ olympe.sc.logic.Yh=class extends olympe.sc.logic.Function{constructor(a,b,c,d,e){super(a,b,c);this.timeout=e;this.j=d}run(a){let b;null!=(b=a.Qa(olympe.sc.ya.j.EDITION))&&b||(this.db.Ra(this,olympe.sc.logic.Yh.D)?(Dn(a.state,this),this.ta(a)):(Sn(this,a),mo(this,a)))}ta(a){const b=this.ac(),c=this.xd(),d=c.nq().X(),e=c.um().X(),f=c.vm().X(),g=c.wm().X(),h=new olympe.L.rb(b,a);this.j.ja(()=>u(function*(){return h.stop()}),`RemoteAction_${this.tag}`);h.listen().subscribe(rxjs.Subscriber.create(k=>{const l=
1181
+ a.ki('remote call'),n=k.body();l.set(olympe.sc.ya.j.REDELIVERED,k.xi());no(this,l);const p=Cc(()=>{k.mi(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.fa(r)!==q&&(r=this.ac(),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);
1182
+ l.set(e,n.get(e))}).catch(q=>{const r=this.ac();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.ac();this.G.error(`Error while listening on remote action ${this.db.name(l)} (${l}): ${k.message}`)}))}};olympe.sc.logic.Yh.O=olympe.dc.na.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.Yh,olympe.sc.P.Da,olympe.host.P.Ge,new olympe.W.pa(olympe.sc.U.qr));olympe.sc.logic.Yh.D=olympe.sc.logic.Yh.O.ka('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.qm=class{constructor(a){this.db=olympe.dc.ha();this.typeRel=a}};olympe.sc.logic.controllers.qm.j={QA:-1,QB:1};olympe.sc.logic.controllers.IC=class extends olympe.sc.logic.controllers.qm{constructor(){super(olympe.sc.logic.rd.j)}};olympe.sc.logic.controllers.RC=class extends olympe.sc.logic.controllers.qm{constructor(){super(olympe.sc.logic.Tb.typeRel)}};olympe.sc.logic.fl={};olympe.sc.logic.fl.Bw=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.fa(b);d?olympe.dc.ma.Pb(a,d,olympe.dc.Mb.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.Bw);olympe.sc.logic.actions={};olympe.sc.logic.fl.vv=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.mf(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.xg();f=0;En(h.state);k();break;case 2:k();break;default:this.G.error('Unhandled input')}},this.tag))}};
1183
1183
  olympe.sc.logic.na.j('0171889b060b6cd54300',olympe.sc.logic.fl.vv);olympe.sc.logic.Rb={};olympe.sc.logic.Rb.fm=class extends olympe.sc.logic.Cd{R(){return this.j('016ac638085357047a2d')}};olympe.sc.logic.Rb.fm.O=io('0169b6876a03f14ae61b',olympe.sc.logic.Rb.fm);olympe.sc.logic.Rb.fm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);let po=null;olympe.sc.logic.Rb.sm=class extends olympe.sc.logic.Cd{R(){return this.j('016ac63808535703691c')}F(a){if(null===po){let b;po=null!=(b=olympe.W.getParameter('sc.event.experimental'))?b:!1}return po?a.observe(Pn(this)[0]):super.F(a)}};olympe.sc.logic.Rb.sm.O=io('0169b6876a03f139d50a',olympe.sc.logic.Rb.sm);olympe.sc.logic.Rb.sm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.Im=class extends olympe.sc.logic.Cd{R(){return this.j('016ac63809a9a8e6db96')}$(){return this.D('016ac6380ab003363b3e')}};io('01646ad602f933b8caaf',olympe.sc.logic.Rb.Im);olympe.sc.logic.Rb.Im.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.Im.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.xk=class extends olympe.sc.logic.Cd{R(){return this.j('016ac6380bd98f1d91a0')}ea(){return this.D('016ac63c589ae38ca3ae')}$(){return this.D('016ac63c5a377fceabaa')}};io('0168ec42fc01747a98b6',olympe.sc.logic.Rb.xk);olympe.sc.logic.Rb.xk.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.xk.prototype.ea.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.xk.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.Wg=class extends olympe.sc.logic.Cd{um(){return this.j('017a7b07b09e3b22c8b4')}nq(){return this.j('017a7b07ba05807a74b0')}vm(){return this.D('017a7b0818c12388d731')}wm(){return this.D('017a7b085146d5e69aec')}bv(){return olympe.C.da.D}};olympe.sc.logic.Rb.Wg.H='017a7b07b09e3b22c8b4';olympe.sc.logic.Rb.Wg.Pc='017a7b07ba05807a74b0';olympe.sc.logic.Rb.Wg.ja='017a7b0818c12388d731';olympe.sc.logic.Rb.Wg.j='017a7b085146d5e69aec';
1184
1184
  olympe.sc.logic.Rb.Wg.O=io('017a7b07a948e30508fa',olympe.sc.logic.Rb.Wg,olympe.sc.logic.Yh);m=olympe.sc.logic.Rb.Wg.prototype;m.um.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.nq.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.vm.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.wm.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.bv.K=olympe.C.J.N;olympe.sc.logic.Rb.Rr=class extends olympe.sc.logic.Cd{R(){return this.j('016ac63c5b3ed0562740')}};io('016a9766c230916ea5ec',olympe.sc.logic.Rb.Rr);olympe.sc.logic.Rb.Rr.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.query={};olympe.sc.query.ro=class extends olympe.sc.Pg{};olympe.sc.query.ro.O=olympe.dc.na.j('01631aacd8276ea98491',olympe.sc.query.ro);olympe.sc.query.Xq=class extends olympe.dm.Enum{};olympe.sc.query.Xq.O=olympe.dc.na.j('01631aacd8276ea98495',olympe.sc.query.Xq);olympe.sc.query.hr=class extends olympe.dm.Enum{};olympe.sc.query.hr.O=olympe.dc.na.j('01631aacd8276ea98494',olympe.sc.query.hr);olympe.sc.query.kr=class extends olympe.sc.Pg{};olympe.sc.query.kr.O=olympe.dc.na.j('01631aacd8276ea98492',olympe.sc.query.kr);olympe.sc.query.oc=class extends olympe.dc.CloudObject{};olympe.sc.query.oc.O=olympe.dc.na.j('01631aacd8276ea98493',olympe.sc.query.oc);olympe.sc.Vo=class extends olympe.dc.CloudObject{};olympe.sc.Vo.O=olympe.dc.na.j('018312ceeb3e93618a85',olympe.sc.Vo);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.ka('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13a');
1185
- olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Ef=class extends olympe.sc.logic.Cd{dv(){return this.j('017ffe02381f9fac5060')}gv(){return this.j('017ffe02381f9fac5061')}hv(){return this.j('017ffe02381f9fac5062')}ky(){return this.j('017ffe02381f9fac5065')}ev(){return this.D('017ffe02381f9fac5063')}fv(){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';
1186
- olympe.sc.workflow.Ef.ff='017ffe02381f9fac5062';olympe.sc.workflow.Ef.ja='017ffe02381f9fac5065';olympe.sc.workflow.Ef.H='017ffe02381f9fac5063';olympe.sc.workflow.Ef.Pc='017ffe02381f9fac5064';m=olympe.sc.workflow.Ef.prototype;m.dv.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.gv.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.hv.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.ky.K=new olympe.C.J(()=>Map,[]);m.ev.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.fv.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.workflow.df=class extends olympe.dm.BrickMetadata{Wc(){return this.Sc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).la().concat(['.',this.la()])}};olympe.sc.workflow.df.O=olympe.dc.na.j('017ffdc2dda51d46b430',olympe.sc.workflow.df);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{D(){return this.Vs()}j(){return this.Sc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.df)}F(){return this.Sc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.df)}Wc(){const a=this.Sc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.df);return a.Sc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).la().concat(['.',a.la(),'->',this.la()])}};
1185
+ olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Ff=class extends olympe.sc.logic.Cd{dv(){return this.j('017ffe02381f9fac5060')}gv(){return this.j('017ffe02381f9fac5061')}hv(){return this.j('017ffe02381f9fac5062')}ky(){return this.j('017ffe02381f9fac5065')}ev(){return this.D('017ffe02381f9fac5063')}fv(){return this.D('017ffe02381f9fac5064')}};olympe.sc.workflow.Ff.O=io('017ffde21f5fe0f704ce',olympe.sc.workflow.Ff);olympe.sc.workflow.Ff.j='017ffe02381f9fac5060';olympe.sc.workflow.Ff.Pe='017ffe02381f9fac5061';
1186
+ olympe.sc.workflow.Ff.ff='017ffe02381f9fac5062';olympe.sc.workflow.Ff.ja='017ffe02381f9fac5065';olympe.sc.workflow.Ff.H='017ffe02381f9fac5063';olympe.sc.workflow.Ff.Pc='017ffe02381f9fac5064';m=olympe.sc.workflow.Ff.prototype;m.dv.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.gv.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.hv.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.ky.K=new olympe.C.J(()=>Map,[]);m.ev.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.fv.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.workflow.df=class extends olympe.dm.BrickMetadata{Wc(){return this.Sc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).la().concat(['.',this.la()])}};olympe.sc.workflow.df.O=olympe.dc.na.j('017ffdc2dda51d46b430',olympe.sc.workflow.df);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{D(){return this.Vs()}j(){return this.Sc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.df)}F(){return this.Sc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.df)}Wc(){const a=this.Sc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.df);return a.Sc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).la().concat(['.',a.la(),'->',this.la()])}};
1187
1187
  olympe.sc.workflow.Transition.O=olympe.dc.na.j('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.O.ka('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.O.sa('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.O.sa('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.D.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);
1188
1188
  olympe.sc.workflow.Transition.prototype.j.K=new olympe.C.J(()=>olympe.sc.workflow.df,[]);olympe.sc.workflow.Transition.prototype.F.K=new olympe.C.J(()=>olympe.sc.workflow.df,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Ne.Ch}F(){return this.nh(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.df)}};olympe.sc.workflow.Workflow.O=olympe.dc.na.j('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.O.ka('017ffdc010e5bcc9c972');
1189
1189
  olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.O.sa('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.O.sa('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.O.sa('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,[]);
1190
- olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.J(()=>olympe.sc.workflow.df,[]);olympe.sc.qa={};olympe.sc.qa.Zc=class extends olympe.sc.Wa{ve(){return olympe.sc.xe.Ne.jw}};olympe.sc.qa.Zc.O=olympe.dc.na.j('01120300000000adef00',olympe.sc.qa.Zc);olympe.sc.qa.Zc.j=olympe.sc.qa.Zc.O.sa('0171bc1f15da96dfdb89');olympe.sc.qa.Zc.ja=olympe.sc.qa.Zc.O.sa('0171bc1f15da96dfdb90');R(olympe.dm.Oc.O,olympe.sc.qa.Zc.j);olympe.sc.qa.Fi=class extends olympe.sc.Runnable{H(){return[this.ac()]}j(){return olympe.dc.sd.from(this.ac()).fb(olympe.sc.qa.Zc.j).Hc()}};olympe.sc.qa.Fi.O=jg(olympe.dc.na.j('0113030000000aca1100',olympe.sc.qa.Fi));olympe.sc.qa.Fi.prototype.j.K=new olympe.C.J(()=>olympe.dm.ib,[]);olympe.sc.qa.lb=class extends olympe.dc.CloudObject{kv(){return this.nh(olympe.sc.qa.lb.hi)}yz(){return this.nh(olympe.sc.qa.lb.ja)}Jc(){return this.yd(olympe.sc.qa.lb.j)}sy(){return this.wb(olympe.sc.qa.lb.H)}Ny(){return this.wb(olympe.sc.qa.lb.ea)}My(){return this.wb(olympe.sc.qa.lb.Y)}Pf(){return this.wb(olympe.sc.qa.lb.$)}Cy(){return this.wb(olympe.sc.qa.lb.N)}Xx(){return this.wb(olympe.sc.qa.lb.D)}Ly(){return this.wb(olympe.sc.qa.lb.R)}jv(){return this.wb(olympe.sc.qa.lb.F)}};
1190
+ olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.J(()=>olympe.sc.workflow.df,[]);olympe.sc.qa={};olympe.sc.qa.Zc=class extends olympe.sc.Xa{ve(){return olympe.sc.xe.Ne.jw}};olympe.sc.qa.Zc.O=olympe.dc.na.j('01120300000000adef00',olympe.sc.qa.Zc);olympe.sc.qa.Zc.j=olympe.sc.qa.Zc.O.sa('0171bc1f15da96dfdb89');olympe.sc.qa.Zc.ja=olympe.sc.qa.Zc.O.sa('0171bc1f15da96dfdb90');R(olympe.dm.Oc.O,olympe.sc.qa.Zc.j);olympe.sc.qa.Ei=class extends olympe.sc.Runnable{H(){return[this.ac()]}j(){return olympe.dc.sd.from(this.ac()).fb(olympe.sc.qa.Zc.j).Hc()}};olympe.sc.qa.Ei.O=jg(olympe.dc.na.j('0113030000000aca1100',olympe.sc.qa.Ei));olympe.sc.qa.Ei.prototype.j.K=new olympe.C.J(()=>olympe.dm.ib,[]);olympe.sc.qa.lb=class extends olympe.dc.CloudObject{kv(){return this.nh(olympe.sc.qa.lb.hi)}yz(){return this.nh(olympe.sc.qa.lb.ja)}Jc(){return this.yd(olympe.sc.qa.lb.j)}sy(){return this.wb(olympe.sc.qa.lb.H)}Ny(){return this.wb(olympe.sc.qa.lb.ea)}My(){return this.wb(olympe.sc.qa.lb.Y)}Pf(){return this.wb(olympe.sc.qa.lb.$)}Cy(){return this.wb(olympe.sc.qa.lb.N)}Xx(){return this.wb(olympe.sc.qa.lb.D)}Ly(){return this.wb(olympe.sc.qa.lb.R)}jv(){return this.wb(olympe.sc.qa.lb.F)}};
1191
1191
  olympe.sc.qa.lb.O=olympe.dc.na.j('011203300000000adef5',olympe.sc.qa.lb);olympe.sc.qa.lb.hi=olympe.sc.qa.lb.O.ka('011203300000000adef6');olympe.sc.qa.lb.ja=olympe.sc.qa.lb.O.ka('011203300000000adef7');olympe.sc.qa.lb.j=olympe.sc.qa.lb.O.ka('011203300000000adef8');olympe.sc.qa.lb.H=olympe.sc.qa.lb.O.ka('011203300000000adef9');olympe.sc.qa.lb.ea=olympe.sc.qa.lb.O.ka('011203300000000adefa');olympe.sc.qa.lb.Y=olympe.sc.qa.lb.O.ka('011203300000000adefb');olympe.sc.qa.lb.D=olympe.sc.qa.lb.O.ka('011203300000000adefc');
1192
1192
  olympe.sc.qa.lb.$=olympe.sc.qa.lb.O.ka('011203300000000adefd');olympe.sc.qa.lb.N=olympe.sc.qa.lb.O.ka('011203300000000adefe');olympe.sc.qa.lb.R=olympe.sc.qa.lb.O.ka('011203300000000adeff');olympe.sc.qa.lb.F=olympe.sc.qa.lb.O.ka('011203300000000adee0');olympe.sc.qa.lb.pc={INIT:0,CA:1,Pk:2,Ok:3,Wm:4,kD:5,zb:9};m=olympe.sc.qa.lb.prototype;m.kv.K=olympe.C.J.N;m.yz.K=olympe.C.J.N;m.Jc.K=olympe.C.J.F;m.sy.K=olympe.C.J.D;m.Ny.K=olympe.C.J.D;m.My.K=olympe.C.J.D;m.Pf.K=olympe.C.J.D;m.Cy.K=olympe.C.J.D;
1193
- m.Xx.K=olympe.C.J.D;m.Ly.K=olympe.C.J.D;m.jv.K=olympe.C.J.D;olympe.sc.qa.om=class extends olympe.sc.qa.Fi{F(a){a.set(olympe.sc.ya.j.ho,!0);super.F(a)}ja(){return!0}};olympe.sc.qa.om.O=olympe.dc.na.j('0113032000000aca1102',olympe.sc.qa.om,olympe.sc.P.Da);olympe.sc.qa.cf=class extends olympe.sc.qa.Zc{j(){return(new olympe.dc.rk(this.X(),olympe.sc.qa.lb)).fb(olympe.sc.qa.cf.H).Yi().Ic()}};olympe.sc.qa.cf.O=olympe.dc.na.j('011203300000000adef3',olympe.sc.qa.cf);olympe.sc.qa.cf.H=olympe.sc.qa.cf.O.sa('011203300000000adef4');R(olympe.sc.qa.lb.O,olympe.sc.qa.cf.H);
1194
- olympe.sc.qa.cf.O.j=(a,b,c)=>{b=$l(a,b||'New Service Application model',olympe.sc.qa.cf,olympe.sc.qa.om);a.Pa(olympe.sc.qa.Zc.j,b,c);c=a.create(olympe.sc.qa.lb).X();a.Pa(olympe.sc.qa.cf.H,b,c);return b.X()};olympe.sc.qa.cf.prototype.j.K=new olympe.C.J(()=>olympe.sc.qa.lb,[]);olympe.sc.dh=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.dh.O=olympe.dc.na.j('011203300000000adf00',olympe.sc.dh);olympe.sc.dh.D=olympe.sc.dh.O.ka('011203300000000adf01');olympe.sc.dh.j=olympe.sc.dh.O.ka('011203300000000adf02');olympe.sc.dh.F='011203300000000adf0f';olympe.sc.Ag={};olympe.sc.Ag.mz=a=>{var b=a.j;const c=olympe.dc.ha();var d=null;var e=null===bo;for(const f of b.Uc())if((b=f.Vb())&&f.D()&&f.jb()===olympe.dc.Ha.SERVER&&Z(a,f.tag())&&c.Ob(b,olympe.sc.Ac)){if(!e)throw new olympe.dc.Nq;let g,h;null==d&&(d=null,null!==ao?d=ao:'string'===typeof $n&&(d=olympe.dc.sd.from($n).fb(olympe.sc.qa.Zc.j).fb(olympe.sc.sf.j.$b()).Hc()),d=null==(g=d)?void 0:g.X());d=null!=(h=d)?h:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.fa(b)}`);a.Pa(olympe.sc.sf.D.X(),
1193
+ m.Xx.K=olympe.C.J.D;m.Ly.K=olympe.C.J.D;m.jv.K=olympe.C.J.D;olympe.sc.qa.om=class extends olympe.sc.qa.Ei{F(a){a.set(olympe.sc.ya.j.ho,!0);super.F(a)}ja(){return!0}};olympe.sc.qa.om.O=olympe.dc.na.j('0113032000000aca1102',olympe.sc.qa.om,olympe.sc.P.Da);olympe.sc.qa.cf=class extends olympe.sc.qa.Zc{j(){return(new olympe.dc.rk(this.X(),olympe.sc.qa.lb)).fb(olympe.sc.qa.cf.H).Xi().Ic()}};olympe.sc.qa.cf.O=olympe.dc.na.j('011203300000000adef3',olympe.sc.qa.cf);olympe.sc.qa.cf.H=olympe.sc.qa.cf.O.sa('011203300000000adef4');R(olympe.sc.qa.lb.O,olympe.sc.qa.cf.H);
1194
+ olympe.sc.qa.cf.O.j=(a,b,c)=>{b=$l(a,b||'New Service Application model',olympe.sc.qa.cf,olympe.sc.qa.om);a.Pa(olympe.sc.qa.Zc.j,b,c);c=a.create(olympe.sc.qa.lb).X();a.Pa(olympe.sc.qa.cf.H,b,c);return b.X()};olympe.sc.qa.cf.prototype.j.K=new olympe.C.J(()=>olympe.sc.qa.lb,[]);olympe.sc.dh=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.dh.O=olympe.dc.na.j('011203300000000adf00',olympe.sc.dh);olympe.sc.dh.D=olympe.sc.dh.O.ka('011203300000000adf01');olympe.sc.dh.j=olympe.sc.dh.O.ka('011203300000000adf02');olympe.sc.dh.F='011203300000000adf0f';olympe.sc.Bg={};olympe.sc.Bg.mz=a=>{var b=a.j;const c=olympe.dc.ha();var d=null;var e=null===bo;for(const f of b.Uc())if((b=f.Vb())&&f.D()&&f.jb()===olympe.dc.Ia.SERVER&&Z(a,f.tag())&&c.Ob(b,olympe.sc.Ac)){if(!e)throw new olympe.dc.Nq;let g,h;null==d&&(d=null,null!==ao?d=ao:'string'===typeof $n&&(d=olympe.dc.sd.from($n).fb(olympe.sc.qa.Zc.j).fb(olympe.sc.tf.j.$b()).Hc()),d=null==(g=d)?void 0:g.X());d=null!=(h=d)?h:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.fa(b)}`);a.Pa(olympe.sc.tf.D.X(),
1195
1195
  d,f.tag())}};
1196
- olympe.sc.Ag.Az=a=>{const b=a.j,c=olympe.dc.ha();for(const d of b.Uc()){const e=d.Vb();e&&!d.zd()&&c.Ob(e,olympe.sc.Ac)&&d.Cb().forEach((f,g)=>{if(f instanceof olympe.dc.wc){const l=b.Tc(f.X());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.X()}`);var h;f=null!=(h=null==l?void 0:l.Vb())?h:null;h=l.tag();let n;if(f===olympe.dc.fa(olympe.sc.Ud)){h=l.Jb(olympe.sc.Ud.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
1196
+ olympe.sc.Bg.Az=a=>{const b=a.j,c=olympe.dc.ha();for(const d of b.Uc()){const e=d.Vb();e&&!d.zd()&&c.Ob(e,olympe.sc.Ac)&&d.Cb().forEach((f,g)=>{if(f instanceof olympe.dc.wc){const l=b.Tc(f.X());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.X()}`);var h;f=null!=(h=null==l?void 0:l.Vb())?h:null;h=l.tag();let n;if(f===olympe.dc.fa(olympe.sc.Ud)){h=l.Jb(olympe.sc.Ud.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
1197
1197
  let p;f=null!=(p=null==(k=b.Tc(h))?void 0:k.Vb())?p:c.model(h)}if(c.Uf(f,olympe.dm.Ie)){k=jn(f);let p;n=null!=(p=l.Ra(k.X()))?p:c.Ra(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]]));Ul(a,l.tag(),olympe.dc.Mb.Dc)}})}};
1198
- olympe.sc.Ag.wx=a=>{const b=a.j,c=olympe.dc.ha(),d=new Set;for(var e of b.Ab.values()){a=e.tag();let f;const g=null!=(f=e.Vb())?f:c.model(a);if(null!==g&&e.Gd()&&(d.has(g)||c.Ob(g,olympe.sc.Ac))){d.add(g);const h=Array.from(e.ea()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.hc.$c?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Tc(k))?void 0:l.Vb())?n:c.model(k);return!p||!(d.has(p)||c.Ob(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.Vb())?l:c.model(h))?
1199
- 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.Qz=a=>{var b=a.j;const c=olympe.dc.ha();for(const d of b.Uc()){b=d.tag();const e=d.Vb();if(e&&!c.Ob(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`);}};
1200
- olympe.W.run([olympe.dc.transaction.P.Ea],a=>{fm(fm(fm(a,olympe.sc.Ag.wx,'businessDataRelations'),olympe.sc.Ag.mz,'linkBusinessContainer'),olympe.sc.Ag.Az,'noBusinessComplexProperty')});olympe.sc.$j=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.$j.O=olympe.dc.na.j('01645fe6873aeea59e64',olympe.sc.$j);olympe.sc.$j.j=olympe.sc.$j.O.sa('017ed8ac775f48d4d589');olympe.sc.So=class extends olympe.dm.Lb{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.So.O=olympe.dc.na.j('0163a68ce44f3d1fa95d',olympe.sc.So);olympe.sc.Ah=class extends olympe.dm.BrickMetadata{};olympe.sc.Ah.O=olympe.dc.na.j('016324fde11a836f77d3',olympe.sc.Ah);olympe.sc.Ah.j=olympe.sc.Ac.O.sa('016324fde11a836088d3');olympe.sc.Ah.O.j=(a,b)=>$l(a,null!=b?b:'New config type',olympe.sc.Ah).X();olympe.sc.MA=class{};olympe.sc.ek=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Ne.Ch}};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).X();olympe.sc.Ae=class extends olympe.sc.Runnable{ta(){return this.cb(olympe.sc.Ae.F,olympe.sc.Runnable)}j(){return this.cb(olympe.sc.Ae.D,olympe.dm.Property)}};olympe.sc.Ae.O=jg(olympe.dc.na.j('016c2d996d9ca27fa9d8',olympe.sc.Ae));olympe.sc.Ae.F=olympe.sc.Ae.O.sa('016c3cb7742ec9309e0b');olympe.sc.Ae.D=olympe.sc.Ae.O.sa('016c42d3454636f90533');olympe.sc.Ae.prototype.ta.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.Ae.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.qp=class extends olympe.dm.Lb{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.qp.O=olympe.dc.na.j('017a7a9ff057958e5678',olympe.sc.qp);olympe.sc.Ni=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ha();e=void 0!==e?e:f.Ia(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.Ni.create=olympe.sc.Ni.create;olympe.sc.Ni.O=olympe.dc.na.j('016cdd861b32d56c8208',olympe.sc.Ni);olympe.sc.wq=class extends olympe.dm.Lb{ve(){return olympe.sc.xe.Ne.Lw}};olympe.sc.wq.O=olympe.dc.na.j('01644b6d4543b344b857',olympe.sc.wq);olympe.sc.xq=class extends olympe.dc.CloudObject{};olympe.sc.xq.O=olympe.dc.na.j('0162f672366be5ca7a86',olympe.sc.xq);const qo={pp:30};olympe.sc.ec=class extends olympe.dc.sources.ec{D(a){return a instanceof olympe.sc.logic.Error?this.format(qo.pp,{c:a.Bj(),m:a.message,s:a.se()}):super.D(a)}j(a){return(null==a?void 0:a.t)===qo.pp?(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.Ud.O.X()){const b=olympe.sc.Ud.j;this.F.get(a).r.push({r:b.X(),o:a,d:this.db.Jb(a,b)})}return a}};olympe.sc.Sr=class extends olympe.sc.Ae{};olympe.sc.Sr.O=olympe.dc.na.j('016d3f37610ae4fc3962',olympe.sc.Sr);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.na.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Xa=class{constructor(a=!0){a=Yl(a);a.N=!0;var b=olympe.sc.Ag.Qz;let c;(null==(c=olympe.W.getParameter(olympe.dc.transaction.U.bm))?0:c.includes('persistenceBusinessDataOnly'))||a.R.push(b);this.j=a;this.D=[];this.source=null}static from(a){const b=olympe.sc.ya.j.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Xa}static process(a,b){return a.has(olympe.sc.ya.j.TRANSACTION,!0)?Promise.resolve(!1):b.ob().then(()=>!0)}T(){return this.j.T()}create(a,b=new Map,c=this.source,d){c='string'===
1201
- typeof c?c:olympe.dc.fe().fromModel(a);a=this.j.create(a,d).Ai(c);for(const [e,f]of b)X(a,e,f);b=a.X();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}ht(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Ld.set(olympe.dc.fa(c),b);return this}delete(a){this.j.delete(a);return this}Pa(a,b,c){this.j.Pa(a,b,c);return this}ic(a,b,c){this.j.ic(a,b,c);return this}wn(a,b){this.j.wn(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}Pz(a,b=!0){olympe.ia.Za('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');
1202
- return this.persist(a,b)}Ai(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){Zl(this.j,a.j);return this}mn(a){this.j.mn(a);return this}ob(){return new Promise((a,b)=>{this.j.ob((c,d)=>{c?a(new olympe.sc.nj(this.D)):b(d)})})}xn(){return new Promise((a,b)=>{this.j.xn((c,d)=>{c?a(new olympe.sc.nj(this.D)):b(d)})})}};olympe.sc.Xa.prototype.executeAsLarge=olympe.sc.Xa.prototype.xn;olympe.sc.Xa.prototype.execute=olympe.sc.Xa.prototype.ob;olympe.sc.Xa.prototype.afterExecution=olympe.sc.Xa.prototype.mn;
1203
- olympe.sc.Xa.prototype.merge=olympe.sc.Xa.prototype.merge;olympe.sc.Xa.prototype.model=olympe.sc.Xa.prototype.model;olympe.sc.Xa.prototype.setSource=olympe.sc.Xa.prototype.Ai;olympe.sc.Xa.prototype.persistInstance=olympe.sc.Xa.prototype.Pz;olympe.sc.Xa.prototype.persist=olympe.sc.Xa.prototype.persist;olympe.sc.Xa.prototype.deleteAllRelations=olympe.sc.Xa.prototype.wn;olympe.sc.Xa.prototype.deleteRelation=olympe.sc.Xa.prototype.ic;olympe.sc.Xa.prototype.createRelation=olympe.sc.Xa.prototype.Pa;
1204
- olympe.sc.Xa.prototype['delete']=olympe.sc.Xa.prototype.delete;olympe.sc.Xa.prototype.multiUpdate=olympe.sc.Xa.prototype.ht;olympe.sc.Xa.prototype.update=olympe.sc.Xa.prototype.update;olympe.sc.Xa.prototype.create=olympe.sc.Xa.prototype.create;olympe.sc.Xa.prototype.getId=olympe.sc.Xa.prototype.T;olympe.sc.Xa.process=olympe.sc.Xa.process;olympe.sc.Xa.from=olympe.sc.Xa.from;olympe.sc.nj=class{constructor(a){this.j=a}hy(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.nj.prototype.getCreatedObjects=olympe.sc.nj.prototype.hy;olympe.zc={};olympe.zc.Ht=class{run(){}};function ro(a,b='default'){return a.j===b}
1198
+ olympe.sc.Bg.wx=a=>{const b=a.j,c=olympe.dc.ha(),d=new Set;for(var e of b.Ab.values()){a=e.tag();let f;const g=null!=(f=e.Vb())?f:c.model(a);if(null!==g&&e.Gd()&&(d.has(g)||c.Ob(g,olympe.sc.Ac))){d.add(g);const h=Array.from(e.ea()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.hc.$c?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Tc(k))?void 0:l.Vb())?n:c.model(k);return!p||!(d.has(p)||c.Ob(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.Vb())?l:c.model(h))?
1199
+ 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.Bg.Qz=a=>{var b=a.j;const c=olympe.dc.ha();for(const d of b.Uc()){b=d.tag();const e=d.Vb();if(e&&!c.Ob(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`);}};
1200
+ olympe.W.run([olympe.dc.transaction.P.Ea],a=>{fm(fm(fm(a,olympe.sc.Bg.wx,'businessDataRelations'),olympe.sc.Bg.mz,'linkBusinessContainer'),olympe.sc.Bg.Az,'noBusinessComplexProperty')});olympe.sc.$j=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.$j.O=olympe.dc.na.j('01645fe6873aeea59e64',olympe.sc.$j);olympe.sc.$j.j=olympe.sc.$j.O.sa('017ed8ac775f48d4d589');olympe.sc.So=class extends olympe.dm.Lb{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.So.O=olympe.dc.na.j('0163a68ce44f3d1fa95d',olympe.sc.So);olympe.sc.Ah=class extends olympe.dm.BrickMetadata{};olympe.sc.Ah.O=olympe.dc.na.j('016324fde11a836f77d3',olympe.sc.Ah);olympe.sc.Ah.j=olympe.sc.Ac.O.sa('016324fde11a836088d3');olympe.sc.Ah.O.j=(a,b)=>$l(a,null!=b?b:'New config type',olympe.sc.Ah).X();olympe.sc.MA=class{};olympe.sc.ek=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Ne.Ch}};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).X();olympe.sc.Ae=class extends olympe.sc.Runnable{ta(){return this.cb(olympe.sc.Ae.F,olympe.sc.Runnable)}j(){return this.cb(olympe.sc.Ae.D,olympe.dm.Property)}};olympe.sc.Ae.O=jg(olympe.dc.na.j('016c2d996d9ca27fa9d8',olympe.sc.Ae));olympe.sc.Ae.F=olympe.sc.Ae.O.sa('016c3cb7742ec9309e0b');olympe.sc.Ae.D=olympe.sc.Ae.O.sa('016c42d3454636f90533');olympe.sc.Ae.prototype.ta.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.Ae.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.qp=class extends olympe.dm.Lb{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.qp.O=olympe.dc.na.j('017a7a9ff057958e5678',olympe.sc.qp);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.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.wq=class extends olympe.dm.Lb{ve(){return olympe.sc.xe.Ne.Lw}};olympe.sc.wq.O=olympe.dc.na.j('01644b6d4543b344b857',olympe.sc.wq);olympe.sc.xq=class extends olympe.dc.CloudObject{};olympe.sc.xq.O=olympe.dc.na.j('0162f672366be5ca7a86',olympe.sc.xq);const qo={pp:30};olympe.sc.ec=class extends olympe.dc.sources.ec{D(a){return a instanceof olympe.sc.logic.Error?this.format(qo.pp,{c:a.Aj(),m:a.message,s:a.se()}):super.D(a)}j(a){return(null==a?void 0:a.t)===qo.pp?(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.Ud.O.X()){const b=olympe.sc.Ud.j;this.F.get(a).r.push({r:b.X(),o:a,d:this.db.Jb(a,b)})}return a}};olympe.sc.Sr=class extends olympe.sc.Ae{};olympe.sc.Sr.O=olympe.dc.na.j('016d3f37610ae4fc3962',olympe.sc.Sr);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.na.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Za=class{constructor(a=!0){a=Yl(a);a.N=!0;var b=olympe.sc.Bg.Qz;let c;(null==(c=olympe.W.getParameter(olympe.dc.transaction.U.bm))?0:c.includes('persistenceBusinessDataOnly'))||a.R.push(b);this.j=a;this.D=[];this.source=null}static from(a){const b=olympe.sc.ya.j.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Za}static process(a,b){return a.has(olympe.sc.ya.j.TRANSACTION,!0)?Promise.resolve(!1):b.ob().then(()=>!0)}T(){return this.j.T()}create(a,b=new Map,c=this.source,d){c='string'===
1201
+ typeof c?c:olympe.dc.fe().fromModel(a);a=this.j.create(a,d).zi(c);for(const [e,f]of b)X(a,e,f);b=a.X();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}ht(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Ld.set(olympe.dc.fa(c),b);return this}delete(a){this.j.delete(a);return this}Pa(a,b,c){this.j.Pa(a,b,c);return this}ic(a,b,c){this.j.ic(a,b,c);return this}wn(a,b){this.j.wn(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}Pz(a,b=!0){olympe.ia.Ya('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');
1202
+ return this.persist(a,b)}zi(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){Zl(this.j,a.j);return this}mn(a){this.j.mn(a);return this}ob(){return new Promise((a,b)=>{this.j.ob((c,d)=>{c?a(new olympe.sc.mj(this.D)):b(d)})})}xn(){return new Promise((a,b)=>{this.j.xn((c,d)=>{c?a(new olympe.sc.mj(this.D)):b(d)})})}};olympe.sc.Za.prototype.executeAsLarge=olympe.sc.Za.prototype.xn;olympe.sc.Za.prototype.execute=olympe.sc.Za.prototype.ob;olympe.sc.Za.prototype.afterExecution=olympe.sc.Za.prototype.mn;
1203
+ olympe.sc.Za.prototype.merge=olympe.sc.Za.prototype.merge;olympe.sc.Za.prototype.model=olympe.sc.Za.prototype.model;olympe.sc.Za.prototype.setSource=olympe.sc.Za.prototype.zi;olympe.sc.Za.prototype.persistInstance=olympe.sc.Za.prototype.Pz;olympe.sc.Za.prototype.persist=olympe.sc.Za.prototype.persist;olympe.sc.Za.prototype.deleteAllRelations=olympe.sc.Za.prototype.wn;olympe.sc.Za.prototype.deleteRelation=olympe.sc.Za.prototype.ic;olympe.sc.Za.prototype.createRelation=olympe.sc.Za.prototype.Pa;
1204
+ olympe.sc.Za.prototype['delete']=olympe.sc.Za.prototype.delete;olympe.sc.Za.prototype.multiUpdate=olympe.sc.Za.prototype.ht;olympe.sc.Za.prototype.update=olympe.sc.Za.prototype.update;olympe.sc.Za.prototype.create=olympe.sc.Za.prototype.create;olympe.sc.Za.prototype.getId=olympe.sc.Za.prototype.T;olympe.sc.Za.process=olympe.sc.Za.process;olympe.sc.Za.from=olympe.sc.Za.from;olympe.sc.mj=class{constructor(a){this.j=a}hy(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.mj.prototype.getCreatedObjects=olympe.sc.mj.prototype.hy;olympe.zc={};olympe.zc.Ht=class{run(){}};function ro(a,b='default'){return a.j===b}
1205
1205
  olympe.zc.Ua=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)}Mj(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),
1206
- this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.zc.Mj=function(a,b,c='default'){const d=a.Za();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.zc.U.Ve+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.xd(olympe.zc.P.Ea).config(c,[b],(e,f)=>f.Mj(e,c,b),e=>ro(e,c),'olympe.hc.registerApp')};olympe.zc.P={Ea:'hc.Manager',Da:'hc.Logger'};olympe.zc.U={Ve:'hc.app',Ip:'hc.globalToken'};olympe.W.config(function(a){E(a,olympe.zc.U.Ve,'default');E(a,olympe.zc.U.Ip,!1);D(a,olympe.zc.P.Da,[olympe.ia.P.Ea],b=>b.cd('hc'));D(a,olympe.Db.P.ah,[new olympe.W.pa(olympe.zc.U.Ve)],b=>b);D(a,olympe.auth.P.Cl,[olympe.Db.P.ah,new olympe.W.pa(olympe.zc.U.Ip)],(b,c)=>new olympe.auth.qo(c?'':b));C(a,olympe.zc.P.Ea,olympe.zc.Ua,new olympe.W.pa(olympe.zc.U.Ve),olympe.zc.P.Da)},'olympe.hc');
1207
- olympe.W.run([olympe.zc.P.Ea],a=>a.run(),'olympe.hc');olympe.sc.Ib={};function so(a){a.Y=a.F.j(()=>u(function*(){return to(a)}),'Stop application')}function uo(a){a.R=a.F.D(()=>olympe.C.Qa(a.$)===olympe.C.da.D?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.Je.j.READINESS)}
1208
- function vo(a){if(a.ta)return a.G.debug('Sending getContext request'),Ji(a.Ja).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.Bb(),d=new Promise((f,g)=>{const h=olympe.dc.ha(),k=new olympe.C.Wb('Primordial Subscription Context',c);xi(k,a.j,l=>{l=h.wi(l)?l:h.model(l);return null!==l&&
1209
- h.Ob(l,olympe.sc.Ah)},{md:wo(b),$n:!0,at:!0}).subscribe(rxjs.Subscriber.create(c.tc(()=>{h.Ob(a.j,olympe.sc.qa.Zc)?(a.bb.Y(a.j,b),f()):Rd(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.ja.ue()],g=>{const h=wo(b,!1);olympe.dc.ma.Qe(g,olympe.dm.User,olympe.dc.Ha.SERVER).observe(c,
1210
- {md:h,cl:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.ea)return xo(a);xo(a).then(()=>{})})}
1211
- function yo(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ha();if(0<a.j.length){const c=Of(b,a.j,a.D.Bb().tc((f,g)=>{if(f)if(f=Rn(g),f instanceof olympe.sc.qa.Fi){a.G.debug('application retrieved: running');g=kn(a.D,f);const h=new olympe.sc.$a.Zv(a.H);pb(a.H,()=>xn(a.D.state,h));qb(a.H,()=>{var k=h.T();return zn(a.D.state,k)});a.mb&&a.H.start();f.run(g);'string'===typeof a.Eb&&(new olympe.sc.ae).ea(f.X(),g,a.G);g.zt(olympe.sc.ya.j.ho).then(()=>{var k;null==(k=d)||k.cancel();a.$.update(olympe.C.da.D);
1212
- a.G.info(`Application ${olympe.dc.ha().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.de();k.Yb=!0;k.Y+=0;k.le.next(0<k.Y);0===k.Y&&k.$&&k.Yb&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.bb.set('__code-as-data-version__',k.version),k.Eb||(k.$=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else to(a)}));olympe.C.Ya().onDestroy(()=>{Mf(b,a.j,c)});const d=Cc(()=>{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)`)},
1213
- 3E4);let e;null==(e=a.Yb)||e.start()}}function wo(a,b=!0){return a?olympe.dc.ma.oc.Rg:b?olympe.dc.ma.oc.vf:olympe.dc.ma.oc.Ck}function xo(a){return u(function*(){zo(a.j)&&(yield co(a.j,a.ea).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.Bb().rg();a.F.F(a.R);a.F.H(a.Y)}
1214
- olympe.sc.Ib.Um=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.ja=b;this.N=c;this.Ja=d;this.F=e;this.Y=this.R='';this.D=f;this.bb=g;this.H=h;this.Yb=l;this.j=k.get('appTag');this.ta=k.get('getContextMode');let n;this.Eb=null!=(n=k.get('debuggerName'))?n:null;this.mb=k.get('autostartProfiler');this.ea=k.get('requireBusinessContainer');this.$=olympe.C.cc(olympe.C.da).update(olympe.C.da.j)}run(){this.G.debug('runtime starting for app #'+this.j);let a=!1;so(this);uo(this);const b=olympe.L.uc.j.dj,
1215
- c=olympe.L.uc.j.Df,d=olympe.L.uc.j.vc;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.Ya().tc(()=>yo(this))));break;case d:this.G.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Ib.Um.j='app_instance';olympe.sc.Ib.Um.za=[olympe.zc.Ht];olympe.sc.Ib.hw=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.Dj();this.G.debug('Request headers',b);return b.origin?b.origin:b.Wz?(new URL(b.Wz)).origin:b[olympe.net.wa.Headers.yp]&&
1206
+ this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.zc.Mj=function(a,b,c='default'){const d=a.Ya();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.zc.U.Ve+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.xd(olympe.zc.P.Ea).config(c,[b],(e,f)=>f.Mj(e,c,b),e=>ro(e,c),'olympe.hc.registerApp')};olympe.zc.P={Ea:'hc.Manager',Da:'hc.Logger'};olympe.zc.U={Ve:'hc.app',Ip:'hc.globalToken'};olympe.W.config(function(a){E(a,olympe.zc.U.Ve,'default');E(a,olympe.zc.U.Ip,!1);D(a,olympe.zc.P.Da,[olympe.ia.P.Ea],b=>b.cd('hc'));D(a,olympe.Db.P.ah,[new olympe.W.pa(olympe.zc.U.Ve)],b=>b);D(a,olympe.auth.P.Cl,[olympe.Db.P.ah,new olympe.W.pa(olympe.zc.U.Ip)],(b,c)=>new olympe.auth.qo(c?'':b));C(a,olympe.zc.P.Ea,olympe.zc.Ua,new olympe.W.pa(olympe.zc.U.Ve),olympe.zc.P.Da)},'olympe.hc');
1207
+ olympe.W.run([olympe.zc.P.Ea],a=>a.run(),'olympe.hc');olympe.sc.Ib={};function so(a){a.Y=a.F.H(()=>u(function*(){return to(a)}),'Stop application')}function uo(a){a.R=a.F.j(()=>olympe.C.Qa(a.$)===olympe.C.da.D?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.Je.j.READINESS)}
1208
+ function vo(a){if(a.ta)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.Bb(),d=new Promise((f,g)=>{const h=olympe.dc.ha(),k=new olympe.C.Wb('Primordial Subscription Context',c);xi(k,a.j,l=>{l=h.wi(l)?l:h.model(l);return null!==l&&
1209
+ h.Ob(l,olympe.sc.Ah)},{md:b?olympe.dc.ma.oc.Rg:olympe.dc.ma.oc.wf,$n:!0,at:!0}).subscribe(rxjs.Subscriber.create(c.tc(()=>{h.Ob(a.j,olympe.sc.qa.Zc)?(a.Wa.Y(a.j,b),f()):Rd(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.ja.ue()],g=>{olympe.dc.ma.Qe(g,olympe.dm.User,olympe.dc.Ia.SERVER).observe(c,
1210
+ {md:olympe.dc.ma.oc.Ck,cl:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.ea)return wo(a);wo(a).then(()=>{})})}
1211
+ function xo(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ha();if(0<a.j.length){const c=Of(b,a.j,a.D.Bb().tc((f,g)=>{if(f)if(f=Rn(g),f instanceof olympe.sc.qa.Ei){a.G.debug('application retrieved: running');g=kn(a.D,f);const h=new olympe.sc.ab.Zv(a.H);pb(a.H,()=>xn(a.D.state,h));qb(a.H,()=>{var k=h.T();return zn(a.D.state,k)});a.mb&&a.H.start();f.run(g);'string'===typeof a.Eb&&(new olympe.sc.ae).ea(f.X(),g,a.G);g.zt(olympe.sc.ya.j.ho).then(()=>{var k;null==(k=d)||k.cancel();a.$.update(olympe.C.da.D);
1212
+ a.G.info(`Application ${olympe.dc.ha().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.de();k.Yb=!0;k.Y+=0;k.le.next(0<k.Y);0===k.Y&&k.$&&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.Eb||(k.$=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else to(a)}));olympe.C.$a().onDestroy(()=>{Mf(b,a.j,c)});const d=Cc(()=>{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)`)},
1213
+ 3E4);let e;null==(e=a.Yb)||e.start()}}function wo(a){return u(function*(){yo(a.j)&&(yield co(a.j,a.ea).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.Bb().sg();a.F.D(a.R);a.F.F(a.Y)}
1214
+ olympe.sc.Ib.Um=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.ja=b;this.N=c;this.Ha=d;this.F=e;this.Y=this.R='';this.D=f;this.Wa=g;this.H=h;this.Yb=l;this.j=k.get('appTag');this.ta=k.get('getContextMode');let n;this.Eb=null!=(n=k.get('debuggerName'))?n:null;this.mb=k.get('autostartProfiler');this.ea=k.get('requireBusinessContainer');this.$=olympe.C.cc(olympe.C.da).update(olympe.C.da.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,
1215
+ c=olympe.L.uc.j.Ef,d=olympe.L.uc.j.vc;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.$a().tc(()=>xo(this))));break;case d:this.G.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Ib.Um.j='app_instance';olympe.sc.Ib.Um.za=[olympe.zc.Ht];olympe.sc.Ib.hw=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.Wz?(new URL(b.Wz)).origin:b[olympe.net.wa.Headers.yp]&&
1216
1216
  b[olympe.net.wa.Headers.zp]?b[olympe.net.wa.Headers.zp]+'://'+b[olympe.net.wa.Headers.yp]:null};this.D.D('manifest',`${this.F}/:${'appTag'}`,[olympe.net.wa.Sd.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.wa.Ub.Fl);try{var f=yield olympe.dc.ma.Qe(e,olympe.sc.qa.Zc).ob()}catch(h){return new olympe.net.qd(`Something went wrong: ${'string'===typeof h?
1217
- h:h.message}`,olympe.net.wa.Ub.Fl)}if(0===f.size())return new olympe.net.qd('App not found',olympe.net.wa.Ub.$i);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.W.getParameter(`app.manifest.${e}`);if(!f)f={};else if('string'===
1218
- 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.wa.Ub.Rh,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function zo(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.ma.from(a).fb(olympe.sc.qa.Zc.j).fb(olympe.dm.Bd.F.$b()).fb(olympe.dm.Bd.j).Hc();a=olympe.dc.ma.from(a).fb(olympe.sc.qa.Zc.j).fb(olympe.dm.ib.D).Hc();return c.concat(a).has(b)}
1219
- olympe.sc.Ib.Sk=class extends olympe.dc.sources.Sk{R(a){return this.db.Ob(a,olympe.sc.Ac)}Y(a,b){if(!this.H){super.init();var c=olympe.dc.sd.from(a).fb(olympe.sc.qa.Zc.j).Hc();if(!(c instanceof olympe.dm.ib))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.ma.oc.Rg:olympe.dc.ma.oc.vf;al(this,c,b);c=new olympe.C.Wb('deployed data sources');olympe.dc.ma.from(a).fb(olympe.sc.qa.Zc.ja).observe(c,{md:b}).subscribe(d=>{const e=
1220
- new olympe.dc.Xa;d.zj().forEach(f=>{e.Pa(olympe.dm.DataSource.Lj,this.j,f)});d.Fj().forEach(f=>{e.ic(olympe.dm.DataSource.Lj,this.j,f)});e.ob()})}}};olympe.sc.Ib.P={jg:'sc.runtime.Main',bf:'sc.runtime.SourceSolver',wr:'sc.runtime.appConfig',yr:'sc.runtime.runtimeHTTPServiceConfig',xr:'sc.runtime.RuntimeHTTPService',Pq:'sc.runtime.OfflineAppConfig'};olympe.sc.Ib.U={Tp:'app.httpManifestPath',uq:'app.manifest.common',qq:'sc.loadBusinessContainer'};
1221
- olympe.W.config(function(a){E(a,olympe.sc.Ib.U.Tp,'/runtime/manifest');E(a,olympe.sc.Ib.U.uq,null);E(a,olympe.sc.Ib.U.qq,!1);D(a,olympe.Db.P.ah,[new olympe.W.pa(olympe.zc.U.Ve),new olympe.W.pa(olympe.sc.U.Ve)],(b,c)=>`${b}${c?'-'+c:''}`);D(a,olympe.sc.Ib.P.Pq,[new olympe.W.pa(olympe.sc.U.Ve),new olympe.W.pa(olympe.net.U.cj),new olympe.W.pa(olympe.net.U.Em)],(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`))?
1217
+ h:h.message}`,olympe.net.wa.Ub.Fl)}if(0===f.size())return new olympe.net.qd('App not found',olympe.net.wa.Ub.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.W.getParameter(`app.manifest.${e}`);if(!f)f={};else if('string'===
1218
+ 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.wa.Ub.Rh,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.ma.from(a).fb(olympe.sc.qa.Zc.j).fb(olympe.dm.Bd.F.$b()).fb(olympe.dm.Bd.j).Hc();a=olympe.dc.ma.from(a).fb(olympe.sc.qa.Zc.j).fb(olympe.dm.ib.D).Hc();return c.concat(a).has(b)}
1219
+ olympe.sc.Ib.Sk=class extends olympe.dc.sources.Sk{R(a){return this.db.Ob(a,olympe.sc.Ac)}Y(a,b){if(!this.H){super.init();var c=olympe.dc.sd.from(a).fb(olympe.sc.qa.Zc.j).Hc();if(!(c instanceof olympe.dm.ib))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.ma.oc.Rg:olympe.dc.ma.oc.wf;al(this,c,b);c=new olympe.C.Wb('deployed data sources');olympe.dc.ma.from(a).fb(olympe.sc.qa.Zc.ja).observe(c,{md:b}).subscribe(d=>{const e=
1220
+ new olympe.dc.Za;d.yj().forEach(f=>{e.Pa(olympe.dm.DataSource.Lj,this.j,f)});d.Ej().forEach(f=>{e.ic(olympe.dm.DataSource.Lj,this.j,f)});e.ob()})}}};olympe.sc.Ib.P={kg:'sc.runtime.Main',bf:'sc.runtime.SourceSolver',wr:'sc.runtime.appConfig',yr:'sc.runtime.runtimeHTTPServiceConfig',xr:'sc.runtime.RuntimeHTTPService',Pq:'sc.runtime.OfflineAppConfig'};olympe.sc.Ib.U={Tp:'app.httpManifestPath',uq:'app.manifest.common',qq:'sc.loadBusinessContainer'};
1221
+ olympe.W.config(function(a){E(a,olympe.sc.Ib.U.Tp,'/runtime/manifest');E(a,olympe.sc.Ib.U.uq,null);E(a,olympe.sc.Ib.U.qq,!1);D(a,olympe.Db.P.ah,[new olympe.W.pa(olympe.zc.U.Ve),new olympe.W.pa(olympe.sc.U.Ve)],(b,c)=>`${b}${c?'-'+c:''}`);D(a,olympe.sc.Ib.P.Pq,[new olympe.W.pa(olympe.sc.U.Ve),new olympe.W.pa(olympe.net.U.bj),new olympe.W.pa(olympe.net.U.Em)],(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`))?
1222
1222
  g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Xa(a,olympe.net.P.Fm,olympe.sc.Ib.P.Pq);C(a,olympe.sc.Ib.P.bf,olympe.sc.Ib.Sk,olympe.dc.P.Dh,new olympe.W.pa(olympe.dc.U.Yg),new olympe.W.pa(olympe.dc.U.$l));Xa(a,olympe.dc.sources.P.bf,olympe.sc.Ib.P.bf);D(a,olympe.sc.Ib.P.wr,[new olympe.W.pa(olympe.sc.U.Ve),new olympe.W.pa(olympe.dc.U.Zh),new olympe.W.pa(olympe.sc.U.bp),new olympe.W.pa(olympe.sc.U.jo),new olympe.W.pa(olympe.sc.Ib.U.qq)],(b,c,d,e,f)=>new Map([['appTag',
1223
- b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['requireBusinessContainer',f]]));C(a,olympe.sc.Ib.P.jg,olympe.sc.Ib.Um,olympe.sc.P.Da,olympe.auth.P.Ea,olympe.L.P.uf,olympe.dc.query.P.Fk,olympe.host.P.Ge,olympe.sc.P.Kk,olympe.sc.Ib.P.bf,olympe.V.P.ig,olympe.sc.Ib.P.wr,olympe.sc.Ib.P.xr);D(a,olympe.sc.Ib.P.yr,[new olympe.W.pa(olympe.sc.Ib.U.Tp),new olympe.W.pa(olympe.sc.Ib.U.uq)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));C(a,olympe.sc.Ib.P.xr,olympe.sc.Ib.hw,
1224
- olympe.sc.P.Da,olympe.net.P.oj,olympe.sc.P.Kk,olympe.sc.Ib.P.yr);olympe.zc.Mj(a,olympe.sc.Ib.P.jg,'sc.runtime');olympe.zc.Mj(a,olympe.sc.Ib.P.jg,'sc.headless');olympe.zc.Mj(a,olympe.sc.Ib.P.jg)},'olympe.sc.runtime');olympe.public={};olympe.public.Na=class a{static Vx(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 rf(olympe.public.Na.get())}static ql(b){return a.D(olympe.public.Na.get().ql(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static jy(){return olympe.C.Qa(olympe.public.Na.get().ue())}static Jz(b){return a.D(olympe.public.Na.get().ue(),b)}static te(){var b=olympe.C,c=b.Qa;var d=olympe.public.Na.get().ed.tb().Hd();return c.call(b,
1225
- d)}static yg(){return new Promise((b,c)=>{olympe.public.Na.get().yg(d=>d?c(d):b())})}static xy(){return olympe.C.Qa(olympe.public.Na.get().si())||void 0}static Xy(){const b=de(olympe.public.Na.get());return{user:b.yc(),userTag:b.ue(),nonce:b.Hd(),payload:b.Wi(),idpName:b.Cf(),protocol:b.Ng()}}static wy(){return Array.from(sf().keys())}static qf(){olympe.public.Na.get().qf()}static rh(b){return new Promise((c,d)=>{olympe.public.Na.get().rh(b,e=>e?d(e):c())})}static pz(b,c){return olympe.public.Na.j((new Map).set('username',
1223
+ b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['requireBusinessContainer',f]]));C(a,olympe.sc.Ib.P.kg,olympe.sc.Ib.Um,olympe.sc.P.Da,olympe.auth.P.Ea,olympe.L.P.vf,olympe.dc.query.P.Fk,olympe.host.P.Ge,olympe.sc.P.Kk,olympe.sc.Ib.P.bf,olympe.V.P.jg,olympe.sc.Ib.P.wr,olympe.sc.Ib.P.xr);D(a,olympe.sc.Ib.P.yr,[new olympe.W.pa(olympe.sc.Ib.U.Tp),new olympe.W.pa(olympe.sc.Ib.U.uq)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));C(a,olympe.sc.Ib.P.xr,olympe.sc.Ib.hw,
1224
+ olympe.sc.P.Da,olympe.net.P.nj,olympe.sc.P.Kk,olympe.sc.Ib.P.yr);olympe.zc.Mj(a,olympe.sc.Ib.P.kg,'sc.runtime');olympe.zc.Mj(a,olympe.sc.Ib.P.kg,'sc.headless');olympe.zc.Mj(a,olympe.sc.Ib.P.kg)},'olympe.sc.runtime');olympe.public={};olympe.public.Na=class a{static Vx(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 rf(olympe.public.Na.get())}static ql(b){return a.D(olympe.public.Na.get().ql(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static jy(){return olympe.C.Qa(olympe.public.Na.get().ue())}static Jz(b){return a.D(olympe.public.Na.get().ue(),b)}static te(){var b=olympe.C,c=b.Qa;var d=olympe.public.Na.get().ed.tb().Hd();return c.call(b,
1225
+ d)}static zg(){return new Promise((b,c)=>{olympe.public.Na.get().zg(d=>d?c(d):b())})}static xy(){return olympe.C.Qa(olympe.public.Na.get().si())||void 0}static Xy(){const b=de(olympe.public.Na.get());return{user:b.yc(),userTag:b.ue(),nonce:b.Hd(),payload:b.Vi(),idpName:b.Df(),protocol:b.Ng()}}static wy(){return Array.from(sf().keys())}static rf(){olympe.public.Na.get().rf()}static rh(b){return new Promise((c,d)=>{olympe.public.Na.get().rh(b,e=>e?d(e):c())})}static pz(b,c){return olympe.public.Na.j((new Map).set('username',
1226
1226
  b).set('password',c),olympe.auth.Ec.j.SRP)}static qz(b){const c=sf();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.Na.j((new Map).set('idpName',d),b)}static oz(){return olympe.public.Na.j(new Map,olympe.auth.Ec.j.SAML)}static rz(b,c){return olympe.public.Na.j((new Map).set('username',b).set('nonce',
1227
- c),olympe.auth.Ec.j.Gm)}static nz(){return olympe.public.Na.j(new Map,olympe.auth.Ec.j.OAUTH2)}static yi(){return olympe.public.Na.get().yi()}static j(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{qf(olympe.public.Na.get(),d,c,()=>{e()})})}static get(){return olympe.auth.re()}static D(b,c){return b.asObservable('function'===typeof c.Bb?c.Bb():c)}};olympe.public.Na.logout=olympe.public.Na.yi;olympe.public.Na.loginOpenID=olympe.public.Na.nz;
1228
- olympe.public.Na.loginToken=olympe.public.Na.rz;olympe.public.Na.loginSAML=olympe.public.Na.oz;olympe.public.Na.loginSSO=olympe.public.Na.qz;olympe.public.Na.loginSRP=olympe.public.Na.pz;olympe.public.Na.getUserFromToken=olympe.public.Na.rh;olympe.public.Na.sendKeepAlive=olympe.public.Na.qf;olympe.public.Na.getIDPNames=olympe.public.Na.wy;olympe.public.Na.getUserToken=olympe.public.Na.Xy;olympe.public.Na.getIDPToken=olympe.public.Na.xy;olympe.public.Na.refreshToken=olympe.public.Na.yg;
1229
- olympe.public.Na.getToken=olympe.public.Na.te;olympe.public.Na.observeUser=olympe.public.Na.Jz;olympe.public.Na.getCurrentUser=olympe.public.Na.jy;olympe.public.Na.isAuthenticated=olympe.public.Na.ql;olympe.public.Na.getState=olympe.public.Na.getState;olympe.public.Na.generateSRPData=olympe.public.Na.Vx;olympe.public.Ba=class{static create(a){return new class extends olympe.dc.Z.Cg{j(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.C.cc(olympe.C.da),e=b.subscribe(f=>d.update(olympe.C.Sb(f)));olympe.C.Ya().Yd(()=>e.unsubscribe());return d.tb()}}}};
1230
- olympe.public.wf=class{static create(a){return new class extends olympe.dc.xc.Cg{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.cc(olympe.C.aa),e=b.subscribe(f=>d.update(olympe.C.ra(f)));olympe.C.Ya().Yd(()=>e.unsubscribe());return d.tb()}}}};olympe.public.Process=class{static Lz(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.D(a,void 0,null==b?void 0:b.type);return()=>c.F(d)}static Mz(a,b,c){const d=olympe.host.ll(),e=d.j(a,b,c);return()=>d.H(e)}static connect(){return olympe.L.An().connect()}static disconnect(){return olympe.L.An().disconnect()}static Wf(a){a='function'===typeof a.Bb?a.Bb():a;return olympe.L.An().Wf().asObservable(a).pipe(rxjs.operators.map(b=>
1231
- b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Wf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.Mz;olympe.public.Process.onHealthCheck=olympe.public.Process.Lz;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Sa.Relation,Direction:olympe.dc.va,generateTag:olympe.V.Of,tagToString:olympe.dc.fa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Ds,defineInverseRelation:olympe.dc.Fx,BrickContext:olympe.sc.ya,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Function,GlobalProperties:olympe.sc.ya.j,registerBrick:olympe.sc.logic.na.j,FunctionBrick:olympe.sc.logic.Function,
1232
- Context:olympe.sc.ya,Entry:olympe.dc.Sa.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.Ni,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.Ed,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.df,WorkflowTransition:olympe.sc.workflow.Transition,
1233
- WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Xa,BurstTransaction:olympe.dc.Hi,TransactionResult:olympe.sc.nj,PredefinedDataSource:olympe.dc.Ha,QueryResult:olympe.dc.Ka,Query:olympe.dc.ma,QuerySingle:olympe.dc.sd,Predicate:olympe.dc.query.Ba,Order:olympe.dc.query.Bk,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.Je.j,Cache:{getCacheEntries:()=>olympe.dc.sources.de().N,clearCache:a=>ql(olympe.dc.sources.de(),
1227
+ c),olympe.auth.Ec.j.Gm)}static nz(){return olympe.public.Na.j(new Map,olympe.auth.Ec.j.OAUTH2)}static Jj(){return olympe.public.Na.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=>{qf(olympe.public.Na.get(),d,c,()=>{e()})})}static get(){return olympe.auth.re()}static D(b,c){return b.asObservable('function'===typeof c.Bb?c.Bb():c)}};olympe.public.Na.logout=olympe.public.Na.Jj;olympe.public.Na.loginOpenID=olympe.public.Na.nz;
1228
+ olympe.public.Na.loginToken=olympe.public.Na.rz;olympe.public.Na.loginSAML=olympe.public.Na.oz;olympe.public.Na.loginSSO=olympe.public.Na.qz;olympe.public.Na.loginSRP=olympe.public.Na.pz;olympe.public.Na.getUserFromToken=olympe.public.Na.rh;olympe.public.Na.sendKeepAlive=olympe.public.Na.rf;olympe.public.Na.getIDPNames=olympe.public.Na.wy;olympe.public.Na.getUserToken=olympe.public.Na.Xy;olympe.public.Na.getIDPToken=olympe.public.Na.xy;olympe.public.Na.refreshToken=olympe.public.Na.zg;
1229
+ olympe.public.Na.getToken=olympe.public.Na.te;olympe.public.Na.observeUser=olympe.public.Na.Jz;olympe.public.Na.getCurrentUser=olympe.public.Na.jy;olympe.public.Na.isAuthenticated=olympe.public.Na.ql;olympe.public.Na.getState=olympe.public.Na.getState;olympe.public.Na.generateSRPData=olympe.public.Na.Vx;olympe.public.Ba=class{static create(a){return new class extends olympe.dc.Z.Cg{j(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.C.cc(olympe.C.da),e=b.subscribe(f=>d.update(olympe.C.Sb(f)));olympe.C.$a().Yd(()=>e.unsubscribe());return d.tb()}}}};
1230
+ olympe.public.xf=class{static create(a){return new class extends olympe.dc.xc.Cg{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.cc(olympe.C.aa),e=b.subscribe(f=>d.update(olympe.C.ra(f)));olympe.C.$a().Yd(()=>e.unsubscribe());return d.tb()}}}};olympe.public.Process=class{static Lz(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 Mz(a,b,c){const d=olympe.host.ll(),e=d.ja(a,b,c);return()=>d.F(e)}static connect(){return olympe.L.An().connect()}static disconnect(){return olympe.L.An().disconnect()}static Wf(a){a='function'===typeof a.Bb?a.Bb():a;return olympe.L.An().Wf().asObservable(a).pipe(rxjs.operators.map(b=>
1231
+ b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Wf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.Mz;olympe.public.Process.onHealthCheck=olympe.public.Process.Lz;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Sa.Relation,Direction:olympe.dc.va,generateTag:olympe.V.jf,tagToString:olympe.dc.fa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Ds,defineInverseRelation:olympe.dc.Fx,BrickContext:olympe.sc.ya,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Function,GlobalProperties:olympe.sc.ya.j,registerBrick:olympe.sc.logic.na.j,FunctionBrick:olympe.sc.logic.Function,
1232
+ Context:olympe.sc.ya,Entry:olympe.dc.Sa.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.Ed,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.df,WorkflowTransition:olympe.sc.workflow.Transition,
1233
+ WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Za,BurstTransaction:olympe.dc.Gi,TransactionResult:olympe.sc.mj,PredefinedDataSource:olympe.dc.Ia,QueryResult:olympe.dc.Ka,Query:olympe.dc.ma,QuerySingle:olympe.dc.sd,Predicate:olympe.dc.query.Ba,Order:olympe.dc.query.Bk,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.Je.j,Cache:{getCacheEntries:()=>olympe.dc.sources.de().N,clearCache:a=>ql(olympe.dc.sources.de(),
1234
1234
  a),getProcessingStatus:()=>olympe.dc.sources.de().Jc(),getProcessingErrors:()=>olympe.dc.sources.de().wd.asObservable(),hasPendingChanges:()=>olympe.dc.sources.de().ea.asObservable(),synchroniseChanges:()=>wl(),getPendingChanges:()=>zl(),clearPendingChanges:()=>Dl(),loadPendingChanges:a=>Bl(a)},Color:olympe.C.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.L.xa.j,ServiceRequest:olympe.L.Fc,Service:olympe.L.rb,Auth:olympe.public.Na,AuthState:{INIT:olympe.auth.Ua.j.INIT,AUTHENTICATING:olympe.auth.Ua.j.Sj,
1235
- GUEST:olympe.auth.Ua.j.Qi,AUTHENTICATED:olympe.auth.Ua.j.rf,ERROR:olympe.auth.Ua.j.zb},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,
1236
- instanceToTag:olympe.dc.fa,registerSync:olympe.dc.na.j,getUniqueTag:olympe.V.Of,onDestroy:a=>olympe.C.Ya().onDestroy(a),offDestroy:a=>olympe.C.Ya().Xf(a),FollowRules:olympe.dc.Mb,transformers:{Related:olympe.dc.ba.af,RecursiveRelated:olympe.dc.ba.Ke,Distinct:olympe.dc.ba.Li,Filter:olympe.dc.ba.yf,Limit:olympe.dc.ba.Nh,Sort:olympe.dc.ba.bh,Union:olympe.dc.ba.Kf},ListDefPredicate:olympe.public.Ba,predicates:{And:olympe.dc.Z.Od,Or:olympe.dc.Z.Fe,Not:olympe.dc.Z.je,Equals:olympe.dc.Z.Be,Contains:olympe.dc.Z.xf,
1237
- Greater:olympe.dc.Z.mk,Smaller:olympe.dc.Z.Rk,HasRelated:olympe.dc.Z.Si,InstanceOf:olympe.dc.Z.Vi,Regex:olympe.dc.Z.Gf},Comparator:olympe.public.wf,comparators:{Number:olympe.dc.xc.Number,String:olympe.dc.xc.String,DateTime:olympe.dc.xc.DateTime},valuedefs:{BooleanProperty:olympe.dc.ab.Wj,StringProperty:olympe.dc.ab.kj,NumberProperty:olympe.dc.ab.bj,DateTimeProperty:olympe.dc.ab.Ki,Constant:olympe.dc.ab.Xe,Tag:olympe.dc.ab.lj}});
1235
+ GUEST:olympe.auth.Ua.j.Pi,AUTHENTICATED:olympe.auth.Ua.j.sf,ERROR:olympe.auth.Ua.j.zb},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,
1236
+ instanceToTag:olympe.dc.fa,registerSync:olympe.dc.na.j,getUniqueTag:olympe.V.jf,onDestroy:a=>olympe.C.$a().onDestroy(a),offDestroy:a=>olympe.C.$a().Xf(a),FollowRules:olympe.dc.Mb,transformers:{Related:olympe.dc.ba.af,RecursiveRelated:olympe.dc.ba.Ke,Distinct:olympe.dc.ba.Ki,Filter:olympe.dc.ba.zf,Limit:olympe.dc.ba.Nh,Sort:olympe.dc.ba.bh,Union:olympe.dc.ba.Lf},ListDefPredicate:olympe.public.Ba,predicates:{And:olympe.dc.Z.Od,Or:olympe.dc.Z.Fe,Not:olympe.dc.Z.je,Equals:olympe.dc.Z.Be,Contains:olympe.dc.Z.yf,
1237
+ Greater:olympe.dc.Z.mk,Smaller:olympe.dc.Z.Rk,HasRelated:olympe.dc.Z.Ri,InstanceOf:olympe.dc.Z.Ui,Regex:olympe.dc.Z.Hf},Comparator:olympe.public.xf,comparators:{Number:olympe.dc.xc.Number,String:olympe.dc.xc.String,DateTime:olympe.dc.xc.DateTime},valuedefs:{BooleanProperty:olympe.dc.bb.Wj,StringProperty:olympe.dc.bb.jj,NumberProperty:olympe.dc.bb.aj,DateTimeProperty:olympe.dc.bb.Ji,Constant:olympe.dc.bb.Xe,Tag:olympe.dc.bb.kj}});
1238
1238
 
1239
1239
 
1240
1240
  }.bind(this))();