@olympeio/runtime-node 9.4.4 → 9.4.5

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
@@ -208,788 +208,785 @@ da('Array.prototype.includes',function(a){return a?a:function(b,c){var d=this;d
208
208
  da('String.prototype.padStart',function(a){return a?a:function(b,c){var d=ha(this);return ia(c,b-d.length)+d}});da('String.prototype.padEnd',function(a){return a?a:function(b,c){var d=ha(this);return d+ia(c,b-d.length)}});da('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)}});
209
209
  da('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}});da('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;})})}});
210
210
  da('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}});da('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}});
211
- da('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 ja=this||self;function B(a,b){a=a.split('.');let c=ja;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={Mj:()=>'object'===typeof window?window:'object'===typeof global?global:self};olympe.Mj().olympe=olympe;olympe.lB=(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 ka=(a,b)=>{a={level:a,message:b.map(c=>String(c)).join(' ')};for(const c of b){let d;if(null==(d=c)?0:d.stack)a.stackTrace||(a.stackTrace=''),a.stackTrace+=c.stack}return JSON.stringify(a)};
212
- (()=>{const a=console.trace,b=console.debug,c=console.log,d=console.info,e=console.warn,f=console.error;console.trace=(...g)=>a(ka('TRACE',g));console.debug=(...g)=>b(ka('DEBUG',g));console.log=(...g)=>c(ka('LOG',g));console.info=(...g)=>d(ka('INFO',g));console.warn=(...g)=>e(ka('WARN',g));console.error=(...g)=>f(ka('ERROR',g))})();olympe.Na={};olympe.Na.node={};olympe.V={};olympe.V.df={};olympe.V.df.gn=class{process(a){const b=Object.keys(a.$d);let c,d;c=0;for(d=b.length;c<d;c++)if(a.sd(b[c]).gm())throw Error('Service "'+b[c]+'" is defined as abstract and needs to be overridden');}};olympe.V.df.gn.va=[olympe.V.df.Wo];olympe.V.df.hn=class{process(a){function b(g,h){if(0<=h.indexOf(g))throw Error('Circular dependency detected: '+h.join(' > ')+' > '+g);h=h.concat(g);if(f[g]&&(delete f[g],g=a.sd(g),c(g.ki(),h),g=g.Ph,null!==g))for(let k=0,m=g.length;k<m;k++)c(g[k].ki(),h)}function c(g,h){for(let k=0,m=g.length,n;k<m;k++)n=g[k],n instanceof olympe.V.qb&&b(n.W(),h)}function d(){for(const g in f)if(Object.prototype.hasOwnProperty.call(f,g))return g}var e=Object.keys(a.$d);const f={};for(let g=0,h=e.length;g<h;g++)f[e[g]]=
213
- !0;for(;void 0!==(e=d());)b(e,[])}};olympe.V.df.hn.va=[olympe.V.df.Wo];olympe.V.df.Wo=class{process(){}};const la=[],ma=[];function na(a){const b=a.fb();b.debug('Registering configurations...');b.C++;la.forEach(c=>{C(a.K,'Registering configure callback '+(c.C?'for module '+c.C:''));a.F.push(c.F)});oa(b);b.debug('done registering')}function qa(a){const b=a.fb();b.debug('Running run callbacks of container...');b.C++;ma.forEach(c=>{const d=ra(a,c.ki());a.K.debug('Calling run callback '+(c.C?'for module '+c.C:''));c.F.apply(null,d)});oa(b);b.debug('done calling run callbacks. DI process completed!')}
214
- olympe.V.mn=class{constructor(){}static C(a,b){la.push(new olympe.V.sk(a,b))}static F(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');});ma.push(new olympe.V.sk(b,c,a))}};olympe.V.config=olympe.V.mn.C;olympe.V.run=olympe.V.mn.F;olympe.V.jk=class{constructor(){}getValue(){}};olympe.V.sk=class{constructor(a,b,c){this.F=a;this.G=[];this.C=b;if(void 0!==c){this.G=c;for(let d=0,e=c.length;d<e;d++)'string'===typeof c[d]&&(c[d]=new olympe.V.qb(c[d]))}}ki(){return this.G}};function sa(a,b,c){let d=a.C[b];if(void 0===d){const e=a.F[b];if(void 0===e){if(c===olympe.V.Fg.C.dl)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.K.error('Error during instantiation of service '+b),f;}!e.G&&(a.C[b]=d)}return d}function ra(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.K.C++,f=b[e],d[e]=f instanceof olympe.V.jk?f.getValue(a):f,oa(a.K);return d}
215
- olympe.V.Fg=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.K=new olympe.V.uo(c);a=olympe.V.R.Sf;if(void 0!==this.C[a])throw Error('Service "'+a+'" has already been instantiated');this.C[a]=this}fb(){return this.K}getParameter(a){return this.parameters[a.toLowerCase()]}};olympe.V.Fg.C={tr:'exception',dl:'null'};function ta(a,b,c){function d(f,g){let h,k,m;for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(k=f[h],m=g.concat((h.startsWith('#')?h.substring(1):h).toLowerCase()),'object'!==typeof k||null===k||h.startsWith('#')?e[m.join('.')]=k:d(k,m))}const e=a.parameters;d(b,c?[c]:[])}function D(a,b,c,...d){C(a.K,'Defining service '+b);a.C(b,c,d,!1,!1)}function ua(a,b,c,...d){C(a.K,'Defining service '+b);a.C(b,c,d,!1,!0)}
211
+ da('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 ja=this||self;function B(a,b){a=a.split('.');let c=ja;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={Mj:()=>'object'===typeof window?window:'object'===typeof global?global:self};olympe.Mj().olympe=olympe;olympe.jB=(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 ka=(a,b)=>{a={level:a,message:b.map(c=>String(c)).join(' ')};for(const c of b){let d;if(null==(d=c)?0:d.stack)a.stackTrace||(a.stackTrace=''),a.stackTrace+=c.stack}return JSON.stringify(a)};
212
+ (()=>{const a=console.trace,b=console.debug,c=console.log,d=console.info,e=console.warn,f=console.error;console.trace=(...g)=>a(ka('TRACE',g));console.debug=(...g)=>b(ka('DEBUG',g));console.log=(...g)=>c(ka('LOG',g));console.info=(...g)=>d(ka('INFO',g));console.warn=(...g)=>e(ka('WARN',g));console.error=(...g)=>f(ka('ERROR',g))})();olympe.Na={};olympe.Na.node={};olympe.V={};olympe.V.cf={};olympe.V.cf.gn=class{process(a){const b=Object.keys(a.Zd);let c,d;c=0;for(d=b.length;c<d;c++)if(a.sd(b[c]).fm())throw Error('Service "'+b[c]+'" is defined as abstract and needs to be overridden');}};olympe.V.cf.gn.va=[olympe.V.cf.Uo];olympe.V.cf.hn=class{process(a){function b(g,h){if(0<=h.indexOf(g))throw Error('Circular dependency detected: '+h.join(' > ')+' > '+g);h=h.concat(g);if(f[g]&&(delete f[g],g=a.sd(g),c(g.li(),h),g=g.Rh,null!==g))for(let k=0,m=g.length;k<m;k++)c(g[k].li(),h)}function c(g,h){for(let k=0,m=g.length,n;k<m;k++)n=g[k],n instanceof olympe.V.qb&&b(n.W(),h)}function d(){for(const g in f)if(Object.prototype.hasOwnProperty.call(f,g))return g}var e=Object.keys(a.Zd);const f={};for(let g=0,h=e.length;g<h;g++)f[e[g]]=
213
+ !0;for(;void 0!==(e=d());)b(e,[])}};olympe.V.cf.hn.va=[olympe.V.cf.Uo];olympe.V.cf.Uo=class{process(){}};const la=[],ma=[];function na(a){const b=a.fb();b.debug('Registering configurations...');b.C++;la.forEach(c=>{C(a.K,'Registering configure callback '+(c.C?'for module '+c.C:''));a.F.push(c.F)});oa(b);b.debug('done registering')}function qa(a){const b=a.fb();b.debug('Running run callbacks of container...');b.C++;ma.forEach(c=>{const d=ra(a,c.li());a.K.debug('Calling run callback '+(c.C?'for module '+c.C:''));c.F.apply(null,d)});oa(b);b.debug('done calling run callbacks. DI process completed!')}
214
+ olympe.V.mn=class{constructor(){}static C(a,b){la.push(new olympe.V.rk(a,b))}static F(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');});ma.push(new olympe.V.rk(b,c,a))}};olympe.V.config=olympe.V.mn.C;olympe.V.run=olympe.V.mn.F;olympe.V.jk=class{constructor(){}getValue(){}};olympe.V.rk=class{constructor(a,b,c){this.F=a;this.G=[];this.C=b;if(void 0!==c){this.G=c;for(let d=0,e=c.length;d<e;d++)'string'===typeof c[d]&&(c[d]=new olympe.V.qb(c[d]))}}li(){return this.G}};function sa(a,b,c){let d=a.C[b];if(void 0===d){const e=a.F[b];if(void 0===e){if(c===olympe.V.Fg.C.cl)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.K.error('Error during instantiation of service '+b),f;}!e.G&&(a.C[b]=d)}return d}function ra(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.K.C++,f=b[e],d[e]=f instanceof olympe.V.jk?f.getValue(a):f,oa(a.K);return d}
215
+ olympe.V.Fg=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.K=new olympe.V.ro(c);a=olympe.V.R.Sf;if(void 0!==this.C[a])throw Error('Service "'+a+'" has already been instantiated');this.C[a]=this}fb(){return this.K}getParameter(a){return this.parameters[a.toLowerCase()]}};olympe.V.Fg.C={tr:'exception',cl:'null'};function ta(a,b,c){function d(f,g){let h,k,m;for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(k=f[h],m=g.concat((h.startsWith('#')?h.substring(1):h).toLowerCase()),'object'!==typeof k||null===k||h.startsWith('#')?e[m.join('.')]=k:d(k,m))}const e=a.parameters;d(b,c?[c]:[])}function D(a,b,c,...d){C(a.K,'Defining service '+b);a.C(b,c,d,!1,!1)}function ua(a,b,c,...d){C(a.K,'Defining service '+b);a.C(b,c,d,!1,!0)}
216
216
  function E(a,b,c,d,e=!1){C(a.K,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function va(a,b,c,d=!1){C(a.K,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function wa(a,b){C(a.K,'Defining abstract service '+b);a.C(b).F=!0}function xa(a,b){a.parameters[olympe.O.U.en.toLowerCase()]=b}function F(a,b,c){b=b.toLowerCase();Object.prototype.hasOwnProperty.call(a.parameters,b)||(a.parameters[b]=c)}
217
- olympe.V.ir=class{constructor(a){var b=ya,c=za;this.$d=Object.create(null);this.parameters=Object.create(null);this.L=[new olympe.V.df.gn,new olympe.V.df.hn];this.F=[];b&&ta(this,b);c&&ta(this,c,'version');a&&ta(this,a);a=this.getParameter(olympe.V.U.As);this.G=void 0!==a?a:3;this.K=new olympe.V.uo(this.G)}fb(){return this.K}C(a,b,c,d,e){const f=a instanceof olympe.V.qb?a.W():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.$d[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
218
- var g=this.$d[f];g.id=g.id+'!!'+ ++olympe.V.Ck.C;g.G=!0;g=g.id;c[h]=g;this.$d[g]=this.$d[f]}}this.$d[f]=new olympe.V.Ck(b,c,d||!1,f);return this.$d[f]}sd(a){a=this.$d[a];if(void 0===a)throw Error();return a}getParameter(a){return this.parameters[a.toLowerCase()]}compile(){const a=this.F;this.K.debug('Calling '+a.length+' configure callbacks');this.K.C++;a.forEach(b=>{C(this.K,'Calling callback');this.K.C++;b(this);oa(this.K)});oa(this.K);this.K.debug('Configuration summary: '+Object.keys(this.$d).length+
219
- ' definitions');this.K.debug('Compiling...');this.K.C++;this.L.forEach((b,c)=>{this.K.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});oa(this.K);this.K.debug('Compilation done, returning container');return new olympe.V.Fg(this.$d,this.parameters,this.G)}};olympe.V.Ck=class{constructor(a,b,c,d){this.L=a||null;this.P=!!c;this.C=[];this.F=!1;this.Ph=null;if(b){this.C=b;for(let e=0,f=b.length;e<f;e++)'string'===typeof b[e]&&(b[e]=new olympe.V.qb(b[e]))}this.id=d||'';this.G=!1}W(){return this.id}instantiate(a){const b=a.fb();b.debug('Resolving arguments for '+this.id);const c=this.L;let d=ra(a,this.C);const e=()=>{if(this.P)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};C(b,'Instantiating '+this.id);const f=olympe.D?olympe.D.og().run(()=>
220
- e()):e(),g=this.Ph;let h,k,m;if(null!==g&&0<g.length){b.C++;C(b,'Calling configuration callbacks:');k=0;for(m=g.length;k<m;k++)b.C++,h=g[k],C(b,'Calling additional configuration callback '+h.C),d=ra(a,h.ki()),d.push(f),h.F.apply(null,d),oa(b);oa(b)}C(b,'Done instantiating '+this.id);return f}ki(){return this.C}gm(){return this.F}config(a,b,c){null===this.Ph&&(this.Ph=[]);this.Ph.push(new olympe.V.sk(b,c,a))}};olympe.V.Ck.C=0;function oa(a){0<a.C&&a.C--}function C(a,b){1>=a.F&&Aa(a,'log','DI: '+b)}function Aa(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.V.uo=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&Aa(this,'log','DI: '+a)}info(a){3>=this.F&&Aa(this,'info','DI: '+a)}warn(a){4>=this.F&&Aa(this,'warn','DI: '+a)}error(a){5>=this.F&&Aa(this,'error','DI: '+a)}};olympe.V.ma=class extends olympe.V.jk{constructor(a){super();this.id=a}W(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.V.qb=class extends olympe.V.jk{constructor(a,b){super();this.id=a;this.C=b||olympe.V.Fg.C.tr}W(){return this.id}getValue(a){return sa(a,this.id,this.C)}};olympe.V.R={Sf:'di.Container',az:'di.PublicContainer'};olympe.V.U={As:'logging.di'};olympe.V.run([olympe.V.R.Sf],a=>{olympe.V.getParameter=b=>a.getParameter(b)});olympe.Z={};function Ba(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function Ca(){var a=Math.random();return Ba((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}let Da=Math.pow(2,32)-1;olympe.Z.hc=function(){return Ca()};olympe.Z.ef=function(){return Ca()};olympe.Z.zB=function(a,b=1){const c=a.substr(12,a.length-12);return Ba(parseInt(a.substr(0,12),16)+b)+c};
221
- olympe.Z.xB=function(a){return Ba(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Ea=0,Fa=0;olympe.Z.tu=function(){var a=(new Date).getTime();a<=Ea?4294967295===Fa?(Fa=Math.floor(Math.random()/4*Da),Ea+=1):Fa=Math.floor(Fa+(4294967295-Fa)/2):(Fa=Math.floor(Math.random()/4*Da),Ea=a);a='00000000'+Fa.toString(16);return Ba(Ea)+a.substr(a.length-8,8)};olympe.Z.OB=function(){for(let a=0;1E4>a;a++)console.log(olympe.Z.tu())};
222
- olympe.Z.jh=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.Z.rB=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.Z.nB=function(a,b){return(b?b:'UI')+'-'+a};olympe.Z.io=class{constructor(a){this.id=a||olympe.Z.io.C++}Ha(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.Z.io.C=0;olympe.Z.Fy=class{constructor(a,b,c,d,e,f){this.C=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.C[3*a+b]=c}get(a,b){return this.C[3*a+b]}};olympe.Z.Ng=function(a,b,c,d,e,f,g,h,k,m,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,m,n,p,q,0]};olympe.Z.Ng.F=function(a){return new olympe.Z.Ng(.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.Z.Ng.C=function(){return new olympe.Z.Ng(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.Z.Ng.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.Z.Ng.prototype.get=function(a,b){return this.values[5*a+b]};olympe.Z.Promise={};olympe.Z.Promise.gq=function(){};olympe.Z.Promise.Cm=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)})})};function Ga(a,b){var c=a.F;b=(new TextEncoder).encode(b);return c.call(a,b)}function Ha(a){return(new TextDecoder('utf8')).decode(a)}olympe.Z.qk=class{G(){}F(){}C(){}};olympe.Z.Zp=a=>a.replace('+','-').replace('/','_');olympe.Z.Yt=a=>a.replace('-','+').replace('_','/');function Ia(a){a.C=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.F&&a.F(d));if(0<a.values.size)Ia(a);else{let d;null==(d=a.G)||d.call(a)}},a.L)}function Ja(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function Ka(a,b){a.F=b;return a}
223
- olympe.Z.yl=class{constructor(a,b=a/2){this.timeout=a;this.L=b;this.values=new Map;this.G=this.F=this.C=null}add(a){this.values.set(a,Date.now());null===this.C&&Ia(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.C&&clearTimeout(this.C);this.C=null;let b;null==(b=this.G)||b.call(this)}return a}clear(){this.C&&clearTimeout(this.C);this.C=null;this.values.clear();return this}};function La(a,b){a.F=b;return a}function Ma(a,b){a.C.G=b}
224
- olympe.Z.xl=class{constructor(a){this.C=Ka(new olympe.Z.yl(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);let d;null==(d=this.F)||d.call(this,b,c)});this.values=new Map;this.F=null}set(a,b){this.values.set(a,b);this.C.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.C.delete(a)}clear(){this.C.clear();this.values.clear();return this}};function Na(a,b){return a+b&4294967295}
217
+ olympe.V.ir=class{constructor(a){var b=ya,c=za;this.Zd=Object.create(null);this.parameters=Object.create(null);this.L=[new olympe.V.cf.gn,new olympe.V.cf.hn];this.F=[];b&&ta(this,b);c&&ta(this,c,'version');a&&ta(this,a);a=this.getParameter(olympe.V.U.As);this.G=void 0!==a?a:3;this.K=new olympe.V.ro(this.G)}fb(){return this.K}C(a,b,c,d,e){const f=a instanceof olympe.V.qb?a.W():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.Zd[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
218
+ var g=this.Zd[f];g.id=g.id+'!!'+ ++olympe.V.Bk.C;g.G=!0;g=g.id;c[h]=g;this.Zd[g]=this.Zd[f]}}this.Zd[f]=new olympe.V.Bk(b,c,d||!1,f);return this.Zd[f]}sd(a){a=this.Zd[a];if(void 0===a)throw Error();return a}getParameter(a){return this.parameters[a.toLowerCase()]}compile(){const a=this.F;this.K.debug('Calling '+a.length+' configure callbacks');this.K.C++;a.forEach(b=>{C(this.K,'Calling callback');this.K.C++;b(this);oa(this.K)});oa(this.K);this.K.debug('Configuration summary: '+Object.keys(this.Zd).length+
219
+ ' definitions');this.K.debug('Compiling...');this.K.C++;this.L.forEach((b,c)=>{this.K.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});oa(this.K);this.K.debug('Compilation done, returning container');return new olympe.V.Fg(this.Zd,this.parameters,this.G)}};olympe.V.Bk=class{constructor(a,b,c,d){this.L=a||null;this.P=!!c;this.C=[];this.F=!1;this.Rh=null;if(b){this.C=b;for(let e=0,f=b.length;e<f;e++)'string'===typeof b[e]&&(b[e]=new olympe.V.qb(b[e]))}this.id=d||'';this.G=!1}W(){return this.id}instantiate(a){const b=a.fb();b.debug('Resolving arguments for '+this.id);const c=this.L;let d=ra(a,this.C);const e=()=>{if(this.P)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};C(b,'Instantiating '+this.id);const f=olympe.D?olympe.D.og().run(()=>
220
+ e()):e(),g=this.Rh;let h,k,m;if(null!==g&&0<g.length){b.C++;C(b,'Calling configuration callbacks:');k=0;for(m=g.length;k<m;k++)b.C++,h=g[k],C(b,'Calling additional configuration callback '+h.C),d=ra(a,h.li()),d.push(f),h.F.apply(null,d),oa(b);oa(b)}C(b,'Done instantiating '+this.id);return f}li(){return this.C}fm(){return this.F}config(a,b,c){null===this.Rh&&(this.Rh=[]);this.Rh.push(new olympe.V.rk(b,c,a))}};olympe.V.Bk.C=0;function oa(a){0<a.C&&a.C--}function C(a,b){1>=a.F&&Aa(a,'log','DI: '+b)}function Aa(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.V.ro=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&Aa(this,'log','DI: '+a)}info(a){3>=this.F&&Aa(this,'info','DI: '+a)}warn(a){4>=this.F&&Aa(this,'warn','DI: '+a)}error(a){5>=this.F&&Aa(this,'error','DI: '+a)}};olympe.V.ma=class extends olympe.V.jk{constructor(a){super();this.id=a}W(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.V.qb=class extends olympe.V.jk{constructor(a,b){super();this.id=a;this.C=b||olympe.V.Fg.C.tr}W(){return this.id}getValue(a){return sa(a,this.id,this.C)}};olympe.V.R={Sf:'di.Container',Zy:'di.PublicContainer'};olympe.V.U={As:'logging.di'};olympe.V.run([olympe.V.R.Sf],a=>{olympe.V.getParameter=b=>a.getParameter(b)});olympe.Z={};function Ba(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function Ca(){var a=Math.random();return Ba((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}let Da=Math.pow(2,32)-1;olympe.Z.hc=function(){return Ca()};olympe.Z.ef=function(){return Ca()};olympe.Z.xB=function(a,b=1){const c=a.substr(12,a.length-12);return Ba(parseInt(a.substr(0,12),16)+b)+c};
221
+ olympe.Z.vB=function(a){return Ba(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Ea=0,Fa=0;olympe.Z.su=function(){var a=(new Date).getTime();a<=Ea?4294967295===Fa?(Fa=Math.floor(Math.random()/4*Da),Ea+=1):Fa=Math.floor(Fa+(4294967295-Fa)/2):(Fa=Math.floor(Math.random()/4*Da),Ea=a);a='00000000'+Fa.toString(16);return Ba(Ea)+a.substr(a.length-8,8)};olympe.Z.LB=function(){for(let a=0;1E4>a;a++)console.log(olympe.Z.su())};
222
+ olympe.Z.kh=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.Z.pB=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.Z.lB=function(a,b){return(b?b:'UI')+'-'+a};olympe.Z.fo=class{constructor(a){this.id=a||olympe.Z.fo.C++}Ha(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.Z.fo.C=0;olympe.Z.Dy=class{constructor(a,b,c,d,e,f){this.C=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.C[3*a+b]=c}get(a,b){return this.C[3*a+b]}};olympe.Z.Ng=function(a,b,c,d,e,f,g,h,k,m,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,m,n,p,q,0]};olympe.Z.Ng.F=function(a){return new olympe.Z.Ng(.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.Z.Ng.C=function(){return new olympe.Z.Ng(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.Z.Ng.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.Z.Ng.prototype.get=function(a,b){return this.values[5*a+b]};olympe.Z.Promise={};olympe.Z.Promise.fq=function(){};olympe.Z.Promise.Bm=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)})})};function Ga(a,b){var c=a.F;b=(new TextEncoder).encode(b);return c.call(a,b)}function Ha(a){return(new TextDecoder('utf8')).decode(a)}olympe.Z.pk=class{G(){}F(){}C(){}};olympe.Z.Yp=a=>a.replace('+','-').replace('/','_');olympe.Z.Xt=a=>a.replace('-','+').replace('_','/');function Ia(a){a.C=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.F&&a.F(d));if(0<a.values.size)Ia(a);else{let d;null==(d=a.G)||d.call(a)}},a.L)}function Ja(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function Ka(a,b){a.F=b;return a}
223
+ olympe.Z.xl=class{constructor(a,b=a/2){this.timeout=a;this.L=b;this.values=new Map;this.G=this.F=this.C=null}add(a){this.values.set(a,Date.now());null===this.C&&Ia(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.C&&clearTimeout(this.C);this.C=null;let b;null==(b=this.G)||b.call(this)}return a}clear(){this.C&&clearTimeout(this.C);this.C=null;this.values.clear();return this}};function La(a,b){a.F=b;return a}function Ma(a,b){a.C.G=b}
224
+ olympe.Z.wl=class{constructor(a){this.C=Ka(new olympe.Z.xl(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);let d;null==(d=this.F)||d.call(this,b,c)});this.values=new Map;this.F=null}set(a,b){this.values.set(a,b);this.C.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.C.delete(a)}clear(){this.C.clear();this.values.clear();return this}};function Na(a,b){return a+b&4294967295}
225
225
  function Oa(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,
226
226
  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);
227
227
  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);
228
228
  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,
229
229
  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]=Na(c,a[0]);a[1]=Na(d,a[1]);a[2]=Na(e,a[2]);a[3]=Na(f,a[3])}function I(a,b,c,d,e,f){b=Na(Na(b,a),Na(d,f));return Na(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)}
230
230
  function Pa(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);Oa(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(Oa(a,g),f=0;16>f;f++)g[f]=0;g[14]=8*e;
231
- Oa(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'!==Pa('hello')&&(Na=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.Z.nb=Pa;olympe.Z.jw=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 m=null,n=null;var p=null;g&&(p=g.match(b),m=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):
232
- r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,WA:g||null,Hq:m||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,oB:f||null,parameters:b}};olympe.Z.HB=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=')))};olympe.Z.MB=function(a){let b='';for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=(b?'&':'?')+c+'='+encodeURIComponent(a[c]));return b};
233
- olympe.Z.Yu=a=>{var b=olympe.O.ae;const c=Object.keys(b).find(d=>b[d]===a);return void 0===c?null:c};olympe.Z.pm=(a,b)=>{if(b instanceof Object)for(const c of Object.keys(b)){const d=b[c];d instanceof Object&&void 0!==a[c]?olympe.Z.pm(a[c],d):a[c]=d}};olympe.Z.Cd=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.Z.pm(d,e);b(`conf.d/${a}`,f=>{olympe.Z.pm(d,f);c(d)})})};olympe.Z.VA=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Zl(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.Z.Vw=class{constructor(a,b,c,d){this.from=a;this.target=b;this.C=c;this.F=d}toString(){return`(${this.from.toString()}, ${this.target.toString()}, ${this.C.toString()}, ${this.F.toString()})`}};olympe.Z.Ds=class{constructor(a,b){this.start=a;this.end=b}};olympe.Z.Ds.C={ty:'left',iz:'right',Tw:'bottom',rA:'top'};function Qa(a){return`${a.C}.${a.F}.${a.G}`}
234
- olympe.Z.bf=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.L=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.Z.bf.C;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.Z.bf.C:new olympe.Z.bf(b,c,d,a[4])}Tj(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}Ci(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<
235
- a.G}Ha(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.L?`-${this.L}`:'')}};olympe.Z.bf.C=new olympe.Z.bf(Number.NaN,Number.NaN,Number.NaN);olympe.Z.R={Cg:'utils.binaryConverter',Tq:'utils.base64Converter'};olympe.V.config(a=>{wa(a,olympe.Z.R.Cg);va(a,olympe.Z.R.Tq,olympe.Z.R.Cg,!0)},'Utils services');olympe.V.run([olympe.Z.R.Cg],a=>{olympe.Z.De=()=>a});olympe.la={};olympe.la.Ab=class{$(){}L(){}C(){}na(){}P(){}Da(){}da(){}ga(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.la.Ab.prototype.fatal=olympe.la.Ab.prototype.fatal;olympe.la.Ab.prototype.error=olympe.la.Ab.prototype.error;olympe.la.Ab.prototype.warn=olympe.la.Ab.prototype.warn;olympe.la.Ab.prototype.info=olympe.la.Ab.prototype.info;olympe.la.Ab.prototype.log=olympe.la.Ab.prototype.log;olympe.la.Ab.prototype.debug=olympe.la.Ab.prototype.debug;olympe.la.Ab.prototype.trace=olympe.la.Ab.prototype.trace;
236
- olympe.la.Ab.C={vt:0,uf:1,zs:2,bo:3,It:4,Db:5,wr:6,bl:7};olympe.la.Ab.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.la.Ba=class{Fc(){}};olympe.la.Vd={};function Ra(a,b,c,d){a.Wa[b](`[OLYMPE.${c}]:`,d.join(' '));if(0<a.T.size){var e=new Date;e=('00'+e.getHours()).substring(-2)+':'+('00'+e.getMinutes()).substring(-2)+':'+('00'+e.getSeconds()).substring(-2)+'.'+('00'+e.getMilliseconds()).substring(-3);for(const f of a.T.values())f(e,c,b,...d)}}
237
- olympe.la.Vd.Ab=class{constructor(a,b){this.name=a;this.F=b;this.G=a.toUpperCase();this.T=new Map;this.Wa=console}$(){return this.F}L(){return this.F<=olympe.la.Ab.C.vt}C(){return this.F<=olympe.la.Ab.C.uf}P(){return this.F<=olympe.la.Ab.C.zs}na(){return this.F<=olympe.la.Ab.C.bo}Da(){return this.F<=olympe.la.Ab.C.It}da(){return this.F<=olympe.la.Ab.C.Db}ga(){return this.F<=olympe.la.Ab.C.wr}trace(...a){this.L()&&Ra(this,'trace',this.G,a)}debug(...a){this.C()&&Ra(this,'debug',this.G,a)}log(...a){this.P()&&
238
- Ra(this,'log',this.G,a)}info(...a){this.na()&&Ra(this,'info',this.G,a)}warn(...a){this.Da()&&Ra(this,'warn',this.G,a)}error(...a){this.da()&&Ra(this,'error',this.G,a)}fatal(...a){this.ga()&&Ra(this,'error',this.G,a)}};olympe.la.Vd.Ab.va=[olympe.la.Ab];olympe.la.Vd.Ba=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.K=this.Fc('logging');this.K.info('Logging initialized, global log level is '+olympe.la.Ab.F[b])}Fc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.la.U.Zq}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.la.U.kt}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&
239
- (d=!0===this.C.getParameter(c));b=new olympe.la.Vd.Ab(a,b,d);this.channels.set(a,b)}return b}};olympe.la.Vd.Ba.va=[olympe.la.Ba];olympe.la.R={Ga:'logging.Manager'};olympe.la.U={On:'logging',Pn:'logging.showLogLevel',Zq:'logging',kt:'showLogLevel'};olympe.V.config(function(a){F(a,olympe.la.U.On,olympe.la.Ab.C.bo);F(a,olympe.la.U.Pn,!0);ua(a,olympe.la.R.Ga,olympe.la.Vd.Ba,olympe.V.R.Sf,new olympe.V.ma(olympe.la.U.On),new olympe.V.ma(olympe.la.U.Pn))},'olympe.logging');olympe.V.run([olympe.la.R.Ga],a=>{olympe.la.fb=b=>a.Fc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.U={Ao:'df.nodeCreationThreshold'};const Sa=[];function Ua(){}function Va(){}olympe.D.H=class a{constructor(b,c,d){this.C=void 0===b?Ua:b;this.F=void 0===c?Sa:c;this.$=d}static L(){var b=[];return void 0===b||0===b.length?olympe.D.H.da:new a(Va,b)}L(){return this.C?this.C():void 0}G(){return this.F?this.F:Sa}P(){return null===this.C&&null===this.F}T(){return this.C===Va}};olympe.D.H.$=new olympe.D.H;olympe.D.H.C=new olympe.D.H(null,null);olympe.D.H.da=new olympe.D.H(Va);olympe.D.H.G=new olympe.D.H(()=>olympe.D.aa);
240
- olympe.D.H.F=new olympe.D.H(()=>olympe.D.Ka);olympe.D.H.P=new olympe.D.H(()=>olympe.D.ea);olympe.D.H.T=new olympe.D.H(()=>olympe.D.Kb);olympe.D.Ig=class{W(){return''}zd(){return''}destroy(){}gb(){return!1}Bc(){return!1}run(a,...b){return a(...b)}G(a){return a}getParent(){return null}Lf(){}jd(){}qd(){}Hj(){}na(){}onDestroy(){return''}pf(){}$(){return''}ze(){}};olympe.D.Ig.prototype.offDestroy=olympe.D.Ig.prototype.pf;olympe.D.Ig.prototype.onDestroy=olympe.D.Ig.prototype.onDestroy;let Wa=0;olympe.V.run([new olympe.V.ma(olympe.D.U.Ao)],()=>{});
241
- olympe.D.Jb=class{constructor(a='SimpleContext',b){++Wa;this.ub=new Map;this.mb=new Map;this.Wa=new Map;this.Wb=0;this.name=a;this.id=String(Wa);this.L=this.Eb=!1;(this.da=void 0===b?olympe.D.Ma():b)&&this.da.jd(this);this.debug=!1}W(){return this.id}zd(){return this.name}run(a,...b){if(!this.Eb){var c=olympe.D.Dq(this);a=a(...b);c&&olympe.D.Dq(c);return a}}G(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.Eb&&!this.L){this.L=!0;this.na();for(const a of this.mb.keys())this.mb.has(a)&&this.mb.get(a)();
242
- this.mb.clear();this.Wa.clear();this.da&&(this.da.qd(this,!1),this.da=null);this.Eb=!0;this.L=!1;this.na()}}gb(){return this.Eb}Bc(){return this.L}jd(a){if(!this.Eb){var b;olympe.D.Ya(a)?b=a.Aa:olympe.D.jm(a)&&(b=a);b&&this.ub.set(b.W(),b)}}qd(a,b=!0){let c;olympe.D.Ya(a)?c=a.Aa:olympe.D.jm(a)&&(c=a);c&&this.ub.has(c.W())&&(b&&c.Hj(this),this.ub.delete(c.W()))}Hj(){this.da=null;this.destroy()}na(){const a=this.ub;for(const b of a.keys())a.has(b)&&a.get(b).Hj(this);this.ub.clear();for(const b of this.Wa.keys())this.Wa.has(b)&&
243
- this.Wa.get(b)();this.Wa.clear()}onDestroy(a,b){void 0===b&&(++this.Wb,b=String(this.Wb));this.mb.set(b,a);return b}pf(a){this.mb.delete(a)}$(a){if(void 0===b){++this.Wb;var b=String(this.Wb)}this.Wa.set(b,a);return b}ze(a){this.Wa.delete(a)}Lf(a){this.da&&this.da.qd(this,!1);(this.da=a||null)&&this.da.jd(this)}getParent(){return this.da}};olympe.D.pp=class extends olympe.D.Jb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}pf(){}};olympe.D.Ig.va=[olympe.D.Ig];let Xa=0;
244
- function Ya(a,b){a.ga||(a.ga=new Map);a.ga.set(b.W(),b);switch(b.Rc()){case olympe.D.Node.C.Og:break;case olympe.D.Node.C.Yg:break;case olympe.D.Node.C.cj:case olympe.D.Node.C.wf:olympe.D.K.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.Jg:Za(a,olympe.D.Node.C.Jg);break;case olympe.D.Node.C.OBSOLETE:a.uc=!0;a.C!==olympe.D.Node.C.Jg&&Za(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.vf:olympe.D.K.warn('Adding a destroyed node as upstream => should never happen!');break;
231
+ Oa(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'!==Pa('hello')&&(Na=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.Z.nb=Pa;olympe.Z.iw=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 m=null,n=null;var p=null;g&&(p=g.match(b),m=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):
232
+ r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,UA:g||null,Gq:m||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,mB:f||null,parameters:b}};olympe.Z.FB=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=')))};olympe.Z.JB=function(a){let b='';for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=(b?'&':'?')+c+'='+encodeURIComponent(a[c]));return b};
233
+ olympe.Z.Xu=a=>{var b=olympe.O.$d;const c=Object.keys(b).find(d=>b[d]===a);return void 0===c?null:c};olympe.Z.om=(a,b)=>{if(b instanceof Object)for(const c of Object.keys(b)){const d=b[c];d instanceof Object&&void 0!==a[c]?olympe.Z.om(a[c],d):a[c]=d}};olympe.Z.ge=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.Z.om(d,e);b(`conf.d/${a}`,f=>{olympe.Z.om(d,f);c(d)})})};olympe.Z.TA=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Yl(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.Z.Uw=class{constructor(a,b,c,d){this.from=a;this.target=b;this.C=c;this.F=d}toString(){return`(${this.from.toString()}, ${this.target.toString()}, ${this.C.toString()}, ${this.F.toString()})`}};olympe.Z.Ds=class{constructor(a,b){this.start=a;this.end=b}};olympe.Z.Ds.C={qy:'left',gz:'right',Sw:'bottom',pA:'top'};function Qa(a){return`${a.C}.${a.F}.${a.G}`}
234
+ olympe.Z.af=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.L=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.Z.af.C;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.Z.af.C:new olympe.Z.af(b,c,d,a[4])}Tj(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}Ci(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<
235
+ a.G}Ha(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.L?`-${this.L}`:'')}};olympe.Z.af.C=new olympe.Z.af(Number.NaN,Number.NaN,Number.NaN);olympe.Z.R={Cg:'utils.binaryConverter',Sq:'utils.base64Converter'};olympe.V.config(a=>{wa(a,olympe.Z.R.Cg);va(a,olympe.Z.R.Sq,olympe.Z.R.Cg,!0)},'Utils services');olympe.V.run([olympe.Z.R.Cg],a=>{olympe.Z.De=()=>a});olympe.la={};olympe.la.zb=class{$(){}L(){}C(){}na(){}P(){}Da(){}da(){}ga(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.la.zb.prototype.fatal=olympe.la.zb.prototype.fatal;olympe.la.zb.prototype.error=olympe.la.zb.prototype.error;olympe.la.zb.prototype.warn=olympe.la.zb.prototype.warn;olympe.la.zb.prototype.info=olympe.la.zb.prototype.info;olympe.la.zb.prototype.log=olympe.la.zb.prototype.log;olympe.la.zb.prototype.debug=olympe.la.zb.prototype.debug;olympe.la.zb.prototype.trace=olympe.la.zb.prototype.trace;
236
+ olympe.la.zb.C={vt:0,uf:1,zs:2,$n:3,Ht:4,Cb:5,wr:6,al:7};olympe.la.zb.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.la.Ba=class{Fc(){}};olympe.la.Ud={};function Ra(a,b,c,d){a.Wa[b](`[OLYMPE.${c}]:`,d.join(' '));if(0<a.T.size){var e=new Date;e=('00'+e.getHours()).substring(-2)+':'+('00'+e.getMinutes()).substring(-2)+':'+('00'+e.getSeconds()).substring(-2)+'.'+('00'+e.getMilliseconds()).substring(-3);for(const f of a.T.values())f(e,c,b,...d)}}
237
+ olympe.la.Ud.zb=class{constructor(a,b){this.name=a;this.F=b;this.G=a.toUpperCase();this.T=new Map;this.Wa=console}$(){return this.F}L(){return this.F<=olympe.la.zb.C.vt}C(){return this.F<=olympe.la.zb.C.uf}P(){return this.F<=olympe.la.zb.C.zs}na(){return this.F<=olympe.la.zb.C.$n}Da(){return this.F<=olympe.la.zb.C.Ht}da(){return this.F<=olympe.la.zb.C.Cb}ga(){return this.F<=olympe.la.zb.C.wr}trace(...a){this.L()&&Ra(this,'trace',this.G,a)}debug(...a){this.C()&&Ra(this,'debug',this.G,a)}log(...a){this.P()&&
238
+ Ra(this,'log',this.G,a)}info(...a){this.na()&&Ra(this,'info',this.G,a)}warn(...a){this.Da()&&Ra(this,'warn',this.G,a)}error(...a){this.da()&&Ra(this,'error',this.G,a)}fatal(...a){this.ga()&&Ra(this,'error',this.G,a)}};olympe.la.Ud.zb.va=[olympe.la.zb];olympe.la.Ud.Ba=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.K=this.Fc('logging');this.K.info('Logging initialized, global log level is '+olympe.la.zb.F[b])}Fc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.la.U.Yq}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.la.U.kt}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&
239
+ (d=!0===this.C.getParameter(c));b=new olympe.la.Ud.zb(a,b,d);this.channels.set(a,b)}return b}};olympe.la.Ud.Ba.va=[olympe.la.Ba];olympe.la.R={Ga:'logging.Manager'};olympe.la.U={On:'logging',Pn:'logging.showLogLevel',Yq:'logging',kt:'showLogLevel'};olympe.V.config(function(a){F(a,olympe.la.U.On,olympe.la.zb.C.$n);F(a,olympe.la.U.Pn,!0);ua(a,olympe.la.R.Ga,olympe.la.Ud.Ba,olympe.V.R.Sf,new olympe.V.ma(olympe.la.U.On),new olympe.V.ma(olympe.la.U.Pn))},'olympe.logging');olympe.V.run([olympe.la.R.Ga],a=>{olympe.la.fb=b=>a.Fc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.U={yo:'df.nodeCreationThreshold'};const Sa=[];function Ua(){}function Va(){}olympe.D.H=class a{constructor(b,c,d){this.C=void 0===b?Ua:b;this.F=void 0===c?Sa:c;this.$=d}static L(){var b=[];return void 0===b||0===b.length?olympe.D.H.da:new a(Va,b)}L(){return this.C?this.C():void 0}G(){return this.F?this.F:Sa}P(){return null===this.C&&null===this.F}T(){return this.C===Va}};olympe.D.H.$=new olympe.D.H;olympe.D.H.C=new olympe.D.H(null,null);olympe.D.H.da=new olympe.D.H(Va);olympe.D.H.G=new olympe.D.H(()=>olympe.D.aa);
240
+ olympe.D.H.F=new olympe.D.H(()=>olympe.D.Ka);olympe.D.H.P=new olympe.D.H(()=>olympe.D.ea);olympe.D.H.T=new olympe.D.H(()=>olympe.D.Kb);olympe.D.Ig=class{W(){return''}zd(){return''}destroy(){}gb(){return!1}Bc(){return!1}run(a,...b){return a(...b)}G(a){return a}getParent(){return null}df(){}ud(){}qd(){}Hj(){}na(){}onDestroy(){return''}pf(){}$(){return''}ze(){}};olympe.D.Ig.prototype.offDestroy=olympe.D.Ig.prototype.pf;olympe.D.Ig.prototype.onDestroy=olympe.D.Ig.prototype.onDestroy;let Wa=0;olympe.V.run([new olympe.V.ma(olympe.D.U.yo)],()=>{});
241
+ olympe.D.Jb=class{constructor(a='SimpleContext',b){++Wa;this.ub=new Map;this.mb=new Map;this.Wa=new Map;this.Vb=0;this.name=a;this.id=String(Wa);this.L=this.Db=!1;(this.da=void 0===b?olympe.D.Ma():b)&&this.da.ud(this);this.debug=!1}W(){return this.id}zd(){return this.name}run(a,...b){if(!this.Db){var c=olympe.D.Cq(this);a=a(...b);c&&olympe.D.Cq(c);return a}}G(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.Db&&!this.L){this.L=!0;this.na();for(const a of this.mb.keys())this.mb.has(a)&&this.mb.get(a)();
242
+ this.mb.clear();this.Wa.clear();this.da&&(this.da.qd(this,!1),this.da=null);this.Db=!0;this.L=!1;this.na()}}gb(){return this.Db}Bc(){return this.L}ud(a){if(!this.Db){var b;olympe.D.Ya(a)?b=a.Aa:olympe.D.im(a)&&(b=a);b&&this.ub.set(b.W(),b)}}qd(a,b=!0){let c;olympe.D.Ya(a)?c=a.Aa:olympe.D.im(a)&&(c=a);c&&this.ub.has(c.W())&&(b&&c.Hj(this),this.ub.delete(c.W()))}Hj(){this.da=null;this.destroy()}na(){const a=this.ub;for(const b of a.keys())a.has(b)&&a.get(b).Hj(this);this.ub.clear();for(const b of this.Wa.keys())this.Wa.has(b)&&
243
+ this.Wa.get(b)();this.Wa.clear()}onDestroy(a,b){void 0===b&&(++this.Vb,b=String(this.Vb));this.mb.set(b,a);return b}pf(a){this.mb.delete(a)}$(a){if(void 0===b){++this.Vb;var b=String(this.Vb)}this.Wa.set(b,a);return b}ze(a){this.Wa.delete(a)}df(a){this.da&&this.da.qd(this,!1);(this.da=a||null)&&this.da.ud(this)}getParent(){return this.da}};olympe.D.np=class extends olympe.D.Jb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}pf(){}};olympe.D.Ig.va=[olympe.D.Ig];let Xa=0;
244
+ function Ya(a,b){a.ga||(a.ga=new Map);a.ga.set(b.W(),b);switch(b.Rc()){case olympe.D.Node.C.Og:break;case olympe.D.Node.C.Zg:break;case olympe.D.Node.C.cj:case olympe.D.Node.C.wf:olympe.D.K.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.Jg:Za(a,olympe.D.Node.C.Jg);break;case olympe.D.Node.C.OBSOLETE:a.nc=!0;a.C!==olympe.D.Node.C.Jg&&Za(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.vf:olympe.D.K.warn('Adding a destroyed node as upstream => should never happen!');break;
245
245
  default:olympe.D.K.warn('Unknown state, investigate: ',b.Rc())}$a(b,a)}
246
- function ab(a){if(a.cd){var b=[],c=[];if(a.qf)if(a.qf instanceof olympe.D.Node)if(bb(a.qf))b=a.qf.xb;else return;else b=a.qf;else b=null;if(null!==a.Da){const e=a.Jf;for(let f=0,g=a.Da.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.Da[f];if(bb(h))c.push(h.xb);else return}else c.push(a.Da[f])}if(a.cd instanceof Function)var d=a.cd;else b&&(b[a.cd]||olympe.D.K.warn('looks like you forget a cast somewhere around '+a.cd),d=b[a.cd]);a.run(()=>{a.na();if(void 0!==d){const e=d.apply(b,c);e&&e.Up?
247
- cb(a,e.Aa):e instanceof olympe.D.Node?cb(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&Za(a,olympe.D.Node.C.Yg))}else db(a)})}}function N(a){void 0===a.ac&&(a.ac=a.valueType===olympe.D.Proxy?eb(void 0,a.ye):eb(a.valueType,a.ye),a.ac.Aa=a);return a.ac}function fb(a){void 0!==a.P&&(gb(a.P,a),a.P=void 0)}function hb(a){if(a.C===olympe.D.Node.C.OBSOLETE&&(a.C=olympe.D.Node.C.Yg,null!==a.T))for(const b of a.T.values())ib(b)}function Za(a,b){b!==a.C&&(a.C=b)}
248
- function jb(a){if(a.C!==olympe.D.Node.C.OBSOLETE&&a.C!==olympe.D.Node.C.cj&&a.C!==olympe.D.Node.C.Og&&a.C!==olympe.D.Node.C.Jg){Za(a,olympe.D.Node.C.cj);var b=a.T;if(b)for(const c of b.values())b.has(c.W())&&jb(c);Za(a,olympe.D.Node.C.OBSOLETE)}}function kb(a,b,c){if(a.C!==olympe.D.Node.C.wf)if(b===a.P)L(a,c,!0);else{if(a.C===olympe.D.Node.C.OBSOLETE||a.C===olympe.D.Node.C.cj)a.uc=!0;ab(a)}}
249
- function L(a,b,c){b instanceof olympe.D.Node&&(olympe.D.K.warn('We are setting the value of a node as a node, that should never happen?'),b=b.xb);a.Qb||c||void 0===a.P||fb(a);if(void 0!==b){if((a.Qb||a.C===olympe.D.Node.C.Yg||a.C===olympe.D.Node.C.OBSOLETE)&&!olympe.D.Ya(b)&&void 0!==a.xb){if(null===b&&null===a.xb){hb(a);return}if(null!==b&&null!==a.xb&&(b.valueOf()===a.xb.valueOf()||a.xb.Ha&&a.xb.Ha(b))){hb(a);return}}if(!0===a.Qb)olympe.D.K.error("Circular dependency detected: updating a downstream node caused this node's (#"+
250
- a.W()+') value to get updated !');else{a.C===olympe.D.Node.C.vf&&olympe.D.K.warn(`trying to set a value on a destroyed node (#${a.W()} ${a.Xc?', '+a.Xc:''})`);a.C===olympe.D.Node.C.wf&&olympe.D.K.warn(`trying to set a value on a node being destroyed (#${a.W()} ${a.Xc?', '+a.Xc:''})`);a.Qb=!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
251
- Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Ka?(c=olympe.D.sb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.aa?(c=olympe.D.oa(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.ea&&(c=olympe.D.Ib(c),d=!1)));a.xb=c;Za(a,olympe.D.Node.C.Yg);if(b=a.T){d=0;for(const f of b.values())0<d&&jb(f),d++;for(const f of b.values())kb(f,a,c)}a.Qb=!1}}}
252
- function lb(a,b){if(a.C!==olympe.D.Node.C.wf&&a.C!==olympe.D.Node.C.vf&&(a.C!==olympe.D.Node.C.Og||a.cd)){var c=void 0!==a.defaultValue;a.cd&&b!==a.P&&a.na();if(c)L(a,a.defaultValue,!0);else if(a.xb=void 0,Za(a,olympe.D.Node.C.Og),b=a.T)for(const d of b.values())lb(d,a)}}function db(a){if(a.C!==olympe.D.Node.C.Jg){Za(a,olympe.D.Node.C.Jg);var b=a.T;if(b)for(const c of b.values())db(c);a.na();void 0!==a.P&&fb(a);a.xb=a.defaultValue}}function bb(a){return a.C===olympe.D.Node.C.Yg}
253
- function cb(a,b){b===a?olympe.D.K.error('Setting a node as provider of itself. Ignoring'):(a.P&&a.P!==b&&fb(a),$a(b,a),bb(b)?L(a,b.xb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):lb(a),a.P=b)}function mb(a,b){a.cd&&(a.cd=void 0);a.Xc='Repeater';cb(a,b)}function ib(a){a.P?hb(a):null!==a.ga&&0===Array.from(a.ga.values()).filter(b=>!bb(b)).length&&(a.uc&&(a.uc=!1,ab(a)),hb(a))}
246
+ function ab(a){if(a.dd){var b=[],c=[];if(a.qf)if(a.qf instanceof olympe.D.Node)if(bb(a.qf))b=a.qf.xb;else return;else b=a.qf;else b=null;if(null!==a.Da){const e=a.Kf;for(let f=0,g=a.Da.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.Da[f];if(bb(h))c.push(h.xb);else return}else c.push(a.Da[f])}if(a.dd instanceof Function)var d=a.dd;else b&&(b[a.dd]||olympe.D.K.warn('looks like you forget a cast somewhere around '+a.dd),d=b[a.dd]);a.run(()=>{a.na();if(void 0!==d){const e=d.apply(b,c);e&&e.Tp?
247
+ cb(a,e.Aa):e instanceof olympe.D.Node?cb(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&Za(a,olympe.D.Node.C.Zg))}else db(a)})}}function N(a){void 0===a.$b&&(a.$b=a.valueType===olympe.D.Proxy?eb(void 0,a.ye):eb(a.valueType,a.ye),a.$b.Aa=a);return a.$b}function fb(a){void 0!==a.P&&(gb(a.P,a),a.P=void 0)}function hb(a){if(a.C===olympe.D.Node.C.OBSOLETE&&(a.C=olympe.D.Node.C.Zg,null!==a.T))for(const b of a.T.values())ib(b)}function Za(a,b){b!==a.C&&(a.C=b)}
248
+ function jb(a){if(a.C!==olympe.D.Node.C.OBSOLETE&&a.C!==olympe.D.Node.C.cj&&a.C!==olympe.D.Node.C.Og&&a.C!==olympe.D.Node.C.Jg){Za(a,olympe.D.Node.C.cj);var b=a.T;if(b)for(const c of b.values())b.has(c.W())&&jb(c);Za(a,olympe.D.Node.C.OBSOLETE)}}function kb(a,b,c){if(a.C!==olympe.D.Node.C.wf)if(b===a.P)L(a,c,!0);else{if(a.C===olympe.D.Node.C.OBSOLETE||a.C===olympe.D.Node.C.cj)a.nc=!0;ab(a)}}
249
+ function L(a,b,c){b instanceof olympe.D.Node&&(olympe.D.K.warn('We are setting the value of a node as a node, that should never happen?'),b=b.xb);a.Pb||c||void 0===a.P||fb(a);if(void 0!==b){if((a.Pb||a.C===olympe.D.Node.C.Zg||a.C===olympe.D.Node.C.OBSOLETE)&&!olympe.D.Ya(b)&&void 0!==a.xb){if(null===b&&null===a.xb){hb(a);return}if(null!==b&&null!==a.xb&&(b.valueOf()===a.xb.valueOf()||a.xb.Ha&&a.xb.Ha(b))){hb(a);return}}if(!0===a.Pb)olympe.D.K.error("Circular dependency detected: updating a downstream node caused this node's (#"+
250
+ a.W()+') value to get updated !');else{a.C===olympe.D.Node.C.vf&&olympe.D.K.warn(`trying to set a value on a destroyed node (#${a.W()} ${a.Xc?', '+a.Xc:''})`);a.C===olympe.D.Node.C.wf&&olympe.D.K.warn(`trying to set a value on a node being destroyed (#${a.W()} ${a.Xc?', '+a.Xc:''})`);a.Pb=!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
251
+ Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Ka?(c=olympe.D.sb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.aa?(c=olympe.D.oa(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.ea&&(c=olympe.D.Ib(c),d=!1)));a.xb=c;Za(a,olympe.D.Node.C.Zg);if(b=a.T){d=0;for(const f of b.values())0<d&&jb(f),d++;for(const f of b.values())kb(f,a,c)}a.Pb=!1}}}
252
+ function lb(a,b){if(a.C!==olympe.D.Node.C.wf&&a.C!==olympe.D.Node.C.vf&&(a.C!==olympe.D.Node.C.Og||a.dd)){var c=void 0!==a.defaultValue;a.dd&&b!==a.P&&a.na();if(c)L(a,a.defaultValue,!0);else if(a.xb=void 0,Za(a,olympe.D.Node.C.Og),b=a.T)for(const d of b.values())lb(d,a)}}function db(a){if(a.C!==olympe.D.Node.C.Jg){Za(a,olympe.D.Node.C.Jg);var b=a.T;if(b)for(const c of b.values())db(c);a.na();void 0!==a.P&&fb(a);a.xb=a.defaultValue}}function bb(a){return a.C===olympe.D.Node.C.Zg}
253
+ function cb(a,b){b===a?olympe.D.K.error('Setting a node as provider of itself. Ignoring'):(a.P&&a.P!==b&&fb(a),$a(b,a),bb(b)?L(a,b.xb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):lb(a),a.P=b)}function mb(a,b){a.dd&&(a.dd=void 0);a.Xc='Repeater';cb(a,b)}function ib(a){a.P?hb(a):null!==a.ga&&0===Array.from(a.ga.values()).filter(b=>!bb(b)).length&&(a.nc&&(a.nc=!1,ab(a)),hb(a))}
254
254
  function $a(a,b){a.T||(a.T=new Map);a.T.set(b.W(),b);a.C===olympe.D.Node.C.vf&&olympe.D.K.warn('adding a downstream node on a deleted one (#'+a.W()+') !')}function gb(a,b){a.T&&(b=b.W(),a.T.has(b)&&(a.T.delete(b),nb(a)))}function nb(a){if(null===a.getParent()){var b=a.T;b&&0<b.size||a.destroy()}}
255
- olympe.D.Node=class extends olympe.D.Jb{constructor({valueType:a,cd:b,mw:c=!0,qf:d,fm:e,debug:f=!1,Jf:g=null,Xc:h='Node',fi:k}={}){++Xa;super(String(Xa));this.debug=!!f;this.Xc=h;h&&'string'===typeof h||(b?this.Xc=b.name?b.name:'anon()':this.Xc='Node');this.Da=e&&0<e.length?e:null;this.Jf=g&&0<g.length?g:null;this.valueType=a;this.xb=void 0;this.Qb=!1;this.C=olympe.D.Node.C.Og;this.uc=!1;this.T=this.ga=null;this.cd=b;this.qf=d||null;this.defaultValue=this.ac=this.P=void 0;this.fi=k;d&&d instanceof
256
- olympe.D.Node&&Ya(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Ya(this,a);c&&ab(this)}zg(a){this.defaultValue=a;this.C===olympe.D.Node.C.Og&&L(this,a,!0);return this}gi(a){this.valueType=a}Hb(){return this.valueType||Object}Rc(){return this.C}gb(){return this.C===olympe.D.Node.C.vf}Bc(){return this.C===olympe.D.Node.C.wf}ye(...a){if(this.fi instanceof Function)return this.fi(...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.Rc();a!==olympe.D.Node.C.wf&&
257
- a!==olympe.D.Node.C.vf||olympe.D.K.warn('Calling a function on a destroyed node!!!',this);a=d.G();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.D.Ya(g)&&b.push(g.Aa);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.bh&&(e[g]=f.Aa,b.push(g));return N(new olympe.D.Node({valueType:d.L(),cd:c,qf:this,fm:e,debug:!1,Jf:b,Xc:'Proxy.'+c+'()'}))}Hj(a){if(null===this.getParent())olympe.D.K.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.K.warn('Investigate a potential issue in creator-createe link: create node mismatch',
258
- a,this.getParent());return}this.Lf(null);nb(this)}destroy(){var a=this.C;if(a!==olympe.D.Node.C.wf&&a!==olympe.D.Node.C.vf){Za(this,olympe.D.Node.C.wf);if(a=this.T){for(const c of a.values())if(a.has(c.W())){var b=c;b.ga&&b.ga.delete(this.W());b.P&&b.P.W()===this.W()?b.P=void 0:b.destroy()}a.clear()}this.T=null;super.destroy();if(this.ga){for(const c of this.ga.values())this.ga.has(c.W())&&gb(c,this);this.ga.clear()}this.ga=null;this.P&&(gb(this.P,this),this.P=void 0);this.xb=void 0;this.Da&&(this.Da.length=
259
- 0,this.Da=null);this.Jf&&(this.Jf.length=0,this.Jf=null);this.fi=this.cd=void 0;this.defaultValue=this.qf=null;this.Xc=`** Destroyed ** ${this.Xc}`;Za(this,olympe.D.Node.C.vf)}}zd(){return this.Xc}};olympe.D.Node.F='rootNode';olympe.D.Node.C={Og:0,Yg:1,Jg:3,cj:4,OBSOLETE:5,wf:6,vf:7};function eb(a,b){if('function'!==typeof a)return new olympe.D.Proxy(a,b);var c=olympe.D.Proxy.prototype;void 0===a.prototype&&olympe.D.K.error('investigate');c=Object.create(ob(c,a.prototype));c.Ej=a;c.Vp=b;return c}function ob(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.il)||Object.defineProperty(b,olympe.D.Proxy.il,{enumerable:!1,configurable:!1,writable:!1,value:pb(a,b)});return b[olympe.D.Proxy.il]}
260
- function qb(a,b){if(a.Ej!==b){a.Ej=b;b.prototype||olympe.D.K.error('Cast not possible, provided type is not a valid type!');var c=ob(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Aa&&a.Aa.gi(b)}}
261
- function pb(a,b){let c={};if(b.prototype)olympe.D.K.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(ob(a,b.__proto__));else return olympe.D.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].J;null===e||e&&e.P()?c[d]=function(...f){var g=this.Aa;if(g&&bb(g)&&(g=g.xb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.H.$,c[d]=function(...f){f=this.Vp.call(this.Aa,
262
- ...f,e,d);const g=e.$;if(g){const h=this.Aa.xb;h&&h[g]&&qb(f,h[g])}return e.T()?this:f})}});return c}function O(a,b){L(a.Aa,b)}function rb(a){lb(a.Aa)}function sb(a,b){mb(a.Aa,olympe.D.mf(b)?b:b.Aa)}function tb(a,b){olympe.D.Ya(b)||olympe.D.mf(b)?sb(a,b):O(a,b)}
263
- olympe.D.Proxy=class{constructor(a,b){this.Aa=null;this.Ej=a;this.Vp=b}static Ya(a){return!(!a||!a.bh)}Ha(a){return olympe.D.sa([this,a],(b,c)=>b===c,Boolean)}ad(a){return olympe.D.sa([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.ea.F:olympe.D.ea.C:b.valueOf()===c.valueOf()?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea)}Up(){return this.Aa}};olympe.D.Proxy.il='__opp__';olympe.D.Proxy.prototype.bh=!0;function ub(a,b){a.node.zg(b);return a}olympe.D.Si=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.Ya(a)?L(this.node,olympe.D.Ta(a)):L(this.node,a);return this}repeat(a){mb(this.node,olympe.D.Ya(a)?a.Aa:a);return this}clear(){lb(this.node);return this}vb(){return N(this.node)}getContext(){return this.node}};function vb(a,b,c=1E3,d,e){const f=olympe.D.ec(olympe.D.aa),g=d||olympe.D.aa.zn.qo;let h,k,m,n;f.update(olympe.D.oa(a));const p=window.performance.now(),q=b.valueOf();m=q-a.valueOf();if(0!==m&&void 0===n){const r=()=>{f.getContext().gb()||(m=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+m*g(k,0,1,1),f.update(olympe.D.oa(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.vb()}
264
- olympe.D.aa=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static wc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.oa(b.value)}Bm(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Ib(!this.Bm())}yc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.sb(''):olympe.D.sb(this.value.toString())}toString(a,b){return void 0!==
265
- 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.Bm()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.ec(olympe.D.aa,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.oa(c))};a.forEach((f,g)=>{olympe.D.pc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().gb()){var g=b.get(f);b.delete(f);
266
- g===c&&e()}});return d.vb()}Hd(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.oa(b.valueOf()+c.valueOf()),olympe.D.aa,'ONumber.plus')}xg(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.oa(b.valueOf()-c.valueOf()),olympe.D.aa,'ONumber.minus')}round(){return olympe.D.oa(Math.round(this.valueOf()))}Di(){return olympe.D.oa(-this.valueOf())}Wj(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.oa(b.valueOf()*c.valueOf()),olympe.D.aa,'ONumber.mul')}hi(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.oa(b.valueOf()/
267
- c.valueOf()),olympe.D.aa,'ONumber.div')}Sv(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.oa(b.valueOf()%c.valueOf()),olympe.D.aa,'ONumber.div')}floor(){return olympe.D.oa(Math.floor(this.valueOf()))}ceil(){return olympe.D.oa(Math.ceil(this.valueOf()))}trunc(){return olympe.D.oa(Math.trunc(this.valueOf()))}log(){return olympe.D.oa(Math.log(this.valueOf()))}pow(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.oa(Math.pow(b.valueOf(),c.valueOf())),olympe.D.aa,'ONumber.pow')}exp(){return olympe.D.oa(Math.exp(this.valueOf()))}ad(a){return olympe.D.sa([this,
268
- a],(b,c)=>olympe.D.Ib(b.Ha(c)),olympe.D.ea,'ONumber.oEquals')}Ha(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}gv(){return this.valueOf()}im(a){return olympe.D.sa([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea,'ONumber.isBiggerThan')}pw(a){return olympe.D.sa([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.oa(c),olympe.D.aa,'ONumber.returnsBiggest')}Bq(a){return olympe.D.sa([this,
269
- a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.oa(c),olympe.D.aa,'ONumber.returnsSmallest')}Lv(a){return olympe.D.sa([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea,'ONumber.isSmallerThan')}sin(){return olympe.D.oa(Math.sin(this.valueOf()))}cos(){return olympe.D.oa(Math.cos(this.valueOf()))}atan2(a){return olympe.D.Ya(a)?olympe.D.Xd([a],b=>olympe.D.oa(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.aa):olympe.D.oa(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.oa(Math.abs(this.valueOf()))}vi(a,
270
- b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.Xd([a,b],(c,d)=>olympe.D.oa(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.aa):olympe.D.oa(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static Lt(a,b,c,d){'number'===typeof a&&(a=olympe.D.Gd(a));'number'===typeof b&&(b=olympe.D.Gd(b));'number'===typeof c&&(c=olympe.D.Gd(c));let e=0;const f=olympe.D.Gd(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.em(b.im(c),()=>{olympe.la.fb('df').warn('You have a min bigger than max, cap your inputs')});
271
- const k=(m,n)=>{n=olympe.D.Gd(n);const p=olympe.D.aa.animate(n,500);sb(f,p);O(n,olympe.D.oa(m));e=m};olympe.D.Xd([a],m=>{e+=m.valueOf();e>h?k(h,e):e<g?k(g,e):sb(f,olympe.D.Gd(e))},olympe.D.aa);void 0!==b&&olympe.D.sm(b.valueOf(),m=>{if(g!==m&&(g=m,g>e)){const n=olympe.D.Gd(e),p=olympe.D.aa.animate(n,400,d);m=olympe.D.oa(g);L(n.Aa,m);e=g;sb(f,p)}});void 0!==c&&olympe.D.sm(c.valueOf(),m=>{if(h!==m&&(h=m,h<e)){const n=olympe.D.Gd(e),p=olympe.D.aa.animate(n,400,d);m=olympe.D.oa(h);L(n.Aa,m);e=h;sb(f,
272
- p)}});return f}static offset(a){let b;return olympe.D.Xd([a],c=>{void 0===b&&(b=c);return olympe.D.oa(c-b)},olympe.D.aa,'offset')}static iq(a){let b,c,d;return olympe.D.sa([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.oa(0);d=window.performance.now();const f=olympe.D.oa((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.aa,'derivative')}static Gv(a){let b=olympe.D.oa(0),c,d,e;return olympe.D.sa([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.oa(0);
273
- e=window.performance.now();b=b.Hd((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.aa,'integrate')}static hu(a){let b;return olympe.D.sa([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.oa(c.valueOf()-b.valueOf());b=c;return d},olympe.D.aa,'diff')}static $t(a,b,c){return olympe.D.Xd([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.D.oa(d>=e?d<=f?d:f:e)},olympe.D.aa)}static animate(a,b,c,d){let e;
274
- return e=olympe.D.sa([a],f=>{const g=olympe.D.Ta(b,1E3),h=olympe.D.Ta(e);return void 0===h?olympe.D.oa(f):vb(h,f,g,c,k=>{d&&d(k)})},olympe.D.aa)}static Wt(a,b,c){let d,e,f,g,h,k,m=olympe.D.Gd(),n;olympe.D.pc([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);O(m,olympe.D.oa(g));1===h&&(clearTimeout(n),n=void 0)},0))});return m}static yc(a){return olympe.D.Ya(a)?
275
- olympe.D.sa([a],b=>olympe.D.sb(b.valueOf().toString()),olympe.D.Ka):olympe.D.sb(a)}static Di(a){return olympe.D.Ya(a)?olympe.D.sa([a],b=>olympe.D.oa(-b.valueOf()),olympe.D.aa):olympe.D.oa(-a.valueOf())}static Hd(a,b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.sa([a,b],(c,d)=>olympe.D.oa(c.valueOf()+d.valueOf()),olympe.D.aa,'plus'):olympe.D.oa(a.valueOf()+b.valueOf())}static xg(a,b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.Xd([a,b],(c,d)=>olympe.D.oa(c.valueOf()-d.valueOf()),olympe.D.aa,
276
- 'minus'):olympe.D.oa(a.valueOf()-b.valueOf())}static hi(a,b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.Xd([a,b],(c,d)=>olympe.D.oa(c.valueOf()/d.valueOf()),olympe.D.aa,'div'):olympe.D.oa(a.valueOf()/b.valueOf())}static kw(a,b){if(void 0===b)return a;olympe.D.pc([b],c=>{c=olympe.D.oa(a.Aa.xb.valueOf()+c.valueOf());L(a.Aa,c)},'plusEqual');return a}};olympe.D.aa.ZERO=new olympe.D.aa(0);olympe.D.aa.ONE=new olympe.D.aa(1);olympe.D.aa.xt=new olympe.D.aa(2);olympe.D.aa.PI=new olympe.D.aa(Math.PI);
277
- olympe.D.aa.Lr=new olympe.D.aa(Infinity);olympe.D.aa.Is=new olympe.D.aa(-Infinity);olympe.D.aa.zo=new olympe.D.aa(NaN);olympe.D.aa.cz=olympe.D.aa.kw;olympe.D.aa.Kw=olympe.D.aa.Lt;olympe.D.aa.Sy=olympe.D.aa.offset;olympe.D.aa.ux=olympe.D.aa.iq;olympe.D.aa.gB=olympe.D.aa.iq;olympe.D.aa.sy=olympe.D.aa.Gv;olympe.D.aa.vx=olympe.D.aa.hu;olympe.D.aa.Zw=olympe.D.aa.$t;olympe.D.aa.Lw=olympe.D.aa.animate;olympe.D.aa.Mw=olympe.D.aa.Wt;olympe.D.aa.sA=olympe.D.aa.yc;olympe.D.aa.tA=olympe.D.aa.Di;
278
- olympe.D.aa.bz=olympe.D.aa.Hd;olympe.D.aa.Gy=olympe.D.aa.xg;olympe.D.aa.wx=olympe.D.aa.hi;
279
- olympe.D.aa.zn={qo:function(a,b,c,d){return c*a/d+b},Qx:function(a,b,c,d){a/=d;return c*a*a+b},$x:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},Mx: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},Fx:function(a,b,c,d){a/=d;return c*a*a*a+b},Wx:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},Kx: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},Rx:function(a,b,c,d){a/=d;return c*a*a*a*a+b},ay:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
280
- Nx: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},Sx:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},by:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},Ox: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},Tx:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},ey:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},Px:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},Ix:function(a,b,c,d){return c*Math.pow(2,
281
- 10*(a/d-1))+b},Zx:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},Lx: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},Ex:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},Vx:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},Jx: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},zx:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},Ax:function(a,b,c,d){d=(a/=d)*a;return b+
282
- c*(2*d*d+2*d*a+-3*d)},Bx:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},Cx:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},Yx: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)},Xx: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)},Hx:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},Gx:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},Ux:function(a,
283
- 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},Dx: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}};l=olympe.D.aa.prototype;l.toJSON.J=olympe.D.H.C;l.Bm.J=olympe.D.H.C;l.isNaN.J=olympe.D.H.P;l.yc.J=olympe.D.H.F;
284
- l.toString.J=new olympe.D.H(()=>String,[]);l.toFixed.J=new olympe.D.H(()=>String,[]);l.Hd.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.xg.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.round.J=olympe.D.H.G;l.Di.J=olympe.D.H.G;l.Wj.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.hi.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.Sv.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.floor.J=olympe.D.H.G;l.ceil.J=olympe.D.H.G;l.trunc.J=olympe.D.H.G;l.log.J=olympe.D.H.G;l.pow.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.exp.J=olympe.D.H.G;
285
- l.ad.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Ha.J=olympe.D.H.C;l.valueOf.J=olympe.D.H.C;l.gv.J=olympe.D.H.C;l.im.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.pw.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.Bq.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.Lv.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.sin.J=olympe.D.H.G;l.cos.J=olympe.D.H.G;l.atan2.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.abs.J=olympe.D.H.G;l.vi.J=new olympe.D.H(()=>olympe.D.aa,[0,1]);olympe.D.Ka=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static wc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.sb(b.value)}cq(a){return olympe.D.Ka.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.sa([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.D.sb(d)},olympe.D.Ka,'OString.concat')}yc(){return this}Dw(a){return olympe.D.oa(parseInt(this.value,
286
- a))}Fq(){return olympe.D.oa(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Ha(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}ad(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.Ib(c&&b.valueOf()===c.valueOf()),olympe.D.ea,'OString.oEquals')}rh(){return olympe.D.Ib(!this.value||0===this.value.length)}contains(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.Ib((c instanceof olympe.D.Ka||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
287
- olympe.D.ea,'OString.contains')}startsWith(a,b){return olympe.D.sa([this,a,b||0],(c,d,e)=>olympe.D.Ib(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.D.ea,'OString.startsWith')}endsWith(a,b){return olympe.D.sa([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Zl().valueOf()+e.valueOf()+1;return olympe.D.Ib(c.valueOf().endsWith(d.valueOf(),e))},olympe.D.ea,'OString.endsWith')}indexOf(a,b){return olympe.D.sa([this,a,b||0],(c,d,e)=>olympe.D.oa(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
288
- olympe.D.aa,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.sa([this,a,b||Infinity],(c,d,e)=>olympe.D.oa(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.aa,'OString.lastIndexOf')}slice(a,b){return olympe.D.sa([this,a,b],(c,d,e)=>olympe.D.sb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Ka,'OString.slice')}Zl(){return olympe.D.oa(this.value.length)}threshold(a){return olympe.D.sa([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Ka.EMPTY,olympe.D.Ka,'OString.threshold')}toLowerCase(){return olympe.D.sb(this.value.toLowerCase())}toUpperCase(){return olympe.D.sb(this.value.toUpperCase())}trim(){return olympe.D.sb(this.value.trim())}padStart(a,
289
- b){return olympe.D.sa([this,a,b],(c,d,e)=>olympe.D.sb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Ka,'OString.padStart')}padEnd(a,b){return olympe.D.sa([this,a,b],(c,d,e)=>olympe.D.sb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Ka,'OString.padEnd')}replace(a,b){return olympe.D.sa([this,a,b],(c,d,e)=>olympe.D.sb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Ka,'OString.replace')}zw(a,b){return olympe.D.sa([this,a,b],(c,d,e)=>olympe.D.sb(c.valueOf().substr(d.valueOf(),
290
- e.valueOf())),olympe.D.Ka,'OString.subOStr')}static concat(...a){return olympe.D.sb('').concat(...a)}};olympe.D.Ka.EMPTY=new olympe.D.Ka('');olympe.D.Ka.mt=new olympe.D.Ka(' ');l=olympe.D.Ka.prototype;l.toJSON.J=olympe.D.H.C;l.cq.J=new olympe.D.H(()=>olympe.D.Ka,[0,1]);l.concat.J=olympe.D.H.F;l.yc.J=olympe.D.H.F;l.Dw.J=olympe.D.H.G;l.Fq.J=olympe.D.H.G;l.toString.J=olympe.D.H.C;l.valueOf.J=olympe.D.H.C;l.Ha.J=olympe.D.H.C;l.ad.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.rh.J=olympe.D.H.P;
291
- l.contains.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.startsWith.J=new olympe.D.H(()=>olympe.D.ea,[0,1]);l.endsWith.J=new olympe.D.H(()=>olympe.D.ea,[0,1]);l.indexOf.J=new olympe.D.H(()=>olympe.D.aa,[0,1]);l.lastIndexOf.J=new olympe.D.H(()=>olympe.D.aa,[0,1]);l.slice.J=new olympe.D.H(()=>olympe.D.Ka,[0,1]);l.Zl.J=olympe.D.H.G;l.threshold.J=new olympe.D.H(()=>olympe.D.Ka,[0]);l.toLowerCase.J=olympe.D.H.F;l.toUpperCase.J=olympe.D.H.F;l.trim.J=olympe.D.H.F;l.padStart.J=olympe.D.H.F;l.padEnd.J=olympe.D.H.F;
292
- l.replace.J=olympe.D.H.F;l.zw.J=olympe.D.H.F;olympe.D.ea=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static wc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.ea.F:olympe.D.ea.C}and(a){if(void 0!==a)return olympe.D.Ya(a)?olympe.D.Xd([a],b=>new olympe.D.ea(this.valueOf()&&b.valueOf()),olympe.D.ea,'and'):this.value&&a.valueOf()?olympe.D.ea.F:olympe.D.ea.C}Ha(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}ad(a){if(void 0!==a)return olympe.D.Ya(a)?
293
- olympe.D.Xd([a],b=>new olympe.D.ea(this.valueOf()===b.valueOf()),olympe.D.ea,'oEquals'):this.Ha(a)?olympe.D.ea.F:olympe.D.ea.C}Sc(){return this.value?olympe.D.ea.C:olympe.D.ea.F}Vt(a){if(void 0!==a)return olympe.D.Ya(a)?olympe.D.Xd([a],b=>new olympe.D.ea(!(this.valueOf()&&b.valueOf())),olympe.D.ea,'andNot'):this.value&&!a.valueOf()?olympe.D.ea.F:olympe.D.ea.C}or(a){if(void 0!==a)return olympe.D.Ya(a)?olympe.D.Xd([a],b=>new olympe.D.ea(this.valueOf()||b.valueOf()),olympe.D.ea,'or'):this.value||a.valueOf()?
294
- olympe.D.ea.F:olympe.D.ea.C}xor(a){return olympe.D.sa([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Ib(b&&!c||!b&&c)},olympe.D.ea,'OBoolean.xor')}vu(){return this.value}rq(){return!0===this.value?olympe.D.aa.ONE:olympe.D.aa.ZERO}yc(){return olympe.D.sb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.ea.F=new olympe.D.ea(!0);olympe.D.ea.C=new olympe.D.ea(!1);l=olympe.D.ea.prototype;l.toJSON.J=olympe.D.H.C;
295
- l.and.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Ha.J=olympe.D.H.C;l.ad.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Sc.J=olympe.D.H.P;l.Vt.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.or.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.xor.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.vu.J=new olympe.D.H(()=>Boolean,[]);l.rq.J=olympe.D.H.G;l.yc.J=olympe.D.H.F;l.toString.J=olympe.D.H.C;l.valueOf.J=olympe.D.H.C;function wb(a){return new olympe.D.Za(new Date(a))}
296
- olympe.D.Za=class{constructor(a){this.kb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.kb.toJSON()+'" }'}static wc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.Za(new Date(b.value.valueOf()))}static now(){return new olympe.D.Za(new Date)}ti(){return this.kb&&!isNaN(this.kb.getTime())?olympe.D.ea.F:olympe.D.ea.C}Ur(){return olympe.D.oa(this.kb.getMilliseconds())}Wr(){return olympe.D.oa(this.kb.getSeconds())}Vr(){return olympe.D.oa(this.kb.getMinutes())}Tr(){return olympe.D.oa(this.kb.getHours())}Iu(){return olympe.D.oa(this.kb.getDate())}getMonth(){return olympe.D.oa(this.kb.getMonth()+1)}Xr(){return olympe.D.oa(this.kb.getFullYear())}getTime(){return this.kb.getTime()}ww(){var a=
255
+ olympe.D.Node=class extends olympe.D.Jb{constructor({valueType:a,dd:b,lw:c=!0,qf:d,em:e,debug:f=!1,Kf:g=null,Xc:h='Node',gi:k}={}){++Xa;super(String(Xa));this.debug=!!f;this.Xc=h;h&&'string'===typeof h||(b?this.Xc=b.name?b.name:'anon()':this.Xc='Node');this.Da=e&&0<e.length?e:null;this.Kf=g&&0<g.length?g:null;this.valueType=a;this.xb=void 0;this.Pb=!1;this.C=olympe.D.Node.C.Og;this.nc=!1;this.T=this.ga=null;this.dd=b;this.qf=d||null;this.defaultValue=this.$b=this.P=void 0;this.gi=k;d&&d instanceof
256
+ olympe.D.Node&&Ya(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Ya(this,a);c&&ab(this)}zg(a){this.defaultValue=a;this.C===olympe.D.Node.C.Og&&L(this,a,!0);return this}hi(a){this.valueType=a}Hb(){return this.valueType||Object}Rc(){return this.C}gb(){return this.C===olympe.D.Node.C.vf}Bc(){return this.C===olympe.D.Node.C.wf}ye(...a){if(this.gi instanceof Function)return this.gi(...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.Rc();a!==olympe.D.Node.C.wf&&
257
+ a!==olympe.D.Node.C.vf||olympe.D.K.warn('Calling a function on a destroyed node!!!',this);a=d.G();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.D.Ya(g)&&b.push(g.Aa);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.dh&&(e[g]=f.Aa,b.push(g));return N(new olympe.D.Node({valueType:d.L(),dd:c,qf:this,em:e,debug:!1,Kf:b,Xc:'Proxy.'+c+'()'}))}Hj(a){if(null===this.getParent())olympe.D.K.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.K.warn('Investigate a potential issue in creator-createe link: create node mismatch',
258
+ a,this.getParent());return}this.df(null);nb(this)}destroy(){var a=this.C;if(a!==olympe.D.Node.C.wf&&a!==olympe.D.Node.C.vf){Za(this,olympe.D.Node.C.wf);if(a=this.T){for(const c of a.values())if(a.has(c.W())){var b=c;b.ga&&b.ga.delete(this.W());b.P&&b.P.W()===this.W()?b.P=void 0:b.destroy()}a.clear()}this.T=null;super.destroy();if(this.ga){for(const c of this.ga.values())this.ga.has(c.W())&&gb(c,this);this.ga.clear()}this.ga=null;this.P&&(gb(this.P,this),this.P=void 0);this.xb=void 0;this.Da&&(this.Da.length=
259
+ 0,this.Da=null);this.Kf&&(this.Kf.length=0,this.Kf=null);this.gi=this.dd=void 0;this.defaultValue=this.qf=null;this.Xc=`** Destroyed ** ${this.Xc}`;Za(this,olympe.D.Node.C.vf)}}zd(){return this.Xc}};olympe.D.Node.F='rootNode';olympe.D.Node.C={Og:0,Zg:1,Jg:3,cj:4,OBSOLETE:5,wf:6,vf:7};function eb(a,b){if('function'!==typeof a)return new olympe.D.Proxy(a,b);var c=olympe.D.Proxy.prototype;void 0===a.prototype&&olympe.D.K.error('investigate');c=Object.create(ob(c,a.prototype));c.Ej=a;c.Up=b;return c}function ob(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.hl)||Object.defineProperty(b,olympe.D.Proxy.hl,{enumerable:!1,configurable:!1,writable:!1,value:pb(a,b)});return b[olympe.D.Proxy.hl]}
260
+ function qb(a,b){if(a.Ej!==b){a.Ej=b;b.prototype||olympe.D.K.error('Cast not possible, provided type is not a valid type!');var c=ob(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Aa&&a.Aa.hi(b)}}
261
+ function pb(a,b){let c={};if(b.prototype)olympe.D.K.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(ob(a,b.__proto__));else return olympe.D.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].J;null===e||e&&e.P()?c[d]=function(...f){var g=this.Aa;if(g&&bb(g)&&(g=g.xb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.H.$,c[d]=function(...f){f=this.Up.call(this.Aa,
262
+ ...f,e,d);const g=e.$;if(g){const h=this.Aa.xb;h&&h[g]&&qb(f,h[g])}return e.T()?this:f})}});return c}function rb(a,b){L(a.Aa,b)}function sb(a){lb(a.Aa)}function tb(a,b){mb(a.Aa,olympe.D.mf(b)?b:b.Aa)}function ub(a,b){olympe.D.Ya(b)||olympe.D.mf(b)?tb(a,b):rb(a,b)}
263
+ olympe.D.Proxy=class{constructor(a,b){this.Aa=null;this.Ej=a;this.Up=b}static Ya(a){return!(!a||!a.dh)}Ha(a){return olympe.D.sa([this,a],(b,c)=>b===c,Boolean)}bd(a){return olympe.D.sa([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.ea.F:olympe.D.ea.C:b.valueOf()===c.valueOf()?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea)}Tp(){return this.Aa}};olympe.D.Proxy.hl='__opp__';olympe.D.Proxy.prototype.dh=!0;function vb(a,b){a.node.zg(b);return a}olympe.D.Si=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.Ya(a)?L(this.node,olympe.D.Ta(a)):L(this.node,a);return this}repeat(a){mb(this.node,olympe.D.Ya(a)?a.Aa:a);return this}clear(){lb(this.node);return this}vb(){return N(this.node)}getContext(){return this.node}};function wb(a,b,c=1E3,d,e){const f=olympe.D.cc(olympe.D.aa),g=d||olympe.D.aa.zn.oo;let h,k,m,n;f.update(olympe.D.oa(a));const p=window.performance.now(),q=b.valueOf();m=q-a.valueOf();if(0!==m&&void 0===n){const r=()=>{f.getContext().gb()||(m=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+m*g(k,0,1,1),f.update(olympe.D.oa(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.vb()}
264
+ olympe.D.aa=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static xc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.oa(b.value)}Am(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Ib(!this.Am())}zc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.sb(''):olympe.D.sb(this.value.toString())}toString(a,b){return void 0!==
265
+ 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.Am()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.cc(olympe.D.aa,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.oa(c))};a.forEach((f,g)=>{olympe.D.qc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().gb()){var g=b.get(f);b.delete(f);
266
+ g===c&&e()}});return d.vb()}Gd(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.oa(b.valueOf()+c.valueOf()),olympe.D.aa,'ONumber.plus')}xg(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.oa(b.valueOf()-c.valueOf()),olympe.D.aa,'ONumber.minus')}round(){return olympe.D.oa(Math.round(this.valueOf()))}Di(){return olympe.D.oa(-this.valueOf())}Wj(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.oa(b.valueOf()*c.valueOf()),olympe.D.aa,'ONumber.mul')}ii(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.oa(b.valueOf()/
267
+ c.valueOf()),olympe.D.aa,'ONumber.div')}Rv(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.oa(b.valueOf()%c.valueOf()),olympe.D.aa,'ONumber.div')}floor(){return olympe.D.oa(Math.floor(this.valueOf()))}ceil(){return olympe.D.oa(Math.ceil(this.valueOf()))}trunc(){return olympe.D.oa(Math.trunc(this.valueOf()))}log(){return olympe.D.oa(Math.log(this.valueOf()))}pow(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.oa(Math.pow(b.valueOf(),c.valueOf())),olympe.D.aa,'ONumber.pow')}exp(){return olympe.D.oa(Math.exp(this.valueOf()))}bd(a){return olympe.D.sa([this,
268
+ a],(b,c)=>olympe.D.Ib(b.Ha(c)),olympe.D.ea,'ONumber.oEquals')}Ha(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}fv(){return this.valueOf()}hm(a){return olympe.D.sa([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea,'ONumber.isBiggerThan')}ow(a){return olympe.D.sa([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.oa(c),olympe.D.aa,'ONumber.returnsBiggest')}Aq(a){return olympe.D.sa([this,
269
+ a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.oa(c),olympe.D.aa,'ONumber.returnsSmallest')}Kv(a){return olympe.D.sa([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea,'ONumber.isSmallerThan')}sin(){return olympe.D.oa(Math.sin(this.valueOf()))}cos(){return olympe.D.oa(Math.cos(this.valueOf()))}atan2(a){return olympe.D.Ya(a)?olympe.D.Wd([a],b=>olympe.D.oa(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.aa):olympe.D.oa(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.oa(Math.abs(this.valueOf()))}vi(a,
270
+ b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.Wd([a,b],(c,d)=>olympe.D.oa(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.aa):olympe.D.oa(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static Kt(a,b,c,d){'number'===typeof a&&(a=olympe.D.Fd(a));'number'===typeof b&&(b=olympe.D.Fd(b));'number'===typeof c&&(c=olympe.D.Fd(c));let e=0;const f=olympe.D.Fd(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.cm(b.hm(c),()=>{olympe.la.fb('df').warn('You have a min bigger than max, cap your inputs')});
271
+ const k=(m,n)=>{n=olympe.D.Fd(n);const p=olympe.D.aa.animate(n,500);tb(f,p);rb(n,olympe.D.oa(m));e=m};olympe.D.Wd([a],m=>{e+=m.valueOf();e>h?k(h,e):e<g?k(g,e):tb(f,olympe.D.Fd(e))},olympe.D.aa);void 0!==b&&olympe.D.qm(b.valueOf(),m=>{if(g!==m&&(g=m,g>e)){const n=olympe.D.Fd(e),p=olympe.D.aa.animate(n,400,d);m=olympe.D.oa(g);L(n.Aa,m);e=g;tb(f,p)}});void 0!==c&&olympe.D.qm(c.valueOf(),m=>{if(h!==m&&(h=m,h<e)){const n=olympe.D.Fd(e),p=olympe.D.aa.animate(n,400,d);m=olympe.D.oa(h);L(n.Aa,m);e=h;tb(f,
272
+ p)}});return f}static offset(a){let b;return olympe.D.Wd([a],c=>{void 0===b&&(b=c);return olympe.D.oa(c-b)},olympe.D.aa,'offset')}static hq(a){let b,c,d;return olympe.D.sa([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.oa(0);d=window.performance.now();const f=olympe.D.oa((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.aa,'derivative')}static Fv(a){let b=olympe.D.oa(0),c,d,e;return olympe.D.sa([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.oa(0);
273
+ e=window.performance.now();b=b.Gd((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.aa,'integrate')}static gu(a){let b;return olympe.D.sa([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.oa(c.valueOf()-b.valueOf());b=c;return d},olympe.D.aa,'diff')}static Zt(a,b,c){return olympe.D.Wd([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.D.oa(d>=e?d<=f?d:f:e)},olympe.D.aa)}static animate(a,b,c,d){let e;
274
+ return e=olympe.D.sa([a],f=>{const g=olympe.D.Ta(b,1E3),h=olympe.D.Ta(e);return void 0===h?olympe.D.oa(f):wb(h,f,g,c,k=>{d&&d(k)})},olympe.D.aa)}static Vt(a,b,c){let d,e,f,g,h,k,m=olympe.D.Fd(),n;olympe.D.qc([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);rb(m,olympe.D.oa(g));1===h&&(clearTimeout(n),n=void 0)},0))});return m}static zc(a){return olympe.D.Ya(a)?
275
+ olympe.D.sa([a],b=>olympe.D.sb(b.valueOf().toString()),olympe.D.Ka):olympe.D.sb(a)}static Di(a){return olympe.D.Ya(a)?olympe.D.sa([a],b=>olympe.D.oa(-b.valueOf()),olympe.D.aa):olympe.D.oa(-a.valueOf())}static Gd(a,b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.sa([a,b],(c,d)=>olympe.D.oa(c.valueOf()+d.valueOf()),olympe.D.aa,'plus'):olympe.D.oa(a.valueOf()+b.valueOf())}static xg(a,b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.Wd([a,b],(c,d)=>olympe.D.oa(c.valueOf()-d.valueOf()),olympe.D.aa,
276
+ 'minus'):olympe.D.oa(a.valueOf()-b.valueOf())}static ii(a,b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.Wd([a,b],(c,d)=>olympe.D.oa(c.valueOf()/d.valueOf()),olympe.D.aa,'div'):olympe.D.oa(a.valueOf()/b.valueOf())}static jw(a,b){if(void 0===b)return a;olympe.D.qc([b],c=>{c=olympe.D.oa(a.Aa.xb.valueOf()+c.valueOf());L(a.Aa,c)},'plusEqual');return a}};olympe.D.aa.ZERO=new olympe.D.aa(0);olympe.D.aa.ONE=new olympe.D.aa(1);olympe.D.aa.xt=new olympe.D.aa(2);olympe.D.aa.PI=new olympe.D.aa(Math.PI);
277
+ olympe.D.aa.Lr=new olympe.D.aa(Infinity);olympe.D.aa.Is=new olympe.D.aa(-Infinity);olympe.D.aa.xo=new olympe.D.aa(NaN);olympe.D.aa.az=olympe.D.aa.jw;olympe.D.aa.Jw=olympe.D.aa.Kt;olympe.D.aa.Qy=olympe.D.aa.offset;olympe.D.aa.sx=olympe.D.aa.hq;olympe.D.aa.eB=olympe.D.aa.hq;olympe.D.aa.py=olympe.D.aa.Fv;olympe.D.aa.tx=olympe.D.aa.gu;olympe.D.aa.Xw=olympe.D.aa.Zt;olympe.D.aa.Kw=olympe.D.aa.animate;olympe.D.aa.Lw=olympe.D.aa.Vt;olympe.D.aa.qA=olympe.D.aa.zc;olympe.D.aa.rA=olympe.D.aa.Di;
278
+ olympe.D.aa.$y=olympe.D.aa.Gd;olympe.D.aa.Ey=olympe.D.aa.xg;olympe.D.aa.ux=olympe.D.aa.ii;
279
+ olympe.D.aa.zn={oo:function(a,b,c,d){return c*a/d+b},Ox:function(a,b,c,d){a/=d;return c*a*a+b},Yx:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},Kx: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},Dx:function(a,b,c,d){a/=d;return c*a*a*a+b},Ux:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},Ix: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},Px:function(a,b,c,d){a/=d;return c*a*a*a*a+b},Zx:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
280
+ Lx: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},Qx:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},$x:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},Mx: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},Rx:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},ay:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},Nx:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},Gx:function(a,b,c,d){return c*Math.pow(2,
281
+ 10*(a/d-1))+b},Xx:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},Jx: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},Cx:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},Tx:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},Hx: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},xx:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},yx:function(a,b,c,d){d=(a/=d)*a;return b+
282
+ c*(2*d*d+2*d*a+-3*d)},zx:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},Ax:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},Wx: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)},Vx: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)},Fx:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},Ex:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},Sx:function(a,
283
+ 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},Bx: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}};l=olympe.D.aa.prototype;l.toJSON.J=olympe.D.H.C;l.Am.J=olympe.D.H.C;l.isNaN.J=olympe.D.H.P;l.zc.J=olympe.D.H.F;
284
+ l.toString.J=new olympe.D.H(()=>String,[]);l.toFixed.J=new olympe.D.H(()=>String,[]);l.Gd.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.xg.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.round.J=olympe.D.H.G;l.Di.J=olympe.D.H.G;l.Wj.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.ii.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.Rv.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.floor.J=olympe.D.H.G;l.ceil.J=olympe.D.H.G;l.trunc.J=olympe.D.H.G;l.log.J=olympe.D.H.G;l.pow.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.exp.J=olympe.D.H.G;
285
+ l.bd.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Ha.J=olympe.D.H.C;l.valueOf.J=olympe.D.H.C;l.fv.J=olympe.D.H.C;l.hm.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.ow.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.Aq.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.Kv.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.sin.J=olympe.D.H.G;l.cos.J=olympe.D.H.G;l.atan2.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.abs.J=olympe.D.H.G;l.vi.J=new olympe.D.H(()=>olympe.D.aa,[0,1]);olympe.D.Ka=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static xc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.sb(b.value)}bq(a){return olympe.D.Ka.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.sa([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.D.sb(d)},olympe.D.Ka,'OString.concat')}zc(){return this}Cw(a){return olympe.D.oa(parseInt(this.value,
286
+ a))}Eq(){return olympe.D.oa(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Ha(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}bd(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.Ib(c&&b.valueOf()===c.valueOf()),olympe.D.ea,'OString.oEquals')}sh(){return olympe.D.Ib(!this.value||0===this.value.length)}contains(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.Ib((c instanceof olympe.D.Ka||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
287
+ olympe.D.ea,'OString.contains')}startsWith(a,b){return olympe.D.sa([this,a,b||0],(c,d,e)=>olympe.D.Ib(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.D.ea,'OString.startsWith')}endsWith(a,b){return olympe.D.sa([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Yl().valueOf()+e.valueOf()+1;return olympe.D.Ib(c.valueOf().endsWith(d.valueOf(),e))},olympe.D.ea,'OString.endsWith')}indexOf(a,b){return olympe.D.sa([this,a,b||0],(c,d,e)=>olympe.D.oa(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
288
+ olympe.D.aa,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.sa([this,a,b||Infinity],(c,d,e)=>olympe.D.oa(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.aa,'OString.lastIndexOf')}slice(a,b){return olympe.D.sa([this,a,b],(c,d,e)=>olympe.D.sb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Ka,'OString.slice')}Yl(){return olympe.D.oa(this.value.length)}threshold(a){return olympe.D.sa([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Ka.EMPTY,olympe.D.Ka,'OString.threshold')}toLowerCase(){return olympe.D.sb(this.value.toLowerCase())}toUpperCase(){return olympe.D.sb(this.value.toUpperCase())}trim(){return olympe.D.sb(this.value.trim())}padStart(a,
289
+ b){return olympe.D.sa([this,a,b],(c,d,e)=>olympe.D.sb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Ka,'OString.padStart')}padEnd(a,b){return olympe.D.sa([this,a,b],(c,d,e)=>olympe.D.sb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Ka,'OString.padEnd')}replace(a,b){return olympe.D.sa([this,a,b],(c,d,e)=>olympe.D.sb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Ka,'OString.replace')}yw(a,b){return olympe.D.sa([this,a,b],(c,d,e)=>olympe.D.sb(c.valueOf().substr(d.valueOf(),
290
+ e.valueOf())),olympe.D.Ka,'OString.subOStr')}static concat(...a){return olympe.D.sb('').concat(...a)}};olympe.D.Ka.EMPTY=new olympe.D.Ka('');olympe.D.Ka.mt=new olympe.D.Ka(' ');l=olympe.D.Ka.prototype;l.toJSON.J=olympe.D.H.C;l.bq.J=new olympe.D.H(()=>olympe.D.Ka,[0,1]);l.concat.J=olympe.D.H.F;l.zc.J=olympe.D.H.F;l.Cw.J=olympe.D.H.G;l.Eq.J=olympe.D.H.G;l.toString.J=olympe.D.H.C;l.valueOf.J=olympe.D.H.C;l.Ha.J=olympe.D.H.C;l.bd.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.sh.J=olympe.D.H.P;
291
+ l.contains.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.startsWith.J=new olympe.D.H(()=>olympe.D.ea,[0,1]);l.endsWith.J=new olympe.D.H(()=>olympe.D.ea,[0,1]);l.indexOf.J=new olympe.D.H(()=>olympe.D.aa,[0,1]);l.lastIndexOf.J=new olympe.D.H(()=>olympe.D.aa,[0,1]);l.slice.J=new olympe.D.H(()=>olympe.D.Ka,[0,1]);l.Yl.J=olympe.D.H.G;l.threshold.J=new olympe.D.H(()=>olympe.D.Ka,[0]);l.toLowerCase.J=olympe.D.H.F;l.toUpperCase.J=olympe.D.H.F;l.trim.J=olympe.D.H.F;l.padStart.J=olympe.D.H.F;l.padEnd.J=olympe.D.H.F;
292
+ l.replace.J=olympe.D.H.F;l.yw.J=olympe.D.H.F;olympe.D.ea=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static xc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.ea.F:olympe.D.ea.C}and(a){if(void 0!==a)return olympe.D.Ya(a)?olympe.D.Wd([a],b=>new olympe.D.ea(this.valueOf()&&b.valueOf()),olympe.D.ea,'and'):this.value&&a.valueOf()?olympe.D.ea.F:olympe.D.ea.C}Ha(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}bd(a){if(void 0!==a)return olympe.D.Ya(a)?
293
+ olympe.D.Wd([a],b=>new olympe.D.ea(this.valueOf()===b.valueOf()),olympe.D.ea,'oEquals'):this.Ha(a)?olympe.D.ea.F:olympe.D.ea.C}Sc(){return this.value?olympe.D.ea.C:olympe.D.ea.F}Ut(a){if(void 0!==a)return olympe.D.Ya(a)?olympe.D.Wd([a],b=>new olympe.D.ea(!(this.valueOf()&&b.valueOf())),olympe.D.ea,'andNot'):this.value&&!a.valueOf()?olympe.D.ea.F:olympe.D.ea.C}or(a){if(void 0!==a)return olympe.D.Ya(a)?olympe.D.Wd([a],b=>new olympe.D.ea(this.valueOf()||b.valueOf()),olympe.D.ea,'or'):this.value||a.valueOf()?
294
+ olympe.D.ea.F:olympe.D.ea.C}xor(a){return olympe.D.sa([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Ib(b&&!c||!b&&c)},olympe.D.ea,'OBoolean.xor')}uu(){return this.value}qq(){return!0===this.value?olympe.D.aa.ONE:olympe.D.aa.ZERO}zc(){return olympe.D.sb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.ea.F=new olympe.D.ea(!0);olympe.D.ea.C=new olympe.D.ea(!1);l=olympe.D.ea.prototype;l.toJSON.J=olympe.D.H.C;
295
+ l.and.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Ha.J=olympe.D.H.C;l.bd.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Sc.J=olympe.D.H.P;l.Ut.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.or.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.xor.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.uu.J=new olympe.D.H(()=>Boolean,[]);l.qq.J=olympe.D.H.G;l.zc.J=olympe.D.H.F;l.toString.J=olympe.D.H.C;l.valueOf.J=olympe.D.H.C;function xb(a){return new olympe.D.Za(new Date(a))}
296
+ olympe.D.Za=class{constructor(a){this.kb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.kb.toJSON()+'" }'}static xc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.Za(new Date(b.value.valueOf()))}static now(){return new olympe.D.Za(new Date)}ti(){return this.kb&&!isNaN(this.kb.getTime())?olympe.D.ea.F:olympe.D.ea.C}Ur(){return olympe.D.oa(this.kb.getMilliseconds())}Wr(){return olympe.D.oa(this.kb.getSeconds())}Vr(){return olympe.D.oa(this.kb.getMinutes())}Tr(){return olympe.D.oa(this.kb.getHours())}Hu(){return olympe.D.oa(this.kb.getDate())}getMonth(){return olympe.D.oa(this.kb.getMonth()+1)}Xr(){return olympe.D.oa(this.kb.getFullYear())}getTime(){return this.kb.getTime()}vw(){var a=
297
297
  olympe.D,b=a.sb;var c=this.kb.getDate();c=10>c?'0'+c:c;var d=this.kb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.kb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.D.sb(this.kb.toLocaleString(a)):olympe.D.sa([this,a],(b,c)=>olympe.D.sb(b.kb.toLocaleString(c.valueOf())),olympe.D.Ka)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.D.sb(this.kb.toLocaleDateString(a)):olympe.D.sa([this,a],(b,c)=>olympe.D.sb(b.kb.toLocaleDateString(c.valueOf())),
298
- olympe.D.Ka)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.sb(this.kb.toLocaleTimeString(a)):olympe.D.sa([this,a],(b,c)=>olympe.D.sb(b.kb.toLocaleTimeString(c.valueOf())),olympe.D.Ka)}yc(){return olympe.D.sb(this.kb.toISOString())}Aw(){return new Date(this.getTime())}Cw(){return this}Ew(){return this}If(a,b){return olympe.D.sa([b],c=>{const d=new olympe.D.Za(new Date(this.kb.getTime()));d.kb['set'+a](this.kb['get'+a]()+c.valueOf());return d},olympe.D.Za)}Nt(a){return this.If('Milliseconds',
299
- a)}St(a){return this.If('Seconds',a)}Ot(a){return this.If('Minutes',a)}Mt(a){return this.If('Hours',a)}Hl(a){return this.If('Date',a)}Tt(a){return'number'===typeof a?this.Hl(7*a):this.Hl(a.Wj(7))}Pt(a){return this.If('Month',a)}Ut(a){return this.If('FullYear',a)}xw(){let a=this.kb.getDay();a=0===a?6:a-1;return new olympe.D.Za(new Date(this.kb.getFullYear(),this.kb.getMonth(),this.kb.getDate()-a))}yw(){return new olympe.D.Za(new Date(this.kb.getFullYear(),this.kb.getMonth()))}ad(a){return olympe.D.sa([a],
300
- b=>olympe.D.Ib(this.Ha(b)),olympe.D.ea)}Ha(a){return a instanceof olympe.D.Za?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Xu(){let a=this.kb.getDay();0===a&&(a=7);return olympe.D.oa(a)}Mu(a,b){return olympe.D.sa([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.kb.getFullYear()-c.kb.getFullYear():'months'===d?c=12*(this.kb.getFullYear()-c.kb.getFullYear())+(this.kb.getMonth()-c.kb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
301
- void 0===d&&(olympe.la.fb('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.kb.getTime()-c.kb.getTime())/d));return olympe.D.oa(c)},olympe.D.aa)}Jv(a){return olympe.D.sa([a],b=>olympe.D.Ib(this.getTime()<b.getTime()),olympe.D.ea)}Hv(a){return olympe.D.sa([a],b=>olympe.D.Ib(this.getTime()>b.getTime()),olympe.D.ea)}Kv(a,b){return olympe.D.sa([a,b],(c,d)=>olympe.D.Ib(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.ea)}valueOf(){return this.ti().valueOf()?
302
- new Date(this.getTime()):new Date(0)}};olympe.D.Za.C=wb(0);olympe.D.Za.F=wb(Number.NaN);l=olympe.D.Za.prototype;l.ti.J=olympe.D.H.P;l.Ur.J=olympe.D.H.G;l.Wr.J=olympe.D.H.G;l.Vr.J=olympe.D.H.G;l.Tr.J=olympe.D.H.G;l.Iu.J=olympe.D.H.G;l.getMonth.J=olympe.D.H.G;l.Xr.J=olympe.D.H.G;l.getTime.J=olympe.D.H.C;l.ww.J=new olympe.D.H(()=>olympe.D.Ka,[0]);l.toLocaleString.J=olympe.D.H.F;l.toLocaleDateString.J=olympe.D.H.F;l.toLocaleTimeString.J=olympe.D.H.F;l.yc.J=olympe.D.H.F;l.Aw.J=olympe.D.H.C;
303
- l.Cw.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Ew.J=new olympe.D.H(()=>olympe.D.Za,[]);l.If.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Nt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.St.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Ot.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Mt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Hl.J=new olympe.D.H(()=>olympe.D.Za,[0]);l.Tt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Pt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Ut.J=new olympe.D.H(()=>olympe.D.Za,[0]);
304
- l.xw.J=new olympe.D.H(()=>olympe.D.Za,[]);l.yw.J=new olympe.D.H(()=>olympe.D.Za,[]);l.ad.J=olympe.D.H.P;l.Ha.J=olympe.D.H.C;l.Xu.J=olympe.D.H.G;l.Mu.J=new olympe.D.H(()=>olympe.D.aa,[0,1]);l.Jv.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Hv.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Kv.J=new olympe.D.H(()=>olympe.D.ea,[0,1]);l.valueOf.J=olympe.D.H.C;const xb=new Map,yb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,zb=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function Ab(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=zb.exec(c)):(d=1,c=yb.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.D.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.D.nf(a)?olympe.D.Xd([a],b,olympe.D.Color):b(a)}
305
- olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.oa(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.oa(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.oa(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.oa(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return`{ "type": "color", "r": ${this.C.valueOf()}, "g": ${this.F.valueOf()}, "b": ${this.b.valueOf()}, "a": ${this.a.valueOf()} }`}static wc(a){let b;'string'===typeof a?b=
306
- JSON.parse(a):b=a;return olympe.D.Color.create(b.r,b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.D.sa([a,b,c,d],(e,f,g,h)=>{e=olympe.D.oa(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.D.oa(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.D.oa(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.D.oa(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of xb.values())if(k&&k.C.Ha(e)&&k.F.Ha(f)&&k.b.Ha(g)&&k.a.Ha(h))return k;
307
- return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}rg(){return this.C}mg(){return this.b}pg(){return this.F}lg(){return this.a}Zt(a,b){return olympe.D.Color.create(this.C.vi(a.rg(),b),this.F.vi(a.pg(),b),this.b.vi(a.mg(),b),this.a.vi(a.lg(),b))}ou(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}Gq(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}zm(){const a=(16777216|this.b|this.F<<8|this.C<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);
308
- return'#'+(a+b).toUpperCase()}toString(){return this.zm()}Ha(a){return a instanceof olympe.D.Color?this.C.valueOf()===a.C.valueOf()&&this.F.valueOf()===a.F.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}};olympe.D.Color.prototype.equals=olympe.D.Color.prototype.Ha;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.zm;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.Gq;olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.lg;
309
- olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.pg;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.mg;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.rg;olympe.D.Color.create=olympe.D.Color.create;l=olympe.D.Color.prototype;l.toJSON.J=olympe.D.H.C;l.rg.J=olympe.D.H.G;l.mg.J=olympe.D.H.G;l.pg.J=olympe.D.H.G;l.lg.J=olympe.D.H.G;l.Zt.J=new olympe.D.H(()=>olympe.D.Color,[]);l.ou.J=new olympe.D.H(()=>olympe.D.Color,[]);l.Gq.J=new olympe.D.H(()=>String,[]);
310
- l.zm.J=new olympe.D.H(()=>String,[]);l.Ha.J=olympe.D.H.C;olympe.D.File=class{ia(){}ko(){}Uk(){}am(){}Kj(){}Vl(){}Lj(){}rename(){}};olympe.D.Kb=class{constructor(a,b){this.x=olympe.D.Gd(a);this.y=olympe.D.Gd(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.Ta(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.Ta(this.y).valueOf())+' }'}static wc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.Kb(b.x,b.y)}lo(){return this.x}uw(a){tb(this.x,a)}mo(){return this.y}vw(a){tb(this.y,a)}tv(){return this.x.Bq(this.y)}Hd(a){return olympe.D.sa([this,a],(b,c)=>new olympe.D.Kb(b.x.Hd(c.x),b.y.Hd(c.y)),
311
- olympe.D.Kb,'Vector2.plus')}xg(a){return olympe.D.sa([this,a],(b,c)=>new olympe.D.Kb(b.x.xg(c.x),b.y.xg(c.y)),olympe.D.Kb,'Vector2.minus')}Uv(a){return new olympe.D.Kb(this.x.Wj(a),this.y.Wj(a))}ju(a){return new olympe.D.Kb(this.x.hi(a),this.y.hi(a))}Wv(){return new olympe.D.Kb(this.x.Di(),this.y.Di())}ku(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.sa([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.oa(d*f+e*g),olympe.D.aa),olympe.D.aa)}length(){return olympe.D.sa([this.x,this.y],(a,b)=>olympe.D.oa(Math.sqrt(a*
312
- a+b*b)),olympe.D.aa)}normalize(){return olympe.D.sa([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.Kb(a/c,b/c)},olympe.D.Kb)}floor(){return olympe.D.sa([this.x,this.y],(a,b)=>new olympe.D.Kb(Math.floor(a),Math.floor(b)),olympe.D.Kb)}ceil(){return olympe.D.sa([this.x,this.y],(a,b)=>new olympe.D.Kb(Math.ceil(a),Math.ceil(b)),olympe.D.Kb)}round(){return olympe.D.sa([this.x,this.y],(a,b)=>new olympe.D.Kb(Math.round(a),Math.round(b)),olympe.D.Kb)}Qt(a){return new olympe.D.Kb(this.x.Hd(a),
313
- this.y.Hd(a))}Rt(a,b){return new olympe.D.Kb(this.x.Hd(a),this.y.Hd(b))}yc(){return olympe.D.sa([this.x,this.y],(a,b)=>olympe.D.sb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Ka)}toString(){return`Vector2[${this.x.Aa.xb}, ${this.y.Aa.xb}]`}Ha(a){return this===a?!0:!1}};l=olympe.D.Kb.prototype;l.toJSON.J=olympe.D.H.C;l.lo.J=olympe.D.H.G;l.uw.J=olympe.D.H.C;l.mo.J=olympe.D.H.G;l.vw.J=olympe.D.H.C;l.tv.J=olympe.D.H.G;l.Hd.J=new olympe.D.H(()=>olympe.D.Kb,[0]);
314
- l.xg.J=new olympe.D.H(()=>olympe.D.Kb,[0]);l.Uv.J=olympe.D.H.T;l.ju.J=olympe.D.H.T;l.Wv.J=olympe.D.H.T;l.ku.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.length.J=olympe.D.H.G;l.normalize.J=olympe.D.H.T;l.floor.J=olympe.D.H.T;l.ceil.J=olympe.D.H.T;l.round.J=olympe.D.H.T;l.Qt.J=olympe.D.H.T;l.Rt.J=olympe.D.H.T;l.yc.J=olympe.D.H.F;l.toString.J=olympe.D.H.C;l.Ha.J=olympe.D.H.C;olympe.D.Vf=class{constructor(){}Hb(){}md(){}get(){}lh(){}has(){}vg(){}xc(){}hf(){}Te(){}Nf(){}forEach(){}Pd(){}};olympe.D.Vf.prototype.forEachCurrentValue=olympe.D.Vf.prototype.Pd;olympe.D.Vf.prototype.forEach=olympe.D.Vf.prototype.forEach;l=olympe.D.Vf.prototype;l.has.J=olympe.D.H.P;l.vg.J=olympe.D.H.C;l.xc.J=new olympe.D.H(()=>Object,[]);l.hf.J=new olympe.D.H(()=>String,[]);l.Te.J=olympe.D.H.G;l.Nf.J=olympe.D.H.C;l.forEach.J=new olympe.D.H(()=>{},[]);l.Pd.J=olympe.D.H.C;olympe.D.Qc=class extends olympe.D.Vf{Ed(){}gf(){}He(){}ff(){}Qd(){}Fe(){}ii(){}nh(){}};olympe.D.Qc.prototype.getCurrentAt=olympe.D.Qc.prototype.Fe;olympe.D.Qc.prototype.getAt=olympe.D.Qc.prototype.Qd;olympe.D.Qc.prototype.getCurrentKeyAt=olympe.D.Qc.prototype.ff;olympe.D.Qc.prototype.getKeyAt=olympe.D.Qc.prototype.He;olympe.D.Qc.prototype.getCurrentRank=olympe.D.Qc.prototype.gf;olympe.D.Qc.prototype.getRank=olympe.D.Qc.prototype.Ed;l=olympe.D.Qc.prototype;l.Ed.J=olympe.D.H.G;l.gf.J=olympe.D.H.C;
315
- l.He.J=new olympe.D.H(()=>String,[]);l.ff.J=olympe.D.H.C;l.Qd.J=new olympe.D.H(()=>Object,[]);l.Fe.J=olympe.D.H.C;l.ii.J=olympe.D.H.C;l.nh.J=new olympe.D.H(()=>Array,[]);olympe.D.xh=class{constructor(a,b){this.P=b||olympe.D.Ma();this.valueType=a||Object;this.values={};this.ub=this.Da=null;this.ze=0;this.$=Object.create(null);this.Eb=Object.create(null);this.size=0;this.L=null;this.P.onDestroy(()=>{const c=this.$;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,m=0;m<k;m++)g[h[m]].destroy()}}})}getContext(){return this.P}Hb(){return this.valueType}md(a){this.valueType=a;const b=this.Da;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
316
- c)&&qb(b[c],a)}get(a){const b=c=>{null===this.Da&&(this.Da={});return this.li(this.Da,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.sa([a],c=>b(c),this.valueType)}lh(a){a=this.values[a];return olympe.D.Ya(a)?bb(a.Aa)?a.Aa.xb:void 0:a}has(a){const b=c=>{null===this.ub&&(this.ub={});return this.li(this.ub,c,c in this.values?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea,'Map.has('+c+')')};return olympe.D.sa([a],c=>b(c),olympe.D.ea)}vg(a){return a in this.values}li(a,b,c,d,e){let f=a[b];
317
- f||this.P.run(()=>{f=olympe.D.rd(d,void 0,e);a[b]=f;f.Aa.onDestroy(()=>delete a[b]);olympe.D.Ya(c)?sb(f,c):O(f,c)});return f}xc(){throw Error('Abstract method getFirstKey needs to be overridden');}hf(){throw Error('Abstract method getFirstKey needs to be overridden');}Te(){null===this.L&&this.P.run(()=>{this.L=olympe.D.rd(olympe.D.aa,olympe.D.oa(this.size));this.L.Aa.onDestroy(()=>{this.L=null})});return this.L}Nf(){return this.size}forEach(a,b){const c=this.Dl();a=this.Wp(c,a,b);this.Cl(c,a)}Dl(){return String(++this.ze)}Cl(a,
318
- b){this.Eb[a]=b;olympe.D.Ma().$(()=>{const c=this.$;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Eb[a]});this.Pd(b)}Wp(a,b,c){const d=olympe.D.Ma();return(e,f)=>{d.run(()=>{const g=olympe.D.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.Gl(a,f,g)})}}Gl(a,b,c){void 0===this.$[b]&&(this.$[b]={});this.$[b][a]=c}Pd(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
319
- a(b[c],c,this))break}Gj(a,b){void 0!==this.values[a]&&this.ei(a,!0);this.values[a]=b;var c=this.Da;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?sb(c[a],b):O(c[a],b));c=this.ub;null!==c&&void 0!==c[a]&&tb(c[a],!0);this.size++;c=this.Eb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}ei(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.bh?d.Aa.xb:d;var e=this.Da;null!==e&&void 0!==e[a]&&rb(e[a]);e=this.ub;null!==e&&void 0!==
320
- e[a]&&tb(e[a],!1);delete c[a];this.size--;b||this.cf()}a=this.$[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}cf(){null!==this.L&&tb(this.L,this.size)}dh(){var a=this.Da;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&rb(a[c]);a=this.ub;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&tb(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.$)if(Object.prototype.hasOwnProperty.call(this.$,
321
- c)){b=this.$[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.L&&tb(this.L,this.size)}Yf(){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.D.xh.va=[olympe.D.Vf];l=olympe.D.xh.prototype;l.getContext.J=olympe.D.H.C;l.Hb.J=olympe.D.H.C;l.md.J=olympe.D.H.C;l.get.J=new olympe.D.H(()=>Object,[],'valueType');l.lh.J=olympe.D.H.C;l.has.J=olympe.D.H.P;l.vg.J=olympe.D.H.C;l.li.J=olympe.D.H.C;
322
- l.Te.J=olympe.D.H.G;l.Nf.J=olympe.D.H.C;l.forEach.J=new olympe.D.H(()=>{},[]);l.Dl.J=olympe.D.H.C;l.Cl.J=olympe.D.H.C;l.Wp.J=olympe.D.H.C;l.Gl.J=olympe.D.H.C;l.Pd.J=olympe.D.H.C;l.Gj.J=olympe.D.H.C;l.ei.J=olympe.D.H.C;l.cf.J=olympe.D.H.C;l.dh.J=olympe.D.H.C;l.Yf.J=olympe.D.H.C;olympe.D.Hi=class extends olympe.D.xh{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.na=this.Wa=this.mb=this.ga=null}md(a){super.md(a);if(null!==this.na)for(let b of this.na.values())qb(b,a)}xc(){return this.Qd(0)}hf(){return this.He(0)}Ed(a){const b=c=>{null===this.mb&&(this.mb=Object.create(null));let d=this.gf(a);d=void 0!==d?olympe.D.oa(d):void 0;return this.li(this.mb,c,d,olympe.D.aa,`List.getRank(${c})`)};return olympe.D.Ya(a)?N(olympe.D.createNode(olympe.D.aa,b,null,
323
- [a.Aa],[0],'onResolved('+(b.name||'')+')')):b(a)}gf(a){return this.F[a]}He(a){const b=c=>{const d=c.valueOf(),e=this.ff(d);null===this.Wa&&(this.Wa=Object.create(null));return this.li(this.Wa,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.sa([a],c=>b(c),String)}ff(a){return this.C[a.valueOf()]}Qd(a){if(olympe.D.Ya(a))return this.get(olympe.D.sa([a],c=>{c=this.He(c);if(!bb(c.Aa)){const d=olympe.D.Ma();olympe.D.mf(d)&&lb(d)}return c},String));null===this.na&&(this.na=new Map);let b=this.na.get(a);
324
- b||this.P.run(()=>{b=this.get(this.He(a));this.na.set(a,b);b.Aa.onDestroy(()=>this.na.delete(a))});return b}Fe(a){return this.lh(this.ff(a))}ii(a,b,c,d){let e=this.Dl();a=this.yq(e,a,b,c,d);this.Cl(e,a)}yq(a,b,c,d,e){return olympe.D.Ma().G((f,g)=>{let h=!1,k=olympe.D.vh([b,c,this.Ed(g)],(m,n,p)=>{p>=m&&p<m+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.Gl(a,g,k)})}nh(){null===this.ga&&this.P.run(()=>{this.ga=olympe.D.rd(Array,this.C.filter(a=>void 0!==a));
325
- this.ga.Aa.onDestroy(()=>{this.L=null})});return this.ga}Pd(a){if(this.C.length!==this.size)super.Pd(a);else{var b=this.values;for(let c of this.C.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}Fl(a,b){const c=this.mb,d=this.Wa,e=this.F[a],f=b.valueOf();if(e!==f||this.C[e]!==a){var g=this.C[f];void 0!==g&&delete this.F[g];void 0!==e&&null!==e&&this.C[e]===a&&(this.C[e]=void 0);this.F[a]=f;this.C[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&rb(c[g]),void 0!==
326
- c[a]&&O(c[a],olympe.D.oa(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&rb(d[e]),void 0!==d[b]&&O(d[b],a))}}El(a){var b=this.Wa,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Aa.xb===a&&rb(b));delete this.F[a];this.C.splice(c,1);c=this.mb;null!==c&&void 0!==c[a]&&rb(c[a])}Xp(){if(null!==this.ga){const a=this.C,b=this.ga.Aa.xb;b&&a.join(',')!==b.join(',')&&O(this.ga,a)}}cf(){this.Xp();super.cf()}dh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.mb;if(null!==a)for(b in a)rb(a[b]);
327
- a=this.Wa;if(null!==a)for(b in a)rb(a[parseInt(b,10)]);var b=this.ga;null!==b&&(jb(b.Aa),O(b,this.C));return olympe.D.xh.prototype.dh.call(this)}Yf(){const a=this.values,b=this.F;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.D.Hi.va=[olympe.D.Qc];l=olympe.D.Hi.prototype;l.md.J=olympe.D.H.C;l.xc.J=new olympe.D.H(()=>Object,[]);l.hf.J=new olympe.D.H(()=>String,[]);l.Ed.J=olympe.D.H.G;l.gf.J=olympe.D.H.C;
328
- l.He.J=new olympe.D.H(()=>String,[]);l.ff.J=olympe.D.H.C;l.Qd.J=new olympe.D.H(()=>Object,[]);l.Fe.J=olympe.D.H.C;l.ii.J=new olympe.D.H(()=>{},[]);l.yq.J=olympe.D.H.C;l.nh.J=new olympe.D.H(()=>Array,[]);l.Pd.J=olympe.D.H.C;l.Fl.J=olympe.D.H.C;l.El.J=olympe.D.H.C;l.Xp.J=olympe.D.H.C;l.cf.J=olympe.D.H.C;l.dh.J=olympe.D.H.C;l.Yf.J=olympe.D.H.C;olympe.D.Map=class extends olympe.D.xh{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}md(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&qb(this.F,a);super.md(a)}xc(){null===this.F&&this.Pl();return this.F}hf(){null===this.C&&this.Pl();return this.C}Pl(){this.getContext().run(()=>{this.F=olympe.D.rd(this.Hb());this.C=olympe.D.rd(String);this.Bi(this.Sl())})}Sl(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}Bi(a){if(void 0!==
329
- a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?sb(this.F,b):O(this.F,b);O(this.C,a)}else void 0!==this.F.Aa.xb&&(rb(this.F),rb(this.C))}set(a,b){this.Gj(a,b);1===this.size&&null!==this.C&&this.Bi(a);this.cf()}remove(a){const b=this.ei(a);null!==this.C&&this.C.Aa.xb===a&&this.Bi(this.Sl());return b}clear(){this.dh();null!==this.C&&this.Bi()}};l=olympe.D.Map.prototype;l.md.J=olympe.D.H.C;l.xc.J=new olympe.D.H(()=>Object,[]);l.hf.J=new olympe.D.H(()=>String,[]);l.Pl.J=olympe.D.H.C;l.Sl.J=olympe.D.H.C;
330
- l.Bi.J=olympe.D.H.C;l.set.J=olympe.D.H.C;l.remove.J=new olympe.D.H(()=>Object,[]);l.clear.J=olympe.D.H.C;olympe.D.$f=class extends olympe.D.Hi{constructor(a){super(a)}set(a,b,c){this.Gj(a,b);void 0!==c&&olympe.D.pc([c],d=>{this.Fl(a,d)});this.cf()}remove(a){this.El(a);return this.ei(a)}clear(){this.dh()}};olympe.D.$f.prototype.remove.J=olympe.D.H.C;olympe.D.$f.prototype.clear.J=olympe.D.H.C;olympe.D.Qq=class extends olympe.D.Si{constructor(a,b){super(olympe.D.aa,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.aa.zn.qo}vb(){return olympe.D.Xv(this.node,this.duration,this.C,void 0)}};let Bb=null;olympe.D.K=void 0;olympe.D.vm=void 0;olympe.D.hh=void 0;olympe.D.ah=new Map;olympe.D.ah.set(0,olympe.D.aa.ZERO);olympe.D.ah.set(1,olympe.D.aa.ONE);olympe.D.ah.set(2,olympe.D.aa.xt);olympe.D.Fj=new Map;olympe.D.Fj.set('',olympe.D.Ka.EMPTY);olympe.D.Fj.set(' ',olympe.D.Ka.mt);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,cd:b,qf:c,fm:d,debug:g,Jf:e,Xc:f,fi:h})};olympe.D.mf=function(a){return!!(a&&a instanceof olympe.D.Node)};
331
- olympe.D.rd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.mf(b)?mb(a,b):olympe.D.Ya(b)?mb(a,b.Aa):L(a,b);return N(a)};olympe.D.Ya=function(a){return!(!a||!a.bh)};olympe.D.nf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.bh))};olympe.D.jm=function(a){return olympe.D.mf(a)||a instanceof olympe.D.Jb||a instanceof olympe.D.pp};olympe.D.sh=function(a){return a instanceof olympe.D.Si};
332
- olympe.D.sm=function(a,b){if(void 0!==a){olympe.D.sh(a)&&(a=a.vb().Aa);if(!olympe.D.nf(a))return b(a);var c=[];olympe.D.Ya(a)?c.push(a.Aa):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.Ta=function(a,b){let c=a;olympe.D.Ya(a)?c=a.Aa.xb:olympe.D.mf(a)?c=a.xb:olympe.D.sh(a)&&(c=a.vb().Aa.xb);return void 0===c?b:c};
333
- olympe.D.zg=function(a,b){let c;olympe.D.Ya(a)?c=a.Aa:olympe.D.mf(a)?c=a:olympe.D.sh(a)&&(c=a.vb().Aa);c&&olympe.D.pc([b],d=>{c.zg(d)},'setDefaultValue');return a};olympe.D.vh=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.Up?(h=h.Aa,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.sh(h)&&(h=h.vb().Aa,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
334
- olympe.D.Xd=function(a,b,c,d){return N(olympe.D.vh(a,b,c,d||'syncProxies'))};const Cb=a=>{for(const b of a)if(olympe.D.nf(b)||olympe.D.sh(b))return!1;return!0};olympe.D.sa=function(a,b,c,d,e){if(Cb(a))return b(...a);const f=olympe.D.vh(a,b,c,d||'TransformFlows');e&&olympe.D.pc([e],g=>{f.zg(g)},'setDefaultValue');return N(f)};olympe.D.pc=function(a,b,c){Cb(a)?b(...a):olympe.D.vh(a,b,void 0,c||'processFlows')};
335
- olympe.D.Aq=function(a,b){if(Cb(a))b(...a);else{const c=olympe.D.Ma();olympe.D.vh(a,(...d)=>{olympe.D.Ma().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};olympe.D.tm=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.D.Ya(g)?(g=g.Aa,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.sh(g)&&(g=g.vb().Aa,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({cd:b,fm:e,Jf:f,mw:!1,Xc:c})};
336
- olympe.D.JB=function(a,b,c){const d=olympe.D.Ma();olympe.D.tm(a,(...e)=>{olympe.D.Ma().destroy();d.run(b,...e)},c||'processFutureFlowsOnce')};olympe.D.dB=function(a,b,c){a=new olympe.D.Si(a,c);b(a);return a.vb()};olympe.D.ec=function(a,b='flowSource'){return new olympe.D.Si(a,b)};olympe.D.NB=function(a,b,c,d){const e=olympe.D.Ma();olympe.D.vh(a,(...f)=>{olympe.D.Ma().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};
337
- olympe.D.em=function(a,b,c){olympe.D.sa([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.pB=function(a,b,c='from observable'){const d=olympe.D.ec(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.vb()};olympe.D.mB=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.QB=function(a){return olympe.D.Ma().G(a)};olympe.D.jB=function(a,b,c){olympe.D.lu(a?a.Aa:a,b,c)};
338
- olympe.D.lu=function(a,b,c){if(a){var d=a.W();null===Bb&&(Bb={});if(Bb[d])olympe.D.K.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{Bb[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.K.warn(e):olympe.D.K.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.K.log(f,'undefined'):null===g?olympe.D.K.log(f,'null'):olympe.D.K.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.K.log(`Node #${d} destroyed`+(b?`: ${b}`:
339
- ''))});c.onDestroy(()=>{delete Bb[d]})}}else olympe.D.K.log('NOT starting node dump, node is '+String(a))};olympe.D.iB=function(){let a='',b=olympe.D.Ma();for(;null!==b;)a+=b.zd()+' --\x3e ',b=b.getParent();olympe.D.K.log(a)};
340
- olympe.D.oa=function(a){if(void 0===a)return olympe.D.aa.ZERO;if(a instanceof olympe.D.aa)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.aa.zo;if(a===Math.PI)return olympe.D.aa.PI;if(Infinity===a)return olympe.D.aa.Lr;if(-Infinity===a)return olympe.D.aa.Is;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.ah.has(a)||olympe.D.ah.set(a,new olympe.D.aa(a)),olympe.D.ah.get(a)):new olympe.D.aa(a)}return null};
341
- olympe.D.Gd=function(a){return void 0===a?olympe.D.rd(olympe.D.aa):olympe.D.rd(olympe.D.aa,olympe.D.nf(a)?a:olympe.D.oa(a))};olympe.D.Xv=olympe.D.aa.animate;olympe.D.BB=function(a,b){return new olympe.D.Qq(a,b)};olympe.D.sb=function(a){if(a instanceof olympe.D.Ka)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.D.Fj.has(a)?olympe.D.Fj.get(a):new olympe.D.Ka(a)};
342
- olympe.D.FB=function(a){return void 0===a?olympe.D.rd(olympe.D.Ka):olympe.D.rd(olympe.D.Ka,olympe.D.nf(a)?a:olympe.D.sb(a))};olympe.D.Ib=function(a){return a instanceof olympe.D.ea?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.ea.F:olympe.D.ea.C};olympe.D.CB=function(a){return void 0===a?olympe.D.rd(olympe.D.ea):olympe.D.rd(olympe.D.ea,olympe.D.nf(a)?a:olympe.D.Ib(a))};olympe.D.Yv=function(a){if(a instanceof Date)return new olympe.D.Za(a)};
343
- olympe.D.EB=function(a){return olympe.D.rd(olympe.D.Za,void 0!==a?new olympe.D.Za(a):null)};olympe.D.xq=a=>a instanceof olympe.D.ea||a instanceof olympe.D.aa||a instanceof olympe.D.Ka||a instanceof olympe.D.Za;olympe.D.GB=function(a,b){return olympe.D.rd(olympe.D.Kb,void 0===a&&void 0===b?void 0:new olympe.D.Kb(a,b))};olympe.D.iw=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.D.Color?e=a:e=olympe.D.Color.create(a,b,c,d));return olympe.D.rd(olympe.D.Color,e)};olympe.D.DB=olympe.D.iw;
344
- olympe.D.du=function(a){olympe.D.K=a;olympe.D.hh=olympe.D.og()};olympe.D.og=function(){olympe.D.vm||(olympe.D.vm=new olympe.D.pp);return olympe.D.vm};olympe.D.Ma=function(){olympe.D.hh||(olympe.D.hh=olympe.D.og());return olympe.D.hh};olympe.D.Dq=function(a){const b=olympe.D.hh;olympe.D.jm(a)&&(olympe.D.hh=a);return b||null};
345
- olympe.D.wc=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.Za.wc(a);break;case 'number':b=olympe.D.aa.wc(a);break;case 'string':b=olympe.D.Ka.wc(a);break;case 'vector2':b=olympe.D.Kb.wc(a);break;case 'color':b=olympe.D.Color.wc(a);break;case 'boolean':b=olympe.D.ea.wc(a)}return b}return null};function Db(a){a.C.gb()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.P.clear(),a.T.length=0,a.L.length=0)}
346
- olympe.D.Fz=class{constructor(){this.C=new olympe.D.Jb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.ec(Eb,'Last slot manager entry');this.size=ub(olympe.D.ec(olympe.D.aa,'SlotManager size').repeat(this.F.vb().Yl()),olympe.D.aa.ZERO);this.P=ub(olympe.D.ec(olympe.D.aa,'last valid slots'),olympe.D.oa(-1))});this.T=[];this.L=[];this.C.onDestroy(()=>{Db(this)})}};
347
- class Eb{constructor(a,b,c,d){this.id=a;this.F=new olympe.D.Jb('Slot manager entry');this.L=c;this.P=d;this.F.run(()=>{const e=ub(olympe.D.ec(olympe.D.aa),olympe.D.aa.ZERO);olympe.D.Ya(b)?e.repeat(b):e.update(b);this.C=olympe.D.ec(olympe.D.aa);this.G=this.C.vb().Hd(e.vb())});this.next=null}W(){return this.id}xv(){return this.C.vb()}Yl(){return this.G}Ed(){return this.L}Iv(){return this.P}Gw(a){this.L=a}tw(a){null===a?this.C.update(olympe.D.aa.ZERO):(this.C.repeat(a.Yl()),a.next=this)}Yr(){this.C.clear();
348
- this.next=null}destroy(){this.F.destroy();this.G=this.C=this.next=null}}l=Eb.prototype;l.W.J=olympe.D.H.C;l.xv.J=new olympe.D.H(()=>olympe.D.aa);l.Yl.J=new olympe.D.H(()=>olympe.D.aa);l.Ed.J=olympe.D.H.C;l.Iv.J=olympe.D.H.C;l.Gw.J=olympe.D.H.C;l.tw.J=olympe.D.H.C;l.Yr.J=olympe.D.H.C;l.destroy.J=olympe.D.H.C;olympe.D.R={za:'df.Logger'};olympe.V.config(a=>{F(a,olympe.D.U.Ao,Number.POSITIVE_INFINITY);E(a,olympe.D.R.za,[olympe.la.R.Ga],b=>b.Fc('df'))},'olympe.df');olympe.V.run([olympe.D.R.za],a=>{olympe.D.du(a)},'olympe.df');olympe.host={};const Fb=new Map,Gb=new Map;olympe.host.Eo=class{static register(a,b,...c){Fb.set(a,b);0<c.length&&Gb.set(a,c)}static create(a,b,c,d){const e=Fb.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=Gb.get(a);return void 0!==a?new e(b,c,...a.map(f=>sa(d,f))):new e(b,c)}};function Hb(a,b,c){a.K.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.Eo.create(c,b,a.K,a.L))}function Ib(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.K.$()<=olympe.la.Ab.C.uf&&a.K.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.D.Ya(f))b.push(a.C.get(f.Kt)||null);else if('function'===typeof f){const g=f,h=olympe.D.Ma();b.push((...k)=>{h.gb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
349
- function Jb(a){var b=olympe.host.fe.Wc,c=olympe.host.fe.Do.Np;++a.G;const d=a.G;Hb(a,d,c);const e=olympe.D.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],m=d+'_'+k;this.F.has(m)&&this.F.get(m).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.D.Ya(p)?(h.push(n),p=p.Aa):olympe.D.mf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{Ib(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
350
- {Ib(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(m,f),f.onDestroy(()=>this.F.delete(m)));return null}.bind(a));e.$(a.P.bind(a,d));a=N(e);a.Kt=d;L(e,a);return a}olympe.host.Ba=class{constructor(a,b){this.K=a;this.L=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}fb(){return this.K}P(a){this.K.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.od=class{constructor(a){this.C=a;this.F=olympe.D.Ma()}G(){return this.C}Bc(){return this.C.Aa.Bc()||this.F.Bc()}gb(){return this.C.Aa.gb()}};olympe.host.od.prototype.G.J=new olympe.D.H(()=>olympe.host.fe.od,[]);olympe.host.yj=class{qh(){}};olympe.host.Lh=class{constructor(){}C(){}F(){}back(){}ti(){}};function Kb(a){return(a=a.find(b=>'authToken'===b.ia()))?a.getValue():null}olympe.host.Lh.F=class{constructor(a,b,c=!1){this.name=a;this.value=b;this.C=c}ia(){return this.name}getValue(){return this.value}Ha(a){return this.ia()===a.ia()&&this.getValue()===a.getValue()&&this.C===a.C}};function Lb(){const a={}.parameters;return new olympe.host.Lh.C(a?a.map(b=>new olympe.host.Lh.F(b.name,b.value,b.hidden)):[])}
351
- olympe.host.Lh.C=class{constructor(a){this.parameters=a}merge(a){const b=new Map(this.parameters.map((c,d)=>[c.ia(),d]));a.parameters.forEach(c=>{b.has(c.ia())?this.parameters[b.get(c.ia())]=c:this.parameters.push(c)})}};function Mb(a,b){var c=olympe.host.sf;const d=olympe.Z.hc(),e=new olympe.D.Jb('onTimeout context');c.C.$(b,d,()=>{e.gb()||e.Bc()||e.run(a);c.C.G(d)});return new olympe.host.Wc.F(c.C,d,e)}function Nb(a,b){var c=olympe.host.sf;const d=olympe.Z.hc(),e=new olympe.D.Jb('onInterval context');c.C.T(b,d,()=>{e.gb()||e.Bc()?c.C.F(d):e.run(a)})}olympe.host.Wc=class{constructor(a){this.C=Jb(a)}};olympe.host.Wc.C=class{constructor(a,b,c){this.sf=a;this.id=b;this.C=null!=c?c:null}W(){return this.id}cancel(){}};
352
- olympe.host.Wc.L=class extends olympe.host.Wc.C{cancel(){this.sf.P(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.Wc.F=class extends olympe.host.Wc.C{cancel(){this.sf.G(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.Wc.G=class extends olympe.host.Wc.C{cancel(){this.sf.F(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.kj=class{F(){return''}da(){return''}P(){}C(){return''}G(){}};olympe.host.fe={};olympe.host.fe.od=class{destroy(){}};olympe.host.fe.od.prototype.destroy=olympe.host.fe.od.prototype.destroy;olympe.host.fe.Do={Ow:100,Qw:101,Pw:102,Sw:103,Rw:104,Nw:105,wz:201,uz:202,qz:204,zz:205,pz:206,sz:207,xz:208,Az:209,Bz:210,Cz:211,rz:212,yz:218,vz:219,Dz:220,oz:221,nz:222,Jz:300,Kz:301,Lz:302,Pz:303,Qz:304,Rz:305,Mz:310,Nz:311,Oz:312,Ty:400,Uy:401,Vy:402,Hy:450,Ay:500,yy:501,Dy:502,Cy:503,zy:504,By:505,jA:600,aA:601,eA:602,Xz:603,Yz:604,Vz:605,$z:606,pA:607,hA:608,Sz:609,Wz:610,Zz:611,gA:612,lA:613,Tz:614,kA:615,fA:616,oA:617,bA:618,cA:619,dA:620,iA:630,Uz:631,mA:632,nA:633,SA:700,vA:701,wA:702,
353
- xA:703,zA:704,AA:705,BA:706,yA:707,DA:708,CA:709,EA:710,IA:711,QA:712,FA:713,GA:714,JA:715,KA:716,MA:717,NA:718,PA:719,LA:720,OA:721,RA:722,HA:723,TA:724,UA:725,Np:800};olympe.host.fe.Wc=class{P(){}$(){}G(){}T(){}F(){}};olympe.host.R={sl:'host.System',Lk:'host.HistoryManager',rp:'host.Scheduler',za:'host.platform.Logger',Ga:'host.Manager',Xe:'host.ProcessManager'};olympe.host.U={So:'host.processProbe',wp:'host.gracefulShutdownTimeout'};olympe.host.sf=null;
354
- olympe.V.config(function(a){wa(a,olympe.host.R.sl);wa(a,olympe.host.R.Lk);D(a,olympe.host.R.Xe,olympe.host.kj);E(a,olympe.host.R.za,[olympe.la.R.Ga],function(b){return b.Fc('host')});D(a,olympe.host.R.Ga,olympe.host.Ba,olympe.host.R.za,olympe.V.R.Sf);E(a,olympe.host.R.rp,[olympe.host.R.Ga],b=>{null===olympe.host.sf&&(olympe.host.sf=new olympe.host.Wc(b));return olympe.host.sf},!0)},'olympe.host');olympe.V.run([olympe.host.R.rp],a=>a,'olympe.host.scheduler');olympe.V.run([olympe.host.R.Ga],a=>a,'olympe.host');
355
- olympe.V.run([olympe.host.R.Xe],a=>{olympe.host.Rj=()=>a});olympe.net={};olympe.net.Fa={};olympe.net.Fa.Kd={Pg:'POST',GET:'GET',Er:'HEAD',To:'PUT',qc:'DELETE',Jo:'OPTIONS',Wy:'PATCH'};olympe.net.Fa.ResponseType={ul:'text',lk:'blob',yt:'arraybuffer'};olympe.net.Fa.Headers={Eh:'content-type',bx:'content-length',Mm:'authorization',Pq:'access-control-allow-origin',Nq:'access-control-allow-headers',Oq:'access-control-allow-methods'};olympe.net.Fa.nn={ky:'text/html',JSON:'application/json',Jt:'application/zip'};
356
- olympe.net.Fa.$b={Yq:0,Uh:200,fn:201,Ei:202,Sq:400,At:401,Jn:403,Co:404,Ey:405,Xh:500,it:503};function Ob(a){return a.host&&encodeURI(a.host)}function Pb(a){return encodeURI(a.path).replace(olympe.net.di.C,(b,c)=>'%'+c)}function Qb(a){return void 0===a.F?443===a.port:a.F}olympe.net.di=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.F=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.F=d)}C(){return`${Qb(this)?'wss':'ws'}://${Ob(this)}:${this.port}/${Pb(this)}`}toString(){return`${Ob(this)}:${this.port}/${Pb(this)}`}};
357
- olympe.net.di.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ga(){}da(){}$(){}F(){}};function P(a,b,c,d){a=olympe.Z.jw(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Mh(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.Hq&&(c=a.Hq.split(':'),2===c.length&&(c=Ga(olympe.Z.De(),`${c[0]}:${c[1]}`),Q(b,{Authorization:`Basic ${c}`})));return b}function Rb(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Q(a,b){Object.assign(a.headers,b)}
358
- olympe.net.Mh=class extends olympe.net.di{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.Fa.Kd.GET;this.query=h;this.headers={};this.body=f;this.G=void 0!==g?g:olympe.net.Fa.ResponseType.ul;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}Nj(){return this.headers}C(){let a=Rb(this);a=a?`?${a}`:'';return Ob(this)?`${Qb(this)?'https':'http'}://${Ob(this)}:${this.port}/${Pb(this)}${a}`:`${Pb(this)}${a}`}toString(){return this.C()}};
359
- olympe.net.Mh.Kd={Pg:'POST',GET:'GET',Er:'HEAD',To:'PUT',qc:'DELETE',Jo:'OPTIONS'};olympe.net.Se=class{constructor(a,b,c,d){this.data=a;this.status=void 0===b?200:b;this.statusText=void 0===c?'':c;this.headers=void 0===d?{}:d}getData(){return this.data}Rc(){return this.status}Nj(){return this.headers}};function Sb(a,b,c){const d=olympe.D.Ma(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.G(f=>{d.pf(e);a.F().C.delete(b);c(f)})}function Tb(a,b){return new olympe.net.We(a,b)}olympe.net.Ba=class{constructor(a){this.K=a;this.L=1;a='Initializing NET layer';this.K.C()&&(a+=' (implementation: '+this.T()+')');this.K.info(a);this.K.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}G(){}C(){}P(){}T(){}};function Ub(a){let b;return!(null==(b=a.C)||!b.connected)}function Vb(a,b){const c=()=>{const d=b(),e=d.Yc();return{username:`${a.T.vhost}:${d.oc()}`,password:e}};return Object.assign({},a.T,c(),{transformWsUrl:(d,e,f)=>{Object.assign(f.options,c());return d}})}
360
- function Wb(a,b,c){Ub(a)?(a.K.C()&&a.K.debug(`MQTT subscribe to topic ${b}`),a.C.subscribe(b,void 0,d=>{d?a.K.error(`Failed to subscribe to topic ${b}: ${d}`):a.F.set(b,c)})):null==c||c(Error('Cannot subscribe because the MQTT client is disconnected'))}function Xb(a,b,c){Ub(a)?(a.K.C()&&a.K.debug(`MQTT unsubscribe topic ${b}`),a.C.unsubscribe(b,void 0,c),a.F.delete(b)):c&&c(Error('Cannot unsubscribe because the MQTT client is disconnected'))}function Yb(a,b){a.G.push(b)}
361
- function Zb(a,b){a.P.push(b)}function $b(a,b){a.L.push(b)}
362
- olympe.net.We=class{constructor(a,b){this.url=a;this.T=b||null;this.C=null;this.G=[];this.P=[];this.L=[];this.da=[];this.$=[];this.F=new Map;this.K=olympe.la.fb('MQTT')}connect(a,b){if(Ub(this))return b&&b(),this;b&&this.G.push(b);null===this.C&&(this.C=mqtt.connect(this.url,Vb(this,a)),this.C.on(olympe.net.We.C.Hs,(c,d)=>{this.K.C()&&this.K.debug(`MQTT < ${d}`);this.F.has(c)?this.F.get(c)(JSON.parse(d.toString())):this.K.warn('There is no subscriber for topic '+c)}),this.C.on(olympe.net.We.C.dr,
363
- ()=>{this.K.info('Mqtt client is connected to bus');this.G.forEach(c=>c())}),this.C.on(olympe.net.We.C.at,()=>{this.K.info('Mqtt client is reconnecting to bus ... ');this.P.forEach(c=>c())}),this.C.on(olympe.net.We.C.Db,c=>{this.K.error('Mqtt client error ',c);this.da.forEach(d=>d(c))}),this.C.on(olympe.net.We.C.Th,()=>{this.K.info('Mqtt client is offline');this.L.forEach(c=>c())}),this.C.on(olympe.net.We.C.cr,()=>{this.K.info('Mqtt client is closed');this.$.forEach(c=>c())}),this.C.on(olympe.net.We.C.Dk,
364
- ()=>{this.K.info('Mqtt client has ended')}));return this}publish(a,b,c,d){if(!Ub(this))return null==d||d(Error('Cannot publish message because the MQTT client is disconnected')),this;const e=JSON.stringify(b);this.K.C()&&this.K.debug(`MQTT > ${e}`);this.C.publish(a,e,c,f=>{null==d||d(f);f&&this.K.error('Failed to publish a message '+e)});return this}end(a,b){this.F.clear();this.C?this.C.end(a,{},()=>{b&&b();this.C=null}):null==b||b();return this}};
365
- olympe.net.We.C={dr:'connect',at:'reconnect',Hs:'message',cr:'close',Dk:'end',Db:'error',Th:'offline'};olympe.net.ci=class{constructor(a){this.K=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}F(){return Promise.reject('Try to restart web server with the browser implementation.')}stop(){return Promise.reject('Try to stop web server with the browser implementation.')}P(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}T(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
366
- olympe.net.ci.C='*';olympe.net.R={Ga:'net.Manager',za:'net.Logger',Dj:'net.WebServer'};olympe.net.U={Jh:'net.httpPort',Un:'net.httpBodyLimit',Zi:'net.localNetworkSuffix'};olympe.V.config(function(a){F(a,olympe.net.U.Jh,3141);F(a,olympe.net.U.Un,100);F(a,olympe.net.U.Zi,'frontend');wa(a,olympe.net.R.Ga);E(a,olympe.net.R.za,[olympe.la.R.Ga],b=>b.Fc('net'));D(a,olympe.net.R.Dj,olympe.net.ci,olympe.net.R.za)},'olympe.net');olympe.Na.node.host={};olympe.Na.node.host.od=function(a,b){this.K=b};olympe.Na.node.host.od.prototype.constructor=olympe.Na.node.host.od;olympe.Na.node.host.od.prototype.destroy=function(){};olympe.Na.node.host.od.prototype.destroy=olympe.Na.node.host.od.prototype.destroy;olympe.Na.node.host.od.prototype.fb=function(){return this.K};olympe.Na.node.host.od.va=[olympe.host.fe.od];function ac(a){a.K.error('No history manager implemented in Node')}olympe.Na.node.host.Fo=class{constructor(a){this.K=a}ti(){return!1}C(){ac(this);return Lb()}F(){ac(this)}back(){ac(this)}};olympe.Na.node.host.Fo.va=[olympe.host.Lh];olympe.Na.node.host.Wc=class{constructor(){this.C={};this.L={}}destroy(){}P(a){clearTimeout(this.C[a]);delete this.C[a]}$(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}T(a,b,c){this.L[b]=setInterval(c,a)}F(a){clearInterval(this.L[a]);delete this.L[a]}};olympe.host.Eo.register(olympe.host.fe.Do.Np,olympe.Na.node.host.Wc);olympe.Na.node.host.Wc.va=[olympe.host.fe.Wc];olympe.Na.node.host.yj=class{constructor(a){this.K=a}qh(){return olympe.D.ea.F}};olympe.Na.node.host.yj.va=[olympe.host.yj];function bc(a){const b=olympe.net.Fa.$b.Uh,c=olympe.net.Fa.$b.Xh;a.ga.P('healthcheck','/readiness',[olympe.net.Fa.Kd.GET],()=>{const d=Array.from(a.$.values()).map(e=>e.apply(a));return 0===d.length?Promise.resolve(new olympe.net.Se('No healthCheck is set',b,'Nothing to check')):Promise.allSettled(d).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.K.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.Se(g,
367
- f?c:b,f?'Some services are not working':'Everything is OK')})}).catch(d=>a.K.error(`Failed to add health check route ${d}`));a.F(()=>a.ga.stop())}function cc(a,b){b=Array.from(b.values()).map(c=>olympe.Z.Promise.Cm(c(),a.na,'Some shutdown hook has timeout'));return Promise.allSettled(b).then(c=>{let d=!1;for(const e of c)'rejected'===e.status&&(d=!0,a.K.warn(`Failed to close some resource: ${e.reason}`));return d})}
368
- function dc(a){return v(function*(){try{const b=yield cc(a,a.L),c=yield cc(a,a.T);if(b||c)throw Error('Failed to gracefully close the backend');}finally{a.L.clear(),a.T.clear()}})}
369
- olympe.Na.node.host.kj=class extends olympe.host.kj{constructor(a,b,c,d=!0){super();this.K=a;this.ga=b;this.na=c;this.$=new Map;this.L=new Map;this.T=new Map;d&&bc(this)}C(a){const b=olympe.Z.ef();this.$.set(b,a);return b}G(a){this.$.delete(a)}F(a){const b=olympe.Z.ef();this.L.set(b,a);return b}da(a){const b=olympe.Z.ef();this.T.set(b,a);return b}P(a){this.L.has(a)?this.L.delete(a):this.T.delete(a)}};olympe.V.config(function(a){F(a,olympe.host.U.So,!0);F(a,olympe.host.U.wp,1E4);ua(a,olympe.host.R.Lk,olympe.Na.node.host.Fo,olympe.host.R.za);ua(a,olympe.host.R.sl,olympe.Na.node.host.yj,olympe.host.R.za);D(a,olympe.host.R.Xe,olympe.Na.node.host.kj,olympe.host.R.za,olympe.net.R.Dj,new olympe.V.ma(olympe.host.U.wp),new olympe.V.ma(olympe.host.U.So))},'olympe.native.node.host');olympe.V.run([olympe.host.R.Xe],a=>{olympe.Na.node.host.Rj=()=>a});olympe.net.Vd={};olympe.net.Vd.Rk=class{constructor(a){this.K=a;this.C=new Map}G(){}F(){}};olympe.net.Vd.WebSocket=class{constructor(a,b){this.K=b;this.id=a;this.C=null;this.buffer=[];this.P=this.G=this.L=this.T=null}W(){return this.id}open(a){const b=`#${this.id}`,c=this.na(a);c.binaryType='arraybuffer';c.onopen=()=>{this.K.info('Websocket OPENED');this.T?(this.K.debug('Notifying upper layer for WebSocket',b),this.T()):this.K.warn('Nothing to notify for WebSocket',b);this.K.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));this.buffer.length=
298
+ olympe.D.Ka)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.sb(this.kb.toLocaleTimeString(a)):olympe.D.sa([this,a],(b,c)=>olympe.D.sb(b.kb.toLocaleTimeString(c.valueOf())),olympe.D.Ka)}zc(){return olympe.D.sb(this.kb.toISOString())}zw(){return new Date(this.getTime())}Bw(){return this}Dw(){return this}Jf(a,b){return olympe.D.sa([b],c=>{const d=new olympe.D.Za(new Date(this.kb.getTime()));d.kb['set'+a](this.kb['get'+a]()+c.valueOf());return d},olympe.D.Za)}Mt(a){return this.Jf('Milliseconds',
299
+ a)}Rt(a){return this.Jf('Seconds',a)}Nt(a){return this.Jf('Minutes',a)}Lt(a){return this.Jf('Hours',a)}Gl(a){return this.Jf('Date',a)}St(a){return'number'===typeof a?this.Gl(7*a):this.Gl(a.Wj(7))}Ot(a){return this.Jf('Month',a)}Tt(a){return this.Jf('FullYear',a)}ww(){let a=this.kb.getDay();a=0===a?6:a-1;return new olympe.D.Za(new Date(this.kb.getFullYear(),this.kb.getMonth(),this.kb.getDate()-a))}xw(){return new olympe.D.Za(new Date(this.kb.getFullYear(),this.kb.getMonth()))}bd(a){return olympe.D.sa([a],
300
+ b=>olympe.D.Ib(this.Ha(b)),olympe.D.ea)}Ha(a){return a instanceof olympe.D.Za?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Wu(){let a=this.kb.getDay();0===a&&(a=7);return olympe.D.oa(a)}Lu(a,b){return olympe.D.sa([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.kb.getFullYear()-c.kb.getFullYear():'months'===d?c=12*(this.kb.getFullYear()-c.kb.getFullYear())+(this.kb.getMonth()-c.kb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
301
+ void 0===d&&(olympe.la.fb('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.kb.getTime()-c.kb.getTime())/d));return olympe.D.oa(c)},olympe.D.aa)}Iv(a){return olympe.D.sa([a],b=>olympe.D.Ib(this.getTime()<b.getTime()),olympe.D.ea)}Gv(a){return olympe.D.sa([a],b=>olympe.D.Ib(this.getTime()>b.getTime()),olympe.D.ea)}Jv(a,b){return olympe.D.sa([a,b],(c,d)=>olympe.D.Ib(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.ea)}valueOf(){return this.ti().valueOf()?
302
+ new Date(this.getTime()):new Date(0)}};olympe.D.Za.C=xb(0);olympe.D.Za.F=xb(Number.NaN);l=olympe.D.Za.prototype;l.ti.J=olympe.D.H.P;l.Ur.J=olympe.D.H.G;l.Wr.J=olympe.D.H.G;l.Vr.J=olympe.D.H.G;l.Tr.J=olympe.D.H.G;l.Hu.J=olympe.D.H.G;l.getMonth.J=olympe.D.H.G;l.Xr.J=olympe.D.H.G;l.getTime.J=olympe.D.H.C;l.vw.J=new olympe.D.H(()=>olympe.D.Ka,[0]);l.toLocaleString.J=olympe.D.H.F;l.toLocaleDateString.J=olympe.D.H.F;l.toLocaleTimeString.J=olympe.D.H.F;l.zc.J=olympe.D.H.F;l.zw.J=olympe.D.H.C;
303
+ l.Bw.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Dw.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Jf.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Mt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Rt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Nt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Lt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Gl.J=new olympe.D.H(()=>olympe.D.Za,[0]);l.St.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Ot.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Tt.J=new olympe.D.H(()=>olympe.D.Za,[0]);
304
+ l.ww.J=new olympe.D.H(()=>olympe.D.Za,[]);l.xw.J=new olympe.D.H(()=>olympe.D.Za,[]);l.bd.J=olympe.D.H.P;l.Ha.J=olympe.D.H.C;l.Wu.J=olympe.D.H.G;l.Lu.J=new olympe.D.H(()=>olympe.D.aa,[0,1]);l.Iv.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Gv.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Jv.J=new olympe.D.H(()=>olympe.D.ea,[0,1]);l.valueOf.J=olympe.D.H.C;const yb=new Map,zb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,Ab=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function Bb(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=Ab.exec(c)):(d=1,c=zb.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.D.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.D.nf(a)?olympe.D.Wd([a],b,olympe.D.Color):b(a)}
305
+ olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.oa(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.oa(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.oa(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.oa(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return`{ "type": "color", "r": ${this.C.valueOf()}, "g": ${this.F.valueOf()}, "b": ${this.b.valueOf()}, "a": ${this.a.valueOf()} }`}static xc(a){let b;'string'===typeof a?b=
306
+ JSON.parse(a):b=a;return olympe.D.Color.create(b.r,b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.D.sa([a,b,c,d],(e,f,g,h)=>{e=olympe.D.oa(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.D.oa(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.D.oa(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.D.oa(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of yb.values())if(k&&k.C.Ha(e)&&k.F.Ha(f)&&k.b.Ha(g)&&k.a.Ha(h))return k;
307
+ return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}rg(){return this.C}mg(){return this.b}pg(){return this.F}lg(){return this.a}Yt(a,b){return olympe.D.Color.create(this.C.vi(a.rg(),b),this.F.vi(a.pg(),b),this.b.vi(a.mg(),b),this.a.vi(a.lg(),b))}nu(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}Fq(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}ym(){const a=(16777216|this.b|this.F<<8|this.C<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);
308
+ return'#'+(a+b).toUpperCase()}toString(){return this.ym()}Ha(a){return a instanceof olympe.D.Color?this.C.valueOf()===a.C.valueOf()&&this.F.valueOf()===a.F.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}};olympe.D.Color.prototype.equals=olympe.D.Color.prototype.Ha;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.ym;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.Fq;olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.lg;
309
+ olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.pg;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.mg;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.rg;olympe.D.Color.create=olympe.D.Color.create;l=olympe.D.Color.prototype;l.toJSON.J=olympe.D.H.C;l.rg.J=olympe.D.H.G;l.mg.J=olympe.D.H.G;l.pg.J=olympe.D.H.G;l.lg.J=olympe.D.H.G;l.Yt.J=new olympe.D.H(()=>olympe.D.Color,[]);l.nu.J=new olympe.D.H(()=>olympe.D.Color,[]);l.Fq.J=new olympe.D.H(()=>String,[]);
310
+ l.ym.J=new olympe.D.H(()=>String,[]);l.Ha.J=olympe.D.H.C;olympe.D.File=class{ia(){}io(){}Tk(){}$l(){}Kj(){}Ul(){}Lj(){}rename(){}};olympe.D.Kb=class{constructor(a,b){this.x=olympe.D.Fd(a);this.y=olympe.D.Fd(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.Ta(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.Ta(this.y).valueOf())+' }'}static xc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.Kb(b.x,b.y)}jo(){return this.x}tw(a){ub(this.x,a)}ko(){return this.y}uw(a){ub(this.y,a)}rv(){return this.x.Aq(this.y)}Gd(a){return olympe.D.sa([this,a],(b,c)=>new olympe.D.Kb(b.x.Gd(c.x),b.y.Gd(c.y)),
311
+ olympe.D.Kb,'Vector2.plus')}xg(a){return olympe.D.sa([this,a],(b,c)=>new olympe.D.Kb(b.x.xg(c.x),b.y.xg(c.y)),olympe.D.Kb,'Vector2.minus')}Tv(a){return new olympe.D.Kb(this.x.Wj(a),this.y.Wj(a))}iu(a){return new olympe.D.Kb(this.x.ii(a),this.y.ii(a))}Vv(){return new olympe.D.Kb(this.x.Di(),this.y.Di())}ju(a){return olympe.D.sa([this,a],(b,c)=>olympe.D.sa([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.oa(d*f+e*g),olympe.D.aa),olympe.D.aa)}length(){return olympe.D.sa([this.x,this.y],(a,b)=>olympe.D.oa(Math.sqrt(a*
312
+ a+b*b)),olympe.D.aa)}normalize(){return olympe.D.sa([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.Kb(a/c,b/c)},olympe.D.Kb)}floor(){return olympe.D.sa([this.x,this.y],(a,b)=>new olympe.D.Kb(Math.floor(a),Math.floor(b)),olympe.D.Kb)}ceil(){return olympe.D.sa([this.x,this.y],(a,b)=>new olympe.D.Kb(Math.ceil(a),Math.ceil(b)),olympe.D.Kb)}round(){return olympe.D.sa([this.x,this.y],(a,b)=>new olympe.D.Kb(Math.round(a),Math.round(b)),olympe.D.Kb)}Pt(a){return new olympe.D.Kb(this.x.Gd(a),
313
+ this.y.Gd(a))}Qt(a,b){return new olympe.D.Kb(this.x.Gd(a),this.y.Gd(b))}zc(){return olympe.D.sa([this.x,this.y],(a,b)=>olympe.D.sb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Ka)}toString(){return`Vector2[${this.x.Aa.xb}, ${this.y.Aa.xb}]`}Ha(a){return this===a?!0:!1}};l=olympe.D.Kb.prototype;l.toJSON.J=olympe.D.H.C;l.jo.J=olympe.D.H.G;l.tw.J=olympe.D.H.C;l.ko.J=olympe.D.H.G;l.uw.J=olympe.D.H.C;l.rv.J=olympe.D.H.G;l.Gd.J=new olympe.D.H(()=>olympe.D.Kb,[0]);
314
+ l.xg.J=new olympe.D.H(()=>olympe.D.Kb,[0]);l.Tv.J=olympe.D.H.T;l.iu.J=olympe.D.H.T;l.Vv.J=olympe.D.H.T;l.ju.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.length.J=olympe.D.H.G;l.normalize.J=olympe.D.H.T;l.floor.J=olympe.D.H.T;l.ceil.J=olympe.D.H.T;l.round.J=olympe.D.H.T;l.Pt.J=olympe.D.H.T;l.Qt.J=olympe.D.H.T;l.zc.J=olympe.D.H.F;l.toString.J=olympe.D.H.C;l.Ha.J=olympe.D.H.C;olympe.D.Vf=class{constructor(){}Hb(){}md(){}get(){}mh(){}has(){}vg(){}yc(){}hf(){}Se(){}Nf(){}forEach(){}Od(){}};olympe.D.Vf.prototype.forEachCurrentValue=olympe.D.Vf.prototype.Od;olympe.D.Vf.prototype.forEach=olympe.D.Vf.prototype.forEach;l=olympe.D.Vf.prototype;l.has.J=olympe.D.H.P;l.vg.J=olympe.D.H.C;l.yc.J=new olympe.D.H(()=>Object,[]);l.hf.J=new olympe.D.H(()=>String,[]);l.Se.J=olympe.D.H.G;l.Nf.J=olympe.D.H.C;l.forEach.J=new olympe.D.H(()=>{},[]);l.Od.J=olympe.D.H.C;olympe.D.Qc=class extends olympe.D.Vf{Dd(){}gf(){}He(){}ff(){}Pd(){}Fe(){}ji(){}oh(){}};olympe.D.Qc.prototype.getCurrentAt=olympe.D.Qc.prototype.Fe;olympe.D.Qc.prototype.getAt=olympe.D.Qc.prototype.Pd;olympe.D.Qc.prototype.getCurrentKeyAt=olympe.D.Qc.prototype.ff;olympe.D.Qc.prototype.getKeyAt=olympe.D.Qc.prototype.He;olympe.D.Qc.prototype.getCurrentRank=olympe.D.Qc.prototype.gf;olympe.D.Qc.prototype.getRank=olympe.D.Qc.prototype.Dd;l=olympe.D.Qc.prototype;l.Dd.J=olympe.D.H.G;l.gf.J=olympe.D.H.C;
315
+ l.He.J=new olympe.D.H(()=>String,[]);l.ff.J=olympe.D.H.C;l.Pd.J=new olympe.D.H(()=>Object,[]);l.Fe.J=olympe.D.H.C;l.ji.J=olympe.D.H.C;l.oh.J=new olympe.D.H(()=>Array,[]);olympe.D.zh=class{constructor(a,b){this.P=b||olympe.D.Ma();this.valueType=a||Object;this.values={};this.ub=this.Da=null;this.ze=0;this.$=Object.create(null);this.Db=Object.create(null);this.size=0;this.L=null;this.P.onDestroy(()=>{const c=this.$;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,m=0;m<k;m++)g[h[m]].destroy()}}})}getContext(){return this.P}Hb(){return this.valueType}md(a){this.valueType=a;const b=this.Da;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
316
+ c)&&qb(b[c],a)}get(a){const b=c=>{null===this.Da&&(this.Da={});return this.mi(this.Da,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.sa([a],c=>b(c),this.valueType)}mh(a){a=this.values[a];return olympe.D.Ya(a)?bb(a.Aa)?a.Aa.xb:void 0:a}has(a){const b=c=>{null===this.ub&&(this.ub={});return this.mi(this.ub,c,c in this.values?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea,'Map.has('+c+')')};return olympe.D.sa([a],c=>b(c),olympe.D.ea)}vg(a){return a in this.values}mi(a,b,c,d,e){let f=a[b];
317
+ f||this.P.run(()=>{f=olympe.D.rd(d,void 0,e);a[b]=f;f.Aa.onDestroy(()=>delete a[b]);olympe.D.Ya(c)?tb(f,c):rb(f,c)});return f}yc(){throw Error('Abstract method getFirstKey needs to be overridden');}hf(){throw Error('Abstract method getFirstKey needs to be overridden');}Se(){null===this.L&&this.P.run(()=>{this.L=olympe.D.rd(olympe.D.aa,olympe.D.oa(this.size));this.L.Aa.onDestroy(()=>{this.L=null})});return this.L}Nf(){return this.size}forEach(a,b){const c=this.Cl();a=this.Vp(c,a,b);this.Bl(c,a)}Cl(){return String(++this.ze)}Bl(a,
318
+ b){this.Db[a]=b;olympe.D.Ma().$(()=>{const c=this.$;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Db[a]});this.Od(b)}Vp(a,b,c){const d=olympe.D.Ma();return(e,f)=>{d.run(()=>{const g=olympe.D.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.Fl(a,f,g)})}}Fl(a,b,c){void 0===this.$[b]&&(this.$[b]={});this.$[b][a]=c}Od(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
319
+ a(b[c],c,this))break}Gj(a,b){void 0!==this.values[a]&&this.fi(a,!0);this.values[a]=b;var c=this.Da;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?tb(c[a],b):rb(c[a],b));c=this.ub;null!==c&&void 0!==c[a]&&ub(c[a],!0);this.size++;c=this.Db;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}fi(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.dh?d.Aa.xb:d;var e=this.Da;null!==e&&void 0!==e[a]&&sb(e[a]);e=this.ub;null!==e&&void 0!==
320
+ e[a]&&ub(e[a],!1);delete c[a];this.size--;b||this.bf()}a=this.$[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}bf(){null!==this.L&&ub(this.L,this.size)}eh(){var a=this.Da;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&sb(a[c]);a=this.ub;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&ub(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.$)if(Object.prototype.hasOwnProperty.call(this.$,
321
+ c)){b=this.$[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.L&&ub(this.L,this.size)}Yf(){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.D.zh.va=[olympe.D.Vf];l=olympe.D.zh.prototype;l.getContext.J=olympe.D.H.C;l.Hb.J=olympe.D.H.C;l.md.J=olympe.D.H.C;l.get.J=new olympe.D.H(()=>Object,[],'valueType');l.mh.J=olympe.D.H.C;l.has.J=olympe.D.H.P;l.vg.J=olympe.D.H.C;l.mi.J=olympe.D.H.C;
322
+ l.Se.J=olympe.D.H.G;l.Nf.J=olympe.D.H.C;l.forEach.J=new olympe.D.H(()=>{},[]);l.Cl.J=olympe.D.H.C;l.Bl.J=olympe.D.H.C;l.Vp.J=olympe.D.H.C;l.Fl.J=olympe.D.H.C;l.Od.J=olympe.D.H.C;l.Gj.J=olympe.D.H.C;l.fi.J=olympe.D.H.C;l.bf.J=olympe.D.H.C;l.eh.J=olympe.D.H.C;l.Yf.J=olympe.D.H.C;olympe.D.Hi=class extends olympe.D.zh{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.na=this.Wa=this.mb=this.ga=null}md(a){super.md(a);if(null!==this.na)for(let b of this.na.values())qb(b,a)}yc(){return this.Pd(0)}hf(){return this.He(0)}Dd(a){const b=c=>{null===this.mb&&(this.mb=Object.create(null));let d=this.gf(a);d=void 0!==d?olympe.D.oa(d):void 0;return this.mi(this.mb,c,d,olympe.D.aa,`List.getRank(${c})`)};return olympe.D.Ya(a)?N(olympe.D.createNode(olympe.D.aa,b,null,
323
+ [a.Aa],[0],'onResolved('+(b.name||'')+')')):b(a)}gf(a){return this.F[a]}He(a){const b=c=>{const d=c.valueOf(),e=this.ff(d);null===this.Wa&&(this.Wa=Object.create(null));return this.mi(this.Wa,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.sa([a],c=>b(c),String)}ff(a){return this.C[a.valueOf()]}Pd(a){if(olympe.D.Ya(a))return this.get(olympe.D.sa([a],c=>{c=this.He(c);if(!bb(c.Aa)){const d=olympe.D.Ma();olympe.D.mf(d)&&lb(d)}return c},String));null===this.na&&(this.na=new Map);let b=this.na.get(a);
324
+ b||this.P.run(()=>{b=this.get(this.He(a));this.na.set(a,b);b.Aa.onDestroy(()=>this.na.delete(a))});return b}Fe(a){return this.mh(this.ff(a))}ji(a,b,c,d){let e=this.Cl();a=this.xq(e,a,b,c,d);this.Bl(e,a)}xq(a,b,c,d,e){return olympe.D.Ma().G((f,g)=>{let h=!1,k=olympe.D.xh([b,c,this.Dd(g)],(m,n,p)=>{p>=m&&p<m+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.Fl(a,g,k)})}oh(){null===this.ga&&this.P.run(()=>{this.ga=olympe.D.rd(Array,this.C.filter(a=>void 0!==a));
325
+ this.ga.Aa.onDestroy(()=>{this.L=null})});return this.ga}Od(a){if(this.C.length!==this.size)super.Od(a);else{var b=this.values;for(let c of this.C.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}El(a,b){const c=this.mb,d=this.Wa,e=this.F[a],f=b.valueOf();if(e!==f||this.C[e]!==a){var g=this.C[f];void 0!==g&&delete this.F[g];void 0!==e&&null!==e&&this.C[e]===a&&(this.C[e]=void 0);this.F[a]=f;this.C[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&sb(c[g]),void 0!==
326
+ c[a]&&rb(c[a],olympe.D.oa(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&sb(d[e]),void 0!==d[b]&&rb(d[b],a))}}Dl(a){var b=this.Wa,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Aa.xb===a&&sb(b));delete this.F[a];this.C.splice(c,1);c=this.mb;null!==c&&void 0!==c[a]&&sb(c[a])}Wp(){if(null!==this.ga){const a=this.C,b=this.ga.Aa.xb;b&&a.join(',')!==b.join(',')&&rb(this.ga,a)}}bf(){this.Wp();super.bf()}eh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.mb;if(null!==
327
+ a)for(b in a)sb(a[b]);a=this.Wa;if(null!==a)for(b in a)sb(a[parseInt(b,10)]);var b=this.ga;null!==b&&(jb(b.Aa),rb(b,this.C));return olympe.D.zh.prototype.eh.call(this)}Yf(){const a=this.values,b=this.F;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.D.Hi.va=[olympe.D.Qc];l=olympe.D.Hi.prototype;l.md.J=olympe.D.H.C;l.yc.J=new olympe.D.H(()=>Object,[]);l.hf.J=new olympe.D.H(()=>String,[]);l.Dd.J=olympe.D.H.G;l.gf.J=olympe.D.H.C;
328
+ l.He.J=new olympe.D.H(()=>String,[]);l.ff.J=olympe.D.H.C;l.Pd.J=new olympe.D.H(()=>Object,[]);l.Fe.J=olympe.D.H.C;l.ji.J=new olympe.D.H(()=>{},[]);l.xq.J=olympe.D.H.C;l.oh.J=new olympe.D.H(()=>Array,[]);l.Od.J=olympe.D.H.C;l.El.J=olympe.D.H.C;l.Dl.J=olympe.D.H.C;l.Wp.J=olympe.D.H.C;l.bf.J=olympe.D.H.C;l.eh.J=olympe.D.H.C;l.Yf.J=olympe.D.H.C;olympe.D.Map=class extends olympe.D.zh{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}md(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&qb(this.F,a);super.md(a)}yc(){null===this.F&&this.Ol();return this.F}hf(){null===this.C&&this.Ol();return this.C}Ol(){this.getContext().run(()=>{this.F=olympe.D.rd(this.Hb());this.C=olympe.D.rd(String);this.Bi(this.Rl())})}Rl(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}Bi(a){if(void 0!==
329
+ a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?tb(this.F,b):rb(this.F,b);rb(this.C,a)}else void 0!==this.F.Aa.xb&&(sb(this.F),sb(this.C))}set(a,b){this.Gj(a,b);1===this.size&&null!==this.C&&this.Bi(a);this.bf()}remove(a){const b=this.fi(a);null!==this.C&&this.C.Aa.xb===a&&this.Bi(this.Rl());return b}clear(){this.eh();null!==this.C&&this.Bi()}};l=olympe.D.Map.prototype;l.md.J=olympe.D.H.C;l.yc.J=new olympe.D.H(()=>Object,[]);l.hf.J=new olympe.D.H(()=>String,[]);l.Ol.J=olympe.D.H.C;
330
+ l.Rl.J=olympe.D.H.C;l.Bi.J=olympe.D.H.C;l.set.J=olympe.D.H.C;l.remove.J=new olympe.D.H(()=>Object,[]);l.clear.J=olympe.D.H.C;olympe.D.$f=class extends olympe.D.Hi{constructor(a){super(a)}set(a,b,c){this.Gj(a,b);void 0!==c&&olympe.D.qc([c],d=>{this.El(a,d)});this.bf()}remove(a){this.Dl(a);return this.fi(a)}clear(){this.eh()}};olympe.D.$f.prototype.remove.J=olympe.D.H.C;olympe.D.$f.prototype.clear.J=olympe.D.H.C;olympe.D.Pq=class extends olympe.D.Si{constructor(a,b){super(olympe.D.aa,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.aa.zn.oo}vb(){return olympe.D.Wv(this.node,this.duration,this.C,void 0)}};let Cb=null;olympe.D.K=void 0;olympe.D.um=void 0;olympe.D.ih=void 0;olympe.D.bh=new Map;olympe.D.bh.set(0,olympe.D.aa.ZERO);olympe.D.bh.set(1,olympe.D.aa.ONE);olympe.D.bh.set(2,olympe.D.aa.xt);olympe.D.Fj=new Map;olympe.D.Fj.set('',olympe.D.Ka.EMPTY);olympe.D.Fj.set(' ',olympe.D.Ka.mt);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,dd:b,qf:c,em:d,debug:g,Kf:e,Xc:f,gi:h})};olympe.D.mf=function(a){return!!(a&&a instanceof olympe.D.Node)};
331
+ olympe.D.rd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.mf(b)?mb(a,b):olympe.D.Ya(b)?mb(a,b.Aa):L(a,b);return N(a)};olympe.D.Ya=function(a){return!(!a||!a.dh)};olympe.D.nf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.dh))};olympe.D.im=function(a){return olympe.D.mf(a)||a instanceof olympe.D.Jb||a instanceof olympe.D.np};olympe.D.th=function(a){return a instanceof olympe.D.Si};
332
+ olympe.D.qm=function(a,b){if(void 0!==a){olympe.D.th(a)&&(a=a.vb().Aa);if(!olympe.D.nf(a))return b(a);var c=[];olympe.D.Ya(a)?c.push(a.Aa):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.Ta=function(a,b){let c=a;olympe.D.Ya(a)?c=a.Aa.xb:olympe.D.mf(a)?c=a.xb:olympe.D.th(a)&&(c=a.vb().Aa.xb);return void 0===c?b:c};
333
+ olympe.D.zg=function(a,b){let c;olympe.D.Ya(a)?c=a.Aa:olympe.D.mf(a)?c=a:olympe.D.th(a)&&(c=a.vb().Aa);c&&olympe.D.qc([b],d=>{c.zg(d)},'setDefaultValue');return a};olympe.D.xh=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.Tp?(h=h.Aa,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.th(h)&&(h=h.vb().Aa,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
334
+ olympe.D.Wd=function(a,b,c,d){return N(olympe.D.xh(a,b,c,d||'syncProxies'))};const Db=a=>{for(const b of a)if(olympe.D.nf(b)||olympe.D.th(b))return!1;return!0};olympe.D.sa=function(a,b,c,d,e){if(Db(a))return b(...a);const f=olympe.D.xh(a,b,c,d||'TransformFlows');e&&olympe.D.qc([e],g=>{f.zg(g)},'setDefaultValue');return N(f)};olympe.D.qc=function(a,b,c){Db(a)?b(...a):olympe.D.xh(a,b,void 0,c||'processFlows')};
335
+ olympe.D.zq=function(a,b){if(Db(a))b(...a);else{const c=olympe.D.Ma();olympe.D.xh(a,(...d)=>{olympe.D.Ma().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};olympe.D.sm=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.D.Ya(g)?(g=g.Aa,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.th(g)&&(g=g.vb().Aa,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({dd:b,em:e,Kf:f,lw:!1,Xc:c})};
336
+ olympe.D.HB=function(a,b,c){const d=olympe.D.Ma();olympe.D.sm(a,(...e)=>{olympe.D.Ma().destroy();d.run(b,...e)},c||'processFutureFlowsOnce')};olympe.D.bB=function(a,b,c){a=new olympe.D.Si(a,c);b(a);return a.vb()};olympe.D.cc=function(a,b='flowSource'){return new olympe.D.Si(a,b)};olympe.D.KB=function(a,b,c,d){const e=olympe.D.Ma();olympe.D.xh(a,(...f)=>{olympe.D.Ma().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};
337
+ olympe.D.cm=function(a,b,c){olympe.D.sa([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.nB=function(a,b,c='from observable'){const d=olympe.D.cc(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.vb()};olympe.D.kB=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.NB=function(a){return olympe.D.Ma().G(a)};olympe.D.hB=function(a,b,c){olympe.D.ku(a?a.Aa:a,b,c)};
338
+ olympe.D.ku=function(a,b,c){if(a){var d=a.W();null===Cb&&(Cb={});if(Cb[d])olympe.D.K.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{Cb[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.K.warn(e):olympe.D.K.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.K.log(f,'undefined'):null===g?olympe.D.K.log(f,'null'):olympe.D.K.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.K.log(`Node #${d} destroyed`+(b?`: ${b}`:
339
+ ''))});c.onDestroy(()=>{delete Cb[d]})}}else olympe.D.K.log('NOT starting node dump, node is '+String(a))};olympe.D.gB=function(){let a='',b=olympe.D.Ma();for(;null!==b;)a+=b.zd()+' --\x3e ',b=b.getParent();olympe.D.K.log(a)};
340
+ olympe.D.oa=function(a){if(void 0===a)return olympe.D.aa.ZERO;if(a instanceof olympe.D.aa)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.aa.xo;if(a===Math.PI)return olympe.D.aa.PI;if(Infinity===a)return olympe.D.aa.Lr;if(-Infinity===a)return olympe.D.aa.Is;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.bh.has(a)||olympe.D.bh.set(a,new olympe.D.aa(a)),olympe.D.bh.get(a)):new olympe.D.aa(a)}return null};
341
+ olympe.D.Fd=function(a){return void 0===a?olympe.D.rd(olympe.D.aa):olympe.D.rd(olympe.D.aa,olympe.D.nf(a)?a:olympe.D.oa(a))};olympe.D.Wv=olympe.D.aa.animate;olympe.D.zB=function(a,b){return new olympe.D.Pq(a,b)};olympe.D.sb=function(a){if(a instanceof olympe.D.Ka)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.D.Fj.has(a)?olympe.D.Fj.get(a):new olympe.D.Ka(a)};
342
+ olympe.D.DB=function(a){return void 0===a?olympe.D.rd(olympe.D.Ka):olympe.D.rd(olympe.D.Ka,olympe.D.nf(a)?a:olympe.D.sb(a))};olympe.D.Ib=function(a){return a instanceof olympe.D.ea?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.ea.F:olympe.D.ea.C};olympe.D.AB=function(a){return void 0===a?olympe.D.rd(olympe.D.ea):olympe.D.rd(olympe.D.ea,olympe.D.nf(a)?a:olympe.D.Ib(a))};olympe.D.Xv=function(a){if(a instanceof Date)return new olympe.D.Za(a)};
343
+ olympe.D.CB=function(a){return olympe.D.rd(olympe.D.Za,void 0!==a?new olympe.D.Za(a):null)};olympe.D.wq=a=>a instanceof olympe.D.ea||a instanceof olympe.D.aa||a instanceof olympe.D.Ka||a instanceof olympe.D.Za;olympe.D.EB=function(a,b){return olympe.D.rd(olympe.D.Kb,void 0===a&&void 0===b?void 0:new olympe.D.Kb(a,b))};olympe.D.hw=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.D.Color?e=a:e=olympe.D.Color.create(a,b,c,d));return olympe.D.rd(olympe.D.Color,e)};olympe.D.BB=olympe.D.hw;
344
+ olympe.D.cu=function(a){olympe.D.K=a;olympe.D.ih=olympe.D.og()};olympe.D.og=function(){olympe.D.um||(olympe.D.um=new olympe.D.np);return olympe.D.um};olympe.D.Ma=function(){olympe.D.ih||(olympe.D.ih=olympe.D.og());return olympe.D.ih};olympe.D.Cq=function(a){const b=olympe.D.ih;olympe.D.im(a)&&(olympe.D.ih=a);return b||null};
345
+ olympe.D.xc=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.Za.xc(a);break;case 'number':b=olympe.D.aa.xc(a);break;case 'string':b=olympe.D.Ka.xc(a);break;case 'vector2':b=olympe.D.Kb.xc(a);break;case 'color':b=olympe.D.Color.xc(a);break;case 'boolean':b=olympe.D.ea.xc(a)}return b}return null};function Eb(a){a.C.gb()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.P.clear(),a.T.length=0,a.L.length=0)}
346
+ olympe.D.Dz=class{constructor(){this.C=new olympe.D.Jb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.cc(Fb,'Last slot manager entry');this.size=vb(olympe.D.cc(olympe.D.aa,'SlotManager size').repeat(this.F.vb().Xl()),olympe.D.aa.ZERO);this.P=vb(olympe.D.cc(olympe.D.aa,'last valid slots'),olympe.D.oa(-1))});this.T=[];this.L=[];this.C.onDestroy(()=>{Eb(this)})}};
347
+ class Fb{constructor(a,b,c,d){this.id=a;this.F=new olympe.D.Jb('Slot manager entry');this.L=c;this.P=d;this.F.run(()=>{const e=vb(olympe.D.cc(olympe.D.aa),olympe.D.aa.ZERO);olympe.D.Ya(b)?e.repeat(b):e.update(b);this.C=olympe.D.cc(olympe.D.aa);this.G=this.C.vb().Gd(e.vb())});this.next=null}W(){return this.id}wv(){return this.C.vb()}Xl(){return this.G}Dd(){return this.L}Hv(){return this.P}Fw(a){this.L=a}sw(a){null===a?this.C.update(olympe.D.aa.ZERO):(this.C.repeat(a.Xl()),a.next=this)}Yr(){this.C.clear();
348
+ this.next=null}destroy(){this.F.destroy();this.G=this.C=this.next=null}}l=Fb.prototype;l.W.J=olympe.D.H.C;l.wv.J=new olympe.D.H(()=>olympe.D.aa);l.Xl.J=new olympe.D.H(()=>olympe.D.aa);l.Dd.J=olympe.D.H.C;l.Hv.J=olympe.D.H.C;l.Fw.J=olympe.D.H.C;l.sw.J=olympe.D.H.C;l.Yr.J=olympe.D.H.C;l.destroy.J=olympe.D.H.C;olympe.D.R={za:'df.Logger'};olympe.V.config(a=>{F(a,olympe.D.U.yo,Number.POSITIVE_INFINITY);E(a,olympe.D.R.za,[olympe.la.R.Ga],b=>b.Fc('df'))},'olympe.df');olympe.V.run([olympe.D.R.za],a=>{olympe.D.cu(a)},'olympe.df');olympe.host={};const Gb=new Map,Hb=new Map;olympe.host.Co=class{static register(a,b,...c){Gb.set(a,b);0<c.length&&Hb.set(a,c)}static create(a,b,c,d){const e=Gb.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=Hb.get(a);return void 0!==a?new e(b,c,...a.map(f=>sa(d,f))):new e(b,c)}};function Ib(a,b,c){a.K.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.Co.create(c,b,a.K,a.L))}function Jb(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.K.$()<=olympe.la.zb.C.uf&&a.K.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.D.Ya(f))b.push(a.C.get(f.Jt)||null);else if('function'===typeof f){const g=f,h=olympe.D.Ma();b.push((...k)=>{h.gb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
349
+ function Kb(a){var b=olympe.host.fe.Wc,c=olympe.host.fe.Bo.Mp;++a.G;const d=a.G;Ib(a,d,c);const e=olympe.D.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],m=d+'_'+k;this.F.has(m)&&this.F.get(m).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.D.Ya(p)?(h.push(n),p=p.Aa):olympe.D.mf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{Jb(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
350
+ {Jb(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(m,f),f.onDestroy(()=>this.F.delete(m)));return null}.bind(a));e.$(a.P.bind(a,d));a=N(e);a.Jt=d;L(e,a);return a}olympe.host.Ba=class{constructor(a,b){this.K=a;this.L=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}fb(){return this.K}P(a){this.K.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.od=class{constructor(a){this.C=a;this.F=olympe.D.Ma()}G(){return this.C}Bc(){return this.C.Aa.Bc()||this.F.Bc()}gb(){return this.C.Aa.gb()}};olympe.host.od.prototype.G.J=new olympe.D.H(()=>olympe.host.fe.od,[]);olympe.host.yj=class{rh(){}};olympe.host.Nh=class{constructor(){}C(){}F(){}back(){}ti(){}};function Lb(a){return(a=a.find(b=>'authToken'===b.ia()))?a.getValue():null}olympe.host.Nh.F=class{constructor(a,b,c=!1){this.name=a;this.value=b;this.C=c}ia(){return this.name}getValue(){return this.value}Ha(a){return this.ia()===a.ia()&&this.getValue()===a.getValue()&&this.C===a.C}};function Mb(){const a={}.parameters;return new olympe.host.Nh.C(a?a.map(b=>new olympe.host.Nh.F(b.name,b.value,b.hidden)):[])}
351
+ olympe.host.Nh.C=class{constructor(a){this.parameters=a}merge(a){const b=new Map(this.parameters.map((c,d)=>[c.ia(),d]));a.parameters.forEach(c=>{b.has(c.ia())?this.parameters[b.get(c.ia())]=c:this.parameters.push(c)})}};function Nb(a,b){var c=olympe.host.sf;const d=olympe.Z.hc(),e=new olympe.D.Jb('onTimeout context');c.C.$(b,d,()=>{e.gb()||e.Bc()||e.run(a);c.C.G(d)});return new olympe.host.Wc.F(c.C,d,e)}function Ob(a,b){var c=olympe.host.sf;const d=olympe.Z.hc(),e=new olympe.D.Jb('onInterval context');c.C.T(b,d,()=>{e.gb()||e.Bc()?c.C.F(d):e.run(a)})}olympe.host.Wc=class{constructor(a){this.C=Kb(a)}};olympe.host.Wc.C=class{constructor(a,b,c){this.sf=a;this.id=b;this.C=null!=c?c:null}W(){return this.id}cancel(){}};
352
+ olympe.host.Wc.L=class extends olympe.host.Wc.C{cancel(){this.sf.P(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.Wc.F=class extends olympe.host.Wc.C{cancel(){this.sf.G(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.Wc.G=class extends olympe.host.Wc.C{cancel(){this.sf.F(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.kj=class{F(){return''}da(){return''}P(){}C(){return''}G(){}};olympe.host.fe={};olympe.host.fe.od=class{destroy(){}};olympe.host.fe.od.prototype.destroy=olympe.host.fe.od.prototype.destroy;olympe.host.fe.Bo={Nw:100,Pw:101,Ow:102,Rw:103,Qw:104,Mw:105,uz:201,rz:202,oz:204,xz:205,nz:206,qz:207,vz:208,yz:209,zz:210,Az:211,pz:212,wz:218,sz:219,Bz:220,mz:221,lz:222,Hz:300,Iz:301,Jz:302,Nz:303,Oz:304,Pz:305,Kz:310,Lz:311,Mz:312,Ry:400,Sy:401,Ty:402,Fy:450,yy:500,wy:501,By:502,Ay:503,xy:504,zy:505,hA:600,Zz:601,cA:602,Vz:603,Wz:604,Tz:605,Yz:606,nA:607,fA:608,Qz:609,Uz:610,Xz:611,eA:612,jA:613,Rz:614,iA:615,dA:616,mA:617,$z:618,aA:619,bA:620,gA:630,Sz:631,kA:632,lA:633,QA:700,tA:701,uA:702,
353
+ vA:703,xA:704,yA:705,zA:706,wA:707,BA:708,AA:709,CA:710,GA:711,OA:712,DA:713,EA:714,HA:715,IA:716,KA:717,LA:718,NA:719,JA:720,MA:721,PA:722,FA:723,RA:724,SA:725,Mp:800};olympe.host.fe.Wc=class{P(){}$(){}G(){}T(){}F(){}};olympe.host.R={rl:'host.System',Kk:'host.HistoryManager',pp:'host.Scheduler',za:'host.platform.Logger',Ga:'host.Manager',We:'host.ProcessManager'};olympe.host.U={Qo:'host.processProbe',up:'host.gracefulShutdownTimeout'};olympe.host.sf=null;
354
+ olympe.V.config(function(a){wa(a,olympe.host.R.rl);wa(a,olympe.host.R.Kk);D(a,olympe.host.R.We,olympe.host.kj);E(a,olympe.host.R.za,[olympe.la.R.Ga],function(b){return b.Fc('host')});D(a,olympe.host.R.Ga,olympe.host.Ba,olympe.host.R.za,olympe.V.R.Sf);E(a,olympe.host.R.pp,[olympe.host.R.Ga],b=>{null===olympe.host.sf&&(olympe.host.sf=new olympe.host.Wc(b));return olympe.host.sf},!0)},'olympe.host');olympe.V.run([olympe.host.R.pp],a=>a,'olympe.host.scheduler');olympe.V.run([olympe.host.R.Ga],a=>a,'olympe.host');
355
+ olympe.V.run([olympe.host.R.We],a=>{olympe.host.Rj=()=>a});olympe.net={};olympe.net.Fa={};olympe.net.Fa.Jd={Pg:'POST',GET:'GET',Er:'HEAD',Ro:'PUT',rc:'DELETE',Ho:'OPTIONS',Uy:'PATCH'};olympe.net.Fa.ResponseType={tl:'text',Om:'blob',Hp:'arraybuffer'};olympe.net.Fa.Headers={Gh:'content-type',$w:'content-length',Lm:'authorization',Oq:'access-control-allow-origin',Mq:'access-control-allow-headers',Nq:'access-control-allow-methods'};olympe.net.Fa.nn={iy:'text/html',JSON:'application/json',It:'application/zip'};
356
+ olympe.net.Fa.Zb={Xq:0,Wh:200,fn:201,Ei:202,Rq:400,zt:401,Jn:403,Ao:404,Cy:405,Zh:500,it:503};function Pb(a){return a.host&&encodeURI(a.host)}function Qb(a){return encodeURI(a.path).replace(olympe.net.ei.C,(b,c)=>'%'+c)}function Rb(a){return void 0===a.F?443===a.port:a.F}olympe.net.ei=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.F=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.F=d)}C(){return`${Rb(this)?'wss':'ws'}://${Pb(this)}:${this.port}/${Qb(this)}`}toString(){return`${Pb(this)}:${this.port}/${Qb(this)}`}};
357
+ olympe.net.ei.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ga(){}da(){}$(){}F(){}};function O(a,b,c,d){a=olympe.Z.iw(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Oh(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.Gq&&(c=a.Gq.split(':'),2===c.length&&(c=Ga(olympe.Z.De(),`${c[0]}:${c[1]}`),P(b,{Authorization:`Basic ${c}`})));return b}function Sb(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function P(a,b){Object.assign(a.headers,b)}
358
+ olympe.net.Oh=class extends olympe.net.ei{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.Fa.Jd.GET;this.query=h;this.headers={};this.body=f;this.G=void 0!==g?g:olympe.net.Fa.ResponseType.tl;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}Nj(){return this.headers}C(){let a=Sb(this);a=a?`?${a}`:'';return Pb(this)?`${Rb(this)?'https':'http'}://${Pb(this)}:${this.port}/${Qb(this)}${a}`:`${Qb(this)}${a}`}toString(){return this.C()}};
359
+ olympe.net.Oh.Jd={Pg:'POST',GET:'GET',Er:'HEAD',Ro:'PUT',rc:'DELETE',Ho:'OPTIONS'};olympe.net.Bf=class{constructor(a,b,c,d){this.data=a;this.status=void 0===b?200:b;this.statusText=void 0===c?'':c;this.headers=void 0===d?{}:d}getData(){return this.data}Rc(){return this.status}Nj(){return this.headers}};function Tb(a,b,c){const d=olympe.D.Ma(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.G(f=>{d.pf(e);a.F().C.delete(b);c(f)})}function Ub(a,b){return new olympe.net.Ve(a,b)}olympe.net.Ba=class{constructor(a){this.K=a;this.L=1;a='Initializing NET layer';this.K.C()&&(a+=' (implementation: '+this.T()+')');this.K.info(a);this.K.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}G(){}C(){}P(){}T(){}};function Vb(a){let b;return!(null==(b=a.C)||!b.connected)}function Wb(a,b){const c=()=>{const d=b(),e=d.Yc();return{username:`${a.T.vhost}:${d.pc()}`,password:e}};return Object.assign({},a.T,c(),{transformWsUrl:(d,e,f)=>{Object.assign(f.options,c());return d}})}
360
+ function Xb(a,b,c){Vb(a)?(a.K.C()&&a.K.debug(`MQTT subscribe to topic ${b}`),a.C.subscribe(b,void 0,d=>{d?a.K.error(`Failed to subscribe to topic ${b}: ${d}`):a.F.set(b,c)})):null==c||c(Error('Cannot subscribe because the MQTT client is disconnected'))}function Yb(a,b,c){Vb(a)?(a.K.C()&&a.K.debug(`MQTT unsubscribe topic ${b}`),a.C.unsubscribe(b,void 0,c),a.F.delete(b)):c&&c(Error('Cannot unsubscribe because the MQTT client is disconnected'))}function Zb(a,b){a.G.push(b)}
361
+ function $b(a,b){a.P.push(b)}function ac(a,b){a.L.push(b)}
362
+ olympe.net.Ve=class{constructor(a,b){this.url=a;this.T=b||null;this.C=null;this.G=[];this.P=[];this.L=[];this.da=[];this.$=[];this.F=new Map;this.K=olympe.la.fb('MQTT')}connect(a,b){if(Vb(this))return b&&b(),this;b&&this.G.push(b);null===this.C&&(this.C=mqtt.connect(this.url,Wb(this,a)),this.C.on(olympe.net.Ve.C.Hs,(c,d)=>{this.K.C()&&this.K.debug(`MQTT < ${d}`);this.F.has(c)?this.F.get(c)(JSON.parse(d.toString())):this.K.warn('There is no subscriber for topic '+c)}),this.C.on(olympe.net.Ve.C.dr,
363
+ ()=>{this.K.info('Mqtt client is connected to bus');this.G.forEach(c=>c())}),this.C.on(olympe.net.Ve.C.at,()=>{this.K.info('Mqtt client is reconnecting to bus ... ');this.P.forEach(c=>c())}),this.C.on(olympe.net.Ve.C.Cb,c=>{this.K.error('Mqtt client error ',c);this.da.forEach(d=>d(c))}),this.C.on(olympe.net.Ve.C.Vh,()=>{this.K.info('Mqtt client is offline');this.L.forEach(c=>c())}),this.C.on(olympe.net.Ve.C.br,()=>{this.K.info('Mqtt client is closed');this.$.forEach(c=>c())}),this.C.on(olympe.net.Ve.C.Ck,
364
+ ()=>{this.K.info('Mqtt client has ended')}));return this}publish(a,b,c,d){if(!Vb(this))return null==d||d(Error('Cannot publish message because the MQTT client is disconnected')),this;const e=JSON.stringify(b);this.K.C()&&this.K.debug(`MQTT > ${e}`);this.C.publish(a,e,c,f=>{null==d||d(f);f&&this.K.error('Failed to publish a message '+e)});return this}end(a,b){this.F.clear();this.C?this.C.end(a,{},()=>{b&&b();this.C=null}):null==b||b();return this}};
365
+ olympe.net.Ve.C={dr:'connect',at:'reconnect',Hs:'message',br:'close',Ck:'end',Cb:'error',Vh:'offline'};olympe.net.di=class{constructor(a){this.K=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}F(){return Promise.reject('Try to restart web server with the browser implementation.')}stop(){return Promise.reject('Try to stop web server with the browser implementation.')}P(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}T(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
366
+ olympe.net.di.C='*';olympe.net.R={Ga:'net.Manager',za:'net.Logger',Dj:'net.WebServer'};olympe.net.U={Lh:'net.httpPort',Un:'net.httpBodyLimit',Zi:'net.localNetworkSuffix'};olympe.V.config(function(a){F(a,olympe.net.U.Lh,3141);F(a,olympe.net.U.Un,100);F(a,olympe.net.U.Zi,'frontend');wa(a,olympe.net.R.Ga);E(a,olympe.net.R.za,[olympe.la.R.Ga],b=>b.Fc('net'));D(a,olympe.net.R.Dj,olympe.net.di,olympe.net.R.za)},'olympe.net');olympe.Na.node.host={};olympe.Na.node.host.od=function(a,b){this.K=b};olympe.Na.node.host.od.prototype.constructor=olympe.Na.node.host.od;olympe.Na.node.host.od.prototype.destroy=function(){};olympe.Na.node.host.od.prototype.destroy=olympe.Na.node.host.od.prototype.destroy;olympe.Na.node.host.od.prototype.fb=function(){return this.K};olympe.Na.node.host.od.va=[olympe.host.fe.od];function bc(a){a.K.error('No history manager implemented in Node')}olympe.Na.node.host.Do=class{constructor(a){this.K=a}ti(){return!1}C(){bc(this);return Mb()}F(){bc(this)}back(){bc(this)}};olympe.Na.node.host.Do.va=[olympe.host.Nh];olympe.Na.node.host.Wc=class{constructor(){this.C={};this.L={}}destroy(){}P(a){clearTimeout(this.C[a]);delete this.C[a]}$(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}T(a,b,c){this.L[b]=setInterval(c,a)}F(a){clearInterval(this.L[a]);delete this.L[a]}};olympe.host.Co.register(olympe.host.fe.Bo.Mp,olympe.Na.node.host.Wc);olympe.Na.node.host.Wc.va=[olympe.host.fe.Wc];olympe.Na.node.host.yj=class{constructor(a){this.K=a}rh(){return olympe.D.ea.F}};olympe.Na.node.host.yj.va=[olympe.host.yj];function cc(a){const b=olympe.net.Fa.Zb.Wh,c=olympe.net.Fa.Zb.Zh;a.ga.P('healthcheck','/readiness',[olympe.net.Fa.Jd.GET],()=>{const d=Array.from(a.$.values()).map(e=>e.apply(a));return 0===d.length?Promise.resolve(new olympe.net.Bf('No healthCheck is set',b,'Nothing to check')):Promise.allSettled(d).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.K.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.Bf(g,
367
+ f?c:b,f?'Some services are not working':'Everything is OK')})}).catch(d=>a.K.error(`Failed to add health check route ${d}`));a.F(()=>a.ga.stop())}function dc(a,b){b=Array.from(b.values()).map(c=>olympe.Z.Promise.Bm(c(),a.na,'Some shutdown hook has timeout'));return Promise.allSettled(b).then(c=>{let d=!1;for(const e of c)'rejected'===e.status&&(d=!0,a.K.warn(`Failed to close some resource: ${e.reason}`));return d})}
368
+ function ec(a){return v(function*(){try{const b=yield dc(a,a.L),c=yield dc(a,a.T);if(b||c)throw Error('Failed to gracefully close the backend');}finally{a.L.clear(),a.T.clear()}})}
369
+ olympe.Na.node.host.kj=class extends olympe.host.kj{constructor(a,b,c,d=!0){super();this.K=a;this.ga=b;this.na=c;this.$=new Map;this.L=new Map;this.T=new Map;d&&cc(this)}C(a){const b=olympe.Z.ef();this.$.set(b,a);return b}G(a){this.$.delete(a)}F(a){const b=olympe.Z.ef();this.L.set(b,a);return b}da(a){const b=olympe.Z.ef();this.T.set(b,a);return b}P(a){this.L.has(a)?this.L.delete(a):this.T.delete(a)}};olympe.V.config(function(a){F(a,olympe.host.U.Qo,!0);F(a,olympe.host.U.up,1E4);ua(a,olympe.host.R.Kk,olympe.Na.node.host.Do,olympe.host.R.za);ua(a,olympe.host.R.rl,olympe.Na.node.host.yj,olympe.host.R.za);D(a,olympe.host.R.We,olympe.Na.node.host.kj,olympe.host.R.za,olympe.net.R.Dj,new olympe.V.ma(olympe.host.U.up),new olympe.V.ma(olympe.host.U.Qo))},'olympe.native.node.host');olympe.V.run([olympe.host.R.We],a=>{olympe.Na.node.host.Rj=()=>a});olympe.net.Ud={};olympe.net.Ud.Qk=class{constructor(a){this.K=a;this.C=new Map}G(){}F(){}};olympe.net.Ud.WebSocket=class{constructor(a,b){this.K=b;this.id=a;this.C=null;this.buffer=[];this.P=this.G=this.L=this.T=null}W(){return this.id}open(a){const b=`#${this.id}`,c=this.na(a);c.binaryType='arraybuffer';c.onopen=()=>{this.K.info('Websocket OPENED');this.T?(this.K.debug('Notifying upper layer for WebSocket',b),this.T()):this.K.warn('Nothing to notify for WebSocket',b);this.K.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));this.buffer.length=
370
370
  0};c.onmessage=d=>{d='string'===typeof d.data?String(d.data):Ha(d.data);(this.K.L()||this.K.C()&&!d.startsWith('pong'))&&this.K.debug(b,'<',d);this.G&&this.G(d)};c.onclose=()=>{this.K.debug(`WebSocket ${b} CLOSED`);this.L&&this.L()};c.onerror=()=>{this.K.debug(`WebSocket ${b} ERROR`);this.P&&this.P()};this.C=c}send(a){const b=`#${this.id}`;if(null!==this.C){const c=this.C.constructor;switch(this.C.readyState){case c.OPEN:(this.K.L()||this.K.C()&&!a.startsWith('ping'))&&this.K.debug(b,'>',a);this.C.send(a);
371
371
  break;case c.CONNECTING:this.K.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);break;default:return this.K.debug(b,'- Closed','>',a),!1}}else this.K.debug(b,'- Not opened yet: BUFFER','>',a),this.buffer.push(a);return!0}close(){if(null!==this.C){const a=this.C.constructor,b=this.C.readyState;if(b===a.OPEN||b===a.CONNECTING){this.K.debug(`Force closing native websocket ${`#${this.id}`}`);this.C.close(1E3);return}}this.K.debug('Try to force close native websocket, but not open nor connecting')}ga(a){this.T=
372
- a||null}da(a){this.G=a||null}F(a){this.P=a||null}$(a){this.L=a||null}na(){}};olympe.net.Vd.WebSocket.va=[olympe.net.WebSocket];olympe.Na.node.net={};olympe.Na.node.net.Ls=class extends olympe.net.Ba{constructor(a,b){super(a,b);this.$=new olympe.Na.node.net.Rk(a)}T(){return'NodeJS'}G(a){var b=this.L++;a=a.C();this.K.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Na.node.net.Ms(b,this.K);b.open(a);return b}C(a,b){this.K.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.L++;b=Sb(this,c,b);this.$.G(c,{u:a.C(),s:Qb(a),h:Ob(a),p:a.port,z:Pb(a),q:Rb(a),m:a.method,v:a.Nj(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,b:a.body,r:a.G},b)}P(){this.K.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.$}};const ec=require('fs'),fc=require('http'),gc=require('https');
373
- olympe.Na.node.net.Rk=class extends olympe.net.Vd.Rk{G(a,b,c){const d=b.s,e=b.b,f=b.m;var g=b.v;const h=b.k,k=b.c,m=b.a,n=b.j;var p=b.h;const q=b.p;let r=b.z;r.startsWith('/')||(r=`/${r}`);const t=b.q,u=b.u,w=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f};g&&(b.headers=g);g=(x,y,z)=>new Promise((A,M)=>{ec.readFile(x,(K,pa)=>{K?M(K):(z[y]=pa,A(z))})});p=x=>{const y=A=>{A.setEncoding(w===olympe.net.Fa.ResponseType.ul?'utf-8':'binary');let M='';A.on('data',K=>{M+=K});A.on('end',()=>{if(w!==olympe.net.Fa.ResponseType.ul){var K=
374
- new Uint8Array(Buffer.from(M,'binary'));K=w===olympe.net.Fa.ResponseType.lk?new Blob(K):K}else K=M;c(this.F(A.statusCode,A.statusMessage,K,A.headers))})},z=d?new gc.request(x,y):new fc.request(x,y);this.C.set(a,()=>{z.destroy()});z.on('error',A=>{c(this.F(olympe.net.Fa.$b.Xh,'Connection refused','Error connecting to '+u+' with method '+f+', code = '+A.code+', message = '+A.message,''))});!e||'POST'!==f&&'PUT'!==f?z.end():(e instanceof Blob?e.arrayBuffer():Promise.resolve(e)).then(A=>{z.write(A instanceof
375
- ArrayBuffer?Buffer.from(A):A);z.end()})};d&&(h||k||m)?h&&k&&m?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,m,'ca')).then(p).catch(x=>{this.K.log('Error loading self signed files:',x)})):this.K.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.K.debug('Received HTTP response',a,c);return new olympe.net.Se(c,a,b,d)}};olympe.Na.node.net.Ms=class extends olympe.net.Vd.WebSocket{na(a){return new (require('ws'))(a)}};olympe.Na.node.net.U={uA:'native.html.net.useWorkers'};olympe.V.config(function(a){ua(a,olympe.net.R.Ga,olympe.Na.node.net.Ls,olympe.net.R.za,olympe.host.R.Ga)},'olympe.native.node.net');olympe.Na.node.net.http={};const hc=require('fastify'),ic={uj:0,tj:1,rl:2},jc=olympe.net.Fa.Kd.Jo,kc=olympe.net.Fa.Headers.Pq,lc=olympe.net.Fa.Headers.Nq,mc=olympe.net.Fa.Headers.Oq,nc=olympe.net.Fa.$b.Uh;
376
- function oc(a,b){const c=b.methods,d=b.Ev,e=b.headers,f=b.origin;a.G.route({bodyLimit:1048576*a.$,url:b.path,method:[...c,jc],handler:(g,h)=>{a.K.debug('< HTTP:',g);var k=g.method;const m={[kc]:f,[mc]:c,[lc]:e};if(k===jc)h.code(nc).headers(m).send();else{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;var [q,r]=g.hostname.split(':');k=new olympe.net.Mh(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,u]of Object.entries(g.headers))k.headers[t]=
377
- u;n=new Map(Object.entries(g.params));g=new Map(Object.entries(g.query));d(k,n,g).then(t=>{const u=t.Rc(),w=t.getData();if(u>=olympe.net.Fa.$b.Xh)throw Error(w);u>=olympe.net.Fa.$b.Sq?a.K.warn('> HTTP: client bad request: reply with error:',w):a.K.debug('> HTTP: reply with body:',w instanceof ArrayBuffer?'binary':w);h.code(u).headers(Object.assign(m,t.Nj())).send(w instanceof ArrayBuffer?Buffer.from(w):w)}).catch(t=>{a.K.error('> HTTP: reply with internal server error:',t);h.code(olympe.net.Fa.$b.Xh).headers(Object.assign(m,
378
- {[olympe.net.Fa.Headers.Eh]:'text/plain'})).send('Internal server error')})}}})}
379
- olympe.Na.node.net.http.ci=class extends olympe.net.ci{constructor(a,b,c){super(a);this.$=c;this.G=this.createServer();this.port=b;this.L=new Map;this.C=ic.uj;this.bd=new Set;this.timer=null}P(a,b,c,d){this.L.set(a,{path:b,methods:c,Ev:d,headers:'*',origin:'*'});return this.F()}T(a){const b=this;return v(function*(){b.L.delete(a);return 0<b.L.size?b.F():b.stop()})}start(){if(this.C===ic.uj)return this.F();if(this.C===ic.tj){for(const a of this.L.values())oc(this,a);return this.G.listen(this.port,
380
- '0.0.0.0').then(a=>{this.C=ic.rl;this.K.debug('Web server listening on '+a);this.bd.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.bd.forEach(b=>b(a))}).finally(()=>this.bd.clear())}return Promise.reject('Try to start a webservice already started')}F(){return this.C===ic.tj?(new Promise((a,b)=>{this.bd.add(c=>c?b(c):a())})).then(()=>this.F()):new Promise((a,b)=>{this.bd.add(c=>c?b(c):a());this.gq(()=>{const c=this;return v(function*(){c.C=ic.tj;yield c.G.close();c.G=c.createServer();yield c.start()})})})}stop(){return this.C===
381
- ic.rl?this.G.close().then(()=>{this.C=ic.uj}):Promise.resolve()}createServer(){const a=hc({logger:!1,level:'error'});a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,d)=>{d(null,c)});return a}gq(a){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,1E3)}};olympe.V.config(function(a){D(a,olympe.net.R.Dj,olympe.Na.node.net.http.ci,olympe.net.R.za,new olympe.V.ma(olympe.net.U.Jh),new olympe.V.ma(olympe.net.U.Un))},'olympe.native.node.net.http');olympe.Na.node.Z={};const pc=require('buffer');olympe.Na.node.Z.qk=class extends olympe.Z.qk{G(a){return new Uint8Array(Buffer.from(a,'base64'))}F(a){return a instanceof Uint8Array?Buffer.from(a,a.byteOffset,a.byteLength).toString('base64'):Buffer.from(a).toString('base64')}C(a,b,c){try{b(pc.KB(a))}catch(d){null==c||c(`Error while trying to fetch buffer from ObjectURL: ${d}`)}}};olympe.V.config(function(a){ua(a,olympe.Z.R.Cg,olympe.Na.node.Z.qk)},'olympe.native.node.utils');olympe.async={};function qc(a,b){a.L||a.$.push(a.G.G(b))}
382
- olympe.async.Fn=class{constructor(a,b=void 0===a){this.F=[];this.$=[];this.G=a||new olympe.D.Jb('Async executor context');this.na=b;this.C=null;this.env=new Map;this.env.set('Executor',this);this.L=this.P=!1;this.K=null;this.timer=this.timeout=0;this.da=olympe.Z.hc()}Cm(a){0<=a&&(this.timeout=a);return this}fb(){return this.K}add(a){this.L||this.F.push(this.G.G(a));return this}start(){this.P||(this.K&&this.K.log('Executor started.'),this.P=!0,this.G.onDestroy(()=>{this.C='Context destroyed.';this.complete(!1)},
372
+ a||null}da(a){this.G=a||null}F(a){this.P=a||null}$(a){this.L=a||null}na(){}};olympe.net.Ud.WebSocket.va=[olympe.net.WebSocket];olympe.Na.node.net={};olympe.Na.node.net.Ls=class extends olympe.net.Ba{constructor(a,b){super(a,b);this.$=new olympe.Na.node.net.Qk(a)}T(){return'NodeJS'}G(a){var b=this.L++;a=a.C();this.K.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Na.node.net.Ms(b,this.K);b.open(a);return b}C(a,b){this.K.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.L++;b=Tb(this,c,b);this.$.G(c,{u:a.C(),s:Rb(a),h:Pb(a),p:a.port,z:Qb(a),q:Sb(a),m:a.method,v:a.Nj(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,b:a.body,r:a.G},b)}P(){this.K.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.$}};const fc=require('fs'),gc=require('http'),hc=require('https');
373
+ olympe.Na.node.net.Qk=class extends olympe.net.Ud.Qk{G(a,b,c){const d=b.s,e=b.b,f=b.m;var g=b.v;const h=b.k,k=b.c,m=b.a,n=b.j;var p=b.h;const q=b.p;let r=b.z;r.startsWith('/')||(r=`/${r}`);const t=b.q,u=b.u,w=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f};g&&(b.headers=g);g=(x,y,z)=>new Promise((A,M)=>{fc.readFile(x,(K,pa)=>{K?M(K):(z[y]=pa,A(z))})});p=x=>{const y=A=>{A.setEncoding(w===olympe.net.Fa.ResponseType.tl?'utf-8':'binary');let M='';A.on('data',K=>{M+=K});A.on('end',()=>{if(w!==olympe.net.Fa.ResponseType.tl){var K=
374
+ new Uint8Array(Buffer.from(M,'binary'));K=w===olympe.net.Fa.ResponseType.Om?new Blob(K):K}else K=M;c(this.F(A.statusCode,A.statusMessage,K,A.headers))})},z=d?new hc.request(x,y):new gc.request(x,y);this.C.set(a,()=>{z.destroy()});z.on('error',A=>{c(this.F(olympe.net.Fa.Zb.Zh,'Connection refused','Error connecting to '+u+' with method '+f+', code = '+A.code+', message = '+A.message,''))});!e||'POST'!==f&&'PUT'!==f?z.end():(e instanceof Blob?e.arrayBuffer():Promise.resolve(e)).then(A=>{z.write(A instanceof
375
+ ArrayBuffer?Buffer.from(A):A);z.end()})};d&&(h||k||m)?h&&k&&m?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,m,'ca')).then(p).catch(x=>{this.K.log('Error loading self signed files:',x)})):this.K.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.K.debug('Received HTTP response',a,c);return new olympe.net.Bf(c,a,b,d)}};olympe.Na.node.net.Ms=class extends olympe.net.Ud.WebSocket{na(a){return new (require('ws'))(a)}};olympe.Na.node.net.U={sA:'native.html.net.useWorkers'};olympe.V.config(function(a){ua(a,olympe.net.R.Ga,olympe.Na.node.net.Ls,olympe.net.R.za,olympe.host.R.Ga)},'olympe.native.node.net');olympe.Na.node.net.http={};const ic=require('fastify'),jc={uj:0,tj:1,ql:2},kc=olympe.net.Fa.Jd.Ho,lc=olympe.net.Fa.Headers.Oq,mc=olympe.net.Fa.Headers.Mq,nc=olympe.net.Fa.Headers.Nq,oc=olympe.net.Fa.Zb.Wh;
376
+ function pc(a,b){const c=b.methods,d=b.Dv,e=b.headers,f=b.origin;a.G.route({bodyLimit:1048576*a.$,url:b.path,method:[...c,kc],handler:(g,h)=>{a.K.debug('< HTTP:',g);var k=g.method;const m={[lc]:f,[nc]:c,[mc]:e};if(k===kc)h.code(oc).headers(m).send();else{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;var [q,r]=g.hostname.split(':');k=new olympe.net.Oh(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,u]of Object.entries(g.headers))k.headers[t]=
377
+ u;n=new Map(Object.entries(g.params));g=new Map(Object.entries(g.query));d(k,n,g).then(t=>{const u=t.Rc(),w=t.getData();let x=w;w instanceof Uint8Array?x=Buffer.from(w.buffer):w instanceof ArrayBuffer&&(x=Buffer.from(w));if(u>=olympe.net.Fa.Zb.Zh)throw Error(w);u>=olympe.net.Fa.Zb.Rq?a.K.warn('> HTTP: client bad request: reply with error:',w):a.K.debug('> HTTP: reply with body:',Buffer.isBuffer(x)?'binary':w);h.code(u).headers(Object.assign(m,t.Nj())).send(x)}).catch(t=>{a.K.error('> HTTP: reply with internal server error:',
378
+ t);h.code(olympe.net.Fa.Zb.Zh).headers(Object.assign(m,{[olympe.net.Fa.Headers.Gh]:'text/plain'})).send('Internal server error')})}}})}
379
+ olympe.Na.node.net.http.di=class extends olympe.net.di{constructor(a,b,c){super(a);this.$=c;this.G=this.createServer();this.port=b;this.L=new Map;this.C=jc.uj;this.cd=new Set;this.timer=null}P(a,b,c,d){this.L.set(a,{path:b,methods:c,Dv:d,headers:'*',origin:'*'});return this.F()}T(a){const b=this;return v(function*(){b.L.delete(a);return 0<b.L.size?b.F():b.stop()})}start(){if(this.C===jc.uj)return this.F();if(this.C===jc.tj){for(const a of this.L.values())pc(this,a);return this.G.listen(this.port,
380
+ '0.0.0.0').then(a=>{this.C=jc.ql;this.K.debug('Web server listening on '+a);this.cd.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.cd.forEach(b=>b(a))}).finally(()=>this.cd.clear())}return Promise.reject('Try to start a webservice already started')}F(){return this.C===jc.tj?(new Promise((a,b)=>{this.cd.add(c=>c?b(c):a())})).then(()=>this.F()):new Promise((a,b)=>{this.cd.add(c=>c?b(c):a());this.fq(()=>{const c=this;return v(function*(){c.C=jc.tj;yield c.G.close();c.G=c.createServer();yield c.start()})})})}stop(){return this.C===
381
+ jc.ql?this.G.close().then(()=>{this.C=jc.uj}):Promise.resolve()}createServer(){const a=ic({logger:!1,level:'error'});a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,d)=>{d(null,c)});return a}fq(a){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,1E3)}};olympe.V.config(function(a){D(a,olympe.net.R.Dj,olympe.Na.node.net.http.di,olympe.net.R.za,new olympe.V.ma(olympe.net.U.Lh),new olympe.V.ma(olympe.net.U.Un))},'olympe.native.node.net.http');olympe.Na.node.Z={};const qc=require('buffer');olympe.Na.node.Z.pk=class extends olympe.Z.pk{G(a){return new Uint8Array(Buffer.from(a,'base64'))}F(a){return a instanceof Uint8Array?Buffer.from(a,a.byteOffset,a.byteLength).toString('base64'):Buffer.from(a).toString('base64')}C(a,b,c){try{b(qc.resolveObjectURL(a))}catch(d){c(`Error while trying to fetch buffer from ObjectURL: ${d}`)}}};olympe.V.config(function(a){ua(a,olympe.Z.R.Cg,olympe.Na.node.Z.pk)},'olympe.native.node.utils');olympe.async={};function rc(a,b){a.L||a.$.push(a.G.G(b))}
382
+ olympe.async.Fn=class{constructor(a,b=void 0===a){this.F=[];this.$=[];this.G=a||new olympe.D.Jb('Async executor context');this.na=b;this.C=null;this.env=new Map;this.env.set('Executor',this);this.L=this.P=!1;this.K=null;this.timer=this.timeout=0;this.da=olympe.Z.hc()}Bm(a){0<=a&&(this.timeout=a);return this}fb(){return this.K}add(a){this.L||this.F.push(this.G.G(a));return this}start(){this.P||(this.K&&this.K.log('Executor started.'),this.P=!0,this.G.onDestroy(()=>{this.C='Context destroyed.';this.complete(!1)},
383
383
  this.da),0<this.timeout&&(this.timer=setTimeout(()=>{this.C='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.F=[];this.$=[];this.env.clear();this.na&&this.G.destroy()}complete(a){this.G.pf(this.da);if(!this.L){this.L=!0;this.timer&&(clearTimeout(this.timer),this.timer=0);this.K&&this.K.log(a?'Executor completed successfully':`Executor completed with error: ${this.C}`);for(const b of this.$)b(a,a?null:this.C,this.env);this.clear()}}getContext(){return this.G}};
384
- function rc(a){if(0<a.F.length){const b=a.F.shift();a.K&&a.K.log(`Executing next task. ${a.F.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{rc(a)})},c=>{c&&(a.C=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.Ap=class extends olympe.async.Fn{static create(){return new olympe.async.Ap(new olympe.D.Jb('SequencedExecutor'),!0)}start(){this.P||(super.start(),rc(this))}};
384
+ function sc(a){if(0<a.F.length){const b=a.F.shift();a.K&&a.K.log(`Executing next task. ${a.F.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{sc(a)})},c=>{c&&(a.C=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.yp=class extends olympe.async.Fn{static create(){return new olympe.async.yp(new olympe.D.Jb('SequencedExecutor'),!0)}start(){this.P||(super.start(),sc(this))}};
385
385
  olympe.async.ij=class extends olympe.async.Fn{constructor(a,b){super(a,b);this.T=0;this.ga=!0}static create(){return new olympe.async.ij(new olympe.D.Jb('ParallelExecutor'),!0)}run(a){this.K&&this.K.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.ga=!1;b&&(this.C=this.C?`${this.C}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.P&&!this.L&&(this.T++,this.run(a));return this}done(){this.T--;0>=this.T&&this.complete(this.ga)}start(){if(!this.P)if(super.start(),
386
- 0<this.F.length){this.T=this.F.length;for(const a of this.F)this.run(a)}else this.complete(!0)}};olympe.jc={};olympe.jc.xs=class{constructor(){}set(){}get(){}forEach(){}remove(){}clear(){}close(){}};olympe.jc.ws=class{constructor(){}C(){}};olympe.jc.Storage=class{open(){}write(){}close(){}};olympe.jc.R={Yi:'localStorage.KeyValueManager',vj:'localStorage.Storage',ix:'localStorage.DatacloudStorage',za:'localStorage.Logger'};olympe.V.config(function(a){wa(a,olympe.jc.R.Yi);E(a,olympe.jc.R.za,[olympe.la.R.Ga],function(b){return b.Fc('localstorage')})},'olympe.localstorage');olympe.O={};olympe.O.errors={};olympe.O.errors.Ry=class extends Error{};olympe.O.errors.Ho=class extends Error{};olympe.O.errors.Ip=class extends Error{};olympe.O.errors.Qo=class extends Error{};olympe.O.errors.Gt=class extends Error{};olympe.O.errors.el=class extends Error{constructor(a,b){super(a);this.id=b}W(){return this.id}};olympe.O.Mb={Ri:'urls.FileSvc',Nm:'urls.BackupSvc',hp:'urls.RestoreBackupSvc',oe:'urls.GetContext',Qn:'urls.GraphDef',$m:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',Mp:'urls.UserTagFromToken',Ft:'urls.UserNameFromTag',Et:'urls.UserRoles',et:'urls.RoleMembers',dj:'urls.OpenIDSvc'};
387
- olympe.V.config(a=>{F(a,olympe.O.Mb.Ri,'rest/filesvc');F(a,olympe.O.Mb.Nm,'rest/backupsvc');F(a,olympe.O.Mb.hp,'rest/backupsvc/restore');F(a,olympe.O.Mb.dj,'rest/openid');F(a,olympe.O.Mb.oe,'rest/initialData');F(a,olympe.O.Mb.Qn,'rest/querysvc/graphDef');F(a,olympe.O.Mb.$m,'rest/querysvc/graphDef/static');F(a,olympe.O.Mb.TRANSACTION,'rest/transaction');F(a,olympe.O.Mb.Mp,'rest/token');F(a,olympe.O.Mb.Ft,'rest/authorization/getUserTag');F(a,olympe.O.Mb.Et,'rest/authorization/getUserRoles');F(a,olympe.O.Mb.et,
388
- 'rest/authorization/roleMembers')});function sc(a){a.K.info('Disconnected from bus');a.G=!0;let b;null==(b=a.F)||b.forEach((c,d)=>{c.qh()&&(a.K.info(`Disconnected from bus: pause keep alive of ${c.C.size} subscriptions for ${d} service.`),tc(c))})}function uc(a){a.K.debug('Connection to bus established. Listening to responses on topic',a.P);Wb(a.C,a.P,b=>{a.K.C()&&a.K.debug('BUS <',JSON.stringify(b));b=new olympe.O.Response(b.dest,b.src,b.seq,b.type,a.Da.G(b.content));let c;null==(c=a.L.get(b.sg()))||c(b)})}
389
- function vc(a){a.K.debug(`Reconnected to bus: Sending ${a.ga.length} pending messages and resubscribe to ${a.da.size} active topics.`);for(const c of a.ga){let d;try{d=c.ha(a.Da)}catch(e){a.K.error(`An error occurred while serializing a message that was pending (seqId=${c.sg()}: ${e}`)}a.C.publish(c.Nb(),d)}a.ga=[];a.da.forEach((c,d)=>{wc(a,d,c)});a.da.clear();let b;null==(b=a.F)||b.forEach((c,d)=>{c.qh()||(a.K.info(`Reconnected to bus: restart keep alive of ${c.C.size} subscriptions for ${d} service.`),
390
- xc(c,!0))})}function yc(a){a.ub=a.na.C(()=>Ub(a.C)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}
391
- function wc(a,b,c){a.G||a.Wa?a.da.set(b,c):a.connect().then(()=>{a.K.debug(`Bus: Subscribe to ${b}`);Wb(a.C,b,d=>{a.K.C()&&a.K.debug(`BUS < #${b}: ${JSON.stringify(d)}`);let e=null;try{e=new olympe.O.Request(d.dest,d.src,d.auth,d.seq,d.type,a.Da.G(d.content))}catch(f){a.K.error(`An error occurred while trying to deserialize the request: ${JSON.stringify(d)}`)}null!==e&&c(e)})})}function zc(a,b,c,d,e){b=new olympe.O.Response(c,a.P,b,d,e);return a.publish(b)}
392
- function Ac(a,b,c,d){const e=Bc(a.T).Yc();a.$++;return new olympe.O.Request(b,a.P,e,a.$,c,d)}function Cc(a,b,c,d){const e=b.sg(),f=olympe.O.Response.jb.dk;let g=null;g=setTimeout(()=>Dc(a,e),a.Qb);a.L.set(e,h=>{g&&clearTimeout(g);h.getType()===f?g=setTimeout(()=>Dc(a,e),d):(a.L.delete(e),c(h))})}function Dc(a,b){const c=a.L.get(b);a.L.delete(b);null==c||c(new olympe.O.Response(a.P,a.P,b,olympe.O.Response.jb.Db,{reason:'Timeout'}))}
393
- function Ec(a,b){a.$++;const c=a.$,d=setTimeout(()=>Dc(a,c),a.Qb);a.L.set(c,e=>{a.L.delete(c);clearTimeout(d);b(e)});return a.$}function Fc(a,b){a.da.delete(b);let c;null==(c=a.F)||c.delete(b);a.K.debug(`Bus: Unsubscribe to ${b}`);return a.G||a.Wa?Promise.resolve():new Promise((d,e)=>{Xb(a.C,b,f=>f?e(f):d())})}
394
- function Gc(a,b,c,d,e){null===a.F&&(a.F=new Map);let f=a.F.get(b);f?(a=f,a.G!==d&&(a.G=d,a.qh()&&(tc(a),xc(a,!1)))):(f=new olympe.O.st(a.K,a,b,d),a.F.set(b,f));d=f;d.C.set(c,e);1===d.C.size&&xc(d,!1)}function Hc(a,b,c){let d;const e=null==(d=a.F)?void 0:d.get(b);if(null==e?0:Ic(e,c))a.publish(Ac(a,b,olympe.O.Request.jb.Jp,c)).catch(f=>a.K.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.C.size&&(a.F.delete(b),0===a.F.size&&(a.F=null))}
395
- function Jc(a,b){return rxjs.operators.retry({resetOnSuccess:!0,delay:c=>{if(c instanceof olympe.O.errors.el){const d=Math.round(5E3*Math.random());a.K.debug(`Subscription topic ${c.W()} not registered in the service, re-subscribe in ${d}ms`);return rxjs.timer(d).pipe(rxjs.operators.tap(()=>null==b?void 0:b()))}return rxjs.throwError(()=>c)}})}function Kc(a,b){return new Promise((c,d)=>{a.T.ug(b.Td(),(e,f)=>{e?d(e):c(f)})})}
396
- olympe.O.Zm=class{constructor(a,b,c,d,e,f){b=f.get('connectionOptions');this.K=a;this.T=c;this.na=d;this.Da=e;this.Qb=f.get('shortTimeout');this.ac=f.get('requestTimeout');this.Wb=f.get('subscriptionsRefreshRate');this.L=new Map;this.C=Tb(f.get('url'),b);this.mb=f.get('allowGuest');this.$=1;this.P=olympe.Z.hc();this.F=null;this.G=!1;this.ga=[];this.da=new Map;this.Eb=this.ub='';this.Wa=!1;$b(this.C,()=>{sc(this)});Zb(this.C,()=>{sc(this)});Yb(this.C,()=>{this.G&&(this.Wa=!1,uc(this),this.G=!1,vc(this))})}connect(){const a=
397
- olympe.auth.Ba.C.INIT,b=olympe.auth.Ba.C.Db,c=olympe.auth.Ba.C.ke,d=olympe.auth.Ba.C.Af,e=olympe.auth.Ba.C.Pe;return new Promise((f,g)=>{Ub(this.C)||this.G?f():olympe.D.pc([this.T.getState()],h=>{const k=olympe.D.Ma();if(this.mb||h!==d)switch(h){case a:this.Wa=!0;break;case b:case e:g(Error('Authentication failed.'));k.destroy();break;case c:case d:yc(this),this.mb||Lc(this.T,()=>this.disconnect().then()),this.G=!0,this.C.connect(()=>Bc(this.T),()=>{k.destroy();f()}),this.Eb=this.na.da(()=>this.disconnect())}else yc(this),
398
- g(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter !!!')),k.destroy()})})}disconnect(){return new Promise(a=>{this.K.debug('Disconnecting from bus');this.T.Da.delete('busLogoutCallback');this.C.end(!1,()=>a());this.na.G(this.ub);this.na.P(this.Eb)})}publish(a){return this.G?(a.getType()!==olympe.O.Request.jb.qe&&(this.K.debug('Bus disconnected, storing message in queue'),this.ga.push(a)),Promise.resolve()):new Promise((b,c)=>{try{const d=
399
- a.ha(this.Da),e=a.Nb();this.K.C()&&this.K.debug(`BUS > #${e}: ${JSON.stringify(d)}`);this.C.publish(e,d,void 0,f=>{f?c(f):b()})}catch(d){c(`An error occurred while serializing the message (seqId=${a.sg()}): ${d}`)}})}ed(a,b,c){return zc(this,a.sg(),a.zb(),b,c)}request(a,b,c,d){const e=Ac(this,a,b,c);if(b===olympe.O.Request.jb.PUBLISH){const f=new olympe.O.Response(a,this.P,e.sg(),olympe.O.Response.jb.dk);return this.publish(e).then(()=>f)}return new Promise((f,g)=>{Cc(this,e,f,null!=d?d:this.ac);
400
- this.publish(e).catch(g)})}};olympe.O.Zm.C='Timeout';const Mc=olympe.net.Fa.Headers.Mm,Nc=olympe.net.Fa.$b.Uh,Oc=olympe.net.Fa.$b.fn,Pc=olympe.net.Fa.$b.Ei,Qc=olympe.net.Fa.$b.it,Rc=olympe.net.Fa.$b.Yq,Sc=olympe.net.Fa.$b.Jn,Tc=olympe.net.Fa.$b.At,Uc=olympe.net.Fa.$b.Co;function Vc(a,b){let c;return null!=(c=a.G.get(b))?c:''}
401
- function Wc(a,b,c){if(null===b)return Promise.reject('No http request to send');Q(b,{[Mc]:c});return rxjs.firstValueFrom(rxjs.defer(()=>new Promise((d,e)=>{const f=b.C();if(a.K.C()){const g=b.body;a.K.debug('HTTP >',f,`body: ${'string'===typeof g?g:typeof g}`)}a.C.C(b,g=>{switch(g.Rc()){case Nc:case Oc:case Pc:const h=g.getData();a.K.C()&&a.K.debug('HTTP <',g.Rc(),`content: ${'string'===typeof h?h:typeof h}`);d(h);break;case Qc:g=`HTTP < Service provider for http request to ${b.C()} is overloaded, retry later`;
402
- a.K.warn(g);e(new olympe.O.errors.Qo(g));break;case Rc:a.K.debug(`HTTP < request canceled (${b.C()}).`);d();break;case Sc:case Tc:g=`HTTP < request authorization denied: ${b.C()}`;a.K.error(g);e(new olympe.O.errors.Gt(g));break;case Uc:g=`HTTP < requested resource not found: ${b.C()}`;a.K.error(g);e(new olympe.O.errors.Ho(g));break;default:g=`HTTP < Error: ${g.Rc()}, ${g.statusText}`,a.K.error(g),e(Error(g))}})})).pipe(rxjs.operators.retry(a.F)))}
403
- olympe.O.Fr=class{constructor(a,b,c,d){this.K=a;this.C=b;this.G=c;this.F=d}};function Xc(a,b,c){a.K.info('Initializing COMMUNICATION layer');if(a.K.C()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.K.debug(d.join('\n\t'))}Yc(a,olympe.O.ae.Db,d=>{switch(d.c){case olympe.O.jb.Ct:a.K.error('Unknown message sent to the server:',olympe.O.cb.Pb[d.s]);break;case olympe.O.jb.xr:a.K.error('Fatal error, the last message is probably too big according to the websocket config.'),a.G.forEach((e,f)=>{null!==e.wm&&Zc(a,f,d.i)})}});b.get('autoConnect')&&
404
- (a.K.debug('Connecting automatically'),a.connect());olympe.D.em(a.P.vb(),()=>{a.qd.forEach(d=>d());Nb(a.ji.bind(a),a.pi);Nb(a.Wb.bind(a),a.uc)},()=>{a.T=null;a.jd.forEach(d=>d(a.L[2]));a.Wb()});c.C(()=>$c(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.C}`));c.da(()=>{a.disconnect();return Promise.resolve()});a.K.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}
405
- function $c(a){return a.C===olympe.O.cb.C.Dh}
406
- function R(a,b){if(a.C!==b){a.K.debug('State change '+a.C+' --\x3e '+b);a.C=b;var c;null==(c=a.ze)||c.call(a,b);switch(b){case olympe.O.cb.C.CONNECTING:break;case olympe.O.cb.C.Dh:a.P.update(olympe.D.ea.F);break;case olympe.O.cb.C.cg:a.L[0]=0;a.L[1]=0;a.connect();break;case olympe.O.cb.C.Db:a.K.error('Connection to server',a.da.C(),'aborted due to error');a.P.update(olympe.D.ea.C);break;case olympe.O.cb.C.$g:break;case olympe.O.cb.C.Ag:a.connect();break;case olympe.O.cb.C.Pe:a.P.update(olympe.D.ea.C);
407
- a.Wa&&(a.K.info('Disconnected, will try to auto reconnect in',a.mb,'ms'),Mb(()=>{a.connect()},a.mb));break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}}function ad(a,b){const c=olympe.Z.hc();a.qd.set(c,b);olympe.D.Ta(a.P)===olympe.D.ea.F&&b()}function bd(a,b){var c;void 0===c&&(c=olympe.Z.hc());a.jd.set(c,b);olympe.D.Ta(a.P)===olympe.D.ea.C&&b(a.L[2])}
408
- function cd(a,b,c,d){const e=a.ye;a.ye++;c={message:{seqId:e,messageFamily:b,payload:c},Kl:d?dd(a,d):null,wm:null};a.G.set(e,c);d=[olympe.O.cb.C.CONNECTING,olympe.O.cb.C.cg];($c(a)||b===olympe.O.ae.Ui&&d.includes(a.C))&&ed(a,e,c)}
409
- function dd(a,b){const c=olympe.O.cb.G.Yh;return d=>{if(null!==d&&void 0!==d){var e=null,f,g=null==(f=d.info)?void 0:f.warn;f=d.s;'string'===typeof g?a.K.debug(`A message has raised a warning in the orchestrator: ${g}. Investigate.`):void 0!==f&&f!==c&&(e=void 0!==olympe.O.cb.Pb[f]?`Status code = ${f} [${olympe.O.cb.Pb[f]}]`:`Status code = ${f}`,g=d.info,void 0!==g&&void 0!==g.error&&(f=g.error.reason,'string'===typeof f&&0<f.length&&(e+=`\nReason:\n${g.error.reason}`),f=g.error.detailedReason,'string'===
410
- typeof f&&0<f.length&&(e+=`\nDetails:\n${g.error.detailedReason}`)),e=Error('Rejected by orchestrator:\n'+e));b(e,d)}}}function ed(a,b,c){var d=c.message;a.K.C()&&a.K.debug('WS >',fd(d));(d=a.F.send(JSON.stringify(d)))?null===c.Kl?a.G.delete(b):c.wm=Date.now():R(a,olympe.O.cb.C.cg);return d}function Yc(a,b,c,d){void 0===d&&(d=olympe.Z.hc());let e=a.ga.get(b);void 0===e&&(e=new Map,a.ga.set(b,e));e.set(d,c)}function gd(a){a=a.ga.get(olympe.O.ae.Zf);void 0!==a&&a.delete('logoutHandler')}
411
- function Zc(a,b,c){if(a.G.has(b)){const {Kl:d}=a.G.get(b);a.G.delete(b);d&&d({s:23,info:c})}}function hd(a,b){a.ze=b}function id(a,b){a.K.error(b);R(a,olympe.O.cb.C.Db)}function jd(a,b,c){a.Qb=null!=c?c:-1;a.K.info('Connected to',a.da.C(),' | ',b?'server version:'+b:'',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.G).sort(([d],[e])=>d-e);for(const [d,e]of b)if(!ed(a,d,e))return;R(a,olympe.O.cb.C.Dh)}
412
- function fd(a){a=JSON.parse(JSON.stringify(a));return`${olympe.Z.Yu(a.messageFamily)}: ${JSON.stringify(a.payload)}`}
413
- olympe.O.cb=class{constructor(a,b,c,d,e,f){this.K=a;this.Eb=b;this.da=d;this.F=null;this.config=f;this.mb=this.config.get('reconnectionDelay');this.Da=e;this.ze=null;this.pi=this.config.get('pingInterval');this.nm=this.mb/2;this.Wa=f.get('autoConnect');f.get('retryHttpOverload');this.uc=f.get('messageTimeout');this.$=olympe.Z.bf.parse(f.get('clientVersion'));this.na=olympe.Z.bf.parse(f.get('serverVersion'));this.C=olympe.O.cb.C.INIT;this.ub=f.get('getContextMode');this.ye=1;this.T=null;this.L=[0,
414
- 0,0];this.ga=new Map;this.P=olympe.D.ec(olympe.D.ea,'Server is online');this.qd=new Map;this.jd=new Map;this.G=new Map;this.ac=new Map;this.Qb=-1;Xc(this,f,c)}connect(){const a=olympe.O.cb.C.INIT,b=olympe.O.cb.C.CONNECTING,c=olympe.O.cb.C.Dh,d=olympe.O.cb.C.Pe,e=olympe.O.cb.C.cg,f=olympe.O.cb.C.$g,g=olympe.O.cb.C.Ag,h=olympe.O.cb.C.Db;null!==this.F&&(this.F.$(null),this.F.close());this.Wa=!0;this.K.log(`Asking NET layer for a connection to ${Ob(this.da)}:${this.da.port}...`);this.F=this.Eb.G(this.da);
415
- this.F.ga(this.zd.bind(this));this.F.da(this.Lf.bind(this));this.F.$(()=>{this.F=null;this.C===c?R(this,e):this.C!==h&&this.C!==f&&R(this,d)});this.Da&&this.C===a&&this.F.F(()=>{this.F.F(null);if(this.C===b){var k=Pb(this.Da);this.K.info(`Trying to wakeup orchestrator with ${k}`);R(this,f);var m=this.Eb.G(this.Da);m.da(n=>{const p=JSON.parse(n);this.K.info(`${k}: ${null==p?void 0:p.status}`);switch(null==p?void 0:p.status){case 'ready':R(this,g);m.close();break;case 'asleep':this.K.info(`Trying to wakeup orchestrator with ${k}`);
416
- m.send('{"action": "wakeup"}');R(this,f);break;case 'waking-up':break;default:this.K.warn(`Invalid message from ${k}: ${n}`),m.close(),R(this,d)}});m.F(()=>{this.K.warn(`Communication with ${k} failed.`);m.close();R(this,d)});m.ga(()=>{this.K.info(`Checking orchestrator status with ${k}`);m.send('{"action": "status"}')})}this.Da=null});this.C!==e&&R(this,b)}disconnect(){const a=olympe.O.cb.C.CONNECTING;if(this.C===olympe.O.cb.C.Dh||this.C===a)this.Wa=!1,R(this,olympe.O.cb.C.Pe),this.F.close()}zd(){this.K.debug('Websocket connected, sending handshake. Client version:',
417
- Qa(this.$),'subscribeEverything:',this.ub?'NO':'YES');cd(this,olympe.O.ae.Ui,{c:olympe.O.jb.Ui,cv:Qa(this.$),m:this.ub?0:1,s:this.T},this.ni.bind(this))}ni(a,b){if(a)id(this,'Error in receiving handshake response: '+a.message);else{this.K.debug('Handshake response received');var c=olympe.O.cb.F;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.Qr:id(this,`Framework version (${Qa(this.$)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
418
- return;case c.ut:id(this,`Framework version (${Qa(this.$)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.Ar:id(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.na.Ha(olympe.Z.bf.C))this.K.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.Z.bf.parse(a);if(e.Ci(this.na)){id(this,`Framework v${Qa(this.$)} is expecting Orchestrator to be at least in v${Qa(this.na)}`);
419
- return}this.K.log('Handshake successful. Orchestrator version: ',e,'required:',Qa(this.na))}catch(f){id(this,f);return}e=olympe.O.cb.C.Pe;if(this.C===olympe.O.cb.C.cg&&null!==this.T&&this.T!==b.sessionId)this.K.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),R(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.ac.set(f,g);this.T=b.sessionId||null;jd(this,a,d)}}}ji(){this.L[0]-this.L[1]>this.nm?(this.K.debug('Ping did not get answer, try to reconnect'),
420
- R(this,olympe.O.cb.C.cg)):(this.L[0]=Date.now(),this.F.send('ping')||(this.K.debug('Impossible to send ping, try to reconnect'),R(this,olympe.O.cb.C.cg)))}Lf(a){this.L[2]=Date.now();if(a.startsWith('pong'))return this.L[1]=this.L[2],null;try{var b=JSON.parse(a)}catch(d){return this.K.error('Unable to parse response from server: '+d.toString()),Error('Unable to parse response from server')}this.K.C()&&this.K.debug('WS <',fd(b));a=b.seqId;const c=b.messageFamily;b=b.payload;if(this.G.has(a)){const {Kl:d}=
421
- this.G.get(a);this.G.delete(a);d&&d(b)}a=this.ga.get(c);if(void 0!==a)for(const d of a.values())d(b);return null}Wb(){const a=Date.now();for(const [b,{wm:c}]of this.G)null!==c&&a-c>this.uc&&(this.K.warn(`No response was received from the server for the seqId = ${b}`),Zc(this,b,{error:{reason:'Message timeout: never receive acknowledge'}}))}};olympe.O.Request=class{constructor(a,b,c,d,e,f){this.F=d;this.C=a;this.source=b;this.L=c;this.th=e;this.G=f||null}Nb(){return this.C}zb(){return this.source}sg(){return this.F}getType(){return this.th}td(){return this.G}Td(){return this.L}ha(a){return{dest:this.C,src:this.source,seq:this.F,auth:this.L,type:this.th,content:a.ha(this.G)}}toString(){return`Request(dest: ${this.C}, src: ${this.source}, seqId: ${this.F}, type: ${this.th})`}};
422
- olympe.O.Request.jb={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,qe:4,Jp:5};function kd(a){const b=olympe.O.Response.jb.Hp;return a.F!==olympe.O.Response.jb.vl?Promise.reject('Should only call `topicAck` on TOPIC responses'):zc(olympe.O.kh(),a.C.seq,a.source,b)}olympe.O.Response=class{constructor(a,b,c,d,e){this.L=c;this.G=a;this.source=b;this.F=d;this.C=null!=e?e:null}Nb(){return this.G}zb(){return this.source}sg(){return this.L}getType(){return this.F}td(){return this.C}ha(a){return{dest:this.G,src:this.source,seq:this.L,type:this.F,content:a.ha(this.C)}}toString(){return JSON.stringify(this)}};
423
- olympe.O.Response.jb={dk:0,sp:1,Pp:2,vl:3,Hp:4,Db:5};const ld=olympe.O.Response.jb.sp,md=olympe.O.Response.jb.Db,nd=olympe.O.Response.jb.Pp,od=olympe.O.Response.jb.vl,pd=olympe.O.Response.jb.Hp,qd=olympe.O.Request.jb.SEND,rd=olympe.O.Request.jb.GET,sd=olympe.O.Request.jb.SUBSCRIBE,td=olympe.O.Request.jb.qe;
424
- olympe.O.zc=class{constructor(a,b,c){this.request=a;this.C=b;this.G=c;this.F=null}wh(){return null!==this.F?Promise.resolve(this.F):Kc(this.C,this.request).then(a=>this.F=a)}th(){return this.request.getType()}source(){return this.request.zb()}body(){return this.request.td()}Yp(){return this.request.getType()===qd?this.C.ed(this.request,ld):Promise.reject('Should only call `ack` on SEND requests')}ed(a){const b=this.request.getType();return b===rd||b===td?this.C.ed(this.request,nd,a):Promise.reject('Should only call `reply` on GET requests')}qm(a){if(this.request.getType()!==
425
- sd)return Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests');const b=olympe.Z.hc();return new Promise((c,d)=>{const e={seq:Ec(this.C,f=>{switch(f.getType()){case pd:ud(this.G,b);c(b);break;case md:d(f.td().reason);break;default:d('Unsupported response type for a SUBSCRIBE request')}}),topic:a,id:b,refresh:this.C.Wb};this.C.ed(this.request,od,e).catch(d)})}ih(a){return this.C.ed(this.request,md,{reason:a.message})}};olympe.O.zc.prototype.fail=olympe.O.zc.prototype.ih;
426
- olympe.O.zc.prototype.notifyOn=olympe.O.zc.prototype.qm;olympe.O.zc.prototype.reply=olympe.O.zc.prototype.ed;olympe.O.zc.prototype.ack=olympe.O.zc.prototype.Yp;olympe.O.zc.prototype.body=olympe.O.zc.prototype.body;olympe.O.zc.prototype.source=olympe.O.zc.prototype.source;olympe.O.zc.prototype.requestType=olympe.O.zc.prototype.th;olympe.O.zc.prototype.userTag=olympe.O.zc.prototype.wh;function tc(a){if(null!==a.F){var b=a.F;a.F=null;clearInterval(b)}}function xc(a,b){b&&a.Wd();null===a.F&&(a.F=setInterval(a.Wd.bind(a),a.G))}function Ic(a,b){b=a.C.delete(b);0===a.C.size&&tc(a);return b}function vd(a,b){a.C.forEach((c,d)=>{Ic(a,d);c(b)})}
427
- olympe.O.st=class{constructor(a,b,c,d){this.K=a;this.L=b;this.P=c;this.G=d;this.C=new Map;this.F=null}qh(){return null!==this.F}Wd(){const a=olympe.O.errors.el;Ub(this.L.C)?this.L.request(this.P,olympe.O.Request.jb.qe,Array.from(this.C.keys())).then(b=>{b=b.td();0<b.length&&b.forEach(c=>{const d=this.C.get(c);Ic(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.K.error(b);vd(this,Error(b))}):tc(this)}};olympe.O.fg=class{ha(a){return this.C(a)}G(a){return this.F(a)}C(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.D.Za:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.D.Color:return{t:2,r:a.rg().valueOf(),g:a.pg().valueOf(),b:a.mg().valueOf(),a:a.lg().valueOf()};case a instanceof Map:const b=Object.create(null);for(const [c,
386
+ 0<this.F.length){this.T=this.F.length;for(const a of this.F)this.run(a)}else this.complete(!0)}};olympe.jc={};olympe.jc.xs=class{constructor(){}set(){}get(){}forEach(){}remove(){}clear(){}close(){}};olympe.jc.ws=class{constructor(){}C(){}};olympe.jc.Storage=class{open(){}write(){}close(){}};olympe.jc.R={Yi:'localStorage.KeyValueManager',vj:'localStorage.Storage',gx:'localStorage.DatacloudStorage',za:'localStorage.Logger'};olympe.V.config(function(a){wa(a,olympe.jc.R.Yi);E(a,olympe.jc.R.za,[olympe.la.R.Ga],function(b){return b.Fc('localstorage')})},'olympe.localstorage');olympe.O={};olympe.O.errors={};olympe.O.errors.Py=class extends Error{};olympe.O.errors.Fo=class extends Error{};olympe.O.errors.Gp=class extends Error{};olympe.O.errors.Oo=class extends Error{};olympe.O.errors.Ft=class extends Error{};olympe.O.errors.dl=class extends Error{constructor(a,b){super(a);this.id=b}W(){return this.id}};olympe.O.Mb={Ri:'urls.FileSvc',Mm:'urls.BackupSvc',fp:'urls.RestoreBackupSvc',pe:'urls.GetContext',Qn:'urls.GraphDef',$m:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',Lp:'urls.UserTagFromToken',Et:'urls.UserNameFromTag',Dt:'urls.UserRoles',et:'urls.RoleMembers',dj:'urls.OpenIDSvc'};
387
+ olympe.V.config(a=>{F(a,olympe.O.Mb.Ri,'rest/filesvc');F(a,olympe.O.Mb.Mm,'rest/backupsvc');F(a,olympe.O.Mb.fp,'rest/backupsvc/restore');F(a,olympe.O.Mb.dj,'rest/openid');F(a,olympe.O.Mb.pe,'rest/initialData');F(a,olympe.O.Mb.Qn,'rest/querysvc/graphDef');F(a,olympe.O.Mb.$m,'rest/querysvc/graphDef/static');F(a,olympe.O.Mb.TRANSACTION,'rest/transaction');F(a,olympe.O.Mb.Lp,'rest/token');F(a,olympe.O.Mb.Et,'rest/authorization/getUserTag');F(a,olympe.O.Mb.Dt,'rest/authorization/getUserRoles');F(a,olympe.O.Mb.et,
388
+ 'rest/authorization/roleMembers')});function tc(a){a.K.info('Disconnected from bus');a.G=!0;let b;null==(b=a.F)||b.forEach((c,d)=>{c.rh()&&(a.K.info(`Disconnected from bus: pause keep alive of ${c.C.size} subscriptions for ${d} service.`),uc(c))})}function vc(a){a.K.debug('Connection to bus established. Listening to responses on topic',a.P);Xb(a.C,a.P,b=>{a.K.C()&&a.K.debug('BUS <',JSON.stringify(b));b=new olympe.O.Response(b.dest,b.src,b.seq,b.type,a.Da.G(b.content));let c;null==(c=a.L.get(b.sg()))||c(b)})}
389
+ function wc(a){a.K.debug(`Reconnected to bus: Sending ${a.ga.length} pending messages and resubscribe to ${a.da.size} active topics.`);for(const c of a.ga){let d;try{d=c.ha(a.Da)}catch(e){a.K.error(`An error occurred while serializing a message that was pending (seqId=${c.sg()}: ${e}`)}a.C.publish(c.fc(),d)}a.ga=[];a.da.forEach((c,d)=>{xc(a,d,c)});a.da.clear();let b;null==(b=a.F)||b.forEach((c,d)=>{c.rh()||(a.K.info(`Reconnected to bus: restart keep alive of ${c.C.size} subscriptions for ${d} service.`),
390
+ yc(c,!0))})}function zc(a){a.ub=a.na.C(()=>Vb(a.C)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}
391
+ function xc(a,b,c){a.G||a.Wa?a.da.set(b,c):a.connect().then(()=>{a.K.debug(`Bus: Subscribe to ${b}`);Xb(a.C,b,d=>{a.K.C()&&a.K.debug(`BUS < #${b}: ${JSON.stringify(d)}`);let e=null;try{e=new olympe.O.Request(d.dest,d.src,d.auth,d.seq,d.type,a.Da.G(d.content))}catch(f){a.K.error(`An error occurred while trying to deserialize the request: ${JSON.stringify(d)}`)}null!==e&&c(e)})})}function Ac(a,b,c,d,e){b=new olympe.O.Response(c,a.P,b,d,e);return a.publish(b)}
392
+ function Bc(a,b,c,d){const e=Cc(a.T).Yc();a.$++;return new olympe.O.Request(b,a.P,e,a.$,c,d)}function Dc(a,b,c,d){const e=b.sg(),f=olympe.O.Response.jb.dk;let g=null;g=setTimeout(()=>Ec(a,e),a.Pb);a.L.set(e,h=>{g&&clearTimeout(g);h.getType()===f?g=setTimeout(()=>Ec(a,e),d):(a.L.delete(e),c(h))})}function Ec(a,b){const c=a.L.get(b);a.L.delete(b);null==c||c(new olympe.O.Response(a.P,a.P,b,olympe.O.Response.jb.Cb,{reason:'Timeout'}))}
393
+ function Fc(a,b){a.$++;const c=a.$,d=setTimeout(()=>Ec(a,c),a.Pb);a.L.set(c,e=>{a.L.delete(c);clearTimeout(d);b(e)});return a.$}function Gc(a,b){a.da.delete(b);let c;null==(c=a.F)||c.delete(b);a.K.debug(`Bus: Unsubscribe to ${b}`);return a.G||a.Wa?Promise.resolve():new Promise((d,e)=>{Yb(a.C,b,f=>f?e(f):d())})}
394
+ function Hc(a,b,c,d,e){null===a.F&&(a.F=new Map);let f=a.F.get(b);f?(a=f,a.G!==d&&(a.G=d,a.rh()&&(uc(a),yc(a,!1)))):(f=new olympe.O.st(a.K,a,b,d),a.F.set(b,f));d=f;d.C.set(c,e);1===d.C.size&&yc(d,!1)}function Ic(a,b,c){let d;const e=null==(d=a.F)?void 0:d.get(b);if(null==e?0:Jc(e,c))a.publish(Bc(a,b,olympe.O.Request.jb.Ip,c)).catch(f=>a.K.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.C.size&&(a.F.delete(b),0===a.F.size&&(a.F=null))}
395
+ function Kc(a,b){return rxjs.operators.retry({resetOnSuccess:!0,delay:c=>{if(c instanceof olympe.O.errors.dl){const d=Math.round(5E3*Math.random());a.K.debug(`Subscription topic ${c.W()} not registered in the service, re-subscribe in ${d}ms`);return rxjs.timer(d).pipe(rxjs.operators.tap(()=>null==b?void 0:b()))}return rxjs.throwError(()=>c)}})}function Lc(a,b){return new Promise((c,d)=>{a.T.ug(b.Sd(),(e,f)=>{e?d(e):c(f)})})}
396
+ olympe.O.Zm=class{constructor(a,b,c,d,e,f){b=f.get('connectionOptions');this.K=a;this.T=c;this.na=d;this.Da=e;this.Pb=f.get('shortTimeout');this.$b=f.get('requestTimeout');this.Vb=f.get('subscriptionsRefreshRate');this.L=new Map;this.C=Ub(f.get('url'),b);this.mb=f.get('allowGuest');this.$=1;this.P=olympe.Z.hc();this.F=null;this.G=!1;this.ga=[];this.da=new Map;this.Db=this.ub='';this.Wa=!1;ac(this.C,()=>{tc(this)});$b(this.C,()=>{tc(this)});Zb(this.C,()=>{this.G&&(this.Wa=!1,vc(this),this.G=!1,wc(this))})}connect(){const a=
397
+ olympe.auth.Ba.C.INIT,b=olympe.auth.Ba.C.Cb,c=olympe.auth.Ba.C.le,d=olympe.auth.Ba.C.Af,e=olympe.auth.Ba.C.Pe;return new Promise((f,g)=>{Vb(this.C)||this.G?f():olympe.D.qc([this.T.getState()],h=>{const k=olympe.D.Ma();if(this.mb||h!==d)switch(h){case a:this.Wa=!0;break;case b:case e:g(Error('Authentication failed.'));k.destroy();break;case c:case d:zc(this),this.mb||Mc(this.T,()=>this.disconnect().then()),this.G=!0,this.C.connect(()=>Cc(this.T),()=>{k.destroy();f()}),this.Db=this.na.da(()=>this.disconnect())}else zc(this),
398
+ g(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter !!!')),k.destroy()})})}disconnect(){return new Promise(a=>{this.K.debug('Disconnecting from bus');this.T.Da.delete('busLogoutCallback');this.C.end(!1,()=>a());this.na.G(this.ub);this.na.P(this.Db)})}publish(a){return this.G?(a.getType()!==olympe.O.Request.jb.re&&(this.K.debug('Bus disconnected, storing message in queue'),this.ga.push(a)),Promise.resolve()):new Promise((b,c)=>{try{const d=
399
+ a.ha(this.Da),e=a.fc();this.K.C()&&this.K.debug(`BUS > #${e}: ${JSON.stringify(d)}`);this.C.publish(e,d,void 0,f=>{f?c(f):b()})}catch(d){c(`An error occurred while serializing the message (seqId=${a.sg()}): ${d}`)}})}gd(a,b,c){return Ac(this,a.sg(),a.Gb(),b,c)}request(a,b,c,d){const e=Bc(this,a,b,c);if(b===olympe.O.Request.jb.PUBLISH){const f=new olympe.O.Response(a,this.P,e.sg(),olympe.O.Response.jb.dk);return this.publish(e).then(()=>f)}return new Promise((f,g)=>{Dc(this,e,f,null!=d?d:this.$b);
400
+ this.publish(e).catch(g)})}};olympe.O.Zm.C='Timeout';const Nc=olympe.net.Fa.Headers.Lm,Oc=olympe.net.Fa.Zb.Wh,Pc=olympe.net.Fa.Zb.fn,Qc=olympe.net.Fa.Zb.Ei,Rc=olympe.net.Fa.Zb.it,Sc=olympe.net.Fa.Zb.Xq,Tc=olympe.net.Fa.Zb.Jn,Uc=olympe.net.Fa.Zb.zt,Vc=olympe.net.Fa.Zb.Ao;function Wc(a,b){let c;return null!=(c=a.G.get(b))?c:''}
401
+ function Xc(a,b,c){if(null===b)return Promise.reject('No http request to send');P(b,{[Nc]:c});return rxjs.firstValueFrom(rxjs.defer(()=>new Promise((d,e)=>{const f=b.C();if(a.K.C()){const g=b.body;a.K.debug('HTTP >',f,`body: ${'string'===typeof g?g:typeof g}`)}a.C.C(b,g=>{switch(g.Rc()){case Oc:case Pc:case Qc:const h=g.getData();a.K.C()&&a.K.debug('HTTP <',g.Rc(),`content: ${'string'===typeof h?h:typeof h}`);d(h);break;case Rc:g=`HTTP < Service provider for http request to ${b.C()} is overloaded, retry later`;
402
+ a.K.warn(g);e(new olympe.O.errors.Oo(g));break;case Sc:a.K.debug(`HTTP < request canceled (${b.C()}).`);d();break;case Tc:case Uc:g=`HTTP < request authorization denied: ${b.C()}`;a.K.error(g);e(new olympe.O.errors.Ft(g));break;case Vc:g=`HTTP < requested resource not found: ${b.C()}`;a.K.error(g);e(new olympe.O.errors.Fo(g));break;default:g=`HTTP < Error: ${g.Rc()}, ${g.statusText}`,a.K.error(g),e(Error(g))}})})).pipe(rxjs.operators.retry(a.F)))}
403
+ olympe.O.Fr=class{constructor(a,b,c,d){this.K=a;this.C=b;this.G=c;this.F=d}};function Yc(a,b,c){a.K.info('Initializing COMMUNICATION layer');if(a.K.C()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.K.debug(d.join('\n\t'))}Zc(a,olympe.O.$d.Cb,d=>{switch(d.c){case olympe.O.jb.Bt:a.K.error('Unknown message sent to the server:',olympe.O.cb.Ob[d.s]);break;case olympe.O.jb.xr:a.K.error('Fatal error, the last message is probably too big according to the websocket config.'),a.G.forEach((e,f)=>{null!==e.vm&&$c(a,f,d.i)})}});b.get('autoConnect')&&
404
+ (a.K.debug('Connecting automatically'),a.connect());olympe.D.cm(a.P.vb(),()=>{a.qd.forEach(d=>d());Ob(a.ki.bind(a),a.ri);Ob(a.Vb.bind(a),a.nc)},()=>{a.T=null;a.ud.forEach(d=>d(a.L[2]));a.Vb()});c.C(()=>ad(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.C}`));c.da(()=>{a.disconnect();return Promise.resolve()});a.K.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}
405
+ function ad(a){return a.C===olympe.O.cb.C.Fh}
406
+ function Q(a,b){if(a.C!==b){a.K.debug('State change '+a.C+' --\x3e '+b);a.C=b;var c;null==(c=a.ze)||c.call(a,b);switch(b){case olympe.O.cb.C.CONNECTING:break;case olympe.O.cb.C.Fh:a.P.update(olympe.D.ea.F);break;case olympe.O.cb.C.cg:a.L[0]=0;a.L[1]=0;a.connect();break;case olympe.O.cb.C.Cb:a.K.error('Connection to server',a.da.C(),'aborted due to error');a.P.update(olympe.D.ea.C);break;case olympe.O.cb.C.ah:break;case olympe.O.cb.C.Ag:a.connect();break;case olympe.O.cb.C.Pe:a.P.update(olympe.D.ea.C);
407
+ a.Wa&&(a.K.info('Disconnected, will try to auto reconnect in',a.mb,'ms'),Nb(()=>{a.connect()},a.mb));break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}}function bd(a,b){const c=olympe.Z.hc();a.qd.set(c,b);olympe.D.Ta(a.P)===olympe.D.ea.F&&b()}function cd(a,b){var c;void 0===c&&(c=olympe.Z.hc());a.ud.set(c,b);olympe.D.Ta(a.P)===olympe.D.ea.C&&b(a.L[2])}
408
+ function dd(a,b,c,d){const e=a.ye;a.ye++;c={message:{seqId:e,messageFamily:b,payload:c},Jl:d?ed(a,d):null,vm:null};a.G.set(e,c);d=[olympe.O.cb.C.CONNECTING,olympe.O.cb.C.cg];(ad(a)||b===olympe.O.$d.Ui&&d.includes(a.C))&&fd(a,e,c)}
409
+ function ed(a,b){const c=olympe.O.cb.G.$h;return d=>{if(null!==d&&void 0!==d){var e=null,f,g=null==(f=d.info)?void 0:f.warn;f=d.s;'string'===typeof g?a.K.debug(`A message has raised a warning in the orchestrator: ${g}. Investigate.`):void 0!==f&&f!==c&&(e=void 0!==olympe.O.cb.Ob[f]?`Status code = ${f} [${olympe.O.cb.Ob[f]}]`:`Status code = ${f}`,g=d.info,void 0!==g&&void 0!==g.error&&(f=g.error.reason,'string'===typeof f&&0<f.length&&(e+=`\nReason:\n${g.error.reason}`),f=g.error.detailedReason,'string'===
410
+ typeof f&&0<f.length&&(e+=`\nDetails:\n${g.error.detailedReason}`)),e=Error('Rejected by orchestrator:\n'+e));b(e,d)}}}function fd(a,b,c){var d=c.message;a.K.C()&&a.K.debug('WS >',gd(d));(d=a.F.send(JSON.stringify(d)))?null===c.Jl?a.G.delete(b):c.vm=Date.now():Q(a,olympe.O.cb.C.cg);return d}function Zc(a,b,c,d){void 0===d&&(d=olympe.Z.hc());let e=a.ga.get(b);void 0===e&&(e=new Map,a.ga.set(b,e));e.set(d,c)}function hd(a){a=a.ga.get(olympe.O.$d.Zf);void 0!==a&&a.delete('logoutHandler')}
411
+ function $c(a,b,c){if(a.G.has(b)){const {Jl:d}=a.G.get(b);a.G.delete(b);d&&d({s:23,info:c})}}function id(a,b){a.ze=b}function jd(a,b){a.K.error(b);Q(a,olympe.O.cb.C.Cb)}function kd(a,b,c){a.Pb=c?1E3*c:-1;a.K.info(`Connected to ${a.da.C()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.G).sort(([d],[e])=>d-e);for(const [d,e]of b)if(!fd(a,d,e))return;Q(a,olympe.O.cb.C.Fh)}
412
+ function gd(a){return`${olympe.Z.Xu(a.messageFamily)}: ${JSON.stringify(a.payload)}`}
413
+ olympe.O.cb=class{constructor(a,b,c,d,e,f){this.K=a;this.Db=b;this.da=d;this.F=null;this.config=f;this.mb=this.config.get('reconnectionDelay');this.Da=e;this.ze=null;this.ri=this.config.get('pingInterval');this.mm=this.mb/2;this.Wa=f.get('autoConnect');f.get('retryHttpOverload');this.nc=f.get('messageTimeout');this.$=olympe.Z.af.parse(f.get('clientVersion'));this.na=olympe.Z.af.parse(f.get('serverVersion'));this.C=olympe.O.cb.C.INIT;this.ub=f.get('getContextMode');this.ye=1;this.T=null;this.L=[0,
414
+ 0,0];this.ga=new Map;this.P=olympe.D.cc(olympe.D.ea,'Server is online');this.qd=new Map;this.ud=new Map;this.G=new Map;this.$b=new Map;this.Pb=-1;Yc(this,f,c)}connect(){const a=olympe.O.cb.C.INIT,b=olympe.O.cb.C.CONNECTING,c=olympe.O.cb.C.Fh,d=olympe.O.cb.C.Pe,e=olympe.O.cb.C.cg,f=olympe.O.cb.C.ah,g=olympe.O.cb.C.Ag,h=olympe.O.cb.C.Cb;null!==this.F&&(this.F.$(null),this.F.close());this.Wa=!0;this.K.log(`Asking NET layer for a connection to ${Pb(this.da)}:${this.da.port}...`);this.F=this.Db.G(this.da);
415
+ this.F.ga(this.zd.bind(this));this.F.da(this.df.bind(this));this.F.$(()=>{this.F=null;this.C===c?Q(this,e):this.C!==h&&this.C!==f&&Q(this,d)});this.Da&&this.C===a&&this.F.F(()=>{this.F.F(null);if(this.C===b){var k=Qb(this.Da);this.K.info(`Trying to wakeup orchestrator with ${k}`);Q(this,f);var m=this.Db.G(this.Da);m.da(n=>{const p=JSON.parse(n);this.K.info(`${k}: ${null==p?void 0:p.status}`);switch(null==p?void 0:p.status){case 'ready':Q(this,g);m.close();break;case 'asleep':this.K.info(`Trying to wakeup orchestrator with ${k}`);
416
+ m.send('{"action": "wakeup"}');Q(this,f);break;case 'waking-up':break;default:this.K.warn(`Invalid message from ${k}: ${n}`),m.close(),Q(this,d)}});m.F(()=>{this.K.warn(`Communication with ${k} failed.`);m.close();Q(this,d)});m.ga(()=>{this.K.info(`Checking orchestrator status with ${k}`);m.send('{"action": "status"}')})}this.Da=null});this.C!==e&&Q(this,b)}disconnect(){const a=olympe.O.cb.C.CONNECTING;if(this.C===olympe.O.cb.C.Fh||this.C===a)this.Wa=!1,Q(this,olympe.O.cb.C.Pe),this.F.close()}zd(){this.K.debug('Websocket connected, sending handshake. Client version:',
417
+ Qa(this.$),'subscribeEverything:',this.ub?'NO':'YES');dd(this,olympe.O.$d.Ui,{c:olympe.O.jb.Ui,cv:Qa(this.$),m:this.ub?0:1,s:this.T},this.oi.bind(this))}oi(a,b){if(a)jd(this,'Error in receiving handshake response: '+a.message);else{this.K.debug('Handshake response received');var c=olympe.O.cb.F;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.Qr:jd(this,`Framework version (${Qa(this.$)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
418
+ return;case c.ut:jd(this,`Framework version (${Qa(this.$)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.Ar:jd(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.na.Ha(olympe.Z.af.C))this.K.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.Z.af.parse(a);if(e.Ci(this.na)){jd(this,`Framework v${Qa(this.$)} is expecting Orchestrator to be at least in v${Qa(this.na)}`);
419
+ return}this.K.log('Handshake successful. Orchestrator version: ',e,'required:',Qa(this.na))}catch(f){jd(this,f);return}e=olympe.O.cb.C.Pe;if(this.C===olympe.O.cb.C.cg&&null!==this.T&&this.T!==b.sessionId)this.K.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),Q(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.$b.set(f,g);this.T=b.sessionId||null;kd(this,a,d)}}}ki(){this.L[0]-this.L[1]>this.mm?(this.K.debug('Ping did not get answer, try to reconnect'),
420
+ Q(this,olympe.O.cb.C.cg)):(this.L[0]=Date.now(),this.F.send('ping')||(this.K.debug('Impossible to send ping, try to reconnect'),Q(this,olympe.O.cb.C.cg)))}df(a){this.L[2]=Date.now();if(a.startsWith('pong'))return this.L[1]=this.L[2],null;try{var b=JSON.parse(a)}catch(d){return this.K.error('Unable to parse response from server: '+d.toString()),Error('Unable to parse response from server')}this.K.C()&&this.K.debug('WS <',gd(b));a=b.seqId;const c=b.messageFamily;b=b.payload;if(this.G.has(a)){const {Jl:d}=
421
+ this.G.get(a);this.G.delete(a);d&&d(b)}a=this.ga.get(c);if(void 0!==a)for(const d of a.values())d(b);return null}Vb(){const a=Date.now();for(const [b,{vm:c}]of this.G)null!==c&&a-c>this.nc&&(this.K.warn(`No response was received from the server for the seqId = ${b}`),$c(this,b,{error:{reason:'Message timeout: never receive acknowledge'}}))}};olympe.O.Request=class{constructor(a,b,c,d,e,f){this.F=d;this.C=a;this.source=b;this.L=c;this.vh=e;this.G=f||null}fc(){return this.C}Gb(){return this.source}sg(){return this.F}getType(){return this.vh}td(){return this.G}Sd(){return this.L}ha(a){return{dest:this.C,src:this.source,seq:this.F,auth:this.L,type:this.vh,content:a.ha(this.G)}}toString(){return`Request(dest: ${this.C}, src: ${this.source}, seqId: ${this.F}, type: ${this.vh})`}};
422
+ olympe.O.Request.jb={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,re:4,Ip:5};function ld(a){const b=olympe.O.Response.jb.Fp;return a.F!==olympe.O.Response.jb.ul?Promise.reject('Should only call `topicAck` on TOPIC responses'):Ac(olympe.O.lh(),a.C.seq,a.source,b)}olympe.O.Response=class{constructor(a,b,c,d,e){this.L=c;this.G=a;this.source=b;this.F=d;this.C=null!=e?e:null}fc(){return this.G}Gb(){return this.source}sg(){return this.L}getType(){return this.F}td(){return this.C}ha(a){return{dest:this.G,src:this.source,seq:this.L,type:this.F,content:a.ha(this.C)}}toString(){return JSON.stringify(this)}};
423
+ olympe.O.Response.jb={dk:0,qp:1,Op:2,ul:3,Fp:4,Cb:5};const md=olympe.O.Response.jb.qp,nd=olympe.O.Response.jb.Cb,od=olympe.O.Response.jb.Op,pd=olympe.O.Response.jb.ul,qd=olympe.O.Response.jb.Fp,rd=olympe.O.Request.jb.SEND,sd=olympe.O.Request.jb.GET,td=olympe.O.Request.jb.SUBSCRIBE,ud=olympe.O.Request.jb.re;
424
+ olympe.O.Ac=class{constructor(a,b,c){this.request=a;this.C=b;this.G=c;this.F=null}yh(){return null!==this.F?Promise.resolve(this.F):Lc(this.C,this.request).then(a=>this.F=a)}vh(){return this.request.getType()}source(){return this.request.Gb()}body(){return this.request.td()}Xp(){return this.request.getType()===rd?this.C.gd(this.request,md):Promise.reject('Should only call `ack` on SEND requests')}gd(a){const b=this.request.getType();return b===sd||b===ud?this.C.gd(this.request,od,a):Promise.reject('Should only call `reply` on GET requests')}pm(a){if(this.request.getType()!==
425
+ td)return Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests');const b=olympe.Z.hc();return new Promise((c,d)=>{const e={seq:Fc(this.C,f=>{switch(f.getType()){case qd:vd(this.G,b);c(b);break;case nd:d(f.td().reason);break;default:d('Unsupported response type for a SUBSCRIBE request')}}),topic:a,id:b,refresh:this.C.Vb};this.C.gd(this.request,pd,e).catch(d)})}jh(a){return this.C.gd(this.request,nd,{reason:a.message})}};olympe.O.Ac.prototype.fail=olympe.O.Ac.prototype.jh;
426
+ olympe.O.Ac.prototype.notifyOn=olympe.O.Ac.prototype.pm;olympe.O.Ac.prototype.reply=olympe.O.Ac.prototype.gd;olympe.O.Ac.prototype.ack=olympe.O.Ac.prototype.Xp;olympe.O.Ac.prototype.body=olympe.O.Ac.prototype.body;olympe.O.Ac.prototype.source=olympe.O.Ac.prototype.source;olympe.O.Ac.prototype.requestType=olympe.O.Ac.prototype.vh;olympe.O.Ac.prototype.userTag=olympe.O.Ac.prototype.yh;function uc(a){if(null!==a.F){var b=a.F;a.F=null;clearInterval(b)}}function yc(a,b){b&&a.Vd();null===a.F&&(a.F=setInterval(a.Vd.bind(a),a.G))}function Jc(a,b){b=a.C.delete(b);0===a.C.size&&uc(a);return b}function wd(a,b){a.C.forEach((c,d)=>{Jc(a,d);c(b)})}
427
+ olympe.O.st=class{constructor(a,b,c,d){this.K=a;this.L=b;this.P=c;this.G=d;this.C=new Map;this.F=null}rh(){return null!==this.F}Vd(){const a=olympe.O.errors.dl;Vb(this.L.C)?this.L.request(this.P,olympe.O.Request.jb.re,Array.from(this.C.keys())).then(b=>{b=b.td();0<b.length&&b.forEach(c=>{const d=this.C.get(c);Jc(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.K.error(b);wd(this,Error(b))}):uc(this)}};olympe.O.fg=class{ha(a){return this.C(a)}G(a){return this.F(a)}C(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.D.Za:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.D.Color:return{t:2,r:a.rg().valueOf(),g:a.pg().valueOf(),b:a.mg().valueOf(),a:a.lg().valueOf()};case a instanceof Map:const b=Object.create(null);for(const [c,
428
428
  d]of a)'string'===typeof c&&(b[c]=this.C(d));return{t:3,m:b};case Array.isArray(a):return a.map(this.C.bind(this));case a instanceof ArrayBuffer:return{t:4,v:olympe.Z.De().F(a)};case a instanceof Uint8Array:return{t:5,v:olympe.Z.De().F(a)};case 'object'===typeof a:return Object.entries(a).reduce((c,[d,e])=>{c[d]=this.C(e);return c},{});default:throw Error(`Impossible to serialize the following value: ${a}`);}}F(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===
429
- typeof a:case 'number'===typeof a:return a}if(Array.isArray(a))return a.map(b=>this.G(b));switch(a.t){case 1:return new Date(a.d);case 2:return olympe.D.Color.create(a.r,a.g,a.b,a.a);case 3:return new Map(Object.entries(a.m).map(([b,c])=>[b,this.G(c)]));case 4:return olympe.Z.De().G(a.v).buffer;case 5:return olympe.Z.De().G(a.v);default:return Object.entries(a).reduce((b,[c,d])=>{b[c]=this.G(d);return b},{})}}};const wd=olympe.O.Response.jb.sp,xd=olympe.O.Response.jb.dk,yd=olympe.O.Response.jb.Db,zd=olympe.O.Response.jb.Pp,Ad=olympe.O.Response.jb.vl,Bd=olympe.O.Request.jb.SEND,Cd=olympe.O.Request.jb.GET,Dd=olympe.O.Request.jb.PUBLISH,Ed=olympe.O.Request.jb.SUBSCRIBE,Fd=olympe.O.Request.jb.qe,Gd=olympe.O.Request.jb.Jp;function ud(a,b){a.C||(a.C=Ka(new olympe.Z.yl(a.F.Wb+3E4),c=>{let d;null==(d=a.G)||d.call(a,c)}));a.C.add(b)}
430
- function Hd(a){let b,c;a=null!=(c=null==(b=a.td())?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.O.errors.Ip(a):Error(a)}
431
- olympe.O.qb=class{constructor(a,b){this.F=olympe.O.kh();this.L=a;this.G=this.C=null;this.P=new olympe.D.Jb(`Service ${a}`,'function'===typeof b.F?b.F():b);this.K=olympe.la.fb(`Service ${this.L}`)}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.P.onDestroy(b);this.F.connect().then(()=>{wc(this.F,this.L,c=>{const d=new olympe.O.zc(c,this.F,this);switch(c.getType()){case Fd:var e=d.body().filter(g=>{let h;return!(null==(h=this.C)?0:Ja(h,g))});d.ed(e).catch(g=>this.K.error('Not able to validate subscription keep alive',
432
- g));break;case Gd:c=d.body();null==(e=this.C)||e.delete(c);let f;null==(f=this.G)||f.call(this,c);break;case Dd:a.next(d);break;default:this.F.ed(c,xd).then(()=>a.next(d))}})}).catch(c=>this.K.error('Failed to connect to the bus: '+c));return b})}Eq(a){this.G=a;return this}stop(){this.clear();this.P.destroy()}clear(){Fc(this.F,this.L).catch(b=>this.K.error('Failed to unsubscribe from '+this.L+', error: '+b));if(this.G){let b;null==(b=this.C)||b.forEach(c=>{let d;return null==(d=this.G)?void 0:d.call(this,
433
- c)})}let a;null==(a=this.C)||a.clear()}static publish(a,b){const c=olympe.O.kh();return c.connect().then(()=>c.request(a,Dd,b)).then()}static send(a,b,c={}){const d=olympe.O.kh();return d.connect().then(()=>d.request(a,Bd,b,c.timeout)).then(e=>{switch(e.getType()){case wd:break;case yd:throw Hd(e);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){const d=olympe.O.kh();return d.connect().then(()=>d.request(a,Cd,b,c.timeout)).then(e=>{switch(e.getType()){case zd:e=
434
- e.td();if(null!==e)return e;throw Error('No payload after request to service: '+a);case yd:throw Hd(e);default:throw Error('Unsupported response type for a GET request');}})}static observe(a,b,c,d={}){const e='function'===typeof b.F?b.F():b,f=olympe.O.kh();return(new rxjs.Observable(g=>{let h=null,k=null;const m=()=>{g.complete();k&&Hc(f,a,k);h&&Fc(f,h).catch(n=>olympe.la.fb('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.$(m);f.connect().then(()=>f.request(a,Ed,c,d.timeout)).then(n=>
435
- {switch(n.getType()){case Ad:const p=n.td();h=p.topic;wc(f,h,q=>{q.getType()===Dd?g.next(q.td()):(g.error('Unsupported notification message. It should be a publish'),m())});k=p.id;Gc(f,a,k,p.refresh,q=>g.error(q));kd(n).catch(q=>{g.error(`Was unable to ack the subscription: ${q}`);m()});break;case yd:g.error(Hd(n));break;default:g.error('Unsupported response type for a SUBSCRIBE request')}}).catch(n=>g.error(n));return m})).pipe(Jc(f,d.onRetry))}};olympe.O.qb.observe=olympe.O.qb.observe;
436
- olympe.O.qb.get=olympe.O.qb.get;olympe.O.qb.send=olympe.O.qb.send;olympe.O.qb.publish=olympe.O.qb.publish;olympe.O.qb.prototype.stop=olympe.O.qb.prototype.stop;olympe.O.qb.prototype.setUnsubscriptionHandler=olympe.O.qb.prototype.Eq;olympe.O.qb.prototype.listen=olympe.O.qb.prototype.listen;olympe.O.ae={rn:1,uf:2,Db:3,Zf:4,Yw:5,Ui:6};olympe.O.jb={Ui:1,Ct:2,xr:3,qe:5};olympe.O.cb.C={INIT:'initialize',CONNECTING:'connecting',Pe:'disconnected',Dh:'connected',cg:'reconnecting',$g:'waking',Ag:'awake',Db:'error'};olympe.O.cb.F={Uh:1,Ar:-1,Qr:-2,ut:-3};olympe.O.cb.G={Yh:0,py:23};
437
- olympe.O.cb.Pb={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',
438
- 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.O.R={qj:'com.ServerManager',pk:'com.BusManager',Ok:'com.HttpManager',ee:'com.Serializer',za:'com.Logger',yp:'com.Source',Kp:'com.Urls',Xy:'com.peerFileSvcUrl',Lo:'com.overloadRetryPolicy'};
439
- olympe.O.U={xk:'defaultHost',Vg:'server.host',rj:'server.port',sj:'server.ssl',kk:'server.basePath',Sp:'server.wsPath',Gm:'server.autoConnect',kl:'server.reconnectionDelay',Ro:'server.pingInterval',Rp:'server.messageTimeout',jp:'server.retryHttpOnOverload',en:'server.clientVersion',vp:'server.serverVersion',jt:'server.wakeUpService',nk:'bus.host',Sm:'bus.path',Tm:'bus.port',Ym:'bus.vhost',Wm:'bus.ssl',qe:'bus.keepalive',ct:'bus.reschedulePings',br:'bus.clientId',$q:'bus.clean',er:'bus.connectTimeout',
440
- Vm:'bus.shortTimeout',Um:'bus.requestTimeout',Xm:'bus.subscriptionRefreshRate',Zs:'bus.queueQoSZero',mk:'bus.allowGuest'};
441
- olympe.V.config(function(a){F(a,olympe.O.U.xk,'object'===typeof window&&window.location&&window.location.hostname||'localhost');var b=a.getParameter(olympe.O.U.xk);F(a,olympe.O.U.Vg,b);var c=a.getParameter(olympe.O.U.Vg),d='localhost'===c;c=d||c.endsWith(a.getParameter(olympe.net.U.Zi));F(a,olympe.O.U.rj,d?8080:c?80:443);F(a,olympe.O.U.sj,!c);F(a,olympe.O.U.kk,'OlympeServer');F(a,olympe.O.U.Sp,'websocket');F(a,olympe.O.U.Gm,!0);F(a,olympe.O.U.kl,5E3);F(a,olympe.O.U.Ro,5E3);F(a,olympe.O.U.Rp,15E3);
442
- F(a,olympe.O.U.jp,5E3);F(a,olympe.O.U.vp,'7.1.3');F(a,olympe.O.U.nk,b);d=a.getParameter(olympe.O.U.nk);d=(b='localhost'===d)||d.endsWith(a.getParameter(olympe.net.U.Zi));F(a,olympe.O.U.Sm,d?'':'/mqtt');F(a,olympe.O.U.Tm,b?15675:d?80:443);F(a,olympe.O.U.Wm,!d);F(a,olympe.O.U.Ym,d?'/':'');F(a,olympe.O.U.qe,30);F(a,olympe.O.U.Vm,5E3);F(a,olympe.O.U.Um,3E4);F(a,olympe.O.U.Xm,6E4);F(a,olympe.O.U.mk,!1);b=a.getParameter(olympe.Pf.U.Kn);if(void 0!==b)xa(a,b);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');
443
- E(a,olympe.O.R.za,[olympe.la.R.Ga],f=>f.Fc('communication'));E(a,'server.WebSocketRequest',[new olympe.V.ma(olympe.O.U.Vg),new olympe.V.ma(olympe.O.U.rj),new olympe.V.ma(olympe.O.U.sj),new olympe.V.ma(olympe.O.U.kk),new olympe.V.ma(olympe.O.U.Sp)],(f,g,h,k,m)=>new olympe.net.di(f,g,(k+'/'+m).replace(/\/+/g,'/').replace(/\/$/,''),h));E(a,'server.wakeUpRequest',[new olympe.V.ma(olympe.O.U.Vg),new olympe.V.ma(olympe.O.U.rj),new olympe.V.ma(olympe.O.U.sj),new olympe.V.ma(olympe.O.U.jt)],(f,g,h,k)=>{if(null===
444
- k||void 0===k)return null;k=k.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.di(f,g,k,h)});const e=Array.from(Object.values(olympe.O.Mb));E(a,olympe.O.R.Kp,[new olympe.V.ma(olympe.O.U.Vg),new olympe.V.ma(olympe.O.U.rj),new olympe.V.ma(olympe.O.U.sj),new olympe.V.ma(olympe.O.U.kk),...e.map(f=>new olympe.V.ma(f))],(f,g,h,k,...m)=>{const n=e.map((p,q)=>{q=m[q];q=(new olympe.net.Mh(f,g,`${k}${q?'/'+q:''}`.replace(/\/+/g,'/').replace(/\/$/,''),h)).C();return[p,q]});return new Map(n)});E(a,
445
- olympe.O.R.Lo,[olympe.O.R.za],f=>({resetOnSuccess:!0,delay:(g,h)=>g instanceof olympe.O.errors.Qo?(h=Math.round(Math.random()*(h+1)*4E3),f.warn(`Service overloaded, re-send request in ${h}ms`),rxjs.timer(h)):rxjs.throwError(()=>g)}));D(a,olympe.O.R.ee,olympe.O.fg);D(a,olympe.O.R.Ok,olympe.O.Fr,olympe.O.R.za,olympe.net.R.Ga,olympe.O.R.Kp,olympe.O.R.Lo);E(a,'server.ManagerConfig',[new olympe.V.ma(olympe.O.U.Gm),new olympe.V.ma(olympe.O.U.kl),new olympe.V.ma(olympe.O.U.Ro),new olympe.V.ma(olympe.O.U.Rp),
446
- new olympe.V.ma(olympe.O.U.en),new olympe.V.ma(olympe.O.U.vp),new olympe.V.ma(olympe.dc.U.Wg),new olympe.V.ma(olympe.O.U.jp)],(...f)=>{const g='autoConnect reconnectionDelay pingInterval messageTimeout clientVersion serverVersion getContextMode retryHttpOverload'.split(' '),h=new Map;f.forEach((k,m)=>h.set(g[m],k));return h});D(a,olympe.O.R.qj,olympe.O.cb,olympe.O.R.za,olympe.net.R.Ga,olympe.host.R.Xe,'server.WebSocketRequest','server.wakeUpRequest','server.ManagerConfig');E(a,'server.bus.ManagerConfig',
447
- [new olympe.V.ma(olympe.O.U.Vg),new olympe.V.ma(olympe.O.U.nk),new olympe.V.ma(olympe.O.U.Sm),new olympe.V.ma(olympe.O.U.Tm),new olympe.V.ma(olympe.O.U.Ym),new olympe.V.ma(olympe.O.U.Wm),new olympe.V.ma(olympe.O.U.mk),new olympe.V.ma(olympe.O.U.Vm),new olympe.V.ma(olympe.O.U.Um),new olympe.V.ma(olympe.O.U.Xm),new olympe.V.ma(olympe.O.U.qe),new olympe.V.ma(olympe.O.U.ct),new olympe.V.ma(olympe.O.U.br),new olympe.V.ma(olympe.O.U.$q),new olympe.V.ma(olympe.O.U.kl),new olympe.V.ma(olympe.O.U.er),new olympe.V.ma(olympe.O.U.Zs)],
448
- (f,g,h,k,m,n,p,q,r,t,...u)=>{g=`${n?'wss://':'ws://'}${g}:${k}${h}/ws`;const w='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero shortTimeout requestTimeout'.split(' ');u=u.reduce((x,y,z)=>{x[w[z]]=y;return x},{});u.vhost=`${m||f.split('.')[0]}`;return new Map([['url',g],['connectionOptions',u],['allowGuest',p],['shortTimeout',q],['requestTimeout',r],['subscriptionsRefreshRate',t]])});D(a,olympe.O.R.pk,olympe.O.Zm,olympe.O.R.za,olympe.net.R.Ga,olympe.auth.R.Ga,
449
- olympe.host.R.Xe,olympe.O.R.ee,'server.bus.ManagerConfig')},'olympe.communication');olympe.V.run([olympe.O.R.pk],a=>{olympe.O.kh=()=>a});olympe.auth={};function Id(a,b){gd(a.C);Yc(a.C,olympe.O.ae.Zf,c=>{const d=c.c;d===olympe.auth.Pc.C.Bs?(a.C.zd(),b(olympe.auth.Ba.F.Ei,c)):d===olympe.auth.Pc.C.gt&&b(olympe.auth.Ba.F.Yn,c)},'logoutHandler')}
450
- function Jd(a,b,c){const d=null==b?void 0:b.Ue();if(b instanceof olympe.auth.fj){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.Yc();h.access_token=Kd(b);g=`${Vc(a.Kg,olympe.O.Mb.dj)}/logout${d?`?idpName=${d}`:''}`;a.F.redirect(g,h)};c=a.F.C();const f=new URL(c);if(0!==f.hash.length||0!==f.search.length){const g=a.storage.C('AUTH');f.hash='';f.search='';g&&g.set('redirectTo',c,()=>{g.close();e(f.toString())})}else e(c)}else cd(a.C,olympe.O.ae.Zf,Object.assign({},{c:olympe.auth.Pc.C.Cs},
451
- d&&{idpName:d}),c)}function Ld(a,b,c,d){c.c=b;cd(a.C,olympe.O.ae.Zf,c,d)}function Md(a,b,c){if(b.Lg()!==olympe.auth.kc.C.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'));else{var d=`?idpName=${b.Ue()}&access_token=${Kd(b)}`;d=`${Vc(a.Kg,olympe.O.Mb.dj)}/refresh${d}`;Wc(a.Kg,P(d),b.Yc()).then(e=>{'string'===typeof e?(e=JSON.parse(e),e=new olympe.auth.fj(b.oc(),b.ie(),b.Yc(),e,b.Ue()),c(null,e)):c(null,b)}).catch(e=>c(Error(e)))}}
452
- olympe.auth.Pc=class{constructor(a,b,c,d,e){this.K=a;this.C=b;this.Kg=c;this.F=d;this.storage=e;const f=this.storage.C('AUTH');f&&(f.get('redirectTo',g=>{g&&(f.remove('redirectTo'),f.close(),this.F.redirect(g,null,olympe.auth.pj.C.GET))}),f.close())}Wd(a){cd(this.C,olympe.O.ae.Zf,{c:olympe.auth.Pc.C.qe},b=>a(b))}ug(a,b,c){const d=Vc(this.Kg,olympe.O.Mb.Mp);a=P(`${d}/${a}`);Wc(this.Kg,a,b).then(e=>c(null,e)).catch(e=>c(Error(e)))}};
453
- olympe.auth.Pc.C={Zf:1,Cs:2,Db:3,qe:5,Yh:6,Hr:10,pt:11,Mq:12,SAML:13,gt:14,Bs:20};function Lc(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.Z.jh());a.Da.set(c,b)}function Bc(a){return olympe.D.Ta(a.C.vb())}
454
- function Nd(a){a.K.info('Initializing AUTH layer');let b=a.uc;if(a.na){const c=a.na.C(),d=Kb(c.parameters);b=d||b;d&&a.na.F(c.parameters.filter(e=>'authToken'!==e.ia()))}b&&a.storage&&Od(a.storage,b,c=>{!c&&a.K.error('Could not store authToken')});a.K.debug('Asking to be notified when auth connector gets online');ad(a.L,()=>{if(a.ub)if(a.G=olympe.auth.Ba.G.Jq,a.K.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),a.ga){const c=new olympe.auth.Request;c.set('username',
455
- a.ga);c.set('password',a.Qb);a.K.log('Autologin with user "'+a.ga+'"');Pd(a,c)}else Qd(a,'No user specified for auto login',!0);else a.G=olympe.auth.Ba.G.zj,a.K.log('Connector online, attempting to log with token'),Rd(a)});bd(a.L,()=>{switch(olympe.D.Ta(a.F)){case olympe.auth.Ba.C.ke:const c=olympe.D.Ta(a.C.vb()).oc();a.K.warn(`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ba.C.Af:a.K.warn('Disconnected from server - guest session lost');break;case olympe.auth.Ba.C.Gi:a.K.warn('Disconnected from server - authentication aborted');
456
- break;case olympe.auth.Ba.C.INIT:a.K.warn('Cannot open auth session - no server connection');break;default:a.K.error('Should not get there, investigate')}Sd(a,olympe.auth.Ba.C.Pe)});hd(a.L,c=>{switch(c){case olympe.O.cb.C.$g:Sd(a,olympe.auth.Ba.C.$g);break;case olympe.O.cb.C.Ag:Sd(a,olympe.auth.Ba.C.Ag)}});Id(a.P,(c,d)=>{if(c===olympe.auth.Ba.F.Ei)Qd(a,'authentication revoked'),a.storage&&Td(a.storage),a.Da.forEach(e=>{e(c,d)});else if(c===olympe.auth.Ba.F.Yn)a.K.info('Redirection to IDP to invalidate token (SAML)'),
457
- Bc(a),a.storage&&Td(a.storage),a.Eb.F();else throw Error(`Unknown logout step coming from server : ${c}`);});a.mb=Ud(a);a.da.F(()=>a.wi().catch(c=>a.K.error(`Failed to logout ${c}`)));a.K.log('DONE initializing AUTH layer (waiting for connector to be online)')}function Vd(a,b){let c=null;olympe.D.em(a.F.vb().ad(olympe.auth.Ba.C.ke).and(b),()=>{c=a.Ie(d=>{d&&a.K.error('Failed to refresh token when returning to active mode')})},()=>{let d;null==(d=c)||d()})}
458
- function Rd(a){null!==a.storage?(a.K.debug('Retrieving token from local storage'),a.storage.Td(b=>{if(b){const e=new olympe.auth.Request;var c=b.oc();e.set('username',c);c=e;var d=b.Yc();c.set('nonce',d);'string'===typeof b.Ue()&&e.set('idpName',b.Ue());a.K.debug('Token found, trying login with',e);Pd(a,e,olympe.auth.kc.C.fl)}else Qd(a,'No token found, cannot perform auto login')})):Qd(a,'Cannot retrieve token: no storage configured, cannot perform auto login',!0)}
459
- function Sd(a,b){a.K.log('State change: ',Wd(a),'--\x3e',b);a.F.update(b)}function Qd(a,b,c=!1){a.C.update(a.$);Sd(a,olympe.auth.Ba.C.Af);b=`Authenticated as guest (${b})`;c?a.K.error(b):a.K.info(b)}function Ud(a){const b=[olympe.auth.Ba.C.ke];a.ub||b.push(olympe.auth.Ba.C.Af);return a.da.C(()=>{const c=Wd(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}`)})}
460
- function Wd(a){return olympe.D.Ta(a.F.vb())}function Xd(){var a=olympe.public.Va.get();return new Map(a.L.ac)}function Yd(a,b){if(b){a.C.update(b);let c;null==(c=a.storage)||Od(c,b);a.K.debug('Token updated')}}function Zd(a,b,c,d=!1){b=b+c?':'+c.message:'';a.K.error(b);a.error.update(olympe.D.sb(b));Sd(a,olympe.auth.Ba.C.Db);if(d)throw Error(b);}
461
- function Pd(a,b,c,d){void 0===c&&(c=a.Wb);void 0===c&&Zd(a,'No authentication provider specified',null,!0);const e=a.Hc.get(c);e||Zd(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.T.set('login',d);a.K.log('Sending authentication request using "'+c+'" for '+b);e.Td(b,a.ac.bind(a));Sd(a,olympe.auth.Ba.C.Gi)}function $d(a,b,c){a.T.forEach(d=>{d(b,c)})}
462
- olympe.auth.Ba=class{constructor(a,b,c,d,e,f,g,h,k,m){this.K=a;this.L=b;this.P=c;this.storage=d;this.Eb=e;this.na=f;this.Wb=m.get('defaultProvider');this.ub=!!m.get('autoLogin');this.ga=m.get('autoUser');this.Qb=m.get('autoPassword');this.uc=m.get('autoToken');this.Hc=new Map;this.da=g;this.mb='';this.F=olympe.D.ec(String).update(olympe.auth.Ba.C.INIT);this.error=olympe.D.ec(olympe.D.Ka);this.G=null;this.$=new olympe.auth.ig('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=
463
- olympe.D.ec(olympe.auth.ig).update(this.$);this.T=new Map;this.Da=new Map;this.Wa=new olympe.Z.xl(m.get('cacheTokenTimeout'));h.forEach(n=>{const p=n.C();if(this.Hc.has(p))throw Error('Provider "'+p+'" has already been registered !');this.Hc.set(p,n)});Nd(this);Vd(this,k)}getState(){return this.F.vb()}oc(){return this.C.vb().oc()}ie(){return this.C.vb().ie()}Ie(a){const b=Bc(this);return olympe.D.Ta(this.C)!==this.$&&b?this.Hc.get(b.Lg()).Ie(b,(c,d)=>{c?(this.K.error('Failed to refresh token, error message: ',
464
- c.message),this.wi().catch(e=>this.K.error(`Failed to logout after wrong refresh ${e}`)),a(c)):(d&&Yd(this,d),a(null))}):null}mh(){return this.C.vb().mh()}ug(a,b){if(Ja(this.Wa.C,a))b(null,this.Wa.get(a));else{var c,d=null==(c=olympe.D.Ta(this.C.vb()))?void 0:c.Yc();this.P.ug(a,d,(e,f)=>{'string'===typeof f&&this.Wa.set(a,f);b(e,f)})}}wi(){return olympe.D.Ta(this.C)===this.$?(this.K.warn('Logout called for Guest user so it will be ignored'),Promise.resolve()):new Promise((a,b)=>{this.K.debug('Sending logout');
465
- Td(this.storage);Jd(this.P,Bc(this),c=>{c?(Zd(this,'Logout request rejected:',c),b(c)):(this.K.debug('Logout request acknowledged'),a())});this.da.G(this.mb)})}Wd(a){Wd(this)===olympe.auth.Ba.C.ke&&this.P.Wd(b=>{b&&this.K.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}ac(a,b){const c=null===this.G?olympe.auth.Ba.G.Gs:this.G;this.G=null;a?(Td(this.storage),this.error.update(olympe.D.sb(a.message)),Qd(this,'authentication rejected: '+a.message),$d(this,a,c)):(this.K.info('User '+
466
- b.oc()+' (#'+b.ie()+') successfully authenticated'),this.C.update(b),Sd(this,olympe.auth.Ba.C.ke),$d(this,a,c),this.storage&&Od(this.storage,b));this.T.has('login')&&this.T.delete('login')}};olympe.auth.Ba.C={INIT:'init',$g:'waking',Ag:'awake',Pe:'disconnected',Af:'guest',Gi:'authenticating',Db:'error',ke:'authenticated'};olympe.auth.Ba.G={Gs:'manual',Jq:'auto',zj:'tokenOnFirstConnection'};olympe.auth.Ba.F={Ei:'accepted',Yn:'redirect'};olympe.auth.kc=class{C(){}Td(){}Ie(){}};olympe.auth.kc.C={SAML:'saml',OAUTH2:'openID',SRP:'srp',fl:'olympeToken'};function ae(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.pc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.bh&&(a=a.Aa.xb);return a?a.valueOf():a}oc(){return this.get('username')}Yc(){return this.get('nonce')}toString(){return this.oc()+(this.Yc()?' with nonce':'')+(this.get('password')?' with password':'')+(ae(this)?` with idp name ${ae(this)}`:'')}};olympe.auth.ig=class{constructor(a,b,c,d={},e=null){this.L=a;this.wh=b;this.F=c;this.C=e;this.G=d}oc(){return this.L}ie(){return this.wh}Yc(){return this.F}td(){return this.G}mh(){return null}Ue(){return this.C}ha(){const a=olympe.Z.De(),b=Object.assign({},{user:this.L,userTag:this.wh,nonce:this.F},this.C&&{idpName:this.C},{payload:this.G});return olympe.Z.Zp(Ga(a,JSON.stringify(b)))}Lg(){return olympe.auth.kc.C.SRP}};l=olympe.auth.ig.prototype;l.oc.J=new olympe.D.H(()=>String,[]);
467
- l.ie.J=new olympe.D.H(()=>String,[]);l.Yc.J=new olympe.D.H(()=>String,[]);l.td.J=new olympe.D.H(()=>Object,[]);l.mh.J=new olympe.D.H(()=>String,[]);l.Ue.J=new olympe.D.H(()=>String,[]);l.ha.J=new olympe.D.H(()=>String,[]);l.Lg.J=new olympe.D.H(()=>String,[]);function Kd(a){return a.td().access_token||null}function be(a){return parseInt(a.td().access_token_exp||'0',10)}olympe.auth.fj=class extends olympe.auth.ig{constructor(a,b,c,d,e){super(a,b,c,d,e)}mh(){return Kd(this)}Lg(){return olympe.auth.kc.C.OAUTH2}};olympe.auth.qp=class extends olympe.auth.ig{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.P=d}mh(){return this.P}Lg(){return olympe.auth.kc.C.SAML}ha(){const a=olympe.Z.De(),b=Object.assign({},{user:this.oc(),userTag:this.ie(),nonce:this.Yc()},this.Ue()&&{idpName:this.Ue()},{payload:this.td(),fullToken:this.P});return olympe.Z.Zp(Ga(a,JSON.stringify(b)))}};function Od(a,b,c){const d=a.C.C('AUTH');d.set(a.key,'string'===typeof b?b:b.ha(),e=>{d.close();c&&c(e)})}function Td(a){const b=a.C.C('AUTH');b.remove(a.key,()=>b.close())}
468
- olympe.auth.zl=class{constructor(a,b,c){this.C=a;this.K=b;this.key='OlympeToken-'+c.C}Td(a){const b=this.C.C('AUTH');this.K.debug(`olympe.auth.TokenStorage: retrieve token with key ${this.key}`);b.get(this.key,c=>{let d=null;if(c)try{this.K.debug('olympe.auth.TokenStorage: Token retrieved successfully');var e=JSON,f=e.parse;var g=Ha(olympe.Z.De().G(olympe.Z.Yt(c)));const h=f.call(e,g);let k;h.fullToken?k=new olympe.auth.qp(h.user,h.userTag,h.nonce,h.fullToken,h.payload,h.idpName):h.payload&&h.payload.id_token?
469
- k=new olympe.auth.fj(h.user,h.userTag,h.nonce,h.payload,h.idpName):k=new olympe.auth.ig(h.user,h.userTag,h.nonce,h.payload,h.idpName);d=k}catch(h){this.K.error('Error while unserializing token: ',h.message)}else this.K.debug('olympe.auth.TokenStorage: No token found');b.close();a(d)})}};olympe.auth.zl.F='OlympeToken';olympe.auth.zl.C='AUTH';olympe.auth.pj=class{redirect(){}F(){}C(){}};olympe.auth.pj.C={GET:'GET',Pg:'POST'};olympe.auth.ik=class{constructor(a){this.C=a||'default'}};olympe.auth.Hc={};function ce(a,b,c){Ld(a.F,olympe.auth.Pc.C.Zf,{token:b.Yc()},(d,e)=>{if(null!==d)c(d);else switch(e.c){case olympe.auth.Pc.C.Db:c(Error('Invalid token'));break;case olympe.auth.Pc.C.Yh:d=null;if(e=e.payload){const f=e.userName,g=e.userTag,h=e.rndCook,k=e.payload,m=e.protocol;'SAML'===m?d=new olympe.auth.qp(f,g,h,e.samlToken,k,ae(b)):'openid'===m&&(d=new olympe.auth.fj(f,g,h,k,ae(b)))}c(null,d);break;default:c(Error('Unknown response from server'))}})}
470
- olympe.auth.Hc.so=class{constructor(a,b){this.F=a;this.storage=b}C(){return olympe.auth.kc.C.fl}Td(a,b){this.storage.Td(c=>{ce(this,a,(d,e)=>{b(d,e||c)})})}Ie(a,b){this.F.Wd(b);return null}};olympe.auth.Hc.so.va=[olympe.auth.kc];function de(a,b,c){const d=1E3*be(b)-Date.now()-6E4;if(0<d)return setTimeout(()=>{ee(a,b,c)},d);ee(a,b,c);return null}function ee(a,b,c){Md(a.L,b,(d,e)=>{d?c(d):e&&(c(null,e),a.F=de(a,e,c))})}
471
- olympe.auth.Hc.No=class{constructor(a,b,c){this.G=b;this.L=a;this.P=c;this.F=null}C(){return olympe.auth.kc.C.OAUTH2}Td(a){const b=encodeURIComponent(this.G.C());a=ae(a)?`idpName=${ae(a)}&`:'';this.G.redirect(`${this.P}/auth?${a}url=${b}`,null,olympe.auth.pj.C.GET)}Ie(a,b){0<be(a)?this.F=de(this,a,b):b(null,a);return this.T.bind(this)}T(){this.F&&clearTimeout(this.F)}};olympe.auth.Hc.No.va=[olympe.auth.kc];function fe(a,b){Ld(a.F,olympe.auth.Pc.C.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.Hc.SAML=class{constructor(a,b){this.F=a;this.G=b}C(){return olympe.auth.kc.C.SAML}Ie(a,b){this.F.Wd(b);return null}Td(a,b){fe(this,c=>{c?b(c):this.G.F(ae(a))})}};olympe.auth.Hc.SAML.va=[olympe.auth.kc];function ge(a,b,c){const d=olympe.auth.Pc.C.Hr,e=olympe.auth.Pc.C.Db,f=olympe.auth.Pc.C.pt,g={I:b.oc()};Ld(a.F,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.oc()}' 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'))}})}
472
- function he(a,b,c){const d=olympe.auth.Pc.C.Mq,e=olympe.auth.Pc.C.Db,f=olympe.auth.Pc.C.Yh;b={A:b.get('a'),M:b.get('m1'),I:b.oc()};Ld(a.F,d,b,(g,h)=>{if(null!==g)c(g);else switch(h.c){case e:a.K.debug('Login failed, invalid username or password');c(Error('Invalid username or password'));break;case f:g=h.payload;a.K.debug('Login successful, creating token');h=g.payload?JSON.parse(g.payload):void 0;c(null,new olympe.auth.ig(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`))}})}
473
- olympe.auth.Hc.SRP=class{constructor(a,b){this.F=b;this.K=a}C(){return olympe.auth.kc.C.SRP}Td(a,b){const c=a.get('password');a.C.delete('password');this.K.debug('Sending SRP request');ge(this,a,(d,e,f)=>{this.K.debug('Received Salt+B message');if(d)b(d);else{try{const g=new SRPClient;g.step1(a.oc(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g);return}this.K.debug('Sending SRP A+M (proof) message');he(this,a,b)}})}Ie(a,b){this.F.Wd(b);return null}};olympe.auth.Hc.SRP.va=[olympe.auth.kc];olympe.auth.R={Ga:'auth.Manager',za:'auth.Logger',vj:'auth.Storage',Fi:'auth.appNameToken',nj:'auth.Redirector',tp:'auth.ServerConnector'};olympe.auth.U={yk:'auth.defaultProvider',gk:'auth.autoLogin',Im:'auth.autoUser',Hm:'auth.autoPassword',zj:'auth.token',Em:'auth.appToken',an:'auth.cacheTokenTimeout'};
474
- olympe.V.config(function(a){F(a,olympe.auth.U.yk,olympe.auth.kc.C.SRP);F(a,olympe.auth.U.gk,!1);F(a,olympe.auth.U.Im,'');F(a,olympe.auth.U.Hm,'');F(a,olympe.auth.U.zj,'');F(a,olympe.auth.U.Em,'default');F(a,olympe.auth.U.an,3E5);E(a,olympe.auth.R.za,[olympe.la.R.Ga],b=>b.Fc('auth'));D(a,olympe.auth.R.Fi,olympe.auth.ik,new olympe.V.ma(olympe.auth.U.Em));D(a,olympe.auth.R.vj,olympe.auth.zl,olympe.jc.R.Yi,olympe.auth.R.za,olympe.auth.R.Fi);D(a,olympe.auth.R.tp,olympe.auth.Pc,olympe.auth.R.za,olympe.O.R.qj,
475
- olympe.O.R.Ok,olympe.auth.R.nj,olympe.jc.R.Yi);wa(a,olympe.auth.R.nj);E(a,olympe.auth.R.Ga,[olympe.auth.R.za,olympe.O.R.qj,olympe.auth.R.tp,olympe.host.R.Lk,olympe.host.R.Xe,olympe.host.R.sl,new olympe.V.qb(olympe.auth.R.vj,olympe.V.Fg.C.dl),new olympe.V.qb(olympe.auth.R.nj,olympe.V.Fg.C.dl),new olympe.V.ma(olympe.auth.U.yk),new olympe.V.ma(olympe.auth.U.gk),new olympe.V.ma(olympe.auth.U.Im),new olympe.V.ma(olympe.auth.U.Hm),new olympe.V.ma(olympe.auth.U.zj),new olympe.V.ma(olympe.auth.U.an)],(b,
476
- c,d,e,f,g,h,k,m,n,p,q,r,t)=>{const u=[new olympe.auth.Hc.so(d,h),new olympe.auth.Hc.SRP(b,d),new olympe.auth.Hc.SAML(d,k),new olympe.auth.Hc.No(d,k,Vc(d.Kg,olympe.O.Mb.dj))];if(!u.map(w=>w.C()).includes(m))throw Error(`Default provider name ${m} given by parameter ${olympe.auth.U.yk} cannot be found`);return new olympe.auth.Ba(b,c,d,h,k,e.ti()?e:null,f,u,g.qh(),new Map([['defaultProvider',m],['autoLogin',n],['autoUser',p],['autoPassword',q],['autoToken',r],['cacheTokenTimeout',t]]))},!0)},'olympe.auth');
477
- olympe.V.run([olympe.auth.R.Ga],a=>{olympe.auth.ge=()=>a});olympe.Na.node.auth={};olympe.Na.node.auth.Go=class{redirect(){console.warn('Redirection n/a in Node.JS')}F(){console.warn('Redirection n/a in Node.JS')}C(){console.warn('Redirection n/a in Node.JS');return''}};olympe.Na.node.auth.Go.va=[olympe.auth.pj];olympe.V.config(a=>{D(a,olympe.auth.R.nj,olympe.Na.node.auth.Go)},'olympe.native.node.auth');olympe.Na.node.jc={};olympe.Na.node.jc.vo=class{constructor(a){this.F={};this.K=a}C(a){void 0===this.F[a]&&(this.F[a]=new olympe.Na.node.jc.wo(a,this.K));return this.F[a].open()}};olympe.Na.node.jc.vo.va=[olympe.jc.ws];olympe.Na.node.jc.wo=class{constructor(a,b){this.name=a;this.K=b;this.C=!1;this.db=null}open(){if(this.C)return this;const a=require('lowdb');this.C=!0;const b=require('lowdb/adapters/Memory');this.db=a(new b);return this}close(){}get(a,b){this.C||this.open();b(this.db.get(a).value(),a)}set(a,b,c){this.C||this.open();this.db.set(a,b).write();c&&c(!0)}forEach(a,b){this.C||this.open();const c=this.db.getState();for(const [d,e]of Object.entries(c))a(e,d);b()}remove(a,b){this.C||this.open();this.db.unset(a).write();
478
- b&&b(!0)}clear(){this.C||this.open();this.db.setState({})}};olympe.Na.node.jc.wo.va=[olympe.jc.xs];olympe.V.config(function(a){D(a,olympe.jc.R.Yi,olympe.Na.node.jc.vo,olympe.jc.R.za)},'olympe.native.node.localstorage');olympe.Na.node.storage={};olympe.Na.node.storage.Storage=class{constructor(a){this.K=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Na.node.storage.Storage.va=[olympe.jc.Storage];olympe.V.config(function(a){ua(a,olympe.jc.R.vj,olympe.Na.node.storage.Storage,olympe.host.R.za)},'olympe.native.html.storage');olympe.Pf={};olympe.Pf.U={VERSION:'version.version',Wq:'version.branch',Le:'version.commit',tt:'version.tag',Kn:'version.olympe-framework',Xq:'version.build'};olympe.V.config(function(a){F(a,olympe.Pf.U.VERSION,'');F(a,olympe.Pf.U.Wq,'');F(a,olympe.Pf.U.Le,'');F(a,olympe.Pf.U.tt,'');F(a,olympe.Pf.U.Kn,'');F(a,olympe.Pf.U.Xq,'')},'olympe.main');const ie=require('fs');let za,ya;function je(a,b){ie.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
479
- function ke(){if(void 0!==za&&void 0!==ya){0===Object.keys(ya).length&&console.warn('No configuration found. Check presence of oConfig.json');0===Object.keys(za).length&&console.warn('No version found. Check presence of version.json');var a=Object.create(null);const b=process.argv;for(let c=2;c<b.length;c++){const d=/^true|false$/i,e=/^\d+(\.\d+)?$/;let f;const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(b[c]);!Array.isArray(g)||4>g.length?console.warn(`Malformed config parameter "${b[c]}" ignored. It should of the form 'a=b'`):
480
- (f=g[3],void 0===f?f=!0:f.startsWith('"')&&f.endsWith('"')?f=f.substring(1,f.length-1):d.test(f)?f='true'===f.toLowerCase():e.test(f)&&(f=parseFloat(f)),a[g[1]]=f)}a=new olympe.V.ir(a);na(a);qa(a.compile())}}function le(){console.log('The node process received a signal for graceful shutdown');let a,b;null==(b=(a=olympe.Na.node.host).Rj)||dc(b.call(a)).then(()=>{console.log('The node backend has stopped successfully');process.exit(0)}).catch(c=>process.exit(1,c))}
481
- olympe.Z.Cd('oConfig.json',je,function(a){ya=a;ke()});je('version.json',function(a){za=a;ke()});process.on('SIGTERM',le);process.on('SIGINT',le);process.on('SIGBREAK',le);process.on('SIGHUP',le);process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);le()});olympe.dc={};olympe.dc.wa={ORIGIN:'<',DESTINATION:'>'};B('olympe.dc.Direction',olympe.dc.wa);olympe.dc.mc={nd:'ff022000000000000000',Hh:'ff02200000000000000e',Li:'ff02200000000000000f'};olympe.dc.jo={VERSION:'@v',yp:'@s'};olympe.dc.Wi={Id:'?'};olympe.dc.Hz={Ly:'online',Th:'offline',qy:'invalidate'};olympe.dc.Ra={SELF:'self',SERVER:'server',Df:'remote',Th:'offline'};olympe.dc.Ob={NONE:null,vn:'ff023000000000000037',qc:'ff023000000000000137',Ef:'ff023000000000000237',lt:'ff023000000000000337'};olympe.dc.Mo=class extends Error{constructor(a){var b=olympe.dc.ta(),c=olympe.dc.Fd(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.zb(b).name():'no name'})`;super(`Trying to use an CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.Writable=class{Ec(){}hd(){}F(){}Ea(){}Xb(){}};olympe.dc.Ws=class{Od(){}W(){}G(){}};function me(a){return olympe.dc.CloudObject.get(a.tag)}olympe.dc.lc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}toJSON(){return'{ "type": "reference", "tag": '+JSON.stringify(this.tag)+' }'}Ha(a){return a instanceof olympe.dc.lc&&this.tag===a.tag}static wc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.lc(b.tag)}};olympe.dc.lc.va=[olympe.dc.pe];olympe.dc.lc.prototype.toJSON.J=olympe.D.H.C;olympe.dc.lc.prototype.Ha.J=olympe.D.H.C;olympe.dc.zr=class a{constructor(b,c,d,e,f,g){this.K=b;this.db=c;this.T=d;this.fc=e;this.P=f;this.G=g;this.C=La(new olympe.Z.xl(6E5),(h,k)=>{URL.revokeObjectURL(k);ne(this.db,h,a.C(h))})}$(b,c,d,e,f){this.da(c).then(g=>{this.ga(b,g,d,!!this.G,e,f)}).catch(g=>this.K.error(g))}F(b,c,d){const e=olympe.D.Ma().G(c),f=olympe.D.Ma().G(g=>{g=`Failed to download file ${b.X()}: ${g}`;this.K.error(g);null==d||d(g)});olympe.D.Aq([b.wq(),b.X(),b.Uk(),b.am()],(g,h,k,m)=>{if(Ja(this.C.C,h))g=this.C.get(h),this.P.C(g,
482
- e,f);else{var n=p=>{p=p instanceof Uint8Array?new Blob([p],{type:m}):p;this.G&&this.L(h,p);e(p)};g.valueOf()?(g=this.db.model(b),g=new olympe.dc.Request(olympe.dc.Request.C.Uf,olympe.dc.Fd().Ce(b),{tag:h,model:g}),this.fc.request(g).then(n).catch(f)):(g=P(k),g.G=olympe.net.Fa.ResponseType.lk,this.T.C(g,p=>{const q=p.Rc();200<=q&&300>q?n(p.getData()):f(`Failed to download file ${b}. Response code ${q}`)}))}})}ga(b,c,d,e,f,g){e=e?k=>{this.L(b,new Blob([c],{type:d}));f(k)}:f;var h=this.db.model(b);h=
483
- new olympe.dc.Request(olympe.dc.Request.C.jg,olympe.dc.Fd().Ce(b),{tag:b,model:h,content:c,mimeType:d});this.fc.request(h).then(e).catch(null!=g?g:this.K.error.bind(this.K))}da(b){return v(function*(){var c=b instanceof olympe.D.Ka?b.valueOf():b;return'string'===typeof c?(new TextEncoder).encode(c):c instanceof ArrayBuffer?new Uint8Array(c,0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}L(b,c){const d=olympe.dc.fa(b);b=URL.createObjectURL(c);this.C.set(d,
484
- b);const e=a.C(d);oe(this.db,d,f=>{f||(this.C.delete(d),ne(this.db,d,e))},e)}static C(b){return`cacheBinary${b}`}};function pe(a,b){let c=qe.get(b)||null,d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Ae(b);if(null===b)break;c=qe.get(b)||null}let e;return null!=(e=c)?e:null}olympe.dc.Sr=class{constructor(a,b,c){this.K=a;this.C=b;this.db=b.view;this.F=c;this.Oa=new FinalizationRegistry(d=>{this.K.L()&&this.K.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.C.C.Qb([d])})}};function re(a,b){a.origin=b;return a}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Ra.SELF;this.C=b;this.content=null!=c?c:null;this.F=null!=d?d:Bc(olympe.auth.ge()).ie()}getType(){return this.type}oc(){return this.F}Nb(){return this.C}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.C}; content: ${this.content}`}};
485
- olympe.dc.Request.C={Pb:1,oe:10,Rn:24,Kk:25,Cr:28,Rg:30,mj:31,ez:32,Ki:33,Xg:40,$h:41,Om:42,ip:43,Ah:45,Qm:46,Gk:47,jg:50,Uf:51,Hg:52,Bt:60,bt:61,Br:62,iy:63,ar:64,Bh:65,sn:91,Dr:93,cl:95,QUERY_RESULT:97};olympe.dc.Wh=class a{constructor(b,c,d,e,f,g,h,k){this.K=b;this.$=c;this.C=h;this.sources=new Map;this.F=this.na(k);this.G=new Map;this.ga(f,g,d,e)}request(b){this.K.debug('Router: sends',b);const c=this.P(b);return this.zb(c).request(b)}T(b,c){this.K.debug('Router: subscribes',b);const d=this.P(b);return this.zb(d).L(b,c)}ed(b){const c=b.Nb();if(c===this.C){let d;null==(d=this.G.get(b.getType()))||d.forEach(e=>e(b))}else olympe.O.qb.publish(c,b).catch(d=>{this.K.error(`Error while publishing the message ${b} to remote router: ${d}`)})}L(b,
486
- c){let d=this.G.get(b);void 0===d&&(d=[],this.G.set(b,d));d.push(c)}da(b){return this.sources.has(b)}zb(b){let c;return null!=(c=this.sources.get(b))?c:this.sources.get(olympe.dc.Ra.Df)}P(b){var c=olympe.dc.Request.C.oe,d=olympe.dc.Request.C.Kk,e=olympe.dc.Request.C.Rn,f=olympe.dc.Request.C.Ki,g=olympe.dc.Request.C.Xg;const h=olympe.dc.Request.C.Ah,k=olympe.dc.Request.C.jg,m=olympe.dc.Request.C.Hg,n=olympe.dc.Request.C.Uf;switch(b.getType()){case c:d=this.F.get(a.C.oe)||[];break;case d:case f:case e:d=
487
- this.F.get(a.C.Ys)||[];break;case g:case h:d=this.F.get(a.C.TRANSACTION)||[];break;case k:case n:case m:d=this.F.get(a.C.yr)||[];break;default:d=[]}c=b.content;e=olympe.auth.Ba.C.ke;f=olympe.auth.Ba.C.Af;g=Wd(this.$);e=!(g===e||g===f);for(var p of d){let q;d=p;f=c&&(null==(q=c)?void 0:q.W)&&c.W();g=d.get('type');if(g===a.F.Th&&e||g===a.F.Xn&&d.get('id')===f||g===a.F.Id)return p=p.get('destination'),this.K.debug('Request type',b.getType(),'with original destination',b.Nb(),'is redirected to',p),p}return b.Nb()}na(b){const c=
488
- Object.values(olympe.dc.Wh.C),d=Object.values(olympe.dc.Wh.F);b=Object.entries(b);const e=new Map;b.forEach(([f,g])=>{if(c.includes(f))if(g instanceof Array){var h=[];e.set(f,h);g.forEach(k=>{const m=k.type;if(d.includes(m)){var n=k.destinations;n instanceof Array?(n=(new Map).set('type',m).set('destinations',n),h.push(n),m===a.F.Xn&&n.set('id',k.id)):this.K.error('Routing rule',f,m,'is not valid. Destinations must be stored in an array')}else this.K.error('Routing rule',f,m,'is not valid. Valid rules are',
489
- d.toString())})}else this.K.error('Routing rule',f,'is not valid. Rules must be ordered in an array');else this.K.error('Routing rule',f,'is not valid. Valid messages are',c.toString())});return e}ga(b,c,d,e){const f=olympe.D.og();this.sources.set(olympe.dc.Ra.SERVER,e.init(this));oe(b,this.C,()=>{this.sources.set(olympe.dc.Ra.Df,d.init(this));const g=new Map;olympe.dc.ra.from(this.C,this.C).eb(olympe.dm.DataSource.yi).filter(olympe.dc.query.Ca.Ha(olympe.dm.DataSource.eh,!0)).observe(f).subscribe(h=>
490
- {var k=se(h);for(var m of k){const [p,q]=g.get(m);c.G(p);c.P(q);k=this.sources.get(m);this.sources.delete(m);var n=void 0;null==(n=k)||n.destroy()}h=te(h);for(const p of h)if(h=p.X(),!this.sources.has(h)){const q=new olympe.dc.sources.ro(this.K,p);this.sources.set(h,q);m=c.C(()=>q.healthCheck());n=c.F(()=>q.destroy());g.set(h,[m,n]);q.init(this)}});ne(b,this.C,'router',!0)},'router')}};olympe.dc.Wh.C={oe:'getContext',Ys:'query',TRANSACTION:'transaction',yr:'file'};
491
- olympe.dc.Wh.F={Id:'default',Th:'offline',Xn:'id'};olympe.dc.Oa={};const ue=olympe.dc.wa.ORIGIN,ve=olympe.dc.wa.DESTINATION,qe=new Map,we=new Map,xe=new Map,ye=new Map;function ze(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.ym||[])];return olympe.dc.ka.C(b,c,...a)}function Ae(a,b){ye.set(a,b);return a}function Be(a){return(a=qe.get(a))&&a.F||olympe.dc.CloudObject}function Ce(a,b,c){const d=a+'@'+(b===ve?ue:ve);if(we.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);we.set(d,c)}
492
- function De(a){a=a.X()+'@'+a.Pa();return we.get(a)||olympe.dc.CloudObject}function S(a,b){b.NAME=a;xe.set(a,b)}function T(a){return a.NAME||null}
493
- olympe.dc.ka=class{constructor(){}static C(a,b,...c){if(qe.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${qe.get(a).F.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.V.qb(g):g}}b=new olympe.dc.Oa.Entry(a,b,d);qe.set(a,b);return b.F.entry=b}static nc(a){return(a=a.entry)&&a.X()||null}};function Ee(a,b){a.C=b}function U(a,b){b=b.Rb();Ce(b.X(),b.Pa(),a.F);return b}function Fe(a){a.G=!0;return a}
494
- olympe.dc.Oa.Entry=class{constructor(a,b,c){this.tag=a;this.F=b;this.ym=c||null;this.C=null;this.G=!1}X(){return this.tag}instantiate(a,b){const c=this.F;if(this.gm()&&b.getParameter(olympe.dc.U.Dn)){var d=olympe.dc.ta();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.la.fb('dc').error(d)}return this.ym?(a=[void 0,a].concat(ra(b,this.ym)),new c(...a)):new c(void 0,
495
- a)}ja(a){return new olympe.dc.Oa.Property(a)}pa(a,b=olympe.dc.wa.DESTINATION){Ce(a,b,this.F);return new olympe.dc.ba.se(a,b)}gm(){return this.G}};B('olympe.dc.registry.Entry',olympe.dc.Oa.Entry);olympe.dc.Oa.Entry.prototype.addRelation=olympe.dc.Oa.Entry.prototype.pa;olympe.dc.Oa.Entry.prototype.addProperty=olympe.dc.Oa.Entry.prototype.ja;olympe.dc.Oa.Entry.va=[olympe.dc.pe];olympe.dc.Oa.Property=class{constructor(a){this.tag=a}X(){return this.tag}};olympe.dc.Oa.Property.prototype.getTag=olympe.dc.Oa.Property.prototype.X;olympe.dc.Oa.Property.va=[olympe.dc.pe];olympe.dc.Oa.Relation=class{constructor(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.fa(a);this.direction=b;this.origin=c;this.L=d}X(){return this.tag}Pa(){return this.direction}type(){return this.L}Rb(){return new olympe.dc.Oa.Relation(this.tag,this.direction===olympe.dc.wa.DESTINATION?olympe.dc.wa.ORIGIN:olympe.dc.wa.DESTINATION,this.L,this.origin)}Ha(a){return a instanceof olympe.dc.Oa.Relation?a.X()===this.X()&&a.Pa()===this.Pa():!1}toString(){return this.direction+
496
- this.tag}};olympe.dc.Oa.Relation.prototype.getInverse=olympe.dc.Oa.Relation.prototype.Rb;olympe.dc.Oa.Relation.prototype.getDirection=olympe.dc.Oa.Relation.prototype.Pa;olympe.dc.Oa.Relation.prototype.getTag=olympe.dc.Oa.Relation.prototype.X;olympe.dc.Oa.Relation.va=[olympe.dc.pe];olympe.dc.db={};function Ge(a,b){const c=a.G,d=olympe.dc.ta(),e=olympe.dc.db.Database.C.Vh,f=olympe.dc.db.Database.C.Id,g=olympe.dc.db.Database.C.ORIGIN,h=olympe.dc.db.Database.C.DESTINATION,k=new olympe.dc.db.Lc('rev-'+b.W());a.K.debug('Generate the reverse graphLayer of',b.W());b.C.forEach((m,n)=>{if(m.L()){k.F(n,olympe.dc.Ob.NONE);for(const [r,t]of m.he())k.Xb(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(m.lf())for(const r of He(d,n,m.$())){m=c.get(r);const t=new Map;m.forEach((u,w)=>{const x=w[0],y=w.substring(1);
497
- x===e?t.set(y,u):x===f?t.set(w,u):x===g?u.forEach((z,A)=>{k.Ea(y,A,r)}):x===h&&u.forEach((z,A)=>{k.Ea(y,r,A)})});m=m.source();k.Ec(r,m,t)}else{const r=new Map;for(const t of m.Cb().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?Ie(p,u,!0):p.Qa(u,!0);let w;r.set(t,null!=(w=q)?w:null)}0<r.size&&k.hd(n,r);for(const [t,u,w]of m.he())w?k.Xb(t,n,u):k.Ea(t,n,u)}}});return k}
498
- function Je(a,b,c){const d=b.W();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 Ke(b,Ge(a,b));a.C.push(d);a.F.set(d,e);a.G.pi(c);a.write(b,!1)}function Le(a,b,c){return a.C.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>e?e.dd(d):d,b)}
499
- olympe.dc.db.hr=class{constructor(a,b,c,d){this.K=a;this.G=b;this.ta=c;this.L=d;this.C=[];this.F=new Map}dd(a){const b=a.W();this.C.includes(b)?this.push(b):this.write(Le(this,a,this.C.length),!0)}push(a){const b=this.C.indexOf(a);if(-1<b){const c=this.F.get(a);this.C.splice(b,1);Le(this,c.F,b);this.F.delete(a)}}write(a,b){(new olympe.dc.db.Tp(this.K,this.G,this.ta,this.L,b)).write(a)}};
500
- function Me(a,b,c,d){const e=olympe.dc.wa.DESTINATION;c=c.tag();const f=a.C.Ge(c);b.Cb().forEach((g,h)=>{f.ja(h,g);b.ub(h)});for(const [g,h,k,m]of b.Eb()){if(!m)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Ea(g,n,p);Ne(d,g,n,p)}}function Oe(a,b,c,d){const e=olympe.dc.wa.DESTINATION,f=c.tag(),g=a.C.Ge(f);b.Cb().forEach((h,k)=>{void 0!==c.Qa(k)&&(g.ja(k,h),b.ub(k))});for(const [h,k,m]of b.he()){const n=c.qd(h,e,k);void 0!==n&&(Ne(d,h,f,k),n===m&&Ne(a.C,h,f,k))}}
501
- class Ke{constructor(a,b){this.F=a;this.C=b;this.db=olympe.dc.ta()}W(){return this.F.W()}dd(a){var b=this.F.C,c=a.C;const d=b.size>c.size,e=d?b:c;b=d?c:b;for(const [g,h]of b){b=g;var f=e.get(b);void 0!==f&&(c=d?f:h,f=d?h:f,f.lf()?c.L()||Pe(this.C,b,f.$()):c.lf()?(Me(this,f,c,a),Pe(a,b,c.$())):Oe(this,f,c,a))}return a}};const Qe=olympe.dc.mc.nd,Re=olympe.dc.mc.Hh,Se=olympe.dc.wa.ORIGIN,Te=olympe.dc.wa.DESTINATION;
502
- 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.Ra.SELF;this.K=b;this.jd=olympe.D.Ma();this.$=olympe.dc.db.Database.G.IDLE;this.ga=new Map;this.Da=[];this.P=[];this.na=new Map;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.Re.C.Ak;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.ze=new olympe.dc.db.Re(c,this,b,f);d.get('debug')&&this.ni()}W(){return this.id}getState(){return this.$}fb(){return this.K}create(b,
503
- c,d,e=!1){var f=this.G(b,!0);if(!f.e&&(null===f.G||f.G===c)){f.G=c;let g;(null==(g=f.model())?0:g.e)&&f.db.da(f,!0)}e&&f.persist();d&&this.uc(f,d);this.F(a.F.co,b)}update(b,c){c&&(b=this.G(b,!0),this.uc(b,c))}Wa(b){const c=this.get(b);void 0!==c&&(this.da(c,!1),this.F(a.F.eo,b))}link(b,c,d){c=this.G(c,!0);d=this.G(d,!0);switch(b){case Qe:Ue(c,d);break;case Re:Ve(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 Qe:We(c,d);break;case Re:Xe(c,
504
- d);break;default:c.unlink(b,d)}}ub(b){for(const c of b)Ye(this.G(c))}Qb(b){for(const c of b)(b=this.get(c))&&Ze(b)}pi(b){b.forEach(c=>{this.G(c).persist()})}qd(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.F(a.F.Bn,b))}G(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.F(a.F.An,b),c&&this.F(a.F.Bl,b));return d}Eb(b){$e(this.P[0],olympe.Z.jh(),b)}T(b){this.P[0].C.delete(b)}F(b,c,...d){this.ga.has(b)&&this.ga.get(b).forEach(e=>{e(c,...d)})}da(b,
505
- c){this.na.set(b,c)}Lf(b,c,d,e){let f;null!=(f=this.P[0])&&af(f,b).ja(e?bf+c:c,d)}ji(b,c,d,e,f){let g;null!=(g=this.P[0])&&(d===cf?f?af(g,b).link(c,e):af(g,b).unlink(c,e):f?af(g,b).Wb(c,e):af(g,b).uc(c,e))}Wb(b,c,d){let e;null!=(e=this.P[0])&&af(e,b).zd(c,d)}C(b,c){let d=this.ga.get(b);void 0===d&&(d=[],this.ga.set(b,d));d.push(c)}mb(b){this.Da.push(b)}L(b){return this.P.reduce((c,d)=>d.P.has(b)||c,!1)}ye(){this.$===a.G.IDLE&&(this.$=a.G.Uq);this.P.unshift(new olympe.dc.db.vr(this,this.jd))}zd(){this.$=
506
- a.G.Le;this.nm();df(this.P[0]);this.P.shift();0===this.P.length&&(this.$=a.G.IDLE,this.Da.forEach(b=>{b()}),ef(this.ze))}uc(b,c){const d=a.C.Id;for(const [h,k]of c)if(void 0!==k)if(h[0]===d){c=b;var e=h.substring(1),f=k;const m=ff+e;var g=c.get(m);(void 0===g?null:g)!==f&&(g=gf+e,null===f?(c.delete(m),f=(f=c.Ae())&&Ie(f,e),f=void 0===f?null:f,null!==f&&c.set(g,f),hf(c,(new Map).set(e,f))):(void 0!==c.get(g)&&c.delete(g),c.set(m,f),hf(c,(new Map).set(e,f))))}else b.update(h,k)}nm(){const b=this.P[0];
507
- for(const [c,d]of this.na)this.ac(new Set,c).filter(e=>{var f=d;const g=e.e!==f;g&&(f?(e.e=f,jf(e)):(kf(e),e.e=f),e.db.F(f?lf.Ek:lf.qc,e.C));return g}).forEach(e=>{e=e.tag();d?af(b,e).create():af(b,e).delete()});this.na.clear()}ac(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(Se+Qe)))for(const f of c.values())this.ac(b,f,d);return d}ni(){const b=a.F.Ek,c=a.F.oj,d=new Set,e=new Map;this.C(a.F.co,f=>{d.add(f)});this.C(b,f=>{d.delete(f);e.delete(f)});this.C(c,(f,...g)=>{if(g[0]===
429
+ typeof a:case 'number'===typeof a:return a}if(Array.isArray(a))return a.map(b=>this.G(b));switch(a.t){case 1:return new Date(a.d);case 2:return olympe.D.Color.create(a.r,a.g,a.b,a.a);case 3:return new Map(Object.entries(a.m).map(([b,c])=>[b,this.G(c)]));case 4:return olympe.Z.De().G(a.v).buffer;case 5:return olympe.Z.De().G(a.v);default:return Object.entries(a).reduce((b,[c,d])=>{b[c]=this.G(d);return b},{})}}};const xd=olympe.O.Response.jb.qp,yd=olympe.O.Response.jb.dk,zd=olympe.O.Response.jb.Cb,Ad=olympe.O.Response.jb.Op,Bd=olympe.O.Response.jb.ul,Cd=olympe.O.Request.jb.SEND,Dd=olympe.O.Request.jb.GET,Ed=olympe.O.Request.jb.PUBLISH,Fd=olympe.O.Request.jb.SUBSCRIBE,Gd=olympe.O.Request.jb.re,Hd=olympe.O.Request.jb.Ip;function vd(a,b){a.C||(a.C=Ka(new olympe.Z.xl(a.F.Vb+3E4),c=>{let d;null==(d=a.G)||d.call(a,c)}));a.C.add(b)}
430
+ function Id(a){let b,c;a=null!=(c=null==(b=a.td())?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.O.errors.Gp(a):Error(a)}
431
+ olympe.O.qb=class{constructor(a,b){this.F=olympe.O.lh();this.L=a;this.G=this.C=null;this.P=new olympe.D.Jb(`Service ${a}`,'function'===typeof b.F?b.F():b);this.K=olympe.la.fb(`Service ${this.L}`)}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.P.onDestroy(b);this.F.connect().then(()=>{xc(this.F,this.L,c=>{const d=new olympe.O.Ac(c,this.F,this);switch(c.getType()){case Gd:var e=d.body().filter(g=>{let h;return!(null==(h=this.C)?0:Ja(h,g))});d.gd(e).catch(g=>this.K.error('Not able to validate subscription keep alive',
432
+ g));break;case Hd:c=d.body();null==(e=this.C)||e.delete(c);let f;null==(f=this.G)||f.call(this,c);break;case Ed:a.next(d);break;default:this.F.gd(c,yd).then(()=>a.next(d))}})}).catch(c=>this.K.error('Failed to connect to the bus: '+c));return b})}Dq(a){this.G=a;return this}stop(){this.clear();this.P.destroy()}clear(){Gc(this.F,this.L).catch(b=>this.K.error('Failed to unsubscribe from '+this.L+', error: '+b));if(this.G){let b;null==(b=this.C)||b.forEach(c=>{let d;return null==(d=this.G)?void 0:d.call(this,
433
+ c)})}let a;null==(a=this.C)||a.clear()}static publish(a,b){const c=olympe.O.lh();return c.connect().then(()=>c.request(a,Ed,b)).then()}static send(a,b,c={}){const d=olympe.O.lh();return d.connect().then(()=>d.request(a,Cd,b,c.timeout)).then(e=>{switch(e.getType()){case xd:break;case zd:throw Id(e);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){const d=olympe.O.lh();return d.connect().then(()=>d.request(a,Dd,b,c.timeout)).then(e=>{switch(e.getType()){case Ad:e=
434
+ e.td();if(null!==e)return e;throw Error('No payload after request to service: '+a);case zd:throw Id(e);default:throw Error('Unsupported response type for a GET request');}})}static observe(a,b,c,d={}){const e='function'===typeof b.F?b.F():b,f=olympe.O.lh();return(new rxjs.Observable(g=>{let h=null,k=null;const m=()=>{g.complete();k&&Ic(f,a,k);h&&Gc(f,h).catch(n=>olympe.la.fb('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.$(m);f.connect().then(()=>f.request(a,Fd,c,d.timeout)).then(n=>
435
+ {switch(n.getType()){case Bd:const p=n.td();h=p.topic;xc(f,h,q=>{q.getType()===Ed?g.next(q.td()):(g.error('Unsupported notification message. It should be a publish'),m())});k=p.id;Hc(f,a,k,p.refresh,q=>g.error(q));ld(n).catch(q=>{g.error(`Was unable to ack the subscription: ${q}`);m()});break;case zd:g.error(Id(n));break;default:g.error('Unsupported response type for a SUBSCRIBE request')}}).catch(n=>g.error(n));return m})).pipe(Kc(f,d.onRetry))}};olympe.O.qb.observe=olympe.O.qb.observe;
436
+ olympe.O.qb.get=olympe.O.qb.get;olympe.O.qb.send=olympe.O.qb.send;olympe.O.qb.publish=olympe.O.qb.publish;olympe.O.qb.prototype.stop=olympe.O.qb.prototype.stop;olympe.O.qb.prototype.setUnsubscriptionHandler=olympe.O.qb.prototype.Dq;olympe.O.qb.prototype.listen=olympe.O.qb.prototype.listen;olympe.O.$d={rn:1,uf:2,Cb:3,Zf:4,Ww:5,Ui:6};olympe.O.jb={Ui:1,Bt:2,xr:3,re:5};olympe.O.cb.C={INIT:'initialize',CONNECTING:'connecting',Pe:'disconnected',Fh:'connected',cg:'reconnecting',ah:'waking',Ag:'awake',Cb:'error'};olympe.O.cb.F={Wh:1,Ar:-1,Qr:-2,ut:-3};olympe.O.cb.G={$h:0,ny:23};
437
+ olympe.O.cb.Ob={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',
438
+ 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.O.R={qj:'com.ServerManager',nk:'com.BusManager',Nk:'com.HttpManager',de:'com.Serializer',za:'com.Logger',wp:'com.Source',Jp:'com.Urls',Vy:'com.peerFileSvcUrl',Jo:'com.overloadRetryPolicy'};
439
+ olympe.O.U={wk:'defaultHost',Vg:'server.host',rj:'server.port',sj:'server.ssl',kk:'server.basePath',Rp:'server.wsPath',Fm:'server.autoConnect',jl:'server.reconnectionDelay',Po:'server.pingInterval',Qp:'server.messageTimeout',hp:'server.retryHttpOnOverload',en:'server.clientVersion',tp:'server.serverVersion',jt:'server.wakeUpService',mk:'bus.host',Sm:'bus.path',Tm:'bus.port',Ym:'bus.vhost',Wm:'bus.ssl',re:'bus.keepalive',ct:'bus.reschedulePings',ar:'bus.clientId',Zq:'bus.clean',er:'bus.connectTimeout',
440
+ Vm:'bus.shortTimeout',Um:'bus.requestTimeout',Xm:'bus.subscriptionRefreshRate',Zs:'bus.queueQoSZero',lk:'bus.allowGuest'};
441
+ olympe.V.config(function(a){F(a,olympe.O.U.wk,'object'===typeof window&&window.location&&window.location.hostname||'localhost');var b=a.getParameter(olympe.O.U.wk);F(a,olympe.O.U.Vg,b);var c=a.getParameter(olympe.O.U.Vg),d='localhost'===c;c=d||c.endsWith(a.getParameter(olympe.net.U.Zi));F(a,olympe.O.U.rj,d?8080:c?80:443);F(a,olympe.O.U.sj,!c);F(a,olympe.O.U.kk,'OlympeServer');F(a,olympe.O.U.Rp,'websocket');F(a,olympe.O.U.Fm,!0);F(a,olympe.O.U.jl,5E3);F(a,olympe.O.U.Po,5E3);F(a,olympe.O.U.Qp,15E3);
442
+ F(a,olympe.O.U.hp,5E3);F(a,olympe.O.U.tp,'7.1.3');F(a,olympe.O.U.mk,b);d=a.getParameter(olympe.O.U.mk);d=(b='localhost'===d)||d.endsWith(a.getParameter(olympe.net.U.Zi));F(a,olympe.O.U.Sm,b?'':'/mqtt');F(a,olympe.O.U.Tm,b?15675:d?80:443);F(a,olympe.O.U.Wm,!d);F(a,olympe.O.U.Ym,b?'/':'');F(a,olympe.O.U.re,30);F(a,olympe.O.U.Vm,5E3);F(a,olympe.O.U.Um,3E4);F(a,olympe.O.U.Xm,6E4);F(a,olympe.O.U.lk,!1);b=a.getParameter(olympe.Pf.U.Kn);if(void 0!==b)xa(a,b);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');
443
+ E(a,olympe.O.R.za,[olympe.la.R.Ga],f=>f.Fc('communication'));E(a,'server.WebSocketRequest',[new olympe.V.ma(olympe.O.U.Vg),new olympe.V.ma(olympe.O.U.rj),new olympe.V.ma(olympe.O.U.sj),new olympe.V.ma(olympe.O.U.kk),new olympe.V.ma(olympe.O.U.Rp)],(f,g,h,k,m)=>new olympe.net.ei(f,g,(k+'/'+m).replace(/\/+/g,'/').replace(/\/$/,''),h));E(a,'server.wakeUpRequest',[new olympe.V.ma(olympe.O.U.Vg),new olympe.V.ma(olympe.O.U.rj),new olympe.V.ma(olympe.O.U.sj),new olympe.V.ma(olympe.O.U.jt)],(f,g,h,k)=>{if(null===
444
+ k||void 0===k)return null;k=k.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.ei(f,g,k,h)});const e=Array.from(Object.values(olympe.O.Mb));E(a,olympe.O.R.Jp,[new olympe.V.ma(olympe.O.U.Vg),new olympe.V.ma(olympe.O.U.rj),new olympe.V.ma(olympe.O.U.sj),new olympe.V.ma(olympe.O.U.kk),...e.map(f=>new olympe.V.ma(f))],(f,g,h,k,...m)=>{const n=e.map((p,q)=>{q=m[q];q=(new olympe.net.Oh(f,g,`${k}${q?'/'+q:''}`.replace(/\/+/g,'/').replace(/\/$/,''),h)).C();return[p,q]});return new Map(n)});E(a,
445
+ olympe.O.R.Jo,[olympe.O.R.za],f=>({resetOnSuccess:!0,delay:(g,h)=>g instanceof olympe.O.errors.Oo?(h=Math.round(Math.random()*(h+1)*4E3),f.warn(`Service overloaded, re-send request in ${h}ms`),rxjs.timer(h)):rxjs.throwError(()=>g)}));D(a,olympe.O.R.de,olympe.O.fg);D(a,olympe.O.R.Nk,olympe.O.Fr,olympe.O.R.za,olympe.net.R.Ga,olympe.O.R.Jp,olympe.O.R.Jo);E(a,'server.ManagerConfig',[new olympe.V.ma(olympe.O.U.Fm),new olympe.V.ma(olympe.O.U.jl),new olympe.V.ma(olympe.O.U.Po),new olympe.V.ma(olympe.O.U.Qp),
446
+ new olympe.V.ma(olympe.O.U.en),new olympe.V.ma(olympe.O.U.tp),new olympe.V.ma(olympe.dc.U.Wg),new olympe.V.ma(olympe.O.U.hp)],(...f)=>{const g='autoConnect reconnectionDelay pingInterval messageTimeout clientVersion serverVersion getContextMode retryHttpOverload'.split(' '),h=new Map;f.forEach((k,m)=>h.set(g[m],k));return h});D(a,olympe.O.R.qj,olympe.O.cb,olympe.O.R.za,olympe.net.R.Ga,olympe.host.R.We,'server.WebSocketRequest','server.wakeUpRequest','server.ManagerConfig');E(a,'server.bus.ManagerConfig',
447
+ [new olympe.V.ma(olympe.O.U.Vg),new olympe.V.ma(olympe.O.U.mk),new olympe.V.ma(olympe.O.U.Sm),new olympe.V.ma(olympe.O.U.Tm),new olympe.V.ma(olympe.O.U.Ym),new olympe.V.ma(olympe.O.U.Wm),new olympe.V.ma(olympe.O.U.lk),new olympe.V.ma(olympe.O.U.Vm),new olympe.V.ma(olympe.O.U.Um),new olympe.V.ma(olympe.O.U.Xm),new olympe.V.ma(olympe.O.U.re),new olympe.V.ma(olympe.O.U.ct),new olympe.V.ma(olympe.O.U.ar),new olympe.V.ma(olympe.O.U.Zq),new olympe.V.ma(olympe.O.U.jl),new olympe.V.ma(olympe.O.U.er),new olympe.V.ma(olympe.O.U.Zs)],
448
+ (f,g,h,k,m,n,p,q,r,t,...u)=>{g=`${n?'wss://':'ws://'}${g}:${k}${h}/ws`;const w='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero shortTimeout requestTimeout'.split(' ');u=u.reduce((x,y,z)=>{x[w[z]]=y;return x},{});u.vhost=`${m||f.split('.')[0]}`;return new Map([['url',g],['connectionOptions',u],['allowGuest',p],['shortTimeout',q],['requestTimeout',r],['subscriptionsRefreshRate',t]])});D(a,olympe.O.R.nk,olympe.O.Zm,olympe.O.R.za,olympe.net.R.Ga,olympe.auth.R.Ga,
449
+ olympe.host.R.We,olympe.O.R.de,'server.bus.ManagerConfig')},'olympe.communication');olympe.V.run([olympe.O.R.nk],a=>{olympe.O.lh=()=>a});olympe.auth={};function Jd(a,b){hd(a.C);Zc(a.C,olympe.O.$d.Zf,c=>{const d=c.c;d===olympe.auth.Pc.C.Bs?(a.C.zd(),b(olympe.auth.Ba.F.Ei,c)):d===olympe.auth.Pc.C.gt&&b(olympe.auth.Ba.F.Xn,c)},'logoutHandler')}
450
+ function Kd(a,b,c){const d=null==b?void 0:b.Te();if(b instanceof olympe.auth.fj){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.Yc();h.access_token=Ld(b);g=`${Wc(a.Kg,olympe.O.Mb.dj)}/logout${d?`?idpName=${d}`:''}`;a.F.redirect(g,h)};c=a.F.C();const f=new URL(c);if(0!==f.hash.length||0!==f.search.length){const g=a.storage.C('AUTH');f.hash='';f.search='';g&&g.set('redirectTo',c,()=>{g.close();e(f.toString())})}else e(c)}else dd(a.C,olympe.O.$d.Zf,Object.assign({},{c:olympe.auth.Pc.C.Cs},
451
+ d&&{idpName:d}),c)}function Md(a,b,c,d){c.c=b;dd(a.C,olympe.O.$d.Zf,c,d)}function Nd(a,b,c){if(b.Lg()!==olympe.auth.kc.C.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'));else{var d=`?idpName=${b.Te()}&access_token=${Ld(b)}`;d=`${Wc(a.Kg,olympe.O.Mb.dj)}/refresh${d}`;Xc(a.Kg,O(d),b.Yc()).then(e=>{'string'===typeof e?(e=JSON.parse(e),e=new olympe.auth.fj(b.pc(),b.je(),b.Yc(),e,b.Te()),c(null,e)):c(null,b)}).catch(e=>c(Error(e)))}}
452
+ olympe.auth.Pc=class{constructor(a,b,c,d,e){this.K=a;this.C=b;this.Kg=c;this.F=d;this.storage=e;const f=this.storage.C('AUTH');f&&(f.get('redirectTo',g=>{g&&(f.remove('redirectTo'),f.close(),this.F.redirect(g,null,olympe.auth.pj.C.GET))}),f.close())}Vd(a){dd(this.C,olympe.O.$d.Zf,{c:olympe.auth.Pc.C.re},b=>a(b))}ug(a,b,c){const d=Wc(this.Kg,olympe.O.Mb.Lp);a=O(`${d}/${a}`);Xc(this.Kg,a,b).then(e=>c(null,e)).catch(e=>c(Error(e)))}};
453
+ olympe.auth.Pc.C={Zf:1,Cs:2,Cb:3,re:5,$h:6,Hr:10,pt:11,Lq:12,SAML:13,gt:14,Bs:20};function Mc(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.Z.kh());a.Da.set(c,b)}function Cc(a){return olympe.D.Ta(a.C.vb())}
454
+ function Od(a){a.K.info('Initializing AUTH layer');let b=a.nc;if(a.na){const c=a.na.C(),d=Lb(c.parameters);b=d||b;d&&a.na.F(c.parameters.filter(e=>'authToken'!==e.ia()))}b&&a.storage&&Pd(a.storage,b,c=>{!c&&a.K.error('Could not store authToken')});a.K.debug('Asking to be notified when auth connector gets online');bd(a.L,()=>{if(a.ub)if(a.G=olympe.auth.Ba.G.Iq,a.K.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),a.ga){const c=new olympe.auth.Request;c.set('username',
455
+ a.ga);c.set('password',a.Pb);a.K.log('Autologin with user "'+a.ga+'"');Qd(a,c)}else Rd(a,'No user specified for auto login',!0);else a.G=olympe.auth.Ba.G.zj,a.K.log('Connector online, attempting to log with token'),Sd(a)});cd(a.L,()=>{switch(olympe.D.Ta(a.F)){case olympe.auth.Ba.C.le:const c=olympe.D.Ta(a.C.vb()).pc();a.K.warn(`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ba.C.Af:a.K.warn('Disconnected from server - guest session lost');break;case olympe.auth.Ba.C.Gi:a.K.warn('Disconnected from server - authentication aborted');
456
+ break;case olympe.auth.Ba.C.INIT:a.K.warn('Cannot open auth session - no server connection');break;default:a.K.error('Should not get there, investigate')}Td(a,olympe.auth.Ba.C.Pe)});id(a.L,c=>{switch(c){case olympe.O.cb.C.ah:Td(a,olympe.auth.Ba.C.ah);break;case olympe.O.cb.C.Ag:Td(a,olympe.auth.Ba.C.Ag)}});Jd(a.P,(c,d)=>{if(c===olympe.auth.Ba.F.Ei)Rd(a,'authentication revoked'),a.storage&&Ud(a.storage),a.Da.forEach(e=>{e(c,d)});else if(c===olympe.auth.Ba.F.Xn)a.K.info('Redirection to IDP to invalidate token (SAML)'),
457
+ Cc(a),a.storage&&Ud(a.storage),a.Db.F();else throw Error(`Unknown logout step coming from server : ${c}`);});a.mb=Vd(a);a.da.F(()=>a.wi().catch(c=>a.K.error(`Failed to logout ${c}`)));a.K.log('DONE initializing AUTH layer (waiting for connector to be online)')}function Wd(a,b){let c=null;olympe.D.cm(a.F.vb().bd(olympe.auth.Ba.C.le).and(b),()=>{c=a.Ie(d=>{d&&a.K.error('Failed to refresh token when returning to active mode')})},()=>{let d;null==(d=c)||d()})}
458
+ function Sd(a){null!==a.storage?(a.K.debug('Retrieving token from local storage'),a.storage.Sd(b=>{if(b){const e=new olympe.auth.Request;var c=b.pc();e.set('username',c);c=e;var d=b.Yc();c.set('nonce',d);'string'===typeof b.Te()&&e.set('idpName',b.Te());a.K.debug('Token found, trying login with',e);Qd(a,e,olympe.auth.kc.C.el)}else Rd(a,'No token found, cannot perform auto login')})):Rd(a,'Cannot retrieve token: no storage configured, cannot perform auto login',!0)}
459
+ function Td(a,b){a.K.log('State change: ',Xd(a),'--\x3e',b);a.F.update(b)}function Rd(a,b,c=!1){a.C.update(a.$);Td(a,olympe.auth.Ba.C.Af);b=`Authenticated as guest (${b})`;c?a.K.error(b):a.K.info(b)}function Vd(a){const b=[olympe.auth.Ba.C.le];a.ub||b.push(olympe.auth.Ba.C.Af);return a.da.C(()=>{const c=Xd(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}`)})}
460
+ function Xd(a){return olympe.D.Ta(a.F.vb())}function Yd(){var a=olympe.public.Va.get();return new Map(a.L.$b)}function Zd(a,b){if(b){a.C.update(b);let c;null==(c=a.storage)||Pd(c,b);a.K.debug('Token updated')}}function $d(a,b,c,d=!1){b=b+c?':'+c.message:'';a.K.error(b);a.error.update(olympe.D.sb(b));Td(a,olympe.auth.Ba.C.Cb);if(d)throw Error(b);}
461
+ function Qd(a,b,c,d){void 0===c&&(c=a.Vb);void 0===c&&$d(a,'No authentication provider specified',null,!0);const e=a.Hc.get(c);e||$d(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.T.set('login',d);a.K.log('Sending authentication request using "'+c+'" for '+b);e.Sd(b,a.$b.bind(a));Td(a,olympe.auth.Ba.C.Gi)}function ae(a,b,c){a.T.forEach(d=>{d(b,c)})}
462
+ olympe.auth.Ba=class{constructor(a,b,c,d,e,f,g,h,k,m){this.K=a;this.L=b;this.P=c;this.storage=d;this.Db=e;this.na=f;this.Vb=m.get('defaultProvider');this.ub=!!m.get('autoLogin');this.ga=m.get('autoUser');this.Pb=m.get('autoPassword');this.nc=m.get('autoToken');this.Hc=new Map;this.da=g;this.mb='';this.F=olympe.D.cc(String).update(olympe.auth.Ba.C.INIT);this.error=olympe.D.cc(olympe.D.Ka);this.G=null;this.$=new olympe.auth.ig('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=
463
+ olympe.D.cc(olympe.auth.ig).update(this.$);this.T=new Map;this.Da=new Map;this.Wa=new olympe.Z.wl(m.get('cacheTokenTimeout'));h.forEach(n=>{const p=n.C();if(this.Hc.has(p))throw Error('Provider "'+p+'" has already been registered !');this.Hc.set(p,n)});Od(this);Wd(this,k)}getState(){return this.F.vb()}pc(){return this.C.vb().pc()}je(){return this.C.vb().je()}Ie(a){const b=Cc(this);return olympe.D.Ta(this.C)!==this.$&&b?this.Hc.get(b.Lg()).Ie(b,(c,d)=>{c?(this.K.error('Failed to refresh token, error message: ',
464
+ c.message),this.wi().catch(e=>this.K.error(`Failed to logout after wrong refresh ${e}`)),a(c)):(d&&Zd(this,d),a(null))}):null}nh(){return this.C.vb().nh()}ug(a,b){if(Ja(this.Wa.C,a))b(null,this.Wa.get(a));else{var c,d=null==(c=olympe.D.Ta(this.C.vb()))?void 0:c.Yc();this.P.ug(a,d,(e,f)=>{'string'===typeof f&&this.Wa.set(a,f);b(e,f)})}}wi(){return olympe.D.Ta(this.C)===this.$?(this.K.warn('Logout called for Guest user so it will be ignored'),Promise.resolve()):new Promise((a,b)=>{this.K.debug('Sending logout');
465
+ Ud(this.storage);Kd(this.P,Cc(this),c=>{c?($d(this,'Logout request rejected:',c),b(c)):(this.K.debug('Logout request acknowledged'),a())});this.da.G(this.mb)})}Vd(a){Xd(this)===olympe.auth.Ba.C.le&&this.P.Vd(b=>{b&&this.K.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}$b(a,b){const c=null===this.G?olympe.auth.Ba.G.Gs:this.G;this.G=null;a?(Ud(this.storage),this.error.update(olympe.D.sb(a.message)),Rd(this,'authentication rejected: '+a.message),ae(this,a,c)):(this.K.info('User '+
466
+ b.pc()+' (#'+b.je()+') successfully authenticated'),this.C.update(b),Td(this,olympe.auth.Ba.C.le),ae(this,a,c),this.storage&&Pd(this.storage,b));this.T.has('login')&&this.T.delete('login')}};olympe.auth.Ba.C={INIT:'init',ah:'waking',Ag:'awake',Pe:'disconnected',Af:'guest',Gi:'authenticating',Cb:'error',le:'authenticated'};olympe.auth.Ba.G={Gs:'manual',Iq:'auto',zj:'tokenOnFirstConnection'};olympe.auth.Ba.F={Ei:'accepted',Xn:'redirect'};olympe.auth.kc=class{C(){}Sd(){}Ie(){}};olympe.auth.kc.C={SAML:'saml',OAUTH2:'openID',SRP:'srp',el:'olympeToken'};function be(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.qc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.dh&&(a=a.Aa.xb);return a?a.valueOf():a}pc(){return this.get('username')}Yc(){return this.get('nonce')}toString(){return this.pc()+(this.Yc()?' with nonce':'')+(this.get('password')?' with password':'')+(be(this)?` with idp name ${be(this)}`:'')}};olympe.auth.ig=class{constructor(a,b,c,d={},e=null){this.L=a;this.yh=b;this.F=c;this.C=e;this.G=d}pc(){return this.L}je(){return this.yh}Yc(){return this.F}td(){return this.G}nh(){return null}Te(){return this.C}ha(){const a=olympe.Z.De(),b=Object.assign({},{user:this.L,userTag:this.yh,nonce:this.F},this.C&&{idpName:this.C},{payload:this.G});return olympe.Z.Yp(Ga(a,JSON.stringify(b)))}Lg(){return olympe.auth.kc.C.SRP}};l=olympe.auth.ig.prototype;l.pc.J=new olympe.D.H(()=>String,[]);
467
+ l.je.J=new olympe.D.H(()=>String,[]);l.Yc.J=new olympe.D.H(()=>String,[]);l.td.J=new olympe.D.H(()=>Object,[]);l.nh.J=new olympe.D.H(()=>String,[]);l.Te.J=new olympe.D.H(()=>String,[]);l.ha.J=new olympe.D.H(()=>String,[]);l.Lg.J=new olympe.D.H(()=>String,[]);function Ld(a){return a.td().access_token||null}function ce(a){return parseInt(a.td().access_token_exp||'0',10)}olympe.auth.fj=class extends olympe.auth.ig{constructor(a,b,c,d,e){super(a,b,c,d,e)}nh(){return Ld(this)}Lg(){return olympe.auth.kc.C.OAUTH2}};olympe.auth.op=class extends olympe.auth.ig{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.P=d}nh(){return this.P}Lg(){return olympe.auth.kc.C.SAML}ha(){const a=olympe.Z.De(),b=Object.assign({},{user:this.pc(),userTag:this.je(),nonce:this.Yc()},this.Te()&&{idpName:this.Te()},{payload:this.td(),fullToken:this.P});return olympe.Z.Yp(Ga(a,JSON.stringify(b)))}};function Pd(a,b,c){const d=a.C.C('AUTH');d.set(a.key,'string'===typeof b?b:b.ha(),e=>{d.close();c&&c(e)})}function Ud(a){const b=a.C.C('AUTH');b.remove(a.key,()=>b.close())}
468
+ olympe.auth.yl=class{constructor(a,b,c){this.C=a;this.K=b;this.key='OlympeToken-'+c.C}Sd(a){const b=this.C.C('AUTH');this.K.debug(`olympe.auth.TokenStorage: retrieve token with key ${this.key}`);b.get(this.key,c=>{let d=null;if(c)try{this.K.debug('olympe.auth.TokenStorage: Token retrieved successfully');var e=JSON,f=e.parse;var g=Ha(olympe.Z.De().G(olympe.Z.Xt(c)));const h=f.call(e,g);let k;h.fullToken?k=new olympe.auth.op(h.user,h.userTag,h.nonce,h.fullToken,h.payload,h.idpName):h.payload&&h.payload.id_token?
469
+ k=new olympe.auth.fj(h.user,h.userTag,h.nonce,h.payload,h.idpName):k=new olympe.auth.ig(h.user,h.userTag,h.nonce,h.payload,h.idpName);d=k}catch(h){this.K.error('Error while unserializing token: ',h.message)}else this.K.debug('olympe.auth.TokenStorage: No token found');b.close();a(d)})}};olympe.auth.yl.F='OlympeToken';olympe.auth.yl.C='AUTH';olympe.auth.pj=class{redirect(){}F(){}C(){}};olympe.auth.pj.C={GET:'GET',Pg:'POST'};olympe.auth.ik=class{constructor(a){this.C=a||'default'}};olympe.auth.Hc={};function de(a,b,c){Md(a.F,olympe.auth.Pc.C.Zf,{token:b.Yc()},(d,e)=>{if(null!==d)c(d);else switch(e.c){case olympe.auth.Pc.C.Cb:c(Error('Invalid token'));break;case olympe.auth.Pc.C.$h:d=null;if(e=e.payload){const f=e.userName,g=e.userTag,h=e.rndCook,k=e.payload,m=e.protocol;'SAML'===m?d=new olympe.auth.op(f,g,h,e.samlToken,k,be(b)):'openid'===m&&(d=new olympe.auth.fj(f,g,h,k,be(b)))}c(null,d);break;default:c(Error('Unknown response from server'))}})}
470
+ olympe.auth.Hc.qo=class{constructor(a,b){this.F=a;this.storage=b}C(){return olympe.auth.kc.C.el}Sd(a,b){this.storage.Sd(c=>{de(this,a,(d,e)=>{b(d,e||c)})})}Ie(a,b){this.F.Vd(b);return null}};olympe.auth.Hc.qo.va=[olympe.auth.kc];function ee(a,b,c){const d=1E3*ce(b)-Date.now()-6E4;if(0<d)return setTimeout(()=>{fe(a,b,c)},d);fe(a,b,c);return null}function fe(a,b,c){Nd(a.L,b,(d,e)=>{d?c(d):e&&(c(null,e),a.F=ee(a,e,c))})}
471
+ olympe.auth.Hc.Lo=class{constructor(a,b,c){this.G=b;this.L=a;this.P=c;this.F=null}C(){return olympe.auth.kc.C.OAUTH2}Sd(a){const b=encodeURIComponent(this.G.C());a=be(a)?`idpName=${be(a)}&`:'';this.G.redirect(`${this.P}/auth?${a}url=${b}`,null,olympe.auth.pj.C.GET)}Ie(a,b){0<ce(a)?this.F=ee(this,a,b):b(null,a);return this.T.bind(this)}T(){this.F&&clearTimeout(this.F)}};olympe.auth.Hc.Lo.va=[olympe.auth.kc];function ge(a,b){Md(a.F,olympe.auth.Pc.C.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.Hc.SAML=class{constructor(a,b){this.F=a;this.G=b}C(){return olympe.auth.kc.C.SAML}Ie(a,b){this.F.Vd(b);return null}Sd(a,b){ge(this,c=>{c?b(c):this.G.F(be(a))})}};olympe.auth.Hc.SAML.va=[olympe.auth.kc];function he(a,b,c){const d=olympe.auth.Pc.C.Hr,e=olympe.auth.Pc.C.Cb,f=olympe.auth.Pc.C.pt,g={I:b.pc()};Md(a.F,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.pc()}' 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'))}})}
472
+ function ie(a,b,c){const d=olympe.auth.Pc.C.Lq,e=olympe.auth.Pc.C.Cb,f=olympe.auth.Pc.C.$h;b={A:b.get('a'),M:b.get('m1'),I:b.pc()};Md(a.F,d,b,(g,h)=>{if(null!==g)c(g);else switch(h.c){case e:a.K.debug('Login failed, invalid username or password');c(Error('Invalid username or password'));break;case f:g=h.payload;a.K.debug('Login successful, creating token');h=g.payload?JSON.parse(g.payload):void 0;c(null,new olympe.auth.ig(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`))}})}
473
+ olympe.auth.Hc.SRP=class{constructor(a,b){this.F=b;this.K=a}C(){return olympe.auth.kc.C.SRP}Sd(a,b){const c=a.get('password');a.C.delete('password');this.K.debug('Sending SRP request');he(this,a,(d,e,f)=>{this.K.debug('Received Salt+B message');if(d)b(d);else{try{const g=new SRPClient;g.step1(a.pc(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g);return}this.K.debug('Sending SRP A+M (proof) message');ie(this,a,b)}})}Ie(a,b){this.F.Vd(b);return null}};olympe.auth.Hc.SRP.va=[olympe.auth.kc];olympe.auth.R={Ga:'auth.Manager',za:'auth.Logger',vj:'auth.Storage',Fi:'auth.appNameToken',nj:'auth.Redirector',rp:'auth.ServerConnector'};olympe.auth.U={xk:'auth.defaultProvider',gk:'auth.autoLogin',Hm:'auth.autoUser',Gm:'auth.autoPassword',zj:'auth.token',Dm:'auth.appToken',an:'auth.cacheTokenTimeout'};
474
+ olympe.V.config(function(a){F(a,olympe.auth.U.xk,olympe.auth.kc.C.SRP);F(a,olympe.auth.U.gk,!1);F(a,olympe.auth.U.Hm,'');F(a,olympe.auth.U.Gm,'');F(a,olympe.auth.U.zj,'');F(a,olympe.auth.U.Dm,'default');F(a,olympe.auth.U.an,3E5);E(a,olympe.auth.R.za,[olympe.la.R.Ga],b=>b.Fc('auth'));D(a,olympe.auth.R.Fi,olympe.auth.ik,new olympe.V.ma(olympe.auth.U.Dm));D(a,olympe.auth.R.vj,olympe.auth.yl,olympe.jc.R.Yi,olympe.auth.R.za,olympe.auth.R.Fi);D(a,olympe.auth.R.rp,olympe.auth.Pc,olympe.auth.R.za,olympe.O.R.qj,
475
+ olympe.O.R.Nk,olympe.auth.R.nj,olympe.jc.R.Yi);wa(a,olympe.auth.R.nj);E(a,olympe.auth.R.Ga,[olympe.auth.R.za,olympe.O.R.qj,olympe.auth.R.rp,olympe.host.R.Kk,olympe.host.R.We,olympe.host.R.rl,new olympe.V.qb(olympe.auth.R.vj,olympe.V.Fg.C.cl),new olympe.V.qb(olympe.auth.R.nj,olympe.V.Fg.C.cl),new olympe.V.ma(olympe.auth.U.xk),new olympe.V.ma(olympe.auth.U.gk),new olympe.V.ma(olympe.auth.U.Hm),new olympe.V.ma(olympe.auth.U.Gm),new olympe.V.ma(olympe.auth.U.zj),new olympe.V.ma(olympe.auth.U.an)],(b,
476
+ c,d,e,f,g,h,k,m,n,p,q,r,t)=>{const u=[new olympe.auth.Hc.qo(d,h),new olympe.auth.Hc.SRP(b,d),new olympe.auth.Hc.SAML(d,k),new olympe.auth.Hc.Lo(d,k,Wc(d.Kg,olympe.O.Mb.dj))];if(!u.map(w=>w.C()).includes(m))throw Error(`Default provider name ${m} given by parameter ${olympe.auth.U.xk} cannot be found`);return new olympe.auth.Ba(b,c,d,h,k,e.ti()?e:null,f,u,g.rh(),new Map([['defaultProvider',m],['autoLogin',n],['autoUser',p],['autoPassword',q],['autoToken',r],['cacheTokenTimeout',t]]))},!0)},'olympe.auth');
477
+ olympe.V.run([olympe.auth.R.Ga],a=>{olympe.auth.he=()=>a});olympe.Na.node.auth={};olympe.Na.node.auth.Eo=class{redirect(){console.warn('Redirection n/a in Node.JS')}F(){console.warn('Redirection n/a in Node.JS')}C(){console.warn('Redirection n/a in Node.JS');return''}};olympe.Na.node.auth.Eo.va=[olympe.auth.pj];olympe.V.config(a=>{D(a,olympe.auth.R.nj,olympe.Na.node.auth.Eo)},'olympe.native.node.auth');olympe.Na.node.jc={};olympe.Na.node.jc.so=class{constructor(a){this.F={};this.K=a}C(a){void 0===this.F[a]&&(this.F[a]=new olympe.Na.node.jc.uo(a,this.K));return this.F[a].open()}};olympe.Na.node.jc.so.va=[olympe.jc.ws];olympe.Na.node.jc.uo=class{constructor(a,b){this.name=a;this.K=b;this.C=!1;this.db=null}open(){if(this.C)return this;const a=require('lowdb');this.C=!0;const b=require('lowdb/adapters/Memory');this.db=a(new b);return this}close(){}get(a,b){this.C||this.open();b(this.db.get(a).value(),a)}set(a,b,c){this.C||this.open();this.db.set(a,b).write();c&&c(!0)}forEach(a,b){this.C||this.open();const c=this.db.getState();for(const [d,e]of Object.entries(c))a(e,d);b()}remove(a,b){this.C||this.open();this.db.unset(a).write();
478
+ b&&b(!0)}clear(){this.C||this.open();this.db.setState({})}};olympe.Na.node.jc.uo.va=[olympe.jc.xs];olympe.V.config(function(a){D(a,olympe.jc.R.Yi,olympe.Na.node.jc.so,olympe.jc.R.za)},'olympe.native.node.localstorage');olympe.Na.node.storage={};olympe.Na.node.storage.Storage=class{constructor(a){this.K=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Na.node.storage.Storage.va=[olympe.jc.Storage];olympe.V.config(function(a){ua(a,olympe.jc.R.vj,olympe.Na.node.storage.Storage,olympe.host.R.za)},'olympe.native.html.storage');olympe.Pf={};olympe.Pf.U={VERSION:'version.version',Vq:'version.branch',Le:'version.commit',tt:'version.tag',Kn:'version.olympe-framework',Wq:'version.build'};olympe.V.config(function(a){F(a,olympe.Pf.U.VERSION,'');F(a,olympe.Pf.U.Vq,'');F(a,olympe.Pf.U.Le,'');F(a,olympe.Pf.U.tt,'');F(a,olympe.Pf.U.Kn,'');F(a,olympe.Pf.U.Wq,'')},'olympe.main');const je=require('fs');let za,ya;function ke(a,b){je.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
479
+ function le(){if(void 0!==za&&void 0!==ya){0===Object.keys(ya).length&&console.warn('No configuration found. Check presence of oConfig.json');0===Object.keys(za).length&&console.warn('No version found. Check presence of version.json');var a=Object.create(null);const b=process.argv;for(let c=2;c<b.length;c++){const d=/^true|false$/i,e=/^\d+(\.\d+)?$/;let f;const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(b[c]);!Array.isArray(g)||4>g.length?console.warn(`Malformed config parameter "${b[c]}" ignored. It should of the form 'a=b'`):
480
+ (f=g[3],void 0===f?f=!0:f.startsWith('"')&&f.endsWith('"')?f=f.substring(1,f.length-1):d.test(f)?f='true'===f.toLowerCase():e.test(f)&&(f=parseFloat(f)),a[g[1]]=f)}a=new olympe.V.ir(a);na(a);qa(a.compile())}}function me(){console.log('The node process received a signal for graceful shutdown');let a,b;null==(b=(a=olympe.Na.node.host).Rj)||ec(b.call(a)).then(()=>{console.log('The node backend has stopped successfully');process.exit(0)}).catch(c=>process.exit(1,c))}
481
+ olympe.Z.ge('oConfig.json',ke,function(a){ya=a;le()});ke('version.json',function(a){za=a;le()});process.on('SIGTERM',me);process.on('SIGINT',me);process.on('SIGBREAK',me);process.on('SIGHUP',me);process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);me()});olympe.dc={};olympe.dc.wa={ORIGIN:'<',DESTINATION:'>'};B('olympe.dc.Direction',olympe.dc.wa);olympe.dc.mc={nd:'ff022000000000000000',Jh:'ff02200000000000000e',Li:'ff02200000000000000f'};olympe.dc.ho={VERSION:'@v',wp:'@s'};olympe.dc.Wi={Hd:'?'};olympe.dc.Fz={Jy:'online',Vh:'offline',oy:'invalidate'};olympe.dc.Ra={SELF:'self',SERVER:'server',Ef:'remote',Vh:'offline'};olympe.dc.Nb={NONE:null,vn:'ff023000000000000037',rc:'ff023000000000000137',Ff:'ff023000000000000237',lt:'ff023000000000000337'};olympe.dc.Ko=class extends Error{constructor(a){var b=olympe.dc.ta(),c=olympe.dc.Ed(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.Gb(b).name():'no name'})`;super(`Trying to use an CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.Writable=class{Ec(){}jd(){}F(){}Ea(){}Wb(){}};olympe.dc.Ws=class{Nd(){}W(){}G(){}};function ne(a){return olympe.dc.CloudObject.get(a.tag)}olympe.dc.lc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}toJSON(){return'{ "type": "reference", "tag": '+JSON.stringify(this.tag)+' }'}Ha(a){return a instanceof olympe.dc.lc&&this.tag===a.tag}static xc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.lc(b.tag)}};olympe.dc.lc.va=[olympe.dc.qe];olympe.dc.lc.prototype.toJSON.J=olympe.D.H.C;olympe.dc.lc.prototype.Ha.J=olympe.D.H.C;olympe.dc.zr=class a{constructor(b,c,d,e,f,g){this.K=b;this.db=c;this.T=d;this.ec=e;this.P=f;this.G=g;this.C=La(new olympe.Z.wl(6E5),(h,k)=>{URL.revokeObjectURL(k);oe(this.db,h,a.C(h))})}$(b,c,d,e,f){this.da(c).then(g=>{this.ga(b,g,d,!!this.G,e,f)}).catch(g=>this.K.error(g))}F(b,c,d){const e=olympe.D.Ma().G(c),f=olympe.D.Ma().G(g=>{g=`Failed to download file ${b.X()}: ${g}`;this.K.error(g);null==d||d(g)});olympe.D.zq([b.vq(),b.X(),b.Tk(),b.$l()],(g,h,k,m)=>{if(Ja(this.C.C,h))g=this.C.get(h),this.P.C(g,
482
+ e,f);else{var n=p=>{p=p instanceof Uint8Array?new Blob([p],{type:m}):p;this.G&&this.L(h,p);e(p)};g.valueOf()?(g=this.db.model(b),g=new olympe.dc.Request(olympe.dc.Request.C.Uf,olympe.dc.Ed().Ce(b),{tag:h,model:g}),this.ec.request(g).then(n).catch(f)):(g=O(k),g.G=olympe.net.Fa.ResponseType.Om,this.T.C(g,p=>{const q=p.Rc();200<=q&&300>q?n(p.getData()):f(`Failed to download file ${b}. Response code ${q}`)}))}})}ga(b,c,d,e,f,g){e=e?k=>{this.L(b,new Blob([c],{type:d}));f(k)}:f;var h=this.db.model(b);h=
483
+ new olympe.dc.Request(olympe.dc.Request.C.jg,olympe.dc.Ed().Ce(b),{tag:b,model:h,content:c,mimeType:d});this.ec.request(h).then(e).catch(null!=g?g:this.K.error.bind(this.K))}da(b){return v(function*(){var c=b instanceof olympe.D.Ka?b.valueOf():b;return'string'===typeof c?(new TextEncoder).encode(c):c instanceof ArrayBuffer?new Uint8Array(c,0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}L(b,c){const d=olympe.dc.fa(b);b=URL.createObjectURL(c);this.C.set(d,
484
+ b);const e=a.C(d);pe(this.db,d,f=>{f||(this.C.delete(d),oe(this.db,d,e))},e)}static C(b){return`cacheBinary${b}`}};function qe(a,b){let c=re.get(b)||null,d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Ae(b);if(null===b)break;c=re.get(b)||null}let e;return null!=(e=c)?e:null}olympe.dc.Sr=class{constructor(a,b,c){this.K=a;this.C=b;this.db=b.view;this.F=c;this.Oa=new FinalizationRegistry(d=>{this.K.L()&&this.K.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.C.C.Pb([d])})}};function se(a,b){a.origin=b;return a}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Ra.SELF;this.C=b;this.content=null!=c?c:null;this.F=null!=d?d:Cc(olympe.auth.he()).je()}getType(){return this.type}pc(){return this.F}fc(){return this.C}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.C}; content: ${this.content}`}};
485
+ olympe.dc.Request.C={Ob:1,pe:10,Rn:24,Jk:25,Cr:28,Rg:30,mj:31,cz:32,Ki:33,Xg:40,Yg:41,Nm:42,gp:43,Ch:45,Qm:46,Fk:47,jg:50,Uf:51,Hg:52,At:60,bt:61,Br:62,gy:63,$q:64,Dh:65,sn:91,Dr:93,bl:95,QUERY_RESULT:97};olympe.dc.Yh=class a{constructor(b,c,d,e,f,g,h,k){this.K=b;this.$=c;this.C=h;this.sources=new Map;this.F=this.na(k);this.G=new Map;this.ga(f,g,d,e)}request(b){this.K.debug('Router: sends',b);const c=this.P(b);return this.Gb(c).request(b)}T(b,c){this.K.debug('Router: subscribes',b);const d=this.P(b);return this.Gb(d).L(b,c)}gd(b){const c=b.fc();if(c===this.C){let d;null==(d=this.G.get(b.getType()))||d.forEach(e=>e(b))}else olympe.O.qb.publish(c,b).catch(d=>{this.K.error(`Error while publishing the message ${b} to remote router: ${d}`)})}L(b,
486
+ c){let d=this.G.get(b);void 0===d&&(d=[],this.G.set(b,d));d.push(c)}da(b){return this.sources.has(b)}Gb(b){let c;return null!=(c=this.sources.get(b))?c:this.sources.get(olympe.dc.Ra.Ef)}P(b){var c=olympe.dc.Request.C.pe,d=olympe.dc.Request.C.Jk,e=olympe.dc.Request.C.Rn,f=olympe.dc.Request.C.Ki,g=olympe.dc.Request.C.Xg;const h=olympe.dc.Request.C.Ch,k=olympe.dc.Request.C.jg,m=olympe.dc.Request.C.Hg,n=olympe.dc.Request.C.Uf;switch(b.getType()){case c:d=this.F.get(a.C.pe)||[];break;case d:case f:case e:d=
487
+ this.F.get(a.C.Ys)||[];break;case g:case h:d=this.F.get(a.C.TRANSACTION)||[];break;case k:case n:case m:d=this.F.get(a.C.yr)||[];break;default:d=[]}c=b.content;e=olympe.auth.Ba.C.le;f=olympe.auth.Ba.C.Af;g=Xd(this.$);e=!(g===e||g===f);for(var p of d){let q;d=p;f=c&&(null==(q=c)?void 0:q.W)&&c.W();g=d.get('type');if(g===a.F.Vh&&e||g===a.F.Wn&&d.get('id')===f||g===a.F.Hd)return p=p.get('destination'),this.K.debug('Request type',b.getType(),'with original destination',b.fc(),'is redirected to',p),p}return b.fc()}na(b){const c=
488
+ Object.values(olympe.dc.Yh.C),d=Object.values(olympe.dc.Yh.F);b=Object.entries(b);const e=new Map;b.forEach(([f,g])=>{if(c.includes(f))if(g instanceof Array){var h=[];e.set(f,h);g.forEach(k=>{const m=k.type;if(d.includes(m)){var n=k.destinations;n instanceof Array?(n=(new Map).set('type',m).set('destinations',n),h.push(n),m===a.F.Wn&&n.set('id',k.id)):this.K.error('Routing rule',f,m,'is not valid. Destinations must be stored in an array')}else this.K.error('Routing rule',f,m,'is not valid. Valid rules are',
489
+ d.toString())})}else this.K.error('Routing rule',f,'is not valid. Rules must be ordered in an array');else this.K.error('Routing rule',f,'is not valid. Valid messages are',c.toString())});return e}ga(b,c,d,e){const f=olympe.D.og();this.sources.set(olympe.dc.Ra.SERVER,e.init(this));pe(b,this.C,()=>{this.sources.set(olympe.dc.Ra.Ef,d.init(this));const g=new Map;olympe.dc.ra.from(this.C,this.C).eb(olympe.dm.DataSource.yi).filter(olympe.dc.query.Ca.Ha(olympe.dm.DataSource.fh,!0)).observe(f).subscribe(h=>
490
+ {var k=te(h);for(var m of k){const [p,q]=g.get(m);c.G(p);c.P(q);k=this.sources.get(m);this.sources.delete(m);var n=void 0;null==(n=k)||n.destroy()}h=ue(h);for(const p of h)if(h=p.X(),!this.sources.has(h)){const q=new olympe.dc.sources.po(this.K,p);this.sources.set(h,q);m=c.C(()=>q.healthCheck());n=c.F(()=>q.destroy());g.set(h,[m,n]);q.init(this)}});oe(b,this.C,'router',!0)},'router')}};olympe.dc.Yh.C={pe:'getContext',Ys:'query',TRANSACTION:'transaction',yr:'file'};
491
+ olympe.dc.Yh.F={Hd:'default',Vh:'offline',Wn:'id'};olympe.dc.Oa={};const ve=olympe.dc.wa.ORIGIN,we=olympe.dc.wa.DESTINATION,re=new Map,xe=new Map,ye=new Map,ze=new Map;function Ae(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.xm||[])];return olympe.dc.ka.C(b,c,...a)}function R(a,b){ze.set(a,b);return a}function Be(a){return(a=re.get(a))&&a.F||olympe.dc.CloudObject}function Ce(a,b,c){const d=a+'@'+(b===we?ve:we);if(xe.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);xe.set(d,c)}
492
+ function De(a){a=a.X()+'@'+a.Pa();return xe.get(a)||olympe.dc.CloudObject}function S(a,b){b.NAME=a;ye.set(a,b)}function T(a){return a.NAME||null}
493
+ olympe.dc.ka=class{constructor(){}static C(a,b,...c){if(re.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${re.get(a).F.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.V.qb(g):g}}b=new olympe.dc.Oa.Entry(a,b,d);re.set(a,b);return b.F.entry=b}static oc(a){return(a=a.entry)&&a.X()||null}};function Ee(a,b){a.C=b}function U(a,b){b=b.Qb();Ce(b.X(),b.Pa(),a.F);return b}function Fe(a){a.G=!0;return a}
494
+ olympe.dc.Oa.Entry=class{constructor(a,b,c){this.tag=a;this.F=b;this.xm=c||null;this.C=null;this.G=!1}X(){return this.tag}instantiate(a,b){const c=this.F;if(this.fm()&&b.getParameter(olympe.dc.U.Dn)){var d=olympe.dc.ta();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.la.fb('dc').error(d)}return this.xm?(a=[void 0,a].concat(ra(b,this.xm)),new c(...a)):new c(void 0,
495
+ a)}ja(a){return new olympe.dc.Oa.Property(a)}pa(a,b=olympe.dc.wa.DESTINATION){Ce(a,b,this.F);return new olympe.dc.ba.te(a,b)}fm(){return this.G}};B('olympe.dc.registry.Entry',olympe.dc.Oa.Entry);olympe.dc.Oa.Entry.prototype.addRelation=olympe.dc.Oa.Entry.prototype.pa;olympe.dc.Oa.Entry.prototype.addProperty=olympe.dc.Oa.Entry.prototype.ja;olympe.dc.Oa.Entry.va=[olympe.dc.qe];olympe.dc.Oa.Property=class{constructor(a){this.tag=a}X(){return this.tag}};olympe.dc.Oa.Property.prototype.getTag=olympe.dc.Oa.Property.prototype.X;olympe.dc.Oa.Property.va=[olympe.dc.qe];olympe.dc.Oa.Relation=class{constructor(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.fa(a);this.direction=b;this.origin=c;this.L=d}X(){return this.tag}Pa(){return this.direction}type(){return this.L}Qb(){return new olympe.dc.Oa.Relation(this.tag,this.direction===olympe.dc.wa.DESTINATION?olympe.dc.wa.ORIGIN:olympe.dc.wa.DESTINATION,this.L,this.origin)}Ha(a){return a instanceof olympe.dc.Oa.Relation?a.X()===this.X()&&a.Pa()===this.Pa():!1}toString(){return this.direction+
496
+ this.tag}};olympe.dc.Oa.Relation.prototype.getInverse=olympe.dc.Oa.Relation.prototype.Qb;olympe.dc.Oa.Relation.prototype.getDirection=olympe.dc.Oa.Relation.prototype.Pa;olympe.dc.Oa.Relation.prototype.getTag=olympe.dc.Oa.Relation.prototype.X;olympe.dc.Oa.Relation.va=[olympe.dc.qe];olympe.dc.db={};function Ge(a,b){const c=a.G,d=olympe.dc.ta(),e=olympe.dc.db.Database.C.Xh,f=olympe.dc.db.Database.C.Hd,g=olympe.dc.db.Database.C.ORIGIN,h=olympe.dc.db.Database.C.DESTINATION,k=new olympe.dc.db.Lc('rev-'+b.W());a.K.debug('Generate the reverse graphLayer of',b.W());b.C.forEach((m,n)=>{if(m.L()){k.F(n,olympe.dc.Nb.NONE);for(const [r,t]of m.ie())k.Wb(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(m.lf())for(const r of He(d,n,m.$())){m=c.get(r);const t=new Map;m.forEach((u,w)=>{const x=w[0],y=w.substring(1);
497
+ x===e?t.set(y,u):x===f?t.set(w,u):x===g?u.forEach((z,A)=>{k.Ea(y,A,r)}):x===h&&u.forEach((z,A)=>{k.Ea(y,r,A)})});m=m.source();k.Ec(r,m,t)}else{const r=new Map;for(const t of m.Bb().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?Ie(p,u,!0):p.Qa(u,!0);let w;r.set(t,null!=(w=q)?w:null)}0<r.size&&k.jd(n,r);for(const [t,u,w]of m.ie())w?k.Wb(t,n,u):k.Ea(t,n,u)}}});return k}
498
+ function Je(a,b,c){const d=b.W();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 Ke(b,Ge(a,b));a.C.push(d);a.F.set(d,e);a.G.ri(c);a.write(b,!1)}function Le(a,b,c){return a.C.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>e?e.ed(d):d,b)}
499
+ olympe.dc.db.hr=class{constructor(a,b,c,d){this.K=a;this.G=b;this.ta=c;this.L=d;this.C=[];this.F=new Map}ed(a){const b=a.W();this.C.includes(b)?this.push(b):this.write(Le(this,a,this.C.length),!0)}push(a){const b=this.C.indexOf(a);if(-1<b){const c=this.F.get(a);this.C.splice(b,1);Le(this,c.F,b);this.F.delete(a)}}write(a,b){(new olympe.dc.db.Sp(this.K,this.G,this.ta,this.L,b)).write(a)}};
500
+ function Me(a,b,c,d){const e=olympe.dc.wa.DESTINATION;c=c.tag();const f=a.C.Ge(c);b.Bb().forEach((g,h)=>{f.ja(h,g);b.ub(h)});for(const [g,h,k,m]of b.Db()){if(!m)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Ea(g,n,p);Ne(d,g,n,p)}}function Oe(a,b,c,d){const e=olympe.dc.wa.DESTINATION,f=c.tag(),g=a.C.Ge(f);b.Bb().forEach((h,k)=>{void 0!==c.Qa(k)&&(g.ja(k,h),b.ub(k))});for(const [h,k,m]of b.ie()){const n=c.qd(h,e,k);void 0!==n&&(Ne(d,h,f,k),n===m&&Ne(a.C,h,f,k))}}
501
+ class Ke{constructor(a,b){this.F=a;this.C=b;this.db=olympe.dc.ta()}W(){return this.F.W()}ed(a){var b=this.F.C,c=a.C;const d=b.size>c.size,e=d?b:c;b=d?c:b;for(const [g,h]of b){b=g;var f=e.get(b);void 0!==f&&(c=d?f:h,f=d?h:f,f.lf()?c.L()||Pe(this.C,b,f.$()):c.lf()?(Me(this,f,c,a),Pe(a,b,c.$())):Oe(this,f,c,a))}return a}};const Qe=olympe.dc.mc.nd,Re=olympe.dc.mc.Jh,Se=olympe.dc.wa.ORIGIN,Te=olympe.dc.wa.DESTINATION;
502
+ 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.Ra.SELF;this.K=b;this.ud=olympe.D.Ma();this.$=olympe.dc.db.Database.G.IDLE;this.ga=new Map;this.Da=[];this.P=[];this.na=new Map;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.Re.C.zk;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.ze=new olympe.dc.db.Re(c,this,b,f);d.get('debug')&&this.oi()}W(){return this.id}getState(){return this.$}fb(){return this.K}create(b,
503
+ c,d,e=!1){var f=this.G(b,!0);if(!f.e&&(null===f.G||f.G===c)){f.G=c;let g;(null==(g=f.model())?0:g.e)&&f.db.da(f,!0)}e&&f.persist();d&&this.nc(f,d);this.F(a.F.ao,b)}update(b,c){c&&(b=this.G(b,!0),this.nc(b,c))}Wa(b){const c=this.get(b);void 0!==c&&(this.da(c,!1),this.F(a.F.bo,b))}link(b,c,d){c=this.G(c,!0);d=this.G(d,!0);switch(b){case Qe:Ue(c,d);break;case Re:Ve(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 Qe:We(c,d);break;case Re:Xe(c,
504
+ d);break;default:c.unlink(b,d)}}ub(b){for(const c of b)Ye(this.G(c))}Pb(b){for(const c of b)(b=this.get(c))&&Ze(b)}ri(b){b.forEach(c=>{this.G(c).persist()})}qd(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.F(a.F.Bn,b))}G(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.F(a.F.An,b),c&&this.F(a.F.Al,b));return d}Db(b){$e(this.P[0],olympe.Z.kh(),b)}T(b){this.P[0].C.delete(b)}F(b,c,...d){this.ga.has(b)&&this.ga.get(b).forEach(e=>{e(c,...d)})}da(b,
505
+ c){this.na.set(b,c)}df(b,c,d,e){let f;null!=(f=this.P[0])&&af(f,b).ja(e?bf+c:c,d)}ki(b,c,d,e,f){let g;null!=(g=this.P[0])&&(d===cf?f?af(g,b).link(c,e):af(g,b).unlink(c,e):f?af(g,b).Vb(c,e):af(g,b).nc(c,e))}Vb(b,c,d){let e;null!=(e=this.P[0])&&af(e,b).zd(c,d)}C(b,c){let d=this.ga.get(b);void 0===d&&(d=[],this.ga.set(b,d));d.push(c)}mb(b){this.Da.push(b)}L(b){return this.P.reduce((c,d)=>d.P.has(b)||c,!1)}ye(){this.$===a.G.IDLE&&(this.$=a.G.Tq);this.P.unshift(new olympe.dc.db.vr(this,this.ud))}zd(){this.$=
506
+ a.G.Le;this.mm();df(this.P[0]);this.P.shift();0===this.P.length&&(this.$=a.G.IDLE,this.Da.forEach(b=>{b()}),ef(this.ze))}nc(b,c){const d=a.C.Hd;for(const [h,k]of c)if(void 0!==k)if(h[0]===d){c=b;var e=h.substring(1),f=k;const m=ff+e;var g=c.get(m);(void 0===g?null:g)!==f&&(g=gf+e,null===f?(c.delete(m),f=(f=c.Ae())&&Ie(f,e),f=void 0===f?null:f,null!==f&&c.set(g,f),hf(c,(new Map).set(e,f))):(void 0!==c.get(g)&&c.delete(g),c.set(m,f),hf(c,(new Map).set(e,f))))}else b.update(h,k)}mm(){const b=this.P[0];
507
+ for(const [c,d]of this.na)this.$b(new Set,c).filter(e=>{var f=d;const g=e.e!==f;g&&(f?(e.e=f,jf(e)):(kf(e),e.e=f),e.db.F(f?lf.Dk:lf.rc,e.C));return g}).forEach(e=>{e=e.tag();d?af(b,e).create():af(b,e).delete()});this.na.clear()}$b(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(Se+Qe)))for(const f of c.values())this.$b(b,f,d);return d}oi(){const b=a.F.Dk,c=a.F.oj,d=new Set,e=new Map;this.C(a.F.ao,f=>{d.add(f)});this.C(b,f=>{d.delete(f);e.delete(f)});this.C(c,(f,...g)=>{if(g[0]===
508
508
  Re&&g[1]===Te){const h=g[2];this.get(h).Ia()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.mb(()=>{d.forEach(f=>{const g=this.get(f);g&&null===g.model()&&this.K.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.K.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()}`)});
509
- e.clear()})}};olympe.dc.db.Database.C={Vh:'$',Mr:'~',Id:'?',ek:'=',Zn:'|',bn:'@',ORIGIN:olympe.dc.wa.ORIGIN,DESTINATION:olympe.dc.wa.DESTINATION};olympe.dc.db.Database.F={An:0,Bn:1,Lp:2,Bl:3,cn:4,dn:5,Ek:6,qc:7,oj:8,ll:9,co:10,eo:11,bp:12};olympe.dc.db.Database.G={IDLE:0,Uq:1,Le:2};function mf(a,b,c=[]){const d=b.W();Je(a.F,b,c);return e=>{if(e)a.F.push(d);else{e=a.F;const f=e.F.get(d);if(void 0!==f){const g=e.C.indexOf(d);e.C.splice(g,1);e.write(Le(e,f.C,e.C.length),!1);e.F.delete(d)}}}}function nf(a,b){a.C.mb(b)}olympe.dc.db.rr=class{constructor(a,b,c,d,e){this.K=a;this.C=b;this.view=c;this.F=new olympe.dc.db.hr(a,b,c,d);this.Tv=new olympe.dc.db.Js(a,c,b,e)}fb(){return this.K}dd(a){this.F.dd(a)}};const of=olympe.dc.db.Database.C.ORIGIN,pf=olympe.dc.db.Database.C.DESTINATION,qf=olympe.dc.db.Database.C.Vh,rf=olympe.dc.db.Database.C.Id,sf=olympe.dc.db.Database.C.ek,tf=olympe.dc.db.Database.C.Zn,uf=of+pf,vf=qf+qf,wf=olympe.dc.db.Database.G;let xf=0;function ne(a,b,c,d=!1){const e=V(a,b);if(null!==e){const f=yf(e,'',c);void 0!==f&&(a.C.getState()!==wf.Le||e.L()&&!d||a.C.T(c),d||!e.Ia()&&!e.L()||f(!1,b))}}
510
- function oe(a,b,c,d){a=a.C.G(olympe.dc.fa(b));d=null!=d?d:zf();Af(a,'',d,c)&&a.Ia()&&c(!0,b);return d}function He(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(e);for(const h of g)yield h,d.Oj(h,f).forEach(([k,,,m])=>{m&&g.add(k)})}.bind(null,a,b,c)}}function zf(){++xf;return String(xf)}
509
+ e.clear()})}};olympe.dc.db.Database.C={Xh:'$',Mr:'~',Hd:'?',ek:'=',Yn:'|',bn:'@',ORIGIN:olympe.dc.wa.ORIGIN,DESTINATION:olympe.dc.wa.DESTINATION};olympe.dc.db.Database.F={An:0,Bn:1,Kp:2,Al:3,cn:4,dn:5,Dk:6,rc:7,oj:8,kl:9,ao:10,bo:11,$o:12};olympe.dc.db.Database.G={IDLE:0,Tq:1,Le:2};function mf(a,b,c=[]){const d=b.W();Je(a.F,b,c);return e=>{if(e)a.F.push(d);else{e=a.F;const f=e.F.get(d);if(void 0!==f){const g=e.C.indexOf(d);e.C.splice(g,1);e.write(Le(e,f.C,e.C.length),!1);e.F.delete(d)}}}}function nf(a,b){a.C.mb(b)}olympe.dc.db.rr=class{constructor(a,b,c,d,e){this.K=a;this.C=b;this.view=c;this.F=new olympe.dc.db.hr(a,b,c,d);this.Sv=new olympe.dc.db.Js(a,c,b,e)}fb(){return this.K}ed(a){this.F.ed(a)}};const of=olympe.dc.db.Database.C.ORIGIN,pf=olympe.dc.db.Database.C.DESTINATION,qf=olympe.dc.db.Database.C.Xh,rf=olympe.dc.db.Database.C.Hd,sf=olympe.dc.db.Database.C.ek,tf=olympe.dc.db.Database.C.Yn,uf=of+pf,vf=qf+qf,wf=olympe.dc.db.Database.G;let xf=0;function oe(a,b,c,d=!1){const e=V(a,b);if(null!==e){const f=yf(e,'',c);void 0!==f&&(a.C.getState()!==wf.Le||e.L()&&!d||a.C.T(c),d||!e.Ia()&&!e.L()||f(!1,b))}}
510
+ function pe(a,b,c,d){a=a.C.G(olympe.dc.fa(b));d=null!=d?d:zf();Af(a,'',d,c)&&a.Ia()&&c(!0,b);return d}function He(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(e);for(const h of g)yield h,d.Oj(h,f).forEach(([k,,,m])=>{m&&g.add(k)})}.bind(null,a,b,c)}}function zf(){++xf;return String(xf)}
511
511
  function Bf(a,b,c,d,e){a=a.C.G(olympe.dc.fa(b));c=olympe.dc.fa(c);b=qf+c;e=null!=e?e:zf();if(Af(a,b,e,d)&&a.Ia()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(sf+c));void 0!==b&&d(b,f)}return e}function V(a,b,c=!1){if(null===b||void 0===b)throw Error('Provided tag is null or undefined.');a=a.C.get(olympe.dc.fa(b));return!a||c&&!a.Ia()?null:a}function Cf(a,b,c,d){b=V(a,b);null!==b&&(c=olympe.dc.fa(c),yf(b,qf+c,d),a.C.getState()===wf.Le&&a.C.T(d))}
512
512
  function Df(a,b,c,d){a=a.C.G(olympe.dc.fa(b));d=null!=d?d:zf();Af(a,vf,d,c)&&a.Ia()&&a.forEach((e,f)=>{const g=f[0];g!==qf&&g!==sf||c(f.substring(1),e,g===sf)});return d}function Ef(a,b,c){b=V(a,b);null!==b&&(yf(b,vf,c),a.C.getState()===wf.Le&&a.C.T(c))}function Ff(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ia()||!c&&g.L())e?d(b.substring(1),b[0],c,h):d(c,h)})}
513
513
  function W(a,b,c,d,e){a=a.C.G(olympe.dc.fa(b));c=c.Pa()+c.X();e=null!=e?e:zf();(d=Gf(a,c,e,d))&&a.Ia()&&Ff(a,c,!0,d,!1);return e}function Hf(a,b,c,d){const e=a.C.G(olympe.dc.fa(b));a=null!=d?d:zf();const f=Gf(e,uf,a,c);f&&e.Ia()&&e.forEach((g,h)=>{g=h[0];g!==of&&g!==pf||Ff(e,h,!0,f,!0)})}function If(a,b,c){const d=V(a,b);if(null!==d){const e=yf(d,uf,c);void 0!==e&&(a.C.getState()!==wf.Le||d.L()||a.C.T(c),!d.Ia()&&!d.L()||d.forEach((f,g)=>{f=g[0];(f===of||f===pf)&&e&&Ff(d,g,!1,e,!0)}))}}
514
- function Jf(a,b,c){b=V(a,b,!1);if(!b)return[];const d=olympe.dm.Relation.C.nl,e=olympe.dm.Relation.C.dt,f=olympe.dm.Relation.C.Al,g=olympe.dm.Relation.C.cp,h=qf+c,k=[];b.forEach((m,n)=>{const p=n[0];if(m instanceof olympe.dc.lc&&p===qf)(m=a.C.get(m.X()))&&k.push([m,n.substring(1),null,!0]);else if(p===of){const q=n.substring(1);let r,t;const u=null!=(t=null==(r=a.C.get(q))?void 0:r.get(h))?t:0;(d|e)&u&&m.forEach(w=>{k.push([w,q,p,!!(d&u)])})}else if(p===pf){const q=n.substring(1);let r,t;const u=
514
+ function Jf(a,b,c){b=V(a,b,!1);if(!b)return[];const d=olympe.dm.Relation.C.ml,e=olympe.dm.Relation.C.dt,f=olympe.dm.Relation.C.zl,g=olympe.dm.Relation.C.ap,h=qf+c,k=[];b.forEach((m,n)=>{const p=n[0];if(m instanceof olympe.dc.lc&&p===qf)(m=a.C.get(m.X()))&&k.push([m,n.substring(1),null,!0]);else if(p===of){const q=n.substring(1);let r,t;const u=null!=(t=null==(r=a.C.get(q))?void 0:r.get(h))?t:0;(d|e)&u&&m.forEach(w=>{k.push([w,q,p,!!(d&u)])})}else if(p===pf){const q=n.substring(1);let r,t;const u=
515
515
  null!=(t=null==(r=a.C.get(q))?void 0:r.get(h))?t:0;(f|g)&u&&m.forEach(w=>{k.push([w,q,p,!!(f&u)])})}});return k}function Kf(a,b,c,d,e){const f=a.C.G(olympe.dc.fa(b));e=null!=e?e:zf();const g=Gf(f,tf+c,e,d);g&&f.Ia()&&Jf(a,b,c).forEach(([h,...k])=>{h.Ia()&&g(...k,!0,h.tag())})}function Lf(a,b,c,d){const e=V(a,b);if(null!==e){const f=yf(e,tf+c,d);void 0!==f&&(a.C.getState()!==wf.Le||e.L()||a.C.T(d),!e.Ia()&&!e.L()||Jf(a,b,c).forEach(([g,...h])=>{(g.Ia()||g.L())&&f(...h,!1,g.tag())}))}}
516
- function Mf(a,b){a=V(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===rf&&b.set(c.substring(1),d);return b}function Nf(a,b,c){return c===olympe.dc.Ob.NONE?0:a.Qa(b,c,!0)||0}function Of(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===of||c===pf){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(V(a,b,!0))}
516
+ function Mf(a,b){a=V(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===rf&&b.set(c.substring(1),d);return b}function Nf(a,b,c){return c===olympe.dc.Nb.NONE?0:a.Qa(b,c,!0)||0}function Of(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===of||c===pf){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(V(a,b,!0))}
517
517
  function Pf(a,b,c){if(!a.Ia(b))return a.K.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.ib(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.K.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.fa(b)}`);return d}function Qf(a,b,c,d){return(c=(a=V(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ia()).length:0}
518
518
  olympe.dc.$a=class{constructor(a,b){this.K=a;this.C=b}W(){return this.C.W()}F(a,b,c,d=!1){a=V(this,a);if(null!==a){b=b.Pa()+b.X();const e=yf(a,b,c);void 0!==e&&(this.C.getState()!==wf.Le||a.L()&&!d||this.C.T(c),d||!a.Ia()&&!a.L()||Ff(a,b,!1,e,!1))}}Ia(a){a=this.C.get(olympe.dc.fa(a));return!(null==a||!a.Ia())}name(a){let b,c;return null!=(c=null==(b=V(this,a))?void 0:b.Qa(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=V(this,a,!0))?a.model():null)?a.tag():null}Ae(a){return(a=(a=V(this,
519
- a,!0))&&a.Ae())?a.tag():null}si(a){a=V(this,a,!0);return!(!a||!a.Ae())}$c(a,b){a=(a=V(this,a,!0))&&a.model();return!(!a||!this.ri(a.tag(),b))}source(a){return(a=V(this,a,!0))&&a.source()}Of(a){a=V(this,a,!1);return!a||a.P}Qa(a,b,c){let d;a=null==(d=V(this,a,!0))?void 0:d.Qa(olympe.dc.fa(b),c);return void 0!==a?a:null}Cb(a,b=!1){var c=V(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===qf||!b&&c===sf)&&a.set(d.substring(1),e);return a}Oj(a,b){return Jf(this,a,b).filter(([c])=>c.Ia()).map(([c,
520
- ...d])=>[c.tag(),...d])}ib(a,b){return this.Pj(a,[b])}mm(a,b,c){let d,e;a=null==(d=V(this,a,!0))?void 0:null==(e=d.get(b.Pa()+b.X()))?void 0:e.get(olympe.dc.fa(c));return!(null==a||!a.Ia())}Pj(a,b){a=V(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=V(this,d,!0).get(c.Pa()+c.X()),void 0!==a)for(const e of a.values())e.Ia()&&b.push(e.tag());a=b}return a}Tb(a,b){var c=V(this,a,!0);return c?(c=c.get(b.Pa()+b.X()))&&1<c.size?(this.K.warn(`Relation ${b.X()} to instance ${a} is not unique: found ${c.size} related items`),
521
- null):(a=c?c.values().next().value:null)&&a.Ia()?a.tag():null:null}qg(a,b,c){a=olympe.dc.fa(a);const d=Pf(this,a,b);d.delete(a);return c?(c=olympe.dc.fa(c),d.has(c)?Array.from(Pf(this,c,b.Rb()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}lq(a,b,c){if(!this.Ia(a))return null;b=Pf(this,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}Tl(a,b,c){return this.Pj(a,b).find(c)||null}pu(a,b,c){return this.Pj(a,
522
- b).filter(c)}pq(a,b=olympe.dc.CloudObject){var c=V(this,a,!0);const d=b&&V(this,b,!0),e=[c];for(;c&&c!==d;){c=c.Ae();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ia())throw a=`Try to get all extensions of the model ${olympe.dc.fa(a)} but one of them does not exists (${c.tag()})`,Error(a);null!==c&&e.push(c)}c=V(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}).`);
523
- return e.map(f=>f.tag())}ri(a,b){const c=olympe.dc.fa(b);return!!this.lq(a,olympe.dc.CloudObject.extendRel,d=>d===c)}Sd(a){return this.ib(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.$a.prototype.getInstances=olympe.dc.$a.prototype.Sd;olympe.dc.$a.prototype.isExtending=olympe.dc.$a.prototype.ri;olympe.dc.$a.prototype.getExtendedModels=olympe.dc.$a.prototype.pq;olympe.dc.$a.prototype.findAllRelated=olympe.dc.$a.prototype.pu;olympe.dc.$a.prototype.findRelated=olympe.dc.$a.prototype.Tl;
524
- olympe.dc.$a.prototype.findRecursive=olympe.dc.$a.prototype.lq;olympe.dc.$a.prototype.getRecursiveRelated=olympe.dc.$a.prototype.qg;olympe.dc.$a.prototype.getUniqueRelated=olympe.dc.$a.prototype.Tb;olympe.dc.$a.prototype.getMultiRelated=olympe.dc.$a.prototype.Pj;olympe.dc.$a.prototype.isRelated=olympe.dc.$a.prototype.mm;olympe.dc.$a.prototype.getRelated=olympe.dc.$a.prototype.ib;olympe.dc.$a.prototype.getProperties=olympe.dc.$a.prototype.Cb;olympe.dc.$a.prototype.getProperty=olympe.dc.$a.prototype.Qa;
525
- olympe.dc.$a.prototype.isPersisted=olympe.dc.$a.prototype.Of;olympe.dc.$a.prototype.instanceOf=olympe.dc.$a.prototype.$c;olympe.dc.$a.prototype.isModel=olympe.dc.$a.prototype.si;olympe.dc.$a.prototype.extension=olympe.dc.$a.prototype.Ae;olympe.dc.$a.prototype.model=olympe.dc.$a.prototype.model;olympe.dc.$a.prototype.name=olympe.dc.$a.prototype.name;olympe.dc.$a.prototype.exist=olympe.dc.$a.prototype.Ia;const Rf=olympe.dc.db.Database.C.ORIGIN,cf=olympe.dc.db.Database.C.DESTINATION,bf=olympe.dc.db.Database.C.ek,Sf=olympe.dc.db.Database.C.Vh,Tf=olympe.dc.db.Database.C.Zn,Uf=olympe.dc.db.Database.C.bn,Vf=Rf+cf,Wf=Sf+Sf,Xf=Array.from(Object.values(olympe.dc.Ob)).filter(a=>null!==a);function $e(a,b,c){let d=a.C.get(b);void 0===d&&(d=[],a.C.set(b,d));a.buffer.push([b,d.length]);d.push(c)}
526
- function df(a){const b=a.L;a.F.forEach((c,d)=>{var e=b.get(d);if(c.L()||c.lf()){var f=e.get(Uf);f&&Yf(a,f,c.L(),d);c.lf()&&a.P.add(d)}for(const [n,p]of c.Cb()){var g=n[0]===bf,h=g?n.substring(1):n;f=a;var k=e,m=p;const q=k.get(Uf+Sf+h);q&&Yf(f,q,m,g);(k=k.get(Uf+Wf))&&Yf(f,k,h,m,g)}for(const n of c.Eb())Zf(a,e,...n);(e=c.na)&&$f(a,b.get(e),c.ac,!c.lf(),d)});a.F.clear();a.G.clear();ag(a)}function af(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.Bf(b),a.F.set(b,c));return c}
519
+ a,!0))&&a.Ae())?a.tag():null}uh(a){a=V(this,a,!0);return!(!a||!a.Ae())}$c(a,b){a=(a=V(this,a,!0))&&a.model();return!(!a||!this.si(a.tag(),b))}source(a){return(a=V(this,a,!0))&&a.source()}Of(a){a=V(this,a,!1);return!a||a.P}Qa(a,b,c){let d;a=null==(d=V(this,a,!0))?void 0:d.Qa(olympe.dc.fa(b),c);return void 0!==a?a:null}Bb(a,b=!1){var c=V(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===qf||!b&&c===sf)&&a.set(d.substring(1),e);return a}Oj(a,b){return Jf(this,a,b).filter(([c])=>c.Ia()).map(([c,
520
+ ...d])=>[c.tag(),...d])}ib(a,b){return this.Pj(a,[b])}km(a,b,c){let d,e;a=null==(d=V(this,a,!0))?void 0:null==(e=d.get(b.Pa()+b.X()))?void 0:e.get(olympe.dc.fa(c));return!(null==a||!a.Ia())}Pj(a,b){a=V(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=V(this,d,!0).get(c.Pa()+c.X()),void 0!==a)for(const e of a.values())e.Ia()&&b.push(e.tag());a=b}return a}Sb(a,b){var c=V(this,a,!0);return c?(c=c.get(b.Pa()+b.X()))&&1<c.size?(this.K.warn(`Relation ${b.X()} to instance ${a} is not unique: found ${c.size} related items`),
521
+ null):(a=c?c.values().next().value:null)&&a.Ia()?a.tag():null:null}qg(a,b,c){a=olympe.dc.fa(a);const d=Pf(this,a,b);d.delete(a);return c?(c=olympe.dc.fa(c),d.has(c)?Array.from(Pf(this,c,b.Qb()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}kq(a,b,c){if(!this.Ia(a))return null;b=Pf(this,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}Sl(a,b,c){return this.Pj(a,b).find(c)||null}ou(a,b,c){return this.Pj(a,
522
+ b).filter(c)}oq(a,b=olympe.dc.CloudObject){var c=V(this,a,!0);const d=b&&V(this,b,!0),e=[c];for(;c&&c!==d;){c=c.Ae();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ia())throw a=`Try to get all extensions of the model ${olympe.dc.fa(a)} but one of them does not exists (${c.tag()})`,Error(a);null!==c&&e.push(c)}c=V(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}).`);
523
+ return e.map(f=>f.tag())}si(a,b){const c=olympe.dc.fa(b);return!!this.kq(a,olympe.dc.CloudObject.extendRel,d=>d===c)}Rd(a){return this.ib(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.$a.prototype.getInstances=olympe.dc.$a.prototype.Rd;olympe.dc.$a.prototype.isExtending=olympe.dc.$a.prototype.si;olympe.dc.$a.prototype.getExtendedModels=olympe.dc.$a.prototype.oq;olympe.dc.$a.prototype.findAllRelated=olympe.dc.$a.prototype.ou;olympe.dc.$a.prototype.findRelated=olympe.dc.$a.prototype.Sl;
524
+ olympe.dc.$a.prototype.findRecursive=olympe.dc.$a.prototype.kq;olympe.dc.$a.prototype.getRecursiveRelated=olympe.dc.$a.prototype.qg;olympe.dc.$a.prototype.getUniqueRelated=olympe.dc.$a.prototype.Sb;olympe.dc.$a.prototype.getMultiRelated=olympe.dc.$a.prototype.Pj;olympe.dc.$a.prototype.isRelated=olympe.dc.$a.prototype.km;olympe.dc.$a.prototype.getRelated=olympe.dc.$a.prototype.ib;olympe.dc.$a.prototype.getProperties=olympe.dc.$a.prototype.Bb;olympe.dc.$a.prototype.getProperty=olympe.dc.$a.prototype.Qa;
525
+ olympe.dc.$a.prototype.isPersisted=olympe.dc.$a.prototype.Of;olympe.dc.$a.prototype.instanceOf=olympe.dc.$a.prototype.$c;olympe.dc.$a.prototype.isModel=olympe.dc.$a.prototype.uh;olympe.dc.$a.prototype.extension=olympe.dc.$a.prototype.Ae;olympe.dc.$a.prototype.model=olympe.dc.$a.prototype.model;olympe.dc.$a.prototype.name=olympe.dc.$a.prototype.name;olympe.dc.$a.prototype.exist=olympe.dc.$a.prototype.Ia;const Rf=olympe.dc.db.Database.C.ORIGIN,cf=olympe.dc.db.Database.C.DESTINATION,bf=olympe.dc.db.Database.C.ek,Sf=olympe.dc.db.Database.C.Xh,Tf=olympe.dc.db.Database.C.Yn,Uf=olympe.dc.db.Database.C.bn,Vf=Rf+cf,Wf=Sf+Sf,Xf=Array.from(Object.values(olympe.dc.Nb)).filter(a=>null!==a);function $e(a,b,c){let d=a.C.get(b);void 0===d&&(d=[],a.C.set(b,d));a.buffer.push([b,d.length]);d.push(c)}
526
+ function df(a){const b=a.L;a.F.forEach((c,d)=>{var e=b.get(d);if(c.L()||c.lf()){var f=e.get(Uf);f&&Yf(a,f,c.L(),d);c.lf()&&a.P.add(d)}for(const [n,p]of c.Bb()){var g=n[0]===bf,h=g?n.substring(1):n;f=a;var k=e,m=p;const q=k.get(Uf+Sf+h);q&&Yf(f,q,m,g);(k=k.get(Uf+Wf))&&Yf(f,k,h,m,g)}for(const n of c.Db())Zf(a,e,...n);(e=c.na)&&$f(a,b.get(e),c.$b,!c.lf(),d)});a.F.clear();a.G.clear();ag(a)}function af(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.Cf(b),a.F.set(b,c));return c}
527
527
  function Yf(a,b,...c){b.forEach((d,e)=>{$e(a,e,d.bind(null,...c))})}function Zf(a,b,c,d,e,f){var g=b.get(Uf+d+c);g&&Yf(a,g,f,e);(g=b.get(Uf+Vf))&&Yf(a,g,c,d,f,e);bg(a,c,d).forEach((h,k)=>{(k=b.get(Uf+Tf+k))&&Yf(a,k,c,d,h,f,e)})}function $f(a,b,c,d,e){Xf.forEach(f=>{(f=b.get(Uf+Tf+f))&&Yf(a,f,c,null,!0,d,e)})}function ag(a){a.T.run(()=>{const b=a.C;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.C.clear();a.buffer.length=0}
528
- function bg(a,b,c){const d=b+c;let e=a.G.get(d);if(!e){const f=a.L.get(b);e=new Map;Xf.forEach(g=>{let h;const k=null!=(h=null==f?void 0:f.get(Sf+g))?h:0;(c===Rf?12:3)&k&&e.set(g,!!((c===Rf?8:2)&k))});a.G.set(d,e)}return e}olympe.dc.db.vr=class{constructor(a,b){this.L=a;this.T=b;this.F=new Map;this.P=new Set;this.C=new Map;this.G=new Map;this.buffer=[]}};function ef(a){if(!a.G&&0<a.F.size)switch(a.mode){case olympe.dc.db.Re.C.Fm:a.G=!0;setTimeout(()=>a.run(),a.delay);break;case olympe.dc.db.Re.C.nt:a.G=!0,a.run()}}
529
- olympe.dc.db.Re=class{constructor(a,b,c,d){this.K=a;this.C=b;this.F=new Set;this.mode=c;this.delay=d;this.G=!1;c!==olympe.dc.db.Re.C.Ak&&this.init()}run(){const a=this.C;this.K.debug('Start garbage collector with',this.F.size,'instances to check');for(const b of this.F){const c=a.get(b);!c||0<c.c||(this.K.debug('Remove unused instance',b,'from database'),a.qd(b))}this.F.clear();this.G=!1}init(){const a=olympe.dc.db.Database.F.Lp,b=olympe.dc.db.Database.F.eo,c=olympe.dc.db.Database.F.bp,d=olympe.dc.db.Database.G.IDLE,
530
- e=f=>{this.F.add(f);this.C.getState()===d&&ef(this)};this.C.C(olympe.dc.db.Database.F.Bl,e.bind(this));this.C.C(b,e.bind(this));this.C.C(a,f=>{this.F.delete(f)});this.C.C(c,(f,...g)=>{this.K.error(g[0])})}};olympe.dc.db.Re.C={Ak:0,nt:1,Fm:2};olympe.dc.db.Re.F=5E3;function Pe(a,b,c=olympe.dc.Ob.NONE){b=a.Oj(b,c);for(const d of b)cg(a,d,!1),a.C.delete(d)}function Ne(a,b,c,d){const e=a.C.get(c);a=a.C.get(d);e&&e.T(b,olympe.dc.wa.DESTINATION,d);a&&a.T(b,olympe.dc.wa.ORIGIN,c)}function dg(a,b,c){let d=a.C.get(b);void 0===d&&(d=new olympe.dc.db.Bf(b),a.C.set(b,d));return c?d.Wa(c):d}
531
- function cg(a,b,c){const d=olympe.dc.wa.ORIGIN,e=olympe.dc.wa.DESTINATION,f=a.C.get(b);for(const [h,k,m]of f.he())if(m||!c){f.T(h,e,k);var g=a.C.get(k);g&&g.T(h,d,b)}for(const [h,k,m]of f.Qb())if(m||!c)f.T(h,d,k),(g=a.C.get(k))&&g.T(h,e,b)}
532
- function eg(a,b){var c=olympe.dc.ta();if(c.Ia(b)){const d=c.model(b),e=c.source(b),f=c.Cb(b,!0);Mf(c,b).forEach((g,h)=>{f.set(`${olympe.dc.Wi.Id}${h}`,g)});a.Ec(b,e,f,d);(c=c.Ae(b))&&a.Ea(olympe.dc.mc.Hh,b,c);f.forEach(g=>{g instanceof olympe.dc.lc&&eg(a,g.X())})}}function*fg(a,b,c,d,e=[]){e.push(b);b=a.Ge(b);for(const [f,g]of b.ib(c))e.includes(f)||(yield*fg(a,f,c,d,e),yield d(f,g))}
533
- olympe.dc.db.Lc=class{constructor(a){this.id=null!=a?a:olympe.Z.ef();this.C=new Map}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "instances": {';for(const b of this.C.keys()){const c=this.C.get(b);a+=JSON.stringify(b)+': '+c.toJSON()+', '}a.endsWith(', ')&&(a=a.substring(0,a.length-2));return a+'}}'}static wc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=new olympe.dc.db.Lc(b.id);b=b.instances;for(const c of Object.keys(b)){const d=olympe.dc.db.Bf.wc(b[c]);a.C.set(c,d)}return a}W(){return this.id}Od(a){const b=
534
- olympe.dc.db.Bf.C.al,c=olympe.dc.db.Bf.C.qc,d=olympe.dc.db.Bf.C.Bj;this.C.forEach((e,f)=>{const g=e.Dd();switch(e.getState()){case b:const h=e.zb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.da()?e.Cb():void 0;a.Ec(f,h,k,g);break;case d:e.da()&&a.hd(f,e.Cb(),g);break;case c:a.F(f,e.$(),g)}for(const [h,k,m]of e.he())e=this.C.get(k),m?a.Ea(h,f,k,g,e.Dd()):a.Xb(h,f,k,g,e.Dd())})}rh(){return 0===this.C.size}G(){let a=0;this.C.forEach(b=>{a+=b.jd()});
535
- return a}Ec(a,b,c,d=null){b=dg(this,a).create(b);'string'===typeof d&&this.Ea(olympe.dc.mc.nd,a,d,d,null);c&&b.Il(c)}hd(a,b,c=null){b&&dg(this,a,c).Il(b)}F(a,b=olympe.dc.Ob.NONE,c=null){const d=this.C.get(a);if(d&&d.L())Pe(this,a,b);else{dg(this,a,c).delete(b);for(const e of this.Oj(a,b,!1))this.C.get(e).Cb().clear(),cg(this,e,!0)}}Ea(a,b,c,d=null,e=null){dg(this,b,d).link(a,c);dg(this,c,e).Wb(a,b)}Xb(a,b,c,d=null,e=null){dg(this,b,d).unlink(a,c);dg(this,c,e).uc(a,b)}Sd(){return function*(a){for(const b of a.values())if(b.L()||
536
- b.lf()||b.da())yield b}(this.C)}Ge(a){return this.C.get(olympe.dc.fa(a))||null}he(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.he((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}qg(a,b,c=(d,e)=>[d,e]){return fg(this,a,b,c)}Oj(a,b,c=!0){const d=olympe.dm.Relation.C.nl,e=olympe.dm.Relation.C.Al,f=olympe.dc.wa.ORIGIN,g=olympe.dc.ta();a=new Set([a]);const h=new Set;for(const m of a){var k=this.C.get(m);if(void 0!==k){for(const [n,p,q]of k.he())q&&Nf(g,n,b)&e?
537
- a.add(p):c||q||h.add(`${m}.${n}.${p}`);for(const [n,p,q]of k.Qb())q&&Nf(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${m}`)}for(const [n,p,q]of Of(g,m))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${m}`:`${m}.${n}.${q}`)&&Nf(g,n,b)&k&&a.add(q)}return Array.from(a).filter(m=>this.C.has(m))}};olympe.dc.db.Lc.va=[olympe.dc.Writable,olympe.dc.Ws];const lf=olympe.dc.db.Database.F,gg=olympe.dc.db.Database.C.Vh,gf=olympe.dc.db.Database.C.Mr,ff=olympe.dc.db.Database.C.Id,hg=olympe.dc.db.Database.C.ek,ig=olympe.dc.db.Database.C.bn,X=olympe.dc.wa.ORIGIN,Y=olympe.dc.wa.DESTINATION,jg=olympe.dc.mc.nd,kg=olympe.dc.mc.Hh;function Ie(a,b,c=!1){const d=a.get(ff+b);return c||void 0!==d?d:a.get(gf+b)}
528
+ function bg(a,b,c){const d=b+c;let e=a.G.get(d);if(!e){const f=a.L.get(b);e=new Map;Xf.forEach(g=>{let h;const k=null!=(h=null==f?void 0:f.get(Sf+g))?h:0;(c===Rf?12:3)&k&&e.set(g,!!((c===Rf?8:2)&k))});a.G.set(d,e)}return e}olympe.dc.db.vr=class{constructor(a,b){this.L=a;this.T=b;this.F=new Map;this.P=new Set;this.C=new Map;this.G=new Map;this.buffer=[]}};function ef(a){if(!a.G&&0<a.F.size)switch(a.mode){case olympe.dc.db.Re.C.Em:a.G=!0;setTimeout(()=>a.run(),a.delay);break;case olympe.dc.db.Re.C.nt:a.G=!0,a.run()}}
529
+ olympe.dc.db.Re=class{constructor(a,b,c,d){this.K=a;this.C=b;this.F=new Set;this.mode=c;this.delay=d;this.G=!1;c!==olympe.dc.db.Re.C.zk&&this.init()}run(){const a=this.C;this.K.debug('Start garbage collector with',this.F.size,'instances to check');for(const b of this.F){const c=a.get(b);!c||0<c.c||(this.K.debug('Remove unused instance',b,'from database'),a.qd(b))}this.F.clear();this.G=!1}init(){const a=olympe.dc.db.Database.F.Kp,b=olympe.dc.db.Database.F.bo,c=olympe.dc.db.Database.F.$o,d=olympe.dc.db.Database.G.IDLE,
530
+ e=f=>{this.F.add(f);this.C.getState()===d&&ef(this)};this.C.C(olympe.dc.db.Database.F.Al,e.bind(this));this.C.C(b,e.bind(this));this.C.C(a,f=>{this.F.delete(f)});this.C.C(c,(f,...g)=>{this.K.error(g[0])})}};olympe.dc.db.Re.C={zk:0,nt:1,Em:2};olympe.dc.db.Re.F=5E3;function Pe(a,b,c=olympe.dc.Nb.NONE){b=a.Oj(b,c);for(const d of b)cg(a,d,!1),a.C.delete(d)}function Ne(a,b,c,d){const e=a.C.get(c);a=a.C.get(d);e&&e.T(b,olympe.dc.wa.DESTINATION,d);a&&a.T(b,olympe.dc.wa.ORIGIN,c)}function dg(a,b,c){let d=a.C.get(b);void 0===d&&(d=new olympe.dc.db.Cf(b),a.C.set(b,d));return c?d.Wa(c):d}
531
+ function cg(a,b,c){const d=olympe.dc.wa.ORIGIN,e=olympe.dc.wa.DESTINATION,f=a.C.get(b);for(const [h,k,m]of f.ie())if(m||!c){f.T(h,e,k);var g=a.C.get(k);g&&g.T(h,d,b)}for(const [h,k,m]of f.Pb())if(m||!c)f.T(h,d,k),(g=a.C.get(k))&&g.T(h,e,b)}
532
+ function eg(a,b){var c=olympe.dc.ta();if(c.Ia(b)){const d=c.model(b),e=c.source(b),f=c.Bb(b,!0);Mf(c,b).forEach((g,h)=>{f.set(`${olympe.dc.Wi.Hd}${h}`,g)});a.Ec(b,e,f,d);(c=c.Ae(b))&&a.Ea(olympe.dc.mc.Jh,b,c);f.forEach(g=>{g instanceof olympe.dc.lc&&eg(a,g.X())})}}function*fg(a,b,c,d,e=[]){e.push(b);b=a.Ge(b);for(const [f,g]of b.ib(c))e.includes(f)||(yield*fg(a,f,c,d,e),yield d(f,g))}
533
+ olympe.dc.db.Lc=class{constructor(a){this.id=null!=a?a:olympe.Z.ef();this.C=new Map}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "instances": {';for(const b of this.C.keys()){const c=this.C.get(b);a+=JSON.stringify(b)+': '+c.toJSON()+', '}a.endsWith(', ')&&(a=a.substring(0,a.length-2));return a+'}}'}static xc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=new olympe.dc.db.Lc(b.id);b=b.instances;for(const c of Object.keys(b)){const d=olympe.dc.db.Cf.xc(b[c]);a.C.set(c,d)}return a}W(){return this.id}Nd(a){const b=
534
+ olympe.dc.db.Cf.C.$k,c=olympe.dc.db.Cf.C.rc,d=olympe.dc.db.Cf.C.Bj;this.C.forEach((e,f)=>{const g=e.Cd();switch(e.getState()){case b:const h=e.Gb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.da()?e.Bb():void 0;a.Ec(f,h,k,g);break;case d:e.da()&&a.jd(f,e.Bb(),g);break;case c:a.F(f,e.$(),g)}for(const [h,k,m]of e.ie())e=this.C.get(k),m?a.Ea(h,f,k,g,e.Cd()):a.Wb(h,f,k,g,e.Cd())})}sh(){return 0===this.C.size}G(){let a=0;this.C.forEach(b=>{a+=b.ud()});
535
+ return a}Ec(a,b,c,d=null){b=dg(this,a).create(b);'string'===typeof d&&this.Ea(olympe.dc.mc.nd,a,d,d,null);c&&b.Hl(c)}jd(a,b,c=null){b&&dg(this,a,c).Hl(b)}F(a,b=olympe.dc.Nb.NONE,c=null){const d=this.C.get(a);if(d&&d.L())Pe(this,a,b);else{dg(this,a,c).delete(b);for(const e of this.Oj(a,b,!1))this.C.get(e).Bb().clear(),cg(this,e,!0)}}Ea(a,b,c,d=null,e=null){dg(this,b,d).link(a,c);dg(this,c,e).Vb(a,b)}Wb(a,b,c,d=null,e=null){dg(this,b,d).unlink(a,c);dg(this,c,e).nc(a,b)}Rd(){return function*(a){for(const b of a.values())if(b.L()||
536
+ b.lf()||b.da())yield b}(this.C)}Ge(a){return this.C.get(olympe.dc.fa(a))||null}ie(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.ie((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}qg(a,b,c=(d,e)=>[d,e]){return fg(this,a,b,c)}Oj(a,b,c=!0){const d=olympe.dm.Relation.C.ml,e=olympe.dm.Relation.C.zl,f=olympe.dc.wa.ORIGIN,g=olympe.dc.ta();a=new Set([a]);const h=new Set;for(const m of a){var k=this.C.get(m);if(void 0!==k){for(const [n,p,q]of k.ie())q&&Nf(g,n,b)&e?
537
+ a.add(p):c||q||h.add(`${m}.${n}.${p}`);for(const [n,p,q]of k.Pb())q&&Nf(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${m}`)}for(const [n,p,q]of Of(g,m))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${m}`:`${m}.${n}.${q}`)&&Nf(g,n,b)&k&&a.add(q)}return Array.from(a).filter(m=>this.C.has(m))}};olympe.dc.db.Lc.va=[olympe.dc.Writable,olympe.dc.Ws];const lf=olympe.dc.db.Database.F,gg=olympe.dc.db.Database.C.Xh,gf=olympe.dc.db.Database.C.Mr,ff=olympe.dc.db.Database.C.Hd,hg=olympe.dc.db.Database.C.ek,ig=olympe.dc.db.Database.C.bn,X=olympe.dc.wa.ORIGIN,Y=olympe.dc.wa.DESTINATION,jg=olympe.dc.mc.nd,kg=olympe.dc.mc.Jh;function Ie(a,b,c=!1){const d=a.get(ff+b);return c||void 0!==d?d:a.get(gf+b)}
538
538
  function Ue(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(jg,c)}a.link(jg,b);b.forEach((d,e)=>{if(e[0]===ff||e[0]===gf)e=e.substring(1),lg(a,e,d)});null===a.G||!b.e&&b!==a||a.db.da(a,!0)}function Ve(a,b){const c=a.Ae();if(null!==c){if(c===b)return;a.unlink(kg,c)}a.link(kg,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===ff||f[0]===gf)f=f.substring(1),a.has(ff+f)||(a.set(gf+f,e),d.set(f,e))});hf(a,d)}
539
- function We(a,b){a.unlink(jg,b);a.forEach((c,d)=>{c=d.substring(1);lg(a,c,null)});a.db.da(a,!1)}function Xe(a,b){a.unlink(kg,b);const c=new Map;a.forEach((d,e)=>{e[0]===gf&&(a.delete(e),d=e.substring(1),c.set(d,null))});hf(a,c)}function Ye(a){a.c++;1===a.c&&a.db.F(lf.Lp,a.C)}
540
- function Ze(a){0<a.c?--a.c:a.db.F(lf.bp,a.C,`Try to decrease references on instance ${a.C} 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.F(lf.Bl,a.C)}function Af(a,b,c,d){const e=mg(a,ig+b);return e.has(c)?!1:(e.set(c,d),Ye(a),a.db.F(lf.cn,a.C,b,c),!0)}
541
- function yf(a,b,c){const d=ng(a,ig+b,c);void 0!==d&&(Ze(a),a.db.F(lf.dn,a.C,b,c));return d}function Gf(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];(g=a.db.get(f[g-1]))&&(h?Ye(g):Ze(g));d(...f)};return Af(a,b,c,e)?e:null}function og(a){void 0!==a.F&&(Ze(a),a.db.Wb(a.C,a.F.tag,a.F.Ja),a.F=void 0)}function pg(a,b,c,d){a.e&&a.db.Lf(a.C,b,c,d)}
542
- function hf(a,b,c=[]){const d=a.get(X+jg);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>lg(e,g,f))});a=a.get(X+kg);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(ff+k)||(g.set(k,h),null!==h?e.set(gf+k,h):e.delete(gf+k))});hf(e,g,[...c,f])}})}function mg(a,b){let c=a.get(b);void 0===c&&(c=new Map,a.set(b,c));return c}function qg(a,b,c,d,e){a.db.ji(a.C,b,c,d.C,e)}
539
+ function We(a,b){a.unlink(jg,b);a.forEach((c,d)=>{c=d.substring(1);lg(a,c,null)});a.db.da(a,!1)}function Xe(a,b){a.unlink(kg,b);const c=new Map;a.forEach((d,e)=>{e[0]===gf&&(a.delete(e),d=e.substring(1),c.set(d,null))});hf(a,c)}function Ye(a){a.c++;1===a.c&&a.db.F(lf.Kp,a.C)}
540
+ function Ze(a){0<a.c?--a.c:a.db.F(lf.$o,a.C,`Try to decrease references on instance ${a.C} 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.F(lf.Al,a.C)}function Af(a,b,c,d){const e=mg(a,ig+b);return e.has(c)?!1:(e.set(c,d),Ye(a),a.db.F(lf.cn,a.C,b,c),!0)}
541
+ function yf(a,b,c){const d=ng(a,ig+b,c);void 0!==d&&(Ze(a),a.db.F(lf.dn,a.C,b,c));return d}function Gf(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];(g=a.db.get(f[g-1]))&&(h?Ye(g):Ze(g));d(...f)};return Af(a,b,c,e)?e:null}function og(a){void 0!==a.F&&(Ze(a),a.db.Vb(a.C,a.F.tag,a.F.Ja),a.F=void 0)}function pg(a,b,c,d){a.e&&a.db.df(a.C,b,c,d)}
542
+ function hf(a,b,c=[]){const d=a.get(X+jg);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>lg(e,g,f))});a=a.get(X+kg);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(ff+k)||(g.set(k,h),null!==h?e.set(gf+k,h):e.delete(gf+k))});hf(e,g,[...c,f])}})}function mg(a,b){let c=a.get(b);void 0===c&&(c=new Map,a.set(b,c));return c}function qg(a,b,c,d,e){a.db.ki(a.C,b,c,d.C,e)}
543
543
  function ng(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 lg(a,b,c){if(!a.has(gg+b)){const d=hg+b,e=a.get(d);c!==(void 0!==e?e:null)&&(null===c?a.delete(d):a.set(d,c),pg(a,b,c,null!==c))}}function jf(a){a.forEach((b,c)=>{const d=c[0];if(d===X||d===Y){const e=c.substring(1),f=d===X?Y:X;b.forEach(g=>{g.e&&(qg(a,e,d,g,!0),qg(g,e,f,a,!0))})}else if(d===gg||d===hg)c=c.substring(1),pg(a,c,b,d===hg)})}
544
544
  function kf(a){a.forEach((b,c)=>{const d=c[0];if(d!==ig){var e=c.substring(1);d===X?b.forEach(f=>{f.unlink(e,a)}):d===Y?b.forEach(f=>{a.unlink(e,f)}):d===gg&&a.update(e,null);a.delete(c)}});if(void 0!==a.F){const b=a.db.get(a.F.tag);let c,d;(null==(c=b.get(gg+a.F.Ja))?void 0:null==(d=c.X)?void 0:d.call(c))===a.C&&b.update(a.F.Ja,null)}}
545
545
  olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.C=a;this.G=null;this.e=!1;this.F=void 0;this.c=0;this.P=!1;this.db=b}tag(){return this.C}Ia(){return this.e}L(){return this.db.L(this.C)}source(){return this.G}model(){const a=this.get(Y+jg);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}Ae(){const a=this.get(Y+kg);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.C}, Exist: ${this.e}, Name: ${a}`;
546
546
  var b=this.model();if(b){var c=b.Qa(olympe.dc.CloudObject.nameProp.X())||'No model name';a+=`\nModel: ${b.C}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.Ae())?(c=b.Qa(olympe.dc.CloudObject.nameProp.X())||'No extension name',a+=`\nExtension: ${b.C}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Qa(a,b=!1){const c=this.get(gg+a);return b||void 0!==c?c:this.get(hg+a)}update(a,b){const c=gg+a;var d=this.get(c),e=d=void 0===d?null:d;(e instanceof
547
- Date?b instanceof Date&&e.getTime()===b.getTime():null!==e&&'function'===typeof e.Ha?e.Ha(b):e===b)||(d instanceof olympe.dc.lc&&(og(this.db.get(d.X())),this.db.Wa(d.X())),b instanceof olympe.dc.lc&&(d=this.db.G(b.X(),!0),d.F&&d.F.tag!==this.C&&this.db.fb().fatal('Instance',b.X(),'referenced multiple times!\nThis instance is currently property of',d.F.tag,'(for the property '+d.F.Ja+')','and is assigned as a property of',this.C,'(for the property '+a+')'),e=this.C,void 0===d.F&&(Ye(d),d.db.Wb(d.C,
548
- e,a)),d.F={tag:e,Ja:a}),d=hg+a,null===b?(this.delete(c),b=(b=this.model())&&Ie(b,a),void 0!==b?(this.set(d,b),pg(this,a,b,!0)):pg(this,a,null,!1)):(this.set(c,b),this.delete(d),pg(this,a,b,!1)))}link(a,b){var c=X+a;const d=mg(this,Y+a);c=mg(b,c);d.has(b.C)||(d.set(b.C,b),c.set(this.C,this),this.db.F(lf.oj,this.C,a,Y,b.C),this.db.F(lf.oj,b.C,a,X,this.C),this.e&&b.e&&(qg(this,a,Y,b,!0),qg(b,a,X,this,!0)))}unlink(a,b){const c=X+a;void 0!==ng(this,Y+a,b.C)&&(ng(b,c,this.C),this.db.F(lf.ll,this.C,a,Y,
549
- b.C),this.db.F(lf.ll,b.C,a,X,this.C),this.e&&b.e&&(qg(this,a,Y,b,!1),qg(b,a,X,this,!1)))}persist(){this.P=!0;return this}clear(){this.forEach((a,b)=>{const c=b[0];if(c===X||c===Y){const d=b.substring(1),e=c===X?Y:X;a.forEach(f=>{const g=f.get(e+d);g.delete(this.C);0===g.size&&f.delete(e+d)})}c===gg&&a instanceof olympe.dc.lc&&og(this.db.get(a.X()))});void 0!==this.F&&this.db.get(this.F.tag).delete(gg+this.F.Ja)}};olympe.dc.db.Bf=class a{constructor(b){this.mb=b;this.P=this.ga=null;this.cc=olympe.dc.Ob.NONE;this.G=a.C.Bj;this.F=this.C=this.ac=this.na=this.properties=null}toJSON(){let b='{ "tag": '+JSON.stringify(this.mb)+', "model": '+JSON.stringify(this.P)+', "src": '+JSON.stringify(this.ga)+', "state": '+JSON.stringify(this.G);if(this.properties){b+=', "properties": {';for(var c of this.properties.keys()){const d=this.properties.get(c);b+=JSON.stringify(c)+': ';b=d.toJSON?b+d.toJSON():b+JSON.stringify(d);
550
- b+=', '}b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}'}if(this.C){b+=', "relations": {';for(const d of this.C.keys()){c=this.C.get(d);b+=JSON.stringify(d)+': {';for(const e of c.keys())b+=JSON.stringify(e)+': '+JSON.stringify(c.get(e))+', ';b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}, '}b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}'}return b+'}'}static wc(b){var c;'string'===typeof b?c=JSON.parse(b):c=b;b=new olympe.dc.db.Bf(c.tag);b.P=c.model;b.ga=c.src;b.G=c.state;const d=
551
- c.properties;if(d){b.properties=new Map;for(var e of Object.keys(d)){const f=d[e],g=f.type;let h=f;g&&('reference'===g?h=olympe.dc.lc.wc(f):h=olympe.D.wc(f));null!==h&&void 0!==h&&b.properties.set(e,h)}}if(c=c.relations){b.C=new Map;for(const f of Object.keys(c)){e=new Map;for(const g of Object.keys(c[f]))e.set(g,c[f][g]);b.C.set(f,e)}}return b}tag(){return this.mb}Dd(){return this.P}zb(){return this.ga}getState(){return this.G}Wa(b){if(null===this.P)this.P=b;else if(this.P!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.P}`);
552
- return this}$(){return this.G===a.C.qc?this.cc:olympe.dc.Ob.NONE}create(b){this.G=a.C.al;this.ga=null!=b?b:null;return this}delete(b=olympe.dc.Ob.NONE){this.G=a.C.qc;this.cc=b;this.properties=null;return this}ja(b,c){if(this.G===a.C.qc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}Il(b){this.G!==a.C.qc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}zd(b,c){if(null!==this.na&&this.na!==b)throw Error('An instance should never be set as complex property of multiple instances');
553
- this.na=b;this.ac=c}ub(b){let c;null==(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.C&&(this.C=new Map);b===olympe.dc.mc.nd&&this.Wa(c);this.pa(this.C,b,c,!0);return this}unlink(b,c){null===this.C&&(this.C=new Map);b===olympe.dc.mc.nd&&this.Wa(c);this.pa(this.C,b,c,!1);return this}Wb(b,c){null===this.F&&(this.F=new Map);this.pa(this.F,b,c,!0)}uc(b,c){null===this.F&&(this.F=new Map);this.pa(this.F,b,c,!1)}qd(b,c,d){if(c=c===olympe.dc.wa.ORIGIN?
554
- this.F:this.C)return(b=c.get(b))&&b.get(d)}T(b,c,d){const e=(c=c===olympe.dc.wa.ORIGIN?this.F:this.C)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}L(){return this.G===a.C.al}lf(){return this.G===a.C.qc}jd(){let b=this.properties?this.properties.size:0;this.C&&this.C.forEach(c=>{b+=c.size});return b}da(){return null!==this.properties}Cb(){let b;return null!=(b=this.properties)?b:new Map}Qa(b){if(this.properties)return this.properties.get(b)}ib(b,c=(d,e)=>[d,e]){return function*(d){if(d=d&&d.get(b.X()))for(const [e,
555
- f]of d)yield c(e,f)}(b.Pa()===olympe.dc.wa.ORIGIN?this.F:this.C)}Tb(b){const c=b.Pa()===olympe.dc.wa.ORIGIN?this.F:this.C;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}he(b=(c,d,e)=>[c,d,e]){return this.Da(this.C,b)}Qb(b=(c,d,e)=>[c,d,e]){return this.Da(this.F,b)}Eb(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.wa.ORIGIN,d=olympe.dc.wa.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,m)=>b(h,d,k,m));yield*e(g,(h,k,m)=>b(h,c,k,m))}(this.Da.bind(this),this.C,this.F)}pa(b,c,d,e){if(this.G!==
556
- a.C.qc||!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)}}*Da(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.Bf.C={al:0,Bj:1,qc:2};olympe.dc.db.Js=class{constructor(a,b,c,d){this.K=a;this.view=b;this.C=c;d&&this.init()}debug(a){const b=olympe.dc.fa(a);if(this.C.has(b)){var c=this.C.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ia()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.C.get(d[d.length-1]);const e=olympe.dc.db.Database.C.Vh+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+' (name: '+c.get(e)+') has no model.\nList: '+
557
- d.join(' --M--\x3e ')}this.K.info(a)}else this.K.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.F.Bn,b=olympe.dc.db.Database.F.Ek,c=olympe.dc.db.Database.F.qc,d=olympe.dc.db.Database.F.oj,e=olympe.dc.db.Database.F.ll,f=olympe.dc.db.Database.F.cn,g=olympe.dc.db.Database.F.dn,h=()=>{};this.C.C(olympe.dc.db.Database.F.An,()=>{});this.C.C(a,()=>{});this.C.C(b,k=>{this.C.Eb(()=>{Hf(this.view,k,h,`monitorRelations${k}`)})});this.C.C(c,
558
- k=>{this.C.Eb(()=>{If(this.view,k,`monitorRelations${k}`)})});this.C.C(d,()=>{});this.C.C(e,()=>{});this.C.C(f,()=>{});this.C.C(g,()=>{})}};olympe.dc.db.Tp=class{constructor(a,b,c,d,e){this.K=a;this.C=b;this.ta=c;this.G=d;this.L=e}write(a){if(this.G){const b=new rg(this.ta);a.Od(b);this.K.info(b.flush())}this.C.ye();a.Od(this);this.C.zd()}Ec(a,b,c){this.C.create(a,b,c,this.L)}hd(a,b){this.C.update(a,b)}F(a,b=olympe.dc.Ob.NONE){for(const c of He(this.ta,a,b))this.C.Wa(c)}Ea(a,b,c){this.C.link(a,b,c)}Xb(a,b,c){this.C.unlink(a,b,c)}};
547
+ Date?b instanceof Date&&e.getTime()===b.getTime():null!==e&&'function'===typeof e.Ha?e.Ha(b):e===b)||(d instanceof olympe.dc.lc&&(og(this.db.get(d.X())),this.db.Wa(d.X())),b instanceof olympe.dc.lc&&(d=this.db.G(b.X(),!0),d.F&&d.F.tag!==this.C&&this.db.fb().fatal('Instance',b.X(),'referenced multiple times!\nThis instance is currently property of',d.F.tag,'(for the property '+d.F.Ja+')','and is assigned as a property of',this.C,'(for the property '+a+')'),e=this.C,void 0===d.F&&(Ye(d),d.db.Vb(d.C,
548
+ e,a)),d.F={tag:e,Ja:a}),d=hg+a,null===b?(this.delete(c),b=(b=this.model())&&Ie(b,a),void 0!==b?(this.set(d,b),pg(this,a,b,!0)):pg(this,a,null,!1)):(this.set(c,b),this.delete(d),pg(this,a,b,!1)))}link(a,b){var c=X+a;const d=mg(this,Y+a);c=mg(b,c);d.has(b.C)||(d.set(b.C,b),c.set(this.C,this),this.db.F(lf.oj,this.C,a,Y,b.C),this.db.F(lf.oj,b.C,a,X,this.C),this.e&&b.e&&(qg(this,a,Y,b,!0),qg(b,a,X,this,!0)))}unlink(a,b){const c=X+a;void 0!==ng(this,Y+a,b.C)&&(ng(b,c,this.C),this.db.F(lf.kl,this.C,a,Y,
549
+ b.C),this.db.F(lf.kl,b.C,a,X,this.C),this.e&&b.e&&(qg(this,a,Y,b,!1),qg(b,a,X,this,!1)))}persist(){this.P=!0;return this}clear(){this.forEach((a,b)=>{const c=b[0];if(c===X||c===Y){const d=b.substring(1),e=c===X?Y:X;a.forEach(f=>{const g=f.get(e+d);g.delete(this.C);0===g.size&&f.delete(e+d)})}c===gg&&a instanceof olympe.dc.lc&&og(this.db.get(a.X()))});void 0!==this.F&&this.db.get(this.F.tag).delete(gg+this.F.Ja)}};olympe.dc.db.Cf=class a{constructor(b){this.mb=b;this.P=this.ga=null;this.bc=olympe.dc.Nb.NONE;this.G=a.C.Bj;this.F=this.C=this.$b=this.na=this.properties=null}toJSON(){let b='{ "tag": '+JSON.stringify(this.mb)+', "model": '+JSON.stringify(this.P)+', "src": '+JSON.stringify(this.ga)+', "state": '+JSON.stringify(this.G);if(this.properties){b+=', "properties": {';for(var c of this.properties.keys()){const d=this.properties.get(c);b+=JSON.stringify(c)+': ';b=d.toJSON?b+d.toJSON():b+JSON.stringify(d);
550
+ b+=', '}b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}'}if(this.C){b+=', "relations": {';for(const d of this.C.keys()){c=this.C.get(d);b+=JSON.stringify(d)+': {';for(const e of c.keys())b+=JSON.stringify(e)+': '+JSON.stringify(c.get(e))+', ';b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}, '}b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}'}return b+'}'}static xc(b){var c;'string'===typeof b?c=JSON.parse(b):c=b;b=new olympe.dc.db.Cf(c.tag);b.P=c.model;b.ga=c.src;b.G=c.state;const d=
551
+ c.properties;if(d){b.properties=new Map;for(var e of Object.keys(d)){const f=d[e],g=f.type;let h=f;g&&('reference'===g?h=olympe.dc.lc.xc(f):h=olympe.D.xc(f));null!==h&&void 0!==h&&b.properties.set(e,h)}}if(c=c.relations){b.C=new Map;for(const f of Object.keys(c)){e=new Map;for(const g of Object.keys(c[f]))e.set(g,c[f][g]);b.C.set(f,e)}}return b}tag(){return this.mb}Cd(){return this.P}Gb(){return this.ga}getState(){return this.G}Wa(b){if(null===this.P)this.P=b;else if(this.P!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.P}`);
552
+ return this}$(){return this.G===a.C.rc?this.bc:olympe.dc.Nb.NONE}create(b){this.G=a.C.$k;this.ga=null!=b?b:null;return this}delete(b=olympe.dc.Nb.NONE){this.G=a.C.rc;this.bc=b;this.properties=null;return this}ja(b,c){if(this.G===a.C.rc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}Hl(b){this.G!==a.C.rc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}zd(b,c){if(null!==this.na&&this.na!==b)throw Error('An instance should never be set as complex property of multiple instances');
553
+ this.na=b;this.$b=c}ub(b){let c;null==(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.C&&(this.C=new Map);b===olympe.dc.mc.nd&&this.Wa(c);this.pa(this.C,b,c,!0);return this}unlink(b,c){null===this.C&&(this.C=new Map);b===olympe.dc.mc.nd&&this.Wa(c);this.pa(this.C,b,c,!1);return this}Vb(b,c){null===this.F&&(this.F=new Map);this.pa(this.F,b,c,!0)}nc(b,c){null===this.F&&(this.F=new Map);this.pa(this.F,b,c,!1)}qd(b,c,d){if(c=c===olympe.dc.wa.ORIGIN?
554
+ this.F:this.C)return(b=c.get(b))&&b.get(d)}T(b,c,d){const e=(c=c===olympe.dc.wa.ORIGIN?this.F:this.C)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}L(){return this.G===a.C.$k}lf(){return this.G===a.C.rc}ud(){let b=this.properties?this.properties.size:0;this.C&&this.C.forEach(c=>{b+=c.size});return b}da(){return null!==this.properties}Bb(){let b;return null!=(b=this.properties)?b:new Map}Qa(b){if(this.properties)return this.properties.get(b)}ib(b,c=(d,e)=>[d,e]){return function*(d){if(d=d&&d.get(b.X()))for(const [e,
555
+ f]of d)yield c(e,f)}(b.Pa()===olympe.dc.wa.ORIGIN?this.F:this.C)}Sb(b){const c=b.Pa()===olympe.dc.wa.ORIGIN?this.F:this.C;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}ie(b=(c,d,e)=>[c,d,e]){return this.Da(this.C,b)}Pb(b=(c,d,e)=>[c,d,e]){return this.Da(this.F,b)}Db(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.wa.ORIGIN,d=olympe.dc.wa.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,m)=>b(h,d,k,m));yield*e(g,(h,k,m)=>b(h,c,k,m))}(this.Da.bind(this),this.C,this.F)}pa(b,c,d,e){if(this.G!==
556
+ a.C.rc||!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)}}*Da(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.Cf.C={$k:0,Bj:1,rc:2};olympe.dc.db.Js=class{constructor(a,b,c,d){this.K=a;this.view=b;this.C=c;d&&this.init()}debug(a){const b=olympe.dc.fa(a);if(this.C.has(b)){var c=this.C.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ia()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.C.get(d[d.length-1]);const e=olympe.dc.db.Database.C.Xh+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+' (name: '+c.get(e)+') has no model.\nList: '+
557
+ d.join(' --M--\x3e ')}this.K.info(a)}else this.K.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.F.Bn,b=olympe.dc.db.Database.F.Dk,c=olympe.dc.db.Database.F.rc,d=olympe.dc.db.Database.F.oj,e=olympe.dc.db.Database.F.kl,f=olympe.dc.db.Database.F.cn,g=olympe.dc.db.Database.F.dn,h=()=>{};this.C.C(olympe.dc.db.Database.F.An,()=>{});this.C.C(a,()=>{});this.C.C(b,k=>{this.C.Db(()=>{Hf(this.view,k,h,`monitorRelations${k}`)})});this.C.C(c,
558
+ k=>{this.C.Db(()=>{If(this.view,k,`monitorRelations${k}`)})});this.C.C(d,()=>{});this.C.C(e,()=>{});this.C.C(f,()=>{});this.C.C(g,()=>{})}};olympe.dc.db.Sp=class{constructor(a,b,c,d,e){this.K=a;this.C=b;this.ta=c;this.G=d;this.L=e}write(a){if(this.G){const b=new rg(this.ta);a.Nd(b);this.K.info(b.flush())}this.C.ye();a.Nd(this);this.C.zd()}Ec(a,b,c){this.C.create(a,b,c,this.L)}jd(a,b){this.C.update(a,b)}F(a,b=olympe.dc.Nb.NONE){for(const c of He(this.ta,a,b))this.C.Wa(c)}Ea(a,b,c){this.C.link(a,b,c)}Wb(a,b,c){this.C.unlink(a,b,c)}};
559
559
  function sg(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.lc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.X()+'")';else if(f instanceof olympe.D.Color)d+='Color("'+f.rg()+','+f.pg()+','+f.mg()+','+f.lg()+'")';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+=sg(a,f,
560
560
  (null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function tg(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function ug(a,b){let c;return b===olympe.dc.mc.nd?'Model':null!=(c=a.db.name(b))?c:b}
561
- class rg{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}`:''}`}Ec(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${sg(this,c)})`,tg(this,d))}hd(a,b,c){this.log(`updateInstance(tag: ${a}, ${sg(this,b)})`,tg(this,c))}F(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,tg(this,c))}Ea(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,ug(this,a))}Xb(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
562
- ug(this,a))}}olympe.dc.db.Tp.va=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.R={za:'dc.db.Logger',Ik:'dc.db.gc.Logger',Ga:'dc.db.DatabaseManager',Ni:'dc.db.Database',wk:'dc.db.DBView',jy:'dc.db.Graph',hx:'dc.db.DatabaseWriter',Yy:'dc.db.PermissionProcessor',Rh:'dc.db.GraphMonitor'};olympe.dc.db.U={Mn:'db.garbageCollector',Nn:'db.garbageCollectorDelay',Rh:'db.monitor',un:'db.debug'};
563
- olympe.V.config(function(a){F(a,olympe.dc.db.U.Mn,olympe.dc.db.Re.C.Fm);F(a,olympe.dc.db.U.Nn,5E3);F(a,olympe.dc.db.U.Rh,!1);F(a,olympe.dc.db.U.un,!1);E(a,olympe.dc.db.R.za,[olympe.la.R.Ga],b=>b.Fc('db'));E(a,olympe.dc.db.R.Ik,[olympe.la.R.Ga],b=>b.Fc('gc'));E(a,olympe.dc.db.R.Ni,[olympe.dc.db.R.za,olympe.dc.db.R.Ik,new olympe.V.ma(olympe.dc.U.eg),new olympe.V.ma(olympe.dc.db.U.Mn),new olympe.V.ma(olympe.dc.db.U.Nn),new olympe.V.ma(olympe.dc.U.Wg),new olympe.V.ma(olympe.dc.db.U.un)],(b,c,d,e,f,g,
564
- h)=>{e=g?olympe.dc.db.Re.C.Ak: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.R.wk,olympe.dc.$a,olympe.dc.db.R.za,olympe.dc.db.R.Ni);E(a,olympe.dc.db.R.Rh,[olympe.dc.db.R.Ga],b=>b.Tv);D(a,olympe.dc.db.R.Ga,olympe.dc.db.rr,olympe.dc.db.R.za,olympe.dc.db.R.Ni,olympe.dc.db.R.wk,new olympe.V.ma(olympe.dc.U.uf),new olympe.V.ma(olympe.dc.db.U.Rh))},'olympe.dc.db');
565
- olympe.V.run([olympe.dc.db.R.Ni,olympe.dc.db.R.Rh],(a,b)=>{olympe.Mj().db=a;olympe.Mj().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function vg(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
566
- olympe.dc.query.Me=class{constructor(a,b,c){this.db=olympe.dc.ta();this.C=a;this.Ja=b;this.Qh=c}ha(){return{p:this.Ja.X(),o:this.Qh}}toString(){return'sortByQueryPart-'+this.Qh+this.Ja.X()}ng(){const a=this.db.Tb(this.Ja,olympe.dm.Property.typeRel),b=olympe.dc.fa;if(a===b(olympe.dm.String))return vg((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return vg((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return vg((c,d)=>c.getTime()-d.getTime());olympe.la.fb('dc.query').warn(`No comparator found for type with tag ${a}`);
567
- return vg(()=>-1)}Qa(){return this.Ja}};function wg(a,b){return new olympe.dc.query.wd((new olympe.dc.transaction.gj(b)).C(a),b)}olympe.dc.query.wd=class{constructor(a,b){this.C=a;this.source=b}static Ul(a){return new olympe.dc.query.wd(new olympe.dc.db.Lc(`DataResult_${a.W()}`),a.zb())}create(a,b,c){this.C.Ec(a,this.source,c,b);return this}Ea(a,b,c){this.C.Ea(a,b,c,null,null);return this}Zc(){return this.C}ha(){const a=new olympe.dc.transaction.ag;this.C.Od(a);return{s:this.source,p:xg(a)}}};
568
- olympe.dc.query.wd.prototype.createRelation=olympe.dc.query.wd.prototype.Ea;olympe.dc.query.wd.prototype.create=olympe.dc.query.wd.prototype.create;olympe.dc.query.wd.fromQuery=olympe.dc.query.wd.Ul;olympe.dc.pe=class{X(){}};olympe.dc.pe.prototype.getTag=olympe.dc.pe.prototype.X;olympe.dc.my=olympe.dc.pe;function yg(a){let b;if(null==(b=a.C)?0:b.rh())if(a=a.L,!a.P){let c;null==(c=a.T)||c.call(a)}}function zg(a,b,c,d,e){yg(a);let f,g;b?null==(f=a.C)||f.Ea(c,d,e):null==(g=a.C)||g.Xb(c,d,e)}
569
- olympe.dc.query.Ns=class{constructor(a,b,c,d){this.K=a;this.source=b;this.G=c;this.L=d;this.C=this.F=null;this.db=olympe.dc.ta()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.G}:${a}:notif`;oe(this.db,a,(d,e)=>{if(d){yg(this);let f;null==(f=this.C)||eg(f,e)}else if(b&&Ef(this.db,e,c),!this.db.Ia(e)){yg(this);let f;null==(f=this.C)||f.F(e,olympe.dc.Ob.NONE)}},c);b&&Df(this.db,a,(d,e,f)=>{yg(this);let g;f||null!=(g=this.C)&&g.hd(a,new Map([[d,e]]))},c)}}stop(a){ne(this.db,a,`${this.G}:${a}:notif`)}};olympe.dc.query.hj={ASC:'ASC',DESC:'DESC'};function Ag(a){const b=Bg(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].W():a.G,g=0<e?b[e-1].C:'root',h=0<e&&b[e-1].T(),k=a.C.get(f),m=new Set(k.Sd()),n=new Map,p=a.L.has(f);let q=p?';':'';if(c.has(f)){const [r,t,u]=c.get(f);c.delete(f);q+=u;r.forEach((w,x)=>{for(const y of k.F(x)){let z;n.set(y,Array.from(w).map(A=>p?`${x};${A}`:A).reduce((A,M)=>A.add(M),null!=(z=n.get(y))?z:new Set))}m.delete(x)});t&&m.forEach(w=>{const x=p?`${w};${u}`:u;for(const y of k.F(w)){let z;n.set(y,
561
+ class rg{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}`:''}`}Ec(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${sg(this,c)})`,tg(this,d))}jd(a,b,c){this.log(`updateInstance(tag: ${a}, ${sg(this,b)})`,tg(this,c))}F(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,tg(this,c))}Ea(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,ug(this,a))}Wb(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
562
+ ug(this,a))}}olympe.dc.db.Sp.va=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.R={za:'dc.db.Logger',Hk:'dc.db.gc.Logger',Ga:'dc.db.DatabaseManager',Ni:'dc.db.Database',vk:'dc.db.DBView',hy:'dc.db.Graph',ex:'dc.db.DatabaseWriter',Wy:'dc.db.PermissionProcessor',Th:'dc.db.GraphMonitor'};olympe.dc.db.U={Mn:'db.garbageCollector',Nn:'db.garbageCollectorDelay',Th:'db.monitor',un:'db.debug'};
563
+ olympe.V.config(function(a){F(a,olympe.dc.db.U.Mn,olympe.dc.db.Re.C.Em);F(a,olympe.dc.db.U.Nn,5E3);F(a,olympe.dc.db.U.Th,!1);F(a,olympe.dc.db.U.un,!1);E(a,olympe.dc.db.R.za,[olympe.la.R.Ga],b=>b.Fc('db'));E(a,olympe.dc.db.R.Hk,[olympe.la.R.Ga],b=>b.Fc('gc'));E(a,olympe.dc.db.R.Ni,[olympe.dc.db.R.za,olympe.dc.db.R.Hk,new olympe.V.ma(olympe.dc.U.eg),new olympe.V.ma(olympe.dc.db.U.Mn),new olympe.V.ma(olympe.dc.db.U.Nn),new olympe.V.ma(olympe.dc.U.Wg),new olympe.V.ma(olympe.dc.db.U.un)],(b,c,d,e,f,g,
564
+ h)=>{e=g?olympe.dc.db.Re.C.zk: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.R.vk,olympe.dc.$a,olympe.dc.db.R.za,olympe.dc.db.R.Ni);E(a,olympe.dc.db.R.Th,[olympe.dc.db.R.Ga],b=>b.Sv);D(a,olympe.dc.db.R.Ga,olympe.dc.db.rr,olympe.dc.db.R.za,olympe.dc.db.R.Ni,olympe.dc.db.R.vk,new olympe.V.ma(olympe.dc.U.uf),new olympe.V.ma(olympe.dc.db.U.Th))},'olympe.dc.db');
565
+ olympe.V.run([olympe.dc.db.R.Ni,olympe.dc.db.R.Th],(a,b)=>{olympe.Mj().db=a;olympe.Mj().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function vg(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
566
+ olympe.dc.query.Me=class{constructor(a,b,c){this.db=olympe.dc.ta();this.C=a;this.Ja=b;this.Sh=c}ha(){return{p:this.Ja.X(),o:this.Sh}}toString(){return'sortByQueryPart-'+this.Sh+this.Ja.X()}ng(){const a=this.db.Sb(this.Ja,olympe.dm.Property.typeRel),b=olympe.dc.fa;if(a===b(olympe.dm.String))return vg((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return vg((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return vg((c,d)=>c.getTime()-d.getTime());olympe.la.fb('dc.query').warn(`No comparator found for type with tag ${a}`);
567
+ return vg(()=>-1)}Qa(){return this.Ja}};function wg(a,b){return new olympe.dc.query.wd((new olympe.dc.transaction.gj(b)).C(a),b)}olympe.dc.query.wd=class{constructor(a,b){this.C=a;this.source=b}static Tl(a){return new olympe.dc.query.wd(new olympe.dc.db.Lc(`DataResult_${a.W()}`),a.Gb())}create(a,b,c){this.C.Ec(a,this.source,c,b);return this}Ea(a,b,c){this.C.Ea(a,b,c,null,null);return this}Zc(){return this.C}ha(){const a=new olympe.dc.transaction.ag;this.C.Nd(a);return{s:this.source,p:xg(a)}}};
568
+ olympe.dc.query.wd.prototype.createRelation=olympe.dc.query.wd.prototype.Ea;olympe.dc.query.wd.prototype.create=olympe.dc.query.wd.prototype.create;olympe.dc.query.wd.fromQuery=olympe.dc.query.wd.Tl;olympe.dc.qe=class{X(){}};olympe.dc.qe.prototype.getTag=olympe.dc.qe.prototype.X;olympe.dc.ky=olympe.dc.qe;function yg(a){let b;if(null==(b=a.C)?0:b.sh())if(a=a.L,!a.P){let c;null==(c=a.T)||c.call(a)}}function zg(a,b,c,d,e){yg(a);let f,g;b?null==(f=a.C)||f.Ea(c,d,e):null==(g=a.C)||g.Wb(c,d,e)}
569
+ olympe.dc.query.Ns=class{constructor(a,b,c,d){this.K=a;this.source=b;this.G=c;this.L=d;this.C=this.F=null;this.db=olympe.dc.ta()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.G}:${a}:notif`;pe(this.db,a,(d,e)=>{if(d){yg(this);let f;null==(f=this.C)||eg(f,e)}else if(b&&Ef(this.db,e,c),!this.db.Ia(e)){yg(this);let f;null==(f=this.C)||f.F(e,olympe.dc.Nb.NONE)}},c);b&&Df(this.db,a,(d,e,f)=>{yg(this);let g;f||null!=(g=this.C)&&g.jd(a,new Map([[d,e]]))},c)}}stop(a){oe(this.db,a,`${this.G}:${a}:notif`)}};olympe.dc.query.hj={ASC:'ASC',DESC:'DESC'};function Ag(a){const b=Bg(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].W():a.G,g=0<e?b[e-1].C:'root',h=0<e&&b[e-1].T(),k=a.C.get(f),m=new Set(k.Rd()),n=new Map,p=a.L.has(f);let q=p?';':'';if(c.has(f)){const [r,t,u]=c.get(f);c.delete(f);q+=u;r.forEach((w,x)=>{for(const y of k.F(x)){let z;n.set(y,Array.from(w).map(A=>p?`${x};${A}`:A).reduce((A,M)=>A.add(M),null!=(z=n.get(y))?z:new Set))}m.delete(x)});t&&m.forEach(w=>{const x=p?`${w};${u}`:u;for(const y of k.F(w)){let z;n.set(y,
570
570
  (null!=(z=n.get(y))?z:new Set).add(x))}})}else m.forEach(r=>{const t=p?`${r};`:'';for(const u of k.F(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),w=new Map;n.forEach((x,y)=>{let z;null==(z=r.get(y))||z.forEach(A=>{let M;const K=null!=(M=w.get(y))?M:new Set;x.forEach(pa=>K.add(pa+A));w.set(y,K)});n.delete(y);r.delete(y)});t&&n.forEach((x,y)=>{w.set(y,new Set(Array.from(x).map(z=>z+u)))});b[e-1].T()&&r.forEach((x,y)=>{w.set(y,new Set(Array.from(x).map(z=>
571
- q+z)))});c.set(g,[w,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 Cg(a){if(null===a.F){const b={yb:a.query.ng(),gd:a.gd,max:a.query.C.max,offset:a.query.C.offset};a.F=olympe.dc.La.from(a.$,Ag(a),b)}return a.F}function Dg(a,b){a.T=b}function Eg(a){if(!a.P){null!==a.F&&(a.$=a.F);a.F=null;a.P=!0;let b;null==(b=a.T)||b.call(a)}}
572
- function Fg(a,b){let c;return null!=(c=a.C.get(b).Sd())?c:[]}function Gg(a,b,c){let d,e;return null!=(e=null==(d=a.C.get(c))?void 0:d.has(b))?e:!1}function Hg(a,b,c=a.G,d='root'){const e=a.C.get(c);if(!e)return a.K.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.G(b,d)&&Eg(a);let g;f&&(null==(g=a.je)||g.watch(b,a.L.has(c)));return f}function Ig(a,b,c,d,e,f){null!==a.je&&(d===olympe.dc.wa.ORIGIN?zg(a.je,b,c,f,e):zg(a.je,b,c,e,f))}
573
- function Jg(a){a.K.C()&&a.K.debug(`Start sending notifications for query ${a.query.W()}`);const b=new olympe.dc.query.Ns(a.K,a.query.zb(),a.query.W(),a);a.C.forEach((c,d)=>{for(const e of c.Sd())b.watch(e,a.L.has(d))});null!=b.C||(b.C=new olympe.dc.db.Lc);a.je=b}function Kg(a){null!==a.je&&(a.K.C()&&a.K.debug(`Stop sending notifications for query ${a.query.W()}`),a.C.forEach(b=>{for(const c of b.Sd())a.je.stop(c)}),a.je=null)}
574
- function Lg(a){a.P=!1;if(null!=(a=a.je)){let b;const c=!(null==(b=a.C)?0:b.rh());a.F=c?a.C:null;c&&(a.C=new olympe.dc.db.Lc,a.K.C()&&a.K.debug(`Commit notification with ${a.F.G()} operations for query ${a.G}`))}}
575
- olympe.dc.query.Vo=class{constructor(a,b){this.K=a;this.query=b;this.G=olympe.Z.nb(b.F);this.ya=new Map;this.C=(new Map).set(this.G,new olympe.dc.query.ya.tl);this.L=new Set(b.L);this.gd=-1;this.P=!1;this.T=null;this.$=olympe.dc.La.empty();this.je=this.F=null;a=Bg(b);a.forEach(c=>{const d=c.W();this.ya.set(d,c.L());this.C.set(d,c.na())});b=b.ng();if(null!==b){b=b.C;let c=-1;for(const d of[this.G].concat(a.map(e=>e.W())))if(c+=this.L.has(d)?1:0,b===d){this.gd=c;break}}}remove(a,b=this.G,c='root'){b=
576
- this.C.get(b);if(null==b||!b.has(a))return!0;b.remove(a,c)&&Eg(this);if(!b.has(a)){let d;null==(d=this.je)||d.stop(a);return!0}return!1}vc(a){const b=a.F,c=olympe.Z.nb(b);a=Bg(a);const d=[];for(const [f,g]of this.C){if(g.P(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.C))?g:[]).flatMap(k=>f.da(k,this.ya.get(k))).filter(k=>{let m,n;return null!=(n=null==(m=this.ya.get(k))?void 0:m.vc(f))?n:!1});e.set(f.W(),h);return 0<h.length})}};function Mg(a){var b=olympe.dc.query.Ca.C.Gp;const c=olympe.dc.query.Ca.C.Cn,d=olympe.dc.query.Ca.C.Li,e=olympe.dc.query.Ca.C.ao,f=olympe.dc.query.Ca.C.Bo,g=olympe.dc.query.Ca.C.ep,h=olympe.dc.query.Ca.C.Dm,k=olympe.dc.query.Ca.C.Ko;switch(a.pr){case b:return new olympe.dc.query.Y.wl(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.D.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.Y.Zd(a.p,b,olympe.dc.ta());case d:return new olympe.dc.query.Y.Ne(a.p,
577
- a.s,olympe.dc.ta(),a.c);case e:return new olympe.dc.query.Y.Nh(olympe.dc.ta(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Y.Ld(Mg(a.v));case g:return new olympe.dc.query.Y.Ze(a.p,new RegExp(a.r),olympe.dc.ta(),a.c);case k:return new olympe.dc.query.Y.ce(...a.p.map(m=>Mg(m)));case h:return new olympe.dc.query.Y.kd(...a.p.map(m=>Mg(m)));default:return null}}
578
- olympe.dc.query.Ca=class{observe(){}lb(){}compile(){return[[this]]}Sc(){return new olympe.dc.query.Y.Ld(this)}Cb(){}vc(){}clear(){}ha(){}Cc(){}toString(){}Ha(a){return this===a}static Fv(...a){return new olympe.dc.query.Y.wl(a)}static Ha(a,b){return new olympe.dc.query.Y.Zd(a,b,olympe.dc.ta())}static contains(a,b,c=!0){return new olympe.dc.query.Y.Ne(a,b,olympe.dc.ta(),c)}static nw(a,b,c=!0){return new olympe.dc.query.Y.Ze(a,b,olympe.dc.ta(),c)}static Tj(a,b,c=!0){return new olympe.dc.query.Y.Nh(olympe.dc.ta(),
579
- a,b,!1,c)}static Ci(a,b,c=!0){return new olympe.dc.query.Y.Nh(olympe.dc.ta(),a,b,!0,c)}static and(...a){return new olympe.dc.query.Y.kd(...a)}static or(...a){return new olympe.dc.query.Y.ce(...a)}static Sc(a){return new olympe.dc.query.Y.Ld(a)}};olympe.dc.query.Ca.not=olympe.dc.query.Ca.Sc;olympe.dc.query.Ca.or=olympe.dc.query.Ca.or;olympe.dc.query.Ca.and=olympe.dc.query.Ca.and;olympe.dc.query.Ca.smallerThan=olympe.dc.query.Ca.Ci;olympe.dc.query.Ca.greaterThan=olympe.dc.query.Ca.Tj;
580
- olympe.dc.query.Ca.regex=olympe.dc.query.Ca.nw;olympe.dc.query.Ca.contains=olympe.dc.query.Ca.contains;olympe.dc.query.Ca.equals=olympe.dc.query.Ca.Ha;olympe.dc.query.Ca['in']=olympe.dc.query.Ca.Fv;olympe.dc.query.Ca.C={Gp:0,Cn:1,Li:2,ao:3,Bo:4,ep:5,Ko:6,Dm:7};function Bg(a){return Array.from(a.ya)}function Ng(a,b=a.G){return 0<=b?a.ya[b].W():olympe.Z.nb(a.F)}function Og(a,b,c,d=!1){var e=olympe.dc.Ob.Ef;d=d?olympe.dc.ra.tc.Qg:olympe.dc.ra.tc.Tf;b=olympe.dc.fa(b);const f=olympe.dc.Fd().Ce(b);b=(new olympe.dc.ra(b,f)).Nd();b.ya=[new olympe.dc.query.ya.ne(Ng(b),e,c)];return b.observe(a,d)}
581
- function Pg(a,b){const c=b.W();let d=a.G+1;for(;d<a.ya.length&&a.ya[d].W()!==c;)d++;b=d<a.ya.length?a.ya:a.ya.concat(b);return new olympe.dc.ra(a.F,a.source,b,d,a.L,a.C)}function Qg(a){const b=0===a.L.size?a.Nd():a;if(null!==b.C.gd&&!b.L.has(Ng(a,b.C.gd)))throw Error('AndReturn was not called for the current level before sortBy operator');return b}
582
- olympe.dc.ra=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,gd:null,rf:null}){this.db=olympe.dc.ta();this.F=a;this.source=b;this.ya=c;this.G=d;this.L=e;this.C=f;this.id=null}static from(a,b){a=olympe.dc.fa(a);if(!olympe.dc.CloudObject.exists(a))throw Error(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);b=null!=b?b:olympe.dc.Fd().Ce(a);b=new olympe.dc.ra(a,b);b.C.rf=olympe.dc.ta().model(a);return b}static Ce(a,b,c){if(!olympe.dc.CloudObject.exists(b))throw Error(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);
583
- a=olympe.dc.fa(a);c=null!=c?c:olympe.dc.Fd().fromModel(b);c=new olympe.dc.ra(a,c);c.C.rf=olympe.dc.fa(b);return c}static Vj(a,b=!0,c){a=olympe.dc.fa(a);c=null!=c?c:olympe.dc.Fd().fromModel(a);return b?(new olympe.dc.ra(a,c)).Mf(olympe.dc.CloudObject.extendedByRel,!0).eb(olympe.dc.CloudObject.instancesRel):(new olympe.dc.ra(a,c)).eb(olympe.dc.CloudObject.instancesRel)}static cc(a,b,c,d,e=!1){e=e?olympe.dc.ra.tc.Qg:olympe.dc.ra.tc.Tf;b=olympe.dc.fa(b);d=null!=d?d:olympe.dc.Fd().Ce(b);d=(new olympe.dc.ra(b,
584
- d)).Nd();d.ya=[new olympe.dc.query.ya.ne(Ng(d),c)];return d.observe(a,e)}eb(a,b=!1){return Pg(this,new olympe.dc.query.ya.Wf(Ng(this),a,b))}Mf(a,b=!1,c=!1){return Pg(this,new olympe.dc.query.ya.zf(Ng(this),a,b,c))}Nd(){const a=(new Set(this.L)).add(Ng(this));return new olympe.dc.ra(this.F,this.source,this.ya,this.G,a,this.C)}filter(a){const b=Array.from(this.ya);b[this.G]=b[this.G].filter(a);return new olympe.dc.ra(this.F,this.source,b,this.G,this.L,this.C)}gi(){return this}om(a,b=0){return new olympe.dc.ra(this.F,
585
- this.source,this.ya,this.G,this.L,{gd:this.C.gd,max:a,offset:b,rf:this.C.rf})}bk(a,b=olympe.dc.query.hj.ASC){if(0>this.G)throw Error('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');const c=this.ya[this.G],d={gd:this.G,max:this.C.max,offset:this.C.offset,rf:this.C.rf},e=Array.from(this.ya);e[this.G]=c.sort(a,b);return new olympe.dc.ra(this.F,this.source,e,this.G,this.L,d)}ng(){const a=this.C.gd;let b;return null!==a?null==(b=this.ya[a])?void 0:b.ng():
586
- null}back(a=1){if(0>this.G||1>a)return this;let b=this.G;for(let c=0;c<a;c++){const d=this.ya[b].C;for(b--;-1<b&&Ng(this,b)!==d;)b--}return new olympe.dc.ra(this.F,this.source,Array.from(this.ya),b,this.L,this.C)}parse(){const a=new Map,b=Ng(this,-1),c={limit:this.C.max,offset:this.C.offset,returned:this.L.has(b),optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.si(this.F)?c.dataType=olympe.dc.fa(this.F):(c.root=olympe.dc.fa(this.F),c.dataType=this.C.rf);this.ya.forEach((d,e)=>{const f=d.W(),
587
- g=d.Cc();Object.assign(g,{returned:this.L.has(f),next:[]});a.set(f,g);g.sort&&this.C.gd!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.ya.Wf&&d.P().Ha(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.ya.zf&&d.P().Ha(olympe.dc.CloudObject.extendedByRel))Object.assign(c,g),c.inheritance=!0;else{let h;null==(h=a.get(d.C))||h.next.push(g)}});return c}lb(a,b=!1){a='function'===typeof a.F?a.F():a;b=b?olympe.dc.ra.tc.Qg:olympe.dc.ra.tc.jl;return olympe.dc.query.Sj().executeQuery(Qg(this),
588
- a,b).then(c=>{let d;return null!=(d=null==c?void 0:Cg(c))?d:olympe.dc.La.empty()})}Ad(){return Cg(Rg(olympe.dc.query.Sj(),Qg(this)))}observe(a,b=olympe.dc.ra.tc.Tf){a='function'===typeof a.F?a.F():a;return Sg(olympe.dc.query.Sj(),Qg(this),a,olympe.dc.Ra.SELF,b).pipe(rxjs.operators.map(c=>Cg(c)),rxjs.operators.distinctUntilChanged())}W(){null===this.id&&(this.id=olympe.Z.nb(this.F+Bg(this).map(a=>a.toString()).join()+Array.from(new Set(this.L)).sort().toString()+this.C.gd+this.C.max+this.C.offset));
589
- return this.id}zb(){return this.source}ha(){let a;return{b:this.F,p:this.ya.map(b=>b.ha()),r:Array.from(this.L),s:this.source,e:{m:this.C.max,o:this.C.offset,s:this.C.gd,rm:null!=(a=this.C.rf)?a:this.db.model(this.F)}}}toString(){return`Query: ${JSON.stringify(this.ha())}`}};olympe.dc.ra.prototype.observe=olympe.dc.ra.prototype.observe;olympe.dc.ra.prototype.executeFromCache=olympe.dc.ra.prototype.Ad;olympe.dc.ra.prototype.execute=olympe.dc.ra.prototype.lb;olympe.dc.ra.prototype.parse=olympe.dc.ra.prototype.parse;
590
- olympe.dc.ra.prototype.back=olympe.dc.ra.prototype.back;olympe.dc.ra.prototype.sortBy=olympe.dc.ra.prototype.bk;olympe.dc.ra.prototype.limit=olympe.dc.ra.prototype.om;olympe.dc.ra.prototype.cast=olympe.dc.ra.prototype.gi;olympe.dc.ra.prototype.filter=olympe.dc.ra.prototype.filter;olympe.dc.ra.prototype.andReturn=olympe.dc.ra.prototype.Nd;olympe.dc.ra.prototype.followRecursively=olympe.dc.ra.prototype.Mf;olympe.dc.ra.prototype.follow=olympe.dc.ra.prototype.eb;olympe.dc.ra.followRule=olympe.dc.ra.cc;
591
- olympe.dc.ra.instancesOf=olympe.dc.ra.Vj;olympe.dc.ra.fromTag=olympe.dc.ra.Ce;olympe.dc.ra.from=olympe.dc.ra.from;olympe.dc.ra.tc={Tf:1,jl:2,Qg:3};function Rg(a,b){const c=new olympe.dc.query.Vo(a.K,b);if(a.F.view.Ia(b.F)){Hg(c,b.F);for(const d of Bg(b))d.lb(c)}return c}
592
- function Sg(a,b,c,d,e){const f=b.W();let g=a.C.get(f);if(!g){var h=b.zb();a.K.debug(`Create new subscription for query ${f} for subscriber ${d}, to be executed by the data source ${h}`);h=a.L&&h===olympe.dc.Ra.SERVER?[]:Array.from(a.C.values());g=new olympe.dc.query.ap(a.K,a.F,b,a.P.bind(a,e));a.C.set(f,g);Tg(g,k=>a.G.add(k));g.start(h)}return new rxjs.Observable(k=>{const m=()=>v(function*(){n&&c.ze(n);if(p){var q=p;const t=a.C.get(f);a.K.debug(`${d} unsubscribed from ${f}`);if(null==t)q=0;else{var r=
571
+ q+z)))});c.set(g,[w,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 Cg(a){if(null===a.F){const b={yb:a.query.ng(),hd:a.hd,max:a.query.C.max,offset:a.query.C.offset};a.F=olympe.dc.La.from(a.$,Ag(a),b)}return a.F}function Dg(a,b){a.T=b}function Eg(a){if(!a.P){null!==a.F&&(a.$=a.F);a.F=null;a.P=!0;let b;null==(b=a.T)||b.call(a)}}
572
+ function Fg(a,b){let c;return null!=(c=a.C.get(b).Rd())?c:[]}function Gg(a,b,c){let d,e;return null!=(e=null==(d=a.C.get(c))?void 0:d.has(b))?e:!1}function Hg(a,b,c=a.G,d='root'){const e=a.C.get(c);if(!e)return a.K.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.G(b,d)&&Eg(a);let g;f&&(null==(g=a.ke)||g.watch(b,a.L.has(c)));return f}function Ig(a,b,c,d,e,f){null!==a.ke&&(d===olympe.dc.wa.ORIGIN?zg(a.ke,b,c,f,e):zg(a.ke,b,c,e,f))}
573
+ function Jg(a){a.K.C()&&a.K.debug(`Start sending notifications for query ${a.query.W()}`);const b=new olympe.dc.query.Ns(a.K,a.query.Gb(),a.query.W(),a);a.C.forEach((c,d)=>{for(const e of c.Rd())b.watch(e,a.L.has(d))});null!=b.C||(b.C=new olympe.dc.db.Lc);a.ke=b}function Kg(a){null!==a.ke&&(a.K.C()&&a.K.debug(`Stop sending notifications for query ${a.query.W()}`),a.C.forEach(b=>{for(const c of b.Rd())a.ke.stop(c)}),a.ke=null)}
574
+ function Lg(a){a.P=!1;if(null!=(a=a.ke)){let b;const c=!(null==(b=a.C)?0:b.sh());a.F=c?a.C:null;c&&(a.C=new olympe.dc.db.Lc,a.K.C()&&a.K.debug(`Commit notification with ${a.F.G()} operations for query ${a.G}`))}}
575
+ olympe.dc.query.To=class{constructor(a,b){this.K=a;this.query=b;this.G=olympe.Z.nb(b.F);this.ya=new Map;this.C=(new Map).set(this.G,new olympe.dc.query.ya.sl);this.L=new Set(b.L);this.hd=-1;this.P=!1;this.T=null;this.$=olympe.dc.La.empty();this.ke=this.F=null;a=Bg(b);a.forEach(c=>{const d=c.W();this.ya.set(d,c.L());this.C.set(d,c.na())});b=b.ng();if(null!==b){b=b.C;let c=-1;for(const d of[this.G].concat(a.map(e=>e.W())))if(c+=this.L.has(d)?1:0,b===d){this.hd=c;break}}}remove(a,b=this.G,c='root'){b=
576
+ this.C.get(b);if(null==b||!b.has(a))return!0;b.remove(a,c)&&Eg(this);if(!b.has(a)){let d;null==(d=this.ke)||d.stop(a);return!0}return!1}wc(a){const b=a.F,c=olympe.Z.nb(b);a=Bg(a);const d=[];for(const [f,g]of this.C){if(g.P(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.C))?g:[]).flatMap(k=>f.da(k,this.ya.get(k))).filter(k=>{let m,n;return null!=(n=null==(m=this.ya.get(k))?void 0:m.wc(f))?n:!1});e.set(f.W(),h);return 0<h.length})}};function Mg(a){var b=olympe.dc.query.Ca.C.Ep;const c=olympe.dc.query.Ca.C.Cn,d=olympe.dc.query.Ca.C.Li,e=olympe.dc.query.Ca.C.Zn,f=olympe.dc.query.Ca.C.zo,g=olympe.dc.query.Ca.C.bp,h=olympe.dc.query.Ca.C.Cm,k=olympe.dc.query.Ca.C.Io;switch(a.pr){case b:return new olympe.dc.query.Y.vl(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.D.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.Y.Yd(a.p,b,olympe.dc.ta());case d:return new olympe.dc.query.Y.Ne(a.p,
577
+ a.s,olympe.dc.ta(),a.c);case e:return new olympe.dc.query.Y.Ph(olympe.dc.ta(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Y.Kd(Mg(a.v));case g:return new olympe.dc.query.Y.Ye(a.p,new RegExp(a.r),olympe.dc.ta(),a.c);case k:return new olympe.dc.query.Y.be(...a.p.map(m=>Mg(m)));case h:return new olympe.dc.query.Y.kd(...a.p.map(m=>Mg(m)));default:return null}}
578
+ olympe.dc.query.Ca=class{observe(){}lb(){}compile(){return[[this]]}Sc(){return new olympe.dc.query.Y.Kd(this)}Bb(){}wc(){}clear(){}ha(){}Cc(){}toString(){}Ha(a){return this===a}static Ev(...a){return new olympe.dc.query.Y.vl(a)}static Ha(a,b){return new olympe.dc.query.Y.Yd(a,b,olympe.dc.ta())}static contains(a,b,c=!0){return new olympe.dc.query.Y.Ne(a,b,olympe.dc.ta(),c)}static mw(a,b,c=!0){return new olympe.dc.query.Y.Ye(a,b,olympe.dc.ta(),c)}static Tj(a,b,c=!0){return new olympe.dc.query.Y.Ph(olympe.dc.ta(),
579
+ a,b,!1,c)}static Ci(a,b,c=!0){return new olympe.dc.query.Y.Ph(olympe.dc.ta(),a,b,!0,c)}static and(...a){return new olympe.dc.query.Y.kd(...a)}static or(...a){return new olympe.dc.query.Y.be(...a)}static Sc(a){return new olympe.dc.query.Y.Kd(a)}};olympe.dc.query.Ca.not=olympe.dc.query.Ca.Sc;olympe.dc.query.Ca.or=olympe.dc.query.Ca.or;olympe.dc.query.Ca.and=olympe.dc.query.Ca.and;olympe.dc.query.Ca.smallerThan=olympe.dc.query.Ca.Ci;olympe.dc.query.Ca.greaterThan=olympe.dc.query.Ca.Tj;
580
+ olympe.dc.query.Ca.regex=olympe.dc.query.Ca.mw;olympe.dc.query.Ca.contains=olympe.dc.query.Ca.contains;olympe.dc.query.Ca.equals=olympe.dc.query.Ca.Ha;olympe.dc.query.Ca['in']=olympe.dc.query.Ca.Ev;olympe.dc.query.Ca.C={Ep:0,Cn:1,Li:2,Zn:3,zo:4,bp:5,Io:6,Cm:7};function Bg(a){return Array.from(a.ya)}function Ng(a,b=a.G){return 0<=b?a.ya[b].W():olympe.Z.nb(a.F)}function Og(a,b,c,d=!1){var e=olympe.dc.Nb.Ff;d=d?olympe.dc.ra.uc.Qg:olympe.dc.ra.uc.Tf;b=olympe.dc.fa(b);const f=olympe.dc.Ed().Ce(b);b=(new olympe.dc.ra(b,f)).Md();b.ya=[new olympe.dc.query.ya.oe(Ng(b),e,c)];return b.observe(a,d)}
581
+ function Pg(a,b){const c=b.W();let d=a.G+1;for(;d<a.ya.length&&a.ya[d].W()!==c;)d++;b=d<a.ya.length?a.ya:a.ya.concat(b);return new olympe.dc.ra(a.F,a.source,b,d,a.L,a.C)}function Qg(a){const b=0===a.L.size?a.Md():a;if(null!==b.C.hd&&!b.L.has(Ng(a,b.C.hd)))throw Error('AndReturn was not called for the current level before sortBy operator');return b}
582
+ olympe.dc.ra=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,hd:null,rf:null}){this.db=olympe.dc.ta();this.F=a;this.source=b;this.ya=c;this.G=d;this.L=e;this.C=f;this.id=null}static from(a,b){a=olympe.dc.fa(a);if(!olympe.dc.CloudObject.exists(a))throw Error(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);b=null!=b?b:olympe.dc.Ed().Ce(a);b=new olympe.dc.ra(a,b);b.C.rf=olympe.dc.ta().model(a);return b}static Ce(a,b,c){if(!olympe.dc.CloudObject.exists(b))throw Error(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);
583
+ a=olympe.dc.fa(a);c=null!=c?c:olympe.dc.Ed().fromModel(b);c=new olympe.dc.ra(a,c);c.C.rf=olympe.dc.fa(b);return c}static Vj(a,b=!0,c){const d=olympe.dc.fa(a);if(!olympe.dc.ta().uh(d))throw Error(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);a=null!=c?c:olympe.dc.Ed().fromModel(d);return b?(new olympe.dc.ra(d,a)).Mf(olympe.dc.CloudObject.extendedByRel,!0).eb(olympe.dc.CloudObject.instancesRel):(new olympe.dc.ra(d,a)).eb(olympe.dc.CloudObject.instancesRel)}static bc(a,
584
+ b,c,d,e=!1){e=e?olympe.dc.ra.uc.Qg:olympe.dc.ra.uc.Tf;b=olympe.dc.fa(b);d=null!=d?d:olympe.dc.Ed().Ce(b);d=(new olympe.dc.ra(b,d)).Md();d.ya=[new olympe.dc.query.ya.oe(Ng(d),c)];return d.observe(a,e)}eb(a,b=!1){return Pg(this,new olympe.dc.query.ya.Wf(Ng(this),a,b))}Mf(a,b=!1,c=!1){return Pg(this,new olympe.dc.query.ya.zf(Ng(this),a,b,c))}Md(){const a=(new Set(this.L)).add(Ng(this));return new olympe.dc.ra(this.F,this.source,this.ya,this.G,a,this.C)}filter(a){const b=Array.from(this.ya);b[this.G]=
585
+ b[this.G].filter(a);return new olympe.dc.ra(this.F,this.source,b,this.G,this.L,this.C)}hi(){return this}nm(a,b=0){return new olympe.dc.ra(this.F,this.source,this.ya,this.G,this.L,{hd:this.C.hd,max:a,offset:b,rf:this.C.rf})}bk(a,b=olympe.dc.query.hj.ASC){if(0>this.G)throw Error('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');const c=this.ya[this.G],d={hd:this.G,max:this.C.max,offset:this.C.offset,rf:this.C.rf},e=Array.from(this.ya);e[this.G]=c.sort(a,
586
+ b);return new olympe.dc.ra(this.F,this.source,e,this.G,this.L,d)}ng(){const a=this.C.hd;let b;return null!==a?null==(b=this.ya[a])?void 0:b.ng():null}back(a=1){if(0>this.G||1>a)return this;let b=this.G;for(let c=0;c<a;c++){const d=this.ya[b].C;for(b--;-1<b&&Ng(this,b)!==d;)b--}return new olympe.dc.ra(this.F,this.source,Array.from(this.ya),b,this.L,this.C)}parse(){const a=new Map,b=Ng(this,-1),c={limit:this.C.max,offset:this.C.offset,returned:this.L.has(b),optional:!1,inheritance:!1,next:[]};a.set(b,
587
+ c);this.db.uh(this.F)?c.dataType=olympe.dc.fa(this.F):(c.root=olympe.dc.fa(this.F),c.dataType=this.C.rf);this.ya.forEach((d,e)=>{const f=d.W(),g=d.Cc();Object.assign(g,{returned:this.L.has(f),next:[]});a.set(f,g);g.sort&&this.C.hd!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.ya.Wf&&d.P().Ha(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.ya.zf&&d.P().Ha(olympe.dc.CloudObject.extendedByRel))Object.assign(c,g),c.inheritance=!0;else{let h;
588
+ null==(h=a.get(d.C))||h.next.push(g)}});return c}lb(a,b=!1){a='function'===typeof a.F?a.F():a;b=b?olympe.dc.ra.uc.Qg:olympe.dc.ra.uc.il;return olympe.dc.query.Sj().executeQuery(Qg(this),a,b).then(c=>{let d;return null!=(d=null==c?void 0:Cg(c))?d:olympe.dc.La.empty()})}Ad(){return Cg(Rg(olympe.dc.query.Sj(),Qg(this)))}observe(a,b=olympe.dc.ra.uc.Tf){a='function'===typeof a.F?a.F():a;return Sg(olympe.dc.query.Sj(),Qg(this),a,olympe.dc.Ra.SELF,b).pipe(rxjs.operators.map(c=>Cg(c)),rxjs.operators.distinctUntilChanged())}W(){null===
589
+ this.id&&(this.id=olympe.Z.nb(this.F+Bg(this).map(a=>a.toString()).join()+Array.from(new Set(this.L)).sort().toString()+this.C.hd+this.C.max+this.C.offset));return this.id}Gb(){return this.source}ha(){let a;return{b:this.F,p:this.ya.map(b=>b.ha()),r:Array.from(this.L),s:this.source,e:{m:this.C.max,o:this.C.offset,s:this.C.hd,rm:null!=(a=this.C.rf)?a:this.db.model(this.F)}}}toString(){return`Query: ${JSON.stringify(this.ha())}`}};olympe.dc.ra.prototype.observe=olympe.dc.ra.prototype.observe;
590
+ olympe.dc.ra.prototype.executeFromCache=olympe.dc.ra.prototype.Ad;olympe.dc.ra.prototype.execute=olympe.dc.ra.prototype.lb;olympe.dc.ra.prototype.parse=olympe.dc.ra.prototype.parse;olympe.dc.ra.prototype.back=olympe.dc.ra.prototype.back;olympe.dc.ra.prototype.sortBy=olympe.dc.ra.prototype.bk;olympe.dc.ra.prototype.limit=olympe.dc.ra.prototype.nm;olympe.dc.ra.prototype.cast=olympe.dc.ra.prototype.hi;olympe.dc.ra.prototype.filter=olympe.dc.ra.prototype.filter;olympe.dc.ra.prototype.andReturn=olympe.dc.ra.prototype.Md;
591
+ olympe.dc.ra.prototype.followRecursively=olympe.dc.ra.prototype.Mf;olympe.dc.ra.prototype.follow=olympe.dc.ra.prototype.eb;olympe.dc.ra.followRule=olympe.dc.ra.bc;olympe.dc.ra.instancesOf=olympe.dc.ra.Vj;olympe.dc.ra.fromTag=olympe.dc.ra.Ce;olympe.dc.ra.from=olympe.dc.ra.from;olympe.dc.ra.uc={Tf:1,il:2,Qg:3};function Rg(a,b){const c=new olympe.dc.query.To(a.K,b);if(a.F.view.Ia(b.F)){Hg(c,b.F);for(const d of Bg(b))d.lb(c)}return c}
592
+ function Sg(a,b,c,d,e){const f=b.W();let g=a.C.get(f);if(!g){var h=b.Gb();a.K.debug(`Create new subscription for query ${f} for subscriber ${d}, to be executed by the data source ${h}`);h=a.L&&h===olympe.dc.Ra.SERVER?[]:Array.from(a.C.values());g=new olympe.dc.query.Zo(a.K,a.F,b,a.P.bind(a,e));a.C.set(f,g);Tg(g,k=>a.G.add(k));g.start(h)}return new rxjs.Observable(k=>{const m=()=>v(function*(){n&&c.ze(n);if(p){var q=p;const t=a.C.get(f);a.K.debug(`${d} unsubscribed from ${f}`);if(null==t)q=0;else{var r=
593
593
  t;r.G.delete(q)&&r.K.debug(`Remove subscriber ${d} for query ${r.query.W()}, now have ${r.G.size} subscribers`);d!==olympe.dc.Ra.SELF&&(r.$--,0===r.$&&Kg(r.C));q=0===r.G.size}q&&(a.K.debug(`No more subscriber to ${f}, remove the subscription`),a.G.delete(f),a.C.delete(f),t.destroy())}k.complete()}),n=c.$(m),p=Ug(g,d,k);return m})}function Vg(a){a.G.forEach(b=>{let c;null==(c=a.C.get(b))||Wg(c)});a.G.clear()}
594
- function Xg(a){a.K.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.C.oe,olympe.dc.Ra.SERVER);return a.fc.request(b).then(c=>{a.F.dd(c.Zc())})}function Yg(a,b){const c=b.zb();if(c===olympe.dc.Ra.SELF||a.L&&c===olympe.dc.Ra.SERVER)return Promise.resolve(!0);a=Array.from(a.C.values()).filter(d=>d.vc(b)).map(d=>new Promise(e=>d.bd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}
595
- function Zg(a){switch(a){case olympe.dc.ra.tc.Tf:case olympe.dc.ra.tc.jl:return olympe.dc.Request.C.Rg;case olympe.dc.ra.tc.Qg:return olympe.dc.Request.C.Ki;default:throw Error(`Unknown query type: ${a}`);}}function $g(a,b,c,d){a.fc.request(b).then(e=>{a.F.dd(e.Zc());c()}).catch(d)}function ah(a,b,c){const d=[];for(const e of a.C.values())bh(e,b,c)&&d.push(new Promise((f,g)=>{const h=new olympe.dc.Request(olympe.dc.Request.C.Rg,b,e.query);$g(a,h,f,g)}));return Promise.all(d).then()}
596
- olympe.dc.query.$s=class{constructor(a,b,c,d){this.K=a;this.F=b;this.fc=c;this.L=d;this.C=new Map;this.G=new Set;nf(b,()=>Vg(this));c.L(olympe.dc.Request.C.sn,e=>{this.F.dd(e.content)})}executeQuery(a,b,c){const d=this;return v(function*(){const e=a.zb();if(!(yield Yg(d,a))){var f=Zg(c);f=new olympe.dc.Request(f,e,a);try{const g=yield d.fc.request(f);if(b.Bc()||b.gb())return null;d.F.dd(g.Zc())}catch(g){return d.K.error(`Error while sending a query to data source ${e}: ${g}`),null}}return Rg(d,a)})}P(a,
597
- b,c,d){const e=b.zb();if(e===olympe.dc.Ra.SELF||this.L&&e===olympe.dc.Ra.SERVER)return c(),null;var f=Zg(a);const g=new olympe.dc.Request(f,e,b);if(a===olympe.dc.ra.tc.Qg)return $g(this,g,c,d),null;let h;a=n=>{h=[];n&&this.K.info(`Resend subscription ${b.W()} after detection of dead subscription in the remote service`);$g(this,g,()=>{let p;null==(p=h)||p.forEach(q=>this.F.dd(q));h=null;c()},d)};const k=b.W();a(!1);f=new olympe.dc.Request(olympe.dc.Request.C.mj,e,b);const m=this.fc.T(f,a.bind(this,
598
- !0)).subscribe(rxjs.Subscriber.create(n=>{Array.isArray(h)?h.push(n):this.F.dd(n)},n=>{this.K.error(`An error occurred with the subscription ${k}: ${n}`);d(String(n))}));return()=>{this.K.debug(`Unsubscribe to query ${k} from data source ${e}`);m.unsubscribe()}}};function se(a){return a.L.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function te(a){return a.G.map(b=>a.F.get(a.C[b]))}function ch(a){const b=olympe.dc.ta();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ia(g)?olympe.dc.CloudObject.get(g):(olympe.la.fb('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.La.create(d,a.a,a.r)}
594
+ function Xg(a){a.K.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.C.pe,olympe.dc.Ra.SERVER);return a.ec.request(b).then(c=>{a.F.ed(c.Zc())})}function Yg(a,b){const c=b.Gb();if(c===olympe.dc.Ra.SELF||a.L&&c===olympe.dc.Ra.SERVER)return Promise.resolve(!0);a=Array.from(a.C.values()).filter(d=>d.wc(b)).map(d=>new Promise(e=>d.cd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}
595
+ function Zg(a){switch(a){case olympe.dc.ra.uc.Tf:case olympe.dc.ra.uc.il:return olympe.dc.Request.C.Rg;case olympe.dc.ra.uc.Qg:return olympe.dc.Request.C.Ki;default:throw Error(`Unknown query type: ${a}`);}}function $g(a,b,c,d){a.ec.request(b).then(e=>{a.F.ed(e.Zc());c()}).catch(d)}function ah(a,b,c){const d=[];for(const e of a.C.values())bh(e,b,c)&&d.push(new Promise((f,g)=>{const h=new olympe.dc.Request(olympe.dc.Request.C.Rg,b,e.query);$g(a,h,f,g)}));return Promise.all(d).then()}
596
+ olympe.dc.query.$s=class{constructor(a,b,c,d){this.K=a;this.F=b;this.ec=c;this.L=d;this.C=new Map;this.G=new Set;nf(b,()=>Vg(this));c.L(olympe.dc.Request.C.sn,e=>{this.F.ed(e.content)})}executeQuery(a,b,c){const d=this;return v(function*(){const e=a.Gb();if(!(yield Yg(d,a))){var f=Zg(c);f=new olympe.dc.Request(f,e,a);try{const g=yield d.ec.request(f);if(b.Bc()||b.gb())return null;d.F.ed(g.Zc())}catch(g){return d.K.error(`Error while sending a query to data source ${e}: ${g}`),null}}return Rg(d,a)})}P(a,
597
+ b,c,d){const e=b.Gb();if(e===olympe.dc.Ra.SELF||this.L&&e===olympe.dc.Ra.SERVER)return c(),null;var f=Zg(a);const g=new olympe.dc.Request(f,e,b);if(a===olympe.dc.ra.uc.Qg)return $g(this,g,c,d),null;let h;a=n=>{h=[];n&&this.K.info(`Resend subscription ${b.W()} after detection of dead subscription in the remote service`);$g(this,g,()=>{let p;null==(p=h)||p.forEach(q=>this.F.ed(q));h=null;c()},d)};const k=b.W();a(!1);f=new olympe.dc.Request(olympe.dc.Request.C.mj,e,b);const m=this.ec.T(f,a.bind(this,
598
+ !0)).subscribe(rxjs.Subscriber.create(n=>{Array.isArray(h)?h.push(n):this.F.ed(n)},n=>{this.K.error(`An error occurred with the subscription ${k}: ${n}`);d(String(n))}));return()=>{this.K.debug(`Unsubscribe to query ${k} from data source ${e}`);m.unsubscribe()}}};function te(a){return a.L.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function ue(a){return a.G.map(b=>a.F.get(a.C[b]))}function ch(a){const b=olympe.dc.ta();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ia(g)?olympe.dc.CloudObject.get(g):(olympe.la.fb('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.La.create(d,a.a,a.r)}
599
599
  olympe.dc.La=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.L=[];this.hash=''}static empty(){return new olympe.dc.La}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.C.length&&(b=this.C[a],b={value:[b,this.F.get(b)],done:!1},a++);return b}}}entries(){return this.C.map(a=>[a,this.F.get(a)])}values(){return this.F.values()}keys(){return this.C.values()}Je(){return this.C.map(a=>this.F.get(a))}size(){return this.C.length}has(a){return this.F.has(a)||this.Je().includes(a)}indexOf(a){return null===
600
- a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.Je().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}xc(){return this.Qd(0)}Qd(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){const b=this.Je();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.Je();a.pop();return a}shift(){if(0<this.C.length){const a=this.Je();a.shift();return a}return[]}filter(a){return this.Je().filter(a)}find(a){return(a=this.Je().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>
601
- a(this.F.get(b),c))}map(a){return this.Je().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.La.create(b,Array.from(this.G),Array.from(this.L))}reduce(a,b){return this.Je().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.G);for(const d of a)c=c.concat(d.G.map(e=>e+c.length));a=this.L.concat(...a.map(d=>d.L));return olympe.dc.La.create(b,c,a)}static from(a,b,{yb:c,gd:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=
602
- olympe.dc.ta(),q=c.Qh===olympe.dc.query.hj.ASC?1:-1,r=c.ng(),t=c.Qa();b.sort((u,w)=>{w=w[d];u=p.Qa(u[d],t);w=p.Qa(w,t);return null===u?-q:null===w?q:q*r(u,w)})}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.Z.nb(b.flat().join(''));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()),m=[],n=[];e.forEach(([p],
600
+ a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.Je().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}yc(){return this.Pd(0)}Pd(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){const b=this.Je();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.Je();a.pop();return a}shift(){if(0<this.C.length){const a=this.Je();a.shift();return a}return[]}filter(a){return this.Je().filter(a)}find(a){return(a=this.Je().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>
601
+ a(this.F.get(b),c))}map(a){return this.Je().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.La.create(b,Array.from(this.G),Array.from(this.L))}reduce(a,b){return this.Je().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.G);for(const d of a)c=c.concat(d.G.map(e=>e+c.length));a=this.L.concat(...a.map(d=>d.L));return olympe.dc.La.create(b,c,a)}static from(a,b,{yb:c,hd:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=
602
+ olympe.dc.ta(),q=c.Sh===olympe.dc.query.hj.ASC?1:-1,r=c.ng(),t=c.Qa();b.sort((u,w)=>{w=w[d];u=p.Qa(u[d],t);w=p.Qa(w,t);return null===u?-q:null===w?q:q*r(u,w)})}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.Z.nb(b.flat().join(''));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()),m=[],n=[];e.forEach(([p],
603
603
  q)=>{!k.has(p)&&m.push(q)});k.forEach(p=>{!h.has(p)&&n.push(p)});return olympe.dc.La.create(e,m,n,c)}static create(a,b,c,d){const e=new olympe.dc.La;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.Z.nb(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.L=c||[];return e}ha(a){a&&this.C.flatMap(b=>b.split('.')).forEach(a);return{k:this.C,a:this.G,r:this.L}}};olympe.dc.La.prototype.concat=olympe.dc.La.prototype.concat;olympe.dc.La.prototype.reduce=olympe.dc.La.prototype.reduce;olympe.dc.La.prototype.sort=olympe.dc.La.prototype.sort;
604
- olympe.dc.La.prototype.map=olympe.dc.La.prototype.map;olympe.dc.La.prototype.forEach=olympe.dc.La.prototype.forEach;olympe.dc.La.prototype.find=olympe.dc.La.prototype.find;olympe.dc.La.prototype.filter=olympe.dc.La.prototype.filter;olympe.dc.La.prototype.shift=olympe.dc.La.prototype.shift;olympe.dc.La.prototype.pop=olympe.dc.La.prototype.pop;olympe.dc.La.prototype.push=olympe.dc.La.prototype.push;olympe.dc.La.prototype.getAt=olympe.dc.La.prototype.Qd;olympe.dc.La.prototype.getFirst=olympe.dc.La.prototype.xc;
605
- olympe.dc.La.prototype.get=olympe.dc.La.prototype.get;olympe.dc.La.prototype.indexOf=olympe.dc.La.prototype.indexOf;olympe.dc.La.prototype.has=olympe.dc.La.prototype.has;olympe.dc.La.prototype.size=olympe.dc.La.prototype.size;olympe.dc.La.prototype.toArray=olympe.dc.La.prototype.Je;olympe.dc.La.prototype.keys=olympe.dc.La.prototype.keys;olympe.dc.La.prototype.values=olympe.dc.La.prototype.values;olympe.dc.La.prototype.entries=olympe.dc.La.prototype.entries;olympe.dc.La.empty=olympe.dc.La.empty;function dh(a){return 1<a.size()?(olympe.la.fb('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.xc()||null}olympe.dc.Nc=class{constructor(a){this.query=a}static from(a){return new olympe.dc.Nc(olympe.dc.ra.from(a))}eb(a){return new olympe.dc.Nc(this.query.eb(a))}gi(){return this}lb(a,b){return this.query.lb(a,b).then(c=>dh(c))}Ad(){return dh(this.query.Ad())}};olympe.dc.Nc.prototype.executeFromCache=olympe.dc.Nc.prototype.Ad;
606
- olympe.dc.Nc.prototype.execute=olympe.dc.Nc.prototype.lb;olympe.dc.Nc.prototype.cast=olympe.dc.Nc.prototype.gi;olympe.dc.Nc.prototype.follow=olympe.dc.Nc.prototype.eb;const eh=olympe.dc.wa.ORIGIN,fh=olympe.dc.wa.DESTINATION;function Tg(a,b){Dg(a.C,()=>b(a.query.W()))}function Ug(a,b,c){const d=a.da;a.da++;a.G.set(d,c);b===olympe.dc.Ra.SELF?a.bd(e=>e?c.error(e):c.next(a.C)):(a.$++,1===a.$&&a.bd(()=>Jg(a.C)));a.K.debug(`Add subscriber ${b} for query ${a.query.W()}, now have ${a.G.size} subscribers`);return d}
607
- function bh(a,b,c){if(a.query.zb()!==b)return!1;c.Od(a.ga);(b=a.ga.flush())&&a.K.debug(`Subscription ${a.query.W()} is considered as obsolete after the transaction ${c.W()} applied on DB`);return b}function Wg(a){Lg(a.C);a.G.forEach(b=>{b.next(a.C)})}function gh(a,b,c){const d=[],e=new olympe.async.ij(olympe.D.og());for(const f of b)f.vc(a.query)&&e.add(g=>f.bd(h=>{!h&&d.push(f);g()}));qc(e,f=>c(f?d:[]));e.start()}
608
- function hh(a){const b=a.query.W(),c=new Map,d=q=>{const r=c.get(q);return r?1===r.size?Array.from(r)[0]:(t,u,w,x)=>r.forEach(y=>y(t,u,w,x)):()=>{}},e=Bg(a.query),f=a.C;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.W(),t=g.C;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.F,m=olympe.Z.nb(k),n=oe(h,k,(q,r)=>{q?Hg(f,r):f.remove(r);d(m)(q,r,null,b)});let p;null==(p=a.T)||p.push(()=>{ne(h,k,n)});ih(a)}
609
- function jh(a){const b=a.na(a.query,()=>{null!==a.P&&hh(a)},d=>{a.K.error(`Error while ensuring coverage of a query to data source ${a.query.zb()}: ${d}`);ih(a)});let c;b&&(null==(c=a.T)||c.push(b))}function kh(a,b){a.L.delete(b);0===a.L.size&&(a.L=null,Promise.resolve().then(()=>{!a.gb()&&jh(a)}))}function ih(a){const b=a.P;a.P=null;null==b||b.forEach(c=>c())}
610
- olympe.dc.query.ap=class{constructor(a,b,c,d){this.K=a;this.db=b.view;this.query=c;this.C=new olympe.dc.query.Vo(this.K,c);this.$=0;this.da=1;this.T=[];this.G=new Map;this.P=[()=>Lg(this.C)];this.na=d;this.ga=new lh(a,this.db,c,this.C);this.F=this.L=null}start(a){gh(this,a,b=>{0<b.length?(this.L=new Set(b),this.L.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),hh(this)):jh(this)})}vc(a){return!this.gb()&&this.query.zb()===a.zb()&&(this.query.W()===a.W()||(null===this.P||this.query.F===a.F)&&
611
- this.C.vc(a))}bd(a){null!==this.P?this.P.push(a):a();return this}destroy(a){a?this.K.error(`Destroy subscription ${this.query.W()} after error: ${a}`):this.K.debug(`Destroy subscription ${this.query.W()}`);const b=this.T;this.T=null;this.G.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>kh(e,this));let d;null==(d=this.L)||d.forEach(e=>{e.F.delete(this);0===e.F.size&&(e.F=null)});b.forEach(e=>e())}gb(){return null===this.T}};
604
+ olympe.dc.La.prototype.map=olympe.dc.La.prototype.map;olympe.dc.La.prototype.forEach=olympe.dc.La.prototype.forEach;olympe.dc.La.prototype.find=olympe.dc.La.prototype.find;olympe.dc.La.prototype.filter=olympe.dc.La.prototype.filter;olympe.dc.La.prototype.shift=olympe.dc.La.prototype.shift;olympe.dc.La.prototype.pop=olympe.dc.La.prototype.pop;olympe.dc.La.prototype.push=olympe.dc.La.prototype.push;olympe.dc.La.prototype.getAt=olympe.dc.La.prototype.Pd;olympe.dc.La.prototype.getFirst=olympe.dc.La.prototype.yc;
605
+ olympe.dc.La.prototype.get=olympe.dc.La.prototype.get;olympe.dc.La.prototype.indexOf=olympe.dc.La.prototype.indexOf;olympe.dc.La.prototype.has=olympe.dc.La.prototype.has;olympe.dc.La.prototype.size=olympe.dc.La.prototype.size;olympe.dc.La.prototype.toArray=olympe.dc.La.prototype.Je;olympe.dc.La.prototype.keys=olympe.dc.La.prototype.keys;olympe.dc.La.prototype.values=olympe.dc.La.prototype.values;olympe.dc.La.prototype.entries=olympe.dc.La.prototype.entries;olympe.dc.La.empty=olympe.dc.La.empty;function dh(a){return 1<a.size()?(olympe.la.fb('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.yc()||null}olympe.dc.Nc=class{constructor(a){this.query=a}static from(a){return new olympe.dc.Nc(olympe.dc.ra.from(a))}eb(a){return new olympe.dc.Nc(this.query.eb(a))}hi(){return this}lb(a,b){return this.query.lb(a,b).then(c=>dh(c))}Ad(){return dh(this.query.Ad())}};olympe.dc.Nc.prototype.executeFromCache=olympe.dc.Nc.prototype.Ad;
606
+ olympe.dc.Nc.prototype.execute=olympe.dc.Nc.prototype.lb;olympe.dc.Nc.prototype.cast=olympe.dc.Nc.prototype.hi;olympe.dc.Nc.prototype.follow=olympe.dc.Nc.prototype.eb;const eh=olympe.dc.wa.ORIGIN,fh=olympe.dc.wa.DESTINATION;function Tg(a,b){Dg(a.C,()=>b(a.query.W()))}function Ug(a,b,c){const d=a.da;a.da++;a.G.set(d,c);b===olympe.dc.Ra.SELF?a.cd(e=>e?c.error(e):c.next(a.C)):(a.$++,1===a.$&&a.cd(()=>Jg(a.C)));a.K.debug(`Add subscriber ${b} for query ${a.query.W()}, now have ${a.G.size} subscribers`);return d}
607
+ function bh(a,b,c){if(a.query.Gb()!==b)return!1;c.Nd(a.ga);(b=a.ga.flush())&&a.K.debug(`Subscription ${a.query.W()} is considered as obsolete after the transaction ${c.W()} applied on DB`);return b}function Wg(a){Lg(a.C);a.G.forEach(b=>{b.next(a.C)})}function gh(a,b,c){const d=[],e=new olympe.async.ij(olympe.D.og());for(const f of b)f.wc(a.query)&&e.add(g=>f.cd(h=>{!h&&d.push(f);g()}));rc(e,f=>c(f?d:[]));e.start()}
608
+ function hh(a){const b=a.query.W(),c=new Map,d=q=>{const r=c.get(q);return r?1===r.size?Array.from(r)[0]:(t,u,w,x)=>r.forEach(y=>y(t,u,w,x)):()=>{}},e=Bg(a.query),f=a.C;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.W(),t=g.C;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.F,m=olympe.Z.nb(k),n=pe(h,k,(q,r)=>{q?Hg(f,r):f.remove(r);d(m)(q,r,null,b)});let p;null==(p=a.T)||p.push(()=>{oe(h,k,n)});ih(a)}
609
+ function jh(a){const b=a.na(a.query,()=>{null!==a.P&&hh(a)},d=>{a.K.error(`Error while ensuring coverage of a query to data source ${a.query.Gb()}: ${d}`);ih(a)});let c;b&&(null==(c=a.T)||c.push(b))}function kh(a,b){a.L.delete(b);0===a.L.size&&(a.L=null,Promise.resolve().then(()=>{!a.gb()&&jh(a)}))}function ih(a){const b=a.P;a.P=null;null==b||b.forEach(c=>c())}
610
+ olympe.dc.query.Zo=class{constructor(a,b,c,d){this.K=a;this.db=b.view;this.query=c;this.C=new olympe.dc.query.To(this.K,c);this.$=0;this.da=1;this.T=[];this.G=new Map;this.P=[()=>Lg(this.C)];this.na=d;this.ga=new lh(a,this.db,c,this.C);this.F=this.L=null}start(a){gh(this,a,b=>{0<b.length?(this.L=new Set(b),this.L.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),hh(this)):jh(this)})}wc(a){return!this.gb()&&this.query.Gb()===a.Gb()&&(this.query.W()===a.W()||(null===this.P||this.query.F===a.F)&&
611
+ this.C.wc(a))}cd(a){null!==this.P?this.P.push(a):a();return this}destroy(a){a?this.K.error(`Destroy subscription ${this.query.W()} after error: ${a}`):this.K.debug(`Destroy subscription ${this.query.W()}`);const b=this.T;this.T=null;this.G.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>kh(e,this));let d;null==(d=this.L)||d.forEach(e=>{e.F.delete(this);0===e.F.size&&(e.F=null)});b.forEach(e=>e())}gb(){return null===this.T}};
612
612
  function mh(a,b){return a.G.has(fh+b)||a.G.has(eh+b)}
613
613
  class lh{constructor(a,b,c,d){this.K=a;this.db=b;this.L=d;this.T=[];this.P=-1<c.C.max||0<c.C.offset;this.G=new Map;this.C=!1;const e=new Map;for(const f of Bg(c)){a=f.W();this.T.push(a);if(f instanceof olympe.dc.query.ya.Wf||f instanceof olympe.dc.query.ya.zf){a=f.P();a=`${a.Pa()}${a.X()}`;let g;b=null!=(g=this.G.get(a))?g:[];b.push(f);this.G.set(a,b)}nh(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.W());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.C;this.C=
614
- !1;return a}Ec(){}hd(a,b){if(!(this.C||!this.P&&this.db.Ia(a))){var c;this.C||(this.C=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&Gg(this.L,a,e)))}}F(a){this.C||this.db.Ia(a)&&!this.P||this.C||(this.C=this.T.some(b=>Gg(this.L,a,b)))}Ea(a,b,c){if(!this.C&&mh(this,a)){var d=this.db.Ia(b),e=this.db.Ia(c);if(d&&!e||!d&&e){const f=this.G.get(fh+a);a=this.G.get(eh+a);this.C||(this.C=d&&(null==f?void 0:f.some(g=>Gg(this.L,b,g.C)))||e&&(null==a?void 0:a.some(g=>Gg(this.L,c,g.C))))}}}Xb(a,b,
615
- c){if(!this.C&&this.P&&mh(this,a)&&this.db.mm(b,new olympe.dc.Oa.Relation(a),c)){const d=this.G.get(fh+a);a=this.G.get(eh+a);const e=this.L;this.C||(this.C=(null==d?void 0:d.some(f=>Gg(e,b,f.C)&&Gg(e,c,f.W())))||(null==a?void 0:a.some(f=>Gg(e,c,f.C)&&Gg(e,b,f.W()))))}}}olympe.dc.query.ap.va=[olympe.dc.Writable];function oh(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
616
- olympe.dc.query.Relation=class extends olympe.dc.Oa.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.Pa())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static wc(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.Pa(),null!=b?b:a instanceof olympe.dc.ba.de)}Rb(){const a=
617
- olympe.dc.wa.DESTINATION,b=olympe.dc.wa.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}toString(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.R={za:'dc.query.Logger',lj:'dc.query.QueryProcessor'};olympe.V.config(function(a){E(a,olympe.dc.query.R.za,[olympe.la.R.Ga],b=>b.Fc('query'));D(a,olympe.dc.query.R.lj,olympe.dc.query.$s,olympe.dc.query.R.za,olympe.dc.db.R.Ga,olympe.dc.R.Tg,new olympe.V.ma(olympe.dc.U.Wg))});olympe.V.run([olympe.dc.query.R.lj],a=>{olympe.dc.query.Sj=()=>a});olympe.dc.query.Y={};olympe.dc.query.Y.kd=class extends olympe.dc.query.Ca{constructor(...a){super();this.Y=a}compile(){return this.Y.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}Sc(){return new olympe.dc.query.Y.ce(...this.Y.map(a=>a.Sc()))}Cb(){return this.Y.flatMap(a=>a.Cb())}vc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}lb(a){return this.Y.reduce((b,c)=>b&&c.lb(a),!0)}observe(a,b,c){const d=
618
- Array(this.Y.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.Y.forEach((g,h)=>{g.observe(a,olympe.Z.nb('AND-'+b+a+h),f.bind(null,h))})}ha(){return{pr:olympe.dc.query.Ca.C.Dm,p:this.Y.map(a=>a.ha())}}Cc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Y.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.Z.nb('AND-'+b+a+d))})}};olympe.dc.query.Y.Ne=class extends olympe.dc.query.Ca{constructor(a,b,c,d=!1){super();this.Ja=olympe.dc.fa(a);this.substring=b;this.db=c;this.C=d}Cb(){return[this.Ja]}vc(a,b){return a instanceof olympe.dc.query.Y.Ne&&a.Ja===this.Ja?b?a.C?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.C?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Qa(){return this.Ja}lb(a){return this.apply(this.db.Qa(a,
614
+ !1;return a}Ec(){}jd(a,b){if(!(this.C||!this.P&&this.db.Ia(a))){var c;this.C||(this.C=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&Gg(this.L,a,e)))}}F(a){this.C||this.db.Ia(a)&&!this.P||this.C||(this.C=this.T.some(b=>Gg(this.L,a,b)))}Ea(a,b,c){if(!this.C&&mh(this,a)){var d=this.db.Ia(b),e=this.db.Ia(c);if(d&&!e||!d&&e){const f=this.G.get(fh+a);a=this.G.get(eh+a);this.C||(this.C=d&&(null==f?void 0:f.some(g=>Gg(this.L,b,g.C)))||e&&(null==a?void 0:a.some(g=>Gg(this.L,c,g.C))))}}}Wb(a,b,
615
+ c){if(!this.C&&this.P&&mh(this,a)&&this.db.km(b,new olympe.dc.Oa.Relation(a),c)){const d=this.G.get(fh+a);a=this.G.get(eh+a);const e=this.L;this.C||(this.C=(null==d?void 0:d.some(f=>Gg(e,b,f.C)&&Gg(e,c,f.W())))||(null==a?void 0:a.some(f=>Gg(e,c,f.C)&&Gg(e,b,f.W()))))}}}olympe.dc.query.Zo.va=[olympe.dc.Writable];function oh(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
616
+ olympe.dc.query.Relation=class extends olympe.dc.Oa.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.Pa())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static xc(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.Pa(),null!=b?b:a instanceof olympe.dc.ba.ce)}Qb(){const a=
617
+ olympe.dc.wa.DESTINATION,b=olympe.dc.wa.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}toString(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.R={za:'dc.query.Logger',lj:'dc.query.QueryProcessor'};olympe.V.config(function(a){E(a,olympe.dc.query.R.za,[olympe.la.R.Ga],b=>b.Fc('query'));D(a,olympe.dc.query.R.lj,olympe.dc.query.$s,olympe.dc.query.R.za,olympe.dc.db.R.Ga,olympe.dc.R.Tg,new olympe.V.ma(olympe.dc.U.Wg))});olympe.V.run([olympe.dc.query.R.lj],a=>{olympe.dc.query.Sj=()=>a});olympe.dc.query.Y={};olympe.dc.query.Y.kd=class extends olympe.dc.query.Ca{constructor(...a){super();this.Y=a}compile(){return this.Y.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}Sc(){return new olympe.dc.query.Y.be(...this.Y.map(a=>a.Sc()))}Bb(){return this.Y.flatMap(a=>a.Bb())}wc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}lb(a){return this.Y.reduce((b,c)=>b&&c.lb(a),!0)}observe(a,b,c){const d=
618
+ Array(this.Y.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.Y.forEach((g,h)=>{g.observe(a,olympe.Z.nb('AND-'+b+a+h),f.bind(null,h))})}ha(){return{pr:olympe.dc.query.Ca.C.Cm,p:this.Y.map(a=>a.ha())}}Cc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Y.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.Z.nb('AND-'+b+a+d))})}};olympe.dc.query.Y.Ne=class extends olympe.dc.query.Ca{constructor(a,b,c,d=!1){super();this.Ja=olympe.dc.fa(a);this.substring=b;this.db=c;this.C=d}Bb(){return[this.Ja]}wc(a,b){return a instanceof olympe.dc.query.Y.Ne&&a.Ja===this.Ja?b?a.C?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.C?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Qa(){return this.Ja}lb(a){return this.apply(this.db.Qa(a,
619
619
  this.Ja))}observe(a,b,c){Bf(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Z.nb(b+a+this.toString()))}apply(a){return'string'===typeof a?this.C?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.Ja+'-'+this.substring+'-'+this.C}clear(a,b){Cf(this.db,a,this.Ja,olympe.Z.nb(b+a+this.toString()))}Cc(){return{name:'CONTAINS',property:this.Qa(),value:this.substring,caseSensitive:this.C}}ha(){return{pr:olympe.dc.query.Ca.C.Li,p:this.Ja,s:this.substring,
620
- c:this.C}}};olympe.dc.query.Y.Zd=class extends olympe.dc.query.Ca{constructor(a,b,c){super();this.Ja=olympe.dc.fa(a);this.C=null!=b?b:null;this.db=c}Cb(){return[this.Ja]}vc(a){if(a instanceof olympe.dc.query.Y.Zd&&this.Ja===a.Ja)if('object'===typeof this.C&&null!==this.C){if(this.C instanceof olympe.dc.CloudObject)return this.C.Ha(a.C);if(this.C instanceof Date)return a.C instanceof Date&&this.C.getTime()===a.C.getTime();if(this.C instanceof olympe.D.Color)return this.C.Ha(a.C)}else return this.C===a.C;return!1}lb(a){return this.apply(this.db.Qa(a,
620
+ c:this.C}}};olympe.dc.query.Y.Yd=class extends olympe.dc.query.Ca{constructor(a,b,c){super();this.Ja=olympe.dc.fa(a);this.C=null!=b?b:null;this.db=c}Bb(){return[this.Ja]}wc(a){if(a instanceof olympe.dc.query.Y.Yd&&this.Ja===a.Ja)if('object'===typeof this.C&&null!==this.C){if(this.C instanceof olympe.dc.CloudObject)return this.C.Ha(a.C);if(this.C instanceof Date)return a.C instanceof Date&&this.C.getTime()===a.C.getTime();if(this.C instanceof olympe.D.Color)return this.C.Ha(a.C)}else return this.C===a.C;return!1}lb(a){return this.apply(this.db.Qa(a,
621
621
  this.Ja))}observe(a,b,c){Bf(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Z.nb(b+a+this.toString()));null===this.C&&null===this.db.Qa(a,this.Ja)&&c(!0)}clear(a,b){Cf(this.db,a,this.Ja,olympe.Z.nb(b+a+this.toString()))}apply(a){return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Ha(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.Ha(this.C):!1:a===this.C}toString(){let a,b;const c=null!=(b=null==(a=this.C)?void 0:a.toString())?
622
622
  b:'null';return'Equals-'+this.Ja+'-'+c}Cc(){return{name:'EQUALS',property:this.Ja,value:this.C}}ha(){let a=1,b=this.C;switch(!0){case this.C instanceof Date:a=2;b=this.C.toJSON();break;case this.C instanceof olympe.dc.CloudObject:a=3;b=this.C.X();break;case this.C instanceof olympe.D.Color:a=4,b={r:this.C.rg().valueOf(),g:this.C.pg().valueOf(),b:this.C.mg().valueOf(),a:this.C.lg().valueOf()}}return{pr:olympe.dc.query.Ca.C.Cn,p:this.Ja,t:a,v:b}}};function ph(a,b,c){return null===b?!1:null===c?!0:a.G?a.F?b<c:b>c:a.F?b<=c:b>=c}function qh(a,b){return'number'===typeof a.C?a.C:a.db.Qa(b,a.C)}function rh(a,b,c){return olympe.Z.nb(c+b+a.C+a.Ja)}
623
- olympe.dc.query.Y.Nh=class extends olympe.dc.query.Ca{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Ja=olympe.dc.fa(b);this.C='number'===typeof c?c:olympe.dc.fa(c);this.F=d;this.G=e}Sc(){return new olympe.dc.query.Y.Nh(this.db,this.Ja,this.C,!this.F,!this.G)}Cb(){return[this.Ja]}vc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Y.Nh&&this.Ja===a.Ja?typeof this.C!==typeof a.C||this.F!==a.F?!1:'number'===typeof this.C?
623
+ olympe.dc.query.Y.Ph=class extends olympe.dc.query.Ca{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Ja=olympe.dc.fa(b);this.C='number'===typeof c?c:olympe.dc.fa(c);this.F=d;this.G=e}Sc(){return new olympe.dc.query.Y.Ph(this.db,this.Ja,this.C,!this.F,!this.G)}Bb(){return[this.Ja]}wc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Y.Ph&&this.Ja===a.Ja?typeof this.C!==typeof a.C||this.F!==a.F?!1:'number'===typeof this.C?
624
624
  this.F&&this.C>=a.C||!this.F&&this.C<=a.C:this.C===a.C:!1}Qa(){return this.Ja}lb(a){return ph(this,this.db.Qa(a,this.Ja),qh(this,a))}observe(a,b,c){'string'===typeof this.C&&Bf(this.db,a,this.C,d=>{const e=this.db.Qa(a,this.Ja);null!==e&&c(ph(this,e,d))},rh(this,a,b));Bf(this.db,a,this.Ja,d=>{const e=qh(this,a);c(null!==e?ph(this,d,e):!0)},rh(this,a,b))}clear(a,b){Cf(this.db,a,this.Ja,rh(this,a,b));'string'===typeof this.C&&Cf(this.db,a,this.C,rh(this,a,b))}Cc(){return{name:'INEQUALITY_OPERATOR',
625
- property:this.Qa(),operator:this.F?'<':'>',strict:this.G,value:this.C}}ha(){return{pr:olympe.dc.query.Ca.C.ao,p:this.Ja,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.Ja+'-'+this.G+'-'+this.C}};olympe.dc.query.Y.Ld=class extends olympe.dc.query.Ca{constructor(a){super();this.C=a}compile(){const a=this.C.Sc();return this.Ha(a)?super.compile():a.compile()}Sc(){return this.C}Cb(){return this.C.Cb()}vc(a,b){return a instanceof olympe.dc.query.Y.Ld?this.C.vc(a.C,b):this.C.vc(a,!b)}lb(a){return!this.C.lb(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.Z.nb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Cc(){return{name:'NOT',predicate:this.C.Cc()}}ha(){return{pr:olympe.dc.query.Ca.C.Bo,v:this.C.ha()}}toString(){return`NOT-${this.C.toString()}`}clear(a,
626
- b){this.C.clear(a,olympe.Z.nb('NOT'+b+a))}Ha(a){return a instanceof olympe.dc.query.Y.Ld?this.C.Ha(a.C):!1}};olympe.dc.query.Y.ce=class extends olympe.dc.query.Ca{constructor(...a){super();this.Y=a}compile(){return this.Y.map(a=>a.compile()).flat()}Sc(){return new olympe.dc.query.Y.kd(...this.Y.map(a=>a.Sc()))}Cb(){return this.Y.flatMap(a=>a.Cb())}vc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}lb(a){return this.Y.reduce((b,c)=>b||c.lb(a),!1)}observe(a,b,c){const d=Array(this.Y.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
627
- k);e!==g&&(e=g,c(g))};this.Y.forEach((g,h)=>{g.observe(a,olympe.Z.nb('OR-'+b+a+h),f.bind(null,h))})}Cc(){throw Error('toObject for OR predicate should not be called');}ha(){return{pr:olympe.dc.query.Ca.C.Ko,p:this.Y.map(a=>a.ha())}}toString(){return'And-'+this.Y.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.Z.nb('OR-'+b+a+d))})}};olympe.dc.query.Y.Ze=class extends olympe.dc.query.Ca{constructor(a,b,c,d=!0){super();this.Ja=olympe.dc.fa(a);this.C=RegExp('');try{this.C=new RegExp(b)}catch(e){if(!(e instanceof SyntaxError))throw e;}this.db=c;this.F=d}Cb(){return[this.Ja]}vc(a){return a instanceof olympe.dc.query.Y.Ze&&this.Ja===a.Ja&&this.C.toString()===a.C.toString()}lb(a){return this.apply(this.db.Qa(a,this.Ja))}observe(a,b,c){Bf(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Z.nb(b+a+this.toString()))}apply(a){return'string'===
628
- typeof a?this.F?this.C.test(a):this.C.test(a.toLowerCase()):!1}toString(){return'Regex'+this.Ja+'-'+this.C.toString()+'-'+this.F}Cc(){return{name:'REGEX',property:this.Ja,pattern:this.C,caseSensitive:this.F}}ha(){return{pr:olympe.dc.query.Ca.C.ep,p:this.Ja,r:this.C.source,c:this.F}}clear(a,b){Cf(this.db,a,this.Ja,olympe.Z.nb(b+a+this.toString()))}};olympe.dc.query.Y.wl=class extends olympe.dc.query.Ca{constructor(a){super();this.C=new Set(a.map(olympe.dc.fa))}Cb(){return[]}vc(a){return a instanceof olympe.dc.query.Y.wl&&Array.from(a.C).every(b=>this.C.has(b))}lb(a){return this.C.has(a)}observe(a,b,c){c(this.C.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.C)}Cc(){return{name:'IS',tags:Array.from(this.C)}}ha(){return{pr:olympe.dc.query.Ca.C.Gp,t:Array.from(this.C)}}};olympe.dc.query.ya={};function nh(a){let b,c;const d=new Set(null!=(c=null==(b=a.F)?void 0:b.Cb())?c:[]);let e;a.yb&&d.add(null==(e=a.yb)?void 0:e.Qa().X());return d}function sh(a){if(!a.ga){let b,c;a.ga=null!=(c=null==(b=a.F)?void 0:b.compile())?c:[]}return a.ga}function th(a,b){for(const c of b)if(a.some(d=>d.vc(c,!1)))return!0;return!1}
625
+ property:this.Qa(),operator:this.F?'<':'>',strict:this.G,value:this.C}}ha(){return{pr:olympe.dc.query.Ca.C.Zn,p:this.Ja,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.Ja+'-'+this.G+'-'+this.C}};olympe.dc.query.Y.Kd=class extends olympe.dc.query.Ca{constructor(a){super();this.C=a}compile(){const a=this.C.Sc();return this.Ha(a)?super.compile():a.compile()}Sc(){return this.C}Bb(){return this.C.Bb()}wc(a,b){return a instanceof olympe.dc.query.Y.Kd?this.C.wc(a.C,b):this.C.wc(a,!b)}lb(a){return!this.C.lb(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.Z.nb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Cc(){return{name:'NOT',predicate:this.C.Cc()}}ha(){return{pr:olympe.dc.query.Ca.C.zo,v:this.C.ha()}}toString(){return`NOT-${this.C.toString()}`}clear(a,
626
+ b){this.C.clear(a,olympe.Z.nb('NOT'+b+a))}Ha(a){return a instanceof olympe.dc.query.Y.Kd?this.C.Ha(a.C):!1}};olympe.dc.query.Y.be=class extends olympe.dc.query.Ca{constructor(...a){super();this.Y=a}compile(){return this.Y.map(a=>a.compile()).flat()}Sc(){return new olympe.dc.query.Y.kd(...this.Y.map(a=>a.Sc()))}Bb(){return this.Y.flatMap(a=>a.Bb())}wc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}lb(a){return this.Y.reduce((b,c)=>b||c.lb(a),!1)}observe(a,b,c){const d=Array(this.Y.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
627
+ k);e!==g&&(e=g,c(g))};this.Y.forEach((g,h)=>{g.observe(a,olympe.Z.nb('OR-'+b+a+h),f.bind(null,h))})}Cc(){throw Error('toObject for OR predicate should not be called');}ha(){return{pr:olympe.dc.query.Ca.C.Io,p:this.Y.map(a=>a.ha())}}toString(){return'And-'+this.Y.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.Z.nb('OR-'+b+a+d))})}};olympe.dc.query.Y.Ye=class extends olympe.dc.query.Ca{constructor(a,b,c,d=!0){super();this.Ja=olympe.dc.fa(a);this.C=RegExp('');try{this.C=new RegExp(b)}catch(e){if(!(e instanceof SyntaxError))throw e;}this.db=c;this.F=d}Bb(){return[this.Ja]}wc(a){return a instanceof olympe.dc.query.Y.Ye&&this.Ja===a.Ja&&this.C.toString()===a.C.toString()}lb(a){return this.apply(this.db.Qa(a,this.Ja))}observe(a,b,c){Bf(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Z.nb(b+a+this.toString()))}apply(a){return'string'===
628
+ typeof a?this.F?this.C.test(a):this.C.test(a.toLowerCase()):!1}toString(){return'Regex'+this.Ja+'-'+this.C.toString()+'-'+this.F}Cc(){return{name:'REGEX',property:this.Ja,pattern:this.C,caseSensitive:this.F}}ha(){return{pr:olympe.dc.query.Ca.C.bp,p:this.Ja,r:this.C.source,c:this.F}}clear(a,b){Cf(this.db,a,this.Ja,olympe.Z.nb(b+a+this.toString()))}};olympe.dc.query.Y.vl=class extends olympe.dc.query.Ca{constructor(a){super();this.C=new Set(a.map(olympe.dc.fa))}Bb(){return[]}wc(a){return a instanceof olympe.dc.query.Y.vl&&Array.from(a.C).every(b=>this.C.has(b))}lb(a){return this.C.has(a)}observe(a,b,c){c(this.C.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.C)}Cc(){return{name:'IS',tags:Array.from(this.C)}}ha(){return{pr:olympe.dc.query.Ca.C.Ep,t:Array.from(this.C)}}};olympe.dc.query.ya={};function nh(a){let b,c;const d=new Set(null!=(c=null==(b=a.F)?void 0:b.Bb())?c:[]);let e;a.yb&&d.add(null==(e=a.yb)?void 0:e.Qa().X());return d}function sh(a){if(!a.ga){let b,c;a.ga=null!=(c=null==(b=a.F)?void 0:b.compile())?c:[]}return a.ga}function th(a,b){for(const c of b)if(a.some(d=>d.wc(c,!1)))return!0;return!1}
629
629
  function uh(a,b){if(null===a.F)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.Z.nb(h+f+d);e?a.F.observe(f,k,m=>{c||b(m,f,g,k)}):(c=!0,a.F.clear(f,k),c=!1,b(!1,f,g,k))}}function vh(a,b,c){if(null===a.yb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.yb.Qa();h=olympe.Z.nb(h+d);e?Bf(a.db,f,k,()=>{Eg(b)},h):Cf(a.db,f,k,h);c(e,f,g,h)}}
630
- olympe.dc.query.ya.jj=class{constructor(a,b){this.db=olympe.dc.ta();this.C=a;this.optional=b;this.ga=this.yb=this.F=this.id=null}static C(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.ya.ne(b,a.f);var c=a.o;const d=new olympe.dc.Oa.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.ya.zf(b,d,a.s,c):new olympe.dc.query.ya.Wf(b,d,c);void 0!==a.p&&(b.F=Mg(a.p));void 0!==a.c&&(c=b.W(),a=a.c,a=new olympe.dc.query.Me(c,new olympe.dc.Oa.Property(a.p),a.o),b.yb=a);return b}L(){}toString(){let a,
631
- b,c,d;return`${this.C}-${this.optional}${null!=(c=null==(a=this.F)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.yb)?void 0:b.toString())?d:''}`}Cc(){}ha(){const a={i:this.C,o:this.optional};null!==this.F&&(a.p=this.F.ha());null!==this.yb&&(a.c=this.yb.ha());return a}$(){}na(){return new olympe.dc.query.ya.tl}da(){}W(){null===this.id&&(this.id=this.$());return this.id}T(){return this.optional}vc(a){const b=sh(this);if(0===b.length)return!0;a=sh(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
630
+ olympe.dc.query.ya.jj=class{constructor(a,b){this.db=olympe.dc.ta();this.C=a;this.optional=b;this.ga=this.yb=this.F=this.id=null}static C(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.ya.oe(b,a.f);var c=a.o;const d=new olympe.dc.Oa.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.ya.zf(b,d,a.s,c):new olympe.dc.query.ya.Wf(b,d,c);void 0!==a.p&&(b.F=Mg(a.p));void 0!==a.c&&(c=b.W(),a=a.c,a=new olympe.dc.query.Me(c,new olympe.dc.Oa.Property(a.p),a.o),b.yb=a);return b}L(){}toString(){let a,
631
+ b,c,d;return`${this.C}-${this.optional}${null!=(c=null==(a=this.F)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.yb)?void 0:b.toString())?d:''}`}Cc(){}ha(){const a={i:this.C,o:this.optional};null!==this.F&&(a.p=this.F.ha());null!==this.yb&&(a.c=this.yb.ha());return a}$(){}na(){return new olympe.dc.query.ya.sl}da(){}W(){null===this.id&&(this.id=this.$());return this.id}T(){return this.optional}wc(a){const b=sh(this);if(0===b.length)return!0;a=sh(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
632
632
  th(d,c)))return!1;return!0}filter(a){const b=this.L(),c=b.F;null===c?b.F=a:b.F=c instanceof olympe.dc.query.Y.kd?new olympe.dc.query.Y.kd(...Array.from(c.Y),a):new olympe.dc.query.Y.kd(b.F,a);return b}sort(a,b){const c=this.L();c.yb=new olympe.dc.query.Me(this.W(),a,b);return c}ng(){return this.yb}lb(a){if(null!==this.F){var b=this.W();for(const c of Fg(a,b))this.F.lb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.W();return uh(this,vh(this,a,(d,e,f,g)=>{(d?Hg(a,e,c,f):a.remove(e,c,f))&&b(d,e,
633
- f,g)}))}};olympe.dc.query.ya.Uo=class{has(){}P(){}F(){}Sd(){}G(){}remove(){}};olympe.dc.query.ya.qn=class{constructor(a){this.C=null;this.content=new Map;this.L=null!=a?a:null}Sd(){return this.content.keys()}F(a){return this.content.has(a)&&null!==this.C?[this.C].values():[].values()}has(a){return this.content.has(a)}P(a){let b;return(null==(b=this.L)?void 0:b.call(this,a))||!1}G(a,b){if(null===this.C)this.C=b;else if(b!==this.C)throw Error('Should never try to insert multi parent in the same counter part result. To be used with FollowRulePart only');let c;b=null!=(c=this.content.get(a))?
634
- c:0;this.content.set(a,b+1);return 0===b}remove(a,b){if(null===b)return this.content.delete(a);b=this.content.get(a);1<b?this.content.set(a,b-1):this.content.delete(a);return 1===b}};olympe.dc.query.ya.qn.va=[olympe.dc.query.ya.Uo];olympe.dc.query.ya.Wf=class extends olympe.dc.query.ya.jj{constructor(a,b,c){super(a,c);this.relation=olympe.dc.query.Relation.from(b,!1)}P(){return this.relation}L(){const a=new olympe.dc.query.ya.Wf(this.C,this.relation,this.optional);a.F=this.F;a.yb=this.yb;return a}$(){return olympe.Z.nb(this.C+this.relation)}da(a,b){return b instanceof olympe.dc.query.ya.ne?[a]:[a+this.relation,a+oh(this.relation),a+'followRules'].map(c=>olympe.Z.nb(c))}lb(a){const b=this.W();for(const c of Fg(a,this.C))this.db.ib(c,
633
+ f,g)}))}};olympe.dc.query.ya.So=class{has(){}P(){}F(){}Rd(){}G(){}remove(){}};olympe.dc.query.ya.qn=class{constructor(a){this.C=null;this.content=new Map;this.L=null!=a?a:null}Rd(){return this.content.keys()}F(a){return this.content.has(a)&&null!==this.C?[this.C].values():[].values()}has(a){return this.content.has(a)}P(a){let b;return(null==(b=this.L)?void 0:b.call(this,a))||!1}G(a,b){if(null===this.C)this.C=b;else if(b!==this.C)throw Error('Should never try to insert multi parent in the same counter part result. To be used with FollowRulePart only');let c;b=null!=(c=this.content.get(a))?
634
+ c:0;this.content.set(a,b+1);return 0===b}remove(a,b){if(null===b)return this.content.delete(a);b=this.content.get(a);1<b?this.content.set(a,b-1):this.content.delete(a);return 1===b}};olympe.dc.query.ya.qn.va=[olympe.dc.query.ya.So];olympe.dc.query.ya.Wf=class extends olympe.dc.query.ya.jj{constructor(a,b,c){super(a,c);this.relation=olympe.dc.query.Relation.from(b,!1)}P(){return this.relation}L(){const a=new olympe.dc.query.ya.Wf(this.C,this.relation,this.optional);a.F=this.F;a.yb=this.yb;return a}$(){return olympe.Z.nb(this.C+this.relation)}da(a,b){return b instanceof olympe.dc.query.ya.oe?[a]:[a+this.relation,a+oh(this.relation),a+'followRules'].map(c=>olympe.Z.nb(c))}lb(a){const b=this.W();for(const c of Fg(a,this.C))this.db.ib(c,
635
635
  this.relation).forEach(d=>{Hg(a,d,b,c)});super.lb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Pa();return(f,g,h,k)=>{const m=olympe.Z.nb(k+g+this.toString());f?W(this.db,g,this.relation,(n,p)=>{Ig(a,n,d,e,g,p);c(n,p,g,m)},m):this.db.F(g,this.relation,m)}}ha(){return Object.assign(super.ha(),{t:this.relation.X(),d:this.relation.Pa()})}Cc(){const a={recursive:!1,relation:this.relation,filter:sh(this).map(b=>b.map(c=>c.Cc())),optional:this.T()};this.yb&&(a.sort={property:this.yb.Qa(),
636
- order:this.yb.Qh});return a}toString(){return`followPart-${this.relation}-${super.toString()}`}};olympe.dc.query.ya.zf=class extends olympe.dc.query.ya.jj{constructor(a,b,c,d){super(a,d);this.relation=olympe.dc.query.Relation.from(b,!0);this.G=c}L(){const a=new olympe.dc.query.ya.zf(this.C,this.relation,this.G,this.optional);a.F=this.F;a.yb=this.yb;return a}$(){return olympe.Z.nb(this.C+this.relation+this.G)}da(a,b){return b instanceof olympe.dc.query.ya.ne?[a]:[a+this.relation,a+'followRules'].map(c=>olympe.Z.nb(c))}P(){return this.relation}lb(a){const b=this.W();for(const c of Fg(a,this.C))this.G&&
636
+ order:this.yb.Sh});return a}toString(){return`followPart-${this.relation}-${super.toString()}`}};olympe.dc.query.ya.zf=class extends olympe.dc.query.ya.jj{constructor(a,b,c,d){super(a,d);this.relation=olympe.dc.query.Relation.from(b,!0);this.G=c}L(){const a=new olympe.dc.query.ya.zf(this.C,this.relation,this.G,this.optional);a.F=this.F;a.yb=this.yb;return a}$(){return olympe.Z.nb(this.C+this.relation+this.G)}da(a,b){return b instanceof olympe.dc.query.ya.oe?[a]:[a+this.relation,a+'followRules'].map(c=>olympe.Z.nb(c))}P(){return this.relation}lb(a){const b=this.W();for(const c of Fg(a,this.C))this.G&&
637
637
  Hg(a,c,b,c),this.db.qg(c,this.relation).forEach(d=>{Hg(a,d,b,c)});super.lb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Pa(),f=new Set,g=(h,k,m,n,p)=>{k=olympe.Z.nb(k+h+p+m);if(this.G||0<m)0<m&&Ig(a,n,d,e,h,p),c(n,p,h,k);n?f.has(p)||(f.add(p),W(this.db,p,this.relation,g.bind(this,h,k,m+1),k)):(f.delete(p),this.db.F(p,this.relation,k))};return(h,k,m,n)=>g(k,n+this.toString(),0,h,k)}ha(){return Object.assign(super.ha(),{s:this.G,t:this.relation.X(),d:this.relation.Pa()})}Cc(){const a=
638
- {recursive:this.G?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:sh(this).map(b=>b.map(c=>c.Cc())),optional:this.T()};this.yb&&(a.sort={property:this.yb.Qa(),order:this.yb.Qh});return a}toString(){return`followRecursivelyPart-${this.relation}-${this.G}-${super.toString()}`}};olympe.dc.query.ya.ne=class extends olympe.dc.query.ya.jj{constructor(a,b,c){super(a,!1);this.cc=b;this.G=null!=c?c:null}L(){return new olympe.dc.query.ya.ne(this.C,this.cc,this.G)}$(){return olympe.Z.nb(this.C+'followRules')}na(){return new olympe.dc.query.ya.qn(this.G)}da(a,b){return b instanceof olympe.dc.query.ya.ne?[a]:[olympe.Z.nb(a+'followRules')]}vc(a){if(a instanceof olympe.dc.query.ya.Wf||a instanceof olympe.dc.query.ya.zf){const b=olympe.dc.wa.ORIGIN,c=olympe.dc.wa.DESTINATION,d=olympe.dc.mc.nd,
639
- e=olympe.dc.mc.Hh,f=olympe.dm.Relation.C.nl,g=olympe.dm.Relation.C.Al;a=a.P();const h=a.Pa(),k=a.X();return h!==c||k!==d&&k!==e?!!(Nf(this.db,a,this.cc)&(a.Pa()===b?f:g)):!0}return a instanceof olympe.dc.query.ya.ne?this.cc===a.cc:!1}lb(a){const b=this.W();for(const c of Fg(a,this.C))for(const d of He(this.db,c,this.cc))Hg(a,d,b,c)}observe(a,b){const c=this.W(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?Kf(this.db,g,this.cc,(m,n,p,q,r)=>{p&&(p=q?Hg(a,r,c,e):a.remove(r,c,e),null!==n&&Ig(a,q,m,n,g,r),p&&d(e,
640
- q,r,h))},k):Lf(this.db,g,this.cc,k);b(f,g,e,k)};return(e,f,g,h)=>{g=olympe.Z.nb(h+f+this.toString());(e?Hg(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,g)}}ha(){return Object.assign(super.ha(),{f:this.cc})}Cc(){throw Error('Try to parse a part of an implicit query. Data connectors do not support those queries.');}toString(){return`followRulePart-${this.cc}-${super.toString()}`}T(){return!1}filter(){olympe.la.fb('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.la.fb('dc.query').warn('Should never try to sort queries with follow rules, ignore...');
641
- return this}};olympe.dc.query.ya.ne.F='followRules';olympe.dc.query.ya.tl=class{constructor(){this.content=new Map}Sd(){return this.content.keys()}F(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)}P(){return!1}G(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);b=c.delete(b);0===c.size&&this.content.delete(a);return b}};olympe.dc.query.ya.tl.va=[olympe.dc.query.ya.Uo];olympe.dc.sources={};olympe.dc.sources.op=class extends Error{};olympe.dc.sources.Bk=class{W(){}init(){}destroy(){}request(){return v(function*(){})}L(){}};const wh=olympe.net.Fa.Kd.GET,xh=olympe.net.Fa.Kd.Pg,yh=olympe.net.Fa.Kd.qc,zh=olympe.net.Fa.Kd.To,Ah=olympe.net.Fa.Headers.Eh,Bh=olympe.net.Fa.Headers.Mm,Ch=olympe.net.Fa.$b.Uh,Dh=olympe.net.Fa.$b.fn,Eh=olympe.net.Fa.$b.Jn,Fh=olympe.net.Fa.$b.Xh,Gh=olympe.net.Fa.$b.Co;
642
- function Hh(a){const b=`/${olympe.V.getParameter(olympe.dc.sources.U.Mk)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.da.P('_DataSourcesHTTPService',b,[wh,xh,yh,zh],(c,d,e)=>v(function*(){const f=d.get('sourceId'),g=a.G.get(d.get('sourceId'));if(!g)return Promise.resolve(new olympe.net.Se('Invalid source id',Gh,'Invalid source id'));const h=c.method,k=c.Nj();for(const [r,t]of Object.entries(Ih(a,f)))if(k[r.toLowerCase()]!==t)return new olympe.net.Se(`Additional auth header ${r} is missing or has wrong value`,
643
- Eh,'Access denied');try{var m=yield Jh(a,k[Bh])}catch(r){return new olympe.net.Se(`Invalid token ${r}`,Eh,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.C.Pb,t=olympe.dc.Request.C.Rg,u=olympe.dc.Request.C.Xg,w=olympe.dc.Request.C.$h,x=olympe.dc.Request.C.Bh,y=olympe.dc.Request.C.Hg,z=olympe.dc.Request.C.Uf,A=olympe.dc.Request.C.jg;let M;switch(n){case r:break;case t:case u:case x:case w:M=a.F.G(p);break;case A:case y:case z:M={tag:e.get('tag'),model:e.get('model'),
644
- mimeType:k[Ah]};p instanceof Uint8Array&&(M.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let K;const pa=null!=(K=k['X-Source-Origin'])?K:olympe.dc.Ra.Df;var q=re(new olympe.dc.Request(n,f,M,m),pa);const Ta=yield g(q),Hj=Ta instanceof Blob||Ta instanceof Uint8Array||Ta instanceof ArrayBuffer||void 0===Ta?null!=Ta?Ta:'':JSON.stringify(a.F.ha(Ta));return new olympe.net.Se(Hj,h===zh?Dh:Ch)}catch(r){return r instanceof olympe.dc.sources.op?new olympe.net.Se(`Authorization error: ${r}`,
645
- Eh,'Forbidden'):new olympe.net.Se(`Internal server error: ${r}`,Fh,'Internal server error')}})).catch(c=>a.K.error(`Error while starting the HTTP Service: ${c}`));a.K.debug(`Started HTTP service with path: ${b}`)}function Kh(a){a.da.T('_DataSourcesHTTPService').catch(b=>{a.K.error(`An error occurred while stopping the data sources http service: ${b}`)})}function Lh(a,b,c){0===a.G.size&&Hh(a);a.G.set(b,c);return()=>{a.G.delete(b);0===a.G.size&&Kh(a)}}
646
- function Mh(a,b,c){c=b.Cd(c);null===c&&a.K.error(`Impossible to build URL for data source ${b}`);return c}
647
- function Nh(a,b,c){if(b===olympe.dc.Ra.SERVER){var d;return null!=(d=Vc(a.T,a.ga.get(c)))?d:null}var e=a.$.get(b);if(!e){d=a.L.zb(b);if(null===d)return null;e=olympe.dc.sources.U.Nk;const f=olympe.dc.sources.U.Jh,g=olympe.dc.sources.U.Wn,h=olympe.dc.sources.U.Mk;let k;e=`${Mh(a,d,g)?'https':'http'}://${Mh(a,d,e)}:${null!=(k=Mh(a,d,f))?k:Mh(a,d,g)?443:80}`+`/${Mh(a,d,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.$.set(b,e)}return`${e}/${c}`}
648
- function Oh(a,b){let c;a=null==(c=a.L.zb(b))?void 0:c.Cd(olympe.dc.sources.U.Vn);return a instanceof Object?a:{}}function Ph(a,b){return b instanceof olympe.net.Mh?Wc(a.T,b,Bc(a.P).Yc()):Promise.reject('No http request to send')}
649
- function Qh(a,b){var c=Nh(a,b.Nb(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.Nb()}`);const d=b.content,e=JSON.stringify(a.F.ha(d));c=P(c,xh,e);Q(c,Object.assign({},{['X-Source-Origin']:b.origin,[Ah]:'application/json'},Oh(a,b.Nb())));return Ph(a,c).then(f=>'string'===typeof f?a.F.G(JSON.parse(f)):olympe.dc.query.wd.Ul(d))}
650
- function Rh(a,b){var c=Nh(a,b.Nb(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.Nb()}`);const d=JSON.stringify(a.F.ha(b.content));c=P(c,xh,d);Q(c,Object.assign({},{['X-Source-Origin']:b.origin,[Ah]:'application/json'},Oh(a,b.Nb())));return Ph(a,c).then()}function Ih(a,b){let c;a=null==(c=a.L.zb(b))?void 0:c.Cd(olympe.dc.sources.U.$n);return a instanceof Object?a:{}}
651
- function Jh(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.P.ug(b,(e,f)=>{e?d(e):c(f)})})}
652
- olympe.dc.sources.Gr=class{constructor(a,b,c,d,e,f){this.K=a;this.da=b;this.T=c;this.P=d;this.L=e;this.F=f;this.G=new Map;new olympe.D.Jb('Http service of remote data provider');this.$=new Map;this.C=new Map;this.ga=new Map([[olympe.dc.Request.C.oe,olympe.O.Mb.oe],[olympe.dc.Request.C.Uf,olympe.O.Mb.Ri],[olympe.dc.Request.C.jg,olympe.O.Mb.Ri],[olympe.dc.Request.C.Hg,olympe.O.Mb.Ri],[olympe.dc.Request.C.Om,olympe.O.Mb.Nm],[olympe.dc.Request.C.ip,olympe.O.Mb.hp],[olympe.dc.Request.C.Kk,olympe.O.Mb.Qn],
653
- [olympe.dc.Request.C.Ki,olympe.O.Mb.$m],[olympe.dc.Request.C.$h,olympe.O.Mb.TRANSACTION]])}Rc(a){const b=a.Nb();var c=Nh(this,b,a.getType());if(!c)return Promise.reject(`No destination URL to send the status request to destination: ${a.Nb()}`);c=P(c,wh);Q(c,Object.assign({},{['X-Source-Origin']:a.origin},Oh(this,b)));return Ph(this,c)}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.Nb(),f=Nh(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);
654
- const g=P(e===olympe.dc.Ra.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,zh,d);Q(g,{[Ah]:'application/octet-stream'});e!==olympe.dc.Ra.SERVER&&Q(g,Object.assign({},{['X-Source-Origin']:a.origin},Oh(this,a.Nb())));return Ph(this,g).then(()=>(new URL(g.C())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.Nb();var e=Nh(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=P(d===olympe.dc.Ra.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,yh,
655
- b);d!==olympe.dc.Ra.SERVER&&Q(e,Object.assign({},{['X-Source-Origin']:a.origin},Oh(this,a.Nb())));return Ph(this,e).then()}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.Nb();var e=Nh(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to download the file. ${b}`);var f;const g=null!=(f=this.C.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,ih:k})});if(this.C.has(b))return f;this.C.set(b,g);e=P(d===olympe.dc.Ra.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,wh,b,olympe.net.Fa.ResponseType.yt);
656
- d!==olympe.dc.Ra.SERVER&&Q(e,Object.assign({},{['X-Source-Origin']:a.origin},Oh(this,a.Nb())));Ph(this,e).then(h=>{const k=h instanceof ArrayBuffer?new Uint8Array(h,0,h.byteLength):h;let m;null==(m=this.C.get(b))||m.forEach(n=>n.done(k))}).catch(h=>{let k;null==(k=this.C.get(b))||k.forEach(m=>m.ih(`${h}`))}).finally(()=>{this.C.delete(b)});return f}};olympe.dc.sources.ho=class{constructor(a,b){this.K=a;this.fc=b}};olympe.dc.sources.ho.$b={Yh:0,kz:1,lz:3,Iy:4};const Sh=olympe.dc.Request.C.Pb,Th=olympe.dc.Request.C.Rg,Uh=olympe.dc.Request.C.mj,Vh=olympe.dc.Request.C.jg,Wh=olympe.dc.Request.C.Uf,Xh=olympe.dc.Request.C.Hg,Yh=olympe.dc.Request.C.Ah,Zh=olympe.dc.Request.C.Bh,$h=olympe.dc.Request.C.Xg;
657
- function ai(a,b){const c=b.W();null===a.F&&(a.F=new olympe.Z.xl(6E4),La(a.F,(f,g)=>{a.applyTransaction(g).catch(h=>{a.K.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),Ma(a.F,()=>{a.F=null}));let d;const e=null!=(d=a.F.get(c))?d:new olympe.dc.db.Lc(c);b.Od(e);Ja(a.F.C,c)||a.F.set(c,e)}
658
- function bi(a,b){const c=b.W();let d,e;const f=null!=(e=null==(d=a.F)?void 0:d.get(c))?e:new olympe.dc.db.Lc(c);let g;null==(g=a.F)||g.delete(c);b.Od(f);return a.applyTransaction(f).catch(h=>{a.K.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function ci(a,b){const c=rxjs.defer(()=>a.C.executeQuery(b).then(d=>d.Zc()));return 0<a.$?rxjs.interval(a.$).pipe(rxjs.operators.switchMap(()=>c)):c}
659
- olympe.dc.sources.ro=class{constructor(a,b){this.K=a;this.C=b;this.T=olympe.dc.query.Sj();this.P=olympe.dc.Xl();this.G=new olympe.D.Jb('Context of source '+this.W());let c;this.$=null!=(c=b.Cd(olympe.dc.sources.U.hl))?c:-1;this.F=null}W(){return this.C.W()}init(){if(this.W()===olympe.dc.Ra.SELF)return this;(new Promise((a,b)=>{let c=!0;di(this.C,this.G).subscribe(rxjs.Subscriber.create(d=>{if(this.K.C()){this.K.debug(`Data source ${this.C.name()} has loaded ${d.size()} data types in its cache:`);
660
- for(const [e,f]of d)this.K.debug(`=> DataType: ${f.name()} (${e})`)}c&&(c=!1,a())},b))})).then(()=>this.C.init(this.G)).catch(a=>{this.K.error(`Error while initialization of DataSource ${this.C.name()} (${this.W()}): ${a}`)});return this}healthCheck(){return this.C.healthCheck().then(()=>`Data source ${this.C.name()} (${this.C.W()}) OK`)}destroy(){this.G.destroy();return this.C.destroy()}request(a){const b=a.content;switch(a.getType()){case Sh:const c=olympe.dm.DataSource.Pb.Db,d=olympe.dm.DataSource.Pb.Sg;
661
- return this.C.healthCheck().then(()=>({s:d})).catch(e=>({s:c,r:String(e)}));case Th:return this.C.executeQuery(b);case Yh:return a=b.Zc(),ai(this,a),this.P.dd(a),Promise.resolve();case $h:return this.applyTransaction(b.Zc());case Zh:return bi(this,b.Zc());case Vh:return b.content instanceof Uint8Array?this.C.uploadFileContent(b.tag,b.model,b.content):Promise.reject('File content is undefined');case Wh:return this.C.downloadFileContent(b.tag,b.model).then(e=>e instanceof Uint8Array?e:Promise.reject(`Content of file ${b.tag} is not an Uint8Array`));
662
- case Xh:return this.C.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}L(a){if(a.getType()===Uh){const b=a.content;a=a.origin;return a===olympe.dc.Ra.SELF?ci(this,b):Sg(this.T,b,this.G,a,olympe.dc.ra.tc.Tf).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))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a){const b=
663
- this;return v(function*(){const c=ei(a);yield b.C.applyTransaction(c);yield ah(b.T,b.W(),a);b.P.dd(a)})}};olympe.dc.sources.ro.va=[olympe.dc.sources.Bk];function ei(a){const b=olympe.dc.sources.Ff.C.fr,c=olympe.dc.sources.Ff.C.Dt,d=olympe.dc.sources.Ff.C.jr,e=olympe.dc.sources.Ff.C.gr,f=olympe.dc.sources.Ff.C.kr,g=[],h=[],k=[],m=[],n=[];a.C.forEach((p,q)=>{const r=p.Dd();p.L()?g.push(fi(b,q,r,p.da()?p.Cb():null)):p.lf()?k.push(fi(d,q,r,null,p.$())):p.da()&&h.push(fi(c,q,r,p.Cb()));for(const [t,u,w]of p.he())p=a.Ge(u),w?m.push(new gi(e,t,q,u,r,p.Dd())):n.push(new gi(f,t,q,u,r,p.Dd()))});return n.concat(k,g,h,m)}
664
- function fi(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new hi(a,b,c,d,e)}olympe.dc.sources.Ff=class{constructor(a){this.type=a}};class hi extends olympe.dc.sources.Ff{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.Ob.NONE}}
665
- class gi extends olympe.dc.sources.Ff{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.Ff.C={fr:'CREATE',Dt:'UPDATE',jr:'DELETE',gr:'CREATE_RELATION',kr:'DELETE_RELATION'};const ii=olympe.dc.Request.C.Pb,ji=olympe.dc.Request.C.Rg,ki=olympe.dc.Request.C.mj,li=olympe.dc.Request.C.Xg,mi=olympe.dc.Request.C.$h,ni=olympe.dc.Request.C.Ah,oi=olympe.dc.Request.C.Bh,pi=olympe.dc.Request.C.jg,qi=olympe.dc.Request.C.Uf,ri=olympe.dc.Request.C.Hg,si=olympe.dc.Request.C.Gk;function ti(a,b){let c;return(null==(c=a.da.zb(b))?void 0:c.Cd(olympe.dc.sources.U.le))!==olympe.dm.DataSource.le.Tn}
666
- function ui(a,b){let c;return(null==(c=a.da.zb(b))?void 0:c.Cd(olympe.dc.sources.U.le))!==olympe.dm.DataSource.le.Rm}function vi(a,b){b=re(new olympe.dc.Request(si,olympe.dc.Ra.SELF,{id:b,finalize:olympe.dc.transaction.Gf.C.bj,error:null}),a.W());let c;null==(c=a.fc)||c.ed(b)}
667
- function wi(a,b){b=b.oc();if(b!==olympe.dm.User.C&&a.Cd(olympe.dc.sources.U.ml))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.W()}). Please use an admin account instead.`,new olympe.dc.sources.op(a);}
668
- function xi(a,b,c,d,e){return v(function*(){var f=olympe.O.Request.jb.SEND,g=olympe.O.Request.jb.GET;const h=olympe.O.Request.jb.PUBLISH,k=olympe.O.Request.jb.SUBSCRIBE,m=d.th();var n=d.body();if(e!==n.oc())throw Error('Access denied: try to impersonate a user');wi(c,n);let p;if(null==(p=a.fc)||!p.da(n.Nb()))throw Error(`Try to process a message with destination data source ${n.Nb()} coming from remote but not started here`);if(m===k){if(n.getType()===ki)f=n.content.W();else throw Error('Not supported type of subscription');
669
- g=yield d.qm(f);a.T.set(g,f);g=a.P.get(f);g||(g=new yi(a.K,f,b,re(n,olympe.dc.Ra.Df)),a.P.set(f,g));n=g;n.C++;n.K.debug(`Data subscription ${n.F} has ${n.C} subscribers`)}else m===g?(n=yield b.request(n),void 0!==n?yield d.ed(n):a.K.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):m===f?(yield b.request(n),yield d.Yp()):m===h&&(yield b.request(n))})}
670
- olympe.dc.sources.np=class{constructor(a,b,c,d,e){this.K=a;this.G=b;this.C=c;this.db=d;this.F=new olympe.D.Jb('Remote Provider Context');this.fc=null;this.$=new Map;this.P=new Map;this.T=new Map;this.da=e}W(){return olympe.dc.Ra.Df}request(a){var b=olympe.O.qb;const c=a.Nb(),d=a.getType();this.K.C()&&this.K.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case ii:const e=olympe.dm.DataSource.Pb.Db,f=olympe.dm.DataSource.Pb.Sg;b=ti(this,c)?b.get(c,a):
671
- Promise.resolve({s:f});a=ui(this,c)?this.C.Rc(a):Promise.resolve({s:f});return Promise.all([b,a]).then(([k,m])=>{if((null==k?void 0:k.s)===e||(null==m?void 0:m.s)===e){let n,p;return{s:e,r:`${null!=(n=null==k?void 0:k.r)?n:''} ${null!=(p=null==m?void 0:m.r)?p:''}`}}return{s:f}});case ji:return ui(this,c)?Qh(this.C,a):b.get(c,a);case li:const g=a.content.Zc().W();return(ti(this,c)?b.send(c,a):Rh(this.C,a)).finally(()=>vi(this,g));case mi:const h=a.content.Zc().W();return(ui(this,c)?Rh(this.C,a):b.send(c,
672
- a)).finally(()=>vi(this,h));case ni:return ti(this,c)?b.publish(c,a).catch(k=>{this.K.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case oi:return ti(this,c)?b.publish(c,a).catch(k=>{this.K.error(`An error occurred while sending "burst transaction done" to the data source ${c}: ${k}`)}):Rh(this.C,a);case pi:return ui(this,c)?this.C.uploadFileContent(a):b.get(c,a);case qi:return ui(this,c)?this.C.downloadFileContent(a):b.get(c,a);case ri:return ui(this,
673
- c)?this.C.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.W()}`)}}L(a,b){const c=a.Nb(),d=a.getType();if(!ti(this,c))return rxjs.throwError(()=>Error(`Subscription request not supported for data source ${this.db.name(c)} (${c}) which uses HTTP only.`));this.K.C()&&this.K.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===ki?olympe.O.qb.observe(c,this.F,a,{onRetry:b}):
674
- rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){this.fc=a;olympe.dc.ra.from(this.G,this.G).eb(olympe.dm.DataSource.yi).filter(olympe.dc.query.Ca.Ha(olympe.dm.DataSource.eh,!0)).filter(olympe.dc.query.Ca.Ha(olympe.dm.DataSource.kq,!0)).observe(this.F).subscribe(b=>{te(b).forEach(this.na.bind(this,a));se(b).forEach(c=>{let d;null==(d=this.$.get(c))||d.destroy();this.$.delete(c)})});this.db.Qa(this.G,olympe.dm.DataSource.kq)&&(new olympe.O.qb(this.G,this.F)).listen().subscribe(b=>
675
- {b=b.body();b instanceof olympe.dc.Request?a.ed(b):this.K.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return v(function*(){})}na(a,b){const c=b.X(),d=new olympe.D.Jb(`Published data provider context ${c}`,this.F);this.$.set(c,d);let e,f;zi(b,d).subscribe(g=>{let h;null==(h=e)||h();let k;null==(k=f)||k.stop();g!==olympe.dm.DataSource.le.Rm&&(e=Lh(this.C,c,m=>{wi(b,m);return a.request(m)}),d.onDestroy(()=>{let m;return null==(m=e)?void 0:m()}));
676
- g!==olympe.dm.DataSource.le.Tn&&(g=new olympe.D.Jb(`Bus Service of data source ${c}`,d),f=(new olympe.O.qb(c,g)).Eq(this.ga.bind(this)),f.listen().subscribe(m=>{m.wh().then(n=>xi(this,a,b,m,n)).catch(n=>{this.K.warn(`Error occurred while processing request from ${m.source()}: ${n}`);return m.ih(n instanceof Error?n:Error(n))})}))})}ga(a){const b=this.T.get(a);this.T.delete(a);if(a=b)null==(a=this.P.get(b))?a=0:(0<a.C&&--a.C,0===a.C?(a.K.debug(`Data subscription ${a.F} has more subscriber: unsubscribe`),
677
- a.G.unsubscribe(),a=!0):(a.K.debug(`Data subscription ${a.F} has ${a.C} subscribers`),a=!1));a&&this.P.delete(b)}};class yi{constructor(a,b,c,d){this.K=a;this.F=b;this.C=0;this.G=c.T(d).subscribe({next:e=>{olympe.O.qb.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}`)})}}olympe.dc.sources.np.va=[olympe.dc.sources.Bk];olympe.dc.sources.fg=class extends olympe.O.fg{constructor(a){super();this.db=a;this.L=new Map}ha(a){a=this.C(a);if(0<this.L.size){const b=Array.from(this.L.values());this.L.clear();return{t:0,i:b,v:a}}return a}G(a){if(0===(null==a?void 0:a.t)){const b=a.i.reduce((c,d)=>{const e=new Map(Array.from(Object.entries(d.p).map(([f,g])=>[f,this.F(g)])));c.Ec(d.t,d.s,e,d.m);d.r.forEach(f=>c.Ea(f.r,d.t,f.d));return c},new olympe.dc.db.Lc);olympe.dc.Xl().dd(b);return this.F(a.v)}return this.F(a)}C(a){switch(!0){case a instanceof
678
- olympe.dc.CloudObject:return a=a.X(),this.P(a),{t:10,v:a};case a instanceof olympe.dc.ra:return{t:11,v:a.ha()};case a instanceof olympe.dc.La:return{t:12,v:a.ha(this.P.bind(this))};case a instanceof olympe.dc.db.Lc:const b=new olympe.dc.transaction.ag;a.Od(b);return{t:13,i:a.W(),v:xg(b)};case a instanceof olympe.dc.Request:return{t:14,r:a.getType(),o:a.origin,d:a.Nb(),u:a.oc(),c:this.C(a.content)};case a instanceof olympe.dc.transaction.Aj:return{t:15,r:a.wg(),p:this.C(a.Zc())};case a instanceof olympe.dc.query.wd:return{t:16,
679
- v:a.ha()};default:return super.C(a)}}F(a){if('object'!==typeof a||'number'!==typeof(null==a?void 0:a.t))return super.F(a);switch(a.t){case 10:return olympe.dc.CloudObject.get(a.v);case 11:a=a.v;var b=a.p.map(olympe.dc.query.ya.jj.C),c=a.e;return new olympe.dc.ra(a.b,a.s,b,b.length-1,new Set(a.r),{max:c.m,offset:c.o,gd:c.s,rf:c.rm});case 12:return ch(a.v);case 13:return(new olympe.dc.transaction.gj).C(a.v,a.i);case 14:return c=null!=(b=this.F(a.c))?b:void 0,re(new olympe.dc.Request(a.r,a.d,c,a.u),
680
- a.o);case 15:return b=this.F(a.p),new olympe.dc.transaction.Aj(b,a.r);case 16:return a=a.v,new olympe.dc.query.wd((new olympe.dc.transaction.gj).C(a.p),a.s);default:return super.F(a)}}P(a){if(!this.L.has(a)){if(!this.db.Ia(a))throw new olympe.dc.Mo(a);var b={};this.db.Cb(a).forEach((d,e)=>{b[e]=this.C(d)});var c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:[]};this.L.set(a,c);for(const [d,e,f]of Of(this.db,a)){const g=this.L.get(f);void 0!==g&&(e===olympe.dc.wa.DESTINATION?c.r.push({r:d,d:f}):
681
- g.r.push({r:d,d:a}))}}}};const Ai=olympe.dc.Request.C.oe,Bi=olympe.dc.Request.C.Xg,Ci=olympe.dc.Request.C.$h,Di=olympe.dc.Request.C.Ah,Ei=olympe.dc.Request.C.Om,Fi=olympe.dc.Request.C.ip,Gi=olympe.dc.Request.C.Rg,Hi=olympe.dc.Request.C.Ki,Ii=olympe.dc.Request.C.mj,Ji=olympe.dc.Request.C.Kk,Ki=olympe.dc.Request.C.Rn,Li=olympe.dc.Request.C.Cr,Mi=olympe.dc.Request.C.Dr,Ni=olympe.dc.Request.C.Hg,Oi=olympe.dc.Request.C.Uf,Pi=olympe.dc.Request.C.jg,Qi=olympe.dc.Request.C.Gk,Ri=olympe.dc.Request.C.Bt,Si=olympe.dc.Request.C.bt,Ti=
682
- olympe.dc.Request.C.Br,Ui=olympe.dc.Request.C.Bh,Vi=olympe.dc.Request.C.ar,Wi=olympe.dc.Request.C.Pb;function Xi(a){return Yi(a,olympe.dc.Request.C.oe).then(b=>{b=b.p;const c=wg(b,a.W());a.K.C()&&a.K.debug('< Get Context result',b);a.K.P()&&a.K.log('< Get Context result has',b.length,'operations');return c})}
683
- function Zi(a,b){const c=b.Zc();b=new olympe.dc.transaction.ag({ak:!0,Md:!1,fh:!1});c.Od(b);return Yi(a,Ci,xg(b)).finally(()=>{$i(a,Qi,{id:c.W(),finalize:olympe.dc.transaction.Gf.C.bj})}).then()}function aj(a,b){const c=new olympe.dc.transaction.ag({Md:!1,fh:!1}),d=b.Zc();d.Od(c);return bj(a,Di,{i:d.W(),r:b.wg(),p:xg(c)},!1).catch(e=>a.K.error(`Error while publishing burst transaction: ${e}`))}
684
- function cj(a,b){const c=b.W();a.K.C()&&a.K.debug(`Query (${c}) sent to orchestrator: ${b}`);b=dj(a,b);return Yi(a,Ji,b).then(d=>ej(a,d))}function fj(a,b){const c=encodeURI(Ga(olympe.Z.De(),JSON.stringify(dj(a,b))));a.K.C()&&a.K.debug(`Static GraphDef query ${b} sent to orchestrator`);return Yi(a,Hi,void 0,`query=${c}&v=${a.version}`).then(d=>ej(a,d))}
685
- function bj(a,b,c,d=!0){const e=olympe.O.ae.rn,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{cd(a.F,e,f,(k,m)=>{k?h(k):g(m)})});cd(a.F,e,f);return Promise.resolve()}
686
- function dj(a,b){const c=Bg(b);b={i:b.W(),b:[b.F],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.ya.ne)Object.assign(b,{f:c[0].cc,q:[]});else{const d=new Map;for(let e=c.length-1;0<=e;e--){const f=c[e],g=f.C;let h;const k=(null!=(h=d.get(g))?h:new Set).add(f);if(f instanceof olympe.dc.query.ya.zf&&f.G){let m;null==(m=d.get(f.W()))||m.forEach(n=>k.add(n))}d.set(g,k)}Object.assign(b,{f:olympe.dc.Ob.NONE,q:c.map(a.T.bind(a,d))})}return b}
687
- function $i(a,b,c){b=re(new olympe.dc.Request(b,olympe.dc.Ra.SELF,c),a.W());let d;null==(d=a.fc)||d.ed(b)}
688
- function Yi(a,b,c,d){if($c(a.F)){const e=Nh(a.C,a.W(),b);if('string'!==typeof e)return Promise.reject(`ServerProvider: no url for type ${b}`);b=P(`${e}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.Fa.Kd.Pg:olympe.net.Fa.Kd.GET,c&&JSON.stringify(c));Q(b,{[olympe.net.Fa.Headers.Eh]:'application/json'});return Ph(a.C,b).then(f=>'string'===typeof f&&0<f.length?JSON.parse(f):f)}a.K.error('Server is disconnected, data request of type',b,'is canceled.');return Promise.reject('Server is disconnected')}
689
- function ej(a,b){if(b&&'object'===typeof b){if(0<b.s)throw Error(b.info.error.reason);return wg(b.p,a.W())}throw Error('Data result can be created only from Object');}
690
- olympe.dc.sources.Bp=class{constructor(a,b,c,d,e,f){this.K=a;this.F=b;this.da=c;this.$=d;this.C=e;this.P=new olympe.dc.transaction.gj(this.W());this.G=new Map;this.fc=null;this.version=f||'unknown';const g=olympe.auth.Ba.C.Af,h=olympe.auth.Ba.C.ke;olympe.D.pc([this.$.getState()],k=>{k!==g&&k!==h||this.G.forEach((m,n)=>{m.error(new olympe.O.errors.el('Connection to server has been recovered',n))})})}W(){return olympe.dc.Ra.SERVER}request(a){var b=a.getType(),c=a.content;switch(b){case Wi:return c=
691
- olympe.dm.DataSource.Pb.Db,a=olympe.dm.DataSource.Pb.Sg,Promise.resolve($c(this.F)?{s:a}:{s:c,r:'Disconnected'});case Ai:return Xi(this);case Bi:return a=new olympe.dc.transaction.ag({Md:!1,fh:!1}),b=c.Zc(),b.Od(a),bj(this,Bi,{i:b.W(),r:c.wg(),p:xg(a)}).then();case Ci:return Zi(this,c);case Di:return aj(this,c);case Ui:return a=new olympe.dc.transaction.ag({Md:!1,fh:!1}),c=c.Zc(),c.Od(a),bj(this,Ui,{i:c.W(),p:xg(a)}).then();case Gi:return cj(this,c);case Hi:return fj(this,c);case Ei:return $c(this.F)?
692
- (c=dj(this,olympe.dc.ra.from(c)),c.f=olympe.dc.Ob.vn,c=P(Nh(this.C,olympe.dc.Ra.SERVER,Ei),olympe.net.Fa.Kd.Pg,JSON.stringify(c),olympe.net.Fa.ResponseType.lk),Q(c,{[olympe.net.Fa.Headers.Eh]:olympe.net.Fa.nn.JSON}),c=Ph(this.C,c)):(this.K.error(`Server is disconnected, backup of instance ${c} is canceled.`),c=Promise.reject('Server is disconnected')),c;case Fi:a=c.TB;b=c.debug;c=c.optional;if($c(this.F)){var d=Nh(this.C,olympe.dc.Ra.SERVER,Fi);c=P(d+`?debug=${b}&optional=${c}`,olympe.net.Fa.Kd.Pg,
693
- a);Q(c,{[olympe.net.Fa.Headers.Eh]:olympe.net.Fa.nn.Jt});c=Ph(this.C,c)}else this.K.error('Server is disconnected, restore of instance is canceled.'),c=Promise.reject('Server is disconnected');return c;case Ri:case Si:case Ti:case Vi:return bj(this,b,{});case Oi:return this.C.downloadFileContent(a);case Ni:return this.C.deleteFileContent(a);case Pi:return this.C.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}L(a,b){if(a.getType()===Ii){const c=
694
- a.content,d=c.W();return(new rxjs.Observable(e=>{const f=dj(this,c);this.G.set(d,e);bj(this,Ki,f).catch(g=>e.error(g))})).pipe(Jc(this.da,b),rxjs.operators.finalize(()=>{bj(this,Li,{i:d}).catch(e=>{this.K.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.G.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){this.fc=a;Yc(this.F,olympe.O.ae.rn,this.ga.bind(this));return this}destroy(){return v(function*(){})}ga(a){var b=
695
- olympe.dc.Request.C.Qm;const c=olympe.dc.Request.C.cl;var d=a.c;if(d===olympe.dc.Request.C.sn)a=this.P.C(a.p),$i(this,d,a);else if(d===b){var e=a.error.reason;b=this.P.C(a.p);$i(this,d,{id:a.i,rollback:b,error:e})}else d===Mi?(d=a.i,a=this.P.C(a.p),null==(e=this.G.get(d))||e.next(a)):d===c&&$i(this,Qi,{id:a.i,finalize:olympe.dc.transaction.Gf.C.cl,error:0<a.s?a.info.error.reason:null})}T(a,b){if(b instanceof olympe.dc.query.ya.Wf||b instanceof olympe.dc.query.ya.zf){const c=b.P();let d;b=Array.from(null!=
696
- (d=a.get(b.W()))?d:[]);return{t:c.X(),d:c.Pa()===olympe.dc.wa.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.T.bind(this,a))}}return{}}};olympe.dc.sources.Bp.va=[olympe.dc.sources.Bk];function gj(a,b,c){const d=new olympe.D.Jb(`Source solver ${b.X()}`);b.eb(olympe.dm.xd.G.Rb()).eb(olympe.dm.xd.C).Nd().back().eb(olympe.dm.xd.F).Nd().observe(d,c).subscribe(e=>{te(e).forEach(([f,g])=>{a.F.set(f.X(),g.W())});se(e).forEach(([f])=>{a.F.delete(f)})});b.eb(olympe.dm.pb.L).observe(d,c).subscribe(e=>{let f,g;a.G=null!=(g=null==(f=e.xc())?void 0:f.W())?g:null});d.onDestroy(()=>{a.F.clear();a.G=null})}
697
- olympe.dc.sources.xj=class{constructor(a,b,c){this.db=a;this.C=b;this.P=c;this.F=new Map;this.G=null;this.L=!1}fromModel(a){a=olympe.dc.fa(a);return this.F.has(a)?this.F.get(a):this.G&&this.T(a)?this.G:this.P}Ce(a){let b;return null!=(b=this.db.source(a))?b:this.P}zb(a){return a===this.C?olympe.dc.CloudObject.get(this.C):a===olympe.dc.Ra.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ia(a)&&this.db.$c(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}T(){return!1}init(){if(!this.L){this.L=
698
- !0;var a=new olympe.dc.Sa;Z(a.create(olympe.dm.DataSource,this.C).uh(this.C),olympe.dm.DataSource.eh,!0);a.Ea(olympe.dm.DataSource.yi,this.C,this.C);a.lb(()=>{olympe.dc.ra.from(this.C).observe(olympe.D.og()).subscribe(()=>{})})}}};olympe.dc.sources.R={za:'dc.sources.Logger',Pk:'dc.sources.HTTPService',Rr:'dc.sources.IOService',gp:'dc.sources.RemoteProvider',up:'dc.sources.ServerProvider',Jy:'dc.sources.OfflineProvider',te:'dc.sources.SourceSolver',ee:'dc.sources.Serializer'};
699
- olympe.dc.sources.U={Nk:'data.httpHost',Jh:'data.httpPort',Wn:'data.httpSSL',Mk:'data.httpBasePath',hl:'data.pollingFrequency',le:'data.communicationMode',ml:'data.restrictedUse',Vn:'data.HTTPExtraHeaders',$n:'data.incomingAuthHeaders',Lq:'offline.autoSync',Kq:'offline.autoPersist',ot:'offline.syncTimeout',VERSION:'version.version'};
700
- olympe.V.config(function(a){F(a,olympe.dc.sources.U.Lq,!1);F(a,olympe.dc.sources.U.Kq,!1);F(a,olympe.dc.sources.U.ot,3E4);var b=a.getParameter(olympe.O.U.xk);F(a,olympe.dc.sources.U.Nk,b);var c=a.getParameter(olympe.dc.sources.U.Nk);c=(b='localhost'===c)||c.endsWith(a.getParameter(olympe.net.U.Zi));F(a,olympe.dc.sources.U.Jh,b?3141:c?80:443);F(a,olympe.dc.sources.U.Wn,!c);F(a,olympe.dc.sources.U.Mk,'runtime/data');F(a,olympe.dc.sources.U.hl,null);F(a,olympe.dc.sources.U.le,null);F(a,olympe.dc.sources.U.ml,
701
- null);F(a,olympe.dc.sources.U.Vn,{});F(a,olympe.dc.sources.U.$n,{});E(a,olympe.dc.sources.R.za,[olympe.la.R.Ga],d=>d.Fc('data'));D(a,olympe.dc.sources.R.ee,olympe.dc.sources.fg,olympe.dc.R.Oe);va(a,olympe.O.R.ee,olympe.dc.sources.R.ee);D(a,olympe.dc.sources.R.Pk,olympe.dc.sources.Gr,olympe.dc.sources.R.za,olympe.net.R.Dj,olympe.O.R.Ok,olympe.auth.R.Ga,olympe.dc.sources.R.te,olympe.O.R.ee,new olympe.V.ma(olympe.O.U.mk));D(a,olympe.dc.sources.R.Rr,olympe.dc.sources.ho,olympe.dc.sources.R.za,olympe.dc.R.Tg,
702
- olympe.net.R.Ga,olympe.auth.R.Ga);D(a,olympe.dc.sources.R.gp,olympe.dc.sources.np,olympe.dc.sources.R.za,new olympe.V.ma(olympe.dc.U.eg),olympe.dc.sources.R.Pk,olympe.dc.R.Oe,olympe.dc.sources.R.te);D(a,olympe.dc.sources.R.up,olympe.dc.sources.Bp,olympe.dc.sources.R.za,olympe.O.R.qj,olympe.O.R.pk,olympe.auth.R.Ga,olympe.dc.sources.R.Pk,new olympe.V.ma(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.R.te,olympe.dc.sources.xj,olympe.dc.R.Oe,new olympe.V.ma(olympe.dc.U.eg),new olympe.V.ma(olympe.dc.U.zk))},
703
- 'olympe.dc.sources');olympe.V.run([olympe.dc.sources.R.te],a=>{olympe.dc.Fd=()=>a});olympe.dc.transaction={};olympe.dc.Ch=class a{constructor(b,c){this.id=null!=b?b:olympe.Z.hc();this.F=new olympe.D.Jb('BurstTransaction#'+this.id,c);this.Eb=hj(this);this.T=!1;this.F.onDestroy(()=>this.P());this.$=new Set;this.G=new Map;this.L=new Set;this.C=null;let d;this.mb=null!=(d=olympe.V.getParameter(olympe.dc.transaction.U.Pm))?d:30;this.na=[]}static C(b,c){return`${b},${c}`}Qb(b){for(const c of this.na)c(b);this.stop()}Wa(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.ga(this.L);0<b.size&&ij(this,
704
- b,!1);this.L.clear()}ga(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.G.get(d))});return c}da(b,c,d){this.Da(b,c,d);this.Eb(b,c,d);null===this.C&&(this.C=setTimeout(this.Wa.bind(this),this.mb))}Da(b,c,d){b=a.C(b,c);this.G.set(b,d);this.L.add(b)}ub(b,c){return this.G.get(a.C(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.ub(d,e)!==g&&this.da(d,e,g.valueOf())});this.$.add(b)}complete(){return new Promise((b,
705
- c)=>{this.P((d,e)=>{for(const f of this.$)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.dc.ph().fb().error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.tm([d],g=>{this.T=!0;g instanceof olympe.dc.lc?olympe.dc.ph().fb().error('Cannot send complex property values in burst transactions'):this.da(e,f,g.valueOf())})}),this.F.$(()=>{this.P()}))}stop(){this.F.destroy();this.na.length=0}getContext(){return this.F}W(){return this.id}wg(){return!1}P(b){if(this.T){this.T=
706
- !1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.L.clear();const c=this.ga(new Set(this.G.keys()));ij(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.Ch.prototype.complete=olympe.dc.Ch.prototype.complete;olympe.dc.Ch.prototype.push=olympe.dc.Ch.prototype.push;olympe.dc.Oo=class{C(){}toString(){}};olympe.dc.transaction.gj=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ra.SERVER}C(b,c){c=new olympe.dc.db.Lc(c);this.G(b,c);return c}G(b,c){for(const d of b)switch(d.o){case 1:b=a.C(d.p||{});let e;c.Ec(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case 2:c.hd(d.t,a.C(d.p),d.m);break;case 3:c.F(d.t,d.f,d.m);break;case 4:c.Ea(d.m,d.l,d.r,d.lm,d.rm);break;case 5:c.Xb(d.m,d.l,d.r,d.lm,d.rm);break;case 6:break;default:throw Error('Undefined patch operation: '+d.o);}}static C(b){const c=new Map;for(const [d,
707
- e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.Wi.Id+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':c.set(b,String(e));break;case 'boolean':c.set(b,!!e);break;case 'number':c.set(b,Number(e));break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;
708
- 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.D.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.lc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};function jj(a,b){let c;return null!=(c=a.sources.get(b))?c:a.L.Ce(b)}function kj(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.C.Ge(b))?void 0:c.Dd())?d:a.db.model(b))?e:null}function lj(a,b){let c;return null!=(c=a.P.get(b))?c:a.db.Of(b)||!a.db.Ia(b)}function mj(a){return Array.from(a.C.Sd()).filter(b=>!b.lf()).map(b=>b.tag())}function nj(a,b,c,d){d(a.C);c&&a.G&&b!==olympe.dc.Ra.SELF&&(c=a.F.get(b),c||(c=new olympe.dc.db.Lc(a.id),a.F.set(b,c)),d(c))}
709
- function oj(a,b,c){const d=jj(a,b),e=lj(a,b),f=kj(a,b);nj(a,d,e,g=>{g.F(b,c,f)})}
710
- olympe.dc.transaction.Xs=class{constructor(a,b,c){this.id=null!=c?c:olympe.Z.hc();this.L=b;this.db=a;this.F=new Map;this.C=new olympe.dc.db.Lc(this.id);this.sources=new Map;this.P=new Map;this.G=!0}rh(){return 0===this.C.C.size}persist(a){this.G=a}Ec(a,b,c,d,e){let f;const g=null!=(f=null!=d?d:this.sources.get(a))?f:this.L.fromModel(b);this.sources.set(a,g);this.P.set(a,c&&this.G);nj(this,g,c,h=>{h.Ec(a,g,e,b)})}hd(a,b){const c=jj(this,a),d=lj(this,a),e=kj(this,a);nj(this,c,d,f=>{f.hd(a,null!=b?b:
711
- new Map,e)})}Ea(a,b,c){const d=jj(this,b),e=jj(this,c);let f=lj(this,b)&&lj(this,c)&&d!==olympe.dc.Ra.SELF&&e!==olympe.dc.Ra.SELF;f&&d!==e&&a!==olympe.dc.mc.nd&&(olympe.la.fb('dc').warn(`Try to create a relation between 2 objects that have different locations: ${b}-[${a}]->${c}, originSrc: ${d}, destinationSrc: ${e}`),f=!1);nj(this,d,f,g=>{g.Ea(a,b,c,kj(this,b),kj(this,c))})}Xb(a,b,c){const d=jj(this,b),e=jj(this,c);let f=lj(this,b)&&lj(this,c)&&d!==olympe.dc.Ra.SELF&&e!==olympe.dc.Ra.SELF;f&&d!==
712
- e&&a!==olympe.dc.mc.nd&&(olympe.la.fb('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);nj(this,d,f,g=>{g.Xb(a,b,c,kj(this,b),kj(this,c))})}};function pj(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.jo.yp)if(e===olympe.dc.Ra.SELF)d[g]=olympe.dc.ta().W();else{if(e===olympe.dc.Ra.SERVER)continue}else g.startsWith(olympe.dc.Wi.Id)&&(g='fd'+g.substring(1));e=a.$(e);c&&e instanceof Object&&8===e.c?a.T.set(g,e):d[g]=e}return d}function qj(a){if(0===a.T.size)return null;const b=Object.create(null);a.T.forEach((c,d)=>{b[d]=c});a.T.clear();return b}
713
- class rj{constructor(){this.T=new Map}$(a){return a instanceof olympe.D.Ka||a instanceof olympe.D.ea||a instanceof olympe.D.aa?a.valueOf():a instanceof Date||a instanceof olympe.D.Za?(a=a instanceof olympe.D.Za?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.D.Color?{c:7,r:a.rg().valueOf(),g:a.pg().valueOf(),b:a.mg().valueOf(),a:a.lg().valueOf()}:a&&'function'===
638
+ {recursive:this.G?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:sh(this).map(b=>b.map(c=>c.Cc())),optional:this.T()};this.yb&&(a.sort={property:this.yb.Qa(),order:this.yb.Sh});return a}toString(){return`followRecursivelyPart-${this.relation}-${this.G}-${super.toString()}`}};olympe.dc.query.ya.oe=class extends olympe.dc.query.ya.jj{constructor(a,b,c){super(a,!1);this.bc=b;this.G=null!=c?c:null}L(){return new olympe.dc.query.ya.oe(this.C,this.bc,this.G)}$(){return olympe.Z.nb(this.C+'followRules')}na(){return new olympe.dc.query.ya.qn(this.G)}da(a,b){return b instanceof olympe.dc.query.ya.oe?[a]:[olympe.Z.nb(a+'followRules')]}wc(a){if(a instanceof olympe.dc.query.ya.Wf||a instanceof olympe.dc.query.ya.zf){const b=olympe.dc.wa.ORIGIN,c=olympe.dc.wa.DESTINATION,d=olympe.dc.mc.nd,
639
+ e=olympe.dc.mc.Jh,f=olympe.dm.Relation.C.ml,g=olympe.dm.Relation.C.zl;a=a.P();const h=a.Pa(),k=a.X();return h!==c||k!==d&&k!==e?!!(Nf(this.db,a,this.bc)&(a.Pa()===b?f:g)):!0}return a instanceof olympe.dc.query.ya.oe?this.bc===a.bc:!1}lb(a){const b=this.W();for(const c of Fg(a,this.C))for(const d of He(this.db,c,this.bc))Hg(a,d,b,c)}observe(a,b){const c=this.W(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?Kf(this.db,g,this.bc,(m,n,p,q,r)=>{p&&(p=q?Hg(a,r,c,e):a.remove(r,c,e),null!==n&&Ig(a,q,m,n,g,r),p&&d(e,
640
+ q,r,h))},k):Lf(this.db,g,this.bc,k);b(f,g,e,k)};return(e,f,g,h)=>{g=olympe.Z.nb(h+f+this.toString());(e?Hg(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,g)}}ha(){return Object.assign(super.ha(),{f:this.bc})}Cc(){throw Error('Try to parse a part of an implicit query. Data connectors do not support those queries.');}toString(){return`followRulePart-${this.bc}-${super.toString()}`}T(){return!1}filter(){olympe.la.fb('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.la.fb('dc.query').warn('Should never try to sort queries with follow rules, ignore...');
641
+ return this}};olympe.dc.query.ya.oe.F='followRules';olympe.dc.query.ya.sl=class{constructor(){this.content=new Map}Rd(){return this.content.keys()}F(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)}P(){return!1}G(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);b=c.delete(b);0===c.size&&this.content.delete(a);return b}};olympe.dc.query.ya.sl.va=[olympe.dc.query.ya.So];olympe.dc.sources={};olympe.dc.sources.mp=class extends Error{};olympe.dc.sources.Ak=class{W(){}init(){}destroy(){}request(){return v(function*(){})}L(){}};const wh=olympe.net.Fa.Jd.GET,xh=olympe.net.Fa.Jd.Pg,yh=olympe.net.Fa.Jd.rc,zh=olympe.net.Fa.Jd.Ro,Ah=olympe.net.Fa.Headers.Gh,Bh=olympe.net.Fa.Headers.Lm,Ch=olympe.net.Fa.Zb.Wh,Dh=olympe.net.Fa.Zb.fn,Eh=olympe.net.Fa.Zb.Jn,Fh=olympe.net.Fa.Zb.Zh,Gh=olympe.net.Fa.Zb.Ao;
642
+ function Hh(a){const b=`/${olympe.V.getParameter(olympe.dc.sources.U.Lk)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.$.P('_DataSourcesHTTPService',b,[wh,xh,yh,zh],(c,d,e)=>v(function*(){const f=d.get('sourceId'),g=a.G.get(d.get('sourceId'));if(!g)return Promise.resolve(new olympe.net.Bf('Invalid source id',Gh,'Invalid source id'));const h=c.method,k=c.Nj();try{var m=yield Ih(a,k[Bh])}catch(r){return new olympe.net.Bf(`Invalid token ${r}`,Eh,'Access denied')}try{var n=
643
+ Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.C.Ob,t=olympe.dc.Request.C.Rg,u=olympe.dc.Request.C.Xg,w=olympe.dc.Request.C.Yg,x=olympe.dc.Request.C.Dh,y=olympe.dc.Request.C.Hg,z=olympe.dc.Request.C.Uf,A=olympe.dc.Request.C.jg;let M;switch(n){case r:break;case t:case u:case x:case w:M=a.F.G(p);break;case A:case y:case z:M={tag:e.get('tag'),model:e.get('model'),mimeType:k[Ah]};p instanceof Uint8Array&&(M.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);
644
+ }let K;const pa=null!=(K=k['X-Source-Origin'])?K:olympe.dc.Ra.Ef;var q=se(new olympe.dc.Request(n,f,M,m),pa);const Ta=yield g(q),Gj=Ta instanceof Blob||Ta instanceof Uint8Array||Ta instanceof ArrayBuffer||void 0===Ta?null!=Ta?Ta:'':JSON.stringify(a.F.ha(Ta));return new olympe.net.Bf(Gj,h===zh?Dh:Ch)}catch(r){return r instanceof olympe.dc.sources.mp?new olympe.net.Bf(`Authorization error: ${r}`,Eh,'Forbidden'):new olympe.net.Bf(`Internal server error: ${r}`,Fh,'Internal server error')}})).catch(c=>
645
+ a.K.error(`Error while starting the HTTP Service: ${c}`));a.K.debug(`Started HTTP service with path: ${b}`)}function Jh(a){a.$.T('_DataSourcesHTTPService').catch(b=>{a.K.error(`An error occurred while stopping the data sources http service: ${b}`)})}function Kh(a,b,c){0===a.G.size&&Hh(a);a.G.set(b,c);return()=>{a.G.delete(b);0===a.G.size&&Jh(a)}}function Lh(a,b,c){c=b.ge(c);null===c&&a.K.error(`Impossible to build URL for data source ${b}`);return c}
646
+ function Mh(a,b,c){if(b===olympe.dc.Ra.SERVER){var d;return null!=(d=Wc(a.P,a.ga.get(c)))?d:null}var e=a.T.get(b);if(!e){d=a.da.Gb(b);if(null===d)return null;e=olympe.dc.sources.U.Mk;const f=olympe.dc.sources.U.Lh,g=olympe.dc.sources.U.Vn,h=olympe.dc.sources.U.Lk;let k;e=`${Lh(a,d,g)?'https':'http'}://${Lh(a,d,e)}:${null!=(k=Lh(a,d,f))?k:Lh(a,d,g)?443:80}`+`/${Lh(a,d,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.T.set(b,e)}return`${e}/${c}`}
647
+ function Nh(a,b){return b instanceof olympe.net.Oh?Xc(a.P,b,Cc(a.L).Yc()):Promise.reject('No http request to send')}function Oh(a,b){var c=Mh(a,b.fc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.fc()}`);const d=b.content,e=JSON.stringify(a.F.ha(d));c=O(c,xh,e);P(c,{['X-Source-Origin']:b.origin,[Ah]:'application/json'});return Nh(a,c).then(f=>'string'===typeof f?a.F.G(JSON.parse(f)):olympe.dc.query.wd.Tl(d))}
648
+ function Ph(a,b){var c=Mh(a,b.fc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.fc()}`);const d=JSON.stringify(a.F.ha(b.content));c=O(c,xh,d);P(c,{['X-Source-Origin']:b.origin,[Ah]:'application/json'});return Nh(a,c).then()}function Ih(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.L.ug(b,(e,f)=>{e?d(e):c(f)})})}
649
+ olympe.dc.sources.Gr=class{constructor(a,b,c,d,e,f){this.K=a;this.$=b;this.P=c;this.L=d;this.da=e;this.F=f;this.G=new Map;new olympe.D.Jb('Http service of remote data provider');this.T=new Map;this.C=new Map;this.ga=new Map([[olympe.dc.Request.C.pe,olympe.O.Mb.pe],[olympe.dc.Request.C.Uf,olympe.O.Mb.Ri],[olympe.dc.Request.C.jg,olympe.O.Mb.Ri],[olympe.dc.Request.C.Hg,olympe.O.Mb.Ri],[olympe.dc.Request.C.Nm,olympe.O.Mb.Mm],[olympe.dc.Request.C.gp,olympe.O.Mb.fp],[olympe.dc.Request.C.Jk,olympe.O.Mb.Qn],
650
+ [olympe.dc.Request.C.Ki,olympe.O.Mb.$m],[olympe.dc.Request.C.Yg,olympe.O.Mb.TRANSACTION]])}Rc(a){var b=Mh(this,a.fc(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.fc()}`);b=O(b,wh);P(b,{['X-Source-Origin']:a.origin});return Nh(this,b)}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.fc(),f=Mh(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);const g=O(e===olympe.dc.Ra.SERVER?
651
+ `${f}/${b}`:`${f}?tag=${b}&model=${c}`,zh,d);P(g,{[Ah]:'application/octet-stream'});e!==olympe.dc.Ra.SERVER&&P(g,{['X-Source-Origin']:a.origin});return Nh(this,g).then(()=>(new URL(g.C())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.fc();var e=Mh(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=O(d===olympe.dc.Ra.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,yh,b);d!==olympe.dc.Ra.SERVER&&P(e,{['X-Source-Origin']:a.origin});return Nh(this,
652
+ e).then()}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.fc();var e=Mh(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to download the file. ${b}`);var f;const g=null!=(f=this.C.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,jh:k})});if(this.C.has(b))return f;this.C.set(b,g);e=O(d===olympe.dc.Ra.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,wh,b,olympe.net.Fa.ResponseType.Hp);d!==olympe.dc.Ra.SERVER&&P(e,{['X-Source-Origin']:a.origin});Nh(this,e).then(h=>{const k=
653
+ h instanceof ArrayBuffer?new Uint8Array(h,0,h.byteLength):h;let m;null==(m=this.C.get(b))||m.forEach(n=>n.done(k))}).catch(h=>{let k;null==(k=this.C.get(b))||k.forEach(m=>m.jh(`${h}`))}).finally(()=>{this.C.delete(b)});return f}};olympe.dc.sources.eo=class{constructor(a,b){this.K=a;this.ec=b}};olympe.dc.sources.eo.Zb={$h:0,iz:1,jz:3,Gy:4};const Qh=olympe.dc.Request.C.Ob,Rh=olympe.dc.Request.C.Rg,Sh=olympe.dc.Request.C.mj,Th=olympe.dc.Request.C.jg,Uh=olympe.dc.Request.C.Uf,Vh=olympe.dc.Request.C.Hg,Wh=olympe.dc.Request.C.Ch,Xh=olympe.dc.Request.C.Dh,Yh=olympe.dc.Request.C.Xg,Zh=olympe.dc.Request.C.Yg;
654
+ function $h(a,b){const c=b.W();null===a.F&&(a.F=new olympe.Z.wl(6E4),La(a.F,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.K.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),Ma(a.F,()=>{a.F=null}));let d;const e=null!=(d=a.F.get(c))?d:new olympe.dc.db.Lc(c);b.Nd(e);Ja(a.F.C,c)||a.F.set(c,e)}
655
+ function ai(a,b){const c=b.W();let d,e;const f=null!=(e=null==(d=a.F)?void 0:d.get(c))?e:new olympe.dc.db.Lc(c);let g;null==(g=a.F)||g.delete(c);b.Nd(f);return a.applyTransaction(f,!1).catch(h=>{a.K.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function bi(a,b){const c=rxjs.defer(()=>a.C.executeQuery(b).then(d=>d.Zc()));return 0<a.$?rxjs.interval(a.$).pipe(rxjs.operators.switchMap(()=>c)):c}
656
+ olympe.dc.sources.po=class{constructor(a,b){this.K=a;this.C=b;this.T=olympe.dc.query.Sj();this.P=olympe.dc.Wl();this.G=new olympe.D.Jb('Context of source '+this.W());let c;this.$=null!=(c=b.ge(olympe.dc.sources.U.gl))?c:-1;this.F=null}W(){return this.C.W()}init(){if(this.W()===olympe.dc.Ra.SELF)return this;(new Promise((a,b)=>{let c=!0;ci(this.C,this.G).subscribe(rxjs.Subscriber.create(d=>{if(this.K.C()){this.K.debug(`Data source ${this.C.name()} has loaded ${d.size()} data types in its cache:`);
657
+ for(const [e,f]of d)this.K.debug(`=> DataType: ${f.name()} (${e})`)}c&&(c=!1,a())},b))})).then(()=>this.C.init(this.G)).catch(a=>{this.K.error(`Error while initialization of DataSource ${this.C.name()} (${this.W()}): ${a}`)});return this}healthCheck(){return this.C.healthCheck().then(()=>`Data source ${this.C.name()} (${this.C.W()}) OK`)}destroy(){this.G.destroy();return this.C.destroy()}request(a){const b=a.content,c=a.getType();switch(c){case Qh:const d=olympe.dm.DataSource.Ob.Cb,e=olympe.dm.DataSource.Ob.Sg;
658
+ return this.C.healthCheck().then(()=>({s:e})).catch(f=>({s:d,r:String(f)}));case Rh:return this.C.executeQuery(b);case Wh:return a=b.Zc(),$h(this,a),this.P.ed(a),Promise.resolve();case Yh:case Zh:return this.applyTransaction(b.Zc(),c===Zh);case Xh:return ai(this,b.Zc());case Th:return b.content instanceof Uint8Array?this.C.uploadFileContent(b.tag,b.model,b.content):Promise.reject('File content is undefined');case Uh:return this.C.downloadFileContent(b.tag,b.model).then(f=>f instanceof Uint8Array?
659
+ f:Promise.reject(`Content of file ${b.tag} is not an Uint8Array`));case Vh:return this.C.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}L(a){if(a.getType()===Sh){const b=a.content;a=a.origin;return a===olympe.dc.Ra.SELF?bi(this,b):Sg(this.T,b,this.G,a,olympe.dc.ra.uc.Tf).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.ke)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c))}return rxjs.throwError(()=>
660
+ Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return v(function*(){const d=di(a);yield c.C.applyTransaction(d,{batch:b});yield ah(c.T,c.W(),a);c.P.ed(a)})}};olympe.dc.sources.po.va=[olympe.dc.sources.Ak];function di(a){const b=olympe.dc.sources.Gf.C.fr,c=olympe.dc.sources.Gf.C.Ct,d=olympe.dc.sources.Gf.C.jr,e=olympe.dc.sources.Gf.C.gr,f=olympe.dc.sources.Gf.C.kr,g=[],h=[],k=[],m=[],n=[];a.C.forEach((p,q)=>{const r=p.Cd();p.L()?g.push(ei(b,q,r,p.da()?p.Bb():null)):p.lf()?k.push(ei(d,q,r,null,p.$())):p.da()&&h.push(ei(c,q,r,p.Bb()));for(const [t,u,w]of p.ie())p=a.Ge(u),w?m.push(new fi(e,t,q,u,r,p.Cd())):n.push(new fi(f,t,q,u,r,p.Cd()))});return n.concat(k,g,h,m)}
661
+ function ei(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new gi(a,b,c,d,e)}olympe.dc.sources.Gf=class{constructor(a){this.type=a}};class gi extends olympe.dc.sources.Gf{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.Nb.NONE}}
662
+ class fi extends olympe.dc.sources.Gf{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.Gf.C={fr:'CREATE',Ct:'UPDATE',jr:'DELETE',gr:'CREATE_RELATION',kr:'DELETE_RELATION'};const hi=olympe.dc.Request.C.Ob,ii=olympe.dc.Request.C.Rg,ji=olympe.dc.Request.C.mj,ki=olympe.dc.Request.C.Xg,li=olympe.dc.Request.C.Yg,mi=olympe.dc.Request.C.Ch,ni=olympe.dc.Request.C.Dh,oi=olympe.dc.Request.C.jg,pi=olympe.dc.Request.C.Uf,qi=olympe.dc.Request.C.Hg,ri=olympe.dc.Request.C.Fk;function si(a,b){let c;return(null==(c=a.da.Gb(b))?void 0:c.ge(olympe.dc.sources.U.me))!==olympe.dm.DataSource.me.Tn}
663
+ function ti(a,b){let c;return(null==(c=a.da.Gb(b))?void 0:c.ge(olympe.dc.sources.U.me))!==olympe.dm.DataSource.me.Rm}function ui(a,b){b=se(new olympe.dc.Request(ri,olympe.dc.Ra.SELF,{id:b,finalize:olympe.dc.transaction.Hf.C.bj,error:null}),a.W());let c;null==(c=a.ec)||c.gd(b)}
664
+ function vi(a,b){b=b.pc();if(b!==olympe.dm.User.C&&a.ge(olympe.dc.sources.U.ll))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.W()}). Please use an admin account instead.`,new olympe.dc.sources.mp(a);}
665
+ function wi(a,b,c,d,e){return v(function*(){var f=olympe.O.Request.jb.SEND,g=olympe.O.Request.jb.GET;const h=olympe.O.Request.jb.PUBLISH,k=olympe.O.Request.jb.SUBSCRIBE,m=d.vh();var n=d.body();if(e!==n.pc())throw Error('Access denied: try to impersonate a user');vi(c,n);let p;if(null==(p=a.ec)||!p.da(n.fc()))throw Error(`Try to process a message with destination data source ${n.fc()} coming from remote but not started here`);if(m===k){if(n.getType()===ji)f=n.content.W();else throw Error('Not supported type of subscription');
666
+ g=yield d.pm(f);a.T.set(g,f);g=a.P.get(f);g||(g=new xi(a.K,f,b,se(n,olympe.dc.Ra.Ef)),a.P.set(f,g));n=g;n.C++;n.K.debug(`Data subscription ${n.F} has ${n.C} subscribers`)}else m===g?(n=yield b.request(n),void 0!==n?yield d.gd(n):a.K.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):m===f?(yield b.request(n),yield d.Xp()):m===h&&(yield b.request(n))})}
667
+ olympe.dc.sources.lp=class{constructor(a,b,c,d,e){this.K=a;this.G=b;this.C=c;this.db=d;this.F=new olympe.D.Jb('Remote Provider Context');this.ec=null;this.$=new Map;this.P=new Map;this.T=new Map;this.da=e}W(){return olympe.dc.Ra.Ef}request(a){var b=olympe.O.qb;const c=a.fc(),d=a.getType();this.K.C()&&this.K.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case hi:const e=olympe.dm.DataSource.Ob.Cb,f=olympe.dm.DataSource.Ob.Sg;b=si(this,c)?b.get(c,a):
668
+ Promise.resolve({s:f});a=ti(this,c)?this.C.Rc(a):Promise.resolve({s:f});return Promise.all([b,a]).then(([k,m])=>{if((null==k?void 0:k.s)===e||(null==m?void 0:m.s)===e){let n,p;return{s:e,r:`${null!=(n=null==k?void 0:k.r)?n:''} ${null!=(p=null==m?void 0:m.r)?p:''}`}}return{s:f}});case ii:return ti(this,c)?Oh(this.C,a):b.get(c,a);case ki:const g=a.content.Zc().W();return(si(this,c)?b.send(c,a):Ph(this.C,a)).finally(()=>ui(this,g));case li:const h=a.content.Zc().W();return(ti(this,c)?Ph(this.C,a):b.send(c,
669
+ a)).finally(()=>ui(this,h));case mi:return si(this,c)?b.publish(c,a).catch(k=>{this.K.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case ni:return si(this,c)?b.publish(c,a).catch(k=>{this.K.error(`An error occurred while sending "burst transaction done" to the data source ${c}: ${k}`)}):Ph(this.C,a);case oi:return ti(this,c)?this.C.uploadFileContent(a):b.get(c,a);case pi:return ti(this,c)?this.C.downloadFileContent(a):b.get(c,a);case qi:return ti(this,
670
+ c)?this.C.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.W()}`)}}L(a,b){const c=a.fc(),d=a.getType();if(!si(this,c))return rxjs.throwError(()=>Error(`Subscription request not supported for data source ${this.db.name(c)} (${c}) which uses HTTP only.`));this.K.C()&&this.K.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===ji?olympe.O.qb.observe(c,this.F,a,{onRetry:b}):
671
+ rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){this.ec=a;olympe.dc.ra.from(this.G,this.G).eb(olympe.dm.DataSource.yi).filter(olympe.dc.query.Ca.Ha(olympe.dm.DataSource.fh,!0)).filter(olympe.dc.query.Ca.Ha(olympe.dm.DataSource.jq,!0)).observe(this.F).subscribe(b=>{ue(b).forEach(this.na.bind(this,a));te(b).forEach(c=>{let d;null==(d=this.$.get(c))||d.destroy();this.$.delete(c)})});this.db.Qa(this.G,olympe.dm.DataSource.jq)&&(new olympe.O.qb(this.G,this.F)).listen().subscribe(b=>
672
+ {b=b.body();b instanceof olympe.dc.Request?a.gd(b):this.K.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return v(function*(){})}na(a,b){const c=b.X(),d=new olympe.D.Jb(`Published data provider context ${c}`,this.F);this.$.set(c,d);let e,f;yi(b,d).subscribe(g=>{let h;null==(h=e)||h();let k;null==(k=f)||k.stop();g!==olympe.dm.DataSource.me.Rm&&(e=Kh(this.C,c,m=>{vi(b,m);return a.request(m)}),d.onDestroy(()=>{let m;return null==(m=e)?void 0:m()}));
673
+ g!==olympe.dm.DataSource.me.Tn&&(g=new olympe.D.Jb(`Bus Service of data source ${c}`,d),f=(new olympe.O.qb(c,g)).Dq(this.ga.bind(this)),f.listen().subscribe(m=>{m.yh().then(n=>wi(this,a,b,m,n)).catch(n=>{this.K.warn(`Error occurred while processing request from ${m.source()}: ${n}`);return m.jh(n instanceof Error?n:Error(n))})}))})}ga(a){const b=this.T.get(a);this.T.delete(a);if(a=b)null==(a=this.P.get(b))?a=0:(0<a.C&&--a.C,0===a.C?(a.K.debug(`Data subscription ${a.F} has more subscriber: unsubscribe`),
674
+ a.G.unsubscribe(),a=!0):(a.K.debug(`Data subscription ${a.F} has ${a.C} subscribers`),a=!1));a&&this.P.delete(b)}};class xi{constructor(a,b,c,d){this.K=a;this.F=b;this.C=0;this.G=c.T(d).subscribe({next:e=>{olympe.O.qb.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}`)})}}olympe.dc.sources.lp.va=[olympe.dc.sources.Ak];olympe.dc.sources.fg=class extends olympe.O.fg{constructor(a){super();this.db=a;this.L=new Map}ha(a){a=this.C(a);if(0<this.L.size){const b=Array.from(this.L.values());this.L.clear();return{t:0,i:b,v:a}}return a}G(a){if(0===(null==a?void 0:a.t)){const b=a.i.reduce((c,d)=>{const e=new Map(Array.from(Object.entries(d.p).map(([f,g])=>[f,this.F(g)])));c.Ec(d.t,d.s,e,d.m);d.r.forEach(f=>c.Ea(f.r,d.t,f.d));return c},new olympe.dc.db.Lc);olympe.dc.Wl().ed(b);return this.F(a.v)}return this.F(a)}C(a){switch(!0){case a instanceof
675
+ olympe.dc.CloudObject:return a=a.X(),this.P(a),{t:10,v:a};case a instanceof olympe.dc.ra:return{t:11,v:a.ha()};case a instanceof olympe.dc.La:return{t:12,v:a.ha(this.P.bind(this))};case a instanceof olympe.dc.db.Lc:const b=new olympe.dc.transaction.ag;a.Nd(b);return{t:13,i:a.W(),v:xg(b)};case a instanceof olympe.dc.Request:return{t:14,r:a.getType(),o:a.origin,d:a.fc(),u:a.pc(),c:this.C(a.content)};case a instanceof olympe.dc.transaction.Aj:return{t:15,r:a.wg(),p:this.C(a.Zc())};case a instanceof olympe.dc.query.wd:return{t:16,
676
+ v:a.ha()};default:return super.C(a)}}F(a){if('object'!==typeof a||'number'!==typeof(null==a?void 0:a.t))return super.F(a);switch(a.t){case 10:return olympe.dc.CloudObject.get(a.v);case 11:a=a.v;var b=a.p.map(olympe.dc.query.ya.jj.C),c=a.e;return new olympe.dc.ra(a.b,a.s,b,b.length-1,new Set(a.r),{max:c.m,offset:c.o,hd:c.s,rf:c.rm});case 12:return ch(a.v);case 13:return(new olympe.dc.transaction.gj).C(a.v,a.i);case 14:return c=null!=(b=this.F(a.c))?b:void 0,se(new olympe.dc.Request(a.r,a.d,c,a.u),
677
+ a.o);case 15:return b=this.F(a.p),new olympe.dc.transaction.Aj(b,a.r);case 16:return a=a.v,new olympe.dc.query.wd((new olympe.dc.transaction.gj).C(a.p),a.s);default:return super.F(a)}}P(a){if(!this.L.has(a)){if(!this.db.Ia(a))throw new olympe.dc.Ko(a);var b={};this.db.Bb(a).forEach((d,e)=>{b[e]=this.C(d)});var c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:[]};this.L.set(a,c);for(const [d,e,f]of Of(this.db,a)){const g=this.L.get(f);void 0!==g&&(e===olympe.dc.wa.DESTINATION?c.r.push({r:d,d:f}):
678
+ g.r.push({r:d,d:a}))}}}};const zi=olympe.dc.Request.C.pe,Ai=olympe.dc.Request.C.Xg,Bi=olympe.dc.Request.C.Yg,Ci=olympe.dc.Request.C.Ch,Di=olympe.dc.Request.C.Nm,Ei=olympe.dc.Request.C.gp,Fi=olympe.dc.Request.C.Rg,Gi=olympe.dc.Request.C.Ki,Hi=olympe.dc.Request.C.mj,Ii=olympe.dc.Request.C.Jk,Ji=olympe.dc.Request.C.Rn,Ki=olympe.dc.Request.C.Cr,Li=olympe.dc.Request.C.Dr,Mi=olympe.dc.Request.C.Hg,Ni=olympe.dc.Request.C.Uf,Oi=olympe.dc.Request.C.jg,Pi=olympe.dc.Request.C.Fk,Qi=olympe.dc.Request.C.At,Ri=olympe.dc.Request.C.bt,Si=
679
+ olympe.dc.Request.C.Br,Ti=olympe.dc.Request.C.Dh,Ui=olympe.dc.Request.C.$q,Vi=olympe.dc.Request.C.Ob;function Wi(a){return Xi(a,olympe.dc.Request.C.pe).then(b=>{b=b.p;const c=wg(b,a.W());a.K.C()&&a.K.debug('< Get Context result',b);a.K.P()&&a.K.log('< Get Context result has',b.length,'operations');return c})}
680
+ function Yi(a,b){const c=b.Zc();b=new olympe.dc.transaction.ag({ak:!0,Ld:!1,gh:!1});c.Nd(b);return Xi(a,Bi,xg(b)).finally(()=>{Zi(a,Pi,{id:c.W(),finalize:olympe.dc.transaction.Hf.C.bj})}).then()}function $i(a,b){const c=new olympe.dc.transaction.ag({Ld:!1,gh:!1}),d=b.Zc();d.Nd(c);return aj(a,Ci,{i:d.W(),r:b.wg(),p:xg(c)},!1).catch(e=>a.K.error(`Error while publishing burst transaction: ${e}`))}
681
+ function bj(a,b){const c=b.W();a.K.C()&&a.K.debug(`Query (${c}) sent to orchestrator: ${b}`);b=cj(a,b);return Xi(a,Ii,b).then(d=>dj(a,d))}function ej(a,b){const c=encodeURI(Ga(olympe.Z.De(),JSON.stringify(cj(a,b))));a.K.C()&&a.K.debug(`Static GraphDef query ${b} sent to orchestrator`);return Xi(a,Gi,void 0,`query=${c}&v=${a.version}`).then(d=>dj(a,d))}
682
+ function aj(a,b,c,d=!0){const e=olympe.O.$d.rn,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{dd(a.F,e,f,(k,m)=>{k?h(k):g(m)})});dd(a.F,e,f);return Promise.resolve()}
683
+ function cj(a,b){const c=Bg(b);b={i:b.W(),b:[b.F],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.ya.oe)Object.assign(b,{f:c[0].bc,q:[]});else{const d=new Map;for(let e=c.length-1;0<=e;e--){const f=c[e],g=f.C;let h;const k=(null!=(h=d.get(g))?h:new Set).add(f);if(f instanceof olympe.dc.query.ya.zf&&f.G){let m;null==(m=d.get(f.W()))||m.forEach(n=>k.add(n))}d.set(g,k)}Object.assign(b,{f:olympe.dc.Nb.NONE,q:c.map(a.T.bind(a,d))})}return b}
684
+ function Zi(a,b,c){b=se(new olympe.dc.Request(b,olympe.dc.Ra.SELF,c),a.W());let d;null==(d=a.ec)||d.gd(b)}
685
+ function Xi(a,b,c,d){if(ad(a.F)){const e=Mh(a.C,a.W(),b);if('string'!==typeof e)return Promise.reject(`ServerProvider: no url for type ${b}`);b=O(`${e}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.Fa.Jd.Pg:olympe.net.Fa.Jd.GET,c&&JSON.stringify(c));P(b,{[olympe.net.Fa.Headers.Gh]:'application/json'});return Nh(a.C,b).then(f=>'string'===typeof f&&0<f.length?JSON.parse(f):f)}a.K.error('Server is disconnected, data request of type',b,'is canceled.');return Promise.reject('Server is disconnected')}
686
+ function dj(a,b){if(b&&'object'===typeof b){if(0<b.s)throw Error(b.info.error.reason);return wg(b.p,a.W())}throw Error('Data result can be created only from Object');}
687
+ olympe.dc.sources.zp=class{constructor(a,b,c,d,e,f){this.K=a;this.F=b;this.da=c;this.$=d;this.C=e;this.P=new olympe.dc.transaction.gj(this.W());this.G=new Map;this.ec=null;this.version=f||'unknown';const g=olympe.auth.Ba.C.Af,h=olympe.auth.Ba.C.le;olympe.D.qc([this.$.getState()],k=>{k!==g&&k!==h||this.G.forEach((m,n)=>{m.error(new olympe.O.errors.dl('Connection to server has been recovered',n))})})}W(){return olympe.dc.Ra.SERVER}request(a){var b=a.getType(),c=a.content;switch(b){case Vi:return c=
688
+ olympe.dm.DataSource.Ob.Cb,a=olympe.dm.DataSource.Ob.Sg,Promise.resolve(ad(this.F)?{s:a}:{s:c,r:'Disconnected'});case zi:return Wi(this);case Ai:return a=new olympe.dc.transaction.ag({Ld:!1,gh:!1}),b=c.Zc(),b.Nd(a),aj(this,Ai,{i:b.W(),r:c.wg(),p:xg(a)}).then();case Bi:return Yi(this,c);case Ci:return $i(this,c);case Ti:return a=new olympe.dc.transaction.ag({Ld:!1,gh:!1}),c=c.Zc(),c.Nd(a),aj(this,Ti,{i:c.W(),p:xg(a)}).then();case Fi:return bj(this,c);case Gi:return ej(this,c);case Di:return ad(this.F)?
689
+ (c=cj(this,olympe.dc.ra.from(c)),c.f=olympe.dc.Nb.vn,c=O(Mh(this.C,olympe.dc.Ra.SERVER,Di),olympe.net.Fa.Jd.Pg,JSON.stringify(c),olympe.net.Fa.ResponseType.Hp),P(c,{[olympe.net.Fa.Headers.Gh]:olympe.net.Fa.nn.JSON}),c=Nh(this.C,c)):(this.K.error(`Server is disconnected, backup of instance ${c} is canceled.`),c=Promise.reject('Server is disconnected')),c;case Ei:a=c.QB;b=c.debug;c=c.optional;if(ad(this.F)){var d=Mh(this.C,olympe.dc.Ra.SERVER,Ei);c=O(d+`?debug=${b}&optional=${c}`,olympe.net.Fa.Jd.Pg,
690
+ a);P(c,{[olympe.net.Fa.Headers.Gh]:olympe.net.Fa.nn.It});c=Nh(this.C,c)}else this.K.error('Server is disconnected, restore of instance is canceled.'),c=Promise.reject('Server is disconnected');return c;case Qi:case Ri:case Si:case Ui:return aj(this,b,{});case Ni:return this.C.downloadFileContent(a);case Mi:return this.C.deleteFileContent(a);case Oi:return this.C.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}L(a,b){if(a.getType()===Hi){const c=
691
+ a.content,d=c.W();return(new rxjs.Observable(e=>{const f=cj(this,c);this.G.set(d,e);aj(this,Ji,f).catch(g=>e.error(g))})).pipe(Kc(this.da,b),rxjs.operators.finalize(()=>{aj(this,Ki,{i:d}).catch(e=>{this.K.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.G.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){this.ec=a;Zc(this.F,olympe.O.$d.rn,this.ga.bind(this));return this}destroy(){return v(function*(){})}ga(a){var b=
692
+ olympe.dc.Request.C.Qm;const c=olympe.dc.Request.C.bl;var d=a.c;if(d===olympe.dc.Request.C.sn)a=this.P.C(a.p),Zi(this,d,a);else if(d===b){var e=a.error.reason;b=this.P.C(a.p);Zi(this,d,{id:a.i,rollback:b,error:e})}else d===Li?(d=a.i,a=this.P.C(a.p),null==(e=this.G.get(d))||e.next(a)):d===c&&Zi(this,Pi,{id:a.i,finalize:olympe.dc.transaction.Hf.C.bl,error:0<a.s?a.info.error.reason:null})}T(a,b){if(b instanceof olympe.dc.query.ya.Wf||b instanceof olympe.dc.query.ya.zf){const c=b.P();let d;b=Array.from(null!=
693
+ (d=a.get(b.W()))?d:[]);return{t:c.X(),d:c.Pa()===olympe.dc.wa.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.T.bind(this,a))}}return{}}};olympe.dc.sources.zp.va=[olympe.dc.sources.Ak];function fj(a,b,c){const d=new olympe.D.Jb(`Source solver ${b.X()}`);b.eb(olympe.dm.xd.G.Qb()).eb(olympe.dm.xd.C).Md().back().eb(olympe.dm.xd.F).Md().observe(d,c).subscribe(e=>{ue(e).forEach(([f,g])=>{a.F.set(f.X(),g.W())});te(e).forEach(([f])=>{a.F.delete(f)})});b.eb(olympe.dm.pb.L).observe(d,c).subscribe(e=>{let f,g;a.G=null!=(g=null==(f=e.yc())?void 0:f.W())?g:null});d.onDestroy(()=>{a.F.clear();a.G=null})}
694
+ olympe.dc.sources.xj=class{constructor(a,b,c){this.db=a;this.C=b;this.P=c;this.F=new Map;this.G=null;this.L=!1}fromModel(a){a=olympe.dc.fa(a);return this.F.has(a)?this.F.get(a):this.G&&this.T(a)?this.G:this.P}Ce(a){let b;return null!=(b=this.db.source(a))?b:this.P}Gb(a){return a===this.C?olympe.dc.CloudObject.get(this.C):a===olympe.dc.Ra.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ia(a)&&this.db.$c(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}T(){return!1}init(){if(!this.L){this.L=
695
+ !0;var a=new olympe.dc.Sa;Z(a.create(olympe.dm.DataSource,this.C).wh(this.C),olympe.dm.DataSource.fh,!0);a.Ea(olympe.dm.DataSource.yi,this.C,this.C);a.lb(()=>{olympe.dc.ra.from(this.C).observe(olympe.D.og()).subscribe(()=>{})})}}};olympe.dc.sources.R={za:'dc.sources.Logger',Ok:'dc.sources.HTTPService',Rr:'dc.sources.IOService',ep:'dc.sources.RemoteProvider',sp:'dc.sources.ServerProvider',Hy:'dc.sources.OfflineProvider',ue:'dc.sources.SourceSolver',de:'dc.sources.Serializer'};olympe.dc.sources.U={Mk:'data.httpHost',Lh:'data.httpPort',Vn:'data.httpSSL',Lk:'data.httpBasePath',gl:'data.pollingFrequency',me:'data.communicationMode',ll:'data.restrictedUse',Kq:'offline.autoSync',Jq:'offline.autoPersist',ot:'offline.syncTimeout',VERSION:'version.version'};
696
+ olympe.V.config(function(a){F(a,olympe.dc.sources.U.Kq,!1);F(a,olympe.dc.sources.U.Jq,!1);F(a,olympe.dc.sources.U.ot,3E4);var b=a.getParameter(olympe.O.U.wk);F(a,olympe.dc.sources.U.Mk,b);var c=a.getParameter(olympe.dc.sources.U.Mk);c=(b='localhost'===c)||c.endsWith(a.getParameter(olympe.net.U.Zi));F(a,olympe.dc.sources.U.Lh,b?3141:c?80:443);F(a,olympe.dc.sources.U.Vn,!c);F(a,olympe.dc.sources.U.Lk,'runtime/data');F(a,olympe.dc.sources.U.gl,null);F(a,olympe.dc.sources.U.me,null);F(a,olympe.dc.sources.U.ll,
697
+ null);E(a,olympe.dc.sources.R.za,[olympe.la.R.Ga],d=>d.Fc('data'));D(a,olympe.dc.sources.R.de,olympe.dc.sources.fg,olympe.dc.R.Oe);va(a,olympe.O.R.de,olympe.dc.sources.R.de);D(a,olympe.dc.sources.R.Ok,olympe.dc.sources.Gr,olympe.dc.sources.R.za,olympe.net.R.Dj,olympe.O.R.Nk,olympe.auth.R.Ga,olympe.dc.sources.R.ue,olympe.O.R.de,new olympe.V.ma(olympe.O.U.lk));D(a,olympe.dc.sources.R.Rr,olympe.dc.sources.eo,olympe.dc.sources.R.za,olympe.dc.R.Tg,olympe.net.R.Ga,olympe.auth.R.Ga);D(a,olympe.dc.sources.R.ep,
698
+ olympe.dc.sources.lp,olympe.dc.sources.R.za,new olympe.V.ma(olympe.dc.U.eg),olympe.dc.sources.R.Ok,olympe.dc.R.Oe,olympe.dc.sources.R.ue);D(a,olympe.dc.sources.R.sp,olympe.dc.sources.zp,olympe.dc.sources.R.za,olympe.O.R.qj,olympe.O.R.nk,olympe.auth.R.Ga,olympe.dc.sources.R.Ok,new olympe.V.ma(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.R.ue,olympe.dc.sources.xj,olympe.dc.R.Oe,new olympe.V.ma(olympe.dc.U.eg),new olympe.V.ma(olympe.dc.U.yk))},'olympe.dc.sources');
699
+ olympe.V.run([olympe.dc.sources.R.ue],a=>{olympe.dc.Ed=()=>a});olympe.dc.transaction={};olympe.dc.Eh=class a{constructor(b,c){this.id=null!=b?b:olympe.Z.hc();this.F=new olympe.D.Jb('BurstTransaction#'+this.id,c);this.Db=gj(this);this.T=!1;this.F.onDestroy(()=>this.P());this.$=new Set;this.G=new Map;this.L=new Set;this.C=null;let d;this.mb=null!=(d=olympe.V.getParameter(olympe.dc.transaction.U.Pm))?d:30;this.na=[]}static C(b,c){return`${b},${c}`}Pb(b){for(const c of this.na)c(b);this.stop()}Wa(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.ga(this.L);0<b.size&&hj(this,
700
+ b,!1);this.L.clear()}ga(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.G.get(d))});return c}da(b,c,d){this.Da(b,c,d);this.Db(b,c,d);null===this.C&&(this.C=setTimeout(this.Wa.bind(this),this.mb))}Da(b,c,d){b=a.C(b,c);this.G.set(b,d);this.L.add(b)}ub(b,c){return this.G.get(a.C(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.ub(d,e)!==g&&this.da(d,e,g.valueOf())});this.$.add(b)}complete(){return new Promise((b,
701
+ c)=>{this.P((d,e)=>{for(const f of this.$)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.dc.qh().fb().error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.sm([d],g=>{this.T=!0;g instanceof olympe.dc.lc?olympe.dc.qh().fb().error('Cannot send complex property values in burst transactions'):this.da(e,f,g.valueOf())})}),this.F.$(()=>{this.P()}))}stop(){this.F.destroy();this.na.length=0}getContext(){return this.F}W(){return this.id}wg(){return!1}P(b){if(this.T){this.T=
702
+ !1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.L.clear();const c=this.ga(new Set(this.G.keys()));hj(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.Eh.prototype.complete=olympe.dc.Eh.prototype.complete;olympe.dc.Eh.prototype.push=olympe.dc.Eh.prototype.push;olympe.dc.Mo=class{C(){}toString(){}};olympe.dc.transaction.gj=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ra.SERVER}C(b,c){c=new olympe.dc.db.Lc(c);this.G(b,c);return c}G(b,c){for(const d of b)switch(d.o){case 1:b=a.C(d.p||{});let e;c.Ec(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case 2:c.jd(d.t,a.C(d.p),d.m);break;case 3:c.F(d.t,d.f,d.m);break;case 4:c.Ea(d.m,d.l,d.r,d.lm,d.rm);break;case 5:c.Wb(d.m,d.l,d.r,d.lm,d.rm);break;case 6:break;default:throw Error('Undefined patch operation: '+d.o);}}static C(b){const c=new Map;for(const [d,
703
+ e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.Wi.Hd+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':c.set(b,String(e));break;case 'boolean':c.set(b,!!e);break;case 'number':c.set(b,Number(e));break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;
704
+ 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.D.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.lc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};function ij(a,b){let c;return null!=(c=a.sources.get(b))?c:a.L.Ce(b)}function jj(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.C.Ge(b))?void 0:c.Cd())?d:a.db.model(b))?e:null}function kj(a,b){let c;return null!=(c=a.P.get(b))?c:a.db.Of(b)||!a.db.Ia(b)}function lj(a){return Array.from(a.C.Rd()).filter(b=>!b.lf()).map(b=>b.tag())}function mj(a,b,c,d){d(a.C);c&&a.G&&b!==olympe.dc.Ra.SELF&&(c=a.F.get(b),c||(c=new olympe.dc.db.Lc(a.id),a.F.set(b,c)),d(c))}
705
+ function nj(a,b,c){const d=ij(a,b),e=kj(a,b),f=jj(a,b);mj(a,d,e,g=>{g.F(b,c,f)})}
706
+ olympe.dc.transaction.Xs=class{constructor(a,b,c){this.id=null!=c?c:olympe.Z.hc();this.L=b;this.db=a;this.F=new Map;this.C=new olympe.dc.db.Lc(this.id);this.sources=new Map;this.P=new Map;this.G=!0}sh(){return 0===this.C.C.size}persist(a){this.G=a}Ec(a,b,c,d,e){let f;const g=null!=(f=null!=d?d:this.sources.get(a))?f:this.L.fromModel(b);this.sources.set(a,g);this.P.set(a,c&&this.G);mj(this,g,c,h=>{h.Ec(a,g,e,b)})}jd(a,b){const c=ij(this,a),d=kj(this,a),e=jj(this,a);mj(this,c,d,f=>{f.jd(a,null!=b?b:
707
+ new Map,e)})}Ea(a,b,c){const d=ij(this,b),e=ij(this,c);let f=kj(this,b)&&kj(this,c)&&d!==olympe.dc.Ra.SELF&&e!==olympe.dc.Ra.SELF;f&&d!==e&&a!==olympe.dc.mc.nd&&(olympe.la.fb('dc').warn(`Try to create a relation between 2 objects that have different locations: ${b}-[${a}]->${c}, originSrc: ${d}, destinationSrc: ${e}`),f=!1);mj(this,d,f,g=>{g.Ea(a,b,c,jj(this,b),jj(this,c))})}Wb(a,b,c){const d=ij(this,b),e=ij(this,c);let f=kj(this,b)&&kj(this,c)&&d!==olympe.dc.Ra.SELF&&e!==olympe.dc.Ra.SELF;f&&d!==
708
+ e&&a!==olympe.dc.mc.nd&&(olympe.la.fb('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);mj(this,d,f,g=>{g.Wb(a,b,c,jj(this,b),jj(this,c))})}};function oj(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.ho.wp)if(e===olympe.dc.Ra.SELF)d[g]=olympe.dc.ta().W();else{if(e===olympe.dc.Ra.SERVER)continue}else g.startsWith(olympe.dc.Wi.Hd)&&(g='fd'+g.substring(1));e=a.$(e);c&&e instanceof Object&&8===e.c?a.T.set(g,e):d[g]=e}return d}function pj(a){if(0===a.T.size)return null;const b=Object.create(null);a.T.forEach((c,d)=>{b[d]=c});a.T.clear();return b}
709
+ class qj{constructor(){this.T=new Map}$(a){return a instanceof olympe.D.Ka||a instanceof olympe.D.ea||a instanceof olympe.D.aa?a.valueOf():a instanceof Date||a instanceof olympe.D.Za?(a=a instanceof olympe.D.Za?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.D.Color?{c:7,r:a.rg().valueOf(),g:a.pg().valueOf(),b:a.mg().valueOf(),a:a.lg().valueOf()}:a&&'function'===
714
710
  typeof a.X?{c:8,t:a.X()}:a}}function xg(a){const b=a.L.concat(a.G).concat(a.P).concat(a.C).concat(a.T);a.P=[];a.G=[];a.C=[];a.T=[];a.L=[];return b}
715
- olympe.dc.transaction.ag=class{constructor({ak:a=!1,fh:b=!0,Md:c=!0}={}){this.P=[];this.G=[];this.C=[];this.T=[];this.L=[];this.ak=null!=a?a:!1;this.Md=null!=c?c:!0;this.fh=null!=b?b:!0;this.$=olympe.D?new rj:new class extends rj{$(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(xg(this))}Ec(a,b,c,d=null){c=pj(this.$,null!=c?c:null,this.ak);c={o:1,t:a,p:c};this.fh&&(c.s=b);this.Md&&d&&(c.m=d);this.P.push(c);this.ak&&(b=qj(this.$))&&this.C.push({o:2,t:a,p:b})}hd(a,
716
- b,c=null){b=pj(this.$,b||null,!1);a={o:2,t:a,p:b};this.Md&&c&&(a.m=c);this.C.push(a)}F(a,b,c=null){a={o:3,t:a,f:b};this.Md&&c&&(a.m=c);this.G.push(a)}Ea(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:4,m:a,l:b,r:c};this.Md&&d&&(a.lm=d);this.Md&&e&&(a.rm=e);this.T.push(a)}Xb(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');
717
- if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:5,m:a,l:b,r:c};this.Md&&d&&(a.lm=d);this.Md&&e&&(a.rm=e);this.L.push(a)}};olympe.dc.transaction.ag.va=[olympe.dc.Writable];function sj(a,b){b&&a.ab.push(b);return b}function tj(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Z(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Z(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();sj(a,new olympe.dc.transaction.ab.xn(e,b));sj(a,new olympe.dc.transaction.ab.vk(e,b,d));return c}
718
- function uj(a){return 0<a.length?(b,c)=>{a.forEach(d=>null==d?void 0:d(b,c))}:void 0}
719
- olympe.dc.Sa=class{constructor(a){this.id=a||olympe.Z.hc();this.ab=[];this.G=new Map;this.L=!0;this.F=[]}W(){return this.id}model(a){let b;return null!=(b=this.G.get(olympe.dc.fa(a)))?b:olympe.dc.ta().model(a)}persist(a){this.L=a;return this}C(a){a.persist(this.L);const b=this.ab;for(let c=0,d=b.length;c<d;c++)b[c].C(a)}create(a,b){b=sj(this,new olympe.dc.transaction.ab.uk(a,b));this.G.set(b.X(),olympe.dc.fa(a));return b}zi(a,b=!0){const c=olympe.dc.fa(a);var d=this.ab.find(h=>h instanceof olympe.dc.transaction.ab.uk&&
720
- h.X()===c);if(d)return d.persist(b);d=olympe.dc.ta();const e=d.model(a);if(null===e)throw Error('Try to persist a instance that does not exist: '+a);if(d.Of(a))return null;let f;const g=null!=(f=d.source(a))?f:olympe.dc.Fd().fromModel(e);a=this.create(e,a).persist(b).uh(g);for(const [h,k,m]of Of(d,a))h!==olympe.dc.mc.nd&&d.Of(m)&&this.Ea(h,k===olympe.dc.wa.DESTINATION?a:m,k===olympe.dc.wa.DESTINATION?m:a);return a}delete(a,b=olympe.dc.Ob.qc){sj(this,new olympe.dc.transaction.ab.yn(a,b))}update(a,
721
- b,c){return sj(this,new olympe.dc.transaction.ab.Ht(a,b,c))}Ea(a,b,c){sj(this,new olympe.dc.transaction.ab.vk(a,b,c))}Xb(a,b,c){sj(this,new olympe.dc.transaction.ab.sr(a,b,c))}Ql(a,b){sj(this,new olympe.dc.transaction.ab.xn(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,f);Z(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Wi.Id+d.X(),e);this.Ea(olympe.dc.CloudObject.propertyRel,a,d);this.Ea(olympe.dm.Property.typeRel,d,b);this.Ea(olympe.dc.CloudObject.containsRel,
722
- a,d);return d}hq(a,b,c='',{$A:d=olympe.dm.Relation.L.Os,kB:e=olympe.dm.Relation.C.cp,fB:f=olympe.dm.Relation.C.Vq,LB:g=olympe.dm.Relation.C.Ir,XA:h=olympe.dm.fk.NONE,IB:k=olympe.dm.Relation.P|h}={},m=olympe.Z.hc()){c=Z(Z(Z(Z(Z(Z(Z(Z(this.create(olympe.dm.Relation,m),olympe.dc.CloudObject.nameProp,c||''),olympe.dm.Relation.F,d),olympe.dm.Relation.G,k),olympe.dm.Relation.da,e),olympe.dm.Relation.na,e),olympe.dm.Relation.$,f),olympe.dm.Relation.ga,g),olympe.dm.Relation.T,h);this.Ea(olympe.dc.CloudObject.xi,
723
- a,c);this.Ea(olympe.dm.Relation.destinationModelRel,c,b);this.Ea(olympe.dc.CloudObject.containsRel,a,c);return c}wg(){return!1}Jl(a){this.F.push(olympe.D.Ma().G(a))}lb(a,b){a=uj([...this.F,a].filter(c=>'function'===typeof c));vj(this,a,b)}Rl(a){a=uj([...this.F,a]);wj(olympe.dc.ph(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Sa.va=[olympe.dc.Oo];function hj(a){var b=olympe.dc.ph();const c=a.W();b.L.set(c,a);a.getContext().onDestroy(()=>{b.L.delete(c)});return(d,e,f)=>{const g=new olympe.dc.db.Lc(c);g.hd(d,(new Map).set(e,f),b.db.model(d));b.F.dd(g)}}
724
- function ij(a,b,c,d){var e=olympe.dc.ph();const f=olympe.dc.Request.C.Ah,g=olympe.dc.Request.C.Bh,h=a.W();a=a.wg();const k=new Map;for(const m of b.keys()){const n=e.db.source(m);if(n===olympe.dc.Ra.SELF)continue;let p=k.get(n);p||(p=new olympe.dc.db.Lc(h),k.set(n,p));p.hd(m,b.get(m),e.db.model(m))}for(const [m,n]of k)b=new olympe.dc.Request(c?g:f,m,new olympe.dc.transaction.Aj(n,a)),b=e.fc.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(()=>null==d?void 0:d(!0))}
725
- function vj(a,b,c){var d=olympe.dc.ph();if(c&&'function'===typeof b){const e=a.W();d.G.set(e,b);wj(d,a,(f,g)=>{f||(d.G.delete(e),b(f,g))},!1)}else wj(d,a,b,!1)}function xj(a){const b=olympe.dc.Request.C.Gk;a.fc.L(olympe.dc.Request.C.Qm,c=>{var d=c.content;c=d.id;var e=d.rollback;d=d.error;const f=a.L.get(c);void 0!==f&&(a.L.delete(c),f.Qb(d));a.F.dd(e);a.K.warn(`Fast update (id=${c}) has been refused and is rolled back. Error: ${d}`)});a.fc.L(b,c=>{c=c.content;yj(a,c.id,c.finalize,c.error)})}
726
- function wj(a,b,c,d=!1){c=c?olympe.D.Ma().G(c):void 0;const e=b.W(),f=new olympe.dc.transaction.Xs(a.db,a.T,e);b.C(f);if(f.rh())null==c||c(!0);else{a.C.set(e,[]);var g=mj(f);a.F.C.ub(g);var h=g.filter(m=>lj(f,m)),k=[mf(a.F,f.C,h),c];zj(a,f,h).then(m=>{k.splice(1,0,m);Aj(a,e,g,f.F.size+1);return Bj(a,f,d,b.wg())}).then(()=>{k.forEach(m=>null==m?void 0:m(!0,null));yj(a,e,olympe.dc.transaction.Gf.C.bj,null)}).catch(m=>{a.K.error(m);k.forEach(n=>null==n?void 0:n(!1,m));Cj(a,e)})}}
727
- function zj(a,b,c){const d=b.C,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.$c(n,olympe.dm.File)&&void 0!==(null==(p=d.Ge(n))?void 0:p.Qa(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(null);const f=olympe.dm.File.C.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.F.values()),k=[],m=olympe.Z.De();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return new Promise((q,r)=>{m.C(p,t=>{if(null===t)URL.revokeObjectURL(p),q();
728
- else{var u=n.X(),w,x=null!=(w=n.get(olympe.dm.File.mimeTypeProp))?w:'application/data';a.$.$(u,t,x,y=>{const z=h.reduce((A,M)=>A||M.Ge(u),null);null!==z&&(y=(new Map).set(e,y).set(f,!0).set(g,new Date),z.Il(y),k.push([u,y]));URL.revokeObjectURL(p);q()},r)}})});2048<p.length&&a.K.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.hd(q,r);return p},
729
- new olympe.dc.db.Lc);return mf(a.F,n)})}function Aj(a,b,c,d){const e=olympe.D.og(),f=new olympe.async.ij(e);0<a.timeout&&f.Cm(a.timeout);const g=olympe.dc.transaction.Gf.C.Ks;let h=!0;const k=a.C.get(b);for(let m=0;m<d;m++)f.add((n,p)=>{k.push(e.G((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});qc(f,(m,n)=>{m||a.K.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.F.C.Qb(c);Cj(a,b)});f.start()}
730
- function Bj(a,b,c,d){const e=c?olympe.dc.Request.C.$h:olympe.dc.Request.C.Xg;return Promise.all(Array.from(b.F).map(([f,g])=>a.fc.request(new olympe.dc.Request(e,f,new olympe.dc.transaction.Aj(g,d))))).then()}function yj(a,b,c,d){(a=(a=a.C.get(b))&&a.pop())&&a(c,d)}function Cj(a,b){var c;null==(c=a.C.get(b))||c.forEach(d=>{d(olympe.dc.transaction.Gf.C.bj,null)});a.C.delete(b);if(0===a.C.size){for(const d of a.P)d();a.P=[]}a.G.has(b)&&(c=a.G.get(b),a.G.delete(b),c(!0))}
731
- function Dj(a,b){0<a.C.size?a.P.push(olympe.D.Ma().G(b)):b()}olympe.dc.transaction.Gf=class{constructor(a,b,c,d,e,f){this.K=a;this.F=b;this.db=b.view;this.fc=c;this.T=d;this.$=e;this.timeout=f;this.L=new Map;this.C=new Map;this.P=[];this.G=new Map;xj(this)}fb(){return this.K}};olympe.dc.transaction.Gf.C={cl:0,bj:1,Ks:2};olympe.dc.transaction.Aj=class{constructor(a,b=!1){this.C=a;this.F=b}wg(){return this.F}Zc(){return this.C}};olympe.dc.transaction.R={za:'dc.transaction.Logger',Ga:'dc.transaction.Manager'};olympe.dc.transaction.U={TIMEOUT:'dc.transaction.timeout',Pm:'dc.transaction.burstInterval'};
732
- olympe.V.config(function(a){F(a,olympe.dc.transaction.U.TIMEOUT,6E4);F(a,olympe.dc.transaction.U.Pm,30);E(a,olympe.dc.transaction.R.za,[olympe.la.R.Ga],b=>b.Fc('dc'));D(a,olympe.dc.transaction.R.Ga,olympe.dc.transaction.Gf,olympe.dc.transaction.R.za,olympe.dc.db.R.Ga,olympe.dc.R.Tg,olympe.dc.sources.R.te,olympe.dc.R.Qi,new olympe.V.ma(olympe.dc.transaction.U.TIMEOUT))},'olympe.dc.transaction');olympe.dc.transaction.ab={};function Ej(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Ta(e));return c}olympe.dc.transaction.ab.Bg=class{constructor(){this.ta=olympe.dc.ta()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Ta(a){a=olympe.D.Ta(a);return void 0===a||null===a?null:olympe.D.xq(a)?a.valueOf():a}};olympe.dc.transaction.ab.Bg.va=[olympe.dc.Oo];olympe.dc.transaction.ab.Jm=class extends olympe.dc.transaction.ab.Bg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Oa.Relation?a:new olympe.dc.Oa.Relation(olympe.dc.fa(a));this.origin=this.ta.Ia(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}Pa(){return this.relation.Pa()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Z(a,b,c){a.G.set(olympe.dc.fa(b),c);return a}
733
- olympe.dc.transaction.ab.uk=class extends olympe.dc.transaction.ab.Bg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.fa(b))?c:olympe.Z.ef();this.model=olympe.dc.fa(a);this.source=null;this.G=new Map;this.F=!0}X(){return this.tag}nc(){return this.model}persist(a){this.F=a;return this}uh(a){this.source=a;return this}C(a){const b=olympe.dc.ta(),c=this.nc(),d=this.X();if(!c)throw Error('OperationError: Cannot create instance, model tag is undefined');if(b.Ia(d)&&!b.Of(d)&&this.F){const e=
734
- new Map([...b.Cb(d,!0),...Ej(this,this.G)]);for(const f of e.values())if(f instanceof olympe.dc.lc&&!lj(a,f.X())){const g=new olympe.dc.Sa;g.zi(f.X());g.C(a)}a.Ec(d,c,this.F,this.source,e);for(const [f,g,h]of Of(b,d))lj(a,h)&&(g===olympe.dc.wa.ORIGIN?a.Ea(f,h,d):a.Ea(f,d,h))}else b.Ia(d)||a.Ec(d,c,this.F,this.source,Ej(this,this.G))}toString(){return`CreateInstance(${this.nc()}, ${this.X()})`}};olympe.dc.transaction.ab.uk.va=[olympe.dc.pe];olympe.dc.transaction.ab.vk=class extends olympe.dc.transaction.ab.Jm{constructor(a,b,c){super(a,b);this.F=this.ta.Ia(c)?olympe.dc.CloudObject.get(c):c}C(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.mc.nd)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');
735
- if(!this.F)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Pa()===olympe.dc.wa.DESTINATION?a.Ea(b,olympe.dc.fa(this.origin),olympe.dc.fa(this.F)):a.Ea(b,olympe.dc.fa(this.F),olympe.dc.fa(this.origin))}toString(){return`CreateRelation('${this.relation.Pa()}${this.relation.X()}, ${olympe.dc.fa(this.origin)}, ${olympe.dc.fa(this.F)})`}};olympe.dc.transaction.ab.tx=class extends olympe.dc.transaction.ab.Bg{constructor(a,b=olympe.dc.Ob.qc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.cc=b}C(a){for(const b of this.ta.Sd(this.model))b!==olympe.dc.fa(this.model)&&(new olympe.dc.transaction.ab.yn(b,this.cc)).C(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.cc})`}};olympe.dc.transaction.ab.xn=class extends olympe.dc.transaction.ab.Jm{C(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.mc.nd)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.Pa(),e=this.ta.ib(c,this.relation);for(const f of e)d===olympe.dc.wa.DESTINATION?
736
- a.Xb(b,c,f):a.Xb(b,f,c)}toString(){return`DeleteAllRelations(${this.Pa()}${this.getType()})`}};olympe.dc.transaction.ab.yn=class extends olympe.dc.transaction.ab.Bg{constructor(a,b=olympe.dc.Ob.qc){super();this.tag=this.ta.Ia(a)?olympe.dc.CloudObject.get(a):a;this.cc=b}X(){return olympe.dc.fa(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ta.Ia(b)&&oj(a,b,this.cc)}toString(){return'DeleteInstance('+this.X()+', '+this.cc+')'}};olympe.dc.transaction.ab.sr=class extends olympe.dc.transaction.ab.vk{C(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.mc.nd)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.F);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
737
- this.relation.Pa()===olympe.dc.wa.DESTINATION?a.Xb(b,c,d):a.Xb(b,d,c)}toString(){return'DeleteRelation('+this.relation.Pa()+this.relation.X()+', '+olympe.dc.fa(this.origin)+', '+olympe.dc.fa(this.F)+')'}};olympe.dc.transaction.ab.Ht=class extends olympe.dc.transaction.ab.Bg{constructor(a,b,c){super();this.tag=this.ta.Ia(a)?olympe.dc.CloudObject.get(a):a;this.F=new Map;void 0!==b&&this.F.set(olympe.dc.fa(b),c)}X(){return olympe.dc.fa(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.C.Ge(b))&&c.L()||this.ta.Ia(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=Ej(this,this.F);
738
- for(const [e,f]of c){var d=this.ta.Qa(b,e);d instanceof olympe.dc.lc&&oj(a,d.X(),olympe.dc.Ob.qc);f instanceof olympe.dc.lc&&!lj(a,f.X())&&(d=new olympe.dc.Sa,d.zi(f.X()),d.C(a))}a.hd(b,c)}toString(){return'UpdateInstance('+this.X()+', '+Ej(this,this.F)+')'}};olympe.dc.fa=function(a){if('string'===typeof a)return a;let b=null;a=olympe.D.Ta(a);void 0!==a&&null!==a&&(a=a.valueOf(),'string'===typeof a?b=a:a.X?b=a.X():'function'===typeof a&&(b=olympe.dc.ka.nc(a)));return b||''};B('olympe.dc.instanceToTag',olympe.dc.fa);olympe.dc.ta=function(){return olympe.dc.Xl().view};olympe.dc.register=function(a,b){olympe.dc.ka.C(a,b)};olympe.dc.defineProperty=function(a){return new olympe.dc.Oa.Property(a)};
739
- olympe.dc.hq=function(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.wa.DESTINATION){const e=olympe.dc.wa.DESTINATION;return b===olympe.dc.wa.ORIGIN||b===e?new olympe.dc.Oa.Relation(a,b):new olympe.dc.Oa.Relation(a,d,b,c)};olympe.dc.eu=function(a){return a.Rb()};olympe.dc.Fb={};olympe.dc.Fb.Ol=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.sb(a):a instanceof olympe.D.Ka?a:null;olympe.dc.Fb.Ll=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Ib(a):a instanceof olympe.D.ea?a:null;olympe.dc.Fb.Nl=a=>'number'===typeof a||a instanceof Number?olympe.D.oa(a):'string'===typeof a||a instanceof String?olympe.D.oa(Number.parseFloat(a.valueOf())):a instanceof olympe.D.aa?a:null;
740
- olympe.dc.Fb.Ml=function(a){return'number'===typeof a||a instanceof Number?wb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.Za(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.Za(a):a instanceof olympe.D.Za?a:null};olympe.dc.Fb.$p=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?Ab(a.valueOf()):null};olympe.dc.Fb.aq=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.lc?me(a):null;
741
- olympe.dc.Fb.kg=a=>a instanceof olympe.dc.lc?me(a):a;olympe.dc.Fb.bB=a=>{switch(typeof a){case 'boolean':return olympe.D.Ib(a);case 'number':return olympe.D.oa(a);case 'string':return olympe.D.sb(a);case 'object':if(a instanceof Date)return olympe.D.Yv(a)}return a};
742
- olympe.dc.Fb.tB=a=>{switch(a){case olympe.D.ea:return olympe.dc.Fb.Ll;case olympe.D.Ka:return olympe.dc.Fb.Ol;case olympe.D.aa:return olympe.dc.Fb.Nl;case olympe.D.Za:return olympe.dc.Fb.Ml;case olympe.D.Color:return olympe.dc.Fb.$p;case olympe.dc.CloudObject:return olympe.dc.Fb.aq;default:return olympe.dc.Fb.kg}};olympe.dc.ic={};olympe.dc.Me=class{ia(){}L(){}G(){}P(){}ha(){}toString(){}};function Fj(a){let b=null;for(a=[...a.ba];null===b&&0<a.length;)b=a.pop().Hb();return b}function Gj(a,b){a.T()||(a=`Calling "${b}" on subscription with id ${a.W()} 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.la.fb('dc').warn(a))}
743
- function Ij(a){const b=new olympe.D.Jb('listDef toObservable');return new rxjs.Observable(c=>{b.run(()=>{olympe.D.pc([a],d=>{c.next(d.valueOf())})});b.onDestroy(()=>{c.complete()});return()=>b.destroy()})}
744
- olympe.dc.ua=class{constructor(a,b,c){void 0===a||null===a?olympe.la.fb('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.sa([a],olympe.dc.fa,String),this.ba=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||Fj(this),this.C=null)}ge(){return olympe.dc.ge()}lb(){if(null===this.C){const a=olympe.dc.ic.$u();this.C=Jj(a,this);null!==this.valueType&&this.C.md(this.valueType);olympe.D.Ma().$(()=>{var b=this.C.W();a.K.debug('QueryMGR: [ID:',
745
- b,'] - Unregistered');const c=a.C.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.C.release(),a.C.delete(b));this.C=null})}return this}Vb(){null===this.C&&this.lb();return this.C}md(a){this.valueType=a;null!==this.C&&this.C.md(this.valueType)}Hb(){return null!==this.C?this.C.Hb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Bd(){return this.F}Vk(){return this.ba}bd(a,b){return this.Vb().bd(a,b)}Yj(a){this.Vb().Yj(a)}bs(){return this.Vb().qd()}$r(){return this.Vb().T()}get(a){return this.Vb().get(a)}nh(){return this.Vb().nh()}lh(a){const b=
746
- this.Vb();Gj(b,'getCurrent');return b.lh(a)}has(a){return this.Vb().has(a)}vg(a){const b=this.Vb();Gj(b,'hasCurrent');return b.vg(a)}Qd(a){return this.Vb().Qd(a)}Zv(a){return Ij(this.Qd(a))}Fe(a){const b=this.Vb();Gj(b,'getCurrentAt');return b.Fe(a)}He(a){return this.Vb().He(a)}ff(a){const b=this.Vb();Gj(b,'getCurrentKeyAt');return b.ff(a)}Ed(a){return this.Vb().Ed(a)}dw(a){return Ij(this.Ed(a))}gf(a){const b=this.Vb();Gj(b,'getCurrentRank');return b.gf(a)}xc(){return this.Vb().xc()}$v(){return Ij(this.xc())}hf(){return this.Vb().hf()}Te(){return this.Vb().Te()}ew(){return Ij(this.Te())}Nf(){const a=
747
- this.Vb();Gj(a,'getCurrentSize');return a.Nf()}forEach(a,b){this.Vb().forEach(a,b)}Pd(a){const b=this.Vb();Gj(b,'forEachCurrentValue');return b.Pd(a)}ii(a,b,c,d){a=new olympe.dc.ba.Mg(a,b);(new olympe.dc.ua(this.F,[...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');
748
- if(c instanceof olympe.dc.Oa.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.C)break;a.push(c)}b=new olympe.dc.ua(this.F,a);b.md(Fj(b)||this.valueType||Object);return b}ck(a){return this.transform(new olympe.dc.ba.af(a))}filter(a){return this.transform(new olympe.dc.ba.Qe(a))}Kf(){const a=new olympe.dc.$i(this.F,null===this.valueType?void 0:this.valueType);let b=this.ba;b instanceof Array||(b=b?[b]:[]);a.transform(b);
749
- return a}toString(){let a=this.ba;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.Ta(this.F)+a+')'}Zr(){return this.Vb().Yf()}yc(){return olympe.D.sa([this.Te()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.Fe(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.sb(b+']')},olympe.D.Ka)}};olympe.dc.ua.prototype.filter=olympe.dc.ua.prototype.filter;olympe.dc.ua.prototype.union=olympe.dc.ua.prototype.ck;olympe.dc.ua.prototype.transform=olympe.dc.ua.prototype.transform;
750
- olympe.dc.ua.prototype.forEachCurrentValue=olympe.dc.ua.prototype.Pd;olympe.dc.ua.prototype.forEach=olympe.dc.ua.prototype.forEach;olympe.dc.ua.prototype.getCurrentSize=olympe.dc.ua.prototype.Nf;olympe.dc.ua.prototype.observeSize=olympe.dc.ua.prototype.ew;olympe.dc.ua.prototype.observeFirst=olympe.dc.ua.prototype.$v;olympe.dc.ua.prototype.getCurrentRank=olympe.dc.ua.prototype.gf;olympe.dc.ua.prototype.observeRank=olympe.dc.ua.prototype.dw;olympe.dc.ua.prototype.getCurrentAt=olympe.dc.ua.prototype.Fe;
751
- olympe.dc.ua.prototype.observeAt=olympe.dc.ua.prototype.Zv;olympe.dc.ua.prototype.offReady=olympe.dc.ua.prototype.Yj;olympe.dc.ua.prototype.onReady=olympe.dc.ua.prototype.bd;olympe.dc.ua.prototype.getBaseTag=olympe.dc.ua.prototype.Bd;olympe.dc.ua.va=[olympe.D.Qc];l=olympe.dc.ua.prototype;l.ge.J=olympe.D.H.C;l.lb.J=olympe.D.H.L();l.Vb.J=new olympe.D.H(()=>olympe.dc.ic.Subscription,[]);l.md.J=new olympe.D.H(()=>{},[]);l.Bd.J=new olympe.D.H(()=>String,[]);l.Vk.J=new olympe.D.H(()=>Array,[]);
752
- l.bd.J=new olympe.D.H(()=>String,[]);l.Yj.J=new olympe.D.H(()=>{},[]);l.bs.J=olympe.D.H.P;l.$r.J=olympe.D.H.C;l.get.J=new olympe.D.H(()=>olympe.dc.CloudObject,[],'valueType');l.nh.J=new olympe.D.H(()=>Array,[]);l.lh.J=olympe.D.H.C;l.has.J=olympe.D.H.P;l.vg.J=olympe.D.H.C;l.Qd.J=new olympe.D.H(()=>olympe.dc.CloudObject,[],'valueType');l.Fe.J=olympe.D.H.C;l.He.J=new olympe.D.H(()=>String,[]);l.ff.J=olympe.D.H.C;l.Ed.J=olympe.D.H.G;l.gf.J=olympe.D.H.C;
753
- l.xc.J=new olympe.D.H(()=>olympe.dc.CloudObject,[],'valueType');l.hf.J=new olympe.D.H(()=>String,[]);l.Te.J=olympe.D.H.G;l.Nf.J=olympe.D.H.C;l.forEach.J=new olympe.D.H(()=>{},[]);l.Pd.J=olympe.D.H.C;l.ii.J=new olympe.D.H(()=>{},[]);l.transform.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.ck.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.filter.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Kf.J=new olympe.D.H(()=>olympe.dc.$i,[]);l.toString.J=olympe.D.H.C;l.Zr.J=olympe.D.H.C;l.yc.J=olympe.D.H.F;const Kj={Iw:'append',Fk:'filter_not',Hn:'filter_and',In:'filter_or'};function Lj(a,b){a=Mj(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.Ua.Km(a,b)).F}
754
- olympe.dc.$i=class{constructor(a,b){this.C=Mj(a);this.K=olympe.la.fb('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.ba=[];this.ab=[]}Ve(){return new olympe.dc.ua(this.C,this.ba,this.valueType)}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Nj('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Oa.Property)throw new Nj('transform','Properties cannot be used as transformer, unlike relations '+d);if(!d||'function'!==typeof d.C)throw new Nj('transform',
755
- 'one of the argument is not a Transformer '+d);const e=d.Hb();null!==e&&(this.valueType=e);this.ba.push(d)}return this}ck(a){this.ba.push(new olympe.dc.ba.af(a));return this}Fw(a){this.ba.push(new olympe.dc.ba.af(Mj(a)));return this}ds(a){this.valueType=a;return this}eb(a){this.ba.push(a);this.valueType=a.Hb()||olympe.dc.CloudObject;return this}su(a){for(const b of a)this.ba.push(b),this.valueType=b.Hb()||olympe.dc.CloudObject;return this}ru(a,b,c){a=new olympe.dc.ba.de(a,a.Pa(),b,c);this.ba.push(a);
756
- this.valueType=a.Hb()||olympe.dc.CloudObject;return this}qu(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.Pa())}a=new olympe.dc.ba.aj(b,c);this.ba.push(a);this.valueType=a.Hb()||olympe.dc.CloudObject;return this}cs(){this.eb(olympe.dc.CloudObject.instancesRel);return this}Be(a){var b=this.ab.pop();b===Kj.Fk&&(a=new olympe.dc.Y.Ld(a),b=this.ab.pop());switch(b){case Kj.Hn:b=this.ba.pop().F;b instanceof olympe.dc.Y.kd?(b=b.Y,b.push(a),a=new olympe.dc.Y.kd(...b)):
757
- a=new olympe.dc.Y.kd(b,a);b=this.ab.pop();break;case Kj.In:b=this.ba.pop().F,b instanceof olympe.dc.Y.ce?(b=b.Y,b.push(a),a=new olympe.dc.Y.ce(...b)):a=new olympe.dc.Y.ce(b,a),b=this.ab.pop()}b===Kj.Fk&&(a=new olympe.dc.Y.Ld(a),this.ab.pop());this.ba.push(new olympe.dc.ba.Qe(a));return this}mu(a,b,c){return this.Be(new olympe.dc.Y.Zd(Lj(a,c),new olympe.dc.Ua.me(b)))}contains(a,b,c=!1,d){return this.Be(new olympe.dc.Y.Ne(Lj(a,d),new olympe.dc.Ua.me(b),c))}$c(a){if(!(a instanceof Array))throw new Nj('instanceOf',
758
- 'Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(Mj(a[c]));return this.Be(new olympe.dc.Y.Oh(b))}Uj(a){return this.Be(new olympe.dc.Y.Zd(new olympe.dc.Ua.ai,new olympe.dc.Ua.me(Mj(a))))}nu(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.Sc().Uj(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().Sc().Uj(a[b])}return this}oi(a,b){if(!(a instanceof Array))throw new Nj('hasRelated','Provided argument "relations" must be an array.');
759
- const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Pa())});return this.Be(new olympe.dc.Y.Kh(c,d,b))}Tj(a,b,c){a=Lj(a,c);return this.Be(new olympe.dc.Y.Ti(a,new olympe.dc.Ua.me(b)))}Ci(a,b,c){a=Lj(a,c);return this.Be(new olympe.dc.Y.wj(a,new olympe.dc.Ua.me(b)))}Rv(a,b,c,d){a=Lj(a,d);return this.Be(new olympe.dc.Y.Ze(a,b,c))}filter(a){const b=new class extends olympe.dc.Y.Rf{C(c,d){return a(olympe.dc.CloudObject.get(d))}};return this.Be(b)}Sc(){this.ab.push(Kj.Fk);return this}and(){this.ba[this.ba.length-
760
- 1]instanceof olympe.dc.ba.Qe&&this.ab.push(Kj.Hn);return this}or(){this.ba[this.ba.length-1]instanceof olympe.dc.ba.Qe&&this.ab.push(Kj.In);return this}bk(a,b,c){a=Mj(a);let d=null;switch(olympe.dc.ta().Tb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.N.X():d=new olympe.dc.bc.String(new olympe.dc.Ua.Zh(a,c));break;case olympe.dm.Number.N.X():d=new olympe.dc.bc.Number(new olympe.dc.Ua.Sh(a,c));break;case olympe.dm.DateTime.N.X():d=new olympe.dc.bc.DateTime(new olympe.dc.Ua.Fh(a,c))}c=d;null!==
761
- c&&this.ba.push(new olympe.dc.ba.gg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.bc.Rf{L(e,f){return a(olympe.dc.CloudObject.get(f))}G(e,f){return b(e,f).valueOf()}};this.ba.push(new olympe.dc.ba.gg(d,c));return this}iu(){this.ba.push(new olympe.dc.ba.Gh);return this}om(a,b){this.ba.push(new olympe.dc.ba.Mg(a,b));return this}};class Nj extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
762
- function Mj(a){return'string'===typeof a||a instanceof olympe.D.Ka?a:'function'===typeof a?olympe.dc.ka.nc(a):olympe.D.Ya(a)?a.Ej===olympe.D.Ka?a:olympe.D.sa([a],b=>olympe.D.sb(olympe.dc.fa(b)),olympe.D.Ka):a.X()}l=olympe.dc.$i.prototype;l.Ve.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.transform.J=olympe.D.H.L();l.ck.J=olympe.D.H.L();l.Fw.J=olympe.D.H.L();l.ds.J=olympe.D.H.L();l.eb.J=olympe.D.H.L();l.su.J=olympe.D.H.L();l.ru.J=olympe.D.H.L();l.qu.J=olympe.D.H.L();l.cs.J=olympe.D.H.L();l.Be.J=olympe.D.H.L();
763
- l.mu.J=olympe.D.H.L();l.contains.J=olympe.D.H.L();l.$c.J=olympe.D.H.L();l.Uj.J=olympe.D.H.L();l.nu.J=olympe.D.H.L();l.oi.J=olympe.D.H.L();l.Tj.J=olympe.D.H.L();l.Ci.J=olympe.D.H.L();l.Rv.J=olympe.D.H.L();l.filter.J=olympe.D.H.L();l.Sc.J=olympe.D.H.L();l.and.J=olympe.D.H.L();l.or.J=olympe.D.H.L();l.bk.J=olympe.D.H.L();l.sort.J=olympe.D.H.L();l.iu.J=olympe.D.H.L();l.om.J=olympe.D.H.L();function Jj(a,b){const c=b.Bd();var d=new olympe.dc.query.Vs;let e;e=c;olympe.D.Ya(e)&&(e=d.add(c));b=(b=b.Vk())?Array.isArray(b)?b:[b]:null;d=olympe.dc.ic.Subscription.G(e,b,d);let f,g,h=null!=(g=null==(f=a.C.get(d))?void 0:f.C)?g:null;null===h&&(a.K.debug('QueryMGR: new',a.F?'local':'remote','subscription "',d,'": #',`${e},`,b),h=new olympe.dc.ic.Subscription(d,c,b,a.G));h.getContext().run(()=>a.process(h));return h}
764
- function Oj(a,b){if(b.T())a.K.debug('ListProcessor: [ID:',b.W(),'] - Subscription already booted, ignoring');else{a.K.debug('ListProcessor: [ID:',b.W(),'] - Booting subscription');var c=new olympe.dc.Ub.Fp(a.db,a.K),d=b.W();olympe.D.pc([b.Bd()],e=>{const f=olympe.dc.fa(e);a.K.debug('ListProcessor: [ID:',b.W(),'] - Booting with baseTag',f);b.ji()||b.pi();oe(a.db,f,Pj(a,b,c),d);olympe.D.Ma().$(()=>ne(a.db,f,d));a.db.Ia(f.valueOf())||Qj(c);b.T()||(Qj(c),b.uc([]))})}}
765
- function Rj(a,b,c,d){const e=[b.Bd()],f=k=>k instanceof olympe.dc.ba.af;let g;const h=(null!=(g=b.tg())?g:[]).filter(f);for(const k of h){e.push(k.Bd());let m;h.push(...(null!=(m=k.tg())?m:[]).filter(f))}Dj(a.P,()=>{olympe.D.pc(e,()=>{const k=b.ye(c);Sj(a,k,b.W(),d)})})}
766
- function Sj(a,b,c,d){a.K.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const e=olympe.D.Ma(),f=new olympe.async.ij(e);b.forEach(g=>{f.add((h,k)=>{let m=!1;Sg(a.L,g,e,olympe.dc.Ra.SELF,olympe.dc.ra.tc.Tf).subscribe(rxjs.Subscriber.create(()=>{m||(m=!0,e.run(h))},n=>e.run(()=>k(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${g.W()} has encountered an error: ${n}`))))})});qc(f,(g,h)=>d(h));f.start()}
767
- function Pj(a,b,c){const d=new olympe.dc.Ub.Ii;let e=!1;const f=olympe.D.Ma(),g=b.tg(),h=[];h[g?g.length:0]=(k,m,n,p)=>{f.Bc()||f.gb()||(k?b.vg(n)?a.K.warn('Adding the same index twice (should never happen) for sub #',b.W(),', index #',n,', tag #',m):(a.K.debug('ListProcessor: [ID:',b.W(),'] - Adding Instance',m,'to the subscription'),b.zd(n,m)):(a.K.debug('ListProcessor: [ID:',b.W(),'] - Removing Instance',m,'from the subscription'),b.ni(n)),e||(Tj(c,()=>{p.Hf();Qj(c)}),f.run(()=>p.ge().Qf(b.uc.bind(b))),
768
- e=!0),Uj(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].C(f,c,h[k+1]);return(k,m)=>{const n=b.W();c.register(n,null);const p=d.C(k,m,n,null);if(null!==p)h[0](k,m,n,Vj(p,k,m,n))}}
769
- olympe.dc.ic.Es=class{constructor(a,b,c,d,e){this.K=a;this.db=b;this.F=e;this.P=c;this.L=d;this.C=new Map;this.G=new olympe.D.Jb('Legacy ListDef processor')}process(a){const b=a.W();var c=this.C.get(b);c||(c=new olympe.dc.ic.rt(a),this.C.set(b,c));c.counter++;Wj(c)?this.K.debug('ListProcessor: [ID:',b,'] - id already processed'):(this.K.debug('ListProcessor: [ID:',b,'] - NOT processed yet.'),c=a.Lf(),this.F&&c===olympe.dc.Ra.SERVER||c===olympe.dc.Ra.SELF?(this.K.debug('QueryMGR: [ID:',b,'] - Local subscription, no need for coverage check, booting subscription '),
770
- Oj(this,a)):Rj(this,a,c,d=>{d?this.K.error(d):Oj(this,a)}))}};function Xj(a){return olympe.D.Ya(a)?'Node#'+a.Aa.W():String(a)}function Yj(a,b){return olympe.D.Ya(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
771
- olympe.dc.query.Vs=class{constructor(){this.C=0;this.values=null}add(a){let b;b=olympe.D.Ya(a)?'n'+a.Aa.W():'p'+ ++this.C;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.Ca=class{ia(){}C(){}F(){}ha(){}toString(){}};olympe.dc.ic.Subscription=class a extends olympe.D.Hi{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Jb('context subscription '+b,e));this.id=b;this.jd=c;this.ba=d||null;this.G=this.P.run(()=>olympe.D.Gd(olympe.dc.ic.Subscription.C.INIT));this.ac=!1;this.da=this.Wb=null}static G(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ha(d);else e+='|null';e=olympe.Z.nb(e)}catch(f){e=olympe.Z.hc()}return e}W(){return this.id}Bd(){return this.jd}tg(){return this.ba}Lf(){const b=
772
- olympe.dc.Fd(),c=olympe.D.Ta(this.Bd());let d;return olympe.dc.CloudObject.instancesRel.Ha(null==(d=this.ba)?void 0:d[0])?b.fromModel(c):b.Ce(c)}ji(){const b=olympe.D.Ta(this.G);return b&&b.valueOf()>=olympe.dc.ic.Subscription.C.zp}pi(){if(this.G.Aa.gb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.Wb;this.Wb=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);tb(this.G,olympe.D.Gd(olympe.dc.ic.Subscription.C.zp))}qd(){return olympe.D.sa([this.G],
773
- ()=>{},olympe.D.ea)}T(){const b=this.G.Aa.xb;return b&&b.valueOf()>=olympe.dc.ic.Subscription.C.Sg}bd(b,c){this.T()?b(this):(null===this.da&&(this.da=new Map),void 0===c&&(c=olympe.Z.hc()),this.da.set(c,olympe.D.Ma().G(b)));return c||''}Yj(b){null!==this.da&&b&&this.da.delete(b)}Qb(){const b=olympe.dc.ic.Subscription.C.Sg;if(!this.G.Aa.gb()&&olympe.D.Ta(this.G)!==b&&(this.cf(),tb(this.G,b),null!==this.da)){for(const c of this.da.values())c(this);this.da=null}}onDestroy(b){this.P.onDestroy(b)}release(){this.P.destroy()}uc(b){if(!this.G.Aa.gb()){for(let c=
774
- 0,d=b.length;c<d;c++)this.Fl(b[c],c);if(this.T())this.cf();else{this.ac=b=!0;for(let c in this.F)if(Object.prototype.hasOwnProperty.call(this.F,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.Qb()}}}zd(b,c){if(!this.G.Aa.gb()&&(this.Gj(b,olympe.dc.CloudObject.get(c)),b=this.T(),this.ac&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.Qb()}}ni(b){this.G.Aa.gb()||(this.El(b),
775
- this.ei(b,!this.T()))}Yf(){return this.T()?super.Yf():'Subscription is not ready!'}ye(b){const c=olympe.D.Ta(this.Bd());return olympe.dc.ic.Subscription.F(c,b,this.tg())}static F(b,c,d){var e=olympe.dc.ra.from(b,c).Nd();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.se){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.eb(h,!0))}else if(e instanceof olympe.dc.ba.de){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.Mf(h,!0,!0))}else if(e instanceof
776
- olympe.dc.ba.af)e=a.F(olympe.D.Ta(e.Bd()),c,e.tg()),b.push(...e);else if(e instanceof olympe.dc.ba.Qe||e instanceof olympe.dc.ba.gg){const h=e.G();b=b.map(k=>{for(const m of h){for(const n of m)k=n.recursive?k.Mf(n,!0,!0):k.eb(n,!0);k=k.back(m.length)}return k})}return b}};olympe.dc.ic.Subscription.C={INIT:0,zp:1,Sg:2};olympe.dc.ic.Subscription.prototype.Yf.J=olympe.D.H.C;function Wj(a){const b=a.F;a.F=!0;return b}olympe.dc.ic.rt=class{constructor(a){this.counter=0;this.F=!1;this.C=a}};olympe.dc.$e=class{ia(){}Hb(){}C(){}ha(){}toString(){}};olympe.dc.Xo=class{G(){}};olympe.dc.Cj=class{ia(){}getValue(){}C(){}ha(){}toString(){}};olympe.dc.bc={};let Zj=0;olympe.dc.bc.Rf=class{constructor(){this.id=Zj++}ia(){return'CustomLocalComparator#'+Zj}P(){return[]}L(){throw Error('GetComparedValue function was not implemented.');}G(){throw Error('Compare function was not implemented.');}ha(){return`{"c":"${this.ia()}"}`}toString(){return this.ia()+'()'}};olympe.dc.bc.Rf.va=[olympe.dc.Me];olympe.dc.bc.DateTime=class{constructor(a){this.C=a}ia(){return T(olympe.dc.bc.DateTime)}P(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(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}ha(a){return'{"c":"'+this.ia()+'",a:['+this.C.ha(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};S('olympe.dc.comparators.DateTime',olympe.dc.bc.DateTime);olympe.dc.bc.DateTime.va=[olympe.dc.Me];olympe.dc.bc.Number=class{constructor(a){this.C=a}ia(){return T(olympe.dc.bc.Number)}P(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(a,b){return a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.ia()}",a:[${this.C.ha(a)}]}`}toString(){return`Number(${this.C.toString()})`}};S('olympe.dc.comparators.Number',olympe.dc.bc.Number);olympe.dc.bc.Number.va=[olympe.dc.Me];olympe.dc.bc.String=class{constructor(a){this.C=a}ia(){return T(olympe.dc.bc.String)}P(){return this.C.C()}L(a,b){return olympe.D.sa([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Ka)}G(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.ia()}",a:[${this.C.ha(a)}]}`}toString(){return`String(${this.C.toString()})`}};S('olympe.dc.comparators.String',olympe.dc.bc.String);olympe.dc.bc.String.va=[olympe.dc.Me];olympe.dc.Y={};let ak=0;olympe.dc.Y.Rf=class{constructor(){this.id=ak++}ia(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ha(){return`{"c":"${this.ia()}"}`}toString(){return this.ia()+'()'}};olympe.dc.Y.Rf.va=[olympe.dc.Ca];olympe.dc.Y.hk=class{constructor(a,b){this.G=a;this.L=b}ia(){}F(){return[this.G.C(),this.L.C()]}C(a,b){return a.run(()=>olympe.D.sa([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.D.Ib(this.P('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.D.ea))}P(){}ha(a){return'{"c":"'+this.ia()+'","a":['+this.G.ha(a)+','+this.L.ha(a)+']}'}toString(){return this.ia().replace(/^.+\./,'')+'('+this.G.toString()+','+this.L.toString()+')'}};
711
+ olympe.dc.transaction.ag=class{constructor({ak:a=!1,gh:b=!0,Ld:c=!0}={}){this.P=[];this.G=[];this.C=[];this.T=[];this.L=[];this.ak=null!=a?a:!1;this.Ld=null!=c?c:!0;this.gh=null!=b?b:!0;this.$=olympe.D?new qj:new class extends qj{$(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(xg(this))}Ec(a,b,c,d=null){c=oj(this.$,null!=c?c:null,this.ak);c={o:1,t:a,p:c};this.gh&&(c.s=b);this.Ld&&d&&(c.m=d);this.P.push(c);this.ak&&(b=pj(this.$))&&this.C.push({o:2,t:a,p:b})}jd(a,
712
+ b,c=null){b=oj(this.$,b||null,!1);a={o:2,t:a,p:b};this.Ld&&c&&(a.m=c);this.C.push(a)}F(a,b,c=null){a={o:3,t:a,f:b};this.Ld&&c&&(a.m=c);this.G.push(a)}Ea(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:4,m:a,l:b,r:c};this.Ld&&d&&(a.lm=d);this.Ld&&e&&(a.rm=e);this.T.push(a)}Wb(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');
713
+ if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:5,m:a,l:b,r:c};this.Ld&&d&&(a.lm=d);this.Ld&&e&&(a.rm=e);this.L.push(a)}};olympe.dc.transaction.ag.va=[olympe.dc.Writable];function rj(a,b){b&&a.ab.push(b);return b}function sj(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Z(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Z(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();rj(a,new olympe.dc.transaction.ab.xn(e,b));rj(a,new olympe.dc.transaction.ab.uk(e,b,d));return c}
714
+ function tj(a){return 0<a.length?(b,c)=>{a.forEach(d=>null==d?void 0:d(b,c))}:void 0}
715
+ olympe.dc.Sa=class{constructor(a){this.id=a||olympe.Z.hc();this.ab=[];this.G=new Map;this.L=!0;this.F=[]}W(){return this.id}model(a){let b;return null!=(b=this.G.get(olympe.dc.fa(a)))?b:olympe.dc.ta().model(a)}persist(a){this.L=a;return this}C(a){a.persist(this.L);const b=this.ab;for(let c=0,d=b.length;c<d;c++)b[c].C(a)}create(a,b){b=rj(this,new olympe.dc.transaction.ab.tk(a,b));this.G.set(b.X(),olympe.dc.fa(a));return b}zi(a,b=!0){const c=olympe.dc.fa(a);var d=this.ab.find(h=>h instanceof olympe.dc.transaction.ab.tk&&
716
+ h.X()===c);if(d)return d.persist(b);d=olympe.dc.ta();const e=d.model(a);if(null===e)throw Error('Try to persist a instance that does not exist: '+a);if(d.Of(a))return null;let f;const g=null!=(f=d.source(a))?f:olympe.dc.Ed().fromModel(e);a=this.create(e,a).persist(b).wh(g);for(const [h,k,m]of Of(d,a))h!==olympe.dc.mc.nd&&d.Of(m)&&this.Ea(h,k===olympe.dc.wa.DESTINATION?a:m,k===olympe.dc.wa.DESTINATION?m:a);return a}delete(a,b=olympe.dc.Nb.rc){rj(this,new olympe.dc.transaction.ab.yn(a,b))}update(a,
717
+ b,c){return rj(this,new olympe.dc.transaction.ab.Gt(a,b,c))}Ea(a,b,c){rj(this,new olympe.dc.transaction.ab.uk(a,b,c))}Wb(a,b,c){rj(this,new olympe.dc.transaction.ab.sr(a,b,c))}Pl(a,b){rj(this,new olympe.dc.transaction.ab.xn(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,f);Z(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Wi.Hd+d.X(),e);this.Ea(olympe.dc.CloudObject.propertyRel,a,d);this.Ea(olympe.dm.Property.typeRel,d,b);this.Ea(olympe.dc.CloudObject.containsRel,
718
+ a,d);return d}gq(a,b,c='',{YA:d=olympe.dm.Relation.L.Os,iB:e=olympe.dm.Relation.C.ap,dB:f=olympe.dm.Relation.C.Uq,IB:g=olympe.dm.Relation.C.Ir,VA:h=olympe.dm.fk.NONE,GB:k=olympe.dm.Relation.P|h}={},m=olympe.Z.hc()){c=Z(Z(Z(Z(Z(Z(Z(Z(this.create(olympe.dm.Relation,m),olympe.dc.CloudObject.nameProp,c||''),olympe.dm.Relation.F,d),olympe.dm.Relation.G,k),olympe.dm.Relation.da,e),olympe.dm.Relation.na,e),olympe.dm.Relation.$,f),olympe.dm.Relation.ga,g),olympe.dm.Relation.T,h);this.Ea(olympe.dc.CloudObject.xi,
719
+ a,c);this.Ea(olympe.dm.Relation.destinationModelRel,c,b);this.Ea(olympe.dc.CloudObject.containsRel,a,c);return c}wg(){return!1}Il(a){this.F.push(olympe.D.Ma().G(a))}lb(a,b){a=tj([...this.F,a].filter(c=>'function'===typeof c));uj(this,a,b)}Ql(a){a=tj([...this.F,a]);vj(olympe.dc.qh(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Sa.va=[olympe.dc.Mo];function gj(a){var b=olympe.dc.qh();const c=a.W();b.L.set(c,a);a.getContext().onDestroy(()=>{b.L.delete(c)});return(d,e,f)=>{const g=new olympe.dc.db.Lc(c);g.jd(d,(new Map).set(e,f),b.db.model(d));b.G.ed(g)}}
720
+ function hj(a,b,c,d){var e=olympe.dc.qh();const f=olympe.dc.Request.C.Ch,g=olympe.dc.Request.C.Dh,h=a.W();a=a.wg();const k=new Map;for(const m of b.keys()){const n=e.db.source(m);if(n===olympe.dc.Ra.SELF)continue;let p=k.get(n);p||(p=new olympe.dc.db.Lc(h),k.set(n,p));p.jd(m,b.get(m),e.db.model(m))}for(const [m,n]of k)b=new olympe.dc.Request(c?g:f,m,new olympe.dc.transaction.Aj(n,a)),b=e.ec.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(()=>null==d?void 0:d(!0))}
721
+ function uj(a,b,c){var d=olympe.dc.qh();if(c&&'function'===typeof b){const e=a.W();d.C.set(e,b);vj(d,a,(f,g)=>{f||(d.C.delete(e),b(f,g))},!1)}else vj(d,a,b,!1)}function wj(a){const b=olympe.dc.Request.C.Fk;a.ec.L(olympe.dc.Request.C.Qm,c=>{var d=c.content;c=d.id;var e=d.rollback;d=d.error;const f=a.L.get(c);void 0!==f&&(a.L.delete(c),f.Pb(d));a.G.ed(e);a.K.warn(`Fast update (id=${c}) has been refused and is rolled back. Error: ${d}`)});a.ec.L(b,c=>{c=c.content;xj(a,c.id,c.finalize,c.error)})}
722
+ function vj(a,b,c,d=!1){c=c?olympe.D.Ma().G(c):void 0;const e=b.W(),f=new olympe.dc.transaction.Xs(a.db,a.T,e);b.C(f);if(f.sh()){null==c||c(!0);var g;null==(g=a.C.get(e))||g(!0);a.C.delete(e)}else{a.F.set(e,[]);var h=lj(f);a.G.C.ub(h);g=h.filter(m=>kj(f,m));var k=[mf(a.G,f.C,g),c];yj(a,f,g).then(m=>{k.splice(1,0,m);zj(a,e,h,f.F.size+1);return Aj(a,f,d,b.wg())}).then(()=>{k.forEach(m=>null==m?void 0:m(!0,null));xj(a,e,olympe.dc.transaction.Hf.C.bj,null)}).catch(m=>{a.K.error(m);k.forEach(n=>null==
723
+ n?void 0:n(!1,m));Bj(a,e)})}}
724
+ function yj(a,b,c){const d=b.C,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.$c(n,olympe.dm.File)&&void 0!==(null==(p=d.Ge(n))?void 0:p.Qa(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(null);const f=olympe.dm.File.C.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.F.values()),k=[],m=olympe.Z.De();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return new Promise((q,r)=>{m.C(p,t=>{if(null===t)URL.revokeObjectURL(p),q();
725
+ else{var u=n.X(),w,x=null!=(w=n.get(olympe.dm.File.mimeTypeProp))?w:'application/data';a.$.$(u,t,x,y=>{const z=h.reduce((A,M)=>A||M.Ge(u),null);null!==z&&(y=(new Map).set(e,y).set(f,!0).set(g,new Date),z.Hl(y),k.push([u,y]));URL.revokeObjectURL(p);q()},r)}},r)});2048<p.length&&a.K.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.jd(q,r);return p},
726
+ new olympe.dc.db.Lc);return mf(a.G,n)})}function zj(a,b,c,d){const e=olympe.D.og(),f=new olympe.async.ij(e);0<a.timeout&&f.Bm(a.timeout);const g=olympe.dc.transaction.Hf.C.Ks;let h=!0;const k=a.F.get(b);for(let m=0;m<d;m++)f.add((n,p)=>{k.push(e.G((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});rc(f,(m,n)=>{m||a.K.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.G.C.Pb(c);Bj(a,b)});f.start()}
727
+ function Aj(a,b,c,d){const e=c?olympe.dc.Request.C.Yg:olympe.dc.Request.C.Xg;return Promise.all(Array.from(b.F).map(([f,g])=>a.ec.request(new olympe.dc.Request(e,f,new olympe.dc.transaction.Aj(g,d))))).then()}function xj(a,b,c,d){(a=(a=a.F.get(b))&&a.pop())&&a(c,d)}function Bj(a,b){var c;null==(c=a.F.get(b))||c.forEach(d=>{d(olympe.dc.transaction.Hf.C.bj,null)});a.F.delete(b);if(0===a.F.size){for(const d of a.P)d();a.P=[]}a.C.has(b)&&(c=a.C.get(b),a.C.delete(b),c(!0))}
728
+ function Cj(a,b){0<a.F.size?a.P.push(olympe.D.Ma().G(b)):b()}olympe.dc.transaction.Hf=class{constructor(a,b,c,d,e,f){this.K=a;this.G=b;this.db=b.view;this.ec=c;this.T=d;this.$=e;this.timeout=f;this.L=new Map;this.F=new Map;this.P=[];this.C=new Map;wj(this)}fb(){return this.K}};olympe.dc.transaction.Hf.C={bl:0,bj:1,Ks:2};olympe.dc.transaction.Aj=class{constructor(a,b=!1){this.C=a;this.F=b}wg(){return this.F}Zc(){return this.C}};olympe.dc.transaction.R={za:'dc.transaction.Logger',Ga:'dc.transaction.Manager'};olympe.dc.transaction.U={TIMEOUT:'dc.transaction.timeout',Pm:'dc.transaction.burstInterval'};
729
+ olympe.V.config(function(a){F(a,olympe.dc.transaction.U.TIMEOUT,6E4);F(a,olympe.dc.transaction.U.Pm,30);E(a,olympe.dc.transaction.R.za,[olympe.la.R.Ga],b=>b.Fc('dc'));D(a,olympe.dc.transaction.R.Ga,olympe.dc.transaction.Hf,olympe.dc.transaction.R.za,olympe.dc.db.R.Ga,olympe.dc.R.Tg,olympe.dc.sources.R.ue,olympe.dc.R.Qi,new olympe.V.ma(olympe.dc.transaction.U.TIMEOUT))},'olympe.dc.transaction');olympe.dc.transaction.ab={};function Dj(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Ta(e));return c}olympe.dc.transaction.ab.Bg=class{constructor(){this.ta=olympe.dc.ta()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Ta(a){a=olympe.D.Ta(a);return void 0===a||null===a?null:olympe.D.wq(a)?a.valueOf():a}};olympe.dc.transaction.ab.Bg.va=[olympe.dc.Mo];olympe.dc.transaction.ab.Im=class extends olympe.dc.transaction.ab.Bg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Oa.Relation?a:new olympe.dc.Oa.Relation(olympe.dc.fa(a));this.origin=this.ta.Ia(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}Pa(){return this.relation.Pa()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Z(a,b,c){a.G.set(olympe.dc.fa(b),c);return a}
730
+ olympe.dc.transaction.ab.tk=class extends olympe.dc.transaction.ab.Bg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.fa(b))?c:olympe.Z.ef();this.model=olympe.dc.fa(a);this.source=null;this.G=new Map;this.F=!0}X(){return this.tag}oc(){return this.model}persist(a){this.F=a;return this}wh(a){this.source=a;return this}C(a){const b=olympe.dc.ta(),c=this.oc(),d=this.X();if(!c)throw Error('OperationError: Cannot create instance, model tag is undefined');if(b.Ia(d)&&!b.Of(d)&&this.F){const e=
731
+ new Map([...b.Bb(d,!0),...Dj(this,this.G)]);for(const f of e.values())if(f instanceof olympe.dc.lc&&!kj(a,f.X())){const g=new olympe.dc.Sa;g.zi(f.X());g.C(a)}a.Ec(d,c,this.F,this.source,e);for(const [f,g,h]of Of(b,d))kj(a,h)&&(g===olympe.dc.wa.ORIGIN?a.Ea(f,h,d):a.Ea(f,d,h))}else b.Ia(d)||a.Ec(d,c,this.F,this.source,Dj(this,this.G))}toString(){return`CreateInstance(${this.oc()}, ${this.X()})`}};olympe.dc.transaction.ab.tk.va=[olympe.dc.qe];olympe.dc.transaction.ab.uk=class extends olympe.dc.transaction.ab.Im{constructor(a,b,c){super(a,b);this.F=this.ta.Ia(c)?olympe.dc.CloudObject.get(c):c}C(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.mc.nd)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');
732
+ if(!this.F)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Pa()===olympe.dc.wa.DESTINATION?a.Ea(b,olympe.dc.fa(this.origin),olympe.dc.fa(this.F)):a.Ea(b,olympe.dc.fa(this.F),olympe.dc.fa(this.origin))}toString(){return`CreateRelation('${this.relation.Pa()}${this.relation.X()}, ${olympe.dc.fa(this.origin)}, ${olympe.dc.fa(this.F)})`}};olympe.dc.transaction.ab.qx=class extends olympe.dc.transaction.ab.Bg{constructor(a,b=olympe.dc.Nb.rc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.bc=b}C(a){for(const b of this.ta.Rd(this.model))b!==olympe.dc.fa(this.model)&&(new olympe.dc.transaction.ab.yn(b,this.bc)).C(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.bc})`}};olympe.dc.transaction.ab.xn=class extends olympe.dc.transaction.ab.Im{C(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.mc.nd)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.Pa(),e=this.ta.ib(c,this.relation);for(const f of e)d===olympe.dc.wa.DESTINATION?
733
+ a.Wb(b,c,f):a.Wb(b,f,c)}toString(){return`DeleteAllRelations(${this.Pa()}${this.getType()})`}};olympe.dc.transaction.ab.yn=class extends olympe.dc.transaction.ab.Bg{constructor(a,b=olympe.dc.Nb.rc){super();this.tag=this.ta.Ia(a)?olympe.dc.CloudObject.get(a):a;this.bc=b}X(){return olympe.dc.fa(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ta.Ia(b)&&nj(a,b,this.bc)}toString(){return'DeleteInstance('+this.X()+', '+this.bc+')'}};olympe.dc.transaction.ab.sr=class extends olympe.dc.transaction.ab.uk{C(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.mc.nd)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.F);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
734
+ this.relation.Pa()===olympe.dc.wa.DESTINATION?a.Wb(b,c,d):a.Wb(b,d,c)}toString(){return'DeleteRelation('+this.relation.Pa()+this.relation.X()+', '+olympe.dc.fa(this.origin)+', '+olympe.dc.fa(this.F)+')'}};olympe.dc.transaction.ab.Gt=class extends olympe.dc.transaction.ab.Bg{constructor(a,b,c){super();this.tag=this.ta.Ia(a)?olympe.dc.CloudObject.get(a):a;this.F=new Map;void 0!==b&&this.F.set(olympe.dc.fa(b),c)}X(){return olympe.dc.fa(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.C.Ge(b))&&c.L()||this.ta.Ia(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=Dj(this,this.F);
735
+ for(const [e,f]of c){var d=this.ta.Qa(b,e);d instanceof olympe.dc.lc&&nj(a,d.X(),olympe.dc.Nb.rc);f instanceof olympe.dc.lc&&!kj(a,f.X())&&(d=new olympe.dc.Sa,d.zi(f.X()),d.C(a))}a.jd(b,c)}toString(){return'UpdateInstance('+this.X()+', '+Dj(this,this.F)+')'}};olympe.dc.fa=function(a){if('string'===typeof a)return a;let b=null;a=olympe.D.Ta(a);void 0!==a&&null!==a&&(a=a.valueOf(),'string'===typeof a?b=a:a.X?b=a.X():'function'===typeof a&&(b=olympe.dc.ka.oc(a)));return b||''};B('olympe.dc.instanceToTag',olympe.dc.fa);olympe.dc.ta=function(){return olympe.dc.Wl().view};olympe.dc.register=function(a,b){olympe.dc.ka.C(a,b)};olympe.dc.defineProperty=function(a){return new olympe.dc.Oa.Property(a)};
736
+ olympe.dc.gq=function(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.wa.DESTINATION){const e=olympe.dc.wa.DESTINATION;return b===olympe.dc.wa.ORIGIN||b===e?new olympe.dc.Oa.Relation(a,b):new olympe.dc.Oa.Relation(a,d,b,c)};olympe.dc.du=function(a){return a.Qb()};olympe.dc.Eb={};olympe.dc.Eb.Nl=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.sb(a):a instanceof olympe.D.Ka?a:null;olympe.dc.Eb.Kl=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Ib(a):a instanceof olympe.D.ea?a:null;olympe.dc.Eb.Ml=a=>'number'===typeof a||a instanceof Number?olympe.D.oa(a):'string'===typeof a||a instanceof String?olympe.D.oa(Number.parseFloat(a.valueOf())):a instanceof olympe.D.aa?a:null;
737
+ olympe.dc.Eb.Ll=function(a){return'number'===typeof a||a instanceof Number?xb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.Za(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.Za(a):a instanceof olympe.D.Za?a:null};olympe.dc.Eb.Zp=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?Bb(a.valueOf()):null};olympe.dc.Eb.$p=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.lc?ne(a):null;
738
+ olympe.dc.Eb.kg=a=>a instanceof olympe.dc.lc?ne(a):a;olympe.dc.Eb.$A=a=>{switch(typeof a){case 'boolean':return olympe.D.Ib(a);case 'number':return olympe.D.oa(a);case 'string':return olympe.D.sb(a);case 'object':if(a instanceof Date)return olympe.D.Xv(a)}return a};
739
+ olympe.dc.Eb.rB=a=>{switch(a){case olympe.D.ea:return olympe.dc.Eb.Kl;case olympe.D.Ka:return olympe.dc.Eb.Nl;case olympe.D.aa:return olympe.dc.Eb.Ml;case olympe.D.Za:return olympe.dc.Eb.Ll;case olympe.D.Color:return olympe.dc.Eb.Zp;case olympe.dc.CloudObject:return olympe.dc.Eb.$p;default:return olympe.dc.Eb.kg}};olympe.dc.ic={};olympe.dc.Me=class{ia(){}L(){}G(){}P(){}ha(){}toString(){}};function Ej(a){let b=null;for(a=[...a.ba];null===b&&0<a.length;)b=a.pop().Hb();return b}function Fj(a,b){a.T()||(a=`Calling "${b}" on subscription with id ${a.W()} 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.la.fb('dc').warn(a))}
740
+ function Hj(a){const b=new olympe.D.Jb('listDef toObservable');return new rxjs.Observable(c=>{b.run(()=>{olympe.D.qc([a],d=>{c.next(d.valueOf())})});b.onDestroy(()=>{c.complete()});return()=>b.destroy()})}
741
+ olympe.dc.ua=class{constructor(a,b,c){void 0===a||null===a?olympe.la.fb('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.sa([a],olympe.dc.fa,String),this.ba=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||Ej(this),this.C=null)}he(){return olympe.dc.he()}lb(){if(null===this.C){const a=olympe.dc.ic.Zu();this.C=Ij(a,this);null!==this.valueType&&this.C.md(this.valueType);olympe.D.Ma().$(()=>{var b=this.C.W();a.K.debug('QueryMGR: [ID:',
742
+ b,'] - Unregistered');const c=a.C.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.C.release(),a.C.delete(b));this.C=null})}return this}Ub(){null===this.C&&this.lb();return this.C}md(a){this.valueType=a;null!==this.C&&this.C.md(this.valueType)}Hb(){return null!==this.C?this.C.Hb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Bd(){return this.F}Uk(){return this.ba}cd(a,b){return this.Ub().cd(a,b)}Yj(a){this.Ub().Yj(a)}bs(){return this.Ub().qd()}$r(){return this.Ub().T()}get(a){return this.Ub().get(a)}oh(){return this.Ub().oh()}mh(a){const b=
743
+ this.Ub();Fj(b,'getCurrent');return b.mh(a)}has(a){return this.Ub().has(a)}vg(a){const b=this.Ub();Fj(b,'hasCurrent');return b.vg(a)}Pd(a){return this.Ub().Pd(a)}Yv(a){return Hj(this.Pd(a))}Fe(a){const b=this.Ub();Fj(b,'getCurrentAt');return b.Fe(a)}He(a){return this.Ub().He(a)}ff(a){const b=this.Ub();Fj(b,'getCurrentKeyAt');return b.ff(a)}Dd(a){return this.Ub().Dd(a)}cw(a){return Hj(this.Dd(a))}gf(a){const b=this.Ub();Fj(b,'getCurrentRank');return b.gf(a)}yc(){return this.Ub().yc()}Zv(){return Hj(this.yc())}hf(){return this.Ub().hf()}Se(){return this.Ub().Se()}dw(){return Hj(this.Se())}Nf(){const a=
744
+ this.Ub();Fj(a,'getCurrentSize');return a.Nf()}forEach(a,b){this.Ub().forEach(a,b)}Od(a){const b=this.Ub();Fj(b,'forEachCurrentValue');return b.Od(a)}ji(a,b,c,d){a=new olympe.dc.ba.Mg(a,b);(new olympe.dc.ua(this.F,[...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');
745
+ if(c instanceof olympe.dc.Oa.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.C)break;a.push(c)}b=new olympe.dc.ua(this.F,a);b.md(Ej(b)||this.valueType||Object);return b}ck(a){return this.transform(new olympe.dc.ba.$e(a))}filter(a){return this.transform(new olympe.dc.ba.Qe(a))}Lf(){const a=new olympe.dc.$i(this.F,null===this.valueType?void 0:this.valueType);let b=this.ba;b instanceof Array||(b=b?[b]:[]);a.transform(b);
746
+ return a}toString(){let a=this.ba;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.Ta(this.F)+a+')'}Zr(){return this.Ub().Yf()}zc(){return olympe.D.sa([this.Se()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.Fe(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.sb(b+']')},olympe.D.Ka)}};olympe.dc.ua.prototype.filter=olympe.dc.ua.prototype.filter;olympe.dc.ua.prototype.union=olympe.dc.ua.prototype.ck;olympe.dc.ua.prototype.transform=olympe.dc.ua.prototype.transform;
747
+ olympe.dc.ua.prototype.forEachCurrentValue=olympe.dc.ua.prototype.Od;olympe.dc.ua.prototype.forEach=olympe.dc.ua.prototype.forEach;olympe.dc.ua.prototype.getCurrentSize=olympe.dc.ua.prototype.Nf;olympe.dc.ua.prototype.observeSize=olympe.dc.ua.prototype.dw;olympe.dc.ua.prototype.observeFirst=olympe.dc.ua.prototype.Zv;olympe.dc.ua.prototype.getCurrentRank=olympe.dc.ua.prototype.gf;olympe.dc.ua.prototype.observeRank=olympe.dc.ua.prototype.cw;olympe.dc.ua.prototype.getCurrentAt=olympe.dc.ua.prototype.Fe;
748
+ olympe.dc.ua.prototype.observeAt=olympe.dc.ua.prototype.Yv;olympe.dc.ua.prototype.offReady=olympe.dc.ua.prototype.Yj;olympe.dc.ua.prototype.onReady=olympe.dc.ua.prototype.cd;olympe.dc.ua.prototype.getBaseTag=olympe.dc.ua.prototype.Bd;olympe.dc.ua.va=[olympe.D.Qc];l=olympe.dc.ua.prototype;l.he.J=olympe.D.H.C;l.lb.J=olympe.D.H.L();l.Ub.J=new olympe.D.H(()=>olympe.dc.ic.Subscription,[]);l.md.J=new olympe.D.H(()=>{},[]);l.Bd.J=new olympe.D.H(()=>String,[]);l.Uk.J=new olympe.D.H(()=>Array,[]);
749
+ l.cd.J=new olympe.D.H(()=>String,[]);l.Yj.J=new olympe.D.H(()=>{},[]);l.bs.J=olympe.D.H.P;l.$r.J=olympe.D.H.C;l.get.J=new olympe.D.H(()=>olympe.dc.CloudObject,[],'valueType');l.oh.J=new olympe.D.H(()=>Array,[]);l.mh.J=olympe.D.H.C;l.has.J=olympe.D.H.P;l.vg.J=olympe.D.H.C;l.Pd.J=new olympe.D.H(()=>olympe.dc.CloudObject,[],'valueType');l.Fe.J=olympe.D.H.C;l.He.J=new olympe.D.H(()=>String,[]);l.ff.J=olympe.D.H.C;l.Dd.J=olympe.D.H.G;l.gf.J=olympe.D.H.C;
750
+ l.yc.J=new olympe.D.H(()=>olympe.dc.CloudObject,[],'valueType');l.hf.J=new olympe.D.H(()=>String,[]);l.Se.J=olympe.D.H.G;l.Nf.J=olympe.D.H.C;l.forEach.J=new olympe.D.H(()=>{},[]);l.Od.J=olympe.D.H.C;l.ji.J=new olympe.D.H(()=>{},[]);l.transform.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.ck.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.filter.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Lf.J=new olympe.D.H(()=>olympe.dc.$i,[]);l.toString.J=olympe.D.H.C;l.Zr.J=olympe.D.H.C;l.zc.J=olympe.D.H.F;const Jj={Hw:'append',Ek:'filter_not',Hn:'filter_and',In:'filter_or'};function Kj(a,b){a=Lj(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.Ua.Jm(a,b)).F}
751
+ olympe.dc.$i=class{constructor(a,b){this.C=Lj(a);this.K=olympe.la.fb('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.ba=[];this.ab=[]}Ue(){return new olympe.dc.ua(this.C,this.ba,this.valueType)}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Mj('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Oa.Property)throw new Mj('transform','Properties cannot be used as transformer, unlike relations '+d);if(!d||'function'!==typeof d.C)throw new Mj('transform',
752
+ 'one of the argument is not a Transformer '+d);const e=d.Hb();null!==e&&(this.valueType=e);this.ba.push(d)}return this}ck(a){this.ba.push(new olympe.dc.ba.$e(a));return this}Ew(a){this.ba.push(new olympe.dc.ba.$e(Lj(a)));return this}ds(a){this.valueType=a;return this}eb(a){this.ba.push(a);this.valueType=a.Hb()||olympe.dc.CloudObject;return this}ru(a){for(const b of a)this.ba.push(b),this.valueType=b.Hb()||olympe.dc.CloudObject;return this}qu(a,b,c){a=new olympe.dc.ba.ce(a,a.Pa(),b,c);this.ba.push(a);
753
+ this.valueType=a.Hb()||olympe.dc.CloudObject;return this}pu(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.Pa())}a=new olympe.dc.ba.aj(b,c);this.ba.push(a);this.valueType=a.Hb()||olympe.dc.CloudObject;return this}cs(){this.eb(olympe.dc.CloudObject.instancesRel);return this}Be(a){var b=this.ab.pop();b===Jj.Ek&&(a=new olympe.dc.Y.Kd(a),b=this.ab.pop());switch(b){case Jj.Hn:b=this.ba.pop().F;b instanceof olympe.dc.Y.kd?(b=b.Y,b.push(a),a=new olympe.dc.Y.kd(...b)):
754
+ a=new olympe.dc.Y.kd(b,a);b=this.ab.pop();break;case Jj.In:b=this.ba.pop().F,b instanceof olympe.dc.Y.be?(b=b.Y,b.push(a),a=new olympe.dc.Y.be(...b)):a=new olympe.dc.Y.be(b,a),b=this.ab.pop()}b===Jj.Ek&&(a=new olympe.dc.Y.Kd(a),this.ab.pop());this.ba.push(new olympe.dc.ba.Qe(a));return this}lu(a,b,c){return this.Be(new olympe.dc.Y.Yd(Kj(a,c),new olympe.dc.Ua.ne(b)))}contains(a,b,c=!1,d){return this.Be(new olympe.dc.Y.Ne(Kj(a,d),new olympe.dc.Ua.ne(b),c))}$c(a){if(!(a instanceof Array))throw new Mj('instanceOf',
755
+ 'Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(Lj(a[c]));return this.Be(new olympe.dc.Y.Qh(b))}Uj(a){return this.Be(new olympe.dc.Y.Yd(new olympe.dc.Ua.bi,new olympe.dc.Ua.ne(Lj(a))))}mu(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.Sc().Uj(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().Sc().Uj(a[b])}return this}pi(a,b){if(!(a instanceof Array))throw new Mj('hasRelated','Provided argument "relations" must be an array.');
756
+ const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Pa())});return this.Be(new olympe.dc.Y.Mh(c,d,b))}Tj(a,b,c){a=Kj(a,c);return this.Be(new olympe.dc.Y.Ti(a,new olympe.dc.Ua.ne(b)))}Ci(a,b,c){a=Kj(a,c);return this.Be(new olympe.dc.Y.wj(a,new olympe.dc.Ua.ne(b)))}Qv(a,b,c,d){a=Kj(a,d);return this.Be(new olympe.dc.Y.Ye(a,b,c))}filter(a){const b=new class extends olympe.dc.Y.Rf{C(c,d){return a(olympe.dc.CloudObject.get(d))}};return this.Be(b)}Sc(){this.ab.push(Jj.Ek);return this}and(){this.ba[this.ba.length-
757
+ 1]instanceof olympe.dc.ba.Qe&&this.ab.push(Jj.Hn);return this}or(){this.ba[this.ba.length-1]instanceof olympe.dc.ba.Qe&&this.ab.push(Jj.In);return this}bk(a,b,c){a=Lj(a);let d=null;switch(olympe.dc.ta().Sb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.N.X():d=new olympe.dc.ac.String(new olympe.dc.Ua.ai(a,c));break;case olympe.dm.Number.N.X():d=new olympe.dc.ac.Number(new olympe.dc.Ua.Uh(a,c));break;case olympe.dm.DateTime.N.X():d=new olympe.dc.ac.DateTime(new olympe.dc.Ua.Hh(a,c))}c=d;null!==
758
+ c&&this.ba.push(new olympe.dc.ba.gg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.ac.Rf{L(e,f){return a(olympe.dc.CloudObject.get(f))}G(e,f){return b(e,f).valueOf()}};this.ba.push(new olympe.dc.ba.gg(d,c));return this}hu(){this.ba.push(new olympe.dc.ba.Ih);return this}nm(a,b){this.ba.push(new olympe.dc.ba.Mg(a,b));return this}};class Mj extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
759
+ function Lj(a){return'string'===typeof a||a instanceof olympe.D.Ka?a:'function'===typeof a?olympe.dc.ka.oc(a):olympe.D.Ya(a)?a.Ej===olympe.D.Ka?a:olympe.D.sa([a],b=>olympe.D.sb(olympe.dc.fa(b)),olympe.D.Ka):a.X()}l=olympe.dc.$i.prototype;l.Ue.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.transform.J=olympe.D.H.L();l.ck.J=olympe.D.H.L();l.Ew.J=olympe.D.H.L();l.ds.J=olympe.D.H.L();l.eb.J=olympe.D.H.L();l.ru.J=olympe.D.H.L();l.qu.J=olympe.D.H.L();l.pu.J=olympe.D.H.L();l.cs.J=olympe.D.H.L();l.Be.J=olympe.D.H.L();
760
+ l.lu.J=olympe.D.H.L();l.contains.J=olympe.D.H.L();l.$c.J=olympe.D.H.L();l.Uj.J=olympe.D.H.L();l.mu.J=olympe.D.H.L();l.pi.J=olympe.D.H.L();l.Tj.J=olympe.D.H.L();l.Ci.J=olympe.D.H.L();l.Qv.J=olympe.D.H.L();l.filter.J=olympe.D.H.L();l.Sc.J=olympe.D.H.L();l.and.J=olympe.D.H.L();l.or.J=olympe.D.H.L();l.bk.J=olympe.D.H.L();l.sort.J=olympe.D.H.L();l.hu.J=olympe.D.H.L();l.nm.J=olympe.D.H.L();function Ij(a,b){const c=b.Bd();var d=new olympe.dc.query.Vs;let e;e=c;olympe.D.Ya(e)&&(e=d.add(c));b=(b=b.Uk())?Array.isArray(b)?b:[b]:null;d=olympe.dc.ic.Subscription.G(e,b,d);let f,g,h=null!=(g=null==(f=a.C.get(d))?void 0:f.C)?g:null;null===h&&(a.K.debug('QueryMGR: new',a.F?'local':'remote','subscription "',d,'": #',`${e},`,b),h=new olympe.dc.ic.Subscription(d,c,b,a.G));h.getContext().run(()=>a.process(h));return h}
761
+ function Nj(a,b){if(b.T())a.K.debug('ListProcessor: [ID:',b.W(),'] - Subscription already booted, ignoring');else{a.K.debug('ListProcessor: [ID:',b.W(),'] - Booting subscription');var c=new olympe.dc.Tb.Dp(a.db,a.K),d=b.W();olympe.D.qc([b.Bd()],e=>{const f=olympe.dc.fa(e);a.K.debug('ListProcessor: [ID:',b.W(),'] - Booting with baseTag',f);b.ki()||b.ri();pe(a.db,f,Oj(a,b,c),d);olympe.D.Ma().$(()=>oe(a.db,f,d));a.db.Ia(f.valueOf())||Pj(c);b.T()||(Pj(c),b.nc([]))})}}
762
+ function Qj(a,b,c,d){const e=[b.Bd()],f=k=>k instanceof olympe.dc.ba.$e;let g;const h=(null!=(g=b.tg())?g:[]).filter(f);for(const k of h){e.push(k.Bd());let m;h.push(...(null!=(m=k.tg())?m:[]).filter(f))}Cj(a.P,()=>{olympe.D.qc(e,()=>{const k=b.ye(c);Rj(a,k,b.W(),d)})})}
763
+ function Rj(a,b,c,d){a.K.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const e=olympe.D.Ma(),f=new olympe.async.ij(e);b.forEach(g=>{f.add((h,k)=>{let m=!1;Sg(a.L,g,e,olympe.dc.Ra.SELF,olympe.dc.ra.uc.Tf).subscribe(rxjs.Subscriber.create(()=>{m||(m=!0,e.run(h))},n=>e.run(()=>k(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${g.W()} has encountered an error: ${n}`))))})});rc(f,(g,h)=>d(h));f.start()}
764
+ function Oj(a,b,c){const d=new olympe.dc.Tb.Ii;let e=!1;const f=olympe.D.Ma(),g=b.tg(),h=[];h[g?g.length:0]=(k,m,n,p)=>{f.Bc()||f.gb()||(k?b.vg(n)?a.K.warn('Adding the same index twice (should never happen) for sub #',b.W(),', index #',n,', tag #',m):(a.K.debug('ListProcessor: [ID:',b.W(),'] - Adding Instance',m,'to the subscription'),b.zd(n,m)):(a.K.debug('ListProcessor: [ID:',b.W(),'] - Removing Instance',m,'from the subscription'),b.oi(n)),e||(Sj(c,()=>{p.If();Pj(c)}),f.run(()=>p.he().Qf(b.nc.bind(b))),
765
+ e=!0),Tj(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].C(f,c,h[k+1]);return(k,m)=>{const n=b.W();c.register(n,null);const p=d.C(k,m,n,null);if(null!==p)h[0](k,m,n,Uj(p,k,m,n))}}
766
+ olympe.dc.ic.Es=class{constructor(a,b,c,d,e){this.K=a;this.db=b;this.F=e;this.P=c;this.L=d;this.C=new Map;this.G=new olympe.D.Jb('Legacy ListDef processor')}process(a){const b=a.W();var c=this.C.get(b);c||(c=new olympe.dc.ic.rt(a),this.C.set(b,c));c.counter++;Vj(c)?this.K.debug('ListProcessor: [ID:',b,'] - id already processed'):(this.K.debug('ListProcessor: [ID:',b,'] - NOT processed yet.'),c=a.df(),this.F&&c===olympe.dc.Ra.SERVER||c===olympe.dc.Ra.SELF?(this.K.debug('QueryMGR: [ID:',b,'] - Local subscription, no need for coverage check, booting subscription '),
767
+ Nj(this,a)):Qj(this,a,c,d=>{d?this.K.error(d):Nj(this,a)}))}};function Wj(a){return olympe.D.Ya(a)?'Node#'+a.Aa.W():String(a)}function Xj(a,b){return olympe.D.Ya(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
768
+ olympe.dc.query.Vs=class{constructor(){this.C=0;this.values=null}add(a){let b;b=olympe.D.Ya(a)?'n'+a.Aa.W():'p'+ ++this.C;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.Ca=class{ia(){}C(){}F(){}ha(){}toString(){}};olympe.dc.ic.Subscription=class a extends olympe.D.Hi{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Jb('context subscription '+b,e));this.id=b;this.ud=c;this.ba=d||null;this.G=this.P.run(()=>olympe.D.Fd(olympe.dc.ic.Subscription.C.INIT));this.$b=!1;this.da=this.Vb=null}static G(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ha(d);else e+='|null';e=olympe.Z.nb(e)}catch(f){e=olympe.Z.hc()}return e}W(){return this.id}Bd(){return this.ud}tg(){return this.ba}df(){const b=
769
+ olympe.dc.Ed(),c=olympe.D.Ta(this.Bd());let d;return olympe.dc.CloudObject.instancesRel.Ha(null==(d=this.ba)?void 0:d[0])?b.fromModel(c):b.Ce(c)}ki(){const b=olympe.D.Ta(this.G);return b&&b.valueOf()>=olympe.dc.ic.Subscription.C.xp}ri(){if(this.G.Aa.gb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.Vb;this.Vb=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);ub(this.G,olympe.D.Fd(olympe.dc.ic.Subscription.C.xp))}qd(){return olympe.D.sa([this.G],
770
+ ()=>{},olympe.D.ea)}T(){const b=this.G.Aa.xb;return b&&b.valueOf()>=olympe.dc.ic.Subscription.C.Sg}cd(b,c){this.T()?b(this):(null===this.da&&(this.da=new Map),void 0===c&&(c=olympe.Z.hc()),this.da.set(c,olympe.D.Ma().G(b)));return c||''}Yj(b){null!==this.da&&b&&this.da.delete(b)}Pb(){const b=olympe.dc.ic.Subscription.C.Sg;if(!this.G.Aa.gb()&&olympe.D.Ta(this.G)!==b&&(this.bf(),ub(this.G,b),null!==this.da)){for(const c of this.da.values())c(this);this.da=null}}onDestroy(b){this.P.onDestroy(b)}release(){this.P.destroy()}nc(b){if(!this.G.Aa.gb()){for(let c=
771
+ 0,d=b.length;c<d;c++)this.El(b[c],c);if(this.T())this.bf();else{this.$b=b=!0;for(let c in this.F)if(Object.prototype.hasOwnProperty.call(this.F,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.Pb()}}}zd(b,c){if(!this.G.Aa.gb()&&(this.Gj(b,olympe.dc.CloudObject.get(c)),b=this.T(),this.$b&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.Pb()}}oi(b){this.G.Aa.gb()||(this.Dl(b),
772
+ this.fi(b,!this.T()))}Yf(){return this.T()?super.Yf():'Subscription is not ready!'}ye(b){const c=olympe.D.Ta(this.Bd());return olympe.dc.ic.Subscription.F(c,b,this.tg())}static F(b,c,d){var e=olympe.dc.ra.from(b,c).Md();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.te){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.eb(h,!0))}else if(e instanceof olympe.dc.ba.ce){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.Mf(h,!0,!0))}else if(e instanceof
773
+ olympe.dc.ba.$e)e=a.F(olympe.D.Ta(e.Bd()),c,e.tg()),b.push(...e);else if(e instanceof olympe.dc.ba.Qe||e instanceof olympe.dc.ba.gg){const h=e.G();b=b.map(k=>{for(const m of h){for(const n of m)k=n.recursive?k.Mf(n,!0,!0):k.eb(n,!0);k=k.back(m.length)}return k})}return b}};olympe.dc.ic.Subscription.C={INIT:0,xp:1,Sg:2};olympe.dc.ic.Subscription.prototype.Yf.J=olympe.D.H.C;function Vj(a){const b=a.F;a.F=!0;return b}olympe.dc.ic.rt=class{constructor(a){this.counter=0;this.F=!1;this.C=a}};olympe.dc.Ze=class{ia(){}Hb(){}C(){}ha(){}toString(){}};olympe.dc.Vo=class{G(){}};olympe.dc.Cj=class{ia(){}getValue(){}C(){}ha(){}toString(){}};olympe.dc.ac={};let Yj=0;olympe.dc.ac.Rf=class{constructor(){this.id=Yj++}ia(){return'CustomLocalComparator#'+Yj}P(){return[]}L(){throw Error('GetComparedValue function was not implemented.');}G(){throw Error('Compare function was not implemented.');}ha(){return`{"c":"${this.ia()}"}`}toString(){return this.ia()+'()'}};olympe.dc.ac.Rf.va=[olympe.dc.Me];olympe.dc.ac.DateTime=class{constructor(a){this.C=a}ia(){return T(olympe.dc.ac.DateTime)}P(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(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}ha(a){return'{"c":"'+this.ia()+'",a:['+this.C.ha(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};S('olympe.dc.comparators.DateTime',olympe.dc.ac.DateTime);olympe.dc.ac.DateTime.va=[olympe.dc.Me];olympe.dc.ac.Number=class{constructor(a){this.C=a}ia(){return T(olympe.dc.ac.Number)}P(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(a,b){return a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.ia()}",a:[${this.C.ha(a)}]}`}toString(){return`Number(${this.C.toString()})`}};S('olympe.dc.comparators.Number',olympe.dc.ac.Number);olympe.dc.ac.Number.va=[olympe.dc.Me];olympe.dc.ac.String=class{constructor(a){this.C=a}ia(){return T(olympe.dc.ac.String)}P(){return this.C.C()}L(a,b){return olympe.D.sa([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Ka)}G(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.ia()}",a:[${this.C.ha(a)}]}`}toString(){return`String(${this.C.toString()})`}};S('olympe.dc.comparators.String',olympe.dc.ac.String);olympe.dc.ac.String.va=[olympe.dc.Me];olympe.dc.Y={};let Zj=0;olympe.dc.Y.Rf=class{constructor(){this.id=Zj++}ia(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ha(){return`{"c":"${this.ia()}"}`}toString(){return this.ia()+'()'}};olympe.dc.Y.Rf.va=[olympe.dc.Ca];olympe.dc.Y.hk=class{constructor(a,b){this.G=a;this.L=b}ia(){}F(){return[this.G.C(),this.L.C()]}C(a,b){return a.run(()=>olympe.D.sa([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.D.Ib(this.P('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.D.ea))}P(){}ha(a){return'{"c":"'+this.ia()+'","a":['+this.G.ha(a)+','+this.L.ha(a)+']}'}toString(){return this.ia().replace(/^.+\./,'')+'('+this.G.toString()+','+this.L.toString()+')'}};
777
774
  olympe.dc.Y.hk.va=[olympe.dc.Ca];olympe.dc.Y.kd=class{constructor(a){this.Y=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Y=this.Y.concat(arguments[c]):this.Y.push(arguments[c])}ia(){return T(olympe.dc.Y.kd)}F(){return this.Y.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.sa(this.Y.map(c=>c.C(a,b)),(...c)=>olympe.D.Ib(c.every(d=>d.valueOf())),olympe.D.ea))}ha(a){const b=this.Y.map(c=>c.ha(a));return'{"c":"'+this.ia()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.Y.map(a=>
778
- a.toString()).join(',')+')'}};S('olympe.dc.predicates.And',olympe.dc.Y.kd);olympe.dc.Y.kd.va=[olympe.dc.Ca];olympe.dc.Y.rk=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return a.run(()=>olympe.D.sa([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.D.Ib((Number(c)&Number(d.valueOf()))===Number(c))},olympe.D.ea))}ia(){return T(olympe.dc.Y.rk)}F(){return[this.value.C()]}ha(a){const b=olympe.D.Ya(this.G)?this.G.Aa.xb.valueOf():this.G.valueOf();return'{"c":"'+this.ia()+'","a":['+b+','+this.value.ha(a)+']}'}toString(){const a=olympe.D.Ya(this.G)?this.G.Aa.xb.valueOf():this.G.valueOf();
779
- return this.ia().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};S('olympe.dc.predicates.BitMask',olympe.dc.Y.rk);olympe.dc.Y.rk.va=[olympe.dc.Ca];olympe.dc.Y.Ne=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}ia(){return T(olympe.dc.Y.Ne)}F(){return[this.source.C(),this.value.C()]}zb(){return this.source}getValue(){return this.value}C(a,b){return a.run(()=>olympe.D.sa([this.source.getValue(a,b),this.value.getValue(a,b),this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Ib(c.includes(d))},olympe.D.ea))}ha(a){const b=this.source.ha(a),c=this.value.ha(a);a=Yj(a,this.G);
780
- return'{"c":"'+this.ia()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Xj(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};S('olympe.dc.predicates.Contains',olympe.dc.Y.Ne);olympe.dc.Y.Ne.va=[olympe.dc.Ca];olympe.dc.Y.Zd=class{constructor(a,b){this.G=a;this.L=b}ia(){return T(olympe.dc.Y.Zd)}F(){return[this.G.C(),this.L.C()]}C(a,b){return a.run(()=>olympe.D.sa([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.ad?c.ad(d):'object'===typeof d&&void 0!==d.ad?d.ad(c):olympe.D.Ib(c.valueOf()===d.valueOf()),olympe.D.ea,'Test equal predicate'))}ha(a){return'{"c":"'+this.ia()+'","a":['+this.G.ha(a)+','+this.L.ha(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.L.toString()+
781
- ')'}};S('olympe.dc.predicates.Equals',olympe.dc.Y.Zd);olympe.dc.Y.Zd.va=[olympe.dc.Ca];olympe.dc.Y.ur=class extends olympe.dc.Y.Zd{constructor(a,b){super(a,new olympe.dc.Ua.me(b))}};olympe.dc.Y.ur.va=[olympe.dc.Ca];olympe.dc.Y.Ti=class extends olympe.dc.Y.hk{constructor(a,b){super(a,b)}ia(){return T(olympe.dc.Y.Ti)}P(a,b){return a>b}};S('olympe.dc.predicates.Greater',olympe.dc.Y.Ti);olympe.dc.Y.Kh=class{constructor(a,b,c){this.G=[];this.L=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.de?this.G.push(new bk(c.X(),c.Pa(),c.G,c.F)):this.G.push(new bk(olympe.dc.fa(c),b[d],1,1))}ia(){return T(olympe.dc.Y.Kh)}F(){return[this.G.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>ub(olympe.D.ec(Boolean),!1)),d=olympe.Z.hc(),e=olympe.dc.ta();let f=0;a=(h,k)=>{0!==this.L.length&&!this.L.includes(k)||
782
- c.getContext().gb()||c.getContext().Bc()||(f+=h?1:-1,c.update(0<f))};const g=this.G;for(let h=g.length-1;0<=h;h--)a=ck(g[h],e,a,d+h);oe(e,b,a,d);c.getContext().onDestroy(()=>{ne(e,b,d)});return c.vb()}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(this.G.map(a=>a.ha()))+(0!==this.L.length?',"'+this.L.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.L.length?'#'+this.L.toString()+', ':'')+this.G.map(a=>a.ha())+')'}};S('olympe.dc.predicates.HasRelated',olympe.dc.Y.Kh);
783
- function ck(a,b,c,d){const e=Object.create(null);d+=olympe.Z.jh();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var m=d+k;g?e[h]||(e[h]=!0,W(b,h,a,(n,p)=>{f(n,p,k+1)},m)):(delete e[h],b.F(h,a,m))}};return(g,h)=>f(g,h,0)}class bk extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ha(){return`${this.X()}, ${this.Pa()}, ${this.F}, ${this.C}`}}olympe.dc.Y.Kh.va=[olympe.dc.Ca];olympe.dc.Y.Qk=class{constructor(a,b,c){this.G=[];this.L=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.de?this.G.push(new dk(c.X(),c.Pa(),c.G,c.F)):this.G.push(new dk(olympe.dc.fa(c),b[d],1,1))}ia(){return T(olympe.dc.Y.Qk)}F(){return[this.G.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>ub(olympe.D.ec(Boolean),!1)),d=olympe.dc.ta(),e=olympe.Z.jh();let f=(k,m,n)=>{m&&(null===this.L||this.L.includes(n))&&k(1)};
784
- const g=this.G;for(let k=g.length-1;0<=k;k--)f=ek(g[k],d,f,e+k);let h=0;oe(d,b,f.bind(null,k=>{c.getContext().Bc()||c.getContext().gb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>ne(d,b,e));return c.vb()}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(this.G.map(a=>a.ha()))+(null!==this.L?',"'+this.L.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.L?'#['+this.L.toString()+'], ':'')+this.G.map(a=>a.ha())+')'}};S('olympe.dc.predicates.HasRelatedTree',olympe.dc.Y.Qk);
785
- function ek(a,b,c,d){const e=a.G,f=a.P,g=new Set,h=(m,n,p)=>{f.has(n)?f.get(n).set(d+p,m):f.set(n,(new Map).set(d+p,m))},k=(m,n,p,q,r)=>{const t=olympe.Z.jh();if(q){const u=p+r,w=x=>{const y=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!==y&&null!==y&&(g.add(u),e.set(r,(e.get(r)||0)+x),Array.from(y.values()).forEach(z=>z(x)));g.delete(u)};h(m,r,p);e.has(r)?m(e.get(r)):(n>=a.F&&c(x=>
786
- {e.set(r,(e.get(r)||0)+x);m(x)},q,r),(0>a.C||n<=a.C)&&r!==p&&W(b,r,a,k.bind(a,w,n+1,r),t))}else m(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.F(r,a,t))};return(m,n,p)=>k(m,0,'origin',n,p)}class dk extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.P=new Map;this.G=new Map}ha(){return`${this.X()}, ${this.Pa()}, ${this.F}, ${this.C}`}}olympe.dc.Y.Qk.va=[olympe.dc.Ca];olympe.dc.Y.Oh=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.fa(b))}):this.G.add(olympe.dc.fa(a))}ia(){return T(olympe.dc.Y.Oh)}F(){return[]}C(a,b){const c=a.run(()=>ub(olympe.D.ec(olympe.D.ea),olympe.D.ea.C)),d=olympe.dc.ta();let e=[];const f=()=>{e.forEach(h=>{d.F(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.fa(olympe.dc.CloudObject))c.update(olympe.D.Ib(this.G.has(k))),f();else{for(const m of e)if(m.tag===k)throw Error(`You should never extend a model to itself (${k})`);
787
- this.G.has(k)?(c.update(olympe.D.ea.F),f()):(h=new fk(k,olympe.dc.CloudObject.extendRel),e.push(h),W(d,h.tag,h.relation,g,h.id))}};a=new fk(b,olympe.dc.CloudObject.modelRel);e.push(a);W(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.vb()}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class fk{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.Z.jh()}}
788
- S('olympe.dc.predicates.InstanceOf',olympe.dc.Y.Oh);olympe.dc.Y.Oh.va=[olympe.dc.Ca];olympe.dc.Y.Ld=class{constructor(a){this.G=a}ia(){return T(olympe.dc.Y.Ld)}F(){return this.G.F()}C(a,b){return a.run(()=>olympe.D.sa([this.G.C(a,b)],c=>olympe.D.Ib(!c.valueOf()),olympe.D.ea))}ha(a){return`{"c":"${this.ia()}","a":[${this.G.ha(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};S('olympe.dc.predicates.Not',olympe.dc.Y.Ld);olympe.dc.Y.Ld.va=[olympe.dc.Ca];olympe.dc.Y.ce=class{constructor(a){this.Y=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Y=this.Y.concat(arguments[c]):this.Y.push(arguments[c])}ia(){return T(olympe.dc.Y.ce)}F(){return this.Y.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.sa(this.Y.map(c=>c.C(a,b)),(...c)=>olympe.D.Ib(c.some(d=>d.valueOf())),olympe.D.ea))}ha(a){const b=this.Y.map(c=>c.ha(a));return'{"c":"'+this.ia()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.Y.map(a=>a.toString()).join(',')+
789
- ')'}};S('olympe.dc.predicates.Or',olympe.dc.Y.ce);olympe.dc.Y.ce.va=[olympe.dc.Ca];olympe.dc.Y.Ze=class{constructor(a,b,c){this.source=a;this.L=b;this.G=void 0===c?!0:c}ia(){return T(olympe.dc.Y.Ze)}F(){return[this.source.C()]}zb(){return this.source}C(a,b){return a.run(()=>olympe.D.sa([this.source.getValue(a,b),this.L,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Ib((new RegExp(d)).test(c))},olympe.D.ea))}ha(a){const b=this.source.ha(a),c=Yj(a,this.L);a=Yj(a,this.G);return'{"c":"'+this.ia()+'","a":['+b+','+c+','+a+
790
- ']}'}toString(){const a=Xj(this.G);return'Regex('+this.source.toString()+','+this.L+','+a+')'}};S('olympe.dc.predicates.Regex',olympe.dc.Y.Ze);olympe.dc.Y.Ze.va=[olympe.dc.Ca];olympe.dc.Y.wj=class extends olympe.dc.Y.hk{constructor(a,b){super(a,b)}ia(){return T(olympe.dc.Y.wj)}P(a,b){return a<b}};S('olympe.dc.predicates.Smaller',olympe.dc.Y.wj);olympe.dc.Ub={};olympe.dc.Ub.Ii=class{constructor(){this.T=this.L=this.index=this.F=null}P(){return null!==this.F}$(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.L;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.Ub.Pi(this),this.index=c,this.L=b):this.L=this.index=null;return b}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.T){const a=
791
- [];null!==this.L&&(0<=this.F?gk(hk(this.L,this.F),a):a.push(this.index));this.T(a)}}Qf(a){this.T=a}};olympe.dc.Ub.Ii.va=[olympe.dc.Ub.Ba];function Vj(a,b,c,d){b?a.P[d]=c:delete a.P[d];null===a.F&&(a.F=new olympe.dc.Ub.Pi(a.C,a));return a.F}function hk(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function gk(a,b){a=a.P;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.Ub.Pi=class{constructor(a,b){this.C=a;this.depth=b?b.depth+1:0;this.P=Object.create(null);this.F=null}ge(){return this.C}Hf(){this.C.P()?this.C.G():this.C.$(this.depth-1)}};class ik extends olympe.dc.Ub.Pi{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.$=this.T=this.L=!1;this.G=null}}
792
- function jk(a,b,c,d,e){const f=Object.create(null),g=a.na,h=a.L;let k,m,n;a.ga=!0;m=0;for(n=g.length;m<n;m++)f[g[m]]=null;g.length=0;m=c;for(n=Math.min(b.length,d);m<n;m++)k=b[m],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.L||(c.L=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.L&&(c.L=!1,e(!1,c.tag,c.index,c)),c.T&&(c.G=null,delete h[k]),delete f[k]);a.ga=!1;null!==a.F&&a.G()}
793
- olympe.dc.Ub.$k=class{constructor(){this.L={};this.na=[];this.F=null;this.ga=!1;this.T=[];this.da=null}P(){return null!==this.F}$(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.ga){var a=this.na,b=a.length,c=this.L,d;for(d=this.T.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.T.push(e.index);else{if(!e.$){var f=e,g=this.F;f.$=!0;f.G=hk(f,
794
- g)}null!==e.G&&gk(e.G,this.T)}}this.da&&this.da(this.T)}}Qf(a){this.da=a}C(a,b,c){let d=this.L[c];a?void 0===d?(d=new ik(this,c,b),this.L[c]=d):(d.tag=b,d.T=!1):void 0!==d&&(d.T=!0);return d}};olympe.dc.Ub.$k.va=[olympe.dc.Ub.Ba];olympe.dc.Ub.Ba=class{constructor(){}C(){}P(){}$(){}G(){}Qf(){}};function kk(a,b){olympe.D.nf(a.value)?(a.node=olympe.D.sm(a.value,b),bb(a.node)||b()):b()}function lk(a,b){if(olympe.D.nf(a.value)){const c=olympe.D.Ma(),d=a.L;olympe.D.pc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>kk(a,b)),olympe.D.Ma().destroy())})}}
795
- class mk extends olympe.dc.Ub.Pi{constructor(a,b,c){super(a);this.index=b;this.value=c;this.L=this.Ta();this.position=this.node=null;this.T=!1;this.G=null}Ta(){const a=olympe.D.Ta(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}gb(){return null===this.value}}
796
- function nk(a,b){if(!b.gb()){var c=a.F;var d=a.na,e=b.Ta(),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].L,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].L,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.L=b.Ta();if(c!==b.position){d=a.F;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.T&&a.G()}}}
797
- function ok(a){const b=a.na;a.F.sort((c,d)=>b(c.Ta(),d.Ta()))}
798
- olympe.dc.Ub.Ep=class{constructor(a){this.na=a;this.L=null;this.F=[];this.T=[];this.da=null;this.ga=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new mk(this,c,d),this.ga.set(b,f),this.P()?kk(f,()=>nk(this,f)):(f.position=e.length,e.push(f));else{f=this.ga.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ga.delete(b);null!==f.position&&(this.P()?this.remove(f):delete e[f.position]);f.destroy()}return f}P(){return null!==this.L}$(a){if(null!==this.L)throw Error('Manager already activated (depth='+
799
- this.L+')');this.L=a;ok(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;lk(d,()=>nk(this,d))}this.G()}G(){if(null===this.L)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.T.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.T){var b=e,c=this.L;b.T=!0;b.G=hk(b,c)}0>this.L?this.T.push(e.index):e.G&&gk(e.G,this.T)}this.da&&this.da(this.T)}Qf(a){this.da=a}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=
800
- a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.Ub.Ep.va=[olympe.dc.Ub.Ba];function Qj(a){if(!a.F){for(let b in a.G)pk(a.G[b]);a.F=!0}a.L=null;a.P=null}function Tj(a,b,c){a.G[c||'root'].T=b}function Uj(a,b,c){a.G[c||'root'].Hf(b)}function qk(a,b,c,d){const e=a.P,f=b+d+c;let g=e[f];void 0===g&&(g=Qf(a.db,b,c,d),e[f]=g);return g}function rk(a,b){a.F||a.C.Hf(b)}function sk(a,b,c,d,e){if(!a.F){let f=qk(a,c,d,e||olympe.dc.wa.DESTINATION);e||(f+=qk(a,c,d,olympe.dc.wa.ORIGIN));0===f&&rk(a,b)}}
801
- function tk(a,b){const c=a.G[b];void 0!==c?(a.K&&a.K.debug('Set current block to',b,null!==c.G?'parent = '+c.G.W():''),a.C=c):a.K&&a.K.error('Try to set a block that does not exists:',b)}function uk(a){const b=String(++a.T),c=a.C;a.G[b]=new vk(b,c);wk(c,b);c.L||(c.L=()=>tk(a,c.W()));return b}function xk(a,b){const c=a.C;a.C.L=()=>{tk(a,c.W());b()}}function yk(a,b){pk(b?a.G[b]:a.C)}
802
- olympe.dc.Ub.Fp=class{constructor(a,b){this.db=a;this.K=b||null;this.L=Object.create(null);this.P=Object.create(null);this.F=!1;this.T=0;this.C=new vk('root');this.G=Object.create(null);this.G.root=this.C}register(a,b,c,d,e){this.F||(null!==b&&c&&d&&e?(c=qk(this,c,d,e),d=this.L[b]||0,this.L[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function wk(a,b){null===a.F&&(a.F=Object.create(null));a.F[b]=!1}function pk(a){a.P=!0;null!==a.G&&a.G.notify(a.id)}
803
- class vk{constructor(a,b){this.id=a;this.G=b||null;this.C=this.T=this.L=this.F=null;this.P=!1}W(){return this.id}Hf(a){const b=this.T;if(this.P||this.C===a||null===a)b&&b(),!b&&pk(this)}notify(a){const b=this.L,c=this.F;if(this.P)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.Ua={};function zk(a,b,c,d){const e=olympe.dc.ta(),f=new olympe.dc.Ub.Ii,g=new olympe.dc.Ub.Fp(e);let h=!1;const k=Object.create(null),m=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,u)=>{a.Bc()||a.gb()||(h||(Tj(g,()=>{u.Hf();Qj(g)}),u.ge().Qf(m),h=!0),q?k[t]=r:delete k[t],Uj(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].C(a,g,n);const p=olympe.Z.hc();oe(e,b,(q,r)=>{g.register(p,null);const t=f.C(q,b,p,null);n(q,r,p,Vj(t,q,b,p))},p);a.onDestroy(()=>{ne(e,b,p)});e.Ia(b)||Qj(g)}
804
- function Ak(a,b,c){const d=c.getContext(),e=olympe.dc.ta(),f=a.G(),g=Bf(e,b,a.L,d.G(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>Cf(e,b,a.L,g))}
805
- olympe.dc.Ua.yh=class{constructor(a,b,c){this.L=a&&a.X?a.X():a;this.ba=b&&b.filter(d=>d instanceof olympe.dc.ba.se||d instanceof olympe.dc.ba.de)||null;this.F=c||null;this.defaultValue=null}ia(){}Hb(){}G(){}C(){return(this.ba||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}zg(a){this.defaultValue=a;return this}tg(){return this.ba}Bd(){return this.F}getValue(a,b){const c=a.run(()=>olympe.D.ec(this.Hb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&ub(c,this.defaultValue);
806
- b=this.F||b;null!==this.ba?zk(a,b,this.ba,d=>{Ak(this,d,c)}):Ak(this,b,c);return c.vb()}ha(a){const b=Yj(a,this.L),c=Yj(a,this.F);let d='null';this.ba&&(d=this.ba.map(function(e){return e.ha(a)}).join(','));return`{"c":"${this.ia()}","a":["${b}",${d},${c}]}`}toString(){const a=Xj(this.L),b=this.F?','+Xj(this.F):'';let c='';this.ba&&(c=','+this.ba.join(','));return this.ia().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.Ua.yh.va=[olympe.dc.Cj];olympe.dc.Ua.Km=class{constructor(a,b){if(olympe.D.nf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ta();const e=d.Tb(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.qg(e,olympe.dc.CloudObject.extendRel,olympe.dm.re);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.N.X():d=new olympe.dc.Ua.Zh(c,b);break;case olympe.dm.Number.N.X():d=new olympe.dc.Ua.Sh(c,
807
- b);break;case olympe.dm.Boolean.N.X():d=new olympe.dc.Ua.Ji(c,b);break;case olympe.dm.DateTime.N.X():d=new olympe.dc.Ua.Fh(c,b)}this.F=d}ia(){return this.F.ia()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ha(a){return this.F.ha(a)}toString(){return this.F.toString()}};olympe.dc.Ua.Km.va=[olympe.dc.Cj];olympe.dc.Ua.Ji=class extends olympe.dc.Ua.yh{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.Ua.Ji)}G(){return olympe.dc.Fb.Ll}Hb(){return olympe.D.ea}};S('olympe.dc.valuedefs.BooleanProperty',olympe.dc.Ua.Ji);olympe.dc.Ua.me=class{constructor(a){this.value=a}ia(){return T(olympe.dc.Ua.me)}C(){return[]}getValue(){return this.value}ha(a){a=Yj(a,this.value);return`{"c":"${this.ia()}","a":[${a}]}`}toString(){return`Constant(${Xj(this.value)})`}};S('olympe.dc.valuedefs.Constant',olympe.dc.Ua.me);olympe.dc.Ua.me.va=[olympe.dc.Cj];olympe.dc.Ua.Fh=class extends olympe.dc.Ua.yh{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.Ua.Fh)}G(){return olympe.dc.Fb.Ml}Hb(){return olympe.D.Za}};S('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.Ua.Fh);olympe.dc.Ua.Sh=class extends olympe.dc.Ua.yh{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.Ua.Sh)}G(){return olympe.dc.Fb.Nl}Hb(){return olympe.D.aa}};S('olympe.dc.valuedefs.NumberProperty',olympe.dc.Ua.Sh);olympe.dc.Ua.Zh=class extends olympe.dc.Ua.yh{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.Ua.Zh)}G(){return olympe.dc.Fb.Ol}Hb(){return olympe.D.Ka}};S('olympe.dc.valuedefs.StringProperty',olympe.dc.Ua.Zh);olympe.dc.Ua.ai=class{ia(){return T(olympe.dc.Ua.ai)}C(){return[]}getValue(a,b){return b}ha(){return'{"c":"'+this.ia()+'","a":[]}'}toString(){return'Tag()'}};S('olympe.dc.valuedefs.Tag',olympe.dc.Ua.ai);olympe.dc.Ua.ai.va=[olympe.dc.Cj];olympe.dc.ba={};olympe.dc.ba.Gh=class{Hb(){return null}ia(){return T(olympe.dc.ba.Gh)}C(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.C.C!==g||b.F||(b.C.C=f),c(!0,f,f,Vj(h,!0,f,f))):(d[f]++,rk(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,Vj(h,!1,f,f)))}}ha(){return'{"c":"'+this.ia()+'"}'}toString(){return'Distinct()'}};S('olympe.dc.transformers.Distinct',olympe.dc.ba.Gh);olympe.dc.ba.Gh.va=[olympe.dc.$e];olympe.dc.ba.Qe=class{constructor(a){this.F=a}Hb(){return null}ia(){return T(olympe.dc.ba.Qe)}G(){return this.F.F()}C(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&rk(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,Vj(h,k,f,g)))}const e={};return(f,g,h,k)=>{const m='@'+h;if(f){let n=this.F.C(a,g);olympe.D.Ya(n)&&(n=n.Aa);olympe.D.mf(n)?(b.F||void 0!==olympe.D.Ta(n)||rk(b,h),e[m]=n,a.run(()=>{olympe.D.pc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[m]&&(e[m].destroy(),delete e[m]),
808
- d(g,h,k,!1),delete e[h]}}ha(a){return'{"c":"'+this.ia()+'","a":['+this.F.ha(a)+']}'}toString(){return'Filter('+this.F.toString()+')'}};S('olympe.dc.transformers.Filter',olympe.dc.ba.Qe);olympe.dc.ba.Qe.va=[olympe.dc.$e,olympe.dc.Xo];olympe.dc.ba.Hk=class{constructor(a,b,c,d){this.F=new olympe.dc.Oa.Relation(olympe.dc.fa(a),c||olympe.dc.wa.DESTINATION);this.G=new olympe.dc.Oa.Relation(olympe.dc.fa(b),d||olympe.dc.wa.DESTINATION)}Hb(){return De(this.F)}ia(){return T(olympe.dc.ba.Hk)}C(a,b,c){const d=olympe.dc.ta(),e={},f=this.F.X(),g=this.F.Pa(),h=this.G.X(),k=this.G.Pa();let m=null,n=null;const p=(r,t,u,w,x,y)=>{if(x){if(x=()=>{const z=olympe.Z.nb(u+g+(f+'_'+r)+y,20),A=Vj(t,!0,y,z);m=r;n=()=>{c(!1,y,z,Vj(t,!1,y,z))};b.register(z,
809
- u,w,f,g);c(!0,y,z,A)},x.vq=r,e[w]=x,null===m||r<m)n&&n(),x()}else if(m===r){n();e[w]=!0;x=Infinity;let z=null;for(let A=Object.keys(e),M=A.length,K=0;K<M;K++){let pa=e[A[K]];pa.vq<x&&(x=pa.vq,z=pa)}z&&z()}},q=(r,t,u,w,x)=>{w?e[x]||(e[x]=!0,sk(b,u,x,f,g),sk(b,u,x,h,k),W(d,x,this.F,p.bind(this,r,t,u,x),u+'_val'),W(d,x,this.G,q.bind(this,r+1,t,u),u+'_follow')):(d.F(x,this.G,u+'_follow'),d.F(x,this.F,u+'_val'),delete e[x])};return(r,t,u,w)=>q(0,w,u,r,t)}ha(){return'{"c":"'+this.ia()+'","a":["'+this.F.toString()+
810
- '","'+this.G.toString()+'"]}'}toString(){return'FirstRelated('+this.F.toString()+', '+this.G.toString()+')'}};S('olympe.dc.transformers.FirstRelated',olympe.dc.ba.Hk);olympe.dc.ba.Hk.va=[olympe.dc.$e];olympe.dc.ba.Mg=class{constructor(a,b){this.start=a;this.F=b}Hb(){return null}ia(){return T(olympe.dc.ba.Mg)}C(a,b,c){const d=new olympe.dc.Ub.$k;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.F||(b.C.C=e[0>n-1?0:Math.min(e.length,n)-1]);jk(d,e,f,n,c)}};a.run(()=>olympe.D.pc([this.start,this.F],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));xk(b,k);const m=uk(b);tk(b,m);return(n,p,q,r)=>{h||(r.ge().Qf(t=>{e=t;yk(b,m)}),Tj(b,()=>r.Hf(),m),h=!0);d.C(n,p,q,null);Uj(b,q,m)}}ha(a){return'{"c":"'+
811
- this.ia()+'","a":['+Yj(a,this.start)+','+Yj(a,this.F)+']}'}toString(){return`Limit(${olympe.D.Ta(this.start)},${olympe.D.Ta(this.F)})`}};S('olympe.dc.transformers.Limit',olympe.dc.ba.Mg);olympe.dc.ba.Mg.va=[olympe.dc.$e];function Bk(a){return a.F.map(b=>b.X())}
812
- olympe.dc.ba.aj=class{constructor(a,b){this.direction=b||olympe.dc.wa.DESTINATION;this.F=a.map(c=>new olympe.dc.Oa.Relation(c,this.direction))}Hb(){return olympe.dc.CloudObject}ia(){return T(olympe.dc.ba.aj)}Pa(){return this.direction}C(a,b,c){const d=olympe.dc.ta(),e=(f,g,h,k)=>W(d,f,k,(m,n)=>{var p=k.X();p=olympe.Z.nb(g+k.Pa()+p+n,20);const q=Vj(h,m,n,p);m&&b.register(p,g,f,k.X(),k.Pa());c(m,n,p,q)},g);return(f,g,h,k)=>{f?this.F.forEach(m=>{sk(b,h,g,m.X(),m.Pa());e(g,h,k,m)}):this.F.forEach(m=>
813
- {d.F(g,m,h)})}}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(Bk(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Pa()+'['+Bk(this).join(',')+'])'}};S('olympe.dc.transformers.MultiRelated',olympe.dc.ba.aj);olympe.dc.ba.aj.va=[olympe.dc.$e];olympe.dc.ba.de=class extends olympe.dc.Oa.Relation{constructor(a,b=olympe.dc.wa.DESTINATION,c=1,d=-1){super(a,b);this.G=c;this.F=d}Hb(){return De(this)}ia(){return T(olympe.dc.ba.de)}C(a,b,c){const d=olympe.dc.ta(),e=Object.create(null),f=olympe.dc.wa.ORIGIN,g=olympe.dc.wa.DESTINATION,h=this.X(),k=this.Pa(),m=(p,q,r)=>{if(!(0<=this.F&&p>=this.F)){var t=d.ib(r,this);p+=1;for(let u=0,w=t.length;u<w;u++){if(void 0!==e[t[u]]||r===t[u])continue;const x=olympe.Z.nb(q+k+(h+'_'+p)+t[u],20);b.register(x,
814
- q,r,h,k||g);null===k&&b.register(x,q,r,h,f)}}},n=(p,q,r,t,u,w)=>{u&&!b.F&&m(p,t,w);p>=this.G?c(u,w,t,Vj(r,u,w,t)):sk(b,t,w,h,k);0<=this.F&&p>=this.F||(u?e[w]||(e[w]=!0,W(d,w,this,(x,y)=>{const z=p+1,A=olympe.Z.nb(t+k+(h+'_'+z)+y,20);n(z,w,r,A,x,y)},t)):(d.F(w,this,t),delete e[w]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ha(){return'{"c":"'+this.ia()+'","a":["'+this.X()+'","'+this.Pa()+'",'+this.G+','+this.F+']}'}toString(){return'RecursiveRelated('+this.Pa()+this.X()+'['+this.G+'..'+this.F+'])'}};
815
- S('olympe.dc.transformers.RecursiveRelated',olympe.dc.ba.de);olympe.dc.ba.de.va=[olympe.dc.$e];olympe.dc.ba.se=class extends olympe.dc.Oa.Relation{constructor(a,b){super(a,b||olympe.dc.wa.DESTINATION)}Hb(){return De(this)}ia(){return T(olympe.dc.ba.se)}Rb(){return new olympe.dc.ba.se(this.tag,this.direction===olympe.dc.wa.DESTINATION?olympe.dc.wa.ORIGIN:olympe.dc.wa.DESTINATION)}C(a,b,c){const d=olympe.dc.ta(),e=this.X(),f=this.Pa();return(g,h,k,m)=>{sk(b,k,h,e,f);g?W(d,h,this,(n,p)=>{const q=olympe.Z.nb(k+f+e+p,20),r=Vj(m,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.F(h,this,k)}}ha(){return'{"c":"'+
816
- this.ia()+'","a":["'+this.X()+'","'+this.Pa()+'"]}'}toString(){return'Related('+this.Pa()+this.X()+')'}};S('olympe.dc.transformers.Related',olympe.dc.ba.se);olympe.dc.ba.se.va=[olympe.dc.$e];olympe.dc.ba.gg=class{constructor(a,b){this.yb=a;this.F=void 0===b?!0:!!b}Hb(){return null}ia(){return T(olympe.dc.ba.gg)}ng(){return this.yb}G(){return[this.yb.P()]}C(a,b,c){const d=new olympe.dc.Ub.Ep(a.G(this.F?this.yb.G.bind(this.yb):(e,f)=>this.yb.G(f,e)));return(e,f,g)=>{var h=e?this.yb.L(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ha(a){return'{"c":"'+this.ia()+'","a":['+this.yb.ha(a)+','+JSON.stringify(this.F)+']}'}toString(){return'Sort('+this.yb.toString()+','+JSON.stringify(this.F)+')'}};
817
- S('olympe.dc.transformers.Sort',olympe.dc.ba.gg);olympe.dc.ba.gg.va=[olympe.dc.$e,olympe.dc.Xo];function Ck(a,b,c,d,e,f){function g(n,p){if(m)for(var q=m.length-1;0<=q;q--)f=m[q].C(b,e,f);e.register(h,null);q=d.C(n,p,c,null);f(n,p,h,Vj(q,n,p,h))}const h=olympe.Z.hc(),k=olympe.dc.ta(),m=a.ba;b.run(()=>olympe.D.pc([a.F],n=>{Dk(k,n,g,h);void 0===k.model(n)&&Qj(e)}))}function Dk(a,b,c,d){const e=b&&b.valueOf();e&&(oe(a,e,c,d),olympe.D.Ma().$(()=>ne(a,e,d)))}
818
- olympe.dc.ba.af=class{constructor(a,b){this.ba=this.F=null;a instanceof olympe.dc.ua?(this.F=a.Bd(),this.ba=a.Vk()):(this.F=a,b&&(this.ba=b))}Hb(){return null}ia(){return T(olympe.dc.ba.af)||''}tg(){return this.ba}Bd(){return this.F}C(a,b,c){const d=new olympe.dc.Ub.$k,e=new olympe.dc.Ub.Ii;let f=[],g=[],h=!1,k=!1;const m=uk(b),n=uk(b);xk(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):yk(b);jk(d,p,0,p.length,c)});tk(b,n);Ck(this,a,this.F,e,b,(p,q,r,t)=>{const u=olympe.D.Ma();u.Bc()||
819
- u.gb()||(k||(t.ge().Qf(w=>{g=w;yk(b,n)}),Tj(b,()=>t.Hf(),n),k=!0),d.C(p,q,r),Uj(b,r,n))});tk(b,m);return(p,q,r,t)=>{h||(t.ge().Qf(u=>{f=u;yk(b,m)}),Tj(b,()=>t.Hf(),m),h=!0);d.C(p,q,r,m);Uj(b,r,m)}}ha(a){const b=this.ba?'['+this.ba.map(c=>c.ha(a)).join(',')+']':'null';return'{"c":"'+this.ia()+'","a":['+Yj(a,this.F)+','+b+']}'}toString(){const a=olympe.D.Ya(this.F)?'N:'+this.F.Aa.W():this.F.valueOf(),b=this.ba?','+this.ba.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
820
- S('olympe.dc.transformers.Union',olympe.dc.ba.af);olympe.dc.ba.af.va=[olympe.dc.$e];olympe.dc.ba.mp={gy:1,Kr:-1,Jr:0};olympe.dc.ba.Gz={Jw:!0,lx:!1};olympe.dc.ic.R={oo:'dc.legacy.listdefProcessor'};olympe.V.config(a=>{D(a,olympe.dc.ic.R.oo,olympe.dc.ic.Es,olympe.dc.query.R.za,olympe.dc.R.Oe,olympe.dc.transaction.R.Ga,olympe.dc.query.R.lj,new olympe.V.ma(olympe.dc.U.Wg))});olympe.V.run([olympe.dc.ic.R.oo],a=>{olympe.dc.ic.$u=()=>a});function Ek(a){const b=olympe.dc.ta(),c=new Map;b.pq(a).forEach(d=>{b.ib(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
821
- olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ta();this.model=null}static Ec(a,b,c,...d){b=olympe.dc.fa(b);var e=qe.get(b)||null;(e=e&&e.C)?e(a,c,...d):(a=a.create(b),void 0!==c&&null!==c&&Z(a,olympe.dc.CloudObject.nameProp,c),a.X())}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.qq();a=olympe.dc.fa(a);var c=pe(b,b.db.model(a));if(null===c)throw new olympe.dc.Mo(a);c=c.instantiate(a,b.F);Object.defineProperty(c,'tag',{value:a,writable:!1});
822
- b.C.C.ub([a]);b.Oa.register(c,a);b=c}return b}static exists(a){return olympe.dc.ta().Ia(olympe.dc.fa(a))}static fq(a,b,c){if('undefined'===typeof olympe.sc)throw Error('Method CloudObject.createWith should only be used at runtime, when sc package exists');const d=olympe.dc.ta();let e=null;const f=h=>{null===e&&(e=Ek(b||this));return e.has(h)?e.get(h):null},g=new Map;a.forEach((h,k)=>{d.Ia(olympe.dc.fa(k))?g.set(k,h):(k=f(k))&&g.set(k,h)});a=new olympe.sc.Sa(!1);c=a.create(null!=b?b:this,g,c);a.lb().catch(h=>
823
- olympe.la.fb('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${h}`));return this.get(c)}static Xt(){return this.get(this)}static Vj(a){return olympe.dc.ra.Vj(a)}static Cb(){return olympe.dc.ta().ib(this,olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Oa.Property(a))}static he(){const a=olympe.dc.ta();return a.ib(this,olympe.dc.CloudObject.xi).map(b=>new olympe.dc.Oa.Relation(b)).concat(a.ib(this,olympe.dc.CloudObject.jq).map(b=>new olympe.dc.Oa.Relation(b,olympe.dc.wa.ORIGIN)))}static Ge(a){return olympe.dc.CloudObject.get(a)}static Vu(a){var b=
824
- pe(olympe.dc.qq(),olympe.dc.fa(a));b=b&&b.F;return new olympe.dc.ua(olympe.dc.fa(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}ia(){return this.rb(olympe.dc.CloudObject.nameProp)}Dd(){this.model||(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.ra.from(this)}Of(){return this.db.Of(this)}zb(){return this.db.source(this)}Wu(){return this.db.si(this)?olympe.dc.Fd().fromModel(this):null}oq(){return olympe.D.sa([this.ia()],
825
- a=>olympe.D.sb(a),olympe.D.Ka,'getDisplayName',olympe.D.sb('('+this.toString()+')'))}nc(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.F?a.F():a;return new rxjs.Observable(e=>{const f=this.db.Qa(this.tag,b);c||null!==f||e.next(f);const g=Bf(this.db,this.tag,b,h=>{null===h||void 0===h?e.next(null):e.next(h)});d.$(()=>{e.complete();Cf(this.db,this.tag,b,g)});return()=>Cf(this.db,this.tag,b,g)})}bw(a){const b='function'===typeof a.F?a.F():a;return new rxjs.Observable(c=>
826
- {const d=Df(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Oa.Property(e),null]):c.next([new olympe.dc.Oa.Property(e),f])});b.$(()=>{c.complete();Ef(this.db,this.tag,d)});return()=>Ef(this.db,this.tag,d)})}cw(a){return this.observe(olympe.D.Ma(),a)}get(a){return this.db.Qa(this.tag,a)}Qa(a){return this.get(a)}eb(a){return olympe.dc.ra.from(this).eb(a)}Ij(a){return olympe.dc.Nc.from(this).eb(a)}Du(){return this.Yb(olympe.dc.CloudObject.au,olympe.dc.CloudObject)}Wl(){return this.ib(olympe.dc.CloudObject.containsRel,
827
- olympe.dc.CloudObject)}kf(a,b,c){const d=olympe.D.ec(c,'Sync valueType'),e=Bf(this.db,this.tag,a,olympe.D.Ma().G(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>Cf(this.db,this.tag,a,e));return d.getContext()}rb(a){return N(this.kf(a,olympe.dc.Fb.Ol,olympe.D.Ka))}Gc(a){return N(this.kf(a,olympe.dc.Fb.Nl,olympe.D.aa))}oh(a){return N(this.kf(a,olympe.dc.Fb.Ll,olympe.D.ea))}mi(a){return N(this.kf(a,olympe.dc.Fb.Ml,olympe.D.Za))}tq(){return N(this.kf(olympe.dm.Color.valueProp,
828
- olympe.dc.Fb.$p,olympe.D.Color))}uq(){return N(this.kf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.Fb.aq,olympe.dc.CloudObject))}ib(a,b){a=a instanceof olympe.dc.ba.se?a:new olympe.dc.ba.se(a.X(),a.Pa());return new olympe.dc.ua(this.X(),a,b)}Yb(a,b){return this.ib(a,b).xc()}mq(a,b){const c=this.db,d=olympe.Z.hc(),e=olympe.D.Ma(),f=new Map;W(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(()=>
829
- {c.F(this.tag,a,d)})}Bw(){return new olympe.dc.ua(this.X(),[],Be(this.X()))}transform(...a){return(new olympe.dc.ua(this.X(),[],this.constructor)).transform(...a)}yc(){return this.oq()}toString(){if(!this.db.Ia(this.tag))return`unknown object #${this.tag||'NULL_TAG'}`;const a=this.db.model(this.tag);var b=this.db.name(this);b=b?` instanceName: '${b}'`:'';return a?`${this.db.name(a)}#${this.tag}${b}`:`orphan object (no model) #${this.tag}${b}`}toJSON(){if(!this.db.Ia(this.tag))return{CloudObject:'Unknown tag'};
830
- const a=this.db.model(this.tag),b=this.db.name(a),c=this.db.name(this.tag);return{CloudObject:this.tag,Name:c,Model:`${b} (${a})`}}Cc(a=!1,b=!0){const c={};this.db.Cb(this,b).forEach((d,e)=>{e=a?this.db.name(e):e;c[e]=d instanceof olympe.dc.lc?me(d):d});return c}Ha(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():!1}ad(a){return olympe.D.sa([a],b=>olympe.D.Ib(this.Ha(b)),olympe.D.ea)}gu(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Sa,c=!0;const d=olympe.dc.wa.ORIGIN;
831
- for(const [e,f,g]of Of(b,this))f===d?a.Xb(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.Xb(e,this,g);a.delete(this,olympe.dc.Ob.NONE);c&&a.lb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Ha;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Cc;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.Ij;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.eb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Qa;
832
- olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.cw;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.bw;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.nc;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.zb;
833
- olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Of;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Dd;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.Vu;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Ge;
834
- olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.he;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Cb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Vj;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Xt;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.fq;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.N=olympe.dc.ka.C('ff021000000000000001',olympe.dc.CloudObject);
835
- olympe.dc.CloudObject.PB=olympe.dc.CloudObject.N.ja(olympe.dc.jo.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.N.ja('ff023000000000000011');B('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.AB=olympe.dc.CloudObject.N.ja('ff023000000000000012');olympe.dc.CloudObject.xi=olympe.dc.CloudObject.N.pa('ff02200000000000000a');olympe.dc.CloudObject.jq=olympe.dc.CloudObject.N.pa('ff02200000000000000b',olympe.dc.wa.ORIGIN);olympe.dc.CloudObject.hB=olympe.dc.CloudObject.N.pa('017e9c4ba4c847d71cbf');
836
- olympe.dc.CloudObject.ZA=olympe.dc.CloudObject.N.pa('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.N.pa('ff02200000000000000c');B('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.N.pa('ff02200000000000000d',olympe.dc.wa.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.N.pa(olympe.dc.mc.nd);B('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);
837
- olympe.dc.CloudObject.instancesRel=U(olympe.dc.CloudObject.N,olympe.dc.CloudObject.modelRel);B('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.N.pa(olympe.dc.mc.Hh);B('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=U(olympe.dc.CloudObject.N,olympe.dc.CloudObject.extendRel);B('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);
838
- olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.N.pa(olympe.dc.mc.Li);B('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.au=U(olympe.dc.CloudObject.N,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.fu=olympe.dc.CloudObject.N.pa('018282d3ac0a474a0bf4');B('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.fu);olympe.dc.Iz=olympe.dc.CloudObject;olympe.dc.CloudObject.va=[olympe.dc.pe];l=olympe.dc.CloudObject.prototype;
839
- l.X.J=new olympe.D.H(()=>String,[]);l.name.J=new olympe.D.H(()=>String,[]);l.ia.J=olympe.D.H.F;l.Dd.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.zb.J=new olympe.D.H(()=>String,[]);l.Wu.J=new olympe.D.H(()=>String,[]);l.oq.J=olympe.D.H.F;l.nc.J=new olympe.D.H(()=>String,[]);l.Du.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Wl.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.kf.J=new olympe.D.H(()=>olympe.D.Node,[]);l.rb.J=olympe.D.H.F;l.Gc.J=olympe.D.H.G;l.oh.J=olympe.D.H.P;
840
- l.mi.J=new olympe.D.H(()=>olympe.D.Za,[]);l.tq.J=new olympe.D.H(()=>olympe.D.Color,[]);l.uq.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.ib.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Yb.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.mq.J=new olympe.D.H(()=>Function,[]);l.Bw.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.transform.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.yc.J=olympe.D.H.F;l.toString.J=olympe.D.H.C;l.Ha.J=olympe.D.H.C;l.ad.J=olympe.D.H.P;l.gu.J=new olympe.D.H(()=>{},[]);olympe.dc.R={Oe:'dc.DBView',fo:'dc.InstanceManager',za:'dc.Logger',wt:'dc.TransactionLogger',Qi:'dc.FileServiceManager',Tg:'dc.Router'};olympe.dc.U={eg:'dc.tag',kp:'dc.routing',uf:'dc.debug',Wg:'dc.subscribeAll',zk:'dc.defaultSource',Gn:'dc.fileCache',Dn:'dc.errorOnAbstractInstantiation'};
841
- olympe.V.config(function(a){F(a,olympe.dc.U.uf,!1);F(a,olympe.dc.U.kp,{});F(a,olympe.dc.U.Wg,!1);F(a,olympe.dc.U.zk,olympe.dc.Ra.SERVER);F(a,olympe.dc.U.Gn,!1);F(a,olympe.dc.U.Dn,!0);F(a,olympe.dc.U.eg,olympe.Z.hc());E(a,olympe.dc.R.za,[olympe.la.R.Ga],b=>b.Fc('dc'));va(a,olympe.dc.R.wt,olympe.dc.transaction.R.za);va(a,olympe.dc.R.Oe,olympe.dc.db.R.wk);D(a,olympe.dc.R.Qi,olympe.dc.zr,olympe.dc.R.za,olympe.dc.R.Oe,olympe.net.R.Ga,olympe.dc.R.Tg,olympe.Z.R.Cg,new olympe.V.ma(olympe.dc.U.Gn));D(a,olympe.dc.R.Tg,
842
- olympe.dc.Wh,olympe.dc.R.za,olympe.auth.R.Ga,olympe.dc.sources.R.gp,olympe.dc.sources.R.up,olympe.dc.R.Oe,olympe.host.R.Xe,new olympe.V.ma(olympe.dc.U.eg),new olympe.V.ma(olympe.dc.U.kp));D(a,olympe.dc.R.fo,olympe.dc.Sr,olympe.dc.db.R.Ik,olympe.dc.db.R.Ga,olympe.V.R.Sf)},'olympe.dc');
843
- olympe.V.run([olympe.dc.db.R.Ga,olympe.dc.transaction.R.Ga,olympe.dc.R.fo,olympe.dc.R.Qi,new olympe.V.ma(olympe.dc.U.eg)],(a,b,c,d,e)=>{olympe.dc.Xl=()=>a;olympe.dc.ph=()=>b;olympe.dc.qq=()=>c;olympe.dc.vB=()=>d;olympe.dc.Ra.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.fk={NONE:0,px:1,lr:2,qx:4,mx:8,ox:16,nx:31,Py:32,My:64,Qy:128,Ny:256,Qs:512,Oy:992,hy:1023};olympe.dm.pd=class extends olympe.dc.CloudObject{ia(){return this.rb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Ka.EMPTY}F(){return olympe.D.ea.C}};olympe.dm.pd.N=olympe.dc.ka.C('ff021000000000000002',olympe.dm.pd);olympe.dm.pd.P=olympe.dm.pd.N.ja('ff023000000000000035');olympe.dm.pd.C=olympe.dm.pd.N.pa('ff022000000000000005');olympe.dm.pd.G=Ae('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.pd.L=Ae('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
844
- olympe.dm.pd.F=Ae('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.pd.prototype.ia.J=olympe.D.H.F;olympe.dm.pd.prototype.C.J=olympe.D.H.F;olympe.dm.pd.prototype.F.J=olympe.D.H.P;olympe.dm.User=class extends olympe.dc.CloudObject{Qu(){return this.$l()}ia(){return this.$l()}$l(){return this.rb(olympe.dm.User.loginProp)}gs(){return this.rb(olympe.dm.User.F)}es(){return olympe.D.Ka.EMPTY}qv(){return this.rb(olympe.dm.User.saltProp)}Cv(){return this.rb(olympe.dm.User.verifierProp)}ov(){return this.ib(olympe.dm.User.G,olympe.dm.pd)}};olympe.dm.User.N=olympe.dc.ka.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.N.ja('ff023000000000000001');
775
+ a.toString()).join(',')+')'}};S('olympe.dc.predicates.And',olympe.dc.Y.kd);olympe.dc.Y.kd.va=[olympe.dc.Ca];olympe.dc.Y.qk=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return a.run(()=>olympe.D.sa([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.D.Ib((Number(c)&Number(d.valueOf()))===Number(c))},olympe.D.ea))}ia(){return T(olympe.dc.Y.qk)}F(){return[this.value.C()]}ha(a){const b=olympe.D.Ya(this.G)?this.G.Aa.xb.valueOf():this.G.valueOf();return'{"c":"'+this.ia()+'","a":['+b+','+this.value.ha(a)+']}'}toString(){const a=olympe.D.Ya(this.G)?this.G.Aa.xb.valueOf():this.G.valueOf();
776
+ return this.ia().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};S('olympe.dc.predicates.BitMask',olympe.dc.Y.qk);olympe.dc.Y.qk.va=[olympe.dc.Ca];olympe.dc.Y.Ne=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}ia(){return T(olympe.dc.Y.Ne)}F(){return[this.source.C(),this.value.C()]}Gb(){return this.source}getValue(){return this.value}C(a,b){return a.run(()=>olympe.D.sa([this.source.getValue(a,b),this.value.getValue(a,b),this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Ib(c.includes(d))},olympe.D.ea))}ha(a){const b=this.source.ha(a),c=this.value.ha(a);a=Xj(a,this.G);
777
+ return'{"c":"'+this.ia()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Wj(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};S('olympe.dc.predicates.Contains',olympe.dc.Y.Ne);olympe.dc.Y.Ne.va=[olympe.dc.Ca];olympe.dc.Y.Yd=class{constructor(a,b){this.G=a;this.L=b}ia(){return T(olympe.dc.Y.Yd)}F(){return[this.G.C(),this.L.C()]}C(a,b){return a.run(()=>olympe.D.sa([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.bd?c.bd(d):'object'===typeof d&&void 0!==d.bd?d.bd(c):olympe.D.Ib(c.valueOf()===d.valueOf()),olympe.D.ea,'Test equal predicate'))}ha(a){return'{"c":"'+this.ia()+'","a":['+this.G.ha(a)+','+this.L.ha(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.L.toString()+
778
+ ')'}};S('olympe.dc.predicates.Equals',olympe.dc.Y.Yd);olympe.dc.Y.Yd.va=[olympe.dc.Ca];olympe.dc.Y.ur=class extends olympe.dc.Y.Yd{constructor(a,b){super(a,new olympe.dc.Ua.ne(b))}};olympe.dc.Y.ur.va=[olympe.dc.Ca];olympe.dc.Y.Ti=class extends olympe.dc.Y.hk{constructor(a,b){super(a,b)}ia(){return T(olympe.dc.Y.Ti)}P(a,b){return a>b}};S('olympe.dc.predicates.Greater',olympe.dc.Y.Ti);olympe.dc.Y.Mh=class{constructor(a,b,c){this.G=[];this.L=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.ce?this.G.push(new ak(c.X(),c.Pa(),c.G,c.F)):this.G.push(new ak(olympe.dc.fa(c),b[d],1,1))}ia(){return T(olympe.dc.Y.Mh)}F(){return[this.G.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>vb(olympe.D.cc(Boolean),!1)),d=olympe.Z.hc(),e=olympe.dc.ta();let f=0;a=(h,k)=>{0!==this.L.length&&!this.L.includes(k)||
779
+ c.getContext().gb()||c.getContext().Bc()||(f+=h?1:-1,c.update(0<f))};const g=this.G;for(let h=g.length-1;0<=h;h--)a=bk(g[h],e,a,d+h);pe(e,b,a,d);c.getContext().onDestroy(()=>{oe(e,b,d)});return c.vb()}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(this.G.map(a=>a.ha()))+(0!==this.L.length?',"'+this.L.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.L.length?'#'+this.L.toString()+', ':'')+this.G.map(a=>a.ha())+')'}};S('olympe.dc.predicates.HasRelated',olympe.dc.Y.Mh);
780
+ function bk(a,b,c,d){const e=Object.create(null);d+=olympe.Z.kh();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var m=d+k;g?e[h]||(e[h]=!0,W(b,h,a,(n,p)=>{f(n,p,k+1)},m)):(delete e[h],b.F(h,a,m))}};return(g,h)=>f(g,h,0)}class ak extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ha(){return`${this.X()}, ${this.Pa()}, ${this.F}, ${this.C}`}}olympe.dc.Y.Mh.va=[olympe.dc.Ca];olympe.dc.Y.Pk=class{constructor(a,b,c){this.G=[];this.L=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.ce?this.G.push(new ck(c.X(),c.Pa(),c.G,c.F)):this.G.push(new ck(olympe.dc.fa(c),b[d],1,1))}ia(){return T(olympe.dc.Y.Pk)}F(){return[this.G.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>vb(olympe.D.cc(Boolean),!1)),d=olympe.dc.ta(),e=olympe.Z.kh();let f=(k,m,n)=>{m&&(null===this.L||this.L.includes(n))&&k(1)};
781
+ const g=this.G;for(let k=g.length-1;0<=k;k--)f=dk(g[k],d,f,e+k);let h=0;pe(d,b,f.bind(null,k=>{c.getContext().Bc()||c.getContext().gb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>oe(d,b,e));return c.vb()}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(this.G.map(a=>a.ha()))+(null!==this.L?',"'+this.L.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.L?'#['+this.L.toString()+'], ':'')+this.G.map(a=>a.ha())+')'}};S('olympe.dc.predicates.HasRelatedTree',olympe.dc.Y.Pk);
782
+ function dk(a,b,c,d){const e=a.G,f=a.P,g=new Set,h=(m,n,p)=>{f.has(n)?f.get(n).set(d+p,m):f.set(n,(new Map).set(d+p,m))},k=(m,n,p,q,r)=>{const t=olympe.Z.kh();if(q){const u=p+r,w=x=>{const y=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!==y&&null!==y&&(g.add(u),e.set(r,(e.get(r)||0)+x),Array.from(y.values()).forEach(z=>z(x)));g.delete(u)};h(m,r,p);e.has(r)?m(e.get(r)):(n>=a.F&&c(x=>
783
+ {e.set(r,(e.get(r)||0)+x);m(x)},q,r),(0>a.C||n<=a.C)&&r!==p&&W(b,r,a,k.bind(a,w,n+1,r),t))}else m(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.F(r,a,t))};return(m,n,p)=>k(m,0,'origin',n,p)}class ck extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.P=new Map;this.G=new Map}ha(){return`${this.X()}, ${this.Pa()}, ${this.F}, ${this.C}`}}olympe.dc.Y.Pk.va=[olympe.dc.Ca];olympe.dc.Y.Qh=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.fa(b))}):this.G.add(olympe.dc.fa(a))}ia(){return T(olympe.dc.Y.Qh)}F(){return[]}C(a,b){const c=a.run(()=>vb(olympe.D.cc(olympe.D.ea),olympe.D.ea.C)),d=olympe.dc.ta();let e=[];const f=()=>{e.forEach(h=>{d.F(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.fa(olympe.dc.CloudObject))c.update(olympe.D.Ib(this.G.has(k))),f();else{for(const m of e)if(m.tag===k)throw Error(`You should never extend a model to itself (${k})`);
784
+ this.G.has(k)?(c.update(olympe.D.ea.F),f()):(h=new ek(k,olympe.dc.CloudObject.extendRel),e.push(h),W(d,h.tag,h.relation,g,h.id))}};a=new ek(b,olympe.dc.CloudObject.modelRel);e.push(a);W(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.vb()}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class ek{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.Z.kh()}}
785
+ S('olympe.dc.predicates.InstanceOf',olympe.dc.Y.Qh);olympe.dc.Y.Qh.va=[olympe.dc.Ca];olympe.dc.Y.Kd=class{constructor(a){this.G=a}ia(){return T(olympe.dc.Y.Kd)}F(){return this.G.F()}C(a,b){return a.run(()=>olympe.D.sa([this.G.C(a,b)],c=>olympe.D.Ib(!c.valueOf()),olympe.D.ea))}ha(a){return`{"c":"${this.ia()}","a":[${this.G.ha(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};S('olympe.dc.predicates.Not',olympe.dc.Y.Kd);olympe.dc.Y.Kd.va=[olympe.dc.Ca];olympe.dc.Y.be=class{constructor(a){this.Y=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Y=this.Y.concat(arguments[c]):this.Y.push(arguments[c])}ia(){return T(olympe.dc.Y.be)}F(){return this.Y.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.sa(this.Y.map(c=>c.C(a,b)),(...c)=>olympe.D.Ib(c.some(d=>d.valueOf())),olympe.D.ea))}ha(a){const b=this.Y.map(c=>c.ha(a));return'{"c":"'+this.ia()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.Y.map(a=>a.toString()).join(',')+
786
+ ')'}};S('olympe.dc.predicates.Or',olympe.dc.Y.be);olympe.dc.Y.be.va=[olympe.dc.Ca];olympe.dc.Y.Ye=class{constructor(a,b,c){this.source=a;this.L=b;this.G=void 0===c?!0:c}ia(){return T(olympe.dc.Y.Ye)}F(){return[this.source.C()]}Gb(){return this.source}C(a,b){return a.run(()=>olympe.D.sa([this.source.getValue(a,b),this.L,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Ib((new RegExp(d)).test(c))},olympe.D.ea))}ha(a){const b=this.source.ha(a),c=Xj(a,this.L);a=Xj(a,this.G);return'{"c":"'+this.ia()+'","a":['+b+','+c+','+a+
787
+ ']}'}toString(){const a=Wj(this.G);return'Regex('+this.source.toString()+','+this.L+','+a+')'}};S('olympe.dc.predicates.Regex',olympe.dc.Y.Ye);olympe.dc.Y.Ye.va=[olympe.dc.Ca];olympe.dc.Y.wj=class extends olympe.dc.Y.hk{constructor(a,b){super(a,b)}ia(){return T(olympe.dc.Y.wj)}P(a,b){return a<b}};S('olympe.dc.predicates.Smaller',olympe.dc.Y.wj);olympe.dc.Tb={};olympe.dc.Tb.Ii=class{constructor(){this.T=this.L=this.index=this.F=null}P(){return null!==this.F}$(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.L;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.Tb.Pi(this),this.index=c,this.L=b):this.L=this.index=null;return b}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.T){const a=
788
+ [];null!==this.L&&(0<=this.F?fk(gk(this.L,this.F),a):a.push(this.index));this.T(a)}}Qf(a){this.T=a}};olympe.dc.Tb.Ii.va=[olympe.dc.Tb.Ba];function Uj(a,b,c,d){b?a.P[d]=c:delete a.P[d];null===a.F&&(a.F=new olympe.dc.Tb.Pi(a.C,a));return a.F}function gk(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function fk(a,b){a=a.P;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.Tb.Pi=class{constructor(a,b){this.C=a;this.depth=b?b.depth+1:0;this.P=Object.create(null);this.F=null}he(){return this.C}If(){this.C.P()?this.C.G():this.C.$(this.depth-1)}};class hk extends olympe.dc.Tb.Pi{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.$=this.T=this.L=!1;this.G=null}}
789
+ function ik(a,b,c,d,e){const f=Object.create(null),g=a.na,h=a.L;let k,m,n;a.ga=!0;m=0;for(n=g.length;m<n;m++)f[g[m]]=null;g.length=0;m=c;for(n=Math.min(b.length,d);m<n;m++)k=b[m],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.L||(c.L=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.L&&(c.L=!1,e(!1,c.tag,c.index,c)),c.T&&(c.G=null,delete h[k]),delete f[k]);a.ga=!1;null!==a.F&&a.G()}
790
+ olympe.dc.Tb.Zk=class{constructor(){this.L={};this.na=[];this.F=null;this.ga=!1;this.T=[];this.da=null}P(){return null!==this.F}$(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.ga){var a=this.na,b=a.length,c=this.L,d;for(d=this.T.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.T.push(e.index);else{if(!e.$){var f=e,g=this.F;f.$=!0;f.G=gk(f,
791
+ g)}null!==e.G&&fk(e.G,this.T)}}this.da&&this.da(this.T)}}Qf(a){this.da=a}C(a,b,c){let d=this.L[c];a?void 0===d?(d=new hk(this,c,b),this.L[c]=d):(d.tag=b,d.T=!1):void 0!==d&&(d.T=!0);return d}};olympe.dc.Tb.Zk.va=[olympe.dc.Tb.Ba];olympe.dc.Tb.Ba=class{constructor(){}C(){}P(){}$(){}G(){}Qf(){}};function jk(a,b){olympe.D.nf(a.value)?(a.node=olympe.D.qm(a.value,b),bb(a.node)||b()):b()}function kk(a,b){if(olympe.D.nf(a.value)){const c=olympe.D.Ma(),d=a.L;olympe.D.qc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>jk(a,b)),olympe.D.Ma().destroy())})}}
792
+ class lk extends olympe.dc.Tb.Pi{constructor(a,b,c){super(a);this.index=b;this.value=c;this.L=this.Ta();this.position=this.node=null;this.T=!1;this.G=null}Ta(){const a=olympe.D.Ta(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}gb(){return null===this.value}}
793
+ function mk(a,b){if(!b.gb()){var c=a.F;var d=a.na,e=b.Ta(),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].L,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].L,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.L=b.Ta();if(c!==b.position){d=a.F;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.T&&a.G()}}}
794
+ function nk(a){const b=a.na;a.F.sort((c,d)=>b(c.Ta(),d.Ta()))}
795
+ olympe.dc.Tb.Cp=class{constructor(a){this.na=a;this.L=null;this.F=[];this.T=[];this.da=null;this.ga=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new lk(this,c,d),this.ga.set(b,f),this.P()?jk(f,()=>mk(this,f)):(f.position=e.length,e.push(f));else{f=this.ga.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ga.delete(b);null!==f.position&&(this.P()?this.remove(f):delete e[f.position]);f.destroy()}return f}P(){return null!==this.L}$(a){if(null!==this.L)throw Error('Manager already activated (depth='+
796
+ this.L+')');this.L=a;nk(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;kk(d,()=>mk(this,d))}this.G()}G(){if(null===this.L)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.T.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.T){var b=e,c=this.L;b.T=!0;b.G=gk(b,c)}0>this.L?this.T.push(e.index):e.G&&fk(e.G,this.T)}this.da&&this.da(this.T)}Qf(a){this.da=a}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=
797
+ a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.Tb.Cp.va=[olympe.dc.Tb.Ba];function Pj(a){if(!a.F){for(let b in a.G)ok(a.G[b]);a.F=!0}a.L=null;a.P=null}function Sj(a,b,c){a.G[c||'root'].T=b}function Tj(a,b,c){a.G[c||'root'].If(b)}function pk(a,b,c,d){const e=a.P,f=b+d+c;let g=e[f];void 0===g&&(g=Qf(a.db,b,c,d),e[f]=g);return g}function qk(a,b){a.F||a.C.If(b)}function rk(a,b,c,d,e){if(!a.F){let f=pk(a,c,d,e||olympe.dc.wa.DESTINATION);e||(f+=pk(a,c,d,olympe.dc.wa.ORIGIN));0===f&&qk(a,b)}}
798
+ function sk(a,b){const c=a.G[b];void 0!==c?(a.K&&a.K.debug('Set current block to',b,null!==c.G?'parent = '+c.G.W():''),a.C=c):a.K&&a.K.error('Try to set a block that does not exists:',b)}function tk(a){const b=String(++a.T),c=a.C;a.G[b]=new uk(b,c);vk(c,b);c.L||(c.L=()=>sk(a,c.W()));return b}function wk(a,b){const c=a.C;a.C.L=()=>{sk(a,c.W());b()}}function xk(a,b){ok(b?a.G[b]:a.C)}
799
+ olympe.dc.Tb.Dp=class{constructor(a,b){this.db=a;this.K=b||null;this.L=Object.create(null);this.P=Object.create(null);this.F=!1;this.T=0;this.C=new uk('root');this.G=Object.create(null);this.G.root=this.C}register(a,b,c,d,e){this.F||(null!==b&&c&&d&&e?(c=pk(this,c,d,e),d=this.L[b]||0,this.L[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function vk(a,b){null===a.F&&(a.F=Object.create(null));a.F[b]=!1}function ok(a){a.P=!0;null!==a.G&&a.G.notify(a.id)}
800
+ class uk{constructor(a,b){this.id=a;this.G=b||null;this.C=this.T=this.L=this.F=null;this.P=!1}W(){return this.id}If(a){const b=this.T;if(this.P||this.C===a||null===a)b&&b(),!b&&ok(this)}notify(a){const b=this.L,c=this.F;if(this.P)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.Ua={};function yk(a,b,c,d){const e=olympe.dc.ta(),f=new olympe.dc.Tb.Ii,g=new olympe.dc.Tb.Dp(e);let h=!1;const k=Object.create(null),m=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,u)=>{a.Bc()||a.gb()||(h||(Sj(g,()=>{u.If();Pj(g)}),u.he().Qf(m),h=!0),q?k[t]=r:delete k[t],Tj(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].C(a,g,n);const p=olympe.Z.hc();pe(e,b,(q,r)=>{g.register(p,null);const t=f.C(q,b,p,null);n(q,r,p,Uj(t,q,b,p))},p);a.onDestroy(()=>{oe(e,b,p)});e.Ia(b)||Pj(g)}
801
+ function zk(a,b,c){const d=c.getContext(),e=olympe.dc.ta(),f=a.G(),g=Bf(e,b,a.L,d.G(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>Cf(e,b,a.L,g))}
802
+ olympe.dc.Ua.Ah=class{constructor(a,b,c){this.L=a&&a.X?a.X():a;this.ba=b&&b.filter(d=>d instanceof olympe.dc.ba.te||d instanceof olympe.dc.ba.ce)||null;this.F=c||null;this.defaultValue=null}ia(){}Hb(){}G(){}C(){return(this.ba||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}zg(a){this.defaultValue=a;return this}tg(){return this.ba}Bd(){return this.F}getValue(a,b){const c=a.run(()=>olympe.D.cc(this.Hb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&vb(c,this.defaultValue);
803
+ b=this.F||b;null!==this.ba?yk(a,b,this.ba,d=>{zk(this,d,c)}):zk(this,b,c);return c.vb()}ha(a){const b=Xj(a,this.L),c=Xj(a,this.F);let d='null';this.ba&&(d=this.ba.map(function(e){return e.ha(a)}).join(','));return`{"c":"${this.ia()}","a":["${b}",${d},${c}]}`}toString(){const a=Wj(this.L),b=this.F?','+Wj(this.F):'';let c='';this.ba&&(c=','+this.ba.join(','));return this.ia().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.Ua.Ah.va=[olympe.dc.Cj];olympe.dc.Ua.Jm=class{constructor(a,b){if(olympe.D.nf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ta();const e=d.Sb(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.qg(e,olympe.dc.CloudObject.extendRel,olympe.dm.se);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.N.X():d=new olympe.dc.Ua.ai(c,b);break;case olympe.dm.Number.N.X():d=new olympe.dc.Ua.Uh(c,
804
+ b);break;case olympe.dm.Boolean.N.X():d=new olympe.dc.Ua.Ji(c,b);break;case olympe.dm.DateTime.N.X():d=new olympe.dc.Ua.Hh(c,b)}this.F=d}ia(){return this.F.ia()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ha(a){return this.F.ha(a)}toString(){return this.F.toString()}};olympe.dc.Ua.Jm.va=[olympe.dc.Cj];olympe.dc.Ua.Ji=class extends olympe.dc.Ua.Ah{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.Ua.Ji)}G(){return olympe.dc.Eb.Kl}Hb(){return olympe.D.ea}};S('olympe.dc.valuedefs.BooleanProperty',olympe.dc.Ua.Ji);olympe.dc.Ua.ne=class{constructor(a){this.value=a}ia(){return T(olympe.dc.Ua.ne)}C(){return[]}getValue(){return this.value}ha(a){a=Xj(a,this.value);return`{"c":"${this.ia()}","a":[${a}]}`}toString(){return`Constant(${Wj(this.value)})`}};S('olympe.dc.valuedefs.Constant',olympe.dc.Ua.ne);olympe.dc.Ua.ne.va=[olympe.dc.Cj];olympe.dc.Ua.Hh=class extends olympe.dc.Ua.Ah{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.Ua.Hh)}G(){return olympe.dc.Eb.Ll}Hb(){return olympe.D.Za}};S('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.Ua.Hh);olympe.dc.Ua.Uh=class extends olympe.dc.Ua.Ah{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.Ua.Uh)}G(){return olympe.dc.Eb.Ml}Hb(){return olympe.D.aa}};S('olympe.dc.valuedefs.NumberProperty',olympe.dc.Ua.Uh);olympe.dc.Ua.ai=class extends olympe.dc.Ua.Ah{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.Ua.ai)}G(){return olympe.dc.Eb.Nl}Hb(){return olympe.D.Ka}};S('olympe.dc.valuedefs.StringProperty',olympe.dc.Ua.ai);olympe.dc.Ua.bi=class{ia(){return T(olympe.dc.Ua.bi)}C(){return[]}getValue(a,b){return b}ha(){return'{"c":"'+this.ia()+'","a":[]}'}toString(){return'Tag()'}};S('olympe.dc.valuedefs.Tag',olympe.dc.Ua.bi);olympe.dc.Ua.bi.va=[olympe.dc.Cj];olympe.dc.ba={};olympe.dc.ba.Ih=class{Hb(){return null}ia(){return T(olympe.dc.ba.Ih)}C(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.C.C!==g||b.F||(b.C.C=f),c(!0,f,f,Uj(h,!0,f,f))):(d[f]++,qk(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,Uj(h,!1,f,f)))}}ha(){return'{"c":"'+this.ia()+'"}'}toString(){return'Distinct()'}};S('olympe.dc.transformers.Distinct',olympe.dc.ba.Ih);olympe.dc.ba.Ih.va=[olympe.dc.Ze];olympe.dc.ba.Qe=class{constructor(a){this.F=a}Hb(){return null}ia(){return T(olympe.dc.ba.Qe)}G(){return this.F.F()}C(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&qk(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,Uj(h,k,f,g)))}const e={};return(f,g,h,k)=>{const m='@'+h;if(f){let n=this.F.C(a,g);olympe.D.Ya(n)&&(n=n.Aa);olympe.D.mf(n)?(b.F||void 0!==olympe.D.Ta(n)||qk(b,h),e[m]=n,a.run(()=>{olympe.D.qc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[m]&&(e[m].destroy(),delete e[m]),
805
+ d(g,h,k,!1),delete e[h]}}ha(a){return'{"c":"'+this.ia()+'","a":['+this.F.ha(a)+']}'}toString(){return'Filter('+this.F.toString()+')'}};S('olympe.dc.transformers.Filter',olympe.dc.ba.Qe);olympe.dc.ba.Qe.va=[olympe.dc.Ze,olympe.dc.Vo];olympe.dc.ba.Gk=class{constructor(a,b,c,d){this.F=new olympe.dc.Oa.Relation(olympe.dc.fa(a),c||olympe.dc.wa.DESTINATION);this.G=new olympe.dc.Oa.Relation(olympe.dc.fa(b),d||olympe.dc.wa.DESTINATION)}Hb(){return De(this.F)}ia(){return T(olympe.dc.ba.Gk)}C(a,b,c){const d=olympe.dc.ta(),e={},f=this.F.X(),g=this.F.Pa(),h=this.G.X(),k=this.G.Pa();let m=null,n=null;const p=(r,t,u,w,x,y)=>{if(x){if(x=()=>{const z=olympe.Z.nb(u+g+(f+'_'+r)+y,20),A=Uj(t,!0,y,z);m=r;n=()=>{c(!1,y,z,Uj(t,!1,y,z))};b.register(z,
806
+ u,w,f,g);c(!0,y,z,A)},x.uq=r,e[w]=x,null===m||r<m)n&&n(),x()}else if(m===r){n();e[w]=!0;x=Infinity;let z=null;for(let A=Object.keys(e),M=A.length,K=0;K<M;K++){let pa=e[A[K]];pa.uq<x&&(x=pa.uq,z=pa)}z&&z()}},q=(r,t,u,w,x)=>{w?e[x]||(e[x]=!0,rk(b,u,x,f,g),rk(b,u,x,h,k),W(d,x,this.F,p.bind(this,r,t,u,x),u+'_val'),W(d,x,this.G,q.bind(this,r+1,t,u),u+'_follow')):(d.F(x,this.G,u+'_follow'),d.F(x,this.F,u+'_val'),delete e[x])};return(r,t,u,w)=>q(0,w,u,r,t)}ha(){return'{"c":"'+this.ia()+'","a":["'+this.F.toString()+
807
+ '","'+this.G.toString()+'"]}'}toString(){return'FirstRelated('+this.F.toString()+', '+this.G.toString()+')'}};S('olympe.dc.transformers.FirstRelated',olympe.dc.ba.Gk);olympe.dc.ba.Gk.va=[olympe.dc.Ze];olympe.dc.ba.Mg=class{constructor(a,b){this.start=a;this.F=b}Hb(){return null}ia(){return T(olympe.dc.ba.Mg)}C(a,b,c){const d=new olympe.dc.Tb.Zk;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.F||(b.C.C=e[0>n-1?0:Math.min(e.length,n)-1]);ik(d,e,f,n,c)}};a.run(()=>olympe.D.qc([this.start,this.F],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));wk(b,k);const m=tk(b);sk(b,m);return(n,p,q,r)=>{h||(r.he().Qf(t=>{e=t;xk(b,m)}),Sj(b,()=>r.If(),m),h=!0);d.C(n,p,q,null);Tj(b,q,m)}}ha(a){return'{"c":"'+
808
+ this.ia()+'","a":['+Xj(a,this.start)+','+Xj(a,this.F)+']}'}toString(){return`Limit(${olympe.D.Ta(this.start)},${olympe.D.Ta(this.F)})`}};S('olympe.dc.transformers.Limit',olympe.dc.ba.Mg);olympe.dc.ba.Mg.va=[olympe.dc.Ze];function Ak(a){return a.F.map(b=>b.X())}
809
+ olympe.dc.ba.aj=class{constructor(a,b){this.direction=b||olympe.dc.wa.DESTINATION;this.F=a.map(c=>new olympe.dc.Oa.Relation(c,this.direction))}Hb(){return olympe.dc.CloudObject}ia(){return T(olympe.dc.ba.aj)}Pa(){return this.direction}C(a,b,c){const d=olympe.dc.ta(),e=(f,g,h,k)=>W(d,f,k,(m,n)=>{var p=k.X();p=olympe.Z.nb(g+k.Pa()+p+n,20);const q=Uj(h,m,n,p);m&&b.register(p,g,f,k.X(),k.Pa());c(m,n,p,q)},g);return(f,g,h,k)=>{f?this.F.forEach(m=>{rk(b,h,g,m.X(),m.Pa());e(g,h,k,m)}):this.F.forEach(m=>
810
+ {d.F(g,m,h)})}}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(Ak(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Pa()+'['+Ak(this).join(',')+'])'}};S('olympe.dc.transformers.MultiRelated',olympe.dc.ba.aj);olympe.dc.ba.aj.va=[olympe.dc.Ze];olympe.dc.ba.ce=class extends olympe.dc.Oa.Relation{constructor(a,b=olympe.dc.wa.DESTINATION,c=1,d=-1){super(a,b);this.G=c;this.F=d}Hb(){return De(this)}ia(){return T(olympe.dc.ba.ce)}C(a,b,c){const d=olympe.dc.ta(),e=Object.create(null),f=olympe.dc.wa.ORIGIN,g=olympe.dc.wa.DESTINATION,h=this.X(),k=this.Pa(),m=(p,q,r)=>{if(!(0<=this.F&&p>=this.F)){var t=d.ib(r,this);p+=1;for(let u=0,w=t.length;u<w;u++){if(void 0!==e[t[u]]||r===t[u])continue;const x=olympe.Z.nb(q+k+(h+'_'+p)+t[u],20);b.register(x,
811
+ q,r,h,k||g);null===k&&b.register(x,q,r,h,f)}}},n=(p,q,r,t,u,w)=>{u&&!b.F&&m(p,t,w);p>=this.G?c(u,w,t,Uj(r,u,w,t)):rk(b,t,w,h,k);0<=this.F&&p>=this.F||(u?e[w]||(e[w]=!0,W(d,w,this,(x,y)=>{const z=p+1,A=olympe.Z.nb(t+k+(h+'_'+z)+y,20);n(z,w,r,A,x,y)},t)):(d.F(w,this,t),delete e[w]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ha(){return'{"c":"'+this.ia()+'","a":["'+this.X()+'","'+this.Pa()+'",'+this.G+','+this.F+']}'}toString(){return'RecursiveRelated('+this.Pa()+this.X()+'['+this.G+'..'+this.F+'])'}};
812
+ S('olympe.dc.transformers.RecursiveRelated',olympe.dc.ba.ce);olympe.dc.ba.ce.va=[olympe.dc.Ze];olympe.dc.ba.te=class extends olympe.dc.Oa.Relation{constructor(a,b){super(a,b||olympe.dc.wa.DESTINATION)}Hb(){return De(this)}ia(){return T(olympe.dc.ba.te)}Qb(){return new olympe.dc.ba.te(this.tag,this.direction===olympe.dc.wa.DESTINATION?olympe.dc.wa.ORIGIN:olympe.dc.wa.DESTINATION)}C(a,b,c){const d=olympe.dc.ta(),e=this.X(),f=this.Pa();return(g,h,k,m)=>{rk(b,k,h,e,f);g?W(d,h,this,(n,p)=>{const q=olympe.Z.nb(k+f+e+p,20),r=Uj(m,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.F(h,this,k)}}ha(){return'{"c":"'+
813
+ this.ia()+'","a":["'+this.X()+'","'+this.Pa()+'"]}'}toString(){return'Related('+this.Pa()+this.X()+')'}};S('olympe.dc.transformers.Related',olympe.dc.ba.te);olympe.dc.ba.te.va=[olympe.dc.Ze];olympe.dc.ba.gg=class{constructor(a,b){this.yb=a;this.F=void 0===b?!0:!!b}Hb(){return null}ia(){return T(olympe.dc.ba.gg)}ng(){return this.yb}G(){return[this.yb.P()]}C(a,b,c){const d=new olympe.dc.Tb.Cp(a.G(this.F?this.yb.G.bind(this.yb):(e,f)=>this.yb.G(f,e)));return(e,f,g)=>{var h=e?this.yb.L(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ha(a){return'{"c":"'+this.ia()+'","a":['+this.yb.ha(a)+','+JSON.stringify(this.F)+']}'}toString(){return'Sort('+this.yb.toString()+','+JSON.stringify(this.F)+')'}};
814
+ S('olympe.dc.transformers.Sort',olympe.dc.ba.gg);olympe.dc.ba.gg.va=[olympe.dc.Ze,olympe.dc.Vo];function Bk(a,b,c,d,e,f){function g(n,p){if(m)for(var q=m.length-1;0<=q;q--)f=m[q].C(b,e,f);e.register(h,null);q=d.C(n,p,c,null);f(n,p,h,Uj(q,n,p,h))}const h=olympe.Z.hc(),k=olympe.dc.ta(),m=a.ba;b.run(()=>olympe.D.qc([a.F],n=>{Ck(k,n,g,h);void 0===k.model(n)&&Pj(e)}))}function Ck(a,b,c,d){const e=b&&b.valueOf();e&&(pe(a,e,c,d),olympe.D.Ma().$(()=>oe(a,e,d)))}
815
+ olympe.dc.ba.$e=class{constructor(a,b){this.ba=this.F=null;a instanceof olympe.dc.ua?(this.F=a.Bd(),this.ba=a.Uk()):(this.F=a,b&&(this.ba=b))}Hb(){return null}ia(){return T(olympe.dc.ba.$e)||''}tg(){return this.ba}Bd(){return this.F}C(a,b,c){const d=new olympe.dc.Tb.Zk,e=new olympe.dc.Tb.Ii;let f=[],g=[],h=!1,k=!1;const m=tk(b),n=tk(b);wk(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):xk(b);ik(d,p,0,p.length,c)});sk(b,n);Bk(this,a,this.F,e,b,(p,q,r,t)=>{const u=olympe.D.Ma();u.Bc()||
816
+ u.gb()||(k||(t.he().Qf(w=>{g=w;xk(b,n)}),Sj(b,()=>t.If(),n),k=!0),d.C(p,q,r),Tj(b,r,n))});sk(b,m);return(p,q,r,t)=>{h||(t.he().Qf(u=>{f=u;xk(b,m)}),Sj(b,()=>t.If(),m),h=!0);d.C(p,q,r,m);Tj(b,r,m)}}ha(a){const b=this.ba?'['+this.ba.map(c=>c.ha(a)).join(',')+']':'null';return'{"c":"'+this.ia()+'","a":['+Xj(a,this.F)+','+b+']}'}toString(){const a=olympe.D.Ya(this.F)?'N:'+this.F.Aa.W():this.F.valueOf(),b=this.ba?','+this.ba.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
817
+ S('olympe.dc.transformers.Union',olympe.dc.ba.$e);olympe.dc.ba.$e.va=[olympe.dc.Ze];olympe.dc.ba.kp={by:1,Kr:-1,Jr:0};olympe.dc.ba.Ez={Iw:!0,jx:!1};olympe.dc.ic.R={mo:'dc.legacy.listdefProcessor'};olympe.V.config(a=>{D(a,olympe.dc.ic.R.mo,olympe.dc.ic.Es,olympe.dc.query.R.za,olympe.dc.R.Oe,olympe.dc.transaction.R.Ga,olympe.dc.query.R.lj,new olympe.V.ma(olympe.dc.U.Wg))});olympe.V.run([olympe.dc.ic.R.mo],a=>{olympe.dc.ic.Zu=()=>a});function Dk(a){const b=olympe.dc.ta(),c=new Map;b.oq(a).forEach(d=>{b.ib(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
818
+ olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ta();this.model=null}static Ec(a,b,c,...d){b=olympe.dc.fa(b);var e=re.get(b)||null;(e=e&&e.C)?e(a,c,...d):(a=a.create(b),void 0!==c&&null!==c&&Z(a,olympe.dc.CloudObject.nameProp,c),a.X())}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.pq();a=olympe.dc.fa(a);var c=qe(b,b.db.model(a));if(null===c)throw new olympe.dc.Ko(a);c=c.instantiate(a,b.F);Object.defineProperty(c,'tag',{value:a,writable:!1});
819
+ b.C.C.ub([a]);b.Oa.register(c,a);b=c}return b}static exists(a){return olympe.dc.ta().Ia(olympe.dc.fa(a))}static eq(a,b,c){if('undefined'===typeof olympe.sc)throw Error('Method CloudObject.createWith should only be used at runtime, when sc package exists');const d=olympe.dc.ta();let e=null;const f=h=>{null===e&&(e=Dk(b||this));return e.has(h)?e.get(h):null},g=new Map;a.forEach((h,k)=>{d.Ia(olympe.dc.fa(k))?g.set(k,h):(k=f(k))&&g.set(k,h)});a=new olympe.sc.Sa(!1);c=a.create(null!=b?b:this,g,c);a.lb().catch(h=>
820
+ olympe.la.fb('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${h}`));return this.get(c)}static Wt(){return this.get(this)}static Vj(a){return olympe.dc.ra.Vj(a)}static Bb(){return olympe.dc.ta().ib(this,olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Oa.Property(a))}static ie(){const a=olympe.dc.ta();return a.ib(this,olympe.dc.CloudObject.xi).map(b=>new olympe.dc.Oa.Relation(b)).concat(a.ib(this,olympe.dc.CloudObject.iq).map(b=>new olympe.dc.Oa.Relation(b,olympe.dc.wa.ORIGIN)))}static Ge(a){return olympe.dc.CloudObject.get(a)}static Uu(a){var b=
821
+ qe(olympe.dc.pq(),olympe.dc.fa(a));b=b&&b.F;return new olympe.dc.ua(olympe.dc.fa(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}ia(){return this.rb(olympe.dc.CloudObject.nameProp)}Cd(){this.model||(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.ra.from(this)}Of(){return this.db.Of(this)}Gb(){return this.db.source(this)}Vu(){return this.db.uh(this)?olympe.dc.Ed().fromModel(this):null}nq(){return olympe.D.sa([this.ia()],
822
+ a=>olympe.D.sb(a),olympe.D.Ka,'getDisplayName',olympe.D.sb('('+this.toString()+')'))}oc(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.F?a.F():a;return new rxjs.Observable(e=>{const f=this.db.Qa(this.tag,b);c||null!==f||e.next(f);const g=Bf(this.db,this.tag,b,h=>{null===h||void 0===h?e.next(null):e.next(h)});d.$(()=>{e.complete();Cf(this.db,this.tag,b,g)});return()=>Cf(this.db,this.tag,b,g)})}aw(a){const b='function'===typeof a.F?a.F():a;return new rxjs.Observable(c=>
823
+ {const d=Df(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Oa.Property(e),null]):c.next([new olympe.dc.Oa.Property(e),f])});b.$(()=>{c.complete();Ef(this.db,this.tag,d)});return()=>Ef(this.db,this.tag,d)})}bw(a){return this.observe(olympe.D.Ma(),a)}get(a){return this.db.Qa(this.tag,a)}Qa(a){return this.get(a)}eb(a){return olympe.dc.ra.from(this).eb(a)}Ij(a){return olympe.dc.Nc.from(this).eb(a)}Cu(){return this.Xb(olympe.dc.CloudObject.$t,olympe.dc.CloudObject)}Vl(){return this.ib(olympe.dc.CloudObject.containsRel,
824
+ olympe.dc.CloudObject)}kf(a,b,c){const d=olympe.D.cc(c,'Sync valueType'),e=Bf(this.db,this.tag,a,olympe.D.Ma().G(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>Cf(this.db,this.tag,a,e));return d.getContext()}rb(a){return N(this.kf(a,olympe.dc.Eb.Nl,olympe.D.Ka))}Gc(a){return N(this.kf(a,olympe.dc.Eb.Ml,olympe.D.aa))}ph(a){return N(this.kf(a,olympe.dc.Eb.Kl,olympe.D.ea))}ni(a){return N(this.kf(a,olympe.dc.Eb.Ll,olympe.D.Za))}sq(){return N(this.kf(olympe.dm.Color.valueProp,
825
+ olympe.dc.Eb.Zp,olympe.D.Color))}tq(){return N(this.kf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.Eb.$p,olympe.dc.CloudObject))}ib(a,b){a=a instanceof olympe.dc.ba.te?a:new olympe.dc.ba.te(a.X(),a.Pa());return new olympe.dc.ua(this.X(),a,b)}Xb(a,b){return this.ib(a,b).yc()}lq(a,b){const c=this.db,d=olympe.Z.hc(),e=olympe.D.Ma(),f=new Map;W(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(()=>
826
+ {c.F(this.tag,a,d)})}Aw(){return new olympe.dc.ua(this.X(),[],Be(this.X()))}transform(...a){return(new olympe.dc.ua(this.X(),[],this.constructor)).transform(...a)}zc(){return this.nq()}toString(){if(!this.db.Ia(this.tag))return`unknown object #${this.tag||'NULL_TAG'}`;const a=this.db.model(this.tag);var b=this.db.name(this);b=b?` instanceName: '${b}'`:'';return a?`${this.db.name(a)}#${this.tag}${b}`:`orphan object (no model) #${this.tag}${b}`}toJSON(){if(!this.db.Ia(this.tag))return{CloudObject:'Unknown tag'};
827
+ const a=this.db.model(this.tag),b=this.db.name(a),c=this.db.name(this.tag);return{CloudObject:this.tag,Name:c,Model:`${b} (${a})`}}Cc(a=!1,b=!0){const c={};this.db.Bb(this,b).forEach((d,e)=>{e=a?this.db.name(e):e;c[e]=d instanceof olympe.dc.lc?ne(d):d});return c}Ha(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():!1}bd(a){return olympe.D.sa([a],b=>olympe.D.Ib(this.Ha(b)),olympe.D.ea)}fu(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Sa,c=!0;const d=olympe.dc.wa.ORIGIN;
828
+ for(const [e,f,g]of Of(b,this))f===d?a.Wb(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.Wb(e,this,g);a.delete(this,olympe.dc.Nb.NONE);c&&a.lb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Ha;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Cc;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.Ij;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.eb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Qa;
829
+ olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.bw;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.aw;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.oc;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.Gb;
830
+ olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Of;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Cd;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.Uu;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Ge;
831
+ olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.ie;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Bb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Vj;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Wt;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.eq;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.N=olympe.dc.ka.C('ff021000000000000001',olympe.dc.CloudObject);
832
+ olympe.dc.CloudObject.MB=olympe.dc.CloudObject.N.ja(olympe.dc.ho.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.N.ja('ff023000000000000011');B('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.yB=olympe.dc.CloudObject.N.ja('ff023000000000000012');olympe.dc.CloudObject.xi=olympe.dc.CloudObject.N.pa('ff02200000000000000a');olympe.dc.CloudObject.iq=olympe.dc.CloudObject.N.pa('ff02200000000000000b',olympe.dc.wa.ORIGIN);olympe.dc.CloudObject.fB=olympe.dc.CloudObject.N.pa('017e9c4ba4c847d71cbf');
833
+ olympe.dc.CloudObject.XA=olympe.dc.CloudObject.N.pa('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.N.pa('ff02200000000000000c');B('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.N.pa('ff02200000000000000d',olympe.dc.wa.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.N.pa(olympe.dc.mc.nd);B('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);
834
+ olympe.dc.CloudObject.instancesRel=U(olympe.dc.CloudObject.N,olympe.dc.CloudObject.modelRel);B('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.N.pa(olympe.dc.mc.Jh);B('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=U(olympe.dc.CloudObject.N,olympe.dc.CloudObject.extendRel);B('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);
835
+ olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.N.pa(olympe.dc.mc.Li);B('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.$t=U(olympe.dc.CloudObject.N,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.eu=olympe.dc.CloudObject.N.pa('018282d3ac0a474a0bf4');B('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.eu);olympe.dc.Gz=olympe.dc.CloudObject;olympe.dc.CloudObject.va=[olympe.dc.qe];l=olympe.dc.CloudObject.prototype;
836
+ l.X.J=new olympe.D.H(()=>String,[]);l.name.J=new olympe.D.H(()=>String,[]);l.ia.J=olympe.D.H.F;l.Cd.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Gb.J=new olympe.D.H(()=>String,[]);l.Vu.J=new olympe.D.H(()=>String,[]);l.nq.J=olympe.D.H.F;l.oc.J=new olympe.D.H(()=>String,[]);l.Cu.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Vl.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.kf.J=new olympe.D.H(()=>olympe.D.Node,[]);l.rb.J=olympe.D.H.F;l.Gc.J=olympe.D.H.G;l.ph.J=olympe.D.H.P;
837
+ l.ni.J=new olympe.D.H(()=>olympe.D.Za,[]);l.sq.J=new olympe.D.H(()=>olympe.D.Color,[]);l.tq.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.ib.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Xb.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.lq.J=new olympe.D.H(()=>Function,[]);l.Aw.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.transform.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.zc.J=olympe.D.H.F;l.toString.J=olympe.D.H.C;l.Ha.J=olympe.D.H.C;l.bd.J=olympe.D.H.P;l.fu.J=new olympe.D.H(()=>{},[]);olympe.dc.R={Oe:'dc.DBView',co:'dc.InstanceManager',za:'dc.Logger',wt:'dc.TransactionLogger',Qi:'dc.FileServiceManager',Tg:'dc.Router'};olympe.dc.U={eg:'dc.tag',ip:'dc.routing',uf:'dc.debug',Wg:'dc.subscribeAll',yk:'dc.defaultSource',Gn:'dc.fileCache',Dn:'dc.errorOnAbstractInstantiation'};
838
+ olympe.V.config(function(a){F(a,olympe.dc.U.uf,!1);F(a,olympe.dc.U.ip,{});F(a,olympe.dc.U.Wg,!1);F(a,olympe.dc.U.yk,olympe.dc.Ra.SERVER);F(a,olympe.dc.U.Gn,!1);F(a,olympe.dc.U.Dn,!0);F(a,olympe.dc.U.eg,olympe.Z.hc());E(a,olympe.dc.R.za,[olympe.la.R.Ga],b=>b.Fc('dc'));va(a,olympe.dc.R.wt,olympe.dc.transaction.R.za);va(a,olympe.dc.R.Oe,olympe.dc.db.R.vk);D(a,olympe.dc.R.Qi,olympe.dc.zr,olympe.dc.R.za,olympe.dc.R.Oe,olympe.net.R.Ga,olympe.dc.R.Tg,olympe.Z.R.Cg,new olympe.V.ma(olympe.dc.U.Gn));D(a,olympe.dc.R.Tg,
839
+ olympe.dc.Yh,olympe.dc.R.za,olympe.auth.R.Ga,olympe.dc.sources.R.ep,olympe.dc.sources.R.sp,olympe.dc.R.Oe,olympe.host.R.We,new olympe.V.ma(olympe.dc.U.eg),new olympe.V.ma(olympe.dc.U.ip));D(a,olympe.dc.R.co,olympe.dc.Sr,olympe.dc.db.R.Hk,olympe.dc.db.R.Ga,olympe.V.R.Sf)},'olympe.dc');
840
+ olympe.V.run([olympe.dc.db.R.Ga,olympe.dc.transaction.R.Ga,olympe.dc.R.co,olympe.dc.R.Qi,new olympe.V.ma(olympe.dc.U.eg)],(a,b,c,d,e)=>{olympe.dc.Wl=()=>a;olympe.dc.qh=()=>b;olympe.dc.pq=()=>c;olympe.dc.tB=()=>d;olympe.dc.Ra.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.fk={NONE:0,nx:1,lr:2,ox:4,kx:8,mx:16,lx:31,Ny:32,Ky:64,Oy:128,Ly:256,Qs:512,My:992,ey:1023};olympe.dm.pd=class extends olympe.dc.CloudObject{ia(){return this.rb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Ka.EMPTY}F(){return olympe.D.ea.C}};olympe.dm.pd.N=olympe.dc.ka.C('ff021000000000000002',olympe.dm.pd);olympe.dm.pd.P=olympe.dm.pd.N.ja('ff023000000000000035');olympe.dm.pd.C=olympe.dm.pd.N.pa('ff022000000000000005');olympe.dm.pd.G=R('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.pd.L=R('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
841
+ olympe.dm.pd.F=R('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.pd.prototype.ia.J=olympe.D.H.F;olympe.dm.pd.prototype.C.J=olympe.D.H.F;olympe.dm.pd.prototype.F.J=olympe.D.H.P;olympe.dm.User=class extends olympe.dc.CloudObject{Pu(){return this.Zl()}ia(){return this.Zl()}Zl(){return this.rb(olympe.dm.User.loginProp)}gs(){return this.rb(olympe.dm.User.F)}es(){return olympe.D.Ka.EMPTY}pv(){return this.rb(olympe.dm.User.saltProp)}Bv(){return this.rb(olympe.dm.User.verifierProp)}nv(){return this.ib(olympe.dm.User.G,olympe.dm.pd)}};olympe.dm.User.N=olympe.dc.ka.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.N.ja('ff023000000000000001');
845
842
  B('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.F=olympe.dm.User.N.ja('ff023000000000000002');olympe.dm.User.T=olympe.dm.User.N.ja('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.N.ja('ff023000000000000004');B('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.N.ja('ff023000000000000005');B('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.P=olympe.dm.User.N.ja('ff023000000000000020');
846
- olympe.dm.User.SAMLnameIdProp=olympe.dm.User.N.ja('ff023000000000000036');B('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.G=U(olympe.dm.User.N,olympe.dm.pd.C);olympe.dm.User.$=olympe.dm.User.N.pa('ff022000000000000002');olympe.dm.User.C=Ae('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.L=Ae('0163d9653067b6237f62','GUEST_USER');l=olympe.dm.User.prototype;l.Qu.J=olympe.D.H.F;l.ia.J=olympe.D.H.F;l.$l.J=olympe.D.H.F;l.gs.J=olympe.D.H.F;l.es.J=olympe.D.H.F;l.qv.J=olympe.D.H.F;
847
- l.Cv.J=olympe.D.H.F;l.ov.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.xf=class extends olympe.dc.CloudObject{$(){return this.Wl()}mb(){return this.rb(olympe.dm.xf.Wa)}};olympe.dm.xf.N=olympe.dc.ka.C('01621fb84e3300000000',olympe.dm.xf);olympe.dm.xf.Wa=olympe.dm.xf.N.ja('01609de3f292e3c2c6ff');olympe.dm.xf.prototype.$.J=new olympe.D.H(()=>olympe.D.Qc,[]);olympe.dm.xf.prototype.mb.J=olympe.D.H.F;olympe.dm.BrickMetadata=class extends olympe.dm.xf{Dv(){return this.rb(olympe.dm.BrickMetadata.Eb)}Rc(){return this.rb(olympe.dm.BrickMetadata.na)}Ud(){return null}Au(){return this.ib(olympe.sc.Gb.Comment.C.Rb(),olympe.sc.Gb.Comment)}Qj(){return this.Ij(olympe.dm.BrickMetadata.ga).Ad().Qj()}};olympe.dm.BrickMetadata.N=Fe(olympe.dc.ka.C('01621fb84e3500000000',olympe.dm.BrickMetadata));olympe.dm.BrickMetadata.Eb=olympe.dm.BrickMetadata.N.ja('01621fb84e320000f001');olympe.dm.BrickMetadata.na=olympe.dm.BrickMetadata.N.ja('01703376c4a81c0e9d94');
848
- olympe.dm.BrickMetadata.ga=olympe.dm.BrickMetadata.N.pa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.uc={Zy:'private',$y:'public'};olympe.dm.BrickMetadata.Qb=Ae('01703376c4a81c0e9d95','BRICK_STATUS');olympe.dm.BrickMetadata.$b={yx:'experimental',mz:'stable',kx:'deprecated'};l=olympe.dm.BrickMetadata.prototype;l.Dv.J=olympe.D.H.F;l.Rc.J=olympe.D.H.F;l.Ud.J=new olympe.D.H(()=>String,[]);l.Au.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Qj.J=olympe.D.H.T;function di(a,b){const c=a.query().eb(olympe.dm.xd.F.Rb()).eb(olympe.dm.xd.C);a=a.query().eb(olympe.dm.pb.L.Rb()).Mf(olympe.dm.pb.G,!0).eb(olympe.sc.Jc.C.Rb());const d=e=>e.Nd().Mf(olympe.dc.CloudObject.extendRel,!0).eb(olympe.dc.CloudObject.xi,!0).eb(olympe.dm.Relation.destinationModelRel).back(2).eb(olympe.dc.CloudObject.propertyRel,!0).eb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
849
- function zi(a,b){return a.observe(b,olympe.dm.DataSource.bq).pipe(rxjs.operators.map(()=>a.Cd(olympe.dc.sources.U.le)),rxjs.operators.distinctUntilChanged())}
850
- olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.fc=c;this.eq=new Map([[olympe.dc.sources.U.hl,olympe.dm.DataSource.lw],[olympe.dc.sources.U.le,olympe.dm.DataSource.bq],[olympe.dc.sources.U.ml,olympe.dm.DataSource.ow]])}W(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ra.SERVER:this.tag}Cd(a){a=a.startsWith('data.')?a.split('.')[1]:a;const b=`${'data.'}${a}`;let c,d,e;return null!=(e=null!=(d=null!=(c=olympe.V.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
851
- '_')}.${a}`))?c:olympe.V.getParameter(`${'data.'}${this.X()}.${a}`))?d:olympe.V.getParameter(b))?e:this.eq.has(b)?this.get(this.eq.get(b)):null}Rc(){const a=this;return v(function*(){const b=olympe.dm.DataSource.Pb.qr,c=olympe.dm.DataSource.Pb.Db,d=new olympe.dc.Request(olympe.dc.Request.C.Pb,a.W());return a.fc.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.la.fb('dc').warn(`Source ${a.name()} (${a.W()}) has encountered issues: ${e}`);return g}).catch(e=>
852
- {const f=olympe.O.errors.Ho;return e instanceof olympe.O.errors.Ip||e instanceof f?b:c})})}init(){const a=this;return v(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return v(function*(){})}healthCheck(){return v(function*(){})}executeQuery(a){return v(function*(){return olympe.dc.query.wd.Ul(a)})}applyTransaction(){return v(function*(){})}uploadFileContent(){return v(function*(){throw Error('Should not try to upload files with SELF source');
843
+ olympe.dm.User.SAMLnameIdProp=olympe.dm.User.N.ja('ff023000000000000036');B('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.G=U(olympe.dm.User.N,olympe.dm.pd.C);olympe.dm.User.$=olympe.dm.User.N.pa('ff022000000000000002');olympe.dm.User.C=R('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.L=R('0163d9653067b6237f62','GUEST_USER');l=olympe.dm.User.prototype;l.Pu.J=olympe.D.H.F;l.ia.J=olympe.D.H.F;l.Zl.J=olympe.D.H.F;l.gs.J=olympe.D.H.F;l.es.J=olympe.D.H.F;l.pv.J=olympe.D.H.F;
844
+ l.Bv.J=olympe.D.H.F;l.nv.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.xf=class extends olympe.dc.CloudObject{$(){return this.Vl()}mb(){return this.rb(olympe.dm.xf.Wa)}};olympe.dm.xf.N=olympe.dc.ka.C('01621fb84e3300000000',olympe.dm.xf);olympe.dm.xf.Wa=olympe.dm.xf.N.ja('01609de3f292e3c2c6ff');olympe.dm.xf.prototype.$.J=new olympe.D.H(()=>olympe.D.Qc,[]);olympe.dm.xf.prototype.mb.J=olympe.D.H.F;olympe.dm.BrickMetadata=class extends olympe.dm.xf{Cv(){return this.rb(olympe.dm.BrickMetadata.Db)}Rc(){return this.rb(olympe.dm.BrickMetadata.na)}Td(){return null}zu(){return this.ib(olympe.sc.Fb.Comment.C.Qb(),olympe.sc.Fb.Comment)}Qj(){return this.Ij(olympe.dm.BrickMetadata.ga).Ad().Qj()}};olympe.dm.BrickMetadata.N=Fe(olympe.dc.ka.C('01621fb84e3500000000',olympe.dm.BrickMetadata));olympe.dm.BrickMetadata.Db=olympe.dm.BrickMetadata.N.ja('01621fb84e320000f001');olympe.dm.BrickMetadata.na=olympe.dm.BrickMetadata.N.ja('01703376c4a81c0e9d94');
845
+ olympe.dm.BrickMetadata.ga=olympe.dm.BrickMetadata.N.pa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.ud={Xy:'private',Yy:'public'};olympe.dm.BrickMetadata.Pb=R('01703376c4a81c0e9d95','BRICK_STATUS');olympe.dm.BrickMetadata.Zb={wx:'experimental',kz:'stable',ix:'deprecated'};l=olympe.dm.BrickMetadata.prototype;l.Cv.J=olympe.D.H.F;l.Rc.J=olympe.D.H.F;l.Td.J=new olympe.D.H(()=>String,[]);l.zu.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Qj.J=olympe.D.H.T;function ci(a,b){const c=a.query().eb(olympe.dm.xd.F.Qb()).eb(olympe.dm.xd.C);a=a.query().eb(olympe.dm.pb.L.Qb()).Mf(olympe.dm.pb.G,!0).eb(olympe.sc.Jc.C.Qb());const d=e=>e.Md().Mf(olympe.dc.CloudObject.extendRel,!0).eb(olympe.dc.CloudObject.xi,!0).eb(olympe.dm.Relation.destinationModelRel).back(2).eb(olympe.dc.CloudObject.propertyRel,!0).eb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
846
+ function yi(a,b){return a.observe(b,olympe.dm.DataSource.aq).pipe(rxjs.operators.map(()=>a.ge(olympe.dc.sources.U.me)),rxjs.operators.distinctUntilChanged())}
847
+ olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.ec=c;this.cq=new Map([[olympe.dc.sources.U.gl,olympe.dm.DataSource.kw],[olympe.dc.sources.U.me,olympe.dm.DataSource.aq],[olympe.dc.sources.U.ll,olympe.dm.DataSource.nw]])}W(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ra.SERVER:this.tag}ge(a){a=a.startsWith('data.')?a.split('.')[1]:a;const b=`${'data.'}${a}`;let c,d,e;return null!=(e=null!=(d=null!=(c=olympe.V.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
848
+ '_')}.${a}`))?c:olympe.V.getParameter(`${'data.'}${this.X()}.${a}`))?d:olympe.V.getParameter(b))?e:this.cq.has(b)?this.get(this.cq.get(b)):null}Rc(){const a=this;return v(function*(){const b=olympe.dm.DataSource.Ob.qr,c=olympe.dm.DataSource.Ob.Cb,d=new olympe.dc.Request(olympe.dc.Request.C.Ob,a.W());return a.ec.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.la.fb('dc').warn(`Source ${a.name()} (${a.W()}) has encountered issues: ${e}`);return g}).catch(e=>
849
+ {const f=olympe.O.errors.Fo;return e instanceof olympe.O.errors.Gp||e instanceof f?b:c})})}init(){const a=this;return v(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return v(function*(){})}healthCheck(){return v(function*(){})}executeQuery(a){return v(function*(){return olympe.dc.query.wd.Tl(a)})}applyTransaction(){return v(function*(){})}uploadFileContent(){return v(function*(){throw Error('Should not try to upload files with SELF source');
853
850
  })}downloadFileContent(){return v(function*(){throw Error('Should not try to download files with SELF source');})}deleteFileContent(){return v(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;
854
- olympe.dm.DataSource.prototype.applyTransaction=olympe.dm.DataSource.prototype.applyTransaction;olympe.dm.DataSource.prototype.executeQuery=olympe.dm.DataSource.prototype.executeQuery;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.Cd;
855
- olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.W;olympe.dm.DataSource.N=olympe.dc.ka.C('ff021000000000000060',olympe.dm.DataSource,olympe.dc.R.Tg);olympe.dm.DataSource.eh=olympe.dm.DataSource.N.ja('ff023000000000000060');B('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.eh);olympe.dm.DataSource.eB=olympe.dm.DataSource.N.ja('ff023000000000000061');olympe.dm.DataSource.lw=olympe.dm.DataSource.N.ja('ff023000000000000062');olympe.dm.DataSource.bq=olympe.dm.DataSource.N.ja('ff023000000000000063');
856
- olympe.dm.DataSource.kq=olympe.dm.DataSource.N.ja('ff023000000000000064');olympe.dm.DataSource.ow=olympe.dm.DataSource.N.ja('ff023000000000000065');olympe.dm.DataSource.yi=olympe.dm.DataSource.N.pa('ff022000000000000060');olympe.dm.DataSource.SERVER=Ae('00000000000000000060','Server source');olympe.dm.DataSource.le={ly:'hybrid',Rm:'bus',Tn:'http'};olympe.dm.DataSource.Pb={Sg:'ready',Db:'error',qr:'down'};olympe.dm.xd=class extends olympe.dc.CloudObject{};olympe.dm.xd.N=olympe.dc.ka.C('ff021000000000000070',olympe.dm.xd);olympe.dm.xd.F=olympe.dm.xd.N.pa('ff023000000000000071');olympe.dm.xd.C=olympe.dm.xd.N.pa('ff023000000000000072');olympe.dm.xd.G=olympe.dm.xd.N.pa('ff023000000000000073');olympe.dm.Bb=class extends olympe.dm.BrickMetadata{L(){return new olympe.dc.ua(this.X(),[new olympe.dc.ba.de(olympe.dm.Bb.F.X(),olympe.dc.wa.DESTINATION,olympe.dc.ba.mp.Jr,olympe.dc.ba.mp.Kr),olympe.dm.Bb.C])}Ud(){return null}C(){return this.ib(olympe.dm.Bb.F,olympe.dm.Bb)}P(){return this.ib(olympe.dm.Bb.C)}};olympe.dm.Bb.N=olympe.dc.ka.C('01612df1db9749227626',olympe.dm.Bb);olympe.dm.Bb.F=olympe.dm.Bb.N.pa('016a697ef00ce7554691');olympe.dm.Bb.Da=U(olympe.dm.Bb.N,olympe.dm.Bb.F);olympe.dm.Bb.C=olympe.dm.Bb.N.pa('016a697ef00ce7554692');
857
- U(olympe.dc.CloudObject.N,olympe.dm.Bb.C);olympe.dm.Bb.prototype.L.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.Bb.prototype.C.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.Bb.prototype.P.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.Ac=class extends olympe.dm.Bb{C(){return this.X()===olympe.dm.Ac.da?this.ib(olympe.dm.Ac.P,olympe.dm.Bb):this.ib(olympe.dm.Ac.T,olympe.dm.Bb)}};olympe.dm.Ac.N=olympe.dc.ka.C('ff021000000000000020',olympe.dm.Ac);olympe.dm.Ac.T=olympe.dm.Ac.N.pa('017e9c34cf48bd6965c1');olympe.dm.Ac.P=olympe.dm.Ac.N.pa('017e9c2e013e06bfffd9');olympe.dm.Ac.zd=olympe.dm.Ac.N.pa('01811f12ad77673770d4');olympe.dm.Ac.da=Ae('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Ac.Wb=Ae('10000000000000000001','OLYMPE_FOLDER');
858
- olympe.dm.Ac.prototype.C.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Pu(){return this.rb(olympe.dm.Module.P)}ev(){return this.Gc(olympe.dm.Module.T)}hs(){return this.rb(olympe.dm.Module.F)}jv(){return this.rb(olympe.dm.Module.$)}Bu(){return this.rb(olympe.dm.Module.G)}fv(){return this.ib(olympe.dm.Module.L,olympe.dm.Module)}rv(){return this.ib(olympe.dm.Module.C,olympe.dm.ld)}};olympe.dm.Module.N=olympe.dc.ka.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.P=olympe.dm.Module.N.ja('ff023000000000000042');
851
+ olympe.dm.DataSource.prototype.applyTransaction=olympe.dm.DataSource.prototype.applyTransaction;olympe.dm.DataSource.prototype.executeQuery=olympe.dm.DataSource.prototype.executeQuery;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.ge;
852
+ olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.W;olympe.dm.DataSource.N=olympe.dc.ka.C('ff021000000000000060',olympe.dm.DataSource,olympe.dc.R.Tg);olympe.dm.DataSource.fh=olympe.dm.DataSource.N.ja('ff023000000000000060');B('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.fh);olympe.dm.DataSource.cB=olympe.dm.DataSource.N.ja('ff023000000000000061');olympe.dm.DataSource.kw=olympe.dm.DataSource.N.ja('ff023000000000000062');olympe.dm.DataSource.aq=olympe.dm.DataSource.N.ja('ff023000000000000063');
853
+ olympe.dm.DataSource.jq=olympe.dm.DataSource.N.ja('ff023000000000000064');olympe.dm.DataSource.nw=olympe.dm.DataSource.N.ja('ff023000000000000065');olympe.dm.DataSource.yi=olympe.dm.DataSource.N.pa('ff022000000000000060');olympe.dm.DataSource.SERVER=R('00000000000000000060','Server source');olympe.dm.DataSource.me={jy:'hybrid',Rm:'bus',Tn:'http'};olympe.dm.DataSource.Ob={Sg:'ready',Cb:'error',qr:'down'};olympe.dm.xd=class extends olympe.dc.CloudObject{};olympe.dm.xd.N=olympe.dc.ka.C('ff021000000000000070',olympe.dm.xd);olympe.dm.xd.F=olympe.dm.xd.N.pa('ff023000000000000071');olympe.dm.xd.C=olympe.dm.xd.N.pa('ff023000000000000072');olympe.dm.xd.G=olympe.dm.xd.N.pa('ff023000000000000073');olympe.dm.Ab=class extends olympe.dm.BrickMetadata{L(){return new olympe.dc.ua(this.X(),[new olympe.dc.ba.ce(olympe.dm.Ab.F.X(),olympe.dc.wa.DESTINATION,olympe.dc.ba.kp.Jr,olympe.dc.ba.kp.Kr),olympe.dm.Ab.C])}Td(){return olympe.sc.ad.ee.cr}C(){return this.ib(olympe.dm.Ab.F,olympe.dm.Ab)}P(){return this.ib(olympe.dm.Ab.C)}};olympe.dm.Ab.N=olympe.dc.ka.C('01612df1db9749227626',olympe.dm.Ab);olympe.dm.Ab.F=olympe.dm.Ab.N.pa('016a697ef00ce7554691');olympe.dm.Ab.Da=U(olympe.dm.Ab.N,olympe.dm.Ab.F);
854
+ olympe.dm.Ab.C=olympe.dm.Ab.N.pa('016a697ef00ce7554692');U(olympe.dc.CloudObject.N,olympe.dm.Ab.C);olympe.dm.Ab.prototype.L.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.Ab.prototype.C.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.Ab.prototype.P.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.vc=class extends olympe.dm.Ab{C(){return this.X()===olympe.dm.vc.da?this.ib(olympe.dm.vc.P,olympe.dm.Ab):this.ib(olympe.dm.vc.T,olympe.dm.Ab)}};olympe.dm.vc.N=olympe.dc.ka.C('ff021000000000000020',olympe.dm.vc);olympe.dm.vc.T=olympe.dm.vc.N.pa('017e9c34cf48bd6965c1');olympe.dm.vc.P=olympe.dm.vc.N.pa('017e9c2e013e06bfffd9');olympe.dm.vc.ye=olympe.dm.vc.N.pa('01811f12ad77673770d4');olympe.dm.vc.da=R('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.vc.$b=R('10000000000000000001','OLYMPE_FOLDER');
855
+ olympe.dm.vc.Vb=R('10000000000000000002','INTERNAL_FOLDER');olympe.dm.vc.prototype.C.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Ou(){return this.rb(olympe.dm.Module.P)}dv(){return this.Gc(olympe.dm.Module.T)}hs(){return this.rb(olympe.dm.Module.F)}hv(){return this.rb(olympe.dm.Module.$)}Au(){return this.rb(olympe.dm.Module.G)}ev(){return this.ib(olympe.dm.Module.L,olympe.dm.Module)}qv(){return this.ib(olympe.dm.Module.C,olympe.dm.ld)}};olympe.dm.Module.N=olympe.dc.ka.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.P=olympe.dm.Module.N.ja('ff023000000000000042');
859
856
  olympe.dm.Module.T=olympe.dm.Module.N.ja('ff023000000000000043');olympe.dm.Module.F=olympe.dm.Module.N.ja('ff023000000000000044');olympe.dm.Module.$=olympe.dm.Module.N.ja('ff023000000000000045');olympe.dm.Module.G=olympe.dm.Module.N.ja('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.N.ja('ff023000000000000049');olympe.dm.Module.C=olympe.dm.Module.N.pa('ff022000000000000013');olympe.dm.Module.L=olympe.dm.Module.N.pa('ff022000000000000014');
860
- olympe.dm.Module.da=Ae('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');l=olympe.dm.Module.prototype;l.Pu.J=olympe.D.H.F;l.ev.J=olympe.D.H.G;l.hs.J=olympe.D.H.F;l.jv.J=olympe.D.H.F;l.Bu.J=olympe.D.H.F;l.fv.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.rv.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.File=class extends olympe.dc.CloudObject{static F(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.Fd().fromModel(a);a=b.create(a,f).uh(g);b=olympe.D.Za.now();Z(Z(Z(Z(Z(Z(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.C,!1);return a.X()}constructor(a,b,c,d,e){super(a,
861
- b);this.F=c;this.G=d;this.C=e}am(){return this.rb(olympe.dm.File.mimeTypeProp)}Kj(a,b){const c=olympe.D.Ma().G(a),d=b&&olympe.D.Ma().G(b);(a=this.db.Qa(this,olympe.dm.File.urlProp,!0))&&a.startsWith('blob:')?this.C.C(a,e=>{e.arrayBuffer().then(c).catch(f=>null==d?void 0:d(`${f}`))},d):this.F.F(this,e=>{e.arrayBuffer().then(c).catch(f=>null==d?void 0:d(`${f}`))},e=>{null==d||d(e)})}Vl(a,b){this.Kj(c=>{a(Ha(c))},b)}Lj(a,b){const c=olympe.D.Ma().G(a),d=b&&olympe.D.Ma().G(b),e=this.db.Qa(this,olympe.dm.File.C),
862
- f=this.db.Qa(this,olympe.dm.File.urlProp),g=h=>{const k=this.db.Qa(this,olympe.dm.File.mimeTypeProp);h.arrayBuffer().then(m=>{c(`data:${k};base64,${this.C.F(m)}`)}).catch(m=>null==d?void 0:d(`${m}`))};e&&e.valueOf()?this.F.F(this,g.bind(this),d):f&&f.startsWith('blob:')?this.C.C(f,g.bind(this),d):'string'===typeof f?a(f):b(`No content nor URL associated to the file ${this.X()}`)}rename(a,b){const c=b&&olympe.D.Ma().G(b);olympe.D.Aq([a],d=>{const e=new olympe.dc.Sa;e.update(this,olympe.dc.CloudObject.nameProp,
863
- d);e.update(this,olympe.dm.File.fileNameProp,d);e.lb(f=>{c&&c(f)})})}rw(){this.G.P(this.get(olympe.dm.File.mimeTypeProp))}Uk(){return this.rb(olympe.dm.File.urlProp)}ko(){return this.rb(olympe.dm.File.fileNameProp)}Fu(){return this.mi(olympe.dm.File.creationDateProp)}dv(){return this.mi(olympe.dm.File.modificationDateProp)}wq(){return this.oh(olympe.dm.File.C)}};olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.rw;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Lj;
864
- olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Vl;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Kj;olympe.dm.File.N=olympe.dc.ka.C('ff021000000000000030',olympe.dm.File,olympe.dc.R.Qi,olympe.net.R.Ga,olympe.Z.R.Cg);olympe.dm.File.nameProp=olympe.dm.File.N.ja('ff023000000000000050');B('olympe.dm.File.nameProp',olympe.dm.File.nameProp);olympe.dm.File.fileNameProp=olympe.dm.File.N.ja('ff023000000000000050');B('olympe.dm.File.fileNameProp',olympe.dm.File.fileNameProp);
857
+ olympe.dm.Module.da=R('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');l=olympe.dm.Module.prototype;l.Ou.J=olympe.D.H.F;l.dv.J=olympe.D.H.G;l.hs.J=olympe.D.H.F;l.hv.J=olympe.D.H.F;l.Au.J=olympe.D.H.F;l.ev.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.qv.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.File=class extends olympe.dc.CloudObject{static F(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.Ed().fromModel(a);a=b.create(a,f).wh(g);b=olympe.D.Za.now();Z(Z(Z(Z(Z(Z(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.C,!1);return a.X()}constructor(a,b,c,d,e){super(a,
858
+ b);this.F=c;this.G=d;this.C=e}$l(){return this.rb(olympe.dm.File.mimeTypeProp)}Kj(a,b){const c=olympe.D.Ma().G(a),d=olympe.D.Ma().G(e=>null==b?void 0:b(`${e}`));(a=this.db.Qa(this,olympe.dm.File.urlProp,!0))&&a.startsWith('blob:')?this.C.C(a,e=>{e.arrayBuffer().then(c).catch(d)},d):this.F.F(this,e=>{e.arrayBuffer().then(c).catch(d)},e=>{null==d||d(e)})}Ul(a,b){this.Kj(c=>{a(Ha(c))},b)}Lj(a,b){const c=olympe.D.Ma().G(a),d=olympe.D.Ma().G(h=>null==b?void 0:b(`${h}`)),e=this.db.Qa(this,olympe.dm.File.C),
859
+ f=this.db.Qa(this,olympe.dm.File.urlProp),g=h=>{const k=this.db.Qa(this,olympe.dm.File.mimeTypeProp);h.arrayBuffer().then(m=>{c(`data:${k};base64,${this.C.F(m)}`)}).catch(d)};e&&e.valueOf()?this.F.F(this,g.bind(this),d):f&&f.startsWith('blob:')?this.C.C(f,g.bind(this),d):'string'===typeof f?a(f):b(`No content nor URL associated to the file ${this.X()}`)}rename(a,b){const c=b&&olympe.D.Ma().G(b);olympe.D.zq([a],d=>{const e=new olympe.dc.Sa;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,
860
+ olympe.dm.File.fileNameProp,d);e.lb(f=>{c&&c(f)})})}qw(){this.G.P(this.get(olympe.dm.File.mimeTypeProp))}Tk(){return this.rb(olympe.dm.File.urlProp)}io(){return this.rb(olympe.dm.File.fileNameProp)}Eu(){return this.ni(olympe.dm.File.creationDateProp)}bv(){return this.ni(olympe.dm.File.modificationDateProp)}vq(){return this.ph(olympe.dm.File.C)}};olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.qw;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Lj;
861
+ olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Ul;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Kj;olympe.dm.File.N=olympe.dc.ka.C('ff021000000000000030',olympe.dm.File,olympe.dc.R.Qi,olympe.net.R.Ga,olympe.Z.R.Cg);olympe.dm.File.nameProp=olympe.dm.File.N.ja('ff023000000000000050');B('olympe.dm.File.nameProp',olympe.dm.File.nameProp);olympe.dm.File.fileNameProp=olympe.dm.File.N.ja('ff023000000000000050');B('olympe.dm.File.fileNameProp',olympe.dm.File.fileNameProp);
865
862
  olympe.dm.File.creationDateProp=olympe.dm.File.N.ja('ff023000000000000051');B('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.N.ja('ff023000000000000055');B('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.N.ja('ff023000000000000052');B('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.N.ja('ff023000000000000053');
866
- B('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.N.ja('ff023000000000000054');olympe.dm.File.N.C=olympe.dm.File.F.bind(null,olympe.dm.File);olympe.dm.File.P='application/data';olympe.dm.File.va=[olympe.D.File];l=olympe.dm.File.prototype;l.am.J=olympe.D.H.F;l.Kj.J=new olympe.D.H(()=>{},[]);l.Vl.J=new olympe.D.H(()=>{},[]);l.Lj.J=new olympe.D.H(()=>{},[]);l.rename.J=olympe.D.H.C;l.Uk.J=olympe.D.H.F;l.ko.J=olympe.D.H.F;l.Fu.J=new olympe.D.H(()=>olympe.D.Za,[]);
867
- l.dv.J=new olympe.D.H(()=>olympe.D.Za,[]);l.wq.J=olympe.D.H.P;olympe.dm.ld=class extends olympe.dc.CloudObject{C(){return this.rb(olympe.dm.ld.F)}G(){return this.Gc(olympe.dm.ld.G)}F(){return this.ib(olympe.dm.ld.C,olympe.dm.Module)}};olympe.dm.ld.N=olympe.dc.ka.C('ff021000000000000041',olympe.dm.ld);olympe.dm.ld.F=olympe.dm.ld.N.ja('ff023000000000000047');olympe.dm.ld.G=olympe.dm.ld.N.ja('ff023000000000000048');olympe.dm.ld.C=olympe.dm.Module.C.Rb();olympe.dm.ld.prototype.C.J=olympe.D.H.F;olympe.dm.ld.prototype.G.J=olympe.D.H.G;
868
- olympe.dm.ld.prototype.F.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.pb=class extends olympe.dm.Ac{C(){return this.ib(olympe.dm.Bb.F,olympe.dm.Bb)}G(){return this.rb(olympe.dm.pb.$)}T(){return this.rb(olympe.dm.pb.ub)}F(){return this.ib(olympe.dm.pb.G,olympe.dm.pb)}};olympe.dm.pb.N=olympe.dc.ka.C('0163d9594700fcf61e54',olympe.dm.pb);olympe.dm.pb.$=olympe.dm.pb.N.ja('017869c7d2833c9492c1');olympe.dm.pb.ub=olympe.dm.pb.N.ja('017869c80bb9929c76d0');olympe.dm.pb.mb=olympe.dm.pb.N.pa('ff02200000000000002a');olympe.dm.pb.G=olympe.dm.pb.N.pa('ff02200000000000002b');
869
- olympe.dm.pb.qd=U(olympe.dm.pb.N,olympe.dm.pb.G);olympe.dm.pb.L=olympe.dm.pb.N.pa('ff02200000000000002c');olympe.dm.pb.jd=olympe.dm.pb.N.pa('017e9c412e2b944bd590');olympe.dm.pb.ze=olympe.dm.pb.N.pa('017e9c416872a89d3415');olympe.dm.pb.ye=olympe.dm.pb.N.pa('017ebf8fe5c506662098');U(olympe.dc.CloudObject.N,olympe.dm.pb.mb);olympe.dm.pb.ac=Ae('100000000000000000dd','PRIMORDIAL');olympe.dm.pb.prototype.C.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.pb.prototype.G.J=olympe.D.H.F;
870
- olympe.dm.pb.prototype.T.J=olympe.D.H.F;olympe.dm.pb.prototype.F.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{C(){return this.Yb(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Yb(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}F(){return this.Ij(olympe.dm.Property.typeRel).Ad()}yc(){return this.C().ia().cq(this.ia())}};olympe.dm.Property.N=olympe.dc.ka.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=U(olympe.dm.Property.N,olympe.dc.CloudObject.propertyRel);
871
- B('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=U(olympe.dm.Property.N,olympe.dc.CloudObject.typeRel);B('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.F.J=olympe.D.H.C;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Zu(){return olympe.D.Ka.EMPTY}xu(){return this.Gc(olympe.dm.Relation.F)}kv(){return this.Gc(olympe.dm.Relation.G)}nq(){return this.ib(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).xc()}sq(){return this.ib(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).xc()}yc(){return this.sq().ia().concat(['-',this.ia(),'->',this.nq().ia()])}};olympe.dm.Relation.N=olympe.dc.ka.C('ff021000000000000006',olympe.dm.Relation);
872
- olympe.dm.Relation.G=olympe.dm.Relation.N.ja('ff023000000000000030');olympe.dm.Relation.F=olympe.dm.Relation.N.ja('ff023000000000000034');olympe.dm.Relation.da=olympe.dm.Relation.N.ja(olympe.dc.Ob.vn);olympe.dm.Relation.$=olympe.dm.Relation.N.ja(olympe.dc.Ob.qc);olympe.dm.Relation.ga=olympe.dm.Relation.N.ja(olympe.dc.Ob.Ef);olympe.dm.Relation.na=olympe.dm.Relation.N.ja(olympe.dc.Ob.lt);olympe.dm.Relation.T=olympe.dm.Relation.N.ja('ff023000000000000031');
873
- olympe.dm.Relation.originModelRel=U(olympe.dm.Relation.N,olympe.dc.CloudObject.xi);B('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=U(olympe.dm.Relation.N,olympe.dc.CloudObject.jq);B('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.C={Ir:0,Vq:5,cp:1,dt:4,Al:2,nl:8,xx:10,fz:6,gz:9,Id:6,hz:9};olympe.dm.Relation.L={Ky:3,Os:4,xy:5,wy:6};olympe.dm.Relation.P=olympe.dm.fk.Qs+olympe.dm.fk.lr;
874
- l=olympe.dm.Relation.prototype;l.Zu.J=olympe.D.H.F;l.xu.J=olympe.D.H.G;l.kv.J=olympe.D.H.G;l.nq.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.sq.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.dm.re=class extends olympe.dc.CloudObject{getValue(){}};olympe.dm.re.N=olympe.dc.ka.C('ff021000000000000019',olympe.dm.re);olympe.dm.String=class extends olympe.dm.re{getValue(){return this.rb(olympe.dm.String.valueProp)}toString(){return this.get(olympe.dm.String.valueProp)}};olympe.dm.String.N=olympe.dc.ka.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.N.ja('ff023000000000000026');B('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.J=olympe.D.H.F;olympe.dm.String.prototype.toString.J=olympe.D.H.C;olympe.dm.Boolean=class extends olympe.dm.re{getValue(){return this.oh(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.N=olympe.dc.ka.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.N.ja('ff023000000000000027');B('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.J=olympe.D.H.P;olympe.dm.Color=class extends olympe.dm.re{getValue(){return this.tq()}};olympe.dm.Color.N=olympe.dc.ka.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.N.ja('ff023000000000000032');B('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.J=new olympe.D.H(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.re{getValue(){return this.mi(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.N=olympe.dc.ka.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.N.ja('ff023000000000000029');B('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.J=new olympe.D.H(()=>olympe.D.Za,[]);olympe.dm.Enum=class extends olympe.dm.String{ia(){return olympe.D.sa([super.ia(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Ka)}Ed(){return this.Gc(olympe.dm.Enum.rankProp)}static create(a,b,c,d,e){const f=olympe.dc.ta();e=void 0!==e?e:f.Ia(b)&&f.Sd(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.dm.Enum.create=olympe.dm.Enum.create;
875
- olympe.dm.Enum.N=olympe.dc.ka.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.N.ja('017a7690c915975ea995');olympe.dm.Enum.prototype.Ed.J=olympe.D.H.G;olympe.dm.yf=class extends olympe.dm.BrickMetadata{Bv(){return this.eb(olympe.dc.CloudObject.instancesRel).bk(olympe.dm.Enum.rankProp,olympe.dc.query.hj.ASC).Ad()}static create(a,b){b=a.create(olympe.dm.yf,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Ea(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.yf.create=olympe.dm.yf.create;olympe.dm.yf.prototype.getValues=olympe.dm.yf.prototype.Bv;olympe.dm.yf.N=olympe.dc.ka.C('017a768f966fc08ebb98',olympe.dm.yf);olympe.dm.Number=class extends olympe.dm.re{getValue(){return this.Gc(olympe.dm.Number.valueProp)}};olympe.dm.Number.N=olympe.dc.ka.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.N.ja('ff023000000000000028');B('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.J=olympe.D.H.G;olympe.sc={};olympe.sc.R={za:'sc.Logger',ol:'sc.RootContext',ee:'sc.Serializer'};olympe.sc.U={Ke:'sc.app',uf:'sc.debug',tn:'sc.debugger',mr:'sc.disableTheme',PRODUCTION:'sc.production',Ps:'sc.onstartTimeout',fp:'sc.remoteActionTimeout',Io:'sc.offlineStart'};
876
- olympe.V.config(a=>{F(a,olympe.sc.U.Ke,'');F(a,olympe.sc.U.Io,!1);F(a,olympe.sc.U.uf,!1);F(a,olympe.sc.U.mr,!0);F(a,olympe.sc.U.PRODUCTION,!1);F(a,olympe.sc.U.Ps,2E4);F(a,olympe.sc.U.fp,1E4);E(a,olympe.sc.R.za,[olympe.la.R.Ga],b=>b.Fc('sc'));D(a,olympe.sc.R.ee,olympe.sc.fg,olympe.dc.R.Oe);va(a,olympe.dc.sources.R.ee,olympe.sc.R.ee);E(a,olympe.sc.R.ol,[new olympe.V.ma(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.vd('root','root',null);olympe.sc.um=c;c.set(olympe.sc.xa.C.PRODUCTION,b);return new olympe.sc.xa(c)})},
877
- 'olympe.sc');olympe.V.run([olympe.sc.R.ol],a=>{olympe.Mj().ctx=a});olympe.sc.hm=()=>null!==olympe.dc.ta().Tb(void 0,olympe.sc.Runnable.C.Rb());olympe.sc.cB=(a,b,c,d)=>{c=Z(Z(a.create(olympe.sc.Dc),olympe.sc.Dc.C,c||null),olympe.sc.Dc.G,d||null);a.Ea(olympe.sc.Dc.F,c,b);a.Ea(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.kg=a=>{a=olympe.dc.Fb.kg(a);return a instanceof olympe.sc.be?a.C():a};olympe.sc.yB=a=>{a=me(a);return a instanceof olympe.sc.be?a.C():a};
878
- olympe.sc.uB=function(a){const b=olympe.dm.Bb.C.Rb(),c=olympe.dc.CloudObject.containsRel.Rb();var d=olympe.dc.fa(a);if(void 0===d)return[];a=olympe.dc.ta();var e=a.model(d);const f=[],g=[];let h=[];if(a.ri(e,olympe.dm.Bb))h.push(d);else{for(e=[];null===a.Tb(d,b);){e.push(d);const k=a.Tb(d,c);if(null===k)return olympe.la.fb('sc').warn(`Object ${d} has no container`),[];a.$c(d,olympe.sc.logic.hb)||k===a.Tb(d,olympe.sc.Runnable.C.Rb())||f.push(d);d=k;if(e.includes(d))throw Error(`Instance ${d} (${a.name(d)}) is part of a cyclic contain pattern`);
879
- }g.push(d);h.push(a.Tb(g[0],b))}h=h.concat(a.qg(h[0],olympe.dm.Bb.Da));h=h.concat(a.qg(h[h.length-1],olympe.dm.Ac.T.Rb()));h=h.concat(a.qg(h[h.length-1],olympe.dm.Ac.P.Rb()));return[...f,...g,...h].reverse()};olympe.sc.wB=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Xf:a.startsWith('video/')?olympe.sc.Zg:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.rc:olympe.dm.File};
880
- olympe.sc.sB=a=>a instanceof olympe.sc.Xf?'image/*':a instanceof olympe.sc.Zg?'video/*':a instanceof olympe.sc.rc?'font/*,application/font-woff':null;olympe.sc.tb={};function Fk(a){const b=olympe.dc.ta();let c;try{const d=[a];let e=a.getParent();for(;null!==e&&e.C!==olympe.sc.um;)d.unshift(e),e=e.getParent();c=d.map(f=>{const g=f.Ee();return null!==g?(f=b.model(g),b.name(g)||f&&b.name(f)||g):f.W()}).join(' > ')}catch(d){c=`No stack available for context ${a.W()}: ${d}`,a.K.warn(c)}return c}
881
- function Gk(a,b){var c=olympe.sc.xa,d=a.C;a=a.F();b=olympe.dc.fa(b);let e,f=null==(e=d.F)?void 0:e.get(b);if(!f){f=d.gh(a,void 0,b);for(d=f.getParent();d&&d.ga&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||Hk(g,b,f)}return new c(f)}function Ik(a){let b;return null!=(b=a.Ta(olympe.sc.xa.C.PRODUCTION))?b:!1}
882
- olympe.sc.xa=class{constructor(a=olympe.sc.um){this.C=a;this.K=olympe.la.fb('sc');this.G=null}W(){return this.C.W()}getParent(){if(null===this.G){const a=this.C.getParent();this.G=null===a?null:new olympe.sc.xa(a)}return this.G}yu(a){const b=olympe.dc.ta();let c=this.getParent();const d=e=>{if(e.Ee()){const f=b.model(e.Ee());if(f&&b.Qa(f,olympe.sc.Xa.da)||a.modelTag&&!b.$c(e.Ee(),a.modelTag))return!1}return!0};for(;c&&!d(c);)c=c.getParent();return c}Ee(){return this.C.Ee()}F(){return this.C.C}set(a,
883
- b){this.C.set(a,b);return this}Am(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}vb(a,b,c=!1){const d=olympe.dc.fa(a),e=olympe.D.ec(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.C.W():void 0));return e.vb()}get(a,b=!1){a=this.Ta(a,b);return void 0!==a?a:null}has(a,b=!1){return this.C.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,
884
- d.next.bind(d),c?void 0:this.C.W(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Jk(this.C,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.yg(a.unsubscribe.bind(a));return this}qw(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.gh(`Runner ${a.name()}`);a.run(b);return b}Hw(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)})\``+
885
- `on the context ${this.W()}:\nStack: ${Fk(this)}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.W()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.fa(a)})\` `+`has never received any value:\nStack: ${Fk(this)}`);e(Error(g))}))})}sw(a){this.set(olympe.sc.xa.C.Sf,a);return this}Ta(a,b=!0){return this.C.Ta(a,b)}on(a,b,c,d=!0){return this.C.on(a,b,c,d)}gh(a){return new olympe.sc.xa(this.C.gh(this.F(),a))}Zj(a,b){return this.C.Zj(a,c=>{b(new olympe.sc.xa(c))})}hv(a){a=
886
- Kk(this.C,a);return a===this.C?this:a&&new olympe.sc.xa(a)}destroy(){this.C.destroy()}yg(a,b){return this.C.yg(a,b)}Xj(a){this.C.Xj(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.F().onDestroy(a)}pf(a){this.gb()||this.F().pf(a)}clear(){this.C.clear()}gb(){return this.F().gb()}Qa(a){a=Lk(this.C,a);return null!==a?new olympe.sc.ui.ax(a,this):null}Ou(a){a=Lk(this.C,a);return null!==a?new olympe.sc.ui.$w(a,this):null}aw(...a){return rxjs.combineLatest(a.map(b=>{b=Lk(this.C,b);return null!==b?this.observe(b):
887
- rxjs.of(null)}))}Ha(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.C===a.C}};olympe.sc.xa.prototype.observeMany=olympe.sc.xa.prototype.aw;olympe.sc.xa.prototype.getEvent=olympe.sc.xa.prototype.Ou;olympe.sc.xa.prototype.getProperty=olympe.sc.xa.prototype.Qa;olympe.sc.xa.prototype.isDestroyed=olympe.sc.xa.prototype.gb;olympe.sc.xa.prototype.clear=olympe.sc.xa.prototype.clear;olympe.sc.xa.prototype.offDestroy=olympe.sc.xa.prototype.pf;olympe.sc.xa.prototype.onDestroy=olympe.sc.xa.prototype.onDestroy;
888
- olympe.sc.xa.prototype.offClear=olympe.sc.xa.prototype.Xj;olympe.sc.xa.prototype.onClear=olympe.sc.xa.prototype.yg;olympe.sc.xa.prototype.destroy=olympe.sc.xa.prototype.destroy;olympe.sc.xa.prototype.getOtherContext=olympe.sc.xa.prototype.hv;olympe.sc.xa.prototype.onContext=olympe.sc.xa.prototype.Zj;olympe.sc.xa.prototype.createChild=olympe.sc.xa.prototype.gh;olympe.sc.xa.prototype.setParentElement=olympe.sc.xa.prototype.sw;olympe.sc.xa.prototype.waitFor=olympe.sc.xa.prototype.Hw;
889
- olympe.sc.xa.prototype.runner=olympe.sc.xa.prototype.qw;olympe.sc.xa.prototype.repeat=olympe.sc.xa.prototype.repeat;olympe.sc.xa.prototype.observe=olympe.sc.xa.prototype.observe;olympe.sc.xa.prototype.has=olympe.sc.xa.prototype.has;olympe.sc.xa.prototype.get=olympe.sc.xa.prototype.get;olympe.sc.xa.prototype.remove=olympe.sc.xa.prototype.remove;olympe.sc.xa.prototype.trigger=olympe.sc.xa.prototype.Am;olympe.sc.xa.prototype.set=olympe.sc.xa.prototype.set;olympe.sc.xa.prototype.getClosest=olympe.sc.xa.prototype.yu;
890
- olympe.sc.xa.prototype.getParent=olympe.sc.xa.prototype.getParent;olympe.sc.xa.C={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',Sf:'__htmlContainer',sx:'__dockableElement'};olympe.sc.Op=class extends olympe.sc.xa{constructor(a){super(a);this.L=new olympe.D.Jb('SC Update Context',super.F());const b=a.yg(()=>{b&&a.Xj(b);this.L.destroy()})}F(){return this.L}yg(a,b){return this.F().onDestroy(a,null!=b?b:olympe.Z.hc())}};function Jk(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 Kk(a,b){if(b===a.id||a.L.has(b)||!b)return a;for(a=a.da;a;){if(b===a.W()||a.L.has(b))return a;const c=Mk(a.F,b);if(c)return c;a=a.getParent()}return null}function Lk(a,b){let c;return(null==(c=a.$)?void 0:c.get('IO#'+b))||null}
891
- function Nk(a){a.C.$(()=>{Ok(a,c=>c.destroy())});a.C.onDestroy(()=>{void 0!==a.Ta(olympe.sc.xa.C.TRANSACTION,!1)&&a.K.warn(`The context ${a.W()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);let c;if(null!=(c=a.da)){let d;null==(d=c.F)||d.delete(a.W());let e;0===(null==(e=c.F)?void 0:e.size)&&(c.F=null)}a.L.clear()});let b;null==(b=a.da)||Pk(b,a)}
892
- function Mk(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ga&&!c.id.startsWith('_')&&(a=Mk(c.F,b)))return a;return null}function Qk(a,b){a.Da=olympe.dc.fa(b);a.ga=b.sd().hm();b.F().forEach(c=>{a.id===c||a.L.has(c)||(a.L.add(c),Hk(a,c,a))});a.$=b.T()}function Rk(a){a.na=!0;let b;null==(b=a.F)||b.forEach(c=>{Rk(c)})}function Sk(a){a.na=!1;let b;null==(b=a.F)||b.forEach(c=>{Sk(c)})}
893
- function Tk(a,...b){var c=olympe.sc.tb.ue.C.ql;if(null!==a.tb)for(const {$j:d,depth:e}of a.tb.values())d.process(a,c,e,...b)}function Uk(a,b,c,d){const e='$'+b;a.T.add(b);c.map(f=>'@'+f+'.'+b).forEach(f=>{let g,h;null==(g=a.G)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});Ok(a,f=>{!f.na&&f.T.has(b)||f.data.has(e)||Uk(f,b,c,d)});a.T.delete(b)}
894
- function Vk(a,b,c){a.G||(a.G=new Map);let d=a.G.get(b);void 0===d&&(d=new Map,a.G.set(b,d));olympe.sc.vd.C+=1;const e=olympe.sc.vd.C;d.set(e,c);return()=>{const f=a.G.get(b);f&&(f.delete(e),0===f.size&&a.G.delete(b))}}function Hk(a,b,c){a.T.add(b);let d;const e=null==(d=a.G)?void 0:d.get('&'+b);if(e)for(const f of e.values())f(c);Ok(a,f=>{f.T.has(b)||Hk(f,b,c)});a.T.delete(b)}function Ok(a,b){let c;null==(c=a.F)||c.forEach(b)}function Wk(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}
895
- function Xk(a,b){if(null!==a.tb&&a.tb.has(b)){var {$j:c,depth:d}=a.tb.get(b);Ok(a,e=>{Xk(e,b)});0===d&&c.F();a.tb.delete(b);0===a.tb.size&&(a.tb=null)}}function Yk(a,b,c=0){null===a.tb&&(a.tb=new Map);a.tb.has(b.W())||(a.tb.set(b.W(),{$j:b,depth:c}),Ok(a,d=>{(-1===b.G||c<b.G)&&Yk(d,b,c+1)}),a.onDestroy(()=>{Xk(a,b.W())}));b.W()}function Zk(a){var b=olympe.sc.tb.ue.F.Df;const c=[];if(null!==a.tb)for(const {$j:d}of a.tb.values())d.getType()===b&&(c.push(d.W()),d.F(),Xk(a,d.W()))}
896
- function Pk(a,b){null===a.F&&(a.F=new Map);a.F.set(b.id,b)}
897
- olympe.sc.vd=class{constructor(a,b='no name',c=olympe.sc.um){this.id=a;this.Xc=b;this.L=new Set;this.da=c;this.C=new olympe.D.Jb('SC Context');this.data=new Map;this.Da=this.P=this.F=this.G=null;this.ga=!1;this.T=new Set;this.na=!1;this.$=null;this.K=olympe.la.fb('sc');this.tb=null;Nk(this)}W(){return this.id}getParent(){return this.da}Ee(){return this.Da}set(a,b){if(!this.C.Bc()&&!this.C.gb()){const f=olympe.dc.fa(a);var c,d,e;let g;a=null!=(g=null!=(e=null==(c=this.$)?void 0:c.get('O#'+f))?e:null==
898
- (d=this.$)?void 0:d.get('IO#'+f))?g:f;c='$'+a;(d=this.data.get(c))&&d.valueOf&&(d=d.valueOf());void 0===b||null===b?void 0!==d&&(this.data.delete(c),null!==this.tb&&0<this.tb.size&&Tk(this,a,null),Uk(this,a,['*',this.id,...this.L],null)):((e=void 0===d)||(e=!('function'===typeof b.Ha?b.Ha(d):b.valueOf()===d.valueOf())),e&&(this.data.set(c,b),null!==this.tb&&0<this.tb.size&&Tk(this,a,b),Uk(this,a,['*',this.id,...this.L],b)))}}on(a,b,c,d=!0){if(this.C.gb()||this.C.Bc())return()=>{};const e=Jk(this,
899
- a),f=c?olympe.dc.fa(c):'*';a=Vk(this,'@'+f+'.'+e,b);c=c?(c=Kk(this,f))?c.Ta(e,!1):void 0:this.Ta(e);void 0!==c&&b(c);if(d)olympe.D.Ma().onDestroy(a);return a}has(a,b=!1){a='$'+Jk(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}gh(a,b,c){const d=null!=c?c:'_'+olympe.Z.hc();if(a.gb()||a.Bc())throw Error(`Try to create new child context in a destroyed context ${a.W()}, probably because \`runner()\` is called on a destroyed context`);const e=
900
- a.run(()=>new olympe.sc.vd(d,b,this));null!==this.tb&&0<this.tb.size&&this.tb.forEach(({$j:f,depth:g})=>{(-1===f.G||g<f.G)&&Yk(e,f,g+1)});return e}Zj(a,b){const c=Kk(this,a);if(c)return b(c),()=>{};const d=Vk(this,'&'+a,e=>{d&&d();b(e)});return d}Ta(a,b=!0){a='$'+Jk(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.C.Bc()||this.C.gb()||this.C.destroy()}yg(a,b){if(this.C.gb())a();else return++olympe.sc.vd.C,b=b||
901
- String(olympe.sc.vd.C),null===this.P&&(this.P=new Map),this.P.set(b,a),b;return b||'noId'}Xj(a){null!==this.P&&this.P.delete(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.C.onDestroy(a)}clear(){if(!this.C.Bc()&&!this.C.gb()){let a;null==(a=this.P)||a.forEach(b=>b())}}gb(){return this.C.gb()}};olympe.sc.vd.prototype.getParent=olympe.sc.vd.prototype.getParent;olympe.sc.vd.C=0;olympe.sc.vd.F={Pr:'I#',Rs:'O#',oy:'IO#'};function $k(a,b,c){return(c=c.Ee())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.tb.ue=class{constructor(a=-1){this.id=olympe.Z.ef();this.active=!0;this.G=a}F(){this.active=!1}W(){return this.id}getType(){}process(){}};olympe.sc.tb.ue.C={ql:'SET'};olympe.sc.tb.ue.F={Df:'REMOTE',ys:'LOCAL'};olympe.sc.yd=class a{constructor(){this.F=this.L=this.P=null;this.T=new Map;this.G=new Map;this.C=new olympe.Z.yl(1E4);Ka(this.C,b=>{Zk(b)})}da(b,c,d){const e=b.body(),f=e.c,g=this.T.get(f);switch(e.t){case olympe.sc.yd.C.Ss:c=this.G.get(e.f);b.ed(c).catch(m=>{d.error('Unable to reply with paths: ',m)});break;case olympe.sc.yd.C.Ts:const h=f+c,k=(m,n,p=0)=>{Wk(m,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.G(q):t=q;let u;q=null!=(u=m.Ee())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
902
- t])})};b.qm(h).then(()=>{const m=[];k(g,m,0);Ok(g,p=>{k(p,m,1)});olympe.O.qb.publish(h,{t:olympe.sc.yd.C.Nr,v:m,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.tb.ft(h);Yk(g,n);this.C.has(g)?Ja(this.C,g):this.C.add(g)}).catch(m=>{d.error('Error notifying on a contextId : ',m)});break;case olympe.sc.yd.C.Us:void 0!==g&&this.C.has(g)&&Ja(this.C,g);break;case olympe.sc.yd.C.Dk:void 0!==g&&(this.C.delete(g),Zk(g))}}ga(b,c,d){this.P=new olympe.O.qb('discovery_debug_id',
903
- c);this.P.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.yd.C.nr){e=f.i;f=f.f;if(!this.G.has(f)){const g=this.$(f,c,b);if(0!==g.length)this.G.set(f,g);else return}null===this.F&&(this.F=olympe.Z.ef(),f=new olympe.D.Jb(this.F,c.F()),this.L=new olympe.O.qb(this.F,f),this.L.listen().subscribe(g=>{this.da(g,b,d)}));olympe.O.qb.publish(e,{t:olympe.sc.yd.C.Iq,n:olympe.V.getParameter(olympe.sc.U.tn)||'no name',a:b,s:this.F}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}$(b,c,
904
- d){const e=[],f=olympe.dc.ta(),g=(h,k)=>{Ok(h,m=>{if(null!==m.Ee()){const n=olympe.dc.CloudObject.get(m.Ee()).Ij(olympe.sc.Runnable.L).Ad();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,m.W()]),this.T.set(m.W(),m));g(m,p)}}})};g(c.C,f.name(d));return e}static F(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.G(d));olympe.O.qb.publish(b,{t:olympe.sc.yd.C.Bj,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.la.fb('Debugger').error('Error publishing on service : ',f)})}static G(b){if(null===
905
- b||void 0===b)return'<null>';const c=olympe.dc.ta();if(b instanceof olympe.dc.CloudObject){var d=b.nc();if(!c.$c(d,olympe.sc.Jc))return b.toString();let f=`${b.Dd().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.ra.from(e).Mf(olympe.dc.CloudObject.extendRel,!0).Nd().eb(olympe.dc.CloudObject.propertyRel).Nd().Ad();e=olympe.dc.ra.from(e).Mf(olympe.dc.CloudObject.extendRel,!0).Nd().eb(olympe.dc.CloudObject.xi).Nd().Ad();d=d.filter(([g])=>g instanceof olympe.sc.Jc);0!==d.length&&(f+=
906
- '<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.Jc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.yd.L='discovery_debug_id';olympe.sc.yd.C={nr:0,Iq:1,Ss:2,Ts:3,Nr:4,Bj:5,Us:6,Dk:7};olympe.sc.tb.vy=class extends olympe.sc.tb.ue{constructor(a=-1){super(a);this.C=new Map}getType(){return olympe.sc.tb.ue.F.ys}process(a,b,c,...d){if(this.active&&b===olympe.sc.tb.ue.C.ql){a=$k(c,Jk(a,d[0]),a);d=d[1];let e;null==(e=this.C.get(a))||e(d)}}on(a,b){this.C.set(a,b)}};olympe.sc.tb.ft=class extends olympe.sc.tb.ue{constructor(a){super(1);this.L=a;this.C=new Map;this.db=olympe.dc.ta()}getType(){return olympe.sc.tb.ue.F.Df}F(){super.F();for(const a of this.C.values())a();this.C.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.tb.ue.C.ql&&void 0!==d[0]&&null!==d[0]){const e=$k(c,Jk(a,d[0]),a),f=d[1];let g;null==(g=this.C.get(e))||g();this.C.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Dd()instanceof olympe.sc.Jc){const h=Df(this.db,f,()=>{olympe.sc.yd.F(this.L,
907
- e,f)});this.C.set(e,()=>{Ef(this.db,f,h)})}olympe.sc.yd.F(this.L,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{js(){return this.Gc(this.bm())}ks(){return this.Gc(this.cm())}Qj(){return new olympe.D.Kb(this.Gc(this.bm()),this.Gc(this.cm()))}bm(){}cm(){}};olympe.sc.Metadata.N=olympe.dc.ka.C('0161ae936c62f9fcd131',olympe.sc.Metadata);l=olympe.sc.Metadata.prototype;l.js.J=olympe.D.H.G;l.ks.J=olympe.D.H.G;l.Qj.J=olympe.D.H.T;l.bm.J=olympe.D.H.C;l.cm.J=olympe.D.H.C;olympe.sc.Dc=class extends olympe.dc.CloudObject{F(){return this.rb(olympe.sc.Dc.G)}C(){return this.rb(olympe.sc.Dc.C)}};olympe.sc.Dc.N=olympe.dc.ka.C('01703376c4a81c0e9d90',olympe.sc.Dc);olympe.sc.Dc.G=olympe.sc.Dc.N.ja('01703376c4a81c0e9d91');olympe.sc.Dc.C=olympe.sc.Dc.N.ja('01703376c4a81c0e9d92');olympe.sc.Dc.F=olympe.sc.Dc.N.pa('01703376c4a81c0e9d93');U(olympe.dc.CloudObject.N,olympe.sc.Dc.F);olympe.sc.Dc.prototype.F.J=olympe.D.H.F;olympe.sc.Dc.prototype.C.J=olympe.D.H.F;olympe.sc.ud={};olympe.sc.ud.xe={Xw:null,ht:'screenflow',zt:'ui-design',xp:'software-intelligence',Gg:'data-management'};olympe.sc.Oc=class extends olympe.dm.BrickMetadata{Ud(){return olympe.sc.ud.xe.xp}C(){return this.ib(olympe.sc.Oc.C,olympe.sc.logic.bg)}F(){return this.ib(olympe.sc.Oc.F,olympe.sc.logic.Cf)}};olympe.sc.Oc.N=olympe.dc.ka.C('011100000000000adef0',olympe.sc.Oc);olympe.sc.Oc.C=olympe.sc.Oc.N.pa('016ac4f59a2917fdef01');olympe.sc.Oc.F=olympe.sc.Oc.N.pa('016ac4f59a2917fdef02');olympe.sc.Oc.N.C=(a,b)=>tj(a,b||'New function signature',olympe.sc.Oc,olympe.sc.logic.Jd).X();
908
- olympe.sc.Oc.prototype.C.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.sc.Oc.prototype.F.J=new olympe.D.H(()=>olympe.dc.ua,[]);function al(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function bl(a,b){b=b.filter(c=>'string'===typeof c&&a.db.$c(c,olympe.sc.logic.Lb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Qa(c,olympe.sc.logic.Lb.C,!0))?e:0;let f;d=null!=(f=a.db.Qa(d,olympe.sc.logic.Lb.C,!0))?f:0;return c-d});return b}
909
- olympe.sc.Xa=class extends olympe.dm.BrickMetadata{ls(a,b,c,d,e=!0){e||olympe.la.fb('sc').error('parameter own= false ignored, investigate');return olympe.D.zg(N(this.kf(a,olympe.dc.Fb.kg,c)),d)}pv(){return this.ib(olympe.sc.Xa.P,olympe.sc.Runnable)}Cu(){return this.ib(olympe.sc.Xa.T,olympe.sc.Runnable)}km(){return this.db.Qa(this,olympe.sc.Xa.da)}hm(){return null!==this.db.Tb(this.tag,olympe.sc.Runnable.C.Rb())}Wk(){return this.ib(olympe.sc.Xa.F,olympe.sc.logic.ob)}Xi(){return this.ib(olympe.sc.Xa.G,
863
+ B('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.N.ja('ff023000000000000054');olympe.dm.File.N.C=olympe.dm.File.F.bind(null,olympe.dm.File);olympe.dm.File.P='application/data';olympe.dm.File.va=[olympe.D.File];l=olympe.dm.File.prototype;l.$l.J=olympe.D.H.F;l.Kj.J=new olympe.D.H(()=>{},[]);l.Ul.J=new olympe.D.H(()=>{},[]);l.Lj.J=new olympe.D.H(()=>{},[]);l.rename.J=olympe.D.H.C;l.Tk.J=olympe.D.H.F;l.io.J=olympe.D.H.F;l.Eu.J=new olympe.D.H(()=>olympe.D.Za,[]);
864
+ l.bv.J=new olympe.D.H(()=>olympe.D.Za,[]);l.vq.J=olympe.D.H.P;olympe.dm.ld=class extends olympe.dc.CloudObject{C(){return this.rb(olympe.dm.ld.F)}G(){return this.Gc(olympe.dm.ld.G)}F(){return this.ib(olympe.dm.ld.C,olympe.dm.Module)}};olympe.dm.ld.N=olympe.dc.ka.C('ff021000000000000041',olympe.dm.ld);olympe.dm.ld.F=olympe.dm.ld.N.ja('ff023000000000000047');olympe.dm.ld.G=olympe.dm.ld.N.ja('ff023000000000000048');olympe.dm.ld.C=olympe.dm.Module.C.Qb();olympe.dm.ld.prototype.C.J=olympe.D.H.F;olympe.dm.ld.prototype.G.J=olympe.D.H.G;
865
+ olympe.dm.ld.prototype.F.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.pb=class extends olympe.dm.vc{C(){return this.ib(olympe.dm.Ab.F,olympe.dm.Ab)}G(){return this.rb(olympe.dm.pb.$)}T(){return this.rb(olympe.dm.pb.ub)}F(){return this.ib(olympe.dm.pb.G,olympe.dm.pb)}};olympe.dm.pb.N=olympe.dc.ka.C('0163d9594700fcf61e54',olympe.dm.pb);olympe.dm.pb.$=olympe.dm.pb.N.ja('017869c7d2833c9492c1');olympe.dm.pb.ub=olympe.dm.pb.N.ja('017869c80bb9929c76d0');olympe.dm.pb.mb=olympe.dm.pb.N.pa('ff02200000000000002a');olympe.dm.pb.G=olympe.dm.pb.N.pa('ff02200000000000002b');
866
+ olympe.dm.pb.zd=U(olympe.dm.pb.N,olympe.dm.pb.G);olympe.dm.pb.L=olympe.dm.pb.N.pa('ff02200000000000002c');olympe.dm.pb.qd=olympe.dm.pb.N.pa('017e9c412e2b944bd590');olympe.dm.pb.df=olympe.dm.pb.N.pa('017e9c416872a89d3415');olympe.dm.pb.ze=olympe.dm.pb.N.pa('017ebf8fe5c506662098');U(olympe.dc.CloudObject.N,olympe.dm.pb.mb);olympe.dm.pb.nc=R('100000000000000000dd','PRIMORDIAL');olympe.dm.pb.prototype.C.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.pb.prototype.G.J=olympe.D.H.F;
867
+ olympe.dm.pb.prototype.T.J=olympe.D.H.F;olympe.dm.pb.prototype.F.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{C(){return this.Xb(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Xb(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}F(){return this.Ij(olympe.dm.Property.typeRel).Ad()}zc(){return this.C().ia().bq(this.ia())}};olympe.dm.Property.N=olympe.dc.ka.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=U(olympe.dm.Property.N,olympe.dc.CloudObject.propertyRel);
868
+ B('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=U(olympe.dm.Property.N,olympe.dc.CloudObject.typeRel);B('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.F.J=olympe.D.H.C;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Yu(){return olympe.D.Ka.EMPTY}wu(){return this.Gc(olympe.dm.Relation.F)}jv(){return this.Gc(olympe.dm.Relation.G)}mq(){return this.ib(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).yc()}rq(){return this.ib(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).yc()}zc(){return this.rq().ia().concat(['-',this.ia(),'->',this.mq().ia()])}};olympe.dm.Relation.N=olympe.dc.ka.C('ff021000000000000006',olympe.dm.Relation);
869
+ olympe.dm.Relation.G=olympe.dm.Relation.N.ja('ff023000000000000030');olympe.dm.Relation.F=olympe.dm.Relation.N.ja('ff023000000000000034');olympe.dm.Relation.da=olympe.dm.Relation.N.ja(olympe.dc.Nb.vn);olympe.dm.Relation.$=olympe.dm.Relation.N.ja(olympe.dc.Nb.rc);olympe.dm.Relation.ga=olympe.dm.Relation.N.ja(olympe.dc.Nb.Ff);olympe.dm.Relation.na=olympe.dm.Relation.N.ja(olympe.dc.Nb.lt);olympe.dm.Relation.T=olympe.dm.Relation.N.ja('ff023000000000000031');
870
+ olympe.dm.Relation.originModelRel=U(olympe.dm.Relation.N,olympe.dc.CloudObject.xi);B('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=U(olympe.dm.Relation.N,olympe.dc.CloudObject.iq);B('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.C={Ir:0,Uq:5,ap:1,dt:4,zl:2,ml:8,vx:10,dz:6,ez:9,Hd:6,fz:9};olympe.dm.Relation.L={Iy:3,Os:4,vy:5,uy:6};olympe.dm.Relation.P=olympe.dm.fk.Qs+olympe.dm.fk.lr;
871
+ l=olympe.dm.Relation.prototype;l.Yu.J=olympe.D.H.F;l.wu.J=olympe.D.H.G;l.jv.J=olympe.D.H.G;l.mq.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.rq.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.dm.se=class extends olympe.dc.CloudObject{getValue(){}};olympe.dm.se.N=olympe.dc.ka.C('ff021000000000000019',olympe.dm.se);olympe.dm.String=class extends olympe.dm.se{getValue(){return this.rb(olympe.dm.String.valueProp)}toString(){return this.get(olympe.dm.String.valueProp)}};olympe.dm.String.N=olympe.dc.ka.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.N.ja('ff023000000000000026');B('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.J=olympe.D.H.F;olympe.dm.String.prototype.toString.J=olympe.D.H.C;olympe.dm.Boolean=class extends olympe.dm.se{getValue(){return this.ph(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.N=olympe.dc.ka.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.N.ja('ff023000000000000027');B('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.J=olympe.D.H.P;olympe.dm.Color=class extends olympe.dm.se{getValue(){return this.sq()}};olympe.dm.Color.N=olympe.dc.ka.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.N.ja('ff023000000000000032');B('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.J=new olympe.D.H(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.se{getValue(){return this.ni(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.N=olympe.dc.ka.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.N.ja('ff023000000000000029');B('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.J=new olympe.D.H(()=>olympe.D.Za,[]);olympe.dm.Enum=class extends olympe.dm.String{ia(){return olympe.D.sa([super.ia(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Ka)}Dd(){return this.Gc(olympe.dm.Enum.rankProp)}static create(a,b,c,d,e){const f=olympe.dc.ta();e=void 0!==e?e:f.Ia(b)&&f.Rd(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.dm.Enum.create=olympe.dm.Enum.create;
872
+ olympe.dm.Enum.N=olympe.dc.ka.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.N.ja('017a7690c915975ea995');olympe.dm.Enum.prototype.Dd.J=olympe.D.H.G;olympe.dm.yf=class extends olympe.dm.BrickMetadata{Av(){return this.eb(olympe.dc.CloudObject.instancesRel).bk(olympe.dm.Enum.rankProp,olympe.dc.query.hj.ASC).Ad()}static create(a,b){b=a.create(olympe.dm.yf,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Ea(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.yf.create=olympe.dm.yf.create;olympe.dm.yf.prototype.getValues=olympe.dm.yf.prototype.Av;olympe.dm.yf.N=olympe.dc.ka.C('017a768f966fc08ebb98',olympe.dm.yf);olympe.dm.Number=class extends olympe.dm.se{getValue(){return this.Gc(olympe.dm.Number.valueProp)}};olympe.dm.Number.N=olympe.dc.ka.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.N.ja('ff023000000000000028');B('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.J=olympe.D.H.G;olympe.sc={};olympe.sc.R={za:'sc.Logger',nl:'sc.RootContext',de:'sc.Serializer'};olympe.sc.U={Ke:'sc.app',uf:'sc.debug',tn:'sc.debugger',mr:'sc.disableTheme',PRODUCTION:'sc.production',Ps:'sc.onstartTimeout',cp:'sc.remoteActionTimeout',Go:'sc.offlineStart'};
873
+ olympe.V.config(a=>{F(a,olympe.sc.U.Ke,'');F(a,olympe.sc.U.Go,!1);F(a,olympe.sc.U.uf,!1);F(a,olympe.sc.U.mr,!0);F(a,olympe.sc.U.PRODUCTION,!1);F(a,olympe.sc.U.Ps,2E4);F(a,olympe.sc.U.cp,1E4);E(a,olympe.sc.R.za,[olympe.la.R.Ga],b=>b.Fc('sc'));D(a,olympe.sc.R.de,olympe.sc.fg,olympe.dc.R.Oe);va(a,olympe.dc.sources.R.de,olympe.sc.R.de);E(a,olympe.sc.R.nl,[new olympe.V.ma(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.vd('root','root',null);olympe.sc.tm=c;c.set(olympe.sc.xa.C.PRODUCTION,b);return new olympe.sc.xa(c)})},
874
+ 'olympe.sc');olympe.V.run([olympe.sc.R.nl],a=>{olympe.Mj().ctx=a});olympe.sc.gm=()=>null!==olympe.dc.ta().Sb(void 0,olympe.sc.Runnable.C.Qb());olympe.sc.aB=(a,b,c,d)=>{c=Z(Z(a.create(olympe.sc.Dc),olympe.sc.Dc.C,c||null),olympe.sc.Dc.G,d||null);a.Ea(olympe.sc.Dc.F,c,b);a.Ea(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.kg=a=>{a=olympe.dc.Eb.kg(a);return a instanceof olympe.sc.ae?a.C():a};olympe.sc.wB=a=>{a=ne(a);return a instanceof olympe.sc.ae?a.C():a};
875
+ olympe.sc.sB=function(a){const b=olympe.dm.Ab.C.Qb(),c=olympe.dc.CloudObject.containsRel.Qb();var d=olympe.dc.fa(a);if(void 0===d)return[];a=olympe.dc.ta();var e=a.model(d);const f=[],g=[];let h=[];if(a.si(e,olympe.dm.Ab))h.push(d);else{for(e=[];null===a.Sb(d,b);){e.push(d);const k=a.Sb(d,c);if(null===k)return olympe.la.fb('sc').warn(`Object ${d} has no container`),[];a.$c(d,olympe.sc.logic.hb)||k===a.Sb(d,olympe.sc.Runnable.C.Qb())||f.push(d);d=k;if(e.includes(d))throw Error(`Instance ${d} (${a.name(d)}) is part of a cyclic contain pattern`);
876
+ }g.push(d);h.push(a.Sb(g[0],b))}h=h.concat(a.qg(h[0],olympe.dm.Ab.Da));h=h.concat(a.qg(h[h.length-1],olympe.dm.vc.T.Qb()));h=h.concat(a.qg(h[h.length-1],olympe.dm.vc.P.Qb()));return[...f,...g,...h].reverse()};olympe.sc.uB=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Xf:a.startsWith('video/')?olympe.sc.$g:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.tc:olympe.dm.File};
877
+ olympe.sc.qB=a=>a instanceof olympe.sc.Xf?'image/*':a instanceof olympe.sc.$g?'video/*':a instanceof olympe.sc.tc?'font/*,application/font-woff':null;olympe.sc.tb={};function Ek(a){const b=olympe.dc.ta();let c;try{const d=[a];let e=a.getParent();for(;null!==e&&e.C!==olympe.sc.tm;)d.unshift(e),e=e.getParent();c=d.map(f=>{const g=f.Ee();return null!==g?(f=b.model(g),b.name(g)||f&&b.name(f)||g):f.W()}).join(' > ')}catch(d){c=`No stack available for context ${a.W()}: ${d}`,a.K.warn(c)}return c}
878
+ function Fk(a,b){var c=olympe.sc.xa,d=a.C;a=a.F();b=olympe.dc.fa(b);let e,f=null==(e=d.F)?void 0:e.get(b);if(!f){f=d.hh(a,void 0,b);for(d=f.getParent();d&&d.ga&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||Gk(g,b,f)}return new c(f)}function Hk(a){let b;return null!=(b=a.Ta(olympe.sc.xa.C.PRODUCTION))?b:!1}
879
+ olympe.sc.xa=class{constructor(a=olympe.sc.tm){this.C=a;this.K=olympe.la.fb('sc');this.G=null}W(){return this.C.W()}getParent(){if(null===this.G){const a=this.C.getParent();this.G=null===a?null:new olympe.sc.xa(a)}return this.G}xu(a){const b=olympe.dc.ta();let c=this.getParent();const d=e=>{if(e.Ee()){const f=b.model(e.Ee());if(f&&b.Qa(f,olympe.sc.Xa.da)||a.modelTag&&!b.$c(e.Ee(),a.modelTag))return!1}return!0};for(;c&&!d(c);)c=c.getParent();return c}Ee(){return this.C.Ee()}F(){return this.C.C}set(a,
880
+ b){this.C.set(a,b);return this}zm(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}vb(a,b,c=!1){const d=olympe.dc.fa(a),e=olympe.D.cc(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.C.W():void 0));return e.vb()}get(a,b=!1){a=this.Ta(a,b);return void 0!==a?a:null}has(a,b=!1){return this.C.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,
881
+ d.next.bind(d),c?void 0:this.C.W(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Ik(this.C,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.yg(a.unsubscribe.bind(a));return this}pw(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.hh(`Runner ${a.name()}`);a.run(b);return b}Gw(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)})\``+
882
+ `on the context ${this.W()}:\nStack: ${Ek(this)}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.W()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.fa(a)})\` `+`has never received any value:\nStack: ${Ek(this)}`);e(Error(g))}))})}rw(a){this.set(olympe.sc.xa.C.Sf,a);return this}Ta(a,b=!0){return this.C.Ta(a,b)}on(a,b,c,d=!0){return this.C.on(a,b,c,d)}hh(a){return new olympe.sc.xa(this.C.hh(this.F(),a))}Zj(a,b){return this.C.Zj(a,c=>{b(new olympe.sc.xa(c))})}gv(a){a=
883
+ Jk(this.C,a);return a===this.C?this:a&&new olympe.sc.xa(a)}destroy(){this.C.destroy()}yg(a,b){return this.C.yg(a,b)}Xj(a){this.C.Xj(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.F().onDestroy(a)}pf(a){this.gb()||this.F().pf(a)}clear(){this.C.clear()}gb(){return this.F().gb()}Qa(a){a=Kk(this.C,a);return null!==a?new olympe.sc.ui.Zw(a,this):null}Nu(a){a=Kk(this.C,a);return null!==a?new olympe.sc.ui.Yw(a,this):null}$v(...a){return rxjs.combineLatest(a.map(b=>{b=Kk(this.C,b);return null!==b?this.observe(b):
884
+ rxjs.of(null)}))}Ha(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.C===a.C}};olympe.sc.xa.prototype.observeMany=olympe.sc.xa.prototype.$v;olympe.sc.xa.prototype.getEvent=olympe.sc.xa.prototype.Nu;olympe.sc.xa.prototype.getProperty=olympe.sc.xa.prototype.Qa;olympe.sc.xa.prototype.isDestroyed=olympe.sc.xa.prototype.gb;olympe.sc.xa.prototype.clear=olympe.sc.xa.prototype.clear;olympe.sc.xa.prototype.offDestroy=olympe.sc.xa.prototype.pf;olympe.sc.xa.prototype.onDestroy=olympe.sc.xa.prototype.onDestroy;
885
+ olympe.sc.xa.prototype.offClear=olympe.sc.xa.prototype.Xj;olympe.sc.xa.prototype.onClear=olympe.sc.xa.prototype.yg;olympe.sc.xa.prototype.destroy=olympe.sc.xa.prototype.destroy;olympe.sc.xa.prototype.getOtherContext=olympe.sc.xa.prototype.gv;olympe.sc.xa.prototype.onContext=olympe.sc.xa.prototype.Zj;olympe.sc.xa.prototype.createChild=olympe.sc.xa.prototype.hh;olympe.sc.xa.prototype.setParentElement=olympe.sc.xa.prototype.rw;olympe.sc.xa.prototype.waitFor=olympe.sc.xa.prototype.Gw;
886
+ olympe.sc.xa.prototype.runner=olympe.sc.xa.prototype.pw;olympe.sc.xa.prototype.repeat=olympe.sc.xa.prototype.repeat;olympe.sc.xa.prototype.observe=olympe.sc.xa.prototype.observe;olympe.sc.xa.prototype.has=olympe.sc.xa.prototype.has;olympe.sc.xa.prototype.get=olympe.sc.xa.prototype.get;olympe.sc.xa.prototype.remove=olympe.sc.xa.prototype.remove;olympe.sc.xa.prototype.trigger=olympe.sc.xa.prototype.zm;olympe.sc.xa.prototype.set=olympe.sc.xa.prototype.set;olympe.sc.xa.prototype.getClosest=olympe.sc.xa.prototype.xu;
887
+ olympe.sc.xa.prototype.getParent=olympe.sc.xa.prototype.getParent;olympe.sc.xa.C={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',Sf:'__htmlContainer',px:'__dockableElement'};olympe.sc.Np=class extends olympe.sc.xa{constructor(a){super(a);this.L=new olympe.D.Jb('SC Update Context',super.F());const b=a.yg(()=>{b&&a.Xj(b);this.L.destroy()})}F(){return this.L}yg(a,b){return this.F().onDestroy(a,null!=b?b:olympe.Z.hc())}};function Ik(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 Jk(a,b){if(b===a.id||a.L.has(b)||!b)return a;for(a=a.da;a;){if(b===a.W()||a.L.has(b))return a;const c=Lk(a.F,b);if(c)return c;a=a.getParent()}return null}function Kk(a,b){let c;return(null==(c=a.$)?void 0:c.get('IO#'+b))||null}
888
+ function Mk(a){a.C.$(()=>{Nk(a,c=>c.destroy())});a.C.onDestroy(()=>{void 0!==a.Ta(olympe.sc.xa.C.TRANSACTION,!1)&&a.K.warn(`The context ${a.W()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);let c;if(null!=(c=a.da)){let d;null==(d=c.F)||d.delete(a.W());let e;0===(null==(e=c.F)?void 0:e.size)&&(c.F=null)}a.L.clear()});let b;null==(b=a.da)||Ok(b,a)}
889
+ function Lk(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ga&&!c.id.startsWith('_')&&(a=Lk(c.F,b)))return a;return null}function Pk(a,b){a.Da=olympe.dc.fa(b);a.ga=b.sd().gm();b.F().forEach(c=>{a.id===c||a.L.has(c)||(a.L.add(c),Gk(a,c,a))});a.$=b.T()}function Qk(a){a.na=!0;let b;null==(b=a.F)||b.forEach(c=>{Qk(c)})}function Rk(a){a.na=!1;let b;null==(b=a.F)||b.forEach(c=>{Rk(c)})}
890
+ function Sk(a,...b){var c=olympe.sc.tb.ve.C.pl;if(null!==a.tb)for(const {$j:d,depth:e}of a.tb.values())d.process(a,c,e,...b)}function Tk(a,b,c,d){const e='$'+b;a.T.add(b);c.map(f=>'@'+f+'.'+b).forEach(f=>{let g,h;null==(g=a.G)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});Nk(a,f=>{!f.na&&f.T.has(b)||f.data.has(e)||Tk(f,b,c,d)});a.T.delete(b)}
891
+ function Uk(a,b,c){a.G||(a.G=new Map);let d=a.G.get(b);void 0===d&&(d=new Map,a.G.set(b,d));olympe.sc.vd.C+=1;const e=olympe.sc.vd.C;d.set(e,c);return()=>{const f=a.G.get(b);f&&(f.delete(e),0===f.size&&a.G.delete(b))}}function Gk(a,b,c){a.T.add(b);let d;const e=null==(d=a.G)?void 0:d.get('&'+b);if(e)for(const f of e.values())f(c);Nk(a,f=>{f.T.has(b)||Gk(f,b,c)});a.T.delete(b)}function Nk(a,b){let c;null==(c=a.F)||c.forEach(b)}function Vk(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}
892
+ function Wk(a,b){if(null!==a.tb&&a.tb.has(b)){var {$j:c,depth:d}=a.tb.get(b);Nk(a,e=>{Wk(e,b)});0===d&&c.F();a.tb.delete(b);0===a.tb.size&&(a.tb=null)}}function Xk(a,b,c=0){null===a.tb&&(a.tb=new Map);a.tb.has(b.W())||(a.tb.set(b.W(),{$j:b,depth:c}),Nk(a,d=>{(-1===b.G||c<b.G)&&Xk(d,b,c+1)}),a.onDestroy(()=>{Wk(a,b.W())}));b.W()}function Yk(a){var b=olympe.sc.tb.ve.F.Ef;const c=[];if(null!==a.tb)for(const {$j:d}of a.tb.values())d.getType()===b&&(c.push(d.W()),d.F(),Wk(a,d.W()))}
893
+ function Ok(a,b){null===a.F&&(a.F=new Map);a.F.set(b.id,b)}
894
+ olympe.sc.vd=class{constructor(a,b='no name',c=olympe.sc.tm){this.id=a;this.Xc=b;this.L=new Set;this.da=c;this.C=new olympe.D.Jb('SC Context');this.data=new Map;this.Da=this.P=this.F=this.G=null;this.ga=!1;this.T=new Set;this.na=!1;this.$=null;this.K=olympe.la.fb('sc');this.tb=null;Mk(this)}W(){return this.id}getParent(){return this.da}Ee(){return this.Da}set(a,b){if(!this.C.Bc()&&!this.C.gb()){const f=olympe.dc.fa(a);var c,d,e;let g;a=null!=(g=null!=(e=null==(c=this.$)?void 0:c.get('O#'+f))?e:null==
895
+ (d=this.$)?void 0:d.get('IO#'+f))?g:f;c='$'+a;(d=this.data.get(c))&&d.valueOf&&(d=d.valueOf());void 0===b||null===b?void 0!==d&&(this.data.delete(c),null!==this.tb&&0<this.tb.size&&Sk(this,a,null),Tk(this,a,['*',this.id,...this.L],null)):((e=void 0===d)||(e=!('function'===typeof b.Ha?b.Ha(d):b.valueOf()===d.valueOf())),e&&(this.data.set(c,b),null!==this.tb&&0<this.tb.size&&Sk(this,a,b),Tk(this,a,['*',this.id,...this.L],b)))}}on(a,b,c,d=!0){if(this.C.gb()||this.C.Bc())return()=>{};const e=Ik(this,
896
+ a),f=c?olympe.dc.fa(c):'*';a=Uk(this,'@'+f+'.'+e,b);c=c?(c=Jk(this,f))?c.Ta(e,!1):void 0:this.Ta(e);void 0!==c&&b(c);if(d)olympe.D.Ma().onDestroy(a);return a}has(a,b=!1){a='$'+Ik(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}hh(a,b,c){const d=null!=c?c:'_'+olympe.Z.hc();if(a.gb()||a.Bc())throw Error(`Try to create new child context in a destroyed context ${a.W()}, probably because \`runner()\` is called on a destroyed context`);const e=
897
+ a.run(()=>new olympe.sc.vd(d,b,this));null!==this.tb&&0<this.tb.size&&this.tb.forEach(({$j:f,depth:g})=>{(-1===f.G||g<f.G)&&Xk(e,f,g+1)});return e}Zj(a,b){const c=Jk(this,a);if(c)return b(c),()=>{};const d=Uk(this,'&'+a,e=>{d&&d();b(e)});return d}Ta(a,b=!0){a='$'+Ik(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.C.Bc()||this.C.gb()||this.C.destroy()}yg(a,b){if(this.C.gb())a();else return++olympe.sc.vd.C,b=b||
898
+ String(olympe.sc.vd.C),null===this.P&&(this.P=new Map),this.P.set(b,a),b;return b||'noId'}Xj(a){null!==this.P&&this.P.delete(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.C.onDestroy(a)}clear(){if(!this.C.Bc()&&!this.C.gb()){let a;null==(a=this.P)||a.forEach(b=>b())}}gb(){return this.C.gb()}};olympe.sc.vd.prototype.getParent=olympe.sc.vd.prototype.getParent;olympe.sc.vd.C=0;olympe.sc.vd.F={Pr:'I#',Rs:'O#',my:'IO#'};function Zk(a,b,c){return(c=c.Ee())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.tb.ve=class{constructor(a=-1){this.id=olympe.Z.ef();this.active=!0;this.G=a}F(){this.active=!1}W(){return this.id}getType(){}process(){}};olympe.sc.tb.ve.C={pl:'SET'};olympe.sc.tb.ve.F={Ef:'REMOTE',ys:'LOCAL'};olympe.sc.yd=class a{constructor(){this.F=this.L=this.P=null;this.T=new Map;this.G=new Map;this.C=new olympe.Z.xl(1E4);Ka(this.C,b=>{Yk(b)})}da(b,c,d){const e=b.body(),f=e.c,g=this.T.get(f);switch(e.t){case olympe.sc.yd.C.Ss:c=this.G.get(e.f);b.gd(c).catch(m=>{d.error('Unable to reply with paths: ',m)});break;case olympe.sc.yd.C.Ts:const h=f+c,k=(m,n,p=0)=>{Vk(m,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.G(q):t=q;let u;q=null!=(u=m.Ee())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
899
+ t])})};b.pm(h).then(()=>{const m=[];k(g,m,0);Nk(g,p=>{k(p,m,1)});olympe.O.qb.publish(h,{t:olympe.sc.yd.C.Nr,v:m,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.tb.ft(h);Xk(g,n);this.C.has(g)?Ja(this.C,g):this.C.add(g)}).catch(m=>{d.error('Error notifying on a contextId : ',m)});break;case olympe.sc.yd.C.Us:void 0!==g&&this.C.has(g)&&Ja(this.C,g);break;case olympe.sc.yd.C.Ck:void 0!==g&&(this.C.delete(g),Yk(g))}}ga(b,c,d){this.P=new olympe.O.qb('discovery_debug_id',
900
+ c);this.P.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.yd.C.nr){e=f.i;f=f.f;if(!this.G.has(f)){const g=this.$(f,c,b);if(0!==g.length)this.G.set(f,g);else return}null===this.F&&(this.F=olympe.Z.ef(),f=new olympe.D.Jb(this.F,c.F()),this.L=new olympe.O.qb(this.F,f),this.L.listen().subscribe(g=>{this.da(g,b,d)}));olympe.O.qb.publish(e,{t:olympe.sc.yd.C.Hq,n:olympe.V.getParameter(olympe.sc.U.tn)||'no name',a:b,s:this.F}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}$(b,c,
901
+ d){const e=[],f=olympe.dc.ta(),g=(h,k)=>{Nk(h,m=>{if(null!==m.Ee()){const n=olympe.dc.CloudObject.get(m.Ee()).Ij(olympe.sc.Runnable.L).Ad();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,m.W()]),this.T.set(m.W(),m));g(m,p)}}})};g(c.C,f.name(d));return e}static F(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.G(d));olympe.O.qb.publish(b,{t:olympe.sc.yd.C.Bj,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.la.fb('Debugger').error('Error publishing on service : ',f)})}static G(b){if(null===
902
+ b||void 0===b)return'<null>';const c=olympe.dc.ta();if(b instanceof olympe.dc.CloudObject){var d=b.oc();if(!c.$c(d,olympe.sc.Jc))return b.toString();let f=`${b.Cd().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.ra.from(e).Mf(olympe.dc.CloudObject.extendRel,!0).Md().eb(olympe.dc.CloudObject.propertyRel).Md().Ad();e=olympe.dc.ra.from(e).Mf(olympe.dc.CloudObject.extendRel,!0).Md().eb(olympe.dc.CloudObject.xi).Md().Ad();d=d.filter(([g])=>g instanceof olympe.sc.Jc);0!==d.length&&(f+=
903
+ '<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.Jc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.yd.L='discovery_debug_id';olympe.sc.yd.C={nr:0,Hq:1,Ss:2,Ts:3,Nr:4,Bj:5,Us:6,Ck:7};olympe.sc.tb.ty=class extends olympe.sc.tb.ve{constructor(a=-1){super(a);this.C=new Map}getType(){return olympe.sc.tb.ve.F.ys}process(a,b,c,...d){if(this.active&&b===olympe.sc.tb.ve.C.pl){a=Zk(c,Ik(a,d[0]),a);d=d[1];let e;null==(e=this.C.get(a))||e(d)}}on(a,b){this.C.set(a,b)}};olympe.sc.tb.ft=class extends olympe.sc.tb.ve{constructor(a){super(1);this.L=a;this.C=new Map;this.db=olympe.dc.ta()}getType(){return olympe.sc.tb.ve.F.Ef}F(){super.F();for(const a of this.C.values())a();this.C.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.tb.ve.C.pl&&void 0!==d[0]&&null!==d[0]){const e=Zk(c,Ik(a,d[0]),a),f=d[1];let g;null==(g=this.C.get(e))||g();this.C.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Cd()instanceof olympe.sc.Jc){const h=Df(this.db,f,()=>{olympe.sc.yd.F(this.L,
904
+ e,f)});this.C.set(e,()=>{Ef(this.db,f,h)})}olympe.sc.yd.F(this.L,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{js(){return this.Gc(this.am())}ks(){return this.Gc(this.bm())}Qj(){return new olympe.D.Kb(this.Gc(this.am()),this.Gc(this.bm()))}am(){}bm(){}};olympe.sc.Metadata.N=olympe.dc.ka.C('0161ae936c62f9fcd131',olympe.sc.Metadata);l=olympe.sc.Metadata.prototype;l.js.J=olympe.D.H.G;l.ks.J=olympe.D.H.G;l.Qj.J=olympe.D.H.T;l.am.J=olympe.D.H.C;l.bm.J=olympe.D.H.C;olympe.sc.Dc=class extends olympe.dc.CloudObject{F(){return this.rb(olympe.sc.Dc.G)}C(){return this.rb(olympe.sc.Dc.C)}};olympe.sc.Dc.N=olympe.dc.ka.C('01703376c4a81c0e9d90',olympe.sc.Dc);olympe.sc.Dc.G=olympe.sc.Dc.N.ja('01703376c4a81c0e9d91');olympe.sc.Dc.C=olympe.sc.Dc.N.ja('01703376c4a81c0e9d92');olympe.sc.Dc.F=olympe.sc.Dc.N.pa('01703376c4a81c0e9d93');U(olympe.dc.CloudObject.N,olympe.sc.Dc.F);olympe.sc.Dc.prototype.F.J=olympe.D.H.F;olympe.sc.Dc.prototype.C.J=olympe.D.H.F;olympe.sc.ad={};olympe.sc.ad.ee={cr:null,ht:'screenflow',yt:'ui-design',vp:'software-intelligence',Gg:'data-management'};olympe.sc.Oc=class extends olympe.dm.BrickMetadata{Td(){return olympe.sc.ad.ee.vp}C(){return this.ib(olympe.sc.Oc.C,olympe.sc.logic.bg)}F(){return this.ib(olympe.sc.Oc.F,olympe.sc.logic.Df)}};olympe.sc.Oc.N=olympe.dc.ka.C('011100000000000adef0',olympe.sc.Oc);olympe.sc.Oc.C=olympe.sc.Oc.N.pa('016ac4f59a2917fdef01');olympe.sc.Oc.F=olympe.sc.Oc.N.pa('016ac4f59a2917fdef02');olympe.sc.Oc.N.C=(a,b)=>sj(a,b||'New function signature',olympe.sc.Oc,olympe.sc.logic.Id).X();
905
+ olympe.sc.Oc.prototype.C.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.sc.Oc.prototype.F.J=new olympe.D.H(()=>olympe.dc.ua,[]);function $k(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function al(a,b){b=b.filter(c=>'string'===typeof c&&a.db.$c(c,olympe.sc.logic.Lb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Qa(c,olympe.sc.logic.Lb.C,!0))?e:0;let f;d=null!=(f=a.db.Qa(d,olympe.sc.logic.Lb.C,!0))?f:0;return c-d});return b}
906
+ olympe.sc.Xa=class extends olympe.dm.BrickMetadata{ls(a,b,c,d,e=!0){e||olympe.la.fb('sc').error('parameter own= false ignored, investigate');return olympe.D.zg(N(this.kf(a,olympe.dc.Eb.kg,c)),d)}ov(){return this.ib(olympe.sc.Xa.P,olympe.sc.Runnable)}Bu(){return this.ib(olympe.sc.Xa.T,olympe.sc.Runnable)}jm(){return this.db.Qa(this,olympe.sc.Xa.da)}gm(){return null!==this.db.Sb(this.tag,olympe.sc.Runnable.C.Qb())}Vk(){return this.ib(olympe.sc.Xa.F,olympe.sc.logic.ob)}Xi(){return this.ib(olympe.sc.Xa.G,
910
907
  olympe.sc.logic.wb)}};olympe.sc.Xa.N=olympe.dc.ka.C('0112000000000000def0',olympe.sc.Xa);olympe.sc.Xa.da=olympe.sc.Xa.N.ja('01692aa71f3108454479');olympe.sc.Xa.mb=olympe.sc.Xa.N.ja('0166446c1f128ebc903a');olympe.sc.Xa.P=olympe.sc.Xa.N.pa('01692a4af82e8984742c');olympe.sc.Xa.T=olympe.sc.Xa.N.pa('01692a4af82e8984742d');olympe.sc.Xa.$=olympe.sc.Xa.N.pa('01692a4af82e8984742e');olympe.sc.Xa.F=olympe.sc.Xa.N.pa('01621fb84e320000f00a');olympe.sc.Xa.G=olympe.sc.Xa.N.pa('01621fb84e320000f00b');
911
- olympe.sc.Xa.ac=olympe.sc.Xa.N.pa('0171838bcfed0000e00e');olympe.sc.Xa.Wb=olympe.sc.Xa.N.pa('0171838bcfed0000a00a');l=olympe.sc.Xa.prototype;l.ls.J=olympe.D.H.C;l.pv.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Cu.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.km.J=olympe.D.H.C;l.hm.J=olympe.D.H.C;l.Wk.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Xi.J=new olympe.D.H(()=>olympe.dc.ua,[]);function cl(a){const b=olympe.dc.CloudObject.fq(new Map,a);olympe.D.Ma().onDestroy(()=>{const c=new olympe.dc.Sa;c.delete(b);c.lb()});return b}function dl(a,b){Qk(b.C,a);al(a.sd(),b);const c=a.L(),d=el(b,c),e=[];c.forEach((f,g)=>{f===a.ga?e[0]=g:f===a.da&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(fl(a,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])})}
912
- function gl(a,b){var c=a.nc();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.C(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.gb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],m=new olympe.sc.Op(b.C);m.F().run(()=>v(function*(){try{yield a.update(m,k,g)}catch(n){a.P(m,n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.K.debug(e):a.K.debug(f),a.P.bind(a,b),()=>a.K.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
913
- function hl(a,b,c,d){const e=d.F(),f=W(a.db,b,c,e.G((g,h)=>{const k=Gk(d,h);g?olympe.dc.CloudObject.get(h).run(k):k.destroy()}));e.onDestroy(a.db.F.bind(a.db,b,c,f,!0))}function el(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)}})}
914
- function fl(a,b,c){const d=olympe.D.Ma(),e=Df(a.db,a.tag,d.G((f,g,h)=>{const k=h?c:b;null!==k&&(null===g||void 0===g?k(f,null):k(f,olympe.sc.kg(g)),h&&b&&b(f,null))}));d.onDestroy(()=>{Ef(a.db,a.tag,e)})}
915
- olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.K=c}run(a){a.F().run(()=>{dl(this,a);this.init(a);if(this.sd().km())gl(this,a);else{const b=new olympe.sc.Op(a.C);b.F().run(()=>this.update(b,[],[]))}a.Am(olympe.sc.Xa.mb);a.yg(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a))})}sd(){return this.Dd()}init(a){this.onInit(a)}update(a,b,c){const d=this.sd();if(d.km())this.onUpdate(a,b,c);else this.K.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.W()}`),
916
- hl(this,d,olympe.sc.Xa.P,a),this.na()&&hl(this,d,olympe.sc.Xa.$,a)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}C(){return[]}onInit(){}onUpdate(){const a=this.nc(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.K.error(`No code was found for the following brick: ${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(){var a=
917
- this.sd();return bl(a,a.db.ib(a.tag,olympe.sc.Xa.F))}getOutputs(){var a=this.sd();return bl(a,a.db.ib(a.tag,olympe.sc.Xa.G))}F(){return[]}T(){return new Map}na(){return!1}G(a,b,c,d){a=b.vb(a,c,!0);void 0!==d&&olympe.D.zg(a,d);return a}ub(a,b,c,d,e){olympe.D.tm([d],f=>{b.set(a,olympe.D.xq(f)?f.valueOf():f)});return this.G(a,b,c,e)}L(){return[this.ga,this.da]}ga(a,b){fl(this,b,null)}da(a,b){fl(this,null,b)}Eb(a,b){const c=this.db,d=olympe.sc.logic.hb.G.Rb(),e=olympe.sc.logic.hb.F,f=olympe.sc.logic.hb.C;
918
- this.mq(d,g=>{var h=g.X();if(h=c.Tb(h,e)||c.Tb(h,f))return il(g,a,b.bind(null,h))})}P(a,b){b=b instanceof Error?`${b.message}\n${b.stack}`:b;this.K.error(`An error occurred in brick ${Fk(a)} (${this.nc()}):\n${b}`)}};olympe.sc.Runnable.N=Fe(olympe.dc.ka.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.L=olympe.sc.Runnable.N.pa('01692a4af82e8984742b');olympe.sc.Runnable.C=olympe.sc.Runnable.N.pa('01756a18d4921c103111');olympe.sc.Runnable.P=U(olympe.sc.Runnable.N,olympe.sc.Xa.P);
919
- olympe.sc.Runnable.T=U(olympe.sc.Runnable.N,olympe.sc.Xa.T);olympe.sc.Runnable.$=U(olympe.sc.Runnable.N,olympe.sc.Xa.$);U(olympe.sc.Xa.N,olympe.sc.Runnable.L);U(olympe.sc.Xa.N,olympe.sc.Runnable.C);olympe.sc.Runnable.prototype.sd.J=new olympe.D.H(()=>olympe.sc.Xa,[]);olympe.sc.Runnable.prototype.G.J=new olympe.D.H(()=>Object,[]);olympe.sc.Runnable.prototype.ub.J=olympe.D.H.C;function jl(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.be)return(a=a.F())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.be=class extends olympe.dc.CloudObject{F(){return this.db.ib(this,olympe.sc.be.C)[0]}C(){return olympe.dc.CloudObject.get(jl(this))}toString(){const a=jl(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.be.N=olympe.dc.ka.C('0163c9ae01f2d6e9ca49',olympe.sc.be);olympe.sc.be.C=olympe.sc.be.N.pa('0169b5a8a33144fb0b49');
920
- U(olympe.dc.CloudObject.N,olympe.sc.be.C);olympe.sc.be.prototype.F.J=new olympe.D.H(()=>String,[]);olympe.sc.be.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.sc.wn=class extends olympe.dm.Bb{Ud(){return olympe.sc.ud.xe.Gg}};olympe.sc.wn.N=olympe.dc.ka.C('0163a68ce44f3d1fa84c',olympe.sc.wn);olympe.sc.Jc=class extends olympe.dm.BrickMetadata{};olympe.sc.Jc.N=olympe.dc.ka.C('016324fde11a836f76c2',olympe.sc.Jc);olympe.sc.Jc.C=olympe.sc.Jc.N.pa('016324fde11a836087c2');olympe.sc.Jc.N.C=function(a,b){return tj(a,null!=b?b:'New type',olympe.sc.Jc).X()};let kl=null;
921
- function ll(a,b){kl=a;const c=olympe.D.Ma(),d=c.G(b);olympe.dc.Nc.from(a).eb(olympe.sc.qa.Uc.C).eb(olympe.sc.Vc.C.Rb()).lb(c,!0).then(e=>{if(null!==e){const f=olympe.dc.ta();Og(c,e,g=>{g=f.si(g)?g:f.model(g);return null!==g&&f.$c(g,olympe.sc.Jc)}).subscribe(()=>{d(olympe.sc.Vc.Pb.po)})}else olympe.la.fb('sc').error('No container found for the application',a),d(olympe.sc.Vc.Pb.bl)}).catch(e=>{olympe.la.fb('sc').error('Error while loading business container:',e.message);d(olympe.sc.Vc.Pb.Db)})}
922
- olympe.sc.Vc=class extends olympe.dc.CloudObject{};olympe.sc.Vc.Pb={po:0,bl:1,Db:2};olympe.sc.Vc.N=olympe.dc.ka.C('017b3aa8fae1e3d044dc',olympe.sc.Vc);olympe.sc.Vc.C=olympe.sc.Vc.N.pa('017b3aa8fd1659291b92');olympe.sc.Vc.F=olympe.sc.Vc.N.pa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.N=olympe.dc.ka.C('018119241abce0e5696e',olympe.sc.Map);olympe.sc.$f=class extends olympe.sc.Map{};olympe.sc.$f.N=olympe.dc.ka.C('01631aacd8276ea98490',olympe.sc.$f);olympe.sc.File=class extends olympe.dm.File{static bu(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Cq(a,e,b,c,d);return e}static cu(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.xm(a,e,b,c,d);return e}static Cq(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.xm(a,b,c,d,e)}static xm(a,b,c,d,e){const f=olympe.dc.ta(),g=f.Ia(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.ri(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
923
- 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.C,!1);a.zq(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.xm;olympe.sc.File.setContent=olympe.sc.File.Cq;olympe.sc.File.createFromURL=olympe.sc.File.cu;olympe.sc.File.createFromContent=olympe.sc.File.bu;
924
- olympe.sc.File.N=ze(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Xf=class extends olympe.sc.File{L(){const a=olympe.D.ec(olympe.D.Ka);this.Lj(b=>{a.update(olympe.D.sb(b))});return a.vb()}};olympe.sc.Xf.N=ze(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Xf);olympe.sc.Xf.N.C=olympe.sc.File.F.bind(null,olympe.sc.Xf);olympe.sc.Xf.prototype.L.J=olympe.D.H.F;olympe.sc.rc=class extends olympe.sc.File{L(){return this.rb(olympe.sc.rc.fontFamilyProp)}P(){return this.rb(olympe.sc.rc.G)}T(){return this.Gc(olympe.sc.rc.L)}};olympe.sc.rc.N=ze(olympe.sc.File,'01647e113043c637b541',olympe.sc.rc);olympe.sc.rc.fontFamilyProp=olympe.sc.rc.N.ja('01647e35ecd24ef0b88d');olympe.sc.rc.G=olympe.sc.rc.N.ja('01647e677f5d1cfbdf42');olympe.sc.rc.L=olympe.sc.rc.N.ja('01647e6780999bf8bd25');
925
- olympe.sc.rc.N.C=(a,b,c,d)=>{c=olympe.sc.File.F(olympe.sc.rc,a,b,c,d);a.update(c,olympe.sc.rc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.rc.prototype.L.J=olympe.D.H.F;olympe.sc.rc.prototype.P.J=olympe.D.H.F;olympe.sc.rc.prototype.T.J=olympe.D.H.G;olympe.sc.Zg=class extends olympe.sc.File{};olympe.sc.Zg.N=ze(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.Zg);olympe.sc.Zg.N.C=olympe.sc.File.F.bind(null,olympe.sc.Zg);olympe.sc.Qp=class extends olympe.dc.CloudObject{};olympe.sc.Qp.N=olympe.dc.ka.C('016421bb3797e22d1c4e',olympe.sc.Qp);olympe.sc.logic={};olympe.sc.logic.Sn=(a,b)=>a===b?0:a>b?1:-1;
926
- olympe.sc.logic.uy=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.D.Ta(b.getType().X());let k,m;if(b===olympe.dc.fa(olympe.dm.String))k=c.valueOf().toLowerCase(),m=p=>p.rb(h).toLowerCase();else if(b===olympe.dc.fa(olympe.dm.Number))k=c.valueOf(),m=p=>p.Gc(h);else if(b===olympe.dc.fa(olympe.dm.DateTime))k=c.getTime(),m=p=>olympe.D.sa([p.mi(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ta().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
927
- return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.Sn(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.Sn(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.Kf().filter(p=>olympe.D.sa([m(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Ib(d.valueOf()?1===q:0<=q)},olympe.D.ea,'FilterList ListDefBuilder Filter TransformFlows')).Ve())};
928
- olympe.sc.logic.aB=(a,b)=>{if(a instanceof olympe.D.aa)return a;if(a instanceof olympe.D.Ka)return a.Fq();if(a instanceof olympe.D.ea)return a.rq();if('string'===typeof a||'number'===typeof a)return olympe.D.oa(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.aa.zo};olympe.sc.logic.Oa={};function ml(a){Ee(a.N,(b,c)=>{b=b.create(a.N.F);Z(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Oa.Ln=class{constructor(a,b,c){this.N=olympe.dc.ka.C(a,b,...c);ml(this)}X(){return this.N.X()}};olympe.sc.logic.Oa.Ln.va=[olympe.dc.pe];const nl=Object.create(null),ol=new Map;function pl(a){if(void 0===nl[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Be(a)}function ql(a,b,c=olympe.sc.logic.Function){if(ol.has(a))throw c=pl(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.ka.C(a,b,...[]);ol.set(a,{N:d,qB:b,YA:c});return d}
929
- olympe.sc.logic.ka=class{constructor(){}static C(a,b,...c){if(nl[a])throw c=pl(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Oa.Ln(a,b,[olympe.sc.R.za].concat(c));return nl[a]=b}};olympe.sc.logic.gx=class{};olympe.sc.logic.Mi=class extends olympe.dc.CloudObject{};olympe.sc.logic.Mi.N=olympe.dc.ka.C('01621fb84e320000cf00',olympe.sc.logic.Mi);olympe.sc.logic.Error=class{constructor(a,b){this.code=a;this.C=b}static create(a,b){return new olympe.sc.logic.Error(b,a)}bv(){return this.C}zu(){return this.code}};B('olympe.sc.logic.Error',olympe.sc.logic.Error);olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.zu;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.bv;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;
930
- olympe.sc.logic.Ih=class extends olympe.sc.logic.Mi{static create(a,b){return new olympe.sc.logic.Error(b,a)}};olympe.sc.logic.Ih.N=olympe.dc.ka.C('016eeb5ede9f3094d8f0',olympe.sc.logic.Ih);olympe.sc.logic.Mc=class extends olympe.dc.CloudObject{C(){return this.Yb(olympe.sc.logic.Mc.C,olympe.dc.CloudObject)}};olympe.sc.logic.Mc.N=olympe.dc.ka.C('016ac4f59ee8ea2081ba',olympe.sc.logic.Mc);olympe.sc.logic.Mc.F=olympe.sc.logic.Mc.N.ja('017bc044aeacce7ffc8f');olympe.sc.logic.Mc.C=olympe.sc.logic.Mc.N.pa('016ac4f5a0091c4790e2');U(olympe.dc.CloudObject.N,olympe.sc.logic.Mc.C);olympe.sc.logic.Mc.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.bg=class extends olympe.sc.logic.Mc{};olympe.sc.logic.bg.N=olympe.dc.ka.C('016ac4f59c592b862457',olympe.sc.logic.bg);olympe.sc.logic.bg.G=olympe.sc.Oc.C.Rb();olympe.sc.logic.bg.N.C=(a,b,c,d,e)=>{b=tj(a,b||'New Predefined Input',olympe.sc.logic.bg,olympe.sc.logic.ob);Z(b,olympe.sc.logic.Mc.F,e);a.Ea(olympe.sc.logic.Mc.C,b,c);a.Ea(olympe.sc.Oc.C,d,b);return b.X()};olympe.sc.logic.Cf=class extends olympe.sc.logic.Mc{};olympe.sc.logic.Cf.N=olympe.dc.ka.C('016ac4f59dd99f5df3e1',olympe.sc.logic.Cf);olympe.sc.logic.Cf.G=U(olympe.sc.logic.Cf.N,olympe.sc.Oc.F);olympe.sc.logic.Cf.N.C=(a,b,c,d,e)=>{b=tj(a,b||'New Predefined Output',olympe.sc.logic.Cf,olympe.sc.logic.wb);Z(b,olympe.sc.logic.Mc.F,e);a.Ea(olympe.sc.logic.Mc.C,b,c);a.Ea(olympe.sc.Oc.F,d,b);return b.X()};olympe.sc.logic.Jd=class extends olympe.sc.Xa{Ud(){return olympe.sc.ud.xe.xp}$(){return this.Wl().Kf().$c([olympe.sc.logic.Function]).and().Sc().$c([olympe.sc.logic.Ic,olympe.sc.logic.Kc]).Ve()}Ru(){return this.Wk().Kf().oi([olympe.dc.CloudObject.modelRel,olympe.sc.logic.bg.G]).Ve()}Su(){return this.Xi().Kf().oi([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Cf.G]).Ve()}Rd(a){const b=this.db.Tl(this,[olympe.sc.Xa.F],c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}jf(a){const b=
931
- this.db.Tl(this,[olympe.sc.Xa.G],c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}yv(){return this.Wk().Kf().oi([olympe.dc.CloudObject.modelRel],olympe.sc.logic.ob).Ve()}zv(){return this.Xi().Kf().oi([olympe.dc.CloudObject.modelRel],olympe.sc.logic.wb).Ve()}};olympe.sc.logic.Jd.N=ql('01621fb84e320000f000',olympe.sc.logic.Jd,olympe.sc.logic.Function);l=olympe.sc.logic.Jd.prototype;l.Ru.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Su.J=new olympe.D.H(()=>olympe.dc.ua,[]);
932
- l.Rd.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.jf.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.yv.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.zv.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.sc.logic.tf=class extends olympe.sc.logic.Jd{C(){return this.Rd('016ac63229782039429f')}F(){return this.jf('016ac6322acf67eebfe7')}G(){return this.Xi().Kf().eb(olympe.sc.logic.Lb.typeRel).Uj(olympe.sc.logic.Ih).Ve().Te().im(olympe.D.aa.ZERO)}};olympe.sc.logic.tf.C='016ac63229782039429f';olympe.sc.logic.tf.L='016ac6322acf67eebfe7';olympe.sc.logic.tf.N=ql('01621fb84e320000a000',olympe.sc.logic.tf,olympe.sc.logic.Action);olympe.sc.logic.tf.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);
933
- olympe.sc.logic.tf.prototype.F.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.tf.prototype.G.J=olympe.D.H.P;olympe.sc.logic.kn=class extends olympe.sc.logic.Jd{};olympe.sc.logic.kn.N=ql('01621fb84e320000f011',olympe.sc.logic.kn);olympe.sc.logic.jn=class extends olympe.sc.logic.tf{};olympe.sc.logic.jn.N=ql('01621fb84e320000f012',olympe.sc.logic.jn);olympe.sc.logic.Function=class extends olympe.sc.Runnable{L(){return[this.Eb]}T(){const a=olympe.sc.vd.F.Pr,b=olympe.sc.vd.F.Rs,c=this.db,d=new Map;this.getInputs().forEach(e=>{d.set(a+c.name(e),e)});this.getOutputs().forEach(e=>{d.set(b+c.name(e),e)});return d}C(a){return this.getOutputs().map(b=>this.db.mm(b,olympe.sc.logic.Lb.typeRel,olympe.sc.logic.Mi)?a.Am.bind(a,b):a.set.bind(a,b))}setupExecution(a){const b=this.getInputs();return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
934
- c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.N=olympe.dc.ka.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.R.za);olympe.sc.logic.Lb=class extends olympe.dc.CloudObject{getType(){return this.Yb(olympe.sc.logic.Lb.typeRel,olympe.dc.CloudObject)}C(){return this.Gc(olympe.sc.logic.Lb.C)}};olympe.sc.logic.Lb.N=olympe.dc.ka.C('0168a431d25001540000',olympe.sc.logic.Lb);olympe.sc.logic.Lb.C=olympe.sc.logic.Lb.N.ja('01740c5d4ae4b520dd01');olympe.sc.logic.Lb.typeRel=olympe.sc.logic.Lb.N.pa('0168a431d3b9b7438424');U(olympe.dc.CloudObject.N,olympe.sc.logic.Lb.typeRel);
908
+ olympe.sc.Xa.$b=olympe.sc.Xa.N.pa('0171838bcfed0000e00e');olympe.sc.Xa.Vb=olympe.sc.Xa.N.pa('0171838bcfed0000a00a');l=olympe.sc.Xa.prototype;l.ls.J=olympe.D.H.C;l.ov.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Bu.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.jm.J=olympe.D.H.C;l.gm.J=olympe.D.H.C;l.Vk.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Xi.J=new olympe.D.H(()=>olympe.dc.ua,[]);function bl(a){const b=olympe.dc.CloudObject.eq(new Map,a);olympe.D.Ma().onDestroy(()=>{const c=new olympe.dc.Sa;c.delete(b);c.lb()});return b}function cl(a,b){Pk(b.C,a);$k(a.sd(),b);const c=a.L(),d=dl(b,c),e=[];c.forEach((f,g)=>{f===a.ga?e[0]=g:f===a.da&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(el(a,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])})}
909
+ function fl(a,b){var c=a.oc();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.C(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.gb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],m=new olympe.sc.Np(b.C);m.F().run(()=>v(function*(){try{yield a.update(m,k,g)}catch(n){a.P(m,n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.K.debug(e):a.K.debug(f),a.P.bind(a,b),()=>a.K.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
910
+ function gl(a,b,c,d){const e=d.F(),f=W(a.db,b,c,e.G((g,h)=>{const k=Fk(d,h);g?olympe.dc.CloudObject.get(h).run(k):k.destroy()}));e.onDestroy(a.db.F.bind(a.db,b,c,f,!0))}function dl(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)}})}
911
+ function el(a,b,c){const d=olympe.D.Ma(),e=Df(a.db,a.tag,d.G((f,g,h)=>{const k=h?c:b;null!==k&&(null===g||void 0===g?k(f,null):k(f,olympe.sc.kg(g)),h&&b&&b(f,null))}));d.onDestroy(()=>{Ef(a.db,a.tag,e)})}
912
+ olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.K=c}run(a){a.F().run(()=>{cl(this,a);this.init(a);if(this.sd().jm())fl(this,a);else{const b=new olympe.sc.Np(a.C);b.F().run(()=>this.update(b,[],[]))}a.zm(olympe.sc.Xa.mb);a.yg(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a))})}sd(){return this.Cd()}init(a){this.onInit(a)}update(a,b,c){const d=this.sd();if(d.jm())this.onUpdate(a,b,c);else this.K.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.W()}`),
913
+ gl(this,d,olympe.sc.Xa.P,a),this.na()&&gl(this,d,olympe.sc.Xa.$,a)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}C(){return[]}onInit(){}onUpdate(){const a=this.oc(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.K.error(`No code was found for the following brick: ${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(){var a=
914
+ this.sd();return al(a,a.db.ib(a.tag,olympe.sc.Xa.F))}getOutputs(){var a=this.sd();return al(a,a.db.ib(a.tag,olympe.sc.Xa.G))}F(){return[]}T(){return new Map}na(){return!1}G(a,b,c,d){a=b.vb(a,c,!0);void 0!==d&&olympe.D.zg(a,d);return a}ub(a,b,c,d,e){olympe.D.sm([d],f=>{b.set(a,olympe.D.wq(f)?f.valueOf():f)});return this.G(a,b,c,e)}L(){return[this.ga,this.da]}ga(a,b){el(this,b,null)}da(a,b){el(this,null,b)}Db(a,b){const c=this.db,d=olympe.sc.logic.hb.G.Qb(),e=olympe.sc.logic.hb.F,f=olympe.sc.logic.hb.C;
915
+ this.lq(d,g=>{var h=g.X();if(h=c.Sb(h,e)||c.Sb(h,f))return hl(g,a,b.bind(null,h))})}P(a,b){b=b instanceof Error?`${b.message}\n${b.stack}`:b;this.K.error(`An error occurred in brick ${Ek(a)} (${this.oc()}):\n${b}`)}};olympe.sc.Runnable.N=Fe(olympe.dc.ka.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.L=olympe.sc.Runnable.N.pa('01692a4af82e8984742b');olympe.sc.Runnable.C=olympe.sc.Runnable.N.pa('01756a18d4921c103111');olympe.sc.Runnable.P=U(olympe.sc.Runnable.N,olympe.sc.Xa.P);
916
+ olympe.sc.Runnable.T=U(olympe.sc.Runnable.N,olympe.sc.Xa.T);olympe.sc.Runnable.$=U(olympe.sc.Runnable.N,olympe.sc.Xa.$);U(olympe.sc.Xa.N,olympe.sc.Runnable.L);U(olympe.sc.Xa.N,olympe.sc.Runnable.C);olympe.sc.Runnable.prototype.sd.J=new olympe.D.H(()=>olympe.sc.Xa,[]);olympe.sc.Runnable.prototype.G.J=new olympe.D.H(()=>Object,[]);olympe.sc.Runnable.prototype.ub.J=olympe.D.H.C;function il(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.ae)return(a=a.F())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.ae=class extends olympe.dc.CloudObject{F(){return this.db.ib(this,olympe.sc.ae.C)[0]}C(){return olympe.dc.CloudObject.get(il(this))}toString(){const a=il(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.ae.N=olympe.dc.ka.C('0163c9ae01f2d6e9ca49',olympe.sc.ae);olympe.sc.ae.C=olympe.sc.ae.N.pa('0169b5a8a33144fb0b49');
917
+ U(olympe.dc.CloudObject.N,olympe.sc.ae.C);olympe.sc.ae.prototype.F.J=new olympe.D.H(()=>String,[]);olympe.sc.ae.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.sc.wn=class extends olympe.dm.Ab{Td(){return olympe.sc.ad.ee.Gg}};olympe.sc.wn.N=olympe.dc.ka.C('0163a68ce44f3d1fa84c',olympe.sc.wn);olympe.sc.Jc=class extends olympe.dm.BrickMetadata{};olympe.sc.Jc.N=olympe.dc.ka.C('016324fde11a836f76c2',olympe.sc.Jc);olympe.sc.Jc.C=olympe.sc.Jc.N.pa('016324fde11a836087c2');olympe.sc.Jc.N.C=function(a,b){return sj(a,null!=b?b:'New type',olympe.sc.Jc).X()};let jl=null;
918
+ function kl(a,b){jl=a;const c=olympe.D.Ma(),d=c.G(b);olympe.dc.Nc.from(a).eb(olympe.sc.qa.Uc.C).eb(olympe.sc.Vc.C.Qb()).lb(c,!0).then(e=>{if(null!==e){const f=olympe.dc.ta();Og(c,e,g=>{g=f.uh(g)?g:f.model(g);return null!==g&&f.$c(g,olympe.sc.Jc)}).subscribe(()=>{d(olympe.sc.Vc.Ob.no)})}else olympe.la.fb('sc').error('No container found for the application',a),d(olympe.sc.Vc.Ob.al)}).catch(e=>{olympe.la.fb('sc').error('Error while loading business container:',e.message);d(olympe.sc.Vc.Ob.Cb)})}
919
+ olympe.sc.Vc=class extends olympe.dc.CloudObject{};olympe.sc.Vc.Ob={no:0,al:1,Cb:2};olympe.sc.Vc.N=olympe.dc.ka.C('017b3aa8fae1e3d044dc',olympe.sc.Vc);olympe.sc.Vc.C=olympe.sc.Vc.N.pa('017b3aa8fd1659291b92');olympe.sc.Vc.F=olympe.sc.Vc.N.pa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.N=olympe.dc.ka.C('018119241abce0e5696e',olympe.sc.Map);olympe.sc.$f=class extends olympe.sc.Map{};olympe.sc.$f.N=olympe.dc.ka.C('01631aacd8276ea98490',olympe.sc.$f);olympe.sc.File=class extends olympe.dm.File{static au(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Bq(a,e,b,c,d);return e}static bu(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.wm(a,e,b,c,d);return e}static Bq(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.wm(a,b,c,d,e)}static wm(a,b,c,d,e){const f=olympe.dc.ta(),g=f.Ia(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.si(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
920
+ 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.C,!1);a.yq(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.wm;olympe.sc.File.setContent=olympe.sc.File.Bq;olympe.sc.File.createFromURL=olympe.sc.File.bu;olympe.sc.File.createFromContent=olympe.sc.File.au;
921
+ olympe.sc.File.N=Ae(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Xf=class extends olympe.sc.File{L(){const a=olympe.D.cc(olympe.D.Ka);this.Lj(b=>{a.update(olympe.D.sb(b))});return a.vb()}};olympe.sc.Xf.N=Ae(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Xf);olympe.sc.Xf.N.C=olympe.sc.File.F.bind(null,olympe.sc.Xf);olympe.sc.Xf.prototype.L.J=olympe.D.H.F;olympe.sc.tc=class extends olympe.sc.File{L(){return this.rb(olympe.sc.tc.fontFamilyProp)}P(){return this.rb(olympe.sc.tc.G)}T(){return this.Gc(olympe.sc.tc.L)}};olympe.sc.tc.N=Ae(olympe.sc.File,'01647e113043c637b541',olympe.sc.tc);olympe.sc.tc.fontFamilyProp=olympe.sc.tc.N.ja('01647e35ecd24ef0b88d');olympe.sc.tc.G=olympe.sc.tc.N.ja('01647e677f5d1cfbdf42');olympe.sc.tc.L=olympe.sc.tc.N.ja('01647e6780999bf8bd25');
922
+ olympe.sc.tc.N.C=(a,b,c,d)=>{c=olympe.sc.File.F(olympe.sc.tc,a,b,c,d);a.update(c,olympe.sc.tc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.tc.prototype.L.J=olympe.D.H.F;olympe.sc.tc.prototype.P.J=olympe.D.H.F;olympe.sc.tc.prototype.T.J=olympe.D.H.G;olympe.sc.$g=class extends olympe.sc.File{};olympe.sc.$g.N=Ae(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.$g);olympe.sc.$g.N.C=olympe.sc.File.F.bind(null,olympe.sc.$g);olympe.sc.Pp=class extends olympe.dc.CloudObject{};olympe.sc.Pp.N=olympe.dc.ka.C('016421bb3797e22d1c4e',olympe.sc.Pp);olympe.sc.logic={};olympe.sc.logic.Sn=(a,b)=>a===b?0:a>b?1:-1;
923
+ olympe.sc.logic.sy=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.D.Ta(b.getType().X());let k,m;if(b===olympe.dc.fa(olympe.dm.String))k=c.valueOf().toLowerCase(),m=p=>p.rb(h).toLowerCase();else if(b===olympe.dc.fa(olympe.dm.Number))k=c.valueOf(),m=p=>p.Gc(h);else if(b===olympe.dc.fa(olympe.dm.DateTime))k=c.getTime(),m=p=>olympe.D.sa([p.ni(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ta().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
924
+ return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.Sn(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.Sn(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.Lf().filter(p=>olympe.D.sa([m(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Ib(d.valueOf()?1===q:0<=q)},olympe.D.ea,'FilterList ListDefBuilder Filter TransformFlows')).Ue())};
925
+ olympe.sc.logic.ZA=(a,b)=>{if(a instanceof olympe.D.aa)return a;if(a instanceof olympe.D.Ka)return a.Eq();if(a instanceof olympe.D.ea)return a.qq();if('string'===typeof a||'number'===typeof a)return olympe.D.oa(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.aa.xo};olympe.sc.logic.Oa={};function ll(a){Ee(a.N,(b,c)=>{b=b.create(a.N.F);Z(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Oa.Ln=class{constructor(a,b,c){this.N=olympe.dc.ka.C(a,b,...c);ll(this)}X(){return this.N.X()}};olympe.sc.logic.Oa.Ln.va=[olympe.dc.qe];const ml=Object.create(null),nl=new Map;function ol(a){if(void 0===ml[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Be(a)}function pl(a,b,c=olympe.sc.logic.Function){if(nl.has(a))throw c=ol(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.ka.C(a,b,...[]);nl.set(a,{N:d,oB:b,WA:c});return d}
926
+ olympe.sc.logic.ka=class{constructor(){}static C(a,b,...c){if(ml[a])throw c=ol(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Oa.Ln(a,b,[olympe.sc.R.za].concat(c));return ml[a]=b}};olympe.sc.logic.bx=class{};olympe.sc.logic.Mi=class extends olympe.dc.CloudObject{};olympe.sc.logic.Mi.N=olympe.dc.ka.C('01621fb84e320000cf00',olympe.sc.logic.Mi);olympe.sc.logic.Error=class{constructor(a,b){this.code=a;this.C=b}static create(a,b){return new olympe.sc.logic.Error(b,a)}av(){return this.C}yu(){return this.code}};B('olympe.sc.logic.Error',olympe.sc.logic.Error);olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.yu;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.av;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;
927
+ olympe.sc.logic.Kh=class extends olympe.sc.logic.Mi{static create(a,b){return new olympe.sc.logic.Error(b,a)}};olympe.sc.logic.Kh.N=olympe.dc.ka.C('016eeb5ede9f3094d8f0',olympe.sc.logic.Kh);olympe.sc.logic.Mc=class extends olympe.dc.CloudObject{C(){return this.Xb(olympe.sc.logic.Mc.C,olympe.dc.CloudObject)}};olympe.sc.logic.Mc.N=olympe.dc.ka.C('016ac4f59ee8ea2081ba',olympe.sc.logic.Mc);olympe.sc.logic.Mc.F=olympe.sc.logic.Mc.N.ja('017bc044aeacce7ffc8f');olympe.sc.logic.Mc.C=olympe.sc.logic.Mc.N.pa('016ac4f5a0091c4790e2');U(olympe.dc.CloudObject.N,olympe.sc.logic.Mc.C);olympe.sc.logic.Mc.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.bg=class extends olympe.sc.logic.Mc{};olympe.sc.logic.bg.N=olympe.dc.ka.C('016ac4f59c592b862457',olympe.sc.logic.bg);olympe.sc.logic.bg.G=olympe.sc.Oc.C.Qb();olympe.sc.logic.bg.N.C=(a,b,c,d,e)=>{b=sj(a,b||'New Predefined Input',olympe.sc.logic.bg,olympe.sc.logic.ob);Z(b,olympe.sc.logic.Mc.F,e);a.Ea(olympe.sc.logic.Mc.C,b,c);a.Ea(olympe.sc.Oc.C,d,b);return b.X()};olympe.sc.logic.Df=class extends olympe.sc.logic.Mc{};olympe.sc.logic.Df.N=olympe.dc.ka.C('016ac4f59dd99f5df3e1',olympe.sc.logic.Df);olympe.sc.logic.Df.G=U(olympe.sc.logic.Df.N,olympe.sc.Oc.F);olympe.sc.logic.Df.N.C=(a,b,c,d,e)=>{b=sj(a,b||'New Predefined Output',olympe.sc.logic.Df,olympe.sc.logic.wb);Z(b,olympe.sc.logic.Mc.F,e);a.Ea(olympe.sc.logic.Mc.C,b,c);a.Ea(olympe.sc.Oc.F,d,b);return b.X()};olympe.sc.logic.Id=class extends olympe.sc.Xa{Td(){return olympe.sc.ad.ee.vp}$(){return this.Vl().Lf().$c([olympe.sc.logic.Function]).and().Sc().$c([olympe.sc.logic.Ic,olympe.sc.logic.Kc]).Ue()}Qu(){return this.Vk().Lf().pi([olympe.dc.CloudObject.modelRel,olympe.sc.logic.bg.G]).Ue()}Ru(){return this.Xi().Lf().pi([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Df.G]).Ue()}Qd(a){const b=this.db.Sl(this,[olympe.sc.Xa.F],c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}jf(a){const b=
928
+ this.db.Sl(this,[olympe.sc.Xa.G],c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}xv(){return this.Vk().Lf().pi([olympe.dc.CloudObject.modelRel],olympe.sc.logic.ob).Ue()}yv(){return this.Xi().Lf().pi([olympe.dc.CloudObject.modelRel],olympe.sc.logic.wb).Ue()}};olympe.sc.logic.Id.N=pl('01621fb84e320000f000',olympe.sc.logic.Id,olympe.sc.logic.Function);l=olympe.sc.logic.Id.prototype;l.Qu.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.Ru.J=new olympe.D.H(()=>olympe.dc.ua,[]);
929
+ l.Qd.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.jf.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.xv.J=new olympe.D.H(()=>olympe.dc.ua,[]);l.yv.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.sc.logic.tf=class extends olympe.sc.logic.Id{C(){return this.Qd('016ac63229782039429f')}F(){return this.jf('016ac6322acf67eebfe7')}G(){return this.Xi().Lf().eb(olympe.sc.logic.Lb.typeRel).Uj(olympe.sc.logic.Kh).Ue().Se().hm(olympe.D.aa.ZERO)}};olympe.sc.logic.tf.C='016ac63229782039429f';olympe.sc.logic.tf.L='016ac6322acf67eebfe7';olympe.sc.logic.tf.N=pl('01621fb84e320000a000',olympe.sc.logic.tf,olympe.sc.logic.Action);olympe.sc.logic.tf.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);
930
+ olympe.sc.logic.tf.prototype.F.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.tf.prototype.G.J=olympe.D.H.P;olympe.sc.logic.kn=class extends olympe.sc.logic.Id{};olympe.sc.logic.kn.N=pl('01621fb84e320000f011',olympe.sc.logic.kn);olympe.sc.logic.jn=class extends olympe.sc.logic.tf{};olympe.sc.logic.jn.N=pl('01621fb84e320000f012',olympe.sc.logic.jn);olympe.sc.logic.Function=class extends olympe.sc.Runnable{L(){return[this.Db]}T(){const a=olympe.sc.vd.F.Pr,b=olympe.sc.vd.F.Rs,c=this.db,d=new Map;this.getInputs().forEach(e=>{d.set(a+c.name(e),e)});this.getOutputs().forEach(e=>{d.set(b+c.name(e),e)});return d}C(a){return this.getOutputs().map(b=>this.db.km(b,olympe.sc.logic.Lb.typeRel,olympe.sc.logic.Mi)?a.zm.bind(a,b):a.set.bind(a,b))}setupExecution(a){const b=this.getInputs();return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
931
+ c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.N=olympe.dc.ka.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.R.za);olympe.sc.logic.Lb=class extends olympe.dc.CloudObject{getType(){return this.Xb(olympe.sc.logic.Lb.typeRel,olympe.dc.CloudObject)}C(){return this.Gc(olympe.sc.logic.Lb.C)}};olympe.sc.logic.Lb.N=olympe.dc.ka.C('0168a431d25001540000',olympe.sc.logic.Lb);olympe.sc.logic.Lb.C=olympe.sc.logic.Lb.N.ja('01740c5d4ae4b520dd01');olympe.sc.logic.Lb.typeRel=olympe.sc.logic.Lb.N.pa('0168a431d3b9b7438424');U(olympe.dc.CloudObject.N,olympe.sc.logic.Lb.typeRel);
935
932
  olympe.sc.logic.Lb.prototype.getType.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Lb.prototype.C.J=olympe.D.H.G;olympe.sc.logic.ob=class extends olympe.sc.logic.Lb{};olympe.sc.logic.ob.N=olympe.dc.ka.C('0168a431d25001540001',olympe.sc.logic.ob);olympe.sc.logic.ob.T=olympe.sc.logic.Lb.N.ja('01740c5d4ae4b520dd02');olympe.sc.logic.ob.P=U(olympe.sc.logic.ob.N,olympe.sc.Xa.F);olympe.sc.logic.ob.F=olympe.sc.logic.ob.N.pa('0168a431d91f2578000b',olympe.dc.wa.ORIGIN);olympe.sc.logic.ob.G=olympe.sc.logic.ob.N.pa('01621fb84e32000000a1',olympe.dc.wa.ORIGIN);
936
933
  olympe.sc.logic.ob.L=olympe.sc.logic.ob.N.pa('01621fb84e32000000d1',olympe.dc.wa.ORIGIN);olympe.sc.logic.ob.N.C=function(a,b,c,d,e,f=olympe.sc.logic.ob){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Ea(olympe.sc.logic.Lb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Lb.C,e);d&&a.Ea(olympe.sc.Xa.F,d,f);return f.X()};olympe.sc.logic.wb=class extends olympe.sc.logic.Lb{};olympe.sc.logic.wb.N=olympe.dc.ka.C('0168a431d25001540002',olympe.sc.logic.wb);olympe.sc.logic.wb.P=U(olympe.sc.logic.wb.N,olympe.sc.Xa.G);olympe.sc.logic.wb.F=olympe.sc.logic.wb.N.pa('0168a431d91f25780003',olympe.dc.wa.ORIGIN);olympe.sc.logic.wb.L=olympe.sc.logic.wb.N.pa('01621fb84e32000000a2',olympe.dc.wa.ORIGIN);olympe.sc.logic.wb.G=olympe.sc.logic.wb.N.pa('01621fb84e32000000d2',olympe.dc.wa.ORIGIN);
937
- olympe.sc.logic.wb.N.C=function(a,b,c,d,e,f=olympe.sc.logic.wb){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Ea(olympe.sc.logic.Lb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Lb.C,e);d&&a.Ea(olympe.sc.Xa.G,d,f);return f.X()};olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.sd().C().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:this.getInputs().filter(d=>d!==b).map(d=>a.get(d))))}};olympe.sc.logic.Action.N=olympe.dc.ka.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.R.za);olympe.sc.logic.Ic=class extends olympe.sc.logic.Function{run(a){dl(this,a);const b=a.getParent(),c=this.db.Tb(this,olympe.sc.logic.Ic.G),d=this.db.Tb(this,olympe.sc.logic.Ic.F);a.on(c,e=>b.set(d,e),this.tag)}Da(){return this.Yb(olympe.sc.logic.Ic.G,olympe.sc.logic.ob)}Wa(){return this.Yb(olympe.sc.logic.Ic.F,olympe.sc.logic.wb)}};olympe.sc.logic.Ic.N=olympe.dc.ka.C('01621fb84e32000000a0',olympe.sc.logic.Ic,olympe.sc.R.za);olympe.sc.logic.Ic.G=U(olympe.sc.logic.Ic.N,olympe.sc.logic.ob.G);
938
- olympe.sc.logic.Ic.F=U(olympe.sc.logic.Ic.N,olympe.sc.logic.wb.L);olympe.sc.logic.Ic.N.C=function(a,b,c){b=a.create(olympe.sc.logic.Ic);a.Ea(olympe.sc.logic.Ic.F,b,c);return b.X()};olympe.sc.logic.Ic.prototype.Da.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Ic.prototype.Wa.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Kc=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Tb(this,olympe.sc.logic.Kc.F),d=this.db.Tb(this,olympe.sc.logic.Kc.G);b.on(c,e=>a.set(d,e),b.W())}Wa(){return this.Yb(olympe.sc.logic.Kc.F,olympe.sc.logic.ob)}Da(){return this.Yb(olympe.sc.logic.Kc.G,olympe.sc.logic.wb)}};olympe.sc.logic.Kc.N=olympe.dc.ka.C('01621fb84e32000000d0',olympe.sc.logic.Kc,olympe.sc.R.za);olympe.sc.logic.Kc.F=U(olympe.sc.logic.Kc.N,olympe.sc.logic.ob.L);
939
- olympe.sc.logic.Kc.G=U(olympe.sc.logic.Kc.N,olympe.sc.logic.wb.G);olympe.sc.logic.Kc.N.C=function(a,b,c){b=a.create(olympe.sc.logic.Kc);a.Ea(olympe.sc.logic.Kc.F,b,c);return b.X()};olympe.sc.logic.Kc.prototype.Wa.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Kc.prototype.Da.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);function il(a,b,c){const d=a.db.Tb(a,olympe.sc.logic.hb.T)||a.db.Tb(a,olympe.sc.logic.hb.L),e=a.db.Tb(a,olympe.sc.logic.hb.P),f=a.db.ri(rl(a),olympe.dm.re)?new olympe.D.Jb('Pipe Context'):null,g=a.C.bind(a,c,f);if(null!==d&&null!==e){let k;const m=b.Zj(e,n=>{k&&k();k=n.on(d,g,e)});return()=>{g(null);m();k&&k()}}const h=Bf(a.db,a,olympe.sc.logic.hb.valueProp,g);return()=>{g(null);Cf(a.db,a,olympe.sc.logic.hb.valueProp,h)}}
940
- function rl(a){let b=null,c=a.db.Tb(a,olympe.sc.logic.hb.F);c?b=a.db.Tb(c,olympe.dm.Property.typeRel):(c=a.db.Tb(a,olympe.sc.logic.hb.C))&&(b=a.db.Tb(c,olympe.sc.logic.Lb.typeRel));return b||olympe.dc.fa(olympe.dc.CloudObject)}
941
- olympe.sc.logic.hb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.K=c}C(a,b,c){const d=olympe.sc.kg(c);null==b||b.na();b&&d instanceof olympe.dm.re?null==b||b.run(()=>{olympe.D.pc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.kf(olympe.sc.logic.hb.valueProp,a||olympe.dc.Fb.kg,Object)}getType(){const a=this.transform(olympe.sc.logic.hb.C,olympe.sc.logic.Lb.typeRel);a.md(olympe.dc.CloudObject);return a.xc()}wv(){return this.Yb(olympe.sc.logic.hb.P,olympe.dc.CloudObject)}uv(){return this.Yb(olympe.sc.logic.hb.T,
942
- olympe.sc.logic.wb)}vv(){return this.Yb(olympe.sc.logic.hb.L,olympe.dm.Property)}Lu(){return this.Yb(olympe.sc.logic.hb.G,olympe.dc.CloudObject)}Ju(){return this.Yb(olympe.sc.logic.hb.C,olympe.sc.logic.ob)}Ku(){return this.Yb(olympe.sc.logic.hb.F,olympe.dm.Property)}};olympe.sc.logic.hb.N=olympe.dc.ka.C('0168a431d91f25780000',olympe.sc.logic.hb,olympe.sc.R.za);olympe.sc.logic.hb.valueProp=olympe.sc.logic.hb.N.ja('0168a431d91f25780001');olympe.sc.logic.hb.P=olympe.sc.logic.hb.N.pa('0168a431d91f25780002');
934
+ olympe.sc.logic.wb.N.C=function(a,b,c,d,e,f=olympe.sc.logic.wb){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Ea(olympe.sc.logic.Lb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Lb.C,e);d&&a.Ea(olympe.sc.Xa.G,d,f);return f.X()};olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.sd().C().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:this.getInputs().filter(d=>d!==b).map(d=>a.get(d))))}};olympe.sc.logic.Action.N=olympe.dc.ka.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.R.za);olympe.sc.logic.Ic=class extends olympe.sc.logic.Function{run(a){cl(this,a);const b=a.getParent(),c=this.db.Sb(this,olympe.sc.logic.Ic.G),d=this.db.Sb(this,olympe.sc.logic.Ic.F);a.on(c,e=>b.set(d,e),this.tag)}Da(){return this.Xb(olympe.sc.logic.Ic.G,olympe.sc.logic.ob)}Wa(){return this.Xb(olympe.sc.logic.Ic.F,olympe.sc.logic.wb)}};olympe.sc.logic.Ic.N=olympe.dc.ka.C('01621fb84e32000000a0',olympe.sc.logic.Ic,olympe.sc.R.za);olympe.sc.logic.Ic.G=U(olympe.sc.logic.Ic.N,olympe.sc.logic.ob.G);
935
+ olympe.sc.logic.Ic.F=U(olympe.sc.logic.Ic.N,olympe.sc.logic.wb.L);olympe.sc.logic.Ic.N.C=function(a,b,c){b=a.create(olympe.sc.logic.Ic);a.Ea(olympe.sc.logic.Ic.F,b,c);return b.X()};olympe.sc.logic.Ic.prototype.Da.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Ic.prototype.Wa.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Kc=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Sb(this,olympe.sc.logic.Kc.F),d=this.db.Sb(this,olympe.sc.logic.Kc.G);b.on(c,e=>a.set(d,e),b.W())}Wa(){return this.Xb(olympe.sc.logic.Kc.F,olympe.sc.logic.ob)}Da(){return this.Xb(olympe.sc.logic.Kc.G,olympe.sc.logic.wb)}};olympe.sc.logic.Kc.N=olympe.dc.ka.C('01621fb84e32000000d0',olympe.sc.logic.Kc,olympe.sc.R.za);olympe.sc.logic.Kc.F=U(olympe.sc.logic.Kc.N,olympe.sc.logic.ob.L);
936
+ olympe.sc.logic.Kc.G=U(olympe.sc.logic.Kc.N,olympe.sc.logic.wb.G);olympe.sc.logic.Kc.N.C=function(a,b,c){b=a.create(olympe.sc.logic.Kc);a.Ea(olympe.sc.logic.Kc.F,b,c);return b.X()};olympe.sc.logic.Kc.prototype.Wa.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Kc.prototype.Da.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);function hl(a,b,c){const d=a.db.Sb(a,olympe.sc.logic.hb.T)||a.db.Sb(a,olympe.sc.logic.hb.L),e=a.db.Sb(a,olympe.sc.logic.hb.P),f=a.db.si(ql(a),olympe.dm.se)?new olympe.D.Jb('Pipe Context'):null,g=a.C.bind(a,c,f);if(null!==d&&null!==e){let k;const m=b.Zj(e,n=>{k&&k();k=n.on(d,g,e)});return()=>{g(null);m();k&&k()}}const h=Bf(a.db,a,olympe.sc.logic.hb.valueProp,g);return()=>{g(null);Cf(a.db,a,olympe.sc.logic.hb.valueProp,h)}}
937
+ function ql(a){let b=null,c=a.db.Sb(a,olympe.sc.logic.hb.F);c?b=a.db.Sb(c,olympe.dm.Property.typeRel):(c=a.db.Sb(a,olympe.sc.logic.hb.C))&&(b=a.db.Sb(c,olympe.sc.logic.Lb.typeRel));return b||olympe.dc.fa(olympe.dc.CloudObject)}
938
+ olympe.sc.logic.hb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.K=c}C(a,b,c){const d=olympe.sc.kg(c);null==b||b.na();b&&d instanceof olympe.dm.se?null==b||b.run(()=>{olympe.D.qc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.kf(olympe.sc.logic.hb.valueProp,a||olympe.dc.Eb.kg,Object)}getType(){const a=this.transform(olympe.sc.logic.hb.C,olympe.sc.logic.Lb.typeRel);a.md(olympe.dc.CloudObject);return a.yc()}vv(){return this.Xb(olympe.sc.logic.hb.P,olympe.dc.CloudObject)}tv(){return this.Xb(olympe.sc.logic.hb.T,
939
+ olympe.sc.logic.wb)}uv(){return this.Xb(olympe.sc.logic.hb.L,olympe.dm.Property)}Ku(){return this.Xb(olympe.sc.logic.hb.G,olympe.dc.CloudObject)}Iu(){return this.Xb(olympe.sc.logic.hb.C,olympe.sc.logic.ob)}Ju(){return this.Xb(olympe.sc.logic.hb.F,olympe.dm.Property)}};olympe.sc.logic.hb.N=olympe.dc.ka.C('0168a431d91f25780000',olympe.sc.logic.hb,olympe.sc.R.za);olympe.sc.logic.hb.valueProp=olympe.sc.logic.hb.N.ja('0168a431d91f25780001');olympe.sc.logic.hb.P=olympe.sc.logic.hb.N.pa('0168a431d91f25780002');
943
940
  olympe.sc.logic.hb.T=U(olympe.sc.logic.hb.N,olympe.sc.logic.wb.F);olympe.sc.logic.hb.L=olympe.sc.logic.hb.N.pa('0168a431d91f25780004');olympe.sc.logic.hb.G=olympe.sc.logic.hb.N.pa('0168a431d91f2578000a');olympe.sc.logic.hb.C=U(olympe.sc.logic.hb.N,olympe.sc.logic.ob.F);olympe.sc.logic.hb.F=olympe.sc.logic.hb.N.pa('0168a431d91f2578000c');U(olympe.dc.CloudObject.N,olympe.sc.logic.hb.P);U(olympe.dm.Property.N,olympe.sc.logic.hb.L);U(olympe.dc.CloudObject.N,olympe.sc.logic.hb.G);
944
- U(olympe.dm.Property.N,olympe.sc.logic.hb.F);l=olympe.sc.logic.hb.prototype;l.getType.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.wv.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.uv.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.vv.J=new olympe.D.H(()=>olympe.dm.Property,[]);l.Lu.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Ju.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Ku.J=new olympe.D.H(()=>olympe.dm.Property,[]);function sl(a,b){const c=a.sd(),d=c.Xk().X(),e=c.Yk().X(),f=c.Zk().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.O.qb.get(a.nc(),g,h).then(k=>{for(const [m,n]of k)m!==e&&m!==f&&b.set(m,n);b.set(e,k.get(e));b.set(f,k.get(f))}).catch(k=>{k=`RemoteAction "${a.name()}" (${a.tag}) encountered an error:\n${k}`;a.K.error(k);b.set(f,olympe.sc.logic.Ih.create(k,400))})}},b.W())}
945
- function tl(a,b,c,d,e,f){const g=n=>{if(null!==n){e.cancel();k&&k();m&&m();try{const p=new Map(a.getOutputs().map(q=>[q,b.get(q)]));f.ed(p).finally(()=>b.destroy())}catch(p){n=Error(`Error while serializing the response from remote action ${a.nc()}: ${p.message}`),f.ih(n).finally(()=>b.destroy())}}},h=b.W(),k=b.on(c,g,h),m=b.on(d,g,h)}
946
- olympe.sc.logic.Ug=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.Ta(olympe.sc.xa.C.EDITION))&&b||(this.db.Qa(this,olympe.sc.logic.Ug.F)?this.Da(a):(dl(this,a),sl(this,a)))}Da(a){const b=this.nc(),c=this.sd(),d=c.no().X(),e=c.Xk().X(),f=c.Yk().X(),g=c.Zk().X();(new olympe.O.qb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.gh('remote call'),m=h.body(),n=Mb(()=>{h.ih(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
947
- k.destroy()},this.timeout);tl(this,k,f,g,n,h);super.run(k);for(const [p,q]of m)p!==e&&k.set(p,q);h.wh().then(p=>{var q=k.get(d);null!==q&&olympe.dc.fa(q)!==p&&(q=this.nc(),this.K.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,m.get(e))}).catch(p=>{const q=this.nc();this.K.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Ih.create('Unrecognized User',
948
- 1))})},h=>{const k=this.nc();this.K.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Ug.N=olympe.dc.ka.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Ug,olympe.sc.R.za,new olympe.V.ma(olympe.sc.U.fp));olympe.sc.logic.Ug.F=olympe.sc.logic.Ug.N.ja('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Sk=class{constructor(a){this.db=olympe.dc.ta();this.typeRel=a}};olympe.sc.logic.controllers.Sk.C={jx:-1,ny:1};olympe.sc.logic.controllers.dz=class extends olympe.sc.logic.controllers.Sk{constructor(){super(olympe.sc.logic.Mc.C)}};olympe.sc.logic.controllers.jz=class extends olympe.sc.logic.controllers.Sk{constructor(){super(olympe.sc.logic.Lb.typeRel)}};olympe.sc.logic.Jj={};olympe.sc.logic.Jj.qt=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.fa(b);d?olympe.dc.ra.cc(a,d,olympe.dc.Ob.Ef).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.K.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.ka.C('0174bf4b7e006e4b788a',olympe.sc.logic.Jj.qt);olympe.sc.logic.actions={};olympe.sc.logic.Jj.Fs=class extends olympe.sc.logic.Function{run(a){dl(this,a);const [b,c,d]=this.C(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.K.warn('No list to iter upon'),this.K.info(a.W())):f<e?(b(g.Fe(f)),f++,c((new Date).getTime())):(Sk(h.C),d((new Date).getTime()))};this.getInputs().forEach((m,n)=>a.on(m,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.Nf();f=0;Rk(h.C);k();break;case 2:k();break;default:this.K.error('Unhandled input')}},this.tag))}};
949
- olympe.sc.logic.ka.C('0171889b060b6cd54300',olympe.sc.logic.Jj.Fs);olympe.sc.logic.Sb={};olympe.sc.logic.Sb.Tk=class extends olympe.sc.logic.Jd{C(){return this.Rd('016ac63808535703691c')}};olympe.sc.logic.Sb.Tk.N=ql('0169b6876a03f139d50a',olympe.sc.logic.Sb.Tk);olympe.sc.logic.Sb.Tk.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Sb.gl=class extends olympe.sc.logic.Jd{C(){return this.Rd('016ac63809a9a8e6db96')}F(){return this.jf('016ac6380ab003363b3e')}};ql('01646ad602f933b8caaf',olympe.sc.logic.Sb.gl);olympe.sc.logic.Sb.gl.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Sb.gl.prototype.F.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Sb.ej=class extends olympe.sc.logic.Jd{C(){return this.Rd('016ac6380bd98f1d91a0')}G(){return this.jf('016ac63c589ae38ca3ae')}F(){return this.jf('016ac63c5a377fceabaa')}};ql('0168ec42fc01747a98b6',olympe.sc.logic.Sb.ej);olympe.sc.logic.Sb.ej.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Sb.ej.prototype.G.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Sb.ej.prototype.F.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Sb.dg=class extends olympe.sc.logic.Jd{Xk(){return this.Rd('017a7b07b09e3b22c8b4')}no(){return this.Rd('017a7b07ba05807a74b0')}Yk(){return this.jf('017a7b0818c12388d731')}Zk(){return this.jf('017a7b085146d5e69aec')}ms(){return olympe.D.ea.F}};olympe.sc.logic.Sb.dg.L='017a7b07b09e3b22c8b4';olympe.sc.logic.Sb.dg.ub='017a7b07ba05807a74b0';olympe.sc.logic.Sb.dg.Da='017a7b0818c12388d731';olympe.sc.logic.Sb.dg.C='017a7b085146d5e69aec';
950
- olympe.sc.logic.Sb.dg.N=ql('017a7b07a948e30508fa',olympe.sc.logic.Sb.dg,olympe.sc.logic.Ug);l=olympe.sc.logic.Sb.dg.prototype;l.Xk.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.no.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Yk.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.Zk.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.ms.J=olympe.D.H.P;olympe.sc.logic.Sb.Cp=class extends olympe.sc.logic.Jd{C(){return this.Rd('016ac63c5b3ed0562740')}};ql('016a9766c230916ea5ec',olympe.sc.logic.Sb.Cp);olympe.sc.logic.Sb.Cp.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.query={};olympe.sc.query.Lm=class extends olympe.sc.$f{};olympe.sc.query.Lm.N=olympe.dc.ka.C('01631aacd8276ea98491',olympe.sc.query.Lm);olympe.sc.query.Po=class extends olympe.dm.Enum{};olympe.sc.query.Po.N=olympe.dc.ka.C('01631aacd8276ea98495',olympe.sc.query.Po);olympe.sc.query.Zo=class extends olympe.dm.Enum{};olympe.sc.query.Zo.N=olympe.dc.ka.C('01631aacd8276ea98494',olympe.sc.query.Zo);olympe.sc.query.$o=class extends olympe.sc.$f{};olympe.sc.query.$o.N=olympe.dc.ka.C('01631aacd8276ea98492',olympe.sc.query.$o);olympe.sc.query.tc=class extends olympe.dc.CloudObject{};olympe.sc.query.tc.N=olympe.dc.ka.C('01631aacd8276ea98493',olympe.sc.query.tc);olympe.sc.pn=class extends olympe.dc.CloudObject{};olympe.sc.pn.N=olympe.dc.ka.C('018312ceeb3e93618a85',olympe.sc.pn);olympe.sc.Gb={};olympe.sc.Gb.Comment=class extends olympe.dm.BrickMetadata{getType(){return this.rb(olympe.sc.Gb.Comment.L)}F(){return this.rb(olympe.sc.Gb.Comment.G)}C(){return new olympe.D.Kb(this.Gc(olympe.sc.Gb.Comment.P),this.Gc(olympe.sc.Gb.Comment.F))}static Ec(a,b,c,...d){c=d[0];d=d[1];b=a.create(b);b.X();a.Ea(olympe.dc.CloudObject.containsRel,c,b);a.Ea(olympe.sc.Gb.Comment.C,b,c);c=a.create(olympe.sc.ui.ud.Yo);Z(c,olympe.sc.ui.ud.Yo.RB,d.lo());Z(c,olympe.sc.ui.ud.Yo.SB,d.mo());a.Ea(olympe.dm.BrickMetadata.ga,
951
- b,c);a.Ea(olympe.dc.CloudObject.containsRel,b,c)}};olympe.sc.Gb.Comment.$=100;olympe.sc.Gb.Comment.T=66;olympe.sc.Gb.Comment.N=olympe.dc.ka.C('0184bd886ee1c7adfe09',olympe.sc.Gb.Comment);olympe.sc.Gb.Comment.L=olympe.sc.Gb.Comment.N.ja('0184c80e29ed08a16c5e');olympe.sc.Gb.Comment.G=olympe.sc.Gb.Comment.N.ja('0184bd889f33359cfe75');olympe.sc.Gb.Comment.P=olympe.sc.Gb.Comment.N.ja('0184c3f9406e25a41512');olympe.sc.Gb.Comment.F=olympe.sc.Gb.Comment.N.ja('0184c3f942e4cc136ce8');
952
- olympe.sc.Gb.Comment.C=olympe.sc.Gb.Comment.N.pa('0184be3f135a83fd6cc3');olympe.sc.Gb.Comment.prototype.getType.J=olympe.D.H.F;olympe.sc.Gb.Comment.prototype.F.J=olympe.D.H.F;olympe.sc.Gb.Comment.prototype.C.J=olympe.D.H.T;olympe.sc.Gb.tk=class extends olympe.dm.Enum{};olympe.sc.Gb.tk.C={Ww:'Comment',qA:'Todo'};olympe.sc.Gb.tk.N=olympe.dc.ka.C('0184cc42e06205501bc7',olympe.sc.Gb.tk);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.N=olympe.dc.ka.C('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.N.ja('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.N.ja('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.N.ja('017ffdd8f0b1e31fe13a');
953
- olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.N.ja('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.N.ja('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.N.pa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.N.pa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Ye=class extends olympe.sc.logic.Jd{ns(){return this.Rd('017ffe02381f9fac5060')}rs(){return this.Rd('017ffe02381f9fac5061')}ss(){return this.Rd('017ffe02381f9fac5062')}Hu(){return this.Rd('017ffe02381f9fac5065')}ps(){return this.jf('017ffe02381f9fac5063')}qs(){return this.jf('017ffe02381f9fac5064')}};olympe.sc.workflow.Ye.N=ql('017ffde21f5fe0f704ce',olympe.sc.workflow.Ye);olympe.sc.workflow.Ye.C='017ffe02381f9fac5060';olympe.sc.workflow.Ye.jd='017ffe02381f9fac5061';
954
- olympe.sc.workflow.Ye.qd='017ffe02381f9fac5062';olympe.sc.workflow.Ye.Da='017ffe02381f9fac5065';olympe.sc.workflow.Ye.L='017ffe02381f9fac5063';olympe.sc.workflow.Ye.ub='017ffe02381f9fac5064';l=olympe.sc.workflow.Ye.prototype;l.ns.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.rs.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.ss.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Hu.J=new olympe.D.H(()=>Map,[]);l.ps.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.qs.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.workflow.we=class extends olympe.dm.BrickMetadata{yc(){return this.Yb(olympe.sc.workflow.Workflow.statesRel.Rb(),olympe.sc.workflow.Workflow).ia().concat(['.',this.ia()])}};olympe.sc.workflow.we.N=olympe.dc.ka.C('017ffdc2dda51d46b430',olympe.sc.workflow.we);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{F(){return this.uq()}C(){return this.Yb(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.we)}G(){return this.Yb(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.we)}yc(){const a=this.Yb(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.we);return a.Yb(olympe.sc.workflow.Workflow.statesRel.Rb(),olympe.sc.workflow.Workflow).ia().concat(['.',a.ia(),'->',this.ia()])}};
941
+ U(olympe.dm.Property.N,olympe.sc.logic.hb.F);l=olympe.sc.logic.hb.prototype;l.getType.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.vv.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.tv.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.uv.J=new olympe.D.H(()=>olympe.dm.Property,[]);l.Ku.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Iu.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Ju.J=new olympe.D.H(()=>olympe.dm.Property,[]);function rl(a,b){const c=a.sd(),d=c.Wk().X(),e=c.Xk().X(),f=c.Yk().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.O.qb.get(a.oc(),g,h).then(k=>{for(const [m,n]of k)m!==e&&m!==f&&b.set(m,n);b.set(e,k.get(e));b.set(f,k.get(f))}).catch(k=>{k=`RemoteAction "${a.name()}" (${a.tag}) encountered an error:\n${k}`;a.K.error(k);b.set(f,olympe.sc.logic.Kh.create(k,400))})}},b.W())}
942
+ function sl(a,b,c,d,e,f){const g=n=>{if(null!==n){e.cancel();k&&k();m&&m();try{const p=new Map(a.getOutputs().map(q=>[q,b.get(q)]));f.gd(p).finally(()=>b.destroy())}catch(p){n=Error(`Error while serializing the response from remote action ${a.oc()}: ${p.message}`),f.jh(n).finally(()=>b.destroy())}}},h=b.W(),k=b.on(c,g,h),m=b.on(d,g,h)}
943
+ olympe.sc.logic.Ug=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.Ta(olympe.sc.xa.C.EDITION))&&b||(this.db.Qa(this,olympe.sc.logic.Ug.F)?this.Da(a):(cl(this,a),rl(this,a)))}Da(a){const b=this.oc(),c=this.sd(),d=c.lo().X(),e=c.Wk().X(),f=c.Xk().X(),g=c.Yk().X();(new olympe.O.qb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.hh('remote call'),m=h.body(),n=Nb(()=>{h.jh(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
944
+ k.destroy()},this.timeout);sl(this,k,f,g,n,h);super.run(k);for(const [p,q]of m)p!==e&&k.set(p,q);h.yh().then(p=>{var q=k.get(d);null!==q&&olympe.dc.fa(q)!==p&&(q=this.oc(),this.K.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,m.get(e))}).catch(p=>{const q=this.oc();this.K.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Kh.create('Unrecognized User',
945
+ 1))})},h=>{const k=this.oc();this.K.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Ug.N=olympe.dc.ka.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Ug,olympe.sc.R.za,new olympe.V.ma(olympe.sc.U.cp));olympe.sc.logic.Ug.F=olympe.sc.logic.Ug.N.ja('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Rk=class{constructor(a){this.db=olympe.dc.ta();this.typeRel=a}};olympe.sc.logic.controllers.Rk.C={hx:-1,ly:1};olympe.sc.logic.controllers.bz=class extends olympe.sc.logic.controllers.Rk{constructor(){super(olympe.sc.logic.Mc.C)}};olympe.sc.logic.controllers.hz=class extends olympe.sc.logic.controllers.Rk{constructor(){super(olympe.sc.logic.Lb.typeRel)}};olympe.sc.logic.Jj={};olympe.sc.logic.Jj.qt=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.fa(b);d?olympe.dc.ra.bc(a,d,olympe.dc.Nb.Ff).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.K.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.ka.C('0174bf4b7e006e4b788a',olympe.sc.logic.Jj.qt);olympe.sc.logic.actions={};olympe.sc.logic.Jj.Fs=class extends olympe.sc.logic.Function{run(a){cl(this,a);const [b,c,d]=this.C(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.K.warn('No list to iter upon'),this.K.info(a.W())):f<e?(b(g.Fe(f)),f++,c((new Date).getTime())):(Rk(h.C),d((new Date).getTime()))};this.getInputs().forEach((m,n)=>a.on(m,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.Nf();f=0;Qk(h.C);k();break;case 2:k();break;default:this.K.error('Unhandled input')}},this.tag))}};
946
+ olympe.sc.logic.ka.C('0171889b060b6cd54300',olympe.sc.logic.Jj.Fs);olympe.sc.logic.Rb={};olympe.sc.logic.Rb.Sk=class extends olympe.sc.logic.Id{C(){return this.Qd('016ac63808535703691c')}};olympe.sc.logic.Rb.Sk.N=pl('0169b6876a03f139d50a',olympe.sc.logic.Rb.Sk);olympe.sc.logic.Rb.Sk.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Rb.fl=class extends olympe.sc.logic.Id{C(){return this.Qd('016ac63809a9a8e6db96')}F(){return this.jf('016ac6380ab003363b3e')}};pl('01646ad602f933b8caaf',olympe.sc.logic.Rb.fl);olympe.sc.logic.Rb.fl.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Rb.fl.prototype.F.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Rb.ej=class extends olympe.sc.logic.Id{C(){return this.Qd('016ac6380bd98f1d91a0')}G(){return this.jf('016ac63c589ae38ca3ae')}F(){return this.jf('016ac63c5a377fceabaa')}};pl('0168ec42fc01747a98b6',olympe.sc.logic.Rb.ej);olympe.sc.logic.Rb.ej.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Rb.ej.prototype.G.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Rb.ej.prototype.F.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Rb.dg=class extends olympe.sc.logic.Id{Wk(){return this.Qd('017a7b07b09e3b22c8b4')}lo(){return this.Qd('017a7b07ba05807a74b0')}Xk(){return this.jf('017a7b0818c12388d731')}Yk(){return this.jf('017a7b085146d5e69aec')}ms(){return olympe.D.ea.F}};olympe.sc.logic.Rb.dg.L='017a7b07b09e3b22c8b4';olympe.sc.logic.Rb.dg.ub='017a7b07ba05807a74b0';olympe.sc.logic.Rb.dg.Da='017a7b0818c12388d731';olympe.sc.logic.Rb.dg.C='017a7b085146d5e69aec';
947
+ olympe.sc.logic.Rb.dg.N=pl('017a7b07a948e30508fa',olympe.sc.logic.Rb.dg,olympe.sc.logic.Ug);l=olympe.sc.logic.Rb.dg.prototype;l.Wk.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.lo.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Xk.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.Yk.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.ms.J=olympe.D.H.P;olympe.sc.logic.Rb.Ap=class extends olympe.sc.logic.Id{C(){return this.Qd('016ac63c5b3ed0562740')}};pl('016a9766c230916ea5ec',olympe.sc.logic.Rb.Ap);olympe.sc.logic.Rb.Ap.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.query={};olympe.sc.query.Km=class extends olympe.sc.$f{};olympe.sc.query.Km.N=olympe.dc.ka.C('01631aacd8276ea98491',olympe.sc.query.Km);olympe.sc.query.No=class extends olympe.dm.Enum{};olympe.sc.query.No.N=olympe.dc.ka.C('01631aacd8276ea98495',olympe.sc.query.No);olympe.sc.query.Xo=class extends olympe.dm.Enum{};olympe.sc.query.Xo.N=olympe.dc.ka.C('01631aacd8276ea98494',olympe.sc.query.Xo);olympe.sc.query.Yo=class extends olympe.sc.$f{};olympe.sc.query.Yo.N=olympe.dc.ka.C('01631aacd8276ea98492',olympe.sc.query.Yo);olympe.sc.query.uc=class extends olympe.dc.CloudObject{};olympe.sc.query.uc.N=olympe.dc.ka.C('01631aacd8276ea98493',olympe.sc.query.uc);olympe.sc.pn=class extends olympe.dc.CloudObject{};olympe.sc.pn.N=olympe.dc.ka.C('018312ceeb3e93618a85',olympe.sc.pn);olympe.sc.Fb={};olympe.sc.Fb.Comment=class extends olympe.dm.BrickMetadata{getType(){return this.rb(olympe.sc.Fb.Comment.L)}F(){return this.rb(olympe.sc.Fb.Comment.G)}C(){return new olympe.D.Kb(this.Gc(olympe.sc.Fb.Comment.P),this.Gc(olympe.sc.Fb.Comment.F))}static Ec(a,b,c,...d){c=d[0];d=d[1];b=a.create(b);b.X();a.Ea(olympe.dc.CloudObject.containsRel,c,b);a.Ea(olympe.sc.Fb.Comment.C,b,c);c=a.create(olympe.sc.ui.ad.Wo);Z(c,olympe.sc.ui.ad.Wo.OB,d.jo());Z(c,olympe.sc.ui.ad.Wo.PB,d.ko());a.Ea(olympe.dm.BrickMetadata.ga,
948
+ b,c);a.Ea(olympe.dc.CloudObject.containsRel,b,c)}};olympe.sc.Fb.Comment.$=100;olympe.sc.Fb.Comment.T=66;olympe.sc.Fb.Comment.N=olympe.dc.ka.C('0184bd886ee1c7adfe09',olympe.sc.Fb.Comment);olympe.sc.Fb.Comment.L=olympe.sc.Fb.Comment.N.ja('0184c80e29ed08a16c5e');olympe.sc.Fb.Comment.G=olympe.sc.Fb.Comment.N.ja('0184bd889f33359cfe75');olympe.sc.Fb.Comment.P=olympe.sc.Fb.Comment.N.ja('0184c3f9406e25a41512');olympe.sc.Fb.Comment.F=olympe.sc.Fb.Comment.N.ja('0184c3f942e4cc136ce8');
949
+ olympe.sc.Fb.Comment.C=olympe.sc.Fb.Comment.N.pa('0184be3f135a83fd6cc3');olympe.sc.Fb.Comment.prototype.getType.J=olympe.D.H.F;olympe.sc.Fb.Comment.prototype.F.J=olympe.D.H.F;olympe.sc.Fb.Comment.prototype.C.J=olympe.D.H.T;olympe.sc.Fb.sk=class extends olympe.dm.Enum{};olympe.sc.Fb.sk.C={Vw:'Comment',oA:'Todo'};olympe.sc.Fb.sk.N=olympe.dc.ka.C('0184cc42e06205501bc7',olympe.sc.Fb.sk);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.N=olympe.dc.ka.C('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.N.ja('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.N.ja('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.N.ja('017ffdd8f0b1e31fe13a');
950
+ olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.N.ja('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.N.ja('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.N.pa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.N.pa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Xe=class extends olympe.sc.logic.Id{ns(){return this.Qd('017ffe02381f9fac5060')}rs(){return this.Qd('017ffe02381f9fac5061')}ss(){return this.Qd('017ffe02381f9fac5062')}Gu(){return this.Qd('017ffe02381f9fac5065')}ps(){return this.jf('017ffe02381f9fac5063')}qs(){return this.jf('017ffe02381f9fac5064')}};olympe.sc.workflow.Xe.N=pl('017ffde21f5fe0f704ce',olympe.sc.workflow.Xe);olympe.sc.workflow.Xe.C='017ffe02381f9fac5060';olympe.sc.workflow.Xe.nc='017ffe02381f9fac5061';
951
+ olympe.sc.workflow.Xe.qd='017ffe02381f9fac5062';olympe.sc.workflow.Xe.Da='017ffe02381f9fac5065';olympe.sc.workflow.Xe.L='017ffe02381f9fac5063';olympe.sc.workflow.Xe.ub='017ffe02381f9fac5064';l=olympe.sc.workflow.Xe.prototype;l.ns.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.rs.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.ss.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Gu.J=new olympe.D.H(()=>Map,[]);l.ps.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.qs.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.workflow.xe=class extends olympe.dm.BrickMetadata{zc(){return this.Xb(olympe.sc.workflow.Workflow.statesRel.Qb(),olympe.sc.workflow.Workflow).ia().concat(['.',this.ia()])}};olympe.sc.workflow.xe.N=olympe.dc.ka.C('017ffdc2dda51d46b430',olympe.sc.workflow.xe);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{F(){return this.tq()}C(){return this.Xb(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.xe)}G(){return this.Xb(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.xe)}zc(){const a=this.Xb(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.xe);return a.Xb(olympe.sc.workflow.Workflow.statesRel.Qb(),olympe.sc.workflow.Workflow).ia().concat(['.',a.ia(),'->',this.ia()])}};
955
952
  olympe.sc.workflow.Transition.N=olympe.dc.ka.C('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.N.ja('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.N.pa('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.N.pa('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.F.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);
956
- olympe.sc.workflow.Transition.prototype.C.J=new olympe.D.H(()=>olympe.sc.workflow.we,[]);olympe.sc.workflow.Transition.prototype.G.J=new olympe.D.H(()=>olympe.sc.workflow.we,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{Ud(){return olympe.sc.ud.xe.Gg}G(){return this.oh(olympe.sc.workflow.Workflow.serializationEnabledProp)}C(){return this.Yb(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.Jc)}F(){return this.Yb(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.we)}};olympe.sc.workflow.Workflow.N=olympe.dc.ka.C('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.N.ja('017ffdc010e5bcc9c972');
953
+ olympe.sc.workflow.Transition.prototype.C.J=new olympe.D.H(()=>olympe.sc.workflow.xe,[]);olympe.sc.workflow.Transition.prototype.G.J=new olympe.D.H(()=>olympe.sc.workflow.xe,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{Td(){return olympe.sc.ad.ee.Gg}G(){return this.ph(olympe.sc.workflow.Workflow.serializationEnabledProp)}C(){return this.Xb(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.Jc)}F(){return this.Xb(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.xe)}};olympe.sc.workflow.Workflow.N=olympe.dc.ka.C('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.N.ja('017ffdc010e5bcc9c972');
957
954
  olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.N.pa('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.N.pa('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.N.pa('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.G.J=olympe.D.H.P;olympe.sc.workflow.Workflow.prototype.C.J=new olympe.D.H(()=>olympe.sc.Jc,[]);
958
- olympe.sc.workflow.Workflow.prototype.F.J=new olympe.D.H(()=>olympe.sc.workflow.we,[]);olympe.sc.qa={};olympe.sc.qa.Uc=class extends olympe.sc.Xa{Ud(){return olympe.sc.ud.xe.ht}};olympe.sc.qa.Uc.N=Fe(olympe.dc.ka.C('01120300000000adef00',olympe.sc.qa.Uc));olympe.sc.qa.Uc.C=olympe.sc.qa.Uc.N.pa('0171bc1f15da96dfdb89');olympe.sc.qa.Uc.Da=olympe.sc.qa.Uc.N.pa('0171bc1f15da96dfdb90');U(olympe.dm.Ac.N,olympe.sc.qa.Uc.C);olympe.sc.qa.zh=class extends olympe.sc.Runnable{F(){return[this.nc()]}Da(){return olympe.dc.Nc.from(this.nc()).eb(olympe.sc.qa.Uc.C).Ad()}};olympe.sc.qa.zh.N=Fe(olympe.dc.ka.C('0113030000000aca1100',olympe.sc.qa.zh));olympe.sc.qa.zh.prototype.Da.J=new olympe.D.H(()=>olympe.dm.pb,[]);olympe.sc.qa.bb=class extends olympe.dc.CloudObject{vs(){return this.oh(olympe.sc.qa.bb.eh)}Vv(){return this.oh(olympe.sc.qa.bb.na)}Rc(){return this.Gc(olympe.sc.qa.bb.C)}Nu(){return this.rb(olympe.sc.qa.bb.L)}nv(){return this.rb(olympe.sc.qa.bb.ga)}mv(){return this.rb(olympe.sc.qa.bb.$)}Cd(){return this.rb(olympe.sc.qa.bb.da)}av(){return this.rb(olympe.sc.qa.bb.P)}wu(){return this.rb(olympe.sc.qa.bb.F)}lv(){return this.rb(olympe.sc.qa.bb.T)}us(){return this.rb(olympe.sc.qa.bb.G)}};
959
- olympe.sc.qa.bb.N=olympe.dc.ka.C('011203300000000adef5',olympe.sc.qa.bb);olympe.sc.qa.bb.eh=olympe.sc.qa.bb.N.ja('011203300000000adef6');olympe.sc.qa.bb.na=olympe.sc.qa.bb.N.ja('011203300000000adef7');olympe.sc.qa.bb.C=olympe.sc.qa.bb.N.ja('011203300000000adef8');olympe.sc.qa.bb.L=olympe.sc.qa.bb.N.ja('011203300000000adef9');olympe.sc.qa.bb.ga=olympe.sc.qa.bb.N.ja('011203300000000adefa');olympe.sc.qa.bb.$=olympe.sc.qa.bb.N.ja('011203300000000adefb');olympe.sc.qa.bb.F=olympe.sc.qa.bb.N.ja('011203300000000adefc');
960
- olympe.sc.qa.bb.da=olympe.sc.qa.bb.N.ja('011203300000000adefd');olympe.sc.qa.bb.P=olympe.sc.qa.bb.N.ja('011203300000000adefe');olympe.sc.qa.bb.T=olympe.sc.qa.bb.N.ja('011203300000000adeff');olympe.sc.qa.bb.G=olympe.sc.qa.bb.N.ja('011203300000000adee0');olympe.sc.qa.bb.Pb={INIT:0,Uw:1,uj:2,tj:3,rl:4,Ez:5,Db:9};l=olympe.sc.qa.bb.prototype;l.vs.J=olympe.D.H.P;l.Vv.J=olympe.D.H.P;l.Rc.J=olympe.D.H.G;l.Nu.J=olympe.D.H.F;l.nv.J=olympe.D.H.F;l.mv.J=olympe.D.H.F;l.Cd.J=olympe.D.H.F;l.av.J=olympe.D.H.F;
961
- l.wu.J=olympe.D.H.F;l.lv.J=olympe.D.H.F;l.us.J=olympe.D.H.F;olympe.sc.qa.Vi=class extends olympe.sc.qa.zh{na(){return!0}};olympe.sc.qa.Vi.N=olympe.dc.ka.C('0113032000000aca1102',olympe.sc.qa.Vi,olympe.sc.R.za);olympe.sc.qa.ve=class extends olympe.sc.qa.Uc{C(){return(new olympe.dc.$i(this.X(),olympe.sc.qa.bb)).eb(olympe.sc.qa.ve.L).Ve().xc()}};olympe.sc.qa.ve.N=olympe.dc.ka.C('011203300000000adef3',olympe.sc.qa.ve);olympe.sc.qa.ve.L=olympe.sc.qa.ve.N.pa('011203300000000adef4');U(olympe.sc.qa.bb.N,olympe.sc.qa.ve.L);
962
- olympe.sc.qa.ve.N.C=(a,b,c)=>{b=tj(a,b||'New Service Application model',olympe.sc.qa.ve,olympe.sc.qa.Vi);a.Ea(olympe.sc.qa.Uc.C,b,c);c=a.create(olympe.sc.qa.bb).X();a.Ea(olympe.sc.qa.ve.L,b,c);return b.X()};olympe.sc.qa.ve.prototype.C.J=new olympe.D.H(()=>olympe.sc.qa.bb,[]);olympe.sc.hg=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.hg.N=olympe.dc.ka.C('011203300000000adf00',olympe.sc.hg);olympe.sc.hg.F=olympe.sc.hg.N.ja('011203300000000adf01');olympe.sc.hg.C=olympe.sc.hg.N.ja('011203300000000adf02');olympe.sc.hg.G='011203300000000adf0f';olympe.sc.Dg=class extends olympe.dm.BrickMetadata{Ud(){return olympe.sc.ud.xe.Gg}};olympe.sc.Dg.N=olympe.dc.ka.C('01645fe6873aeea59e64',olympe.sc.Dg);olympe.sc.Dg.C=olympe.sc.Dg.N.pa('017ed8ac775f48d4d589');olympe.sc.Dg.F=olympe.sc.Dg.N.pa('017ed8ac775f48d4d590');olympe.sc.ln=class extends olympe.dm.Bb{Ud(){return olympe.sc.ud.xe.Gg}};olympe.sc.ln.N=olympe.dc.ka.C('0163a68ce44f3d1fa95d',olympe.sc.ln);olympe.sc.Eg=class extends olympe.dm.BrickMetadata{};olympe.sc.Eg.N=olympe.dc.ka.C('016324fde11a836f77d3',olympe.sc.Eg);olympe.sc.Eg.C=olympe.sc.Jc.N.pa('016324fde11a836088d3');olympe.sc.Eg.N.C=(a,b)=>tj(a,null!=b?b:'New config type',olympe.sc.Eg).X();olympe.sc.ex=class{};olympe.sc.Oi=class extends olympe.dm.BrickMetadata{Ud(){return olympe.sc.ud.xe.Gg}};olympe.sc.Oi.N=olympe.dc.ka.C('017dc8d6c8fd8c8bd2ff',olympe.sc.Oi);olympe.sc.Oi.N.C=(a,b)=>tj(a,null!=b?b:'New data connector',olympe.sc.Oi,olympe.dm.DataSource).X();olympe.sc.Yd=class extends olympe.sc.Runnable{Wa(){return this.ib(olympe.sc.Yd.G,olympe.sc.Runnable)}Da(){return this.ib(olympe.sc.Yd.F,olympe.dm.Property)}};olympe.sc.Yd.N=Fe(olympe.dc.ka.C('016c2d996d9ca27fa9d8',olympe.sc.Yd));olympe.sc.Yd.G=olympe.sc.Yd.N.pa('016c3cb7742ec9309e0b');olympe.sc.Yd.F=olympe.sc.Yd.N.pa('016c42d3454636f90533');olympe.sc.Yd.prototype.Wa.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.sc.Yd.prototype.Da.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.sc.En=class extends olympe.dm.Bb{Ud(){return olympe.sc.ud.xe.Gg}};olympe.sc.En.N=olympe.dc.ka.C('017a7a9ff057958e5678',olympe.sc.En);olympe.sc.xo=class extends olympe.dm.Bb{Ud(){return olympe.sc.ud.xe.zt}};olympe.sc.xo.N=olympe.dc.ka.C('01644b6d4543b344b857',olympe.sc.xo);olympe.sc.yo=class extends olympe.dc.CloudObject{};olympe.sc.yo.N=olympe.dc.ka.C('0162f672366be5ca7a86',olympe.sc.yo);olympe.sc.fg=class extends olympe.dc.sources.fg{C(a){return a instanceof olympe.sc.logic.Error?{t:20,c:a.code,m:a.C}:super.C(a)}F(a){return 20===(null==a?void 0:a.t)?olympe.sc.logic.Error.create(a.m,a.c):super.F(a)}};olympe.sc.Dp=class extends olympe.sc.Yd{};olympe.sc.Dp.N=olympe.dc.ka.C('016d3f37610ae4fc3962',olympe.sc.Dp);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.N=olympe.dc.ka.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Sa=class{constructor(a=!0){this.C=(new olympe.dc.Sa).persist(a);this.F=[];this.source=null}static from(a){const b=olympe.sc.xa.C.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Sa}static process(a,b){return a.has(olympe.sc.xa.C.TRANSACTION,!0)?Promise.resolve(!1):b.lb().then(()=>!0)}W(){return this.C.W()}create(a,b=new Map,c=this.source,d){c='string'===typeof c?c:olympe.dc.Fd().fromModel(a);d=this.C.create(a,d).uh(c);for(const [f,g]of b)Z(d,f,g);if(c===olympe.dc.Ra.SERVER){if('string'===
963
- typeof kl){var e;let f;b=null!=(f=null==(e=olympe.dc.Nc.from(kl).eb(olympe.sc.qa.Uc.C).eb(olympe.sc.Vc.C.Rb()).Ad())?void 0:e.X())?f:null}else b=null;e=b;null!==e?this.Ea(olympe.sc.Vc.F,e,d):olympe.la.fb('sc').warn('No business container for new instance of',olympe.dc.fa(a))}a=d.X();this.F.push(a);return a}update(a,b,c){this.C.update(a,b,c);return this}zq(a,b){a=this.C.update(a);for(const [c,d]of b)b=d,a.F.set(olympe.dc.fa(c),b);return this}delete(a){this.C.delete(a);return this}Ea(a,b,c){this.C.Ea(a,
964
- b,c);return this}Xb(a,b,c){this.C.Xb(a,b,c);return this}Ql(a,b){this.C.Ql(a,b);return this}persist(a=!0){this.C.persist(a);return this}zi(a,b=!0){this.C.zi(a,b);return this}uh(a){this.source=a;return this}model(a){return this.C.model(a)}merge(a){sj(this.C,a.C);return this}Jl(a){this.C.Jl(a);return this}lb(){return new Promise((a,b)=>{this.C.lb((c,d)=>{c?a(new olympe.sc.bi(this.F)):b(d)})})}Rl(){return new Promise((a,b)=>{this.C.Rl((c,d)=>{c?a(new olympe.sc.bi(this.F)):b(d)})})}};
965
- olympe.sc.Sa.prototype.executeAsLarge=olympe.sc.Sa.prototype.Rl;olympe.sc.Sa.prototype.execute=olympe.sc.Sa.prototype.lb;olympe.sc.Sa.prototype.afterExecution=olympe.sc.Sa.prototype.Jl;olympe.sc.Sa.prototype.merge=olympe.sc.Sa.prototype.merge;olympe.sc.Sa.prototype.model=olympe.sc.Sa.prototype.model;olympe.sc.Sa.prototype.setSource=olympe.sc.Sa.prototype.uh;olympe.sc.Sa.prototype.persistInstance=olympe.sc.Sa.prototype.zi;olympe.sc.Sa.prototype.persist=olympe.sc.Sa.prototype.persist;
966
- olympe.sc.Sa.prototype.deleteAllRelations=olympe.sc.Sa.prototype.Ql;olympe.sc.Sa.prototype.deleteRelation=olympe.sc.Sa.prototype.Xb;olympe.sc.Sa.prototype.createRelation=olympe.sc.Sa.prototype.Ea;olympe.sc.Sa.prototype['delete']=olympe.sc.Sa.prototype.delete;olympe.sc.Sa.prototype.multiUpdate=olympe.sc.Sa.prototype.zq;olympe.sc.Sa.prototype.update=olympe.sc.Sa.prototype.update;olympe.sc.Sa.prototype.create=olympe.sc.Sa.prototype.create;olympe.sc.Sa.prototype.getId=olympe.sc.Sa.prototype.W;
967
- olympe.sc.Sa.process=olympe.sc.Sa.process;olympe.sc.Sa.from=olympe.sc.Sa.from;olympe.sc.bi=class{constructor(a){this.C=a}Eu(){return this.C.map(olympe.dc.CloudObject.get)}};olympe.sc.bi.prototype.getCreatedObjects=olympe.sc.bi.prototype.Eu;olympe.Zb={};olympe.Zb.Rq=class{run(){}};olympe.Zb.Ba=class{constructor(a,b){this.C=a;this.K=b;this.F=null;this.G='';this.K.info('HC Manager will execute application registered as:',this.C)}Ai(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.K.log('Application',c,'designated to be launched'):this.K.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.K.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.K.info('Running application:',this.G),
968
- this.F.run()):this.K.error('No app registered under name: '+this.C)}};olympe.Zb.Ai=function(a,b,c){const d=a.fb();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.Zb.U.Ke+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.sd(olympe.Zb.R.Ga).config([b],function(e,f){f.Ai(e,c,b)},'olympe.hc.registerApp')};olympe.Zb.R={Ga:'hc.Manager',za:'hc.Logger'};olympe.Zb.U={Ke:'hc.app',Jk:'hc.globalToken'};olympe.V.config(function(a){F(a,olympe.Zb.U.Ke,'default');F(a,olympe.Zb.U.Jk,!1);E(a,olympe.Zb.R.za,[olympe.la.R.Ga],b=>b.Fc('hc'));E(a,olympe.auth.R.Fi,[new olympe.V.ma(olympe.Zb.U.Ke),new olympe.V.ma(olympe.Zb.U.Jk)],(b,c)=>new olympe.auth.ik(c?'':b));D(a,olympe.Zb.R.Ga,olympe.Zb.Ba,new olympe.V.ma(olympe.Zb.U.Ke),olympe.Zb.R.za)},'olympe.hc');olympe.V.run([olympe.Zb.R.Ga],a=>a.run(),'olympe.hc');olympe.sc.Tc={};function ul(a,b){if(a.$)a.K.debug('Sending getContext request'),Xg(a.da).then(()=>{a.K.debug('synchronisation request successful');kl=a.C;b()}).catch(c=>{a.K.error('failed to synchronise (authenticated) with server: '+c.message)});else{const c=Ik(a.F);a.K.debug((c?'PULLING':'SUBSCRIBING')+' application '+a.C);const d=a.F.F(),e=new olympe.async.Ap(d);e.add((f,g)=>{const h=olympe.dc.ta();Og(d,a.C,k=>{k=h.si(k)?k:h.model(k);return null!==k&&h.$c(k,olympe.sc.Eg)},c).subscribe(rxjs.Subscriber.create(d.G(()=>
969
- {h.$c(a.C,olympe.sc.qa.Uc)?(a.ga.$(a.C,c),f()):g(`The specified application tag (${a.C}) is not an application or does not exist`)}),k=>g(String(k))))});e.add(f=>{olympe.D.pc([a.G.ie()],g=>{olympe.dc.ra.Ce(g,olympe.dm.User).observe(olympe.D.Ma(),olympe.dc.ra.tc.jl).subscribe(()=>d.run(f))})});e.add((f,g)=>{const h=olympe.sc.Vc.Pb.po,k=olympe.sc.Vc.Pb.bl;ll(a.C,m=>{switch(m){case h:case k:d.run(f);break;default:d.run(()=>g('Error while loading the business container'))}})});qc(e,(f,g)=>{if(g)throw Error(g);
955
+ olympe.sc.workflow.Workflow.prototype.F.J=new olympe.D.H(()=>olympe.sc.workflow.xe,[]);olympe.sc.qa={};olympe.sc.qa.Uc=class extends olympe.sc.Xa{Td(){return olympe.sc.ad.ee.ht}};olympe.sc.qa.Uc.N=Fe(olympe.dc.ka.C('01120300000000adef00',olympe.sc.qa.Uc));olympe.sc.qa.Uc.C=olympe.sc.qa.Uc.N.pa('0171bc1f15da96dfdb89');olympe.sc.qa.Uc.Da=olympe.sc.qa.Uc.N.pa('0171bc1f15da96dfdb90');U(olympe.dm.vc.N,olympe.sc.qa.Uc.C);olympe.sc.qa.Bh=class extends olympe.sc.Runnable{F(){return[this.oc()]}Da(){return olympe.dc.Nc.from(this.oc()).eb(olympe.sc.qa.Uc.C).Ad()}};olympe.sc.qa.Bh.N=Fe(olympe.dc.ka.C('0113030000000aca1100',olympe.sc.qa.Bh));olympe.sc.qa.Bh.prototype.Da.J=new olympe.D.H(()=>olympe.dm.pb,[]);olympe.sc.qa.bb=class extends olympe.dc.CloudObject{vs(){return this.ph(olympe.sc.qa.bb.fh)}Uv(){return this.ph(olympe.sc.qa.bb.na)}Rc(){return this.Gc(olympe.sc.qa.bb.C)}Mu(){return this.rb(olympe.sc.qa.bb.L)}mv(){return this.rb(olympe.sc.qa.bb.ga)}lv(){return this.rb(olympe.sc.qa.bb.$)}ge(){return this.rb(olympe.sc.qa.bb.da)}$u(){return this.rb(olympe.sc.qa.bb.P)}vu(){return this.rb(olympe.sc.qa.bb.F)}kv(){return this.rb(olympe.sc.qa.bb.T)}us(){return this.rb(olympe.sc.qa.bb.G)}};
956
+ olympe.sc.qa.bb.N=olympe.dc.ka.C('011203300000000adef5',olympe.sc.qa.bb);olympe.sc.qa.bb.fh=olympe.sc.qa.bb.N.ja('011203300000000adef6');olympe.sc.qa.bb.na=olympe.sc.qa.bb.N.ja('011203300000000adef7');olympe.sc.qa.bb.C=olympe.sc.qa.bb.N.ja('011203300000000adef8');olympe.sc.qa.bb.L=olympe.sc.qa.bb.N.ja('011203300000000adef9');olympe.sc.qa.bb.ga=olympe.sc.qa.bb.N.ja('011203300000000adefa');olympe.sc.qa.bb.$=olympe.sc.qa.bb.N.ja('011203300000000adefb');olympe.sc.qa.bb.F=olympe.sc.qa.bb.N.ja('011203300000000adefc');
957
+ olympe.sc.qa.bb.da=olympe.sc.qa.bb.N.ja('011203300000000adefd');olympe.sc.qa.bb.P=olympe.sc.qa.bb.N.ja('011203300000000adefe');olympe.sc.qa.bb.T=olympe.sc.qa.bb.N.ja('011203300000000adeff');olympe.sc.qa.bb.G=olympe.sc.qa.bb.N.ja('011203300000000adee0');olympe.sc.qa.bb.Ob={INIT:0,Tw:1,uj:2,tj:3,ql:4,Cz:5,Cb:9};l=olympe.sc.qa.bb.prototype;l.vs.J=olympe.D.H.P;l.Uv.J=olympe.D.H.P;l.Rc.J=olympe.D.H.G;l.Mu.J=olympe.D.H.F;l.mv.J=olympe.D.H.F;l.lv.J=olympe.D.H.F;l.ge.J=olympe.D.H.F;l.$u.J=olympe.D.H.F;
958
+ l.vu.J=olympe.D.H.F;l.kv.J=olympe.D.H.F;l.us.J=olympe.D.H.F;olympe.sc.qa.Vi=class extends olympe.sc.qa.Bh{na(){return!0}};olympe.sc.qa.Vi.N=olympe.dc.ka.C('0113032000000aca1102',olympe.sc.qa.Vi,olympe.sc.R.za);olympe.sc.qa.we=class extends olympe.sc.qa.Uc{C(){return(new olympe.dc.$i(this.X(),olympe.sc.qa.bb)).eb(olympe.sc.qa.we.L).Ue().yc()}};olympe.sc.qa.we.N=olympe.dc.ka.C('011203300000000adef3',olympe.sc.qa.we);olympe.sc.qa.we.L=olympe.sc.qa.we.N.pa('011203300000000adef4');U(olympe.sc.qa.bb.N,olympe.sc.qa.we.L);
959
+ olympe.sc.qa.we.N.C=(a,b,c)=>{b=sj(a,b||'New Service Application model',olympe.sc.qa.we,olympe.sc.qa.Vi);a.Ea(olympe.sc.qa.Uc.C,b,c);c=a.create(olympe.sc.qa.bb).X();a.Ea(olympe.sc.qa.we.L,b,c);return b.X()};olympe.sc.qa.we.prototype.C.J=new olympe.D.H(()=>olympe.sc.qa.bb,[]);olympe.sc.hg=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.hg.N=olympe.dc.ka.C('011203300000000adf00',olympe.sc.hg);olympe.sc.hg.F=olympe.sc.hg.N.ja('011203300000000adf01');olympe.sc.hg.C=olympe.sc.hg.N.ja('011203300000000adf02');olympe.sc.hg.G='011203300000000adf0f';olympe.sc.Dg=class extends olympe.dm.BrickMetadata{Td(){return olympe.sc.ad.ee.Gg}};olympe.sc.Dg.N=olympe.dc.ka.C('01645fe6873aeea59e64',olympe.sc.Dg);olympe.sc.Dg.C=olympe.sc.Dg.N.pa('017ed8ac775f48d4d589');olympe.sc.Dg.F=olympe.sc.Dg.N.pa('017ed8ac775f48d4d590');olympe.sc.ln=class extends olympe.dm.Ab{Td(){return olympe.sc.ad.ee.Gg}};olympe.sc.ln.N=olympe.dc.ka.C('0163a68ce44f3d1fa95d',olympe.sc.ln);olympe.sc.Eg=class extends olympe.dm.BrickMetadata{};olympe.sc.Eg.N=olympe.dc.ka.C('016324fde11a836f77d3',olympe.sc.Eg);olympe.sc.Eg.C=olympe.sc.Jc.N.pa('016324fde11a836088d3');olympe.sc.Eg.N.C=(a,b)=>sj(a,null!=b?b:'New config type',olympe.sc.Eg).X();olympe.sc.ax=class{};olympe.sc.Oi=class extends olympe.dm.BrickMetadata{Td(){return olympe.sc.ad.ee.Gg}};olympe.sc.Oi.N=olympe.dc.ka.C('017dc8d6c8fd8c8bd2ff',olympe.sc.Oi);olympe.sc.Oi.N.C=(a,b)=>sj(a,null!=b?b:'New data connector',olympe.sc.Oi,olympe.dm.DataSource).X();olympe.sc.Xd=class extends olympe.sc.Runnable{Wa(){return this.ib(olympe.sc.Xd.G,olympe.sc.Runnable)}Da(){return this.ib(olympe.sc.Xd.F,olympe.dm.Property)}};olympe.sc.Xd.N=Fe(olympe.dc.ka.C('016c2d996d9ca27fa9d8',olympe.sc.Xd));olympe.sc.Xd.G=olympe.sc.Xd.N.pa('016c3cb7742ec9309e0b');olympe.sc.Xd.F=olympe.sc.Xd.N.pa('016c42d3454636f90533');olympe.sc.Xd.prototype.Wa.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.sc.Xd.prototype.Da.J=new olympe.D.H(()=>olympe.dc.ua,[]);olympe.sc.En=class extends olympe.dm.Ab{Td(){return olympe.sc.ad.ee.Gg}};olympe.sc.En.N=olympe.dc.ka.C('017a7a9ff057958e5678',olympe.sc.En);olympe.sc.vo=class extends olympe.dm.Ab{Td(){return olympe.sc.ad.ee.yt}};olympe.sc.vo.N=olympe.dc.ka.C('01644b6d4543b344b857',olympe.sc.vo);olympe.sc.wo=class extends olympe.dc.CloudObject{};olympe.sc.wo.N=olympe.dc.ka.C('0162f672366be5ca7a86',olympe.sc.wo);olympe.sc.fg=class extends olympe.dc.sources.fg{C(a){return a instanceof olympe.sc.logic.Error?{t:20,c:a.code,m:a.C}:super.C(a)}F(a){return 20===(null==a?void 0:a.t)?olympe.sc.logic.Error.create(a.m,a.c):super.F(a)}};olympe.sc.Bp=class extends olympe.sc.Xd{};olympe.sc.Bp.N=olympe.dc.ka.C('016d3f37610ae4fc3962',olympe.sc.Bp);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.N=olympe.dc.ka.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Sa=class{constructor(a=!0){this.C=(new olympe.dc.Sa).persist(a);this.F=[];this.source=null}static from(a){const b=olympe.sc.xa.C.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Sa}static process(a,b){return a.has(olympe.sc.xa.C.TRANSACTION,!0)?Promise.resolve(!1):b.lb().then(()=>!0)}W(){return this.C.W()}create(a,b=new Map,c=this.source,d){c='string'===typeof c?c:olympe.dc.Ed().fromModel(a);d=this.C.create(a,d).wh(c);for(const [f,g]of b)Z(d,f,g);if(c===olympe.dc.Ra.SERVER){if('string'===
960
+ typeof jl){var e;let f;b=null!=(f=null==(e=olympe.dc.Nc.from(jl).eb(olympe.sc.qa.Uc.C).eb(olympe.sc.Vc.C.Qb()).Ad())?void 0:e.X())?f:null}else b=null;e=b;null!==e?this.Ea(olympe.sc.Vc.F,e,d):olympe.la.fb('sc').warn('No business container for new instance of',olympe.dc.fa(a))}a=d.X();this.F.push(a);return a}update(a,b,c){this.C.update(a,b,c);return this}yq(a,b){a=this.C.update(a);for(const [c,d]of b)b=d,a.F.set(olympe.dc.fa(c),b);return this}delete(a){this.C.delete(a);return this}Ea(a,b,c){this.C.Ea(a,
961
+ b,c);return this}Wb(a,b,c){this.C.Wb(a,b,c);return this}Pl(a,b){this.C.Pl(a,b);return this}persist(a=!0){this.C.persist(a);return this}zi(a,b=!0){this.C.zi(a,b);return this}wh(a){this.source=a;return this}model(a){return this.C.model(a)}merge(a){rj(this.C,a.C);return this}Il(a){this.C.Il(a);return this}lb(){return new Promise((a,b)=>{this.C.lb((c,d)=>{c?a(new olympe.sc.ci(this.F)):b(d)})})}Ql(){return new Promise((a,b)=>{this.C.Ql((c,d)=>{c?a(new olympe.sc.ci(this.F)):b(d)})})}};
962
+ olympe.sc.Sa.prototype.executeAsLarge=olympe.sc.Sa.prototype.Ql;olympe.sc.Sa.prototype.execute=olympe.sc.Sa.prototype.lb;olympe.sc.Sa.prototype.afterExecution=olympe.sc.Sa.prototype.Il;olympe.sc.Sa.prototype.merge=olympe.sc.Sa.prototype.merge;olympe.sc.Sa.prototype.model=olympe.sc.Sa.prototype.model;olympe.sc.Sa.prototype.setSource=olympe.sc.Sa.prototype.wh;olympe.sc.Sa.prototype.persistInstance=olympe.sc.Sa.prototype.zi;olympe.sc.Sa.prototype.persist=olympe.sc.Sa.prototype.persist;
963
+ olympe.sc.Sa.prototype.deleteAllRelations=olympe.sc.Sa.prototype.Pl;olympe.sc.Sa.prototype.deleteRelation=olympe.sc.Sa.prototype.Wb;olympe.sc.Sa.prototype.createRelation=olympe.sc.Sa.prototype.Ea;olympe.sc.Sa.prototype['delete']=olympe.sc.Sa.prototype.delete;olympe.sc.Sa.prototype.multiUpdate=olympe.sc.Sa.prototype.yq;olympe.sc.Sa.prototype.update=olympe.sc.Sa.prototype.update;olympe.sc.Sa.prototype.create=olympe.sc.Sa.prototype.create;olympe.sc.Sa.prototype.getId=olympe.sc.Sa.prototype.W;
964
+ olympe.sc.Sa.process=olympe.sc.Sa.process;olympe.sc.Sa.from=olympe.sc.Sa.from;olympe.sc.ci=class{constructor(a){this.C=a}Du(){return this.C.map(olympe.dc.CloudObject.get)}};olympe.sc.ci.prototype.getCreatedObjects=olympe.sc.ci.prototype.Du;olympe.Yb={};olympe.Yb.Qq=class{run(){}};olympe.Yb.Ba=class{constructor(a,b){this.C=a;this.K=b;this.F=null;this.G='';this.K.info('HC Manager will execute application registered as:',this.C)}Ai(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.K.log('Application',c,'designated to be launched'):this.K.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.K.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.K.info('Running application:',this.G),
965
+ this.F.run()):this.K.error('No app registered under name: '+this.C)}};olympe.Yb.Ai=function(a,b,c){const d=a.fb();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.Yb.U.Ke+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.sd(olympe.Yb.R.Ga).config([b],function(e,f){f.Ai(e,c,b)},'olympe.hc.registerApp')};olympe.Yb.R={Ga:'hc.Manager',za:'hc.Logger'};olympe.Yb.U={Ke:'hc.app',Ik:'hc.globalToken'};olympe.V.config(function(a){F(a,olympe.Yb.U.Ke,'default');F(a,olympe.Yb.U.Ik,!1);E(a,olympe.Yb.R.za,[olympe.la.R.Ga],b=>b.Fc('hc'));E(a,olympe.auth.R.Fi,[new olympe.V.ma(olympe.Yb.U.Ke),new olympe.V.ma(olympe.Yb.U.Ik)],(b,c)=>new olympe.auth.ik(c?'':b));D(a,olympe.Yb.R.Ga,olympe.Yb.Ba,new olympe.V.ma(olympe.Yb.U.Ke),olympe.Yb.R.za)},'olympe.hc');olympe.V.run([olympe.Yb.R.Ga],a=>a.run(),'olympe.hc');olympe.sc.Tc={};function tl(a,b){if(a.$)a.K.debug('Sending getContext request'),Xg(a.da).then(()=>{a.K.debug('synchronisation request successful');jl=a.C;b()}).catch(c=>{a.K.error('failed to synchronise (authenticated) with server: '+c.message)});else{const c=Hk(a.F);a.K.debug((c?'PULLING':'SUBSCRIBING')+' application '+a.C);const d=a.F.F(),e=new olympe.async.yp(d);e.add((f,g)=>{const h=olympe.dc.ta();Og(d,a.C,k=>{k=h.uh(k)?k:h.model(k);return null!==k&&h.$c(k,olympe.sc.Eg)},c).subscribe(rxjs.Subscriber.create(d.G(()=>
966
+ {h.$c(a.C,olympe.sc.qa.Uc)?(a.ga.$(a.C,c),f()):g(`The specified application tag (${a.C}) is not an application or does not exist`)}),k=>g(String(k))))});e.add(f=>{olympe.D.qc([a.G.je()],g=>{olympe.dc.ra.Ce(g,olympe.dm.User).observe(olympe.D.Ma(),olympe.dc.ra.uc.il).subscribe(()=>d.run(f))})});e.add((f,g)=>{const h=olympe.sc.Vc.Ob.no,k=olympe.sc.Vc.Ob.al;kl(a.C,m=>{switch(m){case h:case k:d.run(f);break;default:d.run(()=>g('Error while loading the business container'))}})});rc(e,(f,g)=>{if(g)throw Error(g);
970
967
  b()});e.start()}}
971
- function vl(a){a.K.info('Starting application '+a.C);const b=olympe.D.ec(olympe.D.ea).update(olympe.D.ea.C),c=olympe.dc.ta();if(0<a.C.length){const d=oe(c,a.C,a.F.F().G((e,f)=>{e?(e=cl(f),e instanceof olympe.sc.qa.zh?(a.K.debug('application retrieved: running'),f=Gk(a.F,e),e.run(f),'string'===typeof a.na&&(new olympe.sc.yd).ga(e.X(),f,a.K),e instanceof olympe.sc.qa.Vi&&(e=olympe.V.getParameter(olympe.auth.U.gk),f=a.G.L.Qb,!0===e&&0<f&&Nb(()=>{a.G.Wd()},Math.max(1E3,1E4<f?f-1E3:f-100))),b.update(olympe.D.ea.F)):
972
- a.K.error('application retrieved: not an Application with a run() method')):wl(a)}));olympe.D.Ma().onDestroy(()=>{ne(c,a.C,d)});Mb(()=>{olympe.D.Ta(b)===olympe.D.ea.C&&a.K.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},3E4)}xl(a);yl(a,b)}function wl(a){a.K.info('Stop the application');a.F.F().na();a.L.G(a.P);a.L.P(a.T)}function xl(a){a.T=a.L.F(()=>v(function*(){return wl(a)}))}
973
- function yl(a,b){a.P=a.L.C(()=>olympe.D.Ta(b)===olympe.D.ea.F?Promise.resolve('The application is started'):Promise.reject('The application is not started'))}
974
- olympe.sc.Tc.pl=class{constructor(a,b,c,d,e,f,g){this.G=a;this.da=b;this.L=c;this.T=this.P='';this.K=d;this.F=e;this.ga=f;this.C=g.get('appTag');this.$=g.get('getContextMode');let h;this.Da=null!=(h=g.get('offlineMode'))?h:!1;let k;this.na=null!=(k=g.get('debuggerName'))?k:null}run(){const a=olympe.auth.Ba.C.INIT,b=olympe.auth.Ba.C.ke,c=olympe.auth.Ba.C.Pe,d=olympe.auth.Ba.C.Af,e=olympe.auth.Ba.C.Gi,f=olympe.auth.Ba.C.$g,g=olympe.auth.Ba.C.Ag;this.K.debug('runtime starting for app #'+this.C);let h=
975
- !1;const k=()=>{h||(h=!0,ul(this,()=>vl(this)))};olympe.D.pc([this.G.getState()],m=>{switch(m){case f:case g:case a:break;case b:case d:this.K.debug('Server session opened, calling once connected callback');k();break;case c:this.K.debug('Disconnected, working offline.');this.Da&&k();break;case e:this.K.debug('waiting for authentication');break;default:this.K.debug('No server session available, waiting for connection'),h=!1,wl(this)}},'Runtime initial auth state listener')}};olympe.sc.Tc.pl.C='app_instance';
976
- olympe.sc.Tc.pl.va=[olympe.Zb.Rq];olympe.sc.Tc.xj=class extends olympe.dc.sources.xj{T(a){return this.db.$c(a,olympe.sc.Jc)}$(a,b){if(!this.L){super.init();var c=olympe.dc.Nc.from(a).eb(olympe.sc.qa.Uc.C).Ad();if(!(c instanceof olympe.dm.pb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.ra.tc.Qg:olympe.dc.ra.tc.Tf;gj(this,c,b);c=new olympe.D.Jb('deployed data sources');olympe.dc.ra.from(a).eb(olympe.sc.qa.Uc.Da).observe(c,b).subscribe(d=>{const e=new olympe.dc.Sa;
977
- te(d).forEach(f=>{e.Ea(olympe.dm.DataSource.yi,this.C,f)});se(d).forEach(f=>{e.Xb(olympe.dm.DataSource.yi,this.C,f)});e.lb()})}}};olympe.sc.Tc.R={Ef:'sc.runtime.Main',te:'sc.runtime.SourceSolver',lp:'sc.runtime.appConfig'};
978
- olympe.V.config(function(a){E(a,olympe.auth.R.Fi,[new olympe.V.ma(olympe.Zb.U.Ke),new olympe.V.ma(olympe.sc.U.Ke),new olympe.V.ma(olympe.Zb.U.Jk)],(b,c,d)=>new olympe.auth.ik(d?'':b+(c?'-'+c:'')));D(a,olympe.sc.Tc.R.te,olympe.sc.Tc.xj,olympe.dc.R.Oe,new olympe.V.ma(olympe.dc.U.eg),new olympe.V.ma(olympe.dc.U.zk));va(a,olympe.dc.sources.R.te,olympe.sc.Tc.R.te);E(a,olympe.sc.Tc.R.lp,[new olympe.V.ma(olympe.sc.U.Ke),new olympe.V.ma(olympe.dc.U.Wg),new olympe.V.ma(olympe.sc.U.Io),new olympe.V.ma(olympe.sc.U.tn)],
979
- (b,c,d,e)=>new Map([['appTag',b],['getContextMode',c],['offlineMode',d],['debuggerName',e]]));D(a,olympe.sc.Tc.R.Ef,olympe.sc.Tc.pl,olympe.auth.R.Ga,olympe.dc.query.R.lj,olympe.host.R.Xe,olympe.sc.R.za,olympe.sc.R.ol,olympe.sc.Tc.R.te,olympe.sc.Tc.R.lp);olympe.Zb.Ai(a,olympe.sc.Tc.R.Ef,'sc.runtime');olympe.Zb.Ai(a,olympe.sc.Tc.R.Ef,'sc.headless');olympe.Zb.Ai(a,olympe.sc.Tc.R.Ef)},'olympe.sc.runtime');olympe.public={};function zl(a,b){const c=new olympe.auth.Request;for(const [d,e]of a)c.set(d,e);return new Promise(d=>{Pd(olympe.public.Va.get(),c,b,()=>{d()})})}
980
- olympe.public.Va=class{static uu(a,b){const c=new SRPClient,d=c.generateRandomSalt();return{username:a,login:a,salt:d,verifier:c.generateVerifier(d,a,b)}}static getState(){return Wd(olympe.public.Va.get())}static Gu(){return olympe.D.Ta(olympe.public.Va.get().ie())}static fw(a){const b=new olympe.D.Jb('Observe user tag','function'===typeof a.F?a.F():a);return new rxjs.Observable(c=>{b.run(()=>olympe.D.pc([olympe.public.Va.get().ie()],d=>{c.next(d);olympe.D.Ma().onDestroy(()=>c.complete())}));return()=>
981
- b.destroy()})}static Td(){var a=olympe.D,b=a.Ta;var c=olympe.public.Va.get().C.vb().Yc();return b.call(a,c)}static Ie(){return new Promise((a,b)=>{olympe.public.Va.get().Ie(c=>c?b(c):a())})}static Uu(){return olympe.D.Ta(olympe.public.Va.get().mh())||void 0}static Av(){const a=Bc(olympe.public.Va.get());return{user:a.oc(),userTag:a.ie(),nonce:a.Yc(),payload:a.td(),idpName:a.Ue(),protocol:a.Lg()}}static Tu(){return Array.from(Xd().keys())}static Wd(){olympe.public.Va.get().Wd()}static ug(a){return new Promise((b,
982
- c)=>{olympe.public.Va.get().ug(a,d=>d?c(d):b())})}static Ov(a,b){return zl((new Map).set('username',a).set('password',b),olympe.auth.kc.C.SRP)}static Pv(a){const b=Xd();if(0===b.size||a&&!b.has(a)){var c=0===b.size?'There are no available IDPs':`The IDP name ${a} is not valid, the valid names are ${Array.from(b.keys())}`;return Promise.reject(c)}a?(c=a,a=b.get(a)):(a=Array.from(b)[0],c=a[0],a=a[1]);return zl((new Map).set('idpName',c),a)}static Nv(){return zl(new Map,olympe.auth.kc.C.SAML)}static Qv(a,
983
- b){return zl((new Map).set('username',a).set('nonce',b),olympe.auth.kc.C.fl)}static Mv(){return zl(new Map,olympe.auth.kc.C.OAUTH2)}static wi(){return olympe.public.Va.get().wi()}static get(){return olympe.auth.ge()}};olympe.public.Va.logout=olympe.public.Va.wi;olympe.public.Va.loginOpenID=olympe.public.Va.Mv;olympe.public.Va.loginToken=olympe.public.Va.Qv;olympe.public.Va.loginSAML=olympe.public.Va.Nv;olympe.public.Va.loginSSO=olympe.public.Va.Pv;olympe.public.Va.loginSRP=olympe.public.Va.Ov;
984
- olympe.public.Va.getUserFromToken=olympe.public.Va.ug;olympe.public.Va.sendKeepAlive=olympe.public.Va.Wd;olympe.public.Va.getIDPNames=olympe.public.Va.Tu;olympe.public.Va.getUserToken=olympe.public.Va.Av;olympe.public.Va.getIDPToken=olympe.public.Va.Uu;olympe.public.Va.refreshToken=olympe.public.Va.Ie;olympe.public.Va.getToken=olympe.public.Va.Td;olympe.public.Va.observeUser=olympe.public.Va.fw;olympe.public.Va.getCurrentUser=olympe.public.Va.Gu;olympe.public.Va.getState=olympe.public.Va.getState;
985
- olympe.public.Va.generateSRPData=olympe.public.Va.uu;olympe.public.Ca=class{static create(a){return new class extends olympe.dc.Y.Rf{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.ec(olympe.D.ea),e=b.subscribe(f=>d.update(olympe.D.Ib(f)));olympe.D.Ma().$(()=>e.unsubscribe());return d.vb()}}}};
986
- olympe.public.Me=class{static create(a){return new class extends olympe.dc.bc.Rf{L(b,c){return olympe.dc.CloudObject.get(c)}G(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.ec(olympe.D.aa),e=b.subscribe(f=>d.update(olympe.D.oa(f)));olympe.D.Ma().$(()=>e.unsubscribe());return d.vb()}}}};olympe.public.Process=class{static gw(a){const b=olympe.host.Rj(),c=b.C(a);return()=>b.G(c)}static hw(a){const b=olympe.host.Rj(),c=b.F(a);return()=>b.P(c)}};olympe.public.Process.onShutdown=olympe.public.Process.hw;olympe.public.Process.onHealthCheck=olympe.public.Process.gw;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Oa.Relation,Direction:olympe.dc.wa,generateTag:olympe.Z.ef,tagToString:olympe.dc.fa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.hq,defineInverseRelation:olympe.dc.eu,BrickContext:olympe.sc.xa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.xa.C,registerBrick:olympe.sc.logic.ka.C,FunctionBrick:olympe.sc.logic.Function,
987
- Context:olympe.sc.xa,Entry:olympe.dc.Oa.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.yf,EnumValue:olympe.dm.Enum,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.wd,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.we,WorkflowTransition:olympe.sc.workflow.Transition,
988
- WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Sa,BurstTransaction:olympe.dc.Ch,TransactionResult:olympe.sc.bi,PredefinedDataSource:olympe.dc.Ra,QueryResult:olympe.dc.La,Query:olympe.dc.ra,QuerySingle:olympe.dc.Nc,Predicate:olympe.dc.query.Ca,Order:olympe.dc.query.hj,Config:class{static getParameter(a){return olympe.V.getParameter(a)}},Process:olympe.public.Process,Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.O.Request.jb,ServiceRequest:olympe.O.zc,
989
- Service:olympe.O.qb,Auth:olympe.public.Va,AuthState:{INIT:olympe.auth.Ba.C.INIT,DISCONNECTED:olympe.auth.Ba.C.Pe,GUEST:olympe.auth.Ba.C.Af,AUTHENTICATING:olympe.auth.Ba.C.Gi,ERROR:olympe.auth.Ba.C.Db,AUTHENTICATED:olympe.auth.Ba.C.ke},AuthProtocol:olympe.auth.kc.C,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,
990
- RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.$a{static get(){return olympe.dc.ta()}},ListDef:olympe.dc.ua,instanceToTag:olympe.dc.fa,registerSync:olympe.dc.ka.C,getUniqueTag:olympe.Z.ef,onDestroy:a=>olympe.D.Ma().onDestroy(a),offDestroy:a=>olympe.D.Ma().pf(a),FollowRules:olympe.dc.Ob,transformers:{Related:olympe.dc.ba.se,RecursiveRelated:olympe.dc.ba.de,Distinct:olympe.dc.ba.Gh,Filter:olympe.dc.ba.Qe,Limit:olympe.dc.ba.Mg,Sort:olympe.dc.ba.gg,Union:olympe.dc.ba.af},ListDefPredicate:olympe.public.Ca,
991
- predicates:{And:olympe.dc.Y.kd,Or:olympe.dc.Y.ce,Not:olympe.dc.Y.Ld,Equals:olympe.dc.Y.Zd,Contains:olympe.dc.Y.Ne,Greater:olympe.dc.Y.Ti,Smaller:olympe.dc.Y.wj,HasRelated:olympe.dc.Y.Kh,InstanceOf:olympe.dc.Y.Oh,Regex:olympe.dc.Y.Ze},Comparator:olympe.public.Me,comparators:{Number:olympe.dc.bc.Number,String:olympe.dc.bc.String,DateTime:olympe.dc.bc.DateTime},valuedefs:{BooleanProperty:olympe.dc.Ua.Ji,StringProperty:olympe.dc.Ua.Zh,NumberProperty:olympe.dc.Ua.Sh,DateTimeProperty:olympe.dc.Ua.Fh,Constant:olympe.dc.Ua.me,
992
- Tag:olympe.dc.Ua.ai}});
968
+ function ul(a){a.K.info('Starting application '+a.C);const b=olympe.D.cc(olympe.D.ea).update(olympe.D.ea.C),c=olympe.dc.ta();if(0<a.C.length){const d=pe(c,a.C,a.F.F().G((e,f)=>{e?(e=bl(f),e instanceof olympe.sc.qa.Bh?(a.K.debug('application retrieved: running'),f=Fk(a.F,e),e.run(f),'string'===typeof a.na&&(new olympe.sc.yd).ga(e.X(),f,a.K),e instanceof olympe.sc.qa.Vi&&(e=olympe.V.getParameter(olympe.auth.U.gk),f=a.G.L.Pb,!0===e&&0<f&&Ob(()=>{a.G.Vd()},f)),b.update(olympe.D.ea.F)):a.K.error('application retrieved: not an Application with a run() method')):
969
+ vl(a)}));olympe.D.Ma().onDestroy(()=>{oe(c,a.C,d)});Nb(()=>{olympe.D.Ta(b)===olympe.D.ea.C&&a.K.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},3E4)}wl(a);xl(a,b)}function vl(a){a.K.info('Stop the application');a.F.F().na();a.L.G(a.P);a.L.P(a.T)}function wl(a){a.T=a.L.F(()=>v(function*(){return vl(a)}))}
970
+ function xl(a,b){a.P=a.L.C(()=>olympe.D.Ta(b)===olympe.D.ea.F?Promise.resolve('The application is started'):Promise.reject('The application is not started'))}
971
+ olympe.sc.Tc.ol=class{constructor(a,b,c,d,e,f,g){this.G=a;this.da=b;this.L=c;this.T=this.P='';this.K=d;this.F=e;this.ga=f;this.C=g.get('appTag');this.$=g.get('getContextMode');let h;this.Da=null!=(h=g.get('offlineMode'))?h:!1;let k;this.na=null!=(k=g.get('debuggerName'))?k:null}run(){const a=olympe.auth.Ba.C.INIT,b=olympe.auth.Ba.C.le,c=olympe.auth.Ba.C.Pe,d=olympe.auth.Ba.C.Af,e=olympe.auth.Ba.C.Gi,f=olympe.auth.Ba.C.ah,g=olympe.auth.Ba.C.Ag;this.K.debug('runtime starting for app #'+this.C);let h=
972
+ !1;const k=()=>{h||(h=!0,tl(this,()=>ul(this)))};olympe.D.qc([this.G.getState()],m=>{switch(m){case f:case g:case a:break;case b:case d:this.K.debug('Server session opened, calling once connected callback');k();break;case c:this.K.debug('Disconnected, working offline.');this.Da&&k();break;case e:this.K.debug('waiting for authentication');break;default:this.K.debug('No server session available, waiting for connection'),h=!1,vl(this)}},'Runtime initial auth state listener')}};olympe.sc.Tc.ol.C='app_instance';
973
+ olympe.sc.Tc.ol.va=[olympe.Yb.Qq];olympe.sc.Tc.xj=class extends olympe.dc.sources.xj{T(a){return this.db.$c(a,olympe.sc.Jc)}$(a,b){if(!this.L){super.init();var c=olympe.dc.Nc.from(a).eb(olympe.sc.qa.Uc.C).Ad();if(!(c instanceof olympe.dm.pb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.ra.uc.Qg:olympe.dc.ra.uc.Tf;fj(this,c,b);c=new olympe.D.Jb('deployed data sources');olympe.dc.ra.from(a).eb(olympe.sc.qa.Uc.Da).observe(c,b).subscribe(d=>{const e=new olympe.dc.Sa;
974
+ ue(d).forEach(f=>{e.Ea(olympe.dm.DataSource.yi,this.C,f)});te(d).forEach(f=>{e.Wb(olympe.dm.DataSource.yi,this.C,f)});e.lb()})}}};olympe.sc.Tc.R={Ff:'sc.runtime.Main',ue:'sc.runtime.SourceSolver',jp:'sc.runtime.appConfig'};
975
+ olympe.V.config(function(a){E(a,olympe.auth.R.Fi,[new olympe.V.ma(olympe.Yb.U.Ke),new olympe.V.ma(olympe.sc.U.Ke),new olympe.V.ma(olympe.Yb.U.Ik)],(b,c,d)=>new olympe.auth.ik(d?'':b+(c?'-'+c:'')));D(a,olympe.sc.Tc.R.ue,olympe.sc.Tc.xj,olympe.dc.R.Oe,new olympe.V.ma(olympe.dc.U.eg),new olympe.V.ma(olympe.dc.U.yk));va(a,olympe.dc.sources.R.ue,olympe.sc.Tc.R.ue);E(a,olympe.sc.Tc.R.jp,[new olympe.V.ma(olympe.sc.U.Ke),new olympe.V.ma(olympe.dc.U.Wg),new olympe.V.ma(olympe.sc.U.Go),new olympe.V.ma(olympe.sc.U.tn)],
976
+ (b,c,d,e)=>new Map([['appTag',b],['getContextMode',c],['offlineMode',d],['debuggerName',e]]));D(a,olympe.sc.Tc.R.Ff,olympe.sc.Tc.ol,olympe.auth.R.Ga,olympe.dc.query.R.lj,olympe.host.R.We,olympe.sc.R.za,olympe.sc.R.nl,olympe.sc.Tc.R.ue,olympe.sc.Tc.R.jp);olympe.Yb.Ai(a,olympe.sc.Tc.R.Ff,'sc.runtime');olympe.Yb.Ai(a,olympe.sc.Tc.R.Ff,'sc.headless');olympe.Yb.Ai(a,olympe.sc.Tc.R.Ff)},'olympe.sc.runtime');olympe.public={};function yl(a,b){const c=new olympe.auth.Request;for(const [d,e]of a)c.set(d,e);return new Promise(d=>{Qd(olympe.public.Va.get(),c,b,()=>{d()})})}
977
+ olympe.public.Va=class{static tu(a,b){const c=new SRPClient,d=c.generateRandomSalt();return{username:a,login:a,salt:d,verifier:c.generateVerifier(d,a,b)}}static getState(){return Xd(olympe.public.Va.get())}static Fu(){return olympe.D.Ta(olympe.public.Va.get().je())}static ew(a){const b=new olympe.D.Jb('Observe user tag','function'===typeof a.F?a.F():a);return new rxjs.Observable(c=>{b.run(()=>olympe.D.qc([olympe.public.Va.get().je()],d=>{c.next(d);olympe.D.Ma().onDestroy(()=>c.complete())}));return()=>
978
+ b.destroy()})}static Sd(){var a=olympe.D,b=a.Ta;var c=olympe.public.Va.get().C.vb().Yc();return b.call(a,c)}static Ie(){return new Promise((a,b)=>{olympe.public.Va.get().Ie(c=>c?b(c):a())})}static Tu(){return olympe.D.Ta(olympe.public.Va.get().nh())||void 0}static zv(){const a=Cc(olympe.public.Va.get());return{user:a.pc(),userTag:a.je(),nonce:a.Yc(),payload:a.td(),idpName:a.Te(),protocol:a.Lg()}}static Su(){return Array.from(Yd().keys())}static Vd(){olympe.public.Va.get().Vd()}static ug(a){return new Promise((b,
979
+ c)=>{olympe.public.Va.get().ug(a,d=>d?c(d):b())})}static Nv(a,b){return yl((new Map).set('username',a).set('password',b),olympe.auth.kc.C.SRP)}static Ov(a){const b=Yd();if(0===b.size||a&&!b.has(a)){var c=0===b.size?'There are no available IDPs':`The IDP name ${a} is not valid, the valid names are ${Array.from(b.keys())}`;return Promise.reject(c)}a?(c=a,a=b.get(a)):(a=Array.from(b)[0],c=a[0],a=a[1]);return yl((new Map).set('idpName',c),a)}static Mv(){return yl(new Map,olympe.auth.kc.C.SAML)}static Pv(a,
980
+ b){return yl((new Map).set('username',a).set('nonce',b),olympe.auth.kc.C.el)}static Lv(){return yl(new Map,olympe.auth.kc.C.OAUTH2)}static wi(){return olympe.public.Va.get().wi()}static get(){return olympe.auth.he()}};olympe.public.Va.logout=olympe.public.Va.wi;olympe.public.Va.loginOpenID=olympe.public.Va.Lv;olympe.public.Va.loginToken=olympe.public.Va.Pv;olympe.public.Va.loginSAML=olympe.public.Va.Mv;olympe.public.Va.loginSSO=olympe.public.Va.Ov;olympe.public.Va.loginSRP=olympe.public.Va.Nv;
981
+ olympe.public.Va.getUserFromToken=olympe.public.Va.ug;olympe.public.Va.sendKeepAlive=olympe.public.Va.Vd;olympe.public.Va.getIDPNames=olympe.public.Va.Su;olympe.public.Va.getUserToken=olympe.public.Va.zv;olympe.public.Va.getIDPToken=olympe.public.Va.Tu;olympe.public.Va.refreshToken=olympe.public.Va.Ie;olympe.public.Va.getToken=olympe.public.Va.Sd;olympe.public.Va.observeUser=olympe.public.Va.ew;olympe.public.Va.getCurrentUser=olympe.public.Va.Fu;olympe.public.Va.getState=olympe.public.Va.getState;
982
+ olympe.public.Va.generateSRPData=olympe.public.Va.tu;olympe.public.Ca=class{static create(a){return new class extends olympe.dc.Y.Rf{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.cc(olympe.D.ea),e=b.subscribe(f=>d.update(olympe.D.Ib(f)));olympe.D.Ma().$(()=>e.unsubscribe());return d.vb()}}}};
983
+ olympe.public.Me=class{static create(a){return new class extends olympe.dc.ac.Rf{L(b,c){return olympe.dc.CloudObject.get(c)}G(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.cc(olympe.D.aa),e=b.subscribe(f=>d.update(olympe.D.oa(f)));olympe.D.Ma().$(()=>e.unsubscribe());return d.vb()}}}};olympe.public.Process=class{static fw(a){const b=olympe.host.Rj(),c=b.C(a);return()=>b.G(c)}static gw(a){const b=olympe.host.Rj(),c=b.F(a);return()=>b.P(c)}};olympe.public.Process.onShutdown=olympe.public.Process.gw;olympe.public.Process.onHealthCheck=olympe.public.Process.fw;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Oa.Relation,Direction:olympe.dc.wa,generateTag:olympe.Z.ef,tagToString:olympe.dc.fa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.gq,defineInverseRelation:olympe.dc.du,BrickContext:olympe.sc.xa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.xa.C,registerBrick:olympe.sc.logic.ka.C,FunctionBrick:olympe.sc.logic.Function,
984
+ Context:olympe.sc.xa,Entry:olympe.dc.Oa.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.yf,EnumValue:olympe.dm.Enum,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.wd,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.xe,WorkflowTransition:olympe.sc.workflow.Transition,
985
+ WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Sa,BurstTransaction:olympe.dc.Eh,TransactionResult:olympe.sc.ci,PredefinedDataSource:olympe.dc.Ra,QueryResult:olympe.dc.La,Query:olympe.dc.ra,QuerySingle:olympe.dc.Nc,Predicate:olympe.dc.query.Ca,Order:olympe.dc.query.hj,Config:class{static getParameter(a){return olympe.V.getParameter(a)}},Process:olympe.public.Process,Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.O.Request.jb,ServiceRequest:olympe.O.Ac,
986
+ Service:olympe.O.qb,Auth:olympe.public.Va,AuthState:{INIT:olympe.auth.Ba.C.INIT,DISCONNECTED:olympe.auth.Ba.C.Pe,GUEST:olympe.auth.Ba.C.Af,AUTHENTICATING:olympe.auth.Ba.C.Gi,ERROR:olympe.auth.Ba.C.Cb,AUTHENTICATED:olympe.auth.Ba.C.le},AuthProtocol:olympe.auth.kc.C,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,
987
+ RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.$a{static get(){return olympe.dc.ta()}},ListDef:olympe.dc.ua,instanceToTag:olympe.dc.fa,registerSync:olympe.dc.ka.C,getUniqueTag:olympe.Z.ef,onDestroy:a=>olympe.D.Ma().onDestroy(a),offDestroy:a=>olympe.D.Ma().pf(a),FollowRules:olympe.dc.Nb,transformers:{Related:olympe.dc.ba.te,RecursiveRelated:olympe.dc.ba.ce,Distinct:olympe.dc.ba.Ih,Filter:olympe.dc.ba.Qe,Limit:olympe.dc.ba.Mg,Sort:olympe.dc.ba.gg,Union:olympe.dc.ba.$e},ListDefPredicate:olympe.public.Ca,
988
+ predicates:{And:olympe.dc.Y.kd,Or:olympe.dc.Y.be,Not:olympe.dc.Y.Kd,Equals:olympe.dc.Y.Yd,Contains:olympe.dc.Y.Ne,Greater:olympe.dc.Y.Ti,Smaller:olympe.dc.Y.wj,HasRelated:olympe.dc.Y.Mh,InstanceOf:olympe.dc.Y.Qh,Regex:olympe.dc.Y.Ye},Comparator:olympe.public.Me,comparators:{Number:olympe.dc.ac.Number,String:olympe.dc.ac.String,DateTime:olympe.dc.ac.DateTime},valuedefs:{BooleanProperty:olympe.dc.Ua.Ji,StringProperty:olympe.dc.Ua.ai,NumberProperty:olympe.dc.Ua.Uh,DateTimeProperty:olympe.dc.Ua.Hh,Constant:olympe.dc.Ua.ne,
989
+ Tag:olympe.dc.Ua.bi}});
993
990
 
994
991
 
995
992
  }.bind(this))();