@olympeio/runtime-node 9.10.2 → 9.10.4

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
@@ -230,35 +230,35 @@ function ca(a){a=['object'==typeof globalThis&&globalThis,a,'object'==typeof win
230
230
  v('Symbol.asyncIterator',function(a){return a?a:Symbol('Symbol.asyncIterator')});function ea(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 w(a){return ea(a())}
231
231
  function fa(a){var b=a[Symbol.asyncIterator];if(void 0!==b)a=b.call(a);else{b=ha;var c='undefined'!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];a=c?c.call(a):{next:aa(a)};a=new b(a)}return a}
232
232
  function ha(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 ia(a,b){this.j=a;this.value=b}function ja(a,b,c,d){this.method=a;this.j=b;this.resolve=c;this.D=d}function ka(a){this.j=a;this.next=null}
233
- function la(){this.D=this.j=null}la.prototype.cf=function(){return null===this.j};la.prototype.first=function(){if(this.j)return this.j.j;throw Error('no frames in executionQueue');};function ma(a){a.j&&(a.j=a.j.next,a.j||(a.D=null))}la.prototype.enqueue=function(a){a=new ka(a);this.D?this.D.next=a:this.j=a;this.D=a};
234
- function na(a){this.J=a;this.D=null;this.j=new la;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}),ma(b.j));oa(b)};this.N=function(c){pa(b,c)};this.F=function(c){qa(b,c)}}function ra(a,b,c){return new Promise(function(d,e){var f=a.j.cf();a.j.enqueue(new ja(b,c,d,e));f&&oa(a)})}na.prototype.next=function(a){return ra(this,'next',a)};
235
- na.prototype.return=function(a){return ra(this,'return',new ia(0,a))};na.prototype.throw=function(a){return ra(this,'throw',a)};function oa(a){if(!a.j.cf())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){pa(a,c)}else a.D=null,oa(a)}else sa(a)}catch(c){qa(a,c)}}
236
- function sa(a){var b=a.j.first();try{var c=a.J[b.method](b.j);if(c.value instanceof ia)switch(c.value.j){case 0:Promise.resolve(c.value.value).then(function(d){b.resolve({value:d,done:c.done});ma(a.j);oa(a)},function(d){b.D(d);ma(a.j);oa(a)}).catch(a.F);break;case 1:a.D=fa(c.value.value);b.method='next';b.j=void 0;oa(a);break;case 2:Promise.resolve(c.value.value).then(function(d){b.method='next';b.j=d;oa(a)},function(d){b.method='throw';b.j=d;oa(a)}).catch(a.F);break;default:throw Error('Unrecognized AsyncGeneratorWrapper$ActionEnum');
237
- }else b.resolve(c),ma(a.j),oa(a)}catch(d){b.D(d),ma(a.j),oa(a)}}function pa(a,b){var c=a.j.first();a.D=null;c.method='throw';c.j=b;oa(a)}function qa(a,b){a.j.cf()||(a.j.first().D(b),ma(a.j));a.D&&'return'in a.D&&(a.D['return'](void 0),a.D=null);a.J['return'](void 0);oa(a)}v('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}});
233
+ function la(){this.D=this.j=null}la.prototype.hf=function(){return null===this.j};la.prototype.first=function(){if(this.j)return this.j.j;throw Error('no frames in executionQueue');};function ma(a){a.j&&(a.j=a.j.next,a.j||(a.D=null))}la.prototype.enqueue=function(a){a=new ka(a);this.D?this.D.next=a:this.j=a;this.D=a};
234
+ function na(a){this.H=a;this.D=null;this.j=new la;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}),ma(b.j));oa(b)};this.N=function(c){pa(b,c)};this.F=function(c){qa(b,c)}}function ra(a,b,c){return new Promise(function(d,e){var f=a.j.hf();a.j.enqueue(new ja(b,c,d,e));f&&oa(a)})}na.prototype.next=function(a){return ra(this,'next',a)};
235
+ na.prototype.return=function(a){return ra(this,'return',new ia(0,a))};na.prototype.throw=function(a){return ra(this,'throw',a)};function oa(a){if(!a.j.hf())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){pa(a,c)}else a.D=null,oa(a)}else sa(a)}catch(c){qa(a,c)}}
236
+ function sa(a){var b=a.j.first();try{var c=a.H[b.method](b.j);if(c.value instanceof ia)switch(c.value.j){case 0:Promise.resolve(c.value.value).then(function(d){b.resolve({value:d,done:c.done});ma(a.j);oa(a)},function(d){b.D(d);ma(a.j);oa(a)}).catch(a.F);break;case 1:a.D=fa(c.value.value);b.method='next';b.j=void 0;oa(a);break;case 2:Promise.resolve(c.value.value).then(function(d){b.method='next';b.j=d;oa(a)},function(d){b.method='throw';b.j=d;oa(a)}).catch(a.F);break;default:throw Error('Unrecognized AsyncGeneratorWrapper$ActionEnum');
237
+ }else b.resolve(c),ma(a.j),oa(a)}catch(d){b.D(d),ma(a.j),oa(a)}}function pa(a,b){var c=a.j.first();a.D=null;c.method='throw';c.j=b;oa(a)}function qa(a,b){a.j.hf()||(a.j.first().D(b),ma(a.j));a.D&&'return'in a.D&&(a.D['return'](void 0),a.D=null);a.H['return'](void 0);oa(a)}v('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}});
238
238
  v('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 ta(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}v('Array.prototype.values',function(a){return a?a:function(){return ta(this,function(b,c){return c})}});
239
239
  v('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}});
240
240
  v('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;})})}});function ua(a){if(null==a)throw new TypeError("The 'this' value for String.prototype.padStart must not be null or undefined");return a+''}function va(a,b){a=void 0!==a?String(a):' ';return 0<b&&a?a.repeat(Math.ceil(b/a.length)).substring(0,b):''}
241
241
  v('String.prototype.padStart',function(a){return a?a:function(b,c){var d=ua(this);return va(c,b-d.length)+d}});v('String.prototype.padEnd',function(a){return a?a:function(b,c){var d=ua(this);return d+va(c,b-d.length)}});v('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)}});
242
242
  v('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}});v('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}});
243
- v('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 wa=this||self;function B(a,b){a=a.split('.');let c=wa;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={Zd:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.Zd())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.Zd().olympe=olympe;olympe.jE=(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 ya=require('util');function za(a){return'string'===typeof a?a:ya.inspect(a,{maxStringLength:1E4,depth:null,breakLength:Infinity})}function Aa(a,b){return JSON.stringify({level:a,message:b.map(za).join(' ')})}const Ba=console.trace,Ca=console.debug,Da=console.log,Ea=console.info,Fa=console.warn,Ga=console.error;console.trace=(...a)=>Ba.call(console,Aa('TRACE',a));console.debug=(...a)=>Ca.call(console,Aa('DEBUG',a));console.log=(...a)=>Da.call(console,Aa('LOG',a));
244
- console.info=(...a)=>Ea.call(console,Aa('INFO',a));console.warn=(...a)=>Fa.call(console,Aa('WARN',a));console.error=(...a)=>Ga.call(console,Aa('ERROR',a));olympe.Va={};olympe.Va.node={};olympe.W={};olympe.W.Ff={};olympe.W.Ff.io=class{process(a){for(const b of Object.keys(a.ve))if(a.rd(b).hn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.Ff.io.xa=[olympe.W.Ff.uq];olympe.W.Ff.jo=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.rd(e);c(e.ij(),f);for(const g of Ha(e))c(g.ij(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.ub&&b(g.T(),f)}const d=new Set(Object.keys(a.ve));for(const e of d)b(e,[])}};olympe.W.Ff.jo.xa=[olympe.W.Ff.uq];olympe.W.Ff.uq=class{process(){}};const Ia=[],Ja=[];function Ka(a){const b=a.ab();b.debug('Registering configurations...');b.j++;Ia.forEach(c=>{C(a.G,'Registering configure callback '+(c.j?'for module '+c.j:''));a.J.push(c.D)});La(b);b.debug('done registering')}function Ma(a){const b=a.ab();b.debug('Running run callbacks of container...');b.j++;Ja.forEach(c=>{const d=Na(a,c.ij());a.G.debug('Calling run callback '+`for module ${c.j}`);c.D.apply(null,d)});La(b);b.debug('done calling run callbacks. DI process completed!')}
245
- olympe.W.oo=class{constructor(){}static j(a,b){Ia.push(new olympe.W.tl(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');});Ja.push(new olympe.W.tl(b,c,a))}};olympe.W.config=olympe.W.oo.j;olympe.W.run=olympe.W.oo.D;olympe.W.ds=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.Bj=class{constructor(){}getValue(){}};function Oa(a,b){let c,d;return null!=(d=null==(c=a.F)?void 0:c.call(a,b))?d:!0}olympe.W.tl=class{constructor(a,b,c){this.D=a;this.J=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.W.ub(d):d);this.j=null!=b?b:'no name di callback';this.F=null}ij(){return this.J}};function Qa(a,b){var c=olympe.W.P.sg;if(void 0!==a.j[c])throw Error('Service "'+c+'" has already been instantiated');a.j[c]=b}function Ra(a,b,c){let d=a.j[b];if(void 0===d){const e=a.J[b];if(void 0===e){if(c===olympe.W.mh.j.am)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.J&&(a.j[b]=d)}return d}
246
- function Sa(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 Na(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.Bj?f.getValue(a):f,La(a.G);return d}
247
- olympe.W.mh=class{constructor(a,b,c,d,e=2){this.J=a;this.F=b;this.parameters=c;this.j=Object.create(null);this.G=new olympe.W.Np(e);this.D=new Map;Qa(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Ra(this,f).subscribe(this.xj.bind(this,f)))}ab(){return this.G}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}xj(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.G.debug(`Updating parameter ${a} to ${b} and notify ${null!=
248
- (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.mh.j={At:'exception',am:'null'};function Ta(a,b){b=olympe.W.ds(b);for(const [c,d]of b)Ua(a,c,d)}function D(a,b,c,...d){C(a.G,'Defining service '+b);a.j(b,c,d,!1,!1)}function Va(a,b,c,...d){C(a.G,'Defining service '+b);a.j(b,c,d,!1,!0)}function E(a,b,c,d,e=!1){C(a.G,'Defining service (as a factory) '+b);a.j(b,d,c,!0,e)}function Wa(a,b,c,d=!1){C(a.G,'Defining service alias '+b);a.j(b,e=>e,[c],!0,d)}function Xa(a,b){C(a.G,'Defining abstract service '+b);a.j(b).F=!0}function Ua(a,b,c){a.parameters[b.toLowerCase()]=c}
249
- function Ya(a,b,c,d){a.F.push(b);Ua(a,b,d(...c.map(e=>a.getParameter(e))));E(a,b,c.map(e=>new olympe.W.ph(e)),(...e)=>rxjs.combineLatest(e).pipe(rxjs.operators.skip(1),rxjs.operators.map(f=>d(...f)),rxjs.operators.distinctUntilChanged()))}function F(a,b,c){a.D[b.toLowerCase()]=c}
250
- olympe.W.qt=class{constructor(a,b){this.ve=Object.create(null);this.parameters=Object.create(null);this.D=Object.create(null);this.F=[];Ta(this,a);Ta(this,b);this.R=[new olympe.W.Ff.io,new olympe.W.Ff.jo];this.J=[];a=this.getParameter(olympe.W.U.Gu);this.N=void 0!==a?a:3;this.G=new olympe.W.Np(this.N)}ab(){return this.G}j(a,b,c,d,e){const f=a instanceof olympe.W.ub?a.T():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.ve[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
251
- var g=this.ve[f];g.id=g.id+'!!'+ ++olympe.W.Dl.j;g.J=!0;g=g.id;c[h]=g;this.ve[g]=this.ve[f]}}this.ve[f]=new olympe.W.Dl(b,c,d||!1,f);return this.ve[f]}rd(a){const b=this.ve[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.J;this.G.debug('Calling '+a.length+' configure callbacks');this.G.j++;a.forEach(b=>{C(this.G,'Calling callback');this.G.j++;b(this);La(this.G)});
252
- La(this.G);this.G.debug('Configuration summary: '+Object.keys(this.ve).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)});La(this.G);this.G.debug('Compilation done, returning container');return new olympe.W.mh(this.ve,this.D,this.parameters,this.F,this.N)}};function Ha(a){let b,c;return null!=(c=null==(b=a.j)?void 0:b.values())?c:[]}
253
- olympe.W.Dl=class{constructor(a,b,c,d){this.N=a||null;this.R=!!c;this.D=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.ub(e):e);this.F=!1;this.j=null;this.id=null!=d?d:'';this.J=!1}T(){return this.id}instantiate(a){const b=a.ab();b.debug('Resolving arguments for '+this.id);const c=this.N;let d=Na(a,this.D);const e=()=>{if(this.R)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};C(b,'Instantiating '+this.id);const f=olympe.C?olympe.C.Xg().run(()=>e()):e();let g;if(0<(null==
254
- (g=this.j)?void 0:g.size)){b.j++;C(b,'Calling configuration callbacks:');for(const h of this.j.values())b.j++,C(b,'Check if need to call additional configuration callback '+h.j),Oa(h,f)?(C(b,'Calling additional configuration callback '+h.j),d=Na(a,h.ij()),d.push(f),h.D.apply(null,d)):C(b,'Will not call additional configuration callback '+h.j+'predicate has returned false'),La(b);La(b)}C(b,'Done instantiating '+this.id);return f}ij(){return this.D}hn(){return this.F}config(a,b,c,d,e){null===this.j&&
255
- (this.j=new Map);var f=this.j,g=f.set;b=new olympe.W.tl(c,e,b);b.F=d;g.call(f,a,b)}};olympe.W.Dl.j=0;olympe.W.ph=class extends olympe.W.Bj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return new rxjs.Observable(b=>{b.next(a.getParameter(this.id));Sa(a,this.id,c=>b.next(c))})}};function La(a){0<a.j&&a.j--}function C(a,b){1>=a.D&&Za(a,'log','DI: '+b)}function Za(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.j;e++)d+=' ';console[b](d+c)}}olympe.W.Np=class{constructor(a){this.D=a;this.j=0}debug(a){2>=this.D&&Za(this,'log','DI: '+a)}info(a){3>=this.D&&Za(this,'info','DI: '+a)}warn(a){4>=this.D&&Za(this,'warn','DI: '+a)}error(a){5>=this.D&&Za(this,'error','DI: '+a)}};olympe.W.pa=class extends olympe.W.Bj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.W.ub=class extends olympe.W.Bj{constructor(a,b){super();this.id=a;this.j=b||olympe.W.mh.j.At}T(){return this.id}getValue(a){return Ra(a,this.id,this.j)}};olympe.W.P={sg:'di.Container',SB:'di.PublicContainer'};olympe.W.U={Gu:'logging.di'};olympe.W.run([olympe.W.P.sg],a=>{olympe.W.getParameter=b=>a.getParameter(b);olympe.W.xj=(b,c)=>a.xj(b,c);olympe.Zd().getConfig=b=>a.getParameter(b);olympe.Zd().getConfigNames=()=>Object.keys(a.parameters);olympe.Zd().updateConfig=(b,c)=>a.xj(b,c)});olympe.V={};olympe.V.Bp=class{constructor(a){this.id=a||olympe.V.Bp.j++}Ea(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}print(){return('000000'+this.id).substr(-6)}};olympe.V.Bp.j=0;olympe.V.wB=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.yh=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.yh.D=function(a){return new olympe.V.yh(.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.yh.j=function(){return new olympe.V.yh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.V.yh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.V.yh.prototype.get=function(a,b){return this.values[5*a+b]};function $a(a){return(new TextEncoder).encode(a)}function bb(a,b){return a.j($a(b))}function cb(a){return(new TextDecoder('utf8')).decode(a)}function db(a){const b=new olympe.V.stream.yf;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}
256
- olympe.V.ll=class{D(){}j(){}J(a){return w(function*(){if(a instanceof ArrayBuffer)return new Uint8Array(a);if(a instanceof Uint8Array)return a;if('string'===typeof a)return $a(a);if(a instanceof Blob)return new Uint8Array(yield a.arrayBuffer());if(a instanceof olympe.V.stream.yf){const b=[];for(const c=fa(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(){}};
257
- olympe.V.Ir=a=>a.replace('+','-').replace('/','_');olympe.V.Ew=a=>a.replace('-','+').replace('_','/');function eb(a){a.j=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.D&&a.D(d));if(0<a.values.size)eb(a);else{let d;null==(d=a.F)||d.call(a)}},a.J)}function fb(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function gb(a,b){a.D=b;return a}
258
- olympe.V.Bm=class{constructor(a,b=a/2){this.timeout=a;this.J=b;this.values=new Map;this.F=this.D=this.j=null}add(a){this.values.set(a,Date.now());null===this.j&&eb(this)}has(a){return this.values.has(a)}forEach(a){this.values.forEach((b,c)=>a(c))}delete(a){a=this.values.delete(a);if(0===this.values.size){this.j&&clearTimeout(this.j);this.j=null;let b;null==(b=this.F)||b.call(this)}return a}clear(){this.j&&clearTimeout(this.j);this.j=null;this.values.clear();return this}};function hb(a,b){a.D=b;return a}function ib(a,b){a.j.F=b}
259
- olympe.V.Jh=class{constructor(a){this.j=gb(new olympe.V.Bm(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 jb(a,b){a.R.push(b)}function kb(a,b){a.Y.push(b)}function lb(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=>lb(a,d)):c='N/A';return c}function mb(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]=lb(a,g);a.F.push(b)}
260
- olympe.V.ov=class{constructor(){this.F=[];this.R=[];this.Y=[];this.N=new Map;this.J=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 nb(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={JE(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.V.Promise={};olympe.V.Promise.dj=function(a,b){let c=null;return(...d)=>new Promise((e,f)=>{clearTimeout(c);c=setTimeout(()=>w(function*(){try{const g=yield a(...d);e(g)}catch(g){f(g)}}),b)})};olympe.V.Promise.Cn=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)})})};olympe.V.promise={};function ob(a){if(0===a.size())a.D.next(!1);else if(a.F()){a.j++;var b=pb(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);ob(a)})}}function qb(a,b){return new Promise((c,d)=>{a.Fa.push(new olympe.V.promise.Sv(c,d,b));ob(a)})}function pb(a){a.D.next(!0);let b;return null!=(b=a.Fa.shift())?b:null}
261
- olympe.V.promise.wm=class{constructor(){this.Fa=[];this.D=new rxjs.BehaviorSubject(!1);this.j=0}F(){return 0===this.j}clear(){for(;0<this.Fa.length;)this.Fa.shift().j(Error('Canceled by a clearStack'));ob(this)}size(){return this.Fa.length}};olympe.V.promise.Sv=class{constructor(a,b,c){this.resolve=a;this.j=b;this.D=c}};olympe.V.promise.ir=class extends olympe.V.promise.wm{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.pj=a}F(){return this.j<this.pj}};olympe.V.promise.mD=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([`
243
+ v('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 wa=this||self;function B(a,b){a=a.split('.');let c=wa;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={$d:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.$d())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.$d().olympe=olympe;olympe.rE=(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 ya=require('util');function za(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():ya.inspect(b,{maxStringLength:1E4,depth:null,breakLength:Infinity})}function Aa(a,b){return JSON.stringify({level:a,message:b.map(za).join(' ')})}
244
+ const Ba=console.trace,Ca=console.debug,Da=console.log,Ea=console.info,Fa=console.warn,Ga=console.error;console.trace=(...a)=>Ba.call(console,Aa('TRACE',a));console.debug=(...a)=>Ca.call(console,Aa('DEBUG',a));console.log=(...a)=>Da.call(console,Aa('LOG',a));console.info=(...a)=>Ea.call(console,Aa('INFO',a));console.warn=(...a)=>Fa.call(console,Aa('WARN',a));console.error=(...a)=>Ga.call(console,Aa('ERROR',a));olympe.Va={};olympe.Va.node={};olympe.W={};olympe.W.Jf={};olympe.W.Jf.oo=class{process(a){for(const b of Object.keys(a.xe))if(a.rd(b).pn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.Jf.oo.xa=[olympe.W.Jf.Bq];olympe.W.Jf.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.rd(e);c(e.pj(),f);for(const g of Ha(e))c(g.pj(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.ub&&b(g.T(),f)}const d=new Set(Object.keys(a.xe));for(const e of d)b(e,[])}};olympe.W.Jf.po.xa=[olympe.W.Jf.Bq];olympe.W.Jf.Bq=class{process(){}};const Ia=[],Ja=[];function Ka(a){const b=a.$a();b.debug('Registering configurations...');b.j++;Ia.forEach(c=>{C(a.G,'Registering configure callback '+(c.j?'for module '+c.j:''));a.H.push(c.D)});La(b);b.debug('done registering')}function Ma(a){const b=a.$a();b.debug('Running run callbacks of container...');b.j++;Ja.forEach(c=>{const d=Na(a,c.pj());a.G.debug('Calling run callback '+`for module ${c.j}`);c.D.apply(null,d)});La(b);b.debug('done calling run callbacks. DI process completed!')}
245
+ olympe.W.vo=class{constructor(){}static j(a,b){Ia.push(new olympe.W.zl(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');});Ja.push(new olympe.W.zl(b,c,a))}};olympe.W.config=olympe.W.vo.j;olympe.W.run=olympe.W.vo.D;olympe.W.ms=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.Ij=class{constructor(){}getValue(){}};function Oa(a,b){let c,d;return null!=(d=null==(c=a.F)?void 0:c.call(a,b))?d:!0}olympe.W.zl=class{constructor(a,b,c){this.D=a;this.H=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.W.ub(d):d);this.j=null!=b?b:'no name di callback';this.F=null}pj(){return this.H}};function Qa(a,b){var c=olympe.W.P.xg;if(void 0!==a.j[c])throw Error('Service "'+c+'" has already been instantiated');a.j[c]=b}function Ra(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.qh.j.hm)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.H&&(a.j[b]=d)}return d}
246
+ function Sa(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 Na(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.Ij?f.getValue(a):f,La(a.G);return d}
247
+ olympe.W.qh=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.Up(e);this.D=new Map;Qa(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Ra(this,f).subscribe(this.Ej.bind(this,f)))}$a(){return this.G}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}Ej(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.G.debug(`Updating parameter ${a} to ${b} and notify ${null!=
248
+ (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.qh.j={Jt:'exception',hm:'null'};function Ta(a,b){b=olympe.W.ms(b);for(const [c,d]of b)Ua(a,c,d)}function D(a,b,c,...d){C(a.G,'Defining service '+b);a.j(b,c,d,!1,!1)}function Va(a,b,c,...d){C(a.G,'Defining service '+b);a.j(b,c,d,!1,!0)}function E(a,b,c,d,e=!1){C(a.G,'Defining service (as a factory) '+b);a.j(b,d,c,!0,e)}function Wa(a,b,c,d=!1){C(a.G,'Defining service alias '+b);a.j(b,e=>e,[c],!0,d)}function Xa(a,b){C(a.G,'Defining abstract service '+b);a.j(b).F=!0}function Ua(a,b,c){a.parameters[b.toLowerCase()]=c}
249
+ function Ya(a,b,c,d){a.F.push(b);Ua(a,b,d(...c.map(e=>a.getParameter(e))));E(a,b,c.map(e=>new olympe.W.th(e)),(...e)=>rxjs.combineLatest(e).pipe(rxjs.operators.skip(1),rxjs.operators.map(f=>d(...f)),rxjs.operators.distinctUntilChanged()))}function F(a,b,c){a.D[b.toLowerCase()]=c}
250
+ olympe.W.zt=class{constructor(a,b){this.xe=Object.create(null);this.parameters=Object.create(null);this.D=Object.create(null);this.F=[];Ta(this,a);Ta(this,b);this.R=[new olympe.W.Jf.oo,new olympe.W.Jf.po];this.H=[];a=this.getParameter(olympe.W.U.Pu);this.N=void 0!==a?a:3;this.G=new olympe.W.Up(this.N)}$a(){return this.G}j(a,b,c,d,e){const f=a instanceof olympe.W.ub?a.T():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.xe[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
251
+ var g=this.xe[f];g.id=g.id+'!!'+ ++olympe.W.Jl.j;g.H=!0;g=g.id;c[h]=g;this.xe[g]=this.xe[f]}}this.xe[f]=new olympe.W.Jl(b,c,d||!1,f);return this.xe[f]}rd(a){const b=this.xe[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=>{C(this.G,'Calling callback');this.G.j++;b(this);La(this.G)});
252
+ La(this.G);this.G.debug('Configuration summary: '+Object.keys(this.xe).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)});La(this.G);this.G.debug('Compilation done, returning container');return new olympe.W.qh(this.xe,this.D,this.parameters,this.F,this.N)}};function Ha(a){let b,c;return null!=(c=null==(b=a.j)?void 0:b.values())?c:[]}
253
+ olympe.W.Jl=class{constructor(a,b,c,d){this.N=a||null;this.R=!!c;this.D=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.ub(e):e);this.F=!1;this.j=null;this.id=null!=d?d:'';this.H=!1}T(){return this.id}instantiate(a){const b=a.$a();b.debug('Resolving arguments for '+this.id);const c=this.N;let d=Na(a,this.D);const e=()=>{if(this.R)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};C(b,'Instantiating '+this.id);const f=olympe.C?olympe.C.ah().run(()=>e()):e();let g;if(0<(null==
254
+ (g=this.j)?void 0:g.size)){b.j++;C(b,'Calling configuration callbacks:');for(const h of this.j.values())b.j++,C(b,'Check if need to call additional configuration callback '+h.j),Oa(h,f)?(C(b,'Calling additional configuration callback '+h.j),d=Na(a,h.pj()),d.push(f),h.D.apply(null,d)):C(b,'Will not call additional configuration callback '+h.j+'predicate has returned false'),La(b);La(b)}C(b,'Done instantiating '+this.id);return f}pj(){return this.D}pn(){return this.F}config(a,b,c,d,e){null===this.j&&
255
+ (this.j=new Map);var f=this.j,g=f.set;b=new olympe.W.zl(c,e,b);b.F=d;g.call(f,a,b)}};olympe.W.Jl.j=0;olympe.W.th=class extends olympe.W.Ij{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return new rxjs.Observable(b=>{b.next(a.getParameter(this.id));Sa(a,this.id,c=>b.next(c))})}};function La(a){0<a.j&&a.j--}function C(a,b){1>=a.D&&Za(a,'log','DI: '+b)}function Za(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.j;e++)d+=' ';console[b](d+c)}}olympe.W.Up=class{constructor(a){this.D=a;this.j=0}debug(a){2>=this.D&&Za(this,'log','DI: '+a)}info(a){3>=this.D&&Za(this,'info','DI: '+a)}warn(a){4>=this.D&&Za(this,'warn','DI: '+a)}error(a){5>=this.D&&Za(this,'error','DI: '+a)}};olympe.W.pa=class extends olympe.W.Ij{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.W.ub=class extends olympe.W.Ij{constructor(a,b){super();this.id=a;this.j=b||olympe.W.qh.j.Jt}T(){return this.id}getValue(a){return Ra(a,this.id,this.j)}};olympe.W.P={xg:'di.Container',aC:'di.PublicContainer'};olympe.W.U={Pu:'logging.di'};olympe.W.run([olympe.W.P.xg],a=>{olympe.W.getParameter=b=>a.getParameter(b);olympe.W.Ej=(b,c)=>a.Ej(b,c);olympe.$d().getConfig=b=>a.getParameter(b);olympe.$d().getConfigNames=()=>Object.keys(a.parameters);olympe.$d().updateConfig=(b,c)=>a.Ej(b,c)});olympe.V={};olympe.V.Ip=class{constructor(a){this.id=a||olympe.V.Ip.j++}Ea(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}print(){return('000000'+this.id).substr(-6)}};olympe.V.Ip.j=0;olympe.V.FB=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.Ch=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.Ch.D=function(a){return new olympe.V.Ch(.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.Ch.j=function(){return new olympe.V.Ch(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.V.Ch.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.V.Ch.prototype.get=function(a,b){return this.values[5*a+b]};function $a(a){return(new TextEncoder).encode(a)}function bb(a,b){return a.j($a(b))}function cb(a){return(new TextDecoder('utf8')).decode(a)}function db(a){const b=new olympe.V.stream.Cf;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}
256
+ olympe.V.sl=class{D(){}j(){}H(a){return w(function*(){if(a instanceof ArrayBuffer)return new Uint8Array(a);if(a instanceof Uint8Array)return a;if('string'===typeof a)return $a(a);if(a instanceof Blob)return new Uint8Array(yield a.arrayBuffer());if(a instanceof olympe.V.stream.Cf){const b=[];for(const c=fa(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(){}};
257
+ olympe.V.Qr=a=>a.replace('+','-').replace('/','_');olympe.V.Ow=a=>a.replace('-','+').replace('_','/');function eb(a){a.j=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.D&&a.D(d));if(0<a.values.size)eb(a);else{let d;null==(d=a.F)||d.call(a)}},a.H)}function fb(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function gb(a,b){a.D=b;return a}
258
+ olympe.V.Gm=class{constructor(a,b=a/2){this.timeout=a;this.H=b;this.values=new Map;this.F=this.D=this.j=null}add(a){this.values.set(a,Date.now());null===this.j&&eb(this)}has(a){return this.values.has(a)}forEach(a){this.values.forEach((b,c)=>a(c))}delete(a){a=this.values.delete(a);if(0===this.values.size){this.j&&clearTimeout(this.j);this.j=null;let b;null==(b=this.F)||b.call(this)}return a}clear(){this.j&&clearTimeout(this.j);this.j=null;this.values.clear();return this}};function hb(a,b){a.D=b;return a}function ib(a,b){a.j.F=b}
259
+ olympe.V.Nh=class{constructor(a){this.j=gb(new olympe.V.Gm(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 jb(a,b){a.R.push(b)}function kb(a,b){a.Y.push(b)}function lb(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=>lb(a,d)):c='N/A';return c}function mb(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]=lb(a,g);a.F.push(b)}
260
+ 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 nb(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={RE(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.V.Promise={};olympe.V.Promise.kj=function(a,b){let c=null;return(...d)=>new Promise((e,f)=>{clearTimeout(c);c=setTimeout(()=>w(function*(){try{const g=yield a(...d);e(g)}catch(g){f(g)}}),b)})};olympe.V.Promise.In=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)})})};olympe.V.promise={};function ob(a){if(0===a.size())a.D.next(!1);else if(a.F()){a.j++;var b=pb(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);ob(a)})}}function qb(a,b){return new Promise((c,d)=>{a.Fa.push(new olympe.V.promise.bw(c,d,b));ob(a)})}function pb(a){a.D.next(!0);let b;return null!=(b=a.Fa.shift())?b:null}
261
+ olympe.V.promise.Bm=class{constructor(){this.Fa=[];this.D=new rxjs.BehaviorSubject(!1);this.j=0}F(){return 0===this.j}clear(){for(;0<this.Fa.length;)this.Fa.shift().j(Error('Canceled by a clearStack'));ob(this)}size(){return this.Fa.length}};olympe.V.promise.bw=class{constructor(a,b,c){this.resolve=a;this.j=b;this.D=c}};olympe.V.promise.rr=class extends olympe.V.promise.Bm{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.wj=a}F(){return this.j<this.wj}};olympe.V.promise.uD=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([`
262
262
  function onFullfilledCallback(data) {
263
263
  self.postMessage({ type: "done", data, });
264
264
  self.close();
@@ -269,924 +269,924 @@ olympe.V.promise.wm=class{constructor(){this.Fa=[];this.D=new rxjs.BehaviorSubje
269
269
  }
270
270
  self.onmessage = ({ data: { params } }) => {
271
271
  (${this.F.toString()})(onFullfilledCallback, onRejectedCallback, ...(params ?? []));
272
- };`])),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.yf=class{constructor(){this.buffer=[];this.F=this.j=!1;this.error=this.D=null}[Symbol.asyncIterator](){const a=this;return new na(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 ia(2,new Promise(b=>{a.D=()=>b()}))),!a.error&&0<a.buffer.length&&(yield new ia(0,a.buffer.shift()));if(a.error)throw a.error;}())}write(a){const b=this;return w(function*(){if(null===a||void 0===a)throw Error('Try to stream null or undefined');
273
- 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 w(function*(){try{for(const d=fa(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.yf;this.pipeTo({write:c=>w(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.yf;
274
- this.pipeTo({write:c=>w(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.yf.xa=[olympe.V.stream.ReadableStream,olympe.V.stream.WritableStream];olympe.V.stream.ReadableStream=class{[Symbol.asyncIterator](){return new na(function*(){}())}pipeTo(){}map(){}concat(){}};function rb(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.ow=class{constructor(){this.j=URL.createObjectURL(new Blob([`self.onmessage = ({ data: stream }) => {
275
- const transformedStream = (${olympe.V.stream.ck.toString()}).transform(stream);
272
+ };`])),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.Cf=class{constructor(){this.buffer=[];this.F=this.j=!1;this.error=this.D=null}[Symbol.asyncIterator](){const a=this;return new na(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 ia(2,new Promise(b=>{a.D=()=>b()}))),!a.error&&0<a.buffer.length&&(yield new ia(0,a.buffer.shift()));if(a.error)throw a.error;}())}write(a){const b=this;return w(function*(){if(null===a||void 0===a)throw Error('Try to stream null or undefined');
273
+ 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 w(function*(){try{for(const d=fa(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.Cf;this.pipeTo({write:c=>w(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.Cf;
274
+ this.pipeTo({write:c=>w(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.Cf.xa=[olympe.V.stream.ReadableStream,olympe.V.stream.WritableStream];olympe.V.stream.ReadableStream=class{[Symbol.asyncIterator](){return new na(function*(){}())}pipeTo(){}map(){}concat(){}};function rb(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.yw=class{constructor(){this.j=URL.createObjectURL(new Blob([`self.onmessage = ({ data: stream }) => {
275
+ const transformedStream = (${olympe.V.stream.jk.toString()}).transform(stream);
276
276
  self.postMessage(transformedStream, [transformedStream]);
277
- };`],{type:'application/javascript'}))}destroy(){URL.revokeObjectURL(this.j)}};olympe.V.stream.WritableStream=class{write(){return w(function*(){})}throw(){}complete(){}};olympe.V.stream.Wr=(...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)}});
278
- olympe.V.stream.ck=class a{static transform(b){return b.pipeThrough(new TextDecoderStream).pipeThrough(a.j()).pipeThrough(a.D())}static j(){return new TransformStream({start(){this.buffer=''},transform(b,c){this.buffer+=b;for(var d=0;-1!==(b=this.buffer.indexOf('\n',d));){if(d=this.buffer.slice(d,b).trim())try{c.enqueue(JSON.parse(d))}catch(e){c.error(e);return}d=b+1}this.buffer=this.buffer.slice(d)},flush(b){if(this.buffer.trim())try{b.enqueue(JSON.parse(this.buffer))}catch(c){b.error(c)}}})}static D(){return new TransformStream({start(){this.buffer=
279
- [];this.Nw=50},transform(b,c){this.buffer.push(b);this.buffer.length>=this.Nw&&(c.enqueue(this.buffer),this.buffer=[])},flush(b){0<this.buffer.length&&b.enqueue(this.buffer)}})}};olympe.V.stream.ck.transform=olympe.V.stream.ck.transform;function sb(a,b){return a+b&4294967295}
277
+ };`],{type:'application/javascript'}))}destroy(){URL.revokeObjectURL(this.j)}};olympe.V.stream.WritableStream=class{write(){return w(function*(){})}throw(){}complete(){}};olympe.V.stream.ds=(...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)}});
278
+ olympe.V.stream.jk=class a{static transform(b){return b.pipeThrough(new TextDecoderStream).pipeThrough(a.j()).pipeThrough(a.D())}static j(){return new TransformStream({start(){this.buffer=''},transform(b,c){this.buffer+=b;for(var d=0;-1!==(b=this.buffer.indexOf('\n',d));){if(d=this.buffer.slice(d,b).trim())try{c.enqueue(JSON.parse(d))}catch(e){c.error(e);return}d=b+1}this.buffer=this.buffer.slice(d)},flush(b){if(this.buffer.trim())try{b.enqueue(JSON.parse(this.buffer))}catch(c){b.error(c)}}})}static D(){return new TransformStream({start(){this.buffer=
279
+ [];this.Xw=50},transform(b,c){this.buffer.push(b);this.buffer.length>=this.Xw&&(c.enqueue(this.buffer),this.buffer=[])},flush(b){0<this.buffer.length&&b.enqueue(this.buffer)}})}};olympe.V.stream.jk.transform=olympe.V.stream.jk.transform;function sb(a,b){return a+b&4294967295}
280
280
  function tb(a,b){let c=a[0],d=a[1],e=a[2],f=a[3];c=G(c,d,e,f,b[0],7,-680876936);f=G(f,c,d,e,b[1],12,-389564586);e=G(e,f,c,d,b[2],17,606105819);d=G(d,e,f,c,b[3],22,-1044525330);c=G(c,d,e,f,b[4],7,-176418897);f=G(f,c,d,e,b[5],12,1200080426);e=G(e,f,c,d,b[6],17,-1473231341);d=G(d,e,f,c,b[7],22,-45705983);c=G(c,d,e,f,b[8],7,1770035416);f=G(f,c,d,e,b[9],12,-1958414417);e=G(e,f,c,d,b[10],17,-42063);d=G(d,e,f,c,b[11],22,-1990404162);c=G(c,d,e,f,b[12],7,1804603682);f=G(f,c,d,e,b[13],12,-40341101);e=G(e,f,
281
281
  c,d,b[14],17,-1502002290);d=G(d,e,f,c,b[15],22,1236535329);c=H(c,d,e,f,b[1],5,-165796510);f=H(f,c,d,e,b[6],9,-1069501632);e=H(e,f,c,d,b[11],14,643717713);d=H(d,e,f,c,b[0],20,-373897302);c=H(c,d,e,f,b[5],5,-701558691);f=H(f,c,d,e,b[10],9,38016083);e=H(e,f,c,d,b[15],14,-660478335);d=H(d,e,f,c,b[4],20,-405537848);c=H(c,d,e,f,b[9],5,568446438);f=H(f,c,d,e,b[14],9,-1019803690);e=H(e,f,c,d,b[3],14,-187363961);d=H(d,e,f,c,b[8],20,1163531501);c=H(c,d,e,f,b[13],5,-1444681467);f=H(f,c,d,e,b[2],9,-51403784);
282
282
  e=H(e,f,c,d,b[7],14,1735328473);d=H(d,e,f,c,b[12],20,-1926607734);c=I(d^e^f,c,d,b[5],4,-378558);f=I(c^d^e,f,c,b[8],11,-2022574463);e=I(f^c^d,e,f,b[11],16,1839030562);d=I(e^f^c,d,e,b[14],23,-35309556);c=I(d^e^f,c,d,b[1],4,-1530992060);f=I(c^d^e,f,c,b[4],11,1272893353);e=I(f^c^d,e,f,b[7],16,-155497632);d=I(e^f^c,d,e,b[10],23,-1094730640);c=I(d^e^f,c,d,b[13],4,681279174);f=I(c^d^e,f,c,b[0],11,-358537222);e=I(f^c^d,e,f,b[3],16,-722521979);d=I(e^f^c,d,e,b[6],23,76029189);c=I(d^e^f,c,d,b[9],4,-640364487);
283
283
  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,
284
284
  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]=sb(c,a[0]);a[1]=sb(d,a[1]);a[2]=sb(e,a[2]);a[3]=sb(f,a[3])}function I(a,b,c,d,e,f){b=sb(sb(b,a),sb(d,f));return sb(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)}
285
285
  function ub(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);tb(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(tb(a,g),f=0;16>f;f++)g[f]=0;g[14]=8*e;
286
- tb(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'!==ub('hello')&&(sb=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.V.tb=ub;function vb(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function wb(){var a=Math.random();return vb((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}const xb=Math.pow(2,32)-1;olympe.V.Ic=function(){return wb()};olympe.V.Hf=function(){return wb()};olympe.V.vE=function(a,b=1){const c=a.substr(12,a.length-12);return vb(parseInt(a.substr(0,12),16)+b)+c};
287
- olympe.V.uE=function(a){return vb(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let yb=0,zb=0;olympe.V.lx=function(){var a=(new Date).getTime();a<=yb?4294967295===zb?(zb=Math.floor(Math.random()/4*xb),yb+=1):zb=Math.floor(zb+(4294967295-zb)/2):(zb=Math.floor(Math.random()/4*xb),yb=a);a='00000000'+zb.toString(16);return vb(yb)+a.substr(a.length-8,8)};olympe.V.KE=function(){for(let a=0;1E4>a;a++)console.log(olympe.V.lx())};
288
- olympe.V.Zh=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.V.pE=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.lE=function(a,b){return(b?b:'UI')+'-'+a};
289
- olympe.V.dz=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):
290
- r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,TD:g||null,Ks:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,mE:f||null,parameters:b}};olympe.V.EE=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=').map(decodeURIComponent)))};
291
- olympe.V.HE=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.tE=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};
292
- olympe.V.vs=a=>{var b=Ab,c=Bb;return w(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.Jr(n);return h},{})}}).reduce((d,e,f)=>{olympe.V.xs(d,e,'version.json'===a[f]?'version.':'');
293
- return d},Object.create(null))})};olympe.V.Jr=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.xs=(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.xs(a[e],f,''):a[e]=f}};olympe.V.SD=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}bn(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.V.Ju=class{constructor(a,b){this.start=a;this.end=b}};olympe.V.Ju.j={kB:'left',bC:'right',Pz:'bottom',kD:'top'};function Cb(a){return`${a.j}.${a.D}.${a.F}`}
294
- olympe.V.Df=class{constructor(a,b,c,d){this.j=a;this.D=b;this.F=c;this.J=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.Df.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.Df.j:new olympe.V.Df(b,c,d,a[4])}Ok(a){return this.j!==a.j?this.j>a.j:this.D!==a.D?this.D>a.D:this.F>a.F}vj(a){return this.j!==a.j?this.j<a.j:this.D!==a.D?this.D<a.D:this.F<
295
- a.F}Ea(a){return this.j===a.j&&this.D===a.D&&this.F===a.F}toString(){return`${this.j}.${this.D}.${this.F}`+(null!==this.J?`-${this.J}`:'')}};olympe.V.Df.j=new olympe.V.Df(Number.NaN,Number.NaN,Number.NaN);olympe.V.P={qg:'utils.binaryConverter',Vs:'utils.base64Converter',ag:'utils.Profiler'};olympe.W.config(a=>{Xa(a,olympe.V.P.qg);Wa(a,olympe.V.P.Vs,olympe.V.P.qg,!0);D(a,olympe.V.P.ag,olympe.V.ov)},'Utils services');olympe.W.run([olympe.V.P.qg,olympe.V.P.ag],(a,b)=>{olympe.V.Ze=()=>a;olympe.Zd().isProfilerEnabled=()=>b.j;olympe.Zd().startProfiler=()=>b.start();olympe.Zd().stopProfiler=()=>b.stop();olympe.Zd().getProfilerEvents=()=>({events:b.F,names:Object.fromEntries(b.N.entries()),models:Object.fromEntries(b.J.entries())})});olympe.ja={};olympe.ja.yb=class{la(){}J(){}F(){}j(){}fa(){}N(){}ua(){}$(){}ba(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ja.yb.prototype.fatal=olympe.ja.yb.prototype.fatal;olympe.ja.yb.prototype.error=olympe.ja.yb.prototype.error;olympe.ja.yb.prototype.warn=olympe.ja.yb.prototype.warn;olympe.ja.yb.prototype.info=olympe.ja.yb.prototype.info;olympe.ja.yb.prototype.log=olympe.ja.yb.prototype.log;olympe.ja.yb.prototype.debug=olympe.ja.yb.prototype.debug;olympe.ja.yb.prototype.trace=olympe.ja.yb.prototype.trace;
296
- olympe.ja.yb.j={Yv:0,Uf:1,Fu:2,Uj:3,zr:4,zb:5,Dt:6,zB:7};olympe.ja.yb.D={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ja.Ta=class{cd(){}};olympe.ja.pe={};function Db(a,b,c){a.Ga[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)}}
297
- olympe.ja.pe.yb=class{constructor(a,b){this.name=a;const c=b instanceof rxjs.Observable;this.D=c?olympe.ja.yb.j.Uj:b;c&&b.subscribe(d=>{this.D=d});this.Y=a.toUpperCase();this.R=new Map;this.Ga=console}la(){return this.name}J(){return this.D}F(){return this.D<=olympe.ja.yb.j.Yv}j(){return this.D<=olympe.ja.yb.j.Uf}N(){return this.D<=olympe.ja.yb.j.Fu}fa(){return this.D<=olympe.ja.yb.j.Uj}ua(){return this.D<=olympe.ja.yb.j.zr}$(){return this.D<=olympe.ja.yb.j.zb}ba(){return this.D<=olympe.ja.yb.j.Dt}trace(...a){this.F()&&
298
- Db(this,'trace',a)}debug(...a){this.j()&&Db(this,'debug',a)}log(...a){this.N()&&Db(this,'log',a)}info(...a){this.fa()&&Db(this,'info',a)}warn(...a){this.ua()&&Db(this,'warn',a)}error(...a){this.$()&&Db(this,'error',a)}fatal(...a){this.ba()&&Db(this,'error',a)}};olympe.ja.pe.yb.xa=[olympe.ja.yb];olympe.ja.pe.Ta=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.ja.yb.D[b])}cd(a){var b=this.channels.get(a);if(!b){b=`${olympe.ja.U.et}.${a}`;var c;const d=new rxjs.BehaviorSubject(null!=(c=this.j.getParameter(b))?c:this.D);Sa(this.j,b,e=>{d.next(e)});c=this.F;b=`${b}.${olympe.ja.U.Kv}`;Object.prototype.hasOwnProperty.call(this.j.parameters,b.toLowerCase())&&(c=!0===this.j.getParameter(b));
299
- b=new olympe.ja.pe.yb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ja.pe.Ta.xa=[olympe.ja.Ta];olympe.ja.P={Da:'logging.Manager'};olympe.ja.U={bp:'logging',cp:'logging.showLogLevel',et:'logging',Kv:'showLogLevel'};olympe.W.config(function(a){F(a,olympe.ja.U.bp,olympe.ja.yb.j.Uj);F(a,olympe.ja.U.cp,!0);Va(a,olympe.ja.P.Da,olympe.ja.pe.Ta,olympe.W.P.sg,new olympe.W.pa(olympe.ja.U.bp),new olympe.W.pa(olympe.ja.U.cp))},'olympe.logging');olympe.W.run([olympe.ja.P.Da],a=>{olympe.ja.ab=b=>a.cd(b)},'Logging singleton getter initialization');olympe.C={};olympe.C.U={Tp:'df.nodeCreationThreshold'};const Eb=[];function Fb(){}function Gb(){}olympe.C.H=class a{constructor(b,c,d){this.j=void 0===b?Fb:b;this.D=void 0===c?Eb:c;this.Y=d}static J(){var b=[];return void 0===b||0===b.length?olympe.C.H.$:new a(Gb,b)}J(){return this.j?this.j():void 0}F(){return this.D?this.D:Eb}N(){return null===this.j&&null===this.D}R(){return this.j===Gb}};olympe.C.H.Y=new olympe.C.H;olympe.C.H.j=new olympe.C.H(null,null);olympe.C.H.$=new olympe.C.H(Gb);olympe.C.H.F=new olympe.C.H(()=>olympe.C.aa);
300
- olympe.C.H.D=new olympe.C.H(()=>olympe.C.Sa);olympe.C.H.N=new olympe.C.H(()=>olympe.C.ea);olympe.C.H.R=new olympe.C.H(()=>olympe.C.Zb);olympe.C.qh=class{T(){return''}$c(){return''}destroy(){}hb(){return!1}td(){return!1}run(a,...b){return a(...b)}F(a){return a}getParent(){return null}Gf(){}Ec(){}Kc(){}Fk(){}fa(){}onDestroy(){return''}Qf(){}Y(){return''}Wd(){}};olympe.C.qh.prototype.offDestroy=olympe.C.qh.prototype.Qf;olympe.C.qh.prototype.onDestroy=olympe.C.qh.prototype.onDestroy;let Hb=0;olympe.W.run([new olympe.W.pa(olympe.C.U.Tp)],()=>{});
301
- olympe.C.Xb=class{constructor(a='SimpleContext',b){++Hb;this.fb=new Map;this.$a=new Map;this.Ga=new Map;this.$b=0;this.name=a;this.id=String(Hb);this.J=this.Bb=!1;(this.$=void 0===b?olympe.C.Xa():b)&&this.$.Ec(this);this.debug=!1}T(){return this.id}$c(){return this.name}run(a,...b){if(!this.Bb){var c=olympe.C.Gs(this);a=a(...b);c&&olympe.C.Gs(c);return a}}F(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.Bb&&!this.J){this.J=!0;this.fa();for(const a of this.$a.keys())this.$a.has(a)&&this.$a.get(a)();
302
- this.$a.clear();this.Ga.clear();this.$&&(this.$.Kc(this,!1),this.$=null);this.Bb=!0;this.J=!1;this.fa()}}hb(){return this.Bb}td(){return this.J}Ec(a){if(!this.Bb){var b;olympe.C.ib(a)?b=a.Ba:olympe.C.ln(a)&&(b=a);b&&this.fb.set(b.T(),b)}}Kc(a,b=!0){let c;olympe.C.ib(a)?c=a.Ba:olympe.C.ln(a)&&(c=a);c&&this.fb.has(c.T())&&(b&&c.Fk(this),this.fb.delete(c.T()))}Fk(){this.$=null;this.destroy()}fa(){const a=this.fb;for(const b of a.keys())a.has(b)&&a.get(b).Fk(this);this.fb.clear();for(const b of this.Ga.keys())this.Ga.has(b)&&
303
- this.Ga.get(b)();this.Ga.clear()}onDestroy(a,b){void 0===b&&(++this.$b,b=String(this.$b));this.$a.set(b,a);return b}Qf(a){this.$a.delete(a)}Y(a){if(void 0===b){++this.$b;var b=String(this.$b)}this.Ga.set(b,a);return b}Wd(a){this.Ga.delete(a)}Gf(a){this.$&&this.$.Kc(this,!1);(this.$=a||null)&&this.$.Ec(this)}getParent(){return this.$}};olympe.C.Sq=class extends olympe.C.Xb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Qf(){}};olympe.C.qh.xa=[olympe.C.qh];let Ib=0;
304
- function Jb(a,b){a.ba||(a.ba=new Map);a.ba.set(b.T(),b);switch(b.Hc()){case olympe.C.Node.j.zh:break;case olympe.C.Node.j.Lh:break;case olympe.C.Node.j.Yj:case olympe.C.Node.j.Vf:olympe.C.G.warn('Not bad as such but should not happen!');break;case olympe.C.Node.j.rh:Kb(a,olympe.C.Node.j.rh);break;case olympe.C.Node.j.OBSOLETE:a.rc=!0;a.j!==olympe.C.Node.j.rh&&Kb(a,olympe.C.Node.j.OBSOLETE);break;case olympe.C.Node.j.Sd:olympe.C.G.warn('Adding a destroyed node as upstream => should never happen!');break;
286
+ tb(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'!==ub('hello')&&(sb=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.V.tb=ub;function vb(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function wb(){var a=Math.random();return vb((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}const xb=Math.pow(2,32)-1;olympe.V.Ic=function(){return wb()};olympe.V.Kf=function(){return wb()};olympe.V.DE=function(a,b=1){const c=a.substr(12,a.length-12);return vb(parseInt(a.substr(0,12),16)+b)+c};
287
+ olympe.V.CE=function(a){return vb(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let yb=0,zb=0;olympe.V.wx=function(){var a=(new Date).getTime();a<=yb?4294967295===zb?(zb=Math.floor(Math.random()/4*xb),yb+=1):zb=Math.floor(zb+(4294967295-zb)/2):(zb=Math.floor(Math.random()/4*xb),yb=a);a='00000000'+zb.toString(16);return vb(yb)+a.substr(a.length-8,8)};olympe.V.SE=function(){for(let a=0;1E4>a;a++)console.log(olympe.V.wx())};
288
+ olympe.V.di=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.V.xE=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.tE=function(a,b){return(b?b:'UI')+'-'+a};
289
+ olympe.V.nz=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):
290
+ r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,aE:g||null,Ts:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,uE:f||null,parameters:b}};olympe.V.ME=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=').map(decodeURIComponent)))};
291
+ olympe.V.PE=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.BE=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};
292
+ olympe.V.Cs=a=>{var b=Ab,c=Bb;return w(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.Rr(n);return h},{})}}).reduce((d,e,f)=>{olympe.V.Es(d,e,'version.json'===a[f]?'version.':'');
293
+ return d},Object.create(null))})};olympe.V.Rr=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.Es=(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.Es(a[e],f,''):a[e]=f}};olympe.V.$D=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}hn(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.V.Su=class{constructor(a,b){this.start=a;this.end=b}};olympe.V.Su.j={tB:'left',jC:'right',Zz:'bottom',sD:'top'};function Cb(a){return`${a.j}.${a.D}.${a.F}`}
294
+ olympe.V.Hf=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.Hf.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.Hf.j:new olympe.V.Hf(b,c,d,a[4])}Vk(a){return this.j!==a.j?this.j>a.j:this.D!==a.D?this.D>a.D:this.F>a.F}Cj(a){return this.j!==a.j?this.j<a.j:this.D!==a.D?this.D<a.D:this.F<
295
+ a.F}Ea(a){return this.j===a.j&&this.D===a.D&&this.F===a.F}toString(){return`${this.j}.${this.D}.${this.F}`+(null!==this.H?`-${this.H}`:'')}};olympe.V.Hf.j=new olympe.V.Hf(Number.NaN,Number.NaN,Number.NaN);olympe.V.P={vg:'utils.binaryConverter',et:'utils.base64Converter',eg:'utils.Profiler'};olympe.W.config(a=>{Xa(a,olympe.V.P.vg);Wa(a,olympe.V.P.et,olympe.V.P.vg,!0);D(a,olympe.V.P.eg,olympe.V.yv)},'Utils services');olympe.W.run([olympe.V.P.vg,olympe.V.P.eg],(a,b)=>{olympe.V.df=()=>a;olympe.$d().isProfilerEnabled=()=>b.j;olympe.$d().startProfiler=()=>b.start();olympe.$d().stopProfiler=()=>b.stop();olympe.$d().getProfilerEvents=()=>({events:b.F,names:Object.fromEntries(b.N.entries()),models:Object.fromEntries(b.H.entries())})});olympe.ja={};olympe.ja.yb=class{la(){}H(){}F(){}j(){}ha(){}N(){}wa(){}$(){}da(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ja.yb.prototype.fatal=olympe.ja.yb.prototype.fatal;olympe.ja.yb.prototype.error=olympe.ja.yb.prototype.error;olympe.ja.yb.prototype.warn=olympe.ja.yb.prototype.warn;olympe.ja.yb.prototype.info=olympe.ja.yb.prototype.info;olympe.ja.yb.prototype.log=olympe.ja.yb.prototype.log;olympe.ja.yb.prototype.debug=olympe.ja.yb.prototype.debug;olympe.ja.yb.prototype.trace=olympe.ja.yb.prototype.trace;
296
+ olympe.ja.yb.j={hw:0,Xf:1,Ou:2,ak:3,Gr:4,Ab:5,Mt:6,IB:7};olympe.ja.yb.D={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ja.Ta=class{cd(){}};olympe.ja.re={};function Db(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)}}
297
+ olympe.ja.re.yb=class{constructor(a,b){this.name=a;const c=b instanceof rxjs.Observable;this.D=c?olympe.ja.yb.j.ak: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.ja.yb.j.hw}j(){return this.D<=olympe.ja.yb.j.Xf}N(){return this.D<=olympe.ja.yb.j.Ou}ha(){return this.D<=olympe.ja.yb.j.ak}wa(){return this.D<=olympe.ja.yb.j.Gr}$(){return this.D<=olympe.ja.yb.j.Ab}da(){return this.D<=olympe.ja.yb.j.Mt}trace(...a){this.F()&&
298
+ Db(this,'trace',a)}debug(...a){this.j()&&Db(this,'debug',a)}log(...a){this.N()&&Db(this,'log',a)}info(...a){this.ha()&&Db(this,'info',a)}warn(...a){this.wa()&&Db(this,'warn',a)}error(...a){this.$()&&Db(this,'error',a)}fatal(...a){this.da()&&Db(this,'error',a)}};olympe.ja.re.yb.xa=[olympe.ja.yb];olympe.ja.re.Ta=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.ja.yb.D[b])}cd(a){var b=this.channels.get(a);if(!b){b=`${olympe.ja.U.nt}.${a}`;var c;const d=new rxjs.BehaviorSubject(null!=(c=this.j.getParameter(b))?c:this.D);Sa(this.j,b,e=>{d.next(e)});c=this.F;b=`${b}.${olympe.ja.U.Uv}`;Object.prototype.hasOwnProperty.call(this.j.parameters,b.toLowerCase())&&(c=!0===this.j.getParameter(b));
299
+ b=new olympe.ja.re.yb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ja.re.Ta.xa=[olympe.ja.Ta];olympe.ja.P={Da:'logging.Manager'};olympe.ja.U={ip:'logging',jp:'logging.showLogLevel',nt:'logging',Uv:'showLogLevel'};olympe.W.config(function(a){F(a,olympe.ja.U.ip,olympe.ja.yb.j.ak);F(a,olympe.ja.U.jp,!0);Va(a,olympe.ja.P.Da,olympe.ja.re.Ta,olympe.W.P.xg,new olympe.W.pa(olympe.ja.U.ip),new olympe.W.pa(olympe.ja.U.jp))},'olympe.logging');olympe.W.run([olympe.ja.P.Da],a=>{olympe.ja.$a=b=>a.cd(b)},'Logging singleton getter initialization');olympe.C={};olympe.C.U={$p:'df.nodeCreationThreshold'};const Eb=[];function Fb(){}function Gb(){}olympe.C.J=class a{constructor(b,c,d){this.j=void 0===b?Fb:b;this.D=void 0===c?Eb:c;this.Y=d}static H(){var b=[];return void 0===b||0===b.length?olympe.C.J.$:new a(Gb,b)}H(){return this.j?this.j():void 0}F(){return this.D?this.D:Eb}N(){return null===this.j&&null===this.D}R(){return this.j===Gb}};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(Gb);olympe.C.J.F=new olympe.C.J(()=>olympe.C.aa);
300
+ olympe.C.J.D=new olympe.C.J(()=>olympe.C.Sa);olympe.C.J.N=new olympe.C.J(()=>olympe.C.ea);olympe.C.J.R=new olympe.C.J(()=>olympe.C.Zb);olympe.C.uh=class{T(){return''}fn(){return''}destroy(){}gb(){return!1}gd(){return!1}run(a,...b){return a(...b)}rc(a){return a}getParent(){return null}Ps(){}je(){}detach(){}Mk(){}lg(){}onDestroy(){return''}Tf(){}Td(){return''}Gs(){}};olympe.C.uh.prototype.offDestroy=olympe.C.uh.prototype.Tf;olympe.C.uh.prototype.onDestroy=olympe.C.uh.prototype.onDestroy;let Hb=0;olympe.W.run([new olympe.W.pa(olympe.C.U.$p)],()=>{});
301
+ olympe.C.Xb=class{constructor(a='SimpleContext',b){++Hb;this.ha=new Map;this.da=new Map;this.$=new Map;this.cb=0;this.name=a;this.id=String(Hb);this.F=this.wa=!1;(this.N=void 0===b?olympe.C.Xa():b)&&this.N.je(this);this.debug=!1}T(){return this.id}fn(){return this.name}run(a,...b){if(!this.wa){var c=olympe.C.Os(this);a=a(...b);c&&olympe.C.Os(c);return a}}rc(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.wa&&!this.F){this.F=!0;this.lg();for(const a of this.da.keys())this.da.has(a)&&this.da.get(a)();
302
+ this.da.clear();this.$.clear();this.N&&(this.N.detach(this,!1),this.N=null);this.wa=!0;this.F=!1;this.lg()}}gb(){return this.wa}gd(){return this.F}je(a){if(!this.wa){var b;olympe.C.hb(a)?b=a.Ba:olympe.C.sn(a)&&(b=a);b&&this.ha.set(b.T(),b)}}detach(a,b=!0){let c;olympe.C.hb(a)?c=a.Ba:olympe.C.sn(a)&&(c=a);c&&this.ha.has(c.T())&&(b&&c.Mk(this),this.ha.delete(c.T()))}Mk(){this.N=null;this.destroy()}lg(){const a=this.ha;for(const b of a.keys())a.has(b)&&a.get(b).Mk(this);this.ha.clear();for(const b of this.$.keys())this.$.has(b)&&
303
+ this.$.get(b)();this.$.clear()}onDestroy(a,b){void 0===b&&(++this.cb,b=String(this.cb));this.da.set(b,a);return b}Tf(a){this.da.delete(a)}Td(a){if(void 0===b){++this.cb;var b=String(this.cb)}this.$.set(b,a);return b}Gs(a){this.$.delete(a)}Ps(a){this.N&&this.N.detach(this,!1);(this.N=a||null)&&this.N.je(this)}getParent(){return this.N}};olympe.C.Zq=class extends olympe.C.Xb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Tf(){}};olympe.C.uh.xa=[olympe.C.uh];let Ib=0;
304
+ function Jb(a,b){a.R||(a.R=new Map);a.R.set(b.T(),b);switch(b.Hc()){case olympe.C.Node.j.Dh:break;case olympe.C.Node.j.Ph:break;case olympe.C.Node.j.ek:case olympe.C.Node.j.Zf:olympe.C.G.warn('Not bad as such but should not happen!');break;case olympe.C.Node.j.vh:Kb(a,olympe.C.Node.j.vh);break;case olympe.C.Node.j.OBSOLETE:a.zb=!0;a.j!==olympe.C.Node.j.vh&&Kb(a,olympe.C.Node.j.OBSOLETE);break;case olympe.C.Node.j.Vd:olympe.C.G.warn('Adding a destroyed node as upstream => should never happen!');break;
305
305
  default:olympe.C.G.warn('Unknown state, investigate: ',b.Hc())}Lb(b,a)}
306
- function Mb(a){if(a.Jc){var b=[],c=[];if(a.Rf)if(a.Rf instanceof olympe.C.Node)if(Nb(a.Rf))b=a.Rf.Fb;else return;else b=a.Rf;else b=null;if(null!==a.ua){const e=a.gg;for(let f=0,g=a.ua.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.ua[f];if(Nb(h))c.push(h.Fb);else return}else c.push(a.ua[f])}if(a.Jc instanceof Function)var d=a.Jc;else b&&(b[a.Jc]||olympe.C.G.warn('looks like you forget a cast somewhere around '+a.Jc),d=b[a.Jc]);a.run(()=>{a.fa();if(void 0!==d){const e=d.apply(b,c);e&&e.Dr?
307
- Ob(a,e.Ba):e instanceof olympe.C.Node?Ob(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&Kb(a,olympe.C.Node.j.Lh))}else Pb(a)})}}function M(a){void 0===a.Ub&&(a.Ub=a.valueType===olympe.C.Proxy?Qb(void 0,a.Vd):Qb(a.valueType,a.Vd),a.Ub.Ba=a);return a.Ub}function Rb(a){void 0!==a.N&&(Sb(a.N,a),a.N=void 0)}function Tb(a){if(a.j===olympe.C.Node.j.OBSOLETE&&(a.j=olympe.C.Node.j.Lh,null!==a.R))for(const b of a.R.values())Ub(b)}function Kb(a,b){b!==a.j&&(a.j=b)}
308
- function Vb(a){if(a.j!==olympe.C.Node.j.OBSOLETE&&a.j!==olympe.C.Node.j.Yj&&a.j!==olympe.C.Node.j.zh&&a.j!==olympe.C.Node.j.rh){Kb(a,olympe.C.Node.j.Yj);var b=a.R;if(b)for(const c of b.values())b.has(c.T())&&Vb(c);Kb(a,olympe.C.Node.j.OBSOLETE)}}function Wb(a,b,c){if(a.j!==olympe.C.Node.j.Vf)if(b===a.N)L(a,c,!0);else{if(a.j===olympe.C.Node.j.OBSOLETE||a.j===olympe.C.Node.j.Yj)a.rc=!0;Mb(a)}}
309
- 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.Eb||c||void 0===a.N||Rb(a);if(void 0!==b){if((a.Eb||a.j===olympe.C.Node.j.Lh||a.j===olympe.C.Node.j.OBSOLETE)&&!olympe.C.ib(b)&&void 0!==a.Fb){if(null===b&&null===a.Fb){Tb(a);return}if(null!==b&&null!==a.Fb&&(b.valueOf()===a.Fb.valueOf()||a.Fb.Ea&&a.Fb.Ea(b))){Tb(a);return}}if(!0===a.Eb)olympe.C.G.error("Circular dependency detected: updating a downstream node caused this node's (#"+
310
- a.T()+') value to get updated !');else{a.j===olympe.C.Node.j.Sd&&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.Vf&&olympe.C.G.warn(`trying to set a value on a node being destroyed (#${a.T()} ${a.ad?', '+a.ad:''})`);a.Eb=!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
311
- Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.C.Sa?(c=olympe.C.xb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.C.aa?(c=olympe.C.ra(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.C.ea&&(c=olympe.C.Rb(c),d=!1)));a.Fb=c;Kb(a,olympe.C.Node.j.Lh);if(b=a.R){d=0;for(const f of b.values())0<d&&Vb(f),d++;for(const f of b.values())Wb(f,a,c)}a.Eb=!1}}}
312
- function Xb(a,b){if(a.j!==olympe.C.Node.j.Vf&&a.j!==olympe.C.Node.j.Sd&&(a.j!==olympe.C.Node.j.zh||a.Jc)){var c=void 0!==a.defaultValue;a.Jc&&b!==a.N&&a.fa();if(c)L(a,a.defaultValue,!0);else if(a.Fb=void 0,Kb(a,olympe.C.Node.j.zh),b=a.R)for(const d of b.values())Xb(d,a)}}function Pb(a){if(a.j!==olympe.C.Node.j.rh){Kb(a,olympe.C.Node.j.rh);var b=a.R;if(b)for(const c of b.values())Pb(c);a.fa();void 0!==a.N&&Rb(a);a.Fb=a.defaultValue}}function Nb(a){return a.j===olympe.C.Node.j.Lh}
313
- function Ob(a,b){b===a?olympe.C.G.error('Setting a node as provider of itself. Ignoring'):(a.N&&a.N!==b&&Rb(a),Lb(b,a),Nb(b)?L(a,b.Fb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):Xb(a),a.N=b)}function Yb(a,b){a.Jc&&(a.Jc=void 0);a.ad='Repeater';Ob(a,b)}function Ub(a){a.N?Tb(a):null!==a.ba&&0===Array.from(a.ba.values()).filter(b=>!Nb(b)).length&&(a.rc&&(a.rc=!1,Mb(a)),Tb(a))}
314
- function Lb(a,b){a.R||(a.R=new Map);a.R.set(b.T(),b);a.j===olympe.C.Node.j.Sd&&olympe.C.G.warn('adding a downstream node on a deleted one (#'+a.T()+') !')}function Sb(a,b){a.R&&(b=b.T(),a.R.has(b)&&(a.R.delete(b),Zb(a)))}function Zb(a){if(null===a.getParent()){var b=a.R;b&&0<b.size||a.destroy()}}
315
- olympe.C.Node=class extends olympe.C.Xb{constructor({valueType:a,Jc:b,iz:c=!0,Rf:d,gn:e,debug:f=!1,gg:g=null,ad:h='Node',$i:k}={}){++Ib;super(String(Ib));this.debug=!!f;this.ad=h;h&&'string'===typeof h||(b?this.ad=b.name?b.name:'anon()':this.ad='Node');this.ua=e&&0<e.length?e:null;this.gg=g&&0<g.length?g:null;this.valueType=a;this.Fb=void 0;this.Eb=!1;this.j=olympe.C.Node.j.zh;this.rc=!1;this.R=this.ba=null;this.Jc=b;this.Rf=d||null;this.defaultValue=this.Ub=this.N=void 0;this.$i=k;d&&d instanceof
316
- olympe.C.Node&&Jb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Jb(this,a);c&&Mb(this)}jh(a){this.defaultValue=a;this.j===olympe.C.Node.j.zh&&L(this,a,!0);return this}bj(a){this.valueType=a}Mb(){return this.valueType||Object}asObservable(a=olympe.C.Xa()){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()})}Hc(){return this.j}hb(){return this.j===olympe.C.Node.j.Sd}td(){return this.j===
317
- olympe.C.Node.j.Vf}Vd(...a){if(this.$i instanceof Function)return this.$i(...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.Hc();a!==olympe.C.Node.j.Vf&&a!==olympe.C.Node.j.Sd||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.ib(g)&&b.push(g.Ba);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.Tg&&(e[g]=f.Ba,b.push(g));return M(new olympe.C.Node({valueType:d.J(),
318
- Jc:c,Rf:this,gn:e,debug:!1,gg:b,ad:'Proxy.'+c+'()'}))}Fk(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.Gf(null);Zb(this)}destroy(){var a=this.j;if(a!==olympe.C.Node.j.Vf&&a!==olympe.C.Node.j.Sd){Kb(this,olympe.C.Node.j.Vf);if(a=this.R){for(const c of a.values())if(a.has(c.T())){var b=c;b.ba&&b.ba.delete(this.T());
319
- b.N&&b.N.T()===this.T()?b.N=void 0:b.destroy()}a.clear()}this.R=null;super.destroy();if(this.ba){for(const c of this.ba.values())this.ba.has(c.T())&&Sb(c,this);this.ba.clear()}this.ba=null;this.N&&(Sb(this.N,this),this.N=void 0);this.Fb=void 0;this.ua&&(this.ua.length=0,this.ua=null);this.gg&&(this.gg.length=0,this.gg=null);this.$i=this.Jc=void 0;this.defaultValue=this.Rf=null;this.ad=`** Destroyed ** ${this.ad}`;Kb(this,olympe.C.Node.j.Sd)}}$c(){return this.ad}print(){const a=this.Jc?this.Jc instanceof
320
- Function?this.Jc.name?this.Jc.name:'()':this.Jc:'{ }';return'#'+('000000'+this.T()).substr(-6)+(this.ad?' '+this.ad:'')+'>'+(a?' '+a+'()':'')}};olympe.C.Node.D='rootNode';olympe.C.Node.j={zh:0,Lh:1,rh:3,Yj:4,OBSOLETE:5,Vf:6,Sd:7};function Qb(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($b(c,a.prototype));c.Oh=a;c.Er=b;return c}function $b(a,b){Object.prototype.hasOwnProperty.call(b,olympe.C.Proxy.km)||Object.defineProperty(b,olympe.C.Proxy.km,{enumerable:!1,configurable:!1,writable:!1,value:ac(a,b)});return b[olympe.C.Proxy.km]}
321
- function bc(a,b){if(a.Oh!==b){a.Oh=b;b.prototype||olympe.C.G.error('Cast not possible, provided type is not a valid type!');var c=$b(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Ba&&a.Ba.bj(b)}}
322
- function ac(a,b){let c={};if(b.prototype)olympe.C.G.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create($b(a,b.__proto__));else return olympe.C.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].K;null===e||e&&e.N()?c[d]=function(...f){var g=this.Ba;if(g&&Nb(g)&&(g=g.Fb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.C.H.Y,c[d]=function(...f){f=this.Er.call(this.Ba,
323
- ...f,e,d);const g=e.Y;if(g){const h=this.Ba.Fb;h&&h[g]&&bc(f,h[g])}return e.R()?this:f})}});return c}function cc(a,b){L(a.Ba,b)}function dc(a){Xb(a.Ba)}function ec(a,b){Yb(a.Ba,olympe.C.Of(b)?b:b.Ba)}function fc(a,b){olympe.C.ib(b)||olympe.C.Of(b)?ec(a,b):cc(a,b)}
324
- olympe.C.Proxy=class{constructor(a,b){this.Ba=null;this.Oh=a;this.Er=b}static ib(a){return!(!a||!a.Tg)}Ea(a){return olympe.C.ta([this,a],(b,c)=>b===c,Boolean)}Fd(a){return olympe.C.ta([this,a],(b,c)=>null===b||null===c?b===c?olympe.C.ea.D:olympe.C.ea.j:b.valueOf()===c.valueOf()?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea)}asObservable(a){return this.Ba.asObservable(a)}Dr(){return this.Ba}};olympe.C.Proxy.km='__opp__';olympe.C.Proxy.prototype.Tg=!0;function gc(a,b){a.node.jh(b);return a}olympe.C.Rj=class{constructor(a,b='FlowSource'){this.node=olympe.C.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.C.ib(a)?L(this.node,olympe.C.Pa(a)):L(this.node,a);return this}repeat(a){Yb(this.node,olympe.C.ib(a)?a.Ba:a);return this}clear(){Xb(this.node);return this}rb(){return M(this.node)}getContext(){return this.node}};function hc(a,b,c=1E3,d,e){const f=olympe.C.cc(olympe.C.aa),g=d||olympe.C.aa.Go.Lp;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().hb()||(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.rb()}
325
- 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 Ob(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.ra(b.value)}Bn(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.C.Rb(!this.Bn())}Uc(){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!==
326
- 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.Bn()?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.Sc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().hb()){var g=b.get(f);b.delete(f);
327
- g===c&&e()}});return d.rb()}be(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()+c.valueOf()),olympe.C.aa,'ONumber.plus')}hh(a){return olympe.C.ta([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()))}wj(){return olympe.C.ra(-this.valueOf())}Tk(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()*c.valueOf()),olympe.C.aa,'ONumber.mul')}ej(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()/
328
- c.valueOf()),olympe.C.aa,'ONumber.div')}My(a){return olympe.C.ta([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.ta([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()))}Fd(a){return olympe.C.ta([this,
329
- a],(b,c)=>olympe.C.Rb(b.Ea(c)),olympe.C.ea,'ONumber.oEquals')}Ea(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Vx(){return this.valueOf()}kn(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea,'ONumber.isBiggerThan')}mz(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.C.ra(c),olympe.C.aa,'ONumber.returnsBiggest')}Cs(a){return olympe.C.ta([this,
330
- a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.C.ra(c),olympe.C.aa,'ONumber.returnsSmallest')}Dy(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea,'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.ib(a)?olympe.C.re([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()))}qj(a,
331
- b){return olympe.C.ib(a)||olympe.C.ib(b)?olympe.C.re([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 rw(a,b,c,d){'number'===typeof a&&(a=olympe.C.ae(a));'number'===typeof b&&(b=olympe.C.ae(b));'number'===typeof c&&(c=olympe.C.ae(c));let e=0;const f=olympe.C.ae(0);let g,h;void 0!==b&&void 0!==c&&olympe.C.oj(b.kn(c),()=>{olympe.ja.ab('df').warn('You have a min bigger than max, cap your inputs')});
332
- const k=(l,n)=>{n=olympe.C.ae(n);const p=olympe.C.aa.animate(n,500);ec(f,p);cc(n,olympe.C.ra(l));e=l};olympe.C.re([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):ec(f,olympe.C.ae(e))},olympe.C.aa);void 0!==b&&olympe.C.nn(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.C.ae(e),p=olympe.C.aa.animate(n,400,d);l=olympe.C.ra(g);L(n.Ba,l);e=g;ec(f,p)}});void 0!==c&&olympe.C.nn(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.C.ae(e),p=olympe.C.aa.animate(n,400,d);l=olympe.C.ra(h);L(n.Ba,l);e=h;ec(f,
333
- p)}});return f}static offset(a){let b;return olympe.C.re([a],c=>{void 0===b&&(b=c);return olympe.C.ra(c-b)},olympe.C.aa,'offset')}static Rr(a){let b,c,d;return olympe.C.ta([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 vy(a){let b=olympe.C.ra(0),c,d,e;return olympe.C.ta([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.C.ra(0);
334
- e=window.performance.now();b=b.be((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.C.aa,'integrate')}static Xw(a){let b;return olympe.C.ta([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 Mw(a,b,c){return olympe.C.re([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;
335
- return e=olympe.C.ta([a],f=>{const g=olympe.C.Pa(b,1E3),h=olympe.C.Pa(e);return void 0===h?olympe.C.ra(f):hc(h,f,g,c,k=>{d&&d(k)})},olympe.C.aa)}static Cw(a,b,c){let d,e,f,g,h,k,l=olympe.C.ae(),n;olympe.C.Sc([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);cc(l,olympe.C.ra(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Uc(a){return olympe.C.ib(a)?
336
- olympe.C.ta([a],b=>olympe.C.xb(b.valueOf().toString()),olympe.C.Sa):olympe.C.xb(a)}static wj(a){return olympe.C.ib(a)?olympe.C.ta([a],b=>olympe.C.ra(-b.valueOf()),olympe.C.aa):olympe.C.ra(-a.valueOf())}static be(a,b){return olympe.C.ib(a)||olympe.C.ib(b)?olympe.C.ta([a,b],(c,d)=>olympe.C.ra(c.valueOf()+d.valueOf()),olympe.C.aa,'plus'):olympe.C.ra(a.valueOf()+b.valueOf())}static hh(a,b){return olympe.C.ib(a)||olympe.C.ib(b)?olympe.C.re([a,b],(c,d)=>olympe.C.ra(c.valueOf()-d.valueOf()),olympe.C.aa,
337
- 'minus'):olympe.C.ra(a.valueOf()-b.valueOf())}static ej(a,b){return olympe.C.ib(a)||olympe.C.ib(b)?olympe.C.re([a,b],(c,d)=>olympe.C.ra(c.valueOf()/d.valueOf()),olympe.C.aa,'div'):olympe.C.ra(a.valueOf()/b.valueOf())}static gz(a,b){if(void 0===b)return a;olympe.C.Sc([b],c=>{c=olympe.C.ra(a.Ba.Fb.valueOf()+c.valueOf());L(a.Ba,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.aw=new olympe.C.aa(2);olympe.C.aa.PI=new olympe.C.aa(Math.PI);
338
- olympe.C.aa.Ut=new olympe.C.aa(Infinity);olympe.C.aa.Qu=new olympe.C.aa(-Infinity);olympe.C.aa.Sp=new olympe.C.aa(NaN);olympe.C.aa.UB=olympe.C.aa.gz;olympe.C.aa.Gz=olympe.C.aa.rw;olympe.C.aa.IB=olympe.C.aa.offset;olympe.C.aa.mA=olympe.C.aa.Rr;olympe.C.aa.eE=olympe.C.aa.Rr;olympe.C.aa.jB=olympe.C.aa.vy;olympe.C.aa.nA=olympe.C.aa.Xw;olympe.C.aa.Vz=olympe.C.aa.Mw;olympe.C.aa.Hz=olympe.C.aa.animate;olympe.C.aa.Iz=olympe.C.aa.Cw;olympe.C.aa.nD=olympe.C.aa.Uc;olympe.C.aa.oD=olympe.C.aa.wj;
339
- olympe.C.aa.TB=olympe.C.aa.be;olympe.C.aa.xB=olympe.C.aa.hh;olympe.C.aa.oA=olympe.C.aa.ej;
340
- olympe.C.aa.Go={Lp:function(a,b,c,d){return c*a/d+b},IA:function(a,b,c,d){a/=d;return c*a*a+b},SA:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},EA: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},xA:function(a,b,c,d){a/=d;return c*a*a*a+b},OA:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},CA: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},JA:function(a,b,c,d){a/=d;return c*a*a*a*a+b},TA:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
341
- FA: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},KA:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},UA:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},GA: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},LA:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},VA:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},HA:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},AA:function(a,b,c,d){return c*Math.pow(2,
342
- 10*(a/d-1))+b},RA:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},DA: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},wA:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},NA:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},BA: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},rA:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},sA:function(a,b,c,d){d=(a/=d)*a;return b+
343
- c*(2*d*d+2*d*a+-3*d)},tA:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},uA:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},QA: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)},PA: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)},zA:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},yA:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},MA:function(a,
344
- 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},vA: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.H.j;m.Bn.K=olympe.C.H.j;m.isNaN.K=olympe.C.H.N;m.Uc.K=olympe.C.H.D;
345
- m.toString.K=new olympe.C.H(()=>String,[]);m.toFixed.K=new olympe.C.H(()=>String,[]);m.be.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.hh.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.round.K=olympe.C.H.F;m.wj.K=olympe.C.H.F;m.Tk.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.ej.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.My.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.floor.K=olympe.C.H.F;m.ceil.K=olympe.C.H.F;m.trunc.K=olympe.C.H.F;m.log.K=olympe.C.H.F;m.pow.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.exp.K=olympe.C.H.F;
346
- m.Fd.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.Ea.K=olympe.C.H.j;m.valueOf.K=olympe.C.H.j;m.Vx.K=olympe.C.H.j;m.kn.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.mz.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.Cs.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.Dy.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.sin.K=olympe.C.H.F;m.cos.K=olympe.C.H.F;m.atan2.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.abs.K=olympe.C.H.F;m.qj.K=new olympe.C.H(()=>olympe.C.aa,[0,1]);olympe.C.Sa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Ob(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.xb(b.value)}Nr(a){return olympe.C.Sa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.C.ta([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.C.xb(d)},olympe.C.Sa,'OString.concat')}Uc(){return this}Az(a){return olympe.C.ra(parseInt(this.value,
347
- a))}Is(){return olympe.C.ra(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Ea(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Fd(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.Rb(c&&b.valueOf()===c.valueOf()),olympe.C.ea,'OString.oEquals')}cf(){return olympe.C.Rb(!this.value||0===this.value.length)}contains(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.Rb((c instanceof olympe.C.Sa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
348
- olympe.C.ea,'OString.contains')}startsWith(a,b){return olympe.C.ta([this,a,b||0],(c,d,e)=>olympe.C.Rb(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.C.ea,'OString.startsWith')}endsWith(a,b){return olympe.C.ta([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.bn().valueOf()+e.valueOf()+1;return olympe.C.Rb(c.valueOf().endsWith(d.valueOf(),e))},olympe.C.ea,'OString.endsWith')}indexOf(a,b){return olympe.C.ta([this,a,b||0],(c,d,e)=>olympe.C.ra(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
349
- olympe.C.aa,'OString.indexOf')}lastIndexOf(a,b){return olympe.C.ta([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.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.C.Sa,'OString.slice')}bn(){return olympe.C.ra(this.value.length)}threshold(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.C.Sa.EMPTY,olympe.C.Sa,'OString.threshold')}toLowerCase(){return olympe.C.xb(this.value.toLowerCase())}toUpperCase(){return olympe.C.xb(this.value.toUpperCase())}trim(){return olympe.C.xb(this.value.trim())}padStart(a,
350
- b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.padStart')}padEnd(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.padEnd')}replace(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.replace')}wz(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().substr(d.valueOf(),
351
- e.valueOf())),olympe.C.Sa,'OString.subOStr')}static concat(...a){return olympe.C.xb('').concat(...a)}};olympe.C.Sa.EMPTY=new olympe.C.Sa('');olympe.C.Sa.Nv=new olympe.C.Sa(' ');m=olympe.C.Sa.prototype;m.toJSON.K=olympe.C.H.j;m.Nr.K=new olympe.C.H(()=>olympe.C.Sa,[0,1]);m.concat.K=olympe.C.H.D;m.Uc.K=olympe.C.H.D;m.Az.K=olympe.C.H.F;m.Is.K=olympe.C.H.F;m.toString.K=olympe.C.H.j;m.valueOf.K=olympe.C.H.j;m.Ea.K=olympe.C.H.j;m.Fd.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.cf.K=olympe.C.H.N;
352
- m.contains.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.startsWith.K=new olympe.C.H(()=>olympe.C.ea,[0,1]);m.endsWith.K=new olympe.C.H(()=>olympe.C.ea,[0,1]);m.indexOf.K=new olympe.C.H(()=>olympe.C.aa,[0,1]);m.lastIndexOf.K=new olympe.C.H(()=>olympe.C.aa,[0,1]);m.slice.K=new olympe.C.H(()=>olympe.C.Sa,[0,1]);m.bn.K=olympe.C.H.F;m.threshold.K=new olympe.C.H(()=>olympe.C.Sa,[0]);m.toLowerCase.K=olympe.C.H.D;m.toUpperCase.K=olympe.C.H.D;m.trim.K=olympe.C.H.D;m.padStart.K=olympe.C.H.D;m.padEnd.K=olympe.C.H.D;
353
- m.replace.K=olympe.C.H.D;m.wz.K=olympe.C.H.D;olympe.C.ea=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static Ob(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.C.ea.D:olympe.C.ea.j}and(a){if(void 0!==a)return olympe.C.ib(a)?olympe.C.re([a],b=>new olympe.C.ea(this.valueOf()&&b.valueOf()),olympe.C.ea,'and'):this.value&&a.valueOf()?olympe.C.ea.D:olympe.C.ea.j}Ea(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Fd(a){if(void 0!==a)return olympe.C.ib(a)?
354
- olympe.C.re([a],b=>new olympe.C.ea(this.valueOf()===b.valueOf()),olympe.C.ea,'oEquals'):this.Ea(a)?olympe.C.ea.D:olympe.C.ea.j}ud(){return this.value?olympe.C.ea.j:olympe.C.ea.D}Bw(a){if(void 0!==a)return olympe.C.ib(a)?olympe.C.re([a],b=>new olympe.C.ea(!(this.valueOf()&&b.valueOf())),olympe.C.ea,'andNot'):this.value&&!a.valueOf()?olympe.C.ea.D:olympe.C.ea.j}or(a){if(void 0!==a)return olympe.C.ib(a)?olympe.C.re([a],b=>new olympe.C.ea(this.valueOf()||b.valueOf()),olympe.C.ea,'or'):this.value||a.valueOf()?
355
- olympe.C.ea.D:olympe.C.ea.j}xor(a){return olympe.C.ta([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.C.Rb(b&&!c||!b&&c)},olympe.C.ea,'OBoolean.xor')}nx(){return this.value}js(){return!0===this.value?olympe.C.aa.ONE:olympe.C.aa.ZERO}Uc(){return olympe.C.xb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.C.ea.D=new olympe.C.ea(!0);olympe.C.ea.j=new olympe.C.ea(!1);m=olympe.C.ea.prototype;m.toJSON.K=olympe.C.H.j;
356
- m.and.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.Ea.K=olympe.C.H.j;m.Fd.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.ud.K=olympe.C.H.N;m.Bw.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.or.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.xor.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.nx.K=new olympe.C.H(()=>Boolean,[]);m.js.K=olympe.C.H.F;m.Uc.K=olympe.C.H.D;m.toString.K=olympe.C.H.j;m.valueOf.K=olympe.C.H.j;function ic(a){return new olympe.C.eb(new Date(a))}
357
- olympe.C.eb=class{constructor(a){this.qb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.qb.toJSON()+'" }'}static Ob(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)}Dp(){return this.qb&&!isNaN(this.qb.getTime())?olympe.C.ea.D:olympe.C.ea.j}bu(){return olympe.C.ra(this.qb.getMilliseconds())}du(){return olympe.C.ra(this.qb.getSeconds())}cu(){return olympe.C.ra(this.qb.getMinutes())}au(){return olympe.C.ra(this.qb.getHours())}Bx(){return olympe.C.ra(this.qb.getDate())}getMonth(){return olympe.C.ra(this.qb.getMonth()+1)}eu(){return olympe.C.ra(this.qb.getFullYear())}getTime(){return this.qb.getTime()}sz(){var a=
306
+ function Mb(a){if(a.Jc){var b=[],c=[];if(a.Uf)if(a.Uf instanceof olympe.C.Node)if(Nb(a.Uf))b=a.Uf.Fb;else return;else b=a.Uf;else b=null;if(null!==a.Y){const e=a.kg;for(let f=0,g=a.Y.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.Y[f];if(Nb(h))c.push(h.Fb);else return}else c.push(a.Y[f])}if(a.Jc instanceof Function)var d=a.Jc;else b&&(b[a.Jc]||olympe.C.G.warn('looks like you forget a cast somewhere around '+a.Jc),d=b[a.Jc]);a.run(()=>{a.lg();if(void 0!==d){const e=d.apply(b,c);e&&e.Kr?Ob(a,
307
+ e.Ba):e instanceof olympe.C.Node?Ob(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&Kb(a,olympe.C.Node.j.Ph))}else Pb(a)})}}function M(a){void 0===a.jb&&(a.jb=a.valueType===olympe.C.Proxy?Qb(void 0,a.Mb):Qb(a.valueType,a.Mb),a.jb.Ba=a);return a.jb}function Rb(a){void 0!==a.D&&(Sb(a.D,a),a.D=void 0)}function Tb(a){if(a.j===olympe.C.Node.j.OBSOLETE&&(a.j=olympe.C.Node.j.Ph,null!==a.H))for(const b of a.H.values())Ub(b)}function Kb(a,b){b!==a.j&&(a.j=b)}
308
+ function Vb(a){if(a.j!==olympe.C.Node.j.OBSOLETE&&a.j!==olympe.C.Node.j.ek&&a.j!==olympe.C.Node.j.Dh&&a.j!==olympe.C.Node.j.vh){Kb(a,olympe.C.Node.j.ek);var b=a.H;if(b)for(const c of b.values())b.has(c.T())&&Vb(c);Kb(a,olympe.C.Node.j.OBSOLETE)}}function Wb(a,b,c){if(a.j!==olympe.C.Node.j.Zf)if(b===a.D)L(a,c,!0);else{if(a.j===olympe.C.Node.j.OBSOLETE||a.j===olympe.C.Node.j.ek)a.zb=!0;Mb(a)}}
309
+ 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.Ha||c||void 0===a.D||Rb(a);if(void 0!==b){if((a.Ha||a.j===olympe.C.Node.j.Ph||a.j===olympe.C.Node.j.OBSOLETE)&&!olympe.C.hb(b)&&void 0!==a.Fb){if(null===b&&null===a.Fb){Tb(a);return}if(null!==b&&null!==a.Fb&&(b.valueOf()===a.Fb.valueOf()||a.Fb.Ea&&a.Fb.Ea(b))){Tb(a);return}}if(!0===a.Ha)olympe.C.G.error("Circular dependency detected: updating a downstream node caused this node's (#"+
310
+ a.T()+') value to get updated !');else{a.j===olympe.C.Node.j.Vd&&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.Zf&&olympe.C.G.warn(`trying to set a value on a node being destroyed (#${a.T()} ${a.ad?', '+a.ad:''})`);a.Ha=!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
311
+ Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.C.Sa?(c=olympe.C.xb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.C.aa?(c=olympe.C.ra(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.C.ea&&(c=olympe.C.Sb(c),d=!1)));a.Fb=c;Kb(a,olympe.C.Node.j.Ph);if(b=a.H){d=0;for(const f of b.values())0<d&&Vb(f),d++;for(const f of b.values())Wb(f,a,c)}a.Ha=!1}}}
312
+ function Xb(a,b){if(a.j!==olympe.C.Node.j.Zf&&a.j!==olympe.C.Node.j.Vd&&(a.j!==olympe.C.Node.j.Dh||a.Jc)){var c=void 0!==a.defaultValue;a.Jc&&b!==a.D&&a.lg();if(c)L(a,a.defaultValue,!0);else if(a.Fb=void 0,Kb(a,olympe.C.Node.j.Dh),b=a.H)for(const d of b.values())Xb(d,a)}}function Pb(a){if(a.j!==olympe.C.Node.j.vh){Kb(a,olympe.C.Node.j.vh);var b=a.H;if(b)for(const c of b.values())Pb(c);a.lg();void 0!==a.D&&Rb(a);a.Fb=a.defaultValue}}function Nb(a){return a.j===olympe.C.Node.j.Ph}
313
+ function Ob(a,b){b===a?olympe.C.G.error('Setting a node as provider of itself. Ignoring'):(a.D&&a.D!==b&&Rb(a),Lb(b,a),Nb(b)?L(a,b.Fb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):Xb(a),a.D=b)}function Yb(a,b){a.Jc&&(a.Jc=void 0);a.ad='Repeater';Ob(a,b)}function Ub(a){a.D?Tb(a):null!==a.R&&0===Array.from(a.R.values()).filter(b=>!Nb(b)).length&&(a.zb&&(a.zb=!1,Mb(a)),Tb(a))}
314
+ function Lb(a,b){a.H||(a.H=new Map);a.H.set(b.T(),b);a.j===olympe.C.Node.j.Vd&&olympe.C.G.warn('adding a downstream node on a deleted one (#'+a.T()+') !')}function Sb(a,b){a.H&&(b=b.T(),a.H.has(b)&&(a.H.delete(b),Zb(a)))}function Zb(a){if(null===a.getParent()){var b=a.H;b&&0<b.size||a.destroy()}}
315
+ olympe.C.Node=class extends olympe.C.Xb{constructor({valueType:a,Jc:b,sz:c=!0,Uf:d,nn:e,debug:f=!1,kg:g=null,ad:h='Node',gj:k}={}){++Ib;super(String(Ib));this.debug=!!f;this.ad=h;h&&'string'===typeof h||(b?this.ad=b.name?b.name:'anon()':this.ad='Node');this.Y=e&&0<e.length?e:null;this.kg=g&&0<g.length?g:null;this.valueType=a;this.Fb=void 0;this.Ha=!1;this.j=olympe.C.Node.j.Dh;this.zb=!1;this.H=this.R=null;this.Jc=b;this.Uf=d||null;this.defaultValue=this.jb=this.D=void 0;this.gj=k;d&&d instanceof olympe.C.Node&&
316
+ Jb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Jb(this,a);c&&Mb(this)}nh(a){this.defaultValue=a;this.j===olympe.C.Node.j.Dh&&L(this,a,!0);return this}ij(a){this.valueType=a}Nb(){return this.valueType||Object}asObservable(a=olympe.C.Xa()){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()})}Hc(){return this.j}gb(){return this.j===olympe.C.Node.j.Vd}gd(){return this.j===
317
+ olympe.C.Node.j.Zf}Mb(...a){if(this.gj instanceof Function)return this.gj(...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.Hc();a!==olympe.C.Node.j.Zf&&a!==olympe.C.Node.j.Vd||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.Ba);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.Xg&&(e[g]=f.Ba,b.push(g));return M(new olympe.C.Node({valueType:d.H(),
318
+ Jc:c,Uf:this,nn:e,debug:!1,kg:b,ad:'Proxy.'+c+'()'}))}Mk(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.Ps(null);Zb(this)}destroy(){var a=this.j;if(a!==olympe.C.Node.j.Zf&&a!==olympe.C.Node.j.Vd){Kb(this,olympe.C.Node.j.Zf);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());
319
+ 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())&&Sb(c,this);this.R.clear()}this.R=null;this.D&&(Sb(this.D,this),this.D=void 0);this.Fb=void 0;this.Y&&(this.Y.length=0,this.Y=null);this.kg&&(this.kg.length=0,this.kg=null);this.gj=this.Jc=void 0;this.defaultValue=this.Uf=null;this.ad=`** Destroyed ** ${this.ad}`;Kb(this,olympe.C.Node.j.Vd)}}fn(){return this.ad}print(){const a=this.Jc?this.Jc instanceof Function?
320
+ this.Jc.name?this.Jc.name:'()':this.Jc:'{ }';return'#'+('000000'+this.T()).substr(-6)+(this.ad?' '+this.ad:'')+'>'+(a?' '+a+'()':'')}};olympe.C.Node.D='rootNode';olympe.C.Node.j={Dh:0,Ph:1,vh:3,ek:4,OBSOLETE:5,Zf:6,Vd:7};function Qb(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($b(c,a.prototype));c.Sh=a;c.Lr=b;return c}function $b(a,b){Object.prototype.hasOwnProperty.call(b,olympe.C.Proxy.sm)||Object.defineProperty(b,olympe.C.Proxy.sm,{enumerable:!1,configurable:!1,writable:!1,value:ac(a,b)});return b[olympe.C.Proxy.sm]}
321
+ function bc(a,b){if(a.Sh!==b){a.Sh=b;b.prototype||olympe.C.G.error('Cast not possible, provided type is not a valid type!');var c=$b(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Ba&&a.Ba.ij(b)}}
322
+ function ac(a,b){let c={};if(b.prototype)olympe.C.G.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create($b(a,b.__proto__));else return olympe.C.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].K;null===e||e&&e.N()?c[d]=function(...f){var g=this.Ba;if(g&&Nb(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.Lr.call(this.Ba,
323
+ ...f,e,d);const g=e.Y;if(g){const h=this.Ba.Fb;h&&h[g]&&bc(f,h[g])}return e.R()?this:f})}});return c}function cc(a,b){L(a.Ba,b)}function dc(a){Xb(a.Ba)}function ec(a,b){Yb(a.Ba,olympe.C.Rf(b)?b:b.Ba)}function fc(a,b){olympe.C.hb(b)||olympe.C.Rf(b)?ec(a,b):cc(a,b)}
324
+ olympe.C.Proxy=class{constructor(a,b){this.Ba=null;this.Sh=a;this.Lr=b}static hb(a){return!(!a||!a.Xg)}Ea(a){return olympe.C.ta([this,a],(b,c)=>b===c,Boolean)}Fd(a){return olympe.C.ta([this,a],(b,c)=>null===b||null===c?b===c?olympe.C.ea.D:olympe.C.ea.j:b.valueOf()===c.valueOf()?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea)}asObservable(a){return this.Ba.asObservable(a)}Kr(){return this.Ba}};olympe.C.Proxy.sm='__opp__';olympe.C.Proxy.prototype.Xg=!0;function gc(a,b){a.node.nh(b);return a}olympe.C.Yj=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.Pa(a)):L(this.node,a);return this}repeat(a){Yb(this.node,olympe.C.hb(a)?a.Ba:a);return this}clear(){Xb(this.node);return this}rb(){return M(this.node)}getContext(){return this.node}};function hc(a,b,c=1E3,d,e){const f=olympe.C.bc(olympe.C.aa),g=d||olympe.C.aa.Mo.Sp;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.rb()}
325
+ 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)}Hn(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.C.Sb(!this.Hn())}Uc(){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!==
326
+ 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.Hn()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.C.bc(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.Sc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().gb()){var g=b.get(f);b.delete(f);
327
+ g===c&&e()}});return d.rb()}ce(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()+c.valueOf()),olympe.C.aa,'ONumber.plus')}lh(a){return olympe.C.ta([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()))}Dj(){return olympe.C.ra(-this.valueOf())}$k(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()*c.valueOf()),olympe.C.aa,'ONumber.mul')}lj(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()/
328
+ c.valueOf()),olympe.C.aa,'ONumber.div')}Wy(a){return olympe.C.ta([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.ta([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()))}Fd(a){return olympe.C.ta([this,
329
+ a],(b,c)=>olympe.C.Sb(b.Ea(c)),olympe.C.ea,'ONumber.oEquals')}Ea(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}hy(){return this.valueOf()}rn(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea,'ONumber.isBiggerThan')}xz(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.C.ra(c),olympe.C.aa,'ONumber.returnsBiggest')}Ks(a){return olympe.C.ta([this,
330
+ a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.C.ra(c),olympe.C.aa,'ONumber.returnsSmallest')}Ny(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea,'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.te([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()))}xj(a,
331
+ b){return olympe.C.hb(a)||olympe.C.hb(b)?olympe.C.te([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 Bw(a,b,c,d){'number'===typeof a&&(a=olympe.C.be(a));'number'===typeof b&&(b=olympe.C.be(b));'number'===typeof c&&(c=olympe.C.be(c));let e=0;const f=olympe.C.be(0);let g,h;void 0!==b&&void 0!==c&&olympe.C.vj(b.rn(c),()=>{olympe.ja.$a('df').warn('You have a min bigger than max, cap your inputs')});
332
+ const k=(l,n)=>{n=olympe.C.be(n);const p=olympe.C.aa.animate(n,500);ec(f,p);cc(n,olympe.C.ra(l));e=l};olympe.C.te([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):ec(f,olympe.C.be(e))},olympe.C.aa);void 0!==b&&olympe.C.un(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.C.be(e),p=olympe.C.aa.animate(n,400,d);l=olympe.C.ra(g);L(n.Ba,l);e=g;ec(f,p)}});void 0!==c&&olympe.C.un(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.C.be(e),p=olympe.C.aa.animate(n,400,d);l=olympe.C.ra(h);L(n.Ba,l);e=h;ec(f,
333
+ p)}});return f}static offset(a){let b;return olympe.C.te([a],c=>{void 0===b&&(b=c);return olympe.C.ra(c-b)},olympe.C.aa,'offset')}static Yr(a){let b,c,d;return olympe.C.ta([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 Fy(a){let b=olympe.C.ra(0),c,d,e;return olympe.C.ta([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.C.ra(0);
334
+ e=window.performance.now();b=b.ce((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.C.aa,'integrate')}static jx(a){let b;return olympe.C.ta([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 Ww(a,b,c){return olympe.C.te([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;
335
+ return e=olympe.C.ta([a],f=>{const g=olympe.C.Pa(b,1E3),h=olympe.C.Pa(e);return void 0===h?olympe.C.ra(f):hc(h,f,g,c,k=>{d&&d(k)})},olympe.C.aa)}static Mw(a,b,c){let d,e,f,g,h,k,l=olympe.C.be(),n;olympe.C.Sc([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);cc(l,olympe.C.ra(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Uc(a){return olympe.C.hb(a)?
336
+ olympe.C.ta([a],b=>olympe.C.xb(b.valueOf().toString()),olympe.C.Sa):olympe.C.xb(a)}static Dj(a){return olympe.C.hb(a)?olympe.C.ta([a],b=>olympe.C.ra(-b.valueOf()),olympe.C.aa):olympe.C.ra(-a.valueOf())}static ce(a,b){return olympe.C.hb(a)||olympe.C.hb(b)?olympe.C.ta([a,b],(c,d)=>olympe.C.ra(c.valueOf()+d.valueOf()),olympe.C.aa,'plus'):olympe.C.ra(a.valueOf()+b.valueOf())}static lh(a,b){return olympe.C.hb(a)||olympe.C.hb(b)?olympe.C.te([a,b],(c,d)=>olympe.C.ra(c.valueOf()-d.valueOf()),olympe.C.aa,
337
+ 'minus'):olympe.C.ra(a.valueOf()-b.valueOf())}static lj(a,b){return olympe.C.hb(a)||olympe.C.hb(b)?olympe.C.te([a,b],(c,d)=>olympe.C.ra(c.valueOf()/d.valueOf()),olympe.C.aa,'div'):olympe.C.ra(a.valueOf()/b.valueOf())}static qz(a,b){if(void 0===b)return a;olympe.C.Sc([b],c=>{c=olympe.C.ra(a.Ba.Fb.valueOf()+c.valueOf());L(a.Ba,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.kw=new olympe.C.aa(2);olympe.C.aa.PI=new olympe.C.aa(Math.PI);
338
+ olympe.C.aa.cu=new olympe.C.aa(Infinity);olympe.C.aa.Zu=new olympe.C.aa(-Infinity);olympe.C.aa.Zp=new olympe.C.aa(NaN);olympe.C.aa.cC=olympe.C.aa.qz;olympe.C.aa.Qz=olympe.C.aa.Bw;olympe.C.aa.RB=olympe.C.aa.offset;olympe.C.aa.wA=olympe.C.aa.Yr;olympe.C.aa.mE=olympe.C.aa.Yr;olympe.C.aa.sB=olympe.C.aa.Fy;olympe.C.aa.xA=olympe.C.aa.jx;olympe.C.aa.eA=olympe.C.aa.Ww;olympe.C.aa.Rz=olympe.C.aa.animate;olympe.C.aa.Sz=olympe.C.aa.Mw;olympe.C.aa.vD=olympe.C.aa.Uc;olympe.C.aa.wD=olympe.C.aa.Dj;
339
+ olympe.C.aa.bC=olympe.C.aa.ce;olympe.C.aa.GB=olympe.C.aa.lh;olympe.C.aa.yA=olympe.C.aa.lj;
340
+ olympe.C.aa.Mo={Sp:function(a,b,c,d){return c*a/d+b},SA:function(a,b,c,d){a/=d;return c*a*a+b},bB:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},OA: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},HA:function(a,b,c,d){a/=d;return c*a*a*a+b},YA:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},MA: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},TA:function(a,b,c,d){a/=d;return c*a*a*a*a+b},cB:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
341
+ PA: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},UA:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},dB:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},QA: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},VA:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},eB:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},RA:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},KA:function(a,b,c,d){return c*Math.pow(2,
342
+ 10*(a/d-1))+b},aB:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},NA: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},GA:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},XA:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},LA: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},BA:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},CA:function(a,b,c,d){d=(a/=d)*a;return b+
343
+ c*(2*d*d+2*d*a+-3*d)},DA:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},EA:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},$A: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)},ZA: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)},JA:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},IA:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},WA:function(a,
344
+ 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},FA: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.Hn.K=olympe.C.J.j;m.isNaN.K=olympe.C.J.N;m.Uc.K=olympe.C.J.D;
345
+ m.toString.K=new olympe.C.J(()=>String,[]);m.toFixed.K=new olympe.C.J(()=>String,[]);m.ce.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.lh.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.round.K=olympe.C.J.F;m.Dj.K=olympe.C.J.F;m.$k.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.lj.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.Wy.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;
346
+ m.Fd.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.Ea.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.hy.K=olympe.C.J.j;m.rn.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.xz.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.Ks.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.Ny.K=new olympe.C.J(()=>olympe.C.ea,[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.xj.K=new olympe.C.J(()=>olympe.C.aa,[0,1]);olympe.C.Sa=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)}Vr(a){return olympe.C.Sa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.C.ta([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.C.xb(d)},olympe.C.Sa,'OString.concat')}Uc(){return this}Kz(a){return olympe.C.ra(parseInt(this.value,
347
+ a))}Rs(){return olympe.C.ra(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Ea(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Fd(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.Sb(c&&b.valueOf()===c.valueOf()),olympe.C.ea,'OString.oEquals')}hf(){return olympe.C.Sb(!this.value||0===this.value.length)}contains(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.Sb((c instanceof olympe.C.Sa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
348
+ olympe.C.ea,'OString.contains')}startsWith(a,b){return olympe.C.ta([this,a,b||0],(c,d,e)=>olympe.C.Sb(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.C.ea,'OString.startsWith')}endsWith(a,b){return olympe.C.ta([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.hn().valueOf()+e.valueOf()+1;return olympe.C.Sb(c.valueOf().endsWith(d.valueOf(),e))},olympe.C.ea,'OString.endsWith')}indexOf(a,b){return olympe.C.ta([this,a,b||0],(c,d,e)=>olympe.C.ra(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
349
+ olympe.C.aa,'OString.indexOf')}lastIndexOf(a,b){return olympe.C.ta([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.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.C.Sa,'OString.slice')}hn(){return olympe.C.ra(this.value.length)}threshold(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.C.Sa.EMPTY,olympe.C.Sa,'OString.threshold')}toLowerCase(){return olympe.C.xb(this.value.toLowerCase())}toUpperCase(){return olympe.C.xb(this.value.toUpperCase())}trim(){return olympe.C.xb(this.value.trim())}padStart(a,
350
+ b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.padStart')}padEnd(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.padEnd')}replace(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.replace')}Gz(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().substr(d.valueOf(),
351
+ e.valueOf())),olympe.C.Sa,'OString.subOStr')}static concat(...a){return olympe.C.xb('').concat(...a)}};olympe.C.Sa.EMPTY=new olympe.C.Sa('');olympe.C.Sa.Xv=new olympe.C.Sa(' ');m=olympe.C.Sa.prototype;m.toJSON.K=olympe.C.J.j;m.Vr.K=new olympe.C.J(()=>olympe.C.Sa,[0,1]);m.concat.K=olympe.C.J.D;m.Uc.K=olympe.C.J.D;m.Kz.K=olympe.C.J.F;m.Rs.K=olympe.C.J.F;m.toString.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;m.Fd.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.hf.K=olympe.C.J.N;
352
+ m.contains.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.startsWith.K=new olympe.C.J(()=>olympe.C.ea,[0,1]);m.endsWith.K=new olympe.C.J(()=>olympe.C.ea,[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.Sa,[0,1]);m.hn.K=olympe.C.J.F;m.threshold.K=new olympe.C.J(()=>olympe.C.Sa,[0]);m.toLowerCase.K=olympe.C.J.D;m.toUpperCase.K=olympe.C.J.D;m.trim.K=olympe.C.J.D;m.padStart.K=olympe.C.J.D;m.padEnd.K=olympe.C.J.D;
353
+ m.replace.K=olympe.C.J.D;m.Gz.K=olympe.C.J.D;olympe.C.ea=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.ea.D:olympe.C.ea.j}and(a){if(void 0!==a)return olympe.C.hb(a)?olympe.C.te([a],b=>new olympe.C.ea(this.valueOf()&&b.valueOf()),olympe.C.ea,'and'):this.value&&a.valueOf()?olympe.C.ea.D:olympe.C.ea.j}Ea(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Fd(a){if(void 0!==a)return olympe.C.hb(a)?
354
+ olympe.C.te([a],b=>new olympe.C.ea(this.valueOf()===b.valueOf()),olympe.C.ea,'oEquals'):this.Ea(a)?olympe.C.ea.D:olympe.C.ea.j}ud(){return this.value?olympe.C.ea.j:olympe.C.ea.D}Lw(a){if(void 0!==a)return olympe.C.hb(a)?olympe.C.te([a],b=>new olympe.C.ea(!(this.valueOf()&&b.valueOf())),olympe.C.ea,'andNot'):this.value&&!a.valueOf()?olympe.C.ea.D:olympe.C.ea.j}or(a){if(void 0!==a)return olympe.C.hb(a)?olympe.C.te([a],b=>new olympe.C.ea(this.valueOf()||b.valueOf()),olympe.C.ea,'or'):this.value||a.valueOf()?
355
+ olympe.C.ea.D:olympe.C.ea.j}xor(a){return olympe.C.ta([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.C.Sb(b&&!c||!b&&c)},olympe.C.ea,'OBoolean.xor')}yx(){return this.value}rs(){return!0===this.value?olympe.C.aa.ONE:olympe.C.aa.ZERO}Uc(){return olympe.C.xb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.C.ea.D=new olympe.C.ea(!0);olympe.C.ea.j=new olympe.C.ea(!1);m=olympe.C.ea.prototype;m.toJSON.K=olympe.C.J.j;
356
+ m.and.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.Ea.K=olympe.C.J.j;m.Fd.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.ud.K=olympe.C.J.N;m.Lw.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.or.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.xor.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.yx.K=new olympe.C.J(()=>Boolean,[]);m.rs.K=olympe.C.J.F;m.Uc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;function ic(a){return new olympe.C.eb(new Date(a))}
357
+ olympe.C.eb=class{constructor(a){this.qb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.qb.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)}Kp(){return this.qb&&!isNaN(this.qb.getTime())?olympe.C.ea.D:olympe.C.ea.j}ku(){return olympe.C.ra(this.qb.getMilliseconds())}mu(){return olympe.C.ra(this.qb.getSeconds())}lu(){return olympe.C.ra(this.qb.getMinutes())}ju(){return olympe.C.ra(this.qb.getHours())}Lx(){return olympe.C.ra(this.qb.getDate())}getMonth(){return olympe.C.ra(this.qb.getMonth()+1)}nu(){return olympe.C.ra(this.qb.getFullYear())}getTime(){return this.qb.getTime()}Dz(){var a=
358
358
  olympe.C,b=a.xb;var c=this.qb.getDate();c=10>c?'0'+c:c;var d=this.qb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.qb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.qb.toLocaleString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.xb(b.qb.toLocaleString(c.valueOf())),olympe.C.Sa)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.qb.toLocaleDateString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.xb(b.qb.toLocaleDateString(c.valueOf())),
359
- olympe.C.Sa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.qb.toLocaleTimeString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.xb(b.qb.toLocaleTimeString(c.valueOf())),olympe.C.Sa)}Uc(){return olympe.C.xb(this.qb.toISOString())}xz(){return new Date(this.getTime())}zz(){return this}Bz(){return this}fg(a,b){return olympe.C.ta([b],c=>{const d=new olympe.C.eb(new Date(this.qb.getTime()));d.qb['set'+a](this.qb['get'+a]()+c.valueOf());return d},olympe.C.eb)}tw(a){return this.fg('Milliseconds',
360
- a)}yw(a){return this.fg('Seconds',a)}uw(a){return this.fg('Minutes',a)}sw(a){return this.fg('Hours',a)}Km(a){return this.fg('Date',a)}zw(a){return'number'===typeof a?this.Km(7*a):this.Km(a.Tk(7))}vw(a){return this.fg('Month',a)}Aw(a){return this.fg('FullYear',a)}uz(){let a=this.qb.getDay();a=0===a?6:a-1;return new olympe.C.eb(new Date(this.qb.getFullYear(),this.qb.getMonth(),this.qb.getDate()-a))}vz(){return new olympe.C.eb(new Date(this.qb.getFullYear(),this.qb.getMonth()))}Fd(a){return olympe.C.ta([a],
361
- b=>olympe.C.Rb(this.Ea(b)),olympe.C.ea)}Ea(a){return a instanceof olympe.C.eb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Nx(){let a=this.qb.getDay();0===a&&(a=7);return olympe.C.ra(a)}Fx(a,b){return olympe.C.ta([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.qb.getFullYear()-c.qb.getFullYear():'months'===d?c=12*(this.qb.getFullYear()-c.qb.getFullYear())+(this.qb.getMonth()-c.qb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
362
- void 0===d&&(olympe.ja.ab('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.qb.getTime()-c.qb.getTime())/d));return olympe.C.ra(c)},olympe.C.aa)}yy(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.getTime()<b.getTime()),olympe.C.ea)}wy(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.getTime()>b.getTime()),olympe.C.ea)}zy(a,b){return olympe.C.ta([a,b],(c,d)=>olympe.C.Rb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.C.ea)}valueOf(){return this.Dp().valueOf()?
363
- new Date(this.getTime()):new Date(0)}};olympe.C.eb.j=ic(0);olympe.C.eb.D=ic(Number.NaN);m=olympe.C.eb.prototype;m.Dp.K=olympe.C.H.N;m.bu.K=olympe.C.H.F;m.du.K=olympe.C.H.F;m.cu.K=olympe.C.H.F;m.au.K=olympe.C.H.F;m.Bx.K=olympe.C.H.F;m.getMonth.K=olympe.C.H.F;m.eu.K=olympe.C.H.F;m.getTime.K=olympe.C.H.j;m.sz.K=new olympe.C.H(()=>olympe.C.Sa,[0]);m.toLocaleString.K=olympe.C.H.D;m.toLocaleDateString.K=olympe.C.H.D;m.toLocaleTimeString.K=olympe.C.H.D;m.Uc.K=olympe.C.H.D;m.xz.K=olympe.C.H.j;
364
- m.zz.K=new olympe.C.H(()=>olympe.C.eb,[]);m.Bz.K=new olympe.C.H(()=>olympe.C.eb,[]);m.fg.K=new olympe.C.H(()=>olympe.C.eb,[]);m.tw.K=new olympe.C.H(()=>olympe.C.eb,[]);m.yw.K=new olympe.C.H(()=>olympe.C.eb,[]);m.uw.K=new olympe.C.H(()=>olympe.C.eb,[]);m.sw.K=new olympe.C.H(()=>olympe.C.eb,[]);m.Km.K=new olympe.C.H(()=>olympe.C.eb,[0]);m.zw.K=new olympe.C.H(()=>olympe.C.eb,[]);m.vw.K=new olympe.C.H(()=>olympe.C.eb,[]);m.Aw.K=new olympe.C.H(()=>olympe.C.eb,[0]);
365
- m.uz.K=new olympe.C.H(()=>olympe.C.eb,[]);m.vz.K=new olympe.C.H(()=>olympe.C.eb,[]);m.Fd.K=olympe.C.H.N;m.Ea.K=olympe.C.H.j;m.Nx.K=olympe.C.H.F;m.Fx.K=new olympe.C.H(()=>olympe.C.aa,[0,1]);m.yy.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.wy.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.zy.K=new olympe.C.H(()=>olympe.C.ea,[0,1]);m.valueOf.K=olympe.C.H.j;const jc=new Map,kc=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,lc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function mc(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=lc.exec(c)):(d=1,c=kc.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.df(a)?olympe.C.re([a],b,olympe.C.Color):b(a)}
366
- 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 Ob(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.Color.create(b.r,
367
- b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.C.ta([a,b,c,d],(e,f,g,h)=>{e=olympe.C.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 jc.values())if(k&&k.j.Ea(e)&&k.D.Ea(f)&&k.b.Ea(g)&&k.a.Ea(h))return k;return new olympe.C.Color(e,f,g,h)},olympe.C.Color)}ah(){return this.j}Vg(){return this.b}Yg(){return this.D}Ug(){return this.a}Fw(a,
368
- b){return olympe.C.Color.create(this.j.qj(a.ah(),b),this.D.qj(a.Yg(),b),this.b.qj(a.Vg(),b),this.a.qj(a.Ug(),b))}gx(a){return olympe.C.Color.create(this.j,this.D,this.b,a)}Js(){return`rgba(${this.j},${this.D},${this.b},${this.a})`}zn(){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.zn()}Ea(a){return a instanceof olympe.C.Color?this.j.valueOf()===a.j.valueOf()&&
369
- this.D.valueOf()===a.D.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}compare(a){const b=(this.ah().valueOf()<<16|this.Yg().valueOf()<<8|this.Vg().valueOf())-(a.ah().valueOf()<<16|a.Yg().valueOf()<<8|a.Vg().valueOf());return 0===b?this.Ug().valueOf()-a.Ug().valueOf():b}};olympe.C.Color.prototype.equals=olympe.C.Color.prototype.Ea;olympe.C.Color.prototype.toHexString=olympe.C.Color.prototype.zn;olympe.C.Color.prototype.toRGBString=olympe.C.Color.prototype.Js;
370
- olympe.C.Color.prototype.getAlpha=olympe.C.Color.prototype.Ug;olympe.C.Color.prototype.getGreen=olympe.C.Color.prototype.Yg;olympe.C.Color.prototype.getBlue=olympe.C.Color.prototype.Vg;olympe.C.Color.prototype.getRed=olympe.C.Color.prototype.ah;olympe.C.Color.create=olympe.C.Color.create;m=olympe.C.Color.prototype;m.toJSON.K=olympe.C.H.j;m.ah.K=olympe.C.H.F;m.Vg.K=olympe.C.H.F;m.Yg.K=olympe.C.H.F;m.Ug.K=olympe.C.H.F;m.Fw.K=new olympe.C.H(()=>olympe.C.Color,[]);
371
- m.gx.K=new olympe.C.H(()=>olympe.C.Color,[]);m.Js.K=new olympe.C.H(()=>String,[]);m.zn.K=new olympe.C.H(()=>String,[]);m.Ea.K=olympe.C.H.j;m.compare.K=olympe.C.H.j;olympe.C.File=class{la(){}Ep(){}Fp(){}hs(){}Hk(){}Zm(){}Ik(){}rename(){}};olympe.C.Zb=class{constructor(a,b){this.x=olympe.C.ae(a);this.y=olympe.C.ae(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.C.Pa(this.x).valueOf())+', "y": '+JSON.stringify(olympe.C.Pa(this.y).valueOf())+' }'}static Ob(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.C.Zb(b.x,b.y)}fu(){return this.x}qz(a){fc(this.x,a)}gu(){return this.y}rz(a){fc(this.y,a)}iy(){return this.x.Cs(this.y)}be(a){return olympe.C.ta([this,a],(b,c)=>new olympe.C.Zb(b.x.be(c.x),b.y.be(c.y)),
372
- olympe.C.Zb,'Vector2.plus')}hh(a){return olympe.C.ta([this,a],(b,c)=>new olympe.C.Zb(b.x.hh(c.x),b.y.hh(c.y)),olympe.C.Zb,'Vector2.minus')}Oy(a){return new olympe.C.Zb(this.x.Tk(a),this.y.Tk(a))}Zw(a){return new olympe.C.Zb(this.x.ej(a),this.y.ej(a))}Qy(){return new olympe.C.Zb(this.x.wj(),this.y.wj())}$w(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ta([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.C.ra(d*f+e*g),olympe.C.aa),olympe.C.aa)}length(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.ra(Math.sqrt(a*
373
- a+b*b)),olympe.C.aa)}normalize(){return olympe.C.ta([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.C.Zb(a/c,b/c)},olympe.C.Zb)}floor(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.floor(a),Math.floor(b)),olympe.C.Zb)}ceil(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.ceil(a),Math.ceil(b)),olympe.C.Zb)}round(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.round(a),Math.round(b)),olympe.C.Zb)}ww(a){return new olympe.C.Zb(this.x.be(a),
374
- this.y.be(a))}xw(a,b){return new olympe.C.Zb(this.x.be(a),this.y.be(b))}Uc(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.xb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.C.Sa)}toString(){return`Vector2[${this.x.Ba.Fb}, ${this.y.Ba.Fb}]`}Ea(a){return this===a?!0:!1}};m=olympe.C.Zb.prototype;m.toJSON.K=olympe.C.H.j;m.fu.K=olympe.C.H.F;m.qz.K=olympe.C.H.j;m.gu.K=olympe.C.H.F;m.rz.K=olympe.C.H.j;m.iy.K=olympe.C.H.F;m.be.K=new olympe.C.H(()=>olympe.C.Zb,[0]);
375
- m.hh.K=new olympe.C.H(()=>olympe.C.Zb,[0]);m.Oy.K=olympe.C.H.R;m.Zw.K=olympe.C.H.R;m.Qy.K=olympe.C.H.R;m.$w.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.length.K=olympe.C.H.F;m.normalize.K=olympe.C.H.R;m.floor.K=olympe.C.H.R;m.ceil.K=olympe.C.H.R;m.round.K=olympe.C.H.R;m.ww.K=olympe.C.H.R;m.xw.K=olympe.C.H.R;m.Uc.K=olympe.C.H.D;m.toString.K=olympe.C.H.j;m.Ea.K=olympe.C.H.j;olympe.C.xg=class{constructor(){}Mb(){}Ld(){}get(){}ai(){}has(){}eh(){}Gc(){}Lf(){}sf(){}jg(){}forEach(){}ie(){}};olympe.C.xg.prototype.forEachCurrentValue=olympe.C.xg.prototype.ie;olympe.C.xg.prototype.forEach=olympe.C.xg.prototype.forEach;m=olympe.C.xg.prototype;m.has.K=olympe.C.H.N;m.eh.K=olympe.C.H.j;m.Gc.K=new olympe.C.H(()=>Object,[]);m.Lf.K=new olympe.C.H(()=>String,[]);m.sf.K=olympe.C.H.F;m.jg.K=olympe.C.H.j;m.forEach.K=new olympe.C.H(()=>{},[]);m.ie.K=olympe.C.H.j;olympe.C.qd=class extends olympe.C.xg{Cd(){}Kf(){}bf(){}Jf(){}je(){}af(){}fj(){}ci(){}};olympe.C.qd.prototype.getCurrentAt=olympe.C.qd.prototype.af;olympe.C.qd.prototype.getAt=olympe.C.qd.prototype.je;olympe.C.qd.prototype.getCurrentKeyAt=olympe.C.qd.prototype.Jf;olympe.C.qd.prototype.getKeyAt=olympe.C.qd.prototype.bf;olympe.C.qd.prototype.getCurrentRank=olympe.C.qd.prototype.Kf;olympe.C.qd.prototype.getRank=olympe.C.qd.prototype.Cd;m=olympe.C.qd.prototype;m.Cd.K=olympe.C.H.F;m.Kf.K=olympe.C.H.j;
376
- m.bf.K=new olympe.C.H(()=>String,[]);m.Jf.K=olympe.C.H.j;m.je.K=new olympe.C.H(()=>Object,[]);m.af.K=olympe.C.H.j;m.fj.K=olympe.C.H.j;m.ci.K=new olympe.C.H(()=>Array,[]);olympe.C.ji=class{constructor(a,b){this.N=b||olympe.C.Xa();this.valueType=a||Object;this.values={};this.fb=this.ua=null;this.Wd=0;this.Y=Object.create(null);this.Bb=Object.create(null);this.size=0;this.J=null;this.N.onDestroy(()=>{const c=this.Y;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.N}Mb(){return this.valueType}Ld(a){this.valueType=a;const b=this.ua;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
377
- c)&&bc(b[c],a)}get(a){const b=c=>{null===this.ua&&(this.ua={});return this.jj(this.ua,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.C.ta([a],c=>b(c),this.valueType)}ai(a){a=this.values[a];return olympe.C.ib(a)?Nb(a.Ba)?a.Ba.Fb:void 0:a}has(a){const b=c=>{null===this.fb&&(this.fb={});return this.jj(this.fb,c,c in this.values?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea,'Map.has('+c+')')};return olympe.C.ta([a],c=>b(c),olympe.C.ea)}eh(a){return a in this.values}jj(a,b,c,d,e){let f=a[b];
378
- f||this.N.run(()=>{f=olympe.C.Qd(d,void 0,e);a[b]=f;f.Ba.onDestroy(()=>delete a[b]);olympe.C.ib(c)?ec(f,c):cc(f,c)});return f}Gc(){throw Error('Abstract method getFirstKey needs to be overridden');}Lf(){throw Error('Abstract method getFirstKey needs to be overridden');}sf(){null===this.J&&this.N.run(()=>{this.J=olympe.C.Qd(olympe.C.aa,olympe.C.ra(this.size));this.J.Ba.onDestroy(()=>{this.J=null})});return this.J}jg(){return this.size}forEach(a,b){const c=this.Gm();a=this.Fr(c,a,b);this.Fm(c,a)}Gm(){return String(++this.Wd)}Fm(a,
379
- b){this.Bb[a]=b;olympe.C.Xa().Y(()=>{const c=this.Y;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Bb[a]});this.ie(b)}Fr(a,b,c){const d=olympe.C.Xa();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.Jm(a,f,g)})}}Jm(a,b,c){void 0===this.Y[b]&&(this.Y[b]={});this.Y[b][a]=c}ie(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
380
- a(b[c],c,this))break}Bk(a,b){void 0!==this.values[a]&&this.Zi(a,!0);this.values[a]=b;var c=this.ua;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.C.Proxy?ec(c[a],b):cc(c[a],b));c=this.fb;null!==c&&void 0!==c[a]&&fc(c[a],!0);this.size++;c=this.Bb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Zi(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.Tg?d.Ba.Fb:d;var e=this.ua;null!==e&&void 0!==e[a]&&dc(e[a]);e=this.fb;null!==e&&void 0!==
381
- e[a]&&fc(e[a],!1);delete c[a];this.size--;b||this.Ef()}a=this.Y[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Ef(){null!==this.J&&fc(this.J,this.size)}Qh(){var a=this.ua;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&dc(a[c]);a=this.fb;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&fc(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.Y)if(Object.prototype.hasOwnProperty.call(this.Y,
382
- c)){b=this.Y[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.J&&fc(this.J,this.size)}Ag(){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.ji.xa=[olympe.C.xg];m=olympe.C.ji.prototype;m.getContext.K=olympe.C.H.j;m.Mb.K=olympe.C.H.j;m.Ld.K=olympe.C.H.j;m.get.K=new olympe.C.H(()=>Object,[],'valueType');m.ai.K=olympe.C.H.j;m.has.K=olympe.C.H.N;m.eh.K=olympe.C.H.j;m.jj.K=olympe.C.H.j;
383
- m.sf.K=olympe.C.H.F;m.jg.K=olympe.C.H.j;m.forEach.K=new olympe.C.H(()=>{},[]);m.Gm.K=olympe.C.H.j;m.Fm.K=olympe.C.H.j;m.Fr.K=olympe.C.H.j;m.Jm.K=olympe.C.H.j;m.ie.K=olympe.C.H.j;m.Bk.K=olympe.C.H.j;m.Zi.K=olympe.C.H.j;m.Ef.K=olympe.C.H.j;m.Qh.K=olympe.C.H.j;m.Ag.K=olympe.C.H.j;olympe.C.Aj=class extends olympe.C.ji{constructor(a,b){super(a,b);this.D=Object.create(null);this.j=[];this.fa=this.Ga=this.$a=this.ba=null}Ld(a){super.Ld(a);if(null!==this.fa)for(let b of this.fa.values())bc(b,a)}Gc(){return this.je(0)}Lf(){return this.bf(0)}Cd(a){const b=c=>{null===this.$a&&(this.$a=Object.create(null));let d=this.Kf(a);d=void 0!==d?olympe.C.ra(d):void 0;return this.jj(this.$a,c,d,olympe.C.aa,`List.getRank(${c})`)};return olympe.C.ib(a)?M(olympe.C.createNode(olympe.C.aa,b,null,
384
- [a.Ba],[0],'onResolved('+(b.name||'')+')')):b(a)}Kf(a){return this.D[a]}bf(a){const b=c=>{const d=c.valueOf(),e=this.Jf(d);null===this.Ga&&(this.Ga=Object.create(null));return this.jj(this.Ga,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.C.ta([a],c=>b(c),String)}Jf(a){return this.j[a.valueOf()]}je(a){if(olympe.C.ib(a))return this.get(olympe.C.ta([a],c=>{c=this.bf(c);if(!Nb(c.Ba)){const d=olympe.C.Xa();olympe.C.Of(d)&&Xb(d)}return c},String));null===this.fa&&(this.fa=new Map);let b=this.fa.get(a);
385
- b||this.N.run(()=>{b=this.get(this.bf(a));this.fa.set(a,b);b.Ba.onDestroy(()=>this.fa.delete(a))});return b}af(a){return this.ai(this.Jf(a))}fj(a,b,c,d){let e=this.Gm();a=this.ws(e,a,b,c,d);this.Fm(e,a)}ws(a,b,c,d,e){return olympe.C.Xa().F((f,g)=>{let h=!1,k=olympe.C.hi([b,c,this.Cd(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.Jm(a,g,k)})}ci(){null===this.ba&&this.N.run(()=>{this.ba=olympe.C.Qd(Array,this.j.filter(a=>void 0!==a));
386
- this.ba.Ba.onDestroy(()=>{this.J=null})});return this.ba}ie(a){if(this.j.length!==this.size)super.ie(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}}Im(a,b){const c=this.$a,d=this.Ga,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]&&dc(c[g]),void 0!==
387
- c[a]&&cc(c[a],olympe.C.ra(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&dc(d[e]),void 0!==d[b]&&cc(d[b],a))}}Hm(a){var b=this.Ga,c=this.D[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ba.Fb===a&&dc(b));delete this.D[a];this.j.splice(c,1);c=this.$a;null!==c&&void 0!==c[a]&&dc(c[a])}Gr(){if(null!==this.ba){const a=this.j,b=this.ba.Ba.Fb;b&&a.join(',')!==b.join(',')&&cc(this.ba,a)}}Ef(){this.Gr();super.Ef()}Qh(){var a=this.D;for(b in a)delete a[b];this.j.length=0;a=this.$a;if(null!==
388
- a)for(b in a)dc(a[b]);a=this.Ga;if(null!==a)for(b in a)dc(a[parseInt(b,10)]);var b=this.ba;null!==b&&(Vb(b.Ba),cc(b,this.j));return olympe.C.ji.prototype.Qh.call(this)}Ag(){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.Aj.xa=[olympe.C.qd];m=olympe.C.Aj.prototype;m.Ld.K=olympe.C.H.j;m.Gc.K=new olympe.C.H(()=>Object,[]);m.Lf.K=new olympe.C.H(()=>String,[]);m.Cd.K=olympe.C.H.F;m.Kf.K=olympe.C.H.j;
389
- m.bf.K=new olympe.C.H(()=>String,[]);m.Jf.K=olympe.C.H.j;m.je.K=new olympe.C.H(()=>Object,[]);m.af.K=olympe.C.H.j;m.fj.K=new olympe.C.H(()=>{},[]);m.ws.K=olympe.C.H.j;m.ci.K=new olympe.C.H(()=>Array,[]);m.ie.K=olympe.C.H.j;m.Im.K=olympe.C.H.j;m.Hm.K=olympe.C.H.j;m.Gr.K=olympe.C.H.j;m.Ef.K=olympe.C.H.j;m.Qh.K=olympe.C.H.j;m.Ag.K=olympe.C.H.j;olympe.C.Map=class extends olympe.C.ji{constructor(a){a===olympe.C.Proxy&&(a=Object);super(a);this.j=this.D=null}Ld(a){a===olympe.C.Proxy&&(a=Object);null!==this.D&&bc(this.D,a);super.Ld(a)}Gc(){null===this.D&&this.Tm();return this.D}Lf(){null===this.j&&this.Tm();return this.j}Tm(){this.getContext().run(()=>{this.D=olympe.C.Qd(this.Mb());this.j=olympe.C.Qd(String);this.uj(this.Wm())})}Wm(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}uj(a){if(void 0!==
390
- a){const b=this.values[a];b&&b instanceof olympe.C.Proxy?ec(this.D,b):cc(this.D,b);cc(this.j,a)}else void 0!==this.D.Ba.Fb&&(dc(this.D),dc(this.j))}set(a,b){this.Bk(a,b);1===this.size&&null!==this.j&&this.uj(a);this.Ef()}remove(a){const b=this.Zi(a);null!==this.j&&this.j.Ba.Fb===a&&this.uj(this.Wm());return b}clear(){this.Qh();null!==this.j&&this.uj()}};m=olympe.C.Map.prototype;m.Ld.K=olympe.C.H.j;m.Gc.K=new olympe.C.H(()=>Object,[]);m.Lf.K=new olympe.C.H(()=>String,[]);m.Tm.K=olympe.C.H.j;
391
- m.Wm.K=olympe.C.H.j;m.uj.K=olympe.C.H.j;m.set.K=olympe.C.H.j;m.remove.K=new olympe.C.H(()=>Object,[]);m.clear.K=olympe.C.H.j;olympe.C.Dg=class extends olympe.C.Aj{constructor(a){super(a)}set(a,b,c){this.Bk(a,b);void 0!==c&&olympe.C.Sc([c],d=>{this.Im(a,d)});this.Ef()}remove(a){this.Hm(a);return this.Zi(a)}clear(){this.Qh()}};olympe.C.Dg.prototype.remove.K=olympe.C.H.j;olympe.C.Dg.prototype.clear.K=olympe.C.H.j;olympe.C.Ss=class extends olympe.C.Rj{constructor(a,b){super(olympe.C.aa,'animatedFlowSource');this.duration=a;this.j=b||olympe.C.aa.Go.Lp}rb(){return olympe.C.Sy(this.node,this.duration,this.j,void 0)}};let nc=null;olympe.C.G=void 0;olympe.C.rn=void 0;olympe.C.Vh=void 0;olympe.C.Ph=new Map;olympe.C.Ph.set(0,olympe.C.aa.ZERO);olympe.C.Ph.set(1,olympe.C.aa.ONE);olympe.C.Ph.set(2,olympe.C.aa.aw);olympe.C.Ak=new Map;olympe.C.Ak.set('',olympe.C.Sa.EMPTY);olympe.C.Ak.set(' ',olympe.C.Sa.Nv);olympe.C.createNode=function(a,b,c,d,e,f,g,h){return new olympe.C.Node({valueType:a,Jc:b,Rf:c,gn:d,debug:g,gg:e,ad:f,$i:h})};olympe.C.Of=function(a){return a instanceof olympe.C.Node};
392
- olympe.C.Qd=function(a,b,c){a=olympe.C.createNode(a,void 0,void 0,void 0,void 0,c);olympe.C.Of(b)?Yb(a,b):olympe.C.ib(b)?Yb(a,b.Ba):L(a,b);return M(a)};olympe.C.ib=function(a){return!(!a||!a.Tg)};olympe.C.df=function(a){return!(!a||!(a instanceof olympe.C.Node||a.Tg))};olympe.C.ln=function(a){return a instanceof olympe.C.Xb||a instanceof olympe.C.Sq||a instanceof olympe.C.Node};olympe.C.fh=function(a){return a instanceof olympe.C.Rj};
393
- olympe.C.nn=function(a,b){if(void 0!==a){olympe.C.fh(a)&&(a=a.rb().Ba);if(!olympe.C.df(a))return b(a);var c=[];olympe.C.ib(a)?c.push(a.Ba):c.push(a);return olympe.C.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.C.Pa=function(a,b){let c=a;olympe.C.ib(a)?c=a.Ba.Fb:olympe.C.Of(a)?c=a.Fb:olympe.C.fh(a)&&(c=a.rb().Ba.Fb);return void 0===c?b:c};
394
- olympe.C.jh=function(a,b){let c;olympe.C.ib(a)?c=a.Ba:olympe.C.Of(a)?c=a:olympe.C.fh(a)&&(c=a.rb().Ba);c&&olympe.C.Sc([b],d=>{c.jh(d)},'setDefaultValue');return a};olympe.C.hi=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.Dr?(h=h.Ba,g.push(k)):h instanceof olympe.C.Node?g.push(k):olympe.C.fh(h)&&(h=h.rb().Ba,g.push(k))),f[k]=h;return olympe.C.createNode(c,b,null,f,g,d||'syncNodes')};
395
- olympe.C.re=function(a,b,c,d){return M(olympe.C.hi(a,b,c,d||'syncProxies'))};const oc=a=>{for(const b of a)if(olympe.C.df(b)||olympe.C.fh(b))return!1;return!0};olympe.C.ta=function(a,b,c,d,e){if(oc(a))return b(...a);const f=olympe.C.hi(a,b,c,d||'TransformFlows');e&&olympe.C.Sc([e],g=>{f.jh(g)},'setDefaultValue');return M(f)};olympe.C.Sc=function(a,b,c){oc(a)?b(...a):olympe.C.hi(a,b,void 0,c||'processFlows')};
396
- olympe.C.cE=function(a,b,c){const d=olympe.C.Of(a)?a.Mb():olympe.C.fh(a)?a.rb().Oh:a.Oh,e=olympe.C.cc(d,c),f=olympe.V.Promise.dj(g=>{e.getContext().hb()||e.update(g)},b);olympe.C.Sc([a],g=>f(g).then());return e.rb()};olympe.C.zs=function(a,b){if(oc(a))b(...a);else{const c=olympe.C.Xa();olympe.C.hi(a,(...d)=>{olympe.C.Xa().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
397
- olympe.C.pn=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.ib(g)?(g=g.Ba,f.push(h)):g instanceof olympe.C.Node?f.push(h):olympe.C.fh(g)&&(g=g.rb().Ba,f.push(h))),e[h]=g;0!==f.length&&new olympe.C.Node({Jc:b,gn:e,gg:f,iz:!1,ad:c})};olympe.C.As=function(a,b){const c=olympe.C.Xa();olympe.C.pn(a,(...d)=>{olympe.C.Xa().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.C.aE=function(a,b,c){a=new olympe.C.Rj(a,c);b(a);return a.rb()};
398
- olympe.C.cc=function(a,b='flowSource'){return new olympe.C.Rj(a,b)};olympe.C.IE=function(a,b,c,d){const e=olympe.C.Xa();olympe.C.hi(a,(...f)=>{olympe.C.Xa().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.C.oj=function(a,b,c){olympe.C.ta([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.C.nE=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.rb()};
399
- olympe.C.kE=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.C.ME=function(a){return olympe.C.Xa().F(a)};olympe.C.hE=function(a,b,c){olympe.C.ax(a?a.Ba:a,b,c)};
400
- olympe.C.ax=function(a,b,c){if(a){var d=a.T();null===nc&&(nc={});if(nc[d])olympe.C.G.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{nc[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}`:
401
- ''))});c.onDestroy(()=>{delete nc[d]})}}else olympe.C.G.log('NOT starting node dump, node is '+String(a))};olympe.C.gE=function(){let a='',b=olympe.C.Xa();for(;null!==b;)a+=b.$c()+' --\x3e ',b=b.getParent();olympe.C.G.log(a)};
402
- 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.Sp;if(a===Math.PI)return olympe.C.aa.PI;if(Infinity===a)return olympe.C.aa.Ut;if(-Infinity===a)return olympe.C.aa.Qu;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.C.Ph.has(a)||olympe.C.Ph.set(a,new olympe.C.aa(a)),olympe.C.Ph.get(a)):new olympe.C.aa(a)}return null};
403
- olympe.C.ae=function(a){return void 0===a?olympe.C.Qd(olympe.C.aa):olympe.C.Qd(olympe.C.aa,olympe.C.df(a)?a:olympe.C.ra(a))};olympe.C.Sy=olympe.C.aa.animate;olympe.C.xE=function(a,b){return new olympe.C.Ss(a,b)};olympe.C.xb=function(a){if(a instanceof olympe.C.Sa)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.C.Ak.has(a)?olympe.C.Ak.get(a):new olympe.C.Sa(a)};
404
- olympe.C.CE=function(a){return void 0===a?olympe.C.Qd(olympe.C.Sa):olympe.C.Qd(olympe.C.Sa,olympe.C.df(a)?a:olympe.C.xb(a))};olympe.C.Rb=function(a){return a instanceof olympe.C.ea?a:void 0!==a&&null!==a&&a.valueOf()?olympe.C.ea.D:olympe.C.ea.j};olympe.C.zE=function(a){return void 0===a?olympe.C.Qd(olympe.C.ea):olympe.C.Qd(olympe.C.ea,olympe.C.df(a)?a:olympe.C.Rb(a))};olympe.C.yE=function(a){if(a instanceof Date)return new olympe.C.eb(a)};
405
- olympe.C.BE=function(a){return olympe.C.Qd(olympe.C.eb,void 0!==a?new olympe.C.eb(a):null)};olympe.C.qs=a=>a instanceof olympe.C.ea||a instanceof olympe.C.aa||a instanceof olympe.C.Sa||a instanceof olympe.C.eb;olympe.C.DE=function(a,b){return olympe.C.Qd(olympe.C.Zb,void 0===a&&void 0===b?void 0:new olympe.C.Zb(a,b))};olympe.C.cz=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.Qd(olympe.C.Color,e)};olympe.C.AE=olympe.C.cz;
406
- olympe.C.Sw=function(a){olympe.C.G=a;olympe.C.Vh=olympe.C.Xg()};olympe.C.Xg=function(){olympe.C.rn||(olympe.C.rn=new olympe.C.Sq);return olympe.C.rn};olympe.C.Xa=function(){olympe.C.Vh||(olympe.C.Vh=olympe.C.Xg());return olympe.C.Vh};olympe.C.Gs=function(a){const b=olympe.C.Vh;olympe.C.ln(a)&&(olympe.C.Vh=a);return null!=b?b:null};
407
- olympe.C.Ob=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.C.eb.Ob(a);break;case 'number':b=olympe.C.aa.Ob(a);break;case 'string':b=olympe.C.Sa.Ob(a);break;case 'vector2':b=olympe.C.Zb.Ob(a);break;case 'color':b=olympe.C.Color.Ob(a);break;case 'boolean':b=olympe.C.ea.Ob(a)}return b}return null};function pc(a){a.j.hb()||(a.F.forEach(b=>{b.destroy()}),a.F.clear(),a.D.clear(),a.size.clear(),a.N.clear(),a.R.length=0,a.J.length=0)}
408
- olympe.C.yC=class{constructor(){this.j=new olympe.C.Xb('Slot Manager context');this.F=new Map;this.j.run(()=>{this.D=olympe.C.cc(qc,'Last slot manager entry');this.size=gc(olympe.C.cc(olympe.C.aa,'SlotManager size').repeat(this.D.rb().an()),olympe.C.aa.ZERO);this.N=gc(olympe.C.cc(olympe.C.aa,'last valid slots'),olympe.C.ra(-1))});this.R=[];this.J=[];this.j.onDestroy(()=>{pc(this)})}};
409
- class qc{constructor(a,b,c,d){this.id=a;this.D=new olympe.C.Xb('Slot manager entry');this.J=c;this.N=d;this.D.run(()=>{const e=gc(olympe.C.cc(olympe.C.aa),olympe.C.aa.ZERO);olympe.C.ib(b)?e.repeat(b):e.update(b);this.j=olympe.C.cc(olympe.C.aa);this.F=this.j.rb().be(e.rb())});this.next=null}T(){return this.id}my(){return this.j.rb()}an(){return this.F}Cd(){return this.J}xy(){return this.N}Dz(a){this.J=a}pz(a){null===a?this.j.update(olympe.C.aa.ZERO):(this.j.repeat(a.an()),a.next=this)}hu(){this.j.clear();
410
- this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=qc.prototype;m.T.K=olympe.C.H.j;m.my.K=new olympe.C.H(()=>olympe.C.aa);m.an.K=new olympe.C.H(()=>olympe.C.aa);m.Cd.K=olympe.C.H.j;m.xy.K=olympe.C.H.j;m.Dz.K=olympe.C.H.j;m.pz.K=olympe.C.H.j;m.hu.K=olympe.C.H.j;m.destroy.K=olympe.C.H.j;olympe.C.P={Ca:'df.Logger'};olympe.W.config(a=>{F(a,olympe.C.U.Tp,Number.POSITIVE_INFINITY);E(a,olympe.C.P.Ca,[olympe.ja.P.Da],b=>b.cd('df'))},'olympe.df');olympe.W.run([olympe.C.P.Ca],a=>{olympe.C.Sw(a)},'olympe.df');olympe.host={};const rc=new Map,sc=new Map;olympe.host.Xp=class{static register(a,b,...c){rc.set(a,b);0<c.length&&sc.set(a,c)}static create(a,b,c,d){const e=rc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=sc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Ra(d,f))):new e(b,c)}};function tc(a,b,c){a.G.debug('CREATE #',b,', type=',c);a.j.set(b,olympe.host.Xp.create(c,b,a.G,a.J))}function uc(a,b,c,...d){const e=a.j.get(b);if(void 0!==e){a.G.J()<=olympe.ja.yb.j.Uf&&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.ib(f))b.push(a.j.get(f.qw)||null);else if('function'===typeof f){const g=f,h=olympe.C.Xa();b.push((...k)=>{h.hb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
411
- function vc(a){var b=olympe.host.He.Ad,c=olympe.host.He.Wp.wr;++a.F;const d=a.F;tc(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.ib(p)?(h.push(n),p=p.Ba):olympe.C.Of(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{uc(this,d,k,...g)}):(f=olympe.C.createNode(void 0,(...n)=>{e.run(()=>
412
- {uc(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.Y(a.N.bind(a,d));a=M(e);a.qw=d;L(e,a);return a}olympe.host.Ta=class{constructor(a,b){this.G=a;this.J=b;this.F=0;this.j=new Map;this.D=new Map;a.debug('Starting host manager')}ab(){return this.G}N(a){this.G.debug('DESTROY #',a);const b=this.j.get(a);this.j.delete(a);b.destroy()}};olympe.host.Nd=class{constructor(a){this.j=a;this.D=olympe.C.Xa()}F(){return this.j}td(){return this.j.Ba.td()||this.D.td()}hb(){return this.j.Ba.hb()}};olympe.host.Nd.prototype.F.K=new olympe.C.H(()=>olympe.host.He.Nd,[]);olympe.host.vk=class{j(){}D(){}};olympe.host.Ot=class{};function wc(a,b){var c=olympe.host.Sf;const d=olympe.V.Ic(),e=new olympe.C.Xb('onTimeout context');c.j.Y(b,d,()=>{e.hb()||e.td()||e.run(a);c.j.F(d)});return new olympe.host.Ad.D(c.j,d,e)}function xc(a,b){var c=olympe.host.Sf;const d=olympe.V.Ic(),e=new olympe.C.Xb('onInterval context');c.j.R(b,d,()=>{e.hb()||e.td()?c.j.D(d):e.run(a)})}olympe.host.Ad=class{constructor(a){this.j=vc(a)}};olympe.host.Ad.j=class{constructor(a,b,c){this.Sf=a;this.id=b;this.j=null!=c?c:null}T(){return this.id}cancel(){}};
413
- olympe.host.Ad.J=class extends olympe.host.Ad.j{cancel(){this.Sf.N(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ad.D=class extends olympe.host.Ad.j{cancel(){this.Sf.F(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ad.F=class extends olympe.host.Ad.j{cancel(){this.Sf.D(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ce=class{D(a,b){return null!=b?b:''}fa(a,b){return null!=b?b:''}N(){}j(a,b){return null!=b?b:''}F(){}};olympe.host.Ce.j={LIVENESS:'liveness',READINESS:'readiness',ALL:'all'};olympe.host.He={};olympe.host.He.Nd=class{destroy(){}};olympe.host.He.Nd.prototype.destroy=olympe.host.He.Nd.prototype.destroy;olympe.host.He.Wp={Kz:100,Mz:101,Lz:102,Oz:103,Nz:104,Jz:105,pC:201,nC:202,kC:204,sC:205,jC:206,mC:207,qC:208,tC:209,uC:210,vC:211,lC:212,rC:218,oC:219,wC:220,iC:221,hC:222,DC:300,EC:301,FC:302,JC:303,KC:304,LC:305,GC:310,HC:311,IC:312,JB:400,KB:401,LB:402,yB:450,rB:500,pB:501,uB:502,tB:503,qB:504,sB:505,dD:600,VC:601,ZC:602,RC:603,SC:604,PC:605,UC:606,jD:607,bD:608,MC:609,QC:610,TC:611,aD:612,fD:613,NC:614,eD:615,$C:616,iD:617,WC:618,XC:619,YC:620,cD:630,OC:631,gD:632,hD:633,PD:700,sD:701,tD:702,
414
- uD:703,wD:704,xD:705,yD:706,vD:707,AD:708,zD:709,BD:710,FD:711,ND:712,CD:713,DD:714,GD:715,HD:716,JD:717,KD:718,MD:719,ID:720,LD:721,OD:722,ED:723,QD:724,RD:725,wr:800};olympe.host.He.Ad=class{N(){}Y(){}F(){}R(){}D(){}};olympe.host.P={rk:'host.System',kp:'host.HistoryManager',Uq:'host.Scheduler',Ca:'host.platform.Logger',Da:'host.Manager',Re:'host.ProcessManager'};olympe.host.U={kk:'role',lp:'host.currentHost',rq:'host.processProbe',$q:'host.gracefulShutdownTimeout'};olympe.host.Lg={bl:'active',Dh:'preview'};olympe.host.Sf=null;
415
- 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';Ua(a,olympe.host.U.lp,d);b=olympe.host.Lg.bl;c=olympe.host.Lg.Dh;F(a,olympe.host.U.kk,d.startsWith(`${c}.`)?c:b);Xa(a,olympe.host.P.rk);Xa(a,olympe.host.P.kp);D(a,olympe.host.P.Re,olympe.host.Ce);E(a,olympe.host.P.Ca,[olympe.ja.P.Da],e=>e.cd('host'));D(a,olympe.host.P.Da,olympe.host.Ta,olympe.host.P.Ca,olympe.W.P.sg);E(a,olympe.host.P.Uq,[olympe.host.P.Da],
416
- e=>{null===olympe.host.Sf&&(olympe.host.Sf=new olympe.host.Ad(e));return olympe.host.Sf},!0)},'olympe.host');olympe.W.run([olympe.host.P.Uq],a=>a,'olympe.host.scheduler');olympe.W.run([olympe.host.P.Da],a=>a,'olympe.host');olympe.W.run([olympe.host.P.Re],a=>{olympe.host.Mk=()=>a});olympe.net={};olympe.net.wa={};olympe.net.wa.Md={Ch:'POST',GET:'GET',Lt:'HEAD',sq:'PUT',Cc:'DELETE',hq:'OPTIONS',MB:'PATCH'};olympe.net.wa.ResponseType={lr:'text',JSON:'json',il:'blob',Kh:'uint8array',fe:'stream'};olympe.net.wa.Headers={oi:'content-type',Yz:'content-length',Pn:'authorization',Rs:'access-control-allow-origin',Ps:'access-control-allow-headers',Qs:'access-control-allow-methods',Vo:'x-forwarded-host',Wo:'x-forwarded-proto'};
417
- olympe.net.wa.ul={$A:'text/html',JSON:'application/json',pw:'application/zip',fe:'application/octet-stream'};olympe.net.wa.Tb={eo:0,Ah:200,ho:201,yj:202,gl:400,dw:401,So:403,$l:404,vB:405,Pi:500,Fv:503};function yc(a){return a.host&&encodeURI(a.host)}function zc(a){return encodeURI(a.path).replace(olympe.net.Yi.j,(b,c)=>'%'+c)}olympe.net.Yi=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.D=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.D=d)}j(){return`${(void 0===this.D?443===this.port:this.D)?'wss':'ws'}://${yc(this)}:${this.port}/${zc(this)}`}toString(){return`${yc(this)}:${this.port}/${zc(this)}`}};
418
- olympe.net.Yi.j=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ba(){}$(){}Y(){}D(){}};function N(a,b,c,d){a=olympe.V.dz(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Ai(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.Ks&&(c=a.Ks.split(':'),2===c.length&&(c=bb(olympe.V.Ze(),`${c[0]}:${c[1]}`),Ac(b,{Authorization:`Basic ${c}`})));return b}function Bc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Cc(a,b){a.F=b;return a}function Ac(a,b){Object.assign(a.headers,b)}
419
- olympe.net.Ai=class extends olympe.net.Yi{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=null!=e?e:olympe.net.wa.Md.GET;this.query=h;this.headers={};this.body=f;this.F=null!=g?g:olympe.net.wa.ResponseType.lr}kj(){return this.headers}j(){let a=Bc(this);a=a?`?${a}`:'';if(!yc(this))return`${zc(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${(void 0===this.D?443===this.port:this.D)?'https':'http'}://${yc(this)}${b}/${zc(this)}${a}`}toString(){return this.j()}};
420
- olympe.net.Ai.Md={Ch:'POST',GET:'GET',Lt:'HEAD',sq:'PUT',Cc:'DELETE',hq:'OPTIONS'};olympe.net.ld=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}Hc(){return this.status}kj(){return this.headers}};function Dc(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.Xa(),e=d.onDestroy(()=>{var f=a.j;const g=f.j.get(c);f.j.delete(c);null==g||g()});return Ec(a.j,c,b).finally(()=>{d.Qf(e);a.j.j.delete(c)})}olympe.net.Ta=class{constructor(a){this.G=a;this.j=new olympe.net.pe.Pt(a);this.F=1;a='Initializing NET layer';this.G.j()&&(a+=' (implementation: '+this.N()+')');this.G.log(a);this.G.log('DONE initializing NET layer (ready to receive connection requests)')}D(){}J(){}Pf(){}N(){}};function Fc(a){let b;return!(null==(b=a.j)||!b.connected)&&a.J}function Gc(a){if(!a.D)throw Error('Cannot build connection options because the configuration is not available yet');const b=()=>({username:`${a.D.vhost}:${a.D.username}`,password:a.D.password});return Object.assign({},a.D,b(),{transformWsUrl:(c,d)=>{null!==a.D&&Object.assign(d,b());return c}})}
359
+ olympe.C.Sa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.qb.toLocaleTimeString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.xb(b.qb.toLocaleTimeString(c.valueOf())),olympe.C.Sa)}Uc(){return olympe.C.xb(this.qb.toISOString())}Hz(){return new Date(this.getTime())}Jz(){return this}Lz(){return this}jg(a,b){return olympe.C.ta([b],c=>{const d=new olympe.C.eb(new Date(this.qb.getTime()));d.qb['set'+a](this.qb['get'+a]()+c.valueOf());return d},olympe.C.eb)}Dw(a){return this.jg('Milliseconds',
360
+ a)}Iw(a){return this.jg('Seconds',a)}Ew(a){return this.jg('Minutes',a)}Cw(a){return this.jg('Hours',a)}Pm(a){return this.jg('Date',a)}Jw(a){return'number'===typeof a?this.Pm(7*a):this.Pm(a.$k(7))}Fw(a){return this.jg('Month',a)}Kw(a){return this.jg('FullYear',a)}Ez(){let a=this.qb.getDay();a=0===a?6:a-1;return new olympe.C.eb(new Date(this.qb.getFullYear(),this.qb.getMonth(),this.qb.getDate()-a))}Fz(){return new olympe.C.eb(new Date(this.qb.getFullYear(),this.qb.getMonth()))}Fd(a){return olympe.C.ta([a],
361
+ b=>olympe.C.Sb(this.Ea(b)),olympe.C.ea)}Ea(a){return a instanceof olympe.C.eb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Xx(){let a=this.qb.getDay();0===a&&(a=7);return olympe.C.ra(a)}Px(a,b){return olympe.C.ta([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.qb.getFullYear()-c.qb.getFullYear():'months'===d?c=12*(this.qb.getFullYear()-c.qb.getFullYear())+(this.qb.getMonth()-c.qb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
362
+ void 0===d&&(olympe.ja.$a('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.qb.getTime()-c.qb.getTime())/d));return olympe.C.ra(c)},olympe.C.aa)}Iy(a){return olympe.C.ta([a],b=>olympe.C.Sb(this.getTime()<b.getTime()),olympe.C.ea)}Gy(a){return olympe.C.ta([a],b=>olympe.C.Sb(this.getTime()>b.getTime()),olympe.C.ea)}Jy(a,b){return olympe.C.ta([a,b],(c,d)=>olympe.C.Sb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.C.ea)}valueOf(){return this.Kp().valueOf()?
363
+ new Date(this.getTime()):new Date(0)}};olympe.C.eb.j=ic(0);olympe.C.eb.D=ic(Number.NaN);m=olympe.C.eb.prototype;m.Kp.K=olympe.C.J.N;m.ku.K=olympe.C.J.F;m.mu.K=olympe.C.J.F;m.lu.K=olympe.C.J.F;m.ju.K=olympe.C.J.F;m.Lx.K=olympe.C.J.F;m.getMonth.K=olympe.C.J.F;m.nu.K=olympe.C.J.F;m.getTime.K=olympe.C.J.j;m.Dz.K=new olympe.C.J(()=>olympe.C.Sa,[0]);m.toLocaleString.K=olympe.C.J.D;m.toLocaleDateString.K=olympe.C.J.D;m.toLocaleTimeString.K=olympe.C.J.D;m.Uc.K=olympe.C.J.D;m.Hz.K=olympe.C.J.j;
364
+ m.Jz.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Lz.K=new olympe.C.J(()=>olympe.C.eb,[]);m.jg.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Dw.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Iw.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Ew.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Cw.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Pm.K=new olympe.C.J(()=>olympe.C.eb,[0]);m.Jw.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Fw.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Kw.K=new olympe.C.J(()=>olympe.C.eb,[0]);
365
+ m.Ez.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Fz.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Fd.K=olympe.C.J.N;m.Ea.K=olympe.C.J.j;m.Xx.K=olympe.C.J.F;m.Px.K=new olympe.C.J(()=>olympe.C.aa,[0,1]);m.Iy.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.Gy.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.Jy.K=new olympe.C.J(()=>olympe.C.ea,[0,1]);m.valueOf.K=olympe.C.J.j;const jc=new Map,kc=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,lc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function mc(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=lc.exec(c)):(d=1,c=kc.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.jf(a)?olympe.C.te([a],b,olympe.C.Color):b(a)}
366
+ 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,
367
+ b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.C.ta([a,b,c,d],(e,f,g,h)=>{e=olympe.C.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 jc.values())if(k&&k.j.Ea(e)&&k.D.Ea(f)&&k.b.Ea(g)&&k.a.Ea(h))return k;return new olympe.C.Color(e,f,g,h)},olympe.C.Color)}fh(){return this.j}Zg(){return this.b}bh(){return this.D}Yg(){return this.a}Pw(a,
368
+ b){return olympe.C.Color.create(this.j.xj(a.fh(),b),this.D.xj(a.bh(),b),this.b.xj(a.Zg(),b),this.a.xj(a.Yg(),b))}qx(a){return olympe.C.Color.create(this.j,this.D,this.b,a)}Ss(){return`rgba(${this.j},${this.D},${this.b},${this.a})`}Fn(){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.Fn()}Ea(a){return a instanceof olympe.C.Color?this.j.valueOf()===a.j.valueOf()&&
369
+ this.D.valueOf()===a.D.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}compare(a){const b=(this.fh().valueOf()<<16|this.bh().valueOf()<<8|this.Zg().valueOf())-(a.fh().valueOf()<<16|a.bh().valueOf()<<8|a.Zg().valueOf());return 0===b?this.Yg().valueOf()-a.Yg().valueOf():b}};olympe.C.Color.prototype.equals=olympe.C.Color.prototype.Ea;olympe.C.Color.prototype.toHexString=olympe.C.Color.prototype.Fn;olympe.C.Color.prototype.toRGBString=olympe.C.Color.prototype.Ss;
370
+ olympe.C.Color.prototype.getAlpha=olympe.C.Color.prototype.Yg;olympe.C.Color.prototype.getGreen=olympe.C.Color.prototype.bh;olympe.C.Color.prototype.getBlue=olympe.C.Color.prototype.Zg;olympe.C.Color.prototype.getRed=olympe.C.Color.prototype.fh;olympe.C.Color.create=olympe.C.Color.create;m=olympe.C.Color.prototype;m.toJSON.K=olympe.C.J.j;m.fh.K=olympe.C.J.F;m.Zg.K=olympe.C.J.F;m.bh.K=olympe.C.J.F;m.Yg.K=olympe.C.J.F;m.Pw.K=new olympe.C.J(()=>olympe.C.Color,[]);
371
+ m.qx.K=new olympe.C.J(()=>olympe.C.Color,[]);m.Ss.K=new olympe.C.J(()=>String,[]);m.Fn.K=new olympe.C.J(()=>String,[]);m.Ea.K=olympe.C.J.j;m.compare.K=olympe.C.J.j;olympe.C.File=class{la(){}Lp(){}Mp(){}qs(){}Ok(){}dn(){}Pk(){}rename(){}};olympe.C.Zb=class{constructor(a,b){this.x=olympe.C.be(a);this.y=olympe.C.be(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.C.Pa(this.x).valueOf())+', "y": '+JSON.stringify(olympe.C.Pa(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)}ou(){return this.x}Bz(a){fc(this.x,a)}pu(){return this.y}Cz(a){fc(this.y,a)}ty(){return this.x.Ks(this.y)}ce(a){return olympe.C.ta([this,a],(b,c)=>new olympe.C.Zb(b.x.ce(c.x),b.y.ce(c.y)),
372
+ olympe.C.Zb,'Vector2.plus')}lh(a){return olympe.C.ta([this,a],(b,c)=>new olympe.C.Zb(b.x.lh(c.x),b.y.lh(c.y)),olympe.C.Zb,'Vector2.minus')}Yy(a){return new olympe.C.Zb(this.x.$k(a),this.y.$k(a))}lx(a){return new olympe.C.Zb(this.x.lj(a),this.y.lj(a))}$y(){return new olympe.C.Zb(this.x.Dj(),this.y.Dj())}mx(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ta([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.C.ra(d*f+e*g),olympe.C.aa),olympe.C.aa)}length(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.ra(Math.sqrt(a*
373
+ a+b*b)),olympe.C.aa)}normalize(){return olympe.C.ta([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.C.Zb(a/c,b/c)},olympe.C.Zb)}floor(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.floor(a),Math.floor(b)),olympe.C.Zb)}ceil(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.ceil(a),Math.ceil(b)),olympe.C.Zb)}round(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.round(a),Math.round(b)),olympe.C.Zb)}Gw(a){return new olympe.C.Zb(this.x.ce(a),
374
+ this.y.ce(a))}Hw(a,b){return new olympe.C.Zb(this.x.ce(a),this.y.ce(b))}Uc(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.xb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.C.Sa)}toString(){return`Vector2[${this.x.Ba.Fb}, ${this.y.Ba.Fb}]`}Ea(a){return this===a?!0:!1}};m=olympe.C.Zb.prototype;m.toJSON.K=olympe.C.J.j;m.ou.K=olympe.C.J.F;m.Bz.K=olympe.C.J.j;m.pu.K=olympe.C.J.F;m.Cz.K=olympe.C.J.j;m.ty.K=olympe.C.J.F;m.ce.K=new olympe.C.J(()=>olympe.C.Zb,[0]);
375
+ m.lh.K=new olympe.C.J(()=>olympe.C.Zb,[0]);m.Yy.K=olympe.C.J.R;m.lx.K=olympe.C.J.R;m.$y.K=olympe.C.J.R;m.mx.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.Gw.K=olympe.C.J.R;m.Hw.K=olympe.C.J.R;m.Uc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;olympe.C.Bg=class{constructor(){}Nb(){}Md(){}get(){}fi(){}has(){}ih(){}Gc(){}Of(){}wf(){}og(){}forEach(){}ke(){}};olympe.C.Bg.prototype.forEachCurrentValue=olympe.C.Bg.prototype.ke;olympe.C.Bg.prototype.forEach=olympe.C.Bg.prototype.forEach;m=olympe.C.Bg.prototype;m.has.K=olympe.C.J.N;m.ih.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>Object,[]);m.Of.K=new olympe.C.J(()=>String,[]);m.wf.K=olympe.C.J.F;m.og.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.ke.K=olympe.C.J.j;olympe.C.qd=class extends olympe.C.Bg{Dd(){}Nf(){}gf(){}Mf(){}le(){}ff(){}mj(){}hi(){}};olympe.C.qd.prototype.getCurrentAt=olympe.C.qd.prototype.ff;olympe.C.qd.prototype.getAt=olympe.C.qd.prototype.le;olympe.C.qd.prototype.getCurrentKeyAt=olympe.C.qd.prototype.Mf;olympe.C.qd.prototype.getKeyAt=olympe.C.qd.prototype.gf;olympe.C.qd.prototype.getCurrentRank=olympe.C.qd.prototype.Nf;olympe.C.qd.prototype.getRank=olympe.C.qd.prototype.Dd;m=olympe.C.qd.prototype;m.Dd.K=olympe.C.J.F;m.Nf.K=olympe.C.J.j;
376
+ m.gf.K=new olympe.C.J(()=>String,[]);m.Mf.K=olympe.C.J.j;m.le.K=new olympe.C.J(()=>Object,[]);m.ff.K=olympe.C.J.j;m.mj.K=olympe.C.J.j;m.hi.K=new olympe.C.J(()=>Array,[]);olympe.C.oi=class{constructor(a,b){this.N=b||olympe.C.Xa();this.valueType=a||Object;this.values={};this.jb=this.wa=null;this.af=0;this.Y=Object.create(null);this.zb=Object.create(null);this.size=0;this.H=null;this.N.onDestroy(()=>{const c=this.Y;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.N}Nb(){return this.valueType}Md(a){this.valueType=a;const b=this.wa;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
377
+ c)&&bc(b[c],a)}get(a){const b=c=>{null===this.wa&&(this.wa={});return this.qj(this.wa,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.C.ta([a],c=>b(c),this.valueType)}fi(a){a=this.values[a];return olympe.C.hb(a)?Nb(a.Ba)?a.Ba.Fb:void 0:a}has(a){const b=c=>{null===this.jb&&(this.jb={});return this.qj(this.jb,c,c in this.values?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea,'Map.has('+c+')')};return olympe.C.ta([a],c=>b(c),olympe.C.ea)}ih(a){return a in this.values}qj(a,b,c,d,e){let f=a[b];
378
+ f||this.N.run(()=>{f=olympe.C.Sd(d,void 0,e);a[b]=f;f.Ba.onDestroy(()=>delete a[b]);olympe.C.hb(c)?ec(f,c):cc(f,c)});return f}Gc(){throw Error('Abstract method getFirstKey needs to be overridden');}Of(){throw Error('Abstract method getFirstKey needs to be overridden');}wf(){null===this.H&&this.N.run(()=>{this.H=olympe.C.Sd(olympe.C.aa,olympe.C.ra(this.size));this.H.Ba.onDestroy(()=>{this.H=null})});return this.H}og(){return this.size}forEach(a,b){const c=this.Lm();a=this.Mr(c,a,b);this.Km(c,a)}Lm(){return String(++this.af)}Km(a,
379
+ b){this.zb[a]=b;olympe.C.Xa().Td(()=>{const c=this.Y;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.zb[a]});this.ke(b)}Mr(a,b,c){const d=olympe.C.Xa();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.Om(a,f,g)})}}Om(a,b,c){void 0===this.Y[b]&&(this.Y[b]={});this.Y[b][a]=c}ke(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
380
+ a(b[c],c,this))break}Ik(a,b){void 0!==this.values[a]&&this.fj(a,!0);this.values[a]=b;var c=this.wa;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.C.Proxy?ec(c[a],b):cc(c[a],b));c=this.jb;null!==c&&void 0!==c[a]&&fc(c[a],!0);this.size++;c=this.zb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}fj(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.Xg?d.Ba.Fb:d;var e=this.wa;null!==e&&void 0!==e[a]&&dc(e[a]);e=this.jb;null!==e&&void 0!==
381
+ e[a]&&fc(e[a],!1);delete c[a];this.size--;b||this.If()}a=this.Y[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}If(){null!==this.H&&fc(this.H,this.size)}Uh(){var a=this.wa;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&dc(a[c]);a=this.jb;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&fc(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.Y)if(Object.prototype.hasOwnProperty.call(this.Y,
382
+ c)){b=this.Y[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.H&&fc(this.H,this.size)}Eg(){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.oi.xa=[olympe.C.Bg];m=olympe.C.oi.prototype;m.getContext.K=olympe.C.J.j;m.Nb.K=olympe.C.J.j;m.Md.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>Object,[],'valueType');m.fi.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.ih.K=olympe.C.J.j;m.qj.K=olympe.C.J.j;
383
+ m.wf.K=olympe.C.J.F;m.og.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.Lm.K=olympe.C.J.j;m.Km.K=olympe.C.J.j;m.Mr.K=olympe.C.J.j;m.Om.K=olympe.C.J.j;m.ke.K=olympe.C.J.j;m.Ik.K=olympe.C.J.j;m.fj.K=olympe.C.J.j;m.If.K=olympe.C.J.j;m.Uh.K=olympe.C.J.j;m.Eg.K=olympe.C.J.j;olympe.C.Hj=class extends olympe.C.oi{constructor(a,b){super(a,b);this.D=Object.create(null);this.j=[];this.ha=this.Ha=this.cb=this.da=null}Md(a){super.Md(a);if(null!==this.ha)for(let b of this.ha.values())bc(b,a)}Gc(){return this.le(0)}Of(){return this.gf(0)}Dd(a){const b=c=>{null===this.cb&&(this.cb=Object.create(null));let d=this.Nf(a);d=void 0!==d?olympe.C.ra(d):void 0;return this.qj(this.cb,c,d,olympe.C.aa,`List.getRank(${c})`)};return olympe.C.hb(a)?M(olympe.C.createNode(olympe.C.aa,b,null,
384
+ [a.Ba],[0],'onResolved('+(b.name||'')+')')):b(a)}Nf(a){return this.D[a]}gf(a){const b=c=>{const d=c.valueOf(),e=this.Mf(d);null===this.Ha&&(this.Ha=Object.create(null));return this.qj(this.Ha,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.C.ta([a],c=>b(c),String)}Mf(a){return this.j[a.valueOf()]}le(a){if(olympe.C.hb(a))return this.get(olympe.C.ta([a],c=>{c=this.gf(c);if(!Nb(c.Ba)){const d=olympe.C.Xa();olympe.C.Rf(d)&&Xb(d)}return c},String));null===this.ha&&(this.ha=new Map);let b=this.ha.get(a);
385
+ b||this.N.run(()=>{b=this.get(this.gf(a));this.ha.set(a,b);b.Ba.onDestroy(()=>this.ha.delete(a))});return b}ff(a){return this.fi(this.Mf(a))}mj(a,b,c,d){let e=this.Lm();a=this.Ds(e,a,b,c,d);this.Km(e,a)}Ds(a,b,c,d,e){return olympe.C.Xa().rc((f,g)=>{let h=!1,k=olympe.C.mi([b,c,this.Dd(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.Om(a,g,k)})}hi(){null===this.da&&this.N.run(()=>{this.da=olympe.C.Sd(Array,this.j.filter(a=>void 0!==a));
386
+ this.da.Ba.onDestroy(()=>{this.H=null})});return this.da}ke(a){if(this.j.length!==this.size)super.ke(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}}Nm(a,b){const c=this.cb,d=this.Ha,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]&&dc(c[g]),void 0!==
387
+ c[a]&&cc(c[a],olympe.C.ra(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&dc(d[e]),void 0!==d[b]&&cc(d[b],a))}}Mm(a){var b=this.Ha,c=this.D[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ba.Fb===a&&dc(b));delete this.D[a];this.j.splice(c,1);c=this.cb;null!==c&&void 0!==c[a]&&dc(c[a])}Nr(){if(null!==this.da){const a=this.j,b=this.da.Ba.Fb;b&&a.join(',')!==b.join(',')&&cc(this.da,a)}}If(){this.Nr();super.If()}Uh(){var a=this.D;for(b in a)delete a[b];this.j.length=0;a=this.cb;if(null!==
388
+ a)for(b in a)dc(a[b]);a=this.Ha;if(null!==a)for(b in a)dc(a[parseInt(b,10)]);var b=this.da;null!==b&&(Vb(b.Ba),cc(b,this.j));return olympe.C.oi.prototype.Uh.call(this)}Eg(){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.Hj.xa=[olympe.C.qd];m=olympe.C.Hj.prototype;m.Md.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>Object,[]);m.Of.K=new olympe.C.J(()=>String,[]);m.Dd.K=olympe.C.J.F;m.Nf.K=olympe.C.J.j;
389
+ m.gf.K=new olympe.C.J(()=>String,[]);m.Mf.K=olympe.C.J.j;m.le.K=new olympe.C.J(()=>Object,[]);m.ff.K=olympe.C.J.j;m.mj.K=new olympe.C.J(()=>{},[]);m.Ds.K=olympe.C.J.j;m.hi.K=new olympe.C.J(()=>Array,[]);m.ke.K=olympe.C.J.j;m.Nm.K=olympe.C.J.j;m.Mm.K=olympe.C.J.j;m.Nr.K=olympe.C.J.j;m.If.K=olympe.C.J.j;m.Uh.K=olympe.C.J.j;m.Eg.K=olympe.C.J.j;olympe.C.Map=class extends olympe.C.oi{constructor(a){a===olympe.C.Proxy&&(a=Object);super(a);this.j=this.D=null}Md(a){a===olympe.C.Proxy&&(a=Object);null!==this.D&&bc(this.D,a);super.Md(a)}Gc(){null===this.D&&this.Ym();return this.D}Of(){null===this.j&&this.Ym();return this.j}Ym(){this.getContext().run(()=>{this.D=olympe.C.Sd(this.Nb());this.j=olympe.C.Sd(String);this.Bj(this.an())})}an(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}Bj(a){if(void 0!==
390
+ a){const b=this.values[a];b&&b instanceof olympe.C.Proxy?ec(this.D,b):cc(this.D,b);cc(this.j,a)}else void 0!==this.D.Ba.Fb&&(dc(this.D),dc(this.j))}set(a,b){this.Ik(a,b);1===this.size&&null!==this.j&&this.Bj(a);this.If()}remove(a){const b=this.fj(a);null!==this.j&&this.j.Ba.Fb===a&&this.Bj(this.an());return b}clear(){this.Uh();null!==this.j&&this.Bj()}};m=olympe.C.Map.prototype;m.Md.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>Object,[]);m.Of.K=new olympe.C.J(()=>String,[]);m.Ym.K=olympe.C.J.j;
391
+ m.an.K=olympe.C.J.j;m.Bj.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.Hg=class extends olympe.C.Hj{constructor(a){super(a)}set(a,b,c){this.Ik(a,b);void 0!==c&&olympe.C.Sc([c],d=>{this.Nm(a,d)});this.If()}remove(a){this.Mm(a);return this.fj(a)}clear(){this.Uh()}};olympe.C.Hg.prototype.remove.K=olympe.C.J.j;olympe.C.Hg.prototype.clear.K=olympe.C.J.j;olympe.C.at=class extends olympe.C.Yj{constructor(a,b){super(olympe.C.aa,'animatedFlowSource');this.duration=a;this.j=b||olympe.C.aa.Mo.Sp}rb(){return olympe.C.bz(this.node,this.duration,this.j,void 0)}};let nc=null;olympe.C.G=void 0;olympe.C.xn=void 0;olympe.C.Zh=void 0;olympe.C.Th=new Map;olympe.C.Th.set(0,olympe.C.aa.ZERO);olympe.C.Th.set(1,olympe.C.aa.ONE);olympe.C.Th.set(2,olympe.C.aa.kw);olympe.C.Hk=new Map;olympe.C.Hk.set('',olympe.C.Sa.EMPTY);olympe.C.Hk.set(' ',olympe.C.Sa.Xv);olympe.C.createNode=function(a,b,c,d,e,f,g,h){return new olympe.C.Node({valueType:a,Jc:b,Uf:c,nn:d,debug:g,kg:e,ad:f,gj:h})};olympe.C.Rf=function(a){return a instanceof olympe.C.Node};
392
+ olympe.C.Sd=function(a,b,c){a=olympe.C.createNode(a,void 0,void 0,void 0,void 0,c);olympe.C.Rf(b)?Yb(a,b):olympe.C.hb(b)?Yb(a,b.Ba):L(a,b);return M(a)};olympe.C.hb=function(a){return!(!a||!a.Xg)};olympe.C.jf=function(a){return!(!a||!(a instanceof olympe.C.Node||a.Xg))};olympe.C.sn=function(a){return a instanceof olympe.C.Xb||a instanceof olympe.C.Zq||a instanceof olympe.C.Node};olympe.C.jh=function(a){return a instanceof olympe.C.Yj};
393
+ olympe.C.un=function(a,b){if(void 0!==a){olympe.C.jh(a)&&(a=a.rb().Ba);if(!olympe.C.jf(a))return b(a);var c=[];olympe.C.hb(a)?c.push(a.Ba):c.push(a);return olympe.C.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.C.Pa=function(a,b){let c=a;olympe.C.hb(a)?c=a.Ba.Fb:olympe.C.Rf(a)?c=a.Fb:olympe.C.jh(a)&&(c=a.rb().Ba.Fb);return void 0===c?b:c};
394
+ olympe.C.nh=function(a,b){let c;olympe.C.hb(a)?c=a.Ba:olympe.C.Rf(a)?c=a:olympe.C.jh(a)&&(c=a.rb().Ba);c&&olympe.C.Sc([b],d=>{c.nh(d)},'setDefaultValue');return a};olympe.C.mi=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.Kr?(h=h.Ba,g.push(k)):h instanceof olympe.C.Node?g.push(k):olympe.C.jh(h)&&(h=h.rb().Ba,g.push(k))),f[k]=h;return olympe.C.createNode(c,b,null,f,g,d||'syncNodes')};
395
+ olympe.C.te=function(a,b,c,d){return M(olympe.C.mi(a,b,c,d||'syncProxies'))};const oc=a=>{for(const b of a)if(olympe.C.jf(b)||olympe.C.jh(b))return!1;return!0};olympe.C.ta=function(a,b,c,d,e){if(oc(a))return b(...a);const f=olympe.C.mi(a,b,c,d||'TransformFlows');e&&olympe.C.Sc([e],g=>{f.nh(g)},'setDefaultValue');return M(f)};olympe.C.Sc=function(a,b,c){oc(a)?b(...a):olympe.C.mi(a,b,void 0,c||'processFlows')};
396
+ olympe.C.kE=function(a,b,c){const d=olympe.C.Rf(a)?a.Nb():olympe.C.jh(a)?a.rb().Sh:a.Sh,e=olympe.C.bc(d,c),f=olympe.V.Promise.kj(g=>{e.getContext().gb()||e.update(g)},b);olympe.C.Sc([a],g=>f(g).then());return e.rb()};olympe.C.Hs=function(a,b){if(oc(a))b(...a);else{const c=olympe.C.Xa();olympe.C.mi(a,(...d)=>{olympe.C.Xa().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
397
+ olympe.C.vn=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.Ba,f.push(h)):g instanceof olympe.C.Node?f.push(h):olympe.C.jh(g)&&(g=g.rb().Ba,f.push(h))),e[h]=g;0!==f.length&&new olympe.C.Node({Jc:b,nn:e,kg:f,sz:!1,ad:c})};olympe.C.Is=function(a,b){const c=olympe.C.Xa();olympe.C.vn(a,(...d)=>{olympe.C.Xa().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.C.iE=function(a,b,c){a=new olympe.C.Yj(a,c);b(a);return a.rb()};
398
+ olympe.C.bc=function(a,b='flowSource'){return new olympe.C.Yj(a,b)};olympe.C.QE=function(a,b,c,d){const e=olympe.C.Xa();olympe.C.mi(a,(...f)=>{olympe.C.Xa().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.C.vj=function(a,b,c){olympe.C.ta([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.C.vE=function(a,b,c='from observable'){const d=olympe.C.bc(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.rb()};
399
+ olympe.C.sE=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.C.UE=function(a){return olympe.C.Xa().rc(a)};olympe.C.pE=function(a,b,c){olympe.C.nx(a?a.Ba:a,b,c)};
400
+ olympe.C.nx=function(a,b,c){if(a){var d=a.T();null===nc&&(nc={});if(nc[d])olympe.C.G.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{nc[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}`:
401
+ ''))});c.onDestroy(()=>{delete nc[d]})}}else olympe.C.G.log('NOT starting node dump, node is '+String(a))};olympe.C.oE=function(){let a='',b=olympe.C.Xa();for(;null!==b;)a+=b.fn()+' --\x3e ',b=b.getParent();olympe.C.G.log(a)};
402
+ 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.Zp;if(a===Math.PI)return olympe.C.aa.PI;if(Infinity===a)return olympe.C.aa.cu;if(-Infinity===a)return olympe.C.aa.Zu;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.C.Th.has(a)||olympe.C.Th.set(a,new olympe.C.aa(a)),olympe.C.Th.get(a)):new olympe.C.aa(a)}return null};
403
+ olympe.C.be=function(a){return void 0===a?olympe.C.Sd(olympe.C.aa):olympe.C.Sd(olympe.C.aa,olympe.C.jf(a)?a:olympe.C.ra(a))};olympe.C.bz=olympe.C.aa.animate;olympe.C.FE=function(a,b){return new olympe.C.at(a,b)};olympe.C.xb=function(a){if(a instanceof olympe.C.Sa)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.C.Hk.has(a)?olympe.C.Hk.get(a):new olympe.C.Sa(a)};
404
+ olympe.C.KE=function(a){return void 0===a?olympe.C.Sd(olympe.C.Sa):olympe.C.Sd(olympe.C.Sa,olympe.C.jf(a)?a:olympe.C.xb(a))};olympe.C.Sb=function(a){return a instanceof olympe.C.ea?a:void 0!==a&&null!==a&&a.valueOf()?olympe.C.ea.D:olympe.C.ea.j};olympe.C.HE=function(a){return void 0===a?olympe.C.Sd(olympe.C.ea):olympe.C.Sd(olympe.C.ea,olympe.C.jf(a)?a:olympe.C.Sb(a))};olympe.C.GE=function(a){if(a instanceof Date)return new olympe.C.eb(a)};
405
+ olympe.C.JE=function(a){return olympe.C.Sd(olympe.C.eb,void 0!==a?new olympe.C.eb(a):null)};olympe.C.ys=a=>a instanceof olympe.C.ea||a instanceof olympe.C.aa||a instanceof olympe.C.Sa||a instanceof olympe.C.eb;olympe.C.LE=function(a,b){return olympe.C.Sd(olympe.C.Zb,void 0===a&&void 0===b?void 0:new olympe.C.Zb(a,b))};olympe.C.mz=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.Sd(olympe.C.Color,e)};olympe.C.IE=olympe.C.mz;
406
+ olympe.C.bx=function(a){olympe.C.G=a;olympe.C.Zh=olympe.C.ah()};olympe.C.ah=function(){olympe.C.xn||(olympe.C.xn=new olympe.C.Zq);return olympe.C.xn};olympe.C.Xa=function(){olympe.C.Zh||(olympe.C.Zh=olympe.C.ah());return olympe.C.Zh};olympe.C.Os=function(a){const b=olympe.C.Zh;olympe.C.sn(a)&&(olympe.C.Zh=a);return null!=b?b:null};
407
+ 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.Sa.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.ea.Qb(a)}return b}return null};function pc(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)}
408
+ olympe.C.GC=class{constructor(){this.j=new olympe.C.Xb('Slot Manager context');this.F=new Map;this.j.run(()=>{this.D=olympe.C.bc(qc,'Last slot manager entry');this.size=gc(olympe.C.bc(olympe.C.aa,'SlotManager size').repeat(this.D.rb().gn()),olympe.C.aa.ZERO);this.N=gc(olympe.C.bc(olympe.C.aa,'last valid slots'),olympe.C.ra(-1))});this.R=[];this.H=[];this.j.onDestroy(()=>{pc(this)})}};
409
+ class qc{constructor(a,b,c,d){this.id=a;this.D=new olympe.C.Xb('Slot manager entry');this.H=c;this.N=d;this.D.run(()=>{const e=gc(olympe.C.bc(olympe.C.aa),olympe.C.aa.ZERO);olympe.C.hb(b)?e.repeat(b):e.update(b);this.j=olympe.C.bc(olympe.C.aa);this.F=this.j.rb().ce(e.rb())});this.next=null}T(){return this.id}xy(){return this.j.rb()}gn(){return this.F}Dd(){return this.H}Hy(){return this.N}Nz(a){this.H=a}Az(a){null===a?this.j.update(olympe.C.aa.ZERO):(this.j.repeat(a.gn()),a.next=this)}qu(){this.j.clear();
410
+ this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=qc.prototype;m.T.K=olympe.C.J.j;m.xy.K=new olympe.C.J(()=>olympe.C.aa);m.gn.K=new olympe.C.J(()=>olympe.C.aa);m.Dd.K=olympe.C.J.j;m.Hy.K=olympe.C.J.j;m.Nz.K=olympe.C.J.j;m.Az.K=olympe.C.J.j;m.qu.K=olympe.C.J.j;m.destroy.K=olympe.C.J.j;olympe.C.P={Ca:'df.Logger'};olympe.W.config(a=>{F(a,olympe.C.U.$p,Number.POSITIVE_INFINITY);E(a,olympe.C.P.Ca,[olympe.ja.P.Da],b=>b.cd('df'))},'olympe.df');olympe.W.run([olympe.C.P.Ca],a=>{olympe.C.bx(a)},'olympe.df');olympe.host={};const rc=new Map,sc=new Map;olympe.host.eq=class{static register(a,b,...c){rc.set(a,b);0<c.length&&sc.set(a,c)}static create(a,b,c,d){const e=rc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=sc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Ra(d,f))):new e(b,c)}};function tc(a,b,c){a.G.debug('CREATE #',b,', type=',c);a.j.set(b,olympe.host.eq.create(c,b,a.G,a.H))}function uc(a,b,c,...d){const e=a.j.get(b);if(void 0!==e){a.G.H()<=olympe.ja.yb.j.Xf&&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.Aw)||null);else if('function'===typeof f){const g=f,h=olympe.C.Xa();b.push((...k)=>{h.gb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
411
+ function vc(a){var b=olympe.host.Je.Ad,c=olympe.host.Je.cq.Dr;++a.F;const d=a.F;tc(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.Ba):olympe.C.Rf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{uc(this,d,k,...g)}):(f=olympe.C.createNode(void 0,(...n)=>{e.run(()=>
412
+ {uc(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.Td(a.N.bind(a,d));a=M(e);a.Aw=d;L(e,a);return a}olympe.host.Ta=class{constructor(a,b){this.G=a;this.H=b;this.F=0;this.j=new Map;this.D=new Map;a.debug('Starting host manager')}$a(){return this.G}N(a){this.G.debug('DESTROY #',a);const b=this.j.get(a);this.j.delete(a);b.destroy()}};olympe.host.Od=class{constructor(a){this.j=a;this.D=olympe.C.Xa()}F(){return this.j}gd(){return this.j.Ba.gd()||this.D.gd()}gb(){return this.j.Ba.gb()}};olympe.host.Od.prototype.F.K=new olympe.C.J(()=>olympe.host.Je.Od,[]);olympe.host.Ck=class{j(){}D(){}};olympe.host.Xt=class{};function wc(a,b){var c=olympe.host.Vf;const d=olympe.V.Ic(),e=new olympe.C.Xb('onTimeout context');c.j.Y(b,d,()=>{e.gb()||e.gd()||e.run(a);c.j.F(d)});return new olympe.host.Ad.D(c.j,d,e)}function xc(a,b){var c=olympe.host.Vf;const d=olympe.V.Ic(),e=new olympe.C.Xb('onInterval context');c.j.R(b,d,()=>{e.gb()||e.gd()?c.j.D(d):e.run(a)})}olympe.host.Ad=class{constructor(a){this.j=vc(a)}};olympe.host.Ad.j=class{constructor(a,b,c){this.Vf=a;this.id=b;this.j=null!=c?c:null}T(){return this.id}cancel(){}};
413
+ olympe.host.Ad.H=class extends olympe.host.Ad.j{cancel(){this.Vf.N(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ad.D=class extends olympe.host.Ad.j{cancel(){this.Vf.F(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ad.F=class extends olympe.host.Ad.j{cancel(){this.Vf.D(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ee=class{D(a,b){return null!=b?b:''}ha(a,b){return null!=b?b:''}N(){}j(a,b){return null!=b?b:''}F(){}};olympe.host.Ee.j={LIVENESS:'liveness',READINESS:'readiness',ALL:'all'};olympe.host.Je={};olympe.host.Je.Od=class{destroy(){}};olympe.host.Je.Od.prototype.destroy=olympe.host.Je.Od.prototype.destroy;olympe.host.Je.cq={Uz:100,Wz:101,Vz:102,Yz:103,Xz:104,Tz:105,xC:201,vC:202,sC:204,AC:205,rC:206,uC:207,yC:208,BC:209,CC:210,DC:211,tC:212,zC:218,wC:219,EC:220,qC:221,pC:222,LC:300,MC:301,NC:302,RC:303,SC:304,TC:305,OC:310,PC:311,QC:312,SB:400,TB:401,UB:402,HB:450,AB:500,yB:501,DB:502,CB:503,zB:504,BB:505,lD:600,cD:601,gD:602,ZC:603,$C:604,XC:605,bD:606,rD:607,jD:608,UC:609,YC:610,aD:611,iD:612,nD:613,VC:614,mD:615,hD:616,qD:617,dD:618,eD:619,fD:620,kD:630,WC:631,oD:632,pD:633,XD:700,AD:701,BD:702,
414
+ CD:703,ED:704,FD:705,GD:706,DD:707,ID:708,HD:709,JD:710,ND:711,VD:712,KD:713,LD:714,OD:715,PD:716,RD:717,SD:718,UD:719,QD:720,TD:721,WD:722,MD:723,YD:724,ZD:725,Dr:800};olympe.host.Je.Ad=class{N(){}Y(){}F(){}R(){}D(){}};olympe.host.P={yk:'host.System',qp:'host.HistoryManager',ar:'host.Scheduler',Ca:'host.platform.Logger',Da:'host.Manager',Ue:'host.ProcessManager'};olympe.host.U={sk:'role',rp:'host.currentHost',yq:'host.processProbe',gr:'host.gracefulShutdownTimeout'};olympe.host.Pg={il:'active',Hh:'preview'};olympe.host.Vf=null;
415
+ 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';Ua(a,olympe.host.U.rp,d);b=olympe.host.Pg.il;c=olympe.host.Pg.Hh;F(a,olympe.host.U.sk,d.startsWith(`${c}.`)?c:b);Xa(a,olympe.host.P.yk);Xa(a,olympe.host.P.qp);D(a,olympe.host.P.Ue,olympe.host.Ee);E(a,olympe.host.P.Ca,[olympe.ja.P.Da],e=>e.cd('host'));D(a,olympe.host.P.Da,olympe.host.Ta,olympe.host.P.Ca,olympe.W.P.xg);E(a,olympe.host.P.ar,[olympe.host.P.Da],
416
+ e=>{null===olympe.host.Vf&&(olympe.host.Vf=new olympe.host.Ad(e));return olympe.host.Vf},!0)},'olympe.host');olympe.W.run([olympe.host.P.ar],a=>a,'olympe.host.scheduler');olympe.W.run([olympe.host.P.Da],a=>a,'olympe.host');olympe.W.run([olympe.host.P.Ue],a=>{olympe.host.Tk=()=>a});olympe.net={};olympe.net.va={};olympe.net.va.Nd={Gh:'POST',GET:'GET',Ut:'HEAD',zq:'PUT',Dc:'DELETE',oq:'OPTIONS',VB:'PATCH'};olympe.net.va.ResponseType={ur:'text',JSON:'json',pl:'blob',Oh:'uint8array',ge:'stream'};olympe.net.va.Headers={xi:'content-type',hA:'content-length',Vn:'authorization',$s:'access-control-allow-origin',Ys:'access-control-allow-headers',Zs:'access-control-allow-methods',ap:'x-forwarded-host',bp:'x-forwarded-proto'};
417
+ olympe.net.va.Al={jB:'text/html',JSON:'application/json',zw:'application/zip',ge:'application/octet-stream'};olympe.net.va.Vb={lo:0,Eh:200,no:201,Fj:202,nl:400,nw:401,Yo:403,gm:404,EB:405,Wi:500,Pv:503};function yc(a){return a.host&&encodeURI(a.host)}function zc(a){return encodeURI(a.path).replace(olympe.net.ej.j,(b,c)=>'%'+c)}olympe.net.ej=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.D=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.D=d)}j(){return`${(void 0===this.D?443===this.port:this.D)?'wss':'ws'}://${yc(this)}:${this.port}/${zc(this)}`}toString(){return`${yc(this)}:${this.port}/${zc(this)}`}};
418
+ olympe.net.ej.j=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}da(){}$(){}Y(){}D(){}};function N(a,b,c,d){a=olympe.V.nz(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Gi(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.Ts&&(c=a.Ts.split(':'),2===c.length&&(c=bb(olympe.V.df(),`${c[0]}:${c[1]}`),Ac(b,{Authorization:`Basic ${c}`})));return b}function Bc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Cc(a,b){a.F=b;return a}function Ac(a,b){Object.assign(a.headers,b)}
419
+ olympe.net.Gi=class extends olympe.net.ej{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=null!=e?e:olympe.net.va.Nd.GET;this.query=h;this.headers={};this.body=f;this.F=null!=g?g:olympe.net.va.ResponseType.ur}rj(){return this.headers}j(){let a=Bc(this);a=a?`?${a}`:'';if(!yc(this))return`${zc(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${(void 0===this.D?443===this.port:this.D)?'https':'http'}://${yc(this)}${b}/${zc(this)}${a}`}toString(){return this.j()}};
420
+ olympe.net.Gi.Nd={Gh:'POST',GET:'GET',Ut:'HEAD',zq:'PUT',Dc:'DELETE',oq:'OPTIONS'};olympe.net.ld=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}Hc(){return this.status}rj(){return this.headers}};function Dc(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.Xa(),e=d.onDestroy(()=>{var f=a.j;const g=f.j.get(c);f.j.delete(c);null==g||g()});return Ec(a.j,c,b).finally(()=>{d.Tf(e);a.j.j.delete(c)})}olympe.net.Ta=class{constructor(a){this.G=a;this.j=new olympe.net.re.Yt(a);this.F=1;a='Initializing NET layer';this.G.j()&&(a+=' (implementation: '+this.N()+')');this.G.log(a);this.G.log('DONE initializing NET layer (ready to receive connection requests)')}D(){}H(){}Sf(){}N(){}};function Fc(a){let b;return!(null==(b=a.j)||!b.connected)&&a.H}function Gc(a){if(!a.D)throw Error('Cannot build connection options because the configuration is not available yet');const b=()=>({username:`${a.D.vhost}:${a.D.username}`,password:a.D.password});return Object.assign({},a.D,b(),{transformWsUrl:(c,d)=>{null!==a.D&&Object.assign(d,b());return c}})}
421
421
  function Hc(a,b){if(!Fc(a))return Promise.reject(Error('Cannot unsubscribe because the MQTT client is disconnected'));a.G.j()&&a.G.debug(`MQTT unsubscribe topic ${b}`);return new Promise((c,d)=>{a.j.unsubscribe(b,void 0,e=>{a.F.delete(b);e?d(e):c()})})}function Ic(a,b){a.R.push(b)}function Jc(a,b){a.N.push(b)}function Kc(a,b){a.Y.push(b)}
422
- olympe.net.uf=class{constructor(a){this.G=olympe.ja.ab('MQTT');this.J=!1;this.j=this.D=null;this.N=[];this.Y=[];this.ba=[];this.$=[];this.R=[];this.F=new Map;const b=olympe.V.Promise.dj(()=>this.connect(),0);a.subscribe(c=>{this.G.j()&&this.G.debug('New MQTT configuration received',c);this.D=c;null!==c&&this.J&&(Fc(this)?this.end(!1,()=>b().then()):b().then())})}connect(a){if(Fc(this))return null==a||a(),this;a&&this.N.push(a);this.J=!0;null===this.j&&null!==this.D&&(this.j=mqtt.connect(this.D.url,
423
- Gc(this)),this.j.on(olympe.net.uf.j.Pu,(b,c)=>{this.G.j()&&this.G.debug(`MQTT < ${c}`);this.F.has(b)?this.F.get(b)(JSON.parse(c.toString())):this.G.warn('There is no subscriber for topic '+b)}),this.j.on(olympe.net.uf.j.jt,()=>{this.G.info('Mqtt client is connected to bus');this.N.forEach(b=>b())}),this.j.on(olympe.net.uf.j.uv,()=>{this.G.info('Mqtt client is reconnecting to bus ... ');null===this.D&&this.end(!1);this.Y.forEach(b=>b())}),this.j.on(olympe.net.uf.j.zb,b=>{this.G.error('Mqtt client error ',
424
- b);this.$.forEach(c=>c(b))}),this.j.on(olympe.net.uf.j.ye,()=>{this.G.info('Mqtt client is offline');this.ba.forEach(b=>b())}),this.j.on(olympe.net.uf.j.it,()=>{this.G.info('Mqtt client is closed');this.R.forEach(b=>b())}),this.j.on(olympe.net.uf.j.Yf,()=>{this.G.info('Mqtt client has ended')}));return this}publish(a,b,c){if(!Fc(this))return Promise.reject(Error('Cannot publish message because the MQTT client is disconnected'));const d=JSON.stringify(b);this.G.j()&&this.G.debug(`MQTT > ${d}`);return new Promise((e,
425
- f)=>{this.j.publish(a,d,c,g=>{g?f(Error('Failed to publish a message '+d)):e()})})}subscribe(a,b){if(!Fc(this))return Promise.reject(Error('Cannot subscribe because the MQTT client is disconnected'));this.G.debug(`MQTT subscribe to topic ${a}`);return new Promise((c,d)=>{this.j.subscribe(a,void 0,e=>{e?d(Error(`Failed to subscribe to topic ${a}: ${e}`)):(this.F.set(a,b),c())})})}end(a,b){this.J=!1;this.F.clear();this.j?this.j.end(a,{},()=>{this.j=null;null==b||b()}):null==b||b();return this}};
426
- olympe.net.uf.j={jt:'connect',uv:'reconnect',Pu:'message',it:'close',Yf:'end',zb:'error',ye:'offline'};olympe.net.Nh=class{constructor(a){this.G=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}J(){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.')}F(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Y(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
427
- olympe.net.Nh.ALL='*';olympe.net.Rv=class{register(){return w(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.P={Da:'net.Manager',Ca:'net.Logger',Xi:'net.WebServer',Jv:'net.ServiceWorkerManager',cm:'net.OfflineConfig'};olympe.net.U={rf:'net.httpPort',op:'net.httpBodyLimit',vr:'net.http2',np:'net.httpsCertificatesPath',Vl:'net.localNetworkSuffix',Li:'offline.enabled',bm:'offline.autoBackOnline',gq:'offline.downloadBatchSize'};
428
- olympe.W.config(function(a){F(a,olympe.net.U.rf,3141);F(a,olympe.net.U.op,100);F(a,olympe.net.U.vr,!1);F(a,olympe.net.U.np,null);F(a,olympe.net.U.Vl,'frontend');F(a,olympe.net.U.Li,!1);F(a,olympe.net.U.bm,!1);F(a,olympe.net.U.gq,20);Xa(a,olympe.net.P.Da);E(a,olympe.net.P.Ca,[olympe.ja.P.Da],b=>b.cd('net'));D(a,olympe.net.P.Xi,olympe.net.Nh,olympe.net.P.Ca);D(a,olympe.net.P.Jv,olympe.net.Rv);E(a,olympe.net.P.cm,[new olympe.W.pa(olympe.net.U.Li),new olympe.W.pa(olympe.net.U.bm)],(b,c)=>new Map([['offlineEnabled',
429
- b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Va.node.host={};olympe.Va.node.host.Nd=function(a,b){this.G=b};olympe.Va.node.host.Nd.prototype.constructor=olympe.Va.node.host.Nd;olympe.Va.node.host.Nd.prototype.destroy=function(){};olympe.Va.node.host.Nd.prototype.destroy=olympe.Va.node.host.Nd.prototype.destroy;olympe.Va.node.host.Nd.prototype.ab=function(){return this.G};olympe.Va.node.host.Nd.xa=[olympe.host.He.Nd];olympe.Va.node.host.Yp=class{constructor(a){this.G=a}};olympe.Va.node.host.Yp.xa=[olympe.host.Ot];olympe.Va.node.host.Ad=class{constructor(){this.j={};this.J={}}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.J[b]=setInterval(c,a)}D(a){clearInterval(this.J[a]);delete this.J[a]}};olympe.host.Xp.register(olympe.host.He.Wp.wr,olympe.Va.node.host.Ad);olympe.Va.node.host.Ad.xa=[olympe.host.He.Ad];olympe.Va.node.host.vk=class{constructor(a){this.G=a}j(){return olympe.C.ea.D}D(){return!0}};olympe.Va.node.host.vk.xa=[olympe.host.vk];function Lc(a){a.ba.F('readinessProbe','/readiness',[olympe.net.wa.Md.GET],()=>Mc(a,a.$)).catch(b=>a.G.error(`Failed to add readiness health check route ${b}`));a.ba.F('livenessProbe','/liveness',[olympe.net.wa.Md.GET],()=>Mc(a,a.Y)).catch(b=>a.G.error(`Failed to add liveness health check route ${b}`));a.D(()=>a.ba.stop())}
430
- function Nc(a,b){b=Array.from(b.entries()).map(([c,d])=>olympe.V.Promise.Cn(d(),a.ua,`Shutdown hook ${c} has timeout`));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 Oc(a){return w(function*(){try{const b=yield Nc(a,a.J),c=yield Nc(a,a.R);if(b||c)throw Error('Failed to gracefully close the backend');}finally{a.J.clear(),a.R.clear()}})}
431
- function Mc(a,b){const c=olympe.net.wa.Tb.Ah,d=olympe.net.wa.Tb.Pi;b=Array.from(b.values()).map(e=>e.apply(a));return 0===b.length?Promise.resolve(new olympe.net.ld('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.ld(g,f?d:c,f?'Some services are not working':'Everything is OK')})}
432
- olympe.Va.node.host.Ce=class extends olympe.host.Ce{constructor(a,b,c,d=!0){super();this.G=a;this.ba=b;this.ua=c;this.Y=new Map;this.$=new Map;this.J=new Map;this.R=new Map;d&&Lc(this)}j(a,b=olympe.V.Hf(),c=olympe.host.Ce.j.ALL){switch(c){case olympe.host.Ce.j.LIVENESS:this.Y.set(b,a);break;case olympe.host.Ce.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)}D(a,b=olympe.V.Hf()){this.J.set(b,a);return b}fa(a,b=olympe.V.Hf()){this.R.set(b,
433
- a);return b}N(a){this.J.has(a)?this.J.delete(a):this.R.delete(a)}};olympe.W.config(function(a){F(a,olympe.host.U.rq,!0);F(a,olympe.host.U.$q,1E4);Va(a,olympe.host.P.kp,olympe.Va.node.host.Yp,olympe.host.P.Ca);Va(a,olympe.host.P.rk,olympe.Va.node.host.vk,olympe.host.P.Ca);D(a,olympe.host.P.Re,olympe.Va.node.host.Ce,olympe.host.P.Ca,olympe.net.P.Xi,new olympe.W.pa(olympe.host.U.$q),new olympe.W.pa(olympe.host.U.rq))},'olympe.native.node.host');olympe.W.run([olympe.host.P.Re],a=>{olympe.Va.node.host.Mk=()=>a});olympe.net.pe={};function Ec(a,b,c){const d=olympe.net.wa.Tb.eo,e=olympe.net.wa.Tb.Pi,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.kj(),body:null!=(k=c.body)?k:void 0,signal:f.signal}).then(l=>l.ok?Pc(l,c.F).catch(n=>new olympe.net.ld(`Error parsing response from ${g} with method ${h}: ${n.message}`,e,'Error handling response')):new olympe.net.ld(`Error fetching data from ${g} with method ${h}`,l.status,l.statusText,l.headers)).catch(l=>'AbortError'===
422
+ olympe.net.yf=class{constructor(a){this.G=olympe.ja.$a('MQTT');this.H=!1;this.j=this.D=null;this.N=[];this.Y=[];this.da=[];this.$=[];this.R=[];this.F=new Map;const b=olympe.V.Promise.kj(()=>this.connect(),0);a.subscribe(c=>{this.G.j()&&this.G.debug('New MQTT configuration received',c);this.D=c;null!==c&&this.H&&(Fc(this)?this.end(!1,()=>b().then()):b().then())})}connect(a){if(Fc(this))return null==a||a(),this;a&&this.N.push(a);this.H=!0;null===this.j&&null!==this.D&&(this.j=mqtt.connect(this.D.url,
423
+ Gc(this)),this.j.on(olympe.net.yf.j.Yu,(b,c)=>{this.G.j()&&this.G.debug(`MQTT < ${c}`);this.F.has(b)?this.F.get(b)(JSON.parse(c.toString())):this.G.warn('There is no subscriber for topic '+b)}),this.j.on(olympe.net.yf.j.st,()=>{this.G.info('Mqtt client is connected to bus');this.N.forEach(b=>b())}),this.j.on(olympe.net.yf.j.Dv,()=>{this.G.info('Mqtt client is reconnecting to bus ... ');null===this.D&&this.end(!1);this.Y.forEach(b=>b())}),this.j.on(olympe.net.yf.j.Ab,b=>{this.G.error('Mqtt client error ',
424
+ b);this.$.forEach(c=>c(b))}),this.j.on(olympe.net.yf.j.Ae,()=>{this.G.info('Mqtt client is offline');this.da.forEach(b=>b())}),this.j.on(olympe.net.yf.j.rt,()=>{this.G.info('Mqtt client is closed');this.R.forEach(b=>b())}),this.j.on(olympe.net.yf.j.bg,()=>{this.G.info('Mqtt client has ended')}));return this}publish(a,b,c){if(!Fc(this))return Promise.reject(Error('Cannot publish message because the MQTT client is disconnected'));const d=JSON.stringify(b);this.G.j()&&this.G.debug(`MQTT > ${d}`);return new Promise((e,
425
+ f)=>{this.j.publish(a,d,c,g=>{g?f(Error('Failed to publish a message '+d)):e()})})}subscribe(a,b){if(!Fc(this))return Promise.reject(Error('Cannot subscribe because the MQTT client is disconnected'));this.G.debug(`MQTT subscribe to topic ${a}`);return new Promise((c,d)=>{this.j.subscribe(a,void 0,e=>{e?d(Error(`Failed to subscribe to topic ${a}: ${e}`)):(this.F.set(a,b),c())})})}end(a,b){this.H=!1;this.F.clear();this.j?this.j.end(a,{},()=>{this.j=null;null==b||b()}):null==b||b();return this}};
426
+ olympe.net.yf.j={st:'connect',Dv:'reconnect',Yu:'message',rt:'close',bg:'end',Ab:'error',Ae:'offline'};olympe.net.Rh=class{constructor(a){this.G=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}H(){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.')}F(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Y(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
427
+ olympe.net.Rh.ALL='*';olympe.net.aw=class{register(){return w(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.P={Da:'net.Manager',Ca:'net.Logger',dj:'net.WebServer',Tv:'net.ServiceWorkerManager',jm:'net.OfflineConfig'};olympe.net.U={vf:'net.httpPort',up:'net.httpBodyLimit',Cr:'net.http2',tp:'net.httpsCertificatesPath',am:'net.localNetworkSuffix',Ri:'offline.enabled',im:'offline.autoBackOnline',nq:'offline.downloadBatchSize'};
428
+ olympe.W.config(function(a){F(a,olympe.net.U.vf,3141);F(a,olympe.net.U.up,100);F(a,olympe.net.U.Cr,!1);F(a,olympe.net.U.tp,null);F(a,olympe.net.U.am,'frontend');F(a,olympe.net.U.Ri,!1);F(a,olympe.net.U.im,!1);F(a,olympe.net.U.nq,20);Xa(a,olympe.net.P.Da);E(a,olympe.net.P.Ca,[olympe.ja.P.Da],b=>b.cd('net'));D(a,olympe.net.P.dj,olympe.net.Rh,olympe.net.P.Ca);D(a,olympe.net.P.Tv,olympe.net.aw);E(a,olympe.net.P.jm,[new olympe.W.pa(olympe.net.U.Ri),new olympe.W.pa(olympe.net.U.im)],(b,c)=>new Map([['offlineEnabled',
429
+ b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Va.node.host={};olympe.Va.node.host.Od=function(a,b){this.G=b};olympe.Va.node.host.Od.prototype.constructor=olympe.Va.node.host.Od;olympe.Va.node.host.Od.prototype.destroy=function(){};olympe.Va.node.host.Od.prototype.destroy=olympe.Va.node.host.Od.prototype.destroy;olympe.Va.node.host.Od.prototype.$a=function(){return this.G};olympe.Va.node.host.Od.xa=[olympe.host.Je.Od];olympe.Va.node.host.fq=class{constructor(a){this.G=a}};olympe.Va.node.host.fq.xa=[olympe.host.Xt];olympe.Va.node.host.Ad=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.eq.register(olympe.host.Je.cq.Dr,olympe.Va.node.host.Ad);olympe.Va.node.host.Ad.xa=[olympe.host.Je.Ad];olympe.Va.node.host.Ck=class{constructor(a){this.G=a}j(){return olympe.C.ea.D}D(){return!0}};olympe.Va.node.host.Ck.xa=[olympe.host.Ck];function Lc(a){a.da.F('readinessProbe','/readiness',[olympe.net.va.Nd.GET],()=>Mc(a,a.$)).catch(b=>a.G.error(`Failed to add readiness health check route ${b}`));a.da.F('livenessProbe','/liveness',[olympe.net.va.Nd.GET],()=>Mc(a,a.Y)).catch(b=>a.G.error(`Failed to add liveness health check route ${b}`));a.D(()=>a.da.stop())}
430
+ function Nc(a,b){b=Array.from(b.entries()).map(([c,d])=>olympe.V.Promise.In(d(),a.wa,`Shutdown hook ${c} has timeout`));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 Oc(a){return w(function*(){try{const b=yield Nc(a,a.H),c=yield Nc(a,a.R);if(b||c)throw Error('Failed to gracefully close the backend');}finally{a.H.clear(),a.R.clear()}})}
431
+ function Mc(a,b){const c=olympe.net.va.Vb.Eh,d=olympe.net.va.Vb.Wi;b=Array.from(b.values()).map(e=>e.apply(a));return 0===b.length?Promise.resolve(new olympe.net.ld('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.ld(g,f?d:c,f?'Some services are not working':'Everything is OK')})}
432
+ olympe.Va.node.host.Ee=class extends olympe.host.Ee{constructor(a,b,c,d=!0){super();this.G=a;this.da=b;this.wa=c;this.Y=new Map;this.$=new Map;this.H=new Map;this.R=new Map;d&&Lc(this)}j(a,b=olympe.V.Kf(),c=olympe.host.Ee.j.ALL){switch(c){case olympe.host.Ee.j.LIVENESS:this.Y.set(b,a);break;case olympe.host.Ee.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)}D(a,b=olympe.V.Kf()){this.H.set(b,a);return b}ha(a,b=olympe.V.Kf()){this.R.set(b,
433
+ a);return b}N(a){this.H.has(a)?this.H.delete(a):this.R.delete(a)}};olympe.W.config(function(a){F(a,olympe.host.U.yq,!0);F(a,olympe.host.U.gr,1E4);Va(a,olympe.host.P.qp,olympe.Va.node.host.fq,olympe.host.P.Ca);Va(a,olympe.host.P.yk,olympe.Va.node.host.Ck,olympe.host.P.Ca);D(a,olympe.host.P.Ue,olympe.Va.node.host.Ee,olympe.host.P.Ca,olympe.net.P.dj,new olympe.W.pa(olympe.host.U.gr),new olympe.W.pa(olympe.host.U.yq))},'olympe.native.node.host');olympe.W.run([olympe.host.P.Ue],a=>{olympe.Va.node.host.Tk=()=>a});olympe.net.re={};function Ec(a,b,c){const d=olympe.net.va.Vb.lo,e=olympe.net.va.Vb.Wi,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.rj(),body:null!=(k=c.body)?k:void 0,signal:f.signal}).then(l=>l.ok?Pc(l,c.F).catch(n=>new olympe.net.ld(`Error parsing response from ${g} with method ${h}: ${n.message}`,e,'Error handling response')):new olympe.net.ld(`Error fetching data from ${g} with method ${h}`,l.status,l.statusText,l.headers)).catch(l=>'AbortError'===
434
434
  l.name?new olympe.net.ld('',d,'Request canceled'):new olympe.net.ld(`Error connecting to ${g} with method ${h}`,e,'Failed to fetch:'+l.message))}
435
- function Pc(a,b){return w(function*(){switch(b){case olympe.net.wa.ResponseType.il:var c=yield a.blob();break;case olympe.net.wa.ResponseType.Kh: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.fe:c=a.body;break;default:c=yield a.text()}return new olympe.net.ld(c,a.status,a.statusText,a.headers)})}olympe.net.pe.Pt=class{constructor(a){this.G=a;this.j=new Map}};olympe.net.pe.WebSocket=class{constructor(a,b){this.G=b;this.id=a;this.j=null;this.buffer=[];this.N=this.F=this.J=this.R=null}T(){return this.id}open(a){const b=`#${this.id}`,c=this.fa(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));
436
- 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.J&&this.J()});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()||
437
- this.G.j()&&!a.startsWith('ping'))&&this.G.debug(b,'>',a);this.j.send(a);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}`}`);this.j.close(1E3);return}}this.G.debug('Try to force close native websocket, but not open nor connecting')}ba(a){this.R=
438
- a||null}$(a){this.F=a||null}D(a){this.N=a||null}Y(a){this.J=a||null}fa(){}};olympe.net.pe.WebSocket.xa=[olympe.net.WebSocket];olympe.Va.node.net={};olympe.Va.node.net.Vu=class extends olympe.net.Ta{N(){return'NodeJS'}Pf(){return olympe.C.ea.D}D(a){var b=this.F++;a=a.j();this.G.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Va.node.net.Wu(b,this.G);b.open(a);return b}J(){this.G.warn('DOWNLOAD FILE not available with node native implementation. URL:')}};olympe.Va.node.net.Wu=class extends olympe.net.pe.WebSocket{fa(a){return new (require('ws'))(a)}};olympe.Va.node.net.U={rD:'native.html.net.useWorkers'};olympe.W.config(function(a){a.getParameter(olympe.net.U.Li)&&Ua(a,olympe.net.U.Li,!1);Va(a,olympe.net.P.Da,olympe.Va.node.net.Vu,olympe.net.P.Ca,olympe.host.P.Da)},'olympe.native.node.net');olympe.Va.node.net.http={};const Qc=require('fastify'),{Readable:Rc}=require('stream'),Sc={qk:0,pk:1,um:2},Tc=olympe.net.wa.Md.hq,Uc=olympe.net.wa.Headers.Rs,Vc=olympe.net.wa.Headers.Ps,Wc=olympe.net.wa.Headers.Qs,Xc=olympe.net.wa.Tb.Ah;
439
- function Yc(a,b){const c=b.methods,d=b.sy,e=b.headers,f=b.origin;a.D.route({bodyLimit:a.$<<20,url:b.path,method:[...c,Tc],handler:(g,h)=>{a.G.debug('Incoming request:','hostname:',g.hostname,'headers:',g.headers);var k=g.method;const l={[Uc]:f,[Wc]:c,[Vc]:e};if(k===Tc)return a.G.debug('< HTTP: OPTIONS'),h.code(Xc).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=
440
- new olympe.net.Ai(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,u]of Object.entries(g.headers))k.headers[t]=u;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 u=t.Hc(),x=t.getData();(x instanceof Uint8Array||x instanceof ArrayBuffer||x instanceof Rc)&&h.type(olympe.net.wa.ul.fe);if(u>=olympe.net.wa.Tb.Pi)throw Error(x);u>=olympe.net.wa.Tb.gl?a.G.warn('> HTTP: client bad request: reply with error:',
441
- x):a.G.debug('> HTTP: reply with body:',Buffer.isBuffer(x)?'binary':x);return h.code(u).headers(Object.assign(l,t.kj())).send(x)}).catch(t=>{a.G.error('> HTTP: reply with internal server error:',t);return h.code(olympe.net.wa.Tb.Pi).headers(Object.assign(l,{[olympe.net.wa.Headers.oi]:'text/plain'})).send('Internal server error')})}})}
442
- olympe.Va.node.net.http.Nh=class extends olympe.net.Nh{constructor(a,b,c,d,e){super(a);this.$=c;this.port=b;this.ba=d;this.R=e;this.D=this.createServer();this.N=new Map;this.j=Sc.qk;this.hd=new Set;this.timer=null}F(a,b,c,d){const e=olympe.net.Nh.ALL;this.N.set(a,{path:b,methods:c,sy:d,headers:e,origin:e});return this.J()}Y(a){const b=this;return w(function*(){b.N.delete(a);return 0<b.N.size?b.J():b.stop()})}start(){if(this.j===Sc.qk)return this.J();if(this.j===Sc.pk){for(const a of this.N.values())Yc(this,
443
- a);return this.D.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.j=Sc.um;this.G.debug('Web server listening on '+a);this.hd.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.hd.forEach(b=>b(a))}).finally(()=>this.hd.clear())}return Promise.reject('Try to start a webservice already started')}J(){return this.j===Sc.pk?(new Promise((a,b)=>{this.hd.add(c=>c?b(c):a())})).then(()=>this.J()):new Promise((a,b)=>{this.hd.add(c=>c?b(c):a());this.dj(()=>{const c=this;return w(function*(){c.j=Sc.pk;
444
- yield c.D.close();c.D=c.createServer();yield c.start()})})})}stop(){return this.j===Sc.um?this.D.close().then(()=>{this.j=Sc.qk}):Promise.resolve()}createServer(){var a=olympe.ja.yb.j.zr,b=this.G.J();a={logger:{level:olympe.ja.yb.D[b===olympe.ja.yb.j.Uj?a:b].toLowerCase()},http2:this.ba};if('string'===typeof this.R){b=require('fs');const c=require('path');Object.assign(a,{https:{allowHTTP1:!0,key:b.readFileSync(c.join(this.R,'key.pem')),cert:b.readFileSync(c.join(this.R,'cert.pem'))}})}a=Qc(a);a.addContentTypeParser('*',
445
- {parseAs:'buffer'},(c,d,e)=>{e(null,d)});return a}dj(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.W.config(function(a){D(a,olympe.net.P.Xi,olympe.Va.node.net.http.Nh,olympe.net.P.Ca,new olympe.W.pa(olympe.net.U.rf),new olympe.W.pa(olympe.net.U.op),new olympe.W.pa(olympe.net.U.vr),new olympe.W.pa(olympe.net.U.np))},'olympe.native.node.net.http');olympe.Va.node.V={};const Zc=require('stream').Readable,$c=require('buffer');
446
- olympe.Va.node.V.ll=class extends olympe.V.ll{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')}J(a){const b=this,c=()=>super.J;return w(function*(){if(a instanceof Zc){const d=[];for(const e=fa(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(()=>$c.resolveObjectURL(a)).catch(b=>
447
- {throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.W.config(function(a){Va(a,olympe.V.P.qg,olympe.Va.node.V.ll)},'olympe.native.node.utils');olympe.async={};function bd(a,b){a.J||a.Y.push(a.F.F(b))}
448
- olympe.async.No=class{constructor(a,b=void 0===a){this.D=[];this.Y=[];this.F=a||new olympe.C.Xb('Async executor context');this.fa=b;this.j=null;this.env=new Map;this.env.set('Executor',this);this.J=this.N=!1;this.G=null;this.timer=this.timeout=0;this.$=olympe.V.Ic()}Cn(a){0<=a&&(this.timeout=a);return this}ab(){return this.G}add(a){this.J||this.D.push(this.F.F(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)},
449
- 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.fa&&this.F.destroy()}complete(a){this.F.Qf(this.$);if(!this.J){this.J=!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}};
450
- function cd(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(()=>{cd(a)})},c=>{c&&(a.j=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.Qv=class extends olympe.async.No{static create(){return new olympe.async.Qv(new olympe.C.Xb('SequencedExecutor'),!0)}start(){this.N||(super.start(),cd(this))}};
451
- olympe.async.fk=class extends olympe.async.No{constructor(a,b){super(a,b);this.R=0;this.ba=!0}static create(){return new olympe.async.fk(new olympe.C.Xb('ParallelExecutor'),!0)}run(a){this.G&&this.G.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.ba=!1;b&&(this.j=this.j?`${this.j}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.N&&!this.J&&(this.R++,this.run(a));return this}done(){this.R--;0>=this.R&&this.complete(this.ba)}start(){if(!this.N)if(super.start(),
452
- 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.Cu=class{D(){return w(function*(){})}Y(){}N(){}F(){}R(){}forEach(){}has(){}get(){}set(){}remove(){}ba(){}$(){}clear(){}J(){}};olympe.Db.Du=class{D(){}};olympe.Db.Storage=class{open(){}write(){}close(){}};olympe.Db.Mu=class{get(){return null}set(){return this}delete(){}};olympe.Db.P={Vj:'localStorage.KeyValueDatabaseManager',Qi:'localStorage.Storage',bA:'localStorage.DatacloudStorage',Wl:'localStorage.LocalStorage',Ca:'localStorage.Logger',Og:'localStorage.prefix'};olympe.W.config(function(a){Xa(a,olympe.Db.P.Vj);E(a,olympe.Db.P.Og,[],()=>'olympe');E(a,olympe.Db.P.Ca,[olympe.ja.P.Da],b=>b.cd('localstorage'));D(a,olympe.Db.P.Wl,olympe.Db.Mu)},'olympe.localstorage');olympe.L={};olympe.L.errors={};olympe.L.errors.Fo=class extends Error{};olympe.L.errors.mq=class extends Error{};olympe.L.errors.bq=class extends Error{};olympe.L.errors.wk=class extends Error{};olympe.L.errors.no=class extends Error{};olympe.L.errors.Pq=class extends Error{};olympe.L.errors.pq=class extends Error{};olympe.L.errors.kw=class extends Error{};olympe.L.errors.xm=class extends Error{constructor(a,b){super(a);this.id=b}T(){return this.id}};olympe.L.errors.Ji=class extends olympe.L.errors.xm{};
453
- olympe.L.errors.Yn=class extends olympe.L.errors.xm{};olympe.L.errors.jp=class extends olympe.L.errors.xm{};olympe.L.Yb={Pj:'urls.FileSvc',Qn:'urls.BackupSvc',Gq:'urls.RestoreBackupSvc',yg:'urls.GetContext',fp:'urls.GraphDef',$n:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',ur:'urls.UserTagFromToken',jw:'urls.UserNameFromTag',iw:'urls.UserRoles',yv:'urls.RoleMembers',Zj:'urls.OpenIDSvc'};
454
- olympe.W.config(a=>{F(a,olympe.L.Yb.Pj,'rest/filesvc');F(a,olympe.L.Yb.Qn,'rest/backupsvc');F(a,olympe.L.Yb.Gq,'rest/backupsvc/restore');F(a,olympe.L.Yb.Zj,'rest/openid');F(a,olympe.L.Yb.yg,'rest/initialData');F(a,olympe.L.Yb.fp,'rest/querysvc/graphDef');F(a,olympe.L.Yb.$n,'rest/querysvc/graphDef/static');F(a,olympe.L.Yb.TRANSACTION,'rest/transaction');F(a,olympe.L.Yb.ur,'rest/token');F(a,olympe.L.Yb.jw,'rest/authorization/getUserTag');F(a,olympe.L.Yb.iw,'rest/authorization/getUserRoles');F(a,olympe.L.Yb.yv,
455
- 'rest/authorization/roleMembers')});function dd(a){Ic(a.D,()=>{ed(a)});Kc(a.D,()=>{a.$=!0});Jc(a.D,()=>{fd(a).then(()=>{a.$=!1;gd(a)}).catch(b=>{a.G.error(`An error occurred while trying to subscribe to "response topic" on the bus. Close connection: ${b}`);a.D.end()})})}function hd(a){return id(a.Eb)&&Fc(a.D)}
456
- function jd(a,b,c){return w(function*(){hd(a)||(yield a.connect());a.G.debug(`Bus: Subscribe to ${b}`);a.ba.set(b,c);yield a.D.subscribe(a.fa+b,d=>{a.G.j()&&a.G.debug(`BUS < #${b}:`,JSON.stringify(d));let e=null;try{if(kd(a,d.seq,'consumed'),e=olympe.L.sk.D(d,a.$a,f=>ld(a,d.src,f).stream),kd(a,e.de.toString(),'deserialized',(new Map).set('source',e.sb()).set('messageType',e.getType().toString())),e.getType()===olympe.L.cb.j.fe){md(a,e);return}}catch(f){a.G.error(`An error occurred while trying to deserialize the request: ${JSON.stringify(d)} with error ${f}`)}null!==
435
+ function Pc(a,b){return w(function*(){switch(b){case olympe.net.va.ResponseType.pl:var c=yield a.blob();break;case olympe.net.va.ResponseType.Oh:c=yield a.arrayBuffer();c=new Uint8Array(c,0,c.byteLength);break;case olympe.net.va.ResponseType.JSON:c=yield a.json();break;case olympe.net.va.ResponseType.ge:c=a.body;break;default:c=yield a.text()}return new olympe.net.ld(c,a.status,a.statusText,a.headers)})}olympe.net.re.Yt=class{constructor(a){this.G=a;this.j=new Map}};olympe.net.re.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.ha(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));
436
+ 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()||
437
+ this.G.j()&&!a.startsWith('ping'))&&this.G.debug(b,'>',a);this.j.send(a);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}`}`);this.j.close(1E3);return}}this.G.debug('Try to force close native websocket, but not open nor connecting')}da(a){this.R=
438
+ a||null}$(a){this.F=a||null}D(a){this.N=a||null}Y(a){this.H=a||null}ha(){}};olympe.net.re.WebSocket.xa=[olympe.net.WebSocket];olympe.Va.node.net={};olympe.Va.node.net.ev=class extends olympe.net.Ta{N(){return'NodeJS'}Sf(){return olympe.C.ea.D}D(a){var b=this.F++;a=a.j();this.G.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Va.node.net.fv(b,this.G);b.open(a);return b}H(){this.G.warn('DOWNLOAD FILE not available with node native implementation. URL:')}};olympe.Va.node.net.fv=class extends olympe.net.re.WebSocket{ha(a){return new (require('ws'))(a)}};olympe.Va.node.net.U={zD:'native.html.net.useWorkers'};olympe.W.config(function(a){a.getParameter(olympe.net.U.Ri)&&Ua(a,olympe.net.U.Ri,!1);Va(a,olympe.net.P.Da,olympe.Va.node.net.ev,olympe.net.P.Ca,olympe.host.P.Da)},'olympe.native.node.net');olympe.Va.node.net.http={};const Qc=require('fastify'),{Readable:Rc}=require('stream'),Sc={xk:0,wk:1,zm:2},Tc=olympe.net.va.Nd.oq,Uc=olympe.net.va.Headers.$s,Vc=olympe.net.va.Headers.Ys,Wc=olympe.net.va.Headers.Zs,Xc=olympe.net.va.Vb.Eh;
439
+ function Yc(a,b){const c=b.methods,d=b.Cy,e=b.headers,f=b.origin;a.D.route({bodyLimit:a.$<<20,url:b.path,method:[...c,Tc],handler:(g,h)=>{a.G.debug('Incoming request:','hostname:',g.hostname,'headers:',g.headers);var k=g.method;const l={[Uc]:f,[Wc]:c,[Vc]:e};if(k===Tc)return a.G.debug('< HTTP: OPTIONS'),h.code(Xc).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=
440
+ new olympe.net.Gi(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,u]of Object.entries(g.headers))k.headers[t]=u;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 u=t.Hc(),x=t.getData();(x instanceof Uint8Array||x instanceof ArrayBuffer||x instanceof Rc)&&h.type(olympe.net.va.Al.ge);if(u>=olympe.net.va.Vb.Wi)throw Error(x);u>=olympe.net.va.Vb.nl?a.G.warn('> HTTP: client bad request: reply with error:',
441
+ x):a.G.debug('> HTTP: reply with body:',Buffer.isBuffer(x)?'binary':x);return h.code(u).headers(Object.assign(l,t.rj())).send(x)}).catch(t=>{a.G.error('> HTTP: reply with internal server error:',t);return h.code(olympe.net.va.Vb.Wi).headers(Object.assign(l,{[olympe.net.va.Headers.xi]:'text/plain'})).send('Internal server error')})}})}
442
+ olympe.Va.node.net.http.Rh=class extends olympe.net.Rh{constructor(a,b,c,d,e){super(a);this.$=c;this.port=b;this.da=d;this.R=e;this.D=this.createServer();this.N=new Map;this.j=Sc.xk;this.hd=new Set;this.timer=null}F(a,b,c,d){const e=olympe.net.Rh.ALL;this.N.set(a,{path:b,methods:c,Cy:d,headers:e,origin:e});return this.H()}Y(a){const b=this;return w(function*(){b.N.delete(a);return 0<b.N.size?b.H():b.stop()})}start(){if(this.j===Sc.xk)return this.H();if(this.j===Sc.wk){for(const a of this.N.values())Yc(this,
443
+ a);return this.D.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.j=Sc.zm;this.G.debug('Web server listening on '+a);this.hd.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.hd.forEach(b=>b(a))}).finally(()=>this.hd.clear())}return Promise.reject('Try to start a webservice already started')}H(){return this.j===Sc.wk?(new Promise((a,b)=>{this.hd.add(c=>c?b(c):a())})).then(()=>this.H()):new Promise((a,b)=>{this.hd.add(c=>c?b(c):a());this.kj(()=>{const c=this;return w(function*(){c.j=Sc.wk;
444
+ yield c.D.close();c.D=c.createServer();yield c.start()})})})}stop(){return this.j===Sc.zm?this.D.close().then(()=>{this.j=Sc.xk}):Promise.resolve()}createServer(){var a=olympe.ja.yb.j.Gr,b=this.G.H();a={logger:{level:olympe.ja.yb.D[b===olympe.ja.yb.j.ak?a:b].toLowerCase()},http2:this.da};if('string'===typeof this.R){b=require('fs');const c=require('path');Object.assign(a,{https:{allowHTTP1:!0,key:b.readFileSync(c.join(this.R,'key.pem')),cert:b.readFileSync(c.join(this.R,'cert.pem'))}})}a=Qc(a);a.addContentTypeParser('*',
445
+ {parseAs:'buffer'},(c,d,e)=>{e(null,d)});return a}kj(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.W.config(function(a){D(a,olympe.net.P.dj,olympe.Va.node.net.http.Rh,olympe.net.P.Ca,new olympe.W.pa(olympe.net.U.vf),new olympe.W.pa(olympe.net.U.up),new olympe.W.pa(olympe.net.U.Cr),new olympe.W.pa(olympe.net.U.tp))},'olympe.native.node.net.http');olympe.Va.node.V={};const $c=require('stream').Readable,ad=require('buffer');
446
+ olympe.Va.node.V.sl=class extends olympe.V.sl{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 w(function*(){if(a instanceof $c){const d=[];for(const e=fa(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(()=>ad.resolveObjectURL(a)).catch(b=>
447
+ {throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.W.config(function(a){Va(a,olympe.V.P.vg,olympe.Va.node.V.sl)},'olympe.native.node.utils');olympe.async={};function bd(a,b){a.H||a.Y.push(a.F.rc(b))}
448
+ olympe.async.To=class{constructor(a,b=void 0===a){this.D=[];this.Y=[];this.F=a||new olympe.C.Xb('Async executor context');this.ha=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.Ic()}In(a){0<=a&&(this.timeout=a);return this}$a(){return this.G}add(a){this.H||this.D.push(this.F.rc(a));return this}start(){this.N||(this.G&&this.G.log('Executor started.'),this.N=!0,this.F.onDestroy(()=>{this.j='Context destroyed.';this.complete(!1)},
449
+ 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.ha&&this.F.destroy()}complete(a){this.F.Tf(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}};
450
+ function cd(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(()=>{cd(a)})},c=>{c&&(a.j=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.$v=class extends olympe.async.To{static create(){return new olympe.async.$v(new olympe.C.Xb('SequencedExecutor'),!0)}start(){this.N||(super.start(),cd(this))}};
451
+ olympe.async.mk=class extends olympe.async.To{constructor(a,b){super(a,b);this.R=0;this.da=!0}static create(){return new olympe.async.mk(new olympe.C.Xb('ParallelExecutor'),!0)}run(a){this.G&&this.G.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.da=!1;b&&(this.j=this.j?`${this.j}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.N&&!this.H&&(this.R++,this.run(a));return this}done(){this.R--;0>=this.R&&this.complete(this.da)}start(){if(!this.N)if(super.start(),
452
+ 0<this.D.length){this.R=this.D.length;for(const a of this.D)this.run(a)}else this.complete(!0)}};olympe.Eb={};olympe.Eb.Lu=class{D(){return w(function*(){})}Y(){}N(){}F(){}R(){}forEach(){}has(){}get(){}set(){}remove(){}da(){}$(){}clear(){}H(){}};olympe.Eb.Mu=class{D(){}};olympe.Eb.Storage=class{open(){}write(){}close(){}};olympe.Eb.Vu=class{get(){return null}set(){return this}delete(){}};olympe.Eb.P={bk:'localStorage.KeyValueDatabaseManager',Xi:'localStorage.Storage',lA:'localStorage.DatacloudStorage',bm:'localStorage.LocalStorage',Ca:'localStorage.Logger',Sg:'localStorage.prefix'};olympe.W.config(function(a){Xa(a,olympe.Eb.P.bk);E(a,olympe.Eb.P.Sg,[],()=>'olympe');E(a,olympe.Eb.P.Ca,[olympe.ja.P.Da],b=>b.cd('localstorage'));D(a,olympe.Eb.P.bm,olympe.Eb.Vu)},'olympe.localstorage');olympe.L={};olympe.L.errors={};olympe.L.errors.Lo=class extends Error{};olympe.L.errors.tq=class extends Error{};olympe.L.errors.jq=class extends Error{};olympe.L.errors.Dk=class extends Error{};olympe.L.errors.uo=class extends Error{};olympe.L.errors.Wq=class extends Error{};olympe.L.errors.wq=class extends Error{};olympe.L.errors.uw=class extends Error{};olympe.L.errors.Cm=class extends Error{constructor(a,b){super(a);this.id=b}T(){return this.id}};olympe.L.errors.Pi=class extends olympe.L.errors.Cm{};
453
+ olympe.L.errors.eo=class extends olympe.L.errors.Cm{};olympe.L.errors.pp=class extends olympe.L.errors.Cm{};olympe.L.Yb={Wj:'urls.FileSvc',Wn:'urls.BackupSvc',Nq:'urls.RestoreBackupSvc',Cg:'urls.GetContext',lp:'urls.GraphDef',ho:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',Br:'urls.UserTagFromToken',tw:'urls.UserNameFromTag',sw:'urls.UserRoles',Iv:'urls.RoleMembers',fk:'urls.OpenIDSvc'};
454
+ olympe.W.config(a=>{F(a,olympe.L.Yb.Wj,'rest/filesvc');F(a,olympe.L.Yb.Wn,'rest/backupsvc');F(a,olympe.L.Yb.Nq,'rest/backupsvc/restore');F(a,olympe.L.Yb.fk,'rest/openid');F(a,olympe.L.Yb.Cg,'rest/initialData');F(a,olympe.L.Yb.lp,'rest/querysvc/graphDef');F(a,olympe.L.Yb.ho,'rest/querysvc/graphDef/static');F(a,olympe.L.Yb.TRANSACTION,'rest/transaction');F(a,olympe.L.Yb.Br,'rest/token');F(a,olympe.L.Yb.tw,'rest/authorization/getUserTag');F(a,olympe.L.Yb.sw,'rest/authorization/getUserRoles');F(a,olympe.L.Yb.Iv,
455
+ 'rest/authorization/roleMembers')});function dd(a){Ic(a.D,()=>{ed(a)});Kc(a.D,()=>{a.$=!0});Jc(a.D,()=>{fd(a).then(()=>{a.$=!1;gd(a)}).catch(b=>{a.G.error(`An error occurred while trying to subscribe to "response topic" on the bus. Close connection: ${b}`);a.D.end()})})}function hd(a){return id(a.Mb)&&Fc(a.D)}
456
+ function jd(a,b,c){return w(function*(){hd(a)||(yield a.connect());a.G.debug(`Bus: Subscribe to ${b}`);a.da.set(b,c);yield a.D.subscribe(a.ha+b,d=>{a.G.j()&&a.G.debug(`BUS < #${b}:`,JSON.stringify(d));let e=null;try{if(kd(a,d.seq,'consumed'),e=olympe.L.zk.D(d,a.cb,f=>ld(a,d.src,f).stream),kd(a,e.ee.toString(),'deserialized',(new Map).set('source',e.sb()).set('messageType',e.getType().toString())),e.getType()===olympe.L.bb.j.ge){md(a,e);return}}catch(f){a.G.error(`An error occurred while trying to deserialize the request: ${JSON.stringify(d)} with error ${f}`)}null!==
457
457
  e&&c(e)})})}function ed(a){a.G.info('Disconnected from bus');let b;null==(b=a.j)||b.forEach((c,d)=>{null!==c.D&&(a.G.info(`Disconnected from bus: pause keep alive of ${c.j.size} subscriptions for ${d} service.`),nd(c))})}
458
- function fd(a){a.G.debug('Connection to bus established. Listening to responses on topic',a.J);return a.D.subscribe(a.J,b=>{a.G.j()&&a.G.debug('BUS <',JSON.stringify(b));kd(a,b.seq,'consumed');const c=olympe.L.cb.D(b,a.$a,d=>ld(a,b.src,d).stream);kd(a,c.de.toString(),'deserialized',(new Map).set('source',c.sb()).set('messageType',c.getType().toString()));if(c.getType()===olympe.L.cb.j.fe)md(a,c);else{let d;null==(d=a.F.get(c.de))||d(c)}})}
459
- function gd(a){a.G.debug(`Connected to bus: subscribe to ${a.ba.size} active topics.`);a.ba.forEach((c,d)=>{jd(a,d,c).catch(e=>{a.G.error(`Failed to subscribe topic after connecting to the bus, with error: ${e}`)})});let b;null==(b=a.j)||b.forEach((c,d)=>{null===c.D&&(a.G.debug(`Connected to bus: start keep alive of ${c.j.size} subscriptions for ${d} service.`),od(c,!0))});a.R.forEach(c=>c(null));a.R=[]}
460
- function pd(a){a.$b=a.Ga.j(()=>hd(a)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}function kd(a,b,c,d=new Map){a.Ub.j&&mb(a.Ub,'com',d.set('id',`${b}`).set('channel','bus').set('eventType',c))}function ld(a,b,c){const d=`${b}:${c}`;b=a.ua.get(d);b||(b=new olympe.L.oq(()=>a.ua.delete(d)),a.ua.set(d,b));return b}
461
- function md(a,b){const c=olympe.L.Fe.ug,d=olympe.L.Fe.Yf,e=olympe.L.Fe.zb,f=b.j,{id:g,e:h}=f,k=`${b.sb()}:${g}`,l=ld(a,b.sb(),g);if(h===c){fb(a.ua.j,k);const {i:n,c:p}=f;l.write(p,n).catch(q=>{l.throw(q)})}else h===d?l.complete(f.s):h===e&&l.throw(Error(`Received stream error: ${f.reason}`))}function qd(a,b,c,d){const e=rd(a.N).Bd();a.Y++;return new olympe.L.sk(b,a.J,e,a.Y,c,d)}
462
- function sd(a,b,c,d){const e=b.de;let f=null;f=setTimeout(()=>td(a,e),a.Kc);a.F.set(e,g=>{f&&clearTimeout(f);g.getType()===olympe.L.cb.j.al?f=setTimeout(()=>td(a,e),d):(a.F.delete(e),c(g))})}function td(a,b){const c=a.F.get(b);a.F.delete(b);null==c||c(new olympe.L.cb(a.J,a.J,b,olympe.L.cb.j.zb,{reason:'Timeout'}))}function ud(a,b){a.Y++;const c=a.Y,d=setTimeout(()=>td(a,c),a.Kc);a.F.set(c,e=>{a.F.delete(c);clearTimeout(d);b(e)});return a.Y}
463
- function vd(a,b){return w(function*(){let c;const d=null==(c=a.j)?void 0:c.get(b);d&&(nd(d),a.j.delete(b));a.ba.delete(b);a.G.debug(`Bus: Unsubscribe to ${b}`);hd(a)&&(yield Hc(a.D,a.fa+b))})}function wd(a,b,c,d,e){null===a.j&&(a.j=new Map);let f=a.j.get(b);f?(a=f,a.F!==d&&(a.F=d,null!==a.D&&(nd(a),od(a,!1)))):(f=new olympe.L.Vv(a.G,a,b,d),a.j.set(b,f));d=f;d.j.set(c,e);1===d.j.size&&od(d,!1)}
464
- function xd(a,b,c){var d;const e=null==(d=a.j)?void 0:d.get(b);if(null==e?0:yd(e,c))d=olympe.L.cb.j.Cm,hd(a)&&a.publish(qd(a,b,d,c)).catch(f=>a.G.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.j.size&&(a.j.delete(b),0===a.j.size&&(a.j=null))}function zd(a,b){return new Promise((c,d)=>{a.N.dh(b.me(),(e,f)=>{e?d(e):c(f)})})}
465
- olympe.L.Zn=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.Eb=c;this.N=d;this.Ga=e;this.$a=f;this.Ub=g;this.F=new Map;this.Kc=h.get('shortTimeout');this.Ec=h.get('requestTimeout');this.$c=h.get('subscriptionsRefreshRate');this.Bb=h.get('allowGuest');a=h.get('connection');b=this.N.j.rb().asObservable();c=c.Pf().asObservable();c=rxjs.combineLatest([a,b,c]).pipe(rxjs.operators.map(([k,l,n])=>n.valueOf()?Object.assign({},k,{username:l.Bc(),password:l.Bd()}):null));this.D=new olympe.net.uf(c);dd(this);
466
- this.fa='';h.get('topicPrefix').subscribe(k=>{this.G.debug(`Bus: new topic prefix: ${k}`);const l=this.fa;this.fa=k;if(hd(this)){this.G.debug(`Resubscribe to queues with new topic prefix: ${k}`);Promise.all(Array.from(this.ba).map(([p,q])=>{const r=this;return w(function*(){yield jd(r,p,q);yield Hc(r.D,l+p)})})).catch(p=>this.G.error(`Failed to subscribe topics after changing the topic prefix: ${p}`));let n;null==(n=this.j)||n.forEach(p=>{Ad(p)})}});this.Wd=this.Y=0;this.J=olympe.V.Ic();this.j=null;
467
- this.$=!1;this.R=[];this.ba=new Map;this.ua=new olympe.V.Jh(this.Ec);this.rc=this.$b='';this.fb=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.R.forEach(e=>e(d));this.R=[]};hd(this)?a():this.$||this.fb?this.R.push(d=>d?b(d):a()):id(this.Eb)?(this.fb=!0,olympe.C.zs([this.N.Sk()],d=>{pd(this);this.fb=!1;d.valueOf()||this.Bb?(this.Bb||Bd(this.N,()=>this.disconnect().then()),this.$=!0,this.R.push(e=>e?b(e):a()),this.D.connect(),this.rc=this.Ga.fa(()=>this.disconnect(),'Bus websocket')):
468
- 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(){return new Promise(a=>{this.G.debug('Disconnecting from bus');this.N.ba.delete('busLogoutCallback');this.Ga.F(this.$b);this.Ga.N(this.rc);this.D.end(!1,()=>a())})}publish(a,b=!1){const c=this;return w(function*(){if(!c.$||a.getType()!==olympe.L.cb.j.we){hd(c)||(yield c.connect());var d=b?a.jc():c.fa+
469
- a.jc();try{kd(c,a.de.toString(),'serialize');var e=a.ga(c.$a,c.Vd.bind(c,a));c.G.j()&&c.G.debug(`BUS > #${d}:`,JSON.stringify(e))}catch(f){throw Error(`An error occurred while serializing the message (seqId=${a.de}): ${f}`);}yield c.D.publish(d,e);kd(c,a.de.toString(),'publish',(new Map).set('destination',a.jc()).set('messageType',a.getType().toString()))}})}Vd(a,b){const c=this.Wd++;(()=>{const d=this;return w(function*(){const e=l=>d.publish(new olympe.L.cb(a.jc(),a.sb(),a.de,olympe.L.cb.j.fe,l)),
470
- f=olympe.L.Fe.ug,g=olympe.L.Fe.Yf,h=olympe.L.Fe.zb;let k=0;try{for(const l=fa(b);;){const n=yield l.next();if(n.done)break;const p=n.value;yield e({id:c,i:k++,e:f,c:p})}yield e({id:c,s:k,e:g})}catch(l){yield e({id:c,e:h,reason:`Error to complete the stream: ${l}`})}})})();return c}vd(a,b,c){return this.send(a.de,a.sb(),b,c,!0)}send(a,b,c,d,e){return this.publish(new olympe.L.cb(b,this.J,a,c,d),e)}request(a,b,c,d){const e=qd(this,a,b,c);c=olympe.L.cb.j.al;if(b===olympe.L.cb.j.PUBLISH){const f=new olympe.L.cb(a,
471
- this.J,e.de,c);return this.publish(e).then(()=>f)}return new Promise((f,g)=>{sd(this,e,f,null!=d?d:this.Ec);this.publish(e).catch(g)})}};olympe.L.Zn.j='Timeout';const Cd=olympe.net.wa.Headers.Pn,Dd=olympe.net.wa.Tb.Ah,Ed=olympe.net.wa.Tb.ho,Fd=olympe.net.wa.Tb.yj,Gd=olympe.net.wa.Tb.Fv,Hd=olympe.net.wa.Tb.eo,Id=olympe.net.wa.Tb.So,Jd=olympe.net.wa.Tb.dw,Kd=olympe.net.wa.Tb.$l;function Ld(a,b){let c;return null!=(c=a.F.get(b))?c:''}function Md(a,b,c,d=new Map){a.j.j&&mb(a.j,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
472
- function Nd(a,b,c){if(null===b)return Promise.reject('No http request to send');Ac(b,{[Cd]: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}`)}Md(a,e,'request',(new Map).set('destination',b.j()).set('messageType',b.method.toString()));return Dc(a.J,b).then(f=>{Md(a,e,'reply');switch(f.Hc()){case Dd:case Ed:case Fd:var g=f.getData();a.G.j()&&a.G.debug('HTTP <',f.Hc(),`content: ${'string'===
473
- typeof g?g:typeof g}`);return f;case Gd:throw f=`HTTP < Service provider for http request to ${b.j()} is overloaded, retry later`,a.G.warn(f),new olympe.L.errors.pq(f);case Hd:return a.G.debug(`HTTP < request canceled (${b.j()}).`),f;case Id:case Jd:throw f=`HTTP < request authorization denied: ${b.j()}`,a.G.error(f),new olympe.L.errors.kw(f);case Kd:throw f=`HTTP < requested resource not found: ${b.j()}`,a.G.error(f),new olympe.L.errors.bq(f);default:g=`HTTP < Error: ${f.Hc()}, ${f.statusText}`;
474
- a.G.error(g);if(500===f.Hc()&&'Connection refused'===f.statusText)throw new olympe.L.errors.no(g);throw Error(g);}})}).pipe(nb(olympe.L.errors.pq,(e,f)=>{a.G.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.N)))}olympe.L.Mt=class{constructor(a,b,c,d,e){this.G=a;this.J=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.j!==b)switch(a.G.debug('State change '+a.j+' --\x3e '+b),a.j=b,a.Eb.forEach(c=>c(b)),b){case olympe.L.Na.j.zk:case olympe.L.Na.j.CONNECTING:case olympe.L.Na.j.Ao:break;case olympe.L.Na.j.rg:a.connected.update(olympe.C.ea.D);break;case olympe.L.Na.j.Ig:a.J=[0,0,a.J[2]];Od(a);break;case olympe.L.Na.j.zb:let c;a.G.error('Connection to server',null==(c=a.R)?void 0:c.j(),'aborted due to error');a.connected.update(olympe.C.ea.j);break;case olympe.L.Na.j.Kn:Od(a);break;case olympe.L.Na.j.Td:a.connected.update(olympe.C.ea.j);
458
+ function fd(a){a.G.debug('Connection to bus established. Listening to responses on topic',a.H);return a.D.subscribe(a.H,b=>{a.G.j()&&a.G.debug('BUS <',JSON.stringify(b));kd(a,b.seq,'consumed');const c=olympe.L.bb.D(b,a.cb,d=>ld(a,b.src,d).stream);kd(a,c.ee.toString(),'deserialized',(new Map).set('source',c.sb()).set('messageType',c.getType().toString()));if(c.getType()===olympe.L.bb.j.ge)md(a,c);else{let d;null==(d=a.F.get(c.ee))||d(c)}})}
459
+ function gd(a){a.G.debug(`Connected to bus: subscribe to ${a.da.size} active topics.`);a.da.forEach((c,d)=>{jd(a,d,c).catch(e=>{a.G.error(`Failed to subscribe topic after connecting to the bus, with error: ${e}`)})});let b;null==(b=a.j)||b.forEach((c,d)=>{null===c.D&&(a.G.debug(`Connected to bus: start keep alive of ${c.j.size} subscriptions for ${d} service.`),od(c,!0))});a.R.forEach(c=>c(null));a.R=[]}
460
+ function pd(a){a.zc=a.Ha.j(()=>hd(a)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}function kd(a,b,c,d=new Map){a.vc.j&&mb(a.vc,'com',d.set('id',`${b}`).set('channel','bus').set('eventType',c))}function ld(a,b,c){const d=`${b}:${c}`;b=a.wa.get(d);b||(b=new olympe.L.vq(()=>a.wa.delete(d)),a.wa.set(d,b));return b}
461
+ function md(a,b){const c=olympe.L.He.zg,d=olympe.L.He.bg,e=olympe.L.He.Ab,f=b.j,{id:g,e:h}=f,k=`${b.sb()}:${g}`,l=ld(a,b.sb(),g);if(h===c){fb(a.wa.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}`))}function qd(a,b,c,d){const e=rd(a.N).Cd();a.Y++;return new olympe.L.zk(b,a.H,e,a.Y,c,d)}
462
+ function sd(a,b,c,d){const e=b.ee;let f=null;f=setTimeout(()=>td(a,e),a.Id);a.F.set(e,g=>{f&&clearTimeout(f);g.getType()===olympe.L.bb.j.hl?f=setTimeout(()=>td(a,e),d):(a.F.delete(e),c(g))})}function td(a,b){const c=a.F.get(b);a.F.delete(b);null==c||c(new olympe.L.bb(a.H,a.H,b,olympe.L.bb.j.Ab,{reason:'Timeout'}))}function ud(a,b){a.Y++;const c=a.Y,d=setTimeout(()=>td(a,c),a.Id);a.F.set(c,e=>{a.F.delete(c);clearTimeout(d);b(e)});return a.Y}
463
+ function vd(a,b){return w(function*(){let c;const d=null==(c=a.j)?void 0:c.get(b);d&&(nd(d),a.j.delete(b));a.da.delete(b);a.G.debug(`Bus: Unsubscribe to ${b}`);hd(a)&&(yield Hc(a.D,a.ha+b))})}function wd(a,b,c,d,e){null===a.j&&(a.j=new Map);let f=a.j.get(b);f?(a=f,a.F!==d&&(a.F=d,null!==a.D&&(nd(a),od(a,!1)))):(f=new olympe.L.ew(a.G,a,b,d),a.j.set(b,f));d=f;d.j.set(c,e);1===d.j.size&&od(d,!1)}
464
+ function xd(a,b,c){var d;const e=null==(d=a.j)?void 0:d.get(b);if(null==e?0:yd(e,c))d=olympe.L.bb.j.Hm,hd(a)&&a.publish(qd(a,b,d,c)).catch(f=>a.G.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.j.size&&(a.j.delete(b),0===a.j.size&&(a.j=null))}function zd(a,b){return new Promise((c,d)=>{a.N.hh(b.oe(),(e,f)=>{e?d(e):c(f)})})}
465
+ olympe.L.fo=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.Mb=c;this.N=d;this.Ha=e;this.cb=f;this.vc=g;this.F=new Map;this.Id=h.get('shortTimeout');this.Bd=h.get('requestTimeout');this.Rd=h.get('subscriptionsRefreshRate');this.zb=h.get('allowGuest');a=h.get('connection');b=this.N.j.rb().asObservable();c=c.Sf().asObservable();c=rxjs.combineLatest([a,b,c]).pipe(rxjs.operators.map(([k,l,n])=>n.valueOf()?Object.assign({},k,{username:l.Cc(),password:l.Cd()}):null));this.D=new olympe.net.yf(c);dd(this);
466
+ this.ha='';h.get('topicPrefix').subscribe(k=>{this.G.debug(`Bus: new topic prefix: ${k}`);const l=this.ha;this.ha=k;if(hd(this)){this.G.debug(`Resubscribe to queues with new topic prefix: ${k}`);Promise.all(Array.from(this.da).map(([p,q])=>{const r=this;return w(function*(){yield jd(r,p,q);yield Hc(r.D,l+p)})})).catch(p=>this.G.error(`Failed to subscribe topics after changing the topic prefix: ${p}`));let n;null==(n=this.j)||n.forEach(p=>{Ad(p)})}});this.af=this.Y=0;this.H=olympe.V.Ic();this.j=null;
467
+ this.$=!1;this.R=[];this.da=new Map;this.wa=new olympe.V.Nh(this.Bd);this.$c=this.zc='';this.jb=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.R.forEach(e=>e(d));this.R=[]};hd(this)?a():this.$||this.jb?this.R.push(d=>d?b(d):a()):id(this.Mb)?(this.jb=!0,olympe.C.Hs([this.N.Zk()],d=>{pd(this);this.jb=!1;d.valueOf()||this.zb?(this.zb||Bd(this.N,()=>this.disconnect().then()),this.$=!0,this.R.push(e=>e?b(e):a()),this.D.connect(),this.$c=this.Ha.ha(()=>this.disconnect(),'Bus websocket')):
468
+ 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(){return new Promise(a=>{this.G.debug('Disconnecting from bus');this.N.da.delete('busLogoutCallback');this.Ha.F(this.zc);this.Ha.N(this.$c);this.D.end(!1,()=>a())})}publish(a,b=!1){const c=this;return w(function*(){if(!c.$||a.getType()!==olympe.L.bb.j.ye){hd(c)||(yield c.connect());var d=b?a.ic():c.ha+
469
+ a.ic();try{kd(c,a.ee.toString(),'serialize');var e=a.ga(c.cb,c.$e.bind(c,a));c.G.j()&&c.G.debug(`BUS > #${d}:`,JSON.stringify(e))}catch(f){throw Error(`An error occurred while serializing the message (seqId=${a.ee}): ${f}`);}yield c.D.publish(d,e);kd(c,a.ee.toString(),'publish',(new Map).set('destination',a.ic()).set('messageType',a.getType().toString()))}})}$e(a,b){const c=this.af++;(()=>{const d=this;return w(function*(){const e=l=>d.publish(new olympe.L.bb(a.ic(),a.sb(),a.ee,olympe.L.bb.j.ge,l)),
470
+ f=olympe.L.He.zg,g=olympe.L.He.bg,h=olympe.L.He.Ab;let k=0;try{for(const l=fa(b);;){const n=yield l.next();if(n.done)break;const p=n.value;yield e({id:c,i:k++,e:f,c:p})}yield e({id:c,s:k,e:g})}catch(l){yield e({id:c,e:h,reason:`Error to complete the stream: ${l}`})}})})();return c}vd(a,b,c){return this.send(a.ee,a.sb(),b,c,!0)}send(a,b,c,d,e){return this.publish(new olympe.L.bb(b,this.H,a,c,d),e)}request(a,b,c,d){const e=qd(this,a,b,c);c=olympe.L.bb.j.hl;if(b===olympe.L.bb.j.PUBLISH){const f=new olympe.L.bb(a,
471
+ this.H,e.ee,c);return this.publish(e).then(()=>f)}return new Promise((f,g)=>{sd(this,e,f,null!=d?d:this.Bd);this.publish(e).catch(g)})}};olympe.L.fo.j='Timeout';const Cd=olympe.net.va.Headers.Vn,Dd=olympe.net.va.Vb.Eh,Ed=olympe.net.va.Vb.no,Fd=olympe.net.va.Vb.Fj,Gd=olympe.net.va.Vb.Pv,Hd=olympe.net.va.Vb.lo,Id=olympe.net.va.Vb.Yo,Jd=olympe.net.va.Vb.nw,Kd=olympe.net.va.Vb.gm;function Ld(a,b){let c;return null!=(c=a.F.get(b))?c:''}function Md(a,b,c,d=new Map){a.j.j&&mb(a.j,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
472
+ function Nd(a,b,c){if(null===b)return Promise.reject('No http request to send');Ac(b,{[Cd]: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}`)}Md(a,e,'request',(new Map).set('destination',b.j()).set('messageType',b.method.toString()));return Dc(a.H,b).then(f=>{Md(a,e,'reply');switch(f.Hc()){case Dd:case Ed:case Fd:var g=f.getData();a.G.j()&&a.G.debug('HTTP <',f.Hc(),`content: ${'string'===
473
+ typeof g?g:typeof g}`);return f;case Gd:throw f=`HTTP < Service provider for http request to ${b.j()} is overloaded, retry later`,a.G.warn(f),new olympe.L.errors.wq(f);case Hd:return a.G.debug(`HTTP < request canceled (${b.j()}).`),f;case Id:case Jd:throw f=`HTTP < request authorization denied: ${b.j()}`,a.G.error(f),new olympe.L.errors.uw(f);case Kd:throw f=`HTTP < requested resource not found: ${b.j()}`,a.G.error(f),new olympe.L.errors.jq(f);default:g=`HTTP < Error: ${f.Hc()}, ${f.statusText}`;
474
+ a.G.error(g);if(500===f.Hc()&&'Connection refused'===f.statusText)throw new olympe.L.errors.uo(g);throw Error(g);}})}).pipe(nb(olympe.L.errors.wq,(e,f)=>{a.G.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.N)))}olympe.L.Vt=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.j!==b)switch(a.G.debug('State change '+a.j+' --\x3e '+b),a.j=b,a.Mb.forEach(c=>c(b)),b){case olympe.L.Na.j.Gk:case olympe.L.Na.j.CONNECTING:case olympe.L.Na.j.Go:break;case olympe.L.Na.j.wg:a.connected.update(olympe.C.ea.D);break;case olympe.L.Na.j.Mg:a.H=[0,0,a.H[2]];Od(a);break;case olympe.L.Na.j.Ab:let c;a.G.error('Connection to server',null==(c=a.R)?void 0:c.j(),'aborted due to error');a.connected.update(olympe.C.ea.j);break;case olympe.L.Na.j.Qn:Od(a);break;case olympe.L.Na.j.Wd:a.connected.update(olympe.C.ea.j);
475
475
  break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}
476
- function Pd(a){const b=olympe.L.Na.j.Kn,c=olympe.L.Na.j.zk,d=olympe.L.Na.j.Td,e=zc(a.ba);a.G.info(`Trying to wakeup orchestrator with ${e}`);O(a,c);const f=a.Ub.D(a.ba);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(),
477
- O(a,d)}});f.D(()=>{a.G.warn(`Communication with ${e} failed.`);f.close();O(a,d)});f.ba(()=>{a.G.info(`Checking orchestrator status with ${e}`);f.send('{"action": "status"}')})}
478
- function Qd(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'))}Rd(a,olympe.L.xe.zb,d=>{switch(d.c){case olympe.L.Hi.fw:a.G.error('Unknown message sent to the server:',olympe.L.Na.pc[d.s]);break;case olympe.L.Hi.Et:a.G.error('Fatal error, the last message is probably too big according to the websocket config.'),a.F.forEach((e,f)=>{null!==e.sn&&Sd(a,f,d.i)})}});Rd(a,olympe.L.xe.pc,d=>
479
- {d.c===olympe.L.Hi.tv&&'boolean'===typeof d.a&&a.Yh.update(olympe.C.Rb(d.a))});olympe.C.oj(a.connected,()=>{let d=!1;olympe.C.oj(a.fb.j(),()=>{d&&(a.rc(),a.Bb(),d=!1);xc(a.rc.bind(a),a.$c);xc(a.Bb.bind(a),a.Ga)},()=>{a.J=[0,0,a.J[2]];d=!0})},()=>{a.Y=null;wc(a.Bb.bind(a),a.Ga)});c.j(()=>Td(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.j}`));c.fa(()=>a.disconnect(),'Orchestrator websocket');hb(a.N,(d,e)=>{e.throw(Error('Stream timeout'))});
480
- a.G.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}function Td(a){return a.j===olympe.L.Na.j.rg}function Ud(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.j)}function Vd(a,b,c,d,e){a.fa.j&&mb(a.fa,'com',d.set('id',`${b}`).set('channel','ws').set('eventType',c),e)}
481
- function Od(a){const b=olympe.L.Na.j.INIT,c=olympe.L.Na.j.CONNECTING,d=olympe.L.Na.j.rg,e=olympe.L.Na.j.Td,f=olympe.L.Na.j.Ig,g=olympe.L.Na.j.zk,h=olympe.L.Na.j.zb;if(null===a.R)a.G.warn('Trying to open a connection to the orchestrator without a valid server request. Ignoring...'),O(a,e);else{null!==a.D&&(a.D.Y(null),a.D.close());var k,l;a.G.log(`Asking NET layer for a connection to ${null==(k=a.R)?void 0:yc(k)}:${null==(l=a.R)?void 0:l.port}...`);a.D=a.Ub.D(a.R);a.D.ba(a.Vd.bind(a));a.D.$(a.Gf.bind(a));
482
- a.D.Y(()=>{a.D=null;a.j===d?O(a,f):a.j!==h&&a.j!==g&&O(a,e)});a.ba&&a.j===b&&a.D.D(()=>{a.D.D(null);a.j===c&&Pd(a);a.ba=null});a.j!==f&&O(a,c)}}function Wd(a,b,c,d){const e=a.Wd;a.Wd++;c={message:{seqId:e,messageFamily:b,payload:c},Om:d?Xd(d):null,sn:null};a.F.set(e,c);Vd(a,e,'publish',(new Map).set('family',b));d=[olympe.L.Na.j.CONNECTING,olympe.L.Na.j.Ig];(Td(a)||b===olympe.L.xe.Tj&&d.includes(a.j))&&Yd(a,e,c)}
483
- function Xd(a){const b=olympe.L.Na.D.Ri;return c=>{if(null!==c&&void 0!==c){var d=null,e=c.s;if(void 0!==e&&e!==b){d=void 0!==olympe.L.Na.pc[e]?`Status code = ${e} [${olympe.L.Na.pc[e]}]`:`Status code = ${e}`;e=olympe.L.errors.Pq;const f=c.error;'string'===typeof f&&0<f.length&&(f.includes('Message timeout')&&(e=olympe.L.errors.wk),d+=`\nReason:\n${f}`);d=new e('Rejected by orchestrator:\n'+d)}a(d,c)}}}
484
- function Yd(a,b,c){var d=c.message;a.G.j()&&a.G.debug('WS >',JSON.stringify(d.payload));(d=a.D.send(JSON.stringify(d)))?null===c.Om?a.F.delete(b):c.sn=Date.now():olympe.C.Pa(a.fb.j()).valueOf()&&O(a,olympe.L.Na.j.Ig);return d}function Rd(a,b,c,d){void 0===d&&(d=olympe.V.Ic());let e=a.ua.get(b);void 0===e&&(e=new Map,a.ua.set(b,e));e.set(d,c)}function Zd(a){a=a.ua.get(olympe.L.xe.Cg);void 0!==a&&a.delete('logoutHandler')}
485
- function Sd(a,b,c){if(a.F.has(b)){const {Om:d}=a.F.get(b);a.F.delete(b);null==d||d({s:olympe.L.Na.D.Xt,error:c})}}function $d(a,b){a.G.error(b);O(a,olympe.L.Na.j.zb)}function ae(a,b,c){a.Ec=c?1E3*c:-1;let d;a.G.info(`Connected to ${null==(d=a.R)?void 0:d.j()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.F).sort(([e],[f])=>e-f);for(const [e,f]of b)if(!Yd(a,e,f))return;O(a,olympe.L.Na.j.rg)}
486
- function be(a,b){const c=olympe.L.Fe.ug,d=olympe.L.Fe.Yf,e=olympe.L.Fe.zb,{id:f,e:g}=b;let h=a.N.get(f);h||(h=new olympe.L.oq(()=>a.N.delete(f)),a.N.set(f,h));if(g===c){fb(a.N.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}`))}
487
- olympe.L.Na=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.Ub=b;this.R=null;e.subscribe(k=>{this.R=k;k=olympe.L.Na.j.CONNECTING;if(this.j===olympe.L.Na.j.rg||this.j===k){let l;null==(l=this.D)||l.close()}});this.ba=this.D=null;e.subscribe(k=>{this.ba=k;k=olympe.L.Na.j.Td;this.j===olympe.L.Na.j.zk&&(O(this,k),Pd(this))});this.fa=g;this.$c=h.get('pingInterval');this.Ga=h.get('messageTimeout');this.$=olympe.V.Df.parse(h.get('clientVersion'));this.$a=olympe.V.Df.parse(h.get('serverVersion'));this.j=
488
- olympe.L.Na.j.INIT;this.fb=d;this.$b=h.get('getContextMode');this.Wd=1;this.Y=null;this.J=[0,0,0];this.ua=new Map;this.connected=olympe.C.cc(olympe.C.ea,'Server is connected');this.Yh=gc(olympe.C.cc(olympe.C.ea,'Server is readonly'),olympe.C.ea.j);this.Eb=new Set;this.F=new Map;this.N=new olympe.V.Jh(this.Ga);this.Kc=new Map;this.Ec=-1;Qd(this,h,c)}connect(){const a=olympe.L.Na.j.rg,b=olympe.L.Na.j.Td,c=olympe.L.Na.j.zb,d=olympe.L.Na.j.INIT;return new Promise((e,f)=>{this.j!==d&&this.j!==b||Od(this);
489
- Ud(this,[a,b,c],g=>{g===a?e():f(Error('Was not able to open a connection to the orchestrator'))},!0)})}disconnect(){return new Promise((a,b)=>{const c=olympe.L.Na.j.Ao,d=olympe.L.Na.j.Td,e=olympe.L.Na.j.CONNECTING,f=olympe.L.Na.j.zb;this.j===olympe.L.Na.j.rg||this.j===e||this.j===c?(Ud(this,[d,f],g=>{g===d?a():b(Error('Was not able to disconnect'))},!0),this.j!==c&&(O(this,c),this.D.close())):(O(this,d),a())})}Vd(){this.G.debug('Websocket connected, sending handshake. Client version:',Cb(this.$),
490
- 'subscribeEverything:',this.$b?'NO':'YES');Wd(this,olympe.L.xe.Tj,{c:olympe.L.Hi.Tj,cv:Cb(this.$),m:this.$b?0:1,s:this.Y,b:this.fb.D()},this.Wh.bind(this))}Wh(a,b){if(a)$d(this,'Error in receiving handshake response: '+a.message);else{this.G.debug('Handshake response received');var c=olympe.L.Na.F;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.Yt:$d(this,`Framework version (${Cb(this.$)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
491
- return;case c.Xv:$d(this,`Framework version (${Cb(this.$)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.Ht:$d(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.$a.Ea(olympe.V.Df.j))this.G.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.V.Df.parse(a);if(e.vj(this.$a)){$d(this,`Framework v${Cb(this.$)} is expecting Orchestrator to be at least in v${Cb(this.$a)}`);
492
- return}this.G.log('Handshake successful. Orchestrator version: ',JSON.stringify(e),'required:',Cb(this.$a))}catch(f){$d(this,f);return}e=olympe.L.Na.j.Td;if(this.j===olympe.L.Na.j.Ig&&null!==this.Y&&this.Y!==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.Kc.set(f,g);this.Y=b.sessionId||null;ae(this,a,d)}}}rc(){this.J[0]-this.J[1]>this.$c/2?(this.G.debug('Ping did not get answer, try to reconnect'),
493
- O(this,olympe.L.Na.j.Ig)):(this.J[0]=Date.now(),this.D.send('ping')||(this.G.debug('Impossible to send ping, try to reconnect'),O(this,olympe.L.Na.j.Ig)))}Gf(a){this.J[2]=Date.now();if(a.startsWith('pong'))return olympe.C.Pa(this.fb.j()).valueOf()&&(this.J[1]=this.J[2]),null;var b=0;this.fa.j&&(b=performance.now()-this.fa.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=c.seqId;var d=c.stream;
494
- const e=c.messageFamily;c=c.payload;if(this.G.j()){const g=({id:h,i:k,e:l,c:n})=>l===olympe.L.Fe.ug?`stream[${h}][${k}]: ${JSON.stringify(n)}`:l===olympe.L.Fe.Yf?`stream[${h}]:END`:`stream[${h}]:ERROR`;this.G.debug(`WS < ${JSON.stringify(c)}, ${d?g(d):''}`)}Vd(this,a,'consumed',new Map,b);Vd(this,a,'deserialized',(new Map).set('family',e));if(void 0!==d){var f=d.id;b=this.N.has(f);be(this,d);if(b)return null;d=this.N.get(f);if(!d)return this.G.error(`Received a stream chunk for an unknown stream id: ${f}`),
495
- null;f=d.stream}this.F.has(a)&&({Om:d}=this.F.get(a),this.F.delete(a),null==d||d(c,f));a=this.ua.get(e);if(void 0!==a)for(const g of a.values())g(c,f);return null}Bb(){const a=Date.now();for(const [b,{sn:c}]of this.F)null!==c&&a-c>this.Ga&&(this.G.warn(`No response was received from the server for the seqId = ${b}`),Sd(this,b,'Message timeout: never receive acknowledge'))}};function id(a){return olympe.C.Pa(a.j)===olympe.L.uc.j.Mi}
496
- function ce(a,b){const c=olympe.L.uc.j.im,d=olympe.L.uc.j.ye,e=olympe.L.uc.j.Td,f=olympe.L.uc.j.Lv,g=b.get('reconnectionDelay');Ud(a.F,[olympe.L.Na.j.INIT],()=>{de(a)?(a.j.update(c),a.connect().catch(h=>a.G.error(h))):a.F.disconnect().catch(h=>a.G.error(h))},!0);Ud(a.F,[olympe.L.Na.j.Td],()=>{if(olympe.C.Pa(a.j)===f)a.G.info('Disconnected, from orchestrator for shutdown');else if(a.j.update(a.D?d:e),de(a)&&a.N){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.D?a.G.log(h):a.G.error(h);
497
- setTimeout(()=>a.connect().catch(k=>a.G.error(k)),g)}else a.G.info('Disconnected, stay offline.')});a.R.D(()=>{a.j.update(f);return Promise.resolve()},'Connectivity manager: shutdown state')}function de(a){return null===a.storage.get(a.J+'olympe_manual_offline')}
498
- olympe.L.uc=class{constructor(a,b,c,d,e,f){this.G=a;this.F=b;this.R=d;this.storage=e;this.j=olympe.C.cc(Number).update(olympe.L.uc.j.INIT);this.D=f.get('offlineEnabled');this.N=f.get('offlineAutoBackOnline');this.J=f.get('storagePrefix');ce(this,f)}Pf(){const a=olympe.L.uc.j.Mi,b=olympe.L.uc.j.ye,c=olympe.L.uc.j.Td;let d=olympe.C.ea.j;return olympe.C.ta([this.j],e=>{if(e===a)d=olympe.C.ea.D;else if(e===b||e===c)d=olympe.C.ea.j;return d},olympe.C.ea)}getState(){return this.j.rb()}connect(){const a=
499
- this;return w(function*(){const b=olympe.L.uc.j.Mi,c=olympe.L.uc.j.im;olympe.C.Pa(a.j)!==b&&(a.j.update(c),a.storage.delete(a.J+'olympe_manual_offline'),yield a.F.connect(),yield ee(),a.j.update(b))})}disconnect(){const a=this;return w(function*(){const b=olympe.L.uc.j.ye,c=olympe.L.uc.j.im;if(!a.D)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.J+'olympe_manual_offline','true');olympe.C.Pa(a.j)!==b&&
500
- (a.j.update(c),yield olympe.L.$h().disconnect(),yield a.F.disconnect())})}};olympe.L.uc.j={INIT:0,im:1,Mi:2,ye:3,Td:4,Lv:5};olympe.L.uc.D='olympe_manual_offline';olympe.L.cb=class{constructor(a,b,c,d,e){this.de=c;this.D=a;this.source=b;this.messageType=d;this.j=null!=e?e:null}static D(a,b,c){let d;var e=olympe.L.cb,f=a.dest,g=a.src,h=a.seq,k=a.type;b.R=c;return new e(f,g,h,k,b.N(null!=(d=a.content)?d:null))}jc(){return this.D}sb(){return this.source}getType(){return this.messageType}ga(a,b){const c={dest:this.D,src:this.source,seq:this.de,type:this.messageType};null!==this.j&&(a.Y=b,c.content=a.ga(this.j));return c}toString(){return`Message(dest: ${this.D}, src: ${this.source}, seqId: ${this.de}, type: ${this.messageType})`}};
501
- olympe.L.cb.j={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,xr:4,fe:5,zm:6,zb:7,al:10,Vq:11,nr:12,we:13,Cm:14};olympe.L.sk=class extends olympe.L.cb{constructor(a,b,c,d,e,f){super(a,b,d,e,f);this.F=c}static D(a,b,c){let d;var e=olympe.L.sk,f=a.dest,g=a.src,h=a.auth,k=a.seq,l=a.type;b.R=c;return new e(f,g,h,k,l,b.N(null!=(d=a.content)?d:null))}me(){return this.F}ga(a,b){return Object.assign(super.ga(a,b),{auth:this.F})}};olympe.L.sk.Hi={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,we:4,Cm:5};const fe=olympe.L.cb.j.SEND,ge=olympe.L.cb.j.GET,he=olympe.L.cb.j.SUBSCRIBE,ie=olympe.L.cb.j.we,je=olympe.L.cb.j.Vq,ke=olympe.L.cb.j.zb,le=olympe.L.cb.j.xr,me=olympe.L.cb.j.zm,ne=olympe.L.cb.j.nr;
502
- olympe.L.Zc=class{constructor(a,b,c){this.j=a;this.D=b;this.J=c;this.F=null}ii(){return null!==this.F?Promise.resolve(this.F):zd(this.D,this.j).then(a=>this.F=a)}Bs(){return this.j.getType()}source(){return this.j.sb()}body(){return this.j.j}Hr(){return this.j.getType()===fe?this.D.vd(this.j,je):Promise.reject('Should only call `ack` on SEND requests')}vd(a){const b=this.j.getType();return b===ge||b===ie?this.D.vd(this.j,le,a):Promise.reject('Should only call `reply` on GET requests')}mn(a){if(this.j.getType()!==
503
- he)return Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests');const b=olympe.V.Ic();return new Promise((c,d)=>{const e={seq:ud(this.D,f=>{switch(f.getType()){case ne:oe(this.J,b);c(b);break;case ke:d(f.j.reason);break;default:d('Unsupported response type for a SUBSCRIBE request')}}),topic:a,id:b,refresh:this.D.$c};this.D.vd(this.j,me,e).catch(d)})}Xh(a){return this.D.vd(this.j,ke,{reason:a.message})}};olympe.L.Zc.prototype.fail=olympe.L.Zc.prototype.Xh;
504
- olympe.L.Zc.prototype.notifyOn=olympe.L.Zc.prototype.mn;olympe.L.Zc.prototype.reply=olympe.L.Zc.prototype.vd;olympe.L.Zc.prototype.ack=olympe.L.Zc.prototype.Hr;olympe.L.Zc.prototype.body=olympe.L.Zc.prototype.body;olympe.L.Zc.prototype.source=olympe.L.Zc.prototype.source;olympe.L.Zc.prototype.requestType=olympe.L.Zc.prototype.Bs;olympe.L.Zc.prototype.userTag=olympe.L.Zc.prototype.ii;function Ad(a){const b=olympe.L.errors.Ji;a.j.forEach((c,d)=>{yd(a,d);null==c||c(new b(`Subscription ${d} to be refreshed`,d))})}function nd(a){if(null!==a.D){var b=a.D;a.D=null;clearInterval(b)}}function od(a,b){b&&a.ff();null===a.D&&(a.D=setInterval(a.ff.bind(a),a.F))}function yd(a,b){b=a.j.delete(b);0===a.j.size&&nd(a);return b}function pe(a,b){a.j.forEach((c,d)=>{yd(a,d);c(b)})}
505
- olympe.L.Vv=class{constructor(a,b,c,d){this.G=a;this.J=b;this.N=c;this.F=d;this.j=new Map;this.D=null}ff(){const a=olympe.L.errors.Ji;hd(this.J)?this.J.request(this.N,olympe.L.cb.j.we,Array.from(this.j.keys())).then(b=>{b=b.j;0<b.length&&b.forEach(c=>{const d=this.j.get(c);yd(this,c);null==d||d(new a('Subscription does not exist in the service.',c))})}).catch(b=>{b=`Impossible to keep alive subscriptions: ${b}`;this.G.error(b);pe(this,Error(b))}):nd(this)}};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,
506
- 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.Pp,a);case a instanceof Set:return a=Array.from(a).map(this.D.bind(this)),this.format(olympe.L.ec.j.Ng,a);case Array.isArray(a):return a.map(this.D.bind(this));case a instanceof ArrayBuffer:return a=olympe.V.Ze().j(new Uint8Array(a)),this.format(olympe.L.ec.j.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.V.Ze().j(a),this.format(olympe.L.ec.j.Kh,a);case a instanceof
507
- olympe.V.stream.yf:if(!this.Y)throw Error('No stream handler has been set, so cannot serialize the stream.');let b;return this.format(olympe.L.ec.j.fe,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.eq,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'===
508
- typeof a:return a}if(Array.isArray(a))return a.map(d=>this.j(d));if('object'!==typeof a)throw new olympe.L.errors.Fo(`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.Ob(c);case olympe.L.ec.j.Pp:return new Map(Object.entries(c).map(([e,f])=>[e,this.j(f)]));case olympe.L.ec.j.Ng:return new Set(c.map(e=>this.j(e)));case olympe.L.ec.j.ARRAY_BUFFER:return olympe.V.Ze().D(c).buffer;
509
- case olympe.L.ec.j.Kh:return olympe.V.Ze().D(c);case olympe.L.ec.j.fe: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.eq:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.L.errors.Fo(`Impossible to deserialize the following value: ${c}`);}}format(a,b){return{t:a,v:b}}};olympe.L.ec.j={wl:1,COLOR:2,Pp:3,Ng:4,ARRAY_BUFFER:5,Kh:6,fe:7,eq:8};const qe=olympe.L.cb.j.SEND,re=olympe.L.cb.j.GET,se=olympe.L.cb.j.PUBLISH,te=olympe.L.cb.j.SUBSCRIBE,ue=olympe.L.cb.j.we,ve=olympe.L.cb.j.Cm,we=olympe.L.cb.j.Vq,xe=olympe.L.cb.j.al,ye=olympe.L.cb.j.zb,ze=olympe.L.cb.j.xr,Ae=olympe.L.cb.j.zm;function oe(a,b){a.j||(a.j=gb(new olympe.V.Bm(a.D.$c+3E4),c=>{let d;null==(d=a.F)||d.call(a,c)}));a.j.add(b)}
510
- function Be(a,b){const c=olympe.L.cb.j.zm,d=olympe.L.cb.j.nr;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.j.seq,b.sb(),d,null,!0)}function Ce(a){let b,c;a=null!=(c=null==(b=a.j)?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.L.errors.wk(a):Error(a)}
511
- olympe.L.ub=class{constructor(a,b){this.D=olympe.L.$h();this.J=a;this.F=this.j=null;this.N=new olympe.C.Xb(`Service ${a}`,'function'===typeof b.D?b.D():b);this.G=olympe.ja.ab(`Service ${this.J}`)}static observe(a,b,c,d={}){const e='function'===typeof b.D?b.D():b,f=olympe.L.$h();return(new rxjs.Observable(g=>{let h=null,k=null;const l=()=>{g.complete();k&&xd(f,a,k);h&&vd(f,h).catch(n=>olympe.ja.ab('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.Y(l);f.request(a,te,c,d.timeout).then(n=>
476
+ function Pd(a){const b=olympe.L.Na.j.Qn,c=olympe.L.Na.j.Gk,d=olympe.L.Na.j.Wd,e=zc(a.da);a.G.info(`Trying to wakeup orchestrator with ${e}`);O(a,c);const f=a.vc.D(a.da);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(),
477
+ O(a,d)}});f.D(()=>{a.G.warn(`Communication with ${e} failed.`);f.close();O(a,d)});f.da(()=>{a.G.info(`Checking orchestrator status with ${e}`);f.send('{"action": "status"}')})}
478
+ function Qd(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'))}Rd(a,olympe.L.ze.Ab,d=>{switch(d.c){case olympe.L.Ni.pw:a.G.error('Unknown message sent to the server:',olympe.L.Na.oc[d.s]);break;case olympe.L.Ni.Nt:a.G.error('Fatal error, the last message is probably too big according to the websocket config.'),a.F.forEach((e,f)=>{null!==e.yn&&Sd(a,f,d.i)})}});Rd(a,olympe.L.ze.oc,d=>
479
+ {d.c===olympe.L.Ni.Cv&&'boolean'===typeof d.a&&a.ci.update(olympe.C.Sb(d.a))});olympe.C.vj(a.connected,()=>{let d=!1;olympe.C.vj(a.jb.j(),()=>{d&&(a.$c(),a.zb(),d=!1);xc(a.$c.bind(a),a.Rd);xc(a.zb.bind(a),a.Ha)},()=>{a.H=[0,0,a.H[2]];d=!0})},()=>{a.Y=null;wc(a.zb.bind(a),a.Ha)});c.j(()=>Td(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.j}`));c.ha(()=>a.disconnect(),'Orchestrator websocket');hb(a.N,(d,e)=>{e.throw(Error('Stream timeout'))});
480
+ a.G.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}function Td(a){return a.j===olympe.L.Na.j.wg}function Ud(a,b,c,d=!1){const e=f=>{if(0===b.length||b.includes(f))d&&a.Mb.delete(e),c(f)};a.Mb.add(e);e(a.j)}function Vd(a,b,c,d,e){a.ha.j&&mb(a.ha,'com',d.set('id',`${b}`).set('channel','ws').set('eventType',c),e)}
481
+ function Od(a){const b=olympe.L.Na.j.INIT,c=olympe.L.Na.j.CONNECTING,d=olympe.L.Na.j.wg,e=olympe.L.Na.j.Wd,f=olympe.L.Na.j.Mg,g=olympe.L.Na.j.Gk,h=olympe.L.Na.j.Ab;if(null===a.R)a.G.warn('Trying to open a connection to the orchestrator without a valid server request. Ignoring...'),O(a,e);else{null!==a.D&&(a.D.Y(null),a.D.close());var k,l;a.G.log(`Asking NET layer for a connection to ${null==(k=a.R)?void 0:yc(k)}:${null==(l=a.R)?void 0:l.port}...`);a.D=a.vc.D(a.R);a.D.da(a.$e.bind(a));a.D.$(a.$h.bind(a));
482
+ a.D.Y(()=>{a.D=null;a.j===d?O(a,f):a.j!==h&&a.j!==g&&O(a,e)});a.da&&a.j===b&&a.D.D(()=>{a.D.D(null);a.j===c&&Pd(a);a.da=null});a.j!==f&&O(a,c)}}function Wd(a,b,c,d){const e=a.af;a.af++;c={message:{seqId:e,messageFamily:b,payload:c},Tm:d?Xd(d):null,yn:null};a.F.set(e,c);Vd(a,e,'publish',(new Map).set('family',b));d=[olympe.L.Na.j.CONNECTING,olympe.L.Na.j.Mg];(Td(a)||b===olympe.L.ze.$j&&d.includes(a.j))&&Yd(a,e,c)}
483
+ function Xd(a){const b=olympe.L.Na.D.Yi;return c=>{if(null!==c&&void 0!==c){var d=null,e=c.s;if(void 0!==e&&e!==b){d=void 0!==olympe.L.Na.oc[e]?`Status code = ${e} [${olympe.L.Na.oc[e]}]`:`Status code = ${e}`;e=olympe.L.errors.Wq;const f=c.error;'string'===typeof f&&0<f.length&&(f.includes('Message timeout')&&(e=olympe.L.errors.Dk),d+=`\nReason:\n${f}`);d=new e('Rejected by orchestrator:\n'+d)}a(d,c)}}}
484
+ function Yd(a,b,c){var d=c.message;a.G.j()&&a.G.debug('WS >',JSON.stringify(d.payload));(d=a.D.send(JSON.stringify(d)))?null===c.Tm?a.F.delete(b):c.yn=Date.now():olympe.C.Pa(a.jb.j()).valueOf()&&O(a,olympe.L.Na.j.Mg);return d}function Rd(a,b,c,d){void 0===d&&(d=olympe.V.Ic());let e=a.wa.get(b);void 0===e&&(e=new Map,a.wa.set(b,e));e.set(d,c)}function Zd(a){a=a.wa.get(olympe.L.ze.Gg);void 0!==a&&a.delete('logoutHandler')}
485
+ function Sd(a,b,c){if(a.F.has(b)){const {Tm:d}=a.F.get(b);a.F.delete(b);null==d||d({s:olympe.L.Na.D.fu,error:c})}}function $d(a,b){a.G.error(b);O(a,olympe.L.Na.j.Ab)}function ae(a,b,c){a.Bd=c?1E3*c:-1;let d;a.G.info(`Connected to ${null==(d=a.R)?void 0:d.j()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.F).sort(([e],[f])=>e-f);for(const [e,f]of b)if(!Yd(a,e,f))return;O(a,olympe.L.Na.j.wg)}
486
+ function be(a,b){const c=olympe.L.He.zg,d=olympe.L.He.bg,e=olympe.L.He.Ab,{id:f,e:g}=b;let h=a.N.get(f);h||(h=new olympe.L.vq(()=>a.N.delete(f)),a.N.set(f,h));if(g===c){fb(a.N.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}`))}
487
+ olympe.L.Na=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.vc=b;this.R=null;e.subscribe(k=>{this.R=k;k=olympe.L.Na.j.CONNECTING;if(this.j===olympe.L.Na.j.wg||this.j===k){let l;null==(l=this.D)||l.close()}});this.da=this.D=null;e.subscribe(k=>{this.da=k;k=olympe.L.Na.j.Wd;this.j===olympe.L.Na.j.Gk&&(O(this,k),Pd(this))});this.ha=g;this.Rd=h.get('pingInterval');this.Ha=h.get('messageTimeout');this.$=olympe.V.Hf.parse(h.get('clientVersion'));this.cb=olympe.V.Hf.parse(h.get('serverVersion'));this.j=
488
+ olympe.L.Na.j.INIT;this.jb=d;this.zc=h.get('getContextMode');this.af=1;this.Y=null;this.H=[0,0,0];this.wa=new Map;this.connected=olympe.C.bc(olympe.C.ea,'Server is connected');this.ci=gc(olympe.C.bc(olympe.C.ea,'Server is readonly'),olympe.C.ea.j);this.Mb=new Set;this.F=new Map;this.N=new olympe.V.Nh(this.Ha);this.Id=new Map;this.Bd=-1;Qd(this,h,c)}connect(){const a=olympe.L.Na.j.wg,b=olympe.L.Na.j.Wd,c=olympe.L.Na.j.Ab,d=olympe.L.Na.j.INIT;return new Promise((e,f)=>{this.j!==d&&this.j!==b||Od(this);
489
+ Ud(this,[a,b,c],g=>{g===a?e():f(Error('Was not able to open a connection to the orchestrator'))},!0)})}disconnect(){return new Promise((a,b)=>{const c=olympe.L.Na.j.Go,d=olympe.L.Na.j.Wd,e=olympe.L.Na.j.CONNECTING,f=olympe.L.Na.j.Ab;this.j===olympe.L.Na.j.wg||this.j===e||this.j===c?(Ud(this,[d,f],g=>{g===d?a():b(Error('Was not able to disconnect'))},!0),this.j!==c&&(O(this,c),this.D.close())):(O(this,d),a())})}$e(){this.G.debug('Websocket connected, sending handshake. Client version:',Cb(this.$),
490
+ 'subscribeEverything:',this.zc?'NO':'YES');Wd(this,olympe.L.ze.$j,{c:olympe.L.Ni.$j,cv:Cb(this.$),m:this.zc?0:1,s:this.Y,b:this.jb.D()},this.ai.bind(this))}ai(a,b){if(a)$d(this,'Error in receiving handshake response: '+a.message);else{this.G.debug('Handshake response received');var c=olympe.L.Na.F;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.gu:$d(this,`Framework version (${Cb(this.$)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
491
+ return;case c.gw:$d(this,`Framework version (${Cb(this.$)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.Qt:$d(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.cb.Ea(olympe.V.Hf.j))this.G.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.V.Hf.parse(a);if(e.Cj(this.cb)){$d(this,`Framework v${Cb(this.$)} is expecting Orchestrator to be at least in v${Cb(this.cb)}`);
492
+ return}this.G.log('Handshake successful. Orchestrator version: ',JSON.stringify(e),'required:',Cb(this.cb))}catch(f){$d(this,f);return}e=olympe.L.Na.j.Wd;if(this.j===olympe.L.Na.j.Mg&&null!==this.Y&&this.Y!==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.Id.set(f,g);this.Y=b.sessionId||null;ae(this,a,d)}}}$c(){this.H[0]-this.H[1]>this.Rd/2?(this.G.debug('Ping did not get answer, try to reconnect'),
493
+ O(this,olympe.L.Na.j.Mg)):(this.H[0]=Date.now(),this.D.send('ping')||(this.G.debug('Impossible to send ping, try to reconnect'),O(this,olympe.L.Na.j.Mg)))}$h(a){this.H[2]=Date.now();if(a.startsWith('pong'))return olympe.C.Pa(this.jb.j()).valueOf()&&(this.H[1]=this.H[2]),null;var b=0;this.ha.j&&(b=performance.now()-this.ha.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=c.seqId;var d=c.stream;
494
+ const e=c.messageFamily;c=c.payload;if(this.G.j()){const g=({id:h,i:k,e:l,c:n})=>l===olympe.L.He.zg?`stream[${h}][${k}]: ${JSON.stringify(n)}`:l===olympe.L.He.bg?`stream[${h}]:END`:`stream[${h}]:ERROR`;this.G.debug(`WS < ${JSON.stringify(c)}, ${d?g(d):''}`)}Vd(this,a,'consumed',new Map,b);Vd(this,a,'deserialized',(new Map).set('family',e));if(void 0!==d){var f=d.id;b=this.N.has(f);be(this,d);if(b)return null;d=this.N.get(f);if(!d)return this.G.error(`Received a stream chunk for an unknown stream id: ${f}`),
495
+ null;f=d.stream}this.F.has(a)&&({Tm:d}=this.F.get(a),this.F.delete(a),null==d||d(c,f));a=this.wa.get(e);if(void 0!==a)for(const g of a.values())g(c,f);return null}zb(){const a=Date.now();for(const [b,{yn:c}]of this.F)null!==c&&a-c>this.Ha&&(this.G.warn(`No response was received from the server for the seqId = ${b}`),Sd(this,b,'Message timeout: never receive acknowledge'))}};function id(a){return olympe.C.Pa(a.j)===olympe.L.tc.j.Si}
496
+ function ce(a,b){const c=olympe.L.tc.j.pm,d=olympe.L.tc.j.Ae,e=olympe.L.tc.j.Wd,f=olympe.L.tc.j.Vv,g=b.get('reconnectionDelay');Ud(a.F,[olympe.L.Na.j.INIT],()=>{de(a)?(a.j.update(c),a.connect().catch(h=>a.G.error(h))):a.F.disconnect().catch(h=>a.G.error(h))},!0);Ud(a.F,[olympe.L.Na.j.Wd],()=>{if(olympe.C.Pa(a.j)===f)a.G.info('Disconnected, from orchestrator for shutdown');else if(a.j.update(a.D?d:e),de(a)&&a.N){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.D?a.G.log(h):a.G.error(h);
497
+ setTimeout(()=>a.connect().catch(k=>a.G.error(k)),g)}else a.G.info('Disconnected, stay offline.')});a.R.D(()=>{a.j.update(f);return Promise.resolve()},'Connectivity manager: shutdown state')}function de(a){return null===a.storage.get(a.H+'olympe_manual_offline')}
498
+ olympe.L.tc=class{constructor(a,b,c,d,e,f){this.G=a;this.F=b;this.R=d;this.storage=e;this.j=olympe.C.bc(Number).update(olympe.L.tc.j.INIT);this.D=f.get('offlineEnabled');this.N=f.get('offlineAutoBackOnline');this.H=f.get('storagePrefix');ce(this,f)}Sf(){const a=olympe.L.tc.j.Si,b=olympe.L.tc.j.Ae,c=olympe.L.tc.j.Wd;let d=olympe.C.ea.j;return olympe.C.ta([this.j],e=>{if(e===a)d=olympe.C.ea.D;else if(e===b||e===c)d=olympe.C.ea.j;return d},olympe.C.ea)}getState(){return this.j.rb()}connect(){const a=
499
+ this;return w(function*(){const b=olympe.L.tc.j.Si,c=olympe.L.tc.j.pm;olympe.C.Pa(a.j)!==b&&(a.j.update(c),a.storage.delete(a.H+'olympe_manual_offline'),yield a.F.connect(),yield ee(),a.j.update(b))})}disconnect(){const a=this;return w(function*(){const b=olympe.L.tc.j.Ae,c=olympe.L.tc.j.pm;if(!a.D)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.H+'olympe_manual_offline','true');olympe.C.Pa(a.j)!==b&&
500
+ (a.j.update(c),yield olympe.L.ei().disconnect(),yield a.F.disconnect())})}};olympe.L.tc.j={INIT:0,pm:1,Si:2,Ae:3,Wd:4,Vv:5};olympe.L.tc.D='olympe_manual_offline';olympe.L.bb=class{constructor(a,b,c,d,e){this.ee=c;this.D=a;this.source=b;this.messageType=d;this.j=null!=e?e:null}static D(a,b,c){let d;var e=olympe.L.bb,f=a.dest,g=a.src,h=a.seq,k=a.type;b.R=c;return new e(f,g,h,k,b.N(null!=(d=a.content)?d:null))}ic(){return this.D}sb(){return this.source}getType(){return this.messageType}ga(a,b){const c={dest:this.D,src:this.source,seq:this.ee,type:this.messageType};null!==this.j&&(a.Y=b,c.content=a.ga(this.j));return c}toString(){return`Message(dest: ${this.D}, src: ${this.source}, seqId: ${this.ee}, type: ${this.messageType})`}};
501
+ olympe.L.bb.j={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,Er:4,ge:5,Em:6,Ab:7,hl:10,br:11,wr:12,ye:13,Hm:14};olympe.L.zk=class extends olympe.L.bb{constructor(a,b,c,d,e,f){super(a,b,d,e,f);this.F=c}static D(a,b,c){let d;var e=olympe.L.zk,f=a.dest,g=a.src,h=a.auth,k=a.seq,l=a.type;b.R=c;return new e(f,g,h,k,l,b.N(null!=(d=a.content)?d:null))}oe(){return this.F}ga(a,b){return Object.assign(super.ga(a,b),{auth:this.F})}};olympe.L.zk.Ni={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,ye:4,Hm:5};const fe=olympe.L.bb.j.SEND,ge=olympe.L.bb.j.GET,he=olympe.L.bb.j.SUBSCRIBE,ie=olympe.L.bb.j.ye,je=olympe.L.bb.j.br,ke=olympe.L.bb.j.Ab,le=olympe.L.bb.j.Er,me=olympe.L.bb.j.Em,ne=olympe.L.bb.j.wr;
502
+ olympe.L.Zc=class{constructor(a,b,c){this.j=a;this.D=b;this.H=c;this.F=null}ni(){return null!==this.F?Promise.resolve(this.F):zd(this.D,this.j).then(a=>this.F=a)}Js(){return this.j.getType()}source(){return this.j.sb()}body(){return this.j.j}Pr(){return this.j.getType()===fe?this.D.vd(this.j,je):Promise.reject('Should only call `ack` on SEND requests')}vd(a){const b=this.j.getType();return b===ge||b===ie?this.D.vd(this.j,le,a):Promise.reject('Should only call `reply` on GET requests')}tn(a){if(this.j.getType()!==
503
+ he)return Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests');const b=olympe.V.Ic();return new Promise((c,d)=>{const e={seq:ud(this.D,f=>{switch(f.getType()){case ne:oe(this.H,b);c(b);break;case ke:d(f.j.reason);break;default:d('Unsupported response type for a SUBSCRIBE request')}}),topic:a,id:b,refresh:this.D.Rd};this.D.vd(this.j,me,e).catch(d)})}bi(a){return this.D.vd(this.j,ke,{reason:a.message})}};olympe.L.Zc.prototype.fail=olympe.L.Zc.prototype.bi;
504
+ olympe.L.Zc.prototype.notifyOn=olympe.L.Zc.prototype.tn;olympe.L.Zc.prototype.reply=olympe.L.Zc.prototype.vd;olympe.L.Zc.prototype.ack=olympe.L.Zc.prototype.Pr;olympe.L.Zc.prototype.body=olympe.L.Zc.prototype.body;olympe.L.Zc.prototype.source=olympe.L.Zc.prototype.source;olympe.L.Zc.prototype.requestType=olympe.L.Zc.prototype.Js;olympe.L.Zc.prototype.userTag=olympe.L.Zc.prototype.ni;function Ad(a){const b=olympe.L.errors.Pi;a.j.forEach((c,d)=>{yd(a,d);null==c||c(new b(`Subscription ${d} to be refreshed`,d))})}function nd(a){if(null!==a.D){var b=a.D;a.D=null;clearInterval(b)}}function od(a,b){b&&a.kf();null===a.D&&(a.D=setInterval(a.kf.bind(a),a.F))}function yd(a,b){b=a.j.delete(b);0===a.j.size&&nd(a);return b}function pe(a,b){a.j.forEach((c,d)=>{yd(a,d);c(b)})}
505
+ olympe.L.ew=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}kf(){const a=olympe.L.errors.Pi;hd(this.H)?this.H.request(this.N,olympe.L.bb.j.ye,Array.from(this.j.keys())).then(b=>{b=b.j;0<b.length&&b.forEach(c=>{const d=this.j.get(c);yd(this,c);null==d||d(new a('Subscription does not exist in the service.',c))})}).catch(b=>{b=`Impossible to keep alive subscriptions: ${b}`;this.G.error(b);pe(this,Error(b))}):nd(this)}};olympe.L.cc=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.cc.j.Cl,a.valueOf().toISOString());case a instanceof Date:return this.format(olympe.L.cc.j.Cl,a.toISOString());case a instanceof olympe.C.Color:return this.format(olympe.L.cc.j.COLOR,
506
+ a.toJSON());case a instanceof Map:return a=Object.fromEntries(Array.from(a).map(([c,d])=>[c,this.D(d)])),this.format(olympe.L.cc.j.Wp,a);case a instanceof Set:return a=Array.from(a).map(this.D.bind(this)),this.format(olympe.L.cc.j.Rg,a);case Array.isArray(a):return a.map(this.D.bind(this));case a instanceof ArrayBuffer:return a=olympe.V.df().j(new Uint8Array(a)),this.format(olympe.L.cc.j.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.V.df().j(a),this.format(olympe.L.cc.j.Oh,a);case a instanceof
507
+ olympe.V.stream.Cf:if(!this.Y)throw Error('No stream handler has been set, so cannot serialize the stream.');let b;return this.format(olympe.L.cc.j.ge,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.cc.j.lq,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'===
508
+ typeof a:return a}if(Array.isArray(a))return a.map(d=>this.j(d));if('object'!==typeof a)throw new olympe.L.errors.Lo(`Impossible to deserialize the following value: ${a}`);const {t:b,v:c}=a;switch(b){case olympe.L.cc.j.Cl:return new Date(c);case olympe.L.cc.j.COLOR:return olympe.C.Color.Qb(c);case olympe.L.cc.j.Wp:return new Map(Object.entries(c).map(([e,f])=>[e,this.j(f)]));case olympe.L.cc.j.Rg:return new Set(c.map(e=>this.j(e)));case olympe.L.cc.j.ARRAY_BUFFER:return olympe.V.df().D(c).buffer;
509
+ case olympe.L.cc.j.Oh:return olympe.V.df().D(c);case olympe.L.cc.j.ge:if(!this.R)throw Error('No stream handler has been set, so cannot deserialize the stream.');let d;return null==(d=this.R)?void 0:d.call(this,c);case olympe.L.cc.j.lq:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.L.errors.Lo(`Impossible to deserialize the following value: ${c}`);}}format(a,b){return{t:a,v:b}}};olympe.L.cc.j={Cl:1,COLOR:2,Wp:3,Rg:4,ARRAY_BUFFER:5,Oh:6,ge:7,lq:8};const qe=olympe.L.bb.j.SEND,re=olympe.L.bb.j.GET,se=olympe.L.bb.j.PUBLISH,te=olympe.L.bb.j.SUBSCRIBE,ue=olympe.L.bb.j.ye,ve=olympe.L.bb.j.Hm,we=olympe.L.bb.j.br,xe=olympe.L.bb.j.hl,ye=olympe.L.bb.j.Ab,ze=olympe.L.bb.j.Er,Ae=olympe.L.bb.j.Em;function oe(a,b){a.j||(a.j=gb(new olympe.V.Gm(a.D.Rd+3E4),c=>{let d;null==(d=a.F)||d.call(a,c)}));a.j.add(b)}
510
+ function Be(a,b){const c=olympe.L.bb.j.Em,d=olympe.L.bb.j.wr;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.j.seq,b.sb(),d,null,!0)}function Ce(a){let b,c;a=null!=(c=null==(b=a.j)?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.L.errors.Dk(a):Error(a)}
511
+ olympe.L.ub=class{constructor(a,b){this.D=olympe.L.ei();this.H=a;this.F=this.j=null;this.N=new olympe.C.Xb(`Service ${a}`,'function'===typeof b.Cb?b.Cb():b);this.G=olympe.ja.$a(`Service ${this.H}`)}static observe(a,b,c,d={}){const e='function'===typeof b.Cb?b.Cb():b,f=olympe.L.ei();return(new rxjs.Observable(g=>{let h=null,k=null;const l=()=>{g.complete();k&&xd(f,a,k);h&&vd(f,h).catch(n=>olympe.ja.$a('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.Td(l);f.request(a,te,c,d.timeout).then(n=>
512
512
  {switch(n.getType()){case Ae:const p=n.j;h=p.topic;jd(f,h,q=>{q.getType()===se?g.next(q.j):(g.error('Unsupported notification message. It should be a publish'),l())}).then(()=>{k=p.id;wd(f,a,k,p.refresh,q=>g.error(q));Be(f,n).catch(q=>{g.error(`Was unable to ack the subscription: ${q}`);l()})}).catch(q=>{g.error(`Was not able to subscribe to notification topic ${h}: ${q}`);l()});break;case ye:g.error(Ce(n));break;default:g.error('Unsupported response type for a SUBSCRIBE request')}}).catch(n=>g.error(n));
513
- return l})).pipe(nb(olympe.L.errors.Ji,(g,h)=>{olympe.ja.ab(`Service ${a}`).debug(`Subscribed to topic ${g.T()} now that we are back online, after waiting for ${h}ms`);let k;null==(k=d.onRetry)||k.call(d)}))}Hs(a){this.F=a;return this}stop(){this.N.destroy()}clear(){vd(this.D,this.J).catch(b=>this.G.error('Failed to unsubscribe from '+this.J+', error: '+b));if(this.F){let b;null==(b=this.j)||b.forEach(c=>{let d;return null==(d=this.F)?void 0:d.call(this,c)})}let a;null==(a=this.j)||a.clear()}static publish(a,
514
- b){return w(function*(){yield olympe.L.$h().request(a,se,b)})}static send(a,b,c={}){return olympe.L.$h().request(a,qe,b,c.timeout).then(d=>{switch(d.getType()){case we:break;case ye:throw Ce(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.L.$h().request(a,re,b,c.timeout).then(d=>{switch(d.getType()){case ze:d=d.j;if(null!==d)return d;throw Error('No payload after request to service: '+a);case ye:throw Ce(d);default:throw Error('Unsupported response type for a GET request');
515
- }})}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.N.onDestroy(b);jd(this.D,this.J,c=>{const d=new olympe.L.Zc(c,this.D,this);switch(c.getType()){case ue:var e=d.body().filter(g=>{let h;return!(null==(h=this.j)?0:fb(h,g))});d.vd(e).catch(g=>this.G.error('Not able to validate subscription keep alive',g));break;case ve:c=d.body();null==(e=this.j)||e.delete(c);let f;null==(f=this.F)||f.call(this,c);break;case se:a.next(d);break;default:this.D.vd(c,xe).then(()=>a.next(d))}}).catch(c=>
516
- {c='Failed to connect to the bus: '+c;this.G.error(c);a.error(Error(c))});return b})}};olympe.L.ub.prototype.listen=olympe.L.ub.prototype.listen;olympe.L.ub.get=olympe.L.ub.get;olympe.L.ub.send=olympe.L.ub.send;olympe.L.ub.publish=olympe.L.ub.publish;olympe.L.ub.prototype.stop=olympe.L.ub.prototype.stop;olympe.L.ub.prototype.setUnsubscriptionHandler=olympe.L.ub.prototype.Hs;olympe.L.ub.observe=olympe.L.ub.observe;olympe.L.oq=class{constructor(a){this.j=0;this.buffer=[];this.size=null;this.stream=new olympe.V.stream.yf;this.D=null!=a?a:()=>{}}write(a,b){const c=this;return w(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!==
517
- 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)}};olympe.L.xe={ug:1,Uf:2,zb:3,Cg:4,Sz:5,Tj:6,pc:7};olympe.L.Hi={Tj:1,fw:2,Et:3,we:5,tv:1,pD:2};olympe.L.Fe={ug:0,Yf:1,zb:2};olympe.L.Na.j={INIT:'initialize',CONNECTING:'connecting',Td:'disconnected',Ao:'disconnecting',rg:'connected',Ig:'reconnecting',zk:'waking',Kn:'awake',zb:'error'};olympe.L.Na.F={Ah:1,Ht:-1,Yt:-2,Xv:-3};olympe.L.Na.D={Ri:0,Xt:23};
518
- olympe.L.Na.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',
519
- 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={kf:'com.ConnectivityManager',nk:'com.ServerManager',Vn:'com.BusManager',Kl:'com.HttpManager',Ee:'com.Serializer',Ca:'com.Logger',br:'com.Source',sr:'com.Urls',NB:'com.peerFileSvcUrl'};
520
- olympe.L.U={yl:'defaultHost',Ev:'server.host',Gv:'server.port',Hv:'server.ssl',Wq:'server.basePath',Br:'server.wsPath',om:'server.reconnectionDelay',qq:'server.pingInterval',Ar:'server.messageTimeout',Iq:'server.retryHttpOnOverload',ql:'server.clientVersion',Zq:'server.serverVersion',Iv:'server.wakeUpService',Zs:'bus.host',$s:'bus.path',at:'bus.port',dt:'bus.vhost',bt:'bus.ssl',we:'bus.keepalive',xv:'bus.reschedulePings',ht:'bus.clientId',ft:'bus.clean',kt:'bus.connectTimeout',Wn:'bus.shortTimeout',
521
- kl:'bus.requestTimeout',Xn:'bus.subscriptionRefreshRate',qv:'bus.queueQoSZero',jl:'bus.allowGuest',qr:'bus.topicPrefix'};
522
- olympe.W.config(function(a){const b=olympe.host.Lg.Dh;F(a,olympe.L.U.yl,a.getParameter(olympe.host.U.lp));F(a,olympe.L.U.Wq,'OlympeServer');F(a,olympe.L.U.qr,'');Ya(a,'com.hostConfig',[olympe.host.U.kk,olympe.L.U.yl,olympe.L.U.Ev,olympe.L.U.Gv,olympe.L.U.Hv,olympe.L.U.Wq,olympe.L.U.Zs,olympe.L.U.dt,olympe.L.U.at,olympe.L.U.$s,olympe.L.U.bt],(e,f,g,h,k,l,n,p,q,r,t)=>{var u=a.getParameter(olympe.net.U.Vl);e=e===olympe.host.Lg.Dh;var x=['localhost','127.0.0.1'],y=(u=f.endsWith(u))&&e?`${f}-${b}`:f;g=
523
- null!=g?g:y;n=null!=n?n:y;const z=(y=x.includes(g))||u;u=(x=x.includes(n))||u;f=x?'/':f.split('.')[0];return{tn:g,un:null!=h?h:y?8080:z?e?85:80:443,vn:null!=k?k:!z,Es:l,Gw:n,Kw:null!=p?p:f,Iw:null!=q?q:x?15675:u?e?85:80:443,Hw:null!=r?r:x?'':'/mqtt',Jw:null!=t?t:!u}});F(a,olympe.L.U.Br,'websocket');F(a,olympe.L.U.om,5E3);F(a,olympe.L.U.qq,5E3);F(a,olympe.L.U.Ar,3E4);F(a,olympe.L.U.Iq,4E3);F(a,olympe.L.U.Zq,'7.5.0');F(a,olympe.L.U.we,30);F(a,olympe.L.U.kl,3E4);F(a,olympe.L.U.Wn,a.getParameter(olympe.L.U.kl));
524
- F(a,olympe.L.U.Xn,6E4);F(a,olympe.L.U.jl,!1);const c=a.getParameter(olympe.kg.U.To);if(void 0!==c)Ua(a,olympe.L.U.ql,c);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');E(a,olympe.L.P.Ca,[olympe.ja.P.Da],e=>e.cd('communication'));E(a,'server.WebSocketRequest',[new olympe.W.ph('com.hostConfig'),new olympe.W.pa(olympe.L.U.Br)],(e,f)=>e.pipe(rxjs.operators.map(({tn:g,un:h,vn:k,Es:l})=>new olympe.net.Yi(g,h,(l+'/'+f).replace(/\/+/g,'/').replace(/\/$/,
525
- ''),k))).pipe(rxjs.operators.shareReplay(1)));E(a,'server.wakeUpRequest',[new olympe.W.ph('com.hostConfig'),new olympe.W.pa(olympe.L.U.Iv)],(e,f)=>e.pipe(rxjs.operators.map(({tn:g,un:h,vn:k})=>{if(null===f||void 0===f)return null;const l=f.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.Yi(g,h,l,k)})).pipe(rxjs.operators.shareReplay(1)));const d=Array.from(Object.values(olympe.L.Yb));E(a,olympe.L.P.sr,[new olympe.W.ph('com.hostConfig'),...d.map(e=>new olympe.W.pa(e))],(e,...f)=>e.pipe(rxjs.operators.map(({tn:g,
526
- un:h,vn:k,Es:l})=>{const n=d.map((p,q)=>{q=f[q];q=(new olympe.net.Ai(g,h,`${l}${q?'/'+q:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).j();return[p,q]});return new Map(n)})).pipe(rxjs.operators.shareReplay(1)));D(a,olympe.L.P.Ee,olympe.L.ec);D(a,olympe.L.P.Kl,olympe.L.Mt,olympe.L.P.Ca,olympe.net.P.Da,olympe.V.P.ag,olympe.L.P.sr,new olympe.W.pa(olympe.L.U.Iq));E(a,'com.server.ManagerConfig',[new olympe.W.pa(olympe.L.U.qq),new olympe.W.pa(olympe.L.U.Ar),new olympe.W.pa(olympe.L.U.ql),new olympe.W.pa(olympe.L.U.Zq),
527
- new olympe.W.pa(olympe.dc.U.Ih)],(...e)=>{const f=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],g=new Map;e.forEach((h,k)=>g.set(f[k],h));return g});D(a,olympe.L.P.nk,olympe.L.Na,olympe.L.P.Ca,olympe.net.P.Da,olympe.host.P.Re,olympe.host.P.rk,'server.WebSocketRequest','server.wakeUpRequest',olympe.V.P.ag,'com.server.ManagerConfig');Ya(a,'com.bus.TopicPrefix',[olympe.host.U.kk,olympe.L.U.qr],(e,f)=>e===olympe.host.Lg.Dh?`${b}-${f}`:f);E(a,'com.bus.ManagerConfig',
528
- [new olympe.W.ph('com.hostConfig'),new olympe.W.ph('com.bus.TopicPrefix'),new olympe.W.pa(olympe.L.U.jl),new olympe.W.pa(olympe.L.U.Wn),new olympe.W.pa(olympe.L.U.kl),new olympe.W.pa(olympe.L.U.Xn),new olympe.W.pa(olympe.L.U.we),new olympe.W.pa(olympe.L.U.xv),new olympe.W.pa(olympe.L.U.ht),new olympe.W.pa(olympe.L.U.ft),new olympe.W.pa(olympe.L.U.om),new olympe.W.pa(olympe.L.U.kt),new olympe.W.pa(olympe.L.U.qv)],(e,f,g,h,k,l,...n)=>{e=e.pipe(rxjs.operators.map(({Gw:p,Hw:q,Iw:r,Kw:t,Jw:u})=>{p=`${u?
529
- 'wss://':'ws://'}${p}:${r}${q}/ws`;const x='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero shortTimeout requestTimeout'.split(' ');q=n.reduce((y,z,A)=>{y[x[A]]=z;return y},{});q.url=p;q.vhost=t;return q})).pipe(rxjs.operators.shareReplay(1));return new Map([['connection',e],['topicPrefix',f],['allowGuest',g],['shortTimeout',h],['requestTimeout',k],['subscriptionsRefreshRate',l]])});D(a,olympe.L.P.Vn,olympe.L.Zn,olympe.L.P.Ca,olympe.net.P.Da,olympe.L.P.kf,olympe.auth.P.Da,
530
- olympe.host.P.Re,olympe.L.P.Ee,olympe.V.P.ag,'com.bus.ManagerConfig');E(a,'com.connectivity.ManagerConfig',[olympe.net.P.cm,olympe.Db.P.Og,new olympe.W.pa(olympe.L.U.om)],(e,...f)=>['storagePrefix','reconnectionDelay'].reduce((g,h,k)=>g.set(h,f[k]),e));D(a,olympe.L.P.kf,olympe.L.uc,olympe.L.P.Ca,olympe.L.P.nk,olympe.net.P.Da,olympe.host.P.Re,olympe.Db.P.Wl,'com.connectivity.ManagerConfig')},'olympe.communication');
531
- olympe.W.run([olympe.L.P.Vn,olympe.L.P.kf],(a,b)=>{olympe.L.$h=()=>a;olympe.L.Ym=()=>b});olympe.auth={};function De(a,b){Zd(a.j);Rd(a.j,olympe.L.xe.Cg,c=>{const d=c.c;d===olympe.auth.pd.j.Hu?(a.j.Vd(),b(olympe.auth.Ta.D.yj,c)):d===olympe.auth.pd.j.Cv&&b(olympe.auth.Ta.D.rp,c)},'logoutHandler')}
532
- function Ee(a,b,c){const d=null==b?void 0:b.tf();if(b instanceof olympe.auth.bk){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.Bd();h.access_token=Fe(b);g=`${Ld(a.wh,olympe.L.Yb.Zj)}/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 Wd(a.j,
533
- olympe.L.xe.Cg,Object.assign({},{c:olympe.auth.pd.j.Iu},d&&{idpName:d}),c)}function Ge(a,b,c,d){olympe.C.Pa(a.J.getState())===olympe.L.uc.j.ye?d(new olympe.L.errors.mq('Working offline'),'Working offline'):(c.c=b,Wd(a.j,olympe.L.xe.Cg,c,d))}
534
- function He(a,b,c){if(b.Bg()!==olympe.auth.Dc.j.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.tf()}&access_token=${Fe(b)}`;d=`${Ld(a.wh,olympe.L.Yb.Zj)}/refresh${d}`;d=Cc(N(d),olympe.net.wa.ResponseType.JSON);Nd(a.wh,d,b.Bd()).then(e=>{(e=e.getData())?(e=new olympe.auth.bk(b.Bc(),b.ne(),b.Bd(),e,b.tf()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
535
- olympe.auth.pd=class{constructor(a,b,c,d,e,f){this.G=a;this.j=b;this.wh=c;this.J=d;this.D=e;this.F=f;Ie(this.F).then(g=>{g&&this.F.db.remove('main','redirectTo').then(()=>{this.D.redirect(g,null,olympe.auth.mk.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}`)})}ff(a){Wd(this.j,olympe.L.xe.Cg,{c:olympe.auth.pd.j.we},b=>a(b))}dh(a,b,c){const d=Ld(this.wh,olympe.L.Yb.ur);
536
- a=N(`${d}/${a}`);Nd(this.wh,a,b).then(e=>c(null,e.getData())).catch(e=>c(Error(e)))}};olympe.auth.pd.j={Cg:1,Iu:2,zb:3,we:5,Ri:6,Qt:10,Pv:11,Os:12,SAML:13,Cv:14,Hu:20};function Bd(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.V.Zh());a.ba.set(c,b)}function rd(a){return olympe.C.Pa(a.j.rb())}
537
- function ee(){var a=olympe.auth.ke();const b=olympe.auth.Ta.j.zj,c=olympe.auth.Ta.j.INIT;Je(a,b);a.Ga?(a.F=olympe.auth.Ta.F.Ns,a.G.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),Ke(a)):(a.F=olympe.auth.Ta.F.Ti,a.G.log('Connector online, attempting to log with token'),Le(a));return rxjs.firstValueFrom(a.D.rb().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
538
- function Me(a){a.G.log('Initializing AUTH layer');let b=a.Ub;if('object'===typeof location){const c=location.hash;let d=c.indexOf('authToken=');-1<d&&(b=c.substring(d+10),'&'===c[d-1]&&d--,location.hash=c.substring(0,d))}b&&a.storage&&Ne(a.storage,b).catch(c=>a.G.error(c));a.G.debug('Asking to be notified when auth connector gets online');olympe.C.Sc([a.$a.getState()],c=>{switch(c){case olympe.L.uc.j.ye:a.F=olympe.auth.Ta.F.Ti;a.G.log('Connector offline, attempting to recover sessions from current token');
539
- Le(a);break;case olympe.L.uc.j.Td:switch(olympe.C.Pa(a.D)){case olympe.auth.Ta.j.gf:c=olympe.C.Pa(a.j).Bc();Oe(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ta.j.xi:a.G.info('Disconnected from server - guest session lost');break;case olympe.auth.Ta.j.zj:Oe(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Ta.j.INIT:Oe(a,'Cannot open auth session - no server connection');break;default:Oe(a,'Should not get there, investigate',!0)}}});De(a.J,
540
- (c,d)=>{if(c===olympe.auth.Ta.D.yj){Oe(a,'authentication revoked');let e;null==(e=a.storage)||Pe(e).catch(f=>a.G.error('Failed to clear token',f));a.ba.forEach(f=>{f(c,d)})}else if(c===olympe.auth.Ta.D.rp){a.G.info('Redirection to IDP to invalidate token (SAML)');rd(a);let e;null==(e=a.storage)||Pe(e).catch(f=>a.G.error('Failed to clear token',f));a.fb.D()}else throw Error(`Unknown logout step coming from server : ${c}`);});a.ua=Qe(a);a.R.D(()=>a.fi().catch(c=>a.G.error(`Failed to logout ${c}`)),
541
- 'Logout');a.G.log('DONE initializing AUTH layer (waiting for connector to be online)')}function Re(a,b){let c=null;olympe.C.oj(a.D.rb().Fd(olympe.auth.Ta.j.gf).and(b),()=>{const d=rd(a);!Se(a)&&d&&(c=a.Rd.get(d.Bg()).J(d,(e,f)=>{e?(a.G.error('Failed to refresh token, error message: ',e.message),a.fi().catch(g=>a.G.error(`Failed to logout after wrong refresh ${g}`))):f&&Te(a,f)}))},()=>{let d;null==(d=c)||d()})}
542
- function Le(a){null!==a.storage?(a.G.debug('Retrieving token from local storage'),a.storage.me().then(b=>{if(b){const e=new olympe.auth.Request;var c=b.Bc();e.set('username',c);c=e;var d=b.Bd();c.set('nonce',d);'string'===typeof b.tf()&&e.set('idpName',b.tf());a.G.debug('Token found, trying login with',e);Ue(a,e,olympe.auth.Dc.j.em)}else Oe(a,'No token found, cannot perform auto login')}).catch(b=>{Oe(a,b.message,!0)})):Oe(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
543
- !0)}function Oe(a,b,c=!1){a.j.update(a.$);Je(a,olympe.auth.Ta.j.xi);b=`Authenticated as guest (${b})`;c?a.G.error(b):a.G.info(b)}function Qe(a){const b=[olympe.auth.Ta.j.gf];a.Ga||b.push(olympe.auth.Ta.j.xi);return a.R.j(()=>{const c=Ve(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 Je(a,b){a.G.log('State change: ',Ve(a),'--\x3e',b);a.D.update(b)}
544
- function Ke(a){if(a.Y){const b=new olympe.auth.Request;b.set('username',a.Y);b.set('password',a.Bb);a.G.log('Autologin with user "'+a.Y+'"');Ue(a,b)}else Oe(a,'No user specified for auto login',!0)}function Se(a){return olympe.C.Pa(a.j)===a.$}function Te(a,b){if(b){a.j.update(b);let c;null==(c=a.storage)||Ne(c,b).catch(d=>a.G.error(d));a.G.debug('Token updated')}}function Ve(a){return olympe.C.Pa(a.D.rb())}function We(){var a=olympe.public.Ma.get();return new Map(a.J.j.Kc)}
545
- function Xe(a,b,c,d=!1){b=b+c?':'+c.message:'';a.G.error(b);a.error.update(olympe.C.xb(b));Je(a,olympe.auth.Ta.j.zb);if(d)throw Error(b);}function Ue(a,b,c,d){void 0===c&&(c=a.Eb);void 0===c&&Xe(a,'No authentication provider specified',null,!0);const e=a.Rd.get(c);e||Xe(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.N.set('login',d);a.G.log('Sending authentication request using "'+c+'" for '+b);e.me(b,a.$b.bind(a));Je(a,olympe.auth.Ta.j.zj)}
513
+ return l})).pipe(nb(olympe.L.errors.Pi,(g,h)=>{olympe.ja.$a(`Service ${a}`).debug(`Subscribed to topic ${g.T()} now that we are back online, after waiting for ${h}ms`);let k;null==(k=d.onRetry)||k.call(d)}))}Qs(a){this.F=a;return this}stop(){this.N.destroy()}clear(){vd(this.D,this.H).catch(b=>this.G.error('Failed to unsubscribe from '+this.H+', error: '+b));if(this.F){let b;null==(b=this.j)||b.forEach(c=>{let d;return null==(d=this.F)?void 0:d.call(this,c)})}let a;null==(a=this.j)||a.clear()}static publish(a,
514
+ b){return w(function*(){yield olympe.L.ei().request(a,se,b)})}static send(a,b,c={}){return olympe.L.ei().request(a,qe,b,c.timeout).then(d=>{switch(d.getType()){case we:break;case ye:throw Ce(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.L.ei().request(a,re,b,c.timeout).then(d=>{switch(d.getType()){case ze:d=d.j;if(null!==d)return d;throw Error('No payload after request to service: '+a);case ye:throw Ce(d);default:throw Error('Unsupported response type for a GET request');
515
+ }})}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.N.onDestroy(b);jd(this.D,this.H,c=>{const d=new olympe.L.Zc(c,this.D,this);switch(c.getType()){case ue:var e=d.body().filter(g=>{let h;return!(null==(h=this.j)?0:fb(h,g))});d.vd(e).catch(g=>this.G.error('Not able to validate subscription keep alive',g));break;case ve:c=d.body();null==(e=this.j)||e.delete(c);let f;null==(f=this.F)||f.call(this,c);break;case se:a.next(d);break;default:this.D.vd(c,xe).then(()=>a.next(d))}}).catch(c=>
516
+ {c='Failed to connect to the bus: '+c;this.G.error(c);a.error(Error(c))});return b})}};olympe.L.ub.prototype.listen=olympe.L.ub.prototype.listen;olympe.L.ub.get=olympe.L.ub.get;olympe.L.ub.send=olympe.L.ub.send;olympe.L.ub.publish=olympe.L.ub.publish;olympe.L.ub.prototype.stop=olympe.L.ub.prototype.stop;olympe.L.ub.prototype.setUnsubscriptionHandler=olympe.L.ub.prototype.Qs;olympe.L.ub.observe=olympe.L.ub.observe;olympe.L.vq=class{constructor(a){this.j=0;this.buffer=[];this.size=null;this.stream=new olympe.V.stream.Cf;this.D=null!=a?a:()=>{}}write(a,b){const c=this;return w(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!==
517
+ 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)}};olympe.L.ze={zg:1,Xf:2,Ab:3,Gg:4,bA:5,$j:6,oc:7};olympe.L.Ni={$j:1,pw:2,Nt:3,ye:5,Cv:1,xD:2};olympe.L.He={zg:0,bg:1,Ab:2};olympe.L.Na.j={INIT:'initialize',CONNECTING:'connecting',Wd:'disconnected',Go:'disconnecting',wg:'connected',Mg:'reconnecting',Gk:'waking',Qn:'awake',Ab:'error'};olympe.L.Na.F={Eh:1,Qt:-1,gu:-2,gw:-3};olympe.L.Na.D={Yi:0,fu:23};
518
+ olympe.L.Na.oc={0:'OK',1:'SRP Authentication First Step Failed',2:'SRP Authentication Last Step Failed',3:'SRP Authentication Bad Credentials',4:'AutoLogin Authentication Failed',5:'AutoLogin Authentication Token Invalid',6:'Logout Failed',7:'SAML Request Generation Failed',8:'SAML Authentication Save Failed',9:'Invalid SAML Response',10:'SAML User Not Found',11:'Transaction Failed',12:'GetContext Failed',13:'Notification Failed',15:'FileService Clean Failed',17:'Try to subscribe multiple times',
519
+ 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={pf:'com.ConnectivityManager',vk:'com.ServerManager',ao:'com.BusManager',Ql:'com.HttpManager',Ge:'com.Serializer',Ca:'com.Logger',ir:'com.Source',zr:'com.Urls',WB:'com.peerFileSvcUrl'};
520
+ olympe.L.U={El:'defaultHost',Ov:'server.host',Qv:'server.port',Rv:'server.ssl',cr:'server.basePath',Ir:'server.wsPath',vm:'server.reconnectionDelay',xq:'server.pingInterval',Hr:'server.messageTimeout',Pq:'server.retryHttpOnOverload',wl:'server.clientVersion',fr:'server.serverVersion',Sv:'server.wakeUpService',it:'bus.host',jt:'bus.path',kt:'bus.port',mt:'bus.vhost',lt:'bus.ssl',ye:'bus.keepalive',Hv:'bus.reschedulePings',qt:'bus.clientId',ot:'bus.clean',tt:'bus.connectTimeout',bo:'bus.shortTimeout',
521
+ rl:'bus.requestTimeout',co:'bus.subscriptionRefreshRate',Av:'bus.queueQoSZero',ql:'bus.allowGuest',xr:'bus.topicPrefix'};
522
+ olympe.W.config(function(a){const b=olympe.host.Pg.Hh;F(a,olympe.L.U.El,a.getParameter(olympe.host.U.rp));F(a,olympe.L.U.cr,'OlympeServer');F(a,olympe.L.U.xr,'');Ya(a,'com.hostConfig',[olympe.host.U.sk,olympe.L.U.El,olympe.L.U.Ov,olympe.L.U.Qv,olympe.L.U.Rv,olympe.L.U.cr,olympe.L.U.it,olympe.L.U.mt,olympe.L.U.kt,olympe.L.U.jt,olympe.L.U.lt],(e,f,g,h,k,l,n,p,q,r,t)=>{var u=a.getParameter(olympe.net.U.am);e=e===olympe.host.Pg.Hh;var x=['localhost','127.0.0.1'],y=(u=f.endsWith(u))&&e?`${f}-${b}`:f;g=
523
+ null!=g?g:y;n=null!=n?n:y;const z=(y=x.includes(g))||u;u=(x=x.includes(n))||u;f=x?'/':f.split('.')[0];return{zn:g,An:null!=h?h:y?8080:z?e?85:80:443,Bn:null!=k?k:!z,Ms:l,Qw:n,Uw:null!=p?p:f,Sw:null!=q?q:x?15675:u?e?85:80:443,Rw:null!=r?r:x?'':'/mqtt',Tw:null!=t?t:!u}});F(a,olympe.L.U.Ir,'websocket');F(a,olympe.L.U.vm,5E3);F(a,olympe.L.U.xq,5E3);F(a,olympe.L.U.Hr,3E4);F(a,olympe.L.U.Pq,4E3);F(a,olympe.L.U.fr,'7.5.0');F(a,olympe.L.U.ye,30);F(a,olympe.L.U.rl,3E4);F(a,olympe.L.U.bo,a.getParameter(olympe.L.U.rl));
524
+ F(a,olympe.L.U.co,6E4);F(a,olympe.L.U.ql,!1);const c=a.getParameter(olympe.pg.U.Zo);if(void 0!==c)Ua(a,olympe.L.U.wl,c);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');E(a,olympe.L.P.Ca,[olympe.ja.P.Da],e=>e.cd('communication'));E(a,'server.WebSocketRequest',[new olympe.W.th('com.hostConfig'),new olympe.W.pa(olympe.L.U.Ir)],(e,f)=>e.pipe(rxjs.operators.map(({zn:g,An:h,Bn:k,Ms:l})=>new olympe.net.ej(g,h,(l+'/'+f).replace(/\/+/g,'/').replace(/\/$/,
525
+ ''),k))).pipe(rxjs.operators.shareReplay(1)));E(a,'server.wakeUpRequest',[new olympe.W.th('com.hostConfig'),new olympe.W.pa(olympe.L.U.Sv)],(e,f)=>e.pipe(rxjs.operators.map(({zn:g,An:h,Bn:k})=>{if(null===f||void 0===f)return null;const l=f.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.ej(g,h,l,k)})).pipe(rxjs.operators.shareReplay(1)));const d=Array.from(Object.values(olympe.L.Yb));E(a,olympe.L.P.zr,[new olympe.W.th('com.hostConfig'),...d.map(e=>new olympe.W.pa(e))],(e,...f)=>e.pipe(rxjs.operators.map(({zn:g,
526
+ An:h,Bn:k,Ms:l})=>{const n=d.map((p,q)=>{q=f[q];q=(new olympe.net.Gi(g,h,`${l}${q?'/'+q:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).j();return[p,q]});return new Map(n)})).pipe(rxjs.operators.shareReplay(1)));D(a,olympe.L.P.Ge,olympe.L.cc);D(a,olympe.L.P.Ql,olympe.L.Vt,olympe.L.P.Ca,olympe.net.P.Da,olympe.V.P.eg,olympe.L.P.zr,new olympe.W.pa(olympe.L.U.Pq));E(a,'com.server.ManagerConfig',[new olympe.W.pa(olympe.L.U.xq),new olympe.W.pa(olympe.L.U.Hr),new olympe.W.pa(olympe.L.U.wl),new olympe.W.pa(olympe.L.U.fr),
527
+ new olympe.W.pa(olympe.dc.U.Mh)],(...e)=>{const f=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],g=new Map;e.forEach((h,k)=>g.set(f[k],h));return g});D(a,olympe.L.P.vk,olympe.L.Na,olympe.L.P.Ca,olympe.net.P.Da,olympe.host.P.Ue,olympe.host.P.yk,'server.WebSocketRequest','server.wakeUpRequest',olympe.V.P.eg,'com.server.ManagerConfig');Ya(a,'com.bus.TopicPrefix',[olympe.host.U.sk,olympe.L.U.xr],(e,f)=>e===olympe.host.Pg.Hh?`${b}-${f}`:f);E(a,'com.bus.ManagerConfig',
528
+ [new olympe.W.th('com.hostConfig'),new olympe.W.th('com.bus.TopicPrefix'),new olympe.W.pa(olympe.L.U.ql),new olympe.W.pa(olympe.L.U.bo),new olympe.W.pa(olympe.L.U.rl),new olympe.W.pa(olympe.L.U.co),new olympe.W.pa(olympe.L.U.ye),new olympe.W.pa(olympe.L.U.Hv),new olympe.W.pa(olympe.L.U.qt),new olympe.W.pa(olympe.L.U.ot),new olympe.W.pa(olympe.L.U.vm),new olympe.W.pa(olympe.L.U.tt),new olympe.W.pa(olympe.L.U.Av)],(e,f,g,h,k,l,...n)=>{e=e.pipe(rxjs.operators.map(({Qw:p,Rw:q,Sw:r,Uw:t,Tw:u})=>{p=`${u?
529
+ 'wss://':'ws://'}${p}:${r}${q}/ws`;const x='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero shortTimeout requestTimeout'.split(' ');q=n.reduce((y,z,A)=>{y[x[A]]=z;return y},{});q.url=p;q.vhost=t;return q})).pipe(rxjs.operators.shareReplay(1));return new Map([['connection',e],['topicPrefix',f],['allowGuest',g],['shortTimeout',h],['requestTimeout',k],['subscriptionsRefreshRate',l]])});D(a,olympe.L.P.ao,olympe.L.fo,olympe.L.P.Ca,olympe.net.P.Da,olympe.L.P.pf,olympe.auth.P.Da,
530
+ olympe.host.P.Ue,olympe.L.P.Ge,olympe.V.P.eg,'com.bus.ManagerConfig');E(a,'com.connectivity.ManagerConfig',[olympe.net.P.jm,olympe.Eb.P.Sg,new olympe.W.pa(olympe.L.U.vm)],(e,...f)=>['storagePrefix','reconnectionDelay'].reduce((g,h,k)=>g.set(h,f[k]),e));D(a,olympe.L.P.pf,olympe.L.tc,olympe.L.P.Ca,olympe.L.P.vk,olympe.net.P.Da,olympe.host.P.Ue,olympe.Eb.P.bm,'com.connectivity.ManagerConfig')},'olympe.communication');
531
+ olympe.W.run([olympe.L.P.ao,olympe.L.P.pf],(a,b)=>{olympe.L.ei=()=>a;olympe.L.cn=()=>b});olympe.auth={};function De(a,b){Zd(a.j);Rd(a.j,olympe.L.ze.Gg,c=>{const d=c.c;d===olympe.auth.pd.j.Qu?(a.j.$e(),b(olympe.auth.Ta.D.Fj,c)):d===olympe.auth.pd.j.Mv&&b(olympe.auth.Ta.D.xp,c)},'logoutHandler')}
532
+ function Ee(a,b,c){const d=null==b?void 0:b.xf();if(b instanceof olympe.auth.ik){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.Cd();h.access_token=Fe(b);g=`${Ld(a.Ah,olympe.L.Yb.fk)}/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 Wd(a.j,
533
+ olympe.L.ze.Gg,Object.assign({},{c:olympe.auth.pd.j.Ru},d&&{idpName:d}),c)}function Ge(a,b,c,d){olympe.C.Pa(a.H.getState())===olympe.L.tc.j.Ae?d(new olympe.L.errors.tq('Working offline'),'Working offline'):(c.c=b,Wd(a.j,olympe.L.ze.Gg,c,d))}
534
+ function He(a,b,c){if(b.Fg()!==olympe.auth.Ec.j.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.xf()}&access_token=${Fe(b)}`;d=`${Ld(a.Ah,olympe.L.Yb.fk)}/refresh${d}`;d=Cc(N(d),olympe.net.va.ResponseType.JSON);Nd(a.Ah,d,b.Cd()).then(e=>{(e=e.getData())?(e=new olympe.auth.ik(b.Cc(),b.pe(),b.Cd(),e,b.xf()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
535
+ olympe.auth.pd=class{constructor(a,b,c,d,e,f){this.G=a;this.j=b;this.Ah=c;this.H=d;this.D=e;this.F=f;Ie(this.F).then(g=>{g&&this.F.db.remove('main','redirectTo').then(()=>{this.D.redirect(g,null,olympe.auth.uk.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}`)})}kf(a){Wd(this.j,olympe.L.ze.Gg,{c:olympe.auth.pd.j.ye},b=>a(b))}hh(a,b,c){const d=Ld(this.Ah,olympe.L.Yb.Br);
536
+ a=N(`${d}/${a}`);Nd(this.Ah,a,b).then(e=>c(null,e.getData())).catch(e=>c(Error(e)))}};olympe.auth.pd.j={Gg:1,Ru:2,Ab:3,ye:5,Yi:6,Zt:10,Zv:11,Xs:12,SAML:13,Mv:14,Qu:20};function Bd(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.V.di());a.da.set(c,b)}function rd(a){return olympe.C.Pa(a.j.rb())}
537
+ function ee(){var a=olympe.auth.me();const b=olympe.auth.Ta.j.Gj,c=olympe.auth.Ta.j.INIT;Je(a,b);a.Ha?(a.F=olympe.auth.Ta.F.Ws,a.G.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),Ke(a)):(a.F=olympe.auth.Ta.F.$i,a.G.log('Connector online, attempting to log with token'),Le(a));return rxjs.firstValueFrom(a.D.rb().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
538
+ function Me(a){a.G.log('Initializing AUTH layer');let b=a.vc;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&&Ne(a.storage,b).catch(c=>a.G.error(c));a.G.debug('Asking to be notified when auth connector gets online');olympe.C.Sc([a.cb.getState()],c=>{switch(c){case olympe.L.tc.j.Ae:a.F=olympe.auth.Ta.F.$i;a.G.log('Connector offline, attempting to recover sessions from current token');
539
+ Le(a);break;case olympe.L.tc.j.Wd:switch(olympe.C.Pa(a.D)){case olympe.auth.Ta.j.lf:c=olympe.C.Pa(a.j).Cc();Oe(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ta.j.Di:a.G.info('Disconnected from server - guest session lost');break;case olympe.auth.Ta.j.Gj:Oe(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Ta.j.INIT:Oe(a,'Cannot open auth session - no server connection');break;default:Oe(a,'Should not get there, investigate',!0)}}});De(a.H,
540
+ (c,d)=>{if(c===olympe.auth.Ta.D.Fj){Oe(a,'authentication revoked');let e;null==(e=a.storage)||Pe(e).catch(f=>a.G.error('Failed to clear token',f));a.da.forEach(f=>{f(c,d)})}else if(c===olympe.auth.Ta.D.xp){a.G.info('Redirection to IDP to invalidate token (SAML)');rd(a);let e;null==(e=a.storage)||Pe(e).catch(f=>a.G.error('Failed to clear token',f));a.jb.D()}else throw Error(`Unknown logout step coming from server : ${c}`);});a.wa=Qe(a);a.R.D(()=>a.ki().catch(c=>a.G.error(`Failed to logout ${c}`)),
541
+ 'Logout');a.G.log('DONE initializing AUTH layer (waiting for connector to be online)')}function Re(a,b){let c=null;olympe.C.vj(a.D.rb().Fd(olympe.auth.Ta.j.lf).and(b),()=>{const d=rd(a);!Se(a)&&d&&(c=a.Ud.get(d.Fg()).H(d,(e,f)=>{e?(a.G.error('Failed to refresh token, error message: ',e.message),a.ki().catch(g=>a.G.error(`Failed to logout after wrong refresh ${g}`))):f&&Te(a,f)}))},()=>{let d;null==(d=c)||d()})}
542
+ function Le(a){null!==a.storage?(a.G.debug('Retrieving token from local storage'),a.storage.oe().then(b=>{if(b){const e=new olympe.auth.Request;var c=b.Cc();e.set('username',c);c=e;var d=b.Cd();c.set('nonce',d);'string'===typeof b.xf()&&e.set('idpName',b.xf());a.G.debug('Token found, trying login with',e);Ue(a,e,olympe.auth.Ec.j.km)}else Oe(a,'No token found, cannot perform auto login')}).catch(b=>{Oe(a,b.message,!0)})):Oe(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
543
+ !0)}function Oe(a,b,c=!1){a.j.update(a.$);Je(a,olympe.auth.Ta.j.Di);b=`Authenticated as guest (${b})`;c?a.G.error(b):a.G.info(b)}function Qe(a){const b=[olympe.auth.Ta.j.lf];a.Ha||b.push(olympe.auth.Ta.j.Di);return a.R.j(()=>{const c=Ve(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 Je(a,b){a.G.log('State change: ',Ve(a),'--\x3e',b);a.D.update(b)}
544
+ function Ke(a){if(a.Y){const b=new olympe.auth.Request;b.set('username',a.Y);b.set('password',a.zb);a.G.log('Autologin with user "'+a.Y+'"');Ue(a,b)}else Oe(a,'No user specified for auto login',!0)}function Se(a){return olympe.C.Pa(a.j)===a.$}function Te(a,b){if(b){a.j.update(b);let c;null==(c=a.storage)||Ne(c,b).catch(d=>a.G.error(d));a.G.debug('Token updated')}}function Ve(a){return olympe.C.Pa(a.D.rb())}function We(){var a=olympe.public.Ma.get();return new Map(a.H.j.Id)}
545
+ function Xe(a,b,c,d=!1){b=b+c?':'+c.message:'';a.G.error(b);a.error.update(olympe.C.xb(b));Je(a,olympe.auth.Ta.j.Ab);if(d)throw Error(b);}function Ue(a,b,c,d){void 0===c&&(c=a.Mb);void 0===c&&Xe(a,'No authentication provider specified',null,!0);const e=a.Ud.get(c);e||Xe(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.N.set('login',d);a.G.log('Sending authentication request using "'+c+'" for '+b);e.oe(b,a.zc.bind(a));Je(a,olympe.auth.Ta.j.Gj)}
546
546
  function Ye(a,b,c){a.N.forEach(d=>{d(b,c)})}
547
- olympe.auth.Ta=class{constructor(a,b,c,d,e,f,g,h,k){this.G=a;this.$a=b;this.J=c;this.storage=d;this.fb=e;this.Eb=k.get('defaultProvider');this.Ga=!!k.get('autoLogin');this.Y=k.get('autoUser');this.Bb=k.get('autoPassword');this.Ub=k.get('autoToken');this.Rd=new Map;this.R=f;this.ua='';this.D=olympe.C.cc(String).update(olympe.auth.Ta.j.INIT);this.error=olympe.C.cc(olympe.C.Sa);this.F=null;this.$=new olympe.auth.Sg('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.j=olympe.C.cc(olympe.auth.Sg).update(this.$);
548
- this.N=new Map;this.ba=new Map;this.fa=new olympe.V.Jh(k.get('cacheTokenTimeout'));h.forEach(l=>{const n=l.F();if(this.Rd.has(n))throw Error('Provider "'+n+'" has already been registered !');this.Rd.set(n,l)});Me(this);Re(this,g.j())}Sk(){const a=olympe.auth.Ta.j.gf,b=olympe.auth.Ta.j.xi,c=olympe.auth.Ta.j.zb,d=olympe.C.cc(olympe.C.ea);olympe.C.Sc([this.D],e=>{e===a?d.update(olympe.C.ea.D):e===b?d.update(olympe.C.ea.j):e===c?(this.G.error('Authentication failed.'),d.update(olympe.C.ea.j)):d.clear()});
549
- return d.rb()}lg(a){if(olympe.C.Pa(this.D)===olympe.auth.Ta.j.gf){var b=rd(this);!Se(this)&&b&&this.Rd.get(b.Bg()).lg(b,(c,d)=>{c?(this.G.error('Failed to refresh token, error message: ',c.message),this.fi().catch(e=>this.G.error(`Failed to logout after wrong refresh ${e}`))):d&&Te(this,d);a(c)})}}getState(){return this.D.rb()}Bc(){return this.j.rb().Bc()}ne(){return this.j.rb().ne()}bi(){return this.j.rb().bi()}dh(a,b){if(fb(this.fa.j,a))b(null,this.fa.get(a));else{var c,d=null==(c=olympe.C.Pa(this.j.rb()))?
550
- void 0:c.Bd();this.J.dh(a,d,(e,f)=>{'string'===typeof f&&this.fa.set(a,f);b(e,f)})}}fi(){return Se(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)||Pe(c).catch(d=>this.G.error('Failed to clear token',d));Ee(this.J,rd(this),d=>{d?(Xe(this,'Logout request rejected:',d),b(d)):(this.G.debug('Logout request acknowledged'),a())});this.R.F(this.ua)})}ff(a){Ve(this)===olympe.auth.Ta.j.gf&&
551
- this.J.ff(b=>{b&&this.G.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}$b(a,b){const c=null===this.F?olympe.auth.Ta.F.Ou:this.F;this.F=null;if(!a||a instanceof olympe.L.errors.mq){null===a?this.G.info(`User ${b.Bc()} (#${b.ne()}) successfully authenticated`):this.G.info(`User ${b.Bc()} (#${b.ne()}) recovered from token, while offline`);this.j.update(b);Je(this,olympe.auth.Ta.j.gf);Ye(this,a,c);let d;null==(d=this.storage)||Ne(d,b).catch(e=>this.G.error(e))}else{let d;
552
- null==(d=this.storage)||Pe(d).catch(e=>this.G.error(e));this.error.update(olympe.C.xb(a.message));Oe(this,'authentication rejected: '+a.message);Ye(this,a,c)}this.N.has('login')&&this.N.delete('login')}};olympe.auth.Ta.j={INIT:'init',zj:'authenticating',xi:'guest',gf:'authenticated',zb:'error'};olympe.auth.Ta.F={Ou:'manual',Ns:'auto',Ti:'tokenOnFirstConnection'};olympe.auth.Ta.D={yj:'accepted',rp:'redirect'};olympe.auth.Dc=class{constructor(a,b){this.G=a;this.D=b;this.j=null}F(){}me(){}J(a,b){const c=()=>{this.j=setTimeout(()=>this.D.ff(d=>{d?b(d,null):(b(null,null),c())}),this.D.j.Ec)};c();return()=>{this.j&&clearTimeout(this.j);this.j=null}}lg(a,b){this.D.ff(c=>{b(c,null)})}};olympe.auth.Dc.j={SAML:'saml',OAUTH2:'openID',SRP:'srp',em:'olympeToken'};function Ze(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.j=new Map}set(a,b){olympe.C.Sc([b],c=>{this.j.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.j.get(a.toLowerCase()))&&a.Tg&&(a=a.Ba.Fb);return a?a.valueOf():a}Bc(){return this.get('username')}Bd(){return this.get('nonce')}toString(){return this.Bc()+(this.Bd()?' with nonce':'')+(this.get('password')?' with password':'')+(Ze(this)?` with idp name ${Ze(this)}`:'')}};olympe.auth.Sg=class{constructor(a,b,c,d={},e=null){this.J=a;this.ii=b;this.D=c;this.j=e;this.F=d}Bc(){return this.J}ne(){return this.ii}Bd(){return this.D}Di(){return this.F}bi(){return null}tf(){return this.j}ga(){const a=olympe.V.Ze(),b=Object.assign({},{user:this.J,userTag:this.ii,nonce:this.D},this.j&&{idpName:this.j},{payload:this.F});return olympe.V.Ir(bb(a,JSON.stringify(b)))}Bg(){return olympe.auth.Dc.j.SRP}};m=olympe.auth.Sg.prototype;m.Bc.K=new olympe.C.H(()=>String,[]);
553
- m.ne.K=new olympe.C.H(()=>String,[]);m.Bd.K=new olympe.C.H(()=>String,[]);m.Di.K=new olympe.C.H(()=>Object,[]);m.bi.K=new olympe.C.H(()=>String,[]);m.tf.K=new olympe.C.H(()=>String,[]);m.ga.K=new olympe.C.H(()=>String,[]);m.Bg.K=new olympe.C.H(()=>String,[]);function Fe(a){return a.Di().access_token||null}function $e(a){return 1E3*parseInt(a.Di().access_token_exp||'0',10)}olympe.auth.bk=class extends olympe.auth.Sg{constructor(a,b,c,d,e){super(a,b,c,d,e);this.N=Date.now()}bi(){return Fe(this)}Bg(){return olympe.auth.Dc.j.OAUTH2}};olympe.auth.Tq=class extends olympe.auth.Sg{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.N=d}bi(){return this.N}Bg(){return olympe.auth.Dc.j.SAML}ga(){const a=olympe.V.Ze(),b=Object.assign({},{user:this.Bc(),userTag:this.ne(),nonce:this.Bd()},this.tf()&&{idpName:this.tf()},{payload:this.Di(),fullToken:this.N});return olympe.V.Ir(bb(a,JSON.stringify(b)))}};function Ie(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function Ne(a,b){return qb(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 Pe(a){return qb(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}`)}))}
554
- olympe.auth.Us=class{constructor(a,b,c){this.F=a;this.G=b;this.j='OlympeToken-'+c.j;this.D=new olympe.V.promise.wm;this.db=this.F.D('AUTH')}me(){this.G.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.j}`);return qb(this.D,()=>{const a=this;return w(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=
555
- d.parse;var f=cb(olympe.V.Ze().D(olympe.V.Ew(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.Tq(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.bk(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.Sg(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.mk=class{redirect(){}D(){}j(){}};olympe.auth.mk.j={GET:'GET',Ch:'POST'};olympe.auth.Nn=class{constructor(a){this.j=a||'default'}};olympe.auth.Rd={};function af(a,b,c){Ge(a.D,olympe.auth.pd.j.Cg,{token:b.Bd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.pd.j.zb:c(Error('Invalid token'),null);break;case olympe.auth.pd.j.Ri: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.Tq(f,g,h,e.samlToken,k,Ze(b)):'openid'===l&&(d=new olympe.auth.bk(f,g,h,k,Ze(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
556
- olympe.auth.Rd.Nu=class extends olympe.auth.Dc{constructor(a,b,c){super(a,b);this.storage=c}F(){return olympe.auth.Dc.j.em}me(a,b){this.storage.me().then(c=>{af(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function bf(a,b,c){var d=$e(b);const e=Math.max(d-b.N,0),f=olympe.W.getParameter(olympe.auth.U.mr);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.lg(b,c)},d);a.lg(b,c);return null}
557
- olympe.auth.Rd.dv=class extends olympe.auth.Dc{constructor(a,b,c,d){super(a,b);this.N=c;this.R=d}F(){return olympe.auth.Dc.j.OAUTH2}me(a){const b=encodeURIComponent(this.N.j());a=Ze(a)?`idpName=${Ze(a)}&`:'';this.N.redirect(`${this.R}/auth?${a}url=${b}`,null,olympe.auth.mk.j.GET)}J(a,b){0<$e(a)?this.j=bf(this,a,b):b(null,a);return this.Y.bind(this)}lg(a,b){He(this.D,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.j&&(this.j=bf(this,d,b)))})}Y(){this.j&&clearTimeout(this.j);this.j=null}};function cf(a,b){Ge(a.D,olympe.auth.pd.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.Rd.SAML=class extends olympe.auth.Dc{constructor(a,b,c){super(a,b);this.N=c}F(){return olympe.auth.Dc.j.SAML}me(a,b){cf(this,c=>{c?b(c,null):this.N.D(Ze(a))})}};function df(a,b,c){const d=olympe.auth.pd.j.Qt,e=olympe.auth.pd.j.zb,f=olympe.auth.pd.j.Pv,g={I:b.Bc()};Ge(a.D,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.Bc()}' 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'))}})}
558
- function ef(a,b,c){const d=olympe.auth.pd.j.Os,e=olympe.auth.pd.j.zb,f=olympe.auth.pd.j.Ri;b={A:b.get('a'),M:b.get('m1'),I:b.Bc()};Ge(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.Sg(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
559
- null)}})}olympe.auth.Rd.SRP=class extends olympe.auth.Dc{F(){return olympe.auth.Dc.j.SRP}me(a,b){const c=a.get('password');a.j.delete('password');this.G.debug('Sending SRP request');df(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.Bc(),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');ef(this,a,b)}})}};olympe.auth.P={Da:'auth.Manager',Ca:'auth.Logger',Qi:'auth.Storage',dl:'auth.appNameToken',ik:'auth.Redirector',Xq:'auth.ServerConnector'};olympe.auth.U={zl:'auth.defaultProvider',Hn:'auth.autoLogin',Jn:'auth.autoUser',In:'auth.autoPassword',Ti:'auth.token',ao:'auth.cacheTokenTimeout',mr:'auth.tokenDurationPercentage'};
560
- olympe.W.config(function(a){F(a,olympe.auth.U.zl,olympe.auth.Dc.j.SRP);F(a,olympe.auth.U.Hn,!1);F(a,olympe.auth.U.Jn,'');F(a,olympe.auth.U.In,'');F(a,olympe.auth.U.Ti,'');F(a,olympe.auth.U.mr,50);F(a,olympe.auth.U.ao,3E5);E(a,olympe.auth.P.Ca,[olympe.ja.P.Da],b=>b.cd('auth'));D(a,olympe.auth.P.dl,olympe.auth.Nn,olympe.Db.P.Og);D(a,olympe.auth.P.Qi,olympe.auth.Us,olympe.Db.P.Vj,olympe.auth.P.Ca,olympe.auth.P.dl);D(a,olympe.auth.P.Xq,olympe.auth.pd,olympe.auth.P.Ca,olympe.L.P.nk,olympe.L.P.Kl,olympe.L.P.kf,
561
- olympe.auth.P.ik,olympe.auth.P.Qi);Xa(a,olympe.auth.P.ik);E(a,olympe.auth.P.Da,[olympe.auth.P.Ca,olympe.L.P.kf,olympe.auth.P.Xq,olympe.host.P.Re,olympe.host.P.rk,new olympe.W.ub(olympe.auth.P.Qi,olympe.W.mh.j.am),new olympe.W.ub(olympe.auth.P.ik,olympe.W.mh.j.am),new olympe.W.pa(olympe.auth.U.zl),new olympe.W.pa(olympe.auth.U.Hn),new olympe.W.pa(olympe.auth.U.Jn),new olympe.W.pa(olympe.auth.U.In),new olympe.W.pa(olympe.auth.U.Ti),new olympe.W.pa(olympe.auth.U.ao)],(b,c,d,e,f,g,h,k,l,n,p,q,r)=>{const t=
562
- [new olympe.auth.Rd.Nu(b,d,g),new olympe.auth.Rd.SRP(b,d),new olympe.auth.Rd.SAML(b,d,h),new olympe.auth.Rd.dv(b,d,h,Ld(d.wh,olympe.L.Yb.Zj))];if(!t.map(u=>u.F()).includes(k))throw Error(`Default provider name ${k} given by parameter ${olympe.auth.U.zl} cannot be found`);return new olympe.auth.Ta(b,c,d,g,h,e,f,t,new Map([['defaultProvider',k],['autoLogin',l],['autoUser',n],['autoPassword',p],['autoToken',q],['cacheTokenTimeout',r]]))},!0)},'olympe.auth');
563
- olympe.W.run([olympe.auth.P.Da],a=>{olympe.auth.ke=()=>a});olympe.Va.node.auth={};olympe.Va.node.auth.aq=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.aq.xa=[olympe.auth.mk];olympe.W.config(a=>{D(a,olympe.auth.P.ik,olympe.Va.node.auth.aq)},'olympe.native.node.auth');olympe.Va.node.Db={};function ff(){throw Error('Key-Value Database does not implement this in NodeJS');}
564
- olympe.Va.node.Db.Zp=class{constructor(a){this.G=a;this.j=new Map}Y(){return 0}N(a){const b=this;return w(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 w(function*(){const c=b.j.get(a);return c?Array.from(c.values()):[]})}R(a){const b=this;return w(function*(){const c=b.j.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return w(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;
565
- return w(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 w(function*(){let d;return null==(d=c.j.get(a))?void 0:d.get(b)})}set(a,b,c){const d=this;return w(function*(){let e;return null==(e=d.j.get(a))?void 0:e.set(c,b)})}remove(a,b){const c=this;return w(function*(){let d;yield null==(d=c.j.get(a))?void 0:d.delete(b)})}ba(){ff();return Promise.resolve()}$(){ff();return Promise.resolve()}clear(a){const b=this;return w(function*(){let c;
566
- null==(c=b.j.get(a))||c.clear()})}J(){ff();return Promise.resolve([])}D(){return w(function*(){ff()})}};olympe.Va.node.Db.Zp.xa=[olympe.Db.Cu];olympe.Va.node.Db.$p=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.Zp(this.G));return this.j.get(a)}};olympe.Va.node.Db.$p.xa=[olympe.Db.Du];olympe.W.config(function(a){D(a,olympe.Db.P.Vj,olympe.Va.node.Db.$p,olympe.Db.P.Ca)},'olympe.native.node.localstorage');olympe.Va.node.storage={};olympe.Va.node.storage.Storage=class{constructor(a){this.G=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Va.node.storage.Storage.xa=[olympe.Db.Storage];olympe.W.config(function(a){Va(a,olympe.Db.P.Qi,olympe.Va.node.storage.Storage,olympe.host.P.Ca)},'olympe.native.html.storage');olympe.kg={};olympe.kg.U={VERSION:'version.version',Xs:'version.branch',jf:'version.commit',Wv:'version.tag',To:'version.olympe-framework',Ys:'version.build'};olympe.W.config(function(a){F(a,olympe.kg.U.VERSION,'');F(a,olympe.kg.U.Xs,'');F(a,olympe.kg.U.jf,'');F(a,olympe.kg.U.Wv,'');F(a,olympe.kg.U.To,'');F(a,olympe.kg.U.Ys,'')},'olympe.main');const gf=require('fs'),hf=require('fs/promises');let jf;const kf=null!=(jf=process.env.EXTRA_CONFIG_PATH)?jf:null;let lf;const Bb=null!=(lf=process.env.EXTRA_CONFIG_KEY_PREFIX)?lf:'';function Ab(a){return hf.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
567
- function mf(a){var b=nf;console.debug(`Start watching config files for changes: ${b}`);b.forEach(c=>{hf.access(c,gf.constants.F_OK).then(()=>{gf.watch(c,d=>w(function*(){if('change'===d){console.log(`Config file "${c}" has changed. Loading new configuration...`);try{const e=yield olympe.V.vs([c]),f=olympe.W.ds(e);for(const [g,h]of f)a.xj(g,h)}catch(e){console.error(`Failed to updated config from file ${c} with message: ${e.message}`)}}}))}).catch(()=>{})})}
568
- function of(){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).Mk)?void 0:null==(c=b.call(a))?void 0:Oc(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',of);process.on('SIGINT',of);process.on('SIGBREAK',of);process.on('SIGHUP',of);
547
+ olympe.auth.Ta=class{constructor(a,b,c,d,e,f,g,h,k){this.G=a;this.cb=b;this.H=c;this.storage=d;this.jb=e;this.Mb=k.get('defaultProvider');this.Ha=!!k.get('autoLogin');this.Y=k.get('autoUser');this.zb=k.get('autoPassword');this.vc=k.get('autoToken');this.Ud=new Map;this.R=f;this.wa='';this.D=olympe.C.bc(String).update(olympe.auth.Ta.j.INIT);this.error=olympe.C.bc(olympe.C.Sa);this.F=null;this.$=new olympe.auth.Wg('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.j=olympe.C.bc(olympe.auth.Wg).update(this.$);
548
+ this.N=new Map;this.da=new Map;this.ha=new olympe.V.Nh(k.get('cacheTokenTimeout'));h.forEach(l=>{const n=l.F();if(this.Ud.has(n))throw Error('Provider "'+n+'" has already been registered !');this.Ud.set(n,l)});Me(this);Re(this,g.j())}Zk(){const a=olympe.auth.Ta.j.lf,b=olympe.auth.Ta.j.Di,c=olympe.auth.Ta.j.Ab,d=olympe.C.bc(olympe.C.ea);olympe.C.Sc([this.D],e=>{e===a?d.update(olympe.C.ea.D):e===b?d.update(olympe.C.ea.j):e===c?(this.G.error('Authentication failed.'),d.update(olympe.C.ea.j)):d.clear()});
549
+ return d.rb()}qg(a){if(olympe.C.Pa(this.D)===olympe.auth.Ta.j.lf){var b=rd(this);!Se(this)&&b&&this.Ud.get(b.Fg()).qg(b,(c,d)=>{c?(this.G.error('Failed to refresh token, error message: ',c.message),this.ki().catch(e=>this.G.error(`Failed to logout after wrong refresh ${e}`))):d&&Te(this,d);a(c)})}}getState(){return this.D.rb()}Cc(){return this.j.rb().Cc()}pe(){return this.j.rb().pe()}gi(){return this.j.rb().gi()}hh(a,b){if(fb(this.ha.j,a))b(null,this.ha.get(a));else{var c,d=null==(c=olympe.C.Pa(this.j.rb()))?
550
+ void 0:c.Cd();this.H.hh(a,d,(e,f)=>{'string'===typeof f&&this.ha.set(a,f);b(e,f)})}}ki(){return Se(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)||Pe(c).catch(d=>this.G.error('Failed to clear token',d));Ee(this.H,rd(this),d=>{d?(Xe(this,'Logout request rejected:',d),b(d)):(this.G.debug('Logout request acknowledged'),a())});this.R.F(this.wa)})}kf(a){Ve(this)===olympe.auth.Ta.j.lf&&
551
+ this.H.kf(b=>{b&&this.G.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}zc(a,b){const c=null===this.F?olympe.auth.Ta.F.Xu:this.F;this.F=null;if(!a||a instanceof olympe.L.errors.tq){null===a?this.G.info(`User ${b.Cc()} (#${b.pe()}) successfully authenticated`):this.G.info(`User ${b.Cc()} (#${b.pe()}) recovered from token, while offline`);this.j.update(b);Je(this,olympe.auth.Ta.j.lf);Ye(this,a,c);let d;null==(d=this.storage)||Ne(d,b).catch(e=>this.G.error(e))}else{let d;
552
+ null==(d=this.storage)||Pe(d).catch(e=>this.G.error(e));this.error.update(olympe.C.xb(a.message));Oe(this,'authentication rejected: '+a.message);Ye(this,a,c)}this.N.has('login')&&this.N.delete('login')}};olympe.auth.Ta.j={INIT:'init',Gj:'authenticating',Di:'guest',lf:'authenticated',Ab:'error'};olympe.auth.Ta.F={Xu:'manual',Ws:'auto',$i:'tokenOnFirstConnection'};olympe.auth.Ta.D={Fj:'accepted',xp:'redirect'};olympe.auth.Ec=class{constructor(a,b){this.G=a;this.D=b;this.j=null}F(){}oe(){}H(a,b){const c=()=>{this.j=setTimeout(()=>this.D.kf(d=>{d?b(d,null):(b(null,null),c())}),this.D.j.Bd)};c();return()=>{this.j&&clearTimeout(this.j);this.j=null}}qg(a,b){this.D.kf(c=>{b(c,null)})}};olympe.auth.Ec.j={SAML:'saml',OAUTH2:'openID',SRP:'srp',km:'olympeToken'};function Ze(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.j=new Map}set(a,b){olympe.C.Sc([b],c=>{this.j.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.j.get(a.toLowerCase()))&&a.Xg&&(a=a.Ba.Fb);return a?a.valueOf():a}Cc(){return this.get('username')}Cd(){return this.get('nonce')}toString(){return this.Cc()+(this.Cd()?' with nonce':'')+(this.get('password')?' with password':'')+(Ze(this)?` with idp name ${Ze(this)}`:'')}};olympe.auth.Wg=class{constructor(a,b,c,d={},e=null){this.H=a;this.ni=b;this.D=c;this.j=e;this.F=d}Cc(){return this.H}pe(){return this.ni}Cd(){return this.D}Ji(){return this.F}gi(){return null}xf(){return this.j}ga(){const a=olympe.V.df(),b=Object.assign({},{user:this.H,userTag:this.ni,nonce:this.D},this.j&&{idpName:this.j},{payload:this.F});return olympe.V.Qr(bb(a,JSON.stringify(b)))}Fg(){return olympe.auth.Ec.j.SRP}};m=olympe.auth.Wg.prototype;m.Cc.K=new olympe.C.J(()=>String,[]);
553
+ m.pe.K=new olympe.C.J(()=>String,[]);m.Cd.K=new olympe.C.J(()=>String,[]);m.Ji.K=new olympe.C.J(()=>Object,[]);m.gi.K=new olympe.C.J(()=>String,[]);m.xf.K=new olympe.C.J(()=>String,[]);m.ga.K=new olympe.C.J(()=>String,[]);m.Fg.K=new olympe.C.J(()=>String,[]);function Fe(a){return a.Ji().access_token||null}function $e(a){return 1E3*parseInt(a.Ji().access_token_exp||'0',10)}olympe.auth.ik=class extends olympe.auth.Wg{constructor(a,b,c,d,e){super(a,b,c,d,e);this.N=Date.now()}gi(){return Fe(this)}Fg(){return olympe.auth.Ec.j.OAUTH2}};olympe.auth.$q=class extends olympe.auth.Wg{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.N=d}gi(){return this.N}Fg(){return olympe.auth.Ec.j.SAML}ga(){const a=olympe.V.df(),b=Object.assign({},{user:this.Cc(),userTag:this.pe(),nonce:this.Cd()},this.xf()&&{idpName:this.xf()},{payload:this.Ji(),fullToken:this.N});return olympe.V.Qr(bb(a,JSON.stringify(b)))}};function Ie(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function Ne(a,b){return qb(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 Pe(a){return qb(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}`)}))}
554
+ olympe.auth.dt=class{constructor(a,b,c){this.F=a;this.G=b;this.j='OlympeToken-'+c.j;this.D=new olympe.V.promise.Bm;this.db=this.F.D('AUTH')}oe(){this.G.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.j}`);return qb(this.D,()=>{const a=this;return w(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=
555
+ d.parse;var f=cb(olympe.V.df().D(olympe.V.Ow(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.$q(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.ik(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.Wg(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.uk=class{redirect(){}D(){}j(){}};olympe.auth.uk.j={GET:'GET',Gh:'POST'};olympe.auth.Tn=class{constructor(a){this.j=a||'default'}};olympe.auth.Ud={};function af(a,b,c){Ge(a.D,olympe.auth.pd.j.Gg,{token:b.Cd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.pd.j.Ab:c(Error('Invalid token'),null);break;case olympe.auth.pd.j.Yi: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.$q(f,g,h,e.samlToken,k,Ze(b)):'openid'===l&&(d=new olympe.auth.ik(f,g,h,k,Ze(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
556
+ olympe.auth.Ud.Wu=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.storage=c}F(){return olympe.auth.Ec.j.km}oe(a,b){this.storage.oe().then(c=>{af(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function bf(a,b,c){var d=$e(b);const e=Math.max(d-b.N,0),f=olympe.W.getParameter(olympe.auth.U.vr);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.qg(b,c)},d);a.qg(b,c);return null}
557
+ olympe.auth.Ud.nv=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}oe(a){const b=encodeURIComponent(this.N.j());a=Ze(a)?`idpName=${Ze(a)}&`:'';this.N.redirect(`${this.R}/auth?${a}url=${b}`,null,olympe.auth.uk.j.GET)}H(a,b){0<$e(a)?this.j=bf(this,a,b):b(null,a);return this.Y.bind(this)}qg(a,b){He(this.D,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.j&&(this.j=bf(this,d,b)))})}Y(){this.j&&clearTimeout(this.j);this.j=null}};function cf(a,b){Ge(a.D,olympe.auth.pd.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.Ud.SAML=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.N=c}F(){return olympe.auth.Ec.j.SAML}oe(a,b){cf(this,c=>{c?b(c,null):this.N.D(Ze(a))})}};function df(a,b,c){const d=olympe.auth.pd.j.Zt,e=olympe.auth.pd.j.Ab,f=olympe.auth.pd.j.Zv,g={I:b.Cc()};Ge(a.D,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.Cc()}' 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'))}})}
558
+ function ef(a,b,c){const d=olympe.auth.pd.j.Xs,e=olympe.auth.pd.j.Ab,f=olympe.auth.pd.j.Yi;b={A:b.get('a'),M:b.get('m1'),I:b.Cc()};Ge(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.Wg(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
559
+ null)}})}olympe.auth.Ud.SRP=class extends olympe.auth.Ec{F(){return olympe.auth.Ec.j.SRP}oe(a,b){const c=a.get('password');a.j.delete('password');this.G.debug('Sending SRP request');df(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.Cc(),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');ef(this,a,b)}})}};olympe.auth.P={Da:'auth.Manager',Ca:'auth.Logger',Xi:'auth.Storage',kl:'auth.appNameToken',qk:'auth.Redirector',dr:'auth.ServerConnector'};olympe.auth.U={Fl:'auth.defaultProvider',Nn:'auth.autoLogin',Pn:'auth.autoUser',On:'auth.autoPassword',$i:'auth.token',io:'auth.cacheTokenTimeout',vr:'auth.tokenDurationPercentage'};
560
+ olympe.W.config(function(a){F(a,olympe.auth.U.Fl,olympe.auth.Ec.j.SRP);F(a,olympe.auth.U.Nn,!1);F(a,olympe.auth.U.Pn,'');F(a,olympe.auth.U.On,'');F(a,olympe.auth.U.$i,'');F(a,olympe.auth.U.vr,50);F(a,olympe.auth.U.io,3E5);E(a,olympe.auth.P.Ca,[olympe.ja.P.Da],b=>b.cd('auth'));D(a,olympe.auth.P.kl,olympe.auth.Tn,olympe.Eb.P.Sg);D(a,olympe.auth.P.Xi,olympe.auth.dt,olympe.Eb.P.bk,olympe.auth.P.Ca,olympe.auth.P.kl);D(a,olympe.auth.P.dr,olympe.auth.pd,olympe.auth.P.Ca,olympe.L.P.vk,olympe.L.P.Ql,olympe.L.P.pf,
561
+ olympe.auth.P.qk,olympe.auth.P.Xi);Xa(a,olympe.auth.P.qk);E(a,olympe.auth.P.Da,[olympe.auth.P.Ca,olympe.L.P.pf,olympe.auth.P.dr,olympe.host.P.Ue,olympe.host.P.yk,new olympe.W.ub(olympe.auth.P.Xi,olympe.W.qh.j.hm),new olympe.W.ub(olympe.auth.P.qk,olympe.W.qh.j.hm),new olympe.W.pa(olympe.auth.U.Fl),new olympe.W.pa(olympe.auth.U.Nn),new olympe.W.pa(olympe.auth.U.Pn),new olympe.W.pa(olympe.auth.U.On),new olympe.W.pa(olympe.auth.U.$i),new olympe.W.pa(olympe.auth.U.io)],(b,c,d,e,f,g,h,k,l,n,p,q,r)=>{const t=
562
+ [new olympe.auth.Ud.Wu(b,d,g),new olympe.auth.Ud.SRP(b,d),new olympe.auth.Ud.SAML(b,d,h),new olympe.auth.Ud.nv(b,d,h,Ld(d.Ah,olympe.L.Yb.fk))];if(!t.map(u=>u.F()).includes(k))throw Error(`Default provider name ${k} given by parameter ${olympe.auth.U.Fl} cannot be found`);return new olympe.auth.Ta(b,c,d,g,h,e,f,t,new Map([['defaultProvider',k],['autoLogin',l],['autoUser',n],['autoPassword',p],['autoToken',q],['cacheTokenTimeout',r]]))},!0)},'olympe.auth');
563
+ olympe.W.run([olympe.auth.P.Da],a=>{olympe.auth.me=()=>a});olympe.Va.node.auth={};olympe.Va.node.auth.iq=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.iq.xa=[olympe.auth.uk];olympe.W.config(a=>{D(a,olympe.auth.P.qk,olympe.Va.node.auth.iq)},'olympe.native.node.auth');olympe.Va.node.Eb={};function ff(){throw Error('Key-Value Database does not implement this in NodeJS');}
564
+ olympe.Va.node.Eb.gq=class{constructor(a){this.G=a;this.j=new Map}Y(){return 0}N(a){const b=this;return w(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 w(function*(){const c=b.j.get(a);return c?Array.from(c.values()):[]})}R(a){const b=this;return w(function*(){const c=b.j.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return w(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;
565
+ return w(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 w(function*(){let d;return null==(d=c.j.get(a))?void 0:d.get(b)})}set(a,b,c){const d=this;return w(function*(){let e;return null==(e=d.j.get(a))?void 0:e.set(c,b)})}remove(a,b){const c=this;return w(function*(){let d;yield null==(d=c.j.get(a))?void 0:d.delete(b)})}da(){ff();return Promise.resolve()}$(){ff();return Promise.resolve()}clear(a){const b=this;return w(function*(){let c;
566
+ null==(c=b.j.get(a))||c.clear()})}H(){ff();return Promise.resolve([])}D(){return w(function*(){ff()})}};olympe.Va.node.Eb.gq.xa=[olympe.Eb.Lu];olympe.Va.node.Eb.hq=class{constructor(a){this.j=new Map;this.G=a}D(a){this.j.has(a)||this.j.set(a,new olympe.Va.node.Eb.gq(this.G));return this.j.get(a)}};olympe.Va.node.Eb.hq.xa=[olympe.Eb.Mu];olympe.W.config(function(a){D(a,olympe.Eb.P.bk,olympe.Va.node.Eb.hq,olympe.Eb.P.Ca)},'olympe.native.node.localstorage');olympe.Va.node.storage={};olympe.Va.node.storage.Storage=class{constructor(a){this.G=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Va.node.storage.Storage.xa=[olympe.Eb.Storage];olympe.W.config(function(a){Va(a,olympe.Eb.P.Xi,olympe.Va.node.storage.Storage,olympe.host.P.Ca)},'olympe.native.html.storage');olympe.pg={};olympe.pg.U={VERSION:'version.version',gt:'version.branch',nf:'version.commit',fw:'version.tag',Zo:'version.olympe-framework',ht:'version.build'};olympe.W.config(function(a){F(a,olympe.pg.U.VERSION,'');F(a,olympe.pg.U.gt,'');F(a,olympe.pg.U.nf,'');F(a,olympe.pg.U.fw,'');F(a,olympe.pg.U.Zo,'');F(a,olympe.pg.U.ht,'')},'olympe.main');const gf=require('fs'),hf=require('fs/promises');let jf;const kf=null!=(jf=process.env.EXTRA_CONFIG_PATH)?jf:null;let lf;const Bb=null!=(lf=process.env.EXTRA_CONFIG_KEY_PREFIX)?lf:'';function Ab(a){return hf.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
567
+ function mf(a){var b=nf;console.debug(`Start watching config files for changes: ${b}`);b.forEach(c=>{hf.access(c,gf.constants.F_OK).then(()=>{gf.watch(c,d=>w(function*(){if('change'===d){console.log(`Config file "${c}" has changed. Loading new configuration...`);try{const e=yield olympe.V.Cs([c]),f=olympe.W.ms(e);for(const [g,h]of f)a.Ej(g,h)}catch(e){console.error(`Failed to updated config from file ${c} with message: ${e.message}`)}}}))}).catch(()=>{})})}
568
+ function of(){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).Tk)?void 0:null==(c=b.call(a))?void 0:Oc(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',of);process.on('SIGINT',of);process.on('SIGBREAK',of);process.on('SIGHUP',of);
569
569
  process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);of()});const nf=['oConfig.json','conf.d/oConfig.json','version.json'];kf&&nf.push(kf);
570
- olympe.V.vs(nf).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.Jr(g[3])}const d=new olympe.W.qt(a,b);Ka(d);const e=d.compile();Ma(e);mf(e)}catch(b){console.error(`Failed to start Olympe: ${b}`),process.exit(1)}}).catch(a=>{console.error(`Failed to load config files: ${a.message}.`);
571
- setInterval(()=>{},1073741824)});olympe.dc={};olympe.dc.va={ORIGIN:'<',DESTINATION:'>'};B('olympe.dc.Direction',olympe.dc.va);olympe.dc.hc={Yc:'ff022000000000000000',ti:'ff02200000000000000e',Gj:'ff02200000000000000f'};olympe.dc.Cp={VERSION:'@v',br:'@s'};olympe.dc.ce={Pe:'?',$f:'~'};olympe.dc.AC={Mi:'online',ye:'offline',fB:'invalidate'};olympe.dc.Ka={SELF:'self',SERVER:'server',wf:'remote'};
572
- olympe.dc.Lb={NONE:null,Bo:'ff023000000000000037',Cc:'ff023000000000000137',bg:'ff023000000000000237',Mv:'ff023000000000000337',xt:'ff023000000000000437',hw:'ff023000000000000537',hB:olympe.dc.ce.$f+'ff023000000000000037',iB:olympe.dc.ce.$f+'ff023000000000000237',gB:olympe.dc.ce.$f+'ff023000000000000437',qD:olympe.dc.ce.$f+'ff023000000000000537'};olympe.dc.kq=class extends Error{constructor(a){var b=olympe.dc.ia(),c=olympe.dc.$d(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.sb(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.cq=class extends Error{constructor(){var a=pf();super('Try to access a resource not available yet: BusinessContainer, wait for it to be ready');this.j=a}};olympe.dc.Writable=class{Pc(){}Wc(){}D(){}Oa(){}ic(){}};olympe.dc.vq=class{tc(){}T(){}J(){}};olympe.dc.vc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}Ea(a){return a instanceof olympe.dc.vc&&this.tag===a.tag}};olympe.dc.vc.xa=[olympe.dc.Qe];olympe.dc.vc.prototype.Ea.K=olympe.C.H.j;olympe.dc.Gt=class a{constructor(b,c,d,e,f,g){this.G=b;this.$=c;this.db=c.view;this.ba=d;this.Wb=e;this.D=f;this.N=g;this.j=new Map;this.F=hb(new olympe.V.Jh(6E5),(h,k)=>{URL.revokeObjectURL(k);qf(this.db,h,a.j(h))})}fa(b,c,d,e,f){this.Ga(c).then(g=>{this.$a(b,g,d,!!this.N,e,f)}).catch(g=>this.G.error(g))}J(b){const c=this;return w(function*(){const d=f=>{f=`Failed to download file ${b.X()}: ${f}`;c.G.error(f);throw Error(f);},e=b.X();if(fb(c.F.j,e)){const f=c.F.get(e);return c.D.F(f).then(g=>g.arrayBuffer()).then(g=>
573
- new Uint8Array(g,0,g.byteLength)).catch(d)}return c.downloadFileContent(b).then(f=>c.D.J(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,
574
- 0,f.byteLength));if(d)return d=this.db.model(b),c=new olympe.dc.Request(olympe.dc.Request.j.Wf,olympe.dc.$d().Ie(b),{tag:c,model:d,url:e.valueOf()}),this.Wb.request(c);c=N(e);Cc(c,olympe.net.wa.ResponseType.il);return Dc(this.ba,c).then(f=>{const g=f.Hc();if(200<=g&&300>g)return f.getData();throw Error(`Failed to download file ${b}. Response code ${g}`);})}ua(b){const c=new olympe.V.stream.yf;this.J(b).then(d=>{db(d).pipeTo(c).catch(()=>{})});return c}fb(b,c){this.D.J(c).then(d=>{d=URL.createObjectURL(new Blob([d]));
575
- const e=new olympe.dc.db.fc;e.Wc(b,(new Map).set(olympe.dm.File.urlProp.X(),d));this.$.Tc(rf(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;const f=null!=(e=this.j.get(b))?e:[];f.push(g=>g?d(g):c());this.j.set(b,f)})}$a(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.dg,olympe.dc.$d().Ie(b),
576
- {tag:b,model:e,content:c,mimeType:d});this.Wb.request(e).then(k=>h(null!=k?k:'')).catch(null!=g?g:this.G.error.bind(this.G))}Ga(b){return w(function*(){var c=b instanceof olympe.C.Sa?b.valueOf():b;return'string'===typeof c?$a(c):c instanceof ArrayBuffer?new Uint8Array(c,0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}R(b,c){const d=olympe.dc.ha(b);b=URL.createObjectURL(c);this.F.set(d,b);const e=a.j(d);sf(this.db,d,f=>{f||(this.F.delete(d),qf(this.db,
577
- d,e))},e)}static j(b){return`cacheBinary${b}`}};function tf(a,b){let c=uf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Xe(b);if(null===b)break;c=uf(b)}let e;return null!=(e=c)?e:null}olympe.dc.$t=class{constructor(a,b,c){this.G=a;this.j=b;this.db=b.view;this.D=c;this.Ra=new FinalizationRegistry(d=>{this.G.F()&&this.G.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.j.j.Ub([d])})}};function vf(a,b){a.origin=b;return a}function wf(a,b,c){a.D.set(b,c);return a}function xf(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.Ka.SELF;this.j=b;this.content=null!=c?c:null;this.F=null!=d?d:rd(olympe.auth.ke()).ne();this.D=new Map}getType(){return this.type}Bc(){return this.F}jc(){return this.j}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.j}; content: ${this.content}`}};
578
- olympe.dc.Request.j={pc:1,yg:10,It:24,gp:25,Jt:28,Hg:30,hk:31,WB:32,We:40,Rg:41,Rn:42,Hq:43,lD:44,mi:45,Tn:46,Qj:47,dg:50,Wf:51,vg:52,ew:60,vv:61,ap:62,YA:63,gt:64,kh:65,so:91,Kt:93,Zl:95,QUERY_RESULT:97};function yf(a,b,c,d,e){const f=olympe.C.Xg();a.sources.set(olympe.dc.Ka.SERVER,e.init(a));a.F?a.sources.set(olympe.dc.Ka.wf,d.init(a)):sf(b,a.j,()=>{a.sources.set(olympe.dc.Ka.wf,d.init(a));const g=new Map;olympe.dc.ma.from(a.j,a.j).gb(olympe.dm.DataSource.sj).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.Rh,!0)).observe(f).subscribe(h=>{var k=h.mj();for(var l of k){const [p,q]=g.get(l);c.F(p);c.N(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=h.hj();for(const p of h)if(h=
579
- p.X(),!a.sources.has(h)){const q=new olympe.dc.sources.Mp(a.G,p);a.sources.set(h,q);l=c.j(()=>q.healthCheck(),h,olympe.host.Ce.j.READINESS);n=c.D(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});qf(b,a.j,'router',!0)},'router')}function zf(a,b,c){let d=a.D.get(b);void 0===d&&(d=[],a.D.set(b,d));d.push(c)}
580
- olympe.dc.Av=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;yf(this,d,e,b,c)}request(a){this.G.debug('Router: sends',a);return this.sb(a.jc()).request(a)}subscribe(a,b){this.G.debug('Router: subscribes',a);return this.sb(a.jc()).subscribe(a,b)}vd(a){const b=a.jc();if(b===this.j){let c;null==(c=this.D.get(a.getType()))||c.forEach(d=>d(a))}else olympe.L.ub.publish(b,a).catch(c=>{this.G.error(`Error while publishing the message ${a} to remote router: ${c}`)})}sb(a){let b;
581
- return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Ka.wf)}};function rf(a,b){b=new olympe.dc.wg(a.T(),null!=b?b:null);b.j=a;return b}function Af(a,b,c,d){c=new olympe.dc.wg(null!=d?d:olympe.V.Ic(),null!=c?c:null);c.D=b;c.Fa=a;return c}
582
- olympe.dc.wg=class{constructor(a,b){this.id=a;this.Fa=this.j=this.D=null;this.Ek=b}static j(a){return Af(a.p,a.s,a.t,a.i)}T(){return this.id}tc(a){return this.j instanceof olympe.dc.db.fc?this.j.tc(a):Array.isArray(this.Fa)?(new olympe.dc.transaction.Ni(this.D)).D(this.Fa,a):a}J(){let a,b,c,d;return null!=(d=null!=(c=null==(a=this.Fa)?void 0:a.length)?c:null==(b=this.j)?void 0:b.J())?d:0}kc(){return this.j instanceof olympe.dc.db.fc?this.j:Array.isArray(this.Fa)?(this.j=(new olympe.dc.transaction.Ni(this.D)).j(this.Fa,
583
- this.id),this.Fa=null,this.j):new olympe.dc.db.fc(this.id)}Kk(){if(Array.isArray(this.Fa))return this.Fa;if(this.j instanceof olympe.dc.db.fc){const a=new olympe.dc.transaction.Ae;this.j.tc(a);return Bf(a)}return[]}ga(){return{p:this.Kk(),t:this.Ek,s:this.D,i:this.id}}};olympe.dc.wg.xa=[olympe.dc.vq];olympe.dc.Ra={};const Cf=olympe.dc.va.ORIGIN,Df=olympe.dc.va.DESTINATION,Ef=new Map,Ff=new Map,Gf=new Map,Hf=new Map;function uf(a){let b;return null!=(b=Ef.get(a))?b:null}function If(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.yn||[])];return olympe.dc.na.j(b,c,...a)}function Jf(a,b){Hf.set(a,b);return a}function Kf(a){let b,c;return null!=(c=null==(b=Ef.get(a))?void 0:b.D)?c:olympe.dc.CloudObject}
584
- function Lf(a,b,c){const d=a+'@'+(b===Df?Cf:Df);if(Ff.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);Ff.set(d,c)}function Mf(a){a=a.X()+'@'+a.Ja();return Ff.get(a)||olympe.dc.CloudObject}function P(a,b){b.NAME=a;Gf.set(a,b)}function Q(a){let b;return null!=(b=a.NAME)?b:null}
585
- olympe.dc.na=class{constructor(){}static j(a,b,...c){if(Ef.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${Ef.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.ub(g):g}}b=new olympe.dc.Ra.Entry(a,b,d);Ef.set(a,b);return b.D.entry=b}static bc(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.X())?c:null}};function Nf(a,b){a.j=b}function R(a,b){b=b.ac();Lf(b.X(),b.Ja(),a.D);return b}function Of(a){a.F=!0;return a}
586
- olympe.dc.Ra.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.yn=c||null;this.j=null;this.F=!1}X(){return this.tag}instantiate(a,b){const c=this.D;if(this.hn()&&b.getParameter(olympe.dc.U.Ko)){var d=olympe.dc.ia();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.ja.ab('dc').error(d)}return this.yn?(a=[void 0,a].concat(Na(b,this.yn)),new c(...a)):new c(void 0,
587
- a)}ka(a){return new olympe.dc.Ra.Property(a)}sa(a,b=olympe.dc.va.DESTINATION){Lf(a,b,this.D);return new olympe.dc.da.Se(a,b)}hn(){return this.F}};B('olympe.dc.registry.Entry',olympe.dc.Ra.Entry);olympe.dc.Ra.Entry.prototype.addRelation=olympe.dc.Ra.Entry.prototype.sa;olympe.dc.Ra.Entry.prototype.addProperty=olympe.dc.Ra.Entry.prototype.ka;olympe.dc.Ra.Entry.xa=[olympe.dc.Qe];olympe.dc.Ra.Property=class{constructor(a){this.tag=a}X(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Ra.Property.prototype.getTag=olympe.dc.Ra.Property.prototype.X;olympe.dc.Ra.Property.xa=[olympe.dc.Qe];olympe.dc.Ra.Relation=class{constructor(a,b=olympe.dc.va.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.ha(a);this.direction=b;this.origin=c;this.J=d}X(){return this.tag}Ja(){return this.direction}type(){return this.J}ac(){return new olympe.dc.Ra.Relation(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION,this.J,this.origin)}Ea(a){return a instanceof olympe.dc.Ra.Relation?a.X()===this.X()&&a.Ja()===this.Ja():!1}toString(){return`${this.direction}${olympe.dc.ia().name(this.tag)} (${this.tag})`}};
588
- olympe.dc.Ra.Relation.prototype.getInverse=olympe.dc.Ra.Relation.prototype.ac;olympe.dc.Ra.Relation.prototype.getDirection=olympe.dc.Ra.Relation.prototype.Ja;olympe.dc.Ra.Relation.prototype.getTag=olympe.dc.Ra.Relation.prototype.X;olympe.dc.Ra.Relation.xa=[olympe.dc.Qe];olympe.dc.db={};function Pf(a,b){const c=a.J,d=olympe.dc.ia(),e=olympe.dc.db.Database.D.Oi,f=olympe.dc.db.Database.D.Pe,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.Lb.NONE);for(const [r,t]of l.Dd())k.ic(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.Ed())for(const r of Qf(d,n,l.J())){l=c.get(r);const t=new Map;l.forEach((u,x)=>{const y=x[0],z=x.substring(1);
589
- y===e?t.set(z,u):y===f?t.set(x,u):y===g?u.forEach((A,K)=>{k.Oa(z,K,r)}):y===h&&u.forEach((A,K)=>{k.Oa(z,r,K)})});l=l.source();k.Pc(r,l,t)}else{const r=new Map;for(const t of l.Cb().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?Rf(p,u,!0):p.Qa(u,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Wc(n,r);for(const [t,u,x]of l.Dd())x?k.ic(t,n,u):k.Oa(t,n,u)}}});return k}
590
- function Sf(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 Tf(b,Pf(a,b));a.D.unshift(d);a.F.set(d,e);a.J.us(c);a.write(b,!1,!1)}
570
+ olympe.V.Cs(nf).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.Rr(g[3])}const d=new olympe.W.zt(a,b);Ka(d);const e=d.compile();Ma(e);mf(e)}catch(b){console.error(`Failed to start Olympe: ${b}`),process.exit(1)}}).catch(a=>{console.error(`Failed to load config files: ${a.message}.`);
571
+ setInterval(()=>{},1073741824)});olympe.dc={};olympe.dc.ua={ORIGIN:'<',DESTINATION:'>'};B('olympe.dc.Direction',olympe.dc.ua);olympe.dc.fc={Yc:'ff022000000000000000',Ai:'ff02200000000000000e',Nj:'ff02200000000000000f'};olympe.dc.Jp={VERSION:'@v',ir:'@s'};olympe.dc.de={Se:'?',dg:'~'};olympe.dc.IC={Si:'online',Ae:'offline',oB:'invalidate'};olympe.dc.Ja={SELF:'self',SERVER:'server',Af:'remote'};
572
+ olympe.dc.Lb={NONE:null,Ho:'ff023000000000000037',Dc:'ff023000000000000137',fg:'ff023000000000000237',Wv:'ff023000000000000337',Gt:'ff023000000000000437',rw:'ff023000000000000537',qB:olympe.dc.de.dg+'ff023000000000000037',rB:olympe.dc.de.dg+'ff023000000000000237',pB:olympe.dc.de.dg+'ff023000000000000437',yD:olympe.dc.de.dg+'ff023000000000000537'};olympe.dc.rq=class extends Error{constructor(a){var b=olympe.dc.ia(),c=olympe.dc.ae(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.sb(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.kq=class extends Error{constructor(){var a=pf();super('Try to access a resource not available yet: BusinessContainer, wait for it to be ready');this.j=a}};olympe.dc.Writable=class{Oc(){}Wc(){}D(){}Oa(){}hc(){}};olympe.dc.Cq=class{qc(){}T(){}H(){}};olympe.dc.uc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}Ea(a){return a instanceof olympe.dc.uc&&this.tag===a.tag}};olympe.dc.uc.xa=[olympe.dc.Te];olympe.dc.uc.prototype.Ea.K=olympe.C.J.j;olympe.dc.Pt=class a{constructor(b,c,d,e,f,g){this.G=b;this.$=c;this.db=c.view;this.da=d;this.Tb=e;this.D=f;this.N=g;this.j=new Map;this.F=hb(new olympe.V.Nh(6E5),(h,k)=>{URL.revokeObjectURL(k);qf(this.db,h,a.j(h))})}ha(b,c,d,e,f){this.cb(c).then(g=>{this.jb(b,g,d,!!this.N,e,f)}).catch(g=>this.G.error(g))}H(b){const c=this;return w(function*(){const d=f=>{f=`Failed to download file ${b.X()}: ${f}`;c.G.error(f);throw Error(f);},e=b.X();if(fb(c.F.j,e)){const f=c.F.get(e);return c.D.F(f).then(g=>g.arrayBuffer()).then(g=>
573
+ 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,
574
+ 0,f.byteLength));if(d)return d=this.db.model(b),c=new olympe.dc.Request(olympe.dc.Request.j.$f,olympe.dc.ae().Ke(b),{tag:c,model:d,url:e.valueOf()}),this.Tb.request(c);c=N(e);Cc(c,olympe.net.va.ResponseType.pl);return Dc(this.da,c).then(f=>{const g=f.Hc();if(200<=g&&300>g)return f.getData();throw Error(`Failed to download file ${b}. Response code ${g}`);})}wa(b,c,d){c=new olympe.dc.Request(olympe.dc.Request.j.Yf,d,{tag:b,model:c});return this.Tb.request(c).then(()=>this.G.debug(`Successfully deleted file: ${b}`)).catch(e=>
575
+ {throw Error(`Failed to delete file ${b}: ${e.message}`);})}Ha(b){const c=new olympe.V.stream.Cf;this.H(b).then(d=>{db(d).pipeTo(c).catch(()=>{})});return c}zb(b,c){this.D.H(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.ec;e.Wc(b,(new Map).set(olympe.dm.File.urlProp.X(),d));this.$.Tc(rf(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;
576
+ const f=null!=(e=this.j.get(b))?e:[];f.push(g=>g?d(g):c());this.j.set(b,f)})}jb(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.hg,olympe.dc.ae().Ke(b),{tag:b,model:e,content:c,mimeType:d});this.Tb.request(e).then(k=>h(null!=k?k:'')).catch(null!=g?g:this.G.error.bind(this.G))}cb(b){return w(function*(){var c=b instanceof olympe.C.Sa?b.valueOf():b;return'string'===typeof c?$a(c):c instanceof ArrayBuffer?new Uint8Array(c,
577
+ 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);sf(this.db,d,f=>{f||(this.F.delete(d),qf(this.db,d,e))},e)}static j(b){return`cacheBinary${b}`}};function tf(a,b){let c=uf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.bf(b);if(null===b)break;c=uf(b)}let e;return null!=(e=c)?e:null}olympe.dc.iu=class{constructor(a,b,c){this.G=a;this.j=b;this.db=b.view;this.D=c;this.Ra=new FinalizationRegistry(d=>{this.G.F()&&this.G.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.j.detach([d],olympe.dc.db.Instance.j.Bp)})}};function vf(a,b){a.origin=b;return a}function wf(a,b,c){a.D.set(b,c);return a}function xf(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.Ja.SELF;this.j=b;this.content=null!=c?c:null;this.F=null!=d?d:rd(olympe.auth.me()).pe();this.D=new Map}getType(){return this.type}Cc(){return this.F}ic(){return this.j}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.j}; content: ${this.content}`}};
578
+ olympe.dc.Request.j={oc:1,Cg:10,Rt:24,mp:25,St:28,Lg:30,pk:31,eC:32,Ze:40,Vg:41,Xn:42,Oq:43,tD:44,ti:45,Zn:46,Xj:47,hg:50,$f:51,Yf:52,ow:60,Ev:61,hp:62,hB:63,pt:64,oh:65,zo:91,Tt:93,fm:95,QUERY_RESULT:97};function yf(a,b,c,d,e){const f=olympe.C.ah();a.sources.set(olympe.dc.Ja.SERVER,e.init(a));a.F?a.sources.set(olympe.dc.Ja.Af,d.init(a)):sf(b,a.j,()=>{a.sources.set(olympe.dc.Ja.Af,d.init(a));const g=new Map;olympe.dc.ma.from(a.j,a.j).fb(olympe.dm.DataSource.zj).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.Vh,!0)).observe(f).subscribe(h=>{var k=h.tj();for(var l of k){const [p,q]=g.get(l);c.F(p);c.N(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=h.oj();for(const p of h)if(h=
579
+ p.X(),!a.sources.has(h)){const q=new olympe.dc.sources.Tp(a.G,p);a.sources.set(h,q);l=c.j(()=>q.healthCheck(),h,olympe.host.Ee.j.READINESS);n=c.D(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});qf(b,a.j,'router',!0)},'router')}function zf(a,b,c){let d=a.D.get(b);void 0===d&&(d=[],a.D.set(b,d));d.push(c)}
580
+ olympe.dc.Kv=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;yf(this,d,e,b,c)}request(a){this.G.debug('Router: sends',a);return this.sb(a.ic()).request(a)}subscribe(a,b){this.G.debug('Router: subscribes',a);return this.sb(a.ic()).subscribe(a,b)}vd(a){const b=a.ic();if(b===this.j){let c;null==(c=this.D.get(a.getType()))||c.forEach(d=>d(a))}else olympe.L.ub.publish(b,a).catch(c=>{this.G.error(`Error while publishing the message ${a} to remote router: ${c}`)})}sb(a){let b;
581
+ return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Ja.Af)}};function rf(a,b){b=new olympe.dc.Ag(a.T(),null!=b?b:null);b.j=a;return b}function Af(a,b,c,d){c=new olympe.dc.Ag(null!=d?d:olympe.V.Ic(),null!=c?c:null);c.D=b;c.Fa=a;return c}
582
+ olympe.dc.Ag=class{constructor(a,b){this.id=a;this.Fa=this.j=this.D=null;this.Lk=b}static j(a){return Af(a.p,a.s,a.t,a.i)}T(){return this.id}qc(a){return this.j instanceof olympe.dc.db.ec?this.j.qc(a):Array.isArray(this.Fa)?(new olympe.dc.transaction.Ti(this.D)).D(this.Fa,a):a}H(){let a,b,c,d;return null!=(d=null!=(c=null==(a=this.Fa)?void 0:a.length)?c:null==(b=this.j)?void 0:b.H())?d:0}jc(){return this.j instanceof olympe.dc.db.ec?this.j:Array.isArray(this.Fa)?(this.j=(new olympe.dc.transaction.Ti(this.D)).j(this.Fa,
583
+ this.id),this.Fa=null,this.j):new olympe.dc.db.ec(this.id)}Rk(){if(Array.isArray(this.Fa))return this.Fa;if(this.j instanceof olympe.dc.db.ec){const a=new olympe.dc.transaction.Ce;this.j.qc(a);return Bf(a)}return[]}ga(){return{p:this.Rk(),t:this.Lk,s:this.D,i:this.id}}};olympe.dc.Ag.xa=[olympe.dc.Cq];olympe.dc.Ra={};const Cf=olympe.dc.ua.ORIGIN,Df=olympe.dc.ua.DESTINATION,Ef=new Map,Ff=new Map,Gf=new Map,Hf=new Map;function uf(a){let b;return null!=(b=Ef.get(a))?b:null}function If(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.En||[])];return olympe.dc.na.j(b,c,...a)}function Jf(a,b){Hf.set(a,b);return a}function Kf(a){let b,c;return null!=(c=null==(b=Ef.get(a))?void 0:b.D)?c:olympe.dc.CloudObject}
584
+ function Lf(a,b,c){const d=a+'@'+(b===Df?Cf:Df);if(Ff.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);Ff.set(d,c)}function Mf(a){a=a.X()+'@'+a.Ka();return Ff.get(a)||olympe.dc.CloudObject}function P(a,b){b.NAME=a;Gf.set(a,b)}function Q(a){let b;return null!=(b=a.NAME)?b:null}
585
+ olympe.dc.na=class{constructor(){}static j(a,b,...c){if(Ef.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${Ef.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.ub(g):g}}b=new olympe.dc.Ra.Entry(a,b,d);Ef.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 Nf(a,b){a.j=b}function R(a,b){b=b.$b();Lf(b.X(),b.Ka(),a.D);return b}function Of(a){a.F=!0;return a}
586
+ olympe.dc.Ra.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.En=c||null;this.j=null;this.F=!1}X(){return this.tag}instantiate(a,b){const c=this.D;if(this.pn()&&b.getParameter(olympe.dc.U.Qo)){var d=olympe.dc.ia();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.ja.$a('dc').error(d)}return this.En?(a=[void 0,a].concat(Na(b,this.En)),new c(...a)):new c(void 0,
587
+ a)}ka(a){return new olympe.dc.Ra.Property(a)}sa(a,b=olympe.dc.ua.DESTINATION){Lf(a,b,this.D);return new olympe.dc.ba.Ve(a,b)}pn(){return this.F}};B('olympe.dc.registry.Entry',olympe.dc.Ra.Entry);olympe.dc.Ra.Entry.prototype.addRelation=olympe.dc.Ra.Entry.prototype.sa;olympe.dc.Ra.Entry.prototype.addProperty=olympe.dc.Ra.Entry.prototype.ka;olympe.dc.Ra.Entry.xa=[olympe.dc.Te];olympe.dc.Ra.Property=class{constructor(a){this.tag=a}X(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Ra.Property.prototype.getTag=olympe.dc.Ra.Property.prototype.X;olympe.dc.Ra.Property.xa=[olympe.dc.Te];olympe.dc.Ra.Relation=class{constructor(a,b=olympe.dc.ua.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}Ka(){return this.direction}type(){return this.H}$b(){return new olympe.dc.Ra.Relation(this.tag,this.direction===olympe.dc.ua.DESTINATION?olympe.dc.ua.ORIGIN:olympe.dc.ua.DESTINATION,this.H,this.origin)}Ea(a){return a instanceof olympe.dc.Ra.Relation?a.X()===this.X()&&a.Ka()===this.Ka():!1}toString(){return`${this.direction}${olympe.dc.ia().name(this.tag)} (${this.tag})`}};
588
+ olympe.dc.Ra.Relation.prototype.getInverse=olympe.dc.Ra.Relation.prototype.$b;olympe.dc.Ra.Relation.prototype.getDirection=olympe.dc.Ra.Relation.prototype.Ka;olympe.dc.Ra.Relation.prototype.getTag=olympe.dc.Ra.Relation.prototype.X;olympe.dc.Ra.Relation.xa=[olympe.dc.Te];olympe.dc.db={};function Pf(a,b){const c=a.H,d=olympe.dc.ia(),e=olympe.dc.db.Database.D.Ui,f=olympe.dc.db.Database.D.Se,g=olympe.dc.db.Database.D.ORIGIN,h=olympe.dc.db.Database.D.DESTINATION,k=new olympe.dc.db.ec('rev-'+b.T());a.G.debug('Generate the reverse graphLayer of',b.T());b.Bb.forEach((l,n)=>{if(l.D()){k.D(n,olympe.dc.Lb.NONE);for(const [r,t]of l.Ed())k.hc(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.td())for(const r of Qf(d,n,l.H())){l=c.get(r);const t=new Map;l.forEach((u,x)=>{const y=x[0],z=x.substring(1);
589
+ y===e?t.set(z,u):y===f?t.set(x,u):y===g?u.forEach((A,K)=>{k.Oa(z,K,r)}):y===h&&u.forEach((A,K)=>{k.Oa(z,r,K)})});l=l.source();k.Oc(r,l,t)}else{const r=new Map;for(const t of l.Db().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?Rf(p,u,!0):p.Qa(u,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Wc(n,r);for(const [t,u,x]of l.Ed())x?k.hc(t,n,u):k.Oa(t,n,u)}}});return k}
590
+ function Sf(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 Tf(b,Pf(a,b));a.D.unshift(d);a.F.set(d,e);a.H.Bs(c);a.write(b,!1,!1)}
591
591
  function Uf(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.Tc(h),b);let g;e=null!=(g=null==e?void 0:e.update(f,c))?g:new Vf(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}
592
- function Wf(a,b,c){return a.D.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>{let f;return null!=(f=null==e?void 0:e.Tc(d))?f:d},b)}function Xf(a,b,c,d=!1){return w(function*(){const e=new olympe.dc.db.Em(a.G,a.J,a.ia,c);e.open(d);for(const f=fa(b);;){const g=yield f.next();if(g.done)break;e.write(g.value,a.R)}e.close()})}
593
- function Yf(a,b,c,d){b=b.pipeThrough(olympe.V.stream.tap(e=>{0<a.D.length&&Uf(a,Wf(a,e.kc(),a.D.length),e.Ek)}));return Xf(a,b,c,d).then(()=>a.G.debug('Rebase stream completed')).catch(e=>a.G.error('Rebase stream failed:',e))}
594
- olympe.dc.db.ot=class{constructor(a,b,c,d){this.G=a;this.J=b;this.ia=c;let e;this.R=null!=(e=d.get('debug'))?e:!1;let f;this.N=null!=(f=d.get('bufferTimeout'))?f:0;this.D=[];this.F=new Map;this.j=[];b.addEventListener(olympe.dc.db.Database.j.Yo,g=>{this.j.forEach(h=>{for(const k of g)h.j.j(k)})})}Tc(a,b,c){const d=a.T(),e=a.Ek;this.F.has(d)?this.push(d,e):(a=Uf(this,Wf(this,a.kc(),this.D.length),e),this.write(a,b,c))}push(a,b){const c=this.D.indexOf(a);if(-1<c){const d=this.F.get(a);this.D.splice(c,
595
- 1);Uf(this,Wf(this,d.D,c),b);this.F.delete(a)}}write(a,b,c=!1){b=new olympe.dc.db.Em(this.G,this.J,this.ia,b);b.open(c);b.write(a,this.R);b.close()}};class Zf{T(){}Tc(){}}function $f(a,b,c,d){const e=olympe.dc.va.DESTINATION;c=c.tag();const f=a.j.Rc(c);b.Cb().forEach((g,h)=>{f.ka(h,g);b.ba(h)});for(const [g,h,k,l]of b.fa()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.j.Oa(g,n,p);d.N(g,n,p)}}
596
- function ag(a,b,c,d){const e=olympe.dc.va.DESTINATION,f=c.tag(),g=a.j.Rc(f);b.Cb().forEach((h,k)=>{void 0!==c.Qa(k)&&(g.ka(k,h),b.ba(k))});for(const [h,k,l]of b.Dd()){const n=c.Bb(h,e,k);void 0!==n&&(d.N(h,f,k),n===l&&a.j.N(h,f,k))}}
597
- class Tf extends Zf{constructor(a,b){super();this.D=a;this.j=b;this.db=olympe.dc.ia()}T(){return this.D.T()}Tc(a){for(const [b,c]of this.D.ba(a)){const d=b.tag();c.Ed()?b.D()?a.j(d,b.J()):(this.D.j(d,c.J()),this.j.j(d,c.J())):b.Ed()?($f(this,c,b,a),a.j(d,b.J())):ag(this,c,b,a)}return a}}function bg(a){clearTimeout(a.F);a.F=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.J)}
598
- class Vf extends Zf{constructor(a,b,c,d){super();this.j=a;this.D=b;this.buffer=c;this.J=d;this.F=null;bg(this)}T(){return this.j.T()}Tc(a){return a.R(this.j)}update(a,b){this.D=b;a.tc(this.j);bg(this);return this}};const cg=olympe.dc.hc.Yc,dg=olympe.dc.hc.ti,eg=olympe.dc.va.ORIGIN,fg=olympe.dc.va.DESTINATION;let gg=0;
599
- 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.Ka.SELF;this.G=b;this.$c=olympe.C.Xa();this.R=olympe.dc.db.Database.F.IDLE;this.ua=new Map;this.rc=[];this.$=new Map;this.F=null;this.fa=new Set;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.qf.j.Bl;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Vd=new olympe.dc.db.qf(c,this,b,f);d.get('debug')&&this.ps()}T(){return this.id}getState(){return this.R}ab(){return this.G}create(b,
600
- c,d,e=!1){var f=this.N(b,!0);if(!f.e&&null!==c&&(null===f.F||f.F===c)){f.F=c;let g;(null==(g=f.model())?0:g.e)&&f.db.ba(f,!0)}e&&f.persist();this.R===a.F.hl&&hg(f,!0);d&&this.Kc(f,d);this.D(a.j.vp,b)}update(b,c){c&&(b=this.N(b,!0),this.Kc(b,c))}$a(b){const c=this.get(b);void 0!==c&&(this.ba(c,!1),this.D(a.j.wp,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case cg:ig(c,d);break;case dg:jg(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!==d)switch(b){case cg:kg(c,
601
- d);break;case dg:lg(c,d);break;default:c.unlink(b,d)}}Ga(b){for(const c of b)mg(this.N(c))}Ub(b){for(const c of b)(b=this.get(c))&&ng(b)}us(b){b.forEach(c=>{this.N(c).persist()})}Wd(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.D(a.j.Io,b))}N(b,c=!1){let d;return null!=(d=this.get(b))?d:this.Pc(b,c)}Pc(b,c){const d=new olympe.dc.db.Instance(b,this);this.set(b,d);this.D(a.j.Ho,b);c&&this.R!==a.F.hl&&this.D(a.j.Dm,b);return d}$b(b){var c=olympe.V.Zh();this.F?og(this.F,c,b):b()}Y(b){let c;
602
- null!=(c=this.F)&&c.j.delete(b)}fb(b,...c){this.ua.has(b)&&this.ua.get(b).forEach(d=>{d(...c)})}D(b,c,...d){this.fb(b,c,...d)}ba(b,c){let d;null!=(d=this.F)&&d.J.set(b,c)}Wh(b,c,d,e){let f;null!=(f=this.F)&&pg(f,b).ka(e?qg+c:c,d)}Yh(b,c,d,e,f){let g;null!=(g=this.F)&&(d===rg?f?pg(g,b).link(c,e):pg(g,b).unlink(c,e):f?pg(g,b).Eb(c,e):pg(g,b).Ub(c,e))}Bb(b,c,d){let e;null!=(e=this.F)&&pg(e,b).$c(c,d)}addEventListener(b,c){let d=this.ua.get(b);void 0===d&&(d=[],this.ua.set(b,d));d.push(c)}j(b,c){this.addEventListener(b,
603
- c)}Eb(b){this.rc.push(b)}J(b){for(const c of this.$.values())if(c.R.has(b))return!0;return!1}Pk(b=!1){const c=gg++;this.R=a.F.bl;this.fa.add(c);b||this.$.set(c,new olympe.dc.db.Ct(c,this,this.$c));return c}Ey(b,c){if(!this.fa.has(b))throw Error('Database: cannot use a transaction that has not been started');let d;this.F=null!=(d=this.$.get(b))?d:null;b=this.R;this.R=null===this.F?a.F.hl:a.F.jv;c();this.R=b;this.F=null}Gf(b){this.R=a.F.jf;const c=this.$.get(b);c&&(this.F=c,sg(this.F),tg(this.F),this.$.delete(b),
604
- this.F=null);this.fa.delete(b);0===this.fa.size&&(this.R=a.F.IDLE,this.rc.forEach(d=>{d()}),ug(this.Vd))}Kc(b,c){const d=a.D.Pe;for(const [e,f]of c)void 0!==f&&(e[0]===d?vg(b,e.substring(1),f):b.update(e,f))}Ec(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(eg+cg)))for(const f of c.values())null!==f.source()&&this.Ec(b,f,d);return d}ps(){const b=a.j.El,c=a.j.jk,d=new Set,e=new Map;this.j(a.j.vp,f=>{d.add(f)});this.j(b,f=>{d.delete(f);e.delete(f)});this.j(c,(f,...g)=>{if(g[0]===
605
- dg&&g[1]===fg){const h=g[2];this.get(h).Ha()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.Eb(()=>{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 !`+`\nExtension models: ${Array.from(f.values()).join(', ')}`+`\n\n ${h.toString()}`)});
606
- e.clear()})}};olympe.dc.db.Database.D={Oi:'$',Vt:'~',Pe:'?',cl:'=',tp:'|',pl:'@',ORIGIN:olympe.dc.va.ORIGIN,DESTINATION:olympe.dc.va.DESTINATION};olympe.dc.db.Database.j={Ho:0,Io:1,tr:2,Dm:3,bo:4,co:5,El:6,Cc:7,jk:8,qm:9,vp:10,wp:11,Cq:12,Uz:13,Tz:14,$v:15,Yo:16};olympe.dc.db.Database.F={IDLE:0,bl:1,jv:2,hl:3,jf:4};function wg(a,b,c=[]){const d=b.T();Sf(a.D,b,c);return e=>{if(null!==e)a.D.push(d,e);else{e=a.D;var f=e.F.get(d);if(void 0!==f){const g=e.D.indexOf(d);e.D.splice(g,1);f=Wf(e,f.j,e.D.length);e.write(Uf(e,f,Date.now()),!1);e.F.delete(d)}}}}function xg(a,b,c={}){let d,e;return Yf(a.D,b,null!=(d=c.persist)?d:!0,null!=(e=c.Nm)?e:!1)}function yg(a,b){a.j.Eb(b)}
607
- olympe.dc.db.yt=class{constructor(a,b,c,d,e){this.G=a;this.j=b;this.view=c;this.D=new olympe.dc.db.ot(a,b,c,d);this.Ny=new olympe.dc.db.Tu(a,c,b,e)}ab(){return this.G}Tc(a,b={}){let c,d;this.D.Tc(a,null!=(c=b.persist)?c:!0,null!=(d=b.Nm)?d:!1)}};const zg=olympe.dc.db.Database.D.ORIGIN,Ag=olympe.dc.db.Database.D.DESTINATION,Bg=olympe.dc.db.Database.D.Oi,Cg=olympe.dc.db.Database.D.Pe,Dg=olympe.dc.db.Database.D.cl,Eg=olympe.dc.db.Database.D.tp,Fg=zg+Ag,Gg=Bg+Bg,Hg=olympe.dc.db.Database.F;let Ig=0;function qf(a,b,c,d=!1){const e=S(a,b);if(null!==e){const f=Jg(e,'',c);void 0!==f&&(a.j.getState()!==Hg.jf||e.J()&&!d||a.j.Y(c),d||!e.Ha()&&!e.J()||f(!1,b))}}
608
- function sf(a,b,c,d){a=a.j.N(Kg(b));d=null!=d?d:Lg();Mg(a,'',d,c)&&a.Ha()&&c(!0,b);return d}function Qf(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(olympe.dc.ha(e));for(const h of g)yield h,d.Jk(h,f).forEach(([k,,,l])=>{l&&g.add(k)})}.bind(null,a,b,c)}}function Lg(){++Ig;return String(Ig)}function Kg(a){if(a)return olympe.dc.ha(a);throw Error('DBView: Impossible to transform tag to string, provided tag is empty, null or undefined.');}
609
- function Ng(a,b,c,d,e){a=a.j.N(Kg(b));c=Kg(c);b=Bg+c;e=null!=e?e:Lg();if(Mg(a,b,e,d)&&a.Ha()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(Dg+c));void 0!==b&&d(b,f)}return e}function S(a,b,c=!1){if(b)return a=a.j.get(olympe.dc.ha(b)),!a||c&&!a.Ha()?null:a;throw Error('DBView: Impossible to get instance, provided tag is empty, null or undefined.');}function Og(a,b,c,d){b=S(a,b);null!==b&&(c=olympe.dc.ha(c),Jg(b,Bg+c,d),a.j.getState()===Hg.jf&&a.j.Y(d))}
610
- function Pg(a,b,c,d){a=a.j.N(Kg(b));d=null!=d?d:Lg();Mg(a,Gg,d,c)&&a.Ha()&&a.forEach((e,f)=>{const g=f[0];g!==Bg&&g!==Dg||c(f.substring(1),e,g===Dg)});return d}function Qg(a,b,c){b=S(a,b);null!==b&&(Jg(b,Gg,c),a.j.getState()===Hg.jf&&a.j.Y(c))}function Rg(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ha()||!c&&g.J())e?d(b.substring(1),b[0],c,h):d(c,h)})}function T(a,b,c,d,e){a=a.j.N(Kg(b));c=c.Ja()+c.X();e=null!=e?e:Lg();(d=Sg(a,c,e,d))&&a.Ha()&&Rg(a,c,!0,d,!1);return e}
611
- function Tg(a,b,c,d){const e=a.j.N(Kg(b));a=null!=d?d:Lg();const f=Sg(e,Fg,a,c);f&&e.Ha()&&e.forEach((g,h)=>{g=h[0];g!==zg&&g!==Ag||Rg(e,h,!0,f,!0)})}function Ug(a,b,c){const d=S(a,b);if(null!==d){const e=Jg(d,Fg,c);void 0!==e&&(a.j.getState()!==Hg.jf||d.J()||a.j.Y(c),!d.Ha()&&!d.J()||d.forEach((f,g)=>{f=g[0];(f===zg||f===Ag)&&e&&Rg(d,g,!1,e,!0)}))}}
612
- function Vg(a,b,c){b=S(a,b,!1);if(!b||c===olympe.dc.Lb.NONE)return[];const d=c.charAt(0)===olympe.dc.ce.$f,e=[];b.forEach((f,g)=>{const h=g.charAt(0);if(!d&&f instanceof olympe.dc.vc&&(h===Bg||h===Cg))(f=a.j.get(f.X()))&&e.push([f,g.substring(1),null,!0]);else if(h===zg||h===Ag){const k=g.substring(1),l=(h===zg?12:3)&Wg(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.La]:null;b=a.j.get(f);e.push([b,g,null,!0])}return e}
613
- function Xg(a,b,c,d,e){const f=a.j.N(Kg(b));e=null!=e?e:Lg();const g=Sg(f,Eg+c,e,d);g&&f.Ha()&&Vg(a,b,c).forEach(([h,...k])=>{h.Ha()&&g(...k,!0,h.tag())})}function Yg(a,b,c,d){const e=S(a,b);if(null!==e){const f=Jg(e,Eg+c,d);void 0!==f&&(a.j.getState()!==Hg.jf||e.J()||a.j.Y(d),!e.Ha()&&!e.J()||Vg(a,b,c).forEach(([g,...h])=>{(g.Ha()||g.J())&&f(...h,!1,g.tag())}))}}function Zg(a,b){a=S(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===Cg&&b.set(c.substring(1),d);return b}
614
- function Wg(a,b,c){if(c===olympe.dc.Lb.NONE)return 0;const d=c[0]===olympe.dc.ce.$f;c=d?c.substring(1):c;a=a.Qa(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function $g(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===zg||c===Ag){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(S(a,b,!0))}
615
- function ah(a,b,c){if(!a.Ha(b))return a.G.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ha(b)];for(const f of e){const g=a.bb(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.ha(b)}`);return d}function bh(a,b,c,d){return(c=(a=S(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ha()).length:0}
616
- 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.Ja()+b.X();const e=Jg(a,b,c);void 0!==e&&(this.j.getState()!==Hg.jf||a.J()&&!d||this.j.Y(c),d||!a.Ha()&&!a.J()||Rg(a,b,!1,e,!1))}}Ha(a){a=this.j.get(olympe.dc.ha(a));return!(null==a||!a.Ha())}name(a){let b,c;return null!=(c=null==(b=S(this,a))?void 0:b.Qa(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=S(this,a,!0))?a.model():null)?a.tag():null}Xe(a){return(a=(a=S(this,
617
- a,!0))&&a.Xe())?a.tag():null}ei(a){a=S(this,a,!0);return!(!a||!a.Xe())}Qb(a,b){a=(a=S(this,a,!0))&&a.model();return!(!a||!this.Nf(a.tag(),b))}source(a){return(a=S(this,a,!0))&&a.source()}ef(a){a=S(this,a,!1);return!a||a.N}Qa(a,b,c){a=S(this,a,!0);b=olympe.dc.ha(b);let d;return null!=(d=null==a?void 0:a.Qa(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===Bg||!b&&c===Dg)&&a.set(d.substring(1),e);return a}Jk(a,b){return Vg(this,a,b).filter(([c])=>c.Ha()).map(([c,
618
- ...d])=>[c.tag(),...d])}bb(a,b){a=S(this,a,!0);b=b.Ja()+b.X();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ha()&&a.push(c.tag());return a}ss(a,b,c){let d,e;a=null==(d=S(this,a,!0))?void 0:null==(e=d.get(b.Ja()+b.X()))?void 0:e.get(olympe.dc.ha(c));return!(null==a||!a.Ha())}dn(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.Ja()+c.X()),void 0!==a)for(const e of a.values())e.Ha()&&b.push(e.tag());a=b}return a}Jb(a,b){var c=
619
- S(this,a,!0);const d=b.Ja()+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.Ha())?a.tag():null}$g(a,b,c){a=olympe.dc.ha(a);const d=ah(this,a,b);d.delete(a);return c?(c=olympe.dc.ha(c),d.has(c)?Array.from(ah(this,c,b.ac()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Ur(a,b,c){if(!this.Ha(a))return null;b=ah(this,
620
- a,b);const d=[olympe.dc.ha(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}Xm(a,b,c){return this.dn(a,b).find(c)||null}hx(a,b,c){return this.dn(a,b).filter(c)}bs(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.Xe();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ha())throw a=`Try to get all extensions of the model ${olympe.dc.ha(a)} but one of them does not exists (${c.tag()})`,
621
- 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())}Nf(a,b){const c=olympe.dc.ha(b);return!!this.Ur(a,olympe.dc.CloudObject.extendRel,d=>d===c)}dd(a){return this.bb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.kb.prototype.getInstances=olympe.dc.kb.prototype.dd;olympe.dc.kb.prototype.isExtending=olympe.dc.kb.prototype.Nf;
622
- olympe.dc.kb.prototype.getExtendedModels=olympe.dc.kb.prototype.bs;olympe.dc.kb.prototype.findAllRelated=olympe.dc.kb.prototype.hx;olympe.dc.kb.prototype.findRelated=olympe.dc.kb.prototype.Xm;olympe.dc.kb.prototype.findRecursive=olympe.dc.kb.prototype.Ur;olympe.dc.kb.prototype.getRecursiveRelated=olympe.dc.kb.prototype.$g;olympe.dc.kb.prototype.getUniqueRelated=olympe.dc.kb.prototype.Jb;olympe.dc.kb.prototype.getMultiRelated=olympe.dc.kb.prototype.dn;olympe.dc.kb.prototype.isRelated=olympe.dc.kb.prototype.ss;
623
- olympe.dc.kb.prototype.getRelated=olympe.dc.kb.prototype.bb;olympe.dc.kb.prototype.getProperties=olympe.dc.kb.prototype.Cb;olympe.dc.kb.prototype.getProperty=olympe.dc.kb.prototype.Qa;olympe.dc.kb.prototype.isPersisted=olympe.dc.kb.prototype.ef;olympe.dc.kb.prototype.instanceOf=olympe.dc.kb.prototype.Qb;olympe.dc.kb.prototype.isModel=olympe.dc.kb.prototype.ei;olympe.dc.kb.prototype.extension=olympe.dc.kb.prototype.Xe;olympe.dc.kb.prototype.model=olympe.dc.kb.prototype.model;
624
- olympe.dc.kb.prototype.name=olympe.dc.kb.prototype.name;olympe.dc.kb.prototype.exist=olympe.dc.kb.prototype.Ha;const ch=olympe.dc.db.Database.D.ORIGIN,rg=olympe.dc.db.Database.D.DESTINATION,qg=olympe.dc.db.Database.D.cl,dh=olympe.dc.db.Database.D.Oi,eh=olympe.dc.db.Database.D.tp,fh=olympe.dc.db.Database.D.pl,gh=ch+rg,hh=dh+dh,ih=Array.from(Object.values(olympe.dc.Lb)).filter(a=>null!==a);function og(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)}
625
- function sg(a){for(const [b,c]of a.J)a.D.Ec(new Set,b).filter(d=>hg(d,c)).forEach(d=>{d=d.tag();c?pg(a,d).create():pg(a,d).delete()})}
626
- function tg(a){const b=a.D;a.F.forEach((c,d)=>{var e=b.get(d);if(c.D()||c.Ed()){var f=e.get(fh);f&&jh(a,f,c.D(),d);c.Ed()&&a.R.add(d)}for(const [n,p]of c.Cb()){var g=n[0]===qg,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(fh+dh+h);q&&jh(f,q,l,g);(k=k.get(fh+hh))&&jh(f,k,h,l,g)}for(const n of c.fa())kh(a,e,...n);(e=c.$)&&lh(a,e,d,c.$b,!c.Ed())});a.J.clear();a.F.clear();a.N.clear();mh(a)}function pg(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.uh(b),a.F.set(b,c));return c}
627
- function jh(a,b,...c){b.forEach((d,e)=>{og(a,e,d.bind(null,...c))})}function kh(a,b,c,d,e,f){var g=b.get(fh+d+c);g&&jh(a,g,f,e);(g=b.get(fh+gh))&&jh(a,g,c,d,f,e);nh(a,c,d).forEach((h,k)=>{(k=b.get(fh+eh+k))&&jh(a,k,c,d,h,f,e)})}function lh(a,b,c,d,e){ih.forEach(f=>{const g=f[0]===olympe.dc.ce.$f;(f=a.D.get(g?c:b).get(fh+eh+f))&&jh(a,f,d,null,!0,e,g?b:c)})}
628
- function mh(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 nh(a,b,c){const d=b+c;let e=a.N.get(d);if(!e){const f=a.D.get(b);e=new Map;ih.forEach(g=>{const h=g[0]===olympe.dc.ce.$f;var k=h?g.substring(1):g;let l;k=null!=(l=null==f?void 0:f.get(dh+k))?l:0;k=h?((k&3)<<2)+((k&12)>>2):k;(c===ch?12:3)&k&&e.set(g,!!((c===ch?8:2)&k))});a.N.set(d,e)}return e}
629
- olympe.dc.db.Ct=class{constructor(a,b,c){this.id=a;this.D=b;this.Y=c;this.J=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 ug(a){if(!a.F&&0<a.D.size)switch(a.mode){case olympe.dc.db.qf.j.Fn:a.F=!0;setTimeout(()=>{a.j.getState()===olympe.dc.db.Database.F.IDLE&&a.run()},a.delay);break;case olympe.dc.db.qf.j.Ov:a.F=!0,a.run()}}
630
- olympe.dc.db.qf=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.qf.j.Bl&&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.Wd(c),b.push(c))}this.D.clear();this.j.fb(olympe.dc.db.Database.j.Yo,b);this.F=!1}init(){const a=olympe.dc.db.Database.j.tr,b=olympe.dc.db.Database.j.wp,
631
- c=olympe.dc.db.Database.j.Cq,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&ug(this)};this.j.j(olympe.dc.db.Database.j.Dm,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.$v,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.qf.j={Bl:0,Ov:1,Fn:2};olympe.dc.db.qf.D=5E3;olympe.dc.db.fc=class{constructor(a){this.id=null!=a?a:olympe.V.Hf();this.Ab=new Map}T(){return this.id}tc(a){const b=olympe.dc.db.uh.j.Yl,c=olympe.dc.db.uh.j.Cc,d=olympe.dc.db.uh.j.xk;this.Ab.forEach((e,f)=>{const g=e.Vb();switch(e.getState()){case b:const h=e.sb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.R()?e.Cb():void 0;a.Pc(f,h,k,g);break;case d:e.R()&&a.Wc(f,e.Cb(),g);break;case c:a.D(f,e.J(),g)}for(const [h,k,l]of e.Dd())e=this.Ab.get(k),
632
- l?a.Oa(h,f,k,g,e.Vb()):a.ic(h,f,k,g,e.Vb())});return a}cf(){return 0===this.Ab.size}J(){let a=0;this.Ab.forEach(b=>{a+=b.Ec()});return a}Pc(a,b,c,d=null){b=this.F(a).create(b);'string'===typeof d&&this.Oa(olympe.dc.hc.Yc,a,d,d,null);c&&b.Lm(c)}Wc(a,b,c=null){b&&this.F(a,c).Lm(b)}D(a,b=olympe.dc.Lb.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.Jk(a,b,!1))this.Ab.get(e).Cb().clear(),this.Y(e,!0)}}Oa(a,b,c,d=null,e=null){this.F(b,d).link(a,
633
- 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).Ub(a,b)}$(a){var b=olympe.dc.ia();if(b.Ha(a)){const c=b.model(a),d=b.source(a),e=b.Cb(a,!0);Zg(b,a).forEach((f,g)=>{e.set(`${olympe.dc.ce.Pe}${g}`,f)});this.Pc(a,d,e,c);(b=b.Xe(a))&&this.Oa(olympe.dc.hc.ti,a,b);e.forEach(f=>{f instanceof olympe.dc.vc&&this.$(f.X())})}}dd(){return function*(a){for(const b of a.values())if(b.D()||b.Ed()||b.R())yield b}(this.Ab)}Rc(a){let b;return null!=(b=this.Ab.get(olympe.dc.ha(a)))?
634
- b:null}j(a,b=olympe.dc.Lb.NONE){a=this.Jk(a,b);for(const c of a)this.Y(c,!1),this.Ab.delete(c)}Dd(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.Dd((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.Ab.values())}$g(a,b,c=(d,e)=>[d,e]){return this.fa(a,b,c)}*fa(a,b,c,d=[]){d.push(a);a=this.Rc(a);for(const [e,f]of a.bb(b))d.includes(e)||(yield*this.fa(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.N(a,olympe.dc.va.DESTINATION,c);e&&e.N(a,olympe.dc.va.ORIGIN,
635
- 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.Dd())if(k||!b){e.N(g,d,h);var f=this.Ab.get(h);f&&f.N(g,c,a)}for(const [g,h,k]of e.fb())if(k||!b)e.N(g,c,h),(f=this.Ab.get(h))&&f.N(g,d,a)}*gs(a){let b;for(const [c,d]of(null==(b=this.Rc(a))?void 0:b.bb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.Ab.get(c),a.Ed()||(yield a))}Jk(a,b,c=!0){const d=olympe.dm.Relation.j.Jq,e=olympe.dm.Relation.j.rr,f=olympe.dc.va.ORIGIN,g=olympe.dc.ia();a=new Set([a]);
636
- 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.Dd())q&&Wg(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.fb())q&&Wg(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of $g(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&Wg(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.uh(a),this.Ab.set(a,c));return b?c.Ga(b):c}R(a){const b=
637
- olympe.dc.va.DESTINATION;for(const [c,d]of this.ba(a))if(a=c.tag(),d.Ed())this.j(a,d.J());else if(c.Ed())d.D()&&this.j(a,c.J());else{c.Cb().forEach((e,f)=>{void 0!==d.Qa(f)&&c.ba(f)});for(const [e,f,g]of c.Dd()){const h=d.Bb(e,b,f);void 0!==h&&g!==h&&this.N(e,a,f)}}return this}*ba(a){var b=this.Ab;const c=a.Ab,d=(a=a.J()>this.J())?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.xa=[olympe.dc.Writable,olympe.dc.vq];const oh=olympe.dc.db.Database.j,ph=olympe.dc.db.Database.D.Oi,qh=olympe.dc.db.Database.D.Vt,rh=olympe.dc.db.Database.D.Pe,sh=olympe.dc.db.Database.D.cl,th=olympe.dc.db.Database.D.pl,U=olympe.dc.va.ORIGIN,V=olympe.dc.va.DESTINATION,uh=olympe.dc.hc.Yc,vh=olympe.dc.hc.ti;function Rf(a,b,c=!1){const d=a.get(rh+b);return c||void 0!==d?d:a.get(qh+b)}function hg(a,b){const c=a.e!==b;c&&(b?(a.e=b,wh(a)):(xh(a),a.e=b),a.db.D(b?oh.El:oh.Cc,a.j));return c}
638
- function ig(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(uh,c)}a.link(uh,b);b.forEach((d,e)=>{if(e[0]===rh||e[0]===qh)e=e.substring(1),yh(a,e,d)});null===a.F||!b.e&&b!==a||a.db.ba(a,!0)}function jg(a,b){const c=a.Xe();if(null!==c){if(c===b)return;a.unlink(vh,c)}a.link(vh,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===rh||f[0]===qh)f=f.substring(1),a.has(rh+f)||(a.set(qh+f,e),d.set(f,e))});zh(a,d)}
639
- function kg(a,b){a.unlink(uh,b);a.forEach((c,d)=>{c=d.substring(1);yh(a,c,null)});a.db.ba(a,!1)}function lg(a,b){a.unlink(vh,b);const c=new Map;a.forEach((d,e)=>{e[0]===qh&&(a.delete(e),d=e.substring(1),c.set(d,null))});zh(a,c)}function mg(a){a.c++;1===a.c&&a.db.D(oh.tr,a.j)}
640
- function ng(a){0<a.c?--a.c:a.db.D(oh.Cq,a.j,`Try to decrease references on instance ${a.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===a.c&&a.db.D(oh.Dm,a.j)}
641
- function vg(a,b,c){const d=rh+b;var e=a.get(d);e=void 0===e?null:e;if(!Ah(e,c))if(Bh(a,b,e,c,!0),e=qh+b,null===c){a.delete(d);let f;c=null==(f=a.Xe())?void 0:Rf(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);zh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),zh(a,(new Map).set(b,c))}function Mg(a,b,c,d){const e=Ch(a,th+b);return e.has(c)?!1:(e.set(c,d),mg(a),a.db.D(oh.bo,a.j,b,c),!0)}function Jg(a,b,c){const d=Dh(a,th+b,c);void 0!==d&&(ng(a),a.db.D(oh.co,a.j,b,c));return d}
642
- function Sg(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];(g=a.db.get(f[g-1]))&&(h?mg(g):ng(g));d(...f)};return Mg(a,b,c,e)?e:null}function Ah(a,b){return a instanceof Date?b instanceof Date&&a.getTime()===b.getTime():null!==a&&'function'===typeof a.Ea?a.Ea(b):a===b}
643
- function Bh(a,b,c,d,e){c instanceof olympe.dc.vc&&(Eh(a.db.get(c.X())),a.db.$a(c.X()));d instanceof olympe.dc.vc&&(c=a.db.N(d.X(),!0),c.D&&c.D.tag!==a.j&&a.db.ab().fatal('Instance',d.X(),'referenced multiple times!\nThis instance is currently property of',c.D.tag,'(for the property '+c.D.La+')','and is assigned as a property of',a.j,'(for the property '+b+')'),d=c,a=a.j,void 0===d.D&&(mg(d),d.db.Bb(d.j,a,b)),d.D={tag:a,La:b,Ay:e})}function Fh(a,b,c,d){a.e&&a.db.Wh(a.j,b,c,d)}
644
- function zh(a,b,c=[]){const d=a.get(U+uh);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>yh(e,g,f))});a=a.get(U+vh);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(rh+k)||(g.set(k,h),null!==h?e.set(qh+k,h):e.delete(qh+k))});zh(e,g,[...c,f])}})}function Ch(a,b){let c;return null!=(c=a.get(b))?c:a.create(b)}function Gh(a,b,c,d,e){a.db.Yh(a.j,b,c,d.j,e)}
645
- function Dh(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 yh(a,b,c){if(!a.has(ph+b)){const d=sh+b,e=a.get(d);Ah(c,void 0!==e?e:null)||(null===c?a.delete(d):a.set(d,c),Fh(a,b,c,null!==c))}}function wh(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&&(Gh(a,e,d,g,!0),Gh(g,e,f,a,!0))})}else if(d===ph||d===sh)c=c.substring(1),Fh(a,c,b,d===sh)})}
646
- function xh(a){a.forEach((b,c)=>{const d=c[0];if(d!==th){var e=c.substring(1);d===U?b.forEach(f=>{f.unlink(e,a)}):d===V?b.forEach(f=>{a.unlink(e,f)}):d===ph?a.update(e,null):d===rh&&vg(a,e,null);a.delete(c)}});if(void 0!==a.D){const b=a.db.get(a.D.tag),c=a.D.Ay;let d,e;(null==(d=b.get(`${c?rh:ph}${a.D.La}`))?void 0:null==(e=d.X)?void 0:e.call(d))===a.j&&(c?vg(b,a.D.La,null):b.update(a.D.La,null))}}function Eh(a){void 0!==a.D&&(ng(a),a.db.Bb(a.j,a.D.tag,a.D.La),a.D=void 0)}
647
- olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.j=a;this.F=null;this.e=!1;this.D=void 0;this.c=0;this.N=!1;this.db=b}tag(){return this.j}Ha(){return this.e}J(){return this.db.J(this.j)}source(){return this.F}model(){const a=this.get(V+uh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}Xe(){const a=this.get(V+vh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Qa(olympe.dc.CloudObject.nameProp.X());a=`Instance: ${this.j}, Exist: ${this.e}, Name: ${a}`;
648
- var b=this.model();if(b){var c=b.Qa(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.Xe())?(c=b.Qa(olympe.dc.CloudObject.nameProp.X())||'No extension name',a+=`\nExtension: ${b.j}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Qa(a,b=!1){const c=this.get(ph+a);return b||void 0!==c?c:this.get(sh+a)}update(a,b){const c=ph+a;var d=this.get(c);d=void 0===d?null:d;if(!Ah(d,b))if(Bh(this,
649
- a,d,b,!1),d=sh+a,null===b){this.delete(c);let e;b=null==(e=this.model())?void 0:Rf(e,a);void 0!==b?(this.set(d,b),Fh(this,a,b,!0)):Fh(this,a,null,!1)}else this.set(c,b),this.delete(d),Fh(this,a,b,!1)}link(a,b){var c=U+a;const d=Ch(this,V+a);c=Ch(b,c);d.has(b.j)||(d.set(b.j,b),c.set(this.j,this),this.db.D(oh.jk,this.j,a,V,b.j),this.db.D(oh.jk,b.j,a,U,this.j),this.e&&b.e&&(Gh(this,a,V,b,!0),Gh(b,a,U,this,!0)))}unlink(a,b){const c=U+a;void 0!==Dh(this,V+a,b.j)&&(Dh(b,c,this.j),this.db.D(oh.qm,this.j,
650
- a,V,b.j),this.db.D(oh.qm,b.j,a,U,this.j),this.e&&b.e&&(Gh(this,a,V,b,!1),Gh(b,a,U,this,!1)))}persist(){this.N=!0;return this}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===ph&&a instanceof olympe.dc.vc&&Eh(this.db.get(a.X()))});void 0!==this.D&&this.db.get(this.D.tag).delete(ph+this.D.La)}create(a){const b=new Map;this.set(a,b);return b}};
651
- olympe.dc.db.Instance.j={eB:'instance',ZB:'rel',pl:'cb',pm:'ref',TRANSACTION:'tx'};olympe.dc.db.uh=class a{constructor(b){this.rc=b;this.Y=this.$a=null;this.Nb=olympe.dc.Lb.NONE;this.F=a.j.xk;this.j=this.ob=this.$b=this.$=this.properties=null}tag(){return this.rc}Vb(){return this.Y}sb(){return this.$a}getState(){return this.F}Ga(b){if(null===this.Y)this.Y=b;else if(this.Y!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.Y}`);return this}J(){return this.F===a.j.Cc?this.Nb:olympe.dc.Lb.NONE}create(b){this.F=a.j.Yl;this.$a=null!=
652
- b?b:null;return this}delete(b=olympe.dc.Lb.NONE){this.F=a.j.Cc;this.Nb=b;this.properties=null;return this}ka(b,c){if(this.F===a.j.Cc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}Lm(b){this.F!==a.j.Cc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}$c(b,c){if(null!==this.$&&this.$!==b)throw Error('An instance should never be set as complex property of multiple instances');this.$=b;this.$b=c}ba(b){let c;null==
653
- (c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.hc.Yc&&this.Ga(c);this.sa(this.ob,b,c,!0);return this}unlink(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.hc.Yc&&this.Ga(c);this.sa(this.ob,b,c,!1);return this}Eb(b,c){null===this.j&&(this.j=new Map);this.sa(this.j,b,c,!0)}Ub(b,c){null===this.j&&(this.j=new Map);this.sa(this.j,b,c,!1)}Bb(b,c,d){if(c=c===olympe.dc.va.ORIGIN?this.j:this.ob)return(b=c.get(b))&&
654
- b.get(d)}N(b,c,d){const e=(c=c===olympe.dc.va.ORIGIN?this.j:this.ob)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}D(){return this.F===a.j.Yl}Ed(){return this.F===a.j.Cc}Ec(){let b=this.properties?this.properties.size:0,c;null==(c=this.ob)||c.forEach(d=>{b+=d.size});return b}R(){return null!==this.properties}Kc(){return null!==this.ob||null!==this.j}Cb(){let b;return null!=(b=this.properties)?b:new Map}Qa(b){if(this.properties)return this.properties.get(b)}bb(b,c=(d,e)=>[d,e]){return function*(d){if(d=
655
- d&&d.get(b.X()))for(const [e,f]of d)yield c(e,f)}(b.Ja()===olympe.dc.va.ORIGIN?this.j:this.ob)}Jb(b){const c=b.Ja()===olympe.dc.va.ORIGIN?this.j:this.ob;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}Dd(b=(c,d,e)=>[c,d,e]){return this.ua(this.ob,b)}fb(b=(c,d,e)=>[c,d,e]){return this.ua(this.j,b)}fa(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)=>b(h,c,k,l))}(this.ua.bind(this),
656
- this.ob,this.j)}sa(b,c,d,e){if(this.F!==a.j.Cc||!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)}}*ua(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.uh.j={Yl:0,xk:1,Cc:2};olympe.dc.db.Tu=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.ha(a);if(this.j.has(b)){var c=this.j.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ha()){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.Oi+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
657
- ' (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.Io,b=olympe.dc.db.Database.j.El,c=olympe.dc.db.Database.j.Cc,d=olympe.dc.db.Database.j.jk,e=olympe.dc.db.Database.j.qm,f=olympe.dc.db.Database.j.bo,g=olympe.dc.db.Database.j.co,h=()=>{};this.j.j(olympe.dc.db.Database.j.Ho,()=>{});this.j.j(a,()=>{});this.j.j(b,k=>{this.j.$b(()=>{Tg(this.view,
658
- k,h,`monitorRelations${k}`)})});this.j.j(c,k=>{this.j.$b(()=>{Ug(this.view,k,`monitorRelations${k}`)})});this.j.j(d,()=>{});this.j.j(e,()=>{});this.j.j(f,()=>{});this.j.j(g,()=>{})}};olympe.dc.db.Em=class{constructor(a,b,c,d){this.G=a;this.j=b;this.ia=c;this.F=d;this.transactionId=null}open(a){if(null!==this.transactionId)throw Error('A transaction is already open');this.transactionId=this.j.Pk(a);this.G.debug(`DB Writer: transaction ${this.transactionId} opened`)}write(a,b){b&&(b=new Hh(this.ia),a.tc(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',
659
- this.transactionId);this.j.Ey(this.transactionId,()=>a.tc(this))}close(){if(null===this.transactionId)throw Error('No transaction is open');this.j.Gf(this.transactionId);this.G.debug(`DB Writer: transaction ${this.transactionId} committed`);this.transactionId=null}Pc(a,b,c,d){this.j.create(a,b,c,this.F);d&&this.j.link(olympe.dc.hc.Yc,a,d)}Wc(a,b){this.j.update(a,b)}D(a,b=olympe.dc.Lb.NONE){for(const c of Qf(this.ia,a,b))this.j.$a(c)}Oa(a,b,c){this.j.link(a,b,c)}ic(a,b,c){this.j.unlink(a,b,c)}};
660
- function Ih(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)if(d+=(d?', "':'"')+e+'":',!f)d+=JSON.stringify(f);else if(f instanceof olympe.dc.vc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.X()+'")';else if(f instanceof olympe.C.Color)d+='Color("'+f.ah()+','+f.Yg()+','+f.Vg()+','+f.Ug()+'")';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+=Ih(a,f,
661
- (null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function Jh(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function Kh(a,b){let c;return b===olympe.dc.hc.Yc?'Model':null!=(c=a.db.name(b))?c:b}
662
- class Hh{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}`:''}`}Pc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${Ih(this,c)})`,Jh(this,d))}Wc(a,b,c){this.log(`updateInstance(tag: ${a}, ${Ih(this,b)})`,Jh(this,c))}D(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,Jh(this,c))}Oa(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,Kh(this,a))}ic(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
663
- Kh(this,a))}}olympe.dc.db.Em.xa=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.P={Ca:'dc.db.Logger',Il:'dc.db.gc.Logger',Da:'dc.db.DatabaseManager',Jj:'dc.db.Database',xl:'dc.db.DBView',ZA:'dc.db.Graph',aA:'dc.db.DatabaseWriter',OB:'dc.db.PermissionProcessor',Gi:'dc.db.GraphMonitor'};olympe.dc.db.U={Zo:'db.garbageCollector',$o:'db.garbageCollectorDelay',rl:'db.commitBufferTimeout',Gi:'db.monitor',Su:'db.monitorCounters',Ru:'db.monitorCallbacks',zo:'db.debug'};
664
- olympe.W.config(function(a){F(a,olympe.dc.db.U.Zo,olympe.dc.db.qf.j.Fn);F(a,olympe.dc.db.U.$o,5E3);F(a,olympe.dc.db.U.rl,3E4);F(a,olympe.dc.db.U.Gi,!1);F(a,olympe.dc.db.U.zo,!1);E(a,olympe.dc.db.P.Ca,[olympe.ja.P.Da],b=>b.cd('db'));E(a,olympe.dc.db.P.Il,[olympe.ja.P.Da],b=>b.cd('gc'));E(a,olympe.dc.db.P.Jj,[olympe.dc.db.P.Ca,olympe.dc.db.P.Il,new olympe.W.pa(olympe.dc.U.Mg),new olympe.W.pa(olympe.dc.db.U.Zo),new olympe.W.pa(olympe.dc.db.U.$o),new olympe.W.pa(olympe.dc.U.Ih),new olympe.W.pa(olympe.dc.db.U.zo)],
665
- (b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.qf.j.Bl: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)});D(a,olympe.dc.db.P.xl,olympe.dc.kb,olympe.dc.db.P.Ca,olympe.dc.db.P.Jj);E(a,olympe.dc.db.P.Gi,[olympe.dc.db.P.Da],b=>b.Ny);E(a,olympe.dc.db.P.Da,[olympe.dc.db.P.Ca,olympe.dc.db.P.Jj,olympe.dc.db.P.xl,new olympe.W.pa(olympe.dc.U.Uf),new olympe.W.pa(olympe.dc.db.U.rl),new olympe.W.pa(olympe.dc.db.U.Gi),new olympe.W.pa(olympe.dc.db.U.Su),
666
- new olympe.W.pa(olympe.dc.db.U.Ru)],(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.yt(b,c,d,e,g)})},'olympe.dc.db');olympe.W.run([olympe.dc.db.P.Jj,olympe.dc.db.P.Gi],(a,b)=>{olympe.Zd().db=a;olympe.Zd().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function Lh(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
667
- olympe.dc.query.mf=class{constructor(a,b,c){this.db=olympe.dc.ia();this.j=a;this.La=b;this.Ei=c}ga(){return{p:this.La.X(),o:this.Ei}}toString(){return'sortByQueryPart-'+this.Ei+this.La.X()}Wg(){const a=this.db.Jb(this.La,olympe.dm.Property.typeRel),b=olympe.dc.ha;if(this.db.Nf(a,olympe.dm.String))return Lh((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return Lh((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return Lh((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return Lh((c,
668
- d)=>c.compare(d));olympe.ja.ab('dc.query').warn(`No comparator found for type with tag ${a}`);return Lh(()=>-1)}Qa(){return this.La}};olympe.dc.Qe=class{X(){}};olympe.dc.Qe.prototype.getTag=olympe.dc.Qe.prototype.X;olympe.dc.bB=olympe.dc.Qe;function Mh(a){let b;if(null==(b=a.j)?0:b.cf())if(a=a.J,!a.N){let c;null==(c=a.R)||c.call(a)}}function Nh(a,b,c,d,e){Mh(a);let f,g;b?null==(f=a.j)||f.Oa(c,d,e):null==(g=a.j)||g.ic(c,d,e)}
669
- olympe.dc.query.Xu=class{constructor(a,b,c,d){this.G=a;this.source=b;this.D=c;this.J=d;this.j=this.F=null;this.db=olympe.dc.ia()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.D}:${a}:notif`;sf(this.db,a,(d,e)=>{if(d){Mh(this);let f;null==(f=this.j)||f.$(e)}else if(b&&Qg(this.db,e,c),!this.db.Ha(e)){Mh(this);let f;null==(f=this.j)||f.D(e,olympe.dc.Lb.NONE)}},c);b&&Pg(this.db,a,(d,e,f)=>{Mh(this);let g;f||null!=(g=this.j)&&g.Wc(a,new Map([[d,e]]))},c)}}stop(a){qf(this.db,a,`${this.D}:${a}:notif`)}};olympe.dc.query.dk={ASC:'ASC',DESC:'DESC'};function Oh(a){const b=Ph(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.dd()),n=new Map,p=a.J.has(f);let q=p?';':'';if(c.has(f)){const [r,t,u]=c.get(f);c.delete(f);q+=u;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,X)=>K.add(X),null!=(A=n.get(z))?A:new Set))}l.delete(y)});t&&l.forEach(x=>{const y=p?`${x};${u}`:u;for(const z of k.j(x)){let A;n.set(z,
592
+ function Wf(a,b,c){return a.D.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>{let f;return null!=(f=null==e?void 0:e.Tc(d))?f:d},b)}function Xf(a,b,c,d=!1){return w(function*(){const e=new olympe.dc.db.Jm(a.G,a.H,a.ia,c);e.open(d);for(const f=fa(b);;){const g=yield f.next();if(g.done)break;e.write(g.value,a.R)}e.close()})}
593
+ function Yf(a,b,c,d){b=b.pipeThrough(olympe.V.stream.tap(e=>{0<a.D.length&&Uf(a,Wf(a,e.jc(),a.D.length),e.Lk)}));return Xf(a,b,c,d).then(()=>a.G.debug('Rebase stream completed')).catch(e=>a.G.error('Rebase stream failed:',e))}
594
+ olympe.dc.db.xt=class{constructor(a,b,c,d){this.G=a;this.H=b;this.ia=c;let e;this.R=null!=(e=d.get('debug'))?e:!1;let f;this.N=null!=(f=d.get('bufferTimeout'))?f:0;this.D=[];this.F=new Map;this.j=[];b.addEventListener(olympe.dc.db.Database.j.ep,g=>{this.j.forEach(h=>{for(const k of g)h.j.j(k)})})}Tc(a,b,c){const d=a.T(),e=a.Lk;this.F.has(d)?this.push(d,e):(a=Uf(this,Wf(this,a.jc(),this.D.length),e),this.write(a,b,c))}push(a,b){const c=this.D.indexOf(a);if(-1<c){const d=this.F.get(a);this.D.splice(c,
595
+ 1);Uf(this,Wf(this,d.D,c),b);this.F.delete(a)}}write(a,b,c=!1){b=new olympe.dc.db.Jm(this.G,this.H,this.ia,b);b.open(c);b.write(a,this.R);b.close()}};class Zf{T(){}Tc(){}}function $f(a,b,c,d){const e=olympe.dc.ua.DESTINATION;c=c.tag();const f=a.j.Qc(c);b.Db().forEach((g,h)=>{f.ka(h,g);b.da(h)});for(const [g,h,k,l]of b.ha()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.j.Oa(g,n,p);d.N(g,n,p)}}
596
+ function ag(a,b,c,d){const e=olympe.dc.ua.DESTINATION,f=c.tag(),g=a.j.Qc(f);b.Db().forEach((h,k)=>{void 0!==c.Qa(k)&&(g.ka(k,h),b.da(k))});for(const [h,k,l]of b.Ed()){const n=c.zb(h,e,k);void 0!==n&&(d.N(h,f,k),n===l&&a.j.N(h,f,k))}}
597
+ class Tf extends Zf{constructor(a,b){super();this.D=a;this.j=b;this.db=olympe.dc.ia()}T(){return this.D.T()}Tc(a){for(const [b,c]of this.D.da(a)){const d=b.tag();c.td()?b.D()?a.j(d,b.H()):(this.D.j(d,c.H()),this.j.j(d,c.H())):b.td()?($f(this,c,b,a),a.j(d,b.H())):ag(this,c,b,a)}return a}}function bg(a){clearTimeout(a.F);a.F=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.H)}
598
+ class Vf extends Zf{constructor(a,b,c,d){super();this.j=a;this.D=b;this.buffer=c;this.H=d;this.F=null;bg(this)}T(){return this.j.T()}Tc(a){return a.R(this.j)}update(a,b){this.D=b;a.qc(this.j);bg(this);return this}};const cg=olympe.dc.fc.Yc,dg=olympe.dc.fc.Ai,eg=olympe.dc.ua.ORIGIN,fg=olympe.dc.ua.DESTINATION;let gg=0;
599
+ 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.Ja.SELF;this.G=b;this.Bd=olympe.C.Xa();this.R=olympe.dc.db.Database.F.IDLE;this.wa=new Map;this.zc=[];this.$=new Map;this.H=null;this.ha=new Set;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.uf.j.Hl;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Id=new olympe.dc.db.uf(c,this,b,f);d.get('debug')&&this.xs()}T(){return this.id}getState(){return this.R}$a(){return this.G}create(b,
600
+ 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.da(f,!0)}e&&f.persist();this.R===a.F.ol&&hg(f,!0);d&&this.$c(f,d);this.D(a.j.Cp,b)}update(b,c){c&&(b=this.N(b,!0),this.$c(b,c))}Ha(b){const c=this.get(b);void 0!==c&&(this.da(c,!1),this.D(a.j.Dp,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case cg:ig(c,d);break;case dg:jg(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!==d)switch(b){case cg:kg(c,
601
+ d);break;case dg:lg(c,d);break;default:c.unlink(b,d)}}ai(b,c){for(const d of b)this.N(d).je(c)}Wk(b,c){for(const d of b)(b=this.get(d))&&b.detach(c)}Bs(b){b.forEach(c=>{this.N(c).persist()})}Rd(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.D(a.j.Oo,b))}N(b,c=!1){let d;return null!=(d=this.get(b))?d:this.Oc(b,c)}Oc(b,c){const d=new olympe.dc.db.Instance(b,this);this.set(b,d);this.D(a.j.No,b);c&&this.R!==a.F.ol&&this.D(a.j.Im,b);return d}Mb(b){var c=olympe.V.di();this.H?mg(this.H,
602
+ c,b):b()}Y(b){let c;null!=(c=this.H)&&c.j.delete(b)}cb(b,...c){this.wa.has(b)&&this.wa.get(b).forEach(d=>{d(...c)})}D(b,c,...d){this.cb(b,c,...d)}da(b,c){let d;null!=(d=this.H)&&d.H.set(b,c)}af(b,c,d,e){let f;null!=(f=this.H)&&ng(f,b).ka(e?og+c:c,d)}$h(b,c,d,e,f){let g;null!=(g=this.H)&&(d===pg?f?ng(g,b).link(c,e):ng(g,b).unlink(c,e):f?ng(g,b).Mb(c,e):ng(g,b).vc(c,e))}jb(b,c,d){let e;null!=(e=this.H)&&ng(e,b).Rd(c,d)}addEventListener(b,c){let d=this.wa.get(b);void 0===d&&(d=[],this.wa.set(b,d));d.push(c)}j(b,
603
+ c){this.addEventListener(b,c)}zb(b){this.zc.push(b)}F(b){for(const c of this.$.values())if(c.R.has(b))return!0;return!1}ci(b=!1){const c=gg++;this.R=a.F.il;this.ha.add(c);b||this.$.set(c,new olympe.dc.db.Lt(c,this,this.Bd));return c}Oy(b,c){if(!this.ha.has(b))throw Error('Database: cannot use a transaction that has not been started');let d;this.H=null!=(d=this.$.get(b))?d:null;b=this.R;this.R=null===this.H?a.F.ol:a.F.tv;c();this.R=b;this.H=null}$e(b){this.R=a.F.nf;const c=this.$.get(b);c&&(this.H=
604
+ c,qg(this.H),rg(this.H),this.$.delete(b),this.H=null);this.ha.delete(b);0===this.ha.size&&(this.R=a.F.IDLE,this.zc.forEach(d=>{d()}),sg(this.Id))}$c(b,c){const d=a.D.Se;for(const [e,f]of c)void 0!==f&&(e[0]===d?tg(b,e.substring(1),f):b.update(e,f))}vc(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(eg+cg)))for(const f of c.values())null!==f.source()&&this.vc(b,f,d);return d}xs(){const b=a.j.Kl,c=a.j.rk,d=new Set,e=new Map;this.j(a.j.Cp,f=>{d.add(f)});this.j(b,f=>{d.delete(f);e.delete(f)});
605
+ this.j(c,(f,...g)=>{if(g[0]===dg&&g[1]===fg){const h=g[2];this.get(h).Ga()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.zb(()=>{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 !`+`\nExtension models: ${Array.from(f.values()).join(', ')}`+
606
+ `\n\n ${h.toString()}`)});e.clear()})}};olympe.dc.db.Database.D={Ui:'$',du:'~',Se:'?',jl:'=',zp:'|',wi:'@',ORIGIN:olympe.dc.ua.ORIGIN,DESTINATION:olympe.dc.ua.DESTINATION};olympe.dc.db.Database.j={No:0,Oo:1,Ar:2,Im:3,jo:4,ko:5,Kl:6,Dc:7,rk:8,wm:9,Cp:10,Dp:11,Jq:12,dA:13,cA:14,jw:15,ep:16};olympe.dc.db.Database.F={IDLE:0,il:1,tv:2,ol:3,nf:4};function ug(a,b,c=[]){const d=b.T();Sf(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=Wf(e,f.j,e.D.length);e.write(Uf(e,f,Date.now()),!1);e.F.delete(d)}}}}function vg(a,b,c={}){let d,e;return Yf(a.j,b,null!=(d=c.persist)?d:!0,null!=(e=c.Sm)?e:!1)}function wg(a,b){a.D.zb(b)}
607
+ olympe.dc.db.Ht=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.Xy=new olympe.dc.db.bv(a,c,b,e)}$a(){return this.G}Tc(a,b={}){let c,d;this.j.Tc(a,null!=(c=b.persist)?c:!0,null!=(d=b.Sm)?d:!1)}je(a,b){this.D.ai(a,b)}detach(a,b){this.D.Wk(a,b);return this}};const xg=olympe.dc.db.Database.D.ORIGIN,yg=olympe.dc.db.Database.D.DESTINATION,zg=olympe.dc.db.Database.D.Ui,Ag=olympe.dc.db.Database.D.Se,Bg=olympe.dc.db.Database.D.jl,Cg=olympe.dc.db.Database.D.zp,Dg=xg+yg,Eg=zg+zg,Fg=olympe.dc.db.Database.F;let Gg=0;function qf(a,b,c,d=!1){const e=S(a,b);if(null!==e){const f=Hg(e,'',c);void 0!==f&&(a.j.getState()!==Fg.nf||e.F()&&!d||a.j.Y(c),d||!e.Ga()&&!e.F()||f(!1,b))}}
608
+ function sf(a,b,c,d){a=a.j.N(Ig(b));d=null!=d?d:Jg();Kg(a,'',d,c)&&a.Ga()&&c(!0,b);return d}function Qf(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.Qk(h,f).forEach(([k,,,l])=>{l&&g.add(k)})}.bind(null,a,b,c)}}function Jg(){++Gg;return String(Gg)}function Ig(a){if(a)return olympe.dc.fa(a);throw Error('DBView: Impossible to transform tag to string, provided tag is empty, null or undefined.');}
609
+ function Lg(a,b,c,d,e){a=a.j.N(Ig(b));c=Ig(c);b=zg+c;e=null!=e?e:Jg();if(Kg(a,b,e,d)&&a.Ga()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(Bg+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.Ga()?null:a;throw Error('DBView: Impossible to get instance, provided tag is empty, null or undefined.');}function Mg(a,b,c,d){b=S(a,b);null!==b&&(c=olympe.dc.fa(c),Hg(b,zg+c,d),a.j.getState()===Fg.nf&&a.j.Y(d))}
610
+ function Ng(a,b,c,d){a=a.j.N(Ig(b));d=null!=d?d:Jg();Kg(a,Eg,d,c)&&a.Ga()&&a.forEach((e,f)=>{const g=f[0];g!==zg&&g!==Bg||c(f.substring(1),e,g===Bg)});return d}function Og(a,b,c){b=S(a,b);null!==b&&(Hg(b,Eg,c),a.j.getState()===Fg.nf&&a.j.Y(c))}function Pg(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ga()||!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(Ig(b));c=c.Ka()+c.X();e=null!=e?e:Jg();(d=Qg(a,c,e,d))&&a.Ga()&&Pg(a,c,!0,d,!1);return e}
611
+ function Rg(a,b,c,d){const e=a.j.N(Ig(b));a=null!=d?d:Jg();const f=Qg(e,Dg,a,c);f&&e.Ga()&&e.forEach((g,h)=>{g=h[0];g!==xg&&g!==yg||Pg(e,h,!0,f,!0)})}function Sg(a,b,c){const d=S(a,b);if(null!==d){const e=Hg(d,Dg,c);void 0!==e&&(a.j.getState()!==Fg.nf||d.F()||a.j.Y(c),!d.Ga()&&!d.F()||d.forEach((f,g)=>{f=g[0];(f===xg||f===yg)&&e&&Pg(d,g,!1,e,!0)}))}}
612
+ function Tg(a,b,c){b=S(a,b,!1);if(!b||c===olympe.dc.Lb.NONE)return[];const d=c.charAt(0)===olympe.dc.de.dg,e=[];b.forEach((f,g)=>{const h=g.charAt(0);if(!d&&f instanceof olympe.dc.uc&&(h===zg||h===Ag))(f=a.j.get(f.X()))&&e.push([f,g.substring(1),null,!0]);else if(h===xg||h===yg){const k=g.substring(1),l=(h===xg?12:3)&Ug(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.La]:null;b=a.j.get(f);e.push([b,g,null,!0])}return e}
613
+ function Vg(a,b,c,d,e){const f=a.j.N(Ig(b));e=null!=e?e:Jg();const g=Qg(f,Cg+c,e,d);g&&f.Ga()&&Tg(a,b,c).forEach(([h,...k])=>{h.Ga()&&g(...k,!0,h.tag())})}function Wg(a,b,c,d){const e=S(a,b);if(null!==e){const f=Hg(e,Cg+c,d);void 0!==f&&(a.j.getState()!==Fg.nf||e.F()||a.j.Y(d),!e.Ga()&&!e.F()||Tg(a,b,c).forEach(([g,...h])=>{(g.Ga()||g.F())&&f(...h,!1,g.tag())}))}}function Xg(a,b){a=S(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===Ag&&b.set(c.substring(1),d);return b}
614
+ function Ug(a,b,c){if(c===olympe.dc.Lb.NONE)return 0;const d=c[0]===olympe.dc.de.dg;c=d?c.substring(1):c;a=a.Qa(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function Yg(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===xg||c===yg){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(S(a,b,!0))}
615
+ function Zg(a,b,c){if(!a.Ga(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.ab(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 $g(a,b,c,d){return(c=(a=S(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ga()).length:0}
616
+ 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.Ka()+b.X();const e=Hg(a,b,c);void 0!==e&&(this.j.getState()!==Fg.nf||a.F()&&!d||this.j.Y(c),d||!a.Ga()&&!a.F()||Pg(a,b,!1,e,!1))}}Ga(a){a=this.j.get(olympe.dc.fa(a));return!(null==a||!a.Ga())}name(a){let b,c;return null!=(c=null==(b=S(this,a))?void 0:b.Qa(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=S(this,a,!0))?a.model():null)?a.tag():null}bf(a){return(a=(a=S(this,
617
+ a,!0))&&a.bf())?a.tag():null}ji(a){a=S(this,a,!0);return!(!a||!a.bf())}Ob(a,b){a=(a=S(this,a,!0))&&a.model();return!(!a||!this.Qf(a.tag(),b))}source(a){return(a=S(this,a,!0))&&a.source()}Le(a){a=S(this,a,!1);return!a||a.N}Qa(a,b,c){a=S(this,a,!0);b=olympe.dc.fa(b);let d;return null!=(d=null==a?void 0:a.Qa(b,c))?d:null}Db(a,b=!1){var c=S(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===zg||!b&&c===Bg)&&a.set(d.substring(1),e);return a}Qk(a,b){return Tg(this,a,b).filter(([c])=>c.Ga()).map(([c,
618
+ ...d])=>[c.tag(),...d])}ab(a,b){a=S(this,a,!0);b=b.Ka()+b.X();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ga()&&a.push(c.tag());return a}As(a,b,c){let d,e;a=null==(d=S(this,a,!0))?void 0:null==(e=d.get(b.Ka()+b.X()))?void 0:e.get(olympe.dc.fa(c));return!(null==a||!a.Ga())}kn(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.Ka()+c.X()),void 0!==a)for(const e of a.values())e.Ga()&&b.push(e.tag());a=b}return a}Jb(a,b){var c=
619
+ S(this,a,!0);const d=b.Ka()+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.Ga())?a.tag():null}eh(a,b,c){a=olympe.dc.fa(a);const d=Zg(this,a,b);d.delete(a);return c?(c=olympe.dc.fa(c),d.has(c)?Array.from(Zg(this,c,b.$b()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}bs(a,b,c){if(!this.Ga(a))return null;b=Zg(this,
620
+ 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}bn(a,b,c){return this.kn(a,b).find(c)||null}sx(a,b,c){return this.kn(a,b).filter(c)}ks(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.bf();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ga())throw a=`Try to get all extensions of the model ${olympe.dc.fa(a)} but one of them does not exists (${c.tag()})`,
621
+ 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())}Qf(a,b){const c=olympe.dc.fa(b);return!!this.bs(a,olympe.dc.CloudObject.extendRel,d=>d===c)}Rc(a){return this.ab(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.kb.prototype.getInstances=olympe.dc.kb.prototype.Rc;olympe.dc.kb.prototype.isExtending=olympe.dc.kb.prototype.Qf;
622
+ olympe.dc.kb.prototype.getExtendedModels=olympe.dc.kb.prototype.ks;olympe.dc.kb.prototype.findAllRelated=olympe.dc.kb.prototype.sx;olympe.dc.kb.prototype.findRelated=olympe.dc.kb.prototype.bn;olympe.dc.kb.prototype.findRecursive=olympe.dc.kb.prototype.bs;olympe.dc.kb.prototype.getRecursiveRelated=olympe.dc.kb.prototype.eh;olympe.dc.kb.prototype.getUniqueRelated=olympe.dc.kb.prototype.Jb;olympe.dc.kb.prototype.getMultiRelated=olympe.dc.kb.prototype.kn;olympe.dc.kb.prototype.isRelated=olympe.dc.kb.prototype.As;
623
+ olympe.dc.kb.prototype.getRelated=olympe.dc.kb.prototype.ab;olympe.dc.kb.prototype.getProperties=olympe.dc.kb.prototype.Db;olympe.dc.kb.prototype.getProperty=olympe.dc.kb.prototype.Qa;olympe.dc.kb.prototype.isPersisted=olympe.dc.kb.prototype.Le;olympe.dc.kb.prototype.instanceOf=olympe.dc.kb.prototype.Ob;olympe.dc.kb.prototype.isModel=olympe.dc.kb.prototype.ji;olympe.dc.kb.prototype.extension=olympe.dc.kb.prototype.bf;olympe.dc.kb.prototype.model=olympe.dc.kb.prototype.model;
624
+ olympe.dc.kb.prototype.name=olympe.dc.kb.prototype.name;olympe.dc.kb.prototype.exist=olympe.dc.kb.prototype.Ga;const ah=olympe.dc.db.Database.D.ORIGIN,pg=olympe.dc.db.Database.D.DESTINATION,og=olympe.dc.db.Database.D.jl,bh=olympe.dc.db.Database.D.Ui,ch=olympe.dc.db.Database.D.zp,dh=olympe.dc.db.Database.D.wi,eh=ah+pg,fh=bh+bh,gh=Array.from(Object.values(olympe.dc.Lb)).filter(a=>null!==a);function mg(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)}
625
+ function qg(a){for(const [b,c]of a.H)a.D.vc(new Set,b).filter(d=>hg(d,c)).forEach(d=>{d=d.tag();c?ng(a,d).create():ng(a,d).delete()})}
626
+ function rg(a){const b=a.D;a.F.forEach((c,d)=>{var e=b.get(d);if(c.D()||c.td()){var f=e.get(dh);f&&hh(a,f,c.D(),d);c.td()&&a.R.add(d)}for(const [n,p]of c.Db()){var g=n[0]===og,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(dh+bh+h);q&&hh(f,q,l,g);(k=k.get(dh+fh))&&hh(f,k,h,l,g)}for(const n of c.ha())ih(a,e,...n);(e=c.$)&&jh(a,e,d,c.zc,!c.td())});a.H.clear();a.F.clear();a.N.clear();kh(a)}function ng(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.yh(b),a.F.set(b,c));return c}
627
+ function hh(a,b,...c){b.forEach((d,e)=>{mg(a,e,d.bind(null,...c))})}function ih(a,b,c,d,e,f){var g=b.get(dh+d+c);g&&hh(a,g,f,e);(g=b.get(dh+eh))&&hh(a,g,c,d,f,e);lh(a,c,d).forEach((h,k)=>{(k=b.get(dh+ch+k))&&hh(a,k,c,d,h,f,e)})}function jh(a,b,c,d,e){gh.forEach(f=>{const g=f[0]===olympe.dc.de.dg;(f=a.D.get(g?c:b).get(dh+ch+f))&&hh(a,f,d,null,!0,e,g?b:c)})}
628
+ function kh(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 lh(a,b,c){const d=b+c;let e=a.N.get(d);if(!e){const f=a.D.get(b);e=new Map;gh.forEach(g=>{const h=g[0]===olympe.dc.de.dg;var k=h?g.substring(1):g;let l;k=null!=(l=null==f?void 0:f.get(bh+k))?l:0;k=h?((k&3)<<2)+((k&12)>>2):k;(c===ah?12:3)&k&&e.set(g,!!((c===ah?8:2)&k))});a.N.set(d,e)}return e}
629
+ olympe.dc.db.Lt=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 sg(a){if(!a.F&&0<a.D.size)switch(a.mode){case olympe.dc.db.uf.j.Ln:a.F=!0;setTimeout(()=>{a.j.getState()===olympe.dc.db.Database.F.IDLE&&a.run()},a.delay);break;case olympe.dc.db.uf.j.Yv:a.F=!0,a.run()}}
630
+ olympe.dc.db.uf=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.uf.j.Hl&&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.Rd(c),b.push(c))}this.D.clear();this.j.cb(olympe.dc.db.Database.j.ep,b);this.F=!1}init(){const a=olympe.dc.db.Database.j.Ar,b=olympe.dc.db.Database.j.Dp,
631
+ c=olympe.dc.db.Database.j.Jq,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&sg(this)};this.j.j(olympe.dc.db.Database.j.Im,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.jw,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.uf.j={Hl:0,Yv:1,Ln:2};olympe.dc.db.uf.D=5E3;olympe.dc.db.ec=class{constructor(a){this.id=null!=a?a:olympe.V.Kf();this.Bb=new Map}T(){return this.id}qc(a){const b=olympe.dc.db.yh.j.em,c=olympe.dc.db.yh.j.Dc,d=olympe.dc.db.yh.j.Ek;this.Bb.forEach((e,f)=>{const g=e.Wb();switch(e.getState()){case b:const h=e.sb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.R()?e.Db():void 0;a.Oc(f,h,k,g);break;case d:e.R()&&a.Wc(f,e.Db(),g);break;case c:a.D(f,e.H(),g)}for(const [h,k,l]of e.Ed())e=this.Bb.get(k),
632
+ l?a.Oa(h,f,k,g,e.Wb()):a.hc(h,f,k,g,e.Wb())});return a}hf(){return 0===this.Bb.size}H(){let a=0;this.Bb.forEach(b=>{a+=b.Bd()});return a}Oc(a,b,c,d=null){b=this.F(a).create(b);'string'===typeof d&&this.Oa(olympe.dc.fc.Yc,a,d,d,null);c&&b.Qm(c)}Wc(a,b,c=null){b&&this.F(a,c).Qm(b)}D(a,b=olympe.dc.Lb.NONE,c=null){const d=this.Bb.get(a);if(d&&d.D())this.j(a,b);else{this.F(a,c).delete(b);for(const e of this.Qk(a,b,!1))this.Bb.get(e).Db().clear(),this.Y(e,!0)}}Oa(a,b,c,d=null,e=null){this.F(b,d).link(a,
633
+ c);this.F(c,e).Mb(a,b)}hc(a,b,c,d=null,e=null){this.F(b,d).unlink(a,c);this.F(c,e).vc(a,b)}$(a){var b=olympe.dc.ia();if(b.Ga(a)){const c=b.model(a),d=b.source(a),e=b.Db(a,!0);Xg(b,a).forEach((f,g)=>{e.set(`${olympe.dc.de.Se}${g}`,f)});this.Oc(a,d,e,c);(b=b.bf(a))&&this.Oa(olympe.dc.fc.Ai,a,b);e.forEach(f=>{f instanceof olympe.dc.uc&&this.$(f.X())})}}Rc(){return function*(a){for(const b of a.values())if(b.D()||b.td()||b.R())yield b}(this.Bb)}Qc(a){let b;return null!=(b=this.Bb.get(olympe.dc.fa(a)))?
634
+ b:null}j(a,b=olympe.dc.Lb.NONE){a=this.Qk(a,b);for(const c of a)this.Y(c,!1),this.Bb.delete(c)}Ed(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.Ed((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.Bb.values())}eh(a,b,c=(d,e)=>[d,e]){return this.ha(a,b,c)}*ha(a,b,c,d=[]){d.push(a);a=this.Qc(a);for(const [e,f]of a.ab(b))d.includes(e)||(yield*this.ha(e,b,c,d),yield c(e,f))}N(a,b,c){const d=this.Bb.get(b),e=this.Bb.get(c);d&&d.N(a,olympe.dc.ua.DESTINATION,c);e&&e.N(a,olympe.dc.ua.ORIGIN,
635
+ b)}Y(a,b){const c=olympe.dc.ua.ORIGIN,d=olympe.dc.ua.DESTINATION,e=this.Bb.get(a);for(const [g,h,k]of e.Ed())if(k||!b){e.N(g,d,h);var f=this.Bb.get(h);f&&f.N(g,c,a)}for(const [g,h,k]of e.jb())if(k||!b)e.N(g,c,h),(f=this.Bb.get(h))&&f.N(g,d,a)}*ps(a){let b;for(const [c,d]of(null==(b=this.Qc(a))?void 0:b.ab(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.Bb.get(c),a.td()||(yield a))}Qk(a,b,c=!0){const d=olympe.dm.Relation.j.Qq,e=olympe.dm.Relation.j.yr,f=olympe.dc.ua.ORIGIN,g=olympe.dc.ia();a=new Set([a]);
636
+ const h=new Set;for(const l of a){var k=this.Bb.get(l);if(void 0!==k){for(const [n,p,q]of k.Ed())q&&Ug(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.jb())q&&Ug(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of Yg(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&Ug(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.Bb.has(l))}F(a,b){let c=this.Bb.get(a);void 0===c&&(c=new olympe.dc.db.yh(a),this.Bb.set(a,c));return b?c.Ha(b):c}R(a){const b=
637
+ olympe.dc.ua.DESTINATION;for(const [c,d]of this.da(a))if(a=c.tag(),d.td())this.j(a,d.H());else if(c.td())d.D()&&this.j(a,c.H());else{c.Db().forEach((e,f)=>{void 0!==d.Qa(f)&&c.da(f)});for(const [e,f,g]of c.Ed()){const h=d.zb(e,b,f);void 0!==h&&g!==h&&this.N(e,a,f)}}return this}*da(a){var b=this.Bb;const c=a.Bb,d=(a=a.H()>this.H())?c:b;b=a?b:c;for(const [e,f]of b)b=d.get(e),void 0!==b&&(yield[a?f:b,a?b:f])}};olympe.dc.db.ec.xa=[olympe.dc.Writable,olympe.dc.Cq];const mh=olympe.dc.db.Database.j,nh=olympe.dc.db.Database.D.Ui,oh=olympe.dc.db.Database.D.du,ph=olympe.dc.db.Database.D.Se,qh=olympe.dc.db.Database.D.jl,rh=olympe.dc.db.Database.D.wi,U=olympe.dc.ua.ORIGIN,V=olympe.dc.ua.DESTINATION,sh=olympe.dc.fc.Yc,th=olympe.dc.fc.Ai;function Rf(a,b,c=!1){const d=a.get(ph+b);return c||void 0!==d?d:a.get(oh+b)}function hg(a,b){const c=a.e!==b;c&&(b?(a.e=b,uh(a)):(vh(a),a.e=b),a.db.D(b?mh.Kl:mh.Dc,a.j));return c}
638
+ function ig(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(sh,c)}a.link(sh,b);b.forEach((d,e)=>{if(e[0]===ph||e[0]===oh)e=e.substring(1),wh(a,e,d)});null===a.H||!b.e&&b!==a||a.db.da(a,!0)}function jg(a,b){const c=a.bf();if(null!==c){if(c===b)return;a.unlink(th,c)}a.link(th,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===ph||f[0]===oh)f=f.substring(1),a.has(ph+f)||(a.set(oh+f,e),d.set(f,e))});xh(a,d)}
639
+ function kg(a,b){a.unlink(sh,b);a.forEach((c,d)=>{c=d.substring(1);wh(a,c,null)});a.db.da(a,!1)}function lg(a,b){a.unlink(th,b);const c=new Map;a.forEach((d,e)=>{e[0]===oh&&(a.delete(e),d=e.substring(1),c.set(d,null))});xh(a,c)}
640
+ function tg(a,b,c){const d=ph+b;var e=a.get(d);e=void 0===e?null:e;if(!yh(e,c))if(zh(a,b,e,c,!0),e=oh+b,null===c){a.delete(d);let f;c=null==(f=a.bf())?void 0:Rf(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);xh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),xh(a,(new Map).set(b,c))}function Kg(a,b,c,d){const e=Ah(a,rh+b);return e.has(c)?!1:(e.set(c,d),a.je(olympe.dc.db.Instance.j.wi+b),a.db.D(mh.jo,a.j,b,c),!0)}
641
+ function Hg(a,b,c){const d=Bh(a,rh+b,c);void 0!==d&&(a.detach(olympe.dc.db.Instance.j.wi+b),a.db.D(mh.ko,a.j,b,c));return d}function Qg(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.Gv+b;h?g.je(k):g.detach(k)}d(...f)};return Kg(a,b,c,e)?e:null}function yh(a,b){return a instanceof Date?b instanceof Date&&a.getTime()===b.getTime():null!==a&&'function'===typeof a.Ea?a.Ea(b):a===b}
642
+ function zh(a,b,c,d,e){c instanceof olympe.dc.uc&&(Ch(a.db.get(c.X())),a.db.Ha(c.X()));d instanceof olympe.dc.uc&&(c=a.db.N(d.X(),!0),c.D&&c.D.tag!==a.j&&a.db.$a().fatal('Instance',d.X(),'referenced multiple times!\nThis instance is currently property of',c.D.tag,'(for the property '+c.D.La+')','and is assigned as a property of',a.j,'(for the property '+b+')'),d=c,a=a.j,void 0===d.D&&(d.je(olympe.dc.db.Instance.j.Vi+a+':'+b),d.db.jb(d.j,a,b)),d.D={tag:a,La:b,Ky:e})}
643
+ function Dh(a,b,c,d){a.e&&a.db.af(a.j,b,c,d)}function xh(a,b,c=[]){const d=a.get(U+sh);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>wh(e,g,f))});a=a.get(U+th);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(ph+k)||(g.set(k,h),null!==h?e.set(oh+k,h):e.delete(oh+k))});xh(e,g,[...c,f])}})}function Ah(a,b){let c;return null!=(c=a.get(b))?c:a.create(b)}function Eh(a,b,c,d,e){a.db.$h(a.j,b,c,d.j,e)}
644
+ function Bh(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 wh(a,b,c){if(!a.has(nh+b)){const d=qh+b,e=a.get(d);yh(c,void 0!==e?e:null)||(null===c?a.delete(d):a.set(d,c),Dh(a,b,c,null!==c))}}function uh(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&&(Eh(a,e,d,g,!0),Eh(g,e,f,a,!0))})}else if(d===nh||d===qh)c=c.substring(1),Dh(a,c,b,d===qh)})}
645
+ function vh(a){a.forEach((b,c)=>{const d=c[0];if(d!==rh){var e=c.substring(1);d===U?b.forEach(f=>{f.unlink(e,a)}):d===V?b.forEach(f=>{a.unlink(e,f)}):d===nh?a.update(e,null):d===ph&&tg(a,e,null);a.delete(c)}});if(void 0!==a.D){const b=a.db.get(a.D.tag),c=a.D.Ky;let d,e;(null==(d=b.get(`${c?ph:nh}${a.D.La}`))?void 0:null==(e=d.X)?void 0:e.call(d))===a.j&&(c?tg(b,a.D.La,null):b.update(a.D.La,null))}}
646
+ function Ch(a){void 0!==a.D&&(a.detach(olympe.dc.db.Instance.j.Vi+a.D.tag+':'+a.D.La),a.db.jb(a.j,a.D.tag,a.D.La),a.D=void 0)}
647
+ 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}Ga(){return this.e}F(){return this.db.F(this.j)}source(){return this.H}model(){const a=this.get(V+sh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}bf(){const a=this.get(V+th);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Qa(olympe.dc.CloudObject.nameProp.X());a=`Instance: ${this.j}, Exist: ${this.e}, Name: ${a}`;
648
+ var b=this.model();if(b){var c=b.Qa(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.bf())?(c=b.Qa(olympe.dc.CloudObject.nameProp.X())||'No extension name',a+=`\nExtension: ${b.j}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Qa(a,b=!1){const c=this.get(nh+a);return b||void 0!==c?c:this.get(qh+a)}update(a,b){const c=nh+a;var d=this.get(c);d=void 0===d?null:d;if(!yh(d,b))if(zh(this,
649
+ a,d,b,!1),d=qh+a,null===b){this.delete(c);let e;b=null==(e=this.model())?void 0:Rf(e,a);void 0!==b?(this.set(d,b),Dh(this,a,b,!0)):Dh(this,a,null,!1)}else this.set(c,b),this.delete(d),Dh(this,a,b,!1)}link(a,b){var c=U+a;const d=Ah(this,V+a);c=Ah(b,c);d.has(b.j)||(d.set(b.j,b),c.set(this.j,this),this.db.D(mh.rk,this.j,a,V,b.j),this.db.D(mh.rk,b.j,a,U,this.j),this.e&&b.e&&(Eh(this,a,V,b,!0),Eh(b,a,U,this,!0)))}unlink(a,b){const c=U+a;void 0!==Bh(this,V+a,b.j)&&(Bh(b,c,this.j),this.db.D(mh.wm,this.j,
650
+ a,V,b.j),this.db.D(mh.wm,b.j,a,U,this.j),this.e&&b.e&&(Eh(this,a,V,b,!1),Eh(b,a,U,this,!1)))}persist(){this.N=!0;return this}je(){this.c++;1===this.c&&this.db.D(mh.Ar,this.j)}detach(){0<this.c?--this.c:this.db.D(mh.Jq,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(mh.Im,
651
+ 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===nh&&a instanceof olympe.dc.uc&&Ch(this.db.get(a.X()))});void 0!==this.D&&this.db.get(this.D.tag).delete(nh+this.D.La)}create(a){const b=new Map;this.set(a,b);return b}};olympe.dc.db.Instance.j={Bp:'instance',Gv:'rel',wi:'cb',Vi:'ref',TRANSACTION:'tx'};olympe.dc.db.yh=class a{constructor(b){this.$c=b;this.Y=this.cb=null;this.Pb=olympe.dc.Lb.NONE;this.F=a.j.Ek;this.j=this.ob=this.zc=this.$=this.properties=null}tag(){return this.$c}Wb(){return this.Y}sb(){return this.cb}getState(){return this.F}Ha(b){if(null===this.Y)this.Y=b;else if(this.Y!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.Y}`);return this}H(){return this.F===a.j.Dc?this.Pb:olympe.dc.Lb.NONE}create(b){this.F=a.j.em;this.cb=null!=
652
+ b?b:null;return this}delete(b=olympe.dc.Lb.NONE){this.F=a.j.Dc;this.Pb=b;this.properties=null;return this}ka(b,c){if(this.F===a.j.Dc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}Qm(b){this.F!==a.j.Dc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}Rd(b,c){if(null!==this.$&&this.$!==b)throw Error('An instance should never be set as complex property of multiple instances');this.$=b;this.zc=c}da(b){let c;null==
653
+ (c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.fc.Yc&&this.Ha(c);this.sa(this.ob,b,c,!0);return this}unlink(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.fc.Yc&&this.Ha(c);this.sa(this.ob,b,c,!1);return this}Mb(b,c){null===this.j&&(this.j=new Map);this.sa(this.j,b,c,!0)}vc(b,c){null===this.j&&(this.j=new Map);this.sa(this.j,b,c,!1)}zb(b,c,d){if(c=c===olympe.dc.ua.ORIGIN?this.j:this.ob)return(b=c.get(b))&&
654
+ b.get(d)}N(b,c,d){const e=(c=c===olympe.dc.ua.ORIGIN?this.j:this.ob)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}D(){return this.F===a.j.em}td(){return this.F===a.j.Dc}Bd(){let b=this.properties?this.properties.size:0,c;null==(c=this.ob)||c.forEach(d=>{b+=d.size});return b}R(){return null!==this.properties}Id(){return null!==this.ob||null!==this.j}Db(){let b;return null!=(b=this.properties)?b:new Map}Qa(b){if(this.properties)return this.properties.get(b)}ab(b,c=(d,e)=>[d,e]){return function*(d){if(d=
655
+ d&&d.get(b.X()))for(const [e,f]of d)yield c(e,f)}(b.Ka()===olympe.dc.ua.ORIGIN?this.j:this.ob)}Jb(b){const c=b.Ka()===olympe.dc.ua.ORIGIN?this.j:this.ob;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}Ed(b=(c,d,e)=>[c,d,e]){return this.wa(this.ob,b)}jb(b=(c,d,e)=>[c,d,e]){return this.wa(this.j,b)}ha(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.ua.ORIGIN,d=olympe.dc.ua.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>b(h,c,k,l))}(this.wa.bind(this),
656
+ this.ob,this.j)}sa(b,c,d,e){if(this.F!==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)}}*wa(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.yh.j={em:0,Ek:1,Dc:2};olympe.dc.db.bv=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.Ga()){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.Ui+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
657
+ ' (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.Oo,b=olympe.dc.db.Database.j.Kl,c=olympe.dc.db.Database.j.Dc,d=olympe.dc.db.Database.j.rk,e=olympe.dc.db.Database.j.wm,f=olympe.dc.db.Database.j.jo,g=olympe.dc.db.Database.j.ko,h=()=>{};this.j.j(olympe.dc.db.Database.j.No,()=>{});this.j.j(a,()=>{});this.j.j(b,k=>{this.j.Mb(()=>{Rg(this.view,
658
+ k,h,`monitorRelations${k}`)})});this.j.j(c,k=>{this.j.Mb(()=>{Sg(this.view,k,`monitorRelations${k}`)})});this.j.j(d,()=>{});this.j.j(e,()=>{});this.j.j(f,()=>{});this.j.j(g,()=>{})}};olympe.dc.db.Jm=class{constructor(a,b,c,d){this.G=a;this.j=b;this.ia=c;this.F=d;this.transactionId=null}open(a){if(null!==this.transactionId)throw Error('A transaction is already open');this.transactionId=this.j.ci(a);this.G.debug(`DB Writer: transaction ${this.transactionId} opened`)}write(a,b){b&&(b=new Fh(this.ia),a.qc(b),this.G.info(b.flush()));if(null===this.transactionId)throw Error('You must first open a transaction before to write');this.G.debug('DB Writer: writing patch',a.T(),'for transaction',
659
+ this.transactionId);this.j.Oy(this.transactionId,()=>a.qc(this))}close(){if(null===this.transactionId)throw Error('No transaction is open');this.j.$e(this.transactionId);this.G.debug(`DB Writer: transaction ${this.transactionId} committed`);this.transactionId=null}Oc(a,b,c,d){this.j.create(a,b,c,this.F);d&&this.j.link(olympe.dc.fc.Yc,a,d)}Wc(a,b){this.j.update(a,b)}D(a,b=olympe.dc.Lb.NONE){for(const c of Qf(this.ia,a,b))this.j.Ha(c)}Oa(a,b,c){this.j.link(a,b,c)}hc(a,b,c){this.j.unlink(a,b,c)}};
660
+ function Gh(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.uc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.X()+'")';else if(f instanceof olympe.C.Color)d+='Color("'+f.fh()+','+f.bh()+','+f.Zg()+','+f.Yg()+'")';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+=Gh(a,f,
661
+ (null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function Hh(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function Ih(a,b){let c;return b===olympe.dc.fc.Yc?'Model':null!=(c=a.db.name(b))?c:b}
662
+ class Fh{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}`:''}`}Oc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${Gh(this,c)})`,Hh(this,d))}Wc(a,b,c){this.log(`updateInstance(tag: ${a}, ${Gh(this,b)})`,Hh(this,c))}D(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,Hh(this,c))}Oa(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,Ih(this,a))}hc(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
663
+ Ih(this,a))}}olympe.dc.db.Jm.xa=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.P={Ca:'dc.db.Logger',Ol:'dc.db.gc.Logger',Da:'dc.db.DatabaseManager',Qj:'dc.db.Database',Dl:'dc.db.DBView',iB:'dc.db.Graph',kA:'dc.db.DatabaseWriter',XB:'dc.db.PermissionProcessor',Mi:'dc.db.GraphMonitor'};olympe.dc.db.U={fp:'db.garbageCollector',gp:'db.garbageCollectorDelay',xl:'db.commitBufferTimeout',Mi:'db.monitor',av:'db.monitorCounters',$u:'db.monitorCallbacks',Fo:'db.debug'};
664
+ olympe.W.config(function(a){F(a,olympe.dc.db.U.fp,olympe.dc.db.uf.j.Ln);F(a,olympe.dc.db.U.gp,5E3);F(a,olympe.dc.db.U.xl,3E4);F(a,olympe.dc.db.U.Mi,!1);F(a,olympe.dc.db.U.Fo,!1);E(a,olympe.dc.db.P.Ca,[olympe.ja.P.Da],b=>b.cd('db'));E(a,olympe.dc.db.P.Ol,[olympe.ja.P.Da],b=>b.cd('gc'));E(a,olympe.dc.db.P.Qj,[olympe.dc.db.P.Ca,olympe.dc.db.P.Ol,new olympe.W.pa(olympe.dc.U.Qg),new olympe.W.pa(olympe.dc.db.U.fp),new olympe.W.pa(olympe.dc.db.U.gp),new olympe.W.pa(olympe.dc.U.Mh),new olympe.W.pa(olympe.dc.db.U.Fo)],
665
+ (b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.uf.j.Hl: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)});D(a,olympe.dc.db.P.Dl,olympe.dc.kb,olympe.dc.db.P.Ca,olympe.dc.db.P.Qj);E(a,olympe.dc.db.P.Mi,[olympe.dc.db.P.Da],b=>b.Xy);E(a,olympe.dc.db.P.Da,[olympe.dc.db.P.Ca,olympe.dc.db.P.Qj,olympe.dc.db.P.Dl,new olympe.W.pa(olympe.dc.U.Xf),new olympe.W.pa(olympe.dc.db.U.xl),new olympe.W.pa(olympe.dc.db.U.Mi),new olympe.W.pa(olympe.dc.db.U.av),
666
+ new olympe.W.pa(olympe.dc.db.U.$u)],(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.Ht(b,c,d,e,g)})},'olympe.dc.db');olympe.W.run([olympe.dc.db.P.Qj,olympe.dc.db.P.Mi],(a,b)=>{olympe.$d().db=a;olympe.$d().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function Jh(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
667
+ olympe.dc.query.rf=class{constructor(a,b,c){this.db=olympe.dc.ia();this.j=a;this.La=b;this.Ki=c}ga(){return{p:this.La.X(),o:this.Ki}}toString(){return'sortByQueryPart-'+this.Ki+this.La.X()}$g(){const a=this.db.Jb(this.La,olympe.dm.Property.typeRel),b=olympe.dc.fa;if(this.db.Qf(a,olympe.dm.String))return Jh((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return Jh((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return Jh((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return Jh((c,
668
+ d)=>c.compare(d));olympe.ja.$a('dc.query').warn(`No comparator found for type with tag ${a}`);return Jh(()=>-1)}Qa(){return this.La}};olympe.dc.Te=class{X(){}};olympe.dc.Te.prototype.getTag=olympe.dc.Te.prototype.X;olympe.dc.lB=olympe.dc.Te;function Kh(a){let b;if(null==(b=a.j)?0:b.hf())if(a=a.H,!a.N){let c;null==(c=a.R)||c.call(a)}}function Lh(a,b,c,d,e){Kh(a);let f,g;b?null==(f=a.j)||f.Oa(c,d,e):null==(g=a.j)||g.hc(c,d,e)}
669
+ olympe.dc.query.gv=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.ia()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.D}:${a}:notif`;sf(this.db,a,(d,e)=>{if(d){Kh(this);let f;null==(f=this.j)||f.$(e)}else if(b&&Og(this.db,e,c),!this.db.Ga(e)){Kh(this);let f;null==(f=this.j)||f.D(e,olympe.dc.Lb.NONE)}},c);b&&Ng(this.db,a,(d,e,f)=>{Kh(this);let g;f||null!=(g=this.j)&&g.Wc(a,new Map([[d,e]]))},c)}}stop(a){qf(this.db,a,`${this.D}:${a}:notif`)}};olympe.dc.query.kk={ASC:'ASC',DESC:'DESC'};function Mh(a){const b=Nh(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.Rc()),n=new Map,p=a.H.has(f);let q=p?';':'';if(c.has(f)){const [r,t,u]=c.get(f);c.delete(f);q+=u;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,X)=>K.add(X),null!=(A=n.get(z))?A:new Set))}l.delete(y)});t&&l.forEach(x=>{const y=p?`${x};${u}`:u;for(const z of k.j(x)){let A;n.set(z,
670
670
  (null!=(A=n.get(z))?A:new Set).add(y))}})}else l.forEach(r=>{const t=p?`${r};`:'';for(const u of k.j(r))n.has(u)?n.get(u).add(t):n.set(u,(new Set).add(t))});if(0<e&&c.has(g)){const [r,t,u]=c.get(g),x=new Map;n.forEach((y,z)=>{let A;null==(A=r.get(z))||A.forEach(K=>{let X;const xa=null!=(X=x.get(z))?X:new Set;y.forEach(ab=>xa.add(ab+K));x.set(z,xa)});n.delete(z);r.delete(z)});t&&n.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>A+u)))});b[e-1].R()&&r.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>
671
- q+A)))});c.set(g,[x,t&&h,q+u])}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 Qh(a){if(null===a.D){const b={Hb:a.query.Wg(),Hd:a.Hd,max:a.query.j.max,offset:a.query.j.offset};a.D=olympe.dc.Ia.from(a.Y,Oh(a),b)}return a.D}function Rh(a,b){a.R=b}function Sh(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)}}
672
- function Th(a,b){let c;return null!=(c=a.j.get(b).dd())?c:[]}function Uh(a,b,c){let d,e;return null!=(e=null==(d=a.j.get(c))?void 0:d.has(b))?e:!1}function Vh(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)&&Sh(a);let g;f&&(null==(g=a.Je)||g.watch(b,a.J.has(c)));return f}function Wh(a,b,c,d,e,f){null!==a.Je&&(d===olympe.dc.va.ORIGIN?Nh(a.Je,b,c,f,e):Nh(a.Je,b,c,e,f))}
673
- function Xh(a){a.G.j()&&a.G.debug(`Start sending notifications for query ${a.query.T()}`);const b=new olympe.dc.query.Xu(a.G,a.query.sb(),a.query.T(),a);a.j.forEach((c,d)=>{for(const e of c.dd())b.watch(e,a.J.has(d))});null!=b.j||(b.j=new olympe.dc.db.fc);a.Je=b}function Yh(a){null!==a.Je&&(a.G.j()&&a.G.debug(`Stop sending notifications for query ${a.query.T()}`),a.j.forEach(b=>{for(const c of b.dd())a.Je.stop(c)}),a.Je=null)}
674
- function Zh(a){a.N=!1;if(null!=(a=a.Je)){let b;const c=!(null==(b=a.j)?0:b.cf());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.J()} operations for query ${a.D}`))}}
675
- olympe.dc.query.tq=class{constructor(a,b){this.G=a;this.query=b;this.F=olympe.V.tb(b.D);this.oa=new Map;this.j=(new Map).set(this.F,new olympe.dc.query.oa.vm);this.J=new Set(b.F);this.Hd=-1;this.N=!1;this.R=null;this.Y=olympe.dc.Ia.empty();this.Je=this.D=null;a=Ph(b);a.forEach(c=>{const d=c.T();this.oa.set(d,c.N());this.j.set(d,c.fa())});b=b.Wg();if(null!==b){b=b.j;let c=-1;for(const d of[this.F].concat(a.map(e=>e.T())))if(c+=this.J.has(d)?1:0,b===d){this.Hd=c;break}}}remove(a,b=this.F,c='root'){b=
676
- this.j.get(b);if(null==b?0:b.remove(a,c))if(Sh(this),!b.has(a)){let d;null==(d=this.Je)||d.stop(a);return!0}return!1}Oc(a){const b=a.D,c=olympe.V.tb(b);a=Ph(a);const d=[];for(const [f,g]of this.j){if(g.F(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.Oc(f))?n:!1});e.set(f.T(),h);return 0<h.length})}};function $h(a){if(!olympe.dc.ia().Qb(a,olympe.dm.Property))throw new olympe.dc.query.yd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
677
- function ai(a){var b=olympe.dc.query.Aa.j.kr;const c=olympe.dc.query.Aa.j.Jo,d=olympe.dc.query.Aa.j.Gj,e=olympe.dc.query.Aa.j.up,f=olympe.dc.query.Aa.j.Up,g=olympe.dc.query.Aa.j.Dq,h=olympe.dc.query.Aa.j.Dn,k=olympe.dc.query.Aa.j.iq;switch(a.pr){case b:return new olympe.dc.query.Z.Am(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.te(a.p,b,olympe.dc.ia());case d:return new olympe.dc.query.Z.nf(a.p,
678
- a.s,olympe.dc.ia(),a.c);case e:return new olympe.dc.query.Z.Bi(olympe.dc.ia(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Z.ee(ai(a.v));case g:return new olympe.dc.query.Z.zf(a.p,new RegExp(a.r),olympe.dc.ia(),a.c);case k:return new olympe.dc.query.Z.ze(...a.p.map(l=>ai(l)));case h:return new olympe.dc.query.Z.Id(...a.p.map(l=>ai(l)));default:return null}}
679
- olympe.dc.query.Aa=class{observe(){}nb(){}compile(){return[[this]]}ud(){return new olympe.dc.query.Z.ee(this)}Cb(){}Oc(){}clear(){}ga(){}Vc(){}toString(){}Ea(a){return this===a}static uy(...a){return new olympe.dc.query.Z.Am(a)}static Ea(a,b){$h(a);return new olympe.dc.query.Z.te(a,b,olympe.dc.ia())}static contains(a,b,c=!0){$h(a);return new olympe.dc.query.Z.nf(a,b,olympe.dc.ia(),c)}static kz(a,b,c=!0){$h(a);return new olympe.dc.query.Z.zf(a,b,olympe.dc.ia(),c)}static Ok(a,b,c=!0){$h(a);return new olympe.dc.query.Z.Bi(olympe.dc.ia(),
680
- a,b,!1,c)}static vj(a,b,c=!0){$h(a);return new olympe.dc.query.Z.Bi(olympe.dc.ia(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Z.Id(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
681
- return new olympe.dc.query.Z.ze(...a)}static ud(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.Z.ee(a)}};olympe.dc.query.Aa.not=olympe.dc.query.Aa.ud;olympe.dc.query.Aa.or=olympe.dc.query.Aa.or;olympe.dc.query.Aa.and=olympe.dc.query.Aa.and;olympe.dc.query.Aa.smallerThan=olympe.dc.query.Aa.vj;olympe.dc.query.Aa.greaterThan=olympe.dc.query.Aa.Ok;
682
- olympe.dc.query.Aa.regex=olympe.dc.query.Aa.kz;olympe.dc.query.Aa.contains=olympe.dc.query.Aa.contains;olympe.dc.query.Aa.equals=olympe.dc.query.Aa.Ea;olympe.dc.query.Aa['in']=olympe.dc.query.Aa.uy;olympe.dc.query.Aa.j={kr:0,Jo:1,Gj:2,up:3,Up:4,Dq:5,iq:6,Dn:7};function Ph(a){return Array.from(a.oa)}
683
- function bi(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Jb(c,c.Ja()===olympe.dc.va.ORIGIN?e:d);if(0>a.cursor)e=a.j.Ke;else if(e=a.oa[a.cursor],null!==e.ua)e=e.ua;else{var f=olympe.dc.va.ORIGIN;e=olympe.dc.ia().Jb(e.relation,e.relation.Ja()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(a.db.Ha(olympe.dc.CloudObject)&&(null===d||!a.db.Nf(d,e)&&!a.db.Nf(e,d)))throw new olympe.dc.query.yd(`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=
684
- 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 ci(a,b=a.cursor){return 0<=b?a.oa[b].T():olympe.V.tb(a.D)}
685
- function di(a,b,c,d={}){var e=olympe.dc.Lb.bg;const f=(null==d?0:d.jd)?d.jd:olympe.dc.ma.oc.lf,g=(null==d?0:d.xn)?'__code-as-data__':void 0;b=olympe.dc.ha(b);const h=olympe.dc.$d().Ie(b);b=(new olympe.dc.ma(b,h)).he();b.oa=[f===olympe.dc.ma.oc.Fg?new olympe.dc.query.oa.Uo(ci(b),e,c):new olympe.dc.query.oa.Jd(ci(b),e,c)];let k;b.J=null!=(k=null==d?void 0:d.rs)?k:!1;return b.observe(a,{jd:f,Dk:g})}
686
- function ei(a){const b=0===a.F.size?a.he():a;if(null!==b.j.Hd&&!b.F.has(ci(a,b.j.Hd)))throw new olympe.dc.query.yd('AndReturn was not called for the current level before sortBy operator');return b}function fi(a,b){let c,d;return b.J||(null!=(d=null==(c=a.N)?void 0:c.has(b.T()))?d:!1)}
687
- olympe.dc.ma=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Hd:null,Ke:null}){this.db=olympe.dc.ia();if('string'!==typeof a||''===a)throw new olympe.dc.query.yd('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.J=!1}static from(a,b){a=olympe.dc.ha(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.yd(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);
688
- b=null!=b?b:olympe.dc.$d().Ie(a);b=new olympe.dc.ma(a,b);b.j.Ke=olympe.dc.ia().model(a);return b}static Ie(a,b,c){if(!olympe.dc.CloudObject.exists(b)&&!c)throw new olympe.dc.query.yd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ha(a);c=null!=c?c:olympe.dc.$d().fromModel(b);c=new olympe.dc.ma(a,c);c.j.Ke=olympe.dc.ha(b);return c}static Rk(a,b=!0,c){const d=olympe.dc.ha(a);var e=olympe.dc.ia();if(!e.ei(d))throw new olympe.dc.query.yd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);
689
- a=null!=c?c:olympe.dc.$d().fromModel(d);a=new olympe.dc.ma(d,a);a.j.Ke=e.model(d);b&&(a=bi(a,new olympe.dc.query.oa.ue(ci(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.oa.sh(ci(a),olympe.dc.CloudObject.instancesRel,!1);e.ua=d;return bi(b,e)}static Nb(a,b,c,d,e){var f;const g=null!=(f=null==e?void 0:e.jd)?f:olympe.dc.ma.oc.lf;f=(null==e?0:e.xn)?'__code-as-data__':void 0;b=olympe.dc.ha(b);d=null!=d?d:olympe.dc.$d().Ie(b);d=(new olympe.dc.ma(b,d)).he();b=g===olympe.dc.ma.oc.Fg;
690
- d.oa=[b?new olympe.dc.query.oa.Uo(ci(d),c):new olympe.dc.query.oa.Jd(ci(d),c)];let h;d.J=null!=(h=null==e?void 0:e.rs)?h:!1;let k;return d.observe(a,{jd:g,Dk:f,aj:null!=(k=null==e?void 0:e.aj)?k:b})}gb(a,b=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.yd(`The relation given to follow() is invalid: ${a}`);return bi(this,new olympe.dc.query.oa.sh(ci(this),a,b))}hg(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.yd(`The relation given to followRecursively() is invalid: ${a}`);
691
- return bi(this,new olympe.dc.query.oa.ue(ci(this),a,b,c))}he(){const a=(new Set(this.F)).add(ci(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.Aa))throw new olympe.dc.query.yd(`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)}bj(){return this}pj(a,b=0){return new olympe.dc.ma(this.D,
692
- this.source,this.oa,this.cursor,this.F,{Hd:this.j.Hd,max:a,offset:b,Ke:this.j.Ke})}Zk(a,b=olympe.dc.query.dk.ASC){if(0>this.cursor)throw new olympe.dc.query.yd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');if(!olympe.dc.ia().Qb(a,olympe.dm.Property))throw new olympe.dc.query.yd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.oa[this.cursor],d={Hd:this.cursor,max:this.j.max,offset:this.j.offset,Ke:this.j.Ke},
693
- 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)}Wg(){const a=this.j.Hd;let b;return null!==a?null==(b=this.oa[a])?void 0:b.Wg():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&&ci(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=ci(this,-1),c={limit:this.j.max,offset:this.j.offset,returned:this.F.has(b),
694
- filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.ei(this.D)?c.dataType=olympe.dc.ha(this.D):(c.root=olympe.dc.ha(this.D),c.dataType=this.j.Ke);this.oa.forEach((d,e)=>{const f=d.T(),g=d.Vc();Object.assign(g,{returned:this.F.has(f),next:[]});a.set(f,g);g.sort&&this.j.Hd!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.oa.sh&&d.relation.Ea(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.oa.ue&&d.relation.Ea(olympe.dc.CloudObject.extendedByRel))Object.assign(c,
695
- g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}nb(a){const b=(null==a?0:a.jd)?a.jd:olympe.dc.ma.oc.ek;let c;return olympe.dc.query.Nk().executeQuery(ei(this),b,{Th:null!=(c=null==a?void 0:a.Dk)?c:null==a?void 0:a.cacheId,zc:null==a?void 0:a.zc}).then(d=>{let e;return null!=(e=null==d?void 0:Qh(d))?e:olympe.dc.Ia.empty()})}Fc(){return Qh(gi(olympe.dc.query.Nk(),ei(this)))}observe(a,b){const c=(null==b?0:b.jd)?b.jd:olympe.dc.ma.oc.lf;a='function'===typeof a.D?a.D():
696
- a;let d;return hi(olympe.dc.query.Nk(),ei(this),a,olympe.dc.Ka.SELF,c,{Th:null!=(d=null==b?void 0:b.Dk)?d:null==b?void 0:b.cacheId,zc:null==b?void 0:b.zc,aj:null==b?void 0:b.aj}).pipe(rxjs.operators.map(e=>Qh(e)),rxjs.operators.distinctUntilChanged())}T(){null===this.id&&(this.id=olympe.V.tb(this.D+Ph(this).map(a=>a.J()).join()+Array.from(new Set(this.F)).sort().toString()+this.j.Hd+this.j.max+this.j.offset));return this.id}sb(){return this.source}ga(){let a;return{b:this.D,p:this.oa.map(b=>b.ga()),
697
- r:Array.from(this.F),s:this.source,e:{m:this.j.max,o:this.j.offset,s:this.j.Hd,rm:null!=(a=this.j.Ke)?a:this.db.model(this.D)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ha(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.Fc;olympe.dc.ma.prototype.execute=olympe.dc.ma.prototype.nb;
698
- 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.Zk;olympe.dc.ma.prototype.limit=olympe.dc.ma.prototype.pj;olympe.dc.ma.prototype.cast=olympe.dc.ma.prototype.bj;olympe.dc.ma.prototype.filter=olympe.dc.ma.prototype.filter;olympe.dc.ma.prototype.andReturn=olympe.dc.ma.prototype.he;olympe.dc.ma.prototype.followRecursively=olympe.dc.ma.prototype.hg;olympe.dc.ma.prototype.follow=olympe.dc.ma.prototype.gb;
699
- olympe.dc.ma.followRule=olympe.dc.ma.Nb;olympe.dc.ma.instancesOf=olympe.dc.ma.Rk;olympe.dc.ma.fromTag=olympe.dc.ma.Ie;olympe.dc.ma.from=olympe.dc.ma.from;olympe.dc.ma.oc={lf:1,ek:2,Fg:3};olympe.dc.ma.j={nl:'cacheBucketName',zp:'isCacheable'};function ii(a){null===a.Fa&&null===a.j&&(a.Fa=Bf(a.F))}
700
- olympe.dc.query.zd=class extends olympe.dc.wg{constructor(a){super(a,null);this.F=new olympe.dc.transaction.Ae}static gj(a){const b=new olympe.dc.query.zd(`DataResult_${a.T()}`);b.D=a.sb();return b}static j(a){const b=new olympe.dc.query.zd(a.i);let c;b.D=null!=(c=a.s)?c:null;let d;b.Ek=null!=(d=a.t)?d:null;let e;b.Fa=null!=(e=a.p)?e:[];return b}tc(a){ii(this);return super.tc(a)}kc(){ii(this);return super.kc()}Kk(){ii(this);return super.Kk()}create(a,b,c){this.F.Pc(a,this.D,c,b);return this}Oa(a,
701
- b,c){this.F.Oa(a,b,c,null,null);return this}ga(){return super.ga()}};olympe.dc.query.zd.prototype.createRelation=olympe.dc.query.zd.prototype.Oa;olympe.dc.query.zd.prototype.create=olympe.dc.query.zd.prototype.create;olympe.dc.query.zd.fromQuery=olympe.dc.query.zd.gj;function gi(a,b){const c=new olympe.dc.query.tq(a.G,b);if(a.D.view.Ha(b.D)){Vh(c,b.D);for(const d of Ph(b))d.nb(c)}return c}
702
- function hi(a,b,c,d,e,f){const g=b.T();let h=a.j.get(g);if(!h){var k=b.sb();a.G.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.zc||a.J&&k===olympe.dc.Ka.SERVER?[]:Array.from(a.j.values());h=new olympe.dc.query.Bq(a.G,a.D,b,e,a.R.bind(a,e,f));a.j.set(g,h);ji(h,l=>a.F.add(l));h.start(k)&&(null==f?0:f.Th)&&ki(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=>
703
- {const n=()=>{p&&c.Wd(p);l.complete();if(q){var r=q;const u=a.j.get(g);a.G.debug(`${d} unsubscribed from ${g}`);if(null==u)r=0;else{var t=u;t.J.delete(r)&&t.G.debug(`Remove subscriber ${d} for query ${t.query.T()}, now have ${t.J.size} subscribers`);d!==olympe.dc.Ka.SELF&&(t.$--,0===t.$&&Yh(t.j));r=0===t.J.size}r&&(a.G.debug(`No more subscriber to ${g}, remove the subscription`),a.F.delete(g),a.j.delete(g),u.destroy())}},p=c.Y(n),q=li(h,d,l);return n})}
704
- function mi(a){a.F.forEach(b=>{let c;null==(c=a.j.get(b))||ni(c)});a.F.clear()}function oi(a,b,c,d){return w(function*(){const e=null!=d?d:c===olympe.dc.ma.oc.Fg;if(b instanceof ReadableStream)yield xg(a.D,b,{Nm:e});else{var f;if(f=b instanceof olympe.dc.wg)f=b.T(),f=!a.N.J.has(f);f&&a.D.Tc(b,{Nm:e})}})}function pi(a){a.G.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.j.yg,olympe.dc.Ka.SERVER);return a.Wb.request(b).then(c=>{a.D.Tc(c)})}
705
- function qi(a,b){const c=b.sb();if(c===olympe.dc.Ka.SELF||a.J&&c===olympe.dc.Ka.SERVER)return Promise.resolve(!0);a=Array.from(a.j.values()).filter(d=>d.Oc(b)).map(d=>new Promise(e=>d.hd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function ki(a,b,c,d){return w(function*(){var e=b.sb();e=wf(wf(new olympe.dc.Request(olympe.dc.Request.j.Hg,e,b),olympe.dc.ma.j.zp,c===olympe.dc.ma.oc.Fg),olympe.dc.ma.j.nl,null==d?void 0:d.Th);return a.Wb.request(e)})}
706
- function ri(a,b,c){const d=[];for(const e of a.j.values())si(e,b,c)&&d.push(ki(a,e.query,olympe.dc.ma.oc.ek,{}).then(f=>oi(a,f,olympe.dc.ma.oc.ek)));return Promise.all(d).then(()=>{})}
707
- olympe.dc.query.rv=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Wb=d;this.J=e;this.j=new Map;this.F=new Set;yg(b,()=>mi(this));zf(d,olympe.dc.Request.j.so,f=>{oi(this,f.content,olympe.dc.ma.oc.lf).catch(g=>this.G.error(`Error while applying data notification on DB: ${g}`))})}executeQuery(a,b,c){const d=this;return w(function*(){const e='boolean'===typeof c.zc?c.zc:yield qi(d,a);if(!e||(null==c?0:c.Th))try{const f=yield ki(d,a,b,c);e||(yield oi(d,f,b))}catch(f){return d.G.error(`Error while sending a query to data source ${a.sb()}: ${f}`),
708
- null}return gi(d,a)})}R(a,b,c,d,e,f){const g=c.sb();if(g===olympe.dc.Ka.SELF||b.zc||this.J&&g===olympe.dc.Ka.SERVER)return e(),null;if(a!==olympe.dc.ma.oc.lf)return ki(this,c,a,b).then(r=>{var t=r;r instanceof ReadableStream&&(t=(t=d())?r.pipeThrough(t):r);return oi(this,t,a,b.aj)}).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`);ki(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.`),
709
- Promise.resolve();var u=t;t instanceof ReadableStream&&(u=(u=d())?t.pipeThrough(u):t);return oi(this,u,a,b.aj).then(()=>{h.forEach(x=>oi(this,x,a))}).finally(()=>{h=null})}).then(e).catch(f)},n=c.T();l(!1);const p=wf(new olympe.dc.Request(olympe.dc.Request.j.hk,g,c),olympe.dc.ma.j.nl,null==b?void 0:b.Th),q=this.Wb.subscribe(p,l.bind(this,!0)).pipe(nb(olympe.L.errors.jp,()=>{},0)).pipe(nb(olympe.L.errors.Yn,(r,t)=>{this.G.debug(`Data Provider: Subscribe to topic ${r.T()} now that we are back online, after waiting for ${t}ms`);
710
- l(!0)},0)).subscribe(rxjs.Subscriber.create(r=>{Array.isArray(h)?h.push(r):oi(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 ti(a){const b=olympe.dc.ia();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ha(g)?olympe.dc.CloudObject.get(g):(olympe.ja.ab('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.Ia.create(d,a.a,a.r)}
711
- olympe.dc.Ia=class{constructor(){this.j=[];this.D=new Map;this.F=[];this.J=[];this.hash=''}static empty(){return new olympe.dc.Ia}[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()}Le(){return this.j.map(a=>this.D.get(a))}size(){return this.j.length}has(a){return this.D.has(a)||this.Le().includes(a)}indexOf(a){return null===
712
- a||void 0===a?-1:'string'===typeof a?this.j.indexOf(a):this.Le().indexOf(a)}get(a){return(a=this.D.get(a))?a:null}Gc(){return this.je(0)}je(a){return a<this.j.length?this.D.get(this.j[a]):null}push(...a){const b=this.Le();b.push(...a);return b}pop(){if(0===this.j.length)return[];const a=this.Le();a.pop();return a}shift(){if(0<this.j.length){const a=this.Le();a.shift();return a}return[]}filter(a){return this.Le().filter(a)}find(a){return(a=this.Le().find(a))?a:null}forEach(a){this.j.forEach((b,c)=>
713
- a(this.D.get(b),c))}map(a){return this.Le().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Ia.create(b,Array.from(this.F),Array.from(this.J))}reduce(a,b){return this.Le().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.J.concat(...a.map(d=>d.J));return olympe.dc.Ia.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Le()}hj(){return this.F.map(a=>
714
- this.D.get(this.j[a]))}mj(){return this.J.map(a=>{a=a.split('.');return 1===a.length?a[0]:a})}static from(a,b,{Hb:c,Hd:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ia(),q=c.Ei===olympe.dc.query.dk.ASC?1:-1,r=c.Wg(),t=c.Qa();b.sort((u,x)=>{x=x[d];u=p.Qa(u[d],t);x=p.Qa(x,t);return null===u?-q:null===x?q:q*r(olympe.dc.mb.Ac(u),olympe.dc.mb.Ac(x))})}else b.sort((p,q)=>p.reduce((r,t,u)=>r||t.localeCompare(q[u]),0));if(0<e||-1<f)b=b.slice(e,-1<f?e+f:void 0);c=olympe.V.tb(b.flat().join(''));
715
- 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.Ia.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Ia;e.j=a.map(f=>f[0]);e.D=new Map(a);e.hash=d||olympe.V.tb(e.j.join(''));e.F=b||e.j.map((f,g)=>g);e.J=c||[];return e}ga(a){a&&this.j.flatMap(b=>b.split('.')).forEach(a);
716
- return{k:this.j,a:this.F,r:this.J}}};olympe.dc.Ia.prototype.getRemoved=olympe.dc.Ia.prototype.mj;olympe.dc.Ia.prototype.getAdded=olympe.dc.Ia.prototype.hj;olympe.dc.Ia.prototype.concat=olympe.dc.Ia.prototype.concat;olympe.dc.Ia.prototype.reduce=olympe.dc.Ia.prototype.reduce;olympe.dc.Ia.prototype.sort=olympe.dc.Ia.prototype.sort;olympe.dc.Ia.prototype.map=olympe.dc.Ia.prototype.map;olympe.dc.Ia.prototype.forEach=olympe.dc.Ia.prototype.forEach;olympe.dc.Ia.prototype.find=olympe.dc.Ia.prototype.find;
717
- olympe.dc.Ia.prototype.filter=olympe.dc.Ia.prototype.filter;olympe.dc.Ia.prototype.shift=olympe.dc.Ia.prototype.shift;olympe.dc.Ia.prototype.pop=olympe.dc.Ia.prototype.pop;olympe.dc.Ia.prototype.push=olympe.dc.Ia.prototype.push;olympe.dc.Ia.prototype.getAt=olympe.dc.Ia.prototype.je;olympe.dc.Ia.prototype.getFirst=olympe.dc.Ia.prototype.Gc;olympe.dc.Ia.prototype.get=olympe.dc.Ia.prototype.get;olympe.dc.Ia.prototype.indexOf=olympe.dc.Ia.prototype.indexOf;olympe.dc.Ia.prototype.has=olympe.dc.Ia.prototype.has;
718
- olympe.dc.Ia.prototype.size=olympe.dc.Ia.prototype.size;olympe.dc.Ia.prototype.toArray=olympe.dc.Ia.prototype.Le;olympe.dc.Ia.prototype.keys=olympe.dc.Ia.prototype.keys;olympe.dc.Ia.prototype.values=olympe.dc.Ia.prototype.values;olympe.dc.Ia.prototype.entries=olympe.dc.Ia.prototype.entries;olympe.dc.Ia.empty=olympe.dc.Ia.empty;function ui(a){return 1<a.size()?(olympe.ja.ab('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Gc()||null}olympe.dc.nd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.nd(olympe.dc.ma.from(a))}gb(a){return new olympe.dc.nd(this.query.gb(a))}bj(){return this}nb(a){return this.query.nb(a).then(b=>ui(b))}Fc(){return ui(this.query.Fc())}};olympe.dc.nd.prototype.executeFromCache=olympe.dc.nd.prototype.Fc;
719
- olympe.dc.nd.prototype.execute=olympe.dc.nd.prototype.nb;olympe.dc.nd.prototype.cast=olympe.dc.nd.prototype.bj;olympe.dc.nd.prototype.follow=olympe.dc.nd.prototype.gb;const vi=olympe.dc.va.ORIGIN,wi=olympe.dc.va.DESTINATION;function ji(a,b){Rh(a.j,()=>{a.hb()||null!==a.D||b(a.query.T())})}function li(a,b,c){const d=a.ba;a.ba++;a.J.set(d,c);b===olympe.dc.Ka.SELF?a.hd(e=>e?c.error(e):c.next(a.j)):(a.$++,1===a.$&&a.hd(()=>Xh(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.J.size} subscribers`);return d}
720
- function si(a,b,c){if(a.query.sb()!==b)return!1;c.tc(a.fa);(b=a.fa.flush())&&a.G.debug(`Subscription ${a.query.T()} is considered as obsolete after the transaction ${c.T()} applied on DB`);return b}function ni(a){Zh(a.j);a.J.forEach(b=>{b.next(a.j)})}
721
- function xi(a,b,c){const d=[];let e=!1;const f=new olympe.async.fk(olympe.C.Xg());for(const g of b)if(g.Oc(a.query)&&(e||(e=!0),f.add(h=>g.hd(k=>{!k&&d.push(g);h()}))),null!==g.D&&fi(a.query,g.query)){let h;null==(h=a.R)||h.push(g)}bd(f,g=>c(g?d:[]));f.start();return e}
722
- function yi(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,u,x,y)=>r.forEach(z=>z(t,u,x,y)):()=>{}},e=Ph(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 u;c.set(t,(null!=(u=c.get(t))?u:new Set).add(g))}const h=a.db,k=a.query.D,l=olympe.V.tb(k),n=sf(h,k,(q,r)=>{q?Vh(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.Y)||p.push(()=>{qf(h,k,n)});zi(a)}
723
- function Ai(a){const b=a.Ga(a.query,a.$a.bind(a),()=>{null===a.D||a.hb()||yi(a)},d=>{a.hb()||(a.G.error(`Error while getting data from data source (${a.query.sb()}) to ensure coverage of the query ${a.query.T()}: ${d}`),zi(a))});let c;b&&(null==(c=a.Y)||c.push(b))}function Bi(a,b){a.N.delete(b);0===a.N.size&&(a.N=null,Promise.resolve().then(()=>{!a.hb()&&Ai(a)}))}function zi(a){const b=a.D;a.D=null;null==b||b.forEach(c=>c())}
724
- olympe.dc.query.Bq=class{constructor(a,b,c,d,e){this.G=a;this.ua=b;this.db=b.view;this.query=c;this.jd=d;this.j=new olympe.dc.query.tq(this.G,c);this.$=0;this.ba=1;this.Y=[];this.J=new Map;this.D=[()=>Zh(this.j)];this.Ga=e;this.fa=new Ci(a,this.db,c,this.j);this.F=this.N=null;this.R=[]}start(a){return xi(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)}),yi(this)):Ai(this)})}Oc(a){return!this.hb()&&this.query.sb()===a.sb()&&(this.query.T()===a.T()||
725
- (null===this.D||this.query.D===a.D)&&this.j.Oc(a))}hd(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.J.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>Bi(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())}hb(){return null===this.Y}$a(){const a=
726
- olympe.dc.ma.oc.Fg;if(this.jd===a)return olympe.V.stream.tap(c=>{c=c.Kk().filter(d=>d.o===olympe.dc.Mc.j).map(d=>d.t);this.ua.j.Ga(c)});let b;if(0<(null==(b=this.R)?void 0:b.length)){const c=this.R.filter(e=>e.jd===a).map(e=>new Promise(f=>e.hd(f))),d=this.R.filter(e=>e.jd!==a).map(e=>new Promise(f=>e.hd(f)));this.R=void 0;return new TransformStream({start:()=>Promise.all(c),flush:()=>Promise.all(d)})}return null}};function Di(a,b){return a.F.has(wi+b)||a.F.has(vi+b)}
727
- class Ci{constructor(a,b,c,d){this.G=a;this.db=b;this.J=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 Ph(c)){a=f.T();this.R.push(a);if(f instanceof olympe.dc.query.oa.Gh){a=f.relation;a=`${a.Ja()}${a.X()}`;let g;b=null!=(g=this.F.get(a))?g:[];b.push(f);this.F.set(a,b)}Ei(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}Pc(){}Wc(a,b){if(!(this.j||
728
- !this.N&&this.db.Ha(a))){var c;this.j||(this.j=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&Uh(this.J,a,e)))}}D(a){this.j||this.db.Ha(a)&&!this.N||this.j||(this.j=this.R.some(b=>Uh(this.J,a,b)))}Oa(a,b,c){if(!this.j&&Di(this,a)){var d=this.db.Ha(b),e=this.db.Ha(c);if(d&&!e||!d&&e){const f=this.F.get(wi+a);a=this.F.get(vi+a);this.j||(this.j=d&&(null==f?void 0:f.some(g=>Uh(this.J,b,g.j)))||e&&(null==a?void 0:a.some(g=>Uh(this.J,c,g.j))))}}}ic(a,b,c){if(!this.j&&this.N&&Di(this,a)&&this.db.ss(b,
729
- new olympe.dc.Ra.Relation(a),c)){const d=this.F.get(wi+a);a=this.F.get(vi+a);const e=this.J;this.j||(this.j=(null==d?void 0:d.some(f=>Uh(e,b,f.j)&&Uh(e,c,f.T())))||(null==a?void 0:a.some(f=>Uh(e,c,f.j)&&Uh(e,b,f.T()))))}}}olympe.dc.query.Bq.xa=[olympe.dc.Writable];function Fi(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
730
- olympe.dc.query.Relation=class extends olympe.dc.Ra.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.Ja())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Ob(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.Ja(),null!=b?b:a instanceof olympe.dc.da.De)}ac(){const a=
731
- 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={Ca:'dc.query.Logger',gk:'dc.query.QueryProcessor'};olympe.W.config(function(a){E(a,olympe.dc.query.P.Ca,[olympe.ja.P.Da],b=>b.cd('query'));D(a,olympe.dc.query.P.gk,olympe.dc.query.rv,olympe.dc.query.P.Ca,olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.Jg,new olympe.W.pa(olympe.dc.U.Ih))});olympe.W.run([olympe.dc.query.P.gk],a=>{olympe.dc.query.Nk=()=>a});olympe.dc.query.yd=class extends Error{};olympe.dc.query.Z={};olympe.dc.query.Z.Id=class extends olympe.dc.query.Aa{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},[])}ud(){return new olympe.dc.query.Z.ze(...this.Z.map(a=>a.ud()))}Cb(){return this.Z.flatMap(a=>a.Cb())}Oc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b&&c.nb(a),!0)}observe(a,b,c){const d=
732
- 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.tb('AND-'+b+a+h),f.bind(null,h))})}ga(){return{pr:olympe.dc.query.Aa.j.Dn,p:this.Z.map(a=>a.ga())}}Vc(){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.tb('AND-'+b+a+d))})}};olympe.dc.query.Z.nf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!1){super();this.La=olympe.dc.ha(a);this.substring=b;this.db=c;this.j=d}Cb(){return[this.La]}Oc(a,b){return a instanceof olympe.dc.query.Z.nf&&a.La===this.La?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}Qa(){return this.La}nb(a){return this.apply(this.db.Qa(a,
733
- this.La))}observe(a,b,c){Ng(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Ac(a);return'string'===typeof a?this.j?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.La+'-'+this.substring+'-'+this.j}clear(a,b){Og(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}Vc(){return{name:'CONTAINS',property:this.Qa(),value:this.substring,caseSensitive:this.j}}ga(){return{pr:olympe.dc.query.Aa.j.Gj,
734
- p:this.La,s:this.substring,c:this.j}}};olympe.dc.query.Z.te=class extends olympe.dc.query.Aa{constructor(a,b,c){super();this.La=olympe.dc.ha(a);this.j=olympe.dc.mb.Ac(null!=b?b:null);this.db=c}Cb(){return[this.La]}Oc(a){if(a instanceof olympe.dc.query.Z.te&&this.La===a.La)if('object'===typeof this.j&&null!==this.j){if(this.j instanceof olympe.dc.CloudObject)return this.j.Ea(a.j);if(this.j instanceof Date)return a.j instanceof Date&&this.j.getTime()===a.j.getTime();if(this.j instanceof olympe.C.Color)return this.j.Ea(a.j)}else return this.j===
735
- a.j;return!1}nb(a){return this.apply(this.db.Qa(a,this.La))}observe(a,b,c){Ng(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()));null===this.j&&null===this.db.Qa(a,this.La)&&c(!0)}clear(a,b){Og(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Ac(a);return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Ea(this.j):a instanceof Date?this.j instanceof Date&&this.j.getTime()===a.getTime():a instanceof olympe.C.Color?a.Ea(this.j):!1:a===
736
- this.j}toString(){let a,b;const c=null!=(b=null==(a=this.j)?void 0:a.toString())?b:'null';return'Equals-'+this.La+'-'+c}Vc(){return{name:'EQUALS',property:this.La,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.Aa.j.Jo,p:this.La,t:a,v:b}}};function Gi(a,b,c){return olympe.V.tb(c+b+a.j+a.La)}
737
- olympe.dc.query.Z.Bi=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.La=olympe.dc.ha(b);this.j=(this.F=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.ha(c):c;this.D=d;this.J=e}ud(){return new olympe.dc.query.Z.Bi(this.db,this.La,this.j,!this.D,!this.J)}Cb(){return[this.La]}Oc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Z.Bi&&this.La===a.La?
738
- 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}Qa(){return this.La}nb(a){return this.compare(this.db.Qa(a,this.La),this.F?this.db.Qa(a,this.j):this.j)}observe(a,b,c){this.F&&Ng(this.db,a,this.j,d=>{const e=this.db.Qa(a,this.La);null!==e&&c(this.compare(e,d))},Gi(this,a,b));Ng(this.db,a,this.La,d=>{const e=this.F?this.db.Qa(a,this.j):this.j;c(null!==e?this.compare(d,e):!0)},Gi(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.J?
739
- this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){Og(this.db,a,this.La,Gi(this,a,b));this.F&&Og(this.db,a,this.j,Gi(this,a,b))}Vc(){return{name:'INEQUALITY_OPERATOR',property:this.Qa(),operator:this.D?'<':'>',strict:this.J,value:this.j}}ga(){return{pr:olympe.dc.query.Aa.j.up,p:this.La,b:this.j,l:this.D,s:this.J}}toString(){return(this.D?'LowerThan-':'GreaterThan-')+this.La+'-'+this.J+'-'+this.j}};olympe.dc.query.Z.ee=class extends olympe.dc.query.Aa{constructor(a){super();this.j=a}compile(){const a=this.j.ud();return this.Ea(a)?super.compile():a.compile()}ud(){return this.j}Cb(){return this.j.Cb()}Oc(a,b){return a instanceof olympe.dc.query.Z.ee?this.j.Oc(a.j,b):this.j.Oc(a,!b)}nb(a){return!this.j.nb(a)}observe(a,b,c){let d=null;this.j.observe(a,olympe.V.tb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Vc(){return{name:'NOT',predicate:this.j.Vc()}}ga(){return{pr:olympe.dc.query.Aa.j.Up,v:this.j.ga()}}toString(){return`NOT-${this.j.toString()}`}clear(a,
740
- b){this.j.clear(a,olympe.V.tb('NOT'+b+a))}Ea(a){return a instanceof olympe.dc.query.Z.ee?this.j.Ea(a.j):!1}};olympe.dc.query.Z.ze=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){return this.Z.map(a=>a.compile()).flat()}ud(){return new olympe.dc.query.Z.Id(...this.Z.map(a=>a.ud()))}Cb(){return this.Z.flatMap(a=>a.Cb())}Oc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b||c.nb(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=>
741
- k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('OR-'+b+a+h),f.bind(null,h))})}Vc(){throw Error('toObject for OR predicate should not be called');}ga(){return{pr:olympe.dc.query.Aa.j.iq,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.tb('OR-'+b+a+d))})}};olympe.dc.query.Z.zf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0){super();this.La=olympe.dc.ha(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.La]}Oc(a){return a instanceof olympe.dc.query.Z.zf&&this.La===a.La&&this.j.toString()===a.j.toString()}nb(a){return this.apply(this.db.Qa(a,this.La))}observe(a,b,c){Ng(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Ac(a);
742
- return'string'===typeof a?(a=this.j.test(this.D?a:a.toLowerCase()),this.j.lastIndex=0,a):!1}toString(){return'Regex'+this.La+'-'+this.j.toString()+'-'+this.D}Vc(){return{name:'REGEX',property:this.La,pattern:this.j,caseSensitive:this.D}}ga(){return{pr:olympe.dc.query.Aa.j.Dq,p:this.La,r:this.j.source,c:this.D}}clear(a,b){Og(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}};olympe.dc.query.Z.Am=class extends olympe.dc.query.Aa{constructor(a){super();this.j=new Set(a.map(olympe.dc.ha))}Cb(){return[]}Oc(a){return a instanceof olympe.dc.query.Z.Am&&Array.from(a.j).every(b=>this.j.has(b))}nb(a){return this.j.has(a)}observe(a,b,c){c(this.j.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.j)}Vc(){return{name:'IS',tags:Array.from(this.j)}}ga(){return{pr:olympe.dc.query.Aa.j.kr,t:Array.from(this.j)}}};olympe.dc.query.oa={};function Ei(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.Qa().X());return d}function Hi(a){if(!a.ba){let b,c;a.ba=null!=(c=null==(b=a.D)?void 0:b.compile())?c:[]}return a.ba}function Ii(a,b){for(const c of b)if(a.some(d=>d.Oc(c,!1)))return!0;return!1}
743
- function Ji(a,b){if(null===a.D)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.V.tb(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 Ki(a,b,c){if(null===a.Hb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Hb.Qa();h=olympe.V.tb(h+d);e?Ng(a.db,f,k,()=>{Sh(b)},h):Og(a.db,f,k,h);c(e,f,g,h)}}
744
- olympe.dc.query.oa.mm=class{constructor(a,b){this.db=olympe.dc.ia();this.j=a;this.optional=b;this.ba=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.Jd(b,a.f);var c=a.o;const d=new olympe.dc.Ra.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.oa.ue(b,d,a.s,c):new olympe.dc.query.oa.sh(b,d,c);void 0!==a.p&&(b.D=ai(a.p));void 0!==a.c&&(c=b.T(),a=a.c,a=new olympe.dc.query.mf(c,new olympe.dc.Ra.Property(a.p),a.o),b.Hb=a);return b}N(){}J(){let a,
745
- 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:''}`}Vc(){}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(){}fa(){return new olympe.dc.query.oa.vm}$(){}T(){this.id||(this.id=this.Y());return this.id}R(){return this.optional}Oc(a){const b=Hi(this);if(0===b.length)return!0;a=Hi(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
746
- Ii(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.Id?new olympe.dc.query.Z.Id(...Array.from(c.Z),a):new olympe.dc.query.Z.Id(b.D,a);return b}sort(a,b){const c=this.N();c.Hb=new olympe.dc.query.mf(this.T(),a,b);return c}Wg(){return this.Hb}nb(a){if(null!==this.D){var b=this.T();for(const c of Th(a,b))this.D.nb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.T();return Ji(this,Ki(this,a,(d,e,f,g)=>{(d?Vh(a,e,c,f):a.remove(e,c,f))&&b(d,e,
747
- f,g)}))}Ea(){}};olympe.dc.query.oa.Gh=class extends olympe.dc.query.oa.mm{constructor(a,b,c){super(a,c);this.relation=b;this.ua=null}};olympe.dc.query.oa.nm=class{has(){}F(){}j(){}dd(){}D(){}remove(){}};olympe.dc.query.oa.Jd=class extends olympe.dc.query.oa.mm{constructor(a,b,c){super(a,!1);this.Nb=b;this.F=null!=c?c:null}N(){return new olympe.dc.query.oa.Jd(this.j,this.Nb,this.F)}Y(){return olympe.V.tb(this.j+'followRules')}fa(){return new olympe.dc.query.oa.Ap(this.db,this.F)}$(a,b){return b instanceof olympe.dc.query.oa.Jd?[a]:[olympe.V.tb(a+'followRules')]}Oc(a){if(a instanceof olympe.dc.query.oa.Gh){const b=olympe.dc.va.ORIGIN,c=olympe.dc.va.DESTINATION,d=olympe.dc.hc.Yc,e=olympe.dc.hc.ti,f=
748
- olympe.dm.Relation.j.Jq,g=olympe.dm.Relation.j.rr;a=a.relation;const h=a.Ja(),k=a.X();return h!==c||k!==d&&k!==e?!!(Wg(this.db,a,this.Nb)&(a.Ja()===b?f:g)):!0}return a instanceof olympe.dc.query.oa.Jd?this.Nb===a.Nb:!1}nb(a){const b=this.T();for(const c of Th(a,this.j))for(const d of Qf(this.db,c,this.Nb))Vh(a,d,b,c)}observe(a,b){const c=this.T(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?Xg(this.db,g,this.Nb,(l,n,p,q,r)=>{p&&(p=q?Vh(a,r,c,g):a.remove(r,c,g),null!==n&&Wh(a,q,l,n,g,r),p&&d(e,q,r,h))},k):
749
- Yg(this.db,g,this.Nb,k);b(f,g,e,k)};return(e,f,g,h)=>{(e?Vh(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,olympe.V.tb(h+f+this.toString()))}}ga(){return Object.assign(super.ga(),{f:this.Nb})}J(){return`followRulePart-${this.Nb}-${super.J()}`}Vc(){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.Nb)} (${this.Nb})`}Ea(a){return a instanceof olympe.dc.query.oa.Jd&&this.Nb===a.Nb}toJSON(){return{type:'follow rule',
750
- rule:`${this.db.name(this.Nb)} (${this.Nb})`}}R(){return!1}filter(){olympe.ja.ab('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ja.ab('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.oa.Jd.D='followRules';olympe.dc.query.oa.sh=class extends olympe.dc.query.oa.Gh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.oa.sh(this.j,this.relation,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.tb(this.j+this.relation.T())}$(a,b){if(b instanceof olympe.dc.query.oa.Jd)return[a];const c=[a+this.relation.T(),a+Fi(this.relation).T()+!1,a+Fi(this.relation).T()+!0,a+'followRules'].map(d=>olympe.V.tb(d));b instanceof olympe.dc.query.oa.ue&&b.relation.Ea(this.relation)&&
751
- c.push(a);return c}nb(a){const b=this.T();for(const c of Th(a,this.j))this.db.bb(c,this.relation).forEach(d=>{Vh(a,d,b,c)});super.nb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ja(),f=this.toString();return(g,h,k,l)=>{const n=olympe.V.tb(l+h+f);g?T(this.db,h,this.relation,(p,q)=>{Wh(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.Ja()})}J(){return`followPart-${this.relation.T()}-${super.J()}`}Vc(){const a=
752
- {recursive:!1,relation:this.relation,filter:Hi(this).map(b=>b.map(c=>c.Vc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Qa(),order:this.Hb.Ei});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ja()}}Ea(a){return a instanceof olympe.dc.query.oa.sh&&this.relation.Ea(a.relation)}};olympe.dc.query.oa.ue=class extends olympe.dc.query.oa.Gh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.F=c}fa(){return new olympe.dc.query.oa.Nq}N(){const a=new olympe.dc.query.oa.ue(this.j,this.relation,this.F,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.tb(this.j+this.relation.T()+this.F)}$(a,b){if(b instanceof olympe.dc.query.oa.Jd)return[a];const c=[a+this.relation.T()+this.F,a+'followRules'].map(d=>olympe.V.tb(d));b instanceof olympe.dc.query.oa.ue&&
753
- b.relation.Ea(this.relation)&&c.push(a);return c}nb(a){const b=this.T();for(const c of Th(a,this.j))this.F&&Vh(a,c,b,c),this.db.$g(c,this.relation).forEach(d=>{Vh(a,d,b,c)});super.nb(a)}observe(a,b){const c=this.relation.X(),d=this.relation.Ja(),e=(f,g,h,k)=>{const l=olympe.V.tb(k+g);f?T(this.db,g,this.relation,(n,p)=>{Wh(a,n,c,d,g,p);super.observe(a,(q,r,t,u)=>{b(q,r,t,u);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,
754
- g,olympe.V.tb(h+g));e(f,g,g,h)}}ga(){return Object.assign(super.ga(),{s:this.F,t:this.relation.X(),d:this.relation.Ja()})}J(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.J()}`}Vc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:Hi(this).map(b=>b.map(c=>c.Vc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Qa(),order:this.Hb.Ei});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',
755
- relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ja()}}Ea(a){return a instanceof olympe.dc.query.oa.ue&&this.relation.Ea(a.relation)&&this.F===a.F}};olympe.dc.query.oa.Uo=class extends olympe.dc.query.oa.Jd{observe(a,b){const c=this.T();return(d,e,f,g)=>{d?Vh(a,e,c,e):a.remove(e,c,e);b(d,e,e,g)}}};olympe.dc.query.oa.Ap=class{constructor(a,b){this.db=a;this.origin=null;this.content=new Map;this.J=null!=b?b:null}dd(){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)}F(a){let b;return(null==(b=this.J)?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,
756
- b){a===this.origin&&(this.origin=null);if(null===this.origin||!this.db.Ha(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.Ap.xa=[olympe.dc.query.oa.nm];olympe.dc.query.oa.Nq=class{constructor(){this.content=new Map}dd(){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)}F(){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!=
757
- (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.Nq.xa=[olympe.dc.query.oa.nm];olympe.dc.query.oa.vm=class{constructor(){this.content=new Map}dd(){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)}F(){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);
758
- return b}};olympe.dc.query.oa.vm.xa=[olympe.dc.query.oa.nm];olympe.dc.sources={};olympe.dc.sources.Rq=class extends Error{};olympe.dc.sources.Mj=class{T(){}init(){}destroy(){}request(){return w(function*(){})}subscribe(){}};const Li=olympe.net.wa.Md.GET,Mi=olympe.net.wa.Md.Ch,Ni=olympe.net.wa.Md.Cc,Oi=olympe.net.wa.Md.sq,Pi=olympe.net.wa.Headers.oi,Qi=olympe.net.wa.Headers.Pn,Ri=olympe.net.wa.Tb.Ah,Si=olympe.net.wa.Tb.ho,Ti=olympe.net.wa.Tb.So,Ui=olympe.net.wa.Tb.Pi,Vi=olympe.net.wa.Tb.$l;
759
- function Wi(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.U.Jl)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.R.F('_DataSourcesHTTPService',b,[Li,Mi,Ni,Oi],(c,d,e)=>w(function*(){const f=d.get('sourceId');var g=a.F.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ia().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.ld(`No handler found for datasource ${f} called '${g}'`,Vi,'Invalid source id'))}h=c.method;const k=c.kj();try{var l=yield Xi(a,
760
- k[Qi])}catch(r){return new olympe.net.ld(`Invalid token ${r}`,Ti,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.j.pc,t=olympe.dc.Request.j.Hg,u=olympe.dc.Request.j.We,x=olympe.dc.Request.j.Rg,y=olympe.dc.Request.j.kh,z=olympe.dc.Request.j.vg,A=olympe.dc.Request.j.Wf,K=olympe.dc.Request.j.dg;let X;switch(n){case r:break;case t:case u:case y:case x:X=a.D.N(p);break;case K:case z:case A:X={tag:e.get('tag'),model:e.get('model'),mimeType:k[Pi]};p instanceof Uint8Array&&
761
- (X.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let xa;const ab=null!=(xa=k['X-Source-Origin'])?xa:olympe.dc.Ka.wf;var q=vf(new olympe.dc.Request(n,f,X,l),ab);const Pa=yield g(q);let ad;void 0===Pa?ad='':Pa instanceof Blob||Pa instanceof Uint8Array||Pa instanceof ArrayBuffer||'function'===typeof(null==Pa?void 0:Pa.pipe)?ad=Pa:ad=JSON.stringify(a.D.ga(Pa));return new olympe.net.ld(ad,h===Oi?Si:Ri)}catch(r){return r instanceof olympe.dc.sources.Rq?new olympe.net.ld(`Authorization error: ${r}`,
762
- Ti,'Forbidden'):new olympe.net.ld(`Internal server error: ${r}`,Ui,'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 Yi(a){a.R.Y('_DataSourcesHTTPService').catch(b=>{a.G.error(`An error occurred while stopping the data sources http service: ${b}`)})}function Zi(a,b,c){0===a.F.size&&Wi(a);a.F.set(b,c);return()=>{a.F.delete(b);0===a.F.size&&Yi(a)}}
763
- function $i(a,b,c){c=b instanceof olympe.dm.DataSource?b.If(c):aj(b,c);null===c&&a.G.error(`Impossible to build URL for data source ${b}`);return c}
764
- function bj(a,b,c){if(b===olympe.dc.Ka.SERVER){var d;return null!=(d=Ld(a.J,a.ba.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.$.sb(b);e=olympe.dc.sources.U.th;const f=olympe.dc.sources.U.rf,g=olympe.dc.sources.U.yi,h=olympe.dc.sources.U.Jl;let k;e=`${$i(a,null!=d?d:b,g)?'https':'http'}://${$i(a,null!=d?d:b,e)}:${null!=(k=$i(a,null!=d?d:b,f))?k:$i(a,null!=d?d:b,g)?443:80}`+`/${$i(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.N.set(b,e)}return`${e}/${c}`}
765
- function cj(a,b){return b instanceof olympe.net.Ai?Nd(a.J,b,rd(a.Y).Bd()):Promise.reject('No http request to send')}function dj(a,b){var c=bj(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,Mi,e,olympe.net.wa.ResponseType.JSON);Ac(c,{['X-Source-Origin']:b.origin,[Pi]:'application/json'});return cj(a,c).then(f=>(f=f.getData())?a.D.N(f):olympe.dc.query.zd.gj(d))}
766
- function ej(a,b){var c=bj(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,Mi,d);Ac(c,{['X-Source-Origin']:b.origin,[Pi]:'application/json'});return cj(a,c).then(e=>Number.parseInt(e.getData(),10))}function Xi(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.Y.dh(b,(e,f)=>{e?d(e):c(f)})})}
767
- olympe.dc.sources.Nt=class{constructor(a,b,c,d,e,f){this.G=a;this.R=b;this.J=c;this.Y=d;this.$=e;this.D=f;this.F=new Map;new olympe.C.Xb('Http service of remote data provider');this.N=new Map;this.j=new Map;this.ba=new Map([[olympe.dc.Request.j.yg,olympe.L.Yb.yg],[olympe.dc.Request.j.Wf,olympe.L.Yb.Pj],[olympe.dc.Request.j.dg,olympe.L.Yb.Pj],[olympe.dc.Request.j.vg,olympe.L.Yb.Pj],[olympe.dc.Request.j.Rn,olympe.L.Yb.Qn],[olympe.dc.Request.j.Hq,olympe.L.Yb.Gq],[olympe.dc.Request.j.gp,olympe.L.Yb.fp],
768
- [olympe.dc.Request.j.Hg,olympe.L.Yb.$n],[olympe.dc.Request.j.Rg,olympe.L.Yb.TRANSACTION]])}Hc(a){var b=bj(this,a.jc(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.jc()}`);b=Cc(N(b,Li),olympe.net.wa.ResponseType.JSON);Ac(b,{['X-Source-Origin']:a.origin});return cj(this,b).then(c=>c.getData())}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.jc(),f=bj(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);
769
- const g=N(e===olympe.dc.Ka.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,Oi,d);Ac(g,{[Pi]:'application/octet-stream'});e!==olympe.dc.Ka.SERVER&&Ac(g,{['X-Source-Origin']:a.origin});return cj(this,g).then(()=>(new URL(g.j())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.jc();var e=bj(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Ka.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,Ni,b);d!==olympe.dc.Ka.SERVER&&Ac(e,
770
- {['X-Source-Origin']:a.origin});return cj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.jc();var e=bj(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,Xh:k})});if(this.j.has(b))return f;this.j.set(b,g);e=N(d===olympe.dc.Ka.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,Li,void 0,olympe.net.wa.ResponseType.Kh);d!==olympe.dc.Ka.SERVER&&
771
- Ac(e,{['X-Source-Origin']:a.origin});cj(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.Xh(`${h}`))}).finally(()=>{this.j.delete(b)});return f}};olympe.dc.sources.yp=class{constructor(a,b){this.G=a;this.Wb=b}};olympe.dc.sources.yp.Tb={Ri:0,eC:1,fC:3,AB:4};const fj=olympe.dc.Request.j.pc,gj=olympe.dc.Request.j.Hg,hj=olympe.dc.Request.j.hk,ij=olympe.dc.Request.j.dg,jj=olympe.dc.Request.j.Wf,kj=olympe.dc.Request.j.vg,lj=olympe.dc.Request.j.mi,mj=olympe.dc.Request.j.kh,nj=olympe.dc.Request.j.We,oj=olympe.dc.Request.j.Rg;
772
- function pj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.V.Jh(6E4),hb(a.D,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),ib(a.D,()=>{a.D=null}));let d;const e=null!=(d=a.D.get(c))?d:new olympe.dc.db.fc(c);b.tc(e);fb(a.D.j,c)||a.D.set(c,e)}
773
- function qj(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.tc(f);return a.applyTransaction(f,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function rj(a,b){const c=rxjs.defer(()=>a.j.executeQuery(b));return 0<a.R?rxjs.interval(a.R).pipe(rxjs.operators.switchMap(()=>c)):c}
774
- olympe.dc.sources.Mp=class{constructor(a,b){this.G=a;this.j=b;this.Wb=null;this.N=olympe.dc.query.Nk();this.J=olympe.dc.Yr();this.F=new olympe.C.Xb('Context of source '+this.T());let c;this.R=null!=(c=b.If(olympe.dc.sources.U.jm))?c:-1;this.D=null}T(){return this.j.T()}init(a){this.Wb=a;if(this.T()===olympe.dc.Ka.SELF)return this;(new Promise((b,c)=>{let d=!0;sj(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:`);
775
- 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 fj:const d=olympe.dm.DataSource.pc.zb,e=olympe.dm.DataSource.pc.Fh;
776
- return this.j.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case gj:return this.j.executeQuery(b);case lj:return c=b.kc(),pj(this,c),this.J.Tc(rf(c)),Promise.resolve();case nj:case oj:const f=b.kc();return this.applyTransaction(f,c===oj).finally(()=>{if(a.origin===olympe.dc.Ka.SELF){var g=f.T();g=vf(new olympe.dc.Request(olympe.dc.Request.j.Qj,olympe.dc.Ka.SELF,{id:g,finalize:olympe.dc.transaction.Af.j.Ii,error:null}),this.T());let h;null==(h=this.Wb)||h.vd(g)}});case mj:return qj(this,
777
- b.kc());case ij: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 jj:return this.j.downloadFileContent(b.tag,b.model);case kj:return this.j.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===hj){const b=a.content;a=a.origin;return a===olympe.dc.Ka.SELF?rj(this,b):hi(this.N,
778
- b,this.F,a,olympe.dc.ma.oc.lf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Je)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>rf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return w(function*(){var d=tj(a);yield c.j.applyTransaction(d,{batch:b});d=Date.now();yield ri(c.N,c.T(),a);c.J.Tc(rf(a,d));return d})}};olympe.dc.sources.Mp.xa=[olympe.dc.sources.Mj];function tj(a){const b=olympe.dc.sources.cg.j.lt,c=olympe.dc.sources.cg.j.gw,d=olympe.dc.sources.cg.j.rt,e=olympe.dc.sources.cg.j.mt,f=olympe.dc.sources.cg.j.st,g=[],h=[],k=[],l=[],n=[];a.Ab.forEach((p,q)=>{const r=p.Vb();p.D()?g.push(uj(b,q,r,p.R()?p.Cb():null)):p.Ed()?k.push(uj(d,q,r,null,p.J())):p.R()&&h.push(uj(c,q,r,p.Cb()));for(const [t,u,x]of p.Dd())p=a.Rc(u),x?l.push(new vj(e,t,q,u,r,p.Vb())):n.push(new vj(f,t,q,u,r,p.Vb()))});return n.concat(k,g,h,l)}
779
- function uj(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new wj(a,b,c,d,e)}olympe.dc.sources.cg=class{constructor(a){this.type=a}};class wj extends olympe.dc.sources.cg{constructor(a,b,c,d,e){super(a);this.object=b;this.model=c;this.properties=null!=d?d:null;this.deleteRules=null!=e?e:olympe.dc.Lb.NONE}}
780
- class vj extends olympe.dc.sources.cg{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.cg.j={lt:'CREATE',gw:'UPDATE',rt:'DELETE',mt:'CREATE_RELATION',st:'DELETE_RELATION'};function xj(a,b){b=vf(new olympe.dc.Request(olympe.dc.Request.j.Qj,olympe.dc.Ka.SELF,{id:b,finalize:olympe.dc.transaction.Af.j.Ii,error:null}),a.T());let c;null==(c=a.Wb)||c.vd(b)}
781
- olympe.dc.sources.sl=class{constructor(a,b){this.G=a;this.D=b;this.Wb=null}T(){}R(){}Y(){}init(a){this.Wb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return w(function*(){if(!b.D.D)return b.R(a);var c=olympe.dc.Request.j.pc,d=olympe.dc.Request.j.Hg;const e=olympe.dc.Request.j.We,f=olympe.dc.Request.j.Rg;var g=olympe.dc.Request.j.mi;const h=olympe.dc.Request.j.kh,k=olympe.dc.Request.j.dg;var l=olympe.dc.Request.j.Wf;const n=olympe.dc.Request.j.vg,p=olympe.dc.sources.Yd(),
782
- q=a.getType(),r=a.jc();if(id(b.D)){q===d&&(c=a.content,(g=xf(a).get(olympe.dc.ma.j.nl))&&(yield yj(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.R(a);if(q===d){const t=a.content;d=l;const u=new olympe.dc.db.fc(`fullResult_${t.T()}`);l=d.pipeThrough(new TransformStream({transform:(x,y)=>w(function*(){const z=
783
- x.kc();yield zj(p,z);z.tc(u);b.G.j()&&b.G.debug(`Data Provider: Data result for query ${t.T()}`,z.Ab.size,'instances',Array.from(z.Dd()).length,'relations');y.enqueue(x)}),flush:()=>w(function*(){yield Aj(p,t.T(),r,u,!0)})}))}else if(q===e||q===f||q===h)b.G.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield Bj(p,null,r,a.content.kc(),!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.ye};
784
- case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.kc().T();return p.applyTransaction(d,r).finally(()=>xj(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.D)return this.Y(a,
785
- b);const c=olympe.dc.sources.Yd(),d=a.content,e=a.jc();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(id(this.D)){const f=new rxjs.Observable(h=>{olympe.C.As([this.D.Pf()],()=>{h.error(new olympe.L.errors.jp('Go Offline',d.T()))})}),g=this.Y(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.C.As([this.D.Pf()],()=>{f.error(new olympe.L.errors.Yn('Back Online',d.T()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(Bj(c,d.T(),e,f.kc()).then(()=>f).catch(g=>{this.G.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);
786
- throw g;}))))}};olympe.dc.sources.sl.xa=[olympe.dc.sources.Mj];const Cj=olympe.dc.Request.j.pc,Dj=olympe.dc.Request.j.Hg,Ej=olympe.dc.Request.j.hk,Fj=olympe.dc.Request.j.We,Gj=olympe.dc.Request.j.Rg,Hj=olympe.dc.Request.j.mi,Ij=olympe.dc.Request.j.kh,Jj=olympe.dc.Request.j.dg,Kj=olympe.dc.Request.j.Wf,Lj=olympe.dc.Request.j.vg;function Mj(a,b){let c;return(null==(c=a.fa.sb(b))?void 0:c.If(olympe.dc.sources.U.Ne))!==olympe.dm.DataSource.Ne.mp}function Nj(a,b){let c;return(null==(c=a.fa.sb(b))?void 0:c.If(olympe.dc.sources.U.Ne))!==olympe.dm.DataSource.Ne.Un}
787
- function Oj(a,b){b=b.Bc();if(b!==olympe.dm.User.j&&a.If(olympe.dc.sources.U.sm))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.dc.sources.Rq(a);}
788
- function Pj(a,b,c,d,e){return w(function*(){var f=olympe.L.cb.j.SEND,g=olympe.L.cb.j.GET;const h=olympe.L.cb.j.PUBLISH,k=olympe.L.cb.j.SUBSCRIBE,l=d.Bs();var n=d.body();if(e!==n.Bc())throw Error('Access denied: try to impersonate a user');Oj(c,n);let p;if(null==(p=a.Wb)||!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()===Ej)f=n.content.T();else throw Error('Not supported type of subscription');
789
- g=yield d.mn(f);a.$.set(g,f);g=a.N.get(f);g||(g=new Qj(a.G,f,b,vf(n,olympe.dc.Ka.wf)),a.N.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.vd(n):a.G.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.Hr()):l===h&&(yield b.request(n))})}
790
- olympe.dc.sources.Qq=class extends olympe.dc.sources.sl{constructor(a,b,c,d,e,f){super(a,d);this.J=b;this.j=c;this.db=e;this.F=new olympe.C.Xb('Remote Provider Context');this.ba=new Map;this.N=new Map;this.$=new Map;this.fa=f}T(){return olympe.dc.Ka.wf}R(a){var b=olympe.L.ub;const c=a.jc(),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 Cj:const e=olympe.dm.DataSource.pc.zb,f=olympe.dm.DataSource.pc.Fh;b=Mj(this,
791
- c)?b.get(c,a):Promise.resolve({s:f});a=Nj(this,c)?this.j.Hc(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 Dj:return Nj(this,c)?dj(this.j,a):b.get(c,a);case Fj:const g=a.content.kc().T();return(Mj(this,c)?b.get(c,a):ej(this.j,a)).finally(()=>xj(this,g));case Gj:const h=a.content.kc().T();return(Nj(this,c)?ej(this.j,
792
- a):b.get(c,a)).finally(()=>xj(this,h));case Hj:return Mj(this,c)?b.publish(c,a).catch(k=>{this.G.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case Ij:return Mj(this,c)?b.get(c,a):ej(this.j,a);case Jj:return Nj(this,c)?this.j.uploadFileContent(a):b.get(c,a);case Kj:return Nj(this,c)?this.j.downloadFileContent(a):b.get(c,a);case Lj:return Nj(this,c)?this.j.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.T()}`)}}Y(a,
793
- b){const c=a.jc(),d=a.getType();if(!Mj(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===Ej?olympe.L.ub.observe(c,this.F,a,{onRetry:b}):rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.F)return this;olympe.dc.ma.from(this.J,this.J).gb(olympe.dm.DataSource.sj).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.Rh,
794
- !0)).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.Tr,!0)).observe(this.F).subscribe(b=>{b.hj().forEach(this.Ga.bind(this,a));b.mj().forEach(c=>{let d;null==(d=this.ba.get(c))||d.destroy();this.ba.delete(c)})});this.db.Qa(this.J,olympe.dm.DataSource.Tr)&&(new olympe.L.ub(this.J,this.F)).listen().subscribe(b=>{b=b.body();b instanceof olympe.dc.Request?a.vd(b):this.G.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return w(function*(){})}Ga(a,
795
- b){const c=b.X(),d=new olympe.C.Xb(`Published data provider context ${c}`,this.F);this.ba.set(c,d);let e,f;Rj(b,d).subscribe(g=>{let h;null==(h=e)||h();let k;null==(k=f)||k.stop();g!==olympe.dm.DataSource.Ne.Un&&(e=Zi(this.j,c,l=>{Oj(b,l);return a.request(l)}),d.onDestroy(()=>{let l;return null==(l=e)?void 0:l()}));g!==olympe.dm.DataSource.Ne.mp&&(g=new olympe.C.Xb(`Bus Service of data source ${c}`,d),f=(new olympe.L.ub(c,g)).Hs(this.ua.bind(this)),f.listen().subscribe(l=>{l.ii().then(n=>Pj(this,
796
- a,b,l,n)).catch(n=>{this.G.warn(`Error occurred while processing request from ${l.source()}: ${n}`);return l.Xh(n instanceof Error?n:Error(n))})}))})}ua(a){const b=this.$.get(a);this.$.delete(a);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)}};
797
- class Qj{constructor(a,b,c,d){this.G=a;this.D=b;this.j=0;this.F=c.subscribe(d).subscribe({next:e=>{olympe.L.ub.publish(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.Qq.xa=[olympe.dc.sources.Mj];const W={Cr:10,fo:11,Oo:12,yq:13,QUERY_RESULT:14,hp:15,xo:16,We:17,zq:18,wo:19,pm:20};function Sj(a,b){const c=new olympe.dc.transaction.Ae,d=new olympe.dc.transaction.Ae;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.Pc(e.t,e.s,f,e.m);e.r.forEach(h=>g.Oa(h.r,h.o,h.d))});a.$.Tc(Af(Bf(d),olympe.dc.Ka.SELF),{persist:!1});a.$.Tc(Af(Bf(c),olympe.dc.Ka.SELF))}
798
- 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.Cr,a),{i:b})}return a}N(a){return(null==a?void 0:a.t)===W.Cr&&Array.isArray(null==a?void 0:a.i)?(Sj(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.Oo;{const d=a.X(),e={t:d};if(!this.F.has(d)&&(this.J(d),!this.db.ef(d))){const f=
799
- a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))a=olympe.dc.cs().ua(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.fo,this.J(a.X()));case a instanceof olympe.dc.ma:return this.format(W.yq,a.ga());case a instanceof olympe.dc.Ia:return this.format(W.QUERY_RESULT,a.ga(this.J.bind(this)));case a instanceof olympe.dc.db.fc:return b=new olympe.dc.transaction.Ae,
800
- a.tc(b),this.format(W.hp,{i:a.T(),p:Bf(b)});case a instanceof olympe.dc.Request:return this.format(W.xo,{r:a.getType(),o:a.origin,d:a.jc(),u:a.Bc(),c:this.D(a.content)});case a instanceof olympe.dc.transaction.Vi:return this.format(W.We,{r:a.gh(),p:this.D(a.kc())});case a instanceof olympe.dc.query.zd:return this.format(W.zq,a.ga());case a instanceof olympe.dc.wg:return this.format(W.wo,a.ga());case a instanceof olympe.dc.vc:return this.format(W.pm,this.J(a.X()));default:return super.D(a)}}j(a){if(null===
801
- a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case W.Oo:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.cs().fb(d,a));return olympe.dc.CloudObject.get(d);case W.fo:return olympe.dc.CloudObject.get(c);case W.yq:return d=c.p.map(olympe.dc.query.oa.mm.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,Hd:a.s,Ke:a.rm});case W.QUERY_RESULT:return ti(c);case W.hp:return(new olympe.dc.transaction.Ni).j(c.p,c.i);case W.xo:return a=null!=(d=this.j(c.c))?d:void 0,
802
- vf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case W.We:return d=this.j(c.p),new olympe.dc.transaction.Vi(d,c.r);case W.zq:return olympe.dc.query.zd.j(c);case W.wo:return olympe.dc.wg.j(c);case W.pm:return new olympe.dc.vc(c);default:return super.j(a)}}J(a){if(this.F.has(a))return a;if(!this.db.Ha(a))throw new olympe.dc.kq(a);const b={};this.db.Cb(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of $g(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.va.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
803
- d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.ef(a)||(c.v=!0);this.F.set(a,c);return a}};const Tj=olympe.dc.Request.j.yg,Uj=olympe.dc.Request.j.We,Vj=olympe.dc.Request.j.Rg,Wj=olympe.dc.Request.j.mi,Xj=olympe.dc.Request.j.Rn,Yj=olympe.dc.Request.j.Hq,Zj=olympe.dc.Request.j.Hg,ak=olympe.dc.Request.j.hk,bk=olympe.dc.Request.j.gp,ck=olympe.dc.Request.j.It,dk=olympe.dc.Request.j.Jt,ek=olympe.dc.Request.j.Kt,fk=olympe.dc.Request.j.vg,gk=olympe.dc.Request.j.Wf,hk=olympe.dc.Request.j.dg,ik=olympe.dc.Request.j.Qj,jk=olympe.dc.Request.j.ew,kk=olympe.dc.Request.j.vv,lk=olympe.dc.Request.j.ap,mk=
804
- olympe.dc.Request.j.kh,nk=olympe.dc.Request.j.gt,ok=olympe.dc.Request.j.pc;function pk(a){return qk(a,olympe.dc.Request.j.yg).then(b=>{b=b.getData().p;const c=Af(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 rk(a,b){const c=new olympe.dc.transaction.Ae({ge:!1,Sh:!1}),d=b.kc(),e=b.j;d.tc(c);return sk(a,Uj,{i:d.T(),r:b.gh(),p:Bf(c),bd:e?!0:void 0}).then(f=>f.ct)}
805
- function tk(a,b){const c=b.kc(),d=new olympe.dc.transaction.Ae({Yk:!0,ge:!1,Sh:!1});c.tc(d);b=b.j?'bd=true':'';return qk(a,Vj,Bf(d),b,olympe.net.wa.ResponseType.lr).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(()=>{uk(a,ik,{id:c.T(),finalize:olympe.dc.transaction.Af.j.Ii})})}
806
- function vk(a,b){const c=new olympe.dc.transaction.Ae({ge:!1,Sh:!1}),d=b.kc();d.tc(c);return sk(a,Wj,{i:d.T(),r:b.gh(),p:Bf(c)},!1).catch(e=>a.G.error(`Error while publishing burst transaction: ${e}`))}function wk(a,b){const c=new olympe.dc.transaction.Ae({ge:!1,Sh:!1});b=b.kc();b.tc(c);return sk(a,mk,{i:b.T(),p:Bf(c)}).then(d=>d.ct)}
807
- function xk(a,b){const c=encodeURI(bb(olympe.V.Ze(),JSON.stringify(yk(a,b))));a.G.j()&&a.G.debug(`Static GraphDef query ${b} sent to orchestrator`);return qk(a,Zj,void 0,`query=${c}&v=${a.version}`,olympe.net.wa.ResponseType.fe).then(d=>zk(a,d))}function Ak(a,b){const c=b.T();a.G.j()&&a.G.debug(`Query (${c}) sent to orchestrator: ${b}`);const d=yk(a,b);return qb(a.ua,()=>qk(a,bk,d,void 0,olympe.net.wa.ResponseType.fe)).then(e=>zk(a,e))}
808
- function Bk(a,b){if(!Td(a.F))return a.G.error(`Server is disconnected, backup of instance ${b} is canceled.`),Promise.reject('Server is disconnected');b=yk(a,olympe.dc.ma.from(b));b.f=olympe.dc.Lb.Bo;b=N(bj(a.j,olympe.dc.Ka.SERVER,Xj),olympe.net.wa.Md.Ch,JSON.stringify(b),olympe.net.wa.ResponseType.Kh);Ac(b,{[olympe.net.wa.Headers.oi]:olympe.net.wa.ul.JSON});return cj(a.j,b).then(c=>c.getData())}
809
- function Ck(a,b,c,d){if(!Td(a.F))return a.G.error('Server is disconnected, restore of instance is canceled.'),Promise.reject('Server is disconnected');const e=bj(a.j,olympe.dc.Ka.SERVER,Yj);b=N(e+`?debug=${c}&optional=${d}`,olympe.net.wa.Md.Ch,b);Ac(b,{[olympe.net.wa.Headers.oi]:olympe.net.wa.ul.pw});return cj(a.j,b).then(f=>f.getData())}
810
- function sk(a,b,c,d=!0){const e=olympe.L.xe.ug,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{Wd(a.F,e,f,(k,l)=>{k?h(k):g(l)})});Wd(a.F,e,f);return Promise.resolve()}
811
- function yk(a,b){var c=Ph(b);b={i:b.T(),b:[b.D],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.oa.Jd)Object.assign(b,{f:c[0].Nb,q:[]});else{const d=(h,k)=>{h.every(l=>!l.Ea(k))&&h.push(k);return h},e=new Map;for(let h=c.length-1;0<=h;h--){const k=c[h],l=k.j;let n;const p=d(null!=(n=e.get(l))?n:[],k);if(k instanceof olympe.dc.query.oa.ue&&k.F){let q;null==(q=e.get(k.T()))||q.forEach(r=>d(p,r))}e.set(l,p)}let f,g;c=null!=(g=e.get(null==(f=c[0])?void 0:f.j))?g:[];Object.assign(b,{f:olympe.dc.Lb.NONE,q:c.map(a.ba.bind(a,
812
- e))})}return b}function uk(a,b,c){b=vf(new olympe.dc.Request(b,olympe.dc.Ka.SELF,c),a.T());let d;null==(d=a.Wb)||d.vd(b)}
813
- function qk(a,b,c,d,e){const f=bj(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.Md.Ch:olympe.net.wa.Md.GET,c&&JSON.stringify(c));Ac(b,{[olympe.net.wa.Headers.oi]:'application/json'});Cc(b,null!=e?e:olympe.net.wa.ResponseType.JSON);return cj(a.j,b)}
814
- function zk(a,b){return w(function*(){const c=b.headers.graphId,d=b.getData();let e,f;return(null!=(f=null==(e=a.Ga)?void 0:rb(e,d))?f:olympe.V.stream.ck.transform(b.getData())).pipeThrough(new TransformStream({transform:(g,h)=>{a.G.debug(`Received ${g.length} operations for patch ${c}`);h.enqueue(Af(g,a.T(),null,c))}}))})}
815
- function Dk(a,b,c){return w(function*(){const d=b.pi;let e;if(c instanceof olympe.V.stream.yf){e=new olympe.dc.db.fc(d);try{for(const f=fa(c);;){const g=yield f.next();if(g.done)break;a.$.j(g.value.p,d).tc(e)}}catch(f){a.G.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.fc(d)}}else e=a.$.j(b.p,d);return rf(e,b.ct)})}
816
- olympe.dc.sources.er=class extends olympe.dc.sources.sl{constructor(a,b,c,d,e,f,g){super(a,c);this.F=b;this.j=d;this.$=new olympe.dc.transaction.Ni(this.T());this.J=new Map;this.N=new Set;this.version=e||'unknown';this.Ga=g?new olympe.V.stream.ow:null;this.ua=new olympe.V.promise.ir(f);olympe.C.oj(this.D.Pf(),()=>{this.J.forEach((h,k)=>{h.error(new olympe.L.errors.Ji('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ka.SERVER}R(a){var b=a.getType();const c=a.content,d=xf(a);switch(b){case ok:return a=
817
- olympe.dm.DataSource.pc.zb,b=olympe.dm.DataSource.pc.Fh,Promise.resolve(Td(this.F)?{s:b}:{s:a,r:'Disconnected'});case Tj:return pk(this);case Uj:return rk(this,c);case Vj:return tk(this,c);case Wj:return vk(this,c);case mk:return wk(this,c);case Zj:return d.get(olympe.dc.ma.j.zp)?xk(this,c):Ak(this,c);case Xj:return Bk(this,c);case Yj:return Ck(this,c.NE,c.debug,c.optional);case jk:case kk:case lk:case nk:return sk(this,b,{});case gk:return this.j.downloadFileContent(a);case fk:return this.j.deleteFileContent(a);
818
- case hk:return this.j.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Y(a,b){if(a.getType()===ak){const c=a.content,d=c.T();return(new rxjs.Observable(e=>{const f=yk(this,c);this.N.delete(d);this.J.set(d,e);sk(this,ck,f).catch(g=>e.error(g))})).pipe(nb(olympe.L.errors.Ji,(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);sk(this,dk,{i:d}).catch(e=>
819
- {this.G.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.N.has(d)&&this.J.delete(d);this.N.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);Rd(this.F,olympe.L.xe.ug,this.fa.bind(this));return this}destroy(){return w(function*(){})}fa(a,b){const c=olympe.dc.Request.j.Tn,d=olympe.dc.Request.j.Zl,e=a.c;if(e===olympe.dc.Request.j.so)Dk(this,a,b).then(f=>{uk(this,e,f)});else if(e===c)b=this.$.j(a.p,a.i),
820
- b=rf(b,a.ct),uk(this,e,{rollback:b,error:a.error});else if(e===ek){const f=a.i;Dk(this,a,b).then(g=>{let h;null==(h=this.J.get(f))||h.next(g)})}else e===d&&uk(this,ik,{id:a.i,finalize:olympe.dc.transaction.Af.j.Zl,error:0<a.s?a.error:null})}ba(a,b){if(b instanceof olympe.dc.query.oa.Gh){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.X(),d:c.Ja()===olympe.dc.va.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.ba.bind(this,a))}}return{}}};olympe.dc.sources.er.xa=[olympe.dc.sources.Mj];function Ek(a,b,c){const d=new olympe.C.Xb(`Source solver ${b.X()}`);b.gb(olympe.dm.wd.F.ac()).gb(olympe.dm.wd.D).he().back().gb(olympe.dm.wd.j).he().observe(d,{jd:c,zc:!0}).subscribe(e=>{e.hj().forEach(([f,g])=>{a.D.set(f.X(),g.T())});e.mj().forEach(([f])=>{a.D.delete(f)})});b.gb(olympe.dm.jb.D).observe(d,{jd:c,zc:!0}).subscribe(e=>{let f,g;a.F=null!=(g=null==(f=e.Gc())?void 0:f.T())?g:null});d.onDestroy(()=>{a.D.clear();a.F=null})}
821
- olympe.dc.sources.uk=class{constructor(a,b,c){this.db=a;this.j=b;this.N=c;this.D=new Map;this.F=null;this.J=!1}fromModel(a){a=olympe.dc.ha(a);return this.D.has(a)?this.D.get(a):this.F&&this.R(a)?this.F:this.N}Ie(a){let b;return null!=(b=this.db.source(a))?b:this.N}sb(a){return a===this.j?olympe.dc.CloudObject.get(this.j):a===olympe.dc.Ka.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ha(a)&&this.db.Qb(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}R(){return!1}init(){if(!this.J){this.J=
822
- !0;var a=new olympe.dc.Wa;Y(a.create(olympe.dm.DataSource,this.j).gi(this.j),olympe.dm.DataSource.Rh,!0);a.Oa(olympe.dm.DataSource.sj,this.j,this.j);a.nb(()=>{olympe.dc.ma.from(this.j).observe(olympe.C.Xg()).subscribe(()=>{})})}}};olympe.dc.sources.P={Ca:'dc.sources.Logger',Ll:'dc.sources.HTTPService',Zt:'dc.sources.IOService',Fq:'dc.sources.RemoteProvider',Yq:'dc.sources.ServerProvider',BB:'dc.sources.OfflineProvider',Te:'dc.sources.SourceSolver',Ee:'dc.sources.Serializer',uo:'dc.sources.cache.Cache',vo:'dc.sources.cache.DATABASE',ol:'dc.sources.cache.Logger'};
823
- olympe.dc.sources.U={th:'data.httpHost',rf:'data.httpPort',yi:'data.httpSSL',Jl:'data.httpBasePath',jm:'data.pollingFrequency',Ne:'data.communicationMode',sm:'data.restrictedUse',VERSION:'version.version',cr:'data.streamWorker',jq:'data.queryConcurrencyLimit'};olympe.dc.sources.vh={hv:'olympe.internal.data.',th:'olympe.internal.data.httpHost',rf:'olympe.internal.data.httpPort',yi:'olympe.internal.data.httpSSL'};
824
- olympe.W.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.U.Vl),d=`-${olympe.host.Lg.Dh}`;F(a,olympe.dc.sources.U.th,null);F(a,olympe.dc.sources.U.rf,null);F(a,olympe.dc.sources.U.yi,null);F(a,olympe.dc.sources.U.Jl,'runtime/data');F(a,olympe.dc.sources.U.cr,!1);F(a,olympe.dc.sources.U.jq,10);Ya(a,olympe.dc.sources.vh.th,[olympe.host.U.kk,olympe.L.U.yl,olympe.dc.sources.U.th],(e,f,g)=>{if(g)return g;e=e===olympe.host.Lg.Dh;return f.endsWith(c)&&e?f+d:f});Ya(a,olympe.dc.sources.vh.rf,
825
- [olympe.dc.sources.vh.th,olympe.dc.sources.U.rf],(e,f)=>{if(f)return f;f=b.includes(e);const g=e.endsWith(d);e=e.endsWith(c);return f?3141:g?85:e?80:443});Ya(a,olympe.dc.sources.vh.yi,[olympe.dc.sources.vh.rf,olympe.dc.sources.U.yi],(e,f)=>null!==f?f:443===e);F(a,olympe.dc.sources.U.jm,null);F(a,olympe.dc.sources.U.Ne,null);F(a,olympe.dc.sources.U.sm,null);E(a,olympe.dc.sources.P.Ca,[olympe.ja.P.Da],e=>e.cd('data'));D(a,olympe.dc.sources.P.Ee,olympe.dc.sources.ec,olympe.dc.db.P.Da);Wa(a,olympe.L.P.Ee,
826
- olympe.dc.sources.P.Ee);D(a,olympe.dc.sources.P.Ll,olympe.dc.sources.Nt,olympe.dc.sources.P.Ca,olympe.net.P.Xi,olympe.L.P.Kl,olympe.auth.P.Da,olympe.dc.sources.P.Te,olympe.L.P.Ee,new olympe.W.pa(olympe.L.U.jl));D(a,olympe.dc.sources.P.Zt,olympe.dc.sources.yp,olympe.dc.sources.P.Ca,olympe.dc.P.Jg,olympe.net.P.Da,olympe.auth.P.Da);D(a,olympe.dc.sources.P.Fq,olympe.dc.sources.Qq,olympe.dc.sources.P.Ca,new olympe.W.pa(olympe.dc.U.Mg),olympe.dc.sources.P.Ll,olympe.L.P.kf,olympe.dc.P.oh,olympe.dc.sources.P.Te);
827
- D(a,olympe.dc.sources.P.Yq,olympe.dc.sources.er,olympe.dc.sources.P.Ca,olympe.L.P.nk,olympe.L.P.kf,olympe.dc.sources.P.Ll,new olympe.W.pa(olympe.dc.sources.U.VERSION),new olympe.W.pa(olympe.dc.sources.U.jq),new olympe.W.pa(olympe.dc.sources.U.cr));D(a,olympe.dc.sources.P.Te,olympe.dc.sources.uk,olympe.dc.P.oh,new olympe.W.pa(olympe.dc.U.Mg),new olympe.W.pa(olympe.dc.U.Al));E(a,olympe.dc.sources.P.ol,[olympe.ja.P.Da],e=>e.cd('datacache'));D(a,olympe.dc.sources.P.uo,olympe.dc.sources.cache.Cache,olympe.dc.sources.P.ol,
828
- olympe.dc.P.Jg,olympe.dc.sources.P.vo,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.L.P.kf,olympe.Db.P.Wl,olympe.V.P.qg,new olympe.W.pa(olympe.net.U.gq),new olympe.W.pa(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.P.vo,olympe.dc.sources.cache.ak,olympe.Db.P.Og,olympe.dc.sources.P.ol,olympe.Db.P.Vj)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.P.Te,olympe.dc.sources.P.uo],(a,b)=>{olympe.dc.$d=()=>a;olympe.dc.sources.Yd=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.ym=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.pt=class extends olympe.dc.sources.cache.errors.ym{};olympe.dc.sources.cache.errors.bw=class extends olympe.dc.sources.cache.errors.ym{};olympe.dc.sources.cache.errors.lw=class extends olympe.dc.sources.cache.errors.ym{};function Fk(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.Ob(a);case 17:return new olympe.dc.vc(a.v);case 13:return(new olympe.dc.transaction.Ni).j(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
829
- olympe.dc.sources.cache.qp=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.vc:return{t:17,v:a.X()};case a instanceof olympe.dc.db.fc:const b=new olympe.dc.transaction.Ae;a.tc(b);
830
- return{t:13,i:a.T(),v:Bf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function yj(a,b,c){return w(function*(){Gk(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(Hk(a)));return Ik(a.j,b,c)})}function zj(a,b){return w(function*(){yield a.init();a.G.debug(`Cache: subtract pending transaction operations from ${b.T()}`);b.R(a.F)})}
831
- function Aj(a,b,c,d,e=!1){(()=>w(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.dd()).filter(h=>!h.Ed()).map(h=>h.tag()),yield Jk(a.j)),yield Kk(a.j,d,0<f.length?b:null),Lk(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}`),
832
- a.rc.next(f)}finally{b&&Mk(a,'queries',b)}}))().then(()=>{})}function Bj(a,b,c,d,e=!1){return w(function*(){yield zj(a,d);Aj(a,b,c,d,e)})}function Nk(){var a=olympe.dc.sources.Yd();a.$=!0;a.Bb=!0}function Gk(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)}
833
- function Mk(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 Ok(a){return w(function*(){a.F=new olympe.dc.db.fc;const b=yield Pk(a.j);for(const c of b)c.tc(a.F);a.ba.next(0<b.length)})}
834
- function Lk(a,b,c){return w(function*(){const d=Qk(b),e=[];for(const g of d){const h=g.tag();if(!(yield Rk(a.j,h)))if(Gk(a,'files',h),!1===g.Qa(olympe.dm.File.j.X())&&g.Qa(olympe.dm.File.urlProp.X())){var f=g.Qa(olympe.dm.File.urlProp.X());f=N(f);Cc(f,olympe.net.wa.ResponseType.il);e.push(Dc(a.Ec,f).then(k=>{k=k.Hc();if(200>k||300<=k)throw Error(`Failed to download file ${g}. Response code ${k}`);}).finally(()=>Mk(a,'files',h)))}else{let k;const l=null!=(k=g.Qa(olympe.dm.File.mimeTypeProp.X()))?k:
835
- 'application/octet-stream';f={tag:h,model:g.Vb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.j.Wf,c,f);f=qb(a.Kc,()=>a.Wb.request(n).then(p=>Sk(a.j,h,p,l))).finally(()=>Mk(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`)}})})})}
836
- function Qk(a){const b=[olympe.dc.ha(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.ma.from(olympe.dm.File).hg(olympe.dc.CloudObject.extendedByRel).Fc().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Rc(c))?void 0:d.bb(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.Rc(d))?void 0:e.bb(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Rc(g));return c.concat(d)},[])}
837
- function Tk(a,b){return Array.from(a.D.values()).some(c=>c.has(b))}function Hk(a){return Array.from(a.D.keys()).filter(b=>'__code-as-data__'!==b)}function Uk(a,b){return w(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 Vk(a.j,b);a.N.next(Hk(a));d.filter(f=>!e.has(f));yield Jk(a.j)}else yield Promise.all(Hk(a).map(f=>Uk(a,f)))})}
838
- function Wk(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])}
839
- function Xk(a,b,c){return w(function*(){var d=olympe.dc.Request.j.We;const e=olympe.dc.Request.j.vg,f=olympe.dc.Request.j.dg;a.G.debug('Sync Cache: Applying transaction patch to destination',c,b.T());const g=Qk(b);a.G.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>w(function*(){const k=h.tag();var l=h.Vb();if(h.Ed())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield Yk(a.j,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.j})}if(!id(a.fb))throw Error('Lost connection, stop syncing');
840
- l=yield a.Wb.request(l);b.Wc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.Vi(b,!1));if(!id(a.fb))throw Error('Lost connection, stop syncing');yield a.Wb.request(d)})}
841
- function Zk(a,b,c){return c instanceof olympe.L.errors.wk||c instanceof olympe.L.errors.no?(a.G.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.pt('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.L.errors.Pq?(a.G.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.bw('The transaction has been rejected by the datasource',
842
- c.message)):new olympe.dc.sources.cache.errors.lw('Synchronisation error',c.message)}
843
- function $k(){var a=olympe.dc.sources.Yd();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]);(()=>w(function*(){yield a.init();const c=yield al(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){Wk(g);for(const h of g){a.G.debug(`Sync Cache: Processing patch ${d+1}/${e} (${h.T()})`);try{yield Xk(a,
844
- h,f),yield bl(a.j,h)}catch(k){throw Zk(a,f,k);}d+=1;b.next([e,d])}}a.J=null}))().then(()=>{a.R=!1;b.complete()}).catch(c=>{b.error(c.message)}).finally(()=>{Ok(a).finally(()=>{a.R=!1})});return b.asObservable()}
845
- function cl(){const a=olympe.dc.sources.Yd();return w(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=Qk(a.F);for(const e of d)b.has(e.tag())||(d=yield Yk(a.j,e.tag()),c.files.push({t:e.tag(),m:d.j,c:a.ua.j(d.content)}),b.add(e.tag()));b=yield dl(a.j);c.patches.push(...b);return JSON.stringify(c)})}
846
- function el(a){const b=olympe.dc.sources.Yd();return w(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.ua.D(e.c),yield Sk(b.j,e.t,d,e.m);yield fl(b.j,c.patches);yield Ok(b);b.Ga.Tc(rf(b.F))})}
847
- function gl(){const a=olympe.dc.sources.Yd();return w(function*(){yield hl(a.j);yield Ok(a)})}
848
- olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.Wb=b;this.j=c;this.Ga=d;this.Ec=e;this.fb=f;this.$a=g;this.ua=h;this.version=l;this.$=this.version!==this.$a.get('__code-as-data-version__');this.Eb=this.Bb=!1;this.D=new Map;this.N=new rxjs.BehaviorSubject([]);this.J=null;this.ba=new rxjs.BehaviorSubject(!1);this.F=new olympe.dc.db.fc;this.Ub=this.$b=!1;this.fa=[];this.Y=0;this.$c=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});this.R=
849
- !1;this.rc=new rxjs.Subject;this.Kc=new olympe.V.promise.ir(k)}Hc(){return this.status.asObservable()}init(){const a=this;return w(function*(){if(!a.$b)if(a.Ub)yield new Promise(b=>{a.fa.push(b)});else{a.Ub=!0;(yield il(a.j)).forEach(b=>{a.D.set(b.name,new Set(b.j))});a.N.next(Hk(a));yield Ok(a);a.Ga.Tc(rf(a.F));for(const b of a.fa)b();a.$b=!0;a.fa=[]}})}executeQuery(a){const b=this;return w(function*(){yield b.init();return Tk(b,a.T())&&Ph(a).some(c=>c instanceof olympe.dc.query.oa.Jd)?jl(b.j,a).then(olympe.V.stream.Wr):
850
- b.j.executeQuery(a).then(olympe.V.stream.Wr)})}applyTransaction(a,b){const c=this;return w(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.kc(),e=Array.from(d.Ab.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.J)?void 0:f.j.Ab.keys())?g:[]);let k;b!==(null==(k=c.J)?void 0:k.D)||e.some(l=>!h.includes(l))?(yield kl(c.j,d,b),c.J=new olympe.dc.sources.cache.nt(d,b),c.ba.next(!0)):(d.tc(c.J.j),yield kl(c.j,c.J.j,b));d.tc(c.F);yield Kk(c.j,d,'local-transaction')})}uploadFileContent(a,
851
- b,c){const d=this;return w(function*(){yield d.init();yield Sk(d.j,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return w(function*(){yield b.init();return Yk(b.j,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return w(function*(){yield b.init();yield ll(b.j,[a])})}};olympe.dc.sources.cache.nt=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 il(a){return w(function*(){return(yield a.db.F('buckets')).map(b=>olympe.dc.sources.cache.lq.Ob(b))})}function Pk(a){return w(function*(){return(yield a.db.F('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.Bh.Ob(b);return Fk(b.j)})})}function Ik(a,b,c){return w(function*(){a.G.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.D()})}function Jk(a){return w(function*(){return a.db.D()})}
852
- function Kk(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 Rk(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)))})})}
853
- function Sk(a,b,c,d){c=new olympe.dc.sources.cache.hm(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function Vk(a,b){return w(function*(){return a.db.remove('buckets',b).then(()=>{})})}function al(a){return w(function*(){return(yield a.db.F('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.Bh.Ob(c);const d=c.D;let e;const f=null!=(e=b.get(d))?e:[];f.push(Fk(c.j));b.set(d,f);return b},new Map)})}
854
- function bl(a,b){return w(function*(){return a.db.remove('pending-transactions',b.T()).then(()=>{})})}function Yk(a,b){return w(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.hm.Ob(c)})}function dl(a){return w(function*(){return a.db.F('pending-transactions')})}
855
- function fl(a,b){return w(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.Bh.Ob(d);e&&c.set(e.j.i,d)}yield a.db.ba()})}function hl(a){return w(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
856
- function jl(a,b){return w(function*(){const c=b.sb();a.G.debug(`Offline DB: Executing query ${b.T()} by ID with source ${c}`);const d=olympe.dc.query.zd.gj(b);var e=(yield a.db.J(b.T())).map(f=>olympe.dc.sources.cache.Eg.Ob(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.ak.bc(f);const g=ml(f.Gd);d.create(f.tag,e,g);for(const h of f.ob)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.hc.Yc&&!0===e||d.Oa(k,e?n:f.tag,e?f.tag:n)}}a.G.j()&&
857
- a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.kc().Ab.size,'instances',Array.from(d.kc().Dd()).length,'relations');return d})}function kl(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.Bh(c,b,Date.now())).toJSON())}function nl(a){return w(function*(){return a.db.N('pending-transactions')})}function ll(a,b){return w(function*(){b.forEach(c=>a.files.delete(c));yield a.db.$()})}
858
- function ml(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,Fk(d)),new Map)}
859
- olympe.dc.sources.cache.ak=class{constructor(a,b,c){this.J=`Olympe_Cache_${a}`;this.G=b;this.N=new olympe.dc.sources.cache.qp;this.db=c.D(this.J);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.dj(()=>{const d=this;return w(function*(){if(!(0===d.D.size||0<(yield nl(d))))if(0<d.db.Y())d.F().then(()=>{}),d.G.debug('Offline DB GC: Postponing round while the stack is busy');
860
- 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 bc(a){const b=new RegExp(`^(${olympe.dc.hc.Yc})>([a-z0-9]*)$`);for(const c of a.ob)if(a=c.match(b))return a[2];return null}executeQuery(a){const b=this;return w(function*(){const c=Date.now();b.G.debug(`Offline DB: Executing query ${a.T()} with source ${a.sb()}`);const d=olympe.dc.query.zd.gj(a),e=a.sb();var f=
861
- yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Eg.Ob(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.ak.bc(g),ml(g.Gd));for(const p of Ph(a))if(p instanceof olympe.dc.query.oa.Gh){var k=p.relation;g=k.Ja()===olympe.dc.va.ORIGIN;const q=k.X(),r=k.ac();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 u of t){const x=new Map;var l=yield Promise.all(Array.from(u).map(y=>{if(!h.has(y))return b.G.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
862
- Promise.resolve([]);r.X();return b.db.J().then(z=>z.map(A=>olympe.dc.sources.cache.Eg.Ob(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.oa.ue&&p.F&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.oa.ue&&!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.ak.bc(A),d.create(l,n,ml(A.Gd)));q===olympe.dc.hc.Yc&&!0===g||d.Oa(q,g?l:y,g?y:l)}}}}else p instanceof
863
- olympe.dc.query.oa.Jd&&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.kc().Ab.size,'instances',Array.from(d.kc().Dd()).length,'relations'),b.G.debug(`Offline DB: Data result for query ${a.T()} took ${Date.now()-c}ms to be executed`));return d})}};
864
- olympe.dc.sources.cache.lq=class{constructor(a,b){this.name=a;this.j=b}static Ob(a){return a?new olympe.dc.sources.cache.lq(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.j}}};
865
- olympe.dc.sources.cache.Eg=class{constructor(a,b,c,d,e){this.tag=a;this.source=b;this.Gd=null!=c?c:{};this.ob=null!=d?d:[];this.j=null!=e?e:[]}static Ob(a){return a?new olympe.dc.sources.cache.Eg(a.tag,a.source,a.props,a.relations,a.queryIds):null}toJSON(){return{tag:this.tag,source:this.source,props:this.Gd,relations:this.ob,queryIds:this.j}}};
866
- olympe.dc.sources.cache.Bh=class{constructor(a,b,c){this.D=a;this.j=b;this.timestamp=c}static Ob(a){return a?new olympe.dc.sources.cache.Bh(a.destination,a.patch,a.timestamp):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp}}};
867
- olympe.dc.sources.cache.bv=class extends olympe.dc.sources.cache.Bh{constructor(a,b,c,d){super(a,b,c);this.error=d}static Ob(a){return a?new olympe.dc.sources.cache.bv(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp,error:this.error}}};
868
- olympe.dc.sources.cache.hm=class{constructor(a,b,c){this.tag=a;this.content=b;this.j=c}static Ob(a){return a?new olympe.dc.sources.cache.hm(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.j}}};function ol(a,b){let c=a.N.get(b);c||(c=new Set(a.j.get(b).ob),a.N.set(b,c));return c}
869
- olympe.dc.sources.cache.Rt=class{constructor(a,b){this.G=a;this.F=b;this.j=new Map;this.R=new Set;this.Y=new Set;this.J=new olympe.dc.sources.cache.qp;this.N=new Map}dd(){this.R.forEach(a=>this.j.delete(a));Array.from(this.j.entries()).forEach(([a,b])=>{b||this.j.delete(a)});return this.j}Pc(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.J.ga(k[1]);return h},null!=(e=null==d?void 0:d.Gd)?e:{});let f;e=null!=(f=null==d?void 0:d.j)?f:[];null===
870
- this.F||e.includes(this.F)||e.push(this.F);let g;b=new olympe.dc.sources.cache.Eg(a,b,c,null!=(g=null==d?void 0:d.ob)?g:[],e);this.j.set(a,b)}Wc(a,b){const c=this.j.get(a);if(c){var d;c.Gd=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.J.ga(g);return e},null!=(d=c.Gd)?d:{})}else this.G.warn(`Trying to update an instance (${a}) which do not exists in the cache database: ignoring.`)}D(a){this.R.add(a)}Oa(a,b,c){var d;const e=null!=(d=this.j.get(b))?d:new olympe.dc.sources.cache.Eg(b,
871
- 'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Eg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.va.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=ol(this,g.tag);k.has(h)||(g.ob.push(h),k.add(h));null===this.F||g.j.includes(this.F)||g.j.push(this.F)};f(e,`${a}${olympe.dc.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=ol(this,f.tag);if(h.has(g)){const k=
872
- f.ob.indexOf(g);f.ob.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.Rt.xa=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.ni=class a{constructor(b,c){this.id=null!=b?b:olympe.V.Ic();this.D=new olympe.C.Xb('BurstTransaction#'+this.id,c);this.Bb=pl(this);this.R=!1;this.D.onDestroy(()=>this.N());this.Y=new Set;this.F=new Map;this.J=new Set;this.j=null;let d;this.$a=null!=(d=olympe.W.getParameter(olympe.dc.transaction.U.Sn))?d:30;this.fa=[]}static j(b,c){return`${b},${c}`}Eb(b){for(const c of this.fa)c(b);this.stop()}Ga(){null!==this.j&&(clearTimeout(this.j),this.j=null);const b=this.ba(this.J);0<b.size&&ql(this,
873
- b,!1);this.J.clear()}ba(b){const c=new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.F.get(d))});return c}$(b,c,d){this.ua(b,c,d);this.Bb(b,c,d);null===this.j&&(this.j=setTimeout(this.Ga.bind(this),this.$a))}ua(b,c,d){b=a.j(b,c);this.F.set(b,d);this.J.add(b)}fb(b,c){return this.F.get(a.j(b,c))}push(b,c){const d=olympe.dc.ha(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ha(f),this.fb(d,e)!==g&&this.$(d,e,g.valueOf())});this.Y.add(b)}complete(){return new Promise((b,
874
- 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.ha(b),f=olympe.dc.ha(c);void 0===e||void 0===f?olympe.ja.ab('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.pn([d],g=>{this.R=!0;if(g instanceof olympe.dc.vc)olympe.ja.ab('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.Y(()=>{this.N()}))}stop(){this.D.destroy();
875
- this.fa.length=0}getContext(){return this.D}T(){return this.id}gh(){return!1}N(b){if(this.R){this.R=!1;null!==this.j&&(clearTimeout(this.j),this.j=null);this.J.clear();const c=this.ba(new Set(this.F.keys()));ql(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.ni.prototype.complete=olympe.dc.ni.prototype.complete;olympe.dc.ni.prototype.push=olympe.dc.ni.prototype.push;olympe.dc.Mc=class{j(){}toString(){}};olympe.dc.Mc.j=1;olympe.dc.Mc.D=2;olympe.dc.Mc.J=3;olympe.dc.Mc.F=4;olympe.dc.Mc.N=5;olympe.dc.transaction.Ni=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ka.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.ce.Pe+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,
876
- e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.C.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.vc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}j(b,c){return this.D(b,new olympe.dc.db.fc(c))}D(b,c){for(const d of b)switch(d.o){case olympe.dc.Mc.j:b=a.j(d.p||{});let e;c.Pc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case olympe.dc.Mc.D:c.Wc(d.t,
877
- a.j(d.p),d.m);break;case olympe.dc.Mc.J:c.D(d.t,d.f,d.m);break;case olympe.dc.Mc.F:c.Oa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Mc.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 rl(a,b){let c;return null!=(c=a.sources.get(b))?c:a.J.Ie(b)}function sl(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.j.Rc(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.ef(b)||!a.db.Ha(b)}function tl(a,b){0===a.F.size?a.F=b:b.forEach((c,d)=>a.F.set(d,c))}function ul(a){return Array.from(a.j.dd()).filter(b=>!b.Ed()).map(b=>b.tag())}
878
- function vl(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ka.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.fc(a.id),a.D.set(b,c)),d(c))}function wl(a,b,c){const d=rl(a,b),e=Z(a,b),f=sl(a,b);vl(a,d,e,g=>{g.D(b,c,f)})}
879
- olympe.dc.transaction.mv=class{constructor(a,b,c){this.id=null!=c?c:olympe.V.Ic();this.J=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}cf(){return 0===this.j.Ab.size}Pc(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.J.fromModel(b);c=Z(this,a);this.sources.set(a,f);vl(this,f,c,g=>{g.Pc(a,f,d,b)})}Wc(a,b){const c=rl(this,a),d=Z(this,a),e=sl(this,a);vl(this,c,d,f=>{f.Wc(a,null!=b?b:new Map,e)})}Oa(a,b,c){const d=rl(this,b),e=
880
- rl(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ka.SELF&&e!==olympe.dc.Ka.SELF;f&&d!==e&&a!==olympe.dc.hc.Yc&&(f=g=>{let h;return null!=(h=olympe.dc.ia().name(g))?h:g},olympe.ja.ab('dc').warn(`Try to create a relation between 2 objects that have different locations: \n ${f(b)} (${b})-[${f(a)} (${a})]->${f(c)} (${c}), originSrc: ${f(d)} (${d}), destinationSrc: ${f(e)} (${e})`),f=!1);vl(this,d,f,g=>{g.Oa(a,b,c,sl(this,b),sl(this,c))})}ic(a,b,c){const d=rl(this,b),e=rl(this,c);let f=Z(this,b)&&
881
- Z(this,c)&&d!==olympe.dc.Ka.SELF&&e!==olympe.dc.Ka.SELF;f&&d!==e&&a!==olympe.dc.hc.Yc&&(olympe.ja.ab('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);vl(this,d,f,g=>{g.ic(a,b,c,sl(this,b),sl(this,c))})}};function xl(a,b,c){const d=Object.create(null);if(!b)return d;for(const f of Array.from(b.keys()).sort()){let g=f;var e=b.get(f);if(g===olympe.dc.Cp.br)if(e===olympe.dc.Ka.SELF)d[g]=olympe.dc.ia().T();else{if(e===olympe.dc.Ka.SERVER)continue}else g.startsWith(olympe.dc.ce.Pe)&&(g='fd'+g.substring(1));e=a.R(e);c&&e instanceof Object&&8===e.c?a.N.set(g,e):d[g]=e}return d}function yl(a){if(0===a.N.size)return null;const b=Object.create(null);a.N.forEach((c,d)=>{b[d]=c});a.N.clear();return b}
882
- class zl{constructor(){this.N=new Map}R(a){return a instanceof olympe.C.Sa||a instanceof olympe.C.ea||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.ah().valueOf(),g:a.Yg().valueOf(),b:a.Vg().valueOf(),a:a.Ug().valueOf()}:a&&'function'===
883
- typeof a.X?{c:8,t:a.X()}:a}}function Bf(a){const b=a.J.concat(a.F).concat(a.N).concat(a.j).concat(a.R);a.N=[];a.F=[];a.j=[];a.R=[];a.J=[];return b}
884
- olympe.dc.transaction.Ae=class{constructor({Yk:a=!1,Sh:b=!0,ge:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.J=[];this.Yk=null!=a?a:!1;this.ge=null!=c?c:!0;this.Sh=null!=b?b:!0;this.Y=olympe.C?new zl:new class extends zl{R(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(Bf(this))}Pc(a,b,c,d=null){c=xl(this.Y,null!=c?c:null,this.Yk);c={o:olympe.dc.Mc.j,t:a,p:c};this.Sh&&(c.s=b);this.ge&&d&&(c.m=d);this.N.push(c);this.Yk&&(b=yl(this.Y))&&this.j.push({o:olympe.dc.Mc.D,
885
- t:a,p:b})}Wc(a,b,c=null){b=xl(this.Y,b||null,!1);a={o:olympe.dc.Mc.D,t:a,p:b};this.ge&&c&&(a.m=c);this.j.push(a)}D(a,b,c=null){a={o:olympe.dc.Mc.J,t:a,f:b};this.ge&&c&&(a.m=c);this.F.push(a)}Oa(a,b,c,d=null,e=null){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);a={o:olympe.dc.Mc.F,m:a,l:b,r:c};this.ge&&d&&(a.lm=d);this.ge&&
886
- 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.Mc.N,m:a,l:b,r:c};this.ge&&d&&(a.lm=d);this.ge&&e&&(a.rm=e);this.J.push(a)}};olympe.dc.transaction.Ae.xa=[olympe.dc.Writable];function Al(a){var b=new olympe.dc.Wa;b.Y=a;return b}function Bl(a,b){b instanceof olympe.dc.Wa&&b.D.forEach((c,d)=>a.D.set(d,c));a.Fa.push(b);return b}
887
- function Cl(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Y(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Y(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();Bl(a,new olympe.dc.transaction.Fa.Do(e,b));Bl(a,new olympe.dc.transaction.Fa.vl(e,b,d));return c}
888
- function Dl(a,b){if(a.J)throw Error('Operation not permitted: this transaction has already been executed');a.J=!0;const c=[d=>{a.J=d},...a.$,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
889
- olympe.dc.Wa=class{constructor(a){this.id=null!=a?a:olympe.V.Ic();this.Fa=[];this.F=new Map;this.Y=!0;this.D=new Map;this.$=[];this.J=this.N=!1;this.R=[...olympe.dc.nj().Y]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.ha(a)))?b:olympe.dc.ia().model(a)}j(a){tl(a,this.D);for(const b of this.Fa)b.j(a);try{this.R.forEach(b=>b(a))}catch(b){throw Error(`Transaction compilation error: ${b.message}`);}}create(a,b){b=Bl(this,new olympe.dc.transaction.Fa.qo(a,b));const c=b.X();this.F.set(c,
890
- olympe.dc.ha(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.ha(a);var d=olympe.dc.ia();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.$d().fromModel(b);Bl(this,new olympe.dc.transaction.Fa.nv(c,d))}else{if((e=d.Ha(c))&&d.ef(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
891
- if(!e&&!this.F.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Lb.Cc){Bl(this,new olympe.dc.transaction.Fa.Eo(a,b))}update(a,b,c){return Bl(this,new olympe.dc.transaction.Fa.nw(a,b,c))}Oa(a,b,c){Bl(this,new olympe.dc.transaction.Fa.vl(a,b,c))}ic(a,b,c){Bl(this,new olympe.dc.transaction.Fa.zt(a,b,c))}Um(a,b){Bl(this,new olympe.dc.transaction.Fa.Do(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
892
- f);Y(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.ce.Pe+d.X(),e);this.Oa(olympe.dc.CloudObject.propertyRel,a,d);this.Oa(olympe.dm.Property.typeRel,d,b);this.Oa(olympe.dc.CloudObject.containsRel,a,d);return d}Qr(a,b,c='',{XD:d=olympe.dm.Relation.J.Yu,iE:e=olympe.dm.Relation.j.wv,dE:f=olympe.dm.Relation.j.Ws,GE:g=olympe.dm.Relation.j.sp,UD:h=olympe.dm.el.NONE,FE:k=olympe.dm.Relation.N|h}={},l=olympe.V.Ic()){c=Y(Y(Y(Y(Y(Y(Y(Y(Y(Y(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
893
- c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.ba,e),olympe.dm.Relation.ua,e),olympe.dm.Relation.$,e),olympe.dm.Relation.Y,f),olympe.dm.Relation.fa,g),olympe.dm.Relation.Ga,olympe.dm.Relation.j.sp),olympe.dm.Relation.R,h);this.Oa(olympe.dc.CloudObject.rj,a,c);this.Oa(olympe.dm.Relation.destinationModelRel,c,b);this.Oa(olympe.dc.CloudObject.containsRel,a,c);return c}gh(){return!1}Mm(a){this.$.push(olympe.C.Xa().F(a))}nb(a,b){El(olympe.dc.nj(),this,Dl(this,a),b)}Vm(a){a=Dl(this,
894
- a);Fl(olympe.dc.nj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Wa.xa=[olympe.dc.Mc];function pl(a){var b=olympe.dc.nj();const c=a.T();b.J.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.fc(c);g.Wc(d,(new Map).set(e,f),b.db.model(d));b.j.Tc(rf(g,Infinity))}}
895
- function ql(a,b,c,d){var e=olympe.dc.nj();const f=olympe.dc.Request.j.mi,g=olympe.dc.Request.j.kh,h=a.T();a=a.gh();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ka.SELF||!e.db.ef(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.fc(h),k.set(n,p));p.Wc(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.Vi(n,a)),b=e.Wb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.j.Tc(rf(n,p));null==d||d(!0)})}
896
- function El(a,b,c,d){if(d){const e=b.T();a.D.set(e,c);Fl(a,b,(f,g)=>{f||(a.D.delete(e),c(f,g))},!1)}else Fl(a,b,c,!1)}function Gl(a){const b=olympe.dc.Request.j.Qj;zf(a.Wb,olympe.dc.Request.j.Tn,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.T(),f=a.J.get(e);void 0!==f&&(a.J.delete(e),f.Eb(d));a.j.Tc(c);a.G.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});zf(a.Wb,b,c=>{c=c.content;Hl(a,c.id,c.finalize,c.error)})}
897
- function Il(a,b,c){if(!c)throw Error('Transaction compiler id is required');a.fa.has(c)||a.Y.push(b);return a}
898
- function Fl(a,b,c,d=!1){const e=b.T(),f=new olympe.dc.transaction.mv(a.db,a.ba,e);try{b.j(f)}catch(p){if(p instanceof olympe.dc.cq){p.j.then(()=>Fl(a,b,c,d));return}c(!1,p.message);return}if(f.cf()){c(!0);var g;null==(g=a.D.get(e))||g(!0);a.D.delete(e)}else{a.F.set(e,[]);var h=ul(f);a.j.j.Ga(h);g=h.filter(p=>Z(f,p));var k=wg(a.j,f.j,g),l=olympe.C.Xa().F((p,q)=>c(null!==p,q)),n=[k,l];Jl(a,f,g).then(p=>{n.splice(1,0,p);Kl(a,e,h,f.D.size+1);return Ll(a,f.D,d,b.gh(),b.N)}).then(p=>{n.forEach(q=>q(p));
899
- Hl(a,e,olympe.dc.transaction.Af.j.Ii)}).catch(p=>{a.G.error(p);n.forEach(q=>q(null,`${p}`));Ml(a,e)})}}
900
- function Jl(a,b,c){const d=b.j,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.Qb(n,olympe.dm.File)&&void 0!==(null==(p=d.Rc(n))?void 0:p.Qa(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.Ze();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),
901
- r();else{var u=n.X(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.ua.fa(u,q,y,z=>{const A=h.reduce((K,X)=>K||X.Rc(u),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.Lm(z),k.push([u,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.Wc(q,r);return p},
902
- new olympe.dc.db.fc);return wg(a.j,n)})}function Kl(a,b,c,d){const e=olympe.C.Xg(),f=new olympe.async.fk(e);0<a.N&&f.Cn(a.N);const g=olympe.dc.transaction.Af.j.Uu;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.F((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});bd(f,(l,n)=>{l||a.G.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.j.j.Ub(c);Ml(a,b)});f.start()}
903
- function Ll(a,b,c,d,e){if(c&&olympe.C.Pa(a.$.D)!==olympe.auth.Ta.j.gf)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.j.Rg:olympe.dc.Request.j.We;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.Vi(h,d,e));return a.Wb.request(g)})).then(g=>g[0])}
904
- function Hl(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 Ml(a,b){var c;null==(c=a.F.get(b))||c.forEach(d=>{d(olympe.dc.transaction.Af.j.Ii,null)});a.F.delete(b);if(0===a.F.size){for(const d of a.R)d();a.R=[]}a.D.has(b)&&(c=a.D.get(b),a.D.delete(b),c(!0))}
905
- olympe.dc.transaction.Af=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Wb=c;this.ba=d;this.ua=e;this.$=f;this.N=g.get('notificationTimeout');this.Y=[];let h;this.fa=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.J=new olympe.V.Jh(g.get('burstHoldTime'));this.F=new Map;this.R=[];this.D=new Map;this.Ga=new olympe.V.promise.wm;Gl(this)}le(a){qb(this.Ga,()=>this.Wb.request(new olympe.dc.Request(olympe.dc.Request.j.ap,olympe.dc.Ka.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
906
- b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.Af.j={Zl:0,Ii:1,Uu:2};olympe.dc.transaction.Vi=class{constructor(a,b=!1,c=!1){this.D=a;this.F=b;this.j=c}gh(){return this.F}kc(){return this.D}};olympe.dc.transaction.P={Ca:'dc.transaction.Logger',Da:'dc.transaction.Manager'};olympe.dc.transaction.U={Vp:'dc.transaction.timeout',Sn:'dc.transaction.burstInterval',Cl:'dc.transaction.disabledCompilers'};
907
- olympe.W.config(function(a){F(a,olympe.dc.transaction.U.Vp,9E4);F(a,olympe.dc.transaction.U.Sn,30);F(a,olympe.dc.transaction.U.Cl,[]);E(a,olympe.dc.transaction.P.Ca,[olympe.ja.P.Da],b=>b.cd('dc'));E(a,'olympe.dc.transaction.Config',[new olympe.W.pa(olympe.dc.transaction.U.Vp),new olympe.W.pa(olympe.dc.transaction.U.Cl),new olympe.W.pa(olympe.dc.db.U.rl)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));D(a,olympe.dc.transaction.P.Da,olympe.dc.transaction.Af,
908
- olympe.dc.transaction.P.Ca,olympe.dc.db.P.Da,olympe.dc.P.Jg,olympe.dc.sources.P.Te,olympe.dc.P.Oj,olympe.auth.P.Da,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Fa={};function Nl(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Pa(e));return c}olympe.dc.transaction.Fa.pg=class{constructor(){this.ia=olympe.dc.ia()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Pa(a){a=olympe.C.Pa(a);return void 0===a||null===a?null:olympe.C.qs(a)?a.valueOf():a}};olympe.dc.transaction.Fa.pg.xa=[olympe.dc.Mc];olympe.dc.transaction.Fa.Ln=class extends olympe.dc.transaction.Fa.pg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Ra.Relation?a:new olympe.dc.Ra.Relation(olympe.dc.ha(a));this.origin=this.ia.Ha(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}Ja(){return this.relation.Ja()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Y(a,b,c){a.Gd.set(olympe.dc.ha(b),c);return a}olympe.dc.transaction.Fa.qo=class extends olympe.dc.transaction.Fa.pg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ha(b))?c:olympe.V.Hf();this.model=olympe.dc.ha(a);this.source=null;this.Gd=new Map}X(){return this.tag}bc(){return this.model}gi(a){this.source=a;return this}j(a){const b=this.bc(),c=this.X();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Pc(c,b,this.source,Nl(this,this.Gd))}toString(){return`CreateInstance(${this.bc()}, ${this.X()})`}};
909
- olympe.dc.transaction.Fa.qo.xa=[olympe.dc.Qe];olympe.dc.transaction.Fa.vl=class extends olympe.dc.transaction.Fa.Ln{constructor(a,b,c){super(a,b);this.D=this.ia.Ha(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.Yc)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');
910
- if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ja()===olympe.dc.va.DESTINATION?a.Oa(b,olympe.dc.ha(this.origin),olympe.dc.ha(this.D)):a.Oa(b,olympe.dc.ha(this.D),olympe.dc.ha(this.origin))}toString(){return`CreateRelation('${this.relation.Ja()}${this.relation.X()}, ${olympe.dc.ha(this.origin)}, ${olympe.dc.ha(this.D)})`}};olympe.dc.transaction.Fa.lA=class extends olympe.dc.transaction.Fa.pg{constructor(a,b=olympe.dc.Lb.Cc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Nb=b}j(a){for(const b of this.ia.dd(this.model))b!==olympe.dc.ha(this.model)&&(new olympe.dc.transaction.Fa.Eo(b,this.Nb)).j(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.Nb})`}};olympe.dc.transaction.Fa.Do=class extends olympe.dc.transaction.Fa.Ln{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.hc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ha(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.Ja(),e=this.ia.bb(c,this.relation);for(const f of e)d===olympe.dc.va.DESTINATION?
911
- a.ic(b,c,f):a.ic(b,f,c)}toString(){return`DeleteAllRelations(${this.Ja()}${this.getType()})`}};olympe.dc.transaction.Fa.Eo=class extends olympe.dc.transaction.Fa.pg{constructor(a,b=olympe.dc.Lb.Cc){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Nb=b}X(){return olympe.dc.ha(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ia.Ha(b)&&wl(a,b,this.Nb)}toString(){return'DeleteInstance('+this.X()+', '+this.Nb+')'}};olympe.dc.transaction.Fa.zt=class extends olympe.dc.transaction.Fa.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.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ha(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.ha(this.D);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
912
- this.relation.Ja()===olympe.dc.va.DESTINATION?a.ic(b,c,d):a.ic(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ja()+this.relation.X()+', '+olympe.dc.ha(this.origin)+', '+olympe.dc.ha(this.D)+')'}};olympe.dc.transaction.Fa.nw=class extends olympe.dc.transaction.Fa.pg{constructor(a,b,c){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Gd=new Map;void 0!==b&&this.Gd.set(olympe.dc.ha(b),c)}X(){return olympe.dc.ha(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.Rc(b))&&c.D()||this.ia.Ha(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=Nl(this,this.Gd);
913
- for(const [e,f]of c){var d=this.ia.Qa(b,e,!0);d instanceof olympe.dc.vc&&wl(a,d.X(),olympe.dc.Lb.Cc);f instanceof olympe.dc.vc&&!Z(a,f.X())&&(d=new olympe.dc.Wa,d.persist(f.X()),d.j(a))}a.Wc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+Nl(this,this.Gd)+')'}};olympe.dc.transaction.Fa.nv=class a extends olympe.dc.transaction.Fa.pg{constructor(b,c){super();this.tag=b;this.source=c}j(b){const c=olympe.dc.ia();if(Z(b,this.tag)&&c.Ha(this.tag)&&!c.ef(this.tag)){const e=c.Cb(this.tag,!0);var d;let f;null==(f=null==(d=b.j.Rc(this.tag))?void 0:d.Cb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.vc&&c.Ha(g.X())&&(new a(g.X(),this.source)).j(b);d=c.model(this.tag);b.Pc(this.tag,d,this.source,e);for(const [g,h,k]of $g(c,this.tag))Z(b,
914
- k)&&(h===olympe.dc.va.ORIGIN?b.Oa(g,k,this.tag):b.Oa(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.ha=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.Tg))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.na.bc(a))?d:''}else if(olympe.C.df(a)){let d;b=olympe.dc.ha(null==(d=olympe.C.Pa(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};B('olympe.dc.instanceToTag',olympe.dc.ha);olympe.dc.ia=function(){return olympe.dc.Yr().view};olympe.dc.register=function(a,b){olympe.dc.na.j(a,b)};
915
- olympe.dc.defineProperty=function(a){return new olympe.dc.Ra.Property(a)};olympe.dc.Qr=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.Ra.Relation(a,b):new olympe.dc.Ra.Relation(a,d,b,c)};olympe.dc.Uw=function(a){return a.ac()};olympe.dc.mb={};olympe.dc.mb.Sm=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.C.xb(a):a instanceof olympe.C.Sa?a:null;olympe.dc.mb.Pm=a=>'boolean'===typeof a||a instanceof Boolean?olympe.C.Rb(a):a instanceof olympe.C.ea?a:null;olympe.dc.mb.Rm=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;
916
- olympe.dc.mb.Qm=a=>'number'===typeof a||a instanceof Number?ic(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.mb.Kr=function(a){return a instanceof olympe.C.Color?a:'string'===typeof a||a instanceof String?mc(a.valueOf()):null};olympe.dc.mb.Lr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.vc?olympe.dc.CloudObject.get(a.tag):null;
917
- olympe.dc.mb.cj=a=>a instanceof olympe.dc.vc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.mb.Ac=a=>{a=a instanceof olympe.dc.vc?olympe.dc.CloudObject.get(a.tag):a;let b;return null!=(b=a instanceof olympe.dc.CloudObject?a.Ac():a)?b:null};
918
- olympe.dc.mb.qx=a=>{switch(a){case olympe.C.ea:return olympe.dc.mb.Pm;case olympe.C.Sa:return olympe.dc.mb.Sm;case olympe.C.aa:return olympe.dc.mb.Rm;case olympe.C.eb:return olympe.dc.mb.Qm;case olympe.C.Color:return olympe.dc.mb.Kr;case olympe.dc.CloudObject:return olympe.dc.mb.Lr;default:return olympe.dc.mb.cj}};olympe.dc.lc={};olympe.dc.mf=class{la(){}F(){}compare(){}J(){}ga(){}toString(){}};function Ol(a){let b=null;for(a=[...a.da];null===b&&0<a.length;)b=a.pop().Mb();return b}function Pl(a,b){a.R()||(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.ja.ab('dc').warn(a))}
919
- olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ja.ab('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.D=olympe.C.ta([a],olympe.dc.ha,String),this.da=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||Ol(this),this.j=null,this.zc=void 0)}ke(){return olympe.dc.ke()}nb(){if(null===this.j){const a=olympe.dc.lc.Px();this.j=Ql(a,this,this.zc);null!==this.valueType&&this.j.Ld(this.valueType);olympe.C.Xa().Y(()=>
920
- {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.nb();return this.j}Ld(a){this.valueType=a;null!==this.j&&this.j.Ld(this.valueType)}Mb(){return null!==this.j?this.j.Mb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Xd(){return this.D}Rl(){return this.da}hd(a,b){return this.nc().hd(a,b)}Vk(a){this.nc().Vk(a)}ku(){return this.nc().Kc()}ju(){return this.nc().R()}get(a){return this.nc().get(a)}ci(){return this.nc().ci()}ai(a){const b=
921
- this.nc();Pl(b,'getCurrent');return b.ai(a)}has(a){return this.nc().has(a)}eh(a){const b=this.nc();Pl(b,'hasCurrent');return b.eh(a)}je(a){return this.nc().je(a)}Ty(a){return this.je(a).asObservable()}af(a){const b=this.nc();Pl(b,'getCurrentAt');return b.af(a)}bf(a){return this.nc().bf(a)}Jf(a){const b=this.nc();Pl(b,'getCurrentKeyAt');return b.Jf(a)}Cd(a){return this.nc().Cd(a)}Yy(a){return this.Cd(a).asObservable()}Kf(a){const b=this.nc();Pl(b,'getCurrentRank');return b.Kf(a)}Gc(){return this.nc().Gc()}Uy(){return this.Gc().asObservable()}Lf(){return this.nc().Lf()}sf(){return this.nc().sf()}Zy(){return this.sf().asObservable()}jg(){const a=
922
- this.nc();Pl(a,'getCurrentSize');return a.jg()}forEach(a,b){this.nc().forEach(a,b)}ie(a){const b=this.nc();Pl(b,'forEachCurrentValue');return b.ie(a)}fj(a,b,c,d){a=new olympe.dc.da.xh(a,b);(new olympe.dc.za(this.D,[...this.da,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.da];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
923
- if(c instanceof olympe.dc.Ra.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.j)break;a.push(c)}b=new olympe.dc.za(this.D,a);b.zc=this.zc;b.Ld(Ol(b)||this.valueType||Object);return b}$k(a){return this.transform(new olympe.dc.da.Cf(a))}filter(a){return this.transform(new olympe.dc.da.pf(a))}Ck(){const a=new olympe.dc.Wj(this.D,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.zc&&(a.zc=this.zc);
924
- let b=this.da;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.da;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.C.Pa(this.D)+a+')'}iu(){return this.nc().Ag()}Uc(){return olympe.C.ta([this.sf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.af(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.C.xb(b+']')},olympe.C.Sa)}};olympe.dc.za.prototype.filter=olympe.dc.za.prototype.filter;olympe.dc.za.prototype.union=olympe.dc.za.prototype.$k;
925
- olympe.dc.za.prototype.transform=olympe.dc.za.prototype.transform;olympe.dc.za.prototype.forEachCurrentValue=olympe.dc.za.prototype.ie;olympe.dc.za.prototype.forEach=olympe.dc.za.prototype.forEach;olympe.dc.za.prototype.getCurrentSize=olympe.dc.za.prototype.jg;olympe.dc.za.prototype.observeSize=olympe.dc.za.prototype.Zy;olympe.dc.za.prototype.observeFirst=olympe.dc.za.prototype.Uy;olympe.dc.za.prototype.getCurrentRank=olympe.dc.za.prototype.Kf;olympe.dc.za.prototype.observeRank=olympe.dc.za.prototype.Yy;
926
- olympe.dc.za.prototype.getCurrentAt=olympe.dc.za.prototype.af;olympe.dc.za.prototype.observeAt=olympe.dc.za.prototype.Ty;olympe.dc.za.prototype.offReady=olympe.dc.za.prototype.Vk;olympe.dc.za.prototype.onReady=olympe.dc.za.prototype.hd;olympe.dc.za.prototype.getBaseTag=olympe.dc.za.prototype.Xd;olympe.dc.za.xa=[olympe.C.qd];m=olympe.dc.za.prototype;m.ke.K=olympe.C.H.j;m.nb.K=olympe.C.H.J();m.nc.K=new olympe.C.H(()=>olympe.dc.lc.Subscription,[]);m.Ld.K=new olympe.C.H(()=>{},[]);
927
- m.Xd.K=new olympe.C.H(()=>String,[]);m.Rl.K=new olympe.C.H(()=>Array,[]);m.hd.K=new olympe.C.H(()=>String,[]);m.Vk.K=new olympe.C.H(()=>{},[]);m.ku.K=olympe.C.H.N;m.ju.K=olympe.C.H.j;m.get.K=new olympe.C.H(()=>olympe.dc.CloudObject,[],'valueType');m.ci.K=new olympe.C.H(()=>Array,[]);m.ai.K=olympe.C.H.j;m.has.K=olympe.C.H.N;m.eh.K=olympe.C.H.j;m.je.K=new olympe.C.H(()=>olympe.dc.CloudObject,[],'valueType');m.af.K=olympe.C.H.j;m.bf.K=new olympe.C.H(()=>String,[]);m.Jf.K=olympe.C.H.j;m.Cd.K=olympe.C.H.F;
928
- m.Kf.K=olympe.C.H.j;m.Gc.K=new olympe.C.H(()=>olympe.dc.CloudObject,[],'valueType');m.Lf.K=new olympe.C.H(()=>String,[]);m.sf.K=olympe.C.H.F;m.jg.K=olympe.C.H.j;m.forEach.K=new olympe.C.H(()=>{},[]);m.ie.K=olympe.C.H.j;m.fj.K=new olympe.C.H(()=>{},[]);m.transform.K=new olympe.C.H(()=>olympe.dc.za,[]);m.$k.K=new olympe.C.H(()=>olympe.dc.za,[]);m.filter.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Ck.K=new olympe.C.H(()=>olympe.dc.Wj,[]);m.toString.K=olympe.C.H.j;m.iu.K=olympe.C.H.j;m.Uc.K=olympe.C.H.D;const Rl={Ez:'append',Gl:'filter_not',Qo:'filter_and',Ro:'filter_or'};function Sl(a,b){a=Tl(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.Za.Mn(a,b)).D}
929
- olympe.dc.Wj=class{constructor(a,b){this.j=Tl(a);this.G=olympe.ja.ab('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.da=[];this.Fa=[];this.zc=void 0}Fi(){const a=new olympe.dc.za(this.j,this.da,this.valueType);'boolean'===typeof this.zc&&(a.zc=this.zc);return a}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Ul('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Ra.Property)throw new Ul('transform','Properties cannot be used as transformer, unlike relations '+
930
- d);if(!d||'function'!==typeof d.j)throw new Ul('transform','one of the argument is not a Transformer '+d);const e=d.Mb();null!==e&&(this.valueType=e);this.da.push(d)}return this}$k(a){this.da.push(new olympe.dc.da.Cf(a));return this}Cz(a){this.da.push(new olympe.dc.da.Cf(Tl(a)));return this}mu(a){this.valueType=a;return this}gb(a){this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}kx(a){for(const b of a)this.da.push(b),this.valueType=b.Mb()||olympe.dc.CloudObject;return this}jx(a,
931
- b,c){a=new olympe.dc.da.De(a,a.Ja(),b,c);this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}ix(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.Ja())}a=new olympe.dc.da.Xj(b,c);this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}lu(){this.gb(olympe.dc.CloudObject.instancesRel);return this}Ye(a){var b=this.Fa.pop();b===Rl.Gl&&(a=new olympe.dc.Z.ee(a),b=this.Fa.pop());switch(b){case Rl.Qo:b=this.da.pop().D;b instanceof
932
- olympe.dc.Z.Id?(b=b.Z,b.push(a),a=new olympe.dc.Z.Id(...b)):a=new olympe.dc.Z.Id(b,a);b=this.Fa.pop();break;case Rl.Ro:b=this.da.pop().D,b instanceof olympe.dc.Z.ze?(b=b.Z,b.push(a),a=new olympe.dc.Z.ze(...b)):a=new olympe.dc.Z.ze(b,a),b=this.Fa.pop()}b===Rl.Gl&&(a=new olympe.dc.Z.ee(a),this.Fa.pop());this.da.push(new olympe.dc.da.pf(a));return this}bx(a,b,c){return this.Ye(new olympe.dc.Z.te(Sl(a,c),new olympe.dc.Za.Oe(b)))}contains(a,b,c=!1,d){return this.Ye(new olympe.dc.Z.nf(Sl(a,d),new olympe.dc.Za.Oe(b),
933
- c))}Qb(a){if(!(a instanceof Array))throw new Ul('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(Tl(a[c]));return this.Ye(new olympe.dc.Z.Ci(b))}Qk(a){return this.Ye(new olympe.dc.Z.te(new olympe.dc.Za.Ui,new olympe.dc.Za.Oe(Tl(a))))}ex(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.ud().Qk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().ud().Qk(a[b])}return this}ty(a,b){if(!(a instanceof
934
- Array))throw new Ul('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Ja())});return this.Ye(new olympe.dc.Z.zi(c,d,b))}Ok(a,b,c){a=Sl(a,c);return this.Ye(new olympe.dc.Z.Sj(a,new olympe.dc.Za.Oe(b)))}vj(a,b,c){a=Sl(a,c);return this.Ye(new olympe.dc.Z.tk(a,new olympe.dc.Za.Oe(b)))}Ly(a,b,c,d){a=Sl(a,d);return this.Ye(new olympe.dc.Z.zf(a,b,c))}filter(a){const b=new class extends olympe.dc.Z.og{j(c,d){return a(olympe.dc.CloudObject.get(d))}};
935
- return this.Ye(b)}ud(){this.Fa.push(Rl.Gl);return this}and(){this.da[this.da.length-1]instanceof olympe.dc.da.pf&&this.Fa.push(Rl.Qo);return this}or(){this.da[this.da.length-1]instanceof olympe.dc.da.pf&&this.Fa.push(Rl.Ro);return this}Zk(a,b,c){a=Tl(a);let d=null;switch(olympe.dc.ia().Jb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.X():d=new olympe.dc.wc.String(new olympe.dc.Za.Si(a,c));break;case olympe.dm.Number.O.X():d=new olympe.dc.wc.Number(new olympe.dc.Za.Ki(a,c));break;case olympe.dm.DateTime.O.X():d=
936
- new olympe.dc.wc.DateTime(new olympe.dc.Za.ri(a,c))}c=d;null!==c&&this.da.push(new olympe.dc.da.Pg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.wc.og{F(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.da.push(new olympe.dc.da.Pg(d,c));return this}Yw(){this.da.push(new olympe.dc.da.si);return this}pj(a,b){this.da.push(new olympe.dc.da.xh(a,b));return this}};class Ul extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
937
- function Tl(a){return'string'===typeof a||a instanceof olympe.C.Sa?a:'function'===typeof a?olympe.dc.na.bc(a):olympe.C.ib(a)?a.Oh===olympe.C.Sa?a:olympe.C.ta([a],b=>olympe.C.xb(olympe.dc.ha(b)),olympe.C.Sa):a.X()}m=olympe.dc.Wj.prototype;m.Fi.K=new olympe.C.H(()=>olympe.dc.za,[]);m.transform.K=olympe.C.H.J();m.$k.K=olympe.C.H.J();m.Cz.K=olympe.C.H.J();m.mu.K=olympe.C.H.J();m.gb.K=olympe.C.H.J();m.kx.K=olympe.C.H.J();m.jx.K=olympe.C.H.J();m.ix.K=olympe.C.H.J();m.lu.K=olympe.C.H.J();m.Ye.K=olympe.C.H.J();
938
- m.bx.K=olympe.C.H.J();m.contains.K=olympe.C.H.J();m.Qb.K=olympe.C.H.J();m.Qk.K=olympe.C.H.J();m.ex.K=olympe.C.H.J();m.ty.K=olympe.C.H.J();m.Ok.K=olympe.C.H.J();m.vj.K=olympe.C.H.J();m.Ly.K=olympe.C.H.J();m.filter.K=olympe.C.H.J();m.ud.K=olympe.C.H.J();m.and.K=olympe.C.H.J();m.or.K=olympe.C.H.J();m.Zk.K=olympe.C.H.J();m.sort.K=olympe.C.H.J();m.Yw.K=olympe.C.H.J();m.pj.K=olympe.C.H.J();function Ql(a,b,c){const d=b.Xd();var e=new olympe.dc.query.lv;let f;f=d;olympe.C.ib(f)&&(f=e.add(d));b=(b=b.Rl())?Array.isArray(b)?b:[b]:null;e=olympe.dc.lc.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.lc.Subscription(e,d,b,a.F));k.getContext().run(()=>a.process(k,c));return k}
939
- function Vl(a,b){if(b.R())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.mc.jr(a.db,a.G),d=b.T();olympe.C.Sc([b.Xd()],e=>{const f=olympe.dc.ha(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.Wh()||b.Pk();sf(a.db,f,Wl(a,b,c),d);olympe.C.Xa().Y(()=>qf(a.db,f,d));a.db.Ha(f.valueOf())||Xl(c);b.R()||(Xl(c),b.rc([]))})}}
940
- function Yl(a,b,c,d,e){const f=[b.Xd()],g=l=>l instanceof olympe.dc.da.Cf;let h;const k=(null!=(h=b.bh())?h:[]).filter(g);for(const l of k){f.push(l.Xd());let n;k.push(...(null!=(n=l.bh())?n:[]).filter(g))}olympe.C.Sc(f,()=>{const l=b.Vd(c);Zl(a,l,b.T(),d,e)})}
941
- function Zl(a,b,c,d,e){a.G.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.C.Xa(),g=new olympe.async.fk(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;hi(a.J,h,f,olympe.dc.Ka.SELF,olympe.dc.ma.oc.lf,{zc: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}`))))})});bd(g,(h,k)=>d(k));g.start()}
942
- function Wl(a,b,c){const d=new olympe.dc.mc.Cj;let e=!1;const f=olympe.C.Xa(),g=b.bh(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.td()||f.hb()||(k?b.eh(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.$c(n,l)):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Removing Instance',l,'from the subscription'),b.Yh(n)),e||($l(c,()=>{p.eg();Xl(c)}),f.run(()=>p.ke().mg(b.rc.bind(b))),
943
- e=!0),am(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].j(f,c,h[k+1]);return(k,l)=>{const n=b.T();c.register(n,null);const p=d.j(k,l,n,null);if(null!==p)h[0](k,l,n,bm(p,k,l,n))}}
944
- olympe.dc.lc.Ku=class{constructor(a,b,c,d,e,f){this.G=a;this.db=b;this.D=f||e;this.J=d;this.j=new Map;this.F=new olympe.C.Xb('Legacy ListDef processor')}process(a,b){const c=a.T();var d=this.j.get(c);d||(d=new olympe.dc.lc.Uv(a),this.j.set(c,d));d.counter++;cm(d)?this.G.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.G.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.Gf(),b||this.D&&d===olympe.dc.Ka.SERVER||d===olympe.dc.Ka.SELF?(this.G.debug('QueryMGR: [ID:',c,'] - Local subscription, no need for coverage check, booting subscription '),
945
- Vl(this,a)):Yl(this,a,d,e=>{e?this.G.error(e):Vl(this,a)},b))}};function dm(a){return olympe.C.ib(a)?'Node#'+a.Ba.T():String(a)}function em(a,b){return olympe.C.ib(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
946
- olympe.dc.query.lv=class{constructor(){this.j=0;this.values=null}add(a){let b;b=olympe.C.ib(a)?'n'+a.Ba.T():'p'+ ++this.j;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.Aa=class{la(){}j(){}D(){}ga(){}toString(){}};olympe.dc.lc.Subscription=class a extends olympe.C.Aj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.C.Xb('context subscription '+b,e));this.id=b;this.Ec=c;this.da=d||null;this.F=this.N.run(()=>olympe.C.ae(olympe.dc.lc.Subscription.j.INIT));this.Ub=!1;this.$=this.$b=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.tb(e)}catch(f){e=olympe.V.Ic()}return e}T(){return this.id}Xd(){return this.Ec}bh(){return this.da}Gf(){const b=
947
- olympe.dc.$d(),c=olympe.C.Pa(this.Xd());let d;return olympe.dc.CloudObject.instancesRel.Ea(null==(d=this.da)?void 0:d[0])?b.fromModel(c):b.Ie(c)}Wh(){const b=olympe.C.Pa(this.F);return b&&b.valueOf()>=olympe.dc.lc.Subscription.j.dr}Pk(){if(this.F.Ba.hb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.$b;this.$b=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);fc(this.F,olympe.C.ae(olympe.dc.lc.Subscription.j.dr))}Kc(){return olympe.C.ta([this.F],
948
- ()=>{},olympe.C.ea)}R(){const b=this.F.Ba.Fb;return b&&b.valueOf()>=olympe.dc.lc.Subscription.j.Fh}hd(b,c){this.R()?b(this):(null===this.$&&(this.$=new Map),void 0===c&&(c=olympe.V.Ic()),this.$.set(c,olympe.C.Xa().F(b)));return c||''}Vk(b){null!==this.$&&b&&this.$.delete(b)}Eb(){const b=olympe.dc.lc.Subscription.j.Fh;if(!this.F.Ba.hb()&&olympe.C.Pa(this.F)!==b&&(this.Ef(),fc(this.F,b),null!==this.$)){for(const c of this.$.values())c(this);this.$=null}}onDestroy(b){this.N.onDestroy(b)}release(){this.N.destroy()}rc(b){if(!this.F.Ba.hb()){for(let c=
949
- 0,d=b.length;c<d;c++)this.Im(b[c],c);if(this.R())this.Ef();else{this.Ub=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()}}}$c(b,c){if(!this.F.Ba.hb()&&(this.Bk(b,olympe.dc.CloudObject.get(c)),b=this.R(),this.Ub&&!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()}}Yh(b){this.F.Ba.hb()||(this.Hm(b),
950
- this.Zi(b,!this.R()))}Ag(){return this.R()?super.Ag():'Subscription is not ready!'}Vd(b){const c=olympe.C.Pa(this.Xd());return olympe.dc.lc.Subscription.D(c,b,this.bh())}static D(b,c,d){var e=olympe.dc.ma.from(b,c).he();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.da.Se){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.gb(h,!0))}else if(e instanceof olympe.dc.da.De){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.hg(h,!0,!0))}else if(e instanceof
951
- olympe.dc.da.Cf)e=a.D(olympe.C.Pa(e.Xd()),c,e.bh()),b.push(...e);else if(e instanceof olympe.dc.da.pf||e instanceof olympe.dc.da.Pg){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.hg(n,!0,!0):k.gb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.lc.Subscription.j={INIT:0,dr:1,Fh:2};olympe.dc.lc.Subscription.prototype.Ag.K=olympe.C.H.j;function cm(a){const b=a.D;a.D=!0;return b}olympe.dc.lc.Uv=class{constructor(a){this.counter=0;this.D=!1;this.j=a}};olympe.dc.Bf=class{la(){}Mb(){}j(){}ga(){}toString(){}};olympe.dc.wq=class{F(){}};olympe.dc.yk=class{la(){}getValue(){}j(){}ga(){}toString(){}};olympe.dc.wc={};let fm=0;olympe.dc.wc.og=class{constructor(){this.id=fm++}la(){return'CustomLocalComparator#'+fm}J(){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.wc.og.xa=[olympe.dc.mf];olympe.dc.wc.DateTime=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.DateTime)}J(){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.wc.DateTime);olympe.dc.wc.DateTime.xa=[olympe.dc.mf];olympe.dc.wc.Number=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.Number)}J(){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.wc.Number);olympe.dc.wc.Number.xa=[olympe.dc.mf];olympe.dc.wc.String=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.String)}J(){return this.j.j()}F(a,b){return olympe.C.ta([this.j.getValue(a,b)],c=>c.toLowerCase(),olympe.C.Sa)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`String(${this.j.toString()})`}};P('olympe.dc.comparators.String',olympe.dc.wc.String);olympe.dc.wc.String.xa=[olympe.dc.mf];olympe.dc.Z={};let gm=0;olympe.dc.Z.og=class{constructor(){this.id=gm++}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.og.xa=[olympe.dc.Aa];olympe.dc.Z.fl=class{constructor(a,b){this.F=a;this.J=b}la(){}D(){return[this.F.j(),this.J.j()]}j(a,b){return a.run(()=>olympe.C.ta([this.F.getValue(a,b),this.J.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.C.Rb(this.N('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.C.ea))}N(){}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.J.ga(a)+']}'}toString(){return this.la().replace(/^.+\./,'')+'('+this.F.toString()+','+this.J.toString()+')'}};
952
- olympe.dc.Z.fl.xa=[olympe.dc.Aa];olympe.dc.Z.Id=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.Id)}D(){return this.Z.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Z.map(c=>c.j(a,b)),(...c)=>olympe.C.Rb(c.every(d=>d.valueOf())),olympe.C.ea))}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=>
953
- a.toString()).join(',')+')'}};P('olympe.dc.predicates.And',olympe.dc.Z.Id);olympe.dc.Z.Id.xa=[olympe.dc.Aa];olympe.dc.Z.ml=class{constructor(a,b){this.F=a;this.value=b}j(a,b){return a.run(()=>olympe.C.ta([this.F,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.C.Rb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.C.ea))}la(){return Q(olympe.dc.Z.ml)}D(){return[this.value.j()]}ga(a){const b=olympe.C.ib(this.F)?this.F.Ba.Fb.valueOf():this.F.valueOf();return'{"c":"'+this.la()+'","a":['+b+','+this.value.ga(a)+']}'}toString(){const a=olympe.C.ib(this.F)?this.F.Ba.Fb.valueOf():this.F.valueOf();
954
- return this.la().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};P('olympe.dc.predicates.BitMask',olympe.dc.Z.ml);olympe.dc.Z.ml.xa=[olympe.dc.Aa];olympe.dc.Z.nf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}la(){return Q(olympe.dc.Z.nf)}D(){return[this.source.j(),this.value.j()]}sb(){return this.source}getValue(){return this.value}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.value.getValue(a,b),this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Rb(c.includes(d))},olympe.C.ea))}ga(a){const b=this.source.ga(a),c=this.value.ga(a);a=em(a,this.F);
955
- return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+']}'}toString(){const a=dm(this.F);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};P('olympe.dc.predicates.Contains',olympe.dc.Z.nf);olympe.dc.Z.nf.xa=[olympe.dc.Aa];olympe.dc.Z.te=class{constructor(a,b){this.F=a;this.J=b}la(){return Q(olympe.dc.Z.te)}D(){return[this.F.j(),this.J.j()]}j(a,b){return a.run(()=>olympe.C.ta([this.F.getValue(a,b),this.J.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Fd?c.Fd(d):'object'===typeof d&&void 0!==d.Fd?d.Fd(c):olympe.C.Rb(c.valueOf()===d.valueOf()),olympe.C.ea,'Test equal predicate'))}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.J.ga(a)+']}'}toString(){return'Equals('+this.F.toString()+','+this.J.toString()+
956
- ')'}};P('olympe.dc.predicates.Equals',olympe.dc.Z.te);olympe.dc.Z.te.xa=[olympe.dc.Aa];olympe.dc.Z.Bt=class extends olympe.dc.Z.te{constructor(a,b){super(a,new olympe.dc.Za.Oe(b))}};olympe.dc.Z.Bt.xa=[olympe.dc.Aa];olympe.dc.Z.Sj=class extends olympe.dc.Z.fl{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.Sj)}N(a,b){return a>b}};P('olympe.dc.predicates.Greater',olympe.dc.Z.Sj);olympe.dc.Z.zi=class{constructor(a,b,c){this.ob=[];this.F=c instanceof Array?c:void 0!==c?[olympe.dc.ha(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.De?this.ob.push(new hm(c.X(),c.Ja(),c.F,c.D)):this.ob.push(new hm(olympe.dc.ha(c),b[d],1,1))}la(){return Q(olympe.dc.Z.zi)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>gc(olympe.C.cc(Boolean),!1)),d=olympe.V.Ic(),e=olympe.dc.ia();let f=0;a=(h,k)=>{0!==this.F.length&&!this.F.includes(k)||
957
- c.getContext().hb()||c.getContext().td()||(f+=h?1:-1,c.update(0<f))};const g=this.ob;for(let h=g.length-1;0<=h;h--)a=im(g[h],e,a,d+h);sf(e,b,a,d);c.getContext().onDestroy(()=>{qf(e,b,d)});return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelated',olympe.dc.Z.zi);
958
- function im(a,b,c,d){const e=Object.create(null);d+=olympe.V.Zh();const f=(g,h,k)=>{k>=a.D&&c(g,h);if(!(0<=a.j&&k>=a.j)){var l=d+k;g?e[h]||(e[h]=!0,T(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.D(h,a,l))}};return(g,h)=>f(g,h,0)}class hm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d}ga(){return`${this.X()}, ${this.Ja()}, ${this.D}, ${this.j}`}}olympe.dc.Z.zi.xa=[olympe.dc.Aa];olympe.dc.Z.Ml=class{constructor(a,b,c){this.ob=[];this.F=void 0!==c?c.map(olympe.dc.ha):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.De?this.ob.push(new jm(c.X(),c.Ja(),c.F,c.D)):this.ob.push(new jm(olympe.dc.ha(c),b[d],1,1))}la(){return Q(olympe.dc.Z.Ml)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>gc(olympe.C.cc(Boolean),!1)),d=olympe.dc.ia(),e=olympe.V.Zh();let f=(k,l,n)=>{l&&(null===this.F||this.F.includes(n))&&k(1)};
959
- const g=this.ob;for(let k=g.length-1;0<=k;k--)f=km(g[k],d,f,e+k);let h=0;sf(d,b,f.bind(null,k=>{c.getContext().td()||c.getContext().hb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>qf(d,b,e));return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(null!==this.F?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.F?'#['+this.F.toString()+'], ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelatedTree',olympe.dc.Z.Ml);
960
- function km(a,b,c,d){const e=a.F,f=a.N,g=new Set,h=(l,n,p)=>{f.has(n)?f.get(n).set(d+p,l):f.set(n,(new Map).set(d+p,l))},k=(l,n,p,q,r)=>{const t=olympe.V.Zh();if(q){const u=p+r,x=y=>{const z=f.get(r);if(g.has(u))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(u),e.set(r,(e.get(r)||0)+y),Array.from(z.values()).forEach(A=>A(y)));g.delete(u)};h(l,r,p);e.has(r)?l(e.get(r)):(n>=a.D&&c(y=>
961
- {e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.j||n<=a.j)&&r!==p&&T(b,r,a,k.bind(a,x,n+1,r),t))}else l(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.D(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class jm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d;this.N=new Map;this.F=new Map}ga(){return`${this.X()}, ${this.Ja()}, ${this.D}, ${this.j}`}}olympe.dc.Z.Ml.xa=[olympe.dc.Aa];olympe.dc.Z.Ci=class{constructor(a){this.F=new Set;a instanceof Array?a.forEach(b=>{this.F.add(olympe.dc.ha(b))}):this.F.add(olympe.dc.ha(a))}la(){return Q(olympe.dc.Z.Ci)}D(){return[]}j(a,b){const c=a.run(()=>gc(olympe.C.cc(olympe.C.ea),olympe.C.ea.j)),d=olympe.dc.ia();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.ha(olympe.dc.CloudObject))c.update(olympe.C.Rb(this.F.has(k))),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);
962
- this.F.has(k)?(c.update(olympe.C.ea.D),f()):(h=new lm(k,olympe.dc.CloudObject.extendRel),e.push(h),T(d,h.tag,h.relation,g,h.id))}};a=new lm(b,olympe.dc.CloudObject.modelRel);e.push(a);T(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(Array.from(this.F))+']}'}toString(){return'InstanceOf('+Array.from(this.F).join(', ')+')'}};class lm{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.V.Zh()}}
963
- P('olympe.dc.predicates.InstanceOf',olympe.dc.Z.Ci);olympe.dc.Z.Ci.xa=[olympe.dc.Aa];olympe.dc.Z.ee=class{constructor(a){this.F=a}la(){return Q(olympe.dc.Z.ee)}D(){return this.F.D()}j(a,b){return a.run(()=>olympe.C.ta([this.F.j(a,b)],c=>olympe.C.Rb(!c.valueOf()),olympe.C.ea))}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.ee);olympe.dc.Z.ee.xa=[olympe.dc.Aa];olympe.dc.Z.ze=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.ze)}D(){return this.Z.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Z.map(c=>c.j(a,b)),(...c)=>olympe.C.Rb(c.some(d=>d.valueOf())),olympe.C.ea))}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(',')+
964
- ')'}};P('olympe.dc.predicates.Or',olympe.dc.Z.ze);olympe.dc.Z.ze.xa=[olympe.dc.Aa];olympe.dc.Z.zf=class{constructor(a,b,c){this.source=a;this.J=b;this.F=void 0===c?!0:c}la(){return Q(olympe.dc.Z.zf)}D(){return[this.source.j()]}sb(){return this.source}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.J,this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Rb((new RegExp(d)).test(c))},olympe.C.ea))}ga(a){const b=this.source.ga(a),c=em(a,this.J);a=em(a,this.F);return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+
965
- ']}'}toString(){const a=dm(this.F);return'Regex('+this.source.toString()+','+this.J+','+a+')'}};P('olympe.dc.predicates.Regex',olympe.dc.Z.zf);olympe.dc.Z.zf.xa=[olympe.dc.Aa];olympe.dc.Z.tk=class extends olympe.dc.Z.fl{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.tk)}N(a,b){return a<b}};P('olympe.dc.predicates.Smaller',olympe.dc.Z.tk);olympe.dc.mc={};olympe.dc.mc.Cj=class{constructor(){this.$=this.J=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.J;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.mc.Nj(this),this.R=c,this.J=b):this.J=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.J&&
966
- (0<=this.D?mm(nm(this.J,this.D),a):a.push(this.R));this.$(a)}}mg(a){this.$=a}};olympe.dc.mc.Cj.xa=[olympe.dc.mc.Ta];function bm(a,b,c,d){b?a.N[d]=c:delete a.N[d];null===a.D&&(a.D=new olympe.dc.mc.Nj(a.j,a));return a.D}function nm(a,b){for(let c=0;c<b;c++)if(null!==a.D)a=a.D;else break;return a}function mm(a,b){a=a.N;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.mc.Nj=class{constructor(a,b){this.j=a;this.depth=b?b.depth+1:0;this.N=Object.create(null);this.D=null}ke(){return this.j}eg(){this.j.N()?this.j.F():this.j.Y(this.depth-1)}};class om extends olympe.dc.mc.Nj{constructor(a,b,c){super(a);this.R=b;this.tag=c;this.$=this.Y=this.J=!1;this.F=null}}
967
- function pm(a,b,c,d,e){const f=Object.create(null),g=a.fa,h=a.J;let k,l,n;a.ba=!0;l=0;for(n=g.length;l<n;l++)f[g[l]]=null;g.length=0;l=c;for(n=Math.min(b.length,d);l<n;l++)k=b[l],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.J||(c.J=!0,e(!0,c.tag,c.R,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.J&&(c.J=!1,e(!1,c.tag,c.R,c)),c.Y&&(c.F=null,delete h[k]),delete f[k]);a.ba=!1;null!==a.D&&a.F()}
968
- olympe.dc.mc.Xl=class{constructor(){this.J={};this.fa=[];this.D=null;this.ba=!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.ba){var a=this.fa,b=a.length,c=this.J,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=nm(f,g)}null!==
969
- e.F&&mm(e.F,this.R)}}this.$&&this.$(this.R)}}mg(a){this.$=a}j(a,b,c){let d=this.J[c];a?void 0===d?(d=new om(this,c,b),this.J[c]=d):(d.tag=b,d.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.mc.Xl.xa=[olympe.dc.mc.Ta];olympe.dc.mc.Ta=class{constructor(){}j(){}N(){}Y(){}F(){}mg(){}};function qm(a,b){olympe.C.df(a.value)?(a.node=olympe.C.nn(a.value,b),Nb(a.node)||b()):b()}function rm(a,b){if(olympe.C.df(a.value)){const c=olympe.C.Xa(),d=a.J;olympe.C.Sc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>qm(a,b)),olympe.C.Xa().destroy())})}}
970
- class sm extends olympe.dc.mc.Nj{constructor(a,b,c){super(a);this.Y=b;this.value=c;this.J=this.Pa();this.position=this.node=null;this.R=!1;this.F=null}Pa(){const a=olympe.C.Pa(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.F=this.value=null}hb(){return null===this.value}}
971
- function tm(a,b){if(!b.hb()){var c=a.D;var d=a.fa,e=b.Pa(),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].J,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].J,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.J=b.Pa();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()}}}
972
- function um(a){const b=a.fa;a.D.sort((c,d)=>b(c.Pa(),d.Pa()))}
973
- olympe.dc.mc.hr=class{constructor(a){this.fa=a;this.J=null;this.D=[];this.R=[];this.$=null;this.ba=new Map}j(a,b,c,d){b='$'+c;const e=this.D;let f;if(a)f=new sm(this,c,d),this.ba.set(b,f),this.N()?qm(f,()=>tm(this,f)):(f.position=e.length,e.push(f));else{f=this.ba.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ba.delete(b);null!==f.position&&(this.N()?this.remove(f):delete e[f.position]);f.destroy()}return f}N(){return null!==this.J}Y(a){if(null!==this.J)throw Error('Manager already activated (depth='+
974
- this.J+')');this.J=a;um(this);for(let b=0,c=this.D.length;b<c;b++){const d=this.D[b];d.position=b;rm(d,()=>tm(this,d))}this.F()}F(){if(null===this.J)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.J;b.R=!0;b.F=nm(b,c)}0>this.J?this.R.push(e.Y):e.F&&mm(e.F,this.R)}this.$&&this.$(this.R)}mg(a){this.$=a}remove(a){const b=this.D,c=b.length-1;if(null!==a.position){for(a=a.position;a<
975
- c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.mc.hr.xa=[olympe.dc.mc.Ta];function Xl(a){if(!a.D){for(let b in a.F)vm(a.F[b]);a.D=!0}a.J=null;a.N=null}function $l(a,b,c){a.F[c||'root'].R=b}function am(a,b,c){a.F[c||'root'].eg(b)}function wm(a,b,c,d){const e=a.N,f=b+d+c;let g=e[f];void 0===g&&(g=bh(a.db,b,c,d),e[f]=g);return g}function xm(a,b){a.D||a.j.eg(b)}function ym(a,b,c,d,e){if(!a.D){let f=wm(a,c,d,e||olympe.dc.va.DESTINATION);e||(f+=wm(a,c,d,olympe.dc.va.ORIGIN));0===f&&xm(a,b)}}
976
- function zm(a,b){const c=a.F[b];void 0!==c?(a.G&&a.G.debug('Set current block to',b,null!==c.F?'parent = '+c.F.T():''),a.j=c):a.G&&a.G.error('Try to set a block that does not exists:',b)}function Am(a){const b=String(++a.R),c=a.j;a.F[b]=new Bm(b,c);Cm(c,b);c.J||(c.J=()=>zm(a,c.T()));return b}function Dm(a,b){const c=a.j;a.j.J=()=>{zm(a,c.T());b()}}function Em(a,b){vm(b?a.F[b]:a.j)}
977
- olympe.dc.mc.jr=class{constructor(a,b){this.db=a;this.G=b||null;this.J=Object.create(null);this.N=Object.create(null);this.D=!1;this.R=0;this.j=new Bm('root');this.F=Object.create(null);this.F.root=this.j}register(a,b,c,d,e){this.D||(null!==b&&c&&d&&e?(c=wm(this,c,d,e),d=this.J[b]||0,this.J[b]=++d,this.j.j===b&&c<=d&&(this.j.j=a)):this.j.j=a)}};function Cm(a,b){null===a.D&&(a.D=Object.create(null));a.D[b]=!1}function vm(a){a.N=!0;null!==a.F&&a.F.notify(a.id)}
978
- class Bm{constructor(a,b){this.id=a;this.F=b||null;this.j=this.R=this.J=this.D=null;this.N=!1}T(){return this.id}eg(a){const b=this.R;if(this.N||this.j===a||null===a)b&&b(),!b&&vm(this)}notify(a){const b=this.J,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.Za={};function Fm(a,b,c,d){const e=olympe.dc.ia(),f=new olympe.dc.mc.Cj,g=new olympe.dc.mc.jr(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,u)=>{a.td()||a.hb()||(h||($l(g,()=>{u.eg();Xl(g)}),u.ke().mg(l),h=!0),q?k[t]=r:delete k[t],am(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].j(a,g,n);const p=olympe.V.Ic();sf(e,b,(q,r)=>{g.register(p,null);const t=f.j(q,b,p,null);n(q,r,p,bm(t,q,b,p))},p);a.onDestroy(()=>{qf(e,b,p)});e.Ha(b)||Xl(g)}
979
- function Gm(a,b,c){const d=c.getContext(),e=olympe.dc.ia(),f=a.F(),g=Ng(e,b,a.J,d.F(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>Og(e,b,a.J,g))}
980
- olympe.dc.Za.ki=class{constructor(a,b,c){this.J=a&&a.X?a.X():a;this.da=b&&b.filter(d=>d instanceof olympe.dc.da.Se||d instanceof olympe.dc.da.De)||null;this.D=c||null;this.defaultValue=null}la(){}Mb(){}F(){}j(){return(this.da||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}jh(a){this.defaultValue=a;return this}bh(){return this.da}Xd(){return this.D}getValue(a,b){const c=a.run(()=>olympe.C.cc(this.Mb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&gc(c,this.defaultValue);
981
- b=this.D||b;null!==this.da?Fm(a,b,this.da,d=>{Gm(this,d,c)}):Gm(this,b,c);return c.rb()}ga(a){const b=em(a,this.J),c=em(a,this.D);let d='null';this.da&&(d=this.da.map(function(e){return e.ga(a)}).join(','));return`{"c":"${this.la()}","a":["${b}",${d},${c}]}`}toString(){const a=dm(this.J),b=this.D?','+dm(this.D):'';let c='';this.da&&(c=','+this.da.join(','));return this.la().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.Za.ki.xa=[olympe.dc.yk];olympe.dc.Za.Mn=class{constructor(a,b){if(olympe.C.df(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ia();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.$g(e,olympe.dc.CloudObject.extendRel,olympe.dm.Be);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.X():d=new olympe.dc.Za.Si(c,b);break;case olympe.dm.Number.O.X():d=new olympe.dc.Za.Ki(c,
982
- b);break;case olympe.dm.Boolean.O.X():d=new olympe.dc.Za.Dj(c,b);break;case olympe.dm.DateTime.O.X():d=new olympe.dc.Za.ri(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.Za.Mn.xa=[olympe.dc.yk];olympe.dc.Za.Dj=class extends olympe.dc.Za.ki{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Dj)}F(){return olympe.dc.mb.Pm}Mb(){return olympe.C.ea}};P('olympe.dc.valuedefs.BooleanProperty',olympe.dc.Za.Dj);olympe.dc.Za.Oe=class{constructor(a){this.value=a}la(){return Q(olympe.dc.Za.Oe)}j(){return[]}getValue(){return this.value}ga(a){a=em(a,this.value);return`{"c":"${this.la()}","a":[${a}]}`}toString(){return`Constant(${dm(this.value)})`}};P('olympe.dc.valuedefs.Constant',olympe.dc.Za.Oe);olympe.dc.Za.Oe.xa=[olympe.dc.yk];olympe.dc.Za.ri=class extends olympe.dc.Za.ki{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.ri)}F(){return olympe.dc.mb.Qm}Mb(){return olympe.C.eb}};P('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.Za.ri);olympe.dc.Za.Ki=class extends olympe.dc.Za.ki{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Ki)}F(){return olympe.dc.mb.Rm}Mb(){return olympe.C.aa}};P('olympe.dc.valuedefs.NumberProperty',olympe.dc.Za.Ki);olympe.dc.Za.Si=class extends olympe.dc.Za.ki{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Si)}F(){return olympe.dc.mb.Sm}Mb(){return olympe.C.Sa}};P('olympe.dc.valuedefs.StringProperty',olympe.dc.Za.Si);olympe.dc.Za.Ui=class{la(){return Q(olympe.dc.Za.Ui)}j(){return[]}getValue(a,b){return b}ga(){return'{"c":"'+this.la()+'","a":[]}'}toString(){return'Tag()'}};P('olympe.dc.valuedefs.Tag',olympe.dc.Za.Ui);olympe.dc.Za.Ui.xa=[olympe.dc.yk];olympe.dc.da={};olympe.dc.da.si=class{Mb(){return null}la(){return Q(olympe.dc.da.si)}j(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.j.j!==g||b.D||(b.j.j=f),c(!0,f,f,bm(h,!0,f,f))):(d[f]++,xm(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,bm(h,!1,f,f)))}}ga(){return'{"c":"'+this.la()+'"}'}toString(){return'Distinct()'}};P('olympe.dc.transformers.Distinct',olympe.dc.da.si);olympe.dc.da.si.xa=[olympe.dc.Bf];olympe.dc.da.pf=class{constructor(a){this.D=a}Mb(){return null}la(){return Q(olympe.dc.da.pf)}F(){return this.D.D()}j(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&xm(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,bm(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;if(f){let n=this.D.j(a,g);olympe.C.ib(n)&&(n=n.Ba);olympe.C.Of(n)?(b.D||void 0!==olympe.C.Pa(n)||xm(b,h),e[l]=n,a.run(()=>{olympe.C.Sc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
983
- 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.da.pf);olympe.dc.da.pf.xa=[olympe.dc.Bf,olympe.dc.wq];olympe.dc.da.Hl=class{constructor(a,b,c,d){this.D=new olympe.dc.Ra.Relation(olympe.dc.ha(a),c||olympe.dc.va.DESTINATION);this.F=new olympe.dc.Ra.Relation(olympe.dc.ha(b),d||olympe.dc.va.DESTINATION)}Mb(){return Mf(this.D)}la(){return Q(olympe.dc.da.Hl)}j(a,b,c){const d=olympe.dc.ia(),e={},f=this.D.X(),g=this.D.Ja(),h=this.F.X(),k=this.F.Ja();let l=null,n=null;const p=(r,t,u,x,y,z)=>{if(y){if(y=()=>{const A=olympe.V.tb(u+g+(f+'_'+r)+z,20),K=bm(t,!0,z,A);l=r;n=()=>{c(!1,z,A,bm(t,!1,z,A))};b.register(A,
984
- u,x,f,g);c(!0,z,A,K)},y.ns=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),X=K.length,xa=0;xa<X;xa++){let ab=e[K[xa]];ab.ns<y&&(y=ab.ns,A=ab)}A&&A()}},q=(r,t,u,x,y)=>{x?e[y]||(e[y]=!0,ym(b,u,y,f,g),ym(b,u,y,h,k),T(d,y,this.D,p.bind(this,r,t,u,y),u+'_val'),T(d,y,this.F,q.bind(this,r+1,t,u),u+'_follow')):(d.D(y,this.F,u+'_follow'),d.D(y,this.D,u+'_val'),delete e[y])};return(r,t,u,x)=>q(0,x,u,r,t)}ga(){return'{"c":"'+this.la()+'","a":["'+this.D.toString()+
985
- '","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.D.toString()+', '+this.F.toString()+')'}};P('olympe.dc.transformers.FirstRelated',olympe.dc.da.Hl);olympe.dc.da.Hl.xa=[olympe.dc.Bf];olympe.dc.da.xh=class{constructor(a,b){this.start=a;this.D=b}Mb(){return null}la(){return Q(olympe.dc.da.xh)}j(a,b,c){const d=new olympe.dc.mc.Xl;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.D||(b.j.j=e[0>n-1?0:Math.min(e.length,n)-1]);pm(d,e,f,n,c)}};a.run(()=>olympe.C.Sc([this.start,this.D],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));Dm(b,k);const l=Am(b);zm(b,l);return(n,p,q,r)=>{h||(r.ke().mg(t=>{e=t;Em(b,l)}),$l(b,()=>r.eg(),l),h=!0);d.j(n,p,q,null);am(b,q,l)}}ga(a){return'{"c":"'+
986
- this.la()+'","a":['+em(a,this.start)+','+em(a,this.D)+']}'}toString(){return`Limit(${olympe.C.Pa(this.start)},${olympe.C.Pa(this.D)})`}};P('olympe.dc.transformers.Limit',olympe.dc.da.xh);olympe.dc.da.xh.xa=[olympe.dc.Bf];function Hm(a){return a.ob.map(b=>b.X())}
987
- olympe.dc.da.Xj=class{constructor(a,b){this.direction=b||olympe.dc.va.DESTINATION;this.ob=a.map(c=>new olympe.dc.Ra.Relation(c,this.direction))}Mb(){return olympe.dc.CloudObject}la(){return Q(olympe.dc.da.Xj)}Ja(){return this.direction}j(a,b,c){const d=olympe.dc.ia(),e=(f,g,h,k)=>T(d,f,k,(l,n)=>{var p=k.X();p=olympe.V.tb(g+k.Ja()+p+n,20);const q=bm(h,l,n,p);l&&b.register(p,g,f,k.X(),k.Ja());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.ob.forEach(l=>{ym(b,h,g,l.X(),l.Ja());e(g,h,k,l)}):this.ob.forEach(l=>
988
- {d.D(g,l,h)})}}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(Hm(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Ja()+'['+Hm(this).join(',')+'])'}};P('olympe.dc.transformers.MultiRelated',olympe.dc.da.Xj);olympe.dc.da.Xj.xa=[olympe.dc.Bf];olympe.dc.da.De=class extends olympe.dc.Ra.Relation{constructor(a,b=olympe.dc.va.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.D=d}Mb(){return Mf(this)}la(){return Q(olympe.dc.da.De)}j(a,b,c){const d=olympe.dc.ia(),e=Object.create(null),f=olympe.dc.va.ORIGIN,g=olympe.dc.va.DESTINATION,h=this.X(),k=this.Ja(),l=(p,q,r)=>{if(!(0<=this.D&&p>=this.D)){var t=d.bb(r,this);p+=1;for(let u=0,x=t.length;u<x;u++){if(void 0!==e[t[u]]||r===t[u])continue;const y=olympe.V.tb(q+k+(h+'_'+p)+t[u],20);b.register(y,
989
- q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,x)=>{u&&!b.D&&l(p,t,x);p>=this.F?c(u,x,t,bm(r,u,x,t)):ym(b,t,x,h,k);0<=this.D&&p>=this.D||(u?e[x]||(e[x]=!0,T(d,x,this,(y,z)=>{const A=p+1,K=olympe.V.tb(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.Ja()+'",'+this.F+','+this.D+']}'}toString(){return'RecursiveRelated('+this.Ja()+this.X()+'['+this.F+'..'+this.D+'])'}};
990
- P('olympe.dc.transformers.RecursiveRelated',olympe.dc.da.De);olympe.dc.da.De.xa=[olympe.dc.Bf];olympe.dc.da.Se=class extends olympe.dc.Ra.Relation{constructor(a,b){super(a,b||olympe.dc.va.DESTINATION)}Mb(){return Mf(this)}la(){return Q(olympe.dc.da.Se)}ac(){return new olympe.dc.da.Se(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION)}j(a,b,c){const d=olympe.dc.ia(),e=this.X(),f=this.Ja();return(g,h,k,l)=>{ym(b,k,h,e,f);g?T(d,h,this,(n,p)=>{const q=olympe.V.tb(k+f+e+p,20),r=bm(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.D(h,this,k)}}ga(){return'{"c":"'+
991
- this.la()+'","a":["'+this.X()+'","'+this.Ja()+'"]}'}toString(){return'Related('+this.Ja()+this.X()+')'}};P('olympe.dc.transformers.Related',olympe.dc.da.Se);olympe.dc.da.Se.xa=[olympe.dc.Bf];olympe.dc.da.Pg=class{constructor(a,b){this.Hb=a;this.D=void 0===b?!0:!!b}Mb(){return null}la(){return Q(olympe.dc.da.Pg)}Wg(){return this.Hb}F(){return[this.Hb.J()]}j(a,b,c){const d=new olympe.dc.mc.hr(a.F(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)+
992
- ')'}};P('olympe.dc.transformers.Sort',olympe.dc.da.Pg);olympe.dc.da.Pg.xa=[olympe.dc.Bf,olympe.dc.wq];function Im(a,b,c,d,e,f){function g(n,p){if(l)for(var q=l.length-1;0<=q;q--)f=l[q].j(b,e,f);e.register(h,null);q=d.j(n,p,c,null);f(n,p,h,bm(q,n,p,h))}const h=olympe.V.Ic(),k=olympe.dc.ia(),l=a.da;b.run(()=>olympe.C.Sc([a.D],n=>{Jm(k,n,g,h);void 0===k.model(n)&&Xl(e)}))}function Jm(a,b,c,d){const e=b&&b.valueOf();e&&(sf(a,e,c,d),olympe.C.Xa().Y(()=>qf(a,e,d)))}
993
- olympe.dc.da.Cf=class{constructor(a,b){this.da=this.D=null;a instanceof olympe.dc.za?(this.D=a.Xd(),this.da=a.Rl()):(this.D=a,b&&(this.da=b))}Mb(){return null}la(){return Q(olympe.dc.da.Cf)||''}bh(){return this.da}Xd(){return this.D}j(a,b,c){const d=new olympe.dc.mc.Xl,e=new olympe.dc.mc.Cj;let f=[],g=[],h=!1,k=!1;const l=Am(b),n=Am(b);Dm(b,()=>{const p=f.concat(g);0<p.length?b.D||(b.j.j=p[p.length-1]):Em(b);pm(d,p,0,p.length,c)});zm(b,n);Im(this,a,this.D,e,b,(p,q,r,t)=>{const u=olympe.C.Xa();u.td()||
994
- u.hb()||(k||(t.ke().mg(x=>{g=x;Em(b,n)}),$l(b,()=>t.eg(),n),k=!0),d.j(p,q,r),am(b,r,n))});zm(b,l);return(p,q,r,t)=>{h||(t.ke().mg(u=>{f=u;Em(b,l)}),$l(b,()=>t.eg(),l),h=!0);d.j(p,q,r,l);am(b,r,l)}}ga(a){const b=this.da?'['+this.da.map(c=>c.ga(a)).join(',')+']':'null';return'{"c":"'+this.la()+'","a":['+em(a,this.D)+','+b+']}'}toString(){const a=olympe.C.ib(this.D)?'N:'+this.D.Ba.T():this.D.valueOf(),b=this.da?','+this.da.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
995
- P('olympe.dc.transformers.Union',olympe.dc.da.Cf);olympe.dc.da.Cf.xa=[olympe.dc.Bf];olympe.dc.da.Oq={WA:1,Tt:-1,St:0};olympe.dc.da.zC={Fz:!0,eA:!1};olympe.dc.lc.P={Jp:'dc.legacy.listdefProcessor'};olympe.dc.lc.U={Ip:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{F(a,olympe.dc.lc.U.Ip,!1);D(a,olympe.dc.lc.P.Jp,olympe.dc.lc.Ku,olympe.dc.query.P.Ca,olympe.dc.P.oh,olympe.dc.transaction.P.Da,olympe.dc.query.P.gk,new olympe.W.pa(olympe.dc.U.Ih),new olympe.W.pa(olympe.dc.lc.U.Ip))});olympe.W.run([olympe.dc.lc.P.Jp],a=>{olympe.dc.lc.Px=()=>a});function Km(a){const b=olympe.dc.ia(),c=new Map;b.bs(a).forEach(d=>{b.bb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
996
- olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ia();this.model=null}static Pc(a,b,c,...d){b=olympe.dc.ha(b);var e=uf(b);if(e=e&&e.j)return e(a,c,...d);a=a.create(b);void 0!==c&&null!==c&&Y(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.es();a=olympe.dc.ha(a);var c=b.db.model(a);c=tf(b,c);if(null===c)throw new olympe.dc.kq(a);c=c.instantiate(a,b.D);b.j.j.Ga([a]);b.Ra.register(c,a);b=c}return b}static exists(a){return olympe.dc.ia().Ha(olympe.dc.ha(a))}static Tw(a,
997
- b,c){const d=olympe.dc.ia();let e=null;const f=k=>{null===e&&(e=Km(b||this));return e.has(k)?e.get(k):null},g=Al(!1),h=g.create(null!=b?b:this);void 0!==c&&h.gi(c);a.forEach((k,l)=>{d.Ha(olympe.dc.ha(l))?Y(h,l,k):(l=f(l))&&Y(h,l,k)});g.nb((k,l)=>{k||olympe.ja.ab('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});return this.get(h)}static Dw(){return this.get(this)}static Rk(a){return olympe.dc.ma.Rk(a)}static Cb(){return olympe.dc.ia().bb(this,olympe.dc.CloudObject.propertyRel).map(a=>
998
- new olympe.dc.Ra.Property(a))}static Dd(){const a=olympe.dc.ia();return a.bb(this,olympe.dc.CloudObject.rj).map(b=>new olympe.dc.Ra.Relation(b)).concat(a.bb(this,olympe.dc.CloudObject.Sr).map(b=>new olympe.dc.Ra.Relation(b,olympe.dc.va.ORIGIN)))}static Rc(a){return olympe.dc.CloudObject.get(a)}static gs(a){var b=tf(olympe.dc.es(),olympe.dc.ha(a));b=b&&b.D;return new olympe.dc.za(olympe.dc.ha(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||
999
- (this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.ma.from(this)}ef(){return this.db.ef(this)}sb(){return this.db.source(this)}Mx(){return this.db.ei(this)?olympe.dc.$d().fromModel(this):null}$r(){return olympe.C.ta([this.la()],a=>olympe.C.xb(a),olympe.C.Sa,'getDisplayName',olympe.C.xb('('+this.toString()+')'))}bc(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.D?a.D():a;return new rxjs.Observable(e=>
1000
- {const f=olympe.dc.mb.Ac(this.db.Qa(this.tag,b));c||null!==f||e.next(f);const g=Ng(this.db,this.tag,b,h=>{e.next(olympe.dc.mb.Ac(h))});d.Y(()=>{e.complete();Og(this.db,this.tag,b,g)});return()=>Og(this.db,this.tag,b,g)})}Wy(a){const b='function'===typeof a.D?a.D():a;return new rxjs.Observable(c=>{const d=Pg(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Ra.Property(e),null]):c.next([new olympe.dc.Ra.Property(e),f])});b.Y(()=>{c.complete();Qg(this.db,this.tag,d)});return()=>Qg(this.db,
1001
- this.tag,d)})}Xy(a){return this.observe(olympe.C.Xa(),a)}get(a){return olympe.dc.mb.Ac(this.db.Qa(this.tag,a))}Qa(a){return this.get(a)}gb(a){return olympe.dc.ma.from(this).gb(a)}ig(a){return olympe.dc.nd.from(this).gb(a)}Ac(){return this}wx(){return this.Qc(olympe.dc.CloudObject.Pw,olympe.dc.CloudObject)}$m(){return this.bb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Mf(a,b,c){const d=olympe.C.cc(c,'Sync valueType'),e=Ng(this.db,this.tag,a,olympe.C.Xa().F(f=>{b&&null!==f&&void 0!==f&&
1002
- (f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>Og(this.db,this.tag,a,e));return d.getContext()}wb(a){return M(this.Mf(a,olympe.dc.mb.Sm,olympe.C.Sa))}sd(a){return M(this.Mf(a,olympe.dc.mb.Rm,olympe.C.aa))}Zg(a){return M(this.Mf(a,olympe.dc.mb.Pm,olympe.C.ea))}lj(a){return M(this.Mf(a,olympe.dc.mb.Qm,olympe.C.eb))}ls(){return M(this.Mf(olympe.dm.Color.valueProp,olympe.dc.mb.Kr,olympe.C.Color))}ms(){return M(this.Mf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.mb.Lr,
1003
- olympe.dc.CloudObject))}bb(a,b){a=a instanceof olympe.dc.da.Se?a:new olympe.dc.da.Se(a.X(),a.Ja());return new olympe.dc.za(this.X(),a,b)}Qc(a,b){return this.bb(a,b).Gc()}Vr(a,b){const c=this.db,d=olympe.V.Ic(),e=olympe.C.Xa(),f=new Map;T(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,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)})}yz(){return new olympe.dc.za(this.X(),[],Kf(this.X()))}transform(...a){return(new olympe.dc.za(this.X(),
1004
- [],this.constructor)).transform(...a)}Uc(){return this.$r()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ha(this.tag)?Object.assign({'#tag':this.X(),'#type':this.Vb().name()},this.Vc(!0,!0)):{'#tag':this.X(),'#error':'The object does not exist in the local database.'}}Vc(a=!1,b=!0){const c={};this.db.Cb(this,b).forEach((d,e)=>{this.db.Ha(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.mb.Ac(d))});return c}Ea(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():
1005
- 'function'===typeof a?olympe.dc.na.bc(a)===this.X():!1}Fd(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.Ea(b)),olympe.C.ea)}Ww(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Wa,c=!0;const d=olympe.dc.va.ORIGIN;for(const [e,f,g]of $g(b,this))f===d?a.ic(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.ic(e,this,g);a.delete(this,olympe.dc.Lb.NONE);c&&a.nb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Ea;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Vc;
1006
- olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.ig;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.gb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Qa;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Xy;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.Wy;
1007
- olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.bc;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.sb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.ef;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Vb;
1008
- 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.gs;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Rc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.Dd;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Cb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Rk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Dw;
1009
- olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Tw;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.LE=olympe.dc.CloudObject.O.ka(olympe.dc.Cp.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.O.ka('ff023000000000000011');B('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);
1010
- olympe.dc.CloudObject.wE=olympe.dc.CloudObject.O.ka('ff023000000000000012');olympe.dc.CloudObject.rj=olympe.dc.CloudObject.O.sa('ff02200000000000000a');olympe.dc.CloudObject.Sr=olympe.dc.CloudObject.O.sa('ff02200000000000000b',olympe.dc.va.ORIGIN);olympe.dc.CloudObject.fE=olympe.dc.CloudObject.O.sa('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.WD=olympe.dc.CloudObject.O.sa('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.sa('ff02200000000000000c');
1011
- B('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.Yc);B('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);B('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);
1012
- olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.sa(olympe.dc.hc.ti);B('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.extendRel);B('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.sa(olympe.dc.hc.Gj);B('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);
1013
- olympe.dc.CloudObject.Pw=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Vw=olympe.dc.CloudObject.O.sa('018282d3ac0a474a0bf4');B('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.Vw);olympe.dc.BC=olympe.dc.CloudObject;olympe.dc.CloudObject.xa=[olympe.dc.Qe];m=olympe.dc.CloudObject.prototype;m.X.K=new olympe.C.H(()=>String,[]);m.name.K=new olympe.C.H(()=>String,[]);m.la.K=olympe.C.H.D;m.Vb.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);
1014
- m.sb.K=new olympe.C.H(()=>String,[]);m.Mx.K=new olympe.C.H(()=>String,[]);m.$r.K=olympe.C.H.D;m.bc.K=new olympe.C.H(()=>String,[]);m.wx.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.$m.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Mf.K=new olympe.C.H(()=>olympe.C.Node,[]);m.wb.K=olympe.C.H.D;m.sd.K=olympe.C.H.F;m.Zg.K=olympe.C.H.N;m.lj.K=new olympe.C.H(()=>olympe.C.eb,[]);m.ls.K=new olympe.C.H(()=>olympe.C.Color,[]);m.ms.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);
1015
- m.bb.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Qc.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.Vr.K=new olympe.C.H(()=>Function,[]);m.yz.K=new olympe.C.H(()=>olympe.dc.za,[]);m.transform.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Uc.K=olympe.C.H.D;m.toString.K=olympe.C.H.j;m.Ea.K=olympe.C.H.j;m.Fd.K=olympe.C.H.N;m.Ww.K=new olympe.C.H(()=>{},[]);olympe.dc.P={oh:'dc.DBView',xp:'dc.InstanceManager',Ca:'dc.Logger',Zv:'dc.TransactionLogger',Oj:'dc.FileServiceManager',Jg:'dc.Router'};olympe.dc.U={Mg:'dc.tag',Uf:'dc.debug',Ih:'dc.subscribeAll',Al:'dc.defaultSource',Po:'dc.fileCache',ro:'dc.dataConsumerOnly',Ko:'dc.errorOnAbstractInstantiation'};
1016
- olympe.W.config(function(a){const b='object'===typeof window;F(a,olympe.dc.U.Uf,!1);F(a,olympe.dc.U.Ih,!1);F(a,olympe.dc.U.Al,olympe.dc.Ka.SERVER);F(a,olympe.dc.U.ro,b);F(a,olympe.dc.U.Po,b);F(a,olympe.dc.U.Ko,!0);F(a,olympe.dc.U.Mg,olympe.V.Ic());E(a,olympe.dc.P.Ca,[olympe.ja.P.Da],c=>c.cd('dc'));Wa(a,olympe.dc.P.Zv,olympe.dc.transaction.P.Ca);Wa(a,olympe.dc.P.oh,olympe.dc.db.P.xl);D(a,olympe.dc.P.Oj,olympe.dc.Gt,olympe.dc.P.Ca,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.dc.P.Jg,olympe.V.P.qg,new olympe.W.pa(olympe.dc.U.Po));
1017
- D(a,olympe.dc.P.Jg,olympe.dc.Av,olympe.dc.P.Ca,olympe.dc.sources.P.Fq,olympe.dc.sources.P.Yq,olympe.dc.P.oh,olympe.host.P.Re,new olympe.W.pa(olympe.dc.U.Mg),new olympe.W.pa(olympe.dc.U.ro));D(a,olympe.dc.P.xp,olympe.dc.$t,olympe.dc.db.P.Il,olympe.dc.db.P.Da,olympe.W.P.sg)},'olympe.dc');
1018
- olympe.W.run([olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.xp,olympe.dc.P.Oj,new olympe.W.pa(olympe.dc.U.Mg)],(a,b,c,d,e)=>{olympe.dc.Yr=()=>a;olympe.dc.nj=()=>b;olympe.dc.es=()=>c;olympe.dc.cs=()=>d;olympe.dc.Ka.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Pd=class extends olympe.dc.CloudObject{la(){return this.wb(olympe.dc.CloudObject.nameProp)}j(){return olympe.C.Sa.EMPTY}D(){return olympe.C.ea.j}};olympe.dm.Pd.O=olympe.dc.na.j('ff021000000000000002',olympe.dm.Pd);olympe.dm.Pd.N=olympe.dm.Pd.O.ka('ff023000000000000035');olympe.dm.Pd.j=olympe.dm.Pd.O.sa('ff022000000000000005');olympe.dm.Pd.F=Jf('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Pd.J=Jf('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
1019
- olympe.dm.Pd.D=Jf('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Pd.prototype.la.K=olympe.C.H.D;olympe.dm.Pd.prototype.j.K=olympe.C.H.D;olympe.dm.Pd.prototype.D.K=olympe.C.H.N;olympe.dm.el={NONE:0,iA:1,tt:2,jA:4,fA:8,hA:16,gA:31,GB:32,DB:64,HB:128,EB:256,$u:512,FB:992,XA:1023};olympe.dm.User=class extends olympe.dc.CloudObject{Jx(){return this.cn()}la(){return this.cn()}cn(){return this.wb(olympe.dm.User.loginProp)}ou(){return this.wb(olympe.dm.User.D)}nu(){return olympe.C.Sa.EMPTY}gy(){return this.wb(olympe.dm.User.saltProp)}py(){return this.wb(olympe.dm.User.verifierProp)}by(){return this.bb(olympe.dm.User.F,olympe.dm.Pd)}};olympe.dm.User.O=olympe.dc.na.j('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.O.ka('ff023000000000000001');
671
+ q+A)))});c.set(g,[x,t&&h,q+u])}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 Oh(a){if(null===a.D){const b={Hb:a.query.$g(),Hd:a.Hd,max:a.query.j.max,offset:a.query.j.offset};a.D=olympe.dc.Ia.from(a.Y,Mh(a),b)}return a.D}function Ph(a,b){a.R=b}function Qh(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)}}
672
+ function Rh(a,b){let c;return null!=(c=a.j.get(b).Rc())?c:[]}function Sh(a,b,c){let d,e;return null!=(e=null==(d=a.j.get(c))?void 0:d.has(b))?e:!1}function Th(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)&&Qh(a);let g;f&&(null==(g=a.Me)||g.watch(b,a.H.has(c)));return f}function Uh(a,b,c,d,e,f){null!==a.Me&&(d===olympe.dc.ua.ORIGIN?Lh(a.Me,b,c,f,e):Lh(a.Me,b,c,e,f))}
673
+ function Vh(a){a.G.j()&&a.G.debug(`Start sending notifications for query ${a.query.T()}`);const b=new olympe.dc.query.gv(a.G,a.query.sb(),a.query.T(),a);a.j.forEach((c,d)=>{for(const e of c.Rc())b.watch(e,a.H.has(d))});null!=b.j||(b.j=new olympe.dc.db.ec);a.Me=b}function Wh(a){null!==a.Me&&(a.G.j()&&a.G.debug(`Stop sending notifications for query ${a.query.T()}`),a.j.forEach(b=>{for(const c of b.Rc())a.Me.stop(c)}),a.Me=null)}
674
+ function Xh(a){a.N=!1;if(null!=(a=a.Me)){let b;const c=!(null==(b=a.j)?0:b.hf());a.F=c?a.j:null;c&&(a.j=new olympe.dc.db.ec,a.G.j()&&a.G.debug(`Commit notification with ${a.F.H()} operations for query ${a.D}`))}}
675
+ olympe.dc.query.Aq=class{constructor(a,b){this.G=a;this.query=b;this.F=olympe.V.tb(b.D);this.oa=new Map;this.j=(new Map).set(this.F,new olympe.dc.query.oa.Am);this.H=new Set(b.F);this.Hd=-1;this.N=!1;this.R=null;this.Y=olympe.dc.Ia.empty();this.Me=this.D=null;a=Nh(b);a.forEach(c=>{const d=c.T();this.oa.set(d,c.N());this.j.set(d,c.ha())});b=b.$g();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.Hd=c;break}}}remove(a,b=this.F,c='root'){b=
676
+ this.j.get(b);if(null==b?0:b.remove(a,c))if(Qh(this),!b.has(a)){let d;null==(d=this.Me)||d.stop(a);return!0}return!1}Nc(a){const b=a.D,c=olympe.V.tb(b);a=Nh(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.Nc(f))?n:!1});e.set(f.T(),h);return 0<h.length})}};function Yh(a){if(!olympe.dc.ia().Ob(a,olympe.dm.Property))throw new olympe.dc.query.yd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
677
+ function Zh(a){var b=olympe.dc.query.Aa.j.tr;const c=olympe.dc.query.Aa.j.Po,d=olympe.dc.query.Aa.j.Nj,e=olympe.dc.query.Aa.j.Ap,f=olympe.dc.query.Aa.j.aq,g=olympe.dc.query.Aa.j.Kq,h=olympe.dc.query.Aa.j.Jn,k=olympe.dc.query.Aa.j.pq;switch(a.pr){case b:return new olympe.dc.query.Z.Fm(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.ve(a.p,b,olympe.dc.ia());case d:return new olympe.dc.query.Z.sf(a.p,
678
+ a.s,olympe.dc.ia(),a.c);case e:return new olympe.dc.query.Z.Hi(olympe.dc.ia(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Z.fe(Zh(a.v));case g:return new olympe.dc.query.Z.Df(a.p,new RegExp(a.r),olympe.dc.ia(),a.c);case k:return new olympe.dc.query.Z.Be(...a.p.map(l=>Zh(l)));case h:return new olympe.dc.query.Z.Jd(...a.p.map(l=>Zh(l)));default:return null}}
679
+ olympe.dc.query.Aa=class{observe(){}nb(){}compile(){return[[this]]}ud(){return new olympe.dc.query.Z.fe(this)}Db(){}Nc(){}clear(){}ga(){}Vc(){}toString(){}Ea(a){return this===a}static Ey(...a){return new olympe.dc.query.Z.Fm(a)}static Ea(a,b){Yh(a);return new olympe.dc.query.Z.ve(a,b,olympe.dc.ia())}static contains(a,b,c=!0){Yh(a);return new olympe.dc.query.Z.sf(a,b,olympe.dc.ia(),c)}static vz(a,b,c=!0){Yh(a);return new olympe.dc.query.Z.Df(a,b,olympe.dc.ia(),c)}static Vk(a,b,c=!0){Yh(a);return new olympe.dc.query.Z.Hi(olympe.dc.ia(),
680
+ a,b,!1,c)}static Cj(a,b,c=!0){Yh(a);return new olympe.dc.query.Z.Hi(olympe.dc.ia(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Z.Jd(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
681
+ return new olympe.dc.query.Z.Be(...a)}static ud(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.Z.fe(a)}};olympe.dc.query.Aa.not=olympe.dc.query.Aa.ud;olympe.dc.query.Aa.or=olympe.dc.query.Aa.or;olympe.dc.query.Aa.and=olympe.dc.query.Aa.and;olympe.dc.query.Aa.smallerThan=olympe.dc.query.Aa.Cj;olympe.dc.query.Aa.greaterThan=olympe.dc.query.Aa.Vk;
682
+ olympe.dc.query.Aa.regex=olympe.dc.query.Aa.vz;olympe.dc.query.Aa.contains=olympe.dc.query.Aa.contains;olympe.dc.query.Aa.equals=olympe.dc.query.Aa.Ea;olympe.dc.query.Aa['in']=olympe.dc.query.Aa.Ey;olympe.dc.query.Aa.j={tr:0,Po:1,Nj:2,Ap:3,aq:4,Kq:5,pq:6,Jn:7};function Nh(a){return Array.from(a.oa)}
683
+ function $h(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Jb(c,c.Ka()===olympe.dc.ua.ORIGIN?e:d);if(0>a.cursor)e=a.j.Ne;else if(e=a.oa[a.cursor],null!==e.wa)e=e.wa;else{var f=olympe.dc.ua.ORIGIN;e=olympe.dc.ia().Jb(e.relation,e.relation.Ka()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(a.db.Ga(olympe.dc.CloudObject)&&(null===d||!a.db.Qf(d,e)&&!a.db.Qf(e,d)))throw new olympe.dc.query.yd(`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=
684
+ 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 ai(a,b=a.cursor){return 0<=b?a.oa[b].T():olympe.V.tb(a.D)}
685
+ function bi(a,b,c,d={}){var e=olympe.dc.Lb.fg;const f=(null==d?0:d.jd)?d.jd:olympe.dc.ma.nc.qf,g=(null==d?0:d.Dn)?'__code-as-data__':void 0;b=olympe.dc.fa(b);const h=olympe.dc.ae().Ke(b);b=(new olympe.dc.ma(b,h)).ie();b.oa=[f===olympe.dc.ma.nc.Jg?new olympe.dc.query.oa.$o(ai(b),e,c):new olympe.dc.query.oa.Kd(ai(b),e,c)];let k;b.H=null!=(k=null==d?void 0:d.zs)?k:!1;return b.observe(a,{jd:f,Kk:g})}
686
+ function ci(a){const b=0===a.F.size?a.ie():a;if(null!==b.j.Hd&&!b.F.has(ai(a,b.j.Hd)))throw new olympe.dc.query.yd('AndReturn was not called for the current level before sortBy operator');return b}function di(a,b){let c,d;return b.H||(null!=(d=null==(c=a.N)?void 0:c.has(b.T()))?d:!1)}
687
+ olympe.dc.ma=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Hd:null,Ne:null}){this.db=olympe.dc.ia();if('string'!==typeof a||''===a)throw new olympe.dc.query.yd('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.yd(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);
688
+ b=null!=b?b:olympe.dc.ae().Ke(a);b=new olympe.dc.ma(a,b);b.j.Ne=olympe.dc.ia().model(a);return b}static Ke(a,b,c){if(!olympe.dc.CloudObject.exists(b)&&!c)throw new olympe.dc.query.yd(`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.ae().fromModel(b);c=new olympe.dc.ma(a,c);c.j.Ne=olympe.dc.fa(b);return c}static Yk(a,b=!0,c){const d=olympe.dc.fa(a);var e=olympe.dc.ia();if(!e.ji(d))throw new olympe.dc.query.yd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);
689
+ a=null!=c?c:olympe.dc.ae().fromModel(d);a=new olympe.dc.ma(d,a);a.j.Ne=e.model(d);b&&(a=$h(a,new olympe.dc.query.oa.we(ai(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.oa.wh(ai(a),olympe.dc.CloudObject.instancesRel,!1);e.wa=d;return $h(b,e)}static Pb(a,b,c,d,e){var f;const g=null!=(f=null==e?void 0:e.jd)?f:olympe.dc.ma.nc.qf;f=(null==e?0:e.Dn)?'__code-as-data__':void 0;b=olympe.dc.fa(b);d=null!=d?d:olympe.dc.ae().Ke(b);d=(new olympe.dc.ma(b,d)).ie();b=g===olympe.dc.ma.nc.Jg;
690
+ d.oa=[b?new olympe.dc.query.oa.$o(ai(d),c):new olympe.dc.query.oa.Kd(ai(d),c)];let h;d.H=null!=(h=null==e?void 0:e.zs)?h:!1;let k;return d.observe(a,{jd:g,Kk:f,hj:null!=(k=null==e?void 0:e.hj)?k:b})}fb(a,b=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.yd(`The relation given to follow() is invalid: ${a}`);return $h(this,new olympe.dc.query.oa.wh(ai(this),a,b))}mg(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.yd(`The relation given to followRecursively() is invalid: ${a}`);
691
+ return $h(this,new olympe.dc.query.oa.we(ai(this),a,b,c))}ie(){const a=(new Set(this.F)).add(ai(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.Aa))throw new olympe.dc.query.yd(`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)}ij(){return this}wj(a,b=0){return new olympe.dc.ma(this.D,
692
+ this.source,this.oa,this.cursor,this.F,{Hd:this.j.Hd,max:a,offset:b,Ne:this.j.Ne})}fl(a,b=olympe.dc.query.kk.ASC){if(0>this.cursor)throw new olympe.dc.query.yd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');if(!olympe.dc.ia().Ob(a,olympe.dm.Property))throw new olympe.dc.query.yd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.oa[this.cursor],d={Hd:this.cursor,max:this.j.max,offset:this.j.offset,Ne:this.j.Ne},
693
+ 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)}$g(){const a=this.j.Hd;let b;return null!==a?null==(b=this.oa[a])?void 0:b.$g():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&&ai(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=ai(this,-1),c={limit:this.j.max,offset:this.j.offset,returned:this.F.has(b),
694
+ filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.ji(this.D)?c.dataType=olympe.dc.fa(this.D):(c.root=olympe.dc.fa(this.D),c.dataType=this.j.Ne);this.oa.forEach((d,e)=>{const f=d.T(),g=d.Vc();Object.assign(g,{returned:this.F.has(f),next:[]});a.set(f,g);g.sort&&this.j.Hd!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.oa.wh&&d.relation.Ea(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.oa.we&&d.relation.Ea(olympe.dc.CloudObject.extendedByRel))Object.assign(c,
695
+ g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}nb(a){const b=(null==a?0:a.jd)?a.jd:olympe.dc.ma.nc.lk;let c;return olympe.dc.query.Uk().executeQuery(ci(this),b,{Xh:null!=(c=null==a?void 0:a.Kk)?c:null==a?void 0:a.cacheId,Ac:null==a?void 0:a.Ac}).then(d=>{let e;return null!=(e=null==d?void 0:Oh(d))?e:olympe.dc.Ia.empty()})}Fc(){return Oh(ei(olympe.dc.query.Uk(),ci(this)))}observe(a,b){const c=(null==b?0:b.jd)?b.jd:olympe.dc.ma.nc.qf;a='function'===typeof a.Cb?a.Cb():
696
+ a;let d;return fi(olympe.dc.query.Uk(),ci(this),a,olympe.dc.Ja.SELF,c,{Xh:null!=(d=null==b?void 0:b.Kk)?d:null==b?void 0:b.cacheId,Ac:null==b?void 0:b.Ac,hj:null==b?void 0:b.hj}).pipe(rxjs.operators.map(e=>Oh(e)),rxjs.operators.distinctUntilChanged())}T(){null===this.id&&(this.id=olympe.V.tb(this.D+Nh(this).map(a=>a.H()).join()+Array.from(new Set(this.F)).sort().toString()+this.j.Hd+this.j.max+this.j.offset));return this.id}sb(){return this.source}ga(){let a;return{b:this.D,p:this.oa.map(b=>b.ga()),
697
+ r:Array.from(this.F),s:this.source,e:{m:this.j.max,o:this.j.offset,s:this.j.Hd,rm:null!=(a=this.j.Ne)?a:this.db.model(this.D)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ga(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.Fc;olympe.dc.ma.prototype.execute=olympe.dc.ma.prototype.nb;
698
+ 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.fl;olympe.dc.ma.prototype.limit=olympe.dc.ma.prototype.wj;olympe.dc.ma.prototype.cast=olympe.dc.ma.prototype.ij;olympe.dc.ma.prototype.filter=olympe.dc.ma.prototype.filter;olympe.dc.ma.prototype.andReturn=olympe.dc.ma.prototype.ie;olympe.dc.ma.prototype.followRecursively=olympe.dc.ma.prototype.mg;olympe.dc.ma.prototype.follow=olympe.dc.ma.prototype.fb;
699
+ olympe.dc.ma.followRule=olympe.dc.ma.Pb;olympe.dc.ma.instancesOf=olympe.dc.ma.Yk;olympe.dc.ma.fromTag=olympe.dc.ma.Ke;olympe.dc.ma.from=olympe.dc.ma.from;olympe.dc.ma.nc={qf:1,lk:2,Jg:3};olympe.dc.ma.j={ul:'cacheBucketName',Gp:'isCacheable'};function gi(a){null===a.Fa&&null===a.j&&(a.Fa=Bf(a.F))}
700
+ olympe.dc.query.zd=class extends olympe.dc.Ag{constructor(a){super(a,null);this.F=new olympe.dc.transaction.Ce}static nj(a){const b=new olympe.dc.query.zd(`DataResult_${a.T()}`);b.D=a.sb();return b}static j(a){const b=new olympe.dc.query.zd(a.i);let c;b.D=null!=(c=a.s)?c:null;let d;b.Lk=null!=(d=a.t)?d:null;let e;b.Fa=null!=(e=a.p)?e:[];return b}qc(a){gi(this);return super.qc(a)}jc(){gi(this);return super.jc()}Rk(){gi(this);return super.Rk()}create(a,b,c){this.F.Oc(a,this.D,c,b);return this}Oa(a,
701
+ b,c){this.F.Oa(a,b,c,null,null);return this}ga(){return super.ga()}};olympe.dc.query.zd.prototype.createRelation=olympe.dc.query.zd.prototype.Oa;olympe.dc.query.zd.prototype.create=olympe.dc.query.zd.prototype.create;olympe.dc.query.zd.fromQuery=olympe.dc.query.zd.nj;function ei(a,b){const c=new olympe.dc.query.Aq(a.G,b);if(a.D.view.Ga(b.D)){Th(c,b.D);for(const d of Nh(b))d.nb(c)}return c}
702
+ function fi(a,b,c,d,e,f){const g=b.T();let h=a.j.get(g);if(!h){var k=b.sb();a.G.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.Ac||a.H&&k===olympe.dc.Ja.SERVER?[]:Array.from(a.j.values());h=new olympe.dc.query.Iq(a.G,a.D,b,e,a.R.bind(a,e,f));a.j.set(g,h);hi(h,l=>a.F.add(l));h.start(k)&&(null==f?0:f.Xh)&&ii(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=>
703
+ {const n=()=>{p&&c.Gs(p);l.complete();if(q){var r=q;const u=a.j.get(g);a.G.debug(`${d} unsubscribed from ${g}`);if(null==u)r=0;else{var t=u;t.H.delete(r)&&t.G.debug(`Remove subscriber ${d} for query ${t.query.T()}, now have ${t.H.size} subscribers`);d!==olympe.dc.Ja.SELF&&(t.$--,0===t.$&&Wh(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),u.destroy())}},p=c.Td(n),q=ji(h,d,l);return n})}
704
+ function ki(a){a.F.forEach(b=>{let c;null==(c=a.j.get(b))||li(c)});a.F.clear()}function mi(a,b,c,d){return w(function*(){const e=null!=d?d:c===olympe.dc.ma.nc.Jg;if(b instanceof ReadableStream)yield vg(a.D,b,{Sm:e});else{var f;if(f=b instanceof olympe.dc.Ag)f=b.T(),f=!a.N.H.has(f);f&&a.D.Tc(b,{Sm:e})}})}function ni(a){a.G.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.j.Cg,olympe.dc.Ja.SERVER);return a.Tb.request(b).then(c=>{a.D.Tc(c)})}
705
+ function oi(a,b){const c=b.sb();if(c===olympe.dc.Ja.SELF||a.H&&c===olympe.dc.Ja.SERVER)return Promise.resolve(!0);a=Array.from(a.j.values()).filter(d=>d.Nc(b)).map(d=>new Promise(e=>d.hd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function ii(a,b,c,d){return w(function*(){var e=b.sb();e=wf(wf(new olympe.dc.Request(olympe.dc.Request.j.Lg,e,b),olympe.dc.ma.j.Gp,c===olympe.dc.ma.nc.Jg),olympe.dc.ma.j.ul,null==d?void 0:d.Xh);return a.Tb.request(e)})}
706
+ function pi(a,b,c){const d=[];for(const e of a.j.values())qi(e,b,c)&&d.push(ii(a,e.query,olympe.dc.ma.nc.lk,{}).then(f=>mi(a,f,olympe.dc.ma.nc.lk)));return Promise.all(d).then(()=>{})}
707
+ olympe.dc.query.Bv=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Tb=d;this.H=e;this.j=new Map;this.F=new Set;wg(b,()=>ki(this));zf(d,olympe.dc.Request.j.zo,f=>{mi(this,f.content,olympe.dc.ma.nc.qf).catch(g=>this.G.error(`Error while applying data notification on DB: ${g}`))})}executeQuery(a,b,c){const d=this;return w(function*(){const e='boolean'===typeof c.Ac?c.Ac:yield oi(d,a);if(!e||(null==c?0:c.Xh))try{const f=yield ii(d,a,b,c);e||(yield mi(d,f,b))}catch(f){return d.G.error(`Error while sending a query to data source ${a.sb()}: ${f}`),
708
+ null}return ei(d,a)})}R(a,b,c,d,e,f){const g=c.sb();if(g===olympe.dc.Ja.SELF||b.Ac||this.H&&g===olympe.dc.Ja.SERVER)return e(),null;if(a!==olympe.dc.ma.nc.qf)return ii(this,c,a,b).then(r=>{var t=r;r instanceof ReadableStream&&(t=(t=d())?r.pipeThrough(t):r);return mi(this,t,a,b.hj)}).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`);ii(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.`),
709
+ Promise.resolve();var u=t;t instanceof ReadableStream&&(u=(u=d())?t.pipeThrough(u):t);return mi(this,u,a,b.hj).then(()=>{h.forEach(x=>mi(this,x,a))}).finally(()=>{h=null})}).then(e).catch(f)},n=c.T();l(!1);const p=wf(new olympe.dc.Request(olympe.dc.Request.j.pk,g,c),olympe.dc.ma.j.ul,null==b?void 0:b.Xh),q=this.Tb.subscribe(p,l.bind(this,!0)).pipe(nb(olympe.L.errors.pp,()=>{},0)).pipe(nb(olympe.L.errors.eo,(r,t)=>{this.G.debug(`Data Provider: Subscribe to topic ${r.T()} now that we are back online, after waiting for ${t}ms`);
710
+ l(!0)},0)).subscribe(rxjs.Subscriber.create(r=>{Array.isArray(h)?h.push(r):mi(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 ri(a){const b=olympe.dc.ia();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ga(g)?olympe.dc.CloudObject.get(g):(olympe.ja.$a('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.Ia.create(d,a.a,a.r)}
711
+ olympe.dc.Ia=class{constructor(){this.j=[];this.D=new Map;this.F=[];this.H=[];this.hash=''}static empty(){return new olympe.dc.Ia}[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()}Oe(){return this.j.map(a=>this.D.get(a))}size(){return this.j.length}has(a){return this.D.has(a)||this.Oe().includes(a)}indexOf(a){return null===
712
+ a||void 0===a?-1:'string'===typeof a?this.j.indexOf(a):this.Oe().indexOf(a)}get(a){return(a=this.D.get(a))?a:null}Gc(){return this.le(0)}le(a){return a<this.j.length?this.D.get(this.j[a]):null}push(...a){const b=this.Oe();b.push(...a);return b}pop(){if(0===this.j.length)return[];const a=this.Oe();a.pop();return a}shift(){if(0<this.j.length){const a=this.Oe();a.shift();return a}return[]}filter(a){return this.Oe().filter(a)}find(a){return(a=this.Oe().find(a))?a:null}forEach(a){this.j.forEach((b,c)=>
713
+ a(this.D.get(b),c))}map(a){return this.Oe().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Ia.create(b,Array.from(this.F),Array.from(this.H))}reduce(a,b){return this.Oe().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.Ia.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Oe()}oj(){return this.F.map(a=>
714
+ this.D.get(this.j[a]))}tj(){return this.H.map(a=>{a=a.split('.');return 1===a.length?a[0]:a})}static from(a,b,{Hb:c,Hd:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ia(),q=c.Ki===olympe.dc.query.kk.ASC?1:-1,r=c.$g(),t=c.Qa();b.sort((u,x)=>{x=x[d];u=p.Qa(u[d],t);x=p.Qa(x,t);return null===u?-q:null===x?q:q*r(olympe.dc.mb.Bc(u),olympe.dc.mb.Bc(x))})}else b.sort((p,q)=>p.reduce((r,t,u)=>r||t.localeCompare(q[u]),0));if(0<e||-1<f)b=b.slice(e,-1<f?e+f:void 0);c=olympe.V.tb(b.flat().join(''));
715
+ 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.Ia.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Ia;e.j=a.map(f=>f[0]);e.D=new Map(a);e.hash=d||olympe.V.tb(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);
716
+ return{k:this.j,a:this.F,r:this.H}}};olympe.dc.Ia.prototype.getRemoved=olympe.dc.Ia.prototype.tj;olympe.dc.Ia.prototype.getAdded=olympe.dc.Ia.prototype.oj;olympe.dc.Ia.prototype.concat=olympe.dc.Ia.prototype.concat;olympe.dc.Ia.prototype.reduce=olympe.dc.Ia.prototype.reduce;olympe.dc.Ia.prototype.sort=olympe.dc.Ia.prototype.sort;olympe.dc.Ia.prototype.map=olympe.dc.Ia.prototype.map;olympe.dc.Ia.prototype.forEach=olympe.dc.Ia.prototype.forEach;olympe.dc.Ia.prototype.find=olympe.dc.Ia.prototype.find;
717
+ olympe.dc.Ia.prototype.filter=olympe.dc.Ia.prototype.filter;olympe.dc.Ia.prototype.shift=olympe.dc.Ia.prototype.shift;olympe.dc.Ia.prototype.pop=olympe.dc.Ia.prototype.pop;olympe.dc.Ia.prototype.push=olympe.dc.Ia.prototype.push;olympe.dc.Ia.prototype.getAt=olympe.dc.Ia.prototype.le;olympe.dc.Ia.prototype.getFirst=olympe.dc.Ia.prototype.Gc;olympe.dc.Ia.prototype.get=olympe.dc.Ia.prototype.get;olympe.dc.Ia.prototype.indexOf=olympe.dc.Ia.prototype.indexOf;olympe.dc.Ia.prototype.has=olympe.dc.Ia.prototype.has;
718
+ olympe.dc.Ia.prototype.size=olympe.dc.Ia.prototype.size;olympe.dc.Ia.prototype.toArray=olympe.dc.Ia.prototype.Oe;olympe.dc.Ia.prototype.keys=olympe.dc.Ia.prototype.keys;olympe.dc.Ia.prototype.values=olympe.dc.Ia.prototype.values;olympe.dc.Ia.prototype.entries=olympe.dc.Ia.prototype.entries;olympe.dc.Ia.empty=olympe.dc.Ia.empty;function si(a){return 1<a.size()?(olympe.ja.$a('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Gc()||null}olympe.dc.nd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.nd(olympe.dc.ma.from(a))}fb(a){return new olympe.dc.nd(this.query.fb(a))}ij(){return this}nb(a){return this.query.nb(a).then(b=>si(b))}Fc(){return si(this.query.Fc())}};olympe.dc.nd.prototype.executeFromCache=olympe.dc.nd.prototype.Fc;
719
+ olympe.dc.nd.prototype.execute=olympe.dc.nd.prototype.nb;olympe.dc.nd.prototype.cast=olympe.dc.nd.prototype.ij;olympe.dc.nd.prototype.follow=olympe.dc.nd.prototype.fb;const ti=olympe.dc.ua.ORIGIN,ui=olympe.dc.ua.DESTINATION;function hi(a,b){Ph(a.j,()=>{a.gb()||null!==a.D||b(a.query.T())})}function ji(a,b,c){const d=a.da;a.da++;a.H.set(d,c);b===olympe.dc.Ja.SELF?a.hd(e=>e?c.error(e):c.next(a.j)):(a.$++,1===a.$&&a.hd(()=>Vh(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.H.size} subscribers`);return d}
720
+ function qi(a,b,c){if(a.query.sb()!==b)return!1;c.qc(a.ha);(b=a.ha.flush())&&a.G.debug(`Subscription ${a.query.T()} is considered as obsolete after the transaction ${c.T()} applied on DB`);return b}function li(a){Xh(a.j);a.H.forEach(b=>{b.next(a.j)})}
721
+ function vi(a,b,c){const d=[];let e=!1;const f=new olympe.async.mk(olympe.C.ah());for(const g of b)if(g.Nc(a.query)&&(e||(e=!0),f.add(h=>g.hd(k=>{!k&&d.push(g);h()}))),null!==g.D&&di(a.query,g.query)){let h;null==(h=a.R)||h.push(g)}bd(f,g=>c(g?d:[]));f.start();return e}
722
+ function wi(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,u,x,y)=>r.forEach(z=>z(t,u,x,y)):()=>{}},e=Nh(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 u;c.set(t,(null!=(u=c.get(t))?u:new Set).add(g))}const h=a.db,k=a.query.D,l=olympe.V.tb(k),n=sf(h,k,(q,r)=>{q?Th(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.Y)||p.push(()=>{qf(h,k,n)});xi(a)}
723
+ function yi(a){const b=a.Ha(a.query,a.cb.bind(a),()=>{null===a.D||a.gb()||wi(a)},d=>{a.gb()||(a.G.error(`Error while getting data from data source (${a.query.sb()}) to ensure coverage of the query ${a.query.T()}: ${d}`),xi(a))});let c;b&&(null==(c=a.Y)||c.push(b))}function zi(a,b){a.N.delete(b);0===a.N.size&&(a.N=null,Promise.resolve().then(()=>{!a.gb()&&yi(a)}))}function xi(a){const b=a.D;a.D=null;null==b||b.forEach(c=>c())}
724
+ olympe.dc.query.Iq=class{constructor(a,b,c,d,e){this.G=a;this.wa=b;this.db=b.view;this.query=c;this.jd=d;this.j=new olympe.dc.query.Aq(this.G,c);this.$=0;this.da=1;this.Y=[];this.H=new Map;this.D=[()=>Xh(this.j)];this.Ha=e;this.ha=new Ai(a,this.db,c,this.j);this.F=this.N=null;this.R=[]}start(a){return vi(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)}),wi(this)):yi(this)})}Nc(a){return!this.gb()&&this.query.sb()===a.sb()&&(this.query.T()===a.T()||
725
+ (null===this.D||this.query.D===a.D)&&this.j.Nc(a))}hd(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=>zi(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}cb(){const a=
726
+ olympe.dc.ma.nc.Jg;if(this.jd===a)return olympe.V.stream.tap(c=>{c=c.Rk().filter(d=>d.o===olympe.dc.Lc.j).map(d=>d.t);this.wa.je(c,'Batch mode')});let b;if(0<(null==(b=this.R)?void 0:b.length)){const c=this.R.filter(e=>e.jd===a).map(e=>new Promise(f=>e.hd(f))),d=this.R.filter(e=>e.jd!==a).map(e=>new Promise(f=>e.hd(f)));this.R=void 0;return new TransformStream({start:()=>Promise.all(c),flush:()=>Promise.all(d)})}return null}};function Bi(a,b){return a.F.has(ui+b)||a.F.has(ti+b)}
727
+ class Ai{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 Nh(c)){a=f.T();this.R.push(a);if(f instanceof olympe.dc.query.oa.Kh){a=f.relation;a=`${a.Ka()}${a.X()}`;let g;b=null!=(g=this.F.get(a))?g:[];b.push(f);this.F.set(a,b)}Ci(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}Oc(){}Wc(a,b){if(!(this.j||
728
+ !this.N&&this.db.Ga(a))){var c;this.j||(this.j=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&Sh(this.H,a,e)))}}D(a){this.j||this.db.Ga(a)&&!this.N||this.j||(this.j=this.R.some(b=>Sh(this.H,a,b)))}Oa(a,b,c){if(!this.j&&Bi(this,a)){var d=this.db.Ga(b),e=this.db.Ga(c);if(d&&!e||!d&&e){const f=this.F.get(ui+a);a=this.F.get(ti+a);this.j||(this.j=d&&(null==f?void 0:f.some(g=>Sh(this.H,b,g.j)))||e&&(null==a?void 0:a.some(g=>Sh(this.H,c,g.j))))}}}hc(a,b,c){if(!this.j&&this.N&&Bi(this,a)&&this.db.As(b,
729
+ new olympe.dc.Ra.Relation(a),c)){const d=this.F.get(ui+a);a=this.F.get(ti+a);const e=this.H;this.j||(this.j=(null==d?void 0:d.some(f=>Sh(e,b,f.j)&&Sh(e,c,f.T())))||(null==a?void 0:a.some(f=>Sh(e,c,f.j)&&Sh(e,b,f.T()))))}}}olympe.dc.query.Iq.xa=[olympe.dc.Writable];function Di(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
730
+ olympe.dc.query.Relation=class extends olympe.dc.Ra.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.Ka())+', ';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.Ka(),null!=b?b:a instanceof olympe.dc.ba.Fe)}$b(){const a=
731
+ olympe.dc.ua.DESTINATION,b=olympe.dc.ua.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}T(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.P={Ca:'dc.query.Logger',nk:'dc.query.QueryProcessor'};olympe.W.config(function(a){E(a,olympe.dc.query.P.Ca,[olympe.ja.P.Da],b=>b.cd('query'));D(a,olympe.dc.query.P.nk,olympe.dc.query.Bv,olympe.dc.query.P.Ca,olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.Ng,new olympe.W.pa(olympe.dc.U.Mh))});olympe.W.run([olympe.dc.query.P.nk],a=>{olympe.dc.query.Uk=()=>a});olympe.dc.query.yd=class extends Error{};olympe.dc.query.Z={};olympe.dc.query.Z.Jd=class extends olympe.dc.query.Aa{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},[])}ud(){return new olympe.dc.query.Z.Be(...this.Z.map(a=>a.ud()))}Db(){return this.Z.flatMap(a=>a.Db())}Nc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b&&c.nb(a),!0)}observe(a,b,c){const d=
732
+ 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.tb('AND-'+b+a+h),f.bind(null,h))})}ga(){return{pr:olympe.dc.query.Aa.j.Jn,p:this.Z.map(a=>a.ga())}}Vc(){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.tb('AND-'+b+a+d))})}};olympe.dc.query.Z.sf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!1){super();this.La=olympe.dc.fa(a);this.substring=b;this.db=c;this.j=d}Db(){return[this.La]}Nc(a,b){return a instanceof olympe.dc.query.Z.sf&&a.La===this.La?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}Qa(){return this.La}nb(a){return this.apply(this.db.Qa(a,
733
+ this.La))}observe(a,b,c){Lg(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Bc(a);return'string'===typeof a?this.j?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.La+'-'+this.substring+'-'+this.j}clear(a,b){Mg(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}Vc(){return{name:'CONTAINS',property:this.Qa(),value:this.substring,caseSensitive:this.j}}ga(){return{pr:olympe.dc.query.Aa.j.Nj,
734
+ p:this.La,s:this.substring,c:this.j}}};olympe.dc.query.Z.ve=class extends olympe.dc.query.Aa{constructor(a,b,c){super();this.La=olympe.dc.fa(a);this.j=olympe.dc.mb.Bc(null!=b?b:null);this.db=c}Db(){return[this.La]}Nc(a){if(a instanceof olympe.dc.query.Z.ve&&this.La===a.La)if('object'===typeof this.j&&null!==this.j){if(this.j instanceof olympe.dc.CloudObject)return this.j.Ea(a.j);if(this.j instanceof Date)return a.j instanceof Date&&this.j.getTime()===a.j.getTime();if(this.j instanceof olympe.C.Color)return this.j.Ea(a.j)}else return this.j===
735
+ a.j;return!1}nb(a){return this.apply(this.db.Qa(a,this.La))}observe(a,b,c){Lg(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()));null===this.j&&null===this.db.Qa(a,this.La)&&c(!0)}clear(a,b){Mg(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Bc(a);return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Ea(this.j):a instanceof Date?this.j instanceof Date&&this.j.getTime()===a.getTime():a instanceof olympe.C.Color?a.Ea(this.j):!1:a===
736
+ this.j}toString(){let a,b;const c=null!=(b=null==(a=this.j)?void 0:a.toString())?b:'null';return'Equals-'+this.La+'-'+c}Vc(){return{name:'EQUALS',property:this.La,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.Aa.j.Po,p:this.La,t:a,v:b}}};function Ei(a,b,c){return olympe.V.tb(c+b+a.j+a.La)}
737
+ olympe.dc.query.Z.Hi=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.La=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}ud(){return new olympe.dc.query.Z.Hi(this.db,this.La,this.j,!this.D,!this.H)}Db(){return[this.La]}Nc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Z.Hi&&this.La===a.La?
738
+ 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}Qa(){return this.La}nb(a){return this.compare(this.db.Qa(a,this.La),this.F?this.db.Qa(a,this.j):this.j)}observe(a,b,c){this.F&&Lg(this.db,a,this.j,d=>{const e=this.db.Qa(a,this.La);null!==e&&c(this.compare(e,d))},Ei(this,a,b));Lg(this.db,a,this.La,d=>{const e=this.F?this.db.Qa(a,this.j):this.j;c(null!==e?this.compare(d,e):!0)},Ei(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.H?
739
+ this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){Mg(this.db,a,this.La,Ei(this,a,b));this.F&&Mg(this.db,a,this.j,Ei(this,a,b))}Vc(){return{name:'INEQUALITY_OPERATOR',property:this.Qa(),operator:this.D?'<':'>',strict:this.H,value:this.j}}ga(){return{pr:olympe.dc.query.Aa.j.Ap,p:this.La,b:this.j,l:this.D,s:this.H}}toString(){return(this.D?'LowerThan-':'GreaterThan-')+this.La+'-'+this.H+'-'+this.j}};olympe.dc.query.Z.fe=class extends olympe.dc.query.Aa{constructor(a){super();this.j=a}compile(){const a=this.j.ud();return this.Ea(a)?super.compile():a.compile()}ud(){return this.j}Db(){return this.j.Db()}Nc(a,b){return a instanceof olympe.dc.query.Z.fe?this.j.Nc(a.j,b):this.j.Nc(a,!b)}nb(a){return!this.j.nb(a)}observe(a,b,c){let d=null;this.j.observe(a,olympe.V.tb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Vc(){return{name:'NOT',predicate:this.j.Vc()}}ga(){return{pr:olympe.dc.query.Aa.j.aq,v:this.j.ga()}}toString(){return`NOT-${this.j.toString()}`}clear(a,
740
+ b){this.j.clear(a,olympe.V.tb('NOT'+b+a))}Ea(a){return a instanceof olympe.dc.query.Z.fe?this.j.Ea(a.j):!1}};olympe.dc.query.Z.Be=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){return this.Z.map(a=>a.compile()).flat()}ud(){return new olympe.dc.query.Z.Jd(...this.Z.map(a=>a.ud()))}Db(){return this.Z.flatMap(a=>a.Db())}Nc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b||c.nb(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=>
741
+ k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('OR-'+b+a+h),f.bind(null,h))})}Vc(){throw Error('toObject for OR predicate should not be called');}ga(){return{pr:olympe.dc.query.Aa.j.pq,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.tb('OR-'+b+a+d))})}};olympe.dc.query.Z.Df=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0){super();this.La=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}Db(){return[this.La]}Nc(a){return a instanceof olympe.dc.query.Z.Df&&this.La===a.La&&this.j.toString()===a.j.toString()}nb(a){return this.apply(this.db.Qa(a,this.La))}observe(a,b,c){Lg(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Bc(a);
742
+ return'string'===typeof a?(a=this.j.test(this.D?a:a.toLowerCase()),this.j.lastIndex=0,a):!1}toString(){return'Regex'+this.La+'-'+this.j.toString()+'-'+this.D}Vc(){return{name:'REGEX',property:this.La,pattern:this.j,caseSensitive:this.D}}ga(){return{pr:olympe.dc.query.Aa.j.Kq,p:this.La,r:this.j.source,c:this.D}}clear(a,b){Mg(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}};olympe.dc.query.Z.Fm=class extends olympe.dc.query.Aa{constructor(a){super();this.j=new Set(a.map(olympe.dc.fa))}Db(){return[]}Nc(a){return a instanceof olympe.dc.query.Z.Fm&&Array.from(a.j).every(b=>this.j.has(b))}nb(a){return this.j.has(a)}observe(a,b,c){c(this.j.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.j)}Vc(){return{name:'IS',tags:Array.from(this.j)}}ga(){return{pr:olympe.dc.query.Aa.j.tr,t:Array.from(this.j)}}};olympe.dc.query.oa={};function Ci(a){let b,c;const d=new Set(null!=(c=null==(b=a.D)?void 0:b.Db())?c:[]);let e;a.Hb&&d.add(null==(e=a.Hb)?void 0:e.Qa().X());return d}function Fi(a){if(!a.da){let b,c;a.da=null!=(c=null==(b=a.D)?void 0:b.compile())?c:[]}return a.da}function Gi(a,b){for(const c of b)if(a.some(d=>d.Nc(c,!1)))return!0;return!1}
743
+ function Hi(a,b){if(null===a.D)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.V.tb(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 Ii(a,b,c){if(null===a.Hb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Hb.Qa();h=olympe.V.tb(h+d);e?Lg(a.db,f,k,()=>{Qh(b)},h):Mg(a.db,f,k,h);c(e,f,g,h)}}
744
+ olympe.dc.query.oa.tm=class{constructor(a,b){this.db=olympe.dc.ia();this.j=a;this.optional=b;this.da=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.Kd(b,a.f);var c=a.o;const d=new olympe.dc.Ra.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.oa.we(b,d,a.s,c):new olympe.dc.query.oa.wh(b,d,c);void 0!==a.p&&(b.D=Zh(a.p));void 0!==a.c&&(c=b.T(),a=a.c,a=new olympe.dc.query.rf(c,new olympe.dc.Ra.Property(a.p),a.o),b.Hb=a);return b}N(){}H(){let a,
745
+ 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:''}`}Vc(){}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(){}ha(){return new olympe.dc.query.oa.Am}$(){}T(){this.id||(this.id=this.Y());return this.id}R(){return this.optional}Nc(a){const b=Fi(this);if(0===b.length)return!0;a=Fi(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
746
+ Gi(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.Jd?new olympe.dc.query.Z.Jd(...Array.from(c.Z),a):new olympe.dc.query.Z.Jd(b.D,a);return b}sort(a,b){const c=this.N();c.Hb=new olympe.dc.query.rf(this.T(),a,b);return c}$g(){return this.Hb}nb(a){if(null!==this.D){var b=this.T();for(const c of Rh(a,b))this.D.nb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.T();return Hi(this,Ii(this,a,(d,e,f,g)=>{(d?Th(a,e,c,f):a.remove(e,c,f))&&b(d,e,
747
+ f,g)}))}Ea(){}};olympe.dc.query.oa.Kh=class extends olympe.dc.query.oa.tm{constructor(a,b,c){super(a,c);this.relation=b;this.wa=null}};olympe.dc.query.oa.um=class{has(){}H(){}j(){}Rc(){}D(){}remove(){}};olympe.dc.query.oa.Kd=class extends olympe.dc.query.oa.tm{constructor(a,b,c){super(a,!1);this.Pb=b;this.F=null!=c?c:null}N(){return new olympe.dc.query.oa.Kd(this.j,this.Pb,this.F)}Y(){return olympe.V.tb(this.j+'followRules')}ha(){return new olympe.dc.query.oa.Hp(this.db,this.F)}$(a,b){return b instanceof olympe.dc.query.oa.Kd?[a]:[olympe.V.tb(a+'followRules')]}Nc(a){if(a instanceof olympe.dc.query.oa.Kh){const b=olympe.dc.ua.ORIGIN,c=olympe.dc.ua.DESTINATION,d=olympe.dc.fc.Yc,e=olympe.dc.fc.Ai,f=
748
+ olympe.dm.Relation.j.Qq,g=olympe.dm.Relation.j.yr;a=a.relation;const h=a.Ka(),k=a.X();return h!==c||k!==d&&k!==e?!!(Ug(this.db,a,this.Pb)&(a.Ka()===b?f:g)):!0}return a instanceof olympe.dc.query.oa.Kd?this.Pb===a.Pb:!1}nb(a){const b=this.T();for(const c of Rh(a,this.j))for(const d of Qf(this.db,c,this.Pb))Th(a,d,b,c)}observe(a,b){const c=this.T(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?Vg(this.db,g,this.Pb,(l,n,p,q,r)=>{p&&(p=q?Th(a,r,c,g):a.remove(r,c,g),null!==n&&Uh(a,q,l,n,g,r),p&&d(e,q,r,h))},k):
749
+ Wg(this.db,g,this.Pb,k);b(f,g,e,k)};return(e,f,g,h)=>{(e?Th(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,olympe.V.tb(h+f+this.toString()))}}ga(){return Object.assign(super.ga(),{f:this.Pb})}H(){return`followRulePart-${this.Pb}-${super.H()}`}Vc(){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})`}Ea(a){return a instanceof olympe.dc.query.oa.Kd&&this.Pb===a.Pb}toJSON(){return{type:'follow rule',
750
+ rule:`${this.db.name(this.Pb)} (${this.Pb})`}}R(){return!1}filter(){olympe.ja.$a('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ja.$a('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.oa.Kd.D='followRules';olympe.dc.query.oa.wh=class extends olympe.dc.query.oa.Kh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.oa.wh(this.j,this.relation,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.tb(this.j+this.relation.T())}$(a,b){if(b instanceof olympe.dc.query.oa.Kd)return[a];const c=[a+this.relation.T(),a+Di(this.relation).T()+!1,a+Di(this.relation).T()+!0,a+'followRules'].map(d=>olympe.V.tb(d));b instanceof olympe.dc.query.oa.we&&b.relation.Ea(this.relation)&&
751
+ c.push(a);return c}nb(a){const b=this.T();for(const c of Rh(a,this.j))this.db.ab(c,this.relation).forEach(d=>{Th(a,d,b,c)});super.nb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ka(),f=this.toString();return(g,h,k,l)=>{const n=olympe.V.tb(l+h+f);g?T(this.db,h,this.relation,(p,q)=>{Uh(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.Ka()})}H(){return`followPart-${this.relation.T()}-${super.H()}`}Vc(){const a=
752
+ {recursive:!1,relation:this.relation,filter:Fi(this).map(b=>b.map(c=>c.Vc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Qa(),order:this.Hb.Ki});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ka()}}Ea(a){return a instanceof olympe.dc.query.oa.wh&&this.relation.Ea(a.relation)}};olympe.dc.query.oa.we=class extends olympe.dc.query.oa.Kh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.F=c}ha(){return new olympe.dc.query.oa.Uq}N(){const a=new olympe.dc.query.oa.we(this.j,this.relation,this.F,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.tb(this.j+this.relation.T()+this.F)}$(a,b){if(b instanceof olympe.dc.query.oa.Kd)return[a];const c=[a+this.relation.T()+this.F,a+'followRules'].map(d=>olympe.V.tb(d));b instanceof olympe.dc.query.oa.we&&
753
+ b.relation.Ea(this.relation)&&c.push(a);return c}nb(a){const b=this.T();for(const c of Rh(a,this.j))this.F&&Th(a,c,b,c),this.db.eh(c,this.relation).forEach(d=>{Th(a,d,b,c)});super.nb(a)}observe(a,b){const c=this.relation.X(),d=this.relation.Ka(),e=(f,g,h,k)=>{const l=olympe.V.tb(k+g);f?T(this.db,g,this.relation,(n,p)=>{Uh(a,n,c,d,g,p);super.observe(a,(q,r,t,u)=>{b(q,r,t,u);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,
754
+ g,olympe.V.tb(h+g));e(f,g,g,h)}}ga(){return Object.assign(super.ga(),{s:this.F,t:this.relation.X(),d:this.relation.Ka()})}H(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.H()}`}Vc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:Fi(this).map(b=>b.map(c=>c.Vc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Qa(),order:this.Hb.Ki});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',
755
+ relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ka()}}Ea(a){return a instanceof olympe.dc.query.oa.we&&this.relation.Ea(a.relation)&&this.F===a.F}};olympe.dc.query.oa.$o=class extends olympe.dc.query.oa.Kd{observe(a,b){const c=this.T();return(d,e,f,g)=>{d?Th(a,e,c,e):a.remove(e,c,e);b(d,e,e,g)}}};olympe.dc.query.oa.Hp=class{constructor(a,b){this.db=a;this.origin=null;this.content=new Map;this.F=null!=b?b:null}Rc(){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,
756
+ b){a===this.origin&&(this.origin=null);if(null===this.origin||!this.db.Ga(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.Hp.xa=[olympe.dc.query.oa.um];olympe.dc.query.oa.Uq=class{constructor(){this.content=new Map}Rc(){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!=
757
+ (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.Uq.xa=[olympe.dc.query.oa.um];olympe.dc.query.oa.Am=class{constructor(){this.content=new Map}Rc(){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);
758
+ return b}};olympe.dc.query.oa.Am.xa=[olympe.dc.query.oa.um];olympe.dc.sources={};olympe.dc.sources.Yq=class extends Error{};olympe.dc.sources.Tj=class{T(){}init(){}destroy(){}request(){return w(function*(){})}subscribe(){}};const Ji=olympe.net.va.Nd.GET,Ki=olympe.net.va.Nd.Gh,Li=olympe.net.va.Nd.Dc,Mi=olympe.net.va.Nd.zq,Ni=olympe.net.va.Headers.xi,Oi=olympe.net.va.Headers.Vn,Pi=olympe.net.va.Vb.Eh,Qi=olympe.net.va.Vb.no,Ri=olympe.net.va.Vb.Yo,Si=olympe.net.va.Vb.Wi,Ti=olympe.net.va.Vb.gm;
759
+ function Ui(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.U.Pl)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.R.F('_DataSourcesHTTPService',b,[Ji,Ki,Li,Mi],(c,d,e)=>w(function*(){const f=d.get('sourceId');var g=a.F.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ia().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.ld(`No handler found for datasource ${f} called '${g}'`,Ti,'Invalid source id'))}h=c.method;const k=c.rj();try{var l=yield Vi(a,
760
+ k[Oi])}catch(r){return new olympe.net.ld(`Invalid token ${r}`,Ri,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.j.oc,t=olympe.dc.Request.j.Lg,u=olympe.dc.Request.j.Ze,x=olympe.dc.Request.j.Vg,y=olympe.dc.Request.j.oh,z=olympe.dc.Request.j.Yf,A=olympe.dc.Request.j.$f,K=olympe.dc.Request.j.hg;let X;switch(n){case r:break;case t:case u:case y:case x:X=a.D.N(p);break;case K:case z:case A:X={tag:e.get('tag'),model:e.get('model'),mimeType:k[Ni]};p instanceof Uint8Array&&
761
+ (X.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let xa;const ab=null!=(xa=k['X-Source-Origin'])?xa:olympe.dc.Ja.Af;var q=vf(new olympe.dc.Request(n,f,X,l),ab);const Pa=yield g(q);let Zc;void 0===Pa?Zc='':Pa instanceof Blob||Pa instanceof Uint8Array||Pa instanceof ArrayBuffer||'function'===typeof(null==Pa?void 0:Pa.pipe)?Zc=Pa:Zc=JSON.stringify(a.D.ga(Pa));return new olympe.net.ld(Zc,h===Mi?Qi:Pi)}catch(r){return r instanceof olympe.dc.sources.Yq?new olympe.net.ld(`Authorization error: ${r}`,
762
+ Ri,'Forbidden'):new olympe.net.ld(`Internal server error: ${r}`,Si,'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 Wi(a){a.R.Y('_DataSourcesHTTPService').catch(b=>{a.G.error(`An error occurred while stopping the data sources http service: ${b}`)})}function Xi(a,b,c){0===a.F.size&&Ui(a);a.F.set(b,c);return()=>{a.F.delete(b);0===a.F.size&&Wi(a)}}
763
+ function Yi(a,b,c){c=b instanceof olympe.dm.DataSource?b.Lf(c):Zi(b,c);null===c&&a.G.error(`Impossible to build URL for data source ${b}`);return c}
764
+ function $i(a,b,c){if(b===olympe.dc.Ja.SERVER){var d;return null!=(d=Ld(a.H,a.da.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.$.sb(b);e=olympe.dc.sources.U.xh;const f=olympe.dc.sources.U.vf,g=olympe.dc.sources.U.Ei,h=olympe.dc.sources.U.Pl;let k;e=`${Yi(a,null!=d?d:b,g)?'https':'http'}://${Yi(a,null!=d?d:b,e)}:${null!=(k=Yi(a,null!=d?d:b,f))?k:Yi(a,null!=d?d:b,g)?443:80}`+`/${Yi(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.N.set(b,e)}return`${e}/${c}`}
765
+ function aj(a,b){return b instanceof olympe.net.Gi?Nd(a.H,b,rd(a.Y).Cd()):Promise.reject('No http request to send')}function bj(a,b){var c=$i(a,b.ic(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.ic()}`);const d=b.content,e=JSON.stringify(a.D.ga(d));c=N(c,Ki,e,olympe.net.va.ResponseType.JSON);Ac(c,{['X-Source-Origin']:b.origin,[Ni]:'application/json'});return aj(a,c).then(f=>(f=f.getData())?a.D.N(f):olympe.dc.query.zd.nj(d))}
766
+ function cj(a,b){var c=$i(a,b.ic(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.ic()}`);const d=JSON.stringify(a.D.ga(b.content));c=N(c,Ki,d);Ac(c,{['X-Source-Origin']:b.origin,[Ni]:'application/json'});return aj(a,c).then(e=>Number.parseInt(e.getData(),10))}function Vi(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.Y.hh(b,(e,f)=>{e?d(e):c(f)})})}
767
+ olympe.dc.sources.Wt=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.Xb('Http service of remote data provider');this.N=new Map;this.j=new Map;this.da=new Map([[olympe.dc.Request.j.Cg,olympe.L.Yb.Cg],[olympe.dc.Request.j.$f,olympe.L.Yb.Wj],[olympe.dc.Request.j.hg,olympe.L.Yb.Wj],[olympe.dc.Request.j.Yf,olympe.L.Yb.Wj],[olympe.dc.Request.j.Xn,olympe.L.Yb.Wn],[olympe.dc.Request.j.Oq,olympe.L.Yb.Nq],[olympe.dc.Request.j.mp,olympe.L.Yb.lp],
768
+ [olympe.dc.Request.j.Lg,olympe.L.Yb.ho],[olympe.dc.Request.j.Vg,olympe.L.Yb.TRANSACTION]])}Hc(a){var b=$i(this,a.ic(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.ic()}`);b=Cc(N(b,Ji),olympe.net.va.ResponseType.JSON);Ac(b,{['X-Source-Origin']:a.origin});return aj(this,b).then(c=>c.getData())}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.ic(),f=$i(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);
769
+ const g=N(e===olympe.dc.Ja.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,Mi,d);Ac(g,{[Ni]:'application/octet-stream'});e!==olympe.dc.Ja.SERVER&&Ac(g,{['X-Source-Origin']:a.origin});return aj(this,g).then(()=>(new URL(g.j())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=$i(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Ja.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,Li,b);d!==olympe.dc.Ja.SERVER&&Ac(e,
770
+ {['X-Source-Origin']:a.origin});return aj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=$i(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,bi:k})});if(this.j.has(b))return f;this.j.set(b,g);e=N(d===olympe.dc.Ja.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,Ji,void 0,olympe.net.va.ResponseType.Oh);d!==olympe.dc.Ja.SERVER&&
771
+ Ac(e,{['X-Source-Origin']:a.origin});aj(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.bi(`${h}`))}).finally(()=>{this.j.delete(b)});return f}};olympe.dc.sources.Fp=class{constructor(a,b){this.G=a;this.Tb=b}};olympe.dc.sources.Fp.Vb={Yi:0,mC:1,nC:3,JB:4};const dj=olympe.dc.Request.j.oc,ej=olympe.dc.Request.j.Lg,fj=olympe.dc.Request.j.pk,gj=olympe.dc.Request.j.hg,hj=olympe.dc.Request.j.$f,ij=olympe.dc.Request.j.Yf,jj=olympe.dc.Request.j.ti,kj=olympe.dc.Request.j.oh,lj=olympe.dc.Request.j.Ze,mj=olympe.dc.Request.j.Vg;
772
+ function nj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.V.Nh(6E4),hb(a.D,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),ib(a.D,()=>{a.D=null}));let d;const e=null!=(d=a.D.get(c))?d:new olympe.dc.db.ec(c);b.qc(e);fb(a.D.j,c)||a.D.set(c,e)}
773
+ function oj(a,b){const c=b.T();let d,e;const f=null!=(e=null==(d=a.D)?void 0:d.get(c))?e:new olympe.dc.db.ec(c);let g;null==(g=a.D)||g.delete(c);b.qc(f);return a.applyTransaction(f,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function pj(a,b){const c=rxjs.defer(()=>a.j.executeQuery(b));return 0<a.R?rxjs.interval(a.R).pipe(rxjs.operators.switchMap(()=>c)):c}
774
+ olympe.dc.sources.Tp=class{constructor(a,b){this.G=a;this.j=b;this.Tb=null;this.N=olympe.dc.query.Uk();this.H=olympe.dc.gs();this.F=new olympe.C.Xb('Context of source '+this.T());let c;this.R=null!=(c=b.Lf(olympe.dc.sources.U.qm))?c:-1;this.D=null}T(){return this.j.T()}init(a){this.Tb=a;if(this.T()===olympe.dc.Ja.SELF)return this;(new Promise((b,c)=>{let d=!0;qj(this.j,this.F).subscribe(rxjs.Subscriber.create(e=>{if(this.G.j()){this.G.debug(`Data source ${this.j.name()} has loaded ${e.size()} data types in its cache:`);
775
+ 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 dj:const d=olympe.dm.DataSource.oc.Ab,e=olympe.dm.DataSource.oc.Jh;
776
+ return this.j.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case ej:return this.j.executeQuery(b);case jj:return c=b.jc(),nj(this,c),this.H.Tc(rf(c)),Promise.resolve();case lj:case mj:const f=b.jc();return this.applyTransaction(f,c===mj).finally(()=>{if(a.origin===olympe.dc.Ja.SELF){var g=f.T();g=vf(new olympe.dc.Request(olympe.dc.Request.j.Xj,olympe.dc.Ja.SELF,{id:g,finalize:olympe.dc.transaction.Ef.j.Oi,error:null}),this.T());let h;null==(h=this.Tb)||h.vd(g)}});case kj:return oj(this,
777
+ b.jc());case gj: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 hj:return this.j.downloadFileContent(b.tag,b.model);case ij:return this.j.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===fj){const b=a.content;a=a.origin;return a===olympe.dc.Ja.SELF?pj(this,b):fi(this.N,
778
+ b,this.F,a,olympe.dc.ma.nc.qf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Me)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>rf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return w(function*(){var d=rj(a);yield c.j.applyTransaction(d,{batch:b});d=Date.now();yield pi(c.N,c.T(),a);c.H.Tc(rf(a,d));return d})}};olympe.dc.sources.Tp.xa=[olympe.dc.sources.Tj];function rj(a){const b=olympe.dc.sources.gg.j.ut,c=olympe.dc.sources.gg.j.qw,d=olympe.dc.sources.gg.j.At,e=olympe.dc.sources.gg.j.vt,f=olympe.dc.sources.gg.j.Bt,g=[],h=[],k=[],l=[],n=[];a.Bb.forEach((p,q)=>{const r=p.Wb();p.D()?g.push(sj(b,q,r,p.R()?p.Db():null)):p.td()?k.push(sj(d,q,r,null,p.H())):p.R()&&h.push(sj(c,q,r,p.Db()));for(const [t,u,x]of p.Ed())p=a.Qc(u),x?l.push(new tj(e,t,q,u,r,p.Wb())):n.push(new tj(f,t,q,u,r,p.Wb()))});return n.concat(k,g,h,l)}
779
+ function sj(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new uj(a,b,c,d,e)}olympe.dc.sources.gg=class{constructor(a){this.type=a}};class uj extends olympe.dc.sources.gg{constructor(a,b,c,d,e){super(a);this.object=b;this.model=c;this.properties=null!=d?d:null;this.deleteRules=null!=e?e:olympe.dc.Lb.NONE}}
780
+ class tj extends olympe.dc.sources.gg{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.gg.j={ut:'CREATE',qw:'UPDATE',At:'DELETE',vt:'CREATE_RELATION',Bt:'DELETE_RELATION'};function vj(a,b){b=vf(new olympe.dc.Request(olympe.dc.Request.j.Xj,olympe.dc.Ja.SELF,{id:b,finalize:olympe.dc.transaction.Ef.j.Oi,error:null}),a.T());let c;null==(c=a.Tb)||c.vd(b)}
781
+ olympe.dc.sources.yl=class{constructor(a,b){this.G=a;this.D=b;this.Tb=null}T(){}R(){}Y(){}init(a){this.Tb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return w(function*(){if(!b.D.D)return b.R(a);var c=olympe.dc.Request.j.oc,d=olympe.dc.Request.j.Lg;const e=olympe.dc.Request.j.Ze,f=olympe.dc.Request.j.Vg;var g=olympe.dc.Request.j.ti;const h=olympe.dc.Request.j.oh,k=olympe.dc.Request.j.hg;var l=olympe.dc.Request.j.$f;const n=olympe.dc.Request.j.Yf,p=olympe.dc.sources.Zd(),
782
+ q=a.getType(),r=a.ic();if(id(b.D)){q===d&&(c=a.content,(g=xf(a).get(olympe.dc.ma.j.ul))&&(yield wj(p,c.T(),g)),b.G.debug(`Data Provider: Query ${c.T()} will be executed with its default Remote or Server provider`));if(q===l&&(l=a.content,'string'===typeof(null==l?void 0:l.url)&&l.url.startsWith('offline://')))return p.downloadFileContent(l.tag);l=yield b.R(a);if(q===d){const t=a.content;d=l;const u=new olympe.dc.db.ec(`fullResult_${t.T()}`);l=d.pipeThrough(new TransformStream({transform:(x,y)=>w(function*(){const z=
783
+ x.jc();yield xj(p,z);z.qc(u);b.G.j()&&b.G.debug(`Data Provider: Data result for query ${t.T()}`,z.Bb.size,'instances',Array.from(z.Ed()).length,'relations');y.enqueue(x)}),flush:()=>w(function*(){yield yj(p,t.T(),r,u,!0)})}))}else if(q===e||q===f||q===h)b.G.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield zj(p,null,r,a.content.jc(),!1);return l}b.G.debug(`Data Provider: Request (type: ${q}) will be sent to the cache data provider: ${a.content}`);switch(q){case c:return{s:olympe.dm.DataSource.oc.Ae};
784
+ case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.jc().T();return p.applyTransaction(d,r).finally(()=>vj(b,t));case g:return Promise.resolve();case k:return d=a.content,p.uploadFileContent(d.tag,d.content,d.mimeType);case l:return p.downloadFileContent(a.content.tag);case n:return p.deleteFileContent(a.content.tag);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${b.T()}`)}})}subscribe(a,b){if(!this.D.D)return this.Y(a,
785
+ b);const c=olympe.dc.sources.Zd(),d=a.content,e=a.ic();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(id(this.D)){const f=new rxjs.Observable(h=>{olympe.C.Is([this.D.Sf()],()=>{h.error(new olympe.L.errors.pp('Go Offline',d.T()))})}),g=this.Y(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.C.Is([this.D.Sf()],()=>{f.error(new olympe.L.errors.eo('Back Online',d.T()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(zj(c,d.T(),e,f.jc()).then(()=>f).catch(g=>{this.G.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);
786
+ throw g;}))))}};olympe.dc.sources.yl.xa=[olympe.dc.sources.Tj];const Aj=olympe.dc.Request.j.oc,Bj=olympe.dc.Request.j.Lg,Cj=olympe.dc.Request.j.pk,Dj=olympe.dc.Request.j.Ze,Ej=olympe.dc.Request.j.Vg,Fj=olympe.dc.Request.j.ti,Gj=olympe.dc.Request.j.oh,Hj=olympe.dc.Request.j.hg,Ij=olympe.dc.Request.j.$f,Jj=olympe.dc.Request.j.Yf;function Kj(a,b){let c;return(null==(c=a.ha.sb(b))?void 0:c.Lf(olympe.dc.sources.U.Qe))!==olympe.dm.DataSource.Qe.sp}function Lj(a,b){let c;return(null==(c=a.ha.sb(b))?void 0:c.Lf(olympe.dc.sources.U.Qe))!==olympe.dm.DataSource.Qe.$n}
787
+ function Mj(a,b){b=b.Cc();if(b!==olympe.dm.User.j&&a.Lf(olympe.dc.sources.U.xm))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.T()}). Please use an admin account instead.`,new olympe.dc.sources.Yq(a);}
788
+ function Nj(a,b,c,d,e){return w(function*(){var f=olympe.L.bb.j.SEND,g=olympe.L.bb.j.GET;const h=olympe.L.bb.j.PUBLISH,k=olympe.L.bb.j.SUBSCRIBE,l=d.Js();var n=d.body();if(e!==n.Cc())throw Error('Access denied: try to impersonate a user');Mj(c,n);let p;if(null==(p=a.Tb)||!p.sources.has(n.ic()))throw Error(`Try to process a message with destination data source ${n.ic()} coming from remote but not started here`);if(l===k){if(n.getType()===Cj)f=n.content.T();else throw Error('Not supported type of subscription');
789
+ g=yield d.tn(f);a.$.set(g,f);g=a.N.get(f);g||(g=new Oj(a.G,f,b,vf(n,olympe.dc.Ja.Af)),a.N.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.vd(n):a.G.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.Pr()):l===h&&(yield b.request(n))})}
790
+ olympe.dc.sources.Xq=class extends olympe.dc.sources.yl{constructor(a,b,c,d,e,f){super(a,d);this.H=b;this.j=c;this.db=e;this.F=new olympe.C.Xb('Remote Provider Context');this.da=new Map;this.N=new Map;this.$=new Map;this.ha=f}T(){return olympe.dc.Ja.Af}R(a){var b=olympe.L.ub;const c=a.ic(),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 Aj:const e=olympe.dm.DataSource.oc.Ab,f=olympe.dm.DataSource.oc.Jh;b=Kj(this,
791
+ c)?b.get(c,a):Promise.resolve({s:f});a=Lj(this,c)?this.j.Hc(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 Bj:return Lj(this,c)?bj(this.j,a):b.get(c,a);case Dj:const g=a.content.jc().T();return(Kj(this,c)?b.get(c,a):cj(this.j,a)).finally(()=>vj(this,g));case Ej:const h=a.content.jc().T();return(Lj(this,c)?cj(this.j,
792
+ a):b.get(c,a)).finally(()=>vj(this,h));case Fj:return Kj(this,c)?b.publish(c,a).catch(k=>{this.G.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case Gj:return Kj(this,c)?b.get(c,a):cj(this.j,a);case Hj:return Lj(this,c)?this.j.uploadFileContent(a):b.get(c,a);case Ij:return Lj(this,c)?this.j.downloadFileContent(a):b.get(c,a);case Jj:return Lj(this,c)?this.j.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.T()}`)}}Y(a,
793
+ b){const c=a.ic(),d=a.getType();if(!Kj(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===Cj?olympe.L.ub.observe(c,this.F,a,{onRetry:b}):rxjs.throwError(()=>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.zj).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.Vh,
794
+ !0)).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.$r,!0)).observe(this.F).subscribe(b=>{b.oj().forEach(this.Ha.bind(this,a));b.tj().forEach(c=>{let d;null==(d=this.da.get(c))||d.destroy();this.da.delete(c)})});this.db.Qa(this.H,olympe.dm.DataSource.$r)&&(new olympe.L.ub(this.H,this.F)).listen().subscribe(b=>{b=b.body();b instanceof olympe.dc.Request?a.vd(b):this.G.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return w(function*(){})}Ha(a,
795
+ b){const c=b.X(),d=new olympe.C.Xb(`Published data provider context ${c}`,this.F);this.da.set(c,d);let e,f;Pj(b,d).subscribe(g=>{let h;null==(h=e)||h();let k;null==(k=f)||k.stop();g!==olympe.dm.DataSource.Qe.$n&&(e=Xi(this.j,c,l=>{Mj(b,l);return a.request(l)}),d.onDestroy(()=>{let l;return null==(l=e)?void 0:l()}));g!==olympe.dm.DataSource.Qe.sp&&(g=new olympe.C.Xb(`Bus Service of data source ${c}`,d),f=(new olympe.L.ub(c,g)).Qs(this.wa.bind(this)),f.listen().subscribe(l=>{l.ni().then(n=>Nj(this,
796
+ a,b,l,n)).catch(n=>{this.G.warn(`Error occurred while processing request from ${l.source()}: ${n}`);return l.bi(n instanceof Error?n:Error(n))})}))})}wa(a){const b=this.$.get(a);this.$.delete(a);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)}};
797
+ class Oj{constructor(a,b,c,d){this.G=a;this.D=b;this.j=0;this.F=c.subscribe(d).subscribe({next:e=>{olympe.L.ub.publish(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.Xq.xa=[olympe.dc.sources.Tj];const W={Jr:10,mo:11,Uo:12,Fq:13,QUERY_RESULT:14,np:15,Do:16,Ze:17,Gq:18,Co:19,Vi:20};function Qj(a,b){const c=new olympe.dc.transaction.Ce,d=new olympe.dc.transaction.Ce;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.Oc(e.t,e.s,f,e.m);e.r.forEach(h=>g.Oa(h.r,h.o,h.d))});a.$.Tc(Af(Bf(d),olympe.dc.Ja.SELF),{persist:!1});a.$.Tc(Af(Bf(c),olympe.dc.Ja.SELF))}
798
+ olympe.dc.sources.cc=class extends olympe.L.cc{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.Jr,a),{i:b})}return a}N(a){return(null==a?void 0:a.t)===W.Jr&&Array.isArray(null==a?void 0:a.i)?(Qj(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.Uo;{const d=a.X(),e={t:d};if(!this.F.has(d)&&(this.H(d),!this.db.Le(d))){const f=
799
+ a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))a=olympe.dc.ls().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.Fq,a.ga());case a instanceof olympe.dc.Ia:return this.format(W.QUERY_RESULT,a.ga(this.H.bind(this)));case a instanceof olympe.dc.db.ec:return b=new olympe.dc.transaction.Ce,
800
+ a.qc(b),this.format(W.np,{i:a.T(),p:Bf(b)});case a instanceof olympe.dc.Request:return this.format(W.Do,{r:a.getType(),o:a.origin,d:a.ic(),u:a.Cc(),c:this.D(a.content)});case a instanceof olympe.dc.transaction.bj:return this.format(W.Ze,{r:a.kh(),p:this.D(a.jc())});case a instanceof olympe.dc.query.zd:return this.format(W.Gq,a.ga());case a instanceof olympe.dc.Ag:return this.format(W.Co,a.ga());case a instanceof olympe.dc.uc:return this.format(W.Vi,this.H(a.X()));default:return super.D(a)}}j(a){if(null===
801
+ a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case W.Uo:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.ls().zb(d,a));return olympe.dc.CloudObject.get(d);case W.mo:return olympe.dc.CloudObject.get(c);case W.Fq:return d=c.p.map(olympe.dc.query.oa.tm.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,Hd:a.s,Ne:a.rm});case W.QUERY_RESULT:return ri(c);case W.np:return(new olympe.dc.transaction.Ti).j(c.p,c.i);case W.Do:return a=null!=(d=this.j(c.c))?d:void 0,
802
+ vf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case W.Ze:return d=this.j(c.p),new olympe.dc.transaction.bj(d,c.r);case W.Gq:return olympe.dc.query.zd.j(c);case W.Co:return olympe.dc.Ag.j(c);case W.Vi:return new olympe.dc.uc(c);default:return super.j(a)}}H(a){if(this.F.has(a))return a;if(!this.db.Ga(a))throw new olympe.dc.rq(a);const b={};this.db.Db(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of Yg(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.ua.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
803
+ d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.Le(a)||(c.v=!0);this.F.set(a,c);return a}};const Rj=olympe.dc.Request.j.Cg,Sj=olympe.dc.Request.j.Ze,Tj=olympe.dc.Request.j.Vg,Uj=olympe.dc.Request.j.ti,Vj=olympe.dc.Request.j.Xn,Wj=olympe.dc.Request.j.Oq,Xj=olympe.dc.Request.j.Lg,Yj=olympe.dc.Request.j.pk,Zj=olympe.dc.Request.j.mp,ak=olympe.dc.Request.j.Rt,bk=olympe.dc.Request.j.St,ck=olympe.dc.Request.j.Tt,dk=olympe.dc.Request.j.Yf,ek=olympe.dc.Request.j.$f,fk=olympe.dc.Request.j.hg,gk=olympe.dc.Request.j.Xj,hk=olympe.dc.Request.j.ow,ik=olympe.dc.Request.j.Ev,jk=olympe.dc.Request.j.hp,kk=
804
+ olympe.dc.Request.j.oh,lk=olympe.dc.Request.j.pt,mk=olympe.dc.Request.j.oc;function nk(a){return ok(a,olympe.dc.Request.j.Cg).then(b=>{b=b.getData().p;const c=Af(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 pk(a,b){const c=new olympe.dc.transaction.Ce({he:!1,Wh:!1}),d=b.jc(),e=b.j;d.qc(c);return qk(a,Sj,{i:d.T(),r:b.kh(),p:Bf(c),bd:e?!0:void 0}).then(f=>f.ct)}
805
+ function rk(a,b){const c=b.jc(),d=new olympe.dc.transaction.Ce({el:!0,he:!1,Wh:!1});c.qc(d);b=b.j?'bd=true':'';return ok(a,Tj,Bf(d),b,olympe.net.va.ResponseType.ur).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(()=>{sk(a,gk,{id:c.T(),finalize:olympe.dc.transaction.Ef.j.Oi})})}
806
+ function tk(a,b){const c=new olympe.dc.transaction.Ce({he:!1,Wh:!1}),d=b.jc();d.qc(c);return qk(a,Uj,{i:d.T(),r:b.kh(),p:Bf(c)},!1).catch(e=>a.G.error(`Error while publishing burst transaction: ${e}`))}function uk(a,b){const c=new olympe.dc.transaction.Ce({he:!1,Wh:!1});b=b.jc();b.qc(c);return qk(a,kk,{i:b.T(),p:Bf(c)}).then(d=>d.ct)}
807
+ function vk(a,b){const c=encodeURI(bb(olympe.V.df(),JSON.stringify(wk(a,b))));a.G.j()&&a.G.debug(`Static GraphDef query ${b} sent to orchestrator`);return ok(a,Xj,void 0,`query=${c}&v=${a.version}`,olympe.net.va.ResponseType.ge).then(d=>xk(a,d))}function yk(a,b){const c=b.T();a.G.j()&&a.G.debug(`Query (${c}) sent to orchestrator: ${b}`);const d=wk(a,b);return qb(a.wa,()=>ok(a,Zj,d,void 0,olympe.net.va.ResponseType.ge)).then(e=>xk(a,e))}
808
+ function zk(a,b){if(!Td(a.F))return a.G.error(`Server is disconnected, backup of instance ${b} is canceled.`),Promise.reject('Server is disconnected');b=wk(a,olympe.dc.ma.from(b));b.f=olympe.dc.Lb.Ho;b=N($i(a.j,olympe.dc.Ja.SERVER,Vj),olympe.net.va.Nd.Gh,JSON.stringify(b),olympe.net.va.ResponseType.Oh);Ac(b,{[olympe.net.va.Headers.xi]:olympe.net.va.Al.JSON});return aj(a.j,b).then(c=>c.getData())}
809
+ function Ak(a,b,c,d){if(!Td(a.F))return a.G.error('Server is disconnected, restore of instance is canceled.'),Promise.reject('Server is disconnected');const e=$i(a.j,olympe.dc.Ja.SERVER,Wj);b=N(e+`?debug=${c}&optional=${d}`,olympe.net.va.Nd.Gh,b);Ac(b,{[olympe.net.va.Headers.xi]:olympe.net.va.Al.zw});return aj(a.j,b).then(f=>f.getData())}
810
+ function qk(a,b,c,d=!0){const e=olympe.L.ze.zg,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{Wd(a.F,e,f,(k,l)=>{k?h(k):g(l)})});Wd(a.F,e,f);return Promise.resolve()}
811
+ function wk(a,b){var c=Nh(b);b={i:b.T(),b:[b.D],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.oa.Kd)Object.assign(b,{f:c[0].Pb,q:[]});else{const d=(h,k)=>{h.every(l=>!l.Ea(k))&&h.push(k);return h},e=new Map;for(let h=c.length-1;0<=h;h--){const k=c[h],l=k.j;let n;const p=d(null!=(n=e.get(l))?n:[],k);if(k instanceof olympe.dc.query.oa.we&&k.F){let q;null==(q=e.get(k.T()))||q.forEach(r=>d(p,r))}e.set(l,p)}let f,g;c=null!=(g=e.get(null==(f=c[0])?void 0:f.j))?g:[];Object.assign(b,{f:olympe.dc.Lb.NONE,q:c.map(a.da.bind(a,
812
+ e))})}return b}function sk(a,b,c){b=vf(new olympe.dc.Request(b,olympe.dc.Ja.SELF,c),a.T());let d;null==(d=a.Tb)||d.vd(b)}
813
+ function ok(a,b,c,d,e){const f=$i(a.j,a.T(),b);if('string'!==typeof f)return Promise.reject(`ServerProvider: no url for type ${b}`);b=N(`${f}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.va.Nd.Gh:olympe.net.va.Nd.GET,c&&JSON.stringify(c));Ac(b,{[olympe.net.va.Headers.xi]:'application/json'});Cc(b,null!=e?e:olympe.net.va.ResponseType.JSON);return aj(a.j,b)}
814
+ function xk(a,b){return w(function*(){const c=b.headers.graphId,d=b.getData();let e,f;return(null!=(f=null==(e=a.Ha)?void 0:rb(e,d))?f:olympe.V.stream.jk.transform(b.getData())).pipeThrough(new TransformStream({transform:(g,h)=>{a.G.debug(`Received ${g.length} operations for patch ${c}`);h.enqueue(Af(g,a.T(),null,c))}}))})}
815
+ function Bk(a,b,c){return w(function*(){const d=b.pi;let e;if(c instanceof olympe.V.stream.Cf){e=new olympe.dc.db.ec(d);try{for(const f=fa(c);;){const g=yield f.next();if(g.done)break;a.$.j(g.value.p,d).qc(e)}}catch(f){a.G.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.ec(d)}}else e=a.$.j(b.p,d);return rf(e,b.ct)})}
816
+ olympe.dc.sources.lr=class extends olympe.dc.sources.yl{constructor(a,b,c,d,e,f,g){super(a,c);this.F=b;this.j=d;this.$=new olympe.dc.transaction.Ti(this.T());this.H=new Map;this.N=new Set;this.version=e||'unknown';this.Ha=g?new olympe.V.stream.yw:null;this.wa=new olympe.V.promise.rr(f);olympe.C.vj(this.D.Sf(),()=>{this.H.forEach((h,k)=>{h.error(new olympe.L.errors.Pi('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ja.SERVER}R(a){var b=a.getType();const c=a.content,d=xf(a);switch(b){case mk:return a=
817
+ olympe.dm.DataSource.oc.Ab,b=olympe.dm.DataSource.oc.Jh,Promise.resolve(Td(this.F)?{s:b}:{s:a,r:'Disconnected'});case Rj:return nk(this);case Sj:return pk(this,c);case Tj:return rk(this,c);case Uj:return tk(this,c);case kk:return uk(this,c);case Xj:return d.get(olympe.dc.ma.j.Gp)?vk(this,c):yk(this,c);case Vj:return zk(this,c);case Wj:return Ak(this,c.VE,c.debug,c.optional);case hk:case ik:case jk:case lk:return qk(this,b,{});case ek:return this.j.downloadFileContent(a);case dk:return this.j.deleteFileContent(a);
818
+ case fk:return this.j.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Y(a,b){if(a.getType()===Yj){const c=a.content,d=c.T();return(new rxjs.Observable(e=>{const f=wk(this,c);this.N.delete(d);this.H.set(d,e);qk(this,ak,f).catch(g=>e.error(g))})).pipe(nb(olympe.L.errors.Pi,(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);qk(this,bk,{i:d}).catch(e=>
819
+ {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);Rd(this.F,olympe.L.ze.zg,this.ha.bind(this));return this}destroy(){return w(function*(){})}ha(a,b){const c=olympe.dc.Request.j.Zn,d=olympe.dc.Request.j.fm,e=a.c;if(e===olympe.dc.Request.j.zo)Bk(this,a,b).then(f=>{sk(this,e,f)});else if(e===c)b=this.$.j(a.p,a.i),
820
+ b=rf(b,a.ct),sk(this,e,{rollback:b,error:a.error});else if(e===ck){const f=a.i;Bk(this,a,b).then(g=>{let h;null==(h=this.H.get(f))||h.next(g)})}else e===d&&sk(this,gk,{id:a.i,finalize:olympe.dc.transaction.Ef.j.fm,error:0<a.s?a.error:null})}da(a,b){if(b instanceof olympe.dc.query.oa.Kh){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.X(),d:c.Ka()===olympe.dc.ua.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.da.bind(this,a))}}return{}}};olympe.dc.sources.lr.xa=[olympe.dc.sources.Tj];function Ck(a,b,c){const d=new olympe.C.Xb(`Source solver ${b.X()}`);b.fb(olympe.dm.wd.F.$b()).fb(olympe.dm.wd.D).ie().back().fb(olympe.dm.wd.j).ie().observe(d,{jd:c,Ac:!0}).subscribe(e=>{e.oj().forEach(([f,g])=>{a.D.set(f.X(),g.T())});e.tj().forEach(([f])=>{a.D.delete(f)})});b.fb(olympe.dm.ib.D).observe(d,{jd:c,Ac:!0}).subscribe(e=>{let f,g;a.F=null!=(g=null==(f=e.Gc())?void 0:f.T())?g:null});d.onDestroy(()=>{a.D.clear();a.F=null})}
821
+ olympe.dc.sources.Bk=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}Ke(a){let b;return null!=(b=this.db.source(a))?b:this.N}sb(a){return a===this.j?olympe.dc.CloudObject.get(this.j):a===olympe.dc.Ja.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ga(a)&&this.db.Ob(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}R(){return!1}init(){if(!this.H){this.H=
822
+ !0;var a=new olympe.dc.Wa;Y(a.create(olympe.dm.DataSource,this.j).li(this.j),olympe.dm.DataSource.Vh,!0);a.Oa(olympe.dm.DataSource.zj,this.j,this.j);a.nb(()=>{olympe.dc.ma.from(this.j).observe(olympe.C.ah()).subscribe(()=>{})})}}};olympe.dc.sources.P={Ca:'dc.sources.Logger',Rl:'dc.sources.HTTPService',hu:'dc.sources.IOService',Mq:'dc.sources.RemoteProvider',er:'dc.sources.ServerProvider',KB:'dc.sources.OfflineProvider',We:'dc.sources.SourceSolver',Ge:'dc.sources.Serializer',Ao:'dc.sources.cache.Cache',Bo:'dc.sources.cache.DATABASE',vl:'dc.sources.cache.Logger'};
823
+ olympe.dc.sources.U={xh:'data.httpHost',vf:'data.httpPort',Ei:'data.httpSSL',Pl:'data.httpBasePath',qm:'data.pollingFrequency',Qe:'data.communicationMode',xm:'data.restrictedUse',VERSION:'version.version',jr:'data.streamWorker',qq:'data.queryConcurrencyLimit'};olympe.dc.sources.zh={rv:'olympe.internal.data.',xh:'olympe.internal.data.httpHost',vf:'olympe.internal.data.httpPort',Ei:'olympe.internal.data.httpSSL'};
824
+ olympe.W.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.U.am),d=`-${olympe.host.Pg.Hh}`;F(a,olympe.dc.sources.U.xh,null);F(a,olympe.dc.sources.U.vf,null);F(a,olympe.dc.sources.U.Ei,null);F(a,olympe.dc.sources.U.Pl,'runtime/data');F(a,olympe.dc.sources.U.jr,!1);F(a,olympe.dc.sources.U.qq,10);Ya(a,olympe.dc.sources.zh.xh,[olympe.host.U.sk,olympe.L.U.El,olympe.dc.sources.U.xh],(e,f,g)=>{if(g)return g;e=e===olympe.host.Pg.Hh;return f.endsWith(c)&&e?f+d:f});Ya(a,olympe.dc.sources.zh.vf,
825
+ [olympe.dc.sources.zh.xh,olympe.dc.sources.U.vf],(e,f)=>{if(f)return f;f=b.includes(e);const g=e.endsWith(d);e=e.endsWith(c);return f?3141:g?85:e?80:443});Ya(a,olympe.dc.sources.zh.Ei,[olympe.dc.sources.zh.vf,olympe.dc.sources.U.Ei],(e,f)=>null!==f?f:443===e);F(a,olympe.dc.sources.U.qm,null);F(a,olympe.dc.sources.U.Qe,null);F(a,olympe.dc.sources.U.xm,null);E(a,olympe.dc.sources.P.Ca,[olympe.ja.P.Da],e=>e.cd('data'));D(a,olympe.dc.sources.P.Ge,olympe.dc.sources.cc,olympe.dc.db.P.Da);Wa(a,olympe.L.P.Ge,
826
+ olympe.dc.sources.P.Ge);D(a,olympe.dc.sources.P.Rl,olympe.dc.sources.Wt,olympe.dc.sources.P.Ca,olympe.net.P.dj,olympe.L.P.Ql,olympe.auth.P.Da,olympe.dc.sources.P.We,olympe.L.P.Ge,new olympe.W.pa(olympe.L.U.ql));D(a,olympe.dc.sources.P.hu,olympe.dc.sources.Fp,olympe.dc.sources.P.Ca,olympe.dc.P.Ng,olympe.net.P.Da,olympe.auth.P.Da);D(a,olympe.dc.sources.P.Mq,olympe.dc.sources.Xq,olympe.dc.sources.P.Ca,new olympe.W.pa(olympe.dc.U.Qg),olympe.dc.sources.P.Rl,olympe.L.P.pf,olympe.dc.P.sh,olympe.dc.sources.P.We);
827
+ D(a,olympe.dc.sources.P.er,olympe.dc.sources.lr,olympe.dc.sources.P.Ca,olympe.L.P.vk,olympe.L.P.pf,olympe.dc.sources.P.Rl,new olympe.W.pa(olympe.dc.sources.U.VERSION),new olympe.W.pa(olympe.dc.sources.U.qq),new olympe.W.pa(olympe.dc.sources.U.jr));D(a,olympe.dc.sources.P.We,olympe.dc.sources.Bk,olympe.dc.P.sh,new olympe.W.pa(olympe.dc.U.Qg),new olympe.W.pa(olympe.dc.U.Gl));E(a,olympe.dc.sources.P.vl,[olympe.ja.P.Da],e=>e.cd('datacache'));D(a,olympe.dc.sources.P.Ao,olympe.dc.sources.cache.Cache,olympe.dc.sources.P.vl,
828
+ olympe.dc.P.Ng,olympe.dc.sources.P.Bo,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.L.P.pf,olympe.Eb.P.bm,olympe.V.P.vg,new olympe.W.pa(olympe.net.U.nq),new olympe.W.pa(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.P.Bo,olympe.dc.sources.cache.hk,olympe.Eb.P.Sg,olympe.dc.sources.P.vl,olympe.Eb.P.bk)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.P.We,olympe.dc.sources.P.Ao],(a,b)=>{olympe.dc.ae=()=>a;olympe.dc.sources.Zd=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.Dm=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.yt=class extends olympe.dc.sources.cache.errors.Dm{};olympe.dc.sources.cache.errors.lw=class extends olympe.dc.sources.cache.errors.Dm{};olympe.dc.sources.cache.errors.vw=class extends olympe.dc.sources.cache.errors.Dm{};function Dk(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.uc(a.v);case 13:return(new olympe.dc.transaction.Ti).j(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
829
+ olympe.dc.sources.cache.wp=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.uc:return{t:17,v:a.X()};case a instanceof olympe.dc.db.ec:const b=new olympe.dc.transaction.Ce;a.qc(b);
830
+ return{t:13,i:a.T(),v:Bf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function wj(a,b,c){return w(function*(){Ek(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(Fk(a)));return Gk(a.j,b,c)})}function xj(a,b){return w(function*(){yield a.init();a.G.debug(`Cache: subtract pending transaction operations from ${b.T()}`);b.R(a.F)})}
831
+ function yj(a,b,c,d,e=!1){(()=>w(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.Rc()).filter(h=>!h.td()).map(h=>h.tag()),yield Hk(a.j)),yield Ik(a.j,d,0<f.length?b:null),Jk(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}`),
832
+ a.$c.next(f)}finally{b&&Kk(a,'queries',b)}}))().then(()=>{})}function zj(a,b,c,d,e=!1){return w(function*(){yield xj(a,d);yj(a,b,c,d,e)})}function Lk(){var a=olympe.dc.sources.Zd();a.$=!0;a.zb=!0}function Ek(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)}
833
+ function Kk(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 Mk(a){return w(function*(){a.F=new olympe.dc.db.ec;const b=yield Nk(a.j);for(const c of b)c.qc(a.F);a.da.next(0<b.length)})}
834
+ function Jk(a,b,c){return w(function*(){const d=Ok(b),e=[];for(const g of d){const h=g.tag();if(!(yield Pk(a.j,h)))if(Ek(a,'files',h),!1===g.Qa(olympe.dm.File.j.X())&&g.Qa(olympe.dm.File.urlProp.X())){var f=g.Qa(olympe.dm.File.urlProp.X());f=N(f);Cc(f,olympe.net.va.ResponseType.pl);e.push(Dc(a.Bd,f).then(k=>{k=k.Hc();if(200>k||300<=k)throw Error(`Failed to download file ${g}. Response code ${k}`);}).finally(()=>Kk(a,'files',h)))}else{let k;const l=null!=(k=g.Qa(olympe.dm.File.mimeTypeProp.X()))?k:
835
+ 'application/octet-stream';f={tag:h,model:g.Wb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.j.$f,c,f);f=qb(a.Id,()=>a.Tb.request(n).then(p=>Qk(a.j,h,p,l))).finally(()=>Kk(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`)}})})})}
836
+ function Ok(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).mg(olympe.dc.CloudObject.extendedByRel).Fc().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Qc(c))?void 0:d.ab(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.Qc(d))?void 0:e.ab(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Qc(g));return c.concat(d)},[])}
837
+ function Rk(a,b){return Array.from(a.D.values()).some(c=>c.has(b))}function Fk(a){return Array.from(a.D.keys()).filter(b=>'__code-as-data__'!==b)}function Sk(a,b){return w(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 Tk(a.j,b);a.N.next(Fk(a));d.filter(f=>!e.has(f));yield Hk(a.j)}else yield Promise.all(Fk(a).map(f=>Sk(a,f)))})}
838
+ function Uk(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])}
839
+ function Vk(a,b,c){return w(function*(){var d=olympe.dc.Request.j.Ze;const e=olympe.dc.Request.j.Yf,f=olympe.dc.Request.j.hg;a.G.debug('Sync Cache: Applying transaction patch to destination',c,b.T());const g=Ok(b);a.G.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>w(function*(){const k=h.tag();var l=h.Wb();if(h.td())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield Wk(a.j,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.j})}if(!id(a.jb))throw Error('Lost connection, stop syncing');
840
+ l=yield a.Tb.request(l);b.Wc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.bj(b,!1));if(!id(a.jb))throw Error('Lost connection, stop syncing');yield a.Tb.request(d)})}
841
+ function Xk(a,b,c){return c instanceof olympe.L.errors.Dk||c instanceof olympe.L.errors.uo?(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.L.errors.Wq?(a.G.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.lw('The transaction has been rejected by the datasource',
842
+ c.message)):new olympe.dc.sources.cache.errors.vw('Synchronisation error',c.message)}
843
+ function Yk(){var a=olympe.dc.sources.Zd();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]);(()=>w(function*(){yield a.init();const c=yield Zk(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){Uk(g);for(const h of g){a.G.debug(`Sync Cache: Processing patch ${d+1}/${e} (${h.T()})`);try{yield Vk(a,
844
+ h,f),yield $k(a.j,h)}catch(k){throw Xk(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(()=>{Mk(a).finally(()=>{a.R=!1})});return b.asObservable()}
845
+ function al(){const a=olympe.dc.sources.Zd();return w(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=Ok(a.F);for(const e of d)b.has(e.tag())||(d=yield Wk(a.j,e.tag()),c.files.push({t:e.tag(),m:d.j,c:a.wa.j(d.content)}),b.add(e.tag()));b=yield bl(a.j);c.patches.push(...b);return JSON.stringify(c)})}
846
+ function cl(a){const b=olympe.dc.sources.Zd();return w(function*(){let c;try{c=JSON.parse(a)}catch(e){throw Error('Invalid pending changes, must be a JSON string');}var d=c.files;if(!Array.isArray(c.patches)||!Array.isArray(d))throw Error('Invalid pending changes, must contain a `patches` array and a `files` array');for(const e of c.files)d=b.wa.D(e.c),yield Qk(b.j,e.t,d,e.m);yield dl(b.j,c.patches);yield Mk(b);b.Ha.Tc(rf(b.F))})}
847
+ function el(){const a=olympe.dc.sources.Zd();return w(function*(){yield fl(a.j);yield Mk(a)})}
848
+ olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.Tb=b;this.j=c;this.Ha=d;this.Bd=e;this.jb=f;this.cb=g;this.wa=h;this.version=l;this.$=this.version!==this.cb.get('__code-as-data-version__');this.Mb=this.zb=!1;this.D=new Map;this.N=new rxjs.BehaviorSubject([]);this.H=null;this.da=new rxjs.BehaviorSubject(!1);this.F=new olympe.dc.db.ec;this.vc=this.zc=!1;this.ha=[];this.Y=0;this.Rd=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});this.R=
849
+ !1;this.$c=new rxjs.Subject;this.Id=new olympe.V.promise.rr(k)}Hc(){return this.status.asObservable()}init(){const a=this;return w(function*(){if(!a.zc)if(a.vc)yield new Promise(b=>{a.ha.push(b)});else{a.vc=!0;(yield gl(a.j)).forEach(b=>{a.D.set(b.name,new Set(b.j))});a.N.next(Fk(a));yield Mk(a);a.Ha.Tc(rf(a.F));for(const b of a.ha)b();a.zc=!0;a.ha=[]}})}executeQuery(a){const b=this;return w(function*(){yield b.init();return Rk(b,a.T())&&Nh(a).some(c=>c instanceof olympe.dc.query.oa.Kd)?hl(b.j,a).then(olympe.V.stream.ds):
850
+ b.j.executeQuery(a).then(olympe.V.stream.ds)})}applyTransaction(a,b){const c=this;return w(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.jc(),e=Array.from(d.Bb.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.H)?void 0:f.j.Bb.keys())?g:[]);let k;b!==(null==(k=c.H)?void 0:k.D)||e.some(l=>!h.includes(l))?(yield il(c.j,d,b),c.H=new olympe.dc.sources.cache.wt(d,b),c.da.next(!0)):(d.qc(c.H.j),yield il(c.j,c.H.j,b));d.qc(c.F);yield Ik(c.j,d,'local-transaction')})}uploadFileContent(a,
851
+ b,c){const d=this;return w(function*(){yield d.init();yield Qk(d.j,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return w(function*(){yield b.init();return Wk(b.j,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return w(function*(){yield b.init();yield jl(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 gl(a){return w(function*(){return(yield a.db.F('buckets')).map(b=>olympe.dc.sources.cache.sq.Qb(b))})}function Nk(a){return w(function*(){return(yield a.db.F('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.Fh.Qb(b);return Dk(b.j)})})}function Gk(a,b,c){return w(function*(){a.G.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.D()})}function Hk(a){return w(function*(){return a.db.D()})}
852
+ function Ik(a,b,c){a.G.debug(`Offline DB: Apply patch ${b.T()} on local offline db`);Array.from(b.Bb.keys());return a.db.D().then(()=>{null===c&&(b.Bb.forEach((d,e)=>a.D.add(e)),a.F().then(()=>{}))})}function Pk(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)))})})}
853
+ function Qk(a,b,c,d){c=new olympe.dc.sources.cache.om(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function Tk(a,b){return w(function*(){return a.db.remove('buckets',b).then(()=>{})})}function Zk(a){return w(function*(){return(yield a.db.F('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.Fh.Qb(c);const d=c.D;let e;const f=null!=(e=b.get(d))?e:[];f.push(Dk(c.j));b.set(d,f);return b},new Map)})}
854
+ function $k(a,b){return w(function*(){return a.db.remove('pending-transactions',b.T()).then(()=>{})})}function Wk(a,b){return w(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.om.Qb(c)})}function bl(a){return w(function*(){return a.db.F('pending-transactions')})}
855
+ function dl(a,b){return w(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.Fh.Qb(d);e&&c.set(e.j.i,d)}yield a.db.da()})}function fl(a){return w(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
856
+ function hl(a,b){return w(function*(){const c=b.sb();a.G.debug(`Offline DB: Executing query ${b.T()} by ID with source ${c}`);const d=olympe.dc.query.zd.nj(b);var e=(yield a.db.H(b.T())).map(f=>olympe.dc.sources.cache.Ig.Qb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.hk.ac(f);const g=kl(f.Gd);d.create(f.tag,e,g);for(const h of f.ob)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.fc.Yc&&!0===e||d.Oa(k,e?n:f.tag,e?f.tag:n)}}a.G.j()&&
857
+ a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.jc().Bb.size,'instances',Array.from(d.jc().Ed()).length,'relations');return d})}function il(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.Fh(c,b,Date.now())).toJSON())}function ll(a){return w(function*(){return a.db.N('pending-transactions')})}function jl(a,b){return w(function*(){b.forEach(c=>a.files.delete(c));yield a.db.$()})}
858
+ function kl(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,Dk(d)),new Map)}
859
+ olympe.dc.sources.cache.hk=class{constructor(a,b,c){this.H=`Olympe_Cache_${a}`;this.G=b;this.N=new olympe.dc.sources.cache.wp;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.kj(()=>{const d=this;return w(function*(){if(!(0===d.D.size||0<(yield ll(d))))if(0<d.db.Y())d.F().then(()=>{}),d.G.debug('Offline DB GC: Postponing round while the stack is busy');
860
+ 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.fc.Yc})>([a-z0-9]*)$`);for(const c of a.ob)if(a=c.match(b))return a[2];return null}executeQuery(a){const b=this;return w(function*(){const c=Date.now();b.G.debug(`Offline DB: Executing query ${a.T()} with source ${a.sb()}`);const d=olympe.dc.query.zd.nj(a),e=a.sb();var f=
861
+ yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Ig.Qb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.hk.ac(g),kl(g.Gd));for(const p of Nh(a))if(p instanceof olympe.dc.query.oa.Kh){var k=p.relation;g=k.Ka()===olympe.dc.ua.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 u of t){const x=new Map;var l=yield Promise.all(Array.from(u).map(y=>{if(!h.has(y))return b.G.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
862
+ Promise.resolve([]);r.X();return b.db.H().then(z=>z.map(A=>olympe.dc.sources.cache.Ig.Qb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.oa.we&&p.F&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.oa.we&&!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.hk.ac(A),d.create(l,n,kl(A.Gd)));q===olympe.dc.fc.Yc&&!0===g||d.Oa(q,g?l:y,g?y:l)}}}}else p instanceof
863
+ olympe.dc.query.oa.Kd&&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.jc().Bb.size,'instances',Array.from(d.jc().Ed()).length,'relations'),b.G.debug(`Offline DB: Data result for query ${a.T()} took ${Date.now()-c}ms to be executed`));return d})}};
864
+ olympe.dc.sources.cache.sq=class{constructor(a,b){this.name=a;this.j=b}static Qb(a){return a?new olympe.dc.sources.cache.sq(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.j}}};
865
+ olympe.dc.sources.cache.Ig=class{constructor(a,b,c,d,e){this.tag=a;this.source=b;this.Gd=null!=c?c:{};this.ob=null!=d?d:[];this.j=null!=e?e:[]}static Qb(a){return a?new olympe.dc.sources.cache.Ig(a.tag,a.source,a.props,a.relations,a.queryIds):null}toJSON(){return{tag:this.tag,source:this.source,props:this.Gd,relations:this.ob,queryIds:this.j}}};
866
+ olympe.dc.sources.cache.Fh=class{constructor(a,b,c){this.D=a;this.j=b;this.timestamp=c}static Qb(a){return a?new olympe.dc.sources.cache.Fh(a.destination,a.patch,a.timestamp):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp}}};
867
+ olympe.dc.sources.cache.mv=class extends olympe.dc.sources.cache.Fh{constructor(a,b,c,d){super(a,b,c);this.error=d}static Qb(a){return a?new olympe.dc.sources.cache.mv(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp,error:this.error}}};
868
+ olympe.dc.sources.cache.om=class{constructor(a,b,c){this.tag=a;this.content=b;this.j=c}static Qb(a){return a?new olympe.dc.sources.cache.om(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.j}}};function ml(a,b){let c=a.N.get(b);c||(c=new Set(a.j.get(b).ob),a.N.set(b,c));return c}
869
+ olympe.dc.sources.cache.$t=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.wp;this.N=new Map}Rc(){this.R.forEach(a=>this.j.delete(a));Array.from(this.j.entries()).forEach(([a,b])=>{b||this.j.delete(a)});return this.j}Oc(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.Gd)?e:{});let f;e=null!=(f=null==d?void 0:d.j)?f:[];null===
870
+ this.F||e.includes(this.F)||e.push(this.F);let g;b=new olympe.dc.sources.cache.Ig(a,b,c,null!=(g=null==d?void 0:d.ob)?g:[],e);this.j.set(a,b)}Wc(a,b){const c=this.j.get(a);if(c){var d;c.Gd=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.H.ga(g);return e},null!=(d=c.Gd)?d:{})}else this.G.warn(`Trying to update an instance (${a}) which do not exists in the cache database: ignoring.`)}D(a){this.R.add(a)}Oa(a,b,c){var d;const e=null!=(d=this.j.get(b))?d:new olympe.dc.sources.cache.Ig(b,
871
+ 'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Ig(c,'unknown',{},[],[]);b=`${a}${olympe.dc.ua.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=ml(this,g.tag);k.has(h)||(g.ob.push(h),k.add(h));null===this.F||g.j.includes(this.F)||g.j.push(this.F)};f(e,`${a}${olympe.dc.ua.DESTINATION}${c}`);f(d,b)}hc(a,b,c){const d=this.j.get(b),e=this.j.get(c);c=`${a}${olympe.dc.ua.DESTINATION}${c}`;a=`${a}${olympe.dc.ua.ORIGIN}${b}`;b=(f,g)=>{const h=ml(this,f.tag);if(h.has(g)){const k=
872
+ f.ob.indexOf(g);f.ob.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.$t.xa=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.vi=class a{constructor(b,c){this.id=null!=b?b:olympe.V.Ic();this.D=new olympe.C.Xb('BurstTransaction#'+this.id,c);this.zb=nl(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.cb=null!=(d=olympe.W.getParameter(olympe.dc.transaction.U.Yn))?d:30;this.ha=[]}static j(b,c){return`${b},${c}`}Mb(b){for(const c of this.ha)c(b);this.stop()}Ha(){null!==this.j&&(clearTimeout(this.j),this.j=null);const b=this.da(this.H);0<b.size&&ol(this,
873
+ b,!1);this.H.clear()}da(b){const c=new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.F.get(d))});return c}$(b,c,d){this.wa(b,c,d);this.zb(b,c,d);null===this.j&&(this.j=setTimeout(this.Ha.bind(this),this.cb))}wa(b,c,d){b=a.j(b,c);this.F.set(b,d);this.H.add(b)}jb(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.jb(d,e)!==g&&this.$(d,e,g.valueOf())});this.Y.add(b)}complete(){return new Promise((b,
874
+ 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.ja.$a('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.vn([d],g=>{this.R=!0;if(g instanceof olympe.dc.uc)olympe.ja.$a('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.Td(()=>{this.N()}))}stop(){this.D.destroy();
875
+ this.ha.length=0}getContext(){return this.D}T(){return this.id}kh(){return!1}N(b){if(this.R){this.R=!1;null!==this.j&&(clearTimeout(this.j),this.j=null);this.H.clear();const c=this.da(new Set(this.F.keys()));ol(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.vi.prototype.complete=olympe.dc.vi.prototype.complete;olympe.dc.vi.prototype.push=olympe.dc.vi.prototype.push;olympe.dc.Lc=class{j(){}toString(){}};olympe.dc.Lc.j=1;olympe.dc.Lc.D=2;olympe.dc.Lc.H=3;olympe.dc.Lc.F=4;olympe.dc.Lc.N=5;olympe.dc.transaction.Ti=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ja.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.de.Se+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,
876
+ 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.uc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}j(b,c){return this.D(b,new olympe.dc.db.ec(c))}D(b,c){for(const d of b)switch(d.o){case olympe.dc.Lc.j:b=a.j(d.p||{});let e;c.Oc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case olympe.dc.Lc.D:c.Wc(d.t,
877
+ a.j(d.p),d.m);break;case olympe.dc.Lc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Lc.F:c.Oa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Lc.N:c.hc(d.m,d.l,d.r,d.lm,d.rm);break;default:throw Error('Undefined patch operation: '+d.o);}return c}};function pl(a,b){let c;return null!=(c=a.sources.get(b))?c:a.H.Ke(b)}function ql(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.j.Qc(b))?void 0:c.Wb())?d:a.db.model(b))?e:null}function Z(a,b){let c;return null!=(c=a.F.get(b))?c:a.db.Le(b)||!a.db.Ga(b)}function rl(a,b){0===a.F.size?a.F=b:b.forEach((c,d)=>a.F.set(d,c))}function sl(a){return Array.from(a.j.Rc()).filter(b=>!b.td()).map(b=>b.tag())}function tl(a){return Array.from(a.j.Rc()).filter(b=>b.td()).map(b=>b.tag())}
878
+ function ul(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ja.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.ec(a.id),a.D.set(b,c)),d(c))}function vl(a,b,c){const d=pl(a,b),e=Z(a,b),f=ql(a,b);ul(a,d,e,g=>{g.D(b,c,f)})}
879
+ olympe.dc.transaction.wv=class{constructor(a,b,c){this.id=null!=c?c:olympe.V.Ic();this.H=b;this.db=a;this.D=new Map;this.j=new olympe.dc.db.ec(this.id);this.sources=new Map;this.F=new Map}hf(){return 0===this.j.Bb.size}Oc(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);ul(this,f,c,g=>{g.Oc(a,f,d,b)})}Wc(a,b){const c=pl(this,a),d=Z(this,a),e=ql(this,a);ul(this,c,d,f=>{f.Wc(a,null!=b?b:new Map,e)})}Oa(a,b,c){const d=pl(this,b),e=
880
+ pl(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ja.SELF&&e!==olympe.dc.Ja.SELF;f&&d!==e&&a!==olympe.dc.fc.Yc&&(f=g=>{let h;return null!=(h=olympe.dc.ia().name(g))?h:g},olympe.ja.$a('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);ul(this,d,f,g=>{g.Oa(a,b,c,ql(this,b),ql(this,c))})}hc(a,b,c){const d=pl(this,b),e=pl(this,c);let f=Z(this,b)&&
881
+ Z(this,c)&&d!==olympe.dc.Ja.SELF&&e!==olympe.dc.Ja.SELF;f&&d!==e&&a!==olympe.dc.fc.Yc&&(olympe.ja.$a('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);ul(this,d,f,g=>{g.hc(a,b,c,ql(this,b),ql(this,c))})}};function wl(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.Jp.ir)if(e===olympe.dc.Ja.SELF)d[g]=olympe.dc.ia().T();else{if(e===olympe.dc.Ja.SERVER)continue}else g.startsWith(olympe.dc.de.Se)&&(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 xl(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}
882
+ class yl{constructor(){this.N=new Map}R(a){return a instanceof olympe.C.Sa||a instanceof olympe.C.ea||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.fh().valueOf(),g:a.bh().valueOf(),b:a.Zg().valueOf(),a:a.Yg().valueOf()}:a&&'function'===
883
+ typeof a.X?{c:8,t:a.X()}:a}}function Bf(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}
884
+ olympe.dc.transaction.Ce=class{constructor({el:a=!1,Wh:b=!0,he:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.H=[];this.el=null!=a?a:!1;this.he=null!=c?c:!0;this.Wh=null!=b?b:!0;this.Y=olympe.C?new yl:new class extends yl{R(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(Bf(this))}Oc(a,b,c,d=null){c=wl(this.Y,null!=c?c:null,this.el);c={o:olympe.dc.Lc.j,t:a,p:c};this.Wh&&(c.s=b);this.he&&d&&(c.m=d);this.N.push(c);this.el&&(b=xl(this.Y))&&this.j.push({o:olympe.dc.Lc.D,
885
+ t:a,p:b})}Wc(a,b,c=null){b=wl(this.Y,b||null,!1);a={o:olympe.dc.Lc.D,t:a,p:b};this.he&&c&&(a.m=c);this.j.push(a)}D(a,b,c=null){a={o:olympe.dc.Lc.H,t:a,f:b};this.he&&c&&(a.m=c);this.F.push(a)}Oa(a,b,c,d=null,e=null){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);a={o:olympe.dc.Lc.F,m:a,l:b,r:c};this.he&&d&&(a.lm=d);this.he&&
886
+ e&&(a.rm=e);this.R.push(a)}hc(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:olympe.dc.Lc.N,m:a,l:b,r:c};this.he&&d&&(a.lm=d);this.he&&e&&(a.rm=e);this.H.push(a)}};olympe.dc.transaction.Ce.xa=[olympe.dc.Writable];function zl(a){var b=new olympe.dc.Wa;b.Y=a;return b}function Al(a,b){b instanceof olympe.dc.Wa&&b.D.forEach((c,d)=>a.D.set(d,c));a.Fa.push(b);return b}
887
+ function Bl(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Y(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Y(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();Al(a,new olympe.dc.transaction.Fa.Jo(e,b));Al(a,new olympe.dc.transaction.Fa.Bl(e,b,d));return c}
888
+ function Cl(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))}}
889
+ olympe.dc.Wa=class{constructor(a){this.id=null!=a?a:olympe.V.Ic();this.Fa=[];this.F=new Map;this.Y=!0;this.D=new Map;this.$=[];this.H=this.N=!1;this.R=[...olympe.dc.uj().$]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.fa(a)))?b:olympe.dc.ia().model(a)}j(a){rl(a,this.D);for(const b of this.Fa)b.j(a);try{this.R.forEach(b=>b(a))}catch(b){throw Error(`Transaction compilation error: ${b.message}`);}}create(a,b){b=Al(this,new olympe.dc.transaction.Fa.xo(a,b));const c=b.X();this.F.set(c,
890
+ 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.ia();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.ae().fromModel(b);Al(this,new olympe.dc.transaction.Fa.xv(c,d))}else{if((e=d.Ga(c))&&d.Le(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
891
+ if(!e&&!this.F.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Lb.Dc){Al(this,new olympe.dc.transaction.Fa.Ko(a,b))}update(a,b,c){return Al(this,new olympe.dc.transaction.Fa.xw(a,b,c))}Oa(a,b,c){Al(this,new olympe.dc.transaction.Fa.Bl(a,b,c))}hc(a,b,c){Al(this,new olympe.dc.transaction.Fa.It(a,b,c))}Zm(a,b){Al(this,new olympe.dc.transaction.Fa.Jo(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
892
+ f);Y(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.de.Se+d.X(),e);this.Oa(olympe.dc.CloudObject.propertyRel,a,d);this.Oa(olympe.dm.Property.typeRel,d,b);this.Oa(olympe.dc.CloudObject.containsRel,a,d);return d}Xr(a,b,c='',{eE:d=olympe.dm.Relation.H.hv,qE:e=olympe.dm.Relation.j.Fv,lE:f=olympe.dm.Relation.j.ft,OE:g=olympe.dm.Relation.j.yp,bE:h=olympe.dm.ll.NONE,NE:k=olympe.dm.Relation.N|h}={},l=olympe.V.Ic()){c=Y(Y(Y(Y(Y(Y(Y(Y(Y(Y(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
893
+ c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.da,e),olympe.dm.Relation.wa,e),olympe.dm.Relation.$,e),olympe.dm.Relation.Y,f),olympe.dm.Relation.ha,g),olympe.dm.Relation.Ha,olympe.dm.Relation.j.yp),olympe.dm.Relation.R,h);this.Oa(olympe.dc.CloudObject.yj,a,c);this.Oa(olympe.dm.Relation.destinationModelRel,c,b);this.Oa(olympe.dc.CloudObject.containsRel,a,c);return c}kh(){return!1}Rm(a){this.$.push(olympe.C.Xa().rc(a))}nb(a,b){Dl(olympe.dc.uj(),this,Cl(this,a),b)}$m(a){a=
894
+ Cl(this,a);El(olympe.dc.uj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Wa.xa=[olympe.dc.Lc];function nl(a){var b=olympe.dc.uj();const c=a.T();b.H.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.ec(c);g.Wc(d,(new Map).set(e,f),b.db.model(d));b.j.Tc(rf(g,Infinity))}}
895
+ function ol(a,b,c,d){var e=olympe.dc.uj();const f=olympe.dc.Request.j.ti,g=olympe.dc.Request.j.oh,h=a.T();a=a.kh();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ja.SELF||!e.db.Le(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.ec(h),k.set(n,p));p.Wc(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.bj(n,a)),b=e.Tb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.j.Tc(rf(n,p));null==d||d(!0)})}
896
+ function Dl(a,b,c,d){if(d){const e=b.T();a.D.set(e,c);El(a,b,(f,g)=>{f||(a.D.delete(e),c(f,g))},!1)}else El(a,b,c,!1)}function Fl(a){const b=olympe.dc.Request.j.Xj;zf(a.Tb,olympe.dc.Request.j.Zn,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.Mb(d));a.j.Tc(c);a.G.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});zf(a.Tb,b,c=>{c=c.content;Gl(a,c.id,c.finalize,c.error)})}
897
+ function Hl(a,b,c){if(!c)throw Error('Transaction compiler id is required');a.wa.has(c)||a.$.push(b);return a}
898
+ function El(a,b,c,d=!1){const e=b.T(),f=new olympe.dc.transaction.wv(a.db,a.ha,e);try{b.j(f)}catch(q){if(q instanceof olympe.dc.kq){q.j.then(()=>El(a,b,c,d));return}c(!1,q.message);return}if(f.hf()){c(!0);var g;null==(g=a.D.get(e))||g(!0);a.D.delete(e)}else{a.F.set(e,[]);var h=sl(f);a.j.je(h,olympe.dc.db.Instance.j.TRANSACTION);g=h.filter(q=>Z(f,q));var k=tl(f).filter(q=>a.db.Le(q)&&a.db.Ob(q,olympe.dm.File)&&a.db.source(q)!==olympe.dc.Ja.SERVER).map(q=>[q,a.db.model(q),a.db.source(q)]),l=ug(a.j,
899
+ f.j,g),n=olympe.C.Xa().rc((q,r)=>c(null!==q,r)),p=[l,n];Il(a,f,g).then(q=>{p.splice(1,0,q);Jl(a,e,h,f.D.size+1);return Kl(a,f.D,d,b.kh(),b.N)}).then(q=>Promise.allSettled(k.map(([r,t,u])=>a.N.wa(r,t,u))).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));Gl(a,e,olympe.dc.transaction.Ef.j.Oi)}).catch(q=>{a.G.error(q);p.forEach(r=>r(null,`${q}`));Ll(a,e)})}}
900
+ function Il(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.Qc(n))?void 0:p.Qa(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.df();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),
901
+ r();else{var u=n.X(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.N.ha(u,q,y,z=>{const A=h.reduce((K,X)=>K||X.Qc(u),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.Qm(z),k.push([u,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.Wc(q,r);return p},
902
+ new olympe.dc.db.ec);return ug(a.j,n)})}function Jl(a,b,c,d){const e=olympe.C.ah(),f=new olympe.async.mk(e);0<a.R&&f.In(a.R);const g=olympe.dc.transaction.Ef.j.dv;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.rc((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});bd(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);Ll(a,b)});f.start()}
903
+ function Kl(a,b,c,d,e){if(c&&olympe.C.Pa(a.da.D)!==olympe.auth.Ta.j.lf)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.j.Vg:olympe.dc.Request.j.Ze;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.bj(h,d,e));return a.Tb.request(g)})).then(g=>g[0])}
904
+ function Gl(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 Ll(a,b){var c;null==(c=a.F.get(b))||c.forEach(d=>{d(olympe.dc.transaction.Ef.j.Oi,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))}
905
+ olympe.dc.transaction.Ef=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Tb=c;this.ha=d;this.N=e;this.da=f;this.R=g.get('notificationTimeout');this.$=[];let h;this.wa=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.H=new olympe.V.Nh(g.get('burstHoldTime'));this.F=new Map;this.Y=[];this.D=new Map;this.Ha=new olympe.V.promise.Bm;Fl(this)}ne(a){qb(this.Ha,()=>this.Tb.request(new olympe.dc.Request(olympe.dc.Request.j.hp,olympe.dc.Ja.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
906
+ b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.Ef.j={fm:0,Oi:1,dv:2};olympe.dc.transaction.bj=class{constructor(a,b=!1,c=!1){this.D=a;this.F=b;this.j=c}kh(){return this.F}jc(){return this.D}};olympe.dc.transaction.P={Ca:'dc.transaction.Logger',Da:'dc.transaction.Manager'};olympe.dc.transaction.U={bq:'dc.transaction.timeout',Yn:'dc.transaction.burstInterval',Il:'dc.transaction.disabledCompilers'};
907
+ olympe.W.config(function(a){F(a,olympe.dc.transaction.U.bq,9E4);F(a,olympe.dc.transaction.U.Yn,30);F(a,olympe.dc.transaction.U.Il,[]);E(a,olympe.dc.transaction.P.Ca,[olympe.ja.P.Da],b=>b.cd('dc'));E(a,'olympe.dc.transaction.Config',[new olympe.W.pa(olympe.dc.transaction.U.bq),new olympe.W.pa(olympe.dc.transaction.U.Il),new olympe.W.pa(olympe.dc.db.U.xl)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));D(a,olympe.dc.transaction.P.Da,olympe.dc.transaction.Ef,
908
+ olympe.dc.transaction.P.Ca,olympe.dc.db.P.Da,olympe.dc.P.Ng,olympe.dc.sources.P.We,olympe.dc.P.Vj,olympe.auth.P.Da,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Fa={};function Ml(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Pa(e));return c}olympe.dc.transaction.Fa.ug=class{constructor(){this.ia=olympe.dc.ia()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Pa(a){a=olympe.C.Pa(a);return void 0===a||null===a?null:olympe.C.ys(a)?a.valueOf():a}};olympe.dc.transaction.Fa.ug.xa=[olympe.dc.Lc];olympe.dc.transaction.Fa.Rn=class extends olympe.dc.transaction.Fa.ug{constructor(a,b){super();this.relation=a instanceof olympe.dc.Ra.Relation?a:new olympe.dc.Ra.Relation(olympe.dc.fa(a));this.origin=this.ia.Ga(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}Ka(){return this.relation.Ka()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Y(a,b,c){a.Gd.set(olympe.dc.fa(b),c);return a}olympe.dc.transaction.Fa.xo=class extends olympe.dc.transaction.Fa.ug{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.fa(b))?c:olympe.V.Kf();this.model=olympe.dc.fa(a);this.source=null;this.Gd=new Map}X(){return this.tag}ac(){return this.model}li(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.Oc(c,b,this.source,Ml(this,this.Gd))}toString(){return`CreateInstance(${this.ac()}, ${this.X()})`}};
909
+ olympe.dc.transaction.Fa.xo.xa=[olympe.dc.Te];olympe.dc.transaction.Fa.Bl=class extends olympe.dc.transaction.Fa.Rn{constructor(a,b,c){super(a,b);this.D=this.ia.Ga(c)?olympe.dc.CloudObject.get(c):c}j(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.fc.Yc)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');
910
+ if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ka()===olympe.dc.ua.DESTINATION?a.Oa(b,olympe.dc.fa(this.origin),olympe.dc.fa(this.D)):a.Oa(b,olympe.dc.fa(this.D),olympe.dc.fa(this.origin))}toString(){return`CreateRelation('${this.relation.Ka()}${this.relation.X()}, ${olympe.dc.fa(this.origin)}, ${olympe.dc.fa(this.D)})`}};olympe.dc.transaction.Fa.vA=class extends olympe.dc.transaction.Fa.ug{constructor(a,b=olympe.dc.Lb.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.ia.Rc(this.model))b!==olympe.dc.fa(this.model)&&(new olympe.dc.transaction.Fa.Ko(b,this.Pb)).j(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.Pb})`}};olympe.dc.transaction.Fa.Jo=class extends olympe.dc.transaction.Fa.Rn{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Yc)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.Ka(),e=this.ia.ab(c,this.relation);for(const f of e)d===olympe.dc.ua.DESTINATION?
911
+ a.hc(b,c,f):a.hc(b,f,c)}toString(){return`DeleteAllRelations(${this.Ka()}${this.getType()})`}};olympe.dc.transaction.Fa.Ko=class extends olympe.dc.transaction.Fa.ug{constructor(a,b=olympe.dc.Lb.Dc){super();this.tag=this.ia.Ga(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.ia.Ga(b)&&vl(a,b,this.Pb)}toString(){return'DeleteInstance('+this.X()+', '+this.Pb+')'}};olympe.dc.transaction.Fa.It=class extends olympe.dc.transaction.Fa.Bl{j(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Yc)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');
912
+ this.relation.Ka()===olympe.dc.ua.DESTINATION?a.hc(b,c,d):a.hc(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ka()+this.relation.X()+', '+olympe.dc.fa(this.origin)+', '+olympe.dc.fa(this.D)+')'}};olympe.dc.transaction.Fa.xw=class extends olympe.dc.transaction.Fa.ug{constructor(a,b,c){super();this.tag=this.ia.Ga(a)?olympe.dc.CloudObject.get(a):a;this.Gd=new Map;void 0!==b&&this.Gd.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.Qc(b))&&c.D()||this.ia.Ga(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=Ml(this,this.Gd);
913
+ for(const [e,f]of c){var d=this.ia.Qa(b,e,!0);d instanceof olympe.dc.uc&&vl(a,d.X(),olympe.dc.Lb.Dc);f instanceof olympe.dc.uc&&!Z(a,f.X())&&(d=new olympe.dc.Wa,d.persist(f.X()),d.j(a))}a.Wc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+Ml(this,this.Gd)+')'}};olympe.dc.transaction.Fa.xv=class a extends olympe.dc.transaction.Fa.ug{constructor(b,c){super();this.tag=b;this.source=c}j(b){const c=olympe.dc.ia();if(Z(b,this.tag)&&c.Ga(this.tag)&&!c.Le(this.tag)){const e=c.Db(this.tag,!0);var d;let f;null==(f=null==(d=b.j.Qc(this.tag))?void 0:d.Db())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.uc&&c.Ga(g.X())&&(new a(g.X(),this.source)).j(b);d=c.model(this.tag);b.Oc(this.tag,d,this.source,e);for(const [g,h,k]of Yg(c,this.tag))Z(b,
914
+ k)&&(h===olympe.dc.ua.ORIGIN?b.Oa(g,k,this.tag):b.Oa(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.fa=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.Xg))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.na.ac(a))?d:''}else if(olympe.C.jf(a)){let d;b=olympe.dc.fa(null==(d=olympe.C.Pa(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};B('olympe.dc.instanceToTag',olympe.dc.fa);olympe.dc.ia=function(){return olympe.dc.gs().view};olympe.dc.register=function(a,b){olympe.dc.na.j(a,b)};
915
+ olympe.dc.defineProperty=function(a){return new olympe.dc.Ra.Property(a)};olympe.dc.Xr=function(a,b=olympe.dc.ua.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.ua.DESTINATION){const e=olympe.dc.ua.DESTINATION;return b===olympe.dc.ua.ORIGIN||b===e?new olympe.dc.Ra.Relation(a,b):new olympe.dc.Ra.Relation(a,d,b,c)};olympe.dc.gx=function(a){return a.$b()};olympe.dc.mb={};olympe.dc.mb.Xm=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.C.xb(a):a instanceof olympe.C.Sa?a:null;olympe.dc.mb.Um=a=>'boolean'===typeof a||a instanceof Boolean?olympe.C.Sb(a):a instanceof olympe.C.ea?a:null;olympe.dc.mb.Wm=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;
916
+ olympe.dc.mb.Vm=a=>'number'===typeof a||a instanceof Number?ic(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.mb.Sr=function(a){return a instanceof olympe.C.Color?a:'string'===typeof a||a instanceof String?mc(a.valueOf()):null};olympe.dc.mb.Tr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):null;
917
+ olympe.dc.mb.jj=a=>a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.mb.Bc=a=>{a=a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):a;let b;return null!=(b=a instanceof olympe.dc.CloudObject?a.Bc():a)?b:null};
918
+ olympe.dc.mb.Bx=a=>{switch(a){case olympe.C.ea:return olympe.dc.mb.Um;case olympe.C.Sa:return olympe.dc.mb.Xm;case olympe.C.aa:return olympe.dc.mb.Wm;case olympe.C.eb:return olympe.dc.mb.Vm;case olympe.C.Color:return olympe.dc.mb.Sr;case olympe.dc.CloudObject:return olympe.dc.mb.Tr;default:return olympe.dc.mb.jj}};olympe.dc.kc={};olympe.dc.rf=class{la(){}F(){}compare(){}H(){}ga(){}toString(){}};function Nl(a){let b=null;for(a=[...a.ba];null===b&&0<a.length;)b=a.pop().Nb();return b}function Ol(a,b){a.R()||(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.ja.$a('dc').warn(a))}
919
+ olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ja.$a('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.D=olympe.C.ta([a],olympe.dc.fa,String),this.ba=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||Nl(this),this.j=null,this.Ac=void 0)}me(){return olympe.dc.me()}nb(){if(null===this.j){const a=olympe.dc.kc.Zx();this.j=Pl(a,this,this.Ac);null!==this.valueType&&this.j.Md(this.valueType);olympe.C.Xa().Td(()=>
920
+ {var b=this.j.T();a.G.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.j.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.j.release(),a.j.delete(b));this.j=null})}return this}mc(){null===this.j&&this.nb();return this.j}Md(a){this.valueType=a;null!==this.j&&this.j.Md(this.valueType)}Nb(){return null!==this.j?this.j.Nb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Yd(){return this.D}Xl(){return this.ba}hd(a,b){return this.mc().hd(a,b)}bl(a){this.mc().bl(a)}tu(){return this.mc().Id()}su(){return this.mc().R()}get(a){return this.mc().get(a)}hi(){return this.mc().hi()}fi(a){const b=
921
+ this.mc();Ol(b,'getCurrent');return b.fi(a)}has(a){return this.mc().has(a)}ih(a){const b=this.mc();Ol(b,'hasCurrent');return b.ih(a)}le(a){return this.mc().le(a)}cz(a){return this.le(a).asObservable()}ff(a){const b=this.mc();Ol(b,'getCurrentAt');return b.ff(a)}gf(a){return this.mc().gf(a)}Mf(a){const b=this.mc();Ol(b,'getCurrentKeyAt');return b.Mf(a)}Dd(a){return this.mc().Dd(a)}hz(a){return this.Dd(a).asObservable()}Nf(a){const b=this.mc();Ol(b,'getCurrentRank');return b.Nf(a)}Gc(){return this.mc().Gc()}dz(){return this.Gc().asObservable()}Of(){return this.mc().Of()}wf(){return this.mc().wf()}iz(){return this.wf().asObservable()}og(){const a=
922
+ this.mc();Ol(a,'getCurrentSize');return a.og()}forEach(a,b){this.mc().forEach(a,b)}ke(a){const b=this.mc();Ol(b,'forEachCurrentValue');return b.ke(a)}mj(a,b,c,d){a=new olympe.dc.ba.Bh(a,b);(new olympe.dc.za(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');
923
+ if(c instanceof olympe.dc.Ra.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.j)break;a.push(c)}b=new olympe.dc.za(this.D,a);b.Ac=this.Ac;b.Md(Nl(b)||this.valueType||Object);return b}gl(a){return this.transform(new olympe.dc.ba.Gf(a))}filter(a){return this.transform(new olympe.dc.ba.tf(a))}Jk(){const a=new olympe.dc.ck(this.D,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.Ac&&(a.Ac=this.Ac);
924
+ 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.Pa(this.D)+a+')'}ru(){return this.mc().Eg()}Uc(){return olympe.C.ta([this.wf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.ff(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.C.xb(b+']')},olympe.C.Sa)}};olympe.dc.za.prototype.filter=olympe.dc.za.prototype.filter;olympe.dc.za.prototype.union=olympe.dc.za.prototype.gl;
925
+ olympe.dc.za.prototype.transform=olympe.dc.za.prototype.transform;olympe.dc.za.prototype.forEachCurrentValue=olympe.dc.za.prototype.ke;olympe.dc.za.prototype.forEach=olympe.dc.za.prototype.forEach;olympe.dc.za.prototype.getCurrentSize=olympe.dc.za.prototype.og;olympe.dc.za.prototype.observeSize=olympe.dc.za.prototype.iz;olympe.dc.za.prototype.observeFirst=olympe.dc.za.prototype.dz;olympe.dc.za.prototype.getCurrentRank=olympe.dc.za.prototype.Nf;olympe.dc.za.prototype.observeRank=olympe.dc.za.prototype.hz;
926
+ olympe.dc.za.prototype.getCurrentAt=olympe.dc.za.prototype.ff;olympe.dc.za.prototype.observeAt=olympe.dc.za.prototype.cz;olympe.dc.za.prototype.offReady=olympe.dc.za.prototype.bl;olympe.dc.za.prototype.onReady=olympe.dc.za.prototype.hd;olympe.dc.za.prototype.getBaseTag=olympe.dc.za.prototype.Yd;olympe.dc.za.xa=[olympe.C.qd];m=olympe.dc.za.prototype;m.me.K=olympe.C.J.j;m.nb.K=olympe.C.J.H();m.mc.K=new olympe.C.J(()=>olympe.dc.kc.Subscription,[]);m.Md.K=new olympe.C.J(()=>{},[]);
927
+ m.Yd.K=new olympe.C.J(()=>String,[]);m.Xl.K=new olympe.C.J(()=>Array,[]);m.hd.K=new olympe.C.J(()=>String,[]);m.bl.K=new olympe.C.J(()=>{},[]);m.tu.K=olympe.C.J.N;m.su.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.hi.K=new olympe.C.J(()=>Array,[]);m.fi.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.ih.K=olympe.C.J.j;m.le.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.ff.K=olympe.C.J.j;m.gf.K=new olympe.C.J(()=>String,[]);m.Mf.K=olympe.C.J.j;m.Dd.K=olympe.C.J.F;
928
+ m.Nf.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.Of.K=new olympe.C.J(()=>String,[]);m.wf.K=olympe.C.J.F;m.og.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.ke.K=olympe.C.J.j;m.mj.K=new olympe.C.J(()=>{},[]);m.transform.K=new olympe.C.J(()=>olympe.dc.za,[]);m.gl.K=new olympe.C.J(()=>olympe.dc.za,[]);m.filter.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Jk.K=new olympe.C.J(()=>olympe.dc.ck,[]);m.toString.K=olympe.C.J.j;m.ru.K=olympe.C.J.j;m.Uc.K=olympe.C.J.D;const Ql={Oz:'append',Ml:'filter_not',Wo:'filter_and',Xo:'filter_or'};function Rl(a,b){a=Sl(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.Za.Sn(a,b)).D}
929
+ olympe.dc.ck=class{constructor(a,b){this.j=Sl(a);this.G=olympe.ja.$a('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.ba=[];this.Fa=[];this.Ac=void 0}Li(){const a=new olympe.dc.za(this.j,this.ba,this.valueType);'boolean'===typeof this.Ac&&(a.Ac=this.Ac);return a}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Tl('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Ra.Property)throw new Tl('transform','Properties cannot be used as transformer, unlike relations '+
930
+ d);if(!d||'function'!==typeof d.j)throw new Tl('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}gl(a){this.ba.push(new olympe.dc.ba.Gf(a));return this}Mz(a){this.ba.push(new olympe.dc.ba.Gf(Sl(a)));return this}vu(a){this.valueType=a;return this}fb(a){this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}vx(a){for(const b of a)this.ba.push(b),this.valueType=b.Nb()||olympe.dc.CloudObject;return this}ux(a,
931
+ b,c){a=new olympe.dc.ba.Fe(a,a.Ka(),b,c);this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}tx(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.Ka())}a=new olympe.dc.ba.dk(b,c);this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}uu(){this.fb(olympe.dc.CloudObject.instancesRel);return this}cf(a){var b=this.Fa.pop();b===Ql.Ml&&(a=new olympe.dc.Z.fe(a),b=this.Fa.pop());switch(b){case Ql.Wo:b=this.ba.pop().D;b instanceof
932
+ olympe.dc.Z.Jd?(b=b.Z,b.push(a),a=new olympe.dc.Z.Jd(...b)):a=new olympe.dc.Z.Jd(b,a);b=this.Fa.pop();break;case Ql.Xo:b=this.ba.pop().D,b instanceof olympe.dc.Z.Be?(b=b.Z,b.push(a),a=new olympe.dc.Z.Be(...b)):a=new olympe.dc.Z.Be(b,a),b=this.Fa.pop()}b===Ql.Ml&&(a=new olympe.dc.Z.fe(a),this.Fa.pop());this.ba.push(new olympe.dc.ba.tf(a));return this}ox(a,b,c){return this.cf(new olympe.dc.Z.ve(Rl(a,c),new olympe.dc.Za.Re(b)))}contains(a,b,c=!1,d){return this.cf(new olympe.dc.Z.sf(Rl(a,d),new olympe.dc.Za.Re(b),
933
+ c))}Ob(a){if(!(a instanceof Array))throw new Tl('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(Sl(a[c]));return this.cf(new olympe.dc.Z.Ii(b))}Xk(a){return this.cf(new olympe.dc.Z.ve(new olympe.dc.Za.aj,new olympe.dc.Za.Re(Sl(a))))}px(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.ud().Xk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().ud().Xk(a[b])}return this}Dy(a,b){if(!(a instanceof
934
+ Array))throw new Tl('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Ka())});return this.cf(new olympe.dc.Z.Fi(c,d,b))}Vk(a,b,c){a=Rl(a,c);return this.cf(new olympe.dc.Z.Zj(a,new olympe.dc.Za.Re(b)))}Cj(a,b,c){a=Rl(a,c);return this.cf(new olympe.dc.Z.Ak(a,new olympe.dc.Za.Re(b)))}Vy(a,b,c,d){a=Rl(a,d);return this.cf(new olympe.dc.Z.Df(a,b,c))}filter(a){const b=new class extends olympe.dc.Z.tg{j(c,d){return a(olympe.dc.CloudObject.get(d))}};
935
+ return this.cf(b)}ud(){this.Fa.push(Ql.Ml);return this}and(){this.ba[this.ba.length-1]instanceof olympe.dc.ba.tf&&this.Fa.push(Ql.Wo);return this}or(){this.ba[this.ba.length-1]instanceof olympe.dc.ba.tf&&this.Fa.push(Ql.Xo);return this}fl(a,b,c){a=Sl(a);let d=null;switch(olympe.dc.ia().Jb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.X():d=new olympe.dc.wc.String(new olympe.dc.Za.Zi(a,c));break;case olympe.dm.Number.O.X():d=new olympe.dc.wc.Number(new olympe.dc.Za.Qi(a,c));break;case olympe.dm.DateTime.O.X():d=
936
+ new olympe.dc.wc.DateTime(new olympe.dc.Za.yi(a,c))}c=d;null!==c&&this.ba.push(new olympe.dc.ba.Tg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.wc.tg{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.Tg(d,c));return this}kx(){this.ba.push(new olympe.dc.ba.zi);return this}wj(a,b){this.ba.push(new olympe.dc.ba.Bh(a,b));return this}};class Tl extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
937
+ function Sl(a){return'string'===typeof a||a instanceof olympe.C.Sa?a:'function'===typeof a?olympe.dc.na.ac(a):olympe.C.hb(a)?a.Sh===olympe.C.Sa?a:olympe.C.ta([a],b=>olympe.C.xb(olympe.dc.fa(b)),olympe.C.Sa):a.X()}m=olympe.dc.ck.prototype;m.Li.K=new olympe.C.J(()=>olympe.dc.za,[]);m.transform.K=olympe.C.J.H();m.gl.K=olympe.C.J.H();m.Mz.K=olympe.C.J.H();m.vu.K=olympe.C.J.H();m.fb.K=olympe.C.J.H();m.vx.K=olympe.C.J.H();m.ux.K=olympe.C.J.H();m.tx.K=olympe.C.J.H();m.uu.K=olympe.C.J.H();m.cf.K=olympe.C.J.H();
938
+ m.ox.K=olympe.C.J.H();m.contains.K=olympe.C.J.H();m.Ob.K=olympe.C.J.H();m.Xk.K=olympe.C.J.H();m.px.K=olympe.C.J.H();m.Dy.K=olympe.C.J.H();m.Vk.K=olympe.C.J.H();m.Cj.K=olympe.C.J.H();m.Vy.K=olympe.C.J.H();m.filter.K=olympe.C.J.H();m.ud.K=olympe.C.J.H();m.and.K=olympe.C.J.H();m.or.K=olympe.C.J.H();m.fl.K=olympe.C.J.H();m.sort.K=olympe.C.J.H();m.kx.K=olympe.C.J.H();m.wj.K=olympe.C.J.H();function Pl(a,b,c){const d=b.Yd();var e=new olympe.dc.query.vv;let f;f=d;olympe.C.hb(f)&&(f=e.add(d));b=(b=b.Xl())?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}
939
+ function Ul(a,b){if(b.R())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.sr(a.db,a.G),d=b.T();olympe.C.Sc([b.Yd()],e=>{const f=olympe.dc.fa(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.ai()||b.Wk();sf(a.db,f,Vl(a,b,c),d);olympe.C.Xa().Td(()=>qf(a.db,f,d));a.db.Ga(f.valueOf())||Wl(c);b.R()||(Wl(c),b.$c([]))})}}
940
+ function Xl(a,b,c,d,e){const f=[b.Yd()],g=l=>l instanceof olympe.dc.ba.Gf;let h;const k=(null!=(h=b.gh())?h:[]).filter(g);for(const l of k){f.push(l.Yd());let n;k.push(...(null!=(n=l.gh())?n:[]).filter(g))}olympe.C.Sc(f,()=>{const l=b.$e(c);Yl(a,l,b.T(),d,e)})}
941
+ function Yl(a,b,c,d,e){a.G.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.C.Xa(),g=new olympe.async.mk(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;fi(a.H,h,f,olympe.dc.Ja.SELF,olympe.dc.ma.nc.qf,{Ac: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}`))))})});bd(g,(h,k)=>d(k));g.start()}
942
+ function Vl(a,b,c){const d=new olympe.dc.lc.Jj;let e=!1;const f=olympe.C.Xa(),g=b.gh(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.gd()||f.gb()||(k?b.ih(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.Rd(n,l)):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Removing Instance',l,'from the subscription'),b.ci(n)),e||(Zl(c,()=>{p.ig();Wl(c)}),f.run(()=>p.me().rg(b.$c.bind(b))),
943
+ e=!0),$l(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,am(p,k,l,n))}}
944
+ olympe.dc.kc.Tu=class{constructor(a,b,c,d,e,f){this.G=a;this.db=b;this.D=f||e;this.H=d;this.j=new Map;this.F=new olympe.C.Xb('Legacy ListDef processor')}process(a,b){const c=a.T();var d=this.j.get(c);d||(d=new olympe.dc.kc.dw(a),this.j.set(c,d));d.counter++;bm(d)?this.G.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.G.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.$h(),b||this.D&&d===olympe.dc.Ja.SERVER||d===olympe.dc.Ja.SELF?(this.G.debug('QueryMGR: [ID:',c,'] - Local subscription, no need for coverage check, booting subscription '),
945
+ Ul(this,a)):Xl(this,a,d,e=>{e?this.G.error(e):Ul(this,a)},b))}};function cm(a){return olympe.C.hb(a)?'Node#'+a.Ba.T():String(a)}function dm(a,b){return olympe.C.hb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
946
+ olympe.dc.query.vv=class{constructor(){this.j=0;this.values=null}add(a){let b;b=olympe.C.hb(a)?'n'+a.Ba.T():'p'+ ++this.j;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.Aa=class{la(){}j(){}D(){}ga(){}toString(){}};olympe.dc.kc.Subscription=class a extends olympe.C.Hj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.C.Xb('context subscription '+b,e));this.id=b;this.Bd=c;this.ba=d||null;this.F=this.N.run(()=>olympe.C.be(olympe.dc.kc.Subscription.j.INIT));this.vc=!1;this.$=this.zc=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.tb(e)}catch(f){e=olympe.V.Ic()}return e}T(){return this.id}Yd(){return this.Bd}gh(){return this.ba}$h(){const b=
947
+ olympe.dc.ae(),c=olympe.C.Pa(this.Yd());let d;return olympe.dc.CloudObject.instancesRel.Ea(null==(d=this.ba)?void 0:d[0])?b.fromModel(c):b.Ke(c)}ai(){const b=olympe.C.Pa(this.F);return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.kr}Wk(){if(this.F.Ba.gb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.zc;this.zc=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);fc(this.F,olympe.C.be(olympe.dc.kc.Subscription.j.kr))}Id(){return olympe.C.ta([this.F],
948
+ ()=>{},olympe.C.ea)}R(){const b=this.F.Ba.Fb;return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.Jh}hd(b,c){this.R()?b(this):(null===this.$&&(this.$=new Map),void 0===c&&(c=olympe.V.Ic()),this.$.set(c,olympe.C.Xa().rc(b)));return c||''}bl(b){null!==this.$&&b&&this.$.delete(b)}Mb(){const b=olympe.dc.kc.Subscription.j.Jh;if(!this.F.Ba.gb()&&olympe.C.Pa(this.F)!==b&&(this.If(),fc(this.F,b),null!==this.$)){for(const c of this.$.values())c(this);this.$=null}}onDestroy(b){this.N.onDestroy(b)}release(){this.N.destroy()}$c(b){if(!this.F.Ba.gb()){for(let c=
949
+ 0,d=b.length;c<d;c++)this.Nm(b[c],c);if(this.R())this.If();else{this.vc=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.Mb()}}}Rd(b,c){if(!this.F.Ba.gb()&&(this.Ik(b,olympe.dc.CloudObject.get(c)),b=this.R(),this.vc&&!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.Mb()}}ci(b){this.F.Ba.gb()||(this.Mm(b),
950
+ this.fj(b,!this.R()))}Eg(){return this.R()?super.Eg():'Subscription is not ready!'}$e(b){const c=olympe.C.Pa(this.Yd());return olympe.dc.kc.Subscription.D(c,b,this.gh())}static D(b,c,d){var e=olympe.dc.ma.from(b,c).ie();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.Ve){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.fb(h,!0))}else if(e instanceof olympe.dc.ba.Fe){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.mg(h,!0,!0))}else if(e instanceof
951
+ olympe.dc.ba.Gf)e=a.D(olympe.C.Pa(e.Yd()),c,e.gh()),b.push(...e);else if(e instanceof olympe.dc.ba.tf||e instanceof olympe.dc.ba.Tg){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.mg(n,!0,!0):k.fb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.kc.Subscription.j={INIT:0,kr:1,Jh:2};olympe.dc.kc.Subscription.prototype.Eg.K=olympe.C.J.j;function bm(a){const b=a.D;a.D=!0;return b}olympe.dc.kc.dw=class{constructor(a){this.counter=0;this.D=!1;this.j=a}};olympe.dc.Ff=class{la(){}Nb(){}j(){}ga(){}toString(){}};olympe.dc.Dq=class{F(){}};olympe.dc.Fk=class{la(){}getValue(){}j(){}ga(){}toString(){}};olympe.dc.wc={};let em=0;olympe.dc.wc.tg=class{constructor(){this.id=em++}la(){return'CustomLocalComparator#'+em}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.wc.tg.xa=[olympe.dc.rf];olympe.dc.wc.DateTime=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.DateTime)}H(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}ga(a){return'{"c":"'+this.la()+'",a:['+this.j.ga(a)+']}'}toString(){return'Number('+this.j.toString()+')'}};P('olympe.dc.comparators.DateTime',olympe.dc.wc.DateTime);olympe.dc.wc.DateTime.xa=[olympe.dc.rf];olympe.dc.wc.Number=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.Number)}H(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(a,b){return a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`Number(${this.j.toString()})`}};P('olympe.dc.comparators.Number',olympe.dc.wc.Number);olympe.dc.wc.Number.xa=[olympe.dc.rf];olympe.dc.wc.String=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.String)}H(){return this.j.j()}F(a,b){return olympe.C.ta([this.j.getValue(a,b)],c=>c.toLowerCase(),olympe.C.Sa)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`String(${this.j.toString()})`}};P('olympe.dc.comparators.String',olympe.dc.wc.String);olympe.dc.wc.String.xa=[olympe.dc.rf];olympe.dc.Z={};let fm=0;olympe.dc.Z.tg=class{constructor(){this.id=fm++}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.tg.xa=[olympe.dc.Aa];olympe.dc.Z.ml=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.ta([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.ea))}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()+')'}};
952
+ olympe.dc.Z.ml.xa=[olympe.dc.Aa];olympe.dc.Z.Jd=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.Jd)}D(){return this.Z.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Z.map(c=>c.j(a,b)),(...c)=>olympe.C.Sb(c.every(d=>d.valueOf())),olympe.C.ea))}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=>
953
+ a.toString()).join(',')+')'}};P('olympe.dc.predicates.And',olympe.dc.Z.Jd);olympe.dc.Z.Jd.xa=[olympe.dc.Aa];olympe.dc.Z.tl=class{constructor(a,b){this.F=a;this.value=b}j(a,b){return a.run(()=>olympe.C.ta([this.F,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.C.Sb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.C.ea))}la(){return Q(olympe.dc.Z.tl)}D(){return[this.value.j()]}ga(a){const b=olympe.C.hb(this.F)?this.F.Ba.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.Ba.Fb.valueOf():this.F.valueOf();
954
+ return this.la().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};P('olympe.dc.predicates.BitMask',olympe.dc.Z.tl);olympe.dc.Z.tl.xa=[olympe.dc.Aa];olympe.dc.Z.sf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}la(){return Q(olympe.dc.Z.sf)}D(){return[this.source.j(),this.value.j()]}sb(){return this.source}getValue(){return this.value}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.value.getValue(a,b),this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Sb(c.includes(d))},olympe.C.ea))}ga(a){const b=this.source.ga(a),c=this.value.ga(a);a=dm(a,this.F);
955
+ return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+']}'}toString(){const a=cm(this.F);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};P('olympe.dc.predicates.Contains',olympe.dc.Z.sf);olympe.dc.Z.sf.xa=[olympe.dc.Aa];olympe.dc.Z.ve=class{constructor(a,b){this.F=a;this.H=b}la(){return Q(olympe.dc.Z.ve)}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ta([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Fd?c.Fd(d):'object'===typeof d&&void 0!==d.Fd?d.Fd(c):olympe.C.Sb(c.valueOf()===d.valueOf()),olympe.C.ea,'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()+
956
+ ')'}};P('olympe.dc.predicates.Equals',olympe.dc.Z.ve);olympe.dc.Z.ve.xa=[olympe.dc.Aa];olympe.dc.Z.Kt=class extends olympe.dc.Z.ve{constructor(a,b){super(a,new olympe.dc.Za.Re(b))}};olympe.dc.Z.Kt.xa=[olympe.dc.Aa];olympe.dc.Z.Zj=class extends olympe.dc.Z.ml{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.Zj)}N(a,b){return a>b}};P('olympe.dc.predicates.Greater',olympe.dc.Z.Zj);olympe.dc.Z.Fi=class{constructor(a,b,c){this.ob=[];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.Fe?this.ob.push(new gm(c.X(),c.Ka(),c.F,c.D)):this.ob.push(new gm(olympe.dc.fa(c),b[d],1,1))}la(){return Q(olympe.dc.Z.Fi)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>gc(olympe.C.bc(Boolean),!1)),d=olympe.V.Ic(),e=olympe.dc.ia();let f=0;a=(h,k)=>{0!==this.F.length&&!this.F.includes(k)||
957
+ c.getContext().gb()||c.getContext().gd()||(f+=h?1:-1,c.update(0<f))};const g=this.ob;for(let h=g.length-1;0<=h;h--)a=hm(g[h],e,a,d+h);sf(e,b,a,d);c.getContext().onDestroy(()=>{qf(e,b,d)});return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelated',olympe.dc.Z.Fi);
958
+ function hm(a,b,c,d){const e=Object.create(null);d+=olympe.V.di();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 gm 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.Ka()}, ${this.D}, ${this.j}`}}olympe.dc.Z.Fi.xa=[olympe.dc.Aa];olympe.dc.Z.Sl=class{constructor(a,b,c){this.ob=[];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.Fe?this.ob.push(new im(c.X(),c.Ka(),c.F,c.D)):this.ob.push(new im(olympe.dc.fa(c),b[d],1,1))}la(){return Q(olympe.dc.Z.Sl)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>gc(olympe.C.bc(Boolean),!1)),d=olympe.dc.ia(),e=olympe.V.di();let f=(k,l,n)=>{l&&(null===this.F||this.F.includes(n))&&k(1)};
959
+ const g=this.ob;for(let k=g.length-1;0<=k;k--)f=jm(g[k],d,f,e+k);let h=0;sf(d,b,f.bind(null,k=>{c.getContext().gd()||c.getContext().gb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>qf(d,b,e));return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(null!==this.F?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.F?'#['+this.F.toString()+'], ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelatedTree',olympe.dc.Z.Sl);
960
+ function jm(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.di();if(q){const u=p+r,x=y=>{const z=f.get(r);if(g.has(u))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(u),e.set(r,(e.get(r)||0)+y),Array.from(z.values()).forEach(A=>A(y)));g.delete(u)};h(l,r,p);e.has(r)?l(e.get(r)):(n>=a.D&&c(y=>
961
+ {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 im 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.Ka()}, ${this.D}, ${this.j}`}}olympe.dc.Z.Sl.xa=[olympe.dc.Aa];olympe.dc.Z.Ii=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.Ii)}D(){return[]}j(a,b){const c=a.run(()=>gc(olympe.C.bc(olympe.C.ea),olympe.C.ea.j)),d=olympe.dc.ia();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})`);
962
+ this.F.has(k)?(c.update(olympe.C.ea.D),f()):(h=new km(k,olympe.dc.CloudObject.extendRel),e.push(h),T(d,h.tag,h.relation,g,h.id))}};a=new km(b,olympe.dc.CloudObject.modelRel);e.push(a);T(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(Array.from(this.F))+']}'}toString(){return'InstanceOf('+Array.from(this.F).join(', ')+')'}};class km{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.V.di()}}
963
+ P('olympe.dc.predicates.InstanceOf',olympe.dc.Z.Ii);olympe.dc.Z.Ii.xa=[olympe.dc.Aa];olympe.dc.Z.fe=class{constructor(a){this.F=a}la(){return Q(olympe.dc.Z.fe)}D(){return this.F.D()}j(a,b){return a.run(()=>olympe.C.ta([this.F.j(a,b)],c=>olympe.C.Sb(!c.valueOf()),olympe.C.ea))}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.fe);olympe.dc.Z.fe.xa=[olympe.dc.Aa];olympe.dc.Z.Be=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.Be)}D(){return this.Z.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Z.map(c=>c.j(a,b)),(...c)=>olympe.C.Sb(c.some(d=>d.valueOf())),olympe.C.ea))}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(',')+
964
+ ')'}};P('olympe.dc.predicates.Or',olympe.dc.Z.Be);olympe.dc.Z.Be.xa=[olympe.dc.Aa];olympe.dc.Z.Df=class{constructor(a,b,c){this.source=a;this.H=b;this.F=void 0===c?!0:c}la(){return Q(olympe.dc.Z.Df)}D(){return[this.source.j()]}sb(){return this.source}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.H,this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Sb((new RegExp(d)).test(c))},olympe.C.ea))}ga(a){const b=this.source.ga(a),c=dm(a,this.H);a=dm(a,this.F);return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+
965
+ ']}'}toString(){const a=cm(this.F);return'Regex('+this.source.toString()+','+this.H+','+a+')'}};P('olympe.dc.predicates.Regex',olympe.dc.Z.Df);olympe.dc.Z.Df.xa=[olympe.dc.Aa];olympe.dc.Z.Ak=class extends olympe.dc.Z.ml{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.Ak)}N(a,b){return a<b}};P('olympe.dc.predicates.Smaller',olympe.dc.Z.Ak);olympe.dc.lc={};olympe.dc.lc.Jj=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.Uj(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&&
966
+ (0<=this.D?lm(mm(this.H,this.D),a):a.push(this.R));this.$(a)}}rg(a){this.$=a}};olympe.dc.lc.Jj.xa=[olympe.dc.lc.Ta];function am(a,b,c,d){b?a.N[d]=c:delete a.N[d];null===a.D&&(a.D=new olympe.dc.lc.Uj(a.j,a));return a.D}function mm(a,b){for(let c=0;c<b;c++)if(null!==a.D)a=a.D;else break;return a}function lm(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.Uj=class{constructor(a,b){this.j=a;this.depth=b?b.depth+1:0;this.N=Object.create(null);this.D=null}me(){return this.j}ig(){this.j.N()?this.j.F():this.j.Y(this.depth-1)}};class nm extends olympe.dc.lc.Uj{constructor(a,b,c){super(a);this.R=b;this.tag=c;this.$=this.Y=this.H=!1;this.F=null}}
967
+ function om(a,b,c,d,e){const f=Object.create(null),g=a.ha,h=a.H;let k,l,n;a.da=!0;l=0;for(n=g.length;l<n;l++)f[g[l]]=null;g.length=0;l=c;for(n=Math.min(b.length,d);l<n;l++)k=b[l],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.H||(c.H=!0,e(!0,c.tag,c.R,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.H&&(c.H=!1,e(!1,c.tag,c.R,c)),c.Y&&(c.F=null,delete h[k]),delete f[k]);a.da=!1;null!==a.D&&a.F()}
968
+ olympe.dc.lc.cm=class{constructor(){this.H={};this.ha=[];this.D=null;this.da=!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.da){var a=this.ha,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=mm(f,g)}null!==
969
+ e.F&&lm(e.F,this.R)}}this.$&&this.$(this.R)}}rg(a){this.$=a}j(a,b,c){let d=this.H[c];a?void 0===d?(d=new nm(this,c,b),this.H[c]=d):(d.tag=b,d.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.lc.cm.xa=[olympe.dc.lc.Ta];olympe.dc.lc.Ta=class{constructor(){}j(){}N(){}Y(){}F(){}rg(){}};function pm(a,b){olympe.C.jf(a.value)?(a.node=olympe.C.un(a.value,b),Nb(a.node)||b()):b()}function qm(a,b){if(olympe.C.jf(a.value)){const c=olympe.C.Xa(),d=a.H;olympe.C.Sc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>pm(a,b)),olympe.C.Xa().destroy())})}}
970
+ class rm extends olympe.dc.lc.Uj{constructor(a,b,c){super(a);this.Y=b;this.value=c;this.H=this.Pa();this.position=this.node=null;this.R=!1;this.F=null}Pa(){const a=olympe.C.Pa(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}}
971
+ function sm(a,b){if(!b.gb()){var c=a.D;var d=a.ha,e=b.Pa(),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.Pa();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()}}}
972
+ function tm(a){const b=a.ha;a.D.sort((c,d)=>b(c.Pa(),d.Pa()))}
973
+ olympe.dc.lc.qr=class{constructor(a){this.ha=a;this.H=null;this.D=[];this.R=[];this.$=null;this.da=new Map}j(a,b,c,d){b='$'+c;const e=this.D;let f;if(a)f=new rm(this,c,d),this.da.set(b,f),this.N()?pm(f,()=>sm(this,f)):(f.position=e.length,e.push(f));else{f=this.da.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.da.delete(b);null!==f.position&&(this.N()?this.remove(f):delete e[f.position]);f.destroy()}return f}N(){return null!==this.H}Y(a){if(null!==this.H)throw Error('Manager already activated (depth='+
974
+ this.H+')');this.H=a;tm(this);for(let b=0,c=this.D.length;b<c;b++){const d=this.D[b];d.position=b;qm(d,()=>sm(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=mm(b,c)}0>this.H?this.R.push(e.Y):e.F&&lm(e.F,this.R)}this.$&&this.$(this.R)}rg(a){this.$=a}remove(a){const b=this.D,c=b.length-1;if(null!==a.position){for(a=a.position;a<
975
+ c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.lc.qr.xa=[olympe.dc.lc.Ta];function Wl(a){if(!a.D){for(let b in a.F)um(a.F[b]);a.D=!0}a.H=null;a.N=null}function Zl(a,b,c){a.F[c||'root'].R=b}function $l(a,b,c){a.F[c||'root'].ig(b)}function vm(a,b,c,d){const e=a.N,f=b+d+c;let g=e[f];void 0===g&&(g=$g(a.db,b,c,d),e[f]=g);return g}function wm(a,b){a.D||a.j.ig(b)}function xm(a,b,c,d,e){if(!a.D){let f=vm(a,c,d,e||olympe.dc.ua.DESTINATION);e||(f+=vm(a,c,d,olympe.dc.ua.ORIGIN));0===f&&wm(a,b)}}
976
+ function ym(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 zm(a){const b=String(++a.R),c=a.j;a.F[b]=new Am(b,c);Bm(c,b);c.H||(c.H=()=>ym(a,c.T()));return b}function Cm(a,b){const c=a.j;a.j.H=()=>{ym(a,c.T());b()}}function Dm(a,b){um(b?a.F[b]:a.j)}
977
+ olympe.dc.lc.sr=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 Am('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=vm(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 Bm(a,b){null===a.D&&(a.D=Object.create(null));a.D[b]=!1}function um(a){a.N=!0;null!==a.F&&a.F.notify(a.id)}
978
+ class Am{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}ig(a){const b=this.R;if(this.N||this.j===a||null===a)b&&b(),!b&&um(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.Za={};function Em(a,b,c,d){const e=olympe.dc.ia(),f=new olympe.dc.lc.Jj,g=new olympe.dc.lc.sr(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,u)=>{a.gd()||a.gb()||(h||(Zl(g,()=>{u.ig();Wl(g)}),u.me().rg(l),h=!0),q?k[t]=r:delete k[t],$l(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.Ic();sf(e,b,(q,r)=>{g.register(p,null);const t=f.j(q,b,p,null);n(q,r,p,am(t,q,b,p))},p);a.onDestroy(()=>{qf(e,b,p)});e.Ga(b)||Wl(g)}
979
+ function Fm(a,b,c){const d=c.getContext(),e=olympe.dc.ia(),f=a.F(),g=Lg(e,b,a.H,d.rc(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>Mg(e,b,a.H,g))}
980
+ olympe.dc.Za.ri=class{constructor(a,b,c){this.H=a&&a.X?a.X():a;this.ba=b&&b.filter(d=>d instanceof olympe.dc.ba.Ve||d instanceof olympe.dc.ba.Fe)||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)),[])}nh(a){this.defaultValue=a;return this}gh(){return this.ba}Yd(){return this.D}getValue(a,b){const c=a.run(()=>olympe.C.bc(this.Nb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&gc(c,this.defaultValue);
981
+ b=this.D||b;null!==this.ba?Em(a,b,this.ba,d=>{Fm(this,d,c)}):Fm(this,b,c);return c.rb()}ga(a){const b=dm(a,this.H),c=dm(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=cm(this.H),b=this.D?','+cm(this.D):'';let c='';this.ba&&(c=','+this.ba.join(','));return this.la().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.Za.ri.xa=[olympe.dc.Fk];olympe.dc.Za.Sn=class{constructor(a,b){if(olympe.C.jf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ia();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.eh(e,olympe.dc.CloudObject.extendRel,olympe.dm.De);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.X():d=new olympe.dc.Za.Zi(c,b);break;case olympe.dm.Number.O.X():d=new olympe.dc.Za.Qi(c,
982
+ b);break;case olympe.dm.Boolean.O.X():d=new olympe.dc.Za.Kj(c,b);break;case olympe.dm.DateTime.O.X():d=new olympe.dc.Za.yi(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.Za.Sn.xa=[olympe.dc.Fk];olympe.dc.Za.Kj=class extends olympe.dc.Za.ri{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Kj)}F(){return olympe.dc.mb.Um}Nb(){return olympe.C.ea}};P('olympe.dc.valuedefs.BooleanProperty',olympe.dc.Za.Kj);olympe.dc.Za.Re=class{constructor(a){this.value=a}la(){return Q(olympe.dc.Za.Re)}j(){return[]}getValue(){return this.value}ga(a){a=dm(a,this.value);return`{"c":"${this.la()}","a":[${a}]}`}toString(){return`Constant(${cm(this.value)})`}};P('olympe.dc.valuedefs.Constant',olympe.dc.Za.Re);olympe.dc.Za.Re.xa=[olympe.dc.Fk];olympe.dc.Za.yi=class extends olympe.dc.Za.ri{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.yi)}F(){return olympe.dc.mb.Vm}Nb(){return olympe.C.eb}};P('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.Za.yi);olympe.dc.Za.Qi=class extends olympe.dc.Za.ri{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Qi)}F(){return olympe.dc.mb.Wm}Nb(){return olympe.C.aa}};P('olympe.dc.valuedefs.NumberProperty',olympe.dc.Za.Qi);olympe.dc.Za.Zi=class extends olympe.dc.Za.ri{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Zi)}F(){return olympe.dc.mb.Xm}Nb(){return olympe.C.Sa}};P('olympe.dc.valuedefs.StringProperty',olympe.dc.Za.Zi);olympe.dc.Za.aj=class{la(){return Q(olympe.dc.Za.aj)}j(){return[]}getValue(a,b){return b}ga(){return'{"c":"'+this.la()+'","a":[]}'}toString(){return'Tag()'}};P('olympe.dc.valuedefs.Tag',olympe.dc.Za.aj);olympe.dc.Za.aj.xa=[olympe.dc.Fk];olympe.dc.ba={};olympe.dc.ba.zi=class{Nb(){return null}la(){return Q(olympe.dc.ba.zi)}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,am(h,!0,f,f))):(d[f]++,wm(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,am(h,!1,f,f)))}}ga(){return'{"c":"'+this.la()+'"}'}toString(){return'Distinct()'}};P('olympe.dc.transformers.Distinct',olympe.dc.ba.zi);olympe.dc.ba.zi.xa=[olympe.dc.Ff];olympe.dc.ba.tf=class{constructor(a){this.D=a}Nb(){return null}la(){return Q(olympe.dc.ba.tf)}F(){return this.D.D()}j(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&wm(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,am(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.Ba);olympe.C.Rf(n)?(b.D||void 0!==olympe.C.Pa(n)||wm(b,h),e[l]=n,a.run(()=>{olympe.C.Sc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
983
+ 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.tf);olympe.dc.ba.tf.xa=[olympe.dc.Ff,olympe.dc.Dq];olympe.dc.ba.Nl=class{constructor(a,b,c,d){this.D=new olympe.dc.Ra.Relation(olympe.dc.fa(a),c||olympe.dc.ua.DESTINATION);this.F=new olympe.dc.Ra.Relation(olympe.dc.fa(b),d||olympe.dc.ua.DESTINATION)}Nb(){return Mf(this.D)}la(){return Q(olympe.dc.ba.Nl)}j(a,b,c){const d=olympe.dc.ia(),e={},f=this.D.X(),g=this.D.Ka(),h=this.F.X(),k=this.F.Ka();let l=null,n=null;const p=(r,t,u,x,y,z)=>{if(y){if(y=()=>{const A=olympe.V.tb(u+g+(f+'_'+r)+z,20),K=am(t,!0,z,A);l=r;n=()=>{c(!1,z,A,am(t,!1,z,A))};b.register(A,
984
+ u,x,f,g);c(!0,z,A,K)},y.ws=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),X=K.length,xa=0;xa<X;xa++){let ab=e[K[xa]];ab.ws<y&&(y=ab.ws,A=ab)}A&&A()}},q=(r,t,u,x,y)=>{x?e[y]||(e[y]=!0,xm(b,u,y,f,g),xm(b,u,y,h,k),T(d,y,this.D,p.bind(this,r,t,u,y),u+'_val'),T(d,y,this.F,q.bind(this,r+1,t,u),u+'_follow')):(d.D(y,this.F,u+'_follow'),d.D(y,this.D,u+'_val'),delete e[y])};return(r,t,u,x)=>q(0,x,u,r,t)}ga(){return'{"c":"'+this.la()+'","a":["'+this.D.toString()+
985
+ '","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.D.toString()+', '+this.F.toString()+')'}};P('olympe.dc.transformers.FirstRelated',olympe.dc.ba.Nl);olympe.dc.ba.Nl.xa=[olympe.dc.Ff];olympe.dc.ba.Bh=class{constructor(a,b){this.start=a;this.D=b}Nb(){return null}la(){return Q(olympe.dc.ba.Bh)}j(a,b,c){const d=new olympe.dc.lc.cm;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]);om(d,e,f,n,c)}};a.run(()=>olympe.C.Sc([this.start,this.D],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));Cm(b,k);const l=zm(b);ym(b,l);return(n,p,q,r)=>{h||(r.me().rg(t=>{e=t;Dm(b,l)}),Zl(b,()=>r.ig(),l),h=!0);d.j(n,p,q,null);$l(b,q,l)}}ga(a){return'{"c":"'+
986
+ this.la()+'","a":['+dm(a,this.start)+','+dm(a,this.D)+']}'}toString(){return`Limit(${olympe.C.Pa(this.start)},${olympe.C.Pa(this.D)})`}};P('olympe.dc.transformers.Limit',olympe.dc.ba.Bh);olympe.dc.ba.Bh.xa=[olympe.dc.Ff];function Gm(a){return a.ob.map(b=>b.X())}
987
+ olympe.dc.ba.dk=class{constructor(a,b){this.direction=b||olympe.dc.ua.DESTINATION;this.ob=a.map(c=>new olympe.dc.Ra.Relation(c,this.direction))}Nb(){return olympe.dc.CloudObject}la(){return Q(olympe.dc.ba.dk)}Ka(){return this.direction}j(a,b,c){const d=olympe.dc.ia(),e=(f,g,h,k)=>T(d,f,k,(l,n)=>{var p=k.X();p=olympe.V.tb(g+k.Ka()+p+n,20);const q=am(h,l,n,p);l&&b.register(p,g,f,k.X(),k.Ka());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.ob.forEach(l=>{xm(b,h,g,l.X(),l.Ka());e(g,h,k,l)}):this.ob.forEach(l=>
988
+ {d.D(g,l,h)})}}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(Gm(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Ka()+'['+Gm(this).join(',')+'])'}};P('olympe.dc.transformers.MultiRelated',olympe.dc.ba.dk);olympe.dc.ba.dk.xa=[olympe.dc.Ff];olympe.dc.ba.Fe=class extends olympe.dc.Ra.Relation{constructor(a,b=olympe.dc.ua.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.D=d}Nb(){return Mf(this)}la(){return Q(olympe.dc.ba.Fe)}j(a,b,c){const d=olympe.dc.ia(),e=Object.create(null),f=olympe.dc.ua.ORIGIN,g=olympe.dc.ua.DESTINATION,h=this.X(),k=this.Ka(),l=(p,q,r)=>{if(!(0<=this.D&&p>=this.D)){var t=d.ab(r,this);p+=1;for(let u=0,x=t.length;u<x;u++){if(void 0!==e[t[u]]||r===t[u])continue;const y=olympe.V.tb(q+k+(h+'_'+p)+t[u],20);b.register(y,
989
+ q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,x)=>{u&&!b.D&&l(p,t,x);p>=this.F?c(u,x,t,am(r,u,x,t)):xm(b,t,x,h,k);0<=this.D&&p>=this.D||(u?e[x]||(e[x]=!0,T(d,x,this,(y,z)=>{const A=p+1,K=olympe.V.tb(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.Ka()+'",'+this.F+','+this.D+']}'}toString(){return'RecursiveRelated('+this.Ka()+this.X()+'['+this.F+'..'+this.D+'])'}};
990
+ P('olympe.dc.transformers.RecursiveRelated',olympe.dc.ba.Fe);olympe.dc.ba.Fe.xa=[olympe.dc.Ff];olympe.dc.ba.Ve=class extends olympe.dc.Ra.Relation{constructor(a,b){super(a,b||olympe.dc.ua.DESTINATION)}Nb(){return Mf(this)}la(){return Q(olympe.dc.ba.Ve)}$b(){return new olympe.dc.ba.Ve(this.tag,this.direction===olympe.dc.ua.DESTINATION?olympe.dc.ua.ORIGIN:olympe.dc.ua.DESTINATION)}j(a,b,c){const d=olympe.dc.ia(),e=this.X(),f=this.Ka();return(g,h,k,l)=>{xm(b,k,h,e,f);g?T(d,h,this,(n,p)=>{const q=olympe.V.tb(k+f+e+p,20),r=am(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":"'+
991
+ this.la()+'","a":["'+this.X()+'","'+this.Ka()+'"]}'}toString(){return'Related('+this.Ka()+this.X()+')'}};P('olympe.dc.transformers.Related',olympe.dc.ba.Ve);olympe.dc.ba.Ve.xa=[olympe.dc.Ff];olympe.dc.ba.Tg=class{constructor(a,b){this.Hb=a;this.D=void 0===b?!0:!!b}Nb(){return null}la(){return Q(olympe.dc.ba.Tg)}$g(){return this.Hb}F(){return[this.Hb.H()]}j(a,b,c){const d=new olympe.dc.lc.qr(a.rc(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)+
992
+ ')'}};P('olympe.dc.transformers.Sort',olympe.dc.ba.Tg);olympe.dc.ba.Tg.xa=[olympe.dc.Ff,olympe.dc.Dq];function Hm(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,am(q,n,p,h))}const h=olympe.V.Ic(),k=olympe.dc.ia(),l=a.ba;b.run(()=>olympe.C.Sc([a.D],n=>{Im(k,n,g,h);void 0===k.model(n)&&Wl(e)}))}function Im(a,b,c,d){const e=b&&b.valueOf();e&&(sf(a,e,c,d),olympe.C.Xa().Td(()=>qf(a,e,d)))}
993
+ olympe.dc.ba.Gf=class{constructor(a,b){this.ba=this.D=null;a instanceof olympe.dc.za?(this.D=a.Yd(),this.ba=a.Xl()):(this.D=a,b&&(this.ba=b))}Nb(){return null}la(){return Q(olympe.dc.ba.Gf)||''}gh(){return this.ba}Yd(){return this.D}j(a,b,c){const d=new olympe.dc.lc.cm,e=new olympe.dc.lc.Jj;let f=[],g=[],h=!1,k=!1;const l=zm(b),n=zm(b);Cm(b,()=>{const p=f.concat(g);0<p.length?b.D||(b.j.j=p[p.length-1]):Dm(b);om(d,p,0,p.length,c)});ym(b,n);Hm(this,a,this.D,e,b,(p,q,r,t)=>{const u=olympe.C.Xa();u.gd()||
994
+ u.gb()||(k||(t.me().rg(x=>{g=x;Dm(b,n)}),Zl(b,()=>t.ig(),n),k=!0),d.j(p,q,r),$l(b,r,n))});ym(b,l);return(p,q,r,t)=>{h||(t.me().rg(u=>{f=u;Dm(b,l)}),Zl(b,()=>t.ig(),l),h=!0);d.j(p,q,r,l);$l(b,r,l)}}ga(a){const b=this.ba?'['+this.ba.map(c=>c.ga(a)).join(',')+']':'null';return'{"c":"'+this.la()+'","a":['+dm(a,this.D)+','+b+']}'}toString(){const a=olympe.C.hb(this.D)?'N:'+this.D.Ba.T():this.D.valueOf(),b=this.ba?','+this.ba.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
995
+ P('olympe.dc.transformers.Union',olympe.dc.ba.Gf);olympe.dc.ba.Gf.xa=[olympe.dc.Ff];olympe.dc.ba.Vq={fB:1,bu:-1,au:0};olympe.dc.ba.HC={Pz:!0,oA:!1};olympe.dc.kc.P={Qp:'dc.legacy.listdefProcessor'};olympe.dc.kc.U={Pp:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{F(a,olympe.dc.kc.U.Pp,!1);D(a,olympe.dc.kc.P.Qp,olympe.dc.kc.Tu,olympe.dc.query.P.Ca,olympe.dc.P.sh,olympe.dc.transaction.P.Da,olympe.dc.query.P.nk,new olympe.W.pa(olympe.dc.U.Mh),new olympe.W.pa(olympe.dc.kc.U.Pp))});olympe.W.run([olympe.dc.kc.P.Qp],a=>{olympe.dc.kc.Zx=()=>a});function Jm(a){const b=olympe.dc.ia(),c=new Map;b.ks(a).forEach(d=>{b.ab(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
996
+ olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ia();Object.defineProperty(this,'db',{enumerable:!1});this.model=null}static Oc(a,b,c,...d){b=olympe.dc.fa(b);var e=uf(b);if(e=e&&e.j)return e(a,c,...d);a=a.create(b);void 0!==c&&null!==c&&Y(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.ns();a=olympe.dc.fa(a);var c=b.db.model(a);c=tf(b,c);if(null===c)throw new olympe.dc.rq(a);c=c.instantiate(a,b.D);
997
+ b.j.je([a],olympe.dc.db.Instance.j.Bp);b.Ra.register(c,a);b=c}return b}static exists(a){return olympe.dc.ia().Ga(olympe.dc.fa(a))}static ex(a,b,c){const d=olympe.dc.ia();let e=null;const f=k=>{null===e&&(e=Jm(b||this));return e.has(k)?e.get(k):null},g=zl(!1),h=g.create(null!=b?b:this);void 0!==c&&h.li(c);a.forEach((k,l)=>{d.Ga(olympe.dc.fa(l))?Y(h,l,k):(l=f(l))&&Y(h,l,k)});g.nb((k,l)=>{k||olympe.ja.$a('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});return this.get(h)}static Nw(){return this.get(this)}static Yk(a){return olympe.dc.ma.Yk(a)}static Db(){return olympe.dc.ia().ab(this,
998
+ olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Ra.Property(a))}static Ed(){const a=olympe.dc.ia();return a.ab(this,olympe.dc.CloudObject.yj).map(b=>new olympe.dc.Ra.Relation(b)).concat(a.ab(this,olympe.dc.CloudObject.Zr).map(b=>new olympe.dc.Ra.Relation(b,olympe.dc.ua.ORIGIN)))}static Qc(a){return olympe.dc.CloudObject.get(a)}static ps(a){var b=tf(olympe.dc.ns(),olympe.dc.fa(a));b=b&&b.D;return new olympe.dc.za(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)}Wb(){this.model||
999
+ (this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.ma.from(this)}Le(){return this.db.Le(this)}sb(){return this.db.source(this)}Wx(){return this.db.ji(this)?olympe.dc.ae().fromModel(this):null}js(){return olympe.C.ta([this.la()],a=>olympe.C.xb(a),olympe.C.Sa,'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.Cb?a.Cb():a;return new rxjs.Observable(e=>
1000
+ {const f=olympe.dc.mb.Bc(this.db.Qa(this.tag,b));c||null!==f||e.next(f);const g=Lg(this.db,this.tag,b,h=>{e.next(olympe.dc.mb.Bc(h))});d.Td(()=>{e.complete();Mg(this.db,this.tag,b,g)});return()=>Mg(this.db,this.tag,b,g)})}fz(a){const b='function'===typeof a.Cb?a.Cb():a;return new rxjs.Observable(c=>{const d=Ng(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Ra.Property(e),null]):c.next([new olympe.dc.Ra.Property(e),f])});b.Td(()=>{c.complete();Og(this.db,this.tag,d)});return()=>
1001
+ Og(this.db,this.tag,d)})}gz(a){return this.observe(olympe.C.Xa(),a)}get(a){return olympe.dc.mb.Bc(this.db.Qa(this.tag,a))}Qa(a){return this.get(a)}fb(a){return olympe.dc.ma.from(this).fb(a)}ng(a){return olympe.dc.nd.from(this).fb(a)}Bc(){return this}Gx(){return this.Pc(olympe.dc.CloudObject.Zw,olympe.dc.CloudObject)}en(){return this.ab(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Pf(a,b,c){const d=olympe.C.bc(c,'Sync valueType'),e=Lg(this.db,this.tag,a,olympe.C.Xa().rc(f=>{b&&null!==f&&
1002
+ void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>Mg(this.db,this.tag,a,e));return d.getContext()}wb(a){return M(this.Pf(a,olympe.dc.mb.Xm,olympe.C.Sa))}sd(a){return M(this.Pf(a,olympe.dc.mb.Wm,olympe.C.aa))}dh(a){return M(this.Pf(a,olympe.dc.mb.Um,olympe.C.ea))}sj(a){return M(this.Pf(a,olympe.dc.mb.Vm,olympe.C.eb))}us(){return M(this.Pf(olympe.dm.Color.valueProp,olympe.dc.mb.Sr,olympe.C.Color))}vs(){return M(this.Pf(olympe.sc.workflow.Transition.processRefProp,
1003
+ olympe.dc.mb.Tr,olympe.dc.CloudObject))}ab(a,b){a=a instanceof olympe.dc.ba.Ve?a:new olympe.dc.ba.Ve(a.X(),a.Ka());return new olympe.dc.za(this.X(),a,b)}Pc(a,b){return this.ab(a,b).Gc()}cs(a,b){const c=this.db,d=olympe.V.Ic(),e=olympe.C.Xa(),f=new Map;T(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,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)})}Iz(){return new olympe.dc.za(this.X(),[],Kf(this.X()))}transform(...a){return(new olympe.dc.za(this.X(),
1004
+ [],this.constructor)).transform(...a)}Uc(){return this.js()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ga(this.tag)?Object.assign({'#tag':this.X(),'#type':this.Wb().name()},this.Vc(!0,!0)):{'#tag':this.X(),'#error':'The object does not exist in the local database.'}}Vc(a=!1,b=!0){const c={};this.db.Db(this,b).forEach((d,e)=>{this.db.Ga(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.mb.Bc(d))});return c}Ea(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():
1005
+ 'function'===typeof a?olympe.dc.na.ac(a)===this.X():!1}Fd(a){return olympe.C.ta([a],b=>olympe.C.Sb(this.Ea(b)),olympe.C.ea)}ix(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Wa,c=!0;const d=olympe.dc.ua.ORIGIN;for(const [e,f,g]of Yg(b,this))f===d?a.hc(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.hc(e,this,g);a.delete(this,olympe.dc.Lb.NONE);c&&a.nb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Ea;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Vc;
1006
+ olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.ng;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.fb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Qa;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.gz;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.fz;
1007
+ 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.sb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Le;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Wb;
1008
+ 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.ps;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Qc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.Ed;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Db;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Yk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Nw;
1009
+ 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.TE=olympe.dc.CloudObject.O.ka(olympe.dc.Jp.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.O.ka('ff023000000000000011');B('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);
1010
+ olympe.dc.CloudObject.EE=olympe.dc.CloudObject.O.ka('ff023000000000000012');olympe.dc.CloudObject.yj=olympe.dc.CloudObject.O.sa('ff02200000000000000a');olympe.dc.CloudObject.Zr=olympe.dc.CloudObject.O.sa('ff02200000000000000b',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.nE=olympe.dc.CloudObject.O.sa('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.dE=olympe.dc.CloudObject.O.sa('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.sa('ff02200000000000000c');
1011
+ B('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.O.sa('ff02200000000000000d',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.O.sa(olympe.dc.fc.Yc);B('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);B('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);
1012
+ olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.sa(olympe.dc.fc.Ai);B('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.extendRel);B('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.sa(olympe.dc.fc.Nj);B('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);
1013
+ olympe.dc.CloudObject.Zw=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.hx=olympe.dc.CloudObject.O.sa('018282d3ac0a474a0bf4');B('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.hx);olympe.dc.JC=olympe.dc.CloudObject;olympe.dc.CloudObject.xa=[olympe.dc.Te];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;m.Wb.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);
1014
+ m.sb.K=new olympe.C.J(()=>String,[]);m.Wx.K=new olympe.C.J(()=>String,[]);m.js.K=olympe.C.J.D;m.ac.K=new olympe.C.J(()=>String,[]);m.Gx.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.en.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Pf.K=new olympe.C.J(()=>olympe.C.Node,[]);m.wb.K=olympe.C.J.D;m.sd.K=olympe.C.J.F;m.dh.K=olympe.C.J.N;m.sj.K=new olympe.C.J(()=>olympe.C.eb,[]);m.us.K=new olympe.C.J(()=>olympe.C.Color,[]);m.vs.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);
1015
+ m.ab.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Pc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.cs.K=new olympe.C.J(()=>Function,[]);m.Iz.K=new olympe.C.J(()=>olympe.dc.za,[]);m.transform.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Uc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;m.Fd.K=olympe.C.J.N;m.ix.K=new olympe.C.J(()=>{},[]);olympe.dc.P={sh:'dc.DBView',Ep:'dc.InstanceManager',Ca:'dc.Logger',iw:'dc.TransactionLogger',Vj:'dc.FileServiceManager',Ng:'dc.Router'};olympe.dc.U={Qg:'dc.tag',Xf:'dc.debug',Mh:'dc.subscribeAll',Gl:'dc.defaultSource',Vo:'dc.fileCache',yo:'dc.dataConsumerOnly',Qo:'dc.errorOnAbstractInstantiation'};
1016
+ olympe.W.config(function(a){const b='object'===typeof window;F(a,olympe.dc.U.Xf,!1);F(a,olympe.dc.U.Mh,!1);F(a,olympe.dc.U.Gl,olympe.dc.Ja.SERVER);F(a,olympe.dc.U.yo,b);F(a,olympe.dc.U.Vo,b);F(a,olympe.dc.U.Qo,!0);F(a,olympe.dc.U.Qg,olympe.V.Ic());E(a,olympe.dc.P.Ca,[olympe.ja.P.Da],c=>c.cd('dc'));Wa(a,olympe.dc.P.iw,olympe.dc.transaction.P.Ca);Wa(a,olympe.dc.P.sh,olympe.dc.db.P.Dl);D(a,olympe.dc.P.Vj,olympe.dc.Pt,olympe.dc.P.Ca,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.dc.P.Ng,olympe.V.P.vg,new olympe.W.pa(olympe.dc.U.Vo));
1017
+ D(a,olympe.dc.P.Ng,olympe.dc.Kv,olympe.dc.P.Ca,olympe.dc.sources.P.Mq,olympe.dc.sources.P.er,olympe.dc.P.sh,olympe.host.P.Ue,new olympe.W.pa(olympe.dc.U.Qg),new olympe.W.pa(olympe.dc.U.yo));D(a,olympe.dc.P.Ep,olympe.dc.iu,olympe.dc.db.P.Ol,olympe.dc.db.P.Da,olympe.W.P.xg)},'olympe.dc');
1018
+ olympe.W.run([olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.Ep,olympe.dc.P.Vj,new olympe.W.pa(olympe.dc.U.Qg)],(a,b,c,d,e)=>{olympe.dc.gs=()=>a;olympe.dc.uj=()=>b;olympe.dc.ns=()=>c;olympe.dc.ls=()=>d;olympe.dc.Ja.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Qd=class extends olympe.dc.CloudObject{la(){return this.wb(olympe.dc.CloudObject.nameProp)}j(){return olympe.C.Sa.EMPTY}D(){return olympe.C.ea.j}};olympe.dm.Qd.O=olympe.dc.na.j('ff021000000000000002',olympe.dm.Qd);olympe.dm.Qd.N=olympe.dm.Qd.O.ka('ff023000000000000035');olympe.dm.Qd.j=olympe.dm.Qd.O.sa('ff022000000000000005');olympe.dm.Qd.F=Jf('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Qd.H=Jf('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
1019
+ olympe.dm.Qd.D=Jf('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Qd.prototype.la.K=olympe.C.J.D;olympe.dm.Qd.prototype.j.K=olympe.C.J.D;olympe.dm.Qd.prototype.D.K=olympe.C.J.N;olympe.dm.ll={NONE:0,sA:1,Ct:2,tA:4,pA:8,rA:16,qA:31,PB:32,MB:64,QB:128,NB:256,kv:512,OB:992,gB:1023};olympe.dm.User=class extends olympe.dc.CloudObject{Tx(){return this.jn()}la(){return this.jn()}jn(){return this.wb(olympe.dm.User.loginProp)}xu(){return this.wb(olympe.dm.User.D)}wu(){return olympe.C.Sa.EMPTY}qy(){return this.wb(olympe.dm.User.saltProp)}Ay(){return this.wb(olympe.dm.User.verifierProp)}oy(){return this.ab(olympe.dm.User.F,olympe.dm.Qd)}};olympe.dm.User.O=olympe.dc.na.j('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.O.ka('ff023000000000000001');
1020
1020
  B('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');B('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.O.ka('ff023000000000000005');B('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.N=olympe.dm.User.O.ka('ff023000000000000020');
1021
- olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.ka('ff023000000000000036');B('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.F=R(olympe.dm.User.O,olympe.dm.Pd.j);olympe.dm.User.Y=olympe.dm.User.O.sa('ff022000000000000002');olympe.dm.User.j=Jf('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.J=Jf('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.Jx.K=olympe.C.H.D;m.la.K=olympe.C.H.D;m.cn.K=olympe.C.H.D;m.ou.K=olympe.C.H.D;m.nu.K=olympe.C.H.D;m.gy.K=olympe.C.H.D;
1022
- m.py.K=olympe.C.H.D;m.by.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Xf=class extends olympe.dc.CloudObject{Y(){return this.$m()}Ga(){return this.wb(olympe.dm.Xf.ua)}};olympe.dm.Xf.O=olympe.dc.na.j('01621fb84e3300000000',olympe.dm.Xf);olympe.dm.Xf.ua=olympe.dm.Xf.O.ka('01609de3f292e3c2c6ff');olympe.dm.Xf.prototype.Y.K=new olympe.C.H(()=>olympe.C.qd,[]);olympe.dm.Xf.prototype.Ga.K=olympe.C.H.D;olympe.dm.BrickMetadata=class extends olympe.dm.Xf{qy(){return this.wb(olympe.dm.BrickMetadata.$b)}Hc(){return this.wb(olympe.dm.BrickMetadata.ba)}getType(){return this.wb(olympe.dm.BrickMetadata.Eb)}Cy(){return this.Zg(olympe.dm.BrickMetadata.Bb)}oe(){return null}tx(){return this.bb(olympe.sc.ui.Ow.Comment.ZD.ac(),olympe.sc.ui.Ow.Comment)}Lk(){return this.ig(olympe.dm.BrickMetadata.Ga).Fc().Lk()}};olympe.dm.BrickMetadata.O=Of(olympe.dc.na.j('01621fb84e3500000000',olympe.dm.BrickMetadata));
1023
- olympe.dm.BrickMetadata.$b=olympe.dm.BrickMetadata.O.ka('01621fb84e320000f001');olympe.dm.BrickMetadata.ba=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Eb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.Bb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.Ga=olympe.dm.BrickMetadata.O.sa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.$c={PB:'private',RB:'public'};
1024
- olympe.dm.BrickMetadata.Tb={qA:'experimental',gC:'stable',dA:'deprecated'};olympe.dm.BrickMetadata.Kc={Rz:'business',CC:'technical'};m=olympe.dm.BrickMetadata.prototype;m.qy.K=olympe.C.H.D;m.Hc.K=olympe.C.H.D;m.getType.K=olympe.C.H.D;m.Cy.K=olympe.C.H.N;m.oe.K=new olympe.C.H(()=>String,[]);m.tx.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Lk.K=olympe.C.H.R;function aj(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.vh.hv}${b}`)}
1025
- function sj(a,b){const c=a.query().gb(olympe.dm.wd.j.ac()).gb(olympe.dm.wd.D);a=a.query().gb(olympe.dm.jb.D.ac()).hg(olympe.dm.jb.F,!0).gb(olympe.sc.yc.j.ac());const d=e=>e.he().hg(olympe.dc.CloudObject.extendRel,!0).gb(olympe.dc.CloudObject.rj,!0).gb(olympe.dm.Relation.destinationModelRel).back(2).gb(olympe.dc.CloudObject.propertyRel,!0).gb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
1026
- function Rj(a,b){return a.observe(b,olympe.dm.DataSource.Mr).pipe(rxjs.operators.map(()=>a.If(olympe.dc.sources.U.Ne)),rxjs.operators.distinctUntilChanged())}
1027
- olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Wb=c;this.Pr=new Map([[olympe.dc.sources.U.jm,olympe.dm.DataSource.hz],[olympe.dc.sources.U.Ne,olympe.dm.DataSource.Mr],[olympe.dc.sources.U.sm,olympe.dm.DataSource.lz]])}T(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ka.SERVER:this.tag}If(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,
1028
- '_')}.${b}`))?d:aj(this.X(),a))?e:this.Pr.has(c)?this.get(this.Pr.get(c)):null}Hc(){const a=this;return w(function*(){const b=olympe.dm.DataSource.pc.wt,c=olympe.dm.DataSource.pc.zb,d=new olympe.dc.Request(olympe.dc.Request.j.pc,a.T());return a.Wb.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.ja.ab('dc').warn(`Source ${a.name()} (${a.T()}) has encountered issues: ${e}`);return g}).catch(e=>{const f=olympe.L.errors.bq;return e instanceof olympe.L.errors.wk||
1029
- e instanceof f?b:c})})}init(){const a=this;return w(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return w(function*(){})}healthCheck(){return w(function*(){})}executeQuery(a){return w(function*(){return olympe.dc.query.zd.gj(a)})}applyTransaction(){return w(function*(){})}uploadFileContent(){return w(function*(){throw Error('Should not try to upload files with SELF source');})}downloadFileContent(){return w(function*(){throw Error('Should not try to download files with SELF source');
1021
+ olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.ka('ff023000000000000036');B('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.F=R(olympe.dm.User.O,olympe.dm.Qd.j);olympe.dm.User.Y=olympe.dm.User.O.sa('ff022000000000000002');olympe.dm.User.j=Jf('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.H=Jf('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.Tx.K=olympe.C.J.D;m.la.K=olympe.C.J.D;m.jn.K=olympe.C.J.D;m.xu.K=olympe.C.J.D;m.wu.K=olympe.C.J.D;m.qy.K=olympe.C.J.D;
1022
+ m.Ay.K=olympe.C.J.D;m.oy.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.ag=class extends olympe.dc.CloudObject{Y(){return this.en()}Ha(){return this.wb(olympe.dm.ag.wa)}};olympe.dm.ag.O=olympe.dc.na.j('01621fb84e3300000000',olympe.dm.ag);olympe.dm.ag.wa=olympe.dm.ag.O.ka('01609de3f292e3c2c6ff');olympe.dm.ag.prototype.Y.K=new olympe.C.J(()=>olympe.C.qd,[]);olympe.dm.ag.prototype.Ha.K=olympe.C.J.D;olympe.dm.BrickMetadata=class extends olympe.dm.ag{By(){return this.wb(olympe.dm.BrickMetadata.zc)}Hc(){return this.wb(olympe.dm.BrickMetadata.da)}getType(){return this.wb(olympe.dm.BrickMetadata.Mb)}My(){return this.dh(olympe.dm.BrickMetadata.zb)}qe(){return null}Dx(){return this.ab(olympe.sc.ui.Yw.Comment.gE.$b(),olympe.sc.ui.Yw.Comment)}Sk(){return this.ng(olympe.dm.BrickMetadata.Ha).Fc().Sk()}};olympe.dm.BrickMetadata.O=Of(olympe.dc.na.j('01621fb84e3500000000',olympe.dm.BrickMetadata));
1023
+ olympe.dm.BrickMetadata.zc=olympe.dm.BrickMetadata.O.ka('01621fb84e320000f001');olympe.dm.BrickMetadata.da=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Mb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.zb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.Ha=olympe.dm.BrickMetadata.O.sa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.Rd={YB:'private',$B:'public'};
1024
+ olympe.dm.BrickMetadata.Vb={AA:'experimental',oC:'stable',nA:'deprecated'};olympe.dm.BrickMetadata.Id={aA:'business',KC:'technical'};m=olympe.dm.BrickMetadata.prototype;m.By.K=olympe.C.J.D;m.Hc.K=olympe.C.J.D;m.getType.K=olympe.C.J.D;m.My.K=olympe.C.J.N;m.qe.K=new olympe.C.J(()=>String,[]);m.Dx.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Sk.K=olympe.C.J.R;function Zi(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.zh.rv}${b}`)}
1025
+ function qj(a,b){const c=a.query().fb(olympe.dm.wd.j.$b()).fb(olympe.dm.wd.D);a=a.query().fb(olympe.dm.ib.D.$b()).mg(olympe.dm.ib.F,!0).fb(olympe.sc.yc.j.$b());const d=e=>e.ie().mg(olympe.dc.CloudObject.extendRel,!0).fb(olympe.dc.CloudObject.yj,!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)))}
1026
+ function Pj(a,b){return a.observe(b,olympe.dm.DataSource.Ur).pipe(rxjs.operators.map(()=>a.Lf(olympe.dc.sources.U.Qe)),rxjs.operators.distinctUntilChanged())}
1027
+ olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Tb=c;this.Wr=new Map([[olympe.dc.sources.U.qm,olympe.dm.DataSource.rz],[olympe.dc.sources.U.Qe,olympe.dm.DataSource.Ur],[olympe.dc.sources.U.xm,olympe.dm.DataSource.wz]])}T(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ja.SERVER:this.tag}Lf(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,
1028
+ '_')}.${b}`))?d:Zi(this.X(),a))?e:this.Wr.has(c)?this.get(this.Wr.get(c)):null}Hc(){const a=this;return w(function*(){const b=olympe.dm.DataSource.oc.Ft,c=olympe.dm.DataSource.oc.Ab,d=new olympe.dc.Request(olympe.dc.Request.j.oc,a.T());return a.Tb.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.ja.$a('dc').warn(`Source ${a.name()} (${a.T()}) has encountered issues: ${e}`);return g}).catch(e=>{const f=olympe.L.errors.jq;return e instanceof olympe.L.errors.Dk||
1029
+ e instanceof f?b:c})})}init(){const a=this;return w(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return w(function*(){})}healthCheck(){return w(function*(){})}executeQuery(a){return w(function*(){return olympe.dc.query.zd.nj(a)})}applyTransaction(){return w(function*(){})}uploadFileContent(){return w(function*(){throw Error('Should not try to upload files with SELF source');})}downloadFileContent(){return w(function*(){throw Error('Should not try to download files with SELF source');
1030
1030
  })}deleteFileContent(){return w(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;
1031
- 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.If;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.Jg);
1032
- olympe.dm.DataSource.Rh=olympe.dm.DataSource.O.ka('ff023000000000000060');B('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.Rh);olympe.dm.DataSource.bE=olympe.dm.DataSource.O.ka('ff023000000000000061');olympe.dm.DataSource.hz=olympe.dm.DataSource.O.ka('ff023000000000000062');olympe.dm.DataSource.Mr=olympe.dm.DataSource.O.ka('ff023000000000000063');olympe.dm.DataSource.Tr=olympe.dm.DataSource.O.ka('ff023000000000000064');olympe.dm.DataSource.lz=olympe.dm.DataSource.O.ka('ff023000000000000065');
1033
- olympe.dm.DataSource.sj=olympe.dm.DataSource.O.sa('ff022000000000000060');olympe.dm.DataSource.SERVER=Jf('00000000000000000060','Server source');olympe.dm.DataSource.Ne={aB:'hybrid',Un:'bus',mp:'http'};olympe.dm.DataSource.pc={Fh:'ready',zb:'error',wt:'down',ye:'offline'};olympe.dm.wd=class extends olympe.dc.CloudObject{};olympe.dm.wd.O=olympe.dc.na.j('ff021000000000000070',olympe.dm.wd);olympe.dm.wd.j=olympe.dm.wd.O.sa('ff023000000000000071');olympe.dm.wd.D=olympe.dm.wd.O.sa('ff023000000000000072');olympe.dm.wd.F=olympe.dm.wd.O.sa('ff023000000000000073');olympe.dm.Kb=class extends olympe.dm.BrickMetadata{J(){return new olympe.dc.za(this.X(),[new olympe.dc.da.De(olympe.dm.Kb.j.X(),olympe.dc.va.DESTINATION,olympe.dc.da.Oq.St,olympe.dc.da.Oq.Tt),olympe.dm.Kb.J])}oe(){return olympe.sc.qe.Ge.Ft}j(){return this.bb(olympe.dm.Kb.j,olympe.dm.Kb)}N(){return this.bb(olympe.dm.Kb.J)}};olympe.dm.Kb.O=olympe.dc.na.j('01612df1db9749227626',olympe.dm.Kb);olympe.dm.Kb.j=olympe.dm.Kb.O.sa('016a697ef00ce7554691');olympe.dm.Kb.fa=R(olympe.dm.Kb.O,olympe.dm.Kb.j);
1034
- olympe.dm.Kb.J=olympe.dm.Kb.O.sa('016a697ef00ce7554692');R(olympe.dc.CloudObject.O,olympe.dm.Kb.J);olympe.dm.Kb.prototype.J.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.j.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.N.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Nc=class extends olympe.dm.Kb{j(){return this.X()===olympe.dm.Nc.$?this.bb(olympe.dm.Nc.N,olympe.dm.Kb):this.bb(olympe.dm.Nc.R,olympe.dm.Kb)}};olympe.dm.Nc.O=olympe.dc.na.j('ff021000000000000020',olympe.dm.Nc);olympe.dm.Nc.R=olympe.dm.Nc.O.sa('017e9c34cf48bd6965c1');olympe.dm.Nc.N=olympe.dm.Nc.O.sa('017e9c2e013e06bfffd9');olympe.dm.Nc.Yh=olympe.dm.Nc.O.sa('01811f12ad77673770d4');olympe.dm.Nc.$=Jf('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Nc.rc=Jf('10000000000000000001','OLYMPE_FOLDER');
1035
- olympe.dm.Nc.Ub=Jf('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Nc.prototype.j.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Ix(){return this.wb(olympe.dm.Module.N)}Tx(){return this.sd(olympe.dm.Module.R)}pu(){return this.wb(olympe.dm.Module.D)}Xx(){return this.wb(olympe.dm.Module.Y)}ux(){return this.wb(olympe.dm.Module.F)}Ux(){return this.bb(olympe.dm.Module.J,olympe.dm.Module)}hy(){return this.bb(olympe.dm.Module.j,olympe.dm.Kd)}};olympe.dm.Module.O=olympe.dc.na.j('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.N=olympe.dm.Module.O.ka('ff023000000000000042');
1036
- 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.J=olympe.dm.Module.O.sa('ff022000000000000014');
1037
- olympe.dm.Module.$=Jf('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.Ix.K=olympe.C.H.D;m.Tx.K=olympe.C.H.F;m.pu.K=olympe.C.H.D;m.Xx.K=olympe.C.H.D;m.ux.K=olympe.C.H.D;m.Ux.K=new olympe.C.H(()=>olympe.dc.za,[]);m.hy.K=new olympe.C.H(()=>olympe.dc.za,[]);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.$d().fromModel(a);a=b.create(a,f).gi(g);b=olympe.C.eb.now();Y(Y(Y(Y(Y(Y(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,
1038
- b);this.j=c;this.F=d;this.D=e}hs(){return this.wb(olympe.dm.File.mimeTypeProp)}Hk(a,b){void 0===a&&void 0===b||olympe.ja.ab('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Xa().F(a),d=b&&olympe.C.Xa().F(e=>null==b?void 0:b(`${e}`));return this.j.J(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;})}Zm(a,b){void 0===a&&
1039
- void 0===b||olympe.ja.ab('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Xa().F(a),d=b&&olympe.C.Xa().F(e=>null==b?void 0:b(`${e}`));return this.Hk().then(e=>{e=cb(e);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}Ik(a,b){void 0===a&&void 0===b||olympe.ja.ab('File.getContentUrl').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Xa().F(a),
1040
- d=b&&olympe.C.Xa().F(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.J(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()}`;null==d||
1041
- d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.C.Xa().F(b);olympe.C.zs([a],d=>{const e=new olympe.dc.Wa;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.nb(f=>{c&&c(f)})})}Ds(a){this.get(olympe.dm.File.urlProp).startsWith('stream:')?this.j.Y(this.tag).then(()=>this.Ds(a)).catch(b=>this.G.error(`Error while getting the content of a streamed file: ${b}`)):this.F.J(this.get(olympe.dm.File.mimeTypeProp))}Fp(){return this.wb(olympe.dm.File.urlProp)}Ep(){return this.wb(olympe.dm.File.fileNameProp)}yx(){return this.lj(olympe.dm.File.creationDateProp)}Sx(){return this.lj(olympe.dm.File.modificationDateProp)}By(){return this.Zg(olympe.dm.File.j)}};
1042
- olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.Ds;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Ik;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Zm;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Hk;olympe.dm.File.O=olympe.dc.na.j('ff021000000000000030',olympe.dm.File,olympe.dc.P.Oj,olympe.net.P.Da,olympe.V.P.qg);olympe.dm.File.nameProp=olympe.dm.File.O.ka('ff023000000000000050');B('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
1031
+ 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.Lf;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.Ng);
1032
+ olympe.dm.DataSource.Vh=olympe.dm.DataSource.O.ka('ff023000000000000060');B('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.Vh);olympe.dm.DataSource.jE=olympe.dm.DataSource.O.ka('ff023000000000000061');olympe.dm.DataSource.rz=olympe.dm.DataSource.O.ka('ff023000000000000062');olympe.dm.DataSource.Ur=olympe.dm.DataSource.O.ka('ff023000000000000063');olympe.dm.DataSource.$r=olympe.dm.DataSource.O.ka('ff023000000000000064');olympe.dm.DataSource.wz=olympe.dm.DataSource.O.ka('ff023000000000000065');
1033
+ olympe.dm.DataSource.zj=olympe.dm.DataSource.O.sa('ff022000000000000060');olympe.dm.DataSource.SERVER=Jf('00000000000000000060','Server source');olympe.dm.DataSource.Qe={kB:'hybrid',$n:'bus',sp:'http'};olympe.dm.DataSource.oc={Jh:'ready',Ab:'error',Ft:'down',Ae:'offline'};olympe.dm.wd=class extends olympe.dc.CloudObject{};olympe.dm.wd.O=olympe.dc.na.j('ff021000000000000070',olympe.dm.wd);olympe.dm.wd.j=olympe.dm.wd.O.sa('ff023000000000000071');olympe.dm.wd.D=olympe.dm.wd.O.sa('ff023000000000000072');olympe.dm.wd.F=olympe.dm.wd.O.sa('ff023000000000000073');olympe.dm.Kb=class extends olympe.dm.BrickMetadata{H(){return new olympe.dc.za(this.X(),[new olympe.dc.ba.Fe(olympe.dm.Kb.j.X(),olympe.dc.ua.DESTINATION,olympe.dc.ba.Vq.au,olympe.dc.ba.Vq.bu),olympe.dm.Kb.H])}qe(){return olympe.sc.se.Ie.Ot}j(){return this.ab(olympe.dm.Kb.j,olympe.dm.Kb)}N(){return this.ab(olympe.dm.Kb.H)}};olympe.dm.Kb.O=olympe.dc.na.j('01612df1db9749227626',olympe.dm.Kb);olympe.dm.Kb.j=olympe.dm.Kb.O.sa('016a697ef00ce7554691');olympe.dm.Kb.ha=R(olympe.dm.Kb.O,olympe.dm.Kb.j);
1034
+ olympe.dm.Kb.H=olympe.dm.Kb.O.sa('016a697ef00ce7554692');R(olympe.dc.CloudObject.O,olympe.dm.Kb.H);olympe.dm.Kb.prototype.H.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.N.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Mc=class extends olympe.dm.Kb{j(){return this.X()===olympe.dm.Mc.$?this.ab(olympe.dm.Mc.N,olympe.dm.Kb):this.ab(olympe.dm.Mc.R,olympe.dm.Kb)}};olympe.dm.Mc.O=olympe.dc.na.j('ff021000000000000020',olympe.dm.Mc);olympe.dm.Mc.R=olympe.dm.Mc.O.sa('017e9c34cf48bd6965c1');olympe.dm.Mc.N=olympe.dm.Mc.O.sa('017e9c2e013e06bfffd9');olympe.dm.Mc.ci=olympe.dm.Mc.O.sa('01811f12ad77673770d4');olympe.dm.Mc.$=Jf('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Mc.$c=Jf('10000000000000000001','OLYMPE_FOLDER');
1035
+ olympe.dm.Mc.vc=Jf('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Mc.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Sx(){return this.wb(olympe.dm.Module.N)}ey(){return this.sd(olympe.dm.Module.R)}yu(){return this.wb(olympe.dm.Module.D)}jy(){return this.wb(olympe.dm.Module.Y)}Ex(){return this.wb(olympe.dm.Module.F)}gy(){return this.ab(olympe.dm.Module.H,olympe.dm.Module)}sy(){return this.ab(olympe.dm.Module.j,olympe.dm.Ld)}};olympe.dm.Module.O=olympe.dc.na.j('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.N=olympe.dm.Module.O.ka('ff023000000000000042');
1036
+ 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');
1037
+ olympe.dm.Module.$=Jf('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.Sx.K=olympe.C.J.D;m.ey.K=olympe.C.J.F;m.yu.K=olympe.C.J.D;m.jy.K=olympe.C.J.D;m.Ex.K=olympe.C.J.D;m.gy.K=new olympe.C.J(()=>olympe.dc.za,[]);m.sy.K=new olympe.C.J(()=>olympe.dc.za,[]);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.ae().fromModel(a);a=b.create(a,f).li(g);b=olympe.C.eb.now();Y(Y(Y(Y(Y(Y(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,
1038
+ b);this.j=c;this.F=d;this.D=e}qs(){return this.wb(olympe.dm.File.mimeTypeProp)}Ok(a,b){void 0===a&&void 0===b||olympe.ja.$a('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Xa().rc(a),d=b&&olympe.C.Xa().rc(e=>null==b?void 0:b(`${e}`));return this.j.H(this).then(e=>{e=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}dn(a,b){void 0===a&&
1039
+ void 0===b||olympe.ja.$a('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Xa().rc(a),d=b&&olympe.C.Xa().rc(e=>null==b?void 0:b(`${e}`));return this.Ok().then(e=>{e=cb(e);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}Pk(a,b){void 0===a&&void 0===b||olympe.ja.$a('File.getContentUrl').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&
1040
+ olympe.C.Xa().rc(a),d=b&&olympe.C.Xa().rc(g=>null==b?void 0:b(`${g}`));a=this.get(olympe.dm.File.j);const e=this.get(olympe.dm.File.urlProp),f=this.get(olympe.dm.File.mimeTypeProp);if(a||(null==e?0:e.startsWith('blob:'))||(null==e?0:e.startsWith('stream:')))return this.j.H(this).then(g=>{g=`data:${f};base64,${this.D.j(g)}`;null==c||c(g);return g}).catch(g=>{null==d||d(g.message);throw g;});if('string'===typeof e)return null==c||c(e),Promise.resolve(e);a=`No content nor URL associated to the file ${this.X()}`;
1041
+ null==d||d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.C.Xa().rc(b);olympe.C.Hs([a],d=>{const e=new olympe.dc.Wa;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.nb(f=>{c&&c(f)})})}Ls(a){this.get(olympe.dm.File.urlProp).startsWith('stream:')?this.j.Y(this.tag).then(()=>this.Ls(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))}Mp(){return this.wb(olympe.dm.File.urlProp)}Lp(){return this.wb(olympe.dm.File.fileNameProp)}Ix(){return this.sj(olympe.dm.File.creationDateProp)}by(){return this.sj(olympe.dm.File.modificationDateProp)}Ly(){return this.dh(olympe.dm.File.j)}};
1042
+ olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.Ls;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Pk;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.dn;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Ok;olympe.dm.File.O=olympe.dc.na.j('ff021000000000000030',olympe.dm.File,olympe.dc.P.Vj,olympe.net.P.Da,olympe.V.P.vg);olympe.dm.File.nameProp=olympe.dm.File.O.ka('ff023000000000000050');B('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
1043
1043
  olympe.dm.File.fileNameProp=olympe.dm.File.O.ka('ff023000000000000050');B('olympe.dm.File.fileNameProp',olympe.dm.File.fileNameProp);olympe.dm.File.creationDateProp=olympe.dm.File.O.ka('ff023000000000000051');B('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.O.ka('ff023000000000000055');B('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.O.ka('ff023000000000000052');
1044
- B('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.O.ka('ff023000000000000053');B('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.xa=[olympe.C.File];m=olympe.dm.File.prototype;m.hs.K=olympe.C.H.D;m.Hk.K=olympe.C.H.j;m.Zm.K=olympe.C.H.j;m.Ik.K=olympe.C.H.j;m.rename.K=olympe.C.H.j;
1045
- m.Fp.K=olympe.C.H.D;m.Ep.K=olympe.C.H.D;m.yx.K=new olympe.C.H(()=>olympe.C.eb,[]);m.Sx.K=new olympe.C.H(()=>olympe.C.eb,[]);m.By.K=olympe.C.H.N;olympe.dm.Kd=class extends olympe.dc.CloudObject{j(){return this.wb(olympe.dm.Kd.D)}F(){return this.sd(olympe.dm.Kd.F)}D(){return this.bb(olympe.dm.Kd.j,olympe.dm.Module)}};olympe.dm.Kd.O=olympe.dc.na.j('ff021000000000000041',olympe.dm.Kd);olympe.dm.Kd.D=olympe.dm.Kd.O.ka('ff023000000000000047');olympe.dm.Kd.F=olympe.dm.Kd.O.ka('ff023000000000000048');olympe.dm.Kd.j=olympe.dm.Module.j.ac();olympe.dm.Kd.prototype.j.K=olympe.C.H.D;olympe.dm.Kd.prototype.F.K=olympe.C.H.F;
1046
- olympe.dm.Kd.prototype.D.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.jb=class extends olympe.dm.Nc{j(){return this.bb(olympe.dm.Kb.j,olympe.dm.Kb)}F(){return this.wb(olympe.dm.jb.Y)}R(){return this.wb(olympe.dm.jb.fb)}D(){return this.bb(olympe.dm.jb.F,olympe.dm.jb)}};olympe.dm.jb.O=olympe.dc.na.j('0163d9594700fcf61e54',olympe.dm.jb);olympe.dm.jb.Y=olympe.dm.jb.O.ka('017869c7d2833c9492c1');olympe.dm.jb.us=olympe.dm.jb.O.ka('017869c7d2833c9492c2');olympe.dm.jb.Vd=olympe.dm.jb.O.ka('017869c7d2833c9492c3');olympe.dm.jb.fb=olympe.dm.jb.O.ka('017869c80bb9929c76d0');
1047
- olympe.dm.jb.$a=olympe.dm.jb.O.sa('ff02200000000000002a');olympe.dm.jb.F=olympe.dm.jb.O.sa('ff02200000000000002b');olympe.dm.jb.Gf=R(olympe.dm.jb.O,olympe.dm.jb.F);olympe.dm.jb.D=olympe.dm.jb.O.sa('ff02200000000000002c');olympe.dm.jb.Wh=olympe.dm.jb.O.sa('017e9c412e2b944bc48f');olympe.dm.jb.Wd=olympe.dm.jb.O.sa('017e9c412e2b944bd590');olympe.dm.jb.ps=olympe.dm.jb.O.sa('017e9c416872a89d3415');olympe.dm.jb.Pk=olympe.dm.jb.O.sa('017ebf8fe5c506662098');R(olympe.dc.CloudObject.O,olympe.dm.jb.$a);
1048
- olympe.dm.jb.Ec=Jf('100000000000000000dd','PRIMORDIAL');olympe.dm.jb.prototype.j.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.jb.prototype.F.K=olympe.C.H.D;olympe.dm.jb.prototype.R.K=olympe.C.H.D;olympe.dm.jb.prototype.D.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{j(){return this.Qc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Qc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}D(){return this.ig(olympe.dm.Property.typeRel).Fc()}Uc(){return this.j().la().Nr(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);
1049
- B('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);B('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.j.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.D.K=olympe.C.H.j;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Ox(){return olympe.C.Sa.EMPTY}px(){return this.sd(olympe.dm.Relation.D)}Yx(){return this.sd(olympe.dm.Relation.F)}Zr(){return this.bb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Gc()}ks(){return this.bb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Gc()}Uc(){return this.ks().la().concat(['-',this.la(),'->',this.Zr().la()])}};olympe.dm.Relation.O=olympe.dc.na.j('ff021000000000000006',olympe.dm.Relation);
1050
- olympe.dm.Relation.F=olympe.dm.Relation.O.ka('ff023000000000000030');olympe.dm.Relation.D=olympe.dm.Relation.O.ka('ff023000000000000034');olympe.dm.Relation.ba=olympe.dm.Relation.O.ka(olympe.dc.Lb.Bo);olympe.dm.Relation.Y=olympe.dm.Relation.O.ka(olympe.dc.Lb.Cc);olympe.dm.Relation.fa=olympe.dm.Relation.O.ka(olympe.dc.Lb.bg);olympe.dm.Relation.ua=olympe.dm.Relation.O.ka(olympe.dc.Lb.Mv);olympe.dm.Relation.$=olympe.dm.Relation.O.ka(olympe.dc.Lb.xt);olympe.dm.Relation.Ga=olympe.dm.Relation.O.ka(olympe.dc.Lb.hw);
1051
- olympe.dm.Relation.R=olympe.dm.Relation.O.ka('ff023000000000000031');olympe.dm.Relation.originModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.rj);B('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Sr);B('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.j={sp:0,Ws:5,wv:1,aC:4,rr:2,Jq:8,pA:10,XB:6,YB:9,Pe:6,$B:9};
1052
- olympe.dm.Relation.J={CB:3,Yu:4,oB:5,nB:6};olympe.dm.Relation.N=olympe.dm.el.$u+olympe.dm.el.tt;m=olympe.dm.Relation.prototype;m.Ox.K=olympe.C.H.D;m.px.K=olympe.C.H.F;m.Yx.K=olympe.C.H.F;m.Zr.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.ks.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);function Lm(a){a=olympe.dc.ha(a);if(olympe.dc.ia().Nf(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.Be=class extends olympe.dc.CloudObject{getValue(){}};
1053
- olympe.dm.Be.O=olympe.dc.na.j('ff021000000000000019',olympe.dm.Be);olympe.dm.String=class extends olympe.dm.Be{getValue(){return this.wb(olympe.dm.String.valueProp)}Ac(){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');B('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.C.H.D;
1054
- olympe.dm.String.prototype.toString.K=olympe.C.H.j;olympe.dm.Boolean=class extends olympe.dm.Be{getValue(){return this.Zg(olympe.dm.Boolean.valueProp)}Ac(){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');B('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.C.H.N;olympe.dm.Color=class extends olympe.dm.Be{getValue(){return this.ls()}Ac(){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');B('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.C.H(()=>olympe.C.Color,[]);olympe.dm.DateTime=class extends olympe.dm.Be{getValue(){return this.lj(olympe.dm.DateTime.valueProp)}Ac(){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');B('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.C.H(()=>olympe.C.eb,[]);olympe.dm.Enum=class extends olympe.dm.String{la(){return olympe.C.ta([super.la(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Sa)}Cd(){return this.sd(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.Cd.K=olympe.C.H.F;olympe.dm.Zf=class extends olympe.dm.BrickMetadata{oy(){return this.gb(olympe.dc.CloudObject.instancesRel).Zk(olympe.dm.Enum.rankProp,olympe.dc.query.dk.ASC).Fc()}static create(a,b){b=a.create(olympe.dm.Zf,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.Zf.create=olympe.dm.Zf.create;olympe.dm.Zf.prototype.getValues=olympe.dm.Zf.prototype.oy;olympe.dm.Zf.O=olympe.dc.na.j('017a768f966fc08ebb98',olympe.dm.Zf);olympe.dm.Number=class extends olympe.dm.Be{getValue(){return this.sd(olympe.dm.Number.valueProp)}Ac(){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');B('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.C.H.F;olympe.sc={};olympe.sc.P={Ca:'sc.Logger',lk:'sc.RootContext',Ee:'sc.Serializer'};olympe.sc.U={Me:'sc.app',Uf:'sc.debug',Gn:'sc.autostartProfiler',yo:'sc.debugger',ut:'sc.disableTheme',PRODUCTION:'sc.production',Zu:'sc.onstartTimeout',Eq:'sc.remoteActionTimeout'};
1055
- olympe.W.config(a=>{F(a,olympe.sc.U.Me,'');F(a,olympe.sc.U.Uf,!1);F(a,olympe.sc.U.ut,!0);F(a,olympe.sc.U.PRODUCTION,!1);F(a,olympe.sc.U.Zu,2E4);F(a,olympe.sc.U.Eq,3E4);F(a,olympe.sc.U.Gn,!1);E(a,olympe.sc.P.Ca,[olympe.ja.P.Da],b=>b.cd('sc'));D(a,olympe.sc.P.Ee,olympe.sc.ec,olympe.dc.db.P.Da);Wa(a,olympe.dc.sources.P.Ee,olympe.sc.P.Ee);E(a,olympe.sc.P.lk,[new olympe.W.pa(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.tg('root','root',null);olympe.sc.qn=c;c.set(olympe.sc.ya.j.PRODUCTION,b);return new olympe.sc.ya(c)})},
1056
- 'olympe.sc');olympe.W.run([olympe.sc.P.lk,new olympe.W.pa(olympe.L.U.ql)],(a,b)=>{olympe.Zd().ctx=a;olympe.Zd().oVersion=()=>b});olympe.sc.jn=()=>null!==olympe.dc.ia().Jb(void 0,olympe.sc.Runnable.j.ac());olympe.sc.$D=(a,b,c,d)=>{c=Y(Y(a.create(olympe.sc.gd),olympe.sc.gd.j,c||null),olympe.sc.gd.F,d||null);a.Oa(olympe.sc.gd.D,c,b);a.Oa(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.cj=(a,b)=>{a=olympe.dc.mb.qx(b)(a);return a instanceof olympe.sc.Od?a.j():a};
1057
- olympe.sc.rE=function(a){const b=olympe.dc.CloudObject.containsRel.ac();var c=olympe.dc.ha(a);if(void 0===c)return[];a=olympe.dc.ia();const d=[];let e=[];const f=new Set;for(;!a.Qb(c,olympe.dm.Kb);){f.add(c);const g=a.Jb(c,b);if(null===g)return olympe.ja.ab('sc').warn(`Object ${c} has no container`),[];a.Qb(c,olympe.sc.logic.pb)||g===a.Jb(c,olympe.sc.Runnable.j.ac())||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.$g(e[0],
1058
- olympe.dm.Kb.fa));e=e.concat(a.$g(e[e.length-1],olympe.dm.Nc.R.ac()));e=e.concat(a.$g(e[e.length-1],olympe.dm.Nc.N.ac()));return[...d,...e].reverse()};olympe.sc.sE=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.zg:a.startsWith('video/')?olympe.sc.Mh:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Lc:olympe.dm.File};
1059
- olympe.sc.qE=a=>a instanceof olympe.sc.zg?'image/*':a instanceof olympe.sc.Mh?'video/*':a instanceof olympe.sc.Lc?'font/*,application/font-woff':null;olympe.sc.Ya={};function Mm(a,b){var c=olympe.sc.ya,d=a.j;a=a.D();b=olympe.dc.ha(b);let e,f=null==(e=d.D)?void 0:e.get(b);if(!f){f=d.Uh(a,void 0,b);for(d=f.getParent();d&&d.fa&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||Nm(g,b,f)}return new c(f)}function Om(a){let b;return null!=(b=a.Pa(olympe.sc.ya.j.PRODUCTION))?b:!1}
1060
- olympe.sc.ya=class{constructor(a=olympe.sc.qn){this.j=a;this.G=olympe.ja.ab('sc');this.F=null}T(){return this.j.T()}getParent(){if(null===this.F){const a=this.j.getParent();this.F=null===a?null:new olympe.sc.ya(a)}return this.F}sx(a){const b=olympe.dc.ia();let c=this.getParent();if(!c)return this;const d=e=>{e=e.$e();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Qa(f,olympe.sc.Ua.$)||a.modelTag&&!b.Qb(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;c=e}return c}$e(){return this.j.$e()}D(){return this.j.j}set(a,
1061
- b){this.j.set(a,b);return this}An(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}rb(a,b,c=!1){const d=olympe.dc.ha(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.j.T():void 0));return e.rb()}get(a,b=!1){a=this.Pa(a,b);return void 0!==a?a:null}has(a,b=!1){return this.j.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,
1062
- d.next.bind(d),c?void 0:this.j.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Pm(this.j,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.ih(a.unsubscribe.bind(a));return this}nz(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Uh(`Runner ${a.name()}`);a.run(b);return b}Ls(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.ha(a)})\``+
1063
- `on the context ${this.T()}:\nStack: ${this.le()}\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.ha(a)})\` `+`has never received any value:\nStack: ${this.le()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;const d=(null==(c=a.le)?void 0:c.call(a))||this.le();let e,f;c=null!=(f=null==(e=a.Xr)?void 0:e.call(a))?f:0;b=Qm(b,c,d);b.stack=a.stack}else b=
1064
- Qm(b,0,this.le());Rm(this.j,b);return this}oz(a){this.set(olympe.sc.ya.j.sg,a);return this}Pa(a,b=!0){return this.j.Pa(a,b)}on(a,b,c,d=!0){return this.j.on(a,b,c,d)}Uh(a){return new olympe.sc.ya(this.j.Uh(this.D(),a))}Wk(a,b){return this.j.Wk(a,c=>{b(new olympe.sc.ya(c))})}Wx(a){a=Sm(this.j,a);return a===this.j?this:a&&new olympe.sc.ya(a)}destroy(){this.j.destroy()}ih(a,b){return this.j.ih(a,b)}Uk(a){this.j.Uk(a)}onDestroy(a){return this.hb()?(a(),'noId'):this.D().onDestroy(a)}Qf(a){this.hb()||this.D().Qf(a)}clear(){this.j.clear()}hb(){return this.D().hb()}Qa(a){a=
1065
- Tm(this.j,a);return null!==a?new olympe.sc.ui.Xz(a,this):null}Hx(a){a=Tm(this.j,a);return null!==a?new olympe.sc.ui.Wz(a,this):null}Vy(...a){return rxjs.combineLatest(a.map(b=>{b=Tm(this.j,b);return null!==b?this.observe(b):rxjs.of(null)}))}Ea(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.j===a.j}le(){const a=olympe.dc.ia();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.j!==olympe.sc.qn;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.$e();return null!==
1066
- 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.Vy;olympe.sc.ya.prototype.getEvent=olympe.sc.ya.prototype.Hx;olympe.sc.ya.prototype.getProperty=olympe.sc.ya.prototype.Qa;olympe.sc.ya.prototype.isDestroyed=olympe.sc.ya.prototype.hb;olympe.sc.ya.prototype.clear=olympe.sc.ya.prototype.clear;olympe.sc.ya.prototype.offDestroy=olympe.sc.ya.prototype.Qf;
1067
- olympe.sc.ya.prototype.onDestroy=olympe.sc.ya.prototype.onDestroy;olympe.sc.ya.prototype.offClear=olympe.sc.ya.prototype.Uk;olympe.sc.ya.prototype.onClear=olympe.sc.ya.prototype.ih;olympe.sc.ya.prototype.destroy=olympe.sc.ya.prototype.destroy;olympe.sc.ya.prototype.getOtherContext=olympe.sc.ya.prototype.Wx;olympe.sc.ya.prototype.onContext=olympe.sc.ya.prototype.Wk;olympe.sc.ya.prototype.createChild=olympe.sc.ya.prototype.Uh;olympe.sc.ya.prototype.setParentElement=olympe.sc.ya.prototype.oz;
1068
- olympe.sc.ya.prototype['throw']=olympe.sc.ya.prototype.throw;olympe.sc.ya.prototype.waitFor=olympe.sc.ya.prototype.Ls;olympe.sc.ya.prototype.runner=olympe.sc.ya.prototype.nz;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.An;
1069
- olympe.sc.ya.prototype.set=olympe.sc.ya.prototype.set;olympe.sc.ya.prototype.getClosest=olympe.sc.ya.prototype.sx;olympe.sc.ya.prototype.getParent=olympe.sc.ya.prototype.getParent;olympe.sc.ya.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',sg:'__htmlContainer',kA:'__dockableElement',En:'__appHasStarted'};olympe.sc.mw=class extends olympe.sc.ya{constructor(a){super(a);this.J=new olympe.C.Xb('SC Update Context',super.D());const b=a.ih(()=>{b&&a.Uk(b);this.J.destroy()})}D(){return this.J}ih(a,b){return this.D().onDestroy(a,null!=b?b:olympe.V.Ic())}};let Um=0;function Pm(a,b){b=olympe.dc.ha(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 Rm(a,b){if(null===a.J)a.G.error(`An error occurred in a brick: ${b.toString()}`);else if(a.ba){var c=Vm(olympe.dc.CloudObject.get(a.ba));null!==c&&Wm(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):Rm(a.J,b)}else Rm(a.J,b)}
1070
- function Sm(a,b){if(b===a.id||a.R.has(b)||!b)return a;for(a=a.J;a;){if(b===a.T()||a.R.has(b))return a;const c=Xm(a.D,b);if(c)return c;a=a.getParent()}return null}function Ym(a,b,c=0){null===a.Ya&&(a.Ya=new Map);a.Ya.has(b.T())||(a.Ya.set(b.T(),{Xk:b,depth:c}),Zm(a,d=>{(-1===b.F||c<b.F)&&Ym(d,b,c+1)}),a.onDestroy(()=>{$m(a,b.T())}));return b.T()}
1071
- function $m(a,b){if(null===a.Ya||!a.Ya.has(b))return!1;const {Xk:c,depth:d}=a.Ya.get(b);Zm(a,f=>{$m(f,b)});0===d&&c.D();const e=a.Ya.delete(b);0===a.Ya.size&&(a.Ya=null);return e}function Tm(a,b){let c;return(null==(c=a.$)?void 0:c.get('IO#'+b))||null}
1072
- function an(a){a.j.Y(()=>{Zm(a,c=>c.destroy())});a.j.onDestroy(()=>{void 0!==a.Pa(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.J)){let d;null==(d=c.D)||d.delete(a.T());let e;0===(null==(e=c.D)?void 0:e.size)&&(c.D=null)}a.R.clear()});let b;null==(b=a.J)||bn(b,a)}
1073
- function Xm(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.fa&&!c.id.startsWith('_')&&(a=Xm(c.D,b)))return a;return null}function cn(a,b,...c){if(null!==a.Ya)for(const {Xk:d,depth:e}of a.Ya.values())d.process(a,b,e,...c)}function dn(a,b){a.ba=olympe.dc.ha(b);a.fa=b.rd().jn();b.F().forEach(c=>{a.id===c||a.R.has(c)||(a.R.add(c),Nm(a,c,a))});a.$=b.j();cn(a,olympe.sc.Ya.qc.j.INIT)}function en(a){a.ua=!0;let b;null==(b=a.D)||b.forEach(c=>{en(c)})}
1074
- function fn(a){a.ua=!1;let b;null==(b=a.D)||b.forEach(c=>{fn(c)})}function Wm(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.D)||e.forEach(f=>{!f.ua&&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));Um++;const e=Um;d.set(e,c);return()=>{const f=a.F.get(b);f&&(f.delete(e),0===f.size&&a.F.delete(b))}}
1075
- function Nm(a,b,c){a.N.add(b);let d,e;null==(d=a.F)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});Zm(a,f=>{f.N.has(b)||Nm(f,b,c)});a.N.delete(b)}function Zm(a,b){let c;null==(c=a.D)||c.forEach(b)}function jn(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function kn(a){var b=olympe.sc.Ya.qc.D.wf;const c=[];if(null!==a.Ya)for(const {Xk:d}of a.Ya.values())d.getType()===b&&(c.push(d.T()),d.D(),$m(a,d.T()))}function bn(a,b){null===a.D&&(a.D=new Map);a.D.set(b.id,b)}
1076
- olympe.sc.tg=class{constructor(a,b='no name',c=olympe.sc.qn){this.id=a;this.ad=b;this.R=new Set;this.J=c;this.j=new olympe.C.Xb('SC Context');this.data=new Map;this.ba=this.Y=this.D=this.F=null;this.fa=!1;this.N=new Set;this.ua=!1;this.$=null;this.G=olympe.ja.ab('sc');this.Ya=null;an(this)}T(){return this.id}getParent(){return this.J}$e(){return this.ba}set(a,b){if(!this.j.td()&&!this.j.hb()){const g=olympe.dc.ha(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.$)?void 0:c.get('O#'+g))?h:null==
1077
- (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.Ea))try{var f=b.Ea(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.Ya&&0<this.Ya.size&&cn(this,olympe.sc.Ya.qc.j.Ng,a,b),f=Wm(this,a),this.N.add(c),gn(this,c,f,b),this.N.delete(c))}}on(a,b,c,d=!0){if(this.j.hb()||this.j.td())return()=>{};const e=Pm(this,a),f=c?olympe.dc.ha(c):
1078
- '*';a=hn(this,'@'+f+'.'+e,b);c=c?(c=Sm(this,f))?c.Pa(e,!1):void 0:this.Pa(e);void 0!==c&&b(c);if(d)olympe.C.Xa().onDestroy(a);return a}has(a,b=!1){a='$'+Pm(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}Uh(a,b,c){const d=null!=c?c:'_'+olympe.V.Ic();if(a.hb()||a.td())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.tg(d,
1079
- b,this));null!==this.Ya&&0<this.Ya.size&&this.Ya.forEach(({Xk:f,depth:g})=>{(-1===f.F||g<f.F)&&Ym(e,f,g+1)});return e}Wk(a,b){const c=Sm(this,a);if(c)return b(c),()=>{};const d=hn(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Pa(a,b=!0){a='$'+Pm(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.j.td()||this.j.hb()||(cn(this,olympe.sc.Ya.qc.j.Kj),this.j.destroy(),cn(this,olympe.sc.Ya.qc.j.Sd))}ih(a,b){if(this.j.hb())a();
1080
- else return Um++,b=null!=b?b:String(Um),null===this.Y&&(this.Y=new Map),this.Y.set(b,a),b;return b||'noId'}Uk(a){null!==this.Y&&this.Y.delete(a)}onDestroy(a){return this.hb()?(a(),'noId'):this.j.onDestroy(a)}clear(){if(!this.j.hb()){cn(this,olympe.sc.Ya.qc.j.Ej);let a;null==(a=this.Y)||a.forEach(b=>b());cn(this,olympe.sc.Ya.qc.j.Fj)}}hb(){return this.j.hb()}};olympe.sc.tg.prototype.getParent=olympe.sc.tg.prototype.getParent;olympe.sc.tg.j={Ol:'I#',fm:'O#',dB:'IO#'};function ln(a,b,c){return(c=c.$e())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.Ya.qc=class{constructor(a=-1){this.id=olympe.V.Hf();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.Ya.qc.j={INIT:'INIT',Ng:'SET',Ej:'CLEAR',Fj:'CLEARED',Kj:'DESTROY',Sd:'DESTROYED'};olympe.sc.Ya.qc.D={wf:'REMOTE',Eu:'LOCAL',ag:'PROFILER'};olympe.sc.Ud=class a{constructor(){this.D=this.J=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.V.Bm(1E4);gb(this.j,b=>{kn(b)})}$(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.Ud.j.ev:c=this.F.get(e.f);b.vd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.Ud.j.fv:const h=f+c,k=(l,n,p=0)=>{jn(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.F(q):t=q;let u;q=null!=(u=l.$e())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
1081
- t])})};b.mn(h).then(()=>{const l=[];k(g,l,0);Zm(g,p=>{k(p,l,1)});olympe.L.ub.publish(h,{t:olympe.sc.Ud.j.Wt,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.Ya.zv(h);Ym(g,n);this.j.has(g)?fb(this.j,g):this.j.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.Ud.j.gv:void 0!==g&&this.j.has(g)&&fb(this.j,g);break;case olympe.sc.Ud.j.Yf:void 0!==g&&(this.j.delete(g),kn(g))}}ba(b,c,d){this.N=new olympe.L.ub('discovery_debug_id',
1082
- c);this.N.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Ud.j.vt){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.Hf(),f=new olympe.C.Xb(this.D,c.D()),this.J=new olympe.L.ub(this.D,f),this.J.listen().subscribe(g=>{this.$(g,b,d)}));olympe.L.ub.publish(e,{t:olympe.sc.Ud.j.Ms,n:olympe.W.getParameter(olympe.sc.U.yo)||'no name',a:b,s:this.D}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Y(b,c,
1083
- d){const e=[],f=olympe.dc.ia(),g=(h,k)=>{Zm(h,l=>{if(null!==l.$e()){const n=olympe.dc.CloudObject.get(l.$e()).ig(olympe.sc.Runnable.J).Fc();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.j,f.name(d));return e}static D(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.F(d));olympe.L.ub.publish(b,{t:olympe.sc.Ud.j.xk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ja.ab('Debugger').error('Error publishing on service : ',f)})}static F(b){if(null===
1084
- b||void 0===b)return'<null>';const c=olympe.dc.ia();if(b instanceof olympe.dc.CloudObject){var d=b.bc();if(!c.Qb(d,olympe.sc.yc))return b.toString();let f=`${b.Vb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.ma.from(e).hg(olympe.dc.CloudObject.extendRel,!0).he().gb(olympe.dc.CloudObject.propertyRel).he().Fc();e=olympe.dc.ma.from(e).hg(olympe.dc.CloudObject.extendRel,!0).he().gb(olympe.dc.CloudObject.rj).he().Fc();d=d.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=
1085
- '<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Qa(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Ud.J='discovery_debug_id';olympe.sc.Ud.j={vt:0,Ms:1,ev:2,fv:3,Wt:4,xk:5,gv:6,Yf:7};olympe.sc.Ya.mB=class extends olympe.sc.Ya.qc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.Ya.qc.D.Eu}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.qc.j.Ng){a=ln(c,Pm(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 mn(a,b,c,d=new Map){for(var e=[];b;){const n=b.$e();if(!n)break;e.push(n);b=b.getParent()}mb(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.J.has(c)){e=a;f=c;e.ia||(e.ia=olympe.dc.ia());d=e.ia.name(f);e=(f=e.ia.model(f))?e.ia.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.J.set(p,
1044
+ B('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.O.ka('ff023000000000000053');B('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.xa=[olympe.C.File];m=olympe.dm.File.prototype;m.qs.K=olympe.C.J.D;m.Ok.K=olympe.C.J.j;m.dn.K=olympe.C.J.j;m.Pk.K=olympe.C.J.j;m.rename.K=olympe.C.J.j;
1045
+ m.Mp.K=olympe.C.J.D;m.Lp.K=olympe.C.J.D;m.Ix.K=new olympe.C.J(()=>olympe.C.eb,[]);m.by.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Ly.K=olympe.C.J.N;olympe.dm.Ld=class extends olympe.dc.CloudObject{j(){return this.wb(olympe.dm.Ld.D)}F(){return this.sd(olympe.dm.Ld.F)}D(){return this.ab(olympe.dm.Ld.j,olympe.dm.Module)}};olympe.dm.Ld.O=olympe.dc.na.j('ff021000000000000041',olympe.dm.Ld);olympe.dm.Ld.D=olympe.dm.Ld.O.ka('ff023000000000000047');olympe.dm.Ld.F=olympe.dm.Ld.O.ka('ff023000000000000048');olympe.dm.Ld.j=olympe.dm.Module.j.$b();olympe.dm.Ld.prototype.j.K=olympe.C.J.D;olympe.dm.Ld.prototype.F.K=olympe.C.J.F;
1046
+ olympe.dm.Ld.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.ib=class extends olympe.dm.Mc{j(){return this.ab(olympe.dm.Kb.j,olympe.dm.Kb)}F(){return this.wb(olympe.dm.ib.Y)}R(){return this.wb(olympe.dm.ib.jb)}D(){return this.ab(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.Bs=olympe.dm.ib.O.ka('017869c7d2833c9492c2');olympe.dm.ib.$e=olympe.dm.ib.O.ka('017869c7d2833c9492c3');olympe.dm.ib.jb=olympe.dm.ib.O.ka('017869c80bb9929c76d0');
1047
+ olympe.dm.ib.cb=olympe.dm.ib.O.sa('ff02200000000000002a');olympe.dm.ib.F=olympe.dm.ib.O.sa('ff02200000000000002b');olympe.dm.ib.$h=R(olympe.dm.ib.O,olympe.dm.ib.F);olympe.dm.ib.D=olympe.dm.ib.O.sa('ff02200000000000002c');olympe.dm.ib.ai=olympe.dm.ib.O.sa('017e9c412e2b944bc48f');olympe.dm.ib.af=olympe.dm.ib.O.sa('017e9c412e2b944bd590');olympe.dm.ib.xs=olympe.dm.ib.O.sa('017e9c416872a89d3415');olympe.dm.ib.Wk=olympe.dm.ib.O.sa('017ebf8fe5c506662098');R(olympe.dc.CloudObject.O,olympe.dm.ib.cb);
1048
+ olympe.dm.ib.Bd=Jf('100000000000000000dd','PRIMORDIAL');olympe.dm.ib.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);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.za,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{j(){return this.Pc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Pc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}D(){return this.ng(olympe.dm.Property.typeRel).Fc()}Uc(){return this.j().la().Vr(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);
1049
+ B('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);B('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)}Yx(){return olympe.C.Sa.EMPTY}Ax(){return this.sd(olympe.dm.Relation.D)}ky(){return this.sd(olympe.dm.Relation.F)}hs(){return this.ab(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Gc()}ss(){return this.ab(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Gc()}Uc(){return this.ss().la().concat(['-',this.la(),'->',this.hs().la()])}};olympe.dm.Relation.O=olympe.dc.na.j('ff021000000000000006',olympe.dm.Relation);
1050
+ olympe.dm.Relation.F=olympe.dm.Relation.O.ka('ff023000000000000030');olympe.dm.Relation.D=olympe.dm.Relation.O.ka('ff023000000000000034');olympe.dm.Relation.da=olympe.dm.Relation.O.ka(olympe.dc.Lb.Ho);olympe.dm.Relation.Y=olympe.dm.Relation.O.ka(olympe.dc.Lb.Dc);olympe.dm.Relation.ha=olympe.dm.Relation.O.ka(olympe.dc.Lb.fg);olympe.dm.Relation.wa=olympe.dm.Relation.O.ka(olympe.dc.Lb.Wv);olympe.dm.Relation.$=olympe.dm.Relation.O.ka(olympe.dc.Lb.Gt);olympe.dm.Relation.Ha=olympe.dm.Relation.O.ka(olympe.dc.Lb.rw);
1051
+ olympe.dm.Relation.R=olympe.dm.Relation.O.ka('ff023000000000000031');olympe.dm.Relation.originModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.yj);B('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Zr);B('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.j={yp:0,ft:5,Fv:1,iC:4,yr:2,Qq:8,zA:10,fC:6,gC:9,Se:6,hC:9};
1052
+ olympe.dm.Relation.H={LB:3,hv:4,xB:5,wB:6};olympe.dm.Relation.N=olympe.dm.ll.kv+olympe.dm.ll.Ct;m=olympe.dm.Relation.prototype;m.Yx.K=olympe.C.J.D;m.Ax.K=olympe.C.J.F;m.ky.K=olympe.C.J.F;m.hs.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.ss.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);function Km(a){a=olympe.dc.fa(a);if(olympe.dc.ia().Qf(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.De=class extends olympe.dc.CloudObject{getValue(){}};
1053
+ olympe.dm.De.O=olympe.dc.na.j('ff021000000000000019',olympe.dm.De);olympe.dm.String=class extends olympe.dm.De{getValue(){return this.wb(olympe.dm.String.valueProp)}Bc(){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');B('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.C.J.D;
1054
+ olympe.dm.String.prototype.toString.K=olympe.C.J.j;olympe.dm.Boolean=class extends olympe.dm.De{getValue(){return this.dh(olympe.dm.Boolean.valueProp)}Bc(){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');B('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.De{getValue(){return this.us()}Bc(){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');B('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.De{getValue(){return this.sj(olympe.dm.DateTime.valueProp)}Bc(){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');B('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.ta([super.la(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Sa)}Dd(){return this.sd(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.Dd.K=olympe.C.J.F;olympe.dm.cg=class extends olympe.dm.BrickMetadata{zy(){return this.fb(olympe.dc.CloudObject.instancesRel).fl(olympe.dm.Enum.rankProp,olympe.dc.query.kk.ASC).Fc()}static create(a,b){b=a.create(olympe.dm.cg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.cg.create=olympe.dm.cg.create;olympe.dm.cg.prototype.getValues=olympe.dm.cg.prototype.zy;olympe.dm.cg.O=olympe.dc.na.j('017a768f966fc08ebb98',olympe.dm.cg);olympe.dm.Number=class extends olympe.dm.De{getValue(){return this.sd(olympe.dm.Number.valueProp)}Bc(){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');B('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.C.J.F;olympe.sc={};olympe.sc.P={Ca:'sc.Logger',tk:'sc.RootContext',Ge:'sc.Serializer'};olympe.sc.U={Pe:'sc.app',Xf:'sc.debug',Mn:'sc.autostartProfiler',Eo:'sc.debugger',Dt:'sc.disableTheme',PRODUCTION:'sc.production',jv:'sc.onstartTimeout',Lq:'sc.remoteActionTimeout'};
1055
+ olympe.W.config(a=>{F(a,olympe.sc.U.Pe,'');F(a,olympe.sc.U.Xf,!1);F(a,olympe.sc.U.Dt,!0);F(a,olympe.sc.U.PRODUCTION,!1);F(a,olympe.sc.U.jv,2E4);F(a,olympe.sc.U.Lq,3E4);F(a,olympe.sc.U.Mn,!1);E(a,olympe.sc.P.Ca,[olympe.ja.P.Da],b=>b.cd('sc'));D(a,olympe.sc.P.Ge,olympe.sc.cc,olympe.dc.db.P.Da);Wa(a,olympe.dc.sources.P.Ge,olympe.sc.P.Ge);E(a,olympe.sc.P.tk,[new olympe.W.pa(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.yg('root','root',null);olympe.sc.wn=c;c.set(olympe.sc.ya.j.PRODUCTION,b);return new olympe.sc.ya(c)})},
1056
+ 'olympe.sc');olympe.W.run([olympe.sc.P.tk,new olympe.W.pa(olympe.L.U.wl)],(a,b)=>{olympe.$d().ctx=a;olympe.$d().oVersion=()=>b});olympe.sc.qn=()=>null!==olympe.dc.ia().Jb(void 0,olympe.sc.Runnable.j.$b());olympe.sc.hE=(a,b,c,d)=>{c=Y(Y(a.create(olympe.sc.ed),olympe.sc.ed.j,c||null),olympe.sc.ed.F,d||null);a.Oa(olympe.sc.ed.D,c,b);a.Oa(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.jj=(a,b)=>{a=olympe.dc.mb.Bx(b)(a);return a instanceof olympe.sc.Pd?a.j():a};
1057
+ olympe.sc.zE=function(a){const b=olympe.dc.CloudObject.containsRel.$b();var c=olympe.dc.fa(a);if(void 0===c)return[];a=olympe.dc.ia();const d=[];let e=[];const f=new Set;for(;!a.Ob(c,olympe.dm.Kb);){f.add(c);const g=a.Jb(c,b);if(null===g)return olympe.ja.$a('sc').warn(`Object ${c} has no container`),[];a.Ob(c,olympe.sc.logic.pb)||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.eh(e[0],
1058
+ olympe.dm.Kb.ha));e=e.concat(a.eh(e[e.length-1],olympe.dm.Mc.R.$b()));e=e.concat(a.eh(e[e.length-1],olympe.dm.Mc.N.$b()));return[...d,...e].reverse()};olympe.sc.AE=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Dg:a.startsWith('video/')?olympe.sc.Qh:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Kc:olympe.dm.File};
1059
+ olympe.sc.yE=a=>a instanceof olympe.sc.Dg?'image/*':a instanceof olympe.sc.Qh?'video/*':a instanceof olympe.sc.Kc?'font/*,application/font-woff':null;olympe.sc.Ya={};function Lm(a,b){var c=olympe.sc.ya,d=a.j;a=a.Cb();b=olympe.dc.fa(b);let e,f=null==(e=d.j)?void 0:e.get(b);if(!f){f=d.Yh(a,void 0,b);for(d=f.getParent();d&&d.ha&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||Mm(g,b,f)}return new c(f)}function Nm(a,b){let c,d;return(a=null!=(d=null==(c=a.j.j)?void 0:c.get(olympe.dc.fa(b)))?d:null)?new olympe.sc.ya(a):null}function Om(a){let b;return null!=(b=a.Pa(olympe.sc.ya.j.PRODUCTION))?b:!1}
1060
+ olympe.sc.ya=class{constructor(a=olympe.sc.wn){this.j=a;this.G=olympe.ja.$a('sc');this.D=null}T(){return this.j.T()}getParent(){if(null===this.D){const a=this.j.getParent();this.D=null===a?null:new olympe.sc.ya(a)}return this.D}Cx(a){const b=olympe.dc.ia();let c=this.getParent();if(!c)return this;const d=e=>{e=e.ef();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Qa(f,olympe.sc.Ua.$)||a.modelTag&&!b.Ob(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;c=e}return c}ef(){return this.j.ef()}Cb(){return this.j.Cb()}set(a,
1061
+ b){this.j.set(a,b);return this}Gn(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}rb(a,b,c=!1){const d=olympe.dc.fa(a),e=olympe.C.bc(null!=b?b:Object,`Get context value flow source of ${d}`);e.getContext().onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.j.T():void 0));return e.rb()}get(a,b=!1){a=this.Pa(a,b);return void 0!==a?a:null}has(a,b=!1){return this.j.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,
1062
+ d.next.bind(d),c?void 0:this.j.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Pm(this.j,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.mh(a.unsubscribe.bind(a));return this}yz(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Yh(`Runner ${a.name()}`);a.run(b);return b}Us(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.fa(a)})\``+
1063
+ `on the context ${this.T()}:\nStack: ${this.ne()}\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.ne()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;const d=(null==(c=a.ne)?void 0:c.call(a))||this.ne();let e,f;c=null!=(f=null==(e=a.es)?void 0:e.call(a))?f:0;b=Qm(b,c,d);b.stack=a.stack}else b=
1064
+ Qm(b,0,this.ne());Rm(this.j,b);return this}zz(a){this.set(olympe.sc.ya.j.xg,a);return this}Pa(a,b=!0){return this.j.Pa(a,b)}on(a,b,c,d=!0){return this.j.on(a,b,c,d)}Yh(a){return new olympe.sc.ya(this.j.Yh(this.Cb(),a))}cl(a,b){return this.j.cl(a,c=>{b(new olympe.sc.ya(c))})}iy(a){a=Sm(this.j,a);return a===this.j?this:a&&new olympe.sc.ya(a)}destroy(){this.j.destroy()}mh(a,b){return this.j.mh(a,b)}al(a){this.j.al(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.Cb().onDestroy(a)}Tf(a){this.gb()||
1065
+ this.Cb().Tf(a)}clear(){this.j.clear()}gb(){return this.Cb().gb()||this.Cb().gd()}Qa(a){a=Tm(this.j,a);return null!==a?new olympe.sc.ui.gA(a,this):null}Rx(a){a=Tm(this.j,a);return null!==a?new olympe.sc.ui.fA(a,this):null}ez(...a){return rxjs.combineLatest(a.map(b=>{b=Tm(this.j,b);return null!==b?this.observe(b):rxjs.of(null)}))}Ea(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.j===a.j}ne(){const a=olympe.dc.ia();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.j!==
1066
+ olympe.sc.wn;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.ef();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;olympe.sc.ya.prototype.getEvent=olympe.sc.ya.prototype.Rx;olympe.sc.ya.prototype.getProperty=olympe.sc.ya.prototype.Qa;olympe.sc.ya.prototype.isDestroyed=olympe.sc.ya.prototype.gb;
1067
+ olympe.sc.ya.prototype.clear=olympe.sc.ya.prototype.clear;olympe.sc.ya.prototype.offDestroy=olympe.sc.ya.prototype.Tf;olympe.sc.ya.prototype.onDestroy=olympe.sc.ya.prototype.onDestroy;olympe.sc.ya.prototype.offClear=olympe.sc.ya.prototype.al;olympe.sc.ya.prototype.onClear=olympe.sc.ya.prototype.mh;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.cl;
1068
+ olympe.sc.ya.prototype.createChild=olympe.sc.ya.prototype.Yh;olympe.sc.ya.prototype.setParentElement=olympe.sc.ya.prototype.zz;olympe.sc.ya.prototype['throw']=olympe.sc.ya.prototype.throw;olympe.sc.ya.prototype.waitFor=olympe.sc.ya.prototype.Us;olympe.sc.ya.prototype.runner=olympe.sc.ya.prototype.yz;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;
1069
+ 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.Gn;olympe.sc.ya.prototype.set=olympe.sc.ya.prototype.set;olympe.sc.ya.prototype.getClosest=olympe.sc.ya.prototype.Cx;olympe.sc.ya.prototype.getParent=olympe.sc.ya.prototype.getParent;olympe.sc.ya.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',xg:'__htmlContainer',uA:'__dockableElement',Kn:'__appHasStarted'};olympe.sc.ww=class extends olympe.sc.ya{constructor(a){super(a);this.F=new olympe.C.Xb('SC Update Context',super.Cb());const b=a.mh(()=>{b&&a.al(b);this.F.destroy()})}Cb(){return this.F}mh(a,b){return this.Cb().onDestroy(a,null!=b?b:olympe.V.Ic())}};let Um=0;function Pm(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 Rm(a,b){if(null===a.H)a.G.error(`An error occurred in a brick: ${b.toString()}`);else if(a.da){var c=Vm(olympe.dc.CloudObject.get(a.da));null!==c&&Wm(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):Rm(a.H,b)}else Rm(a.H,b)}
1070
+ function Sm(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=Xm(a.j,b);if(c)return c;a=a.getParent()}return null}function Ym(a,b,c=0){null===a.Ya&&(a.Ya=new Map);a.Ya.has(b.T())||(a.Ya.set(b.T(),{dl:b,depth:c}),Zm(a,d=>{(-1===b.F||c<b.F)&&Ym(d,b,c+1)}),a.onDestroy(()=>{$m(a,b.T())}));return b.T()}
1071
+ function $m(a,b){if(null===a.Ya||!a.Ya.has(b))return!1;const {dl:c,depth:d}=a.Ya.get(b);Zm(a,f=>{$m(f,b)});0===d&&c.D();const e=a.Ya.delete(b);0===a.Ya.size&&(a.Ya=null);return e}function Tm(a,b){let c;return(null==(c=a.$)?void 0:c.get('IO#'+b))||null}
1072
+ function an(a){a.D.Td(()=>{Zm(a,c=>c.destroy())});a.D.onDestroy(()=>{void 0!==a.Pa(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)}
1073
+ function Xm(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ha&&!c.id.startsWith('_')&&(a=Xm(c.j,b)))return a;return null}function cn(a,b,...c){if(null!==a.Ya)for(const {dl:d,depth:e}of a.Ya.values())d.process(a,b,e,...c)}function dn(a,b){a.da=olympe.dc.fa(b);a.ha=b.rd().qn();b.F().forEach(c=>{a.id===c||a.R.has(c)||(a.R.add(c),Mm(a,c,a))});a.$=b.j();cn(a,olympe.sc.Ya.pc.j.INIT)}function en(a){a.wa=!0;let b;null==(b=a.j)||b.forEach(c=>{en(c)})}
1074
+ function fn(a){a.wa=!1;let b;null==(b=a.j)||b.forEach(c=>{fn(c)})}function Wm(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.wa&&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));Um++;const e=Um;d.set(e,c);return()=>{const f=a.F.get(b);f&&(f.delete(e),0===f.size&&a.F.delete(b))}}
1075
+ function Mm(a,b,c){a.N.add(b);let d,e;null==(d=a.F)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});Zm(a,f=>{f.N.has(b)||Mm(f,b,c)});a.N.delete(b)}function Zm(a,b){let c;null==(c=a.j)||c.forEach(b)}function jn(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function kn(a){var b=olympe.sc.Ya.pc.D.Af;const c=[];if(null!==a.Ya)for(const {dl:d}of a.Ya.values())d.getType()===b&&(c.push(d.T()),d.D(),$m(a,d.T()))}function bn(a,b){null===a.j&&(a.j=new Map);a.j.set(b.id,b)}
1076
+ olympe.sc.yg=class{constructor(a,b='no name',c=olympe.sc.wn){this.id=a;this.ad=b;this.R=new Set;this.H=c;this.D=new olympe.C.Xb('SC Context');this.data=new Map;this.da=this.Y=this.j=this.F=null;this.ha=!1;this.N=new Set;this.wa=!1;this.$=null;this.G=olympe.ja.$a('sc');this.Ya=null;an(this)}T(){return this.id}getParent(){return this.H}ef(){return this.da}set(a,b){if(!this.D.gd()&&!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==
1077
+ (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.Ea))try{var f=b.Ea(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.Ya&&0<this.Ya.size&&cn(this,olympe.sc.Ya.pc.j.Rg,a,b),f=Wm(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.gd())return()=>{};const e=Pm(this,a),f=c?olympe.dc.fa(c):
1078
+ '*';a=hn(this,'@'+f+'.'+e,b);c=c?(c=Sm(this,f))?c.Pa(e,!1):void 0:this.Pa(e);void 0!==c&&b(c);if(d)olympe.C.Xa().onDestroy(a);return a}has(a,b=!1){a='$'+Pm(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}Yh(a,b,c){const d=null!=c?c:'_'+olympe.V.Ic();if(a.gb()||a.gd())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.yg(d,
1079
+ b,this));null!==this.Ya&&0<this.Ya.size&&this.Ya.forEach(({dl:f,depth:g})=>{(-1===f.F||g<f.F)&&Ym(e,f,g+1)});return e}cl(a,b){const c=Sm(this,a);if(c)return b(c),()=>{};const d=hn(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Pa(a,b=!0){a='$'+Pm(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.gd()||this.D.gb()||(cn(this,olympe.sc.Ya.pc.j.Rj),this.D.destroy(),cn(this,olympe.sc.Ya.pc.j.Vd))}mh(a,b){if(this.D.gb())a();
1080
+ else return Um++,b=null!=b?b:String(Um),null===this.Y&&(this.Y=new Map),this.Y.set(b,a),b;return b||'noId'}al(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.Ya.pc.j.Lj);let a;null==(a=this.Y)||a.forEach(b=>b());cn(this,olympe.sc.Ya.pc.j.Mj)}}gb(){return this.D.gb()}Cb(){return this.D}};olympe.sc.yg.prototype.getParent=olympe.sc.yg.prototype.getParent;olympe.sc.yg.j={Ul:'I#',mm:'O#',nB:'IO#'};function ln(a,b,c){return(c=c.ef())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.Ya.pc=class{constructor(a=-1){this.id=olympe.V.Kf();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.Ya.pc.j={INIT:'INIT',Rg:'SET',Lj:'CLEAR',Mj:'CLEARED',Rj:'DESTROY',Vd:'DESTROYED'};olympe.sc.Ya.pc.D={Af:'REMOTE',Nu:'LOCAL',eg:'PROFILER'};olympe.sc.Xd=class a{constructor(){this.D=this.H=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.V.Gm(1E4);gb(this.j,b=>{kn(b)})}$(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.Xd.j.ov:c=this.F.get(e.f);b.vd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.Xd.j.pv:const h=f+c,k=(l,n,p=0)=>{jn(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.F(q):t=q;let u;q=null!=(u=l.ef())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
1081
+ t])})};b.tn(h).then(()=>{const l=[];k(g,l,0);Zm(g,p=>{k(p,l,1)});olympe.L.ub.publish(h,{t:olympe.sc.Xd.j.eu,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.Ya.Jv(h);Ym(g,n);this.j.has(g)?fb(this.j,g):this.j.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.Xd.j.qv:void 0!==g&&this.j.has(g)&&fb(this.j,g);break;case olympe.sc.Xd.j.bg:void 0!==g&&(this.j.delete(g),kn(g))}}da(b,c,d){this.N=new olympe.L.ub('discovery_debug_id',
1082
+ c);this.N.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Xd.j.Et){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.Kf(),f=new olympe.C.Xb(this.D,c.Cb()),this.H=new olympe.L.ub(this.D,f),this.H.listen().subscribe(g=>{this.$(g,b,d)}));olympe.L.ub.publish(e,{t:olympe.sc.Xd.j.Vs,n:olympe.W.getParameter(olympe.sc.U.Eo)||'no name',a:b,s:this.D}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Y(b,c,
1083
+ d){const e=[],f=olympe.dc.ia(),g=(h,k)=>{Zm(h,l=>{if(null!==l.ef()){const n=olympe.dc.CloudObject.get(l.ef()).ng(olympe.sc.Runnable.H).Fc();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.j,f.name(d));return e}static D(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.F(d));olympe.L.ub.publish(b,{t:olympe.sc.Xd.j.Ek,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ja.$a('Debugger').error('Error publishing on service : ',f)})}static F(b){if(null===
1084
+ b||void 0===b)return'<null>';const c=olympe.dc.ia();if(b instanceof olympe.dc.CloudObject){var d=b.ac();if(!c.Ob(d,olympe.sc.yc))return b.toString();let f=`${b.Wb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.ma.from(e).mg(olympe.dc.CloudObject.extendRel,!0).ie().fb(olympe.dc.CloudObject.propertyRel).ie().Fc();e=olympe.dc.ma.from(e).mg(olympe.dc.CloudObject.extendRel,!0).ie().fb(olympe.dc.CloudObject.yj).ie().Fc();d=d.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=
1085
+ '<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Qa(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Xd.H='discovery_debug_id';olympe.sc.Xd.j={Et:0,Vs:1,ov:2,pv:3,eu:4,Ek:5,qv:6,bg:7};olympe.sc.Ya.vB=class extends olympe.sc.Ya.pc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.Ya.pc.D.Nu}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.pc.j.Rg){a=ln(c,Pm(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 mn(a,b,c,d=new Map){for(var e=[];b;){const n=b.ef();if(!n)break;e.push(n);b=b.getParent()}mb(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.ia||(e.ia=olympe.dc.ia());d=e.ia.name(f);e=(f=e.ia.model(f))?e.ia.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,
1086
1086
  q)}}
1087
- olympe.sc.Ya.pv=class extends olympe.sc.Ya.qc{constructor(a){super();this.j=a;this.ia=olympe.dc.ia();this.J=new Set}getType(){return olympe.sc.Ya.qc.D.ag}process(a,b,c,...d){var e=nn.Ol,f=nn.fm,g=nn.kv;const h=nn.INIT,k=nn.Ej,l=nn.Fj,n=nn.Kj,p=nn.Sd;c=nn.av;if(b===olympe.sc.Ya.qc.j.Ng){const [q,r]=d;b=(d=a.$e())?olympe.dc.ia().Qb(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ia().Qb(d,olympe.sc.ui.cC):!1;b?(g=this.ia.Jb(q,olympe.dm.Property.typeRel),b=this.ia.Qb(q,olympe.sc.logic.vb),d=this.ia.Qb(q,olympe.sc.logic.Gb),
1088
- mn(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ia.Qb(q,olympe.dm.Property),f=this.ia.Jb(q,olympe.dm.Property.typeRel),mn(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.Ya.qc.j.INIT?mn(this,a,h):b===olympe.sc.Ya.qc.j.Ej?mn(this,a,k):b===olympe.sc.Ya.qc.j.Fj?mn(this,a,l):b===olympe.sc.Ya.qc.j.Kj?mn(this,a,n):b===olympe.sc.Ya.qc.j.Sd&&mn(this,a,p)}};
1089
- const nn={Ol:'input',fm:'output',kv:'prop',INIT:'init',Ej:'clear',Fj:'cleared',Kj:'destroy',Sd:'destroyed',av:'other'};olympe.sc.Ya.zv=class extends olympe.sc.Ya.qc{constructor(a){super(1);this.J=a;this.j=new Map;this.db=olympe.dc.ia()}getType(){return olympe.sc.Ya.qc.D.wf}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.Ya.qc.j.Ng&&void 0!==d[0]&&null!==d[0]){const e=ln(c,Pm(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.yc){const h=Pg(this.db,f,()=>{olympe.sc.Ud.D(this.J,
1090
- e,f)});this.j.set(e,()=>{Qg(this.db,f,h)})}olympe.sc.Ud.D(this.J,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{qu(){return this.sd(this.en())}ru(){return this.sd(this.fn())}Lk(){return new olympe.C.Zb(this.sd(this.en()),this.sd(this.fn()))}en(){}fn(){}};olympe.sc.Metadata.O=olympe.dc.na.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.qu.K=olympe.C.H.F;m.ru.K=olympe.C.H.F;m.Lk.K=olympe.C.H.R;m.en.K=olympe.C.H.j;m.fn.K=olympe.C.H.j;olympe.sc.gd=class extends olympe.dc.CloudObject{D(){return this.wb(olympe.sc.gd.F)}j(){return this.wb(olympe.sc.gd.j)}};olympe.sc.gd.O=olympe.dc.na.j('01703376c4a81c0e9d90',olympe.sc.gd);olympe.sc.gd.F=olympe.sc.gd.O.ka('01703376c4a81c0e9d91');olympe.sc.gd.j=olympe.sc.gd.O.ka('01703376c4a81c0e9d92');olympe.sc.gd.D=olympe.sc.gd.O.sa('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.gd.D);olympe.sc.gd.prototype.D.K=olympe.C.H.D;olympe.sc.gd.prototype.j.K=olympe.C.H.D;olympe.sc.qe={};olympe.sc.qe.Ge={Ft:'folders',Dv:'screenflow',cw:'ui-design',ar:'software-intelligence',nh:'data-management',QB:'projects'};olympe.sc.xf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Cd(){return this.sd(olympe.sc.xf.D)}};olympe.sc.xf.O=olympe.dc.na.j('019131fb930466a1ad79',olympe.sc.xf);olympe.sc.xf.D=olympe.sc.xf.O.ka('016d1bb681929c2cc3f1');olympe.sc.xf.j=olympe.sc.xf.O.sa('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.xf.j);olympe.sc.xf.prototype.Cd.K=olympe.C.H.F;olympe.sc.od=class extends olympe.dm.BrickMetadata{oe(){return olympe.sc.qe.Ge.ar}j(){return this.bb(olympe.sc.od.j,olympe.sc.logic.Eh)}D(){return this.bb(olympe.sc.od.D,olympe.sc.logic.Gg)}};olympe.sc.od.O=olympe.dc.na.j('011100000000000adef0',olympe.sc.od);olympe.sc.od.j=olympe.sc.od.O.sa('016ac4f59a2917fdef01');olympe.sc.od.D=olympe.sc.od.O.sa('016ac4f59a2917fdef02');olympe.sc.od.O.j=(a,b)=>Cl(a,b||'New function signature',olympe.sc.od,olympe.sc.logic.xd).X();
1091
- olympe.sc.od.prototype.j.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.sc.od.prototype.D.K=new olympe.C.H(()=>olympe.dc.za,[]);function on(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function pn(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Qb(c,olympe.sc.logic.Sb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Qa(c,olympe.sc.logic.Sb.j,!0))?e:0;let f;d=null!=(f=a.db.Qa(d,olympe.sc.logic.Sb.j,!0))?f:0;return c-d});return b}function qn(a){return pn(a,a.db.bb(a.tag,olympe.sc.Ua.F))}function rn(a){return pn(a,a.db.bb(a.tag,olympe.sc.Ua.D))}
1092
- olympe.sc.Ua=class extends olympe.dm.BrickMetadata{tu(a,b,c,d,e=!0){e||olympe.ja.ab('sc').error('parameter own= false ignored, investigate');return olympe.C.jh(M(this.Mf(a,olympe.dc.mb.cj,c)),d)}J(){return[]}F(){return rxjs.of([])}ey(){return this.bb(olympe.sc.Ua.N,olympe.sc.Runnable)}vx(){return this.bb(olympe.sc.Ua.R,olympe.sc.Runnable)}di(){return this.db.Qa(this,olympe.sc.Ua.$)}jn(){return null!==this.db.Jb(this.tag,olympe.sc.Runnable.j.ac())}su(){return this.bb(olympe.sc.Ua.F,olympe.sc.logic.vb)}Gp(){return this.bb(olympe.sc.Ua.D,
1093
- olympe.sc.logic.Gb)}N(){return[olympe.sc.Ua.$a]}};olympe.sc.Ua.O=olympe.dc.na.j('0112000000000000def0',olympe.sc.Ua);olympe.sc.Ua.$=olympe.sc.Ua.O.ka('01692aa71f3108454479');olympe.sc.Ua.fb=olympe.sc.Ua.O.ka('0166446c1f128ebc903a');olympe.sc.Ua.$a=olympe.sc.Ua.O.ka('0166446c1f128ebc904e');olympe.sc.Ua.N=olympe.sc.Ua.O.sa('01692a4af82e8984742c');olympe.sc.Ua.R=olympe.sc.Ua.O.sa('01692a4af82e8984742d');olympe.sc.Ua.Y=olympe.sc.Ua.O.sa('01692a4af82e8984742e');olympe.sc.Ua.F=olympe.sc.Ua.O.sa('01621fb84e320000f00a');
1094
- olympe.sc.Ua.D=olympe.sc.Ua.O.sa('01621fb84e320000f00b');olympe.sc.Ua.Ec=olympe.sc.Ua.O.sa('0171838bcfed0000e00e');olympe.sc.Ua.rc=olympe.sc.Ua.O.sa('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.tu.K=olympe.C.H.j;m.ey.K=new olympe.C.H(()=>olympe.dc.za,[]);m.vx.K=new olympe.C.H(()=>olympe.dc.za,[]);m.di.K=olympe.C.H.j;m.jn.K=olympe.C.H.j;m.su.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Gp.K=new olympe.C.H(()=>olympe.dc.za,[]);function Vm(a){let b;return null!=(b=a.rd().N().map(olympe.dc.ha)[0])?b:null}function sn(a){const b=new olympe.dc.Wa;a=b.create(a);b.persist(a,!1);b.nb((d,e)=>{d||olympe.ja.ab('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.Xa().onDestroy(()=>{const d=new olympe.dc.Wa;d.delete(c);d.nb()});return c}
1087
+ olympe.sc.Ya.zv=class extends olympe.sc.Ya.pc{constructor(a){super();this.j=a;this.ia=olympe.dc.ia();this.H=new Set}getType(){return olympe.sc.Ya.pc.D.eg}process(a,b,c,...d){var e=nn.Ul,f=nn.mm,g=nn.uv;const h=nn.INIT,k=nn.Lj,l=nn.Mj,n=nn.Rj,p=nn.Vd;c=nn.lv;if(b===olympe.sc.Ya.pc.j.Rg){const [q,r]=d;b=(d=a.ef())?olympe.dc.ia().Ob(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ia().Ob(d,olympe.sc.ui.kC):!1;b?(g=this.ia.Jb(q,olympe.dm.Property.typeRel),b=this.ia.Ob(q,olympe.sc.logic.vb),d=this.ia.Ob(q,olympe.sc.logic.Gb),
1088
+ mn(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ia.Ob(q,olympe.dm.Property),f=this.ia.Jb(q,olympe.dm.Property.typeRel),mn(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.Ya.pc.j.INIT?mn(this,a,h):b===olympe.sc.Ya.pc.j.Lj?mn(this,a,k):b===olympe.sc.Ya.pc.j.Mj?mn(this,a,l):b===olympe.sc.Ya.pc.j.Rj?mn(this,a,n):b===olympe.sc.Ya.pc.j.Vd&&mn(this,a,p)}};
1089
+ const nn={Ul:'input',mm:'output',uv:'prop',INIT:'init',Lj:'clear',Mj:'cleared',Rj:'destroy',Vd:'destroyed',lv:'other'};olympe.sc.Ya.Jv=class extends olympe.sc.Ya.pc{constructor(a){super(1);this.H=a;this.j=new Map;this.db=olympe.dc.ia()}getType(){return olympe.sc.Ya.pc.D.Af}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.Ya.pc.j.Rg&&void 0!==d[0]&&null!==d[0]){const e=ln(c,Pm(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.Wb()instanceof olympe.sc.yc){const h=Ng(this.db,f,()=>{olympe.sc.Xd.D(this.H,
1090
+ e,f)});this.j.set(e,()=>{Og(this.db,f,h)})}olympe.sc.Xd.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{zu(){return this.sd(this.ln())}Au(){return this.sd(this.mn())}Sk(){return new olympe.C.Zb(this.sd(this.ln()),this.sd(this.mn()))}ln(){}mn(){}};olympe.sc.Metadata.O=olympe.dc.na.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.zu.K=olympe.C.J.F;m.Au.K=olympe.C.J.F;m.Sk.K=olympe.C.J.R;m.ln.K=olympe.C.J.j;m.mn.K=olympe.C.J.j;olympe.sc.ed=class extends olympe.dc.CloudObject{D(){return this.wb(olympe.sc.ed.F)}j(){return this.wb(olympe.sc.ed.j)}};olympe.sc.ed.O=olympe.dc.na.j('01703376c4a81c0e9d90',olympe.sc.ed);olympe.sc.ed.F=olympe.sc.ed.O.ka('01703376c4a81c0e9d91');olympe.sc.ed.j=olympe.sc.ed.O.ka('01703376c4a81c0e9d92');olympe.sc.ed.D=olympe.sc.ed.O.sa('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.ed.D);olympe.sc.ed.prototype.D.K=olympe.C.J.D;olympe.sc.ed.prototype.j.K=olympe.C.J.D;olympe.sc.se={};olympe.sc.se.Ie={Ot:'folders',Nv:'screenflow',mw:'ui-design',hr:'software-intelligence',rh:'data-management',ZB:'projects'};olympe.sc.Bf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Dd(){return this.sd(olympe.sc.Bf.D)}};olympe.sc.Bf.O=olympe.dc.na.j('019131fb930466a1ad79',olympe.sc.Bf);olympe.sc.Bf.D=olympe.sc.Bf.O.ka('016d1bb681929c2cc3f1');olympe.sc.Bf.j=olympe.sc.Bf.O.sa('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.Bf.j);olympe.sc.Bf.prototype.Dd.K=olympe.C.J.F;olympe.sc.od=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.hr}j(){return this.ab(olympe.sc.od.j,olympe.sc.logic.Ih)}D(){return this.ab(olympe.sc.od.D,olympe.sc.logic.Kg)}};olympe.sc.od.O=olympe.dc.na.j('011100000000000adef0',olympe.sc.od);olympe.sc.od.j=olympe.sc.od.O.sa('016ac4f59a2917fdef01');olympe.sc.od.D=olympe.sc.od.O.sa('016ac4f59a2917fdef02');olympe.sc.od.O.j=(a,b)=>Bl(a,b||'New function signature',olympe.sc.od,olympe.sc.logic.xd).X();
1091
+ olympe.sc.od.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.od.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);function on(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function pn(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Ob(c,olympe.sc.logic.Ub));b.sort((c,d)=>{let e;c=null!=(e=a.db.Qa(c,olympe.sc.logic.Ub.j,!0))?e:0;let f;d=null!=(f=a.db.Qa(d,olympe.sc.logic.Ub.j,!0))?f:0;return c-d});return b}function qn(a){return pn(a,a.db.ab(a.tag,olympe.sc.Ua.F))}function rn(a){return pn(a,a.db.ab(a.tag,olympe.sc.Ua.D))}
1092
+ olympe.sc.Ua=class extends olympe.dm.BrickMetadata{Cu(a,b,c,d,e=!0){e||olympe.ja.$a('sc').error('parameter own= false ignored, investigate');return olympe.C.nh(M(this.Pf(a,olympe.dc.mb.jj,c)),d)}H(){return[]}F(){return rxjs.of([])}py(){return this.ab(olympe.sc.Ua.N,olympe.sc.Runnable)}Fx(){return this.ab(olympe.sc.Ua.R,olympe.sc.Runnable)}ii(){return this.db.Qa(this,olympe.sc.Ua.$)}qn(){return null!==this.db.Jb(this.tag,olympe.sc.Runnable.j.$b())}Bu(){return this.ab(olympe.sc.Ua.F,olympe.sc.logic.vb)}Np(){return this.ab(olympe.sc.Ua.D,
1093
+ olympe.sc.logic.Gb)}N(){return[olympe.sc.Ua.cb]}};olympe.sc.Ua.O=olympe.dc.na.j('0112000000000000def0',olympe.sc.Ua);olympe.sc.Ua.$=olympe.sc.Ua.O.ka('01692aa71f3108454479');olympe.sc.Ua.jb=olympe.sc.Ua.O.ka('0166446c1f128ebc903a');olympe.sc.Ua.cb=olympe.sc.Ua.O.ka('0166446c1f128ebc904e');olympe.sc.Ua.N=olympe.sc.Ua.O.sa('01692a4af82e8984742c');olympe.sc.Ua.R=olympe.sc.Ua.O.sa('01692a4af82e8984742d');olympe.sc.Ua.Y=olympe.sc.Ua.O.sa('01692a4af82e8984742e');olympe.sc.Ua.F=olympe.sc.Ua.O.sa('01621fb84e320000f00a');
1094
+ olympe.sc.Ua.D=olympe.sc.Ua.O.sa('01621fb84e320000f00b');olympe.sc.Ua.Bd=olympe.sc.Ua.O.sa('0171838bcfed0000e00e');olympe.sc.Ua.$c=olympe.sc.Ua.O.sa('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.Cu.K=olympe.C.J.j;m.py.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Fx.K=new olympe.C.J(()=>olympe.dc.za,[]);m.ii.K=olympe.C.J.j;m.qn.K=olympe.C.J.j;m.Bu.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Np.K=new olympe.C.J(()=>olympe.dc.za,[]);function Vm(a){let b;return null!=(b=a.rd().N().map(olympe.dc.fa)[0])?b:null}function sn(a){const b=new olympe.dc.Wa;a=b.create(a);b.persist(a,!1);b.nb((d,e)=>{d||olympe.ja.$a('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.Xa().onDestroy(()=>{const d=new olympe.dc.Wa;d.delete(c);d.nb()});return c}
1095
1095
  function tn(a,b){dn(b.j,a);on(a.rd(),b);const c=a.N(),d=un(b,c),e=[];c.forEach((f,g)=>{f===a.$?e[0]=g:f===a.R&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(vn(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])})}
1096
- function wn(a,b){let c,d,e;a.G.j()&&(e=a.db.name(a.bc()),c=`Brick ${e} successfully run`,d=`Brick ${e} successfully cleared`);const f=xn(a,b),g=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.hb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.mw(b.j);l.D().run(()=>w(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`)));b.onDestroy(g.unsubscribe.bind(g))}
1097
- function yn(a,b,c,d){let e=[];const f=T(a.db,b,c,(g,h)=>{const k=Mm(d,h);if(g){const l=olympe.dc.CloudObject.get(h);l instanceof olympe.sc.logic.ed&&e?e.push(()=>l.run(k)):l.run(k)}else k.destroy()});e.forEach(g=>g());e=null;d.D().onDestroy(a.db.D.bind(a.db,b,c,f,!0))}function xn(a,b){return a.rd().J(b)}
1098
- function un(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 vn(a,b,c,d){b=b.D();const e=Pg(a.db,a.tag,b.F((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.mb.Ac(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{Qg(a.db,a.tag,e)})}
1099
- olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.D().run(()=>{tn(this,a);this.init(a);a.ih(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));wn(this,a);this.D(a)})}rd(){return this.Vb()}init(a){this.onInit(a)}update(a,b,c){const d=this.rd();if(d.di())this.onUpdate(a,b,c);else this.G.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.T()}`),yn(this,d,olympe.sc.Ua.N,a),this.ba()&&yn(this,d,
1100
- olympe.sc.Ua.Y,a)}D(a){a.An(olympe.sc.Ua.fb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.rd().F(a)}onInit(){}onUpdate(){const a=this.bc(),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 qn(this.rd())}getOutputs(){return rn(this.rd())}F(){return[]}j(){return null}ba(){return!1}J(a,
1101
- b,c,d){a=b.rb(a,c,!0);void 0!==d&&olympe.C.jh(a,d);return a}$a(a,b,c,d,e){olympe.C.pn([d],f=>{b.set(a,olympe.C.qs(f)?f.valueOf():f)});return this.J(a,b,c,e)}N(){return[this.$,this.R]}$(a,b){vn(this,a,b,null)}R(a,b){vn(this,a,null,b)}fb(a,b){const c=this.db,d=olympe.sc.logic.pb.F.ac(),e=olympe.sc.logic.pb.D,f=olympe.sc.logic.pb.j;this.Vr(d,g=>{var h=g.X();if(h=c.Jb(h,e)||c.Jb(h,f))return zn(g,a,b.bind(null,h))})}};olympe.sc.Runnable.O=Of(olympe.dc.na.j('01130000000000ca1100',olympe.sc.Runnable));
1102
- olympe.sc.Runnable.J=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.Ua.N);olympe.sc.Runnable.R=R(olympe.sc.Runnable.O,olympe.sc.Ua.R);olympe.sc.Runnable.Y=R(olympe.sc.Runnable.O,olympe.sc.Ua.Y);R(olympe.sc.Ua.O,olympe.sc.Runnable.J);R(olympe.sc.Ua.O,olympe.sc.Runnable.j);olympe.sc.Runnable.prototype.rd.K=new olympe.C.H(()=>olympe.sc.Ua,[]);
1103
- olympe.sc.Runnable.prototype.J.K=new olympe.C.H(()=>Object,[]);olympe.sc.Runnable.prototype.$a.K=olympe.C.H.j;function An(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Od)return(a=a.D())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.Od=class extends olympe.dc.CloudObject{D(){return this.db.bb(this,olympe.sc.Od.j)[0]}j(){const a=An(this);return olympe.dc.CloudObject.get(a)}Ac(){return this.j().Ac()}toString(){const a=An(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Od.O=olympe.dc.na.j('0163c9ae01f2d6e9ca49',olympe.sc.Od);
1104
- olympe.sc.Od.j=olympe.sc.Od.O.sa('0169b5a8a33144fb0b49');R(olympe.dc.CloudObject.O,olympe.sc.Od.j);olympe.sc.Od.prototype.D.K=new olympe.C.H(()=>String,[]);olympe.sc.Od.prototype.j.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);olympe.sc.Co=class extends olympe.dm.Kb{oe(){return olympe.sc.qe.Ge.nh}};olympe.sc.Co.O=olympe.dc.na.j('0163a68ce44f3d1fa84c',olympe.sc.Co);olympe.sc.yc=class extends olympe.dm.BrickMetadata{};olympe.sc.yc.O=olympe.dc.na.j('016324fde11a836f76c2',olympe.sc.yc);olympe.sc.yc.j=olympe.sc.yc.O.sa('016324fde11a836087c2');olympe.sc.yc.O.j=function(a,b){return Cl(a,null!=b?b:'New type',olympe.sc.yc).X()};let Bn=null,Cn=null,Dn=[];
1105
- function En(a,b){Bn=a;const c=olympe.C.Xa();return olympe.dc.nd.from(a).gb(olympe.sc.qa.Xc.j).gb(olympe.sc.hf.j.ac()).nb({Th:'__code-as-data__'}).then(d=>{let e;null==(e=Dn)||e.forEach(f=>f());Dn=null;Cn=d;if(null!==d){if(b){const f=olympe.dc.ia();return new Promise(g=>{di(c,d,h=>{h=f.ei(h)?h:f.model(h);return null!==h&&f.Qb(h,olympe.sc.yc)},{xn:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ja.ab('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
1106
- g()}))})}olympe.ja.ab('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ja.ab('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{Dn=null;throw d;})}function pf(){return null===Dn?Promise.resolve():new Promise(a=>{Dn.push(()=>a())})}olympe.sc.hf=class extends olympe.dc.CloudObject{};olympe.sc.hf.O=olympe.dc.na.j('017b3aa8fae1e3d044dc',olympe.sc.hf);olympe.sc.hf.j=olympe.sc.hf.O.sa('017b3aa8fd1659291b92');
1107
- olympe.sc.hf.D=olympe.sc.hf.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.Dg=class extends olympe.sc.Map{};olympe.sc.Dg.O=olympe.dc.na.j('01631aacd8276ea98490',olympe.sc.Dg);olympe.sc.File=class extends olympe.dm.File{static Qw(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Fs(a,e,b,c,d);return e}static Rw(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.wn(a,e,b,c,d);return e}static Fs(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.wn(a,b,c,d,e)}static wn(a,b,c,d,e){const f=olympe.dc.ia(),g=f.Ha(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Nf(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
1108
- 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.Qa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.j,!1);a.ys(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.wn;olympe.sc.File.setContent=olympe.sc.File.Fs;olympe.sc.File.createFromURL=olympe.sc.File.Rw;olympe.sc.File.createFromContent=olympe.sc.File.Qw;
1109
- olympe.sc.File.O=If(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.zg=class extends olympe.sc.File{J(){const a=olympe.C.cc(olympe.C.Sa);this.Ik(b=>{a.update(olympe.C.xb(b))});return a.rb()}};olympe.sc.zg.O=If(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.zg);olympe.sc.zg.O.j=olympe.sc.File.D.bind(null,olympe.sc.zg);olympe.sc.zg.prototype.J.K=olympe.C.H.D;olympe.sc.Lc=class extends olympe.sc.File{J(){return this.wb(olympe.sc.Lc.fontFamilyProp)}N(){return this.wb(olympe.sc.Lc.F)}R(){return this.sd(olympe.sc.Lc.J)}};olympe.sc.Lc.O=If(olympe.sc.File,'01647e113043c637b541',olympe.sc.Lc);olympe.sc.Lc.fontFamilyProp=olympe.sc.Lc.O.ka('01647e35ecd24ef0b88d');olympe.sc.Lc.F=olympe.sc.Lc.O.ka('01647e677f5d1cfbdf42');olympe.sc.Lc.J=olympe.sc.Lc.O.ka('01647e6780999bf8bd25');
1110
- olympe.sc.Lc.O.j=(a,b,c,d)=>{c=olympe.sc.File.D(olympe.sc.Lc,a,b,c,d);a.update(c,olympe.sc.Lc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Lc.prototype.J.K=olympe.C.H.D;olympe.sc.Lc.prototype.N.K=olympe.C.H.D;olympe.sc.Lc.prototype.R.K=olympe.C.H.F;olympe.sc.Mh=class extends olympe.sc.File{};olympe.sc.Mh.O=If(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.Mh);olympe.sc.Mh.O.j=olympe.sc.File.D.bind(null,olympe.sc.Mh);olympe.sc.yr=class extends olympe.dc.CloudObject{};olympe.sc.yr.O=olympe.dc.na.j('016421bb3797e22d1c4e',olympe.sc.yr);olympe.sc.logic={};olympe.sc.logic.ip=(a,b)=>a===b?0:a>b?1:-1;
1111
- olympe.sc.logic.lB=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.C.Pa(b.getType().X());let k,l;if(b===olympe.dc.ha(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.wb(h).toLowerCase();else if(b===olympe.dc.ha(olympe.dm.Number))k=c.valueOf(),l=p=>p.sd(h);else if(b===olympe.dc.ha(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.C.ta([p.lj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ia().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
1112
- return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.ip(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.ip(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.Ck().filter(p=>olympe.C.ta([l(p)],q=>{q=n(q.valueOf(),k);return olympe.C.Rb(d.valueOf()?1===q:0<=q)},olympe.C.ea,'FilterList ListDefBuilder Filter TransformFlows')).Fi())};
1113
- olympe.sc.logic.YD=(a,b)=>{if(a instanceof olympe.C.aa)return a;if(a instanceof olympe.C.Sa)return a.Is();if(a instanceof olympe.C.ea)return a.js();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.Sp};olympe.sc.logic.Ra={};function Fn(a){Nf(a.O,(b,c)=>{b=b.create(a.O.D);Y(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Ra.Xo=class{constructor(a,b,c){this.O=olympe.dc.na.j(a,b,...c);Fn(this)}X(){return this.O.X()}};olympe.sc.logic.Ra.Xo.xa=[olympe.dc.Qe];const Gn=Object.create(null),Hn=new Map;function In(a){if(void 0===Gn[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Kf(a)}function Jn(a,b,c=olympe.sc.logic.Function){if(Hn.has(a))throw c=In(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.na.j(a,b,...[]);Hn.set(a,{O:d,oE:b,VD:c});return d}
1114
- olympe.sc.logic.na=class{constructor(){}static j(a,b,...c){if(Gn[a])throw c=In(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Ra.Xo(a,b,[olympe.sc.P.Ca].concat(c));return Gn[a]=b}};olympe.sc.logic.$z=class{};olympe.sc.logic.Ij=class extends olympe.dc.CloudObject{};olympe.sc.logic.Ij.O=olympe.dc.na.j('01621fb84e320000cf00',olympe.sc.logic.Ij);function Qm(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)}Rx(){return this.message}Xr(){return this.code}le(){let a;return null!=(a=this.j)?a:''}toString(){return`${this.message}\nError found in:\n${this.le()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.le;
1115
- olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Xr;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Rx;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.wi=class extends olympe.sc.logic.Ij{};olympe.sc.logic.wi.O=olympe.dc.na.j('016eeb5ede9f3094d8f0',olympe.sc.logic.wi);olympe.sc.logic.md=class extends olympe.dc.CloudObject{j(){return this.Qc(olympe.sc.logic.md.j,olympe.dc.CloudObject)}};olympe.sc.logic.md.O=olympe.dc.na.j('016ac4f59ee8ea2081ba',olympe.sc.logic.md);olympe.sc.logic.md.D=olympe.sc.logic.md.O.ka('017bc044aeacce7ffc8f');olympe.sc.logic.md.j=olympe.sc.logic.md.O.sa('016ac4f5a0091c4790e2');R(olympe.dc.CloudObject.O,olympe.sc.logic.md.j);olympe.sc.logic.md.prototype.j.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Eh=class extends olympe.sc.logic.md{};olympe.sc.logic.Eh.O=olympe.dc.na.j('016ac4f59c592b862457',olympe.sc.logic.Eh);olympe.sc.logic.Eh.F=olympe.sc.od.j.ac();olympe.sc.logic.Eh.O.j=(a,b,c,d,e)=>{b=Cl(a,b||'New Predefined Input',olympe.sc.logic.Eh,olympe.sc.logic.vb);Y(b,olympe.sc.logic.md.D,e);a.Oa(olympe.sc.logic.md.j,b,c);a.Oa(olympe.sc.od.j,d,b);return b.X()};olympe.sc.logic.Gg=class extends olympe.sc.logic.md{};olympe.sc.logic.Gg.O=olympe.dc.na.j('016ac4f59dd99f5df3e1',olympe.sc.logic.Gg);olympe.sc.logic.Gg.F=R(olympe.sc.logic.Gg.O,olympe.sc.od.D);olympe.sc.logic.Gg.O.j=(a,b,c,d,e)=>{b=Cl(a,b||'New Predefined Output',olympe.sc.logic.Gg,olympe.sc.logic.Gb);Y(b,olympe.sc.logic.md.D,e);a.Oa(olympe.sc.logic.md.j,b,c);a.Oa(olympe.sc.od.D,d,b);return b.X()};olympe.sc.logic.xd=class extends olympe.sc.Ua{oe(){return olympe.sc.qe.Ge.ar}Y(){return this.$m().Ck().Qb([olympe.sc.logic.Function]).and().ud().Qb([olympe.sc.logic.kd,olympe.sc.logic.ed]).Fi()}N(){const a=olympe.dc.ha(olympe.sc.logic.wi);return this.db.bb(this,olympe.sc.logic.xd.D).filter(b=>this.db.Jb(b,olympe.sc.logic.Sb.typeRel)===a)}j(a){const b=this.db.Xm(this,[olympe.sc.Ua.F],c=>this.db.model(c)===olympe.dc.ha(a));return b?olympe.dc.CloudObject.get(b):null}D(a){const b=this.db.Xm(this,[olympe.sc.Ua.D],
1116
- c=>this.db.model(c)===olympe.dc.ha(a));return b?olympe.dc.CloudObject.get(b):null}J(a){if(!this.di())return super.J(a);const b=olympe.dc.ha(olympe.sc.logic.Ij),c=olympe.dc.ha(olympe.sc.logic.wi);return rn(this).map(d=>{switch(this.db.Jb(d,olympe.sc.logic.Sb.typeRel)){case b:return a.An.bind(a,d);case c:return a.throw.bind(a);default:return a.set.bind(a,d)}})}F(a){if(!this.di())return super.F(a);const b=qn(this);return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
1117
- c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.xd.O=Jn('01621fb84e320000f000',olympe.sc.logic.xd,olympe.sc.logic.Function);olympe.sc.logic.xd.prototype.j.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.xd.prototype.D.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);let Kn=null;function Ln(){if(null===Kn){let a;Kn=null!=(a=olympe.W.getParameter('sc.action.experimental'))?a:!1}return Kn}
1118
- olympe.sc.logic.Tf=class extends olympe.sc.logic.xd{R(){return this.j('016ac63229782039429f')}$(){return this.D('016ac6322acf67eebfe7')}ba(){return this.Gp().Ck().gb(olympe.sc.logic.Sb.typeRel).Qk(olympe.sc.logic.wi).Fi().sf().kn(olympe.C.aa.ZERO)}F(a){if(this.di()||Ln()){const b=this.R().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:qn(this).filter(d=>d!==b).map(d=>a.get(d))))}return super.F(a)}};olympe.sc.logic.Tf.j='016ac63229782039429f';olympe.sc.logic.Tf.J='016ac6322acf67eebfe7';
1119
- olympe.sc.logic.Tf.O=Jn('01621fb84e320000a000',olympe.sc.logic.Tf,olympe.sc.logic.Action);olympe.sc.logic.Tf.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Tf.prototype.$.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Tf.prototype.ba.K=olympe.C.H.N;olympe.sc.logic.lo=class extends olympe.sc.logic.xd{};olympe.sc.logic.lo.O=Jn('01621fb84e320000f011',olympe.sc.logic.lo);olympe.sc.logic.ko=class extends olympe.sc.logic.Tf{};olympe.sc.logic.ko.O=Jn('01621fb84e320000f012',olympe.sc.logic.ko);olympe.sc.logic.Function=class extends olympe.sc.Runnable{N(){return[this.fb]}j(){if(!this.rd().di())return super.j();const a=olympe.sc.tg.j.Ol,b=olympe.sc.tg.j.fm,c=this.db,d=new Map,e=this.bc();c.bb(e,olympe.sc.Ua.F).forEach(f=>{d.set(a+c.name(f),f)});c.bb(e,olympe.sc.Ua.D).forEach(f=>{d.set(b+c.name(f),f)});return d}};olympe.sc.logic.Function.O=olympe.dc.na.j('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.P.Ca);olympe.sc.logic.Sb=class extends olympe.dc.CloudObject{getType(){return this.Qc(olympe.sc.logic.Sb.typeRel,olympe.dc.CloudObject)}j(){return this.sd(olympe.sc.logic.Sb.j)}};olympe.sc.logic.Sb.O=olympe.dc.na.j('0168a431d25001540000',olympe.sc.logic.Sb);olympe.sc.logic.Sb.j=olympe.sc.logic.Sb.O.ka('01740c5d4ae4b520dd01');olympe.sc.logic.Sb.typeRel=olympe.sc.logic.Sb.O.sa('0168a431d3b9b7438424');R(olympe.dc.CloudObject.O,olympe.sc.logic.Sb.typeRel);
1120
- olympe.sc.logic.Sb.prototype.getType.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Sb.prototype.j.K=olympe.C.H.F;olympe.sc.logic.vb=class extends olympe.sc.logic.Sb{};olympe.sc.logic.vb.O=olympe.dc.na.j('0168a431d25001540001',olympe.sc.logic.vb);olympe.sc.logic.vb.R=olympe.sc.logic.Sb.O.ka('01740c5d4ae4b520dd02');olympe.sc.logic.vb.N=R(olympe.sc.logic.vb.O,olympe.sc.Ua.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);
1121
- olympe.sc.logic.vb.J=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);Y(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Oa(olympe.sc.logic.Sb.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Sb.j,e);d&&a.Oa(olympe.sc.Ua.F,d,f);return f.X()};olympe.sc.logic.Gb=class extends olympe.sc.logic.Sb{};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.Ua.D);olympe.sc.logic.Gb.D=olympe.sc.logic.Gb.O.sa('0168a431d91f25780003',olympe.dc.va.ORIGIN);olympe.sc.logic.Gb.J=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);
1122
- olympe.sc.logic.Gb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.Gb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Oa(olympe.sc.logic.Sb.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Sb.j,e);d&&a.Oa(olympe.sc.Ua.D,d,f);return f.X()};olympe.sc.logic.kd=class extends olympe.sc.logic.Function{run(a){tn(this,a);const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.kd.F),d=this.db.Jb(this,olympe.sc.logic.kd.D);a.on(c,e=>b.set(d,e),this.tag)}fa(){return this.ig(olympe.sc.logic.kd.F).Fc()}ua(){return this.ig(olympe.sc.logic.kd.D).Fc()}};olympe.sc.logic.kd.O=olympe.dc.na.j('01621fb84e32000000a0',olympe.sc.logic.kd,olympe.sc.P.Ca);olympe.sc.logic.kd.F=R(olympe.sc.logic.kd.O,olympe.sc.logic.vb.F);
1123
- olympe.sc.logic.kd.D=R(olympe.sc.logic.kd.O,olympe.sc.logic.Gb.J);olympe.sc.logic.kd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.kd);a.Oa(olympe.sc.logic.kd.D,b,c);return b.X()};olympe.sc.logic.kd.prototype.fa.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.kd.prototype.ua.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.ed=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.ed.D),d=this.db.Jb(this,olympe.sc.logic.ed.F);b.on(c,e=>a.set(d,e),b.T())}ua(){return this.ig(olympe.sc.logic.ed.D).Fc()}fa(){return this.ig(olympe.sc.logic.ed.F).Fc()}};olympe.sc.logic.ed.O=olympe.dc.na.j('01621fb84e32000000d0',olympe.sc.logic.ed,olympe.sc.P.Ca);olympe.sc.logic.ed.D=R(olympe.sc.logic.ed.O,olympe.sc.logic.vb.J);olympe.sc.logic.ed.F=R(olympe.sc.logic.ed.O,olympe.sc.logic.Gb.F);
1124
- olympe.sc.logic.ed.O.j=function(a,b,c){b=a.create(olympe.sc.logic.ed);a.Oa(olympe.sc.logic.ed.D,b,c);return b.X()};olympe.sc.logic.ed.prototype.ua.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.ed.prototype.fa.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);function zn(a,b,c){var d;const e=null!=(d=a.db.Jb(a,olympe.sc.logic.pb.R))?d:a.db.Jb(a,olympe.sc.logic.pb.J),f=a.db.Jb(a,olympe.sc.logic.pb.N);if(null!==e&&null!==f){d=a.db.Nf(Mn(a),olympe.dm.Be)?new olympe.C.Xb('Pipe Context'):null;const k=a.j.bind(a,c,d);let l;const n=b.Wk(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.mb.Ac(k)),h=Ng(a.db,a,olympe.sc.logic.pb.valueProp,g);return()=>{g(null);Og(a.db,a,olympe.sc.logic.pb.valueProp,
1125
- h)}}function Mn(a){let b=null,c=a.db.Jb(a,olympe.sc.logic.pb.D);c?b=a.db.Jb(c,olympe.dm.Property.typeRel):(c=a.db.Jb(a,olympe.sc.logic.pb.j))&&(b=a.db.Jb(c,olympe.sc.logic.Sb.typeRel));return b||olympe.dc.ha(olympe.dc.CloudObject)}
1126
- olympe.sc.logic.pb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.G=c}j(a,b,c){const d=olympe.sc.cj(c);null==b||b.fa();b&&d instanceof olympe.dm.Be?null==b||b.run(()=>{olympe.C.Sc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.Mf(olympe.sc.logic.pb.valueProp,a||olympe.dc.mb.cj,Object)}getType(){const a=this.transform(olympe.sc.logic.pb.j,olympe.sc.logic.Sb.typeRel);a.Ld(olympe.dc.CloudObject);return a.Gc()}ly(){return this.Qc(olympe.sc.logic.pb.N,olympe.dc.CloudObject)}jy(){return this.Qc(olympe.sc.logic.pb.R,
1127
- olympe.sc.logic.Gb)}ky(){return this.Qc(olympe.sc.logic.pb.J,olympe.dm.Property)}Ex(){return this.Qc(olympe.sc.logic.pb.F,olympe.dc.CloudObject)}Cx(){return this.Qc(olympe.sc.logic.pb.j,olympe.sc.logic.vb)}Dx(){return this.Qc(olympe.sc.logic.pb.D,olympe.dm.Property)}};olympe.sc.logic.pb.O=olympe.dc.na.j('0168a431d91f25780000',olympe.sc.logic.pb,olympe.sc.P.Ca);olympe.sc.logic.pb.valueProp=olympe.sc.logic.pb.O.ka('0168a431d91f25780001');olympe.sc.logic.pb.N=olympe.sc.logic.pb.O.sa('0168a431d91f25780002');
1128
- olympe.sc.logic.pb.R=R(olympe.sc.logic.pb.O,olympe.sc.logic.Gb.D);olympe.sc.logic.pb.J=olympe.sc.logic.pb.O.sa('0168a431d91f25780004');olympe.sc.logic.pb.F=olympe.sc.logic.pb.O.sa('0168a431d91f2578000a');olympe.sc.logic.pb.j=R(olympe.sc.logic.pb.O,olympe.sc.logic.vb.D);olympe.sc.logic.pb.D=olympe.sc.logic.pb.O.sa('0168a431d91f2578000c');R(olympe.dc.CloudObject.O,olympe.sc.logic.pb.N);R(olympe.dm.Property.O,olympe.sc.logic.pb.J);R(olympe.dc.CloudObject.O,olympe.sc.logic.pb.F);
1129
- R(olympe.dm.Property.O,olympe.sc.logic.pb.D);m=olympe.sc.logic.pb.prototype;m.getType.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.ly.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.jy.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);m.ky.K=new olympe.C.H(()=>olympe.dm.Property,[]);m.Ex.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.Cx.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);m.Dx.K=new olympe.C.H(()=>olympe.dm.Property,[]);function Nn(a,b){const c=a.rd(),d=c.Sl().X(),e=c.Tl().X(),f=c.Ul().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.ub.get(a.bc(),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=Qm(k.message,k.code,k.le()+'\n===== Remote Call =====\n'+b.le()),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,
1096
+ function wn(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=xn(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.ww(b.j);l.Cb().run(()=>w(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`)));b.onDestroy(g.unsubscribe.bind(g))}
1097
+ function yn(a,b,c,d){let e=[];const f=T(a.db,b,c,(g,h)=>{if(g){const k=Lm(d,h),l=olympe.dc.CloudObject.get(h);l instanceof olympe.sc.logic.dd&&null!==e?e.push(()=>l.run(k)):l.run(k)}else{let k;null==(k=Nm(d,h))||k.destroy()}});e.forEach(g=>g());e=null;d.Cb().onDestroy(a.db.D.bind(a.db,b,c,f))}function xn(a,b){return a.rd().H(b)}
1098
+ function un(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 vn(a,b,c,d){b=b.Cb();const e=Ng(a.db,a.tag,b.rc((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.mb.Bc(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{Og(a.db,a.tag,e)})}
1099
+ olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.Cb().run(()=>{tn(this,a);this.init(a);a.mh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));wn(this,a);this.D(a)})}rd(){return this.Wb()}init(a){this.onInit(a)}update(a,b,c){const d=this.rd();if(d.ii())this.onUpdate(a,b,c);else this.G.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.T()}`),yn(this,d,olympe.sc.Ua.N,a),this.da()&&yn(this,
1100
+ d,olympe.sc.Ua.Y,a)}D(a){a.Gn(olympe.sc.Ua.jb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.rd().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 qn(this.rd())}getOutputs(){return rn(this.rd())}F(){return[]}j(){return null}da(){return!1}H(a,
1101
+ b,c,d){a=b.rb(a,c,!0);void 0!==d&&olympe.C.nh(a,d);return a}cb(a,b,c,d,e){olympe.C.vn([d],f=>{b.set(a,olympe.C.ys(f)?f.valueOf():f)});return this.H(a,b,c,e)}N(){return[this.$,this.R]}$(a,b){vn(this,a,b,null)}R(a,b){vn(this,a,null,b)}jb(a,b){const c=this.db,d=olympe.sc.logic.pb.F.$b(),e=olympe.sc.logic.pb.D,f=olympe.sc.logic.pb.j;this.cs(d,g=>{var h=g.X();if(h=c.Jb(h,e)||c.Jb(h,f))return zn(g,a,b.bind(null,h))})}};olympe.sc.Runnable.O=Of(olympe.dc.na.j('01130000000000ca1100',olympe.sc.Runnable));
1102
+ 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.Ua.N);olympe.sc.Runnable.R=R(olympe.sc.Runnable.O,olympe.sc.Ua.R);olympe.sc.Runnable.Y=R(olympe.sc.Runnable.O,olympe.sc.Ua.Y);R(olympe.sc.Ua.O,olympe.sc.Runnable.H);R(olympe.sc.Ua.O,olympe.sc.Runnable.j);olympe.sc.Runnable.prototype.rd.K=new olympe.C.J(()=>olympe.sc.Ua,[]);
1103
+ olympe.sc.Runnable.prototype.H.K=new olympe.C.J(()=>Object,[]);olympe.sc.Runnable.prototype.cb.K=olympe.C.J.j;function An(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Pd)return(a=a.D())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.Pd=class extends olympe.dc.CloudObject{D(){return this.db.ab(this,olympe.sc.Pd.j)[0]}j(){const a=An(this);return olympe.dc.CloudObject.get(a)}Bc(){return this.j().Bc()}toString(){const a=An(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Pd.O=olympe.dc.na.j('0163c9ae01f2d6e9ca49',olympe.sc.Pd);
1104
+ olympe.sc.Pd.j=olympe.sc.Pd.O.sa('0169b5a8a33144fb0b49');R(olympe.dc.CloudObject.O,olympe.sc.Pd.j);olympe.sc.Pd.prototype.D.K=new olympe.C.J(()=>String,[]);olympe.sc.Pd.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.Io=class extends olympe.dm.Kb{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.Io.O=olympe.dc.na.j('0163a68ce44f3d1fa84c',olympe.sc.Io);olympe.sc.yc=class extends olympe.dm.BrickMetadata{};olympe.sc.yc.O=olympe.dc.na.j('016324fde11a836f76c2',olympe.sc.yc);olympe.sc.yc.j=olympe.sc.yc.O.sa('016324fde11a836087c2');olympe.sc.yc.O.j=function(a,b){return Bl(a,null!=b?b:'New type',olympe.sc.yc).X()};let Bn=null,Cn=null,Dn=[];
1105
+ function En(a,b){Bn=a;const c=olympe.C.Xa();return olympe.dc.nd.from(a).fb(olympe.sc.qa.Xc.j).fb(olympe.sc.mf.j.$b()).nb({Xh:'__code-as-data__'}).then(d=>{let e;null==(e=Dn)||e.forEach(f=>f());Dn=null;Cn=d;if(null!==d){if(b){const f=olympe.dc.ia();return new Promise(g=>{bi(c,d,h=>{h=f.ji(h)?h:f.model(h);return null!==h&&f.Ob(h,olympe.sc.yc)},{Dn:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ja.$a('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
1106
+ g()}))})}olympe.ja.$a('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ja.$a('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{Dn=null;throw d;})}function pf(){return null===Dn?Promise.resolve():new Promise(a=>{Dn.push(()=>a())})}olympe.sc.mf=class extends olympe.dc.CloudObject{};olympe.sc.mf.O=olympe.dc.na.j('017b3aa8fae1e3d044dc',olympe.sc.mf);olympe.sc.mf.j=olympe.sc.mf.O.sa('017b3aa8fd1659291b92');
1107
+ olympe.sc.mf.D=olympe.sc.mf.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.Hg=class extends olympe.sc.Map{};olympe.sc.Hg.O=olympe.dc.na.j('01631aacd8276ea98490',olympe.sc.Hg);olympe.sc.File=class extends olympe.dm.File{static $w(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Ns(a,e,b,c,d);return e}static ax(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Cn(a,e,b,c,d);return e}static Ns(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.Cn(a,b,c,d,e)}static Cn(a,b,c,d,e){const f=olympe.dc.ia(),g=f.Ga(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Qf(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
1108
+ 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.Qa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.j,!1);a.Fs(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.Cn;olympe.sc.File.setContent=olympe.sc.File.Ns;olympe.sc.File.createFromURL=olympe.sc.File.ax;olympe.sc.File.createFromContent=olympe.sc.File.$w;
1109
+ olympe.sc.File.O=If(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Dg=class extends olympe.sc.File{H(){const a=olympe.C.bc(olympe.C.Sa);this.Pk(b=>{a.update(olympe.C.xb(b))});return a.rb()}};olympe.sc.Dg.O=If(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Dg);olympe.sc.Dg.O.j=olympe.sc.File.D.bind(null,olympe.sc.Dg);olympe.sc.Dg.prototype.H.K=olympe.C.J.D;olympe.sc.Kc=class extends olympe.sc.File{H(){return this.wb(olympe.sc.Kc.fontFamilyProp)}N(){return this.wb(olympe.sc.Kc.F)}R(){return this.sd(olympe.sc.Kc.H)}};olympe.sc.Kc.O=If(olympe.sc.File,'01647e113043c637b541',olympe.sc.Kc);olympe.sc.Kc.fontFamilyProp=olympe.sc.Kc.O.ka('01647e35ecd24ef0b88d');olympe.sc.Kc.F=olympe.sc.Kc.O.ka('01647e677f5d1cfbdf42');olympe.sc.Kc.H=olympe.sc.Kc.O.ka('01647e6780999bf8bd25');
1110
+ olympe.sc.Kc.O.j=(a,b,c,d)=>{c=olympe.sc.File.D(olympe.sc.Kc,a,b,c,d);a.update(c,olympe.sc.Kc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Kc.prototype.H.K=olympe.C.J.D;olympe.sc.Kc.prototype.N.K=olympe.C.J.D;olympe.sc.Kc.prototype.R.K=olympe.C.J.F;olympe.sc.Qh=class extends olympe.sc.File{};olympe.sc.Qh.O=If(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.Qh);olympe.sc.Qh.O.j=olympe.sc.File.D.bind(null,olympe.sc.Qh);olympe.sc.Fr=class extends olympe.dc.CloudObject{};olympe.sc.Fr.O=olympe.dc.na.j('016421bb3797e22d1c4e',olympe.sc.Fr);olympe.sc.logic={};olympe.sc.logic.op=(a,b)=>a===b?0:a>b?1:-1;
1111
+ olympe.sc.logic.uB=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.C.Pa(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.sd(h);else if(b===olympe.dc.fa(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.C.ta([p.sj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ia().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
1112
+ return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.op(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.op(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.Jk().filter(p=>olympe.C.ta([l(p)],q=>{q=n(q.valueOf(),k);return olympe.C.Sb(d.valueOf()?1===q:0<=q)},olympe.C.ea,'FilterList ListDefBuilder Filter TransformFlows')).Li())};
1113
+ olympe.sc.logic.fE=(a,b)=>{if(a instanceof olympe.C.aa)return a;if(a instanceof olympe.C.Sa)return a.Rs();if(a instanceof olympe.C.ea)return a.rs();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.Zp};olympe.sc.logic.Ra={};function Fn(a){Nf(a.O,(b,c)=>{b=b.create(a.O.D);Y(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Ra.cp=class{constructor(a,b,c){this.O=olympe.dc.na.j(a,b,...c);Fn(this)}X(){return this.O.X()}};olympe.sc.logic.Ra.cp.xa=[olympe.dc.Te];const Gn=Object.create(null),Hn=new Map;function In(a){if(void 0===Gn[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Kf(a)}function Jn(a,b,c=olympe.sc.logic.Function){if(Hn.has(a))throw c=In(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.na.j(a,b,...[]);Hn.set(a,{O:d,wE:b,cE:c});return d}
1114
+ olympe.sc.logic.na=class{constructor(){}static j(a,b,...c){if(Gn[a])throw c=In(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Ra.cp(a,b,[olympe.sc.P.Ca].concat(c));return Gn[a]=b}};olympe.sc.logic.jA=class{};olympe.sc.logic.Pj=class extends olympe.dc.CloudObject{};olympe.sc.logic.Pj.O=olympe.dc.na.j('01621fb84e320000cf00',olympe.sc.logic.Pj);function Qm(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)}ay(){return this.message}es(){return this.code}ne(){let a;return null!=(a=this.j)?a:''}toString(){return`${this.message}\nError found in:\n${this.ne()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.ne;
1115
+ olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.es;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.ay;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.Ci=class extends olympe.sc.logic.Pj{};olympe.sc.logic.Ci.O=olympe.dc.na.j('016eeb5ede9f3094d8f0',olympe.sc.logic.Ci);olympe.sc.logic.md=class extends olympe.dc.CloudObject{j(){return this.Pc(olympe.sc.logic.md.j,olympe.dc.CloudObject)}};olympe.sc.logic.md.O=olympe.dc.na.j('016ac4f59ee8ea2081ba',olympe.sc.logic.md);olympe.sc.logic.md.D=olympe.sc.logic.md.O.ka('017bc044aeacce7ffc8f');olympe.sc.logic.md.j=olympe.sc.logic.md.O.sa('016ac4f5a0091c4790e2');R(olympe.dc.CloudObject.O,olympe.sc.logic.md.j);olympe.sc.logic.md.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ih=class extends olympe.sc.logic.md{};olympe.sc.logic.Ih.O=olympe.dc.na.j('016ac4f59c592b862457',olympe.sc.logic.Ih);olympe.sc.logic.Ih.F=olympe.sc.od.j.$b();olympe.sc.logic.Ih.O.j=(a,b,c,d,e)=>{b=Bl(a,b||'New Predefined Input',olympe.sc.logic.Ih,olympe.sc.logic.vb);Y(b,olympe.sc.logic.md.D,e);a.Oa(olympe.sc.logic.md.j,b,c);a.Oa(olympe.sc.od.j,d,b);return b.X()};olympe.sc.logic.Kg=class extends olympe.sc.logic.md{};olympe.sc.logic.Kg.O=olympe.dc.na.j('016ac4f59dd99f5df3e1',olympe.sc.logic.Kg);olympe.sc.logic.Kg.F=R(olympe.sc.logic.Kg.O,olympe.sc.od.D);olympe.sc.logic.Kg.O.j=(a,b,c,d,e)=>{b=Bl(a,b||'New Predefined Output',olympe.sc.logic.Kg,olympe.sc.logic.Gb);Y(b,olympe.sc.logic.md.D,e);a.Oa(olympe.sc.logic.md.j,b,c);a.Oa(olympe.sc.od.D,d,b);return b.X()};olympe.sc.logic.xd=class extends olympe.sc.Ua{qe(){return olympe.sc.se.Ie.hr}Y(){return this.en().Jk().Ob([olympe.sc.logic.Function]).and().ud().Ob([olympe.sc.logic.kd,olympe.sc.logic.dd]).Li()}N(){const a=olympe.dc.fa(olympe.sc.logic.Ci);return this.db.ab(this,olympe.sc.logic.xd.D).filter(b=>this.db.Jb(b,olympe.sc.logic.Ub.typeRel)===a)}j(a){const b=this.db.bn(this,[olympe.sc.Ua.F],c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}D(a){const b=this.db.bn(this,[olympe.sc.Ua.D],
1116
+ c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}H(a){if(!this.ii())return super.H(a);const b=olympe.dc.fa(olympe.sc.logic.Pj),c=olympe.dc.fa(olympe.sc.logic.Ci);return rn(this).map(d=>{switch(this.db.Jb(d,olympe.sc.logic.Ub.typeRel)){case b:return a.Gn.bind(a,d);case c:return a.throw.bind(a);default:return a.set.bind(a,d)}})}F(a){if(!this.ii())return super.F(a);const b=qn(this);return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
1117
+ c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.xd.O=Jn('01621fb84e320000f000',olympe.sc.logic.xd,olympe.sc.logic.Function);olympe.sc.logic.xd.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.xd.prototype.D.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);let Kn=null;function Ln(){if(null===Kn){let a;Kn=null!=(a=olympe.W.getParameter('sc.action.experimental'))?a:!1}return Kn}
1118
+ olympe.sc.logic.Wf=class extends olympe.sc.logic.xd{R(){return this.j('016ac63229782039429f')}$(){return this.D('016ac6322acf67eebfe7')}da(){return this.Np().Jk().fb(olympe.sc.logic.Ub.typeRel).Xk(olympe.sc.logic.Ci).Li().wf().rn(olympe.C.aa.ZERO)}F(a){if(this.ii()||Ln()){const b=this.R().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:qn(this).filter(d=>d!==b).map(d=>a.get(d))))}return super.F(a)}};olympe.sc.logic.Wf.j='016ac63229782039429f';olympe.sc.logic.Wf.H='016ac6322acf67eebfe7';
1119
+ olympe.sc.logic.Wf.O=Jn('01621fb84e320000a000',olympe.sc.logic.Wf,olympe.sc.logic.Action);olympe.sc.logic.Wf.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Wf.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Wf.prototype.da.K=olympe.C.J.N;olympe.sc.logic.ro=class extends olympe.sc.logic.xd{};olympe.sc.logic.ro.O=Jn('01621fb84e320000f011',olympe.sc.logic.ro);olympe.sc.logic.qo=class extends olympe.sc.logic.Wf{};olympe.sc.logic.qo.O=Jn('01621fb84e320000f012',olympe.sc.logic.qo);olympe.sc.logic.Function=class extends olympe.sc.Runnable{N(){return[this.jb]}j(){if(!this.rd().ii())return super.j();const a=olympe.sc.yg.j.Ul,b=olympe.sc.yg.j.mm,c=this.db,d=new Map,e=this.ac();c.ab(e,olympe.sc.Ua.F).forEach(f=>{d.set(a+c.name(f),f)});c.ab(e,olympe.sc.Ua.D).forEach(f=>{d.set(b+c.name(f),f)});return d}};olympe.sc.logic.Function.O=olympe.dc.na.j('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.P.Ca);olympe.sc.logic.Ub=class extends olympe.dc.CloudObject{getType(){return this.Pc(olympe.sc.logic.Ub.typeRel,olympe.dc.CloudObject)}j(){return this.sd(olympe.sc.logic.Ub.j)}};olympe.sc.logic.Ub.O=olympe.dc.na.j('0168a431d25001540000',olympe.sc.logic.Ub);olympe.sc.logic.Ub.j=olympe.sc.logic.Ub.O.ka('01740c5d4ae4b520dd01');olympe.sc.logic.Ub.typeRel=olympe.sc.logic.Ub.O.sa('0168a431d3b9b7438424');R(olympe.dc.CloudObject.O,olympe.sc.logic.Ub.typeRel);
1120
+ olympe.sc.logic.Ub.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ub.prototype.j.K=olympe.C.J.F;olympe.sc.logic.vb=class extends olympe.sc.logic.Ub{};olympe.sc.logic.vb.O=olympe.dc.na.j('0168a431d25001540001',olympe.sc.logic.vb);olympe.sc.logic.vb.R=olympe.sc.logic.Ub.O.ka('01740c5d4ae4b520dd02');olympe.sc.logic.vb.N=R(olympe.sc.logic.vb.O,olympe.sc.Ua.F);olympe.sc.logic.vb.D=olympe.sc.logic.vb.O.sa('0168a431d91f2578000b',olympe.dc.ua.ORIGIN);olympe.sc.logic.vb.F=olympe.sc.logic.vb.O.sa('01621fb84e32000000a1',olympe.dc.ua.ORIGIN);
1121
+ olympe.sc.logic.vb.H=olympe.sc.logic.vb.O.sa('01621fb84e32000000d1',olympe.dc.ua.ORIGIN);olympe.sc.logic.vb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.vb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Oa(olympe.sc.logic.Ub.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Ub.j,e);d&&a.Oa(olympe.sc.Ua.F,d,f);return f.X()};olympe.sc.logic.Gb=class extends olympe.sc.logic.Ub{};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.Ua.D);olympe.sc.logic.Gb.D=olympe.sc.logic.Gb.O.sa('0168a431d91f25780003',olympe.dc.ua.ORIGIN);olympe.sc.logic.Gb.H=olympe.sc.logic.Gb.O.sa('01621fb84e32000000a2',olympe.dc.ua.ORIGIN);olympe.sc.logic.Gb.F=olympe.sc.logic.Gb.O.sa('01621fb84e32000000d2',olympe.dc.ua.ORIGIN);
1122
+ olympe.sc.logic.Gb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.Gb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Oa(olympe.sc.logic.Ub.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Ub.j,e);d&&a.Oa(olympe.sc.Ua.D,d,f);return f.X()};olympe.sc.logic.kd=class extends olympe.sc.logic.Function{run(a){tn(this,a);const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.kd.F),d=this.db.Jb(this,olympe.sc.logic.kd.D);a.on(c,e=>b.set(d,e),this.tag)}ha(){return this.ng(olympe.sc.logic.kd.F).Fc()}wa(){return this.ng(olympe.sc.logic.kd.D).Fc()}};olympe.sc.logic.kd.O=olympe.dc.na.j('01621fb84e32000000a0',olympe.sc.logic.kd,olympe.sc.P.Ca);olympe.sc.logic.kd.F=R(olympe.sc.logic.kd.O,olympe.sc.logic.vb.F);
1123
+ olympe.sc.logic.kd.D=R(olympe.sc.logic.kd.O,olympe.sc.logic.Gb.H);olympe.sc.logic.kd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.kd);a.Oa(olympe.sc.logic.kd.D,b,c);return b.X()};olympe.sc.logic.kd.prototype.ha.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.kd.prototype.wa.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.dd=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.dd.D),d=this.db.Jb(this,olympe.sc.logic.dd.F);b.on(c,e=>a.set(d,e),b.T())}wa(){return this.ng(olympe.sc.logic.dd.D).Fc()}ha(){return this.ng(olympe.sc.logic.dd.F).Fc()}};olympe.sc.logic.dd.O=olympe.dc.na.j('01621fb84e32000000d0',olympe.sc.logic.dd,olympe.sc.P.Ca);olympe.sc.logic.dd.D=R(olympe.sc.logic.dd.O,olympe.sc.logic.vb.H);olympe.sc.logic.dd.F=R(olympe.sc.logic.dd.O,olympe.sc.logic.Gb.F);
1124
+ olympe.sc.logic.dd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.dd);a.Oa(olympe.sc.logic.dd.D,b,c);return b.X()};olympe.sc.logic.dd.prototype.wa.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.dd.prototype.ha.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);function zn(a,b,c){var d;const e=null!=(d=a.db.Jb(a,olympe.sc.logic.pb.R))?d:a.db.Jb(a,olympe.sc.logic.pb.H),f=a.db.Jb(a,olympe.sc.logic.pb.N);if(null!==e&&null!==f){d=a.db.Qf(Mn(a),olympe.dm.De)?new olympe.C.Xb('Pipe Context'):null;const k=a.j.bind(a,c,d);let l;const n=b.cl(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.mb.Bc(k)),h=Lg(a.db,a,olympe.sc.logic.pb.valueProp,g);return()=>{g(null);Mg(a.db,a,olympe.sc.logic.pb.valueProp,
1125
+ h)}}function Mn(a){let b=null,c=a.db.Jb(a,olympe.sc.logic.pb.D);c?b=a.db.Jb(c,olympe.dm.Property.typeRel):(c=a.db.Jb(a,olympe.sc.logic.pb.j))&&(b=a.db.Jb(c,olympe.sc.logic.Ub.typeRel));return b||olympe.dc.fa(olympe.dc.CloudObject)}
1126
+ olympe.sc.logic.pb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.G=c}j(a,b,c){const d=olympe.sc.jj(c);null==b||b.lg();b&&d instanceof olympe.dm.De?null==b||b.run(()=>{olympe.C.Sc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.Pf(olympe.sc.logic.pb.valueProp,a||olympe.dc.mb.jj,Object)}getType(){const a=this.transform(olympe.sc.logic.pb.j,olympe.sc.logic.Ub.typeRel);a.Md(olympe.dc.CloudObject);return a.Gc()}wy(){return this.Pc(olympe.sc.logic.pb.N,olympe.dc.CloudObject)}uy(){return this.Pc(olympe.sc.logic.pb.R,
1127
+ olympe.sc.logic.Gb)}vy(){return this.Pc(olympe.sc.logic.pb.H,olympe.dm.Property)}Ox(){return this.Pc(olympe.sc.logic.pb.F,olympe.dc.CloudObject)}Mx(){return this.Pc(olympe.sc.logic.pb.j,olympe.sc.logic.vb)}Nx(){return this.Pc(olympe.sc.logic.pb.D,olympe.dm.Property)}};olympe.sc.logic.pb.O=olympe.dc.na.j('0168a431d91f25780000',olympe.sc.logic.pb,olympe.sc.P.Ca);olympe.sc.logic.pb.valueProp=olympe.sc.logic.pb.O.ka('0168a431d91f25780001');olympe.sc.logic.pb.N=olympe.sc.logic.pb.O.sa('0168a431d91f25780002');
1128
+ olympe.sc.logic.pb.R=R(olympe.sc.logic.pb.O,olympe.sc.logic.Gb.D);olympe.sc.logic.pb.H=olympe.sc.logic.pb.O.sa('0168a431d91f25780004');olympe.sc.logic.pb.F=olympe.sc.logic.pb.O.sa('0168a431d91f2578000a');olympe.sc.logic.pb.j=R(olympe.sc.logic.pb.O,olympe.sc.logic.vb.D);olympe.sc.logic.pb.D=olympe.sc.logic.pb.O.sa('0168a431d91f2578000c');R(olympe.dc.CloudObject.O,olympe.sc.logic.pb.N);R(olympe.dm.Property.O,olympe.sc.logic.pb.H);R(olympe.dc.CloudObject.O,olympe.sc.logic.pb.F);
1129
+ R(olympe.dm.Property.O,olympe.sc.logic.pb.D);m=olympe.sc.logic.pb.prototype;m.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.wy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.uy.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.vy.K=new olympe.C.J(()=>olympe.dm.Property,[]);m.Ox.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Mx.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Nx.K=new olympe.C.J(()=>olympe.dm.Property,[]);function Nn(a,b){const c=a.rd(),d=c.Yl().X(),e=c.Zl().X(),f=c.$l().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.ub.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=Qm(k.message,k.code,k.ne()+'\n===== Remote Call =====\n'+b.ne()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Wb().name()}" (${a.tag}) encountered an error:\n${k}`;a.G.error(k);b.throw(olympe.sc.logic.Error.create(k,
1130
1130
  400))})}},b.T())}
1131
- function On(a,b,c,d,e,f){const g=n=>w(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.vd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Vb().name()} (${a.bc()}): ${r}`);f.Xh(t).catch(u=>{a.G.error(`Cannot reply with an error to a remote action call ${a.Vb().name()} (${a.bc()}): ${u}`)})}finally{b.destroy()}}}),h=b.T(),k=b.on(c,g,h),l=b.on(d,g,h)}
1132
- olympe.sc.logic.Hh=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Pa(olympe.sc.ya.j.EDITION))&&b||(this.db.Qa(this,olympe.sc.logic.Hh.D)?(dn(a.j,this),this.fa(a)):(tn(this,a),Nn(this,a)))}fa(a){const b=this.bc(),c=this.rd(),d=c.Hp().X(),e=c.Sl().X(),f=c.Tl().X(),g=c.Ul().X();(new olympe.L.ub(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Uh('remote call'),l=h.body(),n=wc(()=>{h.Xh(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
1133
- k.destroy()},this.timeout);On(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.ii().then(p=>{var q=k.get(d);null!==q&&olympe.dc.ha(q)!==p&&(q=this.bc(),this.G.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,l.get(e))}).catch(p=>{const q=this.bc();this.G.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Error.create('Unrecognized User',
1134
- 1))})},h=>{const k=this.bc();this.G.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Hh.O=olympe.dc.na.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.Hh,olympe.sc.P.Ca,new olympe.W.pa(olympe.sc.U.Eq));olympe.sc.logic.Hh.D=olympe.sc.logic.Hh.O.ka('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Pl=class{constructor(a){this.db=olympe.dc.ia();this.typeRel=a}};olympe.sc.logic.controllers.Pl.j={cA:-1,cB:1};olympe.sc.logic.controllers.VB=class extends olympe.sc.logic.controllers.Pl{constructor(){super(olympe.sc.logic.md.j)}};olympe.sc.logic.controllers.dC=class extends olympe.sc.logic.controllers.Pl{constructor(){super(olympe.sc.logic.Sb.typeRel)}};olympe.sc.logic.Gk={};olympe.sc.logic.Gk.Tv=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ha(b);d?olympe.dc.ma.Nb(a,d,olympe.dc.Lb.bg).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.Gk.Tv);olympe.sc.logic.actions={};olympe.sc.logic.Gk.Lu=class extends olympe.sc.logic.Function{run(a){tn(this,a);const [b,c,d]=xn(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.af(f)),f++,c(Date.now())):(fn(h.j),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.jg();f=0;en(h.j);k();break;case 2:k();break;default:this.G.error('Unhandled input')}},this.tag))}};
1135
- olympe.sc.logic.na.j('0171889b060b6cd54300',olympe.sc.logic.Gk.Lu);olympe.sc.logic.Pb={};olympe.sc.logic.Pb.Fl=class extends olympe.sc.logic.xd{R(){return this.j('016ac638085357047a2d')}};olympe.sc.logic.Pb.Fl.O=Jn('0169b6876a03f14ae61b',olympe.sc.logic.Pb.Fl);olympe.sc.logic.Pb.Fl.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);let Pn=null;olympe.sc.logic.Pb.Ql=class extends olympe.sc.logic.xd{R(){return this.j('016ac63808535703691c')}F(a){if(null===Pn){let b;Pn=null!=(b=olympe.W.getParameter('sc.event.experimental'))?b:!1}return Pn?a.observe(qn(this)[0]):super.F(a)}};olympe.sc.logic.Pb.Ql.O=Jn('0169b6876a03f139d50a',olympe.sc.logic.Pb.Ql);olympe.sc.logic.Pb.Ql.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Pb.gm=class extends olympe.sc.logic.xd{R(){return this.j('016ac63809a9a8e6db96')}$(){return this.D('016ac6380ab003363b3e')}};Jn('01646ad602f933b8caaf',olympe.sc.logic.Pb.gm);olympe.sc.logic.Pb.gm.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Pb.gm.prototype.$.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Pb.$j=class extends olympe.sc.logic.xd{R(){return this.j('016ac6380bd98f1d91a0')}ba(){return this.D('016ac63c589ae38ca3ae')}$(){return this.D('016ac63c5a377fceabaa')}};Jn('0168ec42fc01747a98b6',olympe.sc.logic.Pb.$j);olympe.sc.logic.Pb.$j.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Pb.$j.prototype.ba.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Pb.$j.prototype.$.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Pb.Kg=class extends olympe.sc.logic.xd{Sl(){return this.j('017a7b07b09e3b22c8b4')}Hp(){return this.j('017a7b07ba05807a74b0')}Tl(){return this.D('017a7b0818c12388d731')}Ul(){return this.D('017a7b085146d5e69aec')}uu(){return olympe.C.ea.D}};olympe.sc.logic.Pb.Kg.J='017a7b07b09e3b22c8b4';olympe.sc.logic.Pb.Kg.Ub='017a7b07ba05807a74b0';olympe.sc.logic.Pb.Kg.fa='017a7b0818c12388d731';olympe.sc.logic.Pb.Kg.j='017a7b085146d5e69aec';
1136
- olympe.sc.logic.Pb.Kg.O=Jn('017a7b07a948e30508fa',olympe.sc.logic.Pb.Kg,olympe.sc.logic.Hh);m=olympe.sc.logic.Pb.Kg.prototype;m.Sl.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);m.Hp.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);m.Tl.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);m.Ul.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);m.uu.K=olympe.C.H.N;olympe.sc.logic.Pb.fr=class extends olympe.sc.logic.xd{R(){return this.j('016ac63c5b3ed0562740')}};Jn('016a9766c230916ea5ec',olympe.sc.logic.Pb.fr);olympe.sc.logic.Pb.fr.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.query={};olympe.sc.query.On=class extends olympe.sc.Dg{};olympe.sc.query.On.O=olympe.dc.na.j('01631aacd8276ea98491',olympe.sc.query.On);olympe.sc.query.nq=class extends olympe.dm.Enum{};olympe.sc.query.nq.O=olympe.dc.na.j('01631aacd8276ea98495',olympe.sc.query.nq);olympe.sc.query.xq=class extends olympe.dm.Enum{};olympe.sc.query.xq.O=olympe.dc.na.j('01631aacd8276ea98494',olympe.sc.query.xq);olympe.sc.query.Aq=class extends olympe.sc.Dg{};olympe.sc.query.Aq.O=olympe.dc.na.j('01631aacd8276ea98492',olympe.sc.query.Aq);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.po=class extends olympe.dc.CloudObject{};olympe.sc.po.O=olympe.dc.na.j('018312ceeb3e93618a85',olympe.sc.po);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');
1137
- 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.vf=class extends olympe.sc.logic.xd{vu(){return this.j('017ffe02381f9fac5060')}yu(){return this.j('017ffe02381f9fac5061')}zu(){return this.j('017ffe02381f9fac5062')}Ax(){return this.j('017ffe02381f9fac5065')}wu(){return this.D('017ffe02381f9fac5063')}xu(){return this.D('017ffe02381f9fac5064')}};olympe.sc.workflow.vf.O=Jn('017ffde21f5fe0f704ce',olympe.sc.workflow.vf);olympe.sc.workflow.vf.j='017ffe02381f9fac5060';olympe.sc.workflow.vf.Vd='017ffe02381f9fac5061';
1138
- olympe.sc.workflow.vf.Wd='017ffe02381f9fac5062';olympe.sc.workflow.vf.fa='017ffe02381f9fac5065';olympe.sc.workflow.vf.J='017ffe02381f9fac5063';olympe.sc.workflow.vf.Ub='017ffe02381f9fac5064';m=olympe.sc.workflow.vf.prototype;m.vu.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);m.yu.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);m.zu.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);m.Ax.K=new olympe.C.H(()=>Map,[]);m.wu.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);m.xu.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.workflow.Ve=class extends olympe.dm.BrickMetadata{Uc(){return this.Qc(olympe.sc.workflow.Workflow.statesRel.ac(),olympe.sc.workflow.Workflow).la().concat(['.',this.la()])}};olympe.sc.workflow.Ve.O=olympe.dc.na.j('017ffdc2dda51d46b430',olympe.sc.workflow.Ve);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{D(){return this.ms()}j(){return this.Qc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Ve)}F(){return this.Qc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.Ve)}Uc(){const a=this.Qc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Ve);return a.Qc(olympe.sc.workflow.Workflow.statesRel.ac(),olympe.sc.workflow.Workflow).la().concat(['.',a.la(),'->',this.la()])}};
1139
- 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.H(()=>olympe.dc.CloudObject,[]);
1140
- olympe.sc.workflow.Transition.prototype.j.K=new olympe.C.H(()=>olympe.sc.workflow.Ve,[]);olympe.sc.workflow.Transition.prototype.F.K=new olympe.C.H(()=>olympe.sc.workflow.Ve,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{oe(){return olympe.sc.qe.Ge.nh}F(){return this.Zg(olympe.sc.workflow.Workflow.serializationEnabledProp)}j(){return this.Qc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.yc)}D(){return this.Qc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.Ve)}};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');
1141
- 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.H.N;olympe.sc.workflow.Workflow.prototype.j.K=new olympe.C.H(()=>olympe.sc.yc,[]);
1142
- olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.H(()=>olympe.sc.workflow.Ve,[]);olympe.sc.qa={};olympe.sc.qa.Xc=class extends olympe.sc.Ua{oe(){return olympe.sc.qe.Ge.Dv}};olympe.sc.qa.Xc.O=olympe.dc.na.j('01120300000000adef00',olympe.sc.qa.Xc);olympe.sc.qa.Xc.j=olympe.sc.qa.Xc.O.sa('0171bc1f15da96dfdb89');olympe.sc.qa.Xc.fa=olympe.sc.qa.Xc.O.sa('0171bc1f15da96dfdb90');R(olympe.dm.Nc.O,olympe.sc.qa.Xc.j);olympe.sc.qa.li=class extends olympe.sc.Runnable{F(){return[this.bc()]}fa(){return olympe.dc.nd.from(this.bc()).gb(olympe.sc.qa.Xc.j).Fc()}};olympe.sc.qa.li.O=Of(olympe.dc.na.j('0113030000000aca1100',olympe.sc.qa.li));olympe.sc.qa.li.prototype.fa.K=new olympe.C.H(()=>olympe.dm.jb,[]);olympe.sc.qa.lb=class extends olympe.dc.CloudObject{Bu(){return this.Zg(olympe.sc.qa.lb.Rh)}Py(){return this.Zg(olympe.sc.qa.lb.fa)}Hc(){return this.sd(olympe.sc.qa.lb.j)}Gx(){return this.wb(olympe.sc.qa.lb.J)}ay(){return this.wb(olympe.sc.qa.lb.ba)}$x(){return this.wb(olympe.sc.qa.lb.Y)}If(){return this.wb(olympe.sc.qa.lb.$)}Qx(){return this.wb(olympe.sc.qa.lb.N)}ox(){return this.wb(olympe.sc.qa.lb.D)}Zx(){return this.wb(olympe.sc.qa.lb.R)}Au(){return this.wb(olympe.sc.qa.lb.F)}};
1143
- olympe.sc.qa.lb.O=olympe.dc.na.j('011203300000000adef5',olympe.sc.qa.lb);olympe.sc.qa.lb.Rh=olympe.sc.qa.lb.O.ka('011203300000000adef6');olympe.sc.qa.lb.fa=olympe.sc.qa.lb.O.ka('011203300000000adef7');olympe.sc.qa.lb.j=olympe.sc.qa.lb.O.ka('011203300000000adef8');olympe.sc.qa.lb.J=olympe.sc.qa.lb.O.ka('011203300000000adef9');olympe.sc.qa.lb.ba=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');
1144
- 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,Qz:1,qk:2,pk:3,um:4,xC:5,zb:9};m=olympe.sc.qa.lb.prototype;m.Bu.K=olympe.C.H.N;m.Py.K=olympe.C.H.N;m.Hc.K=olympe.C.H.F;m.Gx.K=olympe.C.H.D;m.ay.K=olympe.C.H.D;m.$x.K=olympe.C.H.D;m.If.K=olympe.C.H.D;m.Qx.K=olympe.C.H.D;
1145
- m.ox.K=olympe.C.H.D;m.Zx.K=olympe.C.H.D;m.Au.K=olympe.C.H.D;olympe.sc.qa.Nl=class extends olympe.sc.qa.li{D(a){a.set(olympe.sc.ya.j.En,!0);super.D(a)}ba(){return!0}};olympe.sc.qa.Nl.O=olympe.dc.na.j('0113032000000aca1102',olympe.sc.qa.Nl,olympe.sc.P.Ca);olympe.sc.qa.Ue=class extends olympe.sc.qa.Xc{j(){return(new olympe.dc.Wj(this.X(),olympe.sc.qa.lb)).gb(olympe.sc.qa.Ue.J).Fi().Gc()}};olympe.sc.qa.Ue.O=olympe.dc.na.j('011203300000000adef3',olympe.sc.qa.Ue);olympe.sc.qa.Ue.J=olympe.sc.qa.Ue.O.sa('011203300000000adef4');R(olympe.sc.qa.lb.O,olympe.sc.qa.Ue.J);
1146
- olympe.sc.qa.Ue.O.j=(a,b,c)=>{b=Cl(a,b||'New Service Application model',olympe.sc.qa.Ue,olympe.sc.qa.Nl);a.Oa(olympe.sc.qa.Xc.j,b,c);c=a.create(olympe.sc.qa.lb).X();a.Oa(olympe.sc.qa.Ue.J,b,c);return b.X()};olympe.sc.qa.Ue.prototype.j.K=new olympe.C.H(()=>olympe.sc.qa.lb,[]);olympe.sc.Qg=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.Qg.O=olympe.dc.na.j('011203300000000adf00',olympe.sc.Qg);olympe.sc.Qg.D=olympe.sc.Qg.O.ka('011203300000000adf01');olympe.sc.Qg.j=olympe.sc.Qg.O.ka('011203300000000adf02');olympe.sc.Qg.F='011203300000000adf0f';olympe.sc.ng={};olympe.sc.ng.Fy=a=>{var b=a.j;const c=olympe.dc.ia();var d=null;var e=null===Dn;for(const f of b.dd())if((b=f.Vb())&&f.D()&&f.sb()===olympe.dc.Ka.SERVER&&Z(a,f.tag())&&c.Qb(b,olympe.sc.yc)){if(!e)throw new olympe.dc.cq;let g,h;null==d&&(d=null,null!==Cn?d=Cn:'string'===typeof Bn&&(d=olympe.dc.nd.from(Bn).gb(olympe.sc.qa.Xc.j).gb(olympe.sc.hf.j.ac()).Fc()),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.ha(b)}`);a.Oa(olympe.sc.hf.D.X(),
1131
+ function On(a,b,c,d,e,f){const g=n=>w(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.vd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Wb().name()} (${a.ac()}): ${r}`);f.bi(t).catch(u=>{a.G.error(`Cannot reply with an error to a remote action call ${a.Wb().name()} (${a.ac()}): ${u}`)})}finally{b.destroy()}}}),h=b.T(),k=b.on(c,g,h),l=b.on(d,g,h)}
1132
+ olympe.sc.logic.Lh=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Pa(olympe.sc.ya.j.EDITION))&&b||(this.db.Qa(this,olympe.sc.logic.Lh.D)?(dn(a.j,this),this.ha(a)):(tn(this,a),Nn(this,a)))}ha(a){const b=this.ac(),c=this.rd(),d=c.Op().X(),e=c.Yl().X(),f=c.Zl().X(),g=c.$l().X();(new olympe.L.ub(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Yh('remote call'),l=h.body(),n=wc(()=>{h.bi(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
1133
+ k.destroy()},this.timeout);On(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.ni().then(p=>{var q=k.get(d);null!==q&&olympe.dc.fa(q)!==p&&(q=this.ac(),this.G.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,l.get(e))}).catch(p=>{const q=this.ac();this.G.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Error.create('Unrecognized User',
1134
+ 1))})},h=>{const k=this.ac();this.G.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Lh.O=olympe.dc.na.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.Lh,olympe.sc.P.Ca,new olympe.W.pa(olympe.sc.U.Lq));olympe.sc.logic.Lh.D=olympe.sc.logic.Lh.O.ka('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Vl=class{constructor(a){this.db=olympe.dc.ia();this.typeRel=a}};olympe.sc.logic.controllers.Vl.j={mA:-1,mB:1};olympe.sc.logic.controllers.dC=class extends olympe.sc.logic.controllers.Vl{constructor(){super(olympe.sc.logic.md.j)}};olympe.sc.logic.controllers.lC=class extends olympe.sc.logic.controllers.Vl{constructor(){super(olympe.sc.logic.Ub.typeRel)}};olympe.sc.logic.Nk={};olympe.sc.logic.Nk.cw=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.Lb.fg).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.Nk.cw);olympe.sc.logic.actions={};olympe.sc.logic.Nk.Uu=class extends olympe.sc.logic.Function{run(a){tn(this,a);const [b,c,d]=xn(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.ff(f)),f++,c(Date.now())):(fn(h.j),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.og();f=0;en(h.j);k();break;case 2:k();break;default:this.G.error('Unhandled input')}},this.tag))}};
1135
+ olympe.sc.logic.na.j('0171889b060b6cd54300',olympe.sc.logic.Nk.Uu);olympe.sc.logic.Rb={};olympe.sc.logic.Rb.Ll=class extends olympe.sc.logic.xd{R(){return this.j('016ac638085357047a2d')}};olympe.sc.logic.Rb.Ll.O=Jn('0169b6876a03f14ae61b',olympe.sc.logic.Rb.Ll);olympe.sc.logic.Rb.Ll.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);let Pn=null;olympe.sc.logic.Rb.Wl=class extends olympe.sc.logic.xd{R(){return this.j('016ac63808535703691c')}F(a){if(null===Pn){let b;Pn=null!=(b=olympe.W.getParameter('sc.event.experimental'))?b:!1}return Pn?a.observe(qn(this)[0]):super.F(a)}};olympe.sc.logic.Rb.Wl.O=Jn('0169b6876a03f139d50a',olympe.sc.logic.Rb.Wl);olympe.sc.logic.Rb.Wl.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.nm=class extends olympe.sc.logic.xd{R(){return this.j('016ac63809a9a8e6db96')}$(){return this.D('016ac6380ab003363b3e')}};Jn('01646ad602f933b8caaf',olympe.sc.logic.Rb.nm);olympe.sc.logic.Rb.nm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.nm.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.gk=class extends olympe.sc.logic.xd{R(){return this.j('016ac6380bd98f1d91a0')}da(){return this.D('016ac63c589ae38ca3ae')}$(){return this.D('016ac63c5a377fceabaa')}};Jn('0168ec42fc01747a98b6',olympe.sc.logic.Rb.gk);olympe.sc.logic.Rb.gk.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.gk.prototype.da.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.gk.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.Og=class extends olympe.sc.logic.xd{Yl(){return this.j('017a7b07b09e3b22c8b4')}Op(){return this.j('017a7b07ba05807a74b0')}Zl(){return this.D('017a7b0818c12388d731')}$l(){return this.D('017a7b085146d5e69aec')}Du(){return olympe.C.ea.D}};olympe.sc.logic.Rb.Og.H='017a7b07b09e3b22c8b4';olympe.sc.logic.Rb.Og.vc='017a7b07ba05807a74b0';olympe.sc.logic.Rb.Og.ha='017a7b0818c12388d731';olympe.sc.logic.Rb.Og.j='017a7b085146d5e69aec';
1136
+ olympe.sc.logic.Rb.Og.O=Jn('017a7b07a948e30508fa',olympe.sc.logic.Rb.Og,olympe.sc.logic.Lh);m=olympe.sc.logic.Rb.Og.prototype;m.Yl.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Op.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Zl.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.$l.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.Du.K=olympe.C.J.N;olympe.sc.logic.Rb.mr=class extends olympe.sc.logic.xd{R(){return this.j('016ac63c5b3ed0562740')}};Jn('016a9766c230916ea5ec',olympe.sc.logic.Rb.mr);olympe.sc.logic.Rb.mr.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.query={};olympe.sc.query.Un=class extends olympe.sc.Hg{};olympe.sc.query.Un.O=olympe.dc.na.j('01631aacd8276ea98491',olympe.sc.query.Un);olympe.sc.query.uq=class extends olympe.dm.Enum{};olympe.sc.query.uq.O=olympe.dc.na.j('01631aacd8276ea98495',olympe.sc.query.uq);olympe.sc.query.Eq=class extends olympe.dm.Enum{};olympe.sc.query.Eq.O=olympe.dc.na.j('01631aacd8276ea98494',olympe.sc.query.Eq);olympe.sc.query.Hq=class extends olympe.sc.Hg{};olympe.sc.query.Hq.O=olympe.dc.na.j('01631aacd8276ea98492',olympe.sc.query.Hq);olympe.sc.query.nc=class extends olympe.dc.CloudObject{};olympe.sc.query.nc.O=olympe.dc.na.j('01631aacd8276ea98493',olympe.sc.query.nc);olympe.sc.wo=class extends olympe.dc.CloudObject{};olympe.sc.wo.O=olympe.dc.na.j('018312ceeb3e93618a85',olympe.sc.wo);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.O=olympe.dc.na.j('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.O.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');
1137
+ 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.zf=class extends olympe.sc.logic.xd{Eu(){return this.j('017ffe02381f9fac5060')}Hu(){return this.j('017ffe02381f9fac5061')}Iu(){return this.j('017ffe02381f9fac5062')}Kx(){return this.j('017ffe02381f9fac5065')}Fu(){return this.D('017ffe02381f9fac5063')}Gu(){return this.D('017ffe02381f9fac5064')}};olympe.sc.workflow.zf.O=Jn('017ffde21f5fe0f704ce',olympe.sc.workflow.zf);olympe.sc.workflow.zf.j='017ffe02381f9fac5060';olympe.sc.workflow.zf.$e='017ffe02381f9fac5061';
1138
+ olympe.sc.workflow.zf.af='017ffe02381f9fac5062';olympe.sc.workflow.zf.ha='017ffe02381f9fac5065';olympe.sc.workflow.zf.H='017ffe02381f9fac5063';olympe.sc.workflow.zf.vc='017ffe02381f9fac5064';m=olympe.sc.workflow.zf.prototype;m.Eu.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Hu.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Iu.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Kx.K=new olympe.C.J(()=>Map,[]);m.Fu.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.Gu.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.workflow.Ye=class extends olympe.dm.BrickMetadata{Uc(){return this.Pc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).la().concat(['.',this.la()])}};olympe.sc.workflow.Ye.O=olympe.dc.na.j('017ffdc2dda51d46b430',olympe.sc.workflow.Ye);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{D(){return this.vs()}j(){return this.Pc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Ye)}F(){return this.Pc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.Ye)}Uc(){const a=this.Pc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Ye);return a.Pc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).la().concat(['.',a.la(),'->',this.la()])}};
1139
+ 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,[]);
1140
+ olympe.sc.workflow.Transition.prototype.j.K=new olympe.C.J(()=>olympe.sc.workflow.Ye,[]);olympe.sc.workflow.Transition.prototype.F.K=new olympe.C.J(()=>olympe.sc.workflow.Ye,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.rh}F(){return this.dh(olympe.sc.workflow.Workflow.serializationEnabledProp)}j(){return this.Pc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.yc)}D(){return this.Pc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.Ye)}};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');
1141
+ 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.yc,[]);
1142
+ olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.J(()=>olympe.sc.workflow.Ye,[]);olympe.sc.qa={};olympe.sc.qa.Xc=class extends olympe.sc.Ua{qe(){return olympe.sc.se.Ie.Nv}};olympe.sc.qa.Xc.O=olympe.dc.na.j('01120300000000adef00',olympe.sc.qa.Xc);olympe.sc.qa.Xc.j=olympe.sc.qa.Xc.O.sa('0171bc1f15da96dfdb89');olympe.sc.qa.Xc.ha=olympe.sc.qa.Xc.O.sa('0171bc1f15da96dfdb90');R(olympe.dm.Mc.O,olympe.sc.qa.Xc.j);olympe.sc.qa.si=class extends olympe.sc.Runnable{F(){return[this.ac()]}ha(){return olympe.dc.nd.from(this.ac()).fb(olympe.sc.qa.Xc.j).Fc()}};olympe.sc.qa.si.O=Of(olympe.dc.na.j('0113030000000aca1100',olympe.sc.qa.si));olympe.sc.qa.si.prototype.ha.K=new olympe.C.J(()=>olympe.dm.ib,[]);olympe.sc.qa.lb=class extends olympe.dc.CloudObject{Ku(){return this.dh(olympe.sc.qa.lb.Vh)}Zy(){return this.dh(olympe.sc.qa.lb.ha)}Hc(){return this.sd(olympe.sc.qa.lb.j)}Qx(){return this.wb(olympe.sc.qa.lb.H)}ny(){return this.wb(olympe.sc.qa.lb.da)}my(){return this.wb(olympe.sc.qa.lb.Y)}Lf(){return this.wb(olympe.sc.qa.lb.$)}$x(){return this.wb(olympe.sc.qa.lb.N)}zx(){return this.wb(olympe.sc.qa.lb.D)}ly(){return this.wb(olympe.sc.qa.lb.R)}Ju(){return this.wb(olympe.sc.qa.lb.F)}};
1143
+ olympe.sc.qa.lb.O=olympe.dc.na.j('011203300000000adef5',olympe.sc.qa.lb);olympe.sc.qa.lb.Vh=olympe.sc.qa.lb.O.ka('011203300000000adef6');olympe.sc.qa.lb.ha=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.da=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');
1144
+ 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.oc={INIT:0,$z:1,xk:2,wk:3,zm:4,FC:5,Ab:9};m=olympe.sc.qa.lb.prototype;m.Ku.K=olympe.C.J.N;m.Zy.K=olympe.C.J.N;m.Hc.K=olympe.C.J.F;m.Qx.K=olympe.C.J.D;m.ny.K=olympe.C.J.D;m.my.K=olympe.C.J.D;m.Lf.K=olympe.C.J.D;m.$x.K=olympe.C.J.D;
1145
+ m.zx.K=olympe.C.J.D;m.ly.K=olympe.C.J.D;m.Ju.K=olympe.C.J.D;olympe.sc.qa.Tl=class extends olympe.sc.qa.si{D(a){a.set(olympe.sc.ya.j.Kn,!0);super.D(a)}da(){return!0}};olympe.sc.qa.Tl.O=olympe.dc.na.j('0113032000000aca1102',olympe.sc.qa.Tl,olympe.sc.P.Ca);olympe.sc.qa.Xe=class extends olympe.sc.qa.Xc{j(){return(new olympe.dc.ck(this.X(),olympe.sc.qa.lb)).fb(olympe.sc.qa.Xe.H).Li().Gc()}};olympe.sc.qa.Xe.O=olympe.dc.na.j('011203300000000adef3',olympe.sc.qa.Xe);olympe.sc.qa.Xe.H=olympe.sc.qa.Xe.O.sa('011203300000000adef4');R(olympe.sc.qa.lb.O,olympe.sc.qa.Xe.H);
1146
+ olympe.sc.qa.Xe.O.j=(a,b,c)=>{b=Bl(a,b||'New Service Application model',olympe.sc.qa.Xe,olympe.sc.qa.Tl);a.Oa(olympe.sc.qa.Xc.j,b,c);c=a.create(olympe.sc.qa.lb).X();a.Oa(olympe.sc.qa.Xe.H,b,c);return b.X()};olympe.sc.qa.Xe.prototype.j.K=new olympe.C.J(()=>olympe.sc.qa.lb,[]);olympe.sc.Ug=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.Ug.O=olympe.dc.na.j('011203300000000adf00',olympe.sc.Ug);olympe.sc.Ug.D=olympe.sc.Ug.O.ka('011203300000000adf01');olympe.sc.Ug.j=olympe.sc.Ug.O.ka('011203300000000adf02');olympe.sc.Ug.F='011203300000000adf0f';olympe.sc.sg={};olympe.sc.sg.Py=a=>{var b=a.j;const c=olympe.dc.ia();var d=null;var e=null===Dn;for(const f of b.Rc())if((b=f.Wb())&&f.D()&&f.sb()===olympe.dc.Ja.SERVER&&Z(a,f.tag())&&c.Ob(b,olympe.sc.yc)){if(!e)throw new olympe.dc.kq;let g,h;null==d&&(d=null,null!==Cn?d=Cn:'string'===typeof Bn&&(d=olympe.dc.nd.from(Bn).fb(olympe.sc.qa.Xc.j).fb(olympe.sc.mf.j.$b()).Fc()),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.Oa(olympe.sc.mf.D.X(),
1147
1147
  d,f.tag())}};
1148
- olympe.sc.ng.Ry=a=>{const b=a.j,c=olympe.dc.ia();for(const d of b.dd()){const e=d.Vb();e&&!d.Ed()&&c.Qb(e,olympe.sc.yc)&&d.Cb().forEach((f,g)=>{if(f instanceof olympe.dc.vc){const l=b.Rc(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.ha(olympe.sc.Od)){h=l.Jb(olympe.sc.Od.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
1149
- let p;f=null!=(p=null==(k=b.Rc(h))?void 0:k.Vb())?p:c.model(h)}if(c.Nf(f,olympe.dm.Be)){k=Lm(f);let p;n=null!=(p=l.Qa(k.X()))?p:c.Qa(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.Wc(d.tag(),new Map([[g,n]]));wl(a,l.tag(),olympe.dc.Lb.Cc)}})}};
1150
- olympe.sc.ng.Lw=a=>{const b=a.j,c=olympe.dc.ia(),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.Kc()&&(d.has(g)||c.Qb(g,olympe.sc.yc))){d.add(g);const h=Array.from(e.fa()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.hc.Yc?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Rc(k))?void 0:l.Vb())?n:c.model(k);return!p||!(d.has(p)||c.Qb(p,olympe.sc.yc))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Rc(h))?void 0:k.Vb())?l:c.model(h))?
1151
- 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.ng.fz=a=>{var b=a.j;const c=olympe.dc.ia();for(const d of b.dd()){b=d.tag();const e=d.Vb();if(e&&!c.Qb(e,olympe.sc.yc)&&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`);}};
1152
- olympe.W.run([olympe.dc.transaction.P.Da],a=>{Il(Il(Il(a,olympe.sc.ng.Lw,'businessDataRelations'),olympe.sc.ng.Fy,'linkBusinessContainer'),olympe.sc.ng.Ry,'noBusinessComplexProperty')});olympe.sc.Hj=class extends olympe.dm.BrickMetadata{oe(){return olympe.sc.qe.Ge.nh}};olympe.sc.Hj.O=olympe.dc.na.j('01645fe6873aeea59e64',olympe.sc.Hj);olympe.sc.Hj.j=olympe.sc.Hj.O.sa('017ed8ac775f48d4d589');olympe.sc.mo=class extends olympe.dm.Kb{oe(){return olympe.sc.qe.Ge.nh}};olympe.sc.mo.O=olympe.dc.na.j('0163a68ce44f3d1fa95d',olympe.sc.mo);olympe.sc.lh=class extends olympe.dm.BrickMetadata{};olympe.sc.lh.O=olympe.dc.na.j('016324fde11a836f77d3',olympe.sc.lh);olympe.sc.lh.j=olympe.sc.yc.O.sa('016324fde11a836088d3');olympe.sc.lh.O.j=(a,b)=>Cl(a,null!=b?b:'New config type',olympe.sc.lh).X();olympe.sc.Zz=class{};olympe.sc.Lj=class extends olympe.dm.BrickMetadata{oe(){return olympe.sc.qe.Ge.nh}};olympe.sc.Lj.O=olympe.dc.na.j('017dc8d6c8fd8c8bd2ff',olympe.sc.Lj);olympe.sc.Lj.O.j=(a,b)=>Cl(a,null!=b?b:'New data connector',olympe.sc.Lj,olympe.dm.DataSource).X();olympe.sc.se=class extends olympe.sc.Runnable{ua(){return this.bb(olympe.sc.se.F,olympe.sc.Runnable)}fa(){return this.bb(olympe.sc.se.D,olympe.dm.Property)}};olympe.sc.se.O=Of(olympe.dc.na.j('016c2d996d9ca27fa9d8',olympe.sc.se));olympe.sc.se.F=olympe.sc.se.O.sa('016c3cb7742ec9309e0b');olympe.sc.se.D=olympe.sc.se.O.sa('016c42d3454636f90533');olympe.sc.se.prototype.ua.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.sc.se.prototype.fa.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.sc.Mo=class extends olympe.dm.Kb{oe(){return olympe.sc.qe.Ge.nh}};olympe.sc.Mo.O=olympe.dc.na.j('017a7a9ff057958e5678',olympe.sc.Mo);olympe.sc.vi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ia();e=void 0!==e?e:f.Ha(b)&&f.dd(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.vi.create=olympe.sc.vi.create;olympe.sc.vi.O=olympe.dc.na.j('016cdd861b32d56c8208',olympe.sc.vi);olympe.sc.Qp=class extends olympe.dm.Kb{oe(){return olympe.sc.qe.Ge.cw}};olympe.sc.Qp.O=olympe.dc.na.j('01644b6d4543b344b857',olympe.sc.Qp);olympe.sc.Rp=class extends olympe.dc.CloudObject{};olympe.sc.Rp.O=olympe.dc.na.j('0162f672366be5ca7a86',olympe.sc.Rp);const Qn={Lo:30};olympe.sc.ec=class extends olympe.dc.sources.ec{D(a){return a instanceof olympe.sc.logic.Error?this.format(Qn.Lo,{c:a.code,m:a.message,s:a.le()}):super.D(a)}j(a){return(null==a?void 0:a.t)===Qn.Lo?(a=a.v,Qm(a.m,a.c,a.s)):super.j(a)}J(a){super.J(a);if(this.db.model(a)===olympe.sc.Od.O.X()){const b=olympe.sc.Od.j;this.F.get(a).r.push({r:b.X(),o:a,d:this.db.Jb(a,b)})}return a}};olympe.sc.gr=class extends olympe.sc.se{};olympe.sc.gr.O=olympe.dc.na.j('016d3f37610ae4fc3962',olympe.sc.gr);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.na.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Wa=class{constructor(a=!0){a=Al(a);a.N=!0;var b=olympe.sc.ng.fz;let c;(null==(c=olympe.W.getParameter(olympe.dc.transaction.U.Cl))?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.Wa}static process(a,b){return a.has(olympe.sc.ya.j.TRANSACTION,!0)?Promise.resolve(!1):b.nb().then(()=>!0)}T(){return this.j.T()}create(a,b=new Map,c=this.source,d){c='string'===
1153
- typeof c?c:olympe.dc.$d().fromModel(a);a=this.j.create(a,d).gi(c);for(const [e,f]of b)Y(a,e,f);b=a.X();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}ys(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Gd.set(olympe.dc.ha(c),b);return this}delete(a){this.j.delete(a);return this}Oa(a,b,c){this.j.Oa(a,b,c);return this}ic(a,b,c){this.j.ic(a,b,c);return this}Um(a,b){this.j.Um(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}ez(a,b=!0){olympe.ja.ab('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');
1154
- return this.persist(a,b)}gi(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){Bl(this.j,a.j);return this}Mm(a){this.j.Mm(a);return this}nb(){return new Promise((a,b)=>{this.j.nb((c,d)=>{c?a(new olympe.sc.Wi(this.D)):b(d)})})}Vm(){return new Promise((a,b)=>{this.j.Vm((c,d)=>{c?a(new olympe.sc.Wi(this.D)):b(d)})})}};olympe.sc.Wa.prototype.executeAsLarge=olympe.sc.Wa.prototype.Vm;olympe.sc.Wa.prototype.execute=olympe.sc.Wa.prototype.nb;olympe.sc.Wa.prototype.afterExecution=olympe.sc.Wa.prototype.Mm;
1155
- olympe.sc.Wa.prototype.merge=olympe.sc.Wa.prototype.merge;olympe.sc.Wa.prototype.model=olympe.sc.Wa.prototype.model;olympe.sc.Wa.prototype.setSource=olympe.sc.Wa.prototype.gi;olympe.sc.Wa.prototype.persistInstance=olympe.sc.Wa.prototype.ez;olympe.sc.Wa.prototype.persist=olympe.sc.Wa.prototype.persist;olympe.sc.Wa.prototype.deleteAllRelations=olympe.sc.Wa.prototype.Um;olympe.sc.Wa.prototype.deleteRelation=olympe.sc.Wa.prototype.ic;olympe.sc.Wa.prototype.createRelation=olympe.sc.Wa.prototype.Oa;
1156
- olympe.sc.Wa.prototype['delete']=olympe.sc.Wa.prototype.delete;olympe.sc.Wa.prototype.multiUpdate=olympe.sc.Wa.prototype.ys;olympe.sc.Wa.prototype.update=olympe.sc.Wa.prototype.update;olympe.sc.Wa.prototype.create=olympe.sc.Wa.prototype.create;olympe.sc.Wa.prototype.getId=olympe.sc.Wa.prototype.T;olympe.sc.Wa.process=olympe.sc.Wa.process;olympe.sc.Wa.from=olympe.sc.Wa.from;olympe.sc.Wi=class{constructor(a){this.j=a}xx(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.Wi.prototype.getCreatedObjects=olympe.sc.Wi.prototype.xx;olympe.xc={};olympe.xc.Ts=class{run(){}};function Rn(a,b='default'){return a.j===b}
1157
- olympe.xc.Ta=class{constructor(a,b){this.j=a;this.G=b;this.D=null;this.F='';this.G.info('HC Manager will execute application registered as:',this.j)}tj(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),
1158
- this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.xc.tj=function(a,b,c='default'){const d=a.ab();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.xc.U.Me+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.rd(olympe.xc.P.Da).config(c,[b],(e,f)=>f.tj(e,c,b),e=>Rn(e,c),'olympe.hc.registerApp')};olympe.xc.P={Da:'hc.Manager',Ca:'hc.Logger'};olympe.xc.U={Me:'hc.app',ep:'hc.globalToken'};olympe.W.config(function(a){F(a,olympe.xc.U.Me,'default');F(a,olympe.xc.U.ep,!1);E(a,olympe.xc.P.Ca,[olympe.ja.P.Da],b=>b.cd('hc'));E(a,olympe.Db.P.Og,[new olympe.W.pa(olympe.xc.U.Me)],b=>b);E(a,olympe.auth.P.dl,[olympe.Db.P.Og,new olympe.W.pa(olympe.xc.U.ep)],(b,c)=>new olympe.auth.Nn(c?'':b));D(a,olympe.xc.P.Da,olympe.xc.Ta,new olympe.W.pa(olympe.xc.U.Me),olympe.xc.P.Ca)},'olympe.hc');
1159
- olympe.W.run([olympe.xc.P.Da],a=>a.run(),'olympe.hc');olympe.sc.Ib={};function Sn(a){a.Y=a.F.D(()=>w(function*(){return Tn(a)}),'Stop application')}function Un(a){a.R=a.F.j(()=>olympe.C.Pa(a.$)===olympe.C.ea.D?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.Ce.j.READINESS)}
1160
- function Vn(a){if(a.ua)return a.G.debug('Sending getContext request'),pi(a.Ga).then(()=>{a.G.debug('synchronisation request successful');var f=a.j;Dn=null;Bn=f}).catch(f=>{a.G.error('failed to synchronise (authenticated) with server: '+f.message)});const b=Om(a.D);!b&&Nk();a.G.debug((b?'PULLING':'SUBSCRIBING')+' application '+a.j);const c=a.D.D(),d=new Promise((f,g)=>{const h=olympe.dc.ia(),k=new olympe.C.Xb('Primordial Subscription Context',c);di(k,a.j,l=>{l=h.ei(l)?l:h.model(l);return null!==l&&
1161
- h.Qb(l,olympe.sc.lh)},{jd:Wn(b),xn:!0,rs:!0}).subscribe(rxjs.Subscriber.create(c.F(()=>{h.Qb(a.j,olympe.sc.qa.Xc)?(a.$a.Y(a.j,b),f()):id(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.Sc([a.fa.ne()],g=>{const h=Wn(b,!1);olympe.dc.ma.Ie(g,olympe.dm.User,olympe.dc.Ka.SERVER).observe(c,
1162
- {jd:h,Dk:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.ba)return Xn(a);Xn(a).then(()=>{})})}
1163
- function Yn(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ia();if(0<a.j.length){const c=sf(b,a.j,a.D.D().F((f,g)=>{if(f)if(f=sn(g),f instanceof olympe.sc.qa.li){a.G.debug('application retrieved: running');g=Mm(a.D,f);const h=new olympe.sc.Ya.pv(a.J);jb(a.J,()=>Ym(a.D.j,h));kb(a.J,()=>{var k=h.T();return $m(a.D.j,k)});a.fb&&a.J.start();f.run(g);'string'===typeof a.Bb&&(new olympe.sc.Ud).ba(f.X(),g,a.G);g.Ls(olympe.sc.ya.j.En).then(()=>{var k;null==(k=d)||k.cancel();a.$.update(olympe.C.ea.D);
1164
- a.G.info(`Application ${olympe.dc.ia().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.Yd();k.Eb=!0;k.Y+=0;k.$c.next(0<k.Y);0===k.Y&&k.$&&k.Eb&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.$a.set('__code-as-data-version__',k.version),k.Bb||(k.$=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else Tn(a)}));olympe.C.Xa().onDestroy(()=>{qf(b,a.j,c)});const d=wc(()=>{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)`)},
1165
- 3E4);let e;null==(e=a.Eb)||e.start()}}function Wn(a,b=!0){return a?olympe.dc.ma.oc.Fg:b?olympe.dc.ma.oc.lf:olympe.dc.ma.oc.ek}function Xn(a){return w(function*(){Zn(a.j)&&(yield En(a.j,a.ba).catch(b=>{throw Error(`Failed to load the business container for the application ${a.j}: ${b}`);}))})}function Tn(a){a.G.info('Stop the application');a.D.D().fa();a.F.F(a.R);a.F.N(a.Y)}
1166
- olympe.sc.Ib.tm=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.fa=b;this.N=c;this.Ga=d;this.F=e;this.Y=this.R='';this.D=f;this.$a=g;this.J=h;this.Eb=l;this.j=k.get('appTag');this.ua=k.get('getContextMode');let n;this.Bb=null!=(n=k.get('debuggerName'))?n:null;this.fb=k.get('autostartProfiler');this.ba=k.get('requireBusinessContainer');this.$=olympe.C.cc(olympe.C.ea).update(olympe.C.ea.j)}run(){this.G.debug('runtime starting for app #'+this.j);let a=!1;Sn(this);Un(this);const b=olympe.L.uc.j.Mi,
1167
- c=olympe.L.uc.j.ye,d=olympe.L.uc.j.Td;olympe.C.Sc([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,Vn(this).then(olympe.C.Xa().F(()=>Yn(this))));break;case d:this.G.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Ib.tm.j='app_instance';olympe.sc.Ib.tm.xa=[olympe.xc.Ts];olympe.sc.Ib.Bv=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.kj();this.G.debug('Request headers',b);return b.origin?b.origin:b.jz?(new URL(b.jz)).origin:b[olympe.net.wa.Headers.Vo]&&
1168
- b[olympe.net.wa.Headers.Wo]?b[olympe.net.wa.Headers.Wo]+'://'+b[olympe.net.wa.Headers.Vo]:null};this.D.F('manifest',`${this.F}/:${'appTag'}`,[olympe.net.wa.Md.GET],(b,c)=>{const d=this;return w(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.ld('Invalid appTag',olympe.net.wa.Tb.gl);try{var f=yield olympe.dc.ma.Ie(e,olympe.sc.qa.Xc).nb()}catch(h){return new olympe.net.ld(`Something went wrong: ${'string'===typeof h?
1169
- h:h.message}`,olympe.net.wa.Tb.gl)}if(0===f.size())return new olympe.net.ld('App not found',olympe.net.wa.Tb.$l);var g=a(b);f=f.Gc();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'===
1170
- 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.ld(JSON.stringify(e),olympe.net.wa.Tb.Ah,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function Zn(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.ma.from(a).gb(olympe.sc.qa.Xc.j).gb(olympe.dm.wd.F.ac()).gb(olympe.dm.wd.j).Fc();a=olympe.dc.ma.from(a).gb(olympe.sc.qa.Xc.j).gb(olympe.dm.jb.D).Fc();return c.concat(a).has(b)}
1171
- olympe.sc.Ib.uk=class extends olympe.dc.sources.uk{R(a){return this.db.Qb(a,olympe.sc.yc)}Y(a,b){if(!this.J){super.init();var c=olympe.dc.nd.from(a).gb(olympe.sc.qa.Xc.j).Fc();if(!(c instanceof olympe.dm.jb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.ma.oc.Fg:olympe.dc.ma.oc.lf;Ek(this,c,b);c=new olympe.C.Xb('deployed data sources');olympe.dc.ma.from(a).gb(olympe.sc.qa.Xc.fa).observe(c,{jd:b}).subscribe(d=>{const e=
1172
- new olympe.dc.Wa;d.hj().forEach(f=>{e.Oa(olympe.dm.DataSource.sj,this.j,f)});d.mj().forEach(f=>{e.ic(olympe.dm.DataSource.sj,this.j,f)});e.nb()})}}};olympe.sc.Ib.P={bg:'sc.runtime.Main',Te:'sc.runtime.SourceSolver',Kq:'sc.runtime.appConfig',Mq:'sc.runtime.runtimeHTTPServiceConfig',Lq:'sc.runtime.RuntimeHTTPService',fq:'sc.runtime.OfflineAppConfig'};olympe.sc.Ib.U={pp:'app.httpManifestPath',Op:'app.manifest.common',Kp:'sc.loadBusinessContainer'};
1173
- olympe.W.config(function(a){F(a,olympe.sc.Ib.U.pp,'/runtime/manifest');F(a,olympe.sc.Ib.U.Op,null);F(a,olympe.sc.Ib.U.Kp,!1);E(a,olympe.Db.P.Og,[new olympe.W.pa(olympe.xc.U.Me),new olympe.W.pa(olympe.sc.U.Me)],(b,c)=>`${b}${c?'-'+c:''}`);E(a,olympe.sc.Ib.P.fq,[new olympe.W.pa(olympe.sc.U.Me),new olympe.W.pa(olympe.net.U.Li),new olympe.W.pa(olympe.net.U.bm)],(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`))?
1174
- g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Wa(a,olympe.net.P.cm,olympe.sc.Ib.P.fq);D(a,olympe.sc.Ib.P.Te,olympe.sc.Ib.uk,olympe.dc.P.oh,new olympe.W.pa(olympe.dc.U.Mg),new olympe.W.pa(olympe.dc.U.Al));Wa(a,olympe.dc.sources.P.Te,olympe.sc.Ib.P.Te);E(a,olympe.sc.Ib.P.Kq,[new olympe.W.pa(olympe.sc.U.Me),new olympe.W.pa(olympe.dc.U.Ih),new olympe.W.pa(olympe.sc.U.yo),new olympe.W.pa(olympe.sc.U.Gn),new olympe.W.pa(olympe.sc.Ib.U.Kp)],(b,c,d,e,f)=>new Map([['appTag',
1175
- b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['requireBusinessContainer',f]]));D(a,olympe.sc.Ib.P.bg,olympe.sc.Ib.tm,olympe.sc.P.Ca,olympe.auth.P.Da,olympe.L.P.kf,olympe.dc.query.P.gk,olympe.host.P.Re,olympe.sc.P.lk,olympe.sc.Ib.P.Te,olympe.V.P.ag,olympe.sc.Ib.P.Kq,olympe.sc.Ib.P.Lq);E(a,olympe.sc.Ib.P.Mq,[new olympe.W.pa(olympe.sc.Ib.U.pp),new olympe.W.pa(olympe.sc.Ib.U.Op)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));D(a,olympe.sc.Ib.P.Lq,olympe.sc.Ib.Bv,
1176
- olympe.sc.P.Ca,olympe.net.P.Xi,olympe.sc.P.lk,olympe.sc.Ib.P.Mq);olympe.xc.tj(a,olympe.sc.Ib.P.bg,'sc.runtime');olympe.xc.tj(a,olympe.sc.Ib.P.bg,'sc.headless');olympe.xc.tj(a,olympe.sc.Ib.P.bg)},'olympe.sc.runtime');olympe.public={};olympe.public.Ma=class a{static mx(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 Ve(olympe.public.Ma.get())}static Sk(b){return a.D(olympe.public.Ma.get().Sk(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static zx(){return olympe.C.Pa(olympe.public.Ma.get().ne())}static $y(b){return a.D(olympe.public.Ma.get().ne(),b)}static me(){var b=olympe.C,c=b.Pa;var d=olympe.public.Ma.get().j.rb().Bd();return c.call(b,
1177
- d)}static lg(){return new Promise((b,c)=>{olympe.public.Ma.get().lg(d=>d?c(d):b())})}static Lx(){return olympe.C.Pa(olympe.public.Ma.get().bi())||void 0}static ny(){const b=rd(olympe.public.Ma.get());return{user:b.Bc(),userTag:b.ne(),nonce:b.Bd(),payload:b.Di(),idpName:b.tf(),protocol:b.Bg()}}static Kx(){return Array.from(We().keys())}static ff(){olympe.public.Ma.get().ff()}static dh(b){return new Promise((c,d)=>{olympe.public.Ma.get().dh(b,e=>e?d(e):c())})}static Iy(b,c){return olympe.public.Ma.j((new Map).set('username',
1178
- b).set('password',c),olympe.auth.Dc.j.SRP)}static Jy(b){const c=We();if(0===c.size||b&&!c.has(b)){var d=0===c.size?'There are no available IDPs':`The IDP name ${b} is not valid, the valid names are ${Array.from(c.keys())}`;return Promise.reject(d)}b?(d=b,b=c.get(b)):(b=Array.from(c)[0],d=b[0],b=b[1]);return olympe.public.Ma.j((new Map).set('idpName',d),b)}static Hy(){return olympe.public.Ma.j(new Map,olympe.auth.Dc.j.SAML)}static Ky(b,c){return olympe.public.Ma.j((new Map).set('username',b).set('nonce',
1179
- c),olympe.auth.Dc.j.em)}static Gy(){return olympe.public.Ma.j(new Map,olympe.auth.Dc.j.OAUTH2)}static fi(){return olympe.public.Ma.get().fi()}static j(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{Ue(olympe.public.Ma.get(),d,c,()=>{e()})})}static get(){return olympe.auth.ke()}static D(b,c){return b.asObservable('function'===typeof c.D?c.D():c)}};olympe.public.Ma.logout=olympe.public.Ma.fi;olympe.public.Ma.loginOpenID=olympe.public.Ma.Gy;
1180
- olympe.public.Ma.loginToken=olympe.public.Ma.Ky;olympe.public.Ma.loginSAML=olympe.public.Ma.Hy;olympe.public.Ma.loginSSO=olympe.public.Ma.Jy;olympe.public.Ma.loginSRP=olympe.public.Ma.Iy;olympe.public.Ma.getUserFromToken=olympe.public.Ma.dh;olympe.public.Ma.sendKeepAlive=olympe.public.Ma.ff;olympe.public.Ma.getIDPNames=olympe.public.Ma.Kx;olympe.public.Ma.getUserToken=olympe.public.Ma.ny;olympe.public.Ma.getIDPToken=olympe.public.Ma.Lx;olympe.public.Ma.refreshToken=olympe.public.Ma.lg;
1181
- olympe.public.Ma.getToken=olympe.public.Ma.me;olympe.public.Ma.observeUser=olympe.public.Ma.$y;olympe.public.Ma.getCurrentUser=olympe.public.Ma.zx;olympe.public.Ma.isAuthenticated=olympe.public.Ma.Sk;olympe.public.Ma.getState=olympe.public.Ma.getState;olympe.public.Ma.generateSRPData=olympe.public.Ma.mx;olympe.public.Aa=class{static create(a){return new class extends olympe.dc.Z.og{j(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.C.cc(olympe.C.ea),e=b.subscribe(f=>d.update(olympe.C.Rb(f)));olympe.C.Xa().Y(()=>e.unsubscribe());return d.rb()}}}};
1182
- olympe.public.mf=class{static create(a){return new class extends olympe.dc.wc.og{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.Xa().Y(()=>e.unsubscribe());return d.rb()}}}};olympe.public.Process=class{static az(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.Mk(),d=c.j(a,void 0,null==b?void 0:b.type);return()=>c.F(d)}static bz(a,b){const c=olympe.host.Mk(),d=c.D(a,b);return()=>c.N(d)}static connect(){return olympe.L.Ym().connect()}static disconnect(){return olympe.L.Ym().disconnect()}static Pf(a){a='function'===typeof a.D?a.D():a;return olympe.L.Ym().Pf().asObservable(a).pipe(rxjs.operators.map(b=>
1183
- b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Pf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.bz;olympe.public.Process.onHealthCheck=olympe.public.Process.az;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Ra.Relation,Direction:olympe.dc.va,generateTag:olympe.V.Hf,tagToString:olympe.dc.ha,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Qr,defineInverseRelation:olympe.dc.Uw,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,
1184
- Context:olympe.sc.ya,Entry:olympe.dc.Ra.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.sc.File,User:olympe.dm.User,Enum:olympe.dm.Zf,EnumValue:olympe.sc.vi,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.zd,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Ve,WorkflowTransition:olympe.sc.workflow.Transition,
1185
- WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Wa,BurstTransaction:olympe.dc.ni,TransactionResult:olympe.sc.Wi,PredefinedDataSource:olympe.dc.Ka,QueryResult:olympe.dc.Ia,Query:olympe.dc.ma,QuerySingle:olympe.dc.nd,Predicate:olympe.dc.query.Aa,Order:olympe.dc.query.dk,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.Ce.j,Cache:{getCacheEntries:()=>olympe.dc.sources.Yd().N,clearCache:a=>Uk(olympe.dc.sources.Yd(),
1186
- a),getProcessingStatus:()=>olympe.dc.sources.Yd().Hc(),getProcessingErrors:()=>olympe.dc.sources.Yd().rc.asObservable(),hasPendingChanges:()=>olympe.dc.sources.Yd().ba.asObservable(),synchroniseChanges:()=>$k(),getPendingChanges:()=>cl(),clearPendingChanges:()=>gl(),loadPendingChanges:a=>el(a)},Color:olympe.C.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.L.cb.j,ServiceRequest:olympe.L.Zc,Service:olympe.L.ub,Auth:olympe.public.Ma,AuthState:{INIT:olympe.auth.Ta.j.INIT,AUTHENTICATING:olympe.auth.Ta.j.zj,
1187
- GUEST:olympe.auth.Ta.j.xi,AUTHENTICATED:olympe.auth.Ta.j.gf,ERROR:olympe.auth.Ta.j.zb},AuthProtocol:olympe.auth.Dc.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.ia()}},ListDef:olympe.dc.za,
1188
- instanceToTag:olympe.dc.ha,registerSync:olympe.dc.na.j,getUniqueTag:olympe.V.Hf,onDestroy:a=>olympe.C.Xa().onDestroy(a),offDestroy:a=>olympe.C.Xa().Qf(a),FollowRules:olympe.dc.Lb,transformers:{Related:olympe.dc.da.Se,RecursiveRelated:olympe.dc.da.De,Distinct:olympe.dc.da.si,Filter:olympe.dc.da.pf,Limit:olympe.dc.da.xh,Sort:olympe.dc.da.Pg,Union:olympe.dc.da.Cf},ListDefPredicate:olympe.public.Aa,predicates:{And:olympe.dc.Z.Id,Or:olympe.dc.Z.ze,Not:olympe.dc.Z.ee,Equals:olympe.dc.Z.te,Contains:olympe.dc.Z.nf,
1189
- Greater:olympe.dc.Z.Sj,Smaller:olympe.dc.Z.tk,HasRelated:olympe.dc.Z.zi,InstanceOf:olympe.dc.Z.Ci,Regex:olympe.dc.Z.zf},Comparator:olympe.public.mf,comparators:{Number:olympe.dc.wc.Number,String:olympe.dc.wc.String,DateTime:olympe.dc.wc.DateTime},valuedefs:{BooleanProperty:olympe.dc.Za.Dj,StringProperty:olympe.dc.Za.Si,NumberProperty:olympe.dc.Za.Ki,DateTimeProperty:olympe.dc.Za.ri,Constant:olympe.dc.Za.Oe,Tag:olympe.dc.Za.Ui}});
1148
+ olympe.sc.sg.az=a=>{const b=a.j,c=olympe.dc.ia();for(const d of b.Rc()){const e=d.Wb();e&&!d.td()&&c.Ob(e,olympe.sc.yc)&&d.Db().forEach((f,g)=>{if(f instanceof olympe.dc.uc){const l=b.Qc(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.Wb())?h:null;h=l.tag();let n;if(f===olympe.dc.fa(olympe.sc.Pd)){h=l.Jb(olympe.sc.Pd.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
1149
+ let p;f=null!=(p=null==(k=b.Qc(h))?void 0:k.Wb())?p:c.model(h)}if(c.Qf(f,olympe.dm.De)){k=Km(f);let p;n=null!=(p=l.Qa(k.X()))?p:c.Qa(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.Wc(d.tag(),new Map([[g,n]]));vl(a,l.tag(),olympe.dc.Lb.Dc)}})}};
1150
+ olympe.sc.sg.Vw=a=>{const b=a.j,c=olympe.dc.ia(),d=new Set;for(var e of b.Bb.values()){a=e.tag();let f;const g=null!=(f=e.Wb())?f:c.model(a);if(null!==g&&e.Id()&&(d.has(g)||c.Ob(g,olympe.sc.yc))){d.add(g);const h=Array.from(e.ha()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.fc.Yc?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Qc(k))?void 0:l.Wb())?n:c.model(k);return!p||!(d.has(p)||c.Ob(p,olympe.sc.yc))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Qc(h))?void 0:k.Wb())?l:c.model(h))?
1151
+ 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.sg.pz=a=>{var b=a.j;const c=olympe.dc.ia();for(const d of b.Rc()){b=d.tag();const e=d.Wb();if(e&&!c.Ob(e,olympe.sc.yc)&&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`);}};
1152
+ olympe.W.run([olympe.dc.transaction.P.Da],a=>{Hl(Hl(Hl(a,olympe.sc.sg.Vw,'businessDataRelations'),olympe.sc.sg.Py,'linkBusinessContainer'),olympe.sc.sg.az,'noBusinessComplexProperty')});olympe.sc.Oj=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.Oj.O=olympe.dc.na.j('01645fe6873aeea59e64',olympe.sc.Oj);olympe.sc.Oj.j=olympe.sc.Oj.O.sa('017ed8ac775f48d4d589');olympe.sc.so=class extends olympe.dm.Kb{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.so.O=olympe.dc.na.j('0163a68ce44f3d1fa95d',olympe.sc.so);olympe.sc.ph=class extends olympe.dm.BrickMetadata{};olympe.sc.ph.O=olympe.dc.na.j('016324fde11a836f77d3',olympe.sc.ph);olympe.sc.ph.j=olympe.sc.yc.O.sa('016324fde11a836088d3');olympe.sc.ph.O.j=(a,b)=>Bl(a,null!=b?b:'New config type',olympe.sc.ph).X();olympe.sc.iA=class{};olympe.sc.Sj=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.Sj.O=olympe.dc.na.j('017dc8d6c8fd8c8bd2ff',olympe.sc.Sj);olympe.sc.Sj.O.j=(a,b)=>Bl(a,null!=b?b:'New data connector',olympe.sc.Sj,olympe.dm.DataSource).X();olympe.sc.ue=class extends olympe.sc.Runnable{wa(){return this.ab(olympe.sc.ue.F,olympe.sc.Runnable)}ha(){return this.ab(olympe.sc.ue.D,olympe.dm.Property)}};olympe.sc.ue.O=Of(olympe.dc.na.j('016c2d996d9ca27fa9d8',olympe.sc.ue));olympe.sc.ue.F=olympe.sc.ue.O.sa('016c3cb7742ec9309e0b');olympe.sc.ue.D=olympe.sc.ue.O.sa('016c42d3454636f90533');olympe.sc.ue.prototype.wa.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.ue.prototype.ha.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.So=class extends olympe.dm.Kb{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.So.O=olympe.dc.na.j('017a7a9ff057958e5678',olympe.sc.So);olympe.sc.Bi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ia();e=void 0!==e?e:f.Ga(b)&&f.Rc(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.Bi.create=olympe.sc.Bi.create;olympe.sc.Bi.O=olympe.dc.na.j('016cdd861b32d56c8208',olympe.sc.Bi);olympe.sc.Xp=class extends olympe.dm.Kb{qe(){return olympe.sc.se.Ie.mw}};olympe.sc.Xp.O=olympe.dc.na.j('01644b6d4543b344b857',olympe.sc.Xp);olympe.sc.Yp=class extends olympe.dc.CloudObject{};olympe.sc.Yp.O=olympe.dc.na.j('0162f672366be5ca7a86',olympe.sc.Yp);const Qn={Ro:30};olympe.sc.cc=class extends olympe.dc.sources.cc{D(a){return a instanceof olympe.sc.logic.Error?this.format(Qn.Ro,{c:a.code,m:a.message,s:a.ne()}):super.D(a)}j(a){return(null==a?void 0:a.t)===Qn.Ro?(a=a.v,Qm(a.m,a.c,a.s)):super.j(a)}H(a){super.H(a);if(this.db.model(a)===olympe.sc.Pd.O.X()){const b=olympe.sc.Pd.j;this.F.get(a).r.push({r:b.X(),o:a,d:this.db.Jb(a,b)})}return a}};olympe.sc.nr=class extends olympe.sc.ue{};olympe.sc.nr.O=olympe.dc.na.j('016d3f37610ae4fc3962',olympe.sc.nr);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.na.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Wa=class{constructor(a=!0){a=zl(a);a.N=!0;var b=olympe.sc.sg.pz;let c;(null==(c=olympe.W.getParameter(olympe.dc.transaction.U.Il))?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.Wa}static process(a,b){return a.has(olympe.sc.ya.j.TRANSACTION,!0)?Promise.resolve(!1):b.nb().then(()=>!0)}T(){return this.j.T()}create(a,b=new Map,c=this.source,d){c='string'===
1153
+ typeof c?c:olympe.dc.ae().fromModel(a);a=this.j.create(a,d).li(c);for(const [e,f]of b)Y(a,e,f);b=a.X();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}Fs(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Gd.set(olympe.dc.fa(c),b);return this}delete(a){this.j.delete(a);return this}Oa(a,b,c){this.j.Oa(a,b,c);return this}hc(a,b,c){this.j.hc(a,b,c);return this}Zm(a,b){this.j.Zm(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}oz(a,b=!0){olympe.ja.$a('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');
1154
+ return this.persist(a,b)}li(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){Al(this.j,a.j);return this}Rm(a){this.j.Rm(a);return this}nb(){return new Promise((a,b)=>{this.j.nb((c,d)=>{c?a(new olympe.sc.cj(this.D)):b(d)})})}$m(){return new Promise((a,b)=>{this.j.$m((c,d)=>{c?a(new olympe.sc.cj(this.D)):b(d)})})}};olympe.sc.Wa.prototype.executeAsLarge=olympe.sc.Wa.prototype.$m;olympe.sc.Wa.prototype.execute=olympe.sc.Wa.prototype.nb;olympe.sc.Wa.prototype.afterExecution=olympe.sc.Wa.prototype.Rm;
1155
+ olympe.sc.Wa.prototype.merge=olympe.sc.Wa.prototype.merge;olympe.sc.Wa.prototype.model=olympe.sc.Wa.prototype.model;olympe.sc.Wa.prototype.setSource=olympe.sc.Wa.prototype.li;olympe.sc.Wa.prototype.persistInstance=olympe.sc.Wa.prototype.oz;olympe.sc.Wa.prototype.persist=olympe.sc.Wa.prototype.persist;olympe.sc.Wa.prototype.deleteAllRelations=olympe.sc.Wa.prototype.Zm;olympe.sc.Wa.prototype.deleteRelation=olympe.sc.Wa.prototype.hc;olympe.sc.Wa.prototype.createRelation=olympe.sc.Wa.prototype.Oa;
1156
+ olympe.sc.Wa.prototype['delete']=olympe.sc.Wa.prototype.delete;olympe.sc.Wa.prototype.multiUpdate=olympe.sc.Wa.prototype.Fs;olympe.sc.Wa.prototype.update=olympe.sc.Wa.prototype.update;olympe.sc.Wa.prototype.create=olympe.sc.Wa.prototype.create;olympe.sc.Wa.prototype.getId=olympe.sc.Wa.prototype.T;olympe.sc.Wa.process=olympe.sc.Wa.process;olympe.sc.Wa.from=olympe.sc.Wa.from;olympe.sc.cj=class{constructor(a){this.j=a}Hx(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.cj.prototype.getCreatedObjects=olympe.sc.cj.prototype.Hx;olympe.xc={};olympe.xc.bt=class{run(){}};function Rn(a,b='default'){return a.j===b}
1157
+ olympe.xc.Ta=class{constructor(a,b){this.j=a;this.G=b;this.D=null;this.F='';this.G.info('HC Manager will execute application registered as:',this.j)}Aj(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),
1158
+ this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.xc.Aj=function(a,b,c='default'){const d=a.$a();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.xc.U.Pe+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.rd(olympe.xc.P.Da).config(c,[b],(e,f)=>f.Aj(e,c,b),e=>Rn(e,c),'olympe.hc.registerApp')};olympe.xc.P={Da:'hc.Manager',Ca:'hc.Logger'};olympe.xc.U={Pe:'hc.app',kp:'hc.globalToken'};olympe.W.config(function(a){F(a,olympe.xc.U.Pe,'default');F(a,olympe.xc.U.kp,!1);E(a,olympe.xc.P.Ca,[olympe.ja.P.Da],b=>b.cd('hc'));E(a,olympe.Eb.P.Sg,[new olympe.W.pa(olympe.xc.U.Pe)],b=>b);E(a,olympe.auth.P.kl,[olympe.Eb.P.Sg,new olympe.W.pa(olympe.xc.U.kp)],(b,c)=>new olympe.auth.Tn(c?'':b));D(a,olympe.xc.P.Da,olympe.xc.Ta,new olympe.W.pa(olympe.xc.U.Pe),olympe.xc.P.Ca)},'olympe.hc');
1159
+ olympe.W.run([olympe.xc.P.Da],a=>a.run(),'olympe.hc');olympe.sc.Ib={};function Sn(a){a.Y=a.F.D(()=>w(function*(){return Tn(a)}),'Stop application')}function Un(a){a.R=a.F.j(()=>olympe.C.Pa(a.$)===olympe.C.ea.D?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.Ee.j.READINESS)}
1160
+ function Vn(a){if(a.wa)return a.G.debug('Sending getContext request'),ni(a.Ha).then(()=>{a.G.debug('synchronisation request successful');var f=a.j;Dn=null;Bn=f}).catch(f=>{a.G.error('failed to synchronise (authenticated) with server: '+f.message)});const b=Om(a.D);!b&&Lk();a.G.debug((b?'PULLING':'SUBSCRIBING')+' application '+a.j);const c=a.D.Cb(),d=new Promise((f,g)=>{const h=olympe.dc.ia(),k=new olympe.C.Xb('Primordial Subscription Context',c);bi(k,a.j,l=>{l=h.ji(l)?l:h.model(l);return null!==l&&
1161
+ h.Ob(l,olympe.sc.ph)},{jd:Wn(b),Dn:!0,zs:!0}).subscribe(rxjs.Subscriber.create(c.rc(()=>{h.Ob(a.j,olympe.sc.qa.Xc)?(a.cb.Y(a.j,b),f()):id(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.Sc([a.ha.pe()],g=>{const h=Wn(b,!1);olympe.dc.ma.Ke(g,olympe.dm.User,olympe.dc.Ja.SERVER).observe(c,
1162
+ {jd:h,Kk:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.da)return Xn(a);Xn(a).then(()=>{})})}
1163
+ function Yn(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ia();if(0<a.j.length){const c=sf(b,a.j,a.D.Cb().rc((f,g)=>{if(f)if(f=sn(g),f instanceof olympe.sc.qa.si){a.G.debug('application retrieved: running');g=Lm(a.D,f);const h=new olympe.sc.Ya.zv(a.H);jb(a.H,()=>Ym(a.D.j,h));kb(a.H,()=>{var k=h.T();return $m(a.D.j,k)});a.jb&&a.H.start();f.run(g);'string'===typeof a.zb&&(new olympe.sc.Xd).da(f.X(),g,a.G);g.Us(olympe.sc.ya.j.Kn).then(()=>{var k;null==(k=d)||k.cancel();a.$.update(olympe.C.ea.D);
1164
+ a.G.info(`Application ${olympe.dc.ia().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.Zd();k.Mb=!0;k.Y+=0;k.Rd.next(0<k.Y);0===k.Y&&k.$&&k.Mb&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.cb.set('__code-as-data-version__',k.version),k.zb||(k.$=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else Tn(a)}));olympe.C.Xa().onDestroy(()=>{qf(b,a.j,c)});const d=wc(()=>{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)`)},
1165
+ 3E4);let e;null==(e=a.Mb)||e.start()}}function Wn(a,b=!0){return a?olympe.dc.ma.nc.Jg:b?olympe.dc.ma.nc.qf:olympe.dc.ma.nc.lk}function Xn(a){return w(function*(){Zn(a.j)&&(yield En(a.j,a.da).catch(b=>{throw Error(`Failed to load the business container for the application ${a.j}: ${b}`);}))})}function Tn(a){a.G.info('Stop the application');a.D.Cb().lg();a.F.F(a.R);a.F.N(a.Y)}
1166
+ olympe.sc.Ib.ym=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.ha=b;this.N=c;this.Ha=d;this.F=e;this.Y=this.R='';this.D=f;this.cb=g;this.H=h;this.Mb=l;this.j=k.get('appTag');this.wa=k.get('getContextMode');let n;this.zb=null!=(n=k.get('debuggerName'))?n:null;this.jb=k.get('autostartProfiler');this.da=k.get('requireBusinessContainer');this.$=olympe.C.bc(olympe.C.ea).update(olympe.C.ea.j)}run(){this.G.debug('runtime starting for app #'+this.j);let a=!1;Sn(this);Un(this);const b=olympe.L.tc.j.Si,
1167
+ c=olympe.L.tc.j.Ae,d=olympe.L.tc.j.Wd;olympe.C.Sc([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,Vn(this).then(olympe.C.Xa().rc(()=>Yn(this))));break;case d:this.G.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Ib.ym.j='app_instance';olympe.sc.Ib.ym.xa=[olympe.xc.bt];olympe.sc.Ib.Lv=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.rj();this.G.debug('Request headers',b);return b.origin?b.origin:b.uz?(new URL(b.uz)).origin:b[olympe.net.va.Headers.ap]&&
1168
+ b[olympe.net.va.Headers.bp]?b[olympe.net.va.Headers.bp]+'://'+b[olympe.net.va.Headers.ap]:null};this.D.F('manifest',`${this.F}/:${'appTag'}`,[olympe.net.va.Nd.GET],(b,c)=>{const d=this;return w(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.ld('Invalid appTag',olympe.net.va.Vb.nl);try{var f=yield olympe.dc.ma.Ke(e,olympe.sc.qa.Xc).nb()}catch(h){return new olympe.net.ld(`Something went wrong: ${'string'===typeof h?
1169
+ h:h.message}`,olympe.net.va.Vb.nl)}if(0===f.size())return new olympe.net.ld('App not found',olympe.net.va.Vb.gm);var g=a(b);f=f.Gc();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'===
1170
+ 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.ld(JSON.stringify(e),olympe.net.va.Vb.Eh,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function Zn(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.ma.from(a).fb(olympe.sc.qa.Xc.j).fb(olympe.dm.wd.F.$b()).fb(olympe.dm.wd.j).Fc();a=olympe.dc.ma.from(a).fb(olympe.sc.qa.Xc.j).fb(olympe.dm.ib.D).Fc();return c.concat(a).has(b)}
1171
+ olympe.sc.Ib.Bk=class extends olympe.dc.sources.Bk{R(a){return this.db.Ob(a,olympe.sc.yc)}Y(a,b){if(!this.H){super.init();var c=olympe.dc.nd.from(a).fb(olympe.sc.qa.Xc.j).Fc();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.nc.Jg:olympe.dc.ma.nc.qf;Ck(this,c,b);c=new olympe.C.Xb('deployed data sources');olympe.dc.ma.from(a).fb(olympe.sc.qa.Xc.ha).observe(c,{jd:b}).subscribe(d=>{const e=
1172
+ new olympe.dc.Wa;d.oj().forEach(f=>{e.Oa(olympe.dm.DataSource.zj,this.j,f)});d.tj().forEach(f=>{e.hc(olympe.dm.DataSource.zj,this.j,f)});e.nb()})}}};olympe.sc.Ib.P={fg:'sc.runtime.Main',We:'sc.runtime.SourceSolver',Rq:'sc.runtime.appConfig',Tq:'sc.runtime.runtimeHTTPServiceConfig',Sq:'sc.runtime.RuntimeHTTPService',mq:'sc.runtime.OfflineAppConfig'};olympe.sc.Ib.U={vp:'app.httpManifestPath',Vp:'app.manifest.common',Rp:'sc.loadBusinessContainer'};
1173
+ olympe.W.config(function(a){F(a,olympe.sc.Ib.U.vp,'/runtime/manifest');F(a,olympe.sc.Ib.U.Vp,null);F(a,olympe.sc.Ib.U.Rp,!1);E(a,olympe.Eb.P.Sg,[new olympe.W.pa(olympe.xc.U.Pe),new olympe.W.pa(olympe.sc.U.Pe)],(b,c)=>`${b}${c?'-'+c:''}`);E(a,olympe.sc.Ib.P.mq,[new olympe.W.pa(olympe.sc.U.Pe),new olympe.W.pa(olympe.net.U.Ri),new olympe.W.pa(olympe.net.U.im)],(b,c,d)=>{let e;const f=null!=(e=a.getParameter(`offline.${b}.enabled`))?e:c;let g;b=null!=(g=a.getParameter(`offline.${b}.autoBackOnline`))?
1174
+ g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Wa(a,olympe.net.P.jm,olympe.sc.Ib.P.mq);D(a,olympe.sc.Ib.P.We,olympe.sc.Ib.Bk,olympe.dc.P.sh,new olympe.W.pa(olympe.dc.U.Qg),new olympe.W.pa(olympe.dc.U.Gl));Wa(a,olympe.dc.sources.P.We,olympe.sc.Ib.P.We);E(a,olympe.sc.Ib.P.Rq,[new olympe.W.pa(olympe.sc.U.Pe),new olympe.W.pa(olympe.dc.U.Mh),new olympe.W.pa(olympe.sc.U.Eo),new olympe.W.pa(olympe.sc.U.Mn),new olympe.W.pa(olympe.sc.Ib.U.Rp)],(b,c,d,e,f)=>new Map([['appTag',
1175
+ b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['requireBusinessContainer',f]]));D(a,olympe.sc.Ib.P.fg,olympe.sc.Ib.ym,olympe.sc.P.Ca,olympe.auth.P.Da,olympe.L.P.pf,olympe.dc.query.P.nk,olympe.host.P.Ue,olympe.sc.P.tk,olympe.sc.Ib.P.We,olympe.V.P.eg,olympe.sc.Ib.P.Rq,olympe.sc.Ib.P.Sq);E(a,olympe.sc.Ib.P.Tq,[new olympe.W.pa(olympe.sc.Ib.U.vp),new olympe.W.pa(olympe.sc.Ib.U.Vp)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));D(a,olympe.sc.Ib.P.Sq,olympe.sc.Ib.Lv,
1176
+ olympe.sc.P.Ca,olympe.net.P.dj,olympe.sc.P.tk,olympe.sc.Ib.P.Tq);olympe.xc.Aj(a,olympe.sc.Ib.P.fg,'sc.runtime');olympe.xc.Aj(a,olympe.sc.Ib.P.fg,'sc.headless');olympe.xc.Aj(a,olympe.sc.Ib.P.fg)},'olympe.sc.runtime');olympe.public={};olympe.public.Ma=class a{static xx(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 Ve(olympe.public.Ma.get())}static Zk(b){return a.D(olympe.public.Ma.get().Zk(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static Jx(){return olympe.C.Pa(olympe.public.Ma.get().pe())}static jz(b){return a.D(olympe.public.Ma.get().pe(),b)}static oe(){var b=olympe.C,c=b.Pa;var d=olympe.public.Ma.get().j.rb().Cd();return c.call(b,
1177
+ d)}static qg(){return new Promise((b,c)=>{olympe.public.Ma.get().qg(d=>d?c(d):b())})}static Vx(){return olympe.C.Pa(olympe.public.Ma.get().gi())||void 0}static yy(){const b=rd(olympe.public.Ma.get());return{user:b.Cc(),userTag:b.pe(),nonce:b.Cd(),payload:b.Ji(),idpName:b.xf(),protocol:b.Fg()}}static Ux(){return Array.from(We().keys())}static kf(){olympe.public.Ma.get().kf()}static hh(b){return new Promise((c,d)=>{olympe.public.Ma.get().hh(b,e=>e?d(e):c())})}static Sy(b,c){return olympe.public.Ma.j((new Map).set('username',
1178
+ b).set('password',c),olympe.auth.Ec.j.SRP)}static Ty(b){const c=We();if(0===c.size||b&&!c.has(b)){var d=0===c.size?'There are no available IDPs':`The IDP name ${b} is not valid, the valid names are ${Array.from(c.keys())}`;return Promise.reject(d)}b?(d=b,b=c.get(b)):(b=Array.from(c)[0],d=b[0],b=b[1]);return olympe.public.Ma.j((new Map).set('idpName',d),b)}static Ry(){return olympe.public.Ma.j(new Map,olympe.auth.Ec.j.SAML)}static Uy(b,c){return olympe.public.Ma.j((new Map).set('username',b).set('nonce',
1179
+ c),olympe.auth.Ec.j.km)}static Qy(){return olympe.public.Ma.j(new Map,olympe.auth.Ec.j.OAUTH2)}static ki(){return olympe.public.Ma.get().ki()}static j(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{Ue(olympe.public.Ma.get(),d,c,()=>{e()})})}static get(){return olympe.auth.me()}static D(b,c){return b.asObservable('function'===typeof c.Cb?c.Cb():c)}};olympe.public.Ma.logout=olympe.public.Ma.ki;olympe.public.Ma.loginOpenID=olympe.public.Ma.Qy;
1180
+ olympe.public.Ma.loginToken=olympe.public.Ma.Uy;olympe.public.Ma.loginSAML=olympe.public.Ma.Ry;olympe.public.Ma.loginSSO=olympe.public.Ma.Ty;olympe.public.Ma.loginSRP=olympe.public.Ma.Sy;olympe.public.Ma.getUserFromToken=olympe.public.Ma.hh;olympe.public.Ma.sendKeepAlive=olympe.public.Ma.kf;olympe.public.Ma.getIDPNames=olympe.public.Ma.Ux;olympe.public.Ma.getUserToken=olympe.public.Ma.yy;olympe.public.Ma.getIDPToken=olympe.public.Ma.Vx;olympe.public.Ma.refreshToken=olympe.public.Ma.qg;
1181
+ olympe.public.Ma.getToken=olympe.public.Ma.oe;olympe.public.Ma.observeUser=olympe.public.Ma.jz;olympe.public.Ma.getCurrentUser=olympe.public.Ma.Jx;olympe.public.Ma.isAuthenticated=olympe.public.Ma.Zk;olympe.public.Ma.getState=olympe.public.Ma.getState;olympe.public.Ma.generateSRPData=olympe.public.Ma.xx;olympe.public.Aa=class{static create(a){return new class extends olympe.dc.Z.tg{j(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.C.bc(olympe.C.ea),e=b.subscribe(f=>d.update(olympe.C.Sb(f)));olympe.C.Xa().Td(()=>e.unsubscribe());return d.rb()}}}};
1182
+ olympe.public.rf=class{static create(a){return new class extends olympe.dc.wc.tg{F(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.C.bc(olympe.C.aa),e=b.subscribe(f=>d.update(olympe.C.ra(f)));olympe.C.Xa().Td(()=>e.unsubscribe());return d.rb()}}}};olympe.public.Process=class{static kz(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.Tk(),d=c.j(a,void 0,null==b?void 0:b.type);return()=>c.F(d)}static lz(a,b){const c=olympe.host.Tk(),d=c.D(a,b);return()=>c.N(d)}static connect(){return olympe.L.cn().connect()}static disconnect(){return olympe.L.cn().disconnect()}static Sf(a){a='function'===typeof a.Cb?a.Cb():a;return olympe.L.cn().Sf().asObservable(a).pipe(rxjs.operators.map(b=>
1183
+ b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Sf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.lz;olympe.public.Process.onHealthCheck=olympe.public.Process.kz;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Ra.Relation,Direction:olympe.dc.ua,generateTag:olympe.V.Kf,tagToString:olympe.dc.fa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Xr,defineInverseRelation:olympe.dc.gx,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,
1184
+ Context:olympe.sc.ya,Entry:olympe.dc.Ra.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.sc.File,User:olympe.dm.User,Enum:olympe.dm.cg,EnumValue:olympe.sc.Bi,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.zd,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Ye,WorkflowTransition:olympe.sc.workflow.Transition,
1185
+ WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Wa,BurstTransaction:olympe.dc.vi,TransactionResult:olympe.sc.cj,PredefinedDataSource:olympe.dc.Ja,QueryResult:olympe.dc.Ia,Query:olympe.dc.ma,QuerySingle:olympe.dc.nd,Predicate:olympe.dc.query.Aa,Order:olympe.dc.query.kk,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.Ee.j,Cache:{getCacheEntries:()=>olympe.dc.sources.Zd().N,clearCache:a=>Sk(olympe.dc.sources.Zd(),
1186
+ a),getProcessingStatus:()=>olympe.dc.sources.Zd().Hc(),getProcessingErrors:()=>olympe.dc.sources.Zd().$c.asObservable(),hasPendingChanges:()=>olympe.dc.sources.Zd().da.asObservable(),synchroniseChanges:()=>Yk(),getPendingChanges:()=>al(),clearPendingChanges:()=>el(),loadPendingChanges:a=>cl(a)},Color:olympe.C.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.L.bb.j,ServiceRequest:olympe.L.Zc,Service:olympe.L.ub,Auth:olympe.public.Ma,AuthState:{INIT:olympe.auth.Ta.j.INIT,AUTHENTICATING:olympe.auth.Ta.j.Gj,
1187
+ GUEST:olympe.auth.Ta.j.Di,AUTHENTICATED:olympe.auth.Ta.j.lf,ERROR:olympe.auth.Ta.j.Ab},AuthProtocol:olympe.auth.Ec.j,Sync:olympe.dc.CloudObject,BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.kb{static get(){return olympe.dc.ia()}},ListDef:olympe.dc.za,
1188
+ instanceToTag:olympe.dc.fa,registerSync:olympe.dc.na.j,getUniqueTag:olympe.V.Kf,onDestroy:a=>olympe.C.Xa().onDestroy(a),offDestroy:a=>olympe.C.Xa().Tf(a),FollowRules:olympe.dc.Lb,transformers:{Related:olympe.dc.ba.Ve,RecursiveRelated:olympe.dc.ba.Fe,Distinct:olympe.dc.ba.zi,Filter:olympe.dc.ba.tf,Limit:olympe.dc.ba.Bh,Sort:olympe.dc.ba.Tg,Union:olympe.dc.ba.Gf},ListDefPredicate:olympe.public.Aa,predicates:{And:olympe.dc.Z.Jd,Or:olympe.dc.Z.Be,Not:olympe.dc.Z.fe,Equals:olympe.dc.Z.ve,Contains:olympe.dc.Z.sf,
1189
+ Greater:olympe.dc.Z.Zj,Smaller:olympe.dc.Z.Ak,HasRelated:olympe.dc.Z.Fi,InstanceOf:olympe.dc.Z.Ii,Regex:olympe.dc.Z.Df},Comparator:olympe.public.rf,comparators:{Number:olympe.dc.wc.Number,String:olympe.dc.wc.String,DateTime:olympe.dc.wc.DateTime},valuedefs:{BooleanProperty:olympe.dc.Za.Kj,StringProperty:olympe.dc.Za.Zi,NumberProperty:olympe.dc.Za.Qi,DateTimeProperty:olympe.dc.Za.yi,Constant:olympe.dc.Za.Re,Tag:olympe.dc.Za.aj}});
1190
1190
 
1191
1191
 
1192
1192
  }.bind(this))();