@olympeio/runtime-node 9.0.4 → 9.0.6

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
@@ -203,7 +203,7 @@ UMDLibWrapper(this, 'mqtt', function(){var e=require('ws');return t={1026:(e,t,r
203
203
  (function() {
204
204
  "use strict";
205
205
 
206
- 'use strict';var m,ba='function'==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};function ca(a){a=['object'==typeof globalThis&&globalThis,a,'object'==typeof window&&window,'object'==typeof self&&self,'object'==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error('Cannot find global object');}var da=ca(this);
206
+ var m,ba='function'==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};function ca(a){a=['object'==typeof globalThis&&globalThis,a,'object'==typeof window&&window,'object'==typeof self&&self,'object'==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error('Cannot find global object');}var da=ca(this);
207
207
  function ea(a,b){if(b)a:{var c=da;a=a.split('.');for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&ba(c,a,{configurable:!0,writable:!0,value:b})}}function x(a){function b(d){return a.next(d)}function c(d){return a.throw(d)}return new Promise(function(d,e){function f(g){g.done?d(g.value):Promise.resolve(g.value).then(b,c).then(f,e)}f(a.next())})}
208
208
  function fa(a,b){a instanceof String&&(a+='');var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}ea('Array.prototype.values',function(a){return a?a:function(){return fa(this,function(b,c){return c})}});
209
209
  ea('Array.prototype.includes',function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var f=d[c];if(f===b||Object.is(f,b))return!0}return!1}});function ha(a){if(null==a)throw new TypeError("The 'this' value for String.prototype.padStart must not be null or undefined");return a+''}function ia(a,b){a=void 0!==a?String(a):' ';return 0<b&&a?a.repeat(Math.ceil(b/a.length)).substring(0,b):''}
@@ -211,789 +211,791 @@ ea('String.prototype.padStart',function(a){return a?a:function(b,c){var d=ha(thi
211
211
  ea('Array.prototype.flatMap',function(a){return a?a:function(b,c){for(var d=[],e=0;e<this.length;e++){var f=b.call(c,this[e],e,this);Array.isArray(f)?d.push.apply(d,f):d.push(f)}return d}});ea('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}});ea('Object.values',function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push(b[d]);return c}});
212
212
  ea('Promise.prototype.finally',function(a){return a?a:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c;})})}});
213
213
  ea('Object.fromEntries',function(a){return a?a:function(b){var c={};if(!(Symbol.iterator in b))throw new TypeError(''+b+' is not iterable');b=b[Symbol.iterator].call(b);for(var d=b.next();!d.done;d=b.next()){d=d.value;if(Object(d)!==d)throw new TypeError('iterable for fromEntries should yield objects');c[d[0]]=d[1]}return c}});var ja=this||self;
214
- function z(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={hj:()=>'object'===typeof window?window:'object'===typeof global?global:self};olympe.hj().olympe=olympe;olympe.CC=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};olympe.ha={};olympe.ha.node={};'function'!==typeof require||global.Blob||(global.Blob=require('cross-blob'));olympe.T={};olympe.T.zf={};olympe.T.zf.no=class{process(a){const b=Object.keys(a.Ae);let c,d;c=0;for(d=b.length;c<d;c++)if(a.Pd(b[c]).mj())throw Error('Service "'+b[c]+'" is defined as abstract and needs to be overridden');}};olympe.T.zf.no.la=[olympe.T.zf.sq];olympe.T.zf.oo=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.Pd(g),c(g.fj(),h),g=g.Gi,null!==g))for(let k=0,l=g.length;k<l;k++)c(g[k].fj(),h)}function c(g,h){for(let k=0,l=g.length,n;k<l;k++)n=g[k],n instanceof olympe.T.zb&&b(n.Y(),h)}function d(){for(const g in f)if(Object.prototype.hasOwnProperty.call(f,g))return g}var e=Object.keys(a.Ae);const f={};for(let g=0,h=e.length;g<h;g++)f[e[g]]=
215
- !0;for(;void 0!==(e=d());)b(e,[])}};olympe.T.zf.oo.la=[olympe.T.zf.sq];olympe.T.zf.sq=class{process(){}};const ka=[],la=[];olympe.T.ro=class{constructor(){}static C(a,b){ka.push(new olympe.T.Al(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');});la.push(new olympe.T.Al(b,c,a))}};olympe.T.config=olympe.T.ro.C;olympe.T.run=olympe.T.ro.F;olympe.T.rl=class{constructor(){}getValue(){}};olympe.T.Al=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.T.zb(c[d]))}}fj(){return this.G}};function ma(a,b,c){let d=a.C[b];if(void 0===d){const e=a.F[b];if(void 0===e){if(c===olympe.T.hf.C.Kh)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.L.error('Error during instantiation of service '+b),f;}!e.F&&(a.C[b]=d)}return d}function na(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.L.C++,f=b[e],d[e]=f instanceof olympe.T.rl?f.getValue(a):f,oa(a.L);return d}
216
- olympe.T.hf=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.L=new olympe.T.Pp(c);a=olympe.T.O.dg;if(void 0!==this.C[a])throw Error('Service "'+a+'" has already been instantiated');this.C[a]=this}Xa(){return this.L}getParameter(a){return this.parameters[a.toLowerCase()]}};olympe.T.hf.C={bt:'exception',Kh:'null'};function pa(a,b,c){function d(f,g){let h,k,l;for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(k=f[h],l=g.concat((h.startsWith('#')?h.substring(1):h).toLowerCase()),'object'!==typeof k||null===k||h.startsWith('#')?e[l.join('.')]=k:d(k,l))}const e=a.parameters;d(b,c?[c]:[])}function B(a,b,c,...d){qa(a.L,'Defining service '+b);a.C(b,c,d,!1,!1)}function ra(a,b,c,...d){qa(a.L,'Defining service '+b);a.C(b,c,d,!1,!0)}
217
- function C(a,b,c,d,e=!1){qa(a.L,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function sa(a,b,c,d=!1){qa(a.L,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function ta(a,b){qa(a.L,'Defining abstract service '+b);a.C(b).Vi=!0}function ua(a,b){a.parameters[olympe.H.Config.jo.toLowerCase()]=b}function E(a,b,c){b=b.toLowerCase();Object.prototype.hasOwnProperty.call(a.parameters,b)||(a.parameters[b]=c)}
218
- olympe.T.Ps=class{constructor(a){var b=va,c=wa;this.Ae=Object.create(null);this.parameters=Object.create(null);this.N=[new olympe.T.zf.no,new olympe.T.zf.oo];this.F=[];b&&pa(this,b);c&&pa(this,c,'version');a&&pa(this,a);a=this.getParameter(olympe.T.Config.Yt);this.G=void 0!==a?a:3;this.L=new olympe.T.Pp(this.G)}Xa(){return this.L}C(a,b,c,d,e){const f=a instanceof olympe.T.zb?a.Y():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.Ae[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
219
- var g=this.Ae[f];g.id=g.id+'!!'+ ++olympe.T.Gl.C;g.F=!0;g=g.id;c[h]=g;this.Ae[g]=this.Ae[f]}}this.Ae[f]=new olympe.T.Gl(b,c,d||!1,f,e||!1);return this.Ae[f]}Pd(a){a=this.Ae[a];if(void 0===a)throw Error();return a}getParameter(a){return this.parameters[a.toLowerCase()]}compile(){var a=this.F;this.L.debug('Calling '+a.length+' configure callbacks');this.L.C++;for(let b=0,c=a.length;b<c;b++)qa(this.L,'Calling callback'),this.L.C++,a[b].call(null,this),oa(this.L);oa(this.L);this.L.debug('Configuration summary: '+
220
- Object.keys(this.Ae).length+' definitions');this.L.debug('Compiling...');this.L.C++;a=this.N;for(let b=0,c=a.length;b<c;b++)this.L.debug('running compilation pass '+(b+1)+': '+a[b].constructor.name),a[b].process(this);oa(this.L);this.L.debug('Compilation done, returning container');return new olympe.T.hf(this.Ae,this.parameters,this.G)}};olympe.T.Gl=class{constructor(a,b,c,d,e=!0){this.G=a||null;this.N=!!c;this.C=[];this.Vi=!1;this.Gi=null;if(b){this.C=b;for(let f=0,g=b.length;f<g;f++)'string'===typeof b[f]&&(b[f]=new olympe.T.zb(b[f]))}this.id=d||'';this.V=e;this.F=!1}Y(){return this.id}instantiate(a){const b=a.Xa();b.debug('Resolving arguments for '+this.id);const c=this.G;let d=na(a,this.C);const e=()=>{if(this.N)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};qa(b,'Instantiating '+this.id);const f=olympe.D?
221
- olympe.D.oh().run(()=>e()):e(),g=this.Gi;let h,k,l;if(null!==g&&0<g.length){b.C++;qa(b,'Calling configuration callbacks:');k=0;for(l=g.length;k<l;k++)b.C++,h=g[k],qa(b,'Calling additional configuration callback '+h.C),d=na(a,h.fj()),d.push(f),h.F.apply(null,d),oa(b);oa(b)}qa(b,'Done instantiating '+this.id);return f}oj(){return this.V}fj(){return this.C}mj(){return this.Vi}config(a,b,c){null===this.Gi&&(this.Gi=[]);this.Gi.push(new olympe.T.Al(b,c,a))}};olympe.T.Gl.C=0;function oa(a){0<a.C&&a.C--}function qa(a,b){1>=a.F&&xa(a,'log','DI: '+b)}function xa(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.T.Pp=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&xa(this,'log','DI: '+a)}info(a){3>=this.F&&xa(this,'info','DI: '+a)}warn(a){4>=this.F&&xa(this,'warn','DI: '+a)}error(a){5>=this.F&&xa(this,'error','DI: '+a)}};olympe.T.fa=class extends olympe.T.rl{constructor(a){super();this.id=a}Y(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.T.zb=class extends olympe.T.rl{constructor(a,b){super();this.id=a;this.C=b||olympe.T.hf.C.bt}Y(){return this.id}getValue(a){return ma(a,this.id,this.C)}};olympe.T.O={dg:'di.Container',uA:'di.PublicContainer'};olympe.T.Config={Yt:'logging.di'};olympe.T.run([olympe.T.O.dg],a=>{olympe.T.getParameter=b=>a.getParameter(b)});olympe.W={};function ya(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function za(){var a=Math.random();return ya((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}let Aa=Math.pow(2,32)-1;olympe.W.lc=function(){return za()};olympe.W.ej=function(){return za()};olympe.W.ln=function(a,b=1){const c=a.substr(12,a.length-12);return ya(parseInt(a.substr(0,12),16)+b)+c};
222
- olympe.W.Vw=function(a){return ya(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Ba=0,Ca=0;olympe.W.fw=function(){var a=(new Date).getTime();a<=Ba?4294967295===Ca?(Ca=Math.floor(Math.random()/4*Aa),Ba+=1):Ca=Math.floor(Ca+(4294967295-Ca)/2):(Ca=Math.floor(Math.random()/4*Aa),Ba=a);a='00000000'+Ca.toString(16);return ya(Ba)+a.substr(a.length-8,8)};olympe.W.bD=function(){for(let a=0;1E4>a;a++)console.log(olympe.W.fw())};
223
- olympe.W.Ag=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.W.HC=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.W.EC=function(a,b){return(b?b:'UI')+'-'+a};olympe.W.Bp=class{constructor(a){this.id=a||olympe.W.Bp.C++}qb(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.W.Bp.C=0;olympe.W.gA=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.W.Ih=function(a,b,c,d,e,f,g,h,k,l,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,l,n,p,q,0]};olympe.W.Ih.F=function(a){return new olympe.W.Ih(.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.W.Ih.C=function(){return new olympe.W.Ih(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.W.Ih.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.W.Ih.prototype.get=function(a,b){return this.values[5*a+b]};function Da(a){return(new TextEncoder).encode(a).buffer}function Ea(a){return(new TextDecoder('utf8')).decode(a)}olympe.W.vl=class{V(){}C(){}G(){}N(){}F(){}Z(){}};olympe.W.Cr=a=>a.replace('+','-').replace('/','_');olympe.W.Cv=a=>a.replace('-','+').replace('_','/');function Fa(a){a.F=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.G&&a.G(d));0<a.values.size?Fa(a):a.C&&a.C()},a.N)}function Ga(a,b){a.G=b;return a}
224
- olympe.W.fr=class{constructor(a,b=a/2){this.timeout=a;this.N=b;this.values=new Map;this.C=this.G=this.F=null}add(a){this.values.set(a,Date.now());null===this.F&&Fa(this)}has(a){return this.values.has(a)}delete(a){a=this.values.delete(a);0===this.values.size&&(this.F&&clearTimeout(this.F),this.C&&this.C());return a}};olympe.W.er=class{constructor(a){this.F=Ga(new olympe.W.fr(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);this.C&&this.C(b,c)});this.values=new Map;this.C=null}set(a,b){this.values.set(a,b);this.F.add(a)}has(a){return this.values.has(a)}get(a){return this.values.get(a)}delete(a){this.values.delete(a);return this.F.delete(a)}};function Ha(a,b){return a+b&4294967295}
214
+ function z(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={fj:()=>'object'===typeof window?window:'object'===typeof global?global:self};olympe.fj().olympe=olympe;olympe.FC=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};olympe.ha={};olympe.ha.node={};'function'!==typeof require||global.Blob||(global.Blob=require('cross-blob'));olympe.T={};olympe.T.xf={};olympe.T.xf.ho=class{process(a){const b=Object.keys(a.Ae);let c,d;c=0;for(d=b.length;c<d;c++)if(a.Pd(b[c]).kj())throw Error('Service "'+b[c]+'" is defined as abstract and needs to be overridden');}};olympe.T.xf.ho.la=[olympe.T.xf.mq];olympe.T.xf.io=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.Pd(g),c(g.dj(),h),g=g.Fi,null!==g))for(let k=0,l=g.length;k<l;k++)c(g[k].dj(),h)}function c(g,h){for(let k=0,l=g.length,n;k<l;k++)n=g[k],n instanceof olympe.T.zb&&b(n.Z(),h)}function d(){for(const g in f)if(Object.prototype.hasOwnProperty.call(f,g))return g}var e=Object.keys(a.Ae);const f={};for(let g=0,h=e.length;g<h;g++)f[e[g]]=
215
+ !0;for(;void 0!==(e=d());)b(e,[])}};olympe.T.xf.io.la=[olympe.T.xf.mq];olympe.T.xf.mq=class{process(){}};const ka=[],la=[];olympe.T.lo=class{constructor(){}static C(a,b){ka.push(new olympe.T.wl(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');});la.push(new olympe.T.wl(b,c,a))}};olympe.T.config=olympe.T.lo.C;olympe.T.run=olympe.T.lo.F;olympe.T.nl=class{constructor(){}getValue(){}};olympe.T.wl=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.T.zb(c[d]))}}dj(){return this.G}};function ma(a,b,c){let d=a.C[b];if(void 0===d){const e=a.F[b];if(void 0===e){if(c===olympe.T.ff.C.Ih)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.L.error('Error during instantiation of service '+b),f;}!e.F&&(a.C[b]=d)}return d}function na(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.L.C++,f=b[e],d[e]=f instanceof olympe.T.nl?f.getValue(a):f,oa(a.L);return d}
216
+ olympe.T.ff=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.L=new olympe.T.Jp(c);a=olympe.T.O.bg;if(void 0!==this.C[a])throw Error('Service "'+a+'" has already been instantiated');this.C[a]=this}Xa(){return this.L}getParameter(a){return this.parameters[a.toLowerCase()]}};olympe.T.ff.C={Zs:'exception',Ih:'null'};function pa(a,b,c){function d(f,g){let h,k,l;for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(k=f[h],l=g.concat((h.startsWith('#')?h.substring(1):h).toLowerCase()),'object'!==typeof k||null===k||h.startsWith('#')?e[l.join('.')]=k:d(k,l))}const e=a.parameters;d(b,c?[c]:[])}function A(a,b,c,...d){qa(a.L,'Defining service '+b);a.C(b,c,d,!1,!1)}function ra(a,b,c,...d){qa(a.L,'Defining service '+b);a.C(b,c,d,!1,!0)}
217
+ function C(a,b,c,d,e=!1){qa(a.L,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function sa(a,b,c,d=!1){qa(a.L,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function ta(a,b){qa(a.L,'Defining abstract service '+b);a.C(b).Ui=!0}function ua(a,b){a.parameters[olympe.H.Config.bo.toLowerCase()]=b}function D(a,b,c){b=b.toLowerCase();Object.prototype.hasOwnProperty.call(a.parameters,b)||(a.parameters[b]=c)}
218
+ olympe.T.Ls=class{constructor(a){var b=va,c=wa;this.Ae=Object.create(null);this.parameters=Object.create(null);this.N=[new olympe.T.xf.ho,new olympe.T.xf.io];this.F=[];b&&pa(this,b);c&&pa(this,c,'version');a&&pa(this,a);a=this.getParameter(olympe.T.Config.Vt);this.G=void 0!==a?a:3;this.L=new olympe.T.Jp(this.G)}Xa(){return this.L}C(a,b,c,d,e){const f=a instanceof olympe.T.zb?a.Z():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.Ae[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
219
+ var g=this.Ae[f];g.id=g.id+'!!'+ ++olympe.T.Cl.C;g.F=!0;g=g.id;c[h]=g;this.Ae[g]=this.Ae[f]}}this.Ae[f]=new olympe.T.Cl(b,c,d||!1,f,e||!1);return this.Ae[f]}Pd(a){a=this.Ae[a];if(void 0===a)throw Error();return a}getParameter(a){return this.parameters[a.toLowerCase()]}compile(){var a=this.F;this.L.debug('Calling '+a.length+' configure callbacks');this.L.C++;for(let b=0,c=a.length;b<c;b++)qa(this.L,'Calling callback'),this.L.C++,a[b].call(null,this),oa(this.L);oa(this.L);this.L.debug('Configuration summary: '+
220
+ Object.keys(this.Ae).length+' definitions');this.L.debug('Compiling...');this.L.C++;a=this.N;for(let b=0,c=a.length;b<c;b++)this.L.debug('running compilation pass '+(b+1)+': '+a[b].constructor.name),a[b].process(this);oa(this.L);this.L.debug('Compilation done, returning container');return new olympe.T.ff(this.Ae,this.parameters,this.G)}};olympe.T.Cl=class{constructor(a,b,c,d,e=!0){this.G=a||null;this.N=!!c;this.C=[];this.Ui=!1;this.Fi=null;if(b){this.C=b;for(let f=0,g=b.length;f<g;f++)'string'===typeof b[f]&&(b[f]=new olympe.T.zb(b[f]))}this.id=d||'';this.U=e;this.F=!1}Z(){return this.id}instantiate(a){const b=a.Xa();b.debug('Resolving arguments for '+this.id);const c=this.G;let d=na(a,this.C);const e=()=>{if(this.N)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};qa(b,'Instantiating '+this.id);const f=olympe.D?
221
+ olympe.D.mh().run(()=>e()):e(),g=this.Fi;let h,k,l;if(null!==g&&0<g.length){b.C++;qa(b,'Calling configuration callbacks:');k=0;for(l=g.length;k<l;k++)b.C++,h=g[k],qa(b,'Calling additional configuration callback '+h.C),d=na(a,h.dj()),d.push(f),h.F.apply(null,d),oa(b);oa(b)}qa(b,'Done instantiating '+this.id);return f}mj(){return this.U}dj(){return this.C}kj(){return this.Ui}config(a,b,c){null===this.Fi&&(this.Fi=[]);this.Fi.push(new olympe.T.wl(b,c,a))}};olympe.T.Cl.C=0;function oa(a){0<a.C&&a.C--}function qa(a,b){1>=a.F&&xa(a,'log','DI: '+b)}function xa(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.T.Jp=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&xa(this,'log','DI: '+a)}info(a){3>=this.F&&xa(this,'info','DI: '+a)}warn(a){4>=this.F&&xa(this,'warn','DI: '+a)}error(a){5>=this.F&&xa(this,'error','DI: '+a)}};olympe.T.fa=class extends olympe.T.nl{constructor(a){super();this.id=a}Z(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.T.zb=class extends olympe.T.nl{constructor(a,b){super();this.id=a;this.C=b||olympe.T.ff.C.Zs}Z(){return this.id}getValue(a){return ma(a,this.id,this.C)}};olympe.T.O={bg:'di.Container',xA:'di.PublicContainer'};olympe.T.Config={Vt:'logging.di'};olympe.T.run([olympe.T.O.bg],a=>{olympe.T.getParameter=b=>a.getParameter(b)});olympe.W={};function ya(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function za(){var a=Math.random();return ya((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}let Aa=Math.pow(2,32)-1;olympe.W.nc=function(){return za()};olympe.W.cj=function(){return za()};olympe.W.fn=function(a,b=1){const c=a.substr(12,a.length-12);return ya(parseInt(a.substr(0,12),16)+b)+c};
222
+ olympe.W.Sw=function(a){return ya(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Ba=0,Ca=0;olympe.W.cw=function(){var a=(new Date).getTime();a<=Ba?4294967295===Ca?(Ca=Math.floor(Math.random()/4*Aa),Ba+=1):Ca=Math.floor(Ca+(4294967295-Ca)/2):(Ca=Math.floor(Math.random()/4*Aa),Ba=a);a='00000000'+Ca.toString(16);return ya(Ba)+a.substr(a.length-8,8)};olympe.W.eD=function(){for(let a=0;1E4>a;a++)console.log(olympe.W.cw())};
223
+ olympe.W.yg=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.W.KC=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.W.HC=function(a,b){return(b?b:'UI')+'-'+a};olympe.W.vp=class{constructor(a){this.id=a||olympe.W.vp.C++}qb(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.W.vp.C=0;olympe.W.jA=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.W.Gh=function(a,b,c,d,e,f,g,h,k,l,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,l,n,p,q,0]};olympe.W.Gh.F=function(a){return new olympe.W.Gh(.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.W.Gh.C=function(){return new olympe.W.Gh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.W.Gh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.W.Gh.prototype.get=function(a,b){return this.values[5*a+b]};function Da(a){return(new TextEncoder).encode(a).buffer}function Ea(a){return(new TextDecoder('utf8')).decode(a)}olympe.W.rl=class{U(){}C(){}G(){}N(){}F(){}Y(){}};olympe.W.xr=a=>a.replace('+','-').replace('/','_');olympe.W.zv=a=>a.replace('-','+').replace('_','/');function Fa(a){a.F=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.G&&a.G(d));0<a.values.size?Fa(a):a.C&&a.C()},a.N)}function Ga(a,b){a.G=b;return a}
224
+ olympe.W.ar=class{constructor(a,b=a/2){this.timeout=a;this.N=b;this.values=new Map;this.C=this.G=this.F=null}add(a){this.values.set(a,Date.now());null===this.F&&Fa(this)}has(a){return this.values.has(a)}delete(a){a=this.values.delete(a);0===this.values.size&&(this.F&&clearTimeout(this.F),this.C&&this.C());return a}};olympe.W.$q=class{constructor(a){this.F=Ga(new olympe.W.ar(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);this.C&&this.C(b,c)});this.values=new Map;this.C=null}set(a,b){this.values.set(a,b);this.F.add(a)}has(a){return this.values.has(a)}get(a){return this.values.get(a)}delete(a){this.values.delete(a);return this.F.delete(a)}};function Ha(a,b){return a+b&4294967295}
225
225
  function Ia(a,b){let c=a[0],d=a[1],e=a[2],f=a[3];c=F(c,d,e,f,b[0],7,-680876936);f=F(f,c,d,e,b[1],12,-389564586);e=F(e,f,c,d,b[2],17,606105819);d=F(d,e,f,c,b[3],22,-1044525330);c=F(c,d,e,f,b[4],7,-176418897);f=F(f,c,d,e,b[5],12,1200080426);e=F(e,f,c,d,b[6],17,-1473231341);d=F(d,e,f,c,b[7],22,-45705983);c=F(c,d,e,f,b[8],7,1770035416);f=F(f,c,d,e,b[9],12,-1958414417);e=F(e,f,c,d,b[10],17,-42063);d=F(d,e,f,c,b[11],22,-1990404162);c=F(c,d,e,f,b[12],7,1804603682);f=F(f,c,d,e,b[13],12,-40341101);e=F(e,f,
226
226
  c,d,b[14],17,-1502002290);d=F(d,e,f,c,b[15],22,1236535329);c=G(c,d,e,f,b[1],5,-165796510);f=G(f,c,d,e,b[6],9,-1069501632);e=G(e,f,c,d,b[11],14,643717713);d=G(d,e,f,c,b[0],20,-373897302);c=G(c,d,e,f,b[5],5,-701558691);f=G(f,c,d,e,b[10],9,38016083);e=G(e,f,c,d,b[15],14,-660478335);d=G(d,e,f,c,b[4],20,-405537848);c=G(c,d,e,f,b[9],5,568446438);f=G(f,c,d,e,b[14],9,-1019803690);e=G(e,f,c,d,b[3],14,-187363961);d=G(d,e,f,c,b[8],20,1163531501);c=G(c,d,e,f,b[13],5,-1444681467);f=G(f,c,d,e,b[2],9,-51403784);
227
227
  e=G(e,f,c,d,b[7],14,1735328473);d=G(d,e,f,c,b[12],20,-1926607734);c=H(d^e^f,c,d,b[5],4,-378558);f=H(c^d^e,f,c,b[8],11,-2022574463);e=H(f^c^d,e,f,b[11],16,1839030562);d=H(e^f^c,d,e,b[14],23,-35309556);c=H(d^e^f,c,d,b[1],4,-1530992060);f=H(c^d^e,f,c,b[4],11,1272893353);e=H(f^c^d,e,f,b[7],16,-155497632);d=H(e^f^c,d,e,b[10],23,-1094730640);c=H(d^e^f,c,d,b[13],4,681279174);f=H(c^d^e,f,c,b[0],11,-358537222);e=H(f^c^d,e,f,b[3],16,-722521979);d=H(e^f^c,d,e,b[6],23,76029189);c=H(d^e^f,c,d,b[9],4,-640364487);
228
228
  f=H(c^d^e,f,c,b[12],11,-421815835);e=H(f^c^d,e,f,b[15],16,530742520);d=H(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]=Ha(c,a[0]);a[1]=Ha(d,a[1]);a[2]=Ha(e,a[2]);a[3]=Ha(f,a[3])}function H(a,b,c,d,e,f){b=Ha(Ha(b,a),Ha(d,f));return Ha(b<<e|b>>>32-e,c)}function F(a,b,c,d,e,f,g){return H(b&c|~b&d,a,b,e,f,g)}function G(a,b,c,d,e,f,g){return H(b&d|c&~d,a,b,e,f,g)}function J(a,b,c,d,e,f,g){return H(c^(b|~d),a,b,e,f,g)}
230
230
  function Ja(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);Ia(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(Ia(a,g),f=0;16>f;f++)g[f]=0;g[14]=8*e;
231
- Ia(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'!==Ja('hello')&&(Ha=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.W.mb=Ja;olympe.W.Zx=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let l=null,n=null;var p=null;g&&(p=g.match(b),l=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||
232
- null,sC:g||null,vs:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,FC:f||null,parameters:b}};olympe.W.XC=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=')))};olympe.W.$C=function(a){let b='';for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=(b?'&':'?')+c+'='+encodeURIComponent(a[c]));return b};olympe.W.Sr=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};
233
- olympe.W.An=(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.W.An(a[c],d):a[c]=d}};olympe.W.bn=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.W.An(d,e);b(`conf.d/${a}`,f=>{olympe.W.An(d,f);c(d)})})};olympe.W.pC=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Cg(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.W.Qy=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.W.au=class{constructor(a,b){this.start=a;this.end=b}};olympe.W.au.C={Hi:'left',Pi:'right',Oy:'bottom',KB:'top'};function Ka(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.W.Vh.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.W.Vh.C:new olympe.W.Vh(b,c,d,a[4])}function La(a){return`${a.C}.${a.F}.${a.G}`}
234
- olympe.W.Vh=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.N=d||null}Wk(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}zj(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<a.G}qb(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.N?`-${this.N}`:'')}};olympe.W.Vh.C=new olympe.W.Vh(Number.NaN,Number.NaN,Number.NaN);olympe.W.O={zh:'utils.binaryConverter',Cs:'utils.base64Converter'};olympe.T.config(a=>{ta(a,olympe.W.O.zh);sa(a,olympe.W.O.Cs,olympe.W.O.zh,!0)},'Utils services');olympe.T.run([olympe.W.O.zh],a=>{olympe.W.di=()=>a});olympe.pa={};olympe.pa.Ob=class{N(){}ra(){}G(){}aa(){}ka(){}Da(){}V(){}Z(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.pa.Ob.prototype.fatal=olympe.pa.Ob.prototype.fatal;olympe.pa.Ob.prototype.error=olympe.pa.Ob.prototype.error;olympe.pa.Ob.prototype.warn=olympe.pa.Ob.prototype.warn;olympe.pa.Ob.prototype.info=olympe.pa.Ob.prototype.info;olympe.pa.Ob.prototype.log=olympe.pa.Ob.prototype.log;olympe.pa.Ob.prototype.debug=olympe.pa.Ob.prototype.debug;olympe.pa.Ob.prototype.trace=olympe.pa.Ob.prototype.trace;
235
- olympe.pa.Ob.C={Zu:0,eg:1,Xt:2,xp:3,gv:4,qc:5,et:6,cm:7};olympe.pa.Ob.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.pa.sa=class{Nc(){}};olympe.pa.sd={};function Ma(a,b,c,d,e,f){var g=new Date;g=('00'+g.getHours()).substr(-2)+':'+('00'+g.getMinutes()).substr(-2)+':'+('00'+g.getSeconds()).substr(-2)+'.'+('00'+g.getMilliseconds()).substr(-3);f=a.ab?`%c[${g}] [${f.toUpperCase()}] ${c}:%c`:`%c[${g}] ${c}:%c`;for(const h of d)f+=' '+h;a.Sa[b](f,'color: '+e,'color: #444');for(const h of a.qd.values())h(g,c,b,...d)}
236
- olympe.pa.sd.Ob=class{constructor(a,b,c){this.name=a;this.C=b;this.ab=c;this.F=a.toUpperCase();this.qd=new Map;this.Sa=console}N(){return this.C}ra(){return this.C<=olympe.pa.Ob.C.Zu}G(){return this.C<=olympe.pa.Ob.C.eg}ka(){return this.C<=olympe.pa.Ob.C.Xt}aa(){return this.C<=olympe.pa.Ob.C.xp}Da(){return this.C<=olympe.pa.Ob.C.gv}V(){return this.C<=olympe.pa.Ob.C.qc}Z(){return this.C<=olympe.pa.Ob.C.et}trace(...a){this.ra()&&Ma(this,'log',this.F,a,'#99b','trace')}debug(...a){this.G()&&Ma(this,'log',
237
- this.F,a,'#888','debug')}log(...a){this.ka()&&Ma(this,'log',this.F,a,'#000','log')}info(...a){this.aa()&&Ma(this,'info',this.F,a,'#00f','info')}warn(...a){this.Da()&&Ma(this,'warn',this.F,a,'#684911','warn')}error(...a){this.V()&&Ma(this,'error',this.F,a,'#f00','error')}fatal(...a){this.Z()&&Ma(this,'error',this.F,a,'#f00','fatal')}};olympe.pa.sd.Ob.la=[olympe.pa.Ob];olympe.pa.sd.sa=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.L=this.Nc('logging');this.L.info('Logging initialized, global log level is '+olympe.pa.Ob.F[b])}Nc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.pa.Config.Hs}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.pa.Config.Nu}`;Object.prototype.hasOwnProperty.call(this.C.parameters,
238
- c.toLowerCase())&&(d=!0===this.C.getParameter(c));b=new olympe.pa.sd.Ob(a,b,d);this.channels.set(a,b)}return b}};olympe.pa.sd.sa.la=[olympe.pa.sa];olympe.pa.O={va:'logging.Manager'};olympe.pa.Config={Yo:'logging',Zo:'logging.showLogLevel',Hs:'logging',Nu:'showLogLevel'};olympe.T.config(function(a){E(a,olympe.pa.Config.Yo,olympe.pa.Ob.C.xp);E(a,olympe.pa.Config.Zo,!0);ra(a,olympe.pa.O.va,olympe.pa.sd.sa,olympe.T.O.dg,new olympe.T.fa(olympe.pa.Config.Yo),new olympe.T.fa(olympe.pa.Config.Zo))},'olympe.logging');olympe.T.run([olympe.pa.O.va],a=>{olympe.pa.Xa=b=>a.Nc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.Config={Vp:'df.nodeCreationThreshold'};const Na=[];function Oa(){}function Pa(){}olympe.D.J=class a{constructor(b,c,d){this.C=void 0===b?Oa:b;this.F=void 0===c?Na:c;this.aa=d}static N(){var b=[];return void 0===b||0===b.length?olympe.D.J.ka:new a(Pa,b)}N(){return this.C?this.C():void 0}G(){return this.F?this.F:Na}V(){return null===this.C&&null===this.F}Z(){return this.C===Pa}};olympe.D.J.aa=new olympe.D.J;olympe.D.J.C=new olympe.D.J(null,null);olympe.D.J.ka=new olympe.D.J(Pa);olympe.D.J.G=new olympe.D.J(()=>olympe.D.ea);
239
- olympe.D.J.F=new olympe.D.J(()=>olympe.D.Wa);olympe.D.J.V=new olympe.D.J(()=>olympe.D.qa);olympe.D.J.Z=new olympe.D.J(()=>olympe.D.jc);olympe.D.Ch=class{Y(){return''}Uk(){return''}destroy(){}yb(){return!1}gd(){return!1}run(a,...b){return a(...b)}Cb(a){return a}getParent(){return null}ns(){}lh(){}Ge(){}detach(){}Ok(){}Af(){}onDestroy(){return''}Je(){}vc(){return''}Bn(){}};olympe.D.Ch.prototype.offDestroy=olympe.D.Ch.prototype.Je;olympe.D.Ch.prototype.onDestroy=olympe.D.Ch.prototype.onDestroy;let Qa=0;olympe.T.run([new olympe.T.fa(olympe.D.Config.Vp)],()=>{});
240
- olympe.D.Wb=class{constructor(a='SimpleContext',b){++Qa;this.children=new Map;this.aa=new Map;this.Z=new Map;this.Sa=0;this.name=a;this.id=String(Qa);this.Da=this.ka=!1;(this.parent=void 0===b?olympe.D.Ia():b)&&this.parent.Ge(this);this.debug=!1}Y(){return this.id}Uk(){return this.name}run(a,...b){if(!this.ka){var c=olympe.D.ms(this);a=a(...b);c&&olympe.D.ms(c);return a}}Cb(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.ka&&!this.Da){this.Da=!0;this.Af();for(const a of this.aa.keys())this.aa.has(a)&&
241
- this.aa.get(a)();this.aa.clear();this.Z.clear();this.parent&&(this.parent.detach(this,!1),this.parent=null);this.ka=!0;this.Da=!1;this.Af()}}yb(){return this.ka}gd(){return this.Da}Ge(a){if(!this.ka){var b;olympe.D.lb(a)?b=a.Ma:olympe.D.un(a)&&(b=a);b&&this.children.set(b.Y(),b)}}detach(a,b=!0){let c;olympe.D.lb(a)?c=a.Ma:olympe.D.un(a)&&(c=a);c&&this.children.has(c.Y())&&(b&&c.Ok(this),this.children.delete(c.Y()))}Ok(){this.parent=null;this.destroy()}Af(){const a=this.children;for(const b of a.keys())a.has(b)&&
242
- a.get(b).Ok(this);this.children.clear();for(const b of this.Z.keys())this.Z.has(b)&&this.Z.get(b)();this.Z.clear()}onDestroy(a,b){void 0===b&&(++this.Sa,b=String(this.Sa));this.aa.set(b,a);return b}Je(a){this.aa.delete(a)}vc(a){if(void 0===b){++this.Sa;var b=String(this.Sa)}this.Z.set(b,a);return b}Bn(a){this.Z.delete(a)}ns(a){this.parent&&this.parent.detach(this,!1);(this.parent=a||null)&&this.parent.Ge(this)}getParent(){return this.parent}lh(){return this.children}};
243
- olympe.D.Iq=class extends olympe.D.Wb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Je(){}};olympe.D.Ch.la=[olympe.D.Ch];let Ra=0;
244
- function Sa(a,b){a.N||(a.N=new Map);a.N.set(b.Y(),b);switch(b.Rd()){case olympe.D.Node.C.Jh:break;case olympe.D.Node.C.Uh:break;case olympe.D.Node.C.jk:case olympe.D.Node.C.gg:olympe.D.L.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.Dh:Ta(a,olympe.D.Node.C.Dh);break;case olympe.D.Node.C.OBSOLETE:a.bb=!0;a.C!==olympe.D.Node.C.Dh&&Ta(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.fg:olympe.D.L.warn('Adding a destroyed node as upstream => should never happen!');break;
231
+ Ia(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'!==Ja('hello')&&(Ha=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.W.mb=Ja;olympe.W.by=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let l=null,n=null;var p=null;g&&(p=g.match(b),l=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||
232
+ null,vC:g||null,qs:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,IC:f||null,parameters:b}};olympe.W.$C=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=')))};olympe.W.cD=function(a){let b='';for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=(b?'&':'?')+c+'='+encodeURIComponent(a[c]));return b};olympe.W.Mr=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};
233
+ olympe.W.un=(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.W.un(a[c],d):a[c]=d}};olympe.W.Xm=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.W.un(d,e);b(`conf.d/${a}`,f=>{olympe.W.un(d,f);c(d)})})};olympe.W.sC=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Ag(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.W.Vy=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.W.Yt=class{constructor(a,b){this.start=a;this.end=b}};olympe.W.Yt.C={Gi:'left',Oi:'right',Ty:'bottom',NB:'top'};function Ka(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.W.Uh.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.W.Uh.C:new olympe.W.Uh(b,c,d,a[4])}function La(a){return`${a.C}.${a.F}.${a.G}`}
234
+ olympe.W.Uh=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.N=d||null}Sk(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}xj(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<a.G}qb(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.N?`-${this.N}`:'')}};olympe.W.Uh.C=new olympe.W.Uh(Number.NaN,Number.NaN,Number.NaN);olympe.W.O={xh:'utils.binaryConverter',xs:'utils.base64Converter'};olympe.T.config(a=>{ta(a,olympe.W.O.xh);sa(a,olympe.W.O.xs,olympe.W.O.xh,!0)},'Utils services');olympe.T.run([olympe.W.O.xh],a=>{olympe.W.ci=()=>a});olympe.pa={};olympe.pa.Ob=class{N(){}ra(){}G(){}aa(){}ka(){}Da(){}U(){}Y(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.pa.Ob.prototype.fatal=olympe.pa.Ob.prototype.fatal;olympe.pa.Ob.prototype.error=olympe.pa.Ob.prototype.error;olympe.pa.Ob.prototype.warn=olympe.pa.Ob.prototype.warn;olympe.pa.Ob.prototype.info=olympe.pa.Ob.prototype.info;olympe.pa.Ob.prototype.log=olympe.pa.Ob.prototype.log;olympe.pa.Ob.prototype.debug=olympe.pa.Ob.prototype.debug;olympe.pa.Ob.prototype.trace=olympe.pa.Ob.prototype.trace;
235
+ olympe.pa.Ob.C={Wu:0,cg:1,Ut:2,rp:3,dv:4,cc:5,bt:6,Zl:7};olympe.pa.Ob.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.pa.sa=class{Nc(){}};olympe.pa.sd={};function Ma(a,b,c,d,e,f){var g=new Date;g=('00'+g.getHours()).substr(-2)+':'+('00'+g.getMinutes()).substr(-2)+':'+('00'+g.getSeconds()).substr(-2)+'.'+('00'+g.getMilliseconds()).substr(-3);f=a.ab?`%c[${g}] [${f.toUpperCase()}] ${c}:%c`:`%c[${g}] ${c}:%c`;for(const h of d)f+=' '+h;a.Sa[b](f,'color: '+e,'color: #444');for(const h of a.qd.values())h(g,c,b,...d)}
236
+ olympe.pa.sd.Ob=class{constructor(a,b,c){this.name=a;this.C=b;this.ab=c;this.F=a.toUpperCase();this.qd=new Map;this.Sa=console}N(){return this.C}ra(){return this.C<=olympe.pa.Ob.C.Wu}G(){return this.C<=olympe.pa.Ob.C.cg}ka(){return this.C<=olympe.pa.Ob.C.Ut}aa(){return this.C<=olympe.pa.Ob.C.rp}Da(){return this.C<=olympe.pa.Ob.C.dv}U(){return this.C<=olympe.pa.Ob.C.cc}Y(){return this.C<=olympe.pa.Ob.C.bt}trace(...a){this.ra()&&Ma(this,'log',this.F,a,'#99b','trace')}debug(...a){this.G()&&Ma(this,'log',
237
+ this.F,a,'#888','debug')}log(...a){this.ka()&&Ma(this,'log',this.F,a,'#000','log')}info(...a){this.aa()&&Ma(this,'info',this.F,a,'#00f','info')}warn(...a){this.Da()&&Ma(this,'warn',this.F,a,'#684911','warn')}error(...a){this.U()&&Ma(this,'error',this.F,a,'#f00','error')}fatal(...a){this.Y()&&Ma(this,'error',this.F,a,'#f00','fatal')}};olympe.pa.sd.Ob.la=[olympe.pa.Ob];olympe.pa.sd.sa=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.L=this.Nc('logging');this.L.info('Logging initialized, global log level is '+olympe.pa.Ob.F[b])}Nc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.pa.Config.Cs}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.pa.Config.Ku}`;Object.prototype.hasOwnProperty.call(this.C.parameters,
238
+ c.toLowerCase())&&(d=!0===this.C.getParameter(c));b=new olympe.pa.sd.Ob(a,b,d);this.channels.set(a,b)}return b}};olympe.pa.sd.sa.la=[olympe.pa.sa];olympe.pa.O={va:'logging.Manager'};olympe.pa.Config={So:'logging',To:'logging.showLogLevel',Cs:'logging',Ku:'showLogLevel'};olympe.T.config(function(a){D(a,olympe.pa.Config.So,olympe.pa.Ob.C.rp);D(a,olympe.pa.Config.To,!0);ra(a,olympe.pa.O.va,olympe.pa.sd.sa,olympe.T.O.bg,new olympe.T.fa(olympe.pa.Config.So),new olympe.T.fa(olympe.pa.Config.To))},'olympe.logging');olympe.T.run([olympe.pa.O.va],a=>{olympe.pa.Xa=b=>a.Nc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.Config={Pp:'df.nodeCreationThreshold'};const Na=[];function Oa(){}function Pa(){}olympe.D.J=class a{constructor(b,c,d){this.C=void 0===b?Oa:b;this.F=void 0===c?Na:c;this.aa=d}static N(){var b=[];return void 0===b||0===b.length?olympe.D.J.ka:new a(Pa,b)}N(){return this.C?this.C():void 0}G(){return this.F?this.F:Na}U(){return null===this.C&&null===this.F}Y(){return this.C===Pa}};olympe.D.J.aa=new olympe.D.J;olympe.D.J.C=new olympe.D.J(null,null);olympe.D.J.ka=new olympe.D.J(Pa);olympe.D.J.G=new olympe.D.J(()=>olympe.D.ea);
239
+ olympe.D.J.F=new olympe.D.J(()=>olympe.D.Wa);olympe.D.J.U=new olympe.D.J(()=>olympe.D.qa);olympe.D.J.Y=new olympe.D.J(()=>olympe.D.lc);olympe.D.Ah=class{Z(){return''}Qk(){return''}destroy(){}yb(){return!1}gd(){return!1}run(a,...b){return a(...b)}Cb(a){return a}getParent(){return null}hs(){}jh(){}Ge(){}detach(){}Kk(){}yf(){}onDestroy(){return''}Je(){}vc(){return''}vn(){}};olympe.D.Ah.prototype.offDestroy=olympe.D.Ah.prototype.Je;olympe.D.Ah.prototype.onDestroy=olympe.D.Ah.prototype.onDestroy;let Qa=0;olympe.T.run([new olympe.T.fa(olympe.D.Config.Pp)],()=>{});
240
+ olympe.D.Wb=class{constructor(a='SimpleContext',b){++Qa;this.children=new Map;this.aa=new Map;this.Y=new Map;this.Sa=0;this.name=a;this.id=String(Qa);this.Da=this.ka=!1;(this.parent=void 0===b?olympe.D.Ja():b)&&this.parent.Ge(this);this.debug=!1}Z(){return this.id}Qk(){return this.name}run(a,...b){if(!this.ka){var c=olympe.D.gs(this);a=a(...b);c&&olympe.D.gs(c);return a}}Cb(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.ka&&!this.Da){this.Da=!0;this.yf();for(const a of this.aa.keys())this.aa.has(a)&&
241
+ this.aa.get(a)();this.aa.clear();this.Y.clear();this.parent&&(this.parent.detach(this,!1),this.parent=null);this.ka=!0;this.Da=!1;this.yf()}}yb(){return this.ka}gd(){return this.Da}Ge(a){if(!this.ka){var b;olympe.D.lb(a)?b=a.Ma:olympe.D.nn(a)&&(b=a);b&&this.children.set(b.Z(),b)}}detach(a,b=!0){let c;olympe.D.lb(a)?c=a.Ma:olympe.D.nn(a)&&(c=a);c&&this.children.has(c.Z())&&(b&&c.Kk(this),this.children.delete(c.Z()))}Kk(){this.parent=null;this.destroy()}yf(){const a=this.children;for(const b of a.keys())a.has(b)&&
242
+ a.get(b).Kk(this);this.children.clear();for(const b of this.Y.keys())this.Y.has(b)&&this.Y.get(b)();this.Y.clear()}onDestroy(a,b){void 0===b&&(++this.Sa,b=String(this.Sa));this.aa.set(b,a);return b}Je(a){this.aa.delete(a)}vc(a){if(void 0===b){++this.Sa;var b=String(this.Sa)}this.Y.set(b,a);return b}vn(a){this.Y.delete(a)}hs(a){this.parent&&this.parent.detach(this,!1);(this.parent=a||null)&&this.parent.Ge(this)}getParent(){return this.parent}jh(){return this.children}};
243
+ olympe.D.Dq=class extends olympe.D.Wb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Je(){}};olympe.D.Ah.la=[olympe.D.Ah];let Ra=0;
244
+ function Sa(a,b){a.N||(a.N=new Map);a.N.set(b.Z(),b);switch(b.Rd()){case olympe.D.Node.C.Hh:break;case olympe.D.Node.C.Th:break;case olympe.D.Node.C.fk:case olympe.D.Node.C.eg:olympe.D.L.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.Bh:Ta(a,olympe.D.Node.C.Bh);break;case olympe.D.Node.C.OBSOLETE:a.bb=!0;a.C!==olympe.D.Node.C.Bh&&Ta(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.dg:olympe.D.L.warn('Adding a destroyed node as upstream => should never happen!');break;
245
245
  default:olympe.D.L.warn('Unknown state, investigate: ',b.Rd())}Ua(b,a)}
246
- function Va(a){if(a.Bd){var b=[],c=[];if(a.Yf)if(a.Yf instanceof olympe.D.Node)if(Wa(a.Yf))b=a.Yf.Ib;else return;else b=a.Yf;else b=null;if(null!==a.V){const e=a.wg;for(let f=0,g=a.V.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.V[f];if(Wa(h))c.push(h.Ib);else return}else c.push(a.V[f])}if(a.Bd instanceof Function)var d=a.Bd;else b&&(b[a.Bd]||olympe.D.L.warn('looks like you forget a cast somewhere around '+a.Bd),d=b[a.Bd]);a.run(()=>{a.Af();if(void 0!==d){const e=d.apply(b,c);e&&e.wr?Xa(a,
247
- e.Ma):e instanceof olympe.D.Node?Xa(a,e):(K(a,e),void 0===e&&void 0===a.valueType&&Ta(a,olympe.D.Node.C.Uh))}else Ya(a)})}}function L(a){void 0===a.ab&&(a.ab=a.valueType===olympe.D.Proxy?Za(void 0,a.Ab):Za(a.valueType,a.Ab),a.ab.Ma=a);return a.ab}function $a(a){void 0!==a.F&&(ab(a.F,a),a.F=void 0)}function bb(a){if(a.C===olympe.D.Node.C.OBSOLETE&&(a.C=olympe.D.Node.C.Uh,null!==a.G))for(const b of a.G.values())cb(b)}function Ta(a,b){b!==a.C&&(a.C=b)}
248
- function db(a){if(a.C!==olympe.D.Node.C.OBSOLETE&&a.C!==olympe.D.Node.C.jk&&a.C!==olympe.D.Node.C.Jh&&a.C!==olympe.D.Node.C.Dh){Ta(a,olympe.D.Node.C.jk);var b=a.G;if(b)for(const c of b.values())b.has(c.Y())&&db(c);Ta(a,olympe.D.Node.C.OBSOLETE)}}function eb(a,b,c){if(a.C!==olympe.D.Node.C.gg)if(b===a.F)K(a,c,!0);else{if(a.C===olympe.D.Node.C.OBSOLETE||a.C===olympe.D.Node.C.jk)a.bb=!0;Va(a)}}
249
- function K(a,b,c){b instanceof olympe.D.Node&&(olympe.D.L.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Ib);a.ra||c||void 0===a.F||$a(a);if(void 0!==b){if((a.ra||a.C===olympe.D.Node.C.Uh||a.C===olympe.D.Node.C.OBSOLETE)&&!olympe.D.lb(b)&&void 0!==a.Ib){if(null===b&&null===a.Ib){bb(a);return}if(null!==b&&null!==a.Ib&&(b.valueOf()===a.Ib.valueOf()||a.Ib.qb&&a.Ib.qb(b))){bb(a);return}}if(!0===a.ra)olympe.D.L.error("Circular dependency detected: updating a downstream node caused this node's (#"+
250
- a.Y()+') value to get updated !');else{a.C===olympe.D.Node.C.fg&&olympe.D.L.warn(`trying to set a value on a destroyed node (#${a.Y()} ${a.zd?', '+a.zd:''})`);a.C===olympe.D.Node.C.gg&&olympe.D.L.warn(`trying to set a value on a node being destroyed (#${a.Y()} ${a.zd?', '+a.zd:''})`);a.ra=!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.Wa?(c=olympe.D.Bb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.ea?(c=olympe.D.ya(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.qa&&(c=olympe.D.Ac(c),d=!1)));a.Ib=c;Ta(a,olympe.D.Node.C.Uh);if(b=a.G){d=0;for(const f of b.values())0<d&&db(f),d++;for(const f of b.values())eb(f,a,c)}a.ra=!1}}}
252
- function fb(a,b){if(a.C!==olympe.D.Node.C.gg&&a.C!==olympe.D.Node.C.fg&&(a.C!==olympe.D.Node.C.Jh||a.Bd)){var c=void 0!==a.defaultValue;a.Bd&&b!==a.F&&a.Af();if(c)K(a,a.defaultValue,!0);else if(a.Ib=void 0,Ta(a,olympe.D.Node.C.Jh),b=a.G)for(const d of b.values())fb(d,a)}}function Ya(a){if(a.C!==olympe.D.Node.C.Dh){Ta(a,olympe.D.Node.C.Dh);var b=a.G;if(b)for(const c of b.values())Ya(c);a.Af();void 0!==a.F&&$a(a);a.Ib=a.defaultValue}}function Wa(a){return a.C===olympe.D.Node.C.Uh}
246
+ function Va(a){if(a.Bd){var b=[],c=[];if(a.Wf)if(a.Wf instanceof olympe.D.Node)if(Wa(a.Wf))b=a.Wf.Ib;else return;else b=a.Wf;else b=null;if(null!==a.U){const e=a.ug;for(let f=0,g=a.U.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.U[f];if(Wa(h))c.push(h.Ib);else return}else c.push(a.U[f])}if(a.Bd instanceof Function)var d=a.Bd;else b&&(b[a.Bd]||olympe.D.L.warn('looks like you forget a cast somewhere around '+a.Bd),d=b[a.Bd]);a.run(()=>{a.yf();if(void 0!==d){const e=d.apply(b,c);e&&e.rr?Xa(a,
247
+ e.Ma):e instanceof olympe.D.Node?Xa(a,e):(K(a,e),void 0===e&&void 0===a.valueType&&Ta(a,olympe.D.Node.C.Th))}else Ya(a)})}}function L(a){void 0===a.ab&&(a.ab=a.valueType===olympe.D.Proxy?Za(void 0,a.Ab):Za(a.valueType,a.Ab),a.ab.Ma=a);return a.ab}function $a(a){void 0!==a.F&&(ab(a.F,a),a.F=void 0)}function bb(a){if(a.C===olympe.D.Node.C.OBSOLETE&&(a.C=olympe.D.Node.C.Th,null!==a.G))for(const b of a.G.values())cb(b)}function Ta(a,b){b!==a.C&&(a.C=b)}
248
+ function db(a){if(a.C!==olympe.D.Node.C.OBSOLETE&&a.C!==olympe.D.Node.C.fk&&a.C!==olympe.D.Node.C.Hh&&a.C!==olympe.D.Node.C.Bh){Ta(a,olympe.D.Node.C.fk);var b=a.G;if(b)for(const c of b.values())b.has(c.Z())&&db(c);Ta(a,olympe.D.Node.C.OBSOLETE)}}function eb(a,b,c){if(a.C!==olympe.D.Node.C.eg)if(b===a.F)K(a,c,!0);else{if(a.C===olympe.D.Node.C.OBSOLETE||a.C===olympe.D.Node.C.fk)a.bb=!0;Va(a)}}
249
+ function K(a,b,c){b instanceof olympe.D.Node&&(olympe.D.L.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Ib);a.ra||c||void 0===a.F||$a(a);if(void 0!==b){if((a.ra||a.C===olympe.D.Node.C.Th||a.C===olympe.D.Node.C.OBSOLETE)&&!olympe.D.lb(b)&&void 0!==a.Ib){if(null===b&&null===a.Ib){bb(a);return}if(null!==b&&null!==a.Ib&&(b.valueOf()===a.Ib.valueOf()||a.Ib.qb&&a.Ib.qb(b))){bb(a);return}}if(!0===a.ra)olympe.D.L.error("Circular dependency detected: updating a downstream node caused this node's (#"+
250
+ a.Z()+') value to get updated !');else{a.C===olympe.D.Node.C.dg&&olympe.D.L.warn(`trying to set a value on a destroyed node (#${a.Z()} ${a.zd?', '+a.zd:''})`);a.C===olympe.D.Node.C.eg&&olympe.D.L.warn(`trying to set a value on a node being destroyed (#${a.Z()} ${a.zd?', '+a.zd:''})`);a.ra=!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.Wa?(c=olympe.D.Bb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.ea?(c=olympe.D.ya(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.qa&&(c=olympe.D.Ac(c),d=!1)));a.Ib=c;Ta(a,olympe.D.Node.C.Th);if(b=a.G){d=0;for(const f of b.values())0<d&&db(f),d++;for(const f of b.values())eb(f,a,c)}a.ra=!1}}}
252
+ function fb(a,b){if(a.C!==olympe.D.Node.C.eg&&a.C!==olympe.D.Node.C.dg&&(a.C!==olympe.D.Node.C.Hh||a.Bd)){var c=void 0!==a.defaultValue;a.Bd&&b!==a.F&&a.yf();if(c)K(a,a.defaultValue,!0);else if(a.Ib=void 0,Ta(a,olympe.D.Node.C.Hh),b=a.G)for(const d of b.values())fb(d,a)}}function Ya(a){if(a.C!==olympe.D.Node.C.Bh){Ta(a,olympe.D.Node.C.Bh);var b=a.G;if(b)for(const c of b.values())Ya(c);a.yf();void 0!==a.F&&$a(a);a.Ib=a.defaultValue}}function Wa(a){return a.C===olympe.D.Node.C.Th}
253
253
  function Xa(a,b){b===a?olympe.D.L.error('Setting a node as provider of itself. Ignoring'):(a.F&&a.F!==b&&$a(a),Ua(b,a),Wa(b)?K(a,b.Ib,!0):void 0!==a.defaultValue?K(a,a.defaultValue,!0):fb(a),a.F=b)}function gb(a,b){a.Bd&&(a.Bd=void 0);a.zd='Repeater';Xa(a,b)}function cb(a){a.F?bb(a):null!==a.N&&0===Array.from(a.N.values()).filter(b=>!Wa(b)).length&&(a.bb&&(a.bb=!1,Va(a)),bb(a))}
254
- function Ua(a,b){a.G||(a.G=new Map);a.G.set(b.Y(),b);a.C===olympe.D.Node.C.fg&&olympe.D.L.warn('adding a downstream node on a deleted one (#'+a.Y()+') !')}function ab(a,b){a.G&&(b=b.Y(),a.G.has(b)&&(a.G.delete(b),hb(a)))}function hb(a){if(null===a.getParent()){var b=a.G;b&&0<b.size||a.destroy()}}
255
- olympe.D.Node=class extends olympe.D.Wb{constructor({valueType:a,Bd:b,ay:c=!0,Yf:d,pn:e,debug:f=!1,wg:g=null,zd:h='Node',Wi:k}={}){++Ra;super(String(Ra));this.debug=!!f;this.zd=h;h&&'string'===typeof h||(b?this.zd=b.name?b.name:'anon()':this.zd='Node');this.V=e&&0<e.length?e:null;this.wg=g&&0<g.length?g:null;this.valueType=a;this.Ib=void 0;this.ra=!1;this.C=olympe.D.Node.C.Jh;this.bb=!1;this.G=this.N=null;this.Bd=b;this.Yf=d||null;this.defaultValue=this.ab=this.F=void 0;this.Wi=k;d&&d instanceof olympe.D.Node&&
256
- Sa(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Sa(this,a);c&&Va(this)}df(a){this.defaultValue=a;this.C===olympe.D.Node.C.Jh&&K(this,a,!0);return this}Zi(a){this.valueType=a}Yb(){return this.valueType||Object}Rd(){return this.C}yb(){return this.C===olympe.D.Node.C.fg}gd(){return this.C===olympe.D.Node.C.gg}Ab(...a){if(this.Wi instanceof Function)return this.Wi(...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.Rd();a!==olympe.D.Node.C.gg&&a!==olympe.D.Node.C.fg||
257
- olympe.D.L.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.lb(g)&&b.push(g.Ma);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.xf&&(e[g]=f.Ma,b.push(g));return L(new olympe.D.Node({valueType:d.N(),Bd:c,Yf:this,pn:e,debug:!1,wg:b,zd:'Proxy.'+c+'()'}))}Ok(a){if(null===this.getParent())olympe.D.L.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.L.warn('Investigate a potential issue in creator-createe link: create node mismatch',
258
- a,this.getParent());return}this.ns(null);hb(this)}destroy(){var a=this.C;if(a!==olympe.D.Node.C.gg&&a!==olympe.D.Node.C.fg){Ta(this,olympe.D.Node.C.gg);if(a=this.G){for(const c of a.values())if(a.has(c.Y())){var b=c;b.N&&b.N.delete(this.Y());b.F&&b.F.Y()===this.Y()?b.F=void 0:b.destroy()}a.clear()}this.G=null;super.destroy();if(this.N){for(const c of this.N.values())this.N.has(c.Y())&&ab(c,this);this.N.clear()}this.N=null;this.F&&(ab(this.F,this),this.F=void 0);this.Ib=void 0;this.V&&(this.V.length=
259
- 0,this.V=null);this.wg&&(this.wg.length=0,this.wg=null);this.Wi=this.Bd=void 0;this.defaultValue=this.Yf=null;this.zd=`** Destroyed ** ${this.zd}`;Ta(this,olympe.D.Node.C.fg)}}Uk(){return this.zd}};olympe.D.Node.F='rootNode';olympe.D.Node.C={Jh:0,Uh:1,Dh:3,jk:4,OBSOLETE:5,gg:6,fg:7};function Za(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.L.error('investigate');c=Object.create(ib(c,a.prototype));c.Hk=a;c.xr=b;return c}function ib(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.nm)||Object.defineProperty(b,olympe.D.Proxy.nm,{enumerable:!1,configurable:!1,writable:!1,value:jb(a,b)});return b[olympe.D.Proxy.nm]}
260
- function kb(a,b){if(a.Hk!==b){a.Hk=b;b.prototype||olympe.D.L.error('Cast not possible, provided type is not a valid type!');var c=ib(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Ma&&a.Ma.Zi(b)}}
261
- function jb(a,b){let c={};if(b.prototype)olympe.D.L.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(ib(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].K;null===e||e&&e.V()?c[d]=function(...f){var g=this.Ma;if(g&&Wa(g)&&(g=g.Ib)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.J.aa,c[d]=function(...f){f=this.xr.call(this.Ma,
262
- ...f,e,d);const g=e.aa;if(g){const h=this.Ma.Ib;h&&h[g]&&kb(f,h[g])}return e.Z()?this:f})}});return c}function lb(a,b){K(a.Ma,b)}function mb(a){fb(a.Ma)}function nb(a){olympe.D.wc([olympe.D.qa.C],b=>{a.Ma.df(b)},'setDefaultValue');return a}function ob(a,b){gb(a.Ma,olympe.D.Tf(b)?b:b.Ma)}function pb(a,b){olympe.D.lb(b)||olympe.D.Tf(b)?ob(a,b):lb(a,b)}
263
- olympe.D.Proxy=class{constructor(a,b){this.Ma=null;this.Hk=a;this.xr=b}static lb(a){return!(!a||!a.xf)}qb(a){return olympe.D.Fa([this,a],(b,c)=>b===c,Boolean)}Td(a){return olympe.D.Fa([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.qa.F:olympe.D.qa.C:b.valueOf()===c.valueOf()?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa)}wr(){return this.Ma}};olympe.D.Proxy.nm='__opp__';olympe.D.Proxy.prototype.xf=!0;function qb(a,b){a.node.df(b);return a}olympe.D.Vj=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.lb(a)?K(this.node,olympe.D.Ya(a)):K(this.node,a);return this}repeat(a){gb(this.node,olympe.D.lb(a)?a.Ma:a);return this}clear(){fb(this.node);return this}Eb(){return L(this.node)}};function rb(a,b,c=1E3,d,e){const f=olympe.D.Kc(olympe.D.ea),g=d||olympe.D.ea.Eo.Lp;let h,k,l,n;f.update(olympe.D.ya(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.node.yb()||(l=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+l*g(k,0,1,1),f.update(olympe.D.ya(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.Eb()}
264
- olympe.D.ea=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static kc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.ya(b.value)}Kn(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Ac(!this.Kn())}hd(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.Bb(''):olympe.D.Bb(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.Kn()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.Kc(olympe.D.ea,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.ya(c))};a.forEach((f,g)=>{olympe.D.wc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.node.yb()){var g=b.get(f);b.delete(f);g===c&&
266
- e()}});return d.Eb()}he(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.ya(b.valueOf()+c.valueOf()),olympe.D.ea,'ONumber.plus')}xh(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.ya(b.valueOf()-c.valueOf()),olympe.D.ea,'ONumber.minus')}round(){return olympe.D.ya(Math.round(this.valueOf()))}Bj(){return olympe.D.ya(-this.valueOf())}cl(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.ya(b.valueOf()*c.valueOf()),olympe.D.ea,'ONumber.mul')}$i(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.ya(b.valueOf()/c.valueOf()),
267
- olympe.D.ea,'ONumber.div')}Bx(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.ya(b.valueOf()%c.valueOf()),olympe.D.ea,'ONumber.div')}floor(){return olympe.D.ya(Math.floor(this.valueOf()))}ceil(){return olympe.D.ya(Math.ceil(this.valueOf()))}trunc(){return olympe.D.ya(Math.trunc(this.valueOf()))}log(){return olympe.D.ya(Math.log(this.valueOf()))}pow(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.ya(Math.pow(b.valueOf(),c.valueOf())),olympe.D.ea,'ONumber.pow')}exp(){return olympe.D.ya(Math.exp(this.valueOf()))}Td(a){return olympe.D.Fa([this,
268
- a],(b,c)=>olympe.D.Ac(b.qb(c)),olympe.D.qa,'ONumber.oEquals')}qb(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Mw(){return this.valueOf()}sn(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa,'ONumber.isBiggerThan')}dy(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.ya(c),olympe.D.ea,'ONumber.returnsBiggest')}ks(a){return olympe.D.Fa([this,
269
- a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.ya(c),olympe.D.ea,'ONumber.returnsSmallest')}sx(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa,'ONumber.isSmallerThan')}sin(){return olympe.D.ya(Math.sin(this.valueOf()))}cos(){return olympe.D.ya(Math.cos(this.valueOf()))}atan2(a){return olympe.D.lb(a)?olympe.D.ie([a],b=>olympe.D.ya(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.ea):olympe.D.ya(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.ya(Math.abs(this.valueOf()))}qj(a,
270
- b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.ie([a,b],(c,d)=>olympe.D.ya(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.ea):olympe.D.ya(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static jv(a,b,c,d){'number'===typeof a&&(a=olympe.D.ge(a));'number'===typeof b&&(b=olympe.D.ge(b));'number'===typeof c&&(c=olympe.D.ge(c));let e=0;const f=olympe.D.ge(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.nn(b.sn(c),()=>{olympe.pa.Xa('df').warn('You have a min bigger than max, cap your inputs')});
271
- const k=(l,n)=>{n=olympe.D.ge(n);const p=olympe.D.ea.animate(n,500);ob(f,p);lb(n,olympe.D.ya(l));e=l};olympe.D.ie([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):ob(f,olympe.D.ge(e))},olympe.D.ea);void 0!==b&&olympe.D.fl(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.D.ge(e),p=olympe.D.ea.animate(n,400,d);l=olympe.D.ya(g);K(n.Ma,l);e=g;ob(f,p)}});void 0!==c&&olympe.D.fl(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.D.ge(e),p=olympe.D.ea.animate(n,400,d);l=olympe.D.ya(h);K(n.Ma,l);e=h;ob(f,
272
- p)}});return f}static offset(a){let b;return olympe.D.ie([a],c=>{void 0===b&&(b=c);return olympe.D.ya(c-b)},olympe.D.ea,'offset')}static Lr(a){let b,c,d;return olympe.D.Fa([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.ya(0);d=window.performance.now();const f=olympe.D.ya((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.ea,'derivative')}static nx(a){let b=olympe.D.ya(0),c,d,e;return olympe.D.Fa([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.ya(0);
273
- e=window.performance.now();b=b.he((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.ea,'integrate')}static Qv(a){let b;return olympe.D.Fa([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.ya(c.valueOf()-b.valueOf());b=c;return d},olympe.D.ea,'diff')}static Fv(a,b,c){return olympe.D.ie([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.ya(d>=e?d<=f?d:f:e)},olympe.D.ea)}static animate(a,b,c,d){let e;
274
- return e=olympe.D.Fa([a],f=>{const g=olympe.D.Ya(b,1E3),h=olympe.D.Ya(e);return void 0===h?olympe.D.ya(f):rb(h,f,g,c,k=>{d&&d(k)})},olympe.D.ea)}static wv(a,b,c){let d,e,f,g,h,k,l=olympe.D.ge(),n;olympe.D.wc([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);lb(l,olympe.D.ya(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static hd(a){return olympe.D.lb(a)?
275
- olympe.D.Fa([a],b=>olympe.D.Bb(b.valueOf().toString()),olympe.D.Wa):olympe.D.Bb(a)}static Bj(a){return olympe.D.lb(a)?olympe.D.Fa([a],b=>olympe.D.ya(-b.valueOf()),olympe.D.ea):olympe.D.ya(-a.valueOf())}static he(a,b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.Fa([a,b],(c,d)=>olympe.D.ya(c.valueOf()+d.valueOf()),olympe.D.ea,'plus'):olympe.D.ya(a.valueOf()+b.valueOf())}static xh(a,b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.ie([a,b],(c,d)=>olympe.D.ya(c.valueOf()-d.valueOf()),olympe.D.ea,
276
- 'minus'):olympe.D.ya(a.valueOf()-b.valueOf())}static $i(a,b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.ie([a,b],(c,d)=>olympe.D.ya(c.valueOf()/d.valueOf()),olympe.D.ea,'div'):olympe.D.ya(a.valueOf()/b.valueOf())}static $x(a,b){if(void 0===b)return a;olympe.D.wc([b],c=>{c=olympe.D.ya(a.Ma.Ib.valueOf()+c.valueOf());K(a.Ma,c)},'plusEqual');return a}};olympe.D.ea.ZERO=new olympe.D.ea(0);olympe.D.ea.ONE=new olympe.D.ea(1);olympe.D.ea.av=new olympe.D.ea(2);olympe.D.ea.PI=new olympe.D.ea(Math.PI);
277
- olympe.D.ea.vt=new olympe.D.ea(Infinity);olympe.D.ea.hu=new olympe.D.ea(-Infinity);olympe.D.ea.Up=new olympe.D.ea(NaN);olympe.D.ea.wA=olympe.D.ea.$x;olympe.D.ea.Ey=olympe.D.ea.jv;olympe.D.ea.mA=olympe.D.ea.offset;olympe.D.ea.ez=olympe.D.ea.Lr;olympe.D.ea.zC=olympe.D.ea.Lr;olympe.D.ea.Yz=olympe.D.ea.nx;olympe.D.ea.fz=olympe.D.ea.Qv;olympe.D.ea.Uy=olympe.D.ea.Fv;olympe.D.ea.Fy=olympe.D.ea.animate;olympe.D.ea.Gy=olympe.D.ea.wv;olympe.D.ea.LB=olympe.D.ea.hd;olympe.D.ea.MB=olympe.D.ea.Bj;
278
- olympe.D.ea.vA=olympe.D.ea.he;olympe.D.ea.hA=olympe.D.ea.xh;olympe.D.ea.gz=olympe.D.ea.$i;
279
- olympe.D.ea.Eo={Lp:function(a,b,c,d){return c*a/d+b},Bz:function(a,b,c,d){a/=d;return c*a*a+b},Lz:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},xz: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},pz:function(a,b,c,d){a/=d;return c*a*a*a+b},Hz:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},vz: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},Cz:function(a,b,c,d){a/=d;return c*a*a*a*a+b},Mz:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
280
- yz: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},Dz:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},Nz:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},zz: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},Ez:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},Oz:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},Az:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},sz:function(a,b,c,d){return c*Math.pow(2,
281
- 10*(a/d-1))+b},Kz:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},wz: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},oz:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},Gz:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},uz: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},jz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},kz:function(a,b,c,d){d=(a/=d)*a;return b+
282
- c*(2*d*d+2*d*a+-3*d)},lz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},mz:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},Jz: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)},Iz: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)},rz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},qz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},Fz: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},nz:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};m=olympe.D.ea.prototype;m.toJSON.K=olympe.D.J.C;m.Kn.K=olympe.D.J.C;m.isNaN.K=olympe.D.J.V;m.hd.K=olympe.D.J.F;
284
- m.toString.K=new olympe.D.J(()=>String,[]);m.toFixed.K=new olympe.D.J(()=>String,[]);m.he.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.xh.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.round.K=olympe.D.J.G;m.Bj.K=olympe.D.J.G;m.cl.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.$i.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.Bx.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.floor.K=olympe.D.J.G;m.ceil.K=olympe.D.J.G;m.trunc.K=olympe.D.J.G;m.log.K=olympe.D.J.G;m.pow.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.exp.K=olympe.D.J.G;
285
- m.Td.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.qb.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.Mw.K=olympe.D.J.C;m.sn.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.dy.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.ks.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.sx.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.sin.K=olympe.D.J.G;m.cos.K=olympe.D.J.G;m.atan2.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.abs.K=olympe.D.J.G;m.qj.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);olympe.D.Wa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static kc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Bb(b.value)}Hr(a){return olympe.D.Wa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.Fa([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.Bb(d)},olympe.D.Wa,'OString.concat')}hd(){return this}yy(a){return olympe.D.ya(parseInt(this.value,
286
- a))}ts(){return olympe.D.ya(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}qb(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Td(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Ac(c&&b.valueOf()===c.valueOf()),olympe.D.qa,'OString.oEquals')}Rf(){return olympe.D.Ac(!this.value||0===this.value.length)}contains(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Ac((c instanceof olympe.D.Wa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
287
- olympe.D.qa,'OString.contains')}startsWith(a,b){return olympe.D.Fa([this,a,b||0],(c,d,e)=>olympe.D.Ac(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.D.qa,'OString.startsWith')}endsWith(a,b){return olympe.D.Fa([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Cg().valueOf()+e.valueOf()+1;return olympe.D.Ac(c.valueOf().endsWith(d.valueOf(),e))},olympe.D.qa,'OString.endsWith')}indexOf(a,b){return olympe.D.Fa([this,a,b||0],(c,d,e)=>olympe.D.ya(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
288
- olympe.D.ea,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.Fa([this,a,b||Infinity],(c,d,e)=>olympe.D.ya(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.ea,'OString.lastIndexOf')}slice(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Wa,'OString.slice')}Cg(){return olympe.D.ya(this.value.length)}threshold(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Wa.EMPTY,olympe.D.Wa,'OString.threshold')}toLowerCase(){return olympe.D.Bb(this.value.toLowerCase())}toUpperCase(){return olympe.D.Bb(this.value.toUpperCase())}trim(){return olympe.D.Bb(this.value.trim())}padStart(a,
289
- b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Wa,'OString.padStart')}padEnd(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Wa,'OString.padEnd')}replace(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Wa,'OString.replace')}vy(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().substr(d.valueOf(),
290
- e.valueOf())),olympe.D.Wa,'OString.subOStr')}static concat(...a){return olympe.D.Bb('').concat(...a)}};olympe.D.Wa.EMPTY=new olympe.D.Wa('');olympe.D.Wa.Ou=new olympe.D.Wa(' ');m=olympe.D.Wa.prototype;m.toJSON.K=olympe.D.J.C;m.Hr.K=new olympe.D.J(()=>olympe.D.Wa,[0,1]);m.concat.K=olympe.D.J.F;m.hd.K=olympe.D.J.F;m.yy.K=olympe.D.J.G;m.ts.K=olympe.D.J.G;m.toString.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.qb.K=olympe.D.J.C;m.Td.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.Rf.K=olympe.D.J.V;
291
- m.contains.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.startsWith.K=new olympe.D.J(()=>olympe.D.qa,[0,1]);m.endsWith.K=new olympe.D.J(()=>olympe.D.qa,[0,1]);m.indexOf.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.lastIndexOf.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.slice.K=new olympe.D.J(()=>olympe.D.Wa,[0,1]);m.Cg.K=olympe.D.J.G;m.threshold.K=new olympe.D.J(()=>olympe.D.Wa,[0]);m.toLowerCase.K=olympe.D.J.F;m.toUpperCase.K=olympe.D.J.F;m.trim.K=olympe.D.J.F;m.padStart.K=olympe.D.J.F;m.padEnd.K=olympe.D.J.F;
292
- m.replace.K=olympe.D.J.F;m.vy.K=olympe.D.J.F;olympe.D.qa=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static kc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.qa.F:olympe.D.qa.C}and(a){if(void 0!==a)return olympe.D.lb(a)?olympe.D.ie([a],b=>new olympe.D.qa(this.valueOf()&&b.valueOf()),olympe.D.qa,'and'):this.value&&a.valueOf()?olympe.D.qa.F:olympe.D.qa.C}qb(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Td(a){if(void 0!==a)return olympe.D.lb(a)?
293
- olympe.D.ie([a],b=>new olympe.D.qa(this.valueOf()===b.valueOf()),olympe.D.qa,'oEquals'):this.qb(a)?olympe.D.qa.F:olympe.D.qa.C}not(){return this.value?olympe.D.qa.C:olympe.D.qa.F}vv(a){if(void 0!==a)return olympe.D.lb(a)?olympe.D.ie([a],b=>new olympe.D.qa(!(this.valueOf()&&b.valueOf())),olympe.D.qa,'andNot'):this.value&&!a.valueOf()?olympe.D.qa.F:olympe.D.qa.C}or(a){if(void 0!==a)return olympe.D.lb(a)?olympe.D.ie([a],b=>new olympe.D.qa(this.valueOf()||b.valueOf()),olympe.D.qa,'or'):this.value||a.valueOf()?
294
- olympe.D.qa.F:olympe.D.qa.C}xor(a){return olympe.D.Fa([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Ac(b&&!c||!b&&c)},olympe.D.qa,'OBoolean.xor')}hw(){return this.value}Tr(){return!0===this.value?olympe.D.ea.ONE:olympe.D.ea.ZERO}hd(){return olympe.D.Bb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.qa.F=new olympe.D.qa(!0);olympe.D.qa.C=new olympe.D.qa(!1);m=olympe.D.qa.prototype;m.toJSON.K=olympe.D.J.C;
295
- m.and.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.qb.K=olympe.D.J.C;m.Td.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.not.K=olympe.D.J.V;m.vv.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.or.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.xor.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.hw.K=new olympe.D.J(()=>Boolean,[]);m.Tr.K=olympe.D.J.G;m.hd.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;function sb(a){return new olympe.D.jb(new Date(a))}
296
- olympe.D.jb=class{constructor(a){this.xb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.xb.toJSON()+'" }'}static kc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.jb(new Date(b.value.valueOf()))}static now(){return new olympe.D.jb(new Date)}pj(){return this.xb&&!isNaN(this.xb.getTime())?olympe.D.qa.F:olympe.D.qa.C}Ct(){return olympe.D.ya(this.xb.getMilliseconds())}Et(){return olympe.D.ya(this.xb.getSeconds())}Dt(){return olympe.D.ya(this.xb.getMinutes())}Bt(){return olympe.D.ya(this.xb.getHours())}qw(){return olympe.D.ya(this.xb.getDate())}getMonth(){return olympe.D.ya(this.xb.getMonth()+1)}Ft(){return olympe.D.ya(this.xb.getFullYear())}getTime(){return this.xb.getTime()}sy(){var a=
254
+ function Ua(a,b){a.G||(a.G=new Map);a.G.set(b.Z(),b);a.C===olympe.D.Node.C.dg&&olympe.D.L.warn('adding a downstream node on a deleted one (#'+a.Z()+') !')}function ab(a,b){a.G&&(b=b.Z(),a.G.has(b)&&(a.G.delete(b),hb(a)))}function hb(a){if(null===a.getParent()){var b=a.G;b&&0<b.size||a.destroy()}}
255
+ olympe.D.Node=class extends olympe.D.Wb{constructor({valueType:a,Bd:b,gy:c=!0,Wf:d,jn:e,debug:f=!1,ug:g=null,zd:h='Node',Vi:k}={}){++Ra;super(String(Ra));this.debug=!!f;this.zd=h;h&&'string'===typeof h||(b?this.zd=b.name?b.name:'anon()':this.zd='Node');this.U=e&&0<e.length?e:null;this.ug=g&&0<g.length?g:null;this.valueType=a;this.Ib=void 0;this.ra=!1;this.C=olympe.D.Node.C.Hh;this.bb=!1;this.G=this.N=null;this.Bd=b;this.Wf=d||null;this.defaultValue=this.ab=this.F=void 0;this.Vi=k;d&&d instanceof olympe.D.Node&&
256
+ Sa(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Sa(this,a);c&&Va(this)}bf(a){this.defaultValue=a;this.C===olympe.D.Node.C.Hh&&K(this,a,!0);return this}Yi(a){this.valueType=a}Yb(){return this.valueType||Object}Rd(){return this.C}yb(){return this.C===olympe.D.Node.C.dg}gd(){return this.C===olympe.D.Node.C.eg}Ab(...a){if(this.Vi instanceof Function)return this.Vi(...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.Rd();a!==olympe.D.Node.C.eg&&a!==olympe.D.Node.C.dg||
257
+ olympe.D.L.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.lb(g)&&b.push(g.Ma);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.vf&&(e[g]=f.Ma,b.push(g));return L(new olympe.D.Node({valueType:d.N(),Bd:c,Wf:this,jn:e,debug:!1,ug:b,zd:'Proxy.'+c+'()'}))}Kk(a){if(null===this.getParent())olympe.D.L.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.L.warn('Investigate a potential issue in creator-createe link: create node mismatch',
258
+ a,this.getParent());return}this.hs(null);hb(this)}destroy(){var a=this.C;if(a!==olympe.D.Node.C.eg&&a!==olympe.D.Node.C.dg){Ta(this,olympe.D.Node.C.eg);if(a=this.G){for(const c of a.values())if(a.has(c.Z())){var b=c;b.N&&b.N.delete(this.Z());b.F&&b.F.Z()===this.Z()?b.F=void 0:b.destroy()}a.clear()}this.G=null;super.destroy();if(this.N){for(const c of this.N.values())this.N.has(c.Z())&&ab(c,this);this.N.clear()}this.N=null;this.F&&(ab(this.F,this),this.F=void 0);this.Ib=void 0;this.U&&(this.U.length=
259
+ 0,this.U=null);this.ug&&(this.ug.length=0,this.ug=null);this.Vi=this.Bd=void 0;this.defaultValue=this.Wf=null;this.zd=`** Destroyed ** ${this.zd}`;Ta(this,olympe.D.Node.C.dg)}}Qk(){return this.zd}};olympe.D.Node.F='rootNode';olympe.D.Node.C={Hh:0,Th:1,Bh:3,fk:4,OBSOLETE:5,eg:6,dg:7};function Za(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.L.error('investigate');c=Object.create(ib(c,a.prototype));c.Dk=a;c.sr=b;return c}function ib(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.im)||Object.defineProperty(b,olympe.D.Proxy.im,{enumerable:!1,configurable:!1,writable:!1,value:jb(a,b)});return b[olympe.D.Proxy.im]}
260
+ function kb(a,b){if(a.Dk!==b){a.Dk=b;b.prototype||olympe.D.L.error('Cast not possible, provided type is not a valid type!');var c=ib(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Ma&&a.Ma.Yi(b)}}
261
+ function jb(a,b){let c={};if(b.prototype)olympe.D.L.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(ib(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].K;null===e||e&&e.U()?c[d]=function(...f){var g=this.Ma;if(g&&Wa(g)&&(g=g.Ib)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.J.aa,c[d]=function(...f){f=this.sr.call(this.Ma,
262
+ ...f,e,d);const g=e.aa;if(g){const h=this.Ma.Ib;h&&h[g]&&kb(f,h[g])}return e.Y()?this:f})}});return c}function lb(a,b){K(a.Ma,b)}function mb(a){fb(a.Ma)}function nb(a){olympe.D.wc([olympe.D.qa.C],b=>{a.Ma.bf(b)},'setDefaultValue');return a}function ob(a,b){gb(a.Ma,olympe.D.Tf(b)?b:b.Ma)}function pb(a,b){olympe.D.lb(b)||olympe.D.Tf(b)?ob(a,b):lb(a,b)}
263
+ olympe.D.Proxy=class{constructor(a,b){this.Ma=null;this.Dk=a;this.sr=b}static lb(a){return!(!a||!a.vf)}qb(a){return olympe.D.Fa([this,a],(b,c)=>b===c,Boolean)}Td(a){return olympe.D.Fa([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.qa.F:olympe.D.qa.C:b.valueOf()===c.valueOf()?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa)}rr(){return this.Ma}};olympe.D.Proxy.im='__opp__';olympe.D.Proxy.prototype.vf=!0;function qb(a,b){a.node.bf(b);return a}olympe.D.Sj=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.lb(a)?K(this.node,olympe.D.Ya(a)):K(this.node,a);return this}repeat(a){gb(this.node,olympe.D.lb(a)?a.Ma:a);return this}clear(){fb(this.node);return this}Eb(){return L(this.node)}};function rb(a,b,c=1E3,d,e){const f=olympe.D.Kc(olympe.D.ea),g=d||olympe.D.ea.yo.Fp;let h,k,l,n;f.update(olympe.D.ya(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.node.yb()||(l=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+l*g(k,0,1,1),f.update(olympe.D.ya(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.Eb()}
264
+ olympe.D.ea=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.ya(b.value)}En(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Ac(!this.En())}hd(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.Bb(''):olympe.D.Bb(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.En()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.Kc(olympe.D.ea,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.ya(c))};a.forEach((f,g)=>{olympe.D.wc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.node.yb()){var g=b.get(f);b.delete(f);g===c&&
266
+ e()}});return d.Eb()}ge(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.ya(b.valueOf()+c.valueOf()),olympe.D.ea,'ONumber.plus')}vh(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.ya(b.valueOf()-c.valueOf()),olympe.D.ea,'ONumber.minus')}round(){return olympe.D.ya(Math.round(this.valueOf()))}yj(){return olympe.D.ya(-this.valueOf())}Zk(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.ya(b.valueOf()*c.valueOf()),olympe.D.ea,'ONumber.mul')}Zi(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.ya(b.valueOf()/c.valueOf()),
267
+ olympe.D.ea,'ONumber.div')}Ex(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.ya(b.valueOf()%c.valueOf()),olympe.D.ea,'ONumber.div')}floor(){return olympe.D.ya(Math.floor(this.valueOf()))}ceil(){return olympe.D.ya(Math.ceil(this.valueOf()))}trunc(){return olympe.D.ya(Math.trunc(this.valueOf()))}log(){return olympe.D.ya(Math.log(this.valueOf()))}pow(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.ya(Math.pow(b.valueOf(),c.valueOf())),olympe.D.ea,'ONumber.pow')}exp(){return olympe.D.ya(Math.exp(this.valueOf()))}Td(a){return olympe.D.Fa([this,
268
+ a],(b,c)=>olympe.D.Ac(b.qb(c)),olympe.D.qa,'ONumber.oEquals')}qb(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Jw(){return this.valueOf()}ln(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa,'ONumber.isBiggerThan')}hy(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.ya(c),olympe.D.ea,'ONumber.returnsBiggest')}ds(a){return olympe.D.Fa([this,
269
+ a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.ya(c),olympe.D.ea,'ONumber.returnsSmallest')}tx(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa,'ONumber.isSmallerThan')}sin(){return olympe.D.ya(Math.sin(this.valueOf()))}cos(){return olympe.D.ya(Math.cos(this.valueOf()))}atan2(a){return olympe.D.lb(a)?olympe.D.he([a],b=>olympe.D.ya(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.ea):olympe.D.ya(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.ya(Math.abs(this.valueOf()))}oj(a,
270
+ b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.he([a,b],(c,d)=>olympe.D.ya(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.ea):olympe.D.ya(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static fv(a,b,c,d){'number'===typeof a&&(a=olympe.D.fe(a));'number'===typeof b&&(b=olympe.D.fe(b));'number'===typeof c&&(c=olympe.D.fe(c));let e=0;const f=olympe.D.fe(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.hn(b.ln(c),()=>{olympe.pa.Xa('df').warn('You have a min bigger than max, cap your inputs')});
271
+ const k=(l,n)=>{n=olympe.D.fe(n);const p=olympe.D.ea.animate(n,500);ob(f,p);lb(n,olympe.D.ya(l));e=l};olympe.D.he([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):ob(f,olympe.D.fe(e))},olympe.D.ea);void 0!==b&&olympe.D.bl(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.D.fe(e),p=olympe.D.ea.animate(n,400,d);l=olympe.D.ya(g);K(n.Ma,l);e=g;ob(f,p)}});void 0!==c&&olympe.D.bl(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.D.fe(e),p=olympe.D.ea.animate(n,400,d);l=olympe.D.ya(h);K(n.Ma,l);e=h;ob(f,
272
+ p)}});return f}static offset(a){let b;return olympe.D.he([a],c=>{void 0===b&&(b=c);return olympe.D.ya(c-b)},olympe.D.ea,'offset')}static Gr(a){let b,c,d;return olympe.D.Fa([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.ya(0);d=window.performance.now();const f=olympe.D.ya((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.ea,'derivative')}static nx(a){let b=olympe.D.ya(0),c,d,e;return olympe.D.Fa([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.ya(0);
273
+ e=window.performance.now();b=b.ge((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.ea,'integrate')}static Nv(a){let b;return olympe.D.Fa([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.ya(c.valueOf()-b.valueOf());b=c;return d},olympe.D.ea,'diff')}static Cv(a,b,c){return olympe.D.he([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.ya(d>=e?d<=f?d:f:e)},olympe.D.ea)}static animate(a,b,c,d){let e;
274
+ return e=olympe.D.Fa([a],f=>{const g=olympe.D.Ya(b,1E3),h=olympe.D.Ya(e);return void 0===h?olympe.D.ya(f):rb(h,f,g,c,k=>{d&&d(k)})},olympe.D.ea)}static tv(a,b,c){let d,e,f,g,h,k,l=olympe.D.fe(),n;olympe.D.wc([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);lb(l,olympe.D.ya(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static hd(a){return olympe.D.lb(a)?
275
+ olympe.D.Fa([a],b=>olympe.D.Bb(b.valueOf().toString()),olympe.D.Wa):olympe.D.Bb(a)}static yj(a){return olympe.D.lb(a)?olympe.D.Fa([a],b=>olympe.D.ya(-b.valueOf()),olympe.D.ea):olympe.D.ya(-a.valueOf())}static ge(a,b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.Fa([a,b],(c,d)=>olympe.D.ya(c.valueOf()+d.valueOf()),olympe.D.ea,'plus'):olympe.D.ya(a.valueOf()+b.valueOf())}static vh(a,b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.he([a,b],(c,d)=>olympe.D.ya(c.valueOf()-d.valueOf()),olympe.D.ea,
276
+ 'minus'):olympe.D.ya(a.valueOf()-b.valueOf())}static Zi(a,b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.he([a,b],(c,d)=>olympe.D.ya(c.valueOf()/d.valueOf()),olympe.D.ea,'div'):olympe.D.ya(a.valueOf()/b.valueOf())}static ey(a,b){if(void 0===b)return a;olympe.D.wc([b],c=>{c=olympe.D.ya(a.Ma.Ib.valueOf()+c.valueOf());K(a.Ma,c)},'plusEqual');return a}};olympe.D.ea.ZERO=new olympe.D.ea(0);olympe.D.ea.ONE=new olympe.D.ea(1);olympe.D.ea.Yu=new olympe.D.ea(2);olympe.D.ea.PI=new olympe.D.ea(Math.PI);
277
+ olympe.D.ea.st=new olympe.D.ea(Infinity);olympe.D.ea.eu=new olympe.D.ea(-Infinity);olympe.D.ea.Op=new olympe.D.ea(NaN);olympe.D.ea.zA=olympe.D.ea.ey;olympe.D.ea.Jy=olympe.D.ea.fv;olympe.D.ea.pA=olympe.D.ea.offset;olympe.D.ea.iz=olympe.D.ea.Gr;olympe.D.ea.CC=olympe.D.ea.Gr;olympe.D.ea.aA=olympe.D.ea.nx;olympe.D.ea.jz=olympe.D.ea.Nv;olympe.D.ea.Yy=olympe.D.ea.Cv;olympe.D.ea.Ky=olympe.D.ea.animate;olympe.D.ea.Ly=olympe.D.ea.tv;olympe.D.ea.OB=olympe.D.ea.hd;olympe.D.ea.PB=olympe.D.ea.yj;
278
+ olympe.D.ea.yA=olympe.D.ea.ge;olympe.D.ea.kA=olympe.D.ea.vh;olympe.D.ea.kz=olympe.D.ea.Zi;
279
+ olympe.D.ea.yo={Fp:function(a,b,c,d){return c*a/d+b},Ez:function(a,b,c,d){a/=d;return c*a*a+b},Oz:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},Az: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},sz:function(a,b,c,d){a/=d;return c*a*a*a+b},Kz:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},yz: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},Fz:function(a,b,c,d){a/=d;return c*a*a*a*a+b},Pz:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
280
+ Bz: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},Gz:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},Qz:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},Cz: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},Hz:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},Rz:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},Dz:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},wz:function(a,b,c,d){return c*Math.pow(2,
281
+ 10*(a/d-1))+b},Nz:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},zz: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},rz:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},Jz:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},xz: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},mz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},nz:function(a,b,c,d){d=(a/=d)*a;return b+
282
+ c*(2*d*d+2*d*a+-3*d)},oz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},pz:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},Mz: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)},Lz: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)},vz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},uz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},Iz: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},qz:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};m=olympe.D.ea.prototype;m.toJSON.K=olympe.D.J.C;m.En.K=olympe.D.J.C;m.isNaN.K=olympe.D.J.U;m.hd.K=olympe.D.J.F;
284
+ m.toString.K=new olympe.D.J(()=>String,[]);m.toFixed.K=new olympe.D.J(()=>String,[]);m.ge.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.vh.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.round.K=olympe.D.J.G;m.yj.K=olympe.D.J.G;m.Zk.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.Zi.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.Ex.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.floor.K=olympe.D.J.G;m.ceil.K=olympe.D.J.G;m.trunc.K=olympe.D.J.G;m.log.K=olympe.D.J.G;m.pow.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.exp.K=olympe.D.J.G;
285
+ m.Td.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.qb.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.Jw.K=olympe.D.J.C;m.ln.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.hy.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.ds.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.tx.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.sin.K=olympe.D.J.G;m.cos.K=olympe.D.J.G;m.atan2.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.abs.K=olympe.D.J.G;m.oj.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);olympe.D.Wa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Bb(b.value)}Cr(a){return olympe.D.Wa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.Fa([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.Bb(d)},olympe.D.Wa,'OString.concat')}hd(){return this}Dy(a){return olympe.D.ya(parseInt(this.value,
286
+ a))}ns(){return olympe.D.ya(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}qb(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Td(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Ac(c&&b.valueOf()===c.valueOf()),olympe.D.qa,'OString.oEquals')}Rf(){return olympe.D.Ac(!this.value||0===this.value.length)}contains(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Ac((c instanceof olympe.D.Wa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
287
+ olympe.D.qa,'OString.contains')}startsWith(a,b){return olympe.D.Fa([this,a,b||0],(c,d,e)=>olympe.D.Ac(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.D.qa,'OString.startsWith')}endsWith(a,b){return olympe.D.Fa([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Ag().valueOf()+e.valueOf()+1;return olympe.D.Ac(c.valueOf().endsWith(d.valueOf(),e))},olympe.D.qa,'OString.endsWith')}indexOf(a,b){return olympe.D.Fa([this,a,b||0],(c,d,e)=>olympe.D.ya(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
288
+ olympe.D.ea,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.Fa([this,a,b||Infinity],(c,d,e)=>olympe.D.ya(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.ea,'OString.lastIndexOf')}slice(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Wa,'OString.slice')}Ag(){return olympe.D.ya(this.value.length)}threshold(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Wa.EMPTY,olympe.D.Wa,'OString.threshold')}toLowerCase(){return olympe.D.Bb(this.value.toLowerCase())}toUpperCase(){return olympe.D.Bb(this.value.toUpperCase())}trim(){return olympe.D.Bb(this.value.trim())}padStart(a,
289
+ b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Wa,'OString.padStart')}padEnd(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Wa,'OString.padEnd')}replace(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Wa,'OString.replace')}Ay(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().substr(d.valueOf(),
290
+ e.valueOf())),olympe.D.Wa,'OString.subOStr')}static concat(...a){return olympe.D.Bb('').concat(...a)}};olympe.D.Wa.EMPTY=new olympe.D.Wa('');olympe.D.Wa.Lu=new olympe.D.Wa(' ');m=olympe.D.Wa.prototype;m.toJSON.K=olympe.D.J.C;m.Cr.K=new olympe.D.J(()=>olympe.D.Wa,[0,1]);m.concat.K=olympe.D.J.F;m.hd.K=olympe.D.J.F;m.Dy.K=olympe.D.J.G;m.ns.K=olympe.D.J.G;m.toString.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.qb.K=olympe.D.J.C;m.Td.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.Rf.K=olympe.D.J.U;
291
+ m.contains.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.startsWith.K=new olympe.D.J(()=>olympe.D.qa,[0,1]);m.endsWith.K=new olympe.D.J(()=>olympe.D.qa,[0,1]);m.indexOf.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.lastIndexOf.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.slice.K=new olympe.D.J(()=>olympe.D.Wa,[0,1]);m.Ag.K=olympe.D.J.G;m.threshold.K=new olympe.D.J(()=>olympe.D.Wa,[0]);m.toLowerCase.K=olympe.D.J.F;m.toUpperCase.K=olympe.D.J.F;m.trim.K=olympe.D.J.F;m.padStart.K=olympe.D.J.F;m.padEnd.K=olympe.D.J.F;
292
+ m.replace.K=olympe.D.J.F;m.Ay.K=olympe.D.J.F;olympe.D.qa=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.qa.F:olympe.D.qa.C}and(a){if(void 0!==a)return olympe.D.lb(a)?olympe.D.he([a],b=>new olympe.D.qa(this.valueOf()&&b.valueOf()),olympe.D.qa,'and'):this.value&&a.valueOf()?olympe.D.qa.F:olympe.D.qa.C}qb(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Td(a){if(void 0!==a)return olympe.D.lb(a)?
293
+ olympe.D.he([a],b=>new olympe.D.qa(this.valueOf()===b.valueOf()),olympe.D.qa,'oEquals'):this.qb(a)?olympe.D.qa.F:olympe.D.qa.C}not(){return this.value?olympe.D.qa.C:olympe.D.qa.F}rv(a){if(void 0!==a)return olympe.D.lb(a)?olympe.D.he([a],b=>new olympe.D.qa(!(this.valueOf()&&b.valueOf())),olympe.D.qa,'andNot'):this.value&&!a.valueOf()?olympe.D.qa.F:olympe.D.qa.C}or(a){if(void 0!==a)return olympe.D.lb(a)?olympe.D.he([a],b=>new olympe.D.qa(this.valueOf()||b.valueOf()),olympe.D.qa,'or'):this.value||a.valueOf()?
294
+ olympe.D.qa.F:olympe.D.qa.C}xor(a){return olympe.D.Fa([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Ac(b&&!c||!b&&c)},olympe.D.qa,'OBoolean.xor')}ew(){return this.value}Nr(){return!0===this.value?olympe.D.ea.ONE:olympe.D.ea.ZERO}hd(){return olympe.D.Bb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.qa.F=new olympe.D.qa(!0);olympe.D.qa.C=new olympe.D.qa(!1);m=olympe.D.qa.prototype;m.toJSON.K=olympe.D.J.C;
295
+ m.and.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.qb.K=olympe.D.J.C;m.Td.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.not.K=olympe.D.J.U;m.rv.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.or.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.xor.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.ew.K=new olympe.D.J(()=>Boolean,[]);m.Nr.K=olympe.D.J.G;m.hd.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;function sb(a){return new olympe.D.jb(new Date(a))}
296
+ olympe.D.jb=class{constructor(a){this.xb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.xb.toJSON()+'" }'}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.jb(new Date(b.value.valueOf()))}static now(){return new olympe.D.jb(new Date)}nj(){return this.xb&&!isNaN(this.xb.getTime())?olympe.D.qa.F:olympe.D.qa.C}zt(){return olympe.D.ya(this.xb.getMilliseconds())}Bt(){return olympe.D.ya(this.xb.getSeconds())}At(){return olympe.D.ya(this.xb.getMinutes())}yt(){return olympe.D.ya(this.xb.getHours())}nw(){return olympe.D.ya(this.xb.getDate())}getMonth(){return olympe.D.ya(this.xb.getMonth()+1)}Ct(){return olympe.D.ya(this.xb.getFullYear())}getTime(){return this.xb.getTime()}xy(){var a=
297
297
  olympe.D,b=a.Bb;var c=this.xb.getDate();c=10>c?'0'+c:c;var d=this.xb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.xb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.D.Bb(this.xb.toLocaleString(a)):olympe.D.Fa([this,a],(b,c)=>olympe.D.Bb(b.xb.toLocaleString(c.valueOf())),olympe.D.Wa)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.D.Bb(this.xb.toLocaleDateString(a)):olympe.D.Fa([this,a],(b,c)=>olympe.D.Bb(b.xb.toLocaleDateString(c.valueOf())),
298
- olympe.D.Wa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.Bb(this.xb.toLocaleTimeString(a)):olympe.D.Fa([this,a],(b,c)=>olympe.D.Bb(b.xb.toLocaleTimeString(c.valueOf())),olympe.D.Wa)}hd(){return olympe.D.Bb(this.xb.toISOString())}ss(){return new Date(this.getTime())}xy(){return this}zy(){return this}ng(a,b){return olympe.D.Fa([b],c=>{const d=new olympe.D.jb(new Date(this.xb.getTime()));d.xb['set'+a](this.xb['get'+a]()+c.valueOf());return d},olympe.D.jb)}mv(a){return this.ng('Milliseconds',
299
- a)}rv(a){return this.ng('Seconds',a)}nv(a){return this.ng('Minutes',a)}kv(a){return this.ng('Hours',a)}Jm(a){return this.ng('Date',a)}tv(a){return'number'===typeof a?this.Jm(7*a):this.Jm(a.cl(7))}ov(a){return this.ng('Month',a)}uv(a){return this.ng('FullYear',a)}ty(){let a=this.xb.getDay();a=0===a?6:a-1;return new olympe.D.jb(new Date(this.xb.getFullYear(),this.xb.getMonth(),this.xb.getDate()-a))}uy(){return new olympe.D.jb(new Date(this.xb.getFullYear(),this.xb.getMonth()))}Td(a){return olympe.D.Fa([a],
300
- b=>olympe.D.Ac(this.qb(b)),olympe.D.qa)}qb(a){return a instanceof olympe.D.jb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Fw(){let a=this.xb.getDay();0===a&&(a=7);return olympe.D.ya(a)}uw(a,b){return olympe.D.Fa([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.xb.getFullYear()-c.xb.getFullYear():'months'===d?c=12*(this.xb.getFullYear()-c.xb.getFullYear())+(this.xb.getMonth()-c.xb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
301
- void 0===d&&(olympe.pa.Xa('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.xb.getTime()-c.xb.getTime())/d));return olympe.D.ya(c)},olympe.D.ea)}qx(a){return olympe.D.Fa([a],b=>olympe.D.Ac(this.getTime()<b.getTime()),olympe.D.qa)}ox(a){return olympe.D.Fa([a],b=>olympe.D.Ac(this.getTime()>b.getTime()),olympe.D.qa)}rx(a,b){return olympe.D.Fa([a,b],(c,d)=>olympe.D.Ac(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.qa)}valueOf(){return this.pj().valueOf()?
302
- new Date(this.getTime()):new Date(0)}};olympe.D.jb.C=sb(0);olympe.D.jb.F=sb(Number.NaN);m=olympe.D.jb.prototype;m.pj.K=olympe.D.J.V;m.Ct.K=olympe.D.J.G;m.Et.K=olympe.D.J.G;m.Dt.K=olympe.D.J.G;m.Bt.K=olympe.D.J.G;m.qw.K=olympe.D.J.G;m.getMonth.K=olympe.D.J.G;m.Ft.K=olympe.D.J.G;m.getTime.K=olympe.D.J.C;m.sy.K=new olympe.D.J(()=>olympe.D.Wa,[0]);m.toLocaleString.K=olympe.D.J.F;m.toLocaleDateString.K=olympe.D.J.F;m.toLocaleTimeString.K=olympe.D.J.F;m.hd.K=olympe.D.J.F;m.ss.K=olympe.D.J.C;
303
- m.xy.K=new olympe.D.J(()=>olympe.D.jb,[]);m.zy.K=new olympe.D.J(()=>olympe.D.jb,[]);m.ng.K=new olympe.D.J(()=>olympe.D.jb,[]);m.mv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.rv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.nv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.kv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Jm.K=new olympe.D.J(()=>olympe.D.jb,[0]);m.tv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.ov.K=new olympe.D.J(()=>olympe.D.jb,[]);m.uv.K=new olympe.D.J(()=>olympe.D.jb,[0]);
304
- m.ty.K=new olympe.D.J(()=>olympe.D.jb,[]);m.uy.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Td.K=olympe.D.J.V;m.qb.K=olympe.D.J.C;m.Fw.K=olympe.D.J.G;m.uw.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.qx.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.ox.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.rx.K=new olympe.D.J(()=>olympe.D.qa,[0,1]);m.valueOf.K=olympe.D.J.C;const tb=new Map,ub=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,vb=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function wb(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=vb.exec(c)):(d=1,c=ub.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.Uf(a)?olympe.D.ie([a],b,olympe.D.Color):b(a)}
305
- olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.ya(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.ya(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.ya(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.ya(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 kc(a){let b;'string'===typeof a?b=
298
+ olympe.D.Wa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.Bb(this.xb.toLocaleTimeString(a)):olympe.D.Fa([this,a],(b,c)=>olympe.D.Bb(b.xb.toLocaleTimeString(c.valueOf())),olympe.D.Wa)}hd(){return olympe.D.Bb(this.xb.toISOString())}ms(){return new Date(this.getTime())}Cy(){return this}Ey(){return this}lg(a,b){return olympe.D.Fa([b],c=>{const d=new olympe.D.jb(new Date(this.xb.getTime()));d.xb['set'+a](this.xb['get'+a]()+c.valueOf());return d},olympe.D.jb)}hv(a){return this.lg('Milliseconds',
299
+ a)}ov(a){return this.lg('Seconds',a)}jv(a){return this.lg('Minutes',a)}gv(a){return this.lg('Hours',a)}Em(a){return this.lg('Date',a)}pv(a){return'number'===typeof a?this.Em(7*a):this.Em(a.Zk(7))}kv(a){return this.lg('Month',a)}qv(a){return this.lg('FullYear',a)}yy(){let a=this.xb.getDay();a=0===a?6:a-1;return new olympe.D.jb(new Date(this.xb.getFullYear(),this.xb.getMonth(),this.xb.getDate()-a))}zy(){return new olympe.D.jb(new Date(this.xb.getFullYear(),this.xb.getMonth()))}Td(a){return olympe.D.Fa([a],
300
+ b=>olympe.D.Ac(this.qb(b)),olympe.D.qa)}qb(a){return a instanceof olympe.D.jb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Cw(){let a=this.xb.getDay();0===a&&(a=7);return olympe.D.ya(a)}rw(a,b){return olympe.D.Fa([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.xb.getFullYear()-c.xb.getFullYear():'months'===d?c=12*(this.xb.getFullYear()-c.xb.getFullYear())+(this.xb.getMonth()-c.xb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
301
+ void 0===d&&(olympe.pa.Xa('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.xb.getTime()-c.xb.getTime())/d));return olympe.D.ya(c)},olympe.D.ea)}qx(a){return olympe.D.Fa([a],b=>olympe.D.Ac(this.getTime()<b.getTime()),olympe.D.qa)}ox(a){return olympe.D.Fa([a],b=>olympe.D.Ac(this.getTime()>b.getTime()),olympe.D.qa)}sx(a,b){return olympe.D.Fa([a,b],(c,d)=>olympe.D.Ac(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.qa)}valueOf(){return this.nj().valueOf()?
302
+ new Date(this.getTime()):new Date(0)}};olympe.D.jb.C=sb(0);olympe.D.jb.F=sb(Number.NaN);m=olympe.D.jb.prototype;m.nj.K=olympe.D.J.U;m.zt.K=olympe.D.J.G;m.Bt.K=olympe.D.J.G;m.At.K=olympe.D.J.G;m.yt.K=olympe.D.J.G;m.nw.K=olympe.D.J.G;m.getMonth.K=olympe.D.J.G;m.Ct.K=olympe.D.J.G;m.getTime.K=olympe.D.J.C;m.xy.K=new olympe.D.J(()=>olympe.D.Wa,[0]);m.toLocaleString.K=olympe.D.J.F;m.toLocaleDateString.K=olympe.D.J.F;m.toLocaleTimeString.K=olympe.D.J.F;m.hd.K=olympe.D.J.F;m.ms.K=olympe.D.J.C;
303
+ m.Cy.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Ey.K=new olympe.D.J(()=>olympe.D.jb,[]);m.lg.K=new olympe.D.J(()=>olympe.D.jb,[]);m.hv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.ov.K=new olympe.D.J(()=>olympe.D.jb,[]);m.jv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.gv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Em.K=new olympe.D.J(()=>olympe.D.jb,[0]);m.pv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.kv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.qv.K=new olympe.D.J(()=>olympe.D.jb,[0]);
304
+ m.yy.K=new olympe.D.J(()=>olympe.D.jb,[]);m.zy.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Td.K=olympe.D.J.U;m.qb.K=olympe.D.J.C;m.Cw.K=olympe.D.J.G;m.rw.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.qx.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.ox.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.sx.K=new olympe.D.J(()=>olympe.D.qa,[0,1]);m.valueOf.K=olympe.D.J.C;const tb=new Map,ub=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,vb=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function wb(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=vb.exec(c)):(d=1,c=ub.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.Uf(a)?olympe.D.he([a],b,olympe.D.Color):b(a)}
305
+ olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.ya(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.ya(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.ya(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.ya(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 mc(a){let b;'string'===typeof a?b=
306
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.Fa([a,b,c,d],(e,f,g,h)=>{e=olympe.D.ya(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.D.ya(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.D.ya(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.D.ya(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of tb.values())if(k&&k.C.qb(e)&&k.F.qb(f)&&k.b.qb(g)&&k.a.qb(h))return k;
307
- return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}Of(){return this.C}Df(){return this.b}If(){return this.F}Cf(){return this.a}Dv(a,b){return olympe.D.Color.create(this.C.qj(a.Of(),b),this.F.qj(a.If(),b),this.b.qj(a.Df(),b),this.a.qj(a.Cf(),b))}Yv(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}us(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}Jn(){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.Jn()}qb(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.qb;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.Jn;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.us;olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.Cf;
309
- olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.If;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.Df;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.Of;olympe.D.Color.create=olympe.D.Color.create;m=olympe.D.Color.prototype;m.toJSON.K=olympe.D.J.C;m.Of.K=olympe.D.J.G;m.Df.K=olympe.D.J.G;m.If.K=olympe.D.J.G;m.Cf.K=olympe.D.J.G;m.Dv.K=new olympe.D.J(()=>olympe.D.Color,[]);m.Yv.K=new olympe.D.J(()=>olympe.D.Color,[]);m.us.K=new olympe.D.J(()=>String,[]);
310
- m.Jn.K=new olympe.D.J(()=>String,[]);m.qb.K=olympe.D.J.C;olympe.D.File=class{ma(){}Cp(){}Ul(){}jn(){}Sk(){}cn(){}Tk(){}rename(){}};olympe.D.jc=class{constructor(a,b){this.x=olympe.D.ge(a);this.y=olympe.D.ge(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.Ya(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.Ya(this.y).valueOf())+' }'}static kc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.jc(b.x,b.y)}kx(){return this.x}qy(a){pb(this.x,a)}lx(){return this.y}ry(a){pb(this.y,a)}ax(){return this.x.ks(this.y)}he(a){return olympe.D.Fa([this,a],(b,c)=>new olympe.D.jc(b.x.he(c.x),b.y.he(c.y)),
311
- olympe.D.jc,'Vector2.plus')}xh(a){return olympe.D.Fa([this,a],(b,c)=>new olympe.D.jc(b.x.xh(c.x),b.y.xh(c.y)),olympe.D.jc,'Vector2.minus')}Ex(a){return new olympe.D.jc(this.x.cl(a),this.y.cl(a))}Tv(a){return new olympe.D.jc(this.x.$i(a),this.y.$i(a))}Hx(){return new olympe.D.jc(this.x.Bj(),this.y.Bj())}Uv(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Fa([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.ya(d*f+e*g),olympe.D.ea),olympe.D.ea)}length(){return olympe.D.Fa([this.x,this.y],(a,b)=>olympe.D.ya(Math.sqrt(a*
312
- a+b*b)),olympe.D.ea)}normalize(){return olympe.D.Fa([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.jc(a/c,b/c)},olympe.D.jc)}floor(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.jc(Math.floor(a),Math.floor(b)),olympe.D.jc)}ceil(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.jc(Math.ceil(a),Math.ceil(b)),olympe.D.jc)}round(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.jc(Math.round(a),Math.round(b)),olympe.D.jc)}pv(a){return new olympe.D.jc(this.x.he(a),
313
- this.y.he(a))}qv(a,b){return new olympe.D.jc(this.x.he(a),this.y.he(b))}hd(){return olympe.D.Fa([this.x,this.y],(a,b)=>olympe.D.Bb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Wa)}toString(){return`Vector2[${this.x.Ma.Ib}, ${this.y.Ma.Ib}]`}qb(a){return this===a?!0:!1}};m=olympe.D.jc.prototype;m.toJSON.K=olympe.D.J.C;m.kx.K=olympe.D.J.G;m.qy.K=olympe.D.J.C;m.lx.K=olympe.D.J.G;m.ry.K=olympe.D.J.C;m.ax.K=olympe.D.J.G;m.he.K=new olympe.D.J(()=>olympe.D.jc,[0]);
314
- m.xh.K=new olympe.D.J(()=>olympe.D.jc,[0]);m.Ex.K=olympe.D.J.Z;m.Tv.K=olympe.D.J.Z;m.Hx.K=olympe.D.J.Z;m.Uv.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.length.K=olympe.D.J.G;m.normalize.K=olympe.D.J.Z;m.floor.K=olympe.D.J.Z;m.ceil.K=olympe.D.J.Z;m.round.K=olympe.D.J.Z;m.pv.K=olympe.D.J.Z;m.qv.K=olympe.D.J.Z;m.hd.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.qb.K=olympe.D.J.C;olympe.D.Qg=class{constructor(){}Yb(){}Gd(){}get(){}mh(){}has(){}Fg(){}Oc(){}Gf(){}mf(){}Bg(){}forEach(){}de(){}};olympe.D.Qg.prototype.forEachCurrentValue=olympe.D.Qg.prototype.de;olympe.D.Qg.prototype.forEach=olympe.D.Qg.prototype.forEach;m=olympe.D.Qg.prototype;m.has.K=olympe.D.J.V;m.Fg.K=olympe.D.J.C;m.Oc.K=new olympe.D.J(()=>Object,[]);m.Gf.K=new olympe.D.J(()=>String,[]);m.mf.K=olympe.D.J.G;m.Bg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.de.K=olympe.D.J.C;olympe.D.nd=class extends olympe.D.Qg{constructor(){super()}fe(){}Ff(){}Ye(){}Ef(){}re(){}Xe(){}cj(){}fi(){}};olympe.D.nd.prototype.getCurrentAt=olympe.D.nd.prototype.Xe;olympe.D.nd.prototype.getAt=olympe.D.nd.prototype.re;olympe.D.nd.prototype.getCurrentKeyAt=olympe.D.nd.prototype.Ef;olympe.D.nd.prototype.getKeyAt=olympe.D.nd.prototype.Ye;olympe.D.nd.prototype.getCurrentRank=olympe.D.nd.prototype.Ff;olympe.D.nd.prototype.getRank=olympe.D.nd.prototype.fe;m=olympe.D.nd.prototype;m.fe.K=olympe.D.J.G;
315
- m.Ff.K=olympe.D.J.C;m.Ye.K=new olympe.D.J(()=>String,[]);m.Ef.K=olympe.D.J.C;m.re.K=new olympe.D.J(()=>Object,[]);m.Xe.K=olympe.D.J.C;m.cj.K=olympe.D.J.C;m.fi.K=new olympe.D.J(()=>Array,[]);olympe.D.ri=class{constructor(a,b){this.V=b||olympe.D.Ia();this.valueType=a||Object;this.values={};this.Ab=this.Sa=null;this.Xf=0;this.aa=Object.create(null);this.Xb=Object.create(null);this.size=0;this.N=null;this.V.onDestroy(()=>{const c=this.aa;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,l=0;l<k;l++)g[h[l]].destroy()}}})}Hh(){return this.V}Yb(){return this.valueType}Gd(a){this.valueType=a;const b=this.Sa;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
316
- c)&&kb(b[c],a)}get(a){const b=c=>{null===this.Sa&&(this.Sa={});return this.gj(this.Sa,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.Fa([a],c=>b(c),this.valueType)}mh(a){a=this.values[a];return olympe.D.lb(a)?Wa(a.Ma)?a.Ma.Ib:void 0:a}has(a){const b=c=>{null===this.Ab&&(this.Ab={});return this.gj(this.Ab,c,c in this.values?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa,'Map.has('+c+')')};return olympe.D.Fa([a],c=>b(c),olympe.D.qa)}Fg(a){return a in this.values}gj(a,b,c,d,e){let f=a[b];
317
- f||this.V.run(()=>{f=olympe.D.Md(d,void 0,e);a[b]=f;f.Ma.onDestroy(()=>delete a[b]);olympe.D.lb(c)?ob(f,c):lb(f,c)});return f}Oc(){throw Error('Abstract method getFirstKey needs to be overridden');}Gf(){throw Error('Abstract method getFirstKey needs to be overridden');}mf(){null===this.N&&this.V.run(()=>{this.N=olympe.D.Md(olympe.D.ea,olympe.D.ya(this.size));this.N.Ma.onDestroy(()=>{this.N=null})});return this.N}Bg(){return this.size}forEach(a,b){const c=this.Fm();a=this.yr(c,a,b);this.Em(c,a)}Fm(){return String(++this.Xf)}Em(a,
318
- b){this.Xb[a]=b;olympe.D.Ia().vc(()=>{const c=this.aa;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Xb[a]});this.de(b)}yr(a,b,c){const d=olympe.D.Ia();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.Im(a,f,g)})}}Im(a,b,c){void 0===this.aa[b]&&(this.aa[b]={});this.aa[b][a]=c}de(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&
319
- !1===a(b[c],c,this))break}Jk(a,b){void 0!==this.values[a]&&this.Ui(a,!0);this.values[a]=b;var c=this.Sa;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?ob(c[a],b):lb(c[a],b));c=this.Ab;null!==c&&void 0!==c[a]&&pb(c[a],!0);this.size++;c=this.Xb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Ui(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.xf?d.Ma.Ib:d;var e=this.Sa;null!==e&&void 0!==e[a]&&mb(e[a]);e=this.Ab;null!==e&&
320
- void 0!==e[a]&&pb(e[a],!1);delete c[a];this.size--;b||this.yf()}a=this.aa[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}yf(){null!==this.N&&pb(this.N,this.size)}Xh(){var a=this.Sa;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&mb(a[c]);a=this.Ab;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&pb(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];
321
- for(const c in this.aa)if(Object.prototype.hasOwnProperty.call(this.aa,c)){b=this.aa[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.N&&pb(this.N,this.size)}Vg(){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.ri.la=[olympe.D.Qg];m=olympe.D.ri.prototype;m.Hh.K=olympe.D.J.C;m.Yb.K=olympe.D.J.C;m.Gd.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>Object,[],'valueType');
322
- m.mh.K=olympe.D.J.C;m.has.K=olympe.D.J.V;m.Fg.K=olympe.D.J.C;m.gj.K=olympe.D.J.C;m.mf.K=olympe.D.J.G;m.Bg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.Fm.K=olympe.D.J.C;m.Em.K=olympe.D.J.C;m.yr.K=olympe.D.J.C;m.Im.K=olympe.D.J.C;m.de.K=olympe.D.J.C;m.Jk.K=olympe.D.J.C;m.Ui.K=olympe.D.J.C;m.yf.K=olympe.D.J.C;m.Xh.K=olympe.D.J.C;m.Vg.K=olympe.D.J.C;olympe.D.Fj=class extends olympe.D.ri{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.Da=this.ab=this.bb=this.ra=null}Gd(a){super.Gd(a);if(null!==this.Da)for(let b of this.Da.values())kb(b,a)}Oc(){return this.re(0)}Gf(){return this.Ye(0)}fe(a){const b=c=>{null===this.bb&&(this.bb=Object.create(null));let d=this.Ff(a);d=void 0!==d?olympe.D.ya(d):void 0;return this.gj(this.bb,c,d,olympe.D.ea,`List.getRank(${c})`)};return olympe.D.lb(a)?L(olympe.D.createNode(olympe.D.ea,b,null,
323
- [a.Ma],[0],'onResolved('+(b.name||'')+')')):b(a)}Ff(a){return this.F[a]}Ye(a){const b=c=>{const d=c.valueOf(),e=this.Ef(d);null===this.ab&&(this.ab=Object.create(null));return this.gj(this.ab,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.Fa([a],c=>b(c),String)}Ef(a){return this.C[a.valueOf()]}re(a){if(olympe.D.lb(a))return this.get(olympe.D.Fa([a],c=>{c=this.Ye(c);if(!Wa(c.Ma)){const d=olympe.D.Ia();olympe.D.Tf(d)&&fb(d)}return c},String));null===this.Da&&(this.Da=new Map);let b=this.Da.get(a);
324
- b||this.V.run(()=>{b=this.get(this.Ye(a));this.Da.set(a,b);b.Ma.onDestroy(()=>this.Da.delete(a))});return b}Xe(a){return this.mh(this.Ef(a))}cj(a,b,c,d){let e=this.Fm();a=this.cs(e,a,b,c,d);this.Em(e,a)}cs(a,b,c,d,e){return olympe.D.Ia().Cb((f,g)=>{let h=!1,k=olympe.D.ef([b,c,this.fe(g)],(l,n,p)=>{p>=l&&p<l+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.Im(a,g,k)})}fi(){null===this.ra&&this.V.run(()=>{this.ra=olympe.D.Md(Array,this.C.filter(a=>void 0!==a));
325
- this.ra.Ma.onDestroy(()=>{this.N=null})});return this.ra}de(a){if(this.C.length!==this.size)super.de(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}}Hm(a,b){const c=this.bb,d=this.ab,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]&&mb(c[g]),void 0!==
326
- c[a]&&lb(c[a],olympe.D.ya(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&mb(d[e]),void 0!==d[b]&&lb(d[b],a))}}Gm(a){var b=this.ab,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ma.Ib===a&&mb(b));delete this.F[a];this.C.splice(c,1);c=this.bb;null!==c&&void 0!==c[a]&&mb(c[a])}zr(){if(null!==this.ra){const a=this.C,b=this.ra.Ma.Ib;b&&a.join(',')!==b.join(',')&&lb(this.ra,a)}}yf(){this.zr();super.yf()}Xh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.bb;if(null!==
327
- a)for(b in a)mb(a[b]);a=this.ab;if(null!==a)for(b in a)mb(a[parseInt(b,10)]);var b=this.ra;null!==b&&(db(b.Ma),lb(b,this.C));return olympe.D.ri.prototype.Xh.call(this)}Vg(){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.Fj.la=[olympe.D.nd];m=olympe.D.Fj.prototype;m.Gd.K=olympe.D.J.C;m.Oc.K=new olympe.D.J(()=>Object,[]);m.Gf.K=new olympe.D.J(()=>String,[]);m.fe.K=olympe.D.J.G;m.Ff.K=olympe.D.J.C;
328
- m.Ye.K=new olympe.D.J(()=>String,[]);m.Ef.K=olympe.D.J.C;m.re.K=new olympe.D.J(()=>Object,[]);m.Xe.K=olympe.D.J.C;m.cj.K=new olympe.D.J(()=>{},[]);m.cs.K=olympe.D.J.C;m.fi.K=new olympe.D.J(()=>Array,[]);m.de.K=olympe.D.J.C;m.Hm.K=olympe.D.J.C;m.Gm.K=olympe.D.J.C;m.zr.K=olympe.D.J.C;m.yf.K=olympe.D.J.C;m.Xh.K=olympe.D.J.C;m.Vg.K=olympe.D.J.C;olympe.D.Map=class extends olympe.D.ri{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}Gd(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&kb(this.F,a);super.Gd(a)}Oc(){null===this.F&&this.Um();return this.F}Gf(){null===this.C&&this.Um();return this.C}Um(){this.Hh().run(()=>{this.F=olympe.D.Md(this.Yb());this.C=olympe.D.Md(String);this.yj(this.Zm())})}Zm(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}yj(a){if(void 0!==
329
- a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?ob(this.F,b):lb(this.F,b);lb(this.C,a)}else void 0!==this.F.Ma.Ib&&(mb(this.F),mb(this.C))}set(a,b){this.Jk(a,b);1===this.size&&null!==this.C&&this.yj(a);this.yf()}remove(a){const b=this.Ui(a);null!==this.C&&this.C.Ma.Ib===a&&this.yj(this.Zm());return b}clear(){this.Xh();null!==this.C&&this.yj(void 0)}};m=olympe.D.Map.prototype;m.Gd.K=olympe.D.J.C;m.Oc.K=new olympe.D.J(()=>Object,[]);m.Gf.K=new olympe.D.J(()=>String,[]);m.Um.K=olympe.D.J.C;
330
- m.Zm.K=olympe.D.J.C;m.yj.K=olympe.D.J.C;m.set.K=olympe.D.J.C;m.remove.K=new olympe.D.J(()=>Object,[]);m.clear.K=olympe.D.J.C;olympe.D.Wg=class extends olympe.D.Fj{constructor(a){super(a)}set(a,b,c){this.Jk(a,b);void 0!==c&&olympe.D.wc([c],d=>{this.Hm(a,d)});this.yf()}remove(a){this.Gm(a);return this.Ui(a)}clear(){this.Xh()}};olympe.D.Wg.prototype.remove.K=olympe.D.J.C;olympe.D.Wg.prototype.clear.K=olympe.D.J.C;olympe.D.As=class extends olympe.D.Vj{constructor(a,b){super(olympe.D.ea,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.ea.Eo.Lp}Eb(){return olympe.D.Lx(this.node,this.duration,this.C,void 0)}};let xb=null;olympe.D.L=void 0;olympe.D.En=void 0;olympe.D.ai=void 0;olympe.D.Wh=new Map;olympe.D.Wh.set(0,olympe.D.ea.ZERO);olympe.D.Wh.set(1,olympe.D.ea.ONE);olympe.D.Wh.set(2,olympe.D.ea.av);olympe.D.Ik=new Map;olympe.D.Ik.set('',olympe.D.Wa.EMPTY);olympe.D.Ik.set(' ',olympe.D.Wa.Ou);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,Bd:b,Yf:c,pn:d,debug:g,wg:e,zd:f,Wi:h})};olympe.D.Tf=function(a){return!!(a&&a instanceof olympe.D.Node)};
331
- olympe.D.Md=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Tf(b)?gb(a,b):olympe.D.lb(b)?gb(a,b.Ma):K(a,b);return L(a)};olympe.D.lb=function(a){return!(!a||!a.xf)};olympe.D.Uf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.xf))};olympe.D.un=function(a){return olympe.D.Tf(a)||a instanceof olympe.D.Wb||a instanceof olympe.D.Iq};olympe.D.ii=function(a){return a instanceof olympe.D.Vj};
332
- olympe.D.fl=function(a,b){if(void 0!==a){olympe.D.ii(a)&&(a=a.Eb().Ma);if(!olympe.D.Uf(a))return b(a);var c=[];olympe.D.lb(a)?c.push(a.Ma):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.Ya=function(a,b){let c=a;olympe.D.lb(a)?c=a.Ma.Ib:olympe.D.Tf(a)?c=a.Ib:olympe.D.ii(a)&&(c=a.Eb().Ma.Ib);return void 0===c?b:c};
333
- olympe.D.df=function(a,b){let c;olympe.D.lb(a)?c=a.Ma:olympe.D.Tf(a)?c=a:olympe.D.ii(a)&&(c=a.Eb().Ma);c&&olympe.D.wc([b],d=>{c.df(d)},'setDefaultValue');return a};olympe.D.ef=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.wr?(h=h.Ma,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.ii(h)&&(h=h.Eb().Ma,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
334
- olympe.D.ie=function(a,b,c,d){return L(olympe.D.ef(a,b,c,d||'syncProxies'))};const yb=a=>{for(const b of a)if(olympe.D.Uf(b)||olympe.D.ii(b))return!1;return!0};olympe.D.Fa=function(a,b,c,d,e){if(yb(a))return b(...a);const f=olympe.D.ef(a,b,c,d||'TransformFlows');e&&olympe.D.wc([e],g=>{f.df(g)},'setDefaultValue');return L(f)};olympe.D.wc=function(a,b,c){yb(a)?b(...a):olympe.D.ef(a,b,void 0,c||'processFlows')};
335
- olympe.D.hs=function(a,b){if(yb(a))b(...a);else{const c=olympe.D.Ia();olympe.D.ef(a,(...d)=>{olympe.D.Ia().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};olympe.D.Dn=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.lb(g)?(g=g.Ma,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.ii(g)&&(g=g.Eb().Ma,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({Bd:b,pn:e,wg:f,ay:!1,zd:c})};
336
- olympe.D.YC=function(a,b,c){const d=olympe.D.Ia();olympe.D.Dn(a,(...e)=>{olympe.D.Ia().destroy();d.run(b,...e)},c||'processFutureFlowsOnce')};olympe.D.yC=function(a,b,c){a=new olympe.D.Vj(a,c);b(a);return a.Eb()};olympe.D.Kc=function(a,b='flowSource'){return new olympe.D.Vj(a,b)};olympe.D.aD=function(a,b,c,d){const e=olympe.D.Ia();olympe.D.ef(a,(...f)=>{olympe.D.Ia().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};
337
- olympe.D.nn=function(a,b,c){olympe.D.Fa([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.DC=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.fD=function(a){return olympe.D.Ia().Cb(a)};olympe.D.BC=function(a,b,c){olympe.D.Vv(a?a.Ma:a,b,c)};
338
- olympe.D.Vv=function(a,b,c){if(a){var d=a.Y();null===xb&&(xb={});if(xb[d])olympe.D.L.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{xb[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.L.warn(e):olympe.D.L.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.L.log(f,'undefined'):null===g?olympe.D.L.log(f,'null'):olympe.D.L.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.L.log(`Node #${d} destroyed`+(b?`: ${b}`:
339
- ''))});c.onDestroy(()=>{delete xb[d]})}}else olympe.D.L.log('NOT starting node dump, node is '+String(a))};olympe.D.AC=function(){let a='',b=olympe.D.Ia();for(;null!==b;)a+=b.Uk()+' --\x3e ',b=b.getParent();olympe.D.L.log(a)};
340
- olympe.D.ya=function(a){if(void 0===a)return olympe.D.ea.ZERO;if(a instanceof olympe.D.ea)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.ea.Up;if(a===Math.PI)return olympe.D.ea.PI;if(Infinity===a)return olympe.D.ea.vt;if(-Infinity===a)return olympe.D.ea.hu;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.Wh.has(a)||olympe.D.Wh.set(a,new olympe.D.ea(a)),olympe.D.Wh.get(a)):new olympe.D.ea(a)}return null};
341
- olympe.D.ge=function(a){return void 0===a?olympe.D.Md(olympe.D.ea):olympe.D.Md(olympe.D.ea,olympe.D.Uf(a)?a:olympe.D.ya(a))};olympe.D.Lx=olympe.D.ea.animate;olympe.D.SC=function(a,b){return new olympe.D.As(a,b)};olympe.D.Bb=function(a){if(a instanceof olympe.D.Wa)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.Ik.has(a)?olympe.D.Ik.get(a):new olympe.D.Wa(a)};
342
- olympe.D.VC=function(a){return void 0===a?olympe.D.Md(olympe.D.Wa):olympe.D.Md(olympe.D.Wa,olympe.D.Uf(a)?a:olympe.D.Bb(a))};olympe.D.Ac=function(a){return a instanceof olympe.D.qa?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.qa.F:olympe.D.qa.C};olympe.D.Xx=function(a){return void 0===a?olympe.D.Md(olympe.D.qa):olympe.D.Md(olympe.D.qa,olympe.D.Uf(a)?a:olympe.D.Ac(a))};olympe.D.Mx=function(a){if(a instanceof Date)return new olympe.D.jb(a)};
343
- olympe.D.UC=function(a){return olympe.D.Md(olympe.D.jb,void 0!==a?new olympe.D.jb(a):null)};olympe.D.bs=a=>a instanceof olympe.D.qa||a instanceof olympe.D.ea||a instanceof olympe.D.Wa||a instanceof olympe.D.jb;olympe.D.WC=function(a,b){return olympe.D.Md(olympe.D.jc,void 0===a&&void 0===b?void 0:new olympe.D.jc(a,b))};olympe.D.Wx=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.Md(olympe.D.Color,e)};olympe.D.TC=olympe.D.Wx;
344
- olympe.D.Lv=function(a){olympe.D.L=a;olympe.D.ai=olympe.D.oh()};olympe.D.oh=function(){olympe.D.En||(olympe.D.En=new olympe.D.Iq);return olympe.D.En};olympe.D.Ia=function(){olympe.D.ai||(olympe.D.ai=olympe.D.oh());return olympe.D.ai};olympe.D.ms=function(a){const b=olympe.D.ai;olympe.D.un(a)&&(olympe.D.ai=a);return b||null};
345
- olympe.D.kc=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.jb.kc(a);break;case 'number':b=olympe.D.ea.kc(a);break;case 'string':b=olympe.D.Wa.kc(a);break;case 'vector2':b=olympe.D.jc.kc(a);break;case 'color':b=olympe.D.Color.kc(a);break;case 'boolean':b=olympe.D.qa.kc(a)}return b}return null};function zb(a){a.C.yb()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.V.clear(),a.Z.length=0,a.N.length=0)}
346
- olympe.D.$A=class{constructor(){this.C=new olympe.D.Wb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.Kc(Ab,'Last slot manager entry');this.size=qb(olympe.D.Kc(olympe.D.ea,'SlotManager size').repeat(this.F.Eb().en()),olympe.D.ea.ZERO);this.V=qb(olympe.D.Kc(olympe.D.ea,'last valid slots'),olympe.D.ya(-1))});this.Z=[];this.N=[];this.C.onDestroy(()=>{zb(this)})}};
347
- class Ab{constructor(a,b,c,d){this.id=a;this.tc=new olympe.D.Wb('Slot manager entry');this.G=c;this.N=d;this.tc.run(()=>{const e=qb(olympe.D.Kc(olympe.D.ea),olympe.D.ea.ZERO);olympe.D.lb(b)?e.repeat(b):e.update(b);this.C=olympe.D.Kc(olympe.D.ea);this.F=this.C.Eb().he(e.Eb())});this.next=null}Y(){return this.id}ex(){return this.C.Eb()}en(){return this.F}fe(){return this.G}px(){return this.N}By(a){this.G=a}ly(a){null===a?this.C.update(olympe.D.ea.ZERO):(this.C.repeat(a.en()),a.next=this)}Gt(){this.C.clear();
348
- this.next=null}destroy(){this.tc.destroy();this.F=this.C=this.next=null}}m=Ab.prototype;m.Y.K=olympe.D.J.C;m.ex.K=new olympe.D.J(()=>olympe.D.ea);m.en.K=new olympe.D.J(()=>olympe.D.ea);m.fe.K=olympe.D.J.C;m.px.K=olympe.D.J.C;m.By.K=olympe.D.J.C;m.ly.K=olympe.D.J.C;m.Gt.K=olympe.D.J.C;m.destroy.K=olympe.D.J.C;olympe.D.O={Ea:'df.Logger'};olympe.T.config(a=>{E(a,olympe.D.Config.Vp,Number.POSITIVE_INFINITY);C(a,olympe.D.O.Ea,[olympe.pa.O.va],b=>b.Nc('df'))},'olympe.df');olympe.T.run([olympe.D.O.Ea],a=>{olympe.D.Lv(a)},'olympe.df');olympe.host={};const Bb=new Map,Cb=new Map;olympe.host.Zp=class{static register(a,b,...c){Bb.set(a,b);0<c.length&&Cb.set(a,c)}static create(a,b,c,d){const e=Bb.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=Cb.get(a);return void 0!==a?new e(b,c,...a.map(f=>ma(d,f))):new e(b,c)}};function Db(a,b,c){a.L.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.Zp.create(c,b,a.L,a.N))}function Eb(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.L.N()<=olympe.pa.Ob.C.eg&&a.L.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.lb(f))b.push(a.C.get(f.hv)||null);else if('function'===typeof f){const g=f,h=olympe.D.Ia();b.push((...k)=>{h.yb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
349
- function Fb(a){var b=olympe.host.da.ad,c=olympe.host.da.Yp.rr;++a.G;const d=a.G;Db(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],l=d+'_'+k;this.F.has(l)&&this.F.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.D.lb(p)?(h.push(n),p=p.Ma):olympe.D.Tf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{Eb(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
350
- {Eb(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(l,f),f.onDestroy(()=>this.F.delete(l)));return null}.bind(a));e.vc(a.V.bind(a,d));a=L(e);a.hv=d;K(e,a);return a}olympe.host.sa=class{constructor(a,b){this.L=a;this.N=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}Xa(){return this.L}V(a){this.L.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.Hd=class{constructor(a){this.C=a;this.F=olympe.D.Ia()}G(){return this.C}gd(){return this.C.Ma.gd()||this.F.gd()}yb(){return this.C.Ma.yb()}};olympe.host.Hd.prototype.G.K=new olympe.D.J(()=>olympe.host.da.Hd,[]);olympe.host.yk=class{};olympe.host.Fi=class{constructor(){}C(){}F(){}pj(){}};function Gb(a){return(a=a.find(b=>'authToken'===b.ma()))?a.getValue():null}olympe.host.Fi.F=class{constructor(a,b,c=!1){this.name=a;this.value=b;this.C=c}ma(){return this.name}getValue(){return this.value}qb(a){return this.ma()===a.ma()&&this.getValue()===a.getValue()&&this.C===a.C}};function Hb(){const a={}.parameters;return new olympe.host.Fi.C(a?a.map(b=>new olympe.host.Fi.F(b.name,b.value,b.hidden)):[])}
351
- olympe.host.Fi.C=class{constructor(a){this.parameters=a}zn(a){const b=new Map(this.parameters.map((c,d)=>[c.ma(),d]));a.parameters.forEach(c=>{b.has(c.ma())?this.parameters[b.get(c.ma())]=c:this.parameters.push(c)})}};function Ib(a,b){var c=olympe.host.cf;const d=olympe.W.lc(),e=new olympe.D.Wb('onTimeout context');c.C.aa(b,d,()=>{e.yb()||e.gd()||e.run(a);c.C.G(d)});return new olympe.host.ad.G(c.C,d)}function Jb(a,b){var c=olympe.host.cf;const d=olympe.W.lc(),e=new olympe.D.Wb('onInterval context');c.C.Z(b,d,()=>{e.yb()||e.gd()?c.C.F(d):e.run(a)});return new olympe.host.ad.F(c.C,d)}function Kb(a){var b=olympe.host.cf;a=a instanceof olympe.host.ad.F?a.Y():a;b.C.F(a)}olympe.host.ad=class{constructor(a){this.C=Fb(a)}};
352
- olympe.host.ad.C=class{constructor(a,b){this.cf=a;this.id=b}Y(){return this.id}cancel(){}};olympe.host.ad.N=class extends olympe.host.ad.C{cancel(){this.cf.V(this.id)}};olympe.host.ad.G=class extends olympe.host.ad.C{cancel(){this.cf.G(this.id)}};olympe.host.ad.F=class extends olympe.host.ad.C{cancel(){this.cf.F(this.id)}};olympe.host.da={};olympe.host.da.Hd=class{destroy(){}};olympe.host.da.Hd.prototype.destroy=olympe.host.da.Hd.prototype.destroy;olympe.host.da.Yp={Jy:100,Ly:101,Ky:102,Ny:103,My:104,Iy:105,NA:201,LA:202,IA:204,QA:205,HA:206,KA:207,OA:208,RA:209,SA:210,TA:211,JA:212,PA:218,MA:219,UA:220,GA:221,FA:222,cB:300,dB:301,eB:302,iB:303,jB:304,kB:305,fB:310,gB:311,hB:312,nA:400,oA:401,pA:402,jA:450,bA:500,$z:501,eA:502,dA:503,aA:504,cA:505,DB:600,uB:601,yB:602,qB:603,rB:604,oB:605,tB:606,JB:607,BB:608,lB:609,pB:610,sB:611,AB:612,FB:613,mB:614,EB:615,zB:616,IB:617,vB:618,wB:619,xB:620,CB:630,nB:631,GB:632,HB:633,lC:700,PB:701,QB:702,
353
- RB:703,TB:704,UB:705,VB:706,SB:707,XB:708,WB:709,YB:710,bC:711,jC:712,ZB:713,$B:714,cC:715,dC:716,fC:717,gC:718,iC:719,eC:720,hC:721,kC:722,aC:723,mC:724,nC:725,rr:800};olympe.host.da.ad=class{V(){}aa(){}G(){}Z(){}F(){}};olympe.host.O={Wq:'host.System',Ml:'host.HistoryManager',Kq:'host.Scheduler',Ea:'host.platform.Logger',va:'host.Manager'};olympe.host.cf=null;olympe.T.config(function(a){ta(a,olympe.host.O.Wq);ta(a,olympe.host.O.Ml);C(a,olympe.host.O.Ea,[olympe.pa.O.va],function(b){return b.Nc('host')});B(a,olympe.host.O.va,olympe.host.sa,olympe.host.O.Ea,olympe.T.O.dg);C(a,olympe.host.O.Kq,[olympe.host.O.va],b=>{null===olympe.host.cf&&(olympe.host.cf=new olympe.host.ad(b));return olympe.host.cf},!0)},'olympe.host');
354
- olympe.T.run([olympe.host.O.Kq],a=>a,'olympe.host.scheduler');olympe.T.run([olympe.host.O.va],a=>a,'olympe.host');olympe.net={};olympe.net.eb={};olympe.net.eb.ae={mm:'POST',GET:'GET',st:'HEAD',mk:'PUT',Fc:'DELETE',gm:'OPTIONS',rA:'PATCH'};olympe.net.eb.ResponseType={zk:'text',sl:'blob',ARRAY_BUFFER:'arraybuffer'};olympe.net.eb.Headers={Lj:'content-type',Vy:'content-length',si:'authorization',zs:'access-control-allow-origin'};olympe.net.eb.Wy={Sz:'text/html',JSON:'application/json',qC:'application/zip'};olympe.net.eb.od={Gs:0,Lh:200,zl:201,Dj:202,Hy:400,NB:401,it:403,lA:404,fA:405,Lq:500,Mu:503};function Lb(a){return a.host&&encodeURI(a.host)}function Mb(a){return encodeURI(a.path).replace(olympe.net.Gk.C,(b,c)=>'%'+c)}function Nb(a){return void 0===a.G?443===a.port:a.G}olympe.net.Gk=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.G=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.G=d)}C(){return`${Nb(this)?'wss':'ws'}://${Lb(this)}:${this.port}/${Mb(this)}`}toString(){return`${Lb(this)}:${this.port}/${Mb(this)}`}};
355
- olympe.net.Gk.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ka(){}aa(){}V(){}};function Ob(a,b,c,d){a=olympe.W.Zx(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Zj(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.vs&&(c=a.vs.split(':'),2===c.length&&(c=olympe.W.di().C(Da(`${c[0]}:${c[1]}`)),Pb(b,{Authorization:`Basic ${c}`})));return b}function Qb(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}
307
+ return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}Of(){return this.C}Df(){return this.b}If(){return this.F}Cf(){return this.a}Av(a,b){return olympe.D.Color.create(this.C.oj(a.Of(),b),this.F.oj(a.If(),b),this.b.oj(a.Df(),b),this.a.oj(a.Cf(),b))}Vv(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}ps(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}Dn(){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.Dn()}qb(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.qb;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.Dn;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.ps;olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.Cf;
309
+ olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.If;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.Df;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.Of;olympe.D.Color.create=olympe.D.Color.create;m=olympe.D.Color.prototype;m.toJSON.K=olympe.D.J.C;m.Of.K=olympe.D.J.G;m.Df.K=olympe.D.J.G;m.If.K=olympe.D.J.G;m.Cf.K=olympe.D.J.G;m.Av.K=new olympe.D.J(()=>olympe.D.Color,[]);m.Vv.K=new olympe.D.J(()=>olympe.D.Color,[]);m.ps.K=new olympe.D.J(()=>String,[]);
310
+ m.Dn.K=new olympe.D.J(()=>String,[]);m.qb.K=olympe.D.J.C;olympe.D.File=class{ma(){}wp(){}Ql(){}dn(){}Ok(){}Ym(){}Pk(){}rename(){}};olympe.D.lc=class{constructor(a,b){this.x=olympe.D.fe(a);this.y=olympe.D.fe(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.Ya(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.Ya(this.y).valueOf())+' }'}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.lc(b.x,b.y)}kx(){return this.x}vy(a){pb(this.x,a)}lx(){return this.y}wy(a){pb(this.y,a)}Yw(){return this.x.ds(this.y)}ge(a){return olympe.D.Fa([this,a],(b,c)=>new olympe.D.lc(b.x.ge(c.x),b.y.ge(c.y)),
311
+ olympe.D.lc,'Vector2.plus')}vh(a){return olympe.D.Fa([this,a],(b,c)=>new olympe.D.lc(b.x.vh(c.x),b.y.vh(c.y)),olympe.D.lc,'Vector2.minus')}Hx(a){return new olympe.D.lc(this.x.Zk(a),this.y.Zk(a))}Qv(a){return new olympe.D.lc(this.x.Zi(a),this.y.Zi(a))}Kx(){return new olympe.D.lc(this.x.yj(),this.y.yj())}Rv(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Fa([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.ya(d*f+e*g),olympe.D.ea),olympe.D.ea)}length(){return olympe.D.Fa([this.x,this.y],(a,b)=>olympe.D.ya(Math.sqrt(a*
312
+ a+b*b)),olympe.D.ea)}normalize(){return olympe.D.Fa([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.lc(a/c,b/c)},olympe.D.lc)}floor(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.lc(Math.floor(a),Math.floor(b)),olympe.D.lc)}ceil(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.lc(Math.ceil(a),Math.ceil(b)),olympe.D.lc)}round(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.lc(Math.round(a),Math.round(b)),olympe.D.lc)}mv(a){return new olympe.D.lc(this.x.ge(a),
313
+ this.y.ge(a))}nv(a,b){return new olympe.D.lc(this.x.ge(a),this.y.ge(b))}hd(){return olympe.D.Fa([this.x,this.y],(a,b)=>olympe.D.Bb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Wa)}toString(){return`Vector2[${this.x.Ma.Ib}, ${this.y.Ma.Ib}]`}qb(a){return this===a?!0:!1}};m=olympe.D.lc.prototype;m.toJSON.K=olympe.D.J.C;m.kx.K=olympe.D.J.G;m.vy.K=olympe.D.J.C;m.lx.K=olympe.D.J.G;m.wy.K=olympe.D.J.C;m.Yw.K=olympe.D.J.G;m.ge.K=new olympe.D.J(()=>olympe.D.lc,[0]);
314
+ m.vh.K=new olympe.D.J(()=>olympe.D.lc,[0]);m.Hx.K=olympe.D.J.Y;m.Qv.K=olympe.D.J.Y;m.Kx.K=olympe.D.J.Y;m.Rv.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.length.K=olympe.D.J.G;m.normalize.K=olympe.D.J.Y;m.floor.K=olympe.D.J.Y;m.ceil.K=olympe.D.J.Y;m.round.K=olympe.D.J.Y;m.mv.K=olympe.D.J.Y;m.nv.K=olympe.D.J.Y;m.hd.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.qb.K=olympe.D.J.C;olympe.D.Og=class{constructor(){}Yb(){}Gd(){}get(){}kh(){}has(){}Dg(){}Oc(){}Gf(){}kf(){}zg(){}forEach(){}ce(){}};olympe.D.Og.prototype.forEachCurrentValue=olympe.D.Og.prototype.ce;olympe.D.Og.prototype.forEach=olympe.D.Og.prototype.forEach;m=olympe.D.Og.prototype;m.has.K=olympe.D.J.U;m.Dg.K=olympe.D.J.C;m.Oc.K=new olympe.D.J(()=>Object,[]);m.Gf.K=new olympe.D.J(()=>String,[]);m.kf.K=olympe.D.J.G;m.zg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.ce.K=olympe.D.J.C;olympe.D.nd=class extends olympe.D.Og{constructor(){super()}ee(){}Ff(){}We(){}Ef(){}re(){}Ve(){}aj(){}ei(){}};olympe.D.nd.prototype.getCurrentAt=olympe.D.nd.prototype.Ve;olympe.D.nd.prototype.getAt=olympe.D.nd.prototype.re;olympe.D.nd.prototype.getCurrentKeyAt=olympe.D.nd.prototype.Ef;olympe.D.nd.prototype.getKeyAt=olympe.D.nd.prototype.We;olympe.D.nd.prototype.getCurrentRank=olympe.D.nd.prototype.Ff;olympe.D.nd.prototype.getRank=olympe.D.nd.prototype.ee;m=olympe.D.nd.prototype;m.ee.K=olympe.D.J.G;
315
+ m.Ff.K=olympe.D.J.C;m.We.K=new olympe.D.J(()=>String,[]);m.Ef.K=olympe.D.J.C;m.re.K=new olympe.D.J(()=>Object,[]);m.Ve.K=olympe.D.J.C;m.aj.K=olympe.D.J.C;m.ei.K=new olympe.D.J(()=>Array,[]);olympe.D.pi=class{constructor(a,b){this.U=b||olympe.D.Ja();this.valueType=a||Object;this.values={};this.Ab=this.Sa=null;this.Qf=0;this.aa=Object.create(null);this.Xb=Object.create(null);this.size=0;this.N=null;this.U.onDestroy(()=>{const c=this.aa;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,l=0;l<k;l++)g[h[l]].destroy()}}})}Fh(){return this.U}Yb(){return this.valueType}Gd(a){this.valueType=a;const b=this.Sa;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
316
+ c)&&kb(b[c],a)}get(a){const b=c=>{null===this.Sa&&(this.Sa={});return this.ej(this.Sa,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.Fa([a],c=>b(c),this.valueType)}kh(a){a=this.values[a];return olympe.D.lb(a)?Wa(a.Ma)?a.Ma.Ib:void 0:a}has(a){const b=c=>{null===this.Ab&&(this.Ab={});return this.ej(this.Ab,c,c in this.values?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa,'Map.has('+c+')')};return olympe.D.Fa([a],c=>b(c),olympe.D.qa)}Dg(a){return a in this.values}ej(a,b,c,d,e){let f=a[b];
317
+ f||this.U.run(()=>{f=olympe.D.Nd(d,void 0,e);a[b]=f;f.Ma.onDestroy(()=>delete a[b]);olympe.D.lb(c)?ob(f,c):lb(f,c)});return f}Oc(){throw Error('Abstract method getFirstKey needs to be overridden');}Gf(){throw Error('Abstract method getFirstKey needs to be overridden');}kf(){null===this.N&&this.U.run(()=>{this.N=olympe.D.Nd(olympe.D.ea,olympe.D.ya(this.size));this.N.Ma.onDestroy(()=>{this.N=null})});return this.N}zg(){return this.size}forEach(a,b){const c=this.Am();a=this.tr(c,a,b);this.zm(c,a)}Am(){return String(++this.Qf)}zm(a,
318
+ b){this.Xb[a]=b;olympe.D.Ja().vc(()=>{const c=this.aa;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Xb[a]});this.ce(b)}tr(a,b,c){const d=olympe.D.Ja();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.Dm(a,f,g)})}}Dm(a,b,c){void 0===this.aa[b]&&(this.aa[b]={});this.aa[b][a]=c}ce(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&
319
+ !1===a(b[c],c,this))break}Fk(a,b){void 0!==this.values[a]&&this.Ti(a,!0);this.values[a]=b;var c=this.Sa;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?ob(c[a],b):lb(c[a],b));c=this.Ab;null!==c&&void 0!==c[a]&&pb(c[a],!0);this.size++;c=this.Xb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Ti(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.vf?d.Ma.Ib:d;var e=this.Sa;null!==e&&void 0!==e[a]&&mb(e[a]);e=this.Ab;null!==e&&
320
+ void 0!==e[a]&&pb(e[a],!1);delete c[a];this.size--;b||this.wf()}a=this.aa[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}wf(){null!==this.N&&pb(this.N,this.size)}Wh(){var a=this.Sa;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&mb(a[c]);a=this.Ab;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&pb(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];
321
+ for(const c in this.aa)if(Object.prototype.hasOwnProperty.call(this.aa,c)){b=this.aa[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.N&&pb(this.N,this.size)}Tg(){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.pi.la=[olympe.D.Og];m=olympe.D.pi.prototype;m.Fh.K=olympe.D.J.C;m.Yb.K=olympe.D.J.C;m.Gd.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>Object,[],'valueType');
322
+ m.kh.K=olympe.D.J.C;m.has.K=olympe.D.J.U;m.Dg.K=olympe.D.J.C;m.ej.K=olympe.D.J.C;m.kf.K=olympe.D.J.G;m.zg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.Am.K=olympe.D.J.C;m.zm.K=olympe.D.J.C;m.tr.K=olympe.D.J.C;m.Dm.K=olympe.D.J.C;m.ce.K=olympe.D.J.C;m.Fk.K=olympe.D.J.C;m.Ti.K=olympe.D.J.C;m.wf.K=olympe.D.J.C;m.Wh.K=olympe.D.J.C;m.Tg.K=olympe.D.J.C;olympe.D.Cj=class extends olympe.D.pi{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.Da=this.ab=this.bb=this.ra=null}Gd(a){super.Gd(a);if(null!==this.Da)for(let b of this.Da.values())kb(b,a)}Oc(){return this.re(0)}Gf(){return this.We(0)}ee(a){const b=c=>{null===this.bb&&(this.bb=Object.create(null));let d=this.Ff(a);d=void 0!==d?olympe.D.ya(d):void 0;return this.ej(this.bb,c,d,olympe.D.ea,`List.getRank(${c})`)};return olympe.D.lb(a)?L(olympe.D.createNode(olympe.D.ea,b,null,
323
+ [a.Ma],[0],'onResolved('+(b.name||'')+')')):b(a)}Ff(a){return this.F[a]}We(a){const b=c=>{const d=c.valueOf(),e=this.Ef(d);null===this.ab&&(this.ab=Object.create(null));return this.ej(this.ab,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.Fa([a],c=>b(c),String)}Ef(a){return this.C[a.valueOf()]}re(a){if(olympe.D.lb(a))return this.get(olympe.D.Fa([a],c=>{c=this.We(c);if(!Wa(c.Ma)){const d=olympe.D.Ja();olympe.D.Tf(d)&&fb(d)}return c},String));null===this.Da&&(this.Da=new Map);let b=this.Da.get(a);
324
+ b||this.U.run(()=>{b=this.get(this.We(a));this.Da.set(a,b);b.Ma.onDestroy(()=>this.Da.delete(a))});return b}Ve(a){return this.kh(this.Ef(a))}aj(a,b,c,d){let e=this.Am();a=this.Xr(e,a,b,c,d);this.zm(e,a)}Xr(a,b,c,d,e){return olympe.D.Ja().Cb((f,g)=>{let h=!1,k=olympe.D.cf([b,c,this.ee(g)],(l,n,p)=>{p>=l&&p<l+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.Dm(a,g,k)})}ei(){null===this.ra&&this.U.run(()=>{this.ra=olympe.D.Nd(Array,this.C.filter(a=>void 0!==a));
325
+ this.ra.Ma.onDestroy(()=>{this.N=null})});return this.ra}ce(a){if(this.C.length!==this.size)super.ce(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}}Cm(a,b){const c=this.bb,d=this.ab,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]&&mb(c[g]),void 0!==
326
+ c[a]&&lb(c[a],olympe.D.ya(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&mb(d[e]),void 0!==d[b]&&lb(d[b],a))}}Bm(a){var b=this.ab,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ma.Ib===a&&mb(b));delete this.F[a];this.C.splice(c,1);c=this.bb;null!==c&&void 0!==c[a]&&mb(c[a])}ur(){if(null!==this.ra){const a=this.C,b=this.ra.Ma.Ib;b&&a.join(',')!==b.join(',')&&lb(this.ra,a)}}wf(){this.ur();super.wf()}Wh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.bb;if(null!==
327
+ a)for(b in a)mb(a[b]);a=this.ab;if(null!==a)for(b in a)mb(a[parseInt(b,10)]);var b=this.ra;null!==b&&(db(b.Ma),lb(b,this.C));return olympe.D.pi.prototype.Wh.call(this)}Tg(){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.Cj.la=[olympe.D.nd];m=olympe.D.Cj.prototype;m.Gd.K=olympe.D.J.C;m.Oc.K=new olympe.D.J(()=>Object,[]);m.Gf.K=new olympe.D.J(()=>String,[]);m.ee.K=olympe.D.J.G;m.Ff.K=olympe.D.J.C;
328
+ m.We.K=new olympe.D.J(()=>String,[]);m.Ef.K=olympe.D.J.C;m.re.K=new olympe.D.J(()=>Object,[]);m.Ve.K=olympe.D.J.C;m.aj.K=new olympe.D.J(()=>{},[]);m.Xr.K=olympe.D.J.C;m.ei.K=new olympe.D.J(()=>Array,[]);m.ce.K=olympe.D.J.C;m.Cm.K=olympe.D.J.C;m.Bm.K=olympe.D.J.C;m.ur.K=olympe.D.J.C;m.wf.K=olympe.D.J.C;m.Wh.K=olympe.D.J.C;m.Tg.K=olympe.D.J.C;olympe.D.Map=class extends olympe.D.pi{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}Gd(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&kb(this.F,a);super.Gd(a)}Oc(){null===this.F&&this.Pm();return this.F}Gf(){null===this.C&&this.Pm();return this.C}Pm(){this.Fh().run(()=>{this.F=olympe.D.Nd(this.Yb());this.C=olympe.D.Nd(String);this.wj(this.Um())})}Um(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}wj(a){if(void 0!==
329
+ a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?ob(this.F,b):lb(this.F,b);lb(this.C,a)}else void 0!==this.F.Ma.Ib&&(mb(this.F),mb(this.C))}set(a,b){this.Fk(a,b);1===this.size&&null!==this.C&&this.wj(a);this.wf()}remove(a){const b=this.Ti(a);null!==this.C&&this.C.Ma.Ib===a&&this.wj(this.Um());return b}clear(){this.Wh();null!==this.C&&this.wj()}};m=olympe.D.Map.prototype;m.Gd.K=olympe.D.J.C;m.Oc.K=new olympe.D.J(()=>Object,[]);m.Gf.K=new olympe.D.J(()=>String,[]);m.Pm.K=olympe.D.J.C;
330
+ m.Um.K=olympe.D.J.C;m.wj.K=olympe.D.J.C;m.set.K=olympe.D.J.C;m.remove.K=new olympe.D.J(()=>Object,[]);m.clear.K=olympe.D.J.C;olympe.D.Ug=class extends olympe.D.Cj{constructor(a){super(a)}set(a,b,c){this.Fk(a,b);void 0!==c&&olympe.D.wc([c],d=>{this.Cm(a,d)});this.wf()}remove(a){this.Bm(a);return this.Ti(a)}clear(){this.Wh()}};olympe.D.Ug.prototype.remove.K=olympe.D.J.C;olympe.D.Ug.prototype.clear.K=olympe.D.J.C;olympe.D.vs=class extends olympe.D.Sj{constructor(a,b){super(olympe.D.ea,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.ea.yo.Fp}Eb(){return olympe.D.Ox(this.node,this.duration,this.C,void 0)}};let xb=null;olympe.D.L=void 0;olympe.D.yn=void 0;olympe.D.$h=void 0;olympe.D.Vh=new Map;olympe.D.Vh.set(0,olympe.D.ea.ZERO);olympe.D.Vh.set(1,olympe.D.ea.ONE);olympe.D.Vh.set(2,olympe.D.ea.Yu);olympe.D.Ek=new Map;olympe.D.Ek.set('',olympe.D.Wa.EMPTY);olympe.D.Ek.set(' ',olympe.D.Wa.Lu);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,Bd:b,Wf:c,jn:d,debug:g,ug:e,zd:f,Vi:h})};olympe.D.Tf=function(a){return!!(a&&a instanceof olympe.D.Node)};
331
+ olympe.D.Nd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Tf(b)?gb(a,b):olympe.D.lb(b)?gb(a,b.Ma):K(a,b);return L(a)};olympe.D.lb=function(a){return!(!a||!a.vf)};olympe.D.Uf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.vf))};olympe.D.nn=function(a){return olympe.D.Tf(a)||a instanceof olympe.D.Wb||a instanceof olympe.D.Dq};olympe.D.hi=function(a){return a instanceof olympe.D.Sj};
332
+ olympe.D.bl=function(a,b){if(void 0!==a){olympe.D.hi(a)&&(a=a.Eb().Ma);if(!olympe.D.Uf(a))return b(a);var c=[];olympe.D.lb(a)?c.push(a.Ma):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.Ya=function(a,b){let c=a;olympe.D.lb(a)?c=a.Ma.Ib:olympe.D.Tf(a)?c=a.Ib:olympe.D.hi(a)&&(c=a.Eb().Ma.Ib);return void 0===c?b:c};
333
+ olympe.D.bf=function(a,b){let c;olympe.D.lb(a)?c=a.Ma:olympe.D.Tf(a)?c=a:olympe.D.hi(a)&&(c=a.Eb().Ma);c&&olympe.D.wc([b],d=>{c.bf(d)},'setDefaultValue');return a};olympe.D.cf=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.rr?(h=h.Ma,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.hi(h)&&(h=h.Eb().Ma,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
334
+ olympe.D.he=function(a,b,c,d){return L(olympe.D.cf(a,b,c,d||'syncProxies'))};const yb=a=>{for(const b of a)if(olympe.D.Uf(b)||olympe.D.hi(b))return!1;return!0};olympe.D.Fa=function(a,b,c,d,e){if(yb(a))return b(...a);const f=olympe.D.cf(a,b,c,d||'TransformFlows');e&&olympe.D.wc([e],g=>{f.bf(g)},'setDefaultValue');return L(f)};olympe.D.wc=function(a,b,c){yb(a)?b(...a):olympe.D.cf(a,b,void 0,c||'processFlows')};
335
+ olympe.D.bs=function(a,b){if(yb(a))b(...a);else{const c=olympe.D.Ja();olympe.D.cf(a,(...d)=>{olympe.D.Ja().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};olympe.D.xn=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.lb(g)?(g=g.Ma,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.hi(g)&&(g=g.Eb().Ma,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({Bd:b,jn:e,ug:f,gy:!1,zd:c})};
336
+ olympe.D.aD=function(a,b,c){const d=olympe.D.Ja();olympe.D.xn(a,(...e)=>{olympe.D.Ja().destroy();d.run(b,...e)},c||'processFutureFlowsOnce')};olympe.D.BC=function(a,b,c){a=new olympe.D.Sj(a,c);b(a);return a.Eb()};olympe.D.Kc=function(a,b='flowSource'){return new olympe.D.Sj(a,b)};olympe.D.dD=function(a,b,c,d){const e=olympe.D.Ja();olympe.D.cf(a,(...f)=>{olympe.D.Ja().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};
337
+ olympe.D.hn=function(a,b,c){olympe.D.Fa([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.GC=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.iD=function(a){return olympe.D.Ja().Cb(a)};olympe.D.EC=function(a,b,c){olympe.D.Sv(a?a.Ma:a,b,c)};
338
+ olympe.D.Sv=function(a,b,c){if(a){var d=a.Z();null===xb&&(xb={});if(xb[d])olympe.D.L.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{xb[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.L.warn(e):olympe.D.L.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.L.log(f,'undefined'):null===g?olympe.D.L.log(f,'null'):olympe.D.L.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.L.log(`Node #${d} destroyed`+(b?`: ${b}`:
339
+ ''))});c.onDestroy(()=>{delete xb[d]})}}else olympe.D.L.log('NOT starting node dump, node is '+String(a))};olympe.D.DC=function(){let a='',b=olympe.D.Ja();for(;null!==b;)a+=b.Qk()+' --\x3e ',b=b.getParent();olympe.D.L.log(a)};
340
+ olympe.D.ya=function(a){if(void 0===a)return olympe.D.ea.ZERO;if(a instanceof olympe.D.ea)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.ea.Op;if(a===Math.PI)return olympe.D.ea.PI;if(Infinity===a)return olympe.D.ea.st;if(-Infinity===a)return olympe.D.ea.eu;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.Vh.has(a)||olympe.D.Vh.set(a,new olympe.D.ea(a)),olympe.D.Vh.get(a)):new olympe.D.ea(a)}return null};
341
+ olympe.D.fe=function(a){return void 0===a?olympe.D.Nd(olympe.D.ea):olympe.D.Nd(olympe.D.ea,olympe.D.Uf(a)?a:olympe.D.ya(a))};olympe.D.Ox=olympe.D.ea.animate;olympe.D.VC=function(a,b){return new olympe.D.vs(a,b)};olympe.D.Bb=function(a){if(a instanceof olympe.D.Wa)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.Ek.has(a)?olympe.D.Ek.get(a):new olympe.D.Wa(a)};
342
+ olympe.D.YC=function(a){return void 0===a?olympe.D.Nd(olympe.D.Wa):olympe.D.Nd(olympe.D.Wa,olympe.D.Uf(a)?a:olympe.D.Bb(a))};olympe.D.Ac=function(a){return a instanceof olympe.D.qa?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.qa.F:olympe.D.qa.C};olympe.D.$x=function(a){return void 0===a?olympe.D.Nd(olympe.D.qa):olympe.D.Nd(olympe.D.qa,olympe.D.Uf(a)?a:olympe.D.Ac(a))};olympe.D.Px=function(a){if(a instanceof Date)return new olympe.D.jb(a)};
343
+ olympe.D.XC=function(a){return olympe.D.Nd(olympe.D.jb,void 0!==a?new olympe.D.jb(a):null)};olympe.D.Wr=a=>a instanceof olympe.D.qa||a instanceof olympe.D.ea||a instanceof olympe.D.Wa||a instanceof olympe.D.jb;olympe.D.ZC=function(a,b){return olympe.D.Nd(olympe.D.lc,void 0===a&&void 0===b?void 0:new olympe.D.lc(a,b))};olympe.D.Zx=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.Nd(olympe.D.Color,e)};olympe.D.WC=olympe.D.Zx;
344
+ olympe.D.Iv=function(a){olympe.D.L=a;olympe.D.$h=olympe.D.mh()};olympe.D.mh=function(){olympe.D.yn||(olympe.D.yn=new olympe.D.Dq);return olympe.D.yn};olympe.D.Ja=function(){olympe.D.$h||(olympe.D.$h=olympe.D.mh());return olympe.D.$h};olympe.D.gs=function(a){const b=olympe.D.$h;olympe.D.nn(a)&&(olympe.D.$h=a);return b||null};
345
+ olympe.D.mc=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.jb.mc(a);break;case 'number':b=olympe.D.ea.mc(a);break;case 'string':b=olympe.D.Wa.mc(a);break;case 'vector2':b=olympe.D.lc.mc(a);break;case 'color':b=olympe.D.Color.mc(a);break;case 'boolean':b=olympe.D.qa.mc(a)}return b}return null};function zb(a){a.C.yb()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.U.clear(),a.Y.length=0,a.N.length=0)}
346
+ olympe.D.cB=class{constructor(){this.C=new olympe.D.Wb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.Kc(Ab,'Last slot manager entry');this.size=qb(olympe.D.Kc(olympe.D.ea,'SlotManager size').repeat(this.F.Eb().$m()),olympe.D.ea.ZERO);this.U=qb(olympe.D.Kc(olympe.D.ea,'last valid slots'),olympe.D.ya(-1))});this.Y=[];this.N=[];this.C.onDestroy(()=>{zb(this)})}};
347
+ class Ab{constructor(a,b,c,d){this.id=a;this.tc=new olympe.D.Wb('Slot manager entry');this.G=c;this.N=d;this.tc.run(()=>{const e=qb(olympe.D.Kc(olympe.D.ea),olympe.D.ea.ZERO);olympe.D.lb(b)?e.repeat(b):e.update(b);this.C=olympe.D.Kc(olympe.D.ea);this.F=this.C.Eb().ge(e.Eb())});this.next=null}Z(){return this.id}bx(){return this.C.Eb()}$m(){return this.F}ee(){return this.G}px(){return this.N}Gy(a){this.G=a}py(a){null===a?this.C.update(olympe.D.ea.ZERO):(this.C.repeat(a.$m()),a.next=this)}Dt(){this.C.clear();
348
+ this.next=null}destroy(){this.tc.destroy();this.F=this.C=this.next=null}}m=Ab.prototype;m.Z.K=olympe.D.J.C;m.bx.K=new olympe.D.J(()=>olympe.D.ea);m.$m.K=new olympe.D.J(()=>olympe.D.ea);m.ee.K=olympe.D.J.C;m.px.K=olympe.D.J.C;m.Gy.K=olympe.D.J.C;m.py.K=olympe.D.J.C;m.Dt.K=olympe.D.J.C;m.destroy.K=olympe.D.J.C;olympe.D.O={Ea:'df.Logger'};olympe.T.config(a=>{D(a,olympe.D.Config.Pp,Number.POSITIVE_INFINITY);C(a,olympe.D.O.Ea,[olympe.pa.O.va],b=>b.Nc('df'))},'olympe.df');olympe.T.run([olympe.D.O.Ea],a=>{olympe.D.Iv(a)},'olympe.df');olympe.host={};const Bb=new Map,Cb=new Map;olympe.host.Tp=class{static register(a,b,...c){Bb.set(a,b);0<c.length&&Cb.set(a,c)}static create(a,b,c,d){const e=Bb.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=Cb.get(a);return void 0!==a?new e(b,c,...a.map(f=>ma(d,f))):new e(b,c)}};function Db(a,b,c){a.L.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.Tp.create(c,b,a.L,a.N))}function Eb(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.L.N()<=olympe.pa.Ob.C.cg&&a.L.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.lb(f))b.push(a.C.get(f.ev)||null);else if('function'===typeof f){const g=f,h=olympe.D.Ja();b.push((...k)=>{h.yb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
349
+ function Fb(a){var b=olympe.host.da.ad,c=olympe.host.da.Sp.kr;++a.G;const d=a.G;Db(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],l=d+'_'+k;this.F.has(l)&&this.F.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.D.lb(p)?(h.push(n),p=p.Ma):olympe.D.Tf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{Eb(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
350
+ {Eb(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(l,f),f.onDestroy(()=>this.F.delete(l)));return null}.bind(a));e.vc(a.U.bind(a,d));a=L(e);a.ev=d;K(e,a);return a}olympe.host.sa=class{constructor(a,b){this.L=a;this.N=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}Xa(){return this.L}U(a){this.L.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.Hd=class{constructor(a){this.C=a;this.F=olympe.D.Ja()}G(){return this.C}gd(){return this.C.Ma.gd()||this.F.gd()}yb(){return this.C.Ma.yb()}};olympe.host.Hd.prototype.G.K=new olympe.D.J(()=>olympe.host.da.Hd,[]);olympe.host.uk=class{};olympe.host.Ei=class{constructor(){}C(){}F(){}nj(){}};function Gb(a){return(a=a.find(b=>'authToken'===b.ma()))?a.getValue():null}olympe.host.Ei.F=class{constructor(a,b,c=!1){this.name=a;this.value=b;this.C=c}ma(){return this.name}getValue(){return this.value}qb(a){return this.ma()===a.ma()&&this.getValue()===a.getValue()&&this.C===a.C}};function Hb(){const a={}.parameters;return new olympe.host.Ei.C(a?a.map(b=>new olympe.host.Ei.F(b.name,b.value,b.hidden)):[])}
351
+ olympe.host.Ei.C=class{constructor(a){this.parameters=a}tn(a){const b=new Map(this.parameters.map((c,d)=>[c.ma(),d]));a.parameters.forEach(c=>{b.has(c.ma())?this.parameters[b.get(c.ma())]=c:this.parameters.push(c)})}};function Ib(a,b){var c=olympe.host.af;const d=olympe.W.nc(),e=new olympe.D.Wb('onTimeout context');c.C.aa(b,d,()=>{e.yb()||e.gd()||e.run(a);c.C.G(d)});return new olympe.host.ad.G(c.C,d)}function Jb(a,b){var c=olympe.host.af;const d=olympe.W.nc(),e=new olympe.D.Wb('onInterval context');c.C.Y(b,d,()=>{e.yb()||e.gd()?c.C.F(d):e.run(a)});return new olympe.host.ad.F(c.C,d)}function Kb(a){var b=olympe.host.af;a=a instanceof olympe.host.ad.F?a.Z():a;b.C.F(a)}olympe.host.ad=class{constructor(a){this.C=Fb(a)}};
352
+ olympe.host.ad.C=class{constructor(a,b){this.af=a;this.id=b}Z(){return this.id}cancel(){}};olympe.host.ad.N=class extends olympe.host.ad.C{cancel(){this.af.U(this.id)}};olympe.host.ad.G=class extends olympe.host.ad.C{cancel(){this.af.G(this.id)}};olympe.host.ad.F=class extends olympe.host.ad.C{cancel(){this.af.F(this.id)}};olympe.host.da={};olympe.host.da.Hd=class{destroy(){}};olympe.host.da.Hd.prototype.destroy=olympe.host.da.Hd.prototype.destroy;olympe.host.da.Sp={Oy:100,Qy:101,Py:102,Sy:103,Ry:104,Ny:105,QA:201,OA:202,LA:204,TA:205,KA:206,NA:207,RA:208,UA:209,VA:210,WA:211,MA:212,SA:218,PA:219,XA:220,JA:221,IA:222,fB:300,gB:301,hB:302,lB:303,mB:304,nB:305,iB:310,jB:311,kB:312,qA:400,rA:401,sA:402,mA:450,eA:500,cA:501,hA:502,gA:503,dA:504,fA:505,GB:600,xB:601,BB:602,tB:603,uB:604,rB:605,wB:606,MB:607,EB:608,oB:609,sB:610,vB:611,DB:612,IB:613,pB:614,HB:615,CB:616,LB:617,yB:618,zB:619,AB:620,FB:630,qB:631,JB:632,KB:633,oC:700,SB:701,TB:702,
353
+ UB:703,WB:704,XB:705,YB:706,VB:707,$B:708,ZB:709,aC:710,eC:711,mC:712,bC:713,cC:714,fC:715,gC:716,iC:717,jC:718,lC:719,hC:720,kC:721,nC:722,dC:723,pC:724,qC:725,kr:800};olympe.host.da.ad=class{U(){}aa(){}G(){}Y(){}F(){}};olympe.host.O={Rq:'host.System',Il:'host.HistoryManager',Fq:'host.Scheduler',Ea:'host.platform.Logger',va:'host.Manager'};olympe.host.af=null;olympe.T.config(function(a){ta(a,olympe.host.O.Rq);ta(a,olympe.host.O.Il);C(a,olympe.host.O.Ea,[olympe.pa.O.va],function(b){return b.Nc('host')});A(a,olympe.host.O.va,olympe.host.sa,olympe.host.O.Ea,olympe.T.O.bg);C(a,olympe.host.O.Fq,[olympe.host.O.va],b=>{null===olympe.host.af&&(olympe.host.af=new olympe.host.ad(b));return olympe.host.af},!0)},'olympe.host');
354
+ olympe.T.run([olympe.host.O.Fq],a=>a,'olympe.host.scheduler');olympe.T.run([olympe.host.O.va],a=>a,'olympe.host');olympe.net={};olympe.net.eb={};olympe.net.eb.$d={hm:'POST',GET:'GET',pt:'HEAD',ik:'PUT',Fc:'DELETE',am:'OPTIONS',uA:'PATCH'};olympe.net.eb.ResponseType={vk:'text',ol:'blob',ARRAY_BUFFER:'arraybuffer'};olympe.net.eb.Headers={Ij:'content-type',Zy:'content-length',ri:'authorization',us:'access-control-allow-origin'};olympe.net.eb.$y={Vz:'text/html',JSON:'application/json',tC:'application/zip'};olympe.net.eb.od={Bs:0,Kh:200,vl:201,Aj:202,My:400,QB:401,ft:403,oA:404,iA:405,Gq:500,Ju:503};function Lb(a){return a.host&&encodeURI(a.host)}function Mb(a){return encodeURI(a.path).replace(olympe.net.Ck.C,(b,c)=>'%'+c)}function Nb(a){return void 0===a.G?443===a.port:a.G}olympe.net.Ck=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.G=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.G=d)}C(){return`${Nb(this)?'wss':'ws'}://${Lb(this)}:${this.port}/${Mb(this)}`}toString(){return`${Lb(this)}:${this.port}/${Mb(this)}`}};
355
+ olympe.net.Ck.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ka(){}aa(){}U(){}};function Ob(a,b,c,d){a=olympe.W.by(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Wj(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.qs&&(c=a.qs.split(':'),2===c.length&&(c=olympe.W.ci().C(Da(`${c[0]}:${c[1]}`)),Pb(b,{Authorization:`Basic ${c}`})));return b}function Qb(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}
356
356
  function Pb(a,b){for(let c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a.headers[c]=b[c])}
357
- olympe.net.Zj=class extends olympe.net.Gk{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.eb.ae.GET;this.query=h;this.headers={};this.body=f;this.F=void 0!==g?g:olympe.net.eb.ResponseType.zk;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}ij(){return this.headers}C(){let a=Qb(this);a=a?`?${a}`:'';return Lb(this)?`${Nb(this)?'https':'http'}://${Lb(this)}:${this.port}/${Mb(this)}${a}`:`${Mb(this)}${a}`}toString(){return this.C()}};
358
- olympe.net.Zj.ae={mm:'POST',GET:'GET',st:'HEAD',mk:'PUT',Fc:'DELETE',gm:'OPTIONS'};olympe.net.Tg=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}Rd(){return this.status}ij(){return this.headers}};function Rb(a,b,c){const d=olympe.D.Ia(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.Cb(f=>{d.Je(e);a.F().C.delete(b);c(f)})}olympe.net.sa=class{constructor(a){this.L=a;this.G=1;a='Initializing NET layer';this.L.G()&&(a+=' (implementation: '+this.V()+')');this.L.info(a);this.L.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}aa(){}C(){}N(){}V(){}};function Sb(a){return!(!a.client||!a.client.connected)}function Tb(a,b,c){a.connect();a.client.subscribe(b,void 0,d=>{d?a.L.error(`Failed to subscribe to topic ${b}: ${d}`):a.C.set(b,c)})}function Ub(a,b,c){a.connect();a.client.unsubscribe(b,void 0,c);a.C.delete(b)}
359
- olympe.net.hk=class{constructor(a,b){this.url=a;this.G=b||null;this.client=null;this.F=[];this.C=new Map;this.L=olympe.pa.Xa('MQTT')}connect(a){if(Sb(this))return a&&a(),this;a&&this.F.push(a);null===this.client&&(this.client=mqtt.connect(this.url,this.G),this.client.on(olympe.net.hk.C.gu,(b,c)=>{this.C.has(b)?this.C.get(b)(JSON.parse(c.toString())):this.L.warn('There is no subscriber for topic '+b)}),this.client.on(olympe.net.hk.C.Ls,()=>this.F.forEach(b=>b())));return this}publish(a,b,c,d){this.connect();
360
- this.client.publish(a,JSON.stringify(b),c,e=>{d&&d(e);e&&this.L.error('Failed to publish a message '+b)});return this}end(a,b){this.client&&this.client.end(a,{},()=>{b&&b();this.client=null});return this}};olympe.net.hk.C={Ls:'connect',gu:'message',Ry:'close',hz:'end'};olympe.net.Fk=class{constructor(a){this.L=a}aa(){this.L.error('Try to set cors policies on a web server with the browser implementation.');return this}N(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Z(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};olympe.net.O={va:'net.Manager',Ea:'net.Logger',Dm:'net.WebServer'};olympe.net.Config={Nl:'net.httpHost',Ol:'net.httpPort',mp:'net.httpSSL'};
361
- olympe.T.config(function(a){const b='object'===typeof window&&window.location&&window.location.hostname||'localhost',c='localhost'===b;E(a,olympe.net.Config.Nl,b);E(a,olympe.net.Config.Ol,c?3141:443);E(a,olympe.net.Config.mp,!c);ta(a,olympe.net.O.va);C(a,olympe.net.O.Ea,[olympe.pa.O.va],function(d){return d.Nc('net')});B(a,olympe.net.O.Dm,olympe.net.Fk,olympe.net.O.Ea)},'olympe.net');olympe.async={};function Vb(a,b){0<=b&&(a.timeout=b)}function Wb(a,b){a.N||a.qd.push(a.G.Cb(b))}
362
- olympe.async.Mo=class{constructor(a,b=void 0===a){this.C=[];this.qd=[];this.G=a||new olympe.D.Wb('Async executor context');this.ra=b;this.F=null;this.env=new Map;this.env.set('Executor',this);this.N=this.V=!1;this.L=null;this.Z=this.timeout=0}Xa(){return this.L}add(a){this.N||this.C.push(this.G.Cb(a));return this}start(){this.V||(this.L&&this.L.log('Executor started.'),this.V=!0,0<this.timeout&&(this.Z=setTimeout(()=>{this.F='Timeout expired.';this.Z=0;this.complete(!1)},this.timeout)))}clear(){this.C=
363
- [];this.qd=[];this.env.clear();this.ra&&this.G.destroy()}complete(a){if(!this.N){this.N=!0;this.Z&&(clearTimeout(this.Z),this.Z=0);this.L&&this.L.log(a?'Executor completed successfully':`Executor completed with error: ${this.F}`);for(const b of this.qd)b(a,a?null:this.F,this.env);this.clear()}}};
364
- function Xb(a){if(0<a.C.length){const b=a.C.shift();a.L&&a.L.log(`Executing next task. ${a.C.length} tasks left in the pipeline.`);a.G.run(()=>{b(()=>{Promise.resolve().then(()=>{Xb(a)})},c=>{c&&(a.F=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.wk=class extends olympe.async.Mo{static create(){return new olympe.async.wk(new olympe.D.Wb('SequencedExecutor'),!0)}insert(a){this.N||this.C.unshift(a);return this}start(){this.V||(super.start(),Xb(this))}};
365
- olympe.async.qg=class extends olympe.async.Mo{constructor(a,b){super(a,b);this.aa=0;this.ka=!0}static create(){return new olympe.async.qg(new olympe.D.Wb('ParallelExecutor'),!0)}run(a){this.L&&this.L.log('Starting a task');this.G.run(()=>{a(()=>{this.done()},b=>{this.ka=!1;b&&(this.F=this.F?`${this.F}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.V&&!this.N&&(this.aa++,this.run(a));return this}done(){this.aa--;0>=this.aa&&this.complete(this.ka)}start(){if(!this.V)if(super.start(),0<
366
- this.C.length){this.aa=this.C.length;for(const a of this.C)this.run(a)}else this.complete(!0)}};olympe.hc={};olympe.hc.Wt=class{constructor(){}set(){}get(){}forEach(){}remove(){}clear(){}close(){}};olympe.hc.Vt=class{constructor(){}C(){}};olympe.hc.Storage=class{open(){}F(){}V(){}write(){}G(){}N(){}C(){}close(){}};function Yb(a,b,c){a.storage.F(c)}function Zb(a,b,c,d,e){a.storage.write(b,'transactions',c.toJSON(),'text/json',d,e)}function $b(a,b){a.storage.G(b)}function ac(a,b){a.storage.C(b)}function bc(a,b,c,d,e,f){a.storage.write(b,'files',c,d,()=>{e('files/'+b)},f)}function cc(a,b){a.storage.V(b)}olympe.hc.Xs=class{constructor(a){this.storage=a}};olympe.hc.O={dk:'localStorage.KeyValueManager',Ri:'localStorage.Storage',vo:'localStorage.DatacloudStorage',Ea:'localStorage.Logger'};olympe.T.config(function(a){ta(a,olympe.hc.O.dk);C(a,olympe.hc.O.Ea,[olympe.pa.O.va],function(b){return b.Nc('localstorage')});B(a,olympe.hc.O.vo,olympe.hc.Xs,olympe.hc.O.Ri)},'olympe.localstorage');olympe.auth={};olympe.auth.Uu=class{V(){}N(){}Sa(){}aa(){}ki(){}rh(){}Ur(){}};function dc(a){a.L.info('Initializing AUTH layer');let b=a.zc;if(a.ka){const c=a.ka.C(),d=Gb(c.parameters);b=d||b;d&&a.ka.F(c.parameters.filter(e=>'authToken'!==e.ma()))}b&&a.storage&&ec(a.storage,b,c=>{!c&&a.L.error('Could not store authToken')});a.L.debug('Asking to be notified when auth connector gets online');a.F.V(()=>{if(a.ab)if(a.N=olympe.auth.sa.G.xs,a.L.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),a.Z){const c=new olympe.auth.Request;c.set('username',
367
- a.Z);c.Hn(a.bb);a.L.log('Autologin with user "'+a.Z+'"');fc(a,c)}else a.L.error('autoLogin: auto user not specified.'),gc(a);else a.N=olympe.auth.sa.G.Ak,a.L.log('Connector online, attempting to log with token'),hc(a)});a.F.N(()=>{switch(olympe.D.Ya(a.G)){case olympe.auth.sa.C.Ng:a.L.warn('Disconnected from server - session of user '+olympe.D.Ya(a.C.Eb()).Sd()+' lost');break;case olympe.auth.sa.C.Eh:a.L.warn('Disconnected from server - guest session lost');break;case olympe.auth.sa.C.pi:a.L.warn('Disconnected from server - authentication aborted');
368
- break;case olympe.auth.sa.C.INIT:a.L.warn('Cannot open auth session - no server connection');break;default:a.L.error('Should not get there, investigate')}ic(a,olympe.auth.sa.C.hg)});a.F.Sa((c,d)=>{if(c===olympe.auth.sa.F.Dj)a.L.info('Authentication revoked'),gc(a),a.storage&&jc(a.storage),a.ra.forEach(e=>{e(c,d)});else if(c===olympe.auth.sa.F.pp)a.L.info('Redirection to IDP to invalidate token (SAML)'),a.storage&&jc(a.storage),a.Sa.F();else throw Error(`Unknown logout step coming from server : ${c}`);
357
+ olympe.net.Wj=class extends olympe.net.Ck{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.eb.$d.GET;this.query=h;this.headers={};this.body=f;this.F=void 0!==g?g:olympe.net.eb.ResponseType.vk;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}gj(){return this.headers}C(){let a=Qb(this);a=a?`?${a}`:'';return Lb(this)?`${Nb(this)?'https':'http'}://${Lb(this)}:${this.port}/${Mb(this)}${a}`:`${Mb(this)}${a}`}toString(){return this.C()}};
358
+ olympe.net.Wj.$d={hm:'POST',GET:'GET',pt:'HEAD',ik:'PUT',Fc:'DELETE',am:'OPTIONS'};olympe.net.Rg=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}Rd(){return this.status}gj(){return this.headers}};function Rb(a,b,c){const d=olympe.D.Ja(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.Cb(f=>{d.Je(e);a.F().C.delete(b);c(f)})}olympe.net.sa=class{constructor(a){this.L=a;this.G=1;a='Initializing NET layer';this.L.G()&&(a+=' (implementation: '+this.U()+')');this.L.info(a);this.L.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}aa(){}C(){}N(){}U(){}};function Sb(a){return!(!a.client||!a.client.connected)}function Tb(a,b,c){a.connect();a.client.subscribe(b,void 0,d=>{d?a.L.error(`Failed to subscribe to topic ${b}: ${d}`):a.C.set(b,c)})}function Ub(a,b,c){a.connect();a.client.unsubscribe(b,void 0,c);a.C.delete(b)}function Vb(a,b){a.F.push(b)}function Wb(a,b){a.client.on(olympe.net.je.C.tq,b)}function Xb(a,b){a.client.on(olympe.net.je.C.Jh,b)}function Yb(a,b){a.client.on(olympe.net.je.C.cc,b)}
359
+ olympe.net.je=class{constructor(a,b){this.url=a;this.G=b||null;this.client=null;this.F=[];this.C=new Map;this.L=olympe.pa.Xa('MQTT')}connect(a){if(Sb(this))return a&&a(),this;a&&this.F.push(a);null===this.client&&(this.client=mqtt.connect(this.url,this.G),this.client.on(olympe.net.je.C.du,(b,c)=>{this.C.has(b)?this.C.get(b)(JSON.parse(c.toString())):this.L.warn('There is no subscriber for topic '+b)}),this.client.on(olympe.net.je.C.Hs,()=>{this.F.forEach(b=>b())}),this.client.on(olympe.net.je.C.tq,
360
+ ()=>{this.L.warn('Mqtt client is reconnecting to bus ... ')}),this.client.on(olympe.net.je.C.cc,b=>{this.L.error('Mqtt client error ',b)}),this.client.on(olympe.net.je.C.Jh,()=>{this.L.error('Mqtt client is offline')}),this.client.on(olympe.net.je.C.Gs,()=>{this.L.error('Mqtt client is closed')}),this.client.on(olympe.net.je.C.Ys,()=>{this.L.error('Mqtt client has ended')}));return this}publish(a,b,c,d){this.connect();this.client.publish(a,JSON.stringify(b),c,e=>{d&&d(e);e&&this.L.error('Failed to publish a message '+
361
+ b)});return this}end(a,b){this.client&&this.client.end(a,{},()=>{b&&b();this.client=null});return this}};olympe.net.je.C={Hs:'connect',tq:'reconnect',du:'message',Gs:'close',Ys:'end',cc:'error',Jh:'offline'};olympe.net.Bk=class{constructor(a){this.L=a}aa(){this.L.error('Try to set cors policies on a web server with the browser implementation.');return this}N(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Y(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};olympe.net.O={va:'net.Manager',Ea:'net.Logger',ym:'net.WebServer'};olympe.net.Config={Jl:'net.httpHost',Kl:'net.httpPort',fp:'net.httpSSL'};
362
+ olympe.T.config(function(a){const b='object'===typeof window&&window.location&&window.location.hostname||'localhost',c='localhost'===b;D(a,olympe.net.Config.Jl,b);D(a,olympe.net.Config.Kl,c?3141:443);D(a,olympe.net.Config.fp,!c);ta(a,olympe.net.O.va);C(a,olympe.net.O.Ea,[olympe.pa.O.va],function(d){return d.Nc('net')});A(a,olympe.net.O.ym,olympe.net.Bk,olympe.net.O.Ea)},'olympe.net');olympe.async={};function Zb(a,b){0<=b&&(a.timeout=b)}function $b(a,b){a.N||a.qd.push(a.G.Cb(b))}
363
+ olympe.async.Go=class{constructor(a,b=void 0===a){this.C=[];this.qd=[];this.G=a||new olympe.D.Wb('Async executor context');this.ra=b;this.F=null;this.env=new Map;this.env.set('Executor',this);this.N=this.U=!1;this.L=null;this.Y=this.timeout=0}Xa(){return this.L}add(a){this.N||this.C.push(this.G.Cb(a));return this}start(){this.U||(this.L&&this.L.log('Executor started.'),this.U=!0,0<this.timeout&&(this.Y=setTimeout(()=>{this.F='Timeout expired.';this.Y=0;this.complete(!1)},this.timeout)))}clear(){this.C=
364
+ [];this.qd=[];this.env.clear();this.ra&&this.G.destroy()}complete(a){if(!this.N){this.N=!0;this.Y&&(clearTimeout(this.Y),this.Y=0);this.L&&this.L.log(a?'Executor completed successfully':`Executor completed with error: ${this.F}`);for(const b of this.qd)b(a,a?null:this.F,this.env);this.clear()}}};
365
+ function ac(a){if(0<a.C.length){const b=a.C.shift();a.L&&a.L.log(`Executing next task. ${a.C.length} tasks left in the pipeline.`);a.G.run(()=>{b(()=>{Promise.resolve().then(()=>{ac(a)})},c=>{c&&(a.F=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.sk=class extends olympe.async.Go{static create(){return new olympe.async.sk(new olympe.D.Wb('SequencedExecutor'),!0)}insert(a){this.N||this.C.unshift(a);return this}start(){this.U||(super.start(),ac(this))}};
366
+ olympe.async.og=class extends olympe.async.Go{constructor(a,b){super(a,b);this.aa=0;this.ka=!0}static create(){return new olympe.async.og(new olympe.D.Wb('ParallelExecutor'),!0)}run(a){this.L&&this.L.log('Starting a task');this.G.run(()=>{a(()=>{this.done()},b=>{this.ka=!1;b&&(this.F=this.F?`${this.F}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.U&&!this.N&&(this.aa++,this.run(a));return this}done(){this.aa--;0>=this.aa&&this.complete(this.ka)}start(){if(!this.U)if(super.start(),0<
367
+ this.C.length){this.aa=this.C.length;for(const a of this.C)this.run(a)}else this.complete(!0)}};olympe.jc={};olympe.jc.Tt=class{constructor(){}set(){}get(){}forEach(){}remove(){}clear(){}close(){}};olympe.jc.St=class{constructor(){}C(){}};olympe.jc.Storage=class{open(){}F(){}U(){}write(){}G(){}N(){}C(){}close(){}};function bc(a,b,c){a.storage.F(c)}function cc(a,b,c,d,e){a.storage.write(b,'transactions',c.toJSON(),'text/json',d,e)}function dc(a,b){a.storage.G(b)}function ec(a,b){a.storage.C(b)}function fc(a,b,c,d,e,f){a.storage.write(b,'files',c,d,()=>{e('files/'+b)},f)}function gc(a,b){a.storage.U(b)}olympe.jc.Ts=class{constructor(a){this.storage=a}};olympe.jc.O={ak:'localStorage.KeyValueManager',Qi:'localStorage.Storage',po:'localStorage.DatacloudStorage',Ea:'localStorage.Logger'};olympe.T.config(function(a){ta(a,olympe.jc.O.ak);C(a,olympe.jc.O.Ea,[olympe.pa.O.va],function(b){return b.Nc('localstorage')});A(a,olympe.jc.O.po,olympe.jc.Ts,olympe.jc.O.Qi)},'olympe.localstorage');olympe.auth={};olympe.auth.Ru=class{U(){}N(){}Sa(){}aa(){}ji(){}ph(){}Pr(){}};function hc(a){a.L.info('Initializing AUTH layer');let b=a.zc;if(a.ka){const c=a.ka.C(),d=Gb(c.parameters);b=d||b;d&&a.ka.F(c.parameters.filter(e=>'authToken'!==e.ma()))}b&&a.storage&&ic(a.storage,b,c=>{!c&&a.L.error('Could not store authToken')});a.L.debug('Asking to be notified when auth connector gets online');a.F.U(()=>{if(a.ab)if(a.N=olympe.auth.sa.G.ss,a.L.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),a.Y){const c=new olympe.auth.Request;c.set('username',
368
+ a.Y);c.Bn(a.bb);a.L.log('Autologin with user "'+a.Y+'"');jc(a,c)}else a.L.error('autoLogin: auto user not specified.'),kc(a);else a.N=olympe.auth.sa.G.wk,a.L.log('Connector online, attempting to log with token'),lc(a)});a.F.N(()=>{switch(olympe.D.Ya(a.G)){case olympe.auth.sa.C.Lg:a.L.warn('Disconnected from server - session of user '+olympe.D.Ya(a.C.Eb()).Sd()+' lost');break;case olympe.auth.sa.C.Ch:a.L.warn('Disconnected from server - guest session lost');break;case olympe.auth.sa.C.oi:a.L.warn('Disconnected from server - authentication aborted');
369
+ break;case olympe.auth.sa.C.INIT:a.L.warn('Cannot open auth session - no server connection');break;default:a.L.error('Should not get there, investigate')}mc(a,olympe.auth.sa.C.fg)});a.F.Sa((c,d)=>{if(c===olympe.auth.sa.F.Aj)a.L.info('Authentication revoked'),kc(a),a.storage&&nc(a.storage),a.ra.forEach(e=>{e(c,d)});else if(c===olympe.auth.sa.F.ip)a.L.info('Redirection to IDP to invalidate token (SAML)'),a.storage&&nc(a.storage),a.Sa.F();else throw Error(`Unknown logout step coming from server : ${c}`);
369
370
  });a.L.log('DONE initializing AUTH layer (waiting for connector to be online)')}
370
- function hc(a){null!==a.storage?(a.L.debug('Retrieving token from local storage'),a.storage.ed(b=>{if(b){const d=new olympe.auth.Request;var c=b.Sd();d.set('username',c);b=b.Kf();d.set('nonce',b);a.L.debug('Token found, trying login with',d);fc(a,d,a.cc)}else a.L.debug('No token found, cannot perform auto login. Falling back in GUEST state'),gc(a)})):(a.L.error('Cannot retrieve token: no storage configured, cannot perform auto login. Falling back in GUEST state'),gc(a))}
371
- function ic(a,b){a.L.log('State change: ',kc(a),'--\x3e',b);a.G.update(b)}function gc(a){a.C.update(a.Da);ic(a,olympe.auth.sa.C.Eh);a.L.info('Authenticated as guest')}function kc(a){return olympe.D.Ya(a.G.Eb())}function lc(a){const b=olympe.auth.sa.C.Ng,c=olympe.auth.sa.C.Eh,d=olympe.auth.sa.C.pi,e=olympe.D.Kc(olympe.D.qa,'auth.isOnline');olympe.D.wc([a.G],f=>{f=olympe.D.Ac(f===b||f===c||f===d);const g=olympe.D.Ya(e);void 0!==g&&g.qb(f)||e.update(f)},'Router is online');return e.Eb()}
372
- function mc(a){var b=olympe.public.Ta.get(),c='logoutCallback';void 0===c&&(c=olympe.W.Ag());b.ra.set(c,a)}function nc(a){return a.C.Eb().Kf()}function oc(a,b,c,d=!1){b=b+c?':'+c.message:'';a.L.error(b);a.error.update(olympe.D.Bb(b));ic(a,olympe.auth.sa.C.qc);if(d)throw Error(b);}
373
- function fc(a,b,c,d){void 0===c&&(c=a.Ab);void 0===c&&oc(a,'No authentication provider specified',null,!0);const e=a.Hb.get(c);e||oc(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.V.set('login',d);a.L.log('Sending authentication request using "'+c+'" for '+b);e.ed(b,a.Xb.bind(a));ic(a,olympe.auth.sa.C.pi)}function pc(a,b,c){a.V.forEach(d=>{d(b,c)})}
374
- olympe.auth.sa=class{constructor(a,b,c,d,e,f,g,h,k,l,n,p){this.L=a;this.F=b;this.storage=c;this.Sa=d;this.ka=e;this.Ab=g;this.cc=h;this.ab=void 0===k?!0:k;this.Z=l;this.bb=n;this.zc=p;this.Hb=new Map;this.G=olympe.D.Kc(String).update(olympe.auth.sa.C.INIT);this.error=olympe.D.Kc(olympe.D.Wa);this.N=null;this.Da=new olympe.auth.tf('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=olympe.D.Kc(olympe.auth.tf).update(this.Da);this.V=new Map;this.ra=new Map;f.forEach(q=>{const r=
375
- q.ma();if(this.Hb.has(r))throw Error('Provider "'+r+'" has already been registered !');this.Hb.set(r,q)});dc(this)}getState(){return this.G.Eb()}aa(){return this.error.Eb()}Sd(){return this.C.Eb().Sd()}Eg(){return this.C.Eb().Eg()}ei(){return this.C.Eb().ei()}rh(a,b){this.F.rh(a,olympe.D.Ya(nc(this)),b)}yn(){this.L.debug('Sending logout');jc(this.storage);this.F.aa(a=>{a?oc(this,'Logout request rejected:',a):this.L.debug('Logout request acknowledged')})}ki(){kc(this)===olympe.auth.sa.C.Ng&&this.F.ki(a=>
376
- {a&&this.L.error('Was not able to send the auth keep alive message:',a.message)})}Xb(a,b){const c=null===this.N?olympe.auth.sa.G.du:this.N;this.N=null;a?(this.L.warn('Authentication rejected: '+a.message+'. Falling back into GUEST state'),jc(this.storage),this.error.update(olympe.D.Bb(a.message)),gc(this),pc(this,a,c)):(this.L.info('User '+b.Sd()+' (#'+b.Eg()+') successfully authenticated'),this.C.update(b),ic(this,olympe.auth.sa.C.Ng),pc(this,a,c),this.storage&&ec(this.storage,b));this.V.has('login')&&
377
- this.V.delete('login')}};olympe.auth.sa.C={INIT:'init',hg:'disconnected',Eh:'guest',pi:'authenticating',qc:'error',Ng:'authenticated'};olympe.auth.sa.G={du:'manual',xs:'auto',Ak:'tokenOnFirstConnection'};olympe.auth.sa.F={Dj:'accepted',pp:'redirect'};olympe.auth.Oi=class{ma(){}ed(){}};olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.wc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.xf&&(a=a.Ma.Ib);return a?a.valueOf():a}Sd(){return this.get('username')}Hn(a){this.set('password',a)}Kf(){return this.get('nonce')}toString(){return this.Sd()+(this.Kf()?' with nonce':'')+(this.get('password')?' with password':'')}};olympe.auth.tf=class{constructor(a,b,c,d={}){this.user=a;this.Cj=b;this.F=c;this.G=d}Sd(){return this.user}Eg(){return this.Cj}Kf(){return this.F}bk(){return this.G}ei(){return null}ia(){var a=olympe.W,b=a.Cr;var c=JSON.stringify({user:this.user,userTag:this.Cj,nonce:this.F,payload:this.G});c=olympe.W.di().C(Da(c));return b.call(a,c)}};m=olympe.auth.tf.prototype;m.Sd.K=new olympe.D.J(()=>String,[]);m.Eg.K=new olympe.D.J(()=>String,[]);m.Kf.K=new olympe.D.J(()=>String,[]);
378
- m.bk.K=new olympe.D.J(()=>Object,[]);m.ei.K=new olympe.D.J(()=>String,[]);m.ia.K=new olympe.D.J(()=>String,[]);olympe.auth.jm=class extends olympe.auth.tf{constructor(a,b,c,d){super(a,b,c,d)}ei(){return this.bk().access_token||null}};olympe.auth.Jq=class extends olympe.auth.tf{constructor(a,b,c,d){super(a,b,c,d);this.C=null}ei(){return this.C}ia(){var a=olympe.W.di(),b={user:this.Sd(),userTag:this.Eg(),nonce:this.Kf(),payload:this.bk(),fullToken:this.C},c=olympe.W,d=c.Cr;b=JSON.stringify(b);a=a.C(Da(b));return d.call(c,a)}};function ec(a,b,c){const d=a.C.C('AUTH');d.set(a.key,'string'===typeof b?b:b.ia(),e=>{d.close();c&&c(e)})}function jc(a){const b=a.C.C('AUTH');b.remove(a.key,()=>b.close())}
379
- olympe.auth.zm=class{constructor(a,b,c){this.C=a;this.L=b;this.key='OlympeToken-'+c.C}ed(a){const b=this.C.C('AUTH');this.L.debug(`olympe.auth.TokenStorage: retrieve token with key ${this.key}`);b.get(this.key,c=>{let d=null;if(c)try{this.L.debug('olympe.auth.TokenStorage: Token retrieved successfully');{var e=JSON,f=e.parse;var g=Ea(olympe.W.di().V(olympe.W.Cv(c)));const h=f.call(e,g);if(h.fullToken){const k=new olympe.auth.Jq(h.user,h.userTag,h.nonce,h.payload);k.C=h.fullToken;d=k}else d=h.payload&&
380
- h.payload.id_token?new olympe.auth.jm(h.user,h.userTag,h.nonce,h.payload):new olympe.auth.tf(h.user,h.userTag,h.nonce,h.payload)}}catch(h){this.L.error('Error while unserializing token: ',h.message)}else this.L.debug('olympe.auth.TokenStorage: No token found');b.close();a(d)})}};olympe.auth.zm.F='OlympeToken';olympe.auth.zm.C='AUTH';olympe.auth.tk=class{redirect(){}F(){}C(){}};olympe.auth.tk.C={GET:'GET',mm:'POST'};olympe.auth.ql=class{constructor(a){this.C=a||'default'}};olympe.auth.Hb={};olympe.auth.Hb.oa={};olympe.auth.Hb.oa.Ji=class{Z(){}};olympe.auth.Hb.oa.Re=class{ka(){}};olympe.auth.Hb.oa.Ee=class{ra(){}Da(){}};function qc(a,b){return olympe.W.mb(b+'-olympe-'+a.C[b])}olympe.auth.Hb.Ii=class{constructor(a){this.C=a}ma(){return'local'}ed(a,b){const c=a.Sd();if(c){const d=a.get('password'),e=a.Kf();a.C.delete('password');if(void 0!==e&&qc(this,c)===e){b(null,new olympe.auth.tf(c,'',qc(this,c)));return}a=olympe.W.mb(d||'');if(this.C[c]===a){b(null,new olympe.auth.tf(c,'',qc(this,c)));return}}b(Error('Invalid login'))}};olympe.auth.Hb.Ii.C='local';olympe.auth.Hb.Ii.la=[olympe.auth.Oi];olympe.auth.Hb.Ji=class{constructor(a,b){this.C=a;this.storage=b}ma(){return'localToken'}ed(a,b){this.storage.ed(c=>{this.C.Z(a,(d,e)=>{b(d,e||c)})})}};olympe.auth.Hb.Ji.C='localToken';olympe.auth.Hb.Ji.la=[olympe.auth.Oi];olympe.auth.Hb.im=class{constructor(a,b){this.C=a;this.F=b}ma(){return'openID'}ed(){const a=this.C.C();this.C.redirect(`${this.F}/auth?url=${a}`,null,olympe.auth.tk.C.GET)}};olympe.auth.Hb.im.C='openID';olympe.auth.Hb.im.la=[olympe.auth.Oi];olympe.auth.Hb.Re=class{constructor(a,b){this.F=a;this.C=b}ma(){return'saml'}ed(a,b){this.F.ka(c=>{c?b(c):this.C.F()})}};olympe.auth.Hb.Re.C='saml';olympe.auth.Hb.Re.la=[olympe.auth.Oi];olympe.auth.Hb.Ee=class{static dj(a,b){const c=new SRPClient,d=c.generateRandomSalt();return{username:a,login:a,salt:d,verifier:c.generateVerifier(d,a,b)}}constructor(a){this.C=a;this.L=olympe.pa.Xa('auth')}ma(){return'srp'}ed(a,b){const c=a.get('password');a.C.delete('password');this.L.debug('Sending SRP request');this.C.ra(a,(d,e,f)=>{this.L.debug('Received Salt+B message');if(d)b(d);else{try{const g=new SRPClient;g.step1(a.Sd(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g);
381
- return}this.L.debug('Sending SRP A+M (proof) message');this.C.Da(a,b)}})}};olympe.auth.Hb.Ee.C='srp';olympe.auth.Hb.Ee.la=[olympe.auth.Oi];olympe.auth.O={va:'auth.Manager',Ea:'auth.Logger',Ri:'auth.Storage',Ej:'auth.appNameToken',pk:'auth.Redirector'};olympe.auth.td={va:'auth.ManagerConnector',Jp:'auth.LocalTokenConnector',Ee:'auth.SRPConnector',Re:'auth.SAMLConnector'};olympe.auth.Config={Dl:'auth.defaultProvider',Kp:'auth.localTokenProvider',Pn:'auth.autoLogin',Tn:'auth.autoUser',Qn:'auth.autoPassword',Ak:'auth.token',Nn:'auth.appToken'};
382
- olympe.T.config(function(a){E(a,olympe.auth.Config.Dl,'srp');E(a,olympe.auth.Config.Kp,'localToken');E(a,olympe.auth.Config.Pn,!1);E(a,olympe.auth.Config.Tn,'');E(a,olympe.auth.Config.Qn,'');E(a,olympe.auth.Config.Ak,'');E(a,olympe.auth.Config.Nn,'default');C(a,olympe.auth.O.Ea,[olympe.pa.O.va],b=>b.Nc('auth'));B(a,olympe.auth.O.Ej,olympe.auth.ql,new olympe.T.fa(olympe.auth.Config.Nn));B(a,olympe.auth.O.Ri,olympe.auth.zm,olympe.hc.O.dk,olympe.auth.O.Ea,olympe.auth.O.Ej);ta(a,olympe.auth.td.va);ta(a,
383
- olympe.auth.O.pk);C(a,olympe.auth.O.va,[olympe.auth.O.Ea,olympe.auth.td.va,olympe.host.O.Ml,new olympe.T.zb(olympe.auth.O.Ri,olympe.T.hf.C.Kh),new olympe.T.fa(olympe.auth.Config.Dl),new olympe.T.fa(olympe.auth.Config.Kp),new olympe.T.fa(olympe.auth.Config.Pn),new olympe.T.fa(olympe.auth.Config.Tn),new olympe.T.fa(olympe.auth.Config.Qn),new olympe.T.fa(olympe.auth.Config.Ak),new olympe.T.zb(olympe.auth.O.pk,olympe.T.hf.C.Kh),new olympe.T.zb(olympe.auth.td.Jp,olympe.T.hf.C.Kh),new olympe.T.zb(olympe.auth.td.Ee,
384
- olympe.T.hf.C.Kh),new olympe.T.zb(olympe.auth.td.Re,olympe.T.hf.C.Kh)],(b,c,d,e,f,g,h,k,l,n,p,q,r,t)=>{const u=[];q&&u.push(new olympe.auth.Hb.Ji(q,e));r&&u.push(new olympe.auth.Hb.Ee(r));t&&p&&u.push(new olympe.auth.Hb.Re(t,p));p&&c&&u.push(new olympe.auth.Hb.im(p,c.Ur()));if(0===u.length)throw Error('At least one provider is needed for auth to start');if(!u.map(v=>v.ma()).includes(f))throw Error('Default provider name'+f+'given by parameter'+olympe.auth.Config.Dl+'cannot be found');return new olympe.auth.sa(b,
385
- c,e,p,d.pj()?d:null,u,f,g,h,k,l,n)},!0)},'olympe.auth');olympe.T.run([olympe.auth.O.va],a=>{olympe.auth.Qc=()=>a});olympe.dc={};olympe.dc.za={ORIGIN:'<',DESTINATION:'>'};z('olympe.dc.Direction',olympe.dc.za);olympe.dc.ic={Tc:'ff022000000000000000',yi:'ff02200000000000000e',ko:'ff02200000000000000f'};olympe.dc.$b={VERSION:'@v',Jd:'@s'};olympe.dc.Ug={mc:'?'};olympe.dc.xk={cq:'online',em:'offline',yt:'invalidate'};olympe.dc.Ja={rb:'self',Vc:'server',lq:'peer',mc:'server'};olympe.dc.xa=function(a){if('string'===typeof a)return a;let b=null;a=olympe.D.Ya(a);void 0!==a&&null!==a&&(a=a.valueOf(),'string'===typeof a?b=a:a.R?b=a.R():'function'===typeof a&&(b=olympe.dc.Ba.Tb(a)));return b||''};z('olympe.dc.instanceToTag',olympe.dc.xa);olympe.dc.Na=function(){return olympe.dc.Ad().view};olympe.dc.register=function(a,b){olympe.dc.Ba.C(a,b)};olympe.dc.defineProperty=function(a){return new olympe.dc.ta.Property(a)};
386
- olympe.dc.jh=function(a,b=olympe.dc.za.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.za.DESTINATION){const e=olympe.dc.za.DESTINATION;return b===olympe.dc.za.ORIGIN||b===e?new olympe.dc.ta.Relation(a,b):new olympe.dc.ta.Relation(a,d,b,c)};olympe.dc.Ov=function(a){return a.Pc()};olympe.dc.Writable=class{F(){}pc(){}Jc(){}Ra(){}ec(){}};olympe.dc.om=class{Mc(){}Y(){}G(){}};function rc(a,b,c,d,e,f,g){d=new olympe.dc.ga(olympe.dc.ga.ja.Th,{file:b,url:null,content:c,$e:e?h=>{sc(a,b,c);f(h)}:f,mimeType:d,te:g||null},[olympe.dc.Na().source(b)||olympe.dc.Ja.Vc]);a.F.send(d)}function tc(a,b,c,d,e,f){c=c instanceof olympe.D.Wa?c.valueOf():c;'string'===typeof c?c=new Blob([Da(c)],{type:d}):c instanceof ArrayBuffer&&(c=new Blob([c],{type:d}));rc(a,b,c,d,a.G,e,f)}
387
- function sc(a,b,c){const d=olympe.dc.xa(b);a.C.set(d,c);const e=olympe.W.Ag();uc(olympe.dc.Na(),d,f=>{f||(a.C.delete(d),vc(olympe.dc.Na(),d,e))},e)}function wc(a,b,c,d){olympe.D.hs([b.$r(),b.R(),b.Ul(),b.jn()],(e,f,g,h)=>{a.C.has(f)?c(a.C.get(f)):(e=new olympe.dc.ga(olympe.dc.ga.ja.Bh,{file:f,url:e.valueOf()?null:g,mimeType:h.valueOf(),$e:a.G?k=>{sc(a,f,k);c(k)}:c,te:d},[olympe.dc.Na().source(f)||olympe.dc.Ja.Vc]),a.F.send(e))})}
388
- olympe.dc.lt=class{constructor(a,b,c,d,e){this.L=a;this.F=c;this.G=e;this.C=new Map}};olympe.dc.sa=class{constructor(a){this.L=a}};function xc(a,b){a.F=b;return a}function M(a,b){a.Yh.unshift(b);return a}olympe.dc.ga=class{constructor(a,b,c){this.type=a;this.content=b;this.C=c;this.Yh=[];this.F=olympe.D.Ia()}validate(a=null){this.Yh.forEach(b=>{b(a||null)})}toString(){const a=olympe.W.Sr(olympe.dc.ga.ja,this.type);return a?a:'UNKNOWN_MESSAGE'}};
389
- olympe.dc.ga.ja={qc:1,og:2,Sg:10,Qz:11,Pu:20,YA:21,ZA:22,Ru:23,Bi:24,Ai:25,Rz:26,$o:28,rm:30,tm:31,yu:32,eh:40,Bk:41,Ah:45,Jj:46,Tj:47,Th:50,Bh:51,xi:52,ev:60,Eu:61,nt:62,ot:63,Js:64,ul:65,Pz:90,Cl:91,Ll:92,ap:93,Fp:94,ik:95,Qu:96,QUERY_RESULT:97,sm:98};olympe.dc.rg=class{process(){}};olympe.dc.pm=class{constructor(...a){this.Ub=a}process(a,b,c){const d=this.Ub.length,e=(f,g,h)=>{g||f>=d?c(g,h):this.Ub[f].process(a,h,e.bind(null,f+1))};e(0,null,b)}};olympe.dc.pm.la=[olympe.dc.rg];olympe.dc.Hc=class{constructor(a){this.tag='string'===typeof a?a:a.R()}R(){return this.tag}toJSON(){return'{ "type": "reference", "tag": '+JSON.stringify(this.tag)+' }'}qb(a){return a instanceof olympe.dc.Hc&&this.tag===a.tag}static kc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.Hc(b.tag)}};olympe.dc.Hc.la=[olympe.dc.ze];olympe.dc.Hc.prototype.toJSON.K=olympe.D.J.C;olympe.dc.Hc.prototype.qb.K=olympe.D.J.C;olympe.dc.sg=class{send(){}C(){}ra(){}};const yc=olympe.dc.za.ORIGIN,zc=olympe.dc.za.DESTINATION,Ac=new Map,Bc=new Map,Cc=new Map,Dc=new Map;function Ec(a,b){var c=olympe.dm.File;let d=c;'function'===typeof c&&(d=b.entry);c=[...(d.In||[])];return olympe.dc.Ba.C(a,b,...c)}function Fc(a,b){Dc.set(a,b);return a}function Gc(a){return(a=Ac.get(a))&&a.C||olympe.dc.CloudObject}function Hc(a,b,c){const d=a+'@'+(b===zc?yc:zc);if(Bc.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);Bc.set(d,c)}
390
- function Ic(a){a=a.R()+'@'+a.Oa();return Bc.get(a)||olympe.dc.CloudObject}function N(a,b){b.NAME=a;Cc.set(a,b)}function O(a){return a.NAME||null}
391
- olympe.dc.Ba=class{constructor(){}static C(a,b,...c){if(Ac.has(a))throw Error(`Tag: ${a} - overwriting already defined sync ${Ac.get(a).C.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.T.zb(g):g}}b=new olympe.dc.ta.Entry(a,b,d);Ac.set(a,b);return b.C.entry=b}static Tb(a){return(a=a.entry)&&a.R()||null}};olympe.dc.ta={};function P(a,b){b=b.Pc();Hc(b.R(),b.Oa(),a.C);return b}function Jc(a){a.F=!0;return a}
392
- olympe.dc.ta.Entry=class{constructor(a,b,c){this.tag=a;this.C=b;this.In=c||null;this.F=!1}R(){return this.tag}instantiate(a,b){const c=this.C;if(this.mj()&&b.getParameter(olympe.dc.Config.Ho)){var d=olympe.dc.Na();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.R()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.pa.Xa('dc').error(d)}return this.In?(a=[void 0,a].concat(na(b,this.In)),new c(...a)):new c(void 0,
393
- a)}Ca(a){return new olympe.dc.ta.Property(a)}Pa(a,b=olympe.dc.za.DESTINATION){Hc(a,b,this.C);return new olympe.dc.X.Qb(a,b)}mj(){return this.F}};z('olympe.dc.registry.Entry',olympe.dc.ta.Entry);olympe.dc.ta.Entry.prototype.addRelation=olympe.dc.ta.Entry.prototype.Pa;olympe.dc.ta.Entry.prototype.addProperty=olympe.dc.ta.Entry.prototype.Ca;olympe.dc.ta.Entry.la=[olympe.dc.ze];olympe.dc.ta.Property=class{constructor(a){this.tag=a}R(){return this.tag}};olympe.dc.ta.Property.prototype.getTag=olympe.dc.ta.Property.prototype.R;olympe.dc.ta.Property.la=[olympe.dc.ze];olympe.dc.ta.Relation=class{constructor(a,b=olympe.dc.za.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.xa(a);this.direction=b;this.origin=c;this.destination=d}R(){return this.tag}Oa(){return this.direction}type(){return this.destination}Pc(){return new olympe.dc.ta.Relation(this.tag,this.direction===olympe.dc.za.DESTINATION?olympe.dc.za.ORIGIN:olympe.dc.za.DESTINATION,this.destination,this.origin)}qb(a){return a instanceof olympe.dc.ta.Relation?a.R()===this.R()&&
394
- a.Oa()===this.Oa():!1}toString(){return this.direction+this.tag}};olympe.dc.ta.Relation.prototype.getInverse=olympe.dc.ta.Relation.prototype.Pc;olympe.dc.ta.Relation.prototype.getDirection=olympe.dc.ta.Relation.prototype.Oa;olympe.dc.ta.Relation.prototype.getTag=olympe.dc.ta.Relation.prototype.R;olympe.dc.ta.Relation.la=[olympe.dc.ze];olympe.dc.db={};function Kc(a,b,c,d,e,f=olympe.dc.Ja.rb){const g=c.Y();Lc(a.C,b,c,d,e,f);return h=>{if(h)a.C.push(g);else{h=a.C;const k=h.F.get(g);if(void 0!==k){const l=h.C.indexOf(g);h.C.splice(l,1);Mc(h,Nc(h,k.C,h.C.length),k.source);h.F.delete(g)}}}}function Oc(a,b){a.Ha.Sa(b)}function Pc(a,b,c){b&&a.Ha.Xc(b);c&&a.Ha.Nd(c)}
395
- olympe.dc.db.Zs=class{constructor(a,b,c,d,e){this.L=a;this.Ha=b;this.C=new olympe.dc.db.Os(a,b,d);this.view=new olympe.dc.ib(a,b);this.Cx=new olympe.dc.db.ju(this.L,this.view,b,e)}Xa(){return this.L}persist(a){this.Ha.Da();this.Ha.Ab(a,olympe.dc.db.Instance.C.oq);this.Ha.ra()}bf(a,b){this.C.bf(a,b)}};const Qc=olympe.dc.$b.VERSION,Rc=olympe.dc.$b.Jd,Sc=olympe.dc.ic.Tc,Tc=olympe.dc.ic.yi;
396
- olympe.dc.db.Database=class a extends Map{constructor(b,c){super();this.id=olympe.W.lc();this.L=b;this.cc=olympe.D.Ia();this.He=c.get('defaultSource')||olympe.dc.Ja.rb;this.V=olympe.dc.db.Database.F.IDLE;this.ka=new Map;this.Xb=[];this.G=[];this.bb=new Map;b=c.get('garbageCollector')||olympe.dc.db.Ci.C.Fl;new olympe.dc.db.Ci(this,b,this.cc);c.get('debug')&&this.Wf()}Y(){return this.id}getState(){return this.V}Xa(){return this.L}create(b,c){const d=this.N(b,!0);d.cc(c&&parseInt(c.get(Qc),10)||1);d.mi(c&&
397
- c.get(Rc)||this.He);c&&(c.delete(Qc),c.delete(Rc),this.qe(d,c));this.C(a.C.yp,b)}update(b,c,d=!1){if(void 0!==c&&null!==c){b=this.N(b,!0);var e=c&&parseInt(c.get(Qc),10);0>e||!d&&b.version()>=e||(c.delete(Qc),b.cc(isNaN(e)?b.version()+1:e),this.qe(b,c))}}Jc(b){const c=this.get(b);void 0!==c&&(this.ab(c,!1),this.C(a.C.zp,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case Sc:c.Ve(d);break;case Tc:c.qe(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!==
398
- d)switch(b){case Sc:c.wh(d);break;case Tc:c.Xf(d);break;default:c.unlink(b,d)}}Xc(b){for(const c of b)this.N(c).Ge()}Nd(b){for(const c of b)(b=this.get(c))&&b.detach()}Ab(b,c){b.forEach(d=>{this.N(d).Qf(c)})}zc(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.C(a.C.Go,b))}N(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.C(a.C.Fo,b),c&&this.C(a.C.Dk,b));return d}Z(b,c,d=!1,e=null){return{[Symbol.iterator]:function*(f){const g=olympe.dm.Relation.C.Ck,
399
- h=olympe.dm.Relation.C.rk,k=olympe.dc.za.ORIGIN,l=olympe.dc.za.DESTINATION,n=a.bc.Oh+c,p=d?h:g,q=d?g:h,r=(new Map).set(f,!1),t=(v,w)=>(v=this.get(v))&&0!==(v.get(n)&w),u=([v,w])=>!r.has(v)&&(e?e(w):!0);for(const v of r.keys())r.get(v)||(r.set(v,!0),yield v),f=this.get(v),void 0!==f&&f.forEach((w,y)=>{(y[0]===k&&t(y.substring(1),q)||y[0]===l&&t(y.substring(1),p))&&Array.from(w.entries()).filter(u).forEach(([A])=>{r.set(A,!1)})})}.bind(this,b)}}ce(b){this.G[0].Te(olympe.W.Ag(),b)}aa(b){if(0===this.G.length)debugger;
400
- this.G[0].C.delete(b)}C(b,c,...d){this.ka.has(b)&&this.ka.get(b).forEach(e=>{e(c,...d)})}ab(b,c){this.bb.set(b,c)}Pf(b,c,d,e){0<this.G.length&&Uc(this.G[0],b).Ca(e?Vc+c:c,d)}Qf(b,c,d,e,f){if(0<this.G.length){var g=this.G[0];d===Wc?f?Uc(g,b).link(c,e):Uc(g,b).unlink(c,e):f?Uc(g,b).bb(c,e):Uc(g,b).Ab(c,e)}}F(b,c){let d=this.ka.get(b);void 0===d&&(d=[],this.ka.set(b,d));d.push(c)}Sa(b){this.Xb.push(b)}Ve(b){return this.G.reduce((c,d)=>d.G.has(b)||c,!1)}Da(){this.V===a.F.IDLE&&(this.V=a.F.Ds);this.G.unshift(new olympe.dc.db.dt(this,
401
- this.cc))}ra(){this.V=a.F.cg;this.Xf();Xc(this.G[0]);this.G.shift();0===this.G.length&&(this.V=a.F.IDLE,this.Xb.forEach(b=>{b()}))}qe(b,c){const d=a.bc.mc;for(const [e,f]of c)void 0!==f&&(e[0]===d?b.ji(e.substr(1),f):b.update(e,f))}Xf(){const b=a.bc.ORIGIN,c=this.bb,d=new Map,e=(g,h)=>{const k=g.get(b+Sc);k&&k.forEach((l,n)=>{g!==l&&(d.set(l,h),c.delete(n),e(l,h))})};c.forEach((g,h)=>{d.set(h,g);e(h,g)});const f=this.G[0];d.forEach((g,h)=>{h.ce(g)&&(h=h.tag(),g?Uc(f,h).create():Uc(f,h).delete())});
402
- this.bb.clear()}Wf(){const b=a.bc.DESTINATION,c=a.C.Hl,d=a.C.qk,e=new Set,f=new Map;this.F(a.C.yp,g=>{e.add(g)});this.F(c,g=>{e.delete(g);f.delete(g)});this.F(d,(g,...h)=>{if(h[0]===Tc&&h[1]===b){const k=h[2];this.get(k).Gb()||(h=f.get(k)||new Set,0===h.size&&f.set(k,h),h.add(g))}});this.Sa(()=>{e.forEach(g=>{const h=this.get(g);h&&null===h.model()&&this.L.error(`\n[DEBUG - DATABASE]\nInstance ${g} created but does not exist !\n${h.toString()}`)});e.clear();f.forEach((g,h)=>{const k=this.get(h);k&&
403
- this.L.error(`\n[DEBUG - DATABASE]\nThe model ${h} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(g.values()).join(', ')}`+`\n\n ${k.toString()}`)});f.clear()})}};olympe.dc.db.Database.bc={Oh:'$',wt:'~',mc:'?',ol:'=',fo:'@',ORIGIN:olympe.dc.za.ORIGIN,DESTINATION:olympe.dc.za.DESTINATION};olympe.dc.db.Database.C={Fo:0,Go:1,hr:2,Dk:3,ho:4,io:5,Hl:6,Fc:7,qk:8,um:9,yp:10,zp:11,Aq:12};olympe.dc.db.Database.F={IDLE:0,Ds:1,cg:2};const Q=olympe.dc.db.Database.C,Yc=olympe.dc.db.Database.bc.Oh,Zc=olympe.dc.db.Database.bc.wt,$c=olympe.dc.db.Database.bc.mc,ad=olympe.dc.db.Database.bc.ol,bd=olympe.dc.db.Database.bc.fo,R=olympe.dc.za.ORIGIN,S=olympe.dc.za.DESTINATION,cd=olympe.dc.ic.Tc,dd=olympe.dc.ic.yi;
404
- olympe.dc.db.Instance=class a extends Map{constructor(b,c){super();this.C=b;this.Xc=olympe.dc.Ja.rb;this.e=!1;this.bb=0;this.F=void 0;this.c=0;this.ka=a.C.oq;this.db=c}tag(){return this.C}Gb(){return this.e}Ab(){return this.db.Ve(this.C)}source(){return this.Xc}version(){return this.bb}model(){const b=this.get(S+cd);return b&&b.values().next().value||null}Bf(){const b=this.get(S+dd);return b&&b.values().next().value||null}persisted(){return this.ka!==a.C.sr}toString(){var b=this.fb(olympe.dc.CloudObject.nameProp.R());
405
- b=`Instance: ${this.C}, Exist: ${this.e}, Name: ${b}`;var c=this.model();if(c){var d=c.fb(olympe.dc.CloudObject.nameProp.R())||'No model name';b+=`\nModel: ${c.C}, Exist: ${c.e}, Model name: ${d}`}else b+='\nModel: no model';(c=this.Bf())?(d=c.fb(olympe.dc.CloudObject.nameProp.R())||'No extension name',b+=`\nExtension: ${c.C}, Exist: ${c.e}, Extension name: ${d}`):b+='\nExtension: no extension';return b}fb(b,c=!1){const d=this.get(Yc+b);return c||void 0!==d?d:this.get(ad+b)}ra(b,c=!1){const d=this.get($c+
406
- b);return c||void 0!==d?d:this.get(Zc+b)}update(b,c){const d=Yc+b;var e=this.get(d),f=e=void 0===e?null:e;(null!==f&&'function'===typeof f.qb?f.qb(c):f===c)||(e instanceof olympe.dc.Hc&&(this.db.get(e.R()).zc(),this.db.Jc(e.R())),c instanceof olympe.dc.Hc&&(e=this.db.N(c.R(),!0),e.F&&e.F.tag!==this.C&&this.db.Xa().fatal('Instance',c.R(),'referenced multiple times!\nThis instance is currently property of',e.F.tag,'(for the property '+e.F.kb+')','and is assigned as a property of',this.C,'(for the property '+
407
- b+')'),e.Wf(this.C,b)),e=ad+b,null===c?(this.delete(d),c=(c=this.model())&&c.ra(b),void 0!==c?(this.set(e,c),this.N(b,c,!0)):this.N(b,null,!1)):(this.set(d,c),this.delete(e),this.N(b,c,!1)))}ji(b,c){const d=$c+b;var e=this.get(d);(void 0===e?null:e)!==c&&(e=Zc+b,null===c?(this.delete(d),c=(c=this.Bf())&&c.ra(b),c=void 0===c?null:c,null!==c&&this.set(e,c),this.Z((new Map).set(b,c))):(void 0!==this.get(e)&&this.delete(e),this.set(d,c),this.Z((new Map).set(b,c))))}link(b,c){var d=R+b;const e=this.ab(S+
408
- b);d=c.ab(d);e.has(c.C)||(e.set(c.C,c),d.set(this.C,this),this.db.C(Q.qk,this.C,b,S,c.C),this.db.C(Q.qk,c.C,b,R,this.C),this.e&&c.e&&(this.G(b,S,c,!0),c.G(b,R,this,!0)))}unlink(b,c){const d=R+b;void 0!==this.Sa(S+b,c.C)&&(c.Sa(d,this.C),this.db.C(Q.um,this.C,b,S,c.C),this.db.C(Q.um,c.C,b,R,this.C),this.e&&c.e&&(this.G(b,S,c,!1),c.G(b,R,this,!1)))}Ve(b){const c=this.model();if(null!==c){if(c===b)return;this.unlink(cd,c)}this.link(cd,b);b.forEach((d,e)=>{e[0]!==$c&&e[0]!==Zc||this.Da(e.substr(1),d)});
409
- (b.e||b===this)&&this.db.ab(this,!0)}wh(b){this.unlink(cd,b);this.forEach((c,d)=>{this.Da(d.substr(1),null)});this.db.ab(this,!1)}qe(b){const c=this.Bf();if(null!==c){if(c===b)return;this.unlink(dd,c)}this.link(dd,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===$c||f[0]===Zc)f=f.substr(1),this.has($c+f)||(this.set(Zc+f,e),d.set(f,e))});this.Z(d)}Xf(b){this.unlink(dd,b);const c=new Map;this.forEach((d,e)=>{e[0]===Zc&&(this.delete(e),c.set(e.substr(1),null))});this.Z(c)}Xb(b,c,d){const e=(...f)=>{var g=
410
- f.length;const h=f[g-2];(g=this.db.get(f[g-1]))&&(h?g.Ge():g.detach());d(...f)};this.Te(b,c,e);return e}Te(b,c,d){const e=this.ab(bd+b);e.has(c)||(e.set(c,d),this.Ge(),this.db.C(Q.ho,this.C,b,c))}V(b,c){const d=this.Sa(bd+b,c);void 0!==d&&(this.detach(),this.db.C(Q.io,this.C,b,c));return d}mi(b){this.Xc=b}cc(b){this.bb=b}Qf(b){this.ka=b;this.aa()||this.db.C(Q.Dk,this.C)}ce(b){const c=this.e!==b;c&&(b?(this.e=b,this.Pf()):(this.He(),this.e=b),this.Nd(b));return c}Ge(){this.c++;1===this.c&&this.db.C(Q.hr,
411
- this.C)}detach(){0<this.c?--this.c:this.db.C(Q.Aq,this.C,`Try to decrease references on instance ${this.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===this.c&&this.db.C(Q.Dk,this.C)}aa(){return 0<this.c||this.ka===olympe.dc.db.Instance.C.pq}clear(){this.forEach((b,c)=>{const d=c[0];if(d===R||d===S){const e=c.substr(1),f=d===R?S:R;
412
- b.forEach(g=>{const h=g.get(f+e);h.delete(this.C);0===h.size&&g.delete(f+e)})}d===Yc&&b instanceof olympe.dc.Hc&&this.db.get(b.R()).zc()});void 0!==this.F&&this.db.get(this.F.tag).delete(Yc+this.F.kb)}Wf(b,c){void 0===this.F&&this.Ge();this.F={tag:b,kb:c}}zc(){void 0!==this.F&&(this.detach(),this.F=void 0)}Pf(){this.forEach((b,c)=>{const d=c[0];if(d===R||d===S){const e=c.substr(1),f=d===R?S:R;b.forEach(g=>{g.e&&(this.G(e,d,g,!0),g.G(e,f,this,!0))})}else d!==Yc&&d!==ad||this.N(c.substr(1),b,d===ad)})}He(){this.forEach((b,
413
- c)=>{const d=c[0];if(d!==bd){var e=c.substr(1);d===R?b.forEach(f=>{f.unlink(e,this)}):d===S?b.forEach(f=>{this.unlink(e,f)}):d===Yc&&this.update(d,null);this.delete(c)}});this.bb=0;if(void 0!==this.F){const b=this.db.get(this.F.tag),c=b.get(Yc+this.F.kb);c&&c.R&&c.R()===this.C&&b.update(this.F.kb,null)}}Nd(b){this.db.C(b?Q.Hl:Q.Fc,this.C)}N(b,c,d){this.e&&this.db.Pf(this.C,b,c,d)}G(b,c,d,e){this.db.Qf(this.C,b,c,d.C,e)}Z(b,c=[]){var d=this.get(R+cd);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>e.Da(g,
414
- f))});d=this.get(R+dd);void 0!==d&&d.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has($c+k)||(g.set(k,h),null!==h?e.set(Zc+k,h):e.delete(Zc+k))});e.Z(g,[...c,f])}})}Da(b,c){if(!this.has(Yc+b)){const d=ad+b,e=this.get(d);c!==(void 0!==e?e:null)&&(null===c?this.delete(d):this.set(d,c),this.N(b,c,null!==c))}}ab(b){let c=this.get(b);void 0===c&&(c=new Map,this.set(b,c));return c}Sa(b,c){const d=this.get(b);if(void 0!==d){const e=d.get(c);d.delete(c);0===d.size&&this.delete(b);
415
- return e}}};olympe.dc.db.Instance.C={sr:0,pq:1,oq:2};const Wc=olympe.dc.db.Database.bc.DESTINATION,Vc=olympe.dc.db.Database.bc.ol,ed=olympe.dc.db.Database.bc.Oh,fd=olympe.dc.db.Database.bc.fo,gd=olympe.dc.db.Database.bc.ORIGIN+Wc,hd=ed+ed;
416
- function Xc(a){const b=a.Ha;a.F.forEach((c,d)=>{const e=b.get(d);if(c.se()||c.N()){var f=e.get(fd);f&&id(a,f,c.se(),d);c.N()&&a.G.add(d)}for(const [l,n]of c.rd()){var g=l[0]===Vc;d=a;var h=e;f=g?l.substr(1):l;var k=n;const p=h.get(fd+ed+f);p&&id(d,p,k,g);(h=h.get(fd+hd))&&id(d,h,f,k,g)}for(const l of c.Sa())jd(a,e,...l)});a.F.clear();kd(a)}function Uc(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.mg(b),a.F.set(b,c));return c}
417
- function id(a,b,...c){b.forEach((d,e)=>{a.Te(e,d.bind(null,...c))})}function jd(a,b,c,d,e,f){const g=b.get(fd+d+c);g&&id(a,g,f,e);(b=b.get(fd+gd))&&id(a,b,c,d,f,e)}function kd(a){a.N.run(()=>{const b=a.C;for(const [d,e]of a.buffer){var c=b.get(d);(c=c&&c[e])&&c()}});a.C.clear();a.buffer.length=0}
418
- olympe.dc.db.dt=class{constructor(a,b){this.Ha=a;this.N=b;this.F=new Map;this.G=new Set;this.C=new Map;this.buffer=[]}Te(a,b){let c=this.C.get(a);void 0===c&&(c=[],this.C.set(a,c));this.buffer.push([a,c.length]);c.push(b)}};function ld(a){const b=olympe.dc.db.Database.C.Go,c=olympe.dc.db.Database.C.Hl,d=olympe.dc.db.Database.C.Fc,e=olympe.dc.db.Database.C.qk,f=olympe.dc.db.Database.C.um,g=olympe.dc.db.Database.C.ho,h=olympe.dc.db.Database.C.io,k=()=>{};a.Ha.F(olympe.dc.db.Database.C.Fo,()=>{});a.Ha.F(b,()=>{});a.Ha.F(c,l=>{a.Ha.ce(()=>{md(a.view,l,k,`monitorRelations${l}`)})});a.Ha.F(d,l=>{a.Ha.ce(()=>{nd(a.view,l,`monitorRelations${l}`)})});a.Ha.F(e,()=>{});a.Ha.F(f,()=>{});a.Ha.F(g,()=>{});a.Ha.F(h,()=>{})}
419
- olympe.dc.db.ju=class{constructor(a,b,c,d){this.L=a;this.view=b;this.Ha=c;d&&ld(this)}debug(a){const b=olympe.dc.xa(a);if(this.Ha.has(b)){var c=this.Ha.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Gb()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.Ha.get(d[d.length-1]);const e=olympe.dc.db.Database.bc.Oh+olympe.dc.CloudObject.nameProp.R();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+' (name: '+c.get(e)+') has no model.\nList: '+
420
- d.join(' --M--\x3e ')}this.L.info(a)}else this.L.info('[DATABASE] Instance',b,'has never been created or referred by the database')}};olympe.dc.db.Ci=class a{constructor(b,c,d){this.L=b.Xa();this.Ha=b;this.F=new Set;this.mode=c;this.N=d;this.C=!1;c!==a.C.Fl&&this.V()}run(){if(!this.C)switch(this.mode){case a.C.ws:this.C=!0;this.N.run(()=>{Ib(()=>{this.G();this.C=!1},0)});break;case a.C.Uq:this.C=!0,this.G(),this.C=!1}}G(){const b=this.Ha,c=olympe.dc.Rb.rf,d=this.F,e=h=>b.get(h);var f=h=>!(h.persisted()||h.aa());for(var g of d){const h=b.get(g);if(h&&!h.aa()){if(!h.persisted())continue;Array.from(b.Z(g,c,!1,f)).forEach(k=>{d.add(k)});
421
- b.zc(g)}d.delete(g)}for(const h of d)f=Array.from(b.Z(h,c,!0)).map(e),g=Array.from(b.Z(h,c)).map(e),f.some(k=>k.aa())?g.filter(k=>!k.persisted()).forEach(k=>{d.delete(k.tag())}):f.concat(g).filter(k=>!k.persisted()).map(k=>k.tag()).forEach(k=>{d.delete(k);b.zc(k)});d.clear()}V(){this.Ha.Sa(this.run.bind(this));const b=olympe.dc.db.Database.C.hr,c=olympe.dc.db.Database.C.zp,d=olympe.dc.db.Database.C.Aq,e=olympe.dc.db.Database.F.IDLE,f=g=>{this.F.add(g);this.Ha.getState()===e&&this.run()};this.Ha.F(olympe.dc.db.Database.C.Dk,
422
- f.bind(this));this.Ha.F(c,f.bind(this));this.Ha.F(b,g=>{this.F.delete(g)});this.Ha.F(d,(g,...h)=>{this.L.error(h[0])})}};olympe.dc.db.Ci.C={Fl:0,Uq:1,ws:2};const od=olympe.dc.db.Database.bc.ORIGIN,pd=olympe.dc.db.Database.bc.DESTINATION,qd=olympe.dc.db.Database.bc.Oh,rd=olympe.dc.db.Database.bc.ol,sd=od+pd,td=qd+qd,ud=olympe.dc.db.Database.F;function uc(a,b,c,d){const e=a.Ha.N(olympe.dc.xa(b));d=d||vd(a);e.Te('',d,c);e.Gb()&&a.G.run(()=>{c(!0,b)});return d}function vc(a,b,c,d=!1){const e=U(a,b);if(null!==e){const f=e.V('',c);void 0!==f&&(a.Ha.getState()===ud.cg&&a.Ha.aa(c),!d&&e.Gb()&&a.G.run(()=>{f(!1,b)}))}}
423
- function md(a,b,c,d){const e=a.Ha.N(olympe.dc.xa(b));b=d||vd(a);const f=e.Xb(sd,b,c);e.Gb()&&e.forEach((g,h)=>{g=h[0];g!==od&&g!==pd||wd(a,e,h,!0,f,!0)})}function nd(a,b,c){const d=U(a,b);if(null!==d){const e=d.V(sd,c);void 0!==e&&(a.Ha.getState()!==ud.cg||d.Ab()||a.Ha.aa(c),d.Gb()&&d.forEach((f,g)=>{f=g[0];(f===od||f===pd)&&e&&wd(a,d,g,!1,e,!0)}))}}function vd(a){++a.N;return String(a.N)}
424
- function xd(a,b,c,d,e){b=a.Ha.N(olympe.dc.xa(b));c=olympe.dc.xa(c);const f=qd+c;e=e||vd(a);b.Te(f,e,d);if(b.Gb()){let g=!1,h=b.get(f);void 0===h&&(g=!0,h=b.get(rd+c));if(void 0===h)return e;a.G.run(()=>{d(h,g)})}return e}function U(a,b,c=!1){if(null===b||void 0===b)throw Error('Provided tag is null or undefined.');a=a.Ha.get(olympe.dc.xa(b));return!a||c&&!a.Gb()?null:a}
425
- function yd(a,b,c){b=a.Ha.N(olympe.dc.xa(b));const d=vd(a);b.Te(td,d,c);b.Gb()&&b.forEach((e,f)=>{const g=f[0];g!==qd&&g!==rd||a.G.run(()=>{c(f.substr(1),e,g===rd)})});return d}function wd(a,b,c,d,e,f){(b=b.get(c))&&b.forEach((g,h)=>{g.Gb()&&(f?a.G.run(()=>{e(c.substr(1),c[0],d,h)}):a.G.run(()=>{e(d,h)}))})}function V(a,b,c,d,e){b=a.Ha.N(olympe.dc.xa(b));c=c.Oa()+c.R();e=e||vd(a);d=b.Xb(c,e,d);b.Gb()&&wd(a,b,c,!0,d,!1);return e}function zd(a,b,c){return c===olympe.dc.Rb.NONE?0:a.fb(b,c,!0)||0}
426
- function Ad(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===od||c===pd){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(U(a,b,!0))}function Bd(a,b,c){if(!a.Gb(b))return a.L.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.xa(b)];for(const f of e){const g=a.ub(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.L.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.xa(b)}`);return d}
427
- function Cd(a,b,c){return null!==a.$m(c,olympe.dc.CloudObject.extendRel,d=>olympe.dc.Na().al(d,olympe.dc.CloudObject.propertyRel,b))}function Dd(a,b,c,d){return(c=(a=U(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Gb()).length:0}
428
- olympe.dc.ib=class{constructor(a,b){this.L=a;this.G=new olympe.D.Wb('DB View context');this.Ha=b;this.N=0}Y(){return this.Ha.Y()}F(a,b,c){a=U(this,a);null!==a&&(b=olympe.dc.xa(b),a.V(qd+b,c),this.Ha.getState()===ud.cg&&this.Ha.aa(c))}C(a,b,c,d=!1){a=U(this,a);if(null!==a){b=b.Oa()+b.R();const e=a.V(b,c);void 0!==e&&(this.Ha.getState()!==ud.cg||a.Ab()&&!d||this.Ha.aa(c),!d&&a.Gb()&&wd(this,a,b,!1,e,!1))}}Gb(a){a=U(this,a);return!(!a||!a.Gb())}name(a){return(a=U(this,a))?a.fb(olympe.dc.CloudObject.nameProp.R()):
429
- ''}model(a){return(a=(a=U(this,a,!0))?a.model():null)?a.tag():null}Bf(a){return(a=(a=U(this,a,!0))&&a.Bf())?a.tag():null}nj(a){a=U(this,a,!0);return!(!a||!a.Bf())}th(a,b){a=(a=U(this,a,!0))&&a.model();return!(!a||!this.Sf(a.tag(),b))}version(a){return(a=U(this,a,!0))&&a.version()}source(a){return(a=U(this,a,!0))&&a.source()}Vf(a){return(a=U(this,a,!1))?!!a.persisted():!0}fb(a,b,c){b=(a=U(this,a,!0))?a.fb(olympe.dc.xa(b),c):null;return void 0!==b?b:null}rd(a,b=!1){var c=U(this,a,!0);a=new Map;if(c)for(const [d,
430
- e]of c)c=d[0],(c===qd||!b&&c===rd)&&a.set(d.substring(1),e);return a}ub(a,b){return this.jj(a,[b])}al(a,b,c){return this.ub(a,b).includes(olympe.dc.xa(c))}jj(a,b){a=U(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=U(this,d,!0).get(c.Oa()+c.R()),void 0!==a)for(const e of a.values())e.Gb()&&b.push(e.tag());a=b}return a}fc(a,b){var c=U(this,a,!0);return c?(c=c.get(b.Oa()+b.R()))&&1<c.size?(this.L.warn(`Relation ${b.R()} to instance ${a} is not unique: found ${c.size} related items`),
431
- null):(a=c?c.values().next().value:null)&&a.Gb()?a.tag():null:null}Nf(a,b,c){a=olympe.dc.xa(a);const d=Bd(this,a,b);d.delete(a);return c?(c=olympe.dc.xa(c),d.has(c)?Array.from(Bd(this,c,b.Pc()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}$m(a,b,c){if(!this.Gb(a))return null;b=Bd(this,a,b);const d=[olympe.dc.xa(a)];for(const e of d){if(c(e))return e;if(a=b.get(e))for(const f of a.filter(g=>!d.includes(g)))d.push(f)}return null}an(a,b,c){return this.jj(a,b).find(c)||null}Zv(a,b,c){return this.jj(a,
432
- b).filter(c)}gn(a,b=olympe.dc.CloudObject){var c=U(this,a,!0);const d=b&&U(this,b,!0),e=[c];for(;c&&c!==d;){c=c.Bf();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Gb())throw a=`Try to get all extensions of the model ${olympe.dc.xa(a)} but one of them does not exists (${c.tag()})`,Error(a);null!==c&&e.push(c)}c=U(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}).`);
433
- return e.map(f=>f.tag())}Sf(a,b){const c=olympe.dc.xa(b);return!!this.$m(a,olympe.dc.CloudObject.extendRel,d=>d===c)}ee(a){return this.ub(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.ib.prototype.getInstances=olympe.dc.ib.prototype.ee;olympe.dc.ib.prototype.isExtending=olympe.dc.ib.prototype.Sf;olympe.dc.ib.prototype.getExtendedModels=olympe.dc.ib.prototype.gn;olympe.dc.ib.prototype.findAllRelated=olympe.dc.ib.prototype.Zv;olympe.dc.ib.prototype.findRelated=olympe.dc.ib.prototype.an;
434
- olympe.dc.ib.prototype.findRecursive=olympe.dc.ib.prototype.$m;olympe.dc.ib.prototype.getRecursiveRelated=olympe.dc.ib.prototype.Nf;olympe.dc.ib.prototype.getUniqueRelated=olympe.dc.ib.prototype.fc;olympe.dc.ib.prototype.getMultiRelated=olympe.dc.ib.prototype.jj;olympe.dc.ib.prototype.isRelated=olympe.dc.ib.prototype.al;olympe.dc.ib.prototype.getRelated=olympe.dc.ib.prototype.ub;olympe.dc.ib.prototype.getProperties=olympe.dc.ib.prototype.rd;olympe.dc.ib.prototype.getProperty=olympe.dc.ib.prototype.fb;
435
- olympe.dc.ib.prototype.isPersisted=olympe.dc.ib.prototype.Vf;olympe.dc.ib.prototype.instanceOf=olympe.dc.ib.prototype.th;olympe.dc.ib.prototype.isModel=olympe.dc.ib.prototype.nj;olympe.dc.ib.prototype.extension=olympe.dc.ib.prototype.Bf;olympe.dc.ib.prototype.model=olympe.dc.ib.prototype.model;olympe.dc.ib.prototype.name=olympe.dc.ib.prototype.name;olympe.dc.ib.prototype.exist=olympe.dc.ib.prototype.Gb;function Ed(a,b){let c=a.C.get(b);void 0===c&&(c=new olympe.dc.db.mg(b),a.C.set(b,c));return c}function Fd(a,b,c=olympe.dc.Rb.NONE){b=Gd(a,b,c);for(const d of b)Hd(a,d,!1),a.C.delete(d)}
436
- function Gd(a,b,c,d=!0){const e=olympe.dm.Relation.C.rk,f=olympe.dm.Relation.C.Ck,g=olympe.dc.za.ORIGIN,h=olympe.dc.Na();b=new Set([b]);const k=new Set;for(const n of b){var l=a.C.get(n);if(void 0!==l){for(const [p,q,r]of l.dd())r&&zd(h,p,c)&f?b.add(q):d||r||k.add(`${n}.${p}.${q}`);for(const [p,q,r]of l.ab())r&&zd(h,p,c)&e?b.add(q):d||r||k.add(`${q}.${p}.${n}`)}for(const [p,q,r]of Ad(h,n))l=q===g?e:f,!k.has(q===g?`${r}.${p}.${n}`:`${n}.${p}.${r}`)&&zd(h,p,c)&l&&b.add(r)}return Array.from(b).filter(n=>
437
- a.C.has(n))}function Hd(a,b,c){const d=olympe.dc.za.ORIGIN,e=olympe.dc.za.DESTINATION,f=a.C.get(b);for(const [h,k,l]of f.dd())if(l||!c){f.V(h,e,k);var g=a.C.get(k);g&&g.V(h,d,b)}for(const [h,k,l]of f.ab())if(l||!c)f.V(h,d,k),(g=a.C.get(k))&&g.V(h,e,b)}function*Id(a,b,c,d,e=[]){e.push(b);b=a.Jf(b);for(const [f,g]of b.ub(c))e.includes(f)||(yield*Id(a,f,c,d,e),yield d(f,g))}function Jd(a,b,c,d){const e=a.C.get(c);a=a.C.get(d);e&&e.V(b,olympe.dc.za.DESTINATION,d);a&&a.V(b,olympe.dc.za.ORIGIN,c)}
438
- olympe.dc.db.xc=class{constructor(a){this.id=a||olympe.W.ej();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.substr(0,a.length-2));return a+'}}'}static kc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=new olympe.dc.db.xc(b.id);b=b.instances;for(const c of Object.keys(b)){const d=olympe.dc.db.mg.kc(b[c]);a.C.set(c,d)}return a}Y(){return this.id}Mc(a){const b=
439
- olympe.dc.db.mg.C.bm,c=olympe.dc.db.mg.C.Fc,d=olympe.dc.db.mg.C.Ek;this.C.forEach((e,f)=>{const g=e.getState();switch(g.id){case b:a.F(f,e.Z()?e.rd():void 0);break;case d:e.Z()&&a.pc(f,e.rd(),g.bj);break;case c:a.Jc(f,g.bj)}for(const [h,k,l]of e.dd())l?a.Ra(h,f,k):a.ec(h,f,k)})}G(){let a=0;this.C.forEach(b=>{a+=b.cc()});return a}F(a,b){a=Ed(this,a).create();b&&a.ra(b)}pc(a,b,c){b&&(a=Ed(this,a).ra(b),c&&a.Xb())}Jc(a,b=olympe.dc.Rb.NONE){const c=this.C.get(a);if(c&&c.se())Fd(this,a,b);else{Ed(this,
440
- a).delete(b);for(const d of Gd(this,a,b,!1))this.C.get(d).rd().clear(),Hd(this,d,!0)}}Ra(a,b,c){Ed(this,b).link(a,c);Ed(this,c).bb(a,b)}ec(a,b,c){Ed(this,b).unlink(a,c);Ed(this,c).Ab(a,b)}ee(){return function*(a){for(const b of a.values())if(b.se()||b.N()||b.Z())yield b}(this.C)}Jf(a){return this.C.get(olympe.dc.xa(a))||null}dd(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.dd((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}Nf(a,b,c=(d,e)=>[d,e]){return Id(this,
441
- a,b,c)}};olympe.dc.db.xc.la=[olympe.dc.Writable,olympe.dc.om];const Kd=new Map;
442
- olympe.dc.db.mg=class a{constructor(b){this.ka=b;this.G=a.F(a.C.Ek,!1);this.F=this.Ka=this.C=null}toJSON(){let b='{ "tag": '+JSON.stringify(this.ka)+', "state": '+JSON.stringify(this.G);if(this.C){b+=', "properties": {';for(var c of this.C.keys()){const d=this.C.get(c);b+=JSON.stringify(c)+': ';b=d.toJSON?b+d.toJSON():b+JSON.stringify(d);b+=', '}b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}'}if(this.Ka){b+=', "relations": {';for(const d of this.Ka.keys()){c=this.Ka.get(d);b+=JSON.stringify(d)+
443
- ': {';for(const e of c.keys())b+=JSON.stringify(e)+': '+JSON.stringify(c.get(e))+', ';b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}, '}b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}'}return b+'}'}static kc(b){var c;'string'===typeof b?c=JSON.parse(b):c=b;b=new olympe.dc.db.mg(c.tag);b.G=c.state;const d=c.properties;if(d){b.C=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.Hc.kc(f):h=olympe.D.kc(f));null!==h&&void 0!==h&&b.C.set(e,h)}}if(c=
444
- c.relations){b.Ka=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.Ka.set(f,e)}}return b}static F(b,c){const d=String(b)+','+String(c);let e=Kd.get(d);void 0===e&&(e={id:b,bj:c},Kd.set(d,e));return e}tag(){return this.ka}getState(){return this.G}create(){this.G=a.F(a.C.bm);return this}delete(b=olympe.dc.Rb.NONE){this.G=a.F(a.C.Fc,b);this.C=null;return this}Xb(){this.G.id===a.C.Ek&&(this.G=a.F(a.C.Ek,!0))}Ca(b,c){if(this.G.type===a.C.Fc)return this;
371
+ function lc(a){null!==a.storage?(a.L.debug('Retrieving token from local storage'),a.storage.ed(b=>{if(b){const d=new olympe.auth.Request;var c=b.Sd();d.set('username',c);b=b.Kf();d.set('nonce',b);a.L.debug('Token found, trying login with',d);jc(a,d,a.fc)}else a.L.debug('No token found, cannot perform auto login. Falling back in GUEST state'),kc(a)})):(a.L.error('Cannot retrieve token: no storage configured, cannot perform auto login. Falling back in GUEST state'),kc(a))}
372
+ function mc(a,b){a.L.log('State change: ',oc(a),'--\x3e',b);a.G.update(b)}function kc(a){a.C.update(a.Da);mc(a,olympe.auth.sa.C.Ch);a.L.info('Authenticated as guest')}function oc(a){return olympe.D.Ya(a.G.Eb())}function pc(a){const b=olympe.auth.sa.C.Lg,c=olympe.auth.sa.C.Ch,d=olympe.auth.sa.C.oi,e=olympe.D.Kc(olympe.D.qa,'auth.isOnline');olympe.D.wc([a.G],f=>{f=olympe.D.Ac(f===b||f===c||f===d);const g=olympe.D.Ya(e);void 0!==g&&g.qb(f)||e.update(f)},'Router is online');return e.Eb()}
373
+ function qc(a){var b=olympe.public.Ta.get(),c='logoutCallback';void 0===c&&(c=olympe.W.yg());b.ra.set(c,a)}function rc(a){return a.C.Eb().Kf()}function sc(a,b,c,d=!1){b=b+c?':'+c.message:'';a.L.error(b);a.error.update(olympe.D.Bb(b));mc(a,olympe.auth.sa.C.cc);if(d)throw Error(b);}
374
+ function jc(a,b,c,d){void 0===c&&(c=a.Ab);void 0===c&&sc(a,'No authentication provider specified',null,!0);const e=a.Hb.get(c);e||sc(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.U.set('login',d);a.L.log('Sending authentication request using "'+c+'" for '+b);e.ed(b,a.Xb.bind(a));mc(a,olympe.auth.sa.C.oi)}function tc(a,b,c){a.U.forEach(d=>{d(b,c)})}
375
+ olympe.auth.sa=class{constructor(a,b,c,d,e,f,g,h,k,l,n,p){this.L=a;this.F=b;this.storage=c;this.Sa=d;this.ka=e;this.Ab=g;this.fc=h;this.ab=void 0===k?!0:k;this.Y=l;this.bb=n;this.zc=p;this.Hb=new Map;this.G=olympe.D.Kc(String).update(olympe.auth.sa.C.INIT);this.error=olympe.D.Kc(olympe.D.Wa);this.N=null;this.Da=new olympe.auth.rf('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=olympe.D.Kc(olympe.auth.rf).update(this.Da);this.U=new Map;this.ra=new Map;f.forEach(q=>{const r=
376
+ q.ma();if(this.Hb.has(r))throw Error('Provider "'+r+'" has already been registered !');this.Hb.set(r,q)});hc(this)}getState(){return this.G.Eb()}aa(){return this.error.Eb()}Sd(){return this.C.Eb().Sd()}Cg(){return this.C.Eb().Cg()}di(){return this.C.Eb().di()}ph(a,b){this.F.ph(a,olympe.D.Ya(rc(this)),b)}sn(){this.L.debug('Sending logout');nc(this.storage);this.F.aa(a=>{a?sc(this,'Logout request rejected:',a):this.L.debug('Logout request acknowledged')})}ji(){oc(this)===olympe.auth.sa.C.Lg&&this.F.ji(a=>
377
+ {a&&this.L.error('Was not able to send the auth keep alive message:',a.message)})}Xb(a,b){const c=null===this.N?olympe.auth.sa.G.au:this.N;this.N=null;a?(this.L.warn('Authentication rejected: '+a.message+'. Falling back into GUEST state'),nc(this.storage),this.error.update(olympe.D.Bb(a.message)),kc(this),tc(this,a,c)):(this.L.info('User '+b.Sd()+' (#'+b.Cg()+') successfully authenticated'),this.C.update(b),mc(this,olympe.auth.sa.C.Lg),tc(this,a,c),this.storage&&ic(this.storage,b));this.U.has('login')&&
378
+ this.U.delete('login')}};olympe.auth.sa.C={INIT:'init',fg:'disconnected',Ch:'guest',oi:'authenticating',cc:'error',Lg:'authenticated'};olympe.auth.sa.G={au:'manual',ss:'auto',wk:'tokenOnFirstConnection'};olympe.auth.sa.F={Aj:'accepted',ip:'redirect'};olympe.auth.Ni=class{ma(){}ed(){}};olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.wc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.vf&&(a=a.Ma.Ib);return a?a.valueOf():a}Sd(){return this.get('username')}Bn(a){this.set('password',a)}Kf(){return this.get('nonce')}toString(){return this.Sd()+(this.Kf()?' with nonce':'')+(this.get('password')?' with password':'')}};olympe.auth.rf=class{constructor(a,b,c,d={}){this.user=a;this.zj=b;this.F=c;this.G=d}Sd(){return this.user}Cg(){return this.zj}Kf(){return this.F}Zj(){return this.G}di(){return null}ia(){var a=olympe.W,b=a.xr;var c=JSON.stringify({user:this.user,userTag:this.zj,nonce:this.F,payload:this.G});c=olympe.W.ci().C(Da(c));return b.call(a,c)}};m=olympe.auth.rf.prototype;m.Sd.K=new olympe.D.J(()=>String,[]);m.Cg.K=new olympe.D.J(()=>String,[]);m.Kf.K=new olympe.D.J(()=>String,[]);
379
+ m.Zj.K=new olympe.D.J(()=>Object,[]);m.di.K=new olympe.D.J(()=>String,[]);m.ia.K=new olympe.D.J(()=>String,[]);olympe.auth.em=class extends olympe.auth.rf{constructor(a,b,c,d){super(a,b,c,d)}di(){return this.Zj().access_token||null}};olympe.auth.Eq=class extends olympe.auth.rf{constructor(a,b,c,d){super(a,b,c,d);this.C=null}di(){return this.C}ia(){var a=olympe.W.ci(),b={user:this.Sd(),userTag:this.Cg(),nonce:this.Kf(),payload:this.Zj(),fullToken:this.C},c=olympe.W,d=c.xr;b=JSON.stringify(b);a=a.C(Da(b));return d.call(c,a)}};function ic(a,b,c){const d=a.C.C('AUTH');d.set(a.key,'string'===typeof b?b:b.ia(),e=>{d.close();c&&c(e)})}function nc(a){const b=a.C.C('AUTH');b.remove(a.key,()=>b.close())}
380
+ olympe.auth.um=class{constructor(a,b,c){this.C=a;this.L=b;this.key='OlympeToken-'+c.C}ed(a){const b=this.C.C('AUTH');this.L.debug(`olympe.auth.TokenStorage: retrieve token with key ${this.key}`);b.get(this.key,c=>{let d=null;if(c)try{this.L.debug('olympe.auth.TokenStorage: Token retrieved successfully');{var e=JSON,f=e.parse;var g=Ea(olympe.W.ci().U(olympe.W.zv(c)));const h=f.call(e,g);if(h.fullToken){const k=new olympe.auth.Eq(h.user,h.userTag,h.nonce,h.payload);k.C=h.fullToken;d=k}else d=h.payload&&
381
+ h.payload.id_token?new olympe.auth.em(h.user,h.userTag,h.nonce,h.payload):new olympe.auth.rf(h.user,h.userTag,h.nonce,h.payload)}}catch(h){this.L.error('Error while unserializing token: ',h.message)}else this.L.debug('olympe.auth.TokenStorage: No token found');b.close();a(d)})}};olympe.auth.um.F='OlympeToken';olympe.auth.um.C='AUTH';olympe.auth.pk=class{redirect(){}F(){}C(){}};olympe.auth.pk.C={GET:'GET',hm:'POST'};olympe.auth.ml=class{constructor(a){this.C=a||'default'}};olympe.auth.Hb={};olympe.auth.Hb.oa={};olympe.auth.Hb.oa.Ii=class{Y(){}};olympe.auth.Hb.oa.Pe=class{ka(){}};olympe.auth.Hb.oa.Ee=class{ra(){}Da(){}};function uc(a,b){return olympe.W.mb(b+'-olympe-'+a.C[b])}olympe.auth.Hb.Hi=class{constructor(a){this.C=a}ma(){return'local'}ed(a,b){const c=a.Sd();if(c){const d=a.get('password'),e=a.Kf();a.C.delete('password');if(void 0!==e&&uc(this,c)===e){b(null,new olympe.auth.rf(c,'',uc(this,c)));return}a=olympe.W.mb(d||'');if(this.C[c]===a){b(null,new olympe.auth.rf(c,'',uc(this,c)));return}}b(Error('Invalid login'))}};olympe.auth.Hb.Hi.C='local';olympe.auth.Hb.Hi.la=[olympe.auth.Ni];olympe.auth.Hb.Ii=class{constructor(a,b){this.C=a;this.storage=b}ma(){return'localToken'}ed(a,b){this.storage.ed(c=>{this.C.Y(a,(d,e)=>{b(d,e||c)})})}};olympe.auth.Hb.Ii.C='localToken';olympe.auth.Hb.Ii.la=[olympe.auth.Ni];olympe.auth.Hb.cm=class{constructor(a,b){this.C=a;this.F=b}ma(){return'openID'}ed(){const a=this.C.C();this.C.redirect(`${this.F}/auth?url=${a}`,null,olympe.auth.pk.C.GET)}};olympe.auth.Hb.cm.C='openID';olympe.auth.Hb.cm.la=[olympe.auth.Ni];olympe.auth.Hb.Pe=class{constructor(a,b){this.F=a;this.C=b}ma(){return'saml'}ed(a,b){this.F.ka(c=>{c?b(c):this.C.F()})}};olympe.auth.Hb.Pe.C='saml';olympe.auth.Hb.Pe.la=[olympe.auth.Ni];olympe.auth.Hb.Ee=class{static bj(a,b){const c=new SRPClient,d=c.generateRandomSalt();return{username:a,login:a,salt:d,verifier:c.generateVerifier(d,a,b)}}constructor(a){this.C=a;this.L=olympe.pa.Xa('auth')}ma(){return'srp'}ed(a,b){const c=a.get('password');a.C.delete('password');this.L.debug('Sending SRP request');this.C.ra(a,(d,e,f)=>{this.L.debug('Received Salt+B message');if(d)b(d);else{try{const g=new SRPClient;g.step1(a.Sd(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g);
382
+ return}this.L.debug('Sending SRP A+M (proof) message');this.C.Da(a,b)}})}};olympe.auth.Hb.Ee.C='srp';olympe.auth.Hb.Ee.la=[olympe.auth.Ni];olympe.auth.O={va:'auth.Manager',Ea:'auth.Logger',Qi:'auth.Storage',Bj:'auth.appNameToken',kk:'auth.Redirector'};olympe.auth.td={va:'auth.ManagerConnector',Dp:'auth.LocalTokenConnector',Ee:'auth.SRPConnector',Pe:'auth.SAMLConnector'};olympe.auth.Config={zl:'auth.defaultProvider',Ep:'auth.localTokenProvider',Jn:'auth.autoLogin',Nn:'auth.autoUser',Kn:'auth.autoPassword',wk:'auth.token',Hn:'auth.appToken'};
383
+ olympe.T.config(function(a){D(a,olympe.auth.Config.zl,'srp');D(a,olympe.auth.Config.Ep,'localToken');D(a,olympe.auth.Config.Jn,!1);D(a,olympe.auth.Config.Nn,'');D(a,olympe.auth.Config.Kn,'');D(a,olympe.auth.Config.wk,'');D(a,olympe.auth.Config.Hn,'default');C(a,olympe.auth.O.Ea,[olympe.pa.O.va],b=>b.Nc('auth'));A(a,olympe.auth.O.Bj,olympe.auth.ml,new olympe.T.fa(olympe.auth.Config.Hn));A(a,olympe.auth.O.Qi,olympe.auth.um,olympe.jc.O.ak,olympe.auth.O.Ea,olympe.auth.O.Bj);ta(a,olympe.auth.td.va);ta(a,
384
+ olympe.auth.O.kk);C(a,olympe.auth.O.va,[olympe.auth.O.Ea,olympe.auth.td.va,olympe.host.O.Il,new olympe.T.zb(olympe.auth.O.Qi,olympe.T.ff.C.Ih),new olympe.T.fa(olympe.auth.Config.zl),new olympe.T.fa(olympe.auth.Config.Ep),new olympe.T.fa(olympe.auth.Config.Jn),new olympe.T.fa(olympe.auth.Config.Nn),new olympe.T.fa(olympe.auth.Config.Kn),new olympe.T.fa(olympe.auth.Config.wk),new olympe.T.zb(olympe.auth.O.kk,olympe.T.ff.C.Ih),new olympe.T.zb(olympe.auth.td.Dp,olympe.T.ff.C.Ih),new olympe.T.zb(olympe.auth.td.Ee,
385
+ olympe.T.ff.C.Ih),new olympe.T.zb(olympe.auth.td.Pe,olympe.T.ff.C.Ih)],(b,c,d,e,f,g,h,k,l,n,p,q,r,t)=>{const u=[];q&&u.push(new olympe.auth.Hb.Ii(q,e));r&&u.push(new olympe.auth.Hb.Ee(r));t&&p&&u.push(new olympe.auth.Hb.Pe(t,p));p&&c&&u.push(new olympe.auth.Hb.cm(p,c.Pr()));if(0===u.length)throw Error('At least one provider is needed for auth to start');if(!u.map(v=>v.ma()).includes(f))throw Error('Default provider name'+f+'given by parameter'+olympe.auth.Config.zl+'cannot be found');return new olympe.auth.sa(b,
386
+ c,e,p,d.nj()?d:null,u,f,g,h,k,l,n)},!0)},'olympe.auth');olympe.T.run([olympe.auth.O.va],a=>{olympe.auth.Qc=()=>a});olympe.dc={};olympe.dc.za={ORIGIN:'<',DESTINATION:'>'};z('olympe.dc.Direction',olympe.dc.za);olympe.dc.kc={Tc:'ff022000000000000000',xi:'ff02200000000000000e',co:'ff02200000000000000f'};olympe.dc.$b={VERSION:'@v',Jd:'@s'};olympe.dc.Sg={bc:'?'};olympe.dc.tk={Xp:'online',Jh:'offline',vt:'invalidate'};olympe.dc.Ha={rb:'self',Vc:'server',fq:'peer',bc:'server'};olympe.dc.xa=function(a){if('string'===typeof a)return a;let b=null;a=olympe.D.Ya(a);void 0!==a&&null!==a&&(a=a.valueOf(),'string'===typeof a?b=a:a.R?b=a.R():'function'===typeof a&&(b=olympe.dc.Ba.Rb(a)));return b||''};z('olympe.dc.instanceToTag',olympe.dc.xa);olympe.dc.Na=function(){return olympe.dc.Ad().view};olympe.dc.register=function(a,b){olympe.dc.Ba.C(a,b)};olympe.dc.defineProperty=function(a){return new olympe.dc.ta.Property(a)};
387
+ olympe.dc.hh=function(a,b=olympe.dc.za.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.za.DESTINATION){const e=olympe.dc.za.DESTINATION;return b===olympe.dc.za.ORIGIN||b===e?new olympe.dc.ta.Relation(a,b):new olympe.dc.ta.Relation(a,d,b,c)};olympe.dc.Lv=function(a){return a.Pc()};olympe.dc.Writable=class{F(){}qc(){}Jc(){}Ra(){}hc(){}};olympe.dc.jm=class{Mc(){}Z(){}G(){}};function vc(a,b,c,d,e,f,g){d=new olympe.dc.ga(olympe.dc.ga.ja.Sh,{file:b,url:null,content:c,Ye:e?h=>{wc(a,b,c);f(h)}:f,mimeType:d,te:g||null},[olympe.dc.Na().source(b)||olympe.dc.Ha.Vc]);a.F.send(d)}function xc(a,b,c,d,e,f){c=c instanceof olympe.D.Wa?c.valueOf():c;'string'===typeof c?c=new Blob([Da(c)],{type:d}):c instanceof ArrayBuffer&&(c=new Blob([c],{type:d}));vc(a,b,c,d,a.G,e,f)}
388
+ function wc(a,b,c){const d=olympe.dc.xa(b);a.C.set(d,c);const e=olympe.W.yg();yc(olympe.dc.Na(),d,f=>{f||(a.C.delete(d),zc(olympe.dc.Na(),d,e))},e)}function Ac(a,b,c,d){olympe.D.bs([b.Vr(),b.R(),b.Ql(),b.dn()],(e,f,g,h)=>{a.C.has(f)?c(a.C.get(f)):(e=new olympe.dc.ga(olympe.dc.ga.ja.zh,{file:f,url:e.valueOf()?null:g,mimeType:h.valueOf(),Ye:a.G?k=>{wc(a,f,k);c(k)}:c,te:d},[olympe.dc.Na().source(f)||olympe.dc.Ha.Vc]),a.F.send(e))})}
389
+ olympe.dc.it=class{constructor(a,b,c,d,e){this.L=a;this.F=c;this.G=e;this.C=new Map}};olympe.dc.sa=class{constructor(a){this.L=a}};function Bc(a,b){a.F=b;return a}function M(a,b){a.Xh.unshift(b);return a}olympe.dc.ga=class{constructor(a,b,c){this.type=a;this.content=b;this.C=c;this.Xh=[];this.F=olympe.D.Ja()}validate(a=null){this.Xh.forEach(b=>{b(a||null)})}toString(){const a=olympe.W.Mr(olympe.dc.ga.ja,this.type);return a?a:'UNKNOWN_MESSAGE'}};
390
+ olympe.dc.ga.ja={cc:1,mg:2,Qg:10,Tz:11,Mu:20,aB:21,bB:22,Ou:23,Ai:24,zi:25,Uz:26,Uo:28,mm:30,om:31,vu:32,bh:40,xk:41,yh:45,Gj:46,Qj:47,Sh:50,zh:51,wi:52,av:60,Bu:61,kt:62,lt:63,Es:64,ql:65,Sz:90,yl:91,Hl:92,Vo:93,zp:94,ek:95,Nu:96,QUERY_RESULT:97,nm:98};olympe.dc.pg=class{process(){}};olympe.dc.km=class{constructor(...a){this.Ub=a}process(a,b,c){const d=this.Ub.length,e=(f,g,h)=>{g||f>=d?c(g,h):this.Ub[f].process(a,h,e.bind(null,f+1))};e(0,null,b)}};olympe.dc.km.la=[olympe.dc.pg];olympe.dc.Hc=class{constructor(a){this.tag='string'===typeof a?a:a.R()}R(){return this.tag}toJSON(){return'{ "type": "reference", "tag": '+JSON.stringify(this.tag)+' }'}qb(a){return a instanceof olympe.dc.Hc&&this.tag===a.tag}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.Hc(b.tag)}};olympe.dc.Hc.la=[olympe.dc.ze];olympe.dc.Hc.prototype.toJSON.K=olympe.D.J.C;olympe.dc.Hc.prototype.qb.K=olympe.D.J.C;olympe.dc.qg=class{send(){}C(){}ra(){}};const Cc=olympe.dc.za.ORIGIN,Dc=olympe.dc.za.DESTINATION,Ec=new Map,Fc=new Map,Gc=new Map,Hc=new Map;function Ic(a,b){var c=olympe.dm.File;let d=c;'function'===typeof c&&(d=b.entry);c=[...(d.Cn||[])];return olympe.dc.Ba.C(a,b,...c)}function Jc(a,b){Hc.set(a,b);return a}function Kc(a){return(a=Ec.get(a))&&a.C||olympe.dc.CloudObject}function Lc(a,b,c){const d=a+'@'+(b===Dc?Cc:Dc);if(Fc.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);Fc.set(d,c)}
391
+ function Mc(a){a=a.R()+'@'+a.Oa();return Fc.get(a)||olympe.dc.CloudObject}function N(a,b){b.NAME=a;Gc.set(a,b)}function O(a){return a.NAME||null}
392
+ olympe.dc.Ba=class{constructor(){}static C(a,b,...c){if(Ec.has(a))throw Error(`Tag: ${a} - overwriting already defined sync ${Ec.get(a).C.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.T.zb(g):g}}b=new olympe.dc.ta.Entry(a,b,d);Ec.set(a,b);return b.C.entry=b}static Rb(a){return(a=a.entry)&&a.R()||null}};olympe.dc.ta={};function P(a,b){b=b.Pc();Lc(b.R(),b.Oa(),a.C);return b}function Nc(a){a.F=!0;return a}
393
+ olympe.dc.ta.Entry=class{constructor(a,b,c){this.tag=a;this.C=b;this.Cn=c||null;this.F=!1}R(){return this.tag}instantiate(a,b){const c=this.C;if(this.kj()&&b.getParameter(olympe.dc.Config.Bo)){var d=olympe.dc.Na();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.R()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.pa.Xa('dc').error(d)}return this.Cn?(a=[void 0,a].concat(na(b,this.Cn)),new c(...a)):new c(void 0,
394
+ a)}Ca(a){return new olympe.dc.ta.Property(a)}Pa(a,b=olympe.dc.za.DESTINATION){Lc(a,b,this.C);return new olympe.dc.X.Qb(a,b)}kj(){return this.F}};z('olympe.dc.registry.Entry',olympe.dc.ta.Entry);olympe.dc.ta.Entry.prototype.addRelation=olympe.dc.ta.Entry.prototype.Pa;olympe.dc.ta.Entry.prototype.addProperty=olympe.dc.ta.Entry.prototype.Ca;olympe.dc.ta.Entry.la=[olympe.dc.ze];olympe.dc.ta.Property=class{constructor(a){this.tag=a}R(){return this.tag}};olympe.dc.ta.Property.prototype.getTag=olympe.dc.ta.Property.prototype.R;olympe.dc.ta.Property.la=[olympe.dc.ze];olympe.dc.ta.Relation=class{constructor(a,b=olympe.dc.za.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.xa(a);this.direction=b;this.origin=c;this.destination=d}R(){return this.tag}Oa(){return this.direction}type(){return this.destination}Pc(){return new olympe.dc.ta.Relation(this.tag,this.direction===olympe.dc.za.DESTINATION?olympe.dc.za.ORIGIN:olympe.dc.za.DESTINATION,this.destination,this.origin)}qb(a){return a instanceof olympe.dc.ta.Relation?a.R()===this.R()&&
395
+ a.Oa()===this.Oa():!1}toString(){return this.direction+this.tag}};olympe.dc.ta.Relation.prototype.getInverse=olympe.dc.ta.Relation.prototype.Pc;olympe.dc.ta.Relation.prototype.getDirection=olympe.dc.ta.Relation.prototype.Oa;olympe.dc.ta.Relation.prototype.getTag=olympe.dc.ta.Relation.prototype.R;olympe.dc.ta.Relation.la=[olympe.dc.ze];olympe.dc.db={};function Oc(a,b,c,d,e,f=olympe.dc.Ha.rb){const g=c.Z();Pc(a.C,b,c,d,e,f);return h=>{if(h)a.C.push(g);else{h=a.C;const k=h.F.get(g);if(void 0!==k){const l=h.C.indexOf(g);h.C.splice(l,1);Qc(h,Rc(h,k.C,h.C.length),k.source);h.F.delete(g)}}}}function Sc(a,b){a.Ia.Sa(b)}function Tc(a,b,c){b&&a.Ia.Xc(b);c&&a.Ia.Ld(c)}
396
+ olympe.dc.db.Vs=class{constructor(a,b,c,d,e){this.L=a;this.Ia=b;this.C=new olympe.dc.db.Ks(a,b,d);this.view=new olympe.dc.ib(a,b);this.Fx=new olympe.dc.db.gu(this.L,this.view,b,e)}Xa(){return this.L}persist(a){this.Ia.Da();this.Ia.Ab(a,olympe.dc.db.Instance.C.iq);this.Ia.ra()}$e(a,b){this.C.$e(a,b)}};const Uc=olympe.dc.$b.VERSION,Vc=olympe.dc.$b.Jd,Wc=olympe.dc.kc.Tc,Xc=olympe.dc.kc.xi;
397
+ olympe.dc.db.Database=class a extends Map{constructor(b,c){super();this.id=olympe.W.nc();this.L=b;this.fc=olympe.D.Ja();this.He=c.get('defaultSource')||olympe.dc.Ha.rb;this.U=olympe.dc.db.Database.F.IDLE;this.ka=new Map;this.Xb=[];this.G=[];this.bb=new Map;b=c.get('garbageCollector')||olympe.dc.db.Bi.C.Bl;new olympe.dc.db.Bi(this,b,this.fc);c.get('debug')&&this.Pf()}Z(){return this.id}getState(){return this.U}Xa(){return this.L}create(b,c){const d=this.N(b,!0);d.fc(c&&parseInt(c.get(Uc),10)||1);d.li(c&&
398
+ c.get(Vc)||this.He);c&&(c.delete(Uc),c.delete(Vc),this.qe(d,c));this.C(a.C.sp,b)}update(b,c,d=!1){if(void 0!==c&&null!==c){b=this.N(b,!0);var e=c&&parseInt(c.get(Uc),10);0>e||!d&&b.version()>=e||(c.delete(Uc),b.fc(isNaN(e)?b.version()+1:e),this.qe(b,c))}}Jc(b){const c=this.get(b);void 0!==c&&(this.ab(c,!1),this.C(a.C.tp,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case Wc:c.Se(d);break;case Xc:c.qe(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!==
399
+ d)switch(b){case Wc:c.th(d);break;case Xc:c.Qf(d);break;default:c.unlink(b,d)}}Xc(b){for(const c of b)this.N(c).Ge()}Ld(b){for(const c of b)(b=this.get(c))&&b.detach()}Ab(b,c){b.forEach(d=>{this.N(d).Bf(c)})}zc(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.C(a.C.Ao,b))}N(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.C(a.C.zo,b),c&&this.C(a.C.zk,b));return d}Y(b,c,d=!1,e=null){return{[Symbol.iterator]:function*(f){const g=olympe.dm.Relation.C.yk,
400
+ h=olympe.dm.Relation.C.mk,k=olympe.dc.za.ORIGIN,l=olympe.dc.za.DESTINATION,n=a.ec.Nh+c,p=d?h:g,q=d?g:h,r=(new Map).set(f,!1),t=(v,w)=>(v=this.get(v))&&0!==(v.get(n)&w),u=([v,w])=>!r.has(v)&&(e?e(w):!0);for(const v of r.keys())r.get(v)||(r.set(v,!0),yield v),f=this.get(v),void 0!==f&&f.forEach((w,y)=>{(y[0]===k&&t(y.substring(1),q)||y[0]===l&&t(y.substring(1),p))&&Array.from(w.entries()).filter(u).forEach(([B])=>{r.set(B,!1)})})}.bind(this,b)}}be(b){this.G[0].Re(olympe.W.yg(),b)}aa(b){if(0===this.G.length)debugger;
401
+ this.G[0].C.delete(b)}C(b,c,...d){this.ka.has(b)&&this.ka.get(b).forEach(e=>{e(c,...d)})}ab(b,c){this.bb.set(b,c)}Af(b,c,d,e){0<this.G.length&&Yc(this.G[0],b).Ca(e?Zc+c:c,d)}Bf(b,c,d,e,f){if(0<this.G.length){var g=this.G[0];d===$c?f?Yc(g,b).link(c,e):Yc(g,b).unlink(c,e):f?Yc(g,b).bb(c,e):Yc(g,b).Ab(c,e)}}F(b,c){let d=this.ka.get(b);void 0===d&&(d=[],this.ka.set(b,d));d.push(c)}Sa(b){this.Xb.push(b)}Se(b){return this.G.reduce((c,d)=>d.G.has(b)||c,!1)}Da(){this.U===a.F.IDLE&&(this.U=a.F.ys);this.G.unshift(new olympe.dc.db.at(this,
402
+ this.fc))}ra(){this.U=a.F.ag;this.Qf();ad(this.G[0]);this.G.shift();0===this.G.length&&(this.U=a.F.IDLE,this.Xb.forEach(b=>{b()}))}qe(b,c){const d=a.ec.bc;for(const [e,f]of c)void 0!==f&&(e[0]===d?b.ii(e.substr(1),f):b.update(e,f))}Qf(){const b=a.ec.ORIGIN,c=this.bb,d=new Map,e=(g,h)=>{const k=g.get(b+Wc);k&&k.forEach((l,n)=>{g!==l&&(d.set(l,h),c.delete(n),e(l,h))})};c.forEach((g,h)=>{d.set(h,g);e(h,g)});const f=this.G[0];d.forEach((g,h)=>{h.be(g)&&(h=h.tag(),g?Yc(f,h).create():Yc(f,h).delete())});
403
+ this.bb.clear()}Pf(){const b=a.ec.DESTINATION,c=a.C.Dl,d=a.C.lk,e=new Set,f=new Map;this.F(a.C.sp,g=>{e.add(g)});this.F(c,g=>{e.delete(g);f.delete(g)});this.F(d,(g,...h)=>{if(h[0]===Xc&&h[1]===b){const k=h[2];this.get(k).Gb()||(h=f.get(k)||new Set,0===h.size&&f.set(k,h),h.add(g))}});this.Sa(()=>{e.forEach(g=>{const h=this.get(g);h&&null===h.model()&&this.L.error(`\n[DEBUG - DATABASE]\nInstance ${g} created but does not exist !\n${h.toString()}`)});e.clear();f.forEach((g,h)=>{const k=this.get(h);k&&
404
+ this.L.error(`\n[DEBUG - DATABASE]\nThe model ${h} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(g.values()).join(', ')}`+`\n\n ${k.toString()}`)});f.clear()})}};olympe.dc.db.Database.ec={Nh:'$',tt:'~',bc:'?',kl:'=',Zn:'@',ORIGIN:olympe.dc.za.ORIGIN,DESTINATION:olympe.dc.za.DESTINATION};olympe.dc.db.Database.C={zo:0,Ao:1,cr:2,zk:3,$n:4,ao:5,Dl:6,Fc:7,lk:8,pm:9,sp:10,tp:11,vq:12};olympe.dc.db.Database.F={IDLE:0,ys:1,ag:2};const Q=olympe.dc.db.Database.C,bd=olympe.dc.db.Database.ec.Nh,cd=olympe.dc.db.Database.ec.tt,dd=olympe.dc.db.Database.ec.bc,ed=olympe.dc.db.Database.ec.kl,fd=olympe.dc.db.Database.ec.Zn,R=olympe.dc.za.ORIGIN,S=olympe.dc.za.DESTINATION,gd=olympe.dc.kc.Tc,hd=olympe.dc.kc.xi;
405
+ olympe.dc.db.Instance=class a extends Map{constructor(b,c){super();this.C=b;this.Xc=olympe.dc.Ha.rb;this.e=!1;this.bb=0;this.F=void 0;this.c=0;this.ka=a.C.iq;this.db=c}tag(){return this.C}Gb(){return this.e}Ab(){return this.db.Se(this.C)}source(){return this.Xc}version(){return this.bb}model(){const b=this.get(S+gd);return b&&b.values().next().value||null}zf(){const b=this.get(S+hd);return b&&b.values().next().value||null}persisted(){return this.ka!==a.C.lr}toString(){var b=this.fb(olympe.dc.CloudObject.nameProp.R());
406
+ b=`Instance: ${this.C}, Exist: ${this.e}, Name: ${b}`;var c=this.model();if(c){var d=c.fb(olympe.dc.CloudObject.nameProp.R())||'No model name';b+=`\nModel: ${c.C}, Exist: ${c.e}, Model name: ${d}`}else b+='\nModel: no model';(c=this.zf())?(d=c.fb(olympe.dc.CloudObject.nameProp.R())||'No extension name',b+=`\nExtension: ${c.C}, Exist: ${c.e}, Extension name: ${d}`):b+='\nExtension: no extension';return b}fb(b,c=!1){const d=this.get(bd+b);return c||void 0!==d?d:this.get(ed+b)}ra(b,c=!1){const d=this.get(dd+
407
+ b);return c||void 0!==d?d:this.get(cd+b)}update(b,c){const d=bd+b;var e=this.get(d),f=e=void 0===e?null:e;(null!==f&&'function'===typeof f.qb?f.qb(c):f===c)||(e instanceof olympe.dc.Hc&&(this.db.get(e.R()).zc(),this.db.Jc(e.R())),c instanceof olympe.dc.Hc&&(e=this.db.N(c.R(),!0),e.F&&e.F.tag!==this.C&&this.db.Xa().fatal('Instance',c.R(),'referenced multiple times!\nThis instance is currently property of',e.F.tag,'(for the property '+e.F.kb+')','and is assigned as a property of',this.C,'(for the property '+
408
+ b+')'),e.Pf(this.C,b)),e=ed+b,null===c?(this.delete(d),c=(c=this.model())&&c.ra(b),void 0!==c?(this.set(e,c),this.N(b,c,!0)):this.N(b,null,!1)):(this.set(d,c),this.delete(e),this.N(b,c,!1)))}ii(b,c){const d=dd+b;var e=this.get(d);(void 0===e?null:e)!==c&&(e=cd+b,null===c?(this.delete(d),c=(c=this.zf())&&c.ra(b),c=void 0===c?null:c,null!==c&&this.set(e,c),this.Y((new Map).set(b,c))):(void 0!==this.get(e)&&this.delete(e),this.set(d,c),this.Y((new Map).set(b,c))))}link(b,c){var d=R+b;const e=this.ab(S+
409
+ b);d=c.ab(d);e.has(c.C)||(e.set(c.C,c),d.set(this.C,this),this.db.C(Q.lk,this.C,b,S,c.C),this.db.C(Q.lk,c.C,b,R,this.C),this.e&&c.e&&(this.G(b,S,c,!0),c.G(b,R,this,!0)))}unlink(b,c){const d=R+b;void 0!==this.Sa(S+b,c.C)&&(c.Sa(d,this.C),this.db.C(Q.pm,this.C,b,S,c.C),this.db.C(Q.pm,c.C,b,R,this.C),this.e&&c.e&&(this.G(b,S,c,!1),c.G(b,R,this,!1)))}Se(b){const c=this.model();if(null!==c){if(c===b)return;this.unlink(gd,c)}this.link(gd,b);b.forEach((d,e)=>{e[0]!==dd&&e[0]!==cd||this.Da(e.substr(1),d)});
410
+ (b.e||b===this)&&this.db.ab(this,!0)}th(b){this.unlink(gd,b);this.forEach((c,d)=>{this.Da(d.substr(1),null)});this.db.ab(this,!1)}qe(b){const c=this.zf();if(null!==c){if(c===b)return;this.unlink(hd,c)}this.link(hd,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===dd||f[0]===cd)f=f.substr(1),this.has(dd+f)||(this.set(cd+f,e),d.set(f,e))});this.Y(d)}Qf(b){this.unlink(hd,b);const c=new Map;this.forEach((d,e)=>{e[0]===cd&&(this.delete(e),c.set(e.substr(1),null))});this.Y(c)}Xb(b,c,d){const e=(...f)=>{var g=
411
+ f.length;const h=f[g-2];(g=this.db.get(f[g-1]))&&(h?g.Ge():g.detach());d(...f)};this.Re(b,c,e);return e}Re(b,c,d){const e=this.ab(fd+b);e.has(c)||(e.set(c,d),this.Ge(),this.db.C(Q.$n,this.C,b,c))}U(b,c){const d=this.Sa(fd+b,c);void 0!==d&&(this.detach(),this.db.C(Q.ao,this.C,b,c));return d}li(b){this.Xc=b}fc(b){this.bb=b}Bf(b){this.ka=b;this.aa()||this.db.C(Q.zk,this.C)}be(b){const c=this.e!==b;c&&(b?(this.e=b,this.Af()):(this.He(),this.e=b),this.Ld(b));return c}Ge(){this.c++;1===this.c&&this.db.C(Q.cr,
412
+ this.C)}detach(){0<this.c?--this.c:this.db.C(Q.vq,this.C,`Try to decrease references on instance ${this.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===this.c&&this.db.C(Q.zk,this.C)}aa(){return 0<this.c||this.ka===olympe.dc.db.Instance.C.jq}clear(){this.forEach((b,c)=>{const d=c[0];if(d===R||d===S){const e=c.substr(1),f=d===R?S:R;
413
+ b.forEach(g=>{const h=g.get(f+e);h.delete(this.C);0===h.size&&g.delete(f+e)})}d===bd&&b instanceof olympe.dc.Hc&&this.db.get(b.R()).zc()});void 0!==this.F&&this.db.get(this.F.tag).delete(bd+this.F.kb)}Pf(b,c){void 0===this.F&&this.Ge();this.F={tag:b,kb:c}}zc(){void 0!==this.F&&(this.detach(),this.F=void 0)}Af(){this.forEach((b,c)=>{const d=c[0];if(d===R||d===S){const e=c.substr(1),f=d===R?S:R;b.forEach(g=>{g.e&&(this.G(e,d,g,!0),g.G(e,f,this,!0))})}else d!==bd&&d!==ed||this.N(c.substr(1),b,d===ed)})}He(){this.forEach((b,
414
+ c)=>{const d=c[0];if(d!==fd){var e=c.substr(1);d===R?b.forEach(f=>{f.unlink(e,this)}):d===S?b.forEach(f=>{this.unlink(e,f)}):d===bd&&this.update(d,null);this.delete(c)}});this.bb=0;if(void 0!==this.F){const b=this.db.get(this.F.tag),c=b.get(bd+this.F.kb);c&&c.R&&c.R()===this.C&&b.update(this.F.kb,null)}}Ld(b){this.db.C(b?Q.Dl:Q.Fc,this.C)}N(b,c,d){this.e&&this.db.Af(this.C,b,c,d)}G(b,c,d,e){this.db.Bf(this.C,b,c,d.C,e)}Y(b,c=[]){var d=this.get(R+gd);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>e.Da(g,
415
+ f))});d=this.get(R+hd);void 0!==d&&d.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(dd+k)||(g.set(k,h),null!==h?e.set(cd+k,h):e.delete(cd+k))});e.Y(g,[...c,f])}})}Da(b,c){if(!this.has(bd+b)){const d=ed+b,e=this.get(d);c!==(void 0!==e?e:null)&&(null===c?this.delete(d):this.set(d,c),this.N(b,c,null!==c))}}ab(b){let c=this.get(b);void 0===c&&(c=new Map,this.set(b,c));return c}Sa(b,c){const d=this.get(b);if(void 0!==d){const e=d.get(c);d.delete(c);0===d.size&&this.delete(b);
416
+ return e}}};olympe.dc.db.Instance.C={lr:0,jq:1,iq:2};const $c=olympe.dc.db.Database.ec.DESTINATION,Zc=olympe.dc.db.Database.ec.kl,id=olympe.dc.db.Database.ec.Nh,jd=olympe.dc.db.Database.ec.Zn,kd=olympe.dc.db.Database.ec.ORIGIN+$c,ld=id+id;
417
+ function ad(a){const b=a.Ia;a.F.forEach((c,d)=>{const e=b.get(d);if(c.se()||c.N()){var f=e.get(jd);f&&md(a,f,c.se(),d);c.N()&&a.G.add(d)}for(const [l,n]of c.rd()){var g=l[0]===Zc;d=a;var h=e;f=g?l.substr(1):l;var k=n;const p=h.get(jd+id+f);p&&md(d,p,k,g);(h=h.get(jd+ld))&&md(d,h,f,k,g)}for(const l of c.Sa())nd(a,e,...l)});a.F.clear();od(a)}function Yc(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.kg(b),a.F.set(b,c));return c}
418
+ function md(a,b,...c){b.forEach((d,e)=>{a.Re(e,d.bind(null,...c))})}function nd(a,b,c,d,e,f){const g=b.get(jd+d+c);g&&md(a,g,f,e);(b=b.get(jd+kd))&&md(a,b,c,d,f,e)}function od(a){a.N.run(()=>{const b=a.C;for(const [d,e]of a.buffer){var c=b.get(d);(c=c&&c[e])&&c()}});a.C.clear();a.buffer.length=0}
419
+ olympe.dc.db.at=class{constructor(a,b){this.Ia=a;this.N=b;this.F=new Map;this.G=new Set;this.C=new Map;this.buffer=[]}Re(a,b){let c=this.C.get(a);void 0===c&&(c=[],this.C.set(a,c));this.buffer.push([a,c.length]);c.push(b)}};function pd(a){const b=olympe.dc.db.Database.C.Ao,c=olympe.dc.db.Database.C.Dl,d=olympe.dc.db.Database.C.Fc,e=olympe.dc.db.Database.C.lk,f=olympe.dc.db.Database.C.pm,g=olympe.dc.db.Database.C.$n,h=olympe.dc.db.Database.C.ao,k=()=>{};a.Ia.F(olympe.dc.db.Database.C.zo,()=>{});a.Ia.F(b,()=>{});a.Ia.F(c,l=>{a.Ia.be(()=>{qd(a.view,l,k,`monitorRelations${l}`)})});a.Ia.F(d,l=>{a.Ia.be(()=>{rd(a.view,l,`monitorRelations${l}`)})});a.Ia.F(e,()=>{});a.Ia.F(f,()=>{});a.Ia.F(g,()=>{});a.Ia.F(h,()=>{})}
420
+ olympe.dc.db.gu=class{constructor(a,b,c,d){this.L=a;this.view=b;this.Ia=c;d&&pd(this)}debug(a){const b=olympe.dc.xa(a);if(this.Ia.has(b)){var c=this.Ia.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Gb()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.Ia.get(d[d.length-1]);const e=olympe.dc.db.Database.ec.Nh+olympe.dc.CloudObject.nameProp.R();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+' (name: '+c.get(e)+') has no model.\nList: '+
421
+ d.join(' --M--\x3e ')}this.L.info(a)}else this.L.info('[DATABASE] Instance',b,'has never been created or referred by the database')}};olympe.dc.db.Bi=class a{constructor(b,c,d){this.L=b.Xa();this.Ia=b;this.F=new Set;this.mode=c;this.N=d;this.C=!1;c!==a.C.Bl&&this.U()}run(){if(!this.C)switch(this.mode){case a.C.rs:this.C=!0;this.N.run(()=>{Ib(()=>{this.G();this.C=!1},0)});break;case a.C.Pq:this.C=!0,this.G(),this.C=!1}}G(){const b=this.Ia,c=olympe.dc.Sb.pf,d=this.F,e=h=>b.get(h);var f=h=>!(h.persisted()||h.aa());for(var g of d){const h=b.get(g);if(h&&!h.aa()){if(!h.persisted())continue;Array.from(b.Y(g,c,!1,f)).forEach(k=>{d.add(k)});
422
+ b.zc(g)}d.delete(g)}for(const h of d)f=Array.from(b.Y(h,c,!0)).map(e),g=Array.from(b.Y(h,c)).map(e),f.some(k=>k.aa())?g.filter(k=>!k.persisted()).forEach(k=>{d.delete(k.tag())}):f.concat(g).filter(k=>!k.persisted()).map(k=>k.tag()).forEach(k=>{d.delete(k);b.zc(k)});d.clear()}U(){this.Ia.Sa(this.run.bind(this));const b=olympe.dc.db.Database.C.cr,c=olympe.dc.db.Database.C.tp,d=olympe.dc.db.Database.C.vq,e=olympe.dc.db.Database.F.IDLE,f=g=>{this.F.add(g);this.Ia.getState()===e&&this.run()};this.Ia.F(olympe.dc.db.Database.C.zk,
423
+ f.bind(this));this.Ia.F(c,f.bind(this));this.Ia.F(b,g=>{this.F.delete(g)});this.Ia.F(d,(g,...h)=>{this.L.error(h[0])})}};olympe.dc.db.Bi.C={Bl:0,Pq:1,rs:2};const sd=olympe.dc.db.Database.ec.ORIGIN,td=olympe.dc.db.Database.ec.DESTINATION,ud=olympe.dc.db.Database.ec.Nh,vd=olympe.dc.db.Database.ec.kl,wd=sd+td,xd=ud+ud,yd=olympe.dc.db.Database.F;function yc(a,b,c,d){const e=a.Ia.N(olympe.dc.xa(b));d=d||zd(a);e.Re('',d,c);e.Gb()&&a.G.run(()=>{c(!0,b)});return d}function zc(a,b,c,d=!1){const e=U(a,b);if(null!==e){const f=e.U('',c);void 0!==f&&(a.Ia.getState()===yd.ag&&a.Ia.aa(c),!d&&e.Gb()&&a.G.run(()=>{f(!1,b)}))}}
424
+ function qd(a,b,c,d){const e=a.Ia.N(olympe.dc.xa(b));b=d||zd(a);const f=e.Xb(wd,b,c);e.Gb()&&e.forEach((g,h)=>{g=h[0];g!==sd&&g!==td||Ad(a,e,h,!0,f,!0)})}function rd(a,b,c){const d=U(a,b);if(null!==d){const e=d.U(wd,c);void 0!==e&&(a.Ia.getState()!==yd.ag||d.Ab()||a.Ia.aa(c),d.Gb()&&d.forEach((f,g)=>{f=g[0];(f===sd||f===td)&&e&&Ad(a,d,g,!1,e,!0)}))}}function zd(a){++a.N;return String(a.N)}
425
+ function Bd(a,b,c,d,e){b=a.Ia.N(olympe.dc.xa(b));c=olympe.dc.xa(c);const f=ud+c;e=e||zd(a);b.Re(f,e,d);if(b.Gb()){let g=!1,h=b.get(f);void 0===h&&(g=!0,h=b.get(vd+c));if(void 0===h)return e;a.G.run(()=>{d(h,g)})}return e}function U(a,b,c=!1){if(null===b||void 0===b)throw Error('Provided tag is null or undefined.');a=a.Ia.get(olympe.dc.xa(b));return!a||c&&!a.Gb()?null:a}
426
+ function Cd(a,b,c){b=a.Ia.N(olympe.dc.xa(b));const d=zd(a);b.Re(xd,d,c);b.Gb()&&b.forEach((e,f)=>{const g=f[0];g!==ud&&g!==vd||a.G.run(()=>{c(f.substr(1),e,g===vd)})});return d}function Ad(a,b,c,d,e,f){(b=b.get(c))&&b.forEach((g,h)=>{g.Gb()&&(f?a.G.run(()=>{e(c.substr(1),c[0],d,h)}):a.G.run(()=>{e(d,h)}))})}function V(a,b,c,d,e){b=a.Ia.N(olympe.dc.xa(b));c=c.Oa()+c.R();e=e||zd(a);d=b.Xb(c,e,d);b.Gb()&&Ad(a,b,c,!0,d,!1);return e}function Dd(a,b,c){return c===olympe.dc.Sb.NONE?0:a.fb(b,c,!0)||0}
427
+ function Ed(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===sd||c===td){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(U(a,b,!0))}function Fd(a,b,c){if(!a.Gb(b))return a.L.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.xa(b)];for(const f of e){const g=a.ub(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.L.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.xa(b)}`);return d}
428
+ function Gd(a,b,c){return null!==a.Vm(c,olympe.dc.CloudObject.extendRel,d=>olympe.dc.Na().Xk(d,olympe.dc.CloudObject.propertyRel,b))}function Hd(a,b,c,d){return(c=(a=U(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Gb()).length:0}
429
+ olympe.dc.ib=class{constructor(a,b){this.L=a;this.G=new olympe.D.Wb('DB View context');this.Ia=b;this.N=0}Z(){return this.Ia.Z()}F(a,b,c){a=U(this,a);null!==a&&(b=olympe.dc.xa(b),a.U(ud+b,c),this.Ia.getState()===yd.ag&&this.Ia.aa(c))}C(a,b,c,d=!1){a=U(this,a);if(null!==a){b=b.Oa()+b.R();const e=a.U(b,c);void 0!==e&&(this.Ia.getState()!==yd.ag||a.Ab()&&!d||this.Ia.aa(c),!d&&a.Gb()&&Ad(this,a,b,!1,e,!1))}}Gb(a){a=U(this,a);return!(!a||!a.Gb())}name(a){return(a=U(this,a))?a.fb(olympe.dc.CloudObject.nameProp.R()):
430
+ ''}model(a){return(a=(a=U(this,a,!0))?a.model():null)?a.tag():null}zf(a){return(a=(a=U(this,a,!0))&&a.zf())?a.tag():null}lj(a){a=U(this,a,!0);return!(!a||!a.zf())}rh(a,b){a=(a=U(this,a,!0))&&a.model();return!(!a||!this.Sf(a.tag(),b))}version(a){return(a=U(this,a,!0))&&a.version()}source(a){return(a=U(this,a,!0))&&a.source()}Vf(a){return(a=U(this,a,!1))?!!a.persisted():!0}fb(a,b,c){b=(a=U(this,a,!0))?a.fb(olympe.dc.xa(b),c):null;return void 0!==b?b:null}rd(a,b=!1){var c=U(this,a,!0);a=new Map;if(c)for(const [d,
431
+ e]of c)c=d[0],(c===ud||!b&&c===vd)&&a.set(d.substring(1),e);return a}ub(a,b){return this.hj(a,[b])}Xk(a,b,c){return this.ub(a,b).includes(olympe.dc.xa(c))}hj(a,b){a=U(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=U(this,d,!0).get(c.Oa()+c.R()),void 0!==a)for(const e of a.values())e.Gb()&&b.push(e.tag());a=b}return a}ic(a,b){var c=U(this,a,!0);return c?(c=c.get(b.Oa()+b.R()))&&1<c.size?(this.L.warn(`Relation ${b.R()} to instance ${a} is not unique: found ${c.size} related items`),
432
+ null):(a=c?c.values().next().value:null)&&a.Gb()?a.tag():null:null}Nf(a,b,c){a=olympe.dc.xa(a);const d=Fd(this,a,b);d.delete(a);return c?(c=olympe.dc.xa(c),d.has(c)?Array.from(Fd(this,c,b.Pc()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Vm(a,b,c){if(!this.Gb(a))return null;b=Fd(this,a,b);const d=[olympe.dc.xa(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}Wm(a,b,c){return this.hj(a,b).find(c)||null}Wv(a,b,c){return this.hj(a,
433
+ b).filter(c)}bn(a,b=olympe.dc.CloudObject){var c=U(this,a,!0);const d=b&&U(this,b,!0),e=[c];for(;c&&c!==d;){c=c.zf();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Gb())throw a=`Try to get all extensions of the model ${olympe.dc.xa(a)} but one of them does not exists (${c.tag()})`,Error(a);null!==c&&e.push(c)}c=U(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}).`);
434
+ return e.map(f=>f.tag())}Sf(a,b){const c=olympe.dc.xa(b);return!!this.Vm(a,olympe.dc.CloudObject.extendRel,d=>d===c)}de(a){return this.ub(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.ib.prototype.getInstances=olympe.dc.ib.prototype.de;olympe.dc.ib.prototype.isExtending=olympe.dc.ib.prototype.Sf;olympe.dc.ib.prototype.getExtendedModels=olympe.dc.ib.prototype.bn;olympe.dc.ib.prototype.findAllRelated=olympe.dc.ib.prototype.Wv;olympe.dc.ib.prototype.findRelated=olympe.dc.ib.prototype.Wm;
435
+ olympe.dc.ib.prototype.findRecursive=olympe.dc.ib.prototype.Vm;olympe.dc.ib.prototype.getRecursiveRelated=olympe.dc.ib.prototype.Nf;olympe.dc.ib.prototype.getUniqueRelated=olympe.dc.ib.prototype.ic;olympe.dc.ib.prototype.getMultiRelated=olympe.dc.ib.prototype.hj;olympe.dc.ib.prototype.isRelated=olympe.dc.ib.prototype.Xk;olympe.dc.ib.prototype.getRelated=olympe.dc.ib.prototype.ub;olympe.dc.ib.prototype.getProperties=olympe.dc.ib.prototype.rd;olympe.dc.ib.prototype.getProperty=olympe.dc.ib.prototype.fb;
436
+ olympe.dc.ib.prototype.isPersisted=olympe.dc.ib.prototype.Vf;olympe.dc.ib.prototype.instanceOf=olympe.dc.ib.prototype.rh;olympe.dc.ib.prototype.isModel=olympe.dc.ib.prototype.lj;olympe.dc.ib.prototype.extension=olympe.dc.ib.prototype.zf;olympe.dc.ib.prototype.model=olympe.dc.ib.prototype.model;olympe.dc.ib.prototype.name=olympe.dc.ib.prototype.name;olympe.dc.ib.prototype.exist=olympe.dc.ib.prototype.Gb;function Id(a,b){let c=a.C.get(b);void 0===c&&(c=new olympe.dc.db.kg(b),a.C.set(b,c));return c}function Jd(a,b,c=olympe.dc.Sb.NONE){b=Kd(a,b,c);for(const d of b)Ld(a,d,!1),a.C.delete(d)}
437
+ function Kd(a,b,c,d=!0){const e=olympe.dm.Relation.C.mk,f=olympe.dm.Relation.C.yk,g=olympe.dc.za.ORIGIN,h=olympe.dc.Na();b=new Set([b]);const k=new Set;for(const n of b){var l=a.C.get(n);if(void 0!==l){for(const [p,q,r]of l.dd())r&&Dd(h,p,c)&f?b.add(q):d||r||k.add(`${n}.${p}.${q}`);for(const [p,q,r]of l.ab())r&&Dd(h,p,c)&e?b.add(q):d||r||k.add(`${q}.${p}.${n}`)}for(const [p,q,r]of Ed(h,n))l=q===g?e:f,!k.has(q===g?`${r}.${p}.${n}`:`${n}.${p}.${r}`)&&Dd(h,p,c)&l&&b.add(r)}return Array.from(b).filter(n=>
438
+ a.C.has(n))}function Ld(a,b,c){const d=olympe.dc.za.ORIGIN,e=olympe.dc.za.DESTINATION,f=a.C.get(b);for(const [h,k,l]of f.dd())if(l||!c){f.U(h,e,k);var g=a.C.get(k);g&&g.U(h,d,b)}for(const [h,k,l]of f.ab())if(l||!c)f.U(h,d,k),(g=a.C.get(k))&&g.U(h,e,b)}function*Md(a,b,c,d,e=[]){e.push(b);b=a.Jf(b);for(const [f,g]of b.ub(c))e.includes(f)||(yield*Md(a,f,c,d,e),yield d(f,g))}function Nd(a,b,c,d){const e=a.C.get(c);a=a.C.get(d);e&&e.U(b,olympe.dc.za.DESTINATION,d);a&&a.U(b,olympe.dc.za.ORIGIN,c)}
439
+ olympe.dc.db.xc=class{constructor(a){this.id=a||olympe.W.cj();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.substr(0,a.length-2));return a+'}}'}static mc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=new olympe.dc.db.xc(b.id);b=b.instances;for(const c of Object.keys(b)){const d=olympe.dc.db.kg.mc(b[c]);a.C.set(c,d)}return a}Z(){return this.id}Mc(a){const b=
440
+ olympe.dc.db.kg.C.Yl,c=olympe.dc.db.kg.C.Fc,d=olympe.dc.db.kg.C.Ak;this.C.forEach((e,f)=>{const g=e.getState();switch(g.id){case b:a.F(f,e.Y()?e.rd():void 0);break;case d:e.Y()&&a.qc(f,e.rd(),g.$i);break;case c:a.Jc(f,g.$i)}for(const [h,k,l]of e.dd())l?a.Ra(h,f,k):a.hc(h,f,k)})}G(){let a=0;this.C.forEach(b=>{a+=b.fc()});return a}F(a,b){a=Id(this,a).create();b&&a.ra(b)}qc(a,b,c){b&&(a=Id(this,a).ra(b),c&&a.Xb())}Jc(a,b=olympe.dc.Sb.NONE){const c=this.C.get(a);if(c&&c.se())Jd(this,a,b);else{Id(this,
441
+ a).delete(b);for(const d of Kd(this,a,b,!1))this.C.get(d).rd().clear(),Ld(this,d,!0)}}Ra(a,b,c){Id(this,b).link(a,c);Id(this,c).bb(a,b)}hc(a,b,c){Id(this,b).unlink(a,c);Id(this,c).Ab(a,b)}de(){return function*(a){for(const b of a.values())if(b.se()||b.N()||b.Y())yield b}(this.C)}Jf(a){return this.C.get(olympe.dc.xa(a))||null}dd(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.dd((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}Nf(a,b,c=(d,e)=>[d,e]){return Md(this,
442
+ a,b,c)}};olympe.dc.db.xc.la=[olympe.dc.Writable,olympe.dc.jm];const Od=new Map;
443
+ olympe.dc.db.kg=class a{constructor(b){this.ka=b;this.G=a.F(a.C.Ak,!1);this.F=this.Ka=this.C=null}toJSON(){let b='{ "tag": '+JSON.stringify(this.ka)+', "state": '+JSON.stringify(this.G);if(this.C){b+=', "properties": {';for(var c of this.C.keys()){const d=this.C.get(c);b+=JSON.stringify(c)+': ';b=d.toJSON?b+d.toJSON():b+JSON.stringify(d);b+=', '}b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}'}if(this.Ka){b+=', "relations": {';for(const d of this.Ka.keys()){c=this.Ka.get(d);b+=JSON.stringify(d)+
444
+ ': {';for(const e of c.keys())b+=JSON.stringify(e)+': '+JSON.stringify(c.get(e))+', ';b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}, '}b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}'}return b+'}'}static mc(b){var c;'string'===typeof b?c=JSON.parse(b):c=b;b=new olympe.dc.db.kg(c.tag);b.G=c.state;const d=c.properties;if(d){b.C=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.Hc.mc(f):h=olympe.D.mc(f));null!==h&&void 0!==h&&b.C.set(e,h)}}if(c=
445
+ c.relations){b.Ka=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.Ka.set(f,e)}}return b}static F(b,c){const d=String(b)+','+String(c);let e=Od.get(d);void 0===e&&(e={id:b,$i:c},Od.set(d,e));return e}tag(){return this.ka}getState(){return this.G}create(){this.G=a.F(a.C.Yl);return this}delete(b=olympe.dc.Sb.NONE){this.G=a.F(a.C.Fc,b);this.C=null;return this}Xb(){this.G.id===a.C.Ak&&(this.G=a.F(a.C.Ak,!0))}Ca(b,c){if(this.G.type===a.C.Fc)return this;
445
446
  this.C||(this.C=new Map);this.C.set(b,c);return this}ra(b){this.C||(this.C=new Map);b.forEach((c,d)=>{this.C.set(d,c)});return this}Da(b){this.C&&this.C.delete(b);0===this.C.size&&(this.C=null)}link(b,c){null===this.Ka&&(this.Ka=new Map);this.Pa(this.Ka,b,c,!0);return this}unlink(b,c){null===this.Ka&&(this.Ka=new Map);this.Pa(this.Ka,b,c,!1);return this}bb(b,c){this.F||(this.F=new Map);this.Pa(this.F,b,c,!0)}Ab(b,c){this.F||(this.F=new Map);this.Pa(this.F,b,c,!1)}zc(b,c,d){if(c=c===olympe.dc.za.ORIGIN?
446
- this.F:this.Ka)return(b=c.get(b))&&b.get(d)}V(b,c,d){const e=(c=c===olympe.dc.za.ORIGIN?this.F:this.Ka)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}se(){return this.G.id===a.C.bm}N(){return this.G.id===a.C.Fc}cc(){let b=this.C?this.C.size:0;this.Ka&&this.Ka.forEach(c=>{b+=c.size});return b}Z(){return null!==this.C}rd(){return this.C||new Map}fb(b){if(this.C)return this.C.get(b)}ub(b,c=(d,e)=>[d,e]){return function*(d){if(d=d&&d.get(b.R()))for(const [e,f]of d)yield c(e,f)}(b.Oa()===olympe.dc.za.ORIGIN?
447
- this.F:this.Ka)}fc(b){const c=b.Oa()===olympe.dc.za.ORIGIN?this.F:this.Ka;return(b=c&&c.get(b.R()))&&0!==b.size?Array.from(b.keys())[0]:null}ph(){return this.fc(olympe.dc.CloudObject.modelRel)}dd(b=(c,d,e)=>[c,d,e]){return this.aa(this.Ka,b)}ab(b=(c,d,e)=>[c,d,e]){return this.aa(this.F,b)}Sa(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.za.ORIGIN,d=olympe.dc.za.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>b(h,c,k,l))}(this.aa.bind(this),this.Ka,this.F)}Pa(b,c,
448
- d,e){if(this.G.id!==a.C.Fc||!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)}}*aa(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.mg.C={bm:0,Ek:1,Fc:2};function Lc(a,b,c,d,e,f=olympe.dc.Ja.rb){const g=olympe.dc.db.Instance.C.pq,h=olympe.dc.db.Instance.C.sr,k=c.Y();if(a.F.has(k))throw Error(`You try to execute the patch ${k} a second times whereas the first execution has not been validated yet.`);const l=new Ld(c,Md(a,c),f);a.C.push(k);a.F.set(k,l);a.Ha.Da();a.Ha.Ab(d,g);a.Ha.Ab(e,h);Mc(a,c,f);const n=Array.from(c.ee()).filter(p=>p.se()).map(p=>p.tag());a.Ha.Xc(n);a.Ha.ra();0<n.length&&b.vc(()=>{a.Ha.Da();a.Ha.Nd(n);a.Ha.ra()})}
449
- function Mc(a,b,c){a.G.process(c,b,d=>{d||a.L.debug('CommitController: Rebase of patch',b.Y(),'done')})}function Nc(a,b,c){return a.C.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>e?e.bf(d):d,b)}
450
- function Md(a,b){const c=a.Ha,d=olympe.dc.db.Database.bc.Oh,e=olympe.dc.db.Database.bc.mc,f=olympe.dc.db.Database.bc.ORIGIN,g=olympe.dc.db.Database.bc.DESTINATION,h=olympe.dc.$b.VERSION,k=olympe.dc.$b.Jd,l=new olympe.dc.db.xc('rev-'+b.Y());a.L.debug('Generate the reverse graphLayer of',b.Y());b.C.forEach((n,p)=>{if(n.se()){l.Jc(p,olympe.dc.Rb.NONE);for(const [t,u]of n.dd())l.ec(t,p,u)}else{var q=c.get(p);if(void 0!==q)if(n.N()){n=n.getState().bj;for(const t of c.Z(p,n)){p=c.get(t);const u=(new Map).set(h,
451
- q.version()).set(k,q.source());p.forEach((v,w)=>{const y=w[0],A=w.substr(1);y===d?u.set(A,v):y===e?u.set(w,v):y===f?v.forEach((D,T)=>{l.Ra(A,T,t,0)}):y===g&&v.forEach((D,T)=>{l.Ra(A,t,T,0)})});l.F(t,u,0)}}else{const t=(new Map).set(h,q.version());for(const u of n.rd().keys()){var r=u[0]===e;const v=r?u.substr(1):u;r=r?q.ra(v,!0):q.fb(v,!0);t.set(u,void 0===r?null:r)}1<t.size&&l.pc(p,t,!0,0);for(const [u,v,w]of n.dd())w?l.ec(u,p,v):l.Ra(u,p,v)}}});return l}
452
- olympe.dc.db.Os=class{constructor(a,b,c){this.L=a;this.Ha=b;this.G=c;this.C=[];this.F=new Map}bf(a,b){Mc(this,Nc(this,a,this.C.length),b)}push(a){const b=this.C.indexOf(a);if(-1<b){const c=this.F.get(a);this.C.splice(b,1);Nc(this,c.F,b);this.F.delete(a)}}};function Nd(a,b,c,d){const e=olympe.dc.za.DESTINATION;c=c.tag();const f=a.C.Jf(c);b.rd().forEach((g,h)=>{f.Ca(h,g);b.Da(h)});for(const [g,h,k,l]of b.Sa()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Ra(g,n,p);Jd(d,g,n,p)}}
453
- function Od(a,b,c,d){const e=olympe.dc.za.DESTINATION,f=c.tag(),g=a.C.Jf(f);b.rd().forEach((h,k)=>{void 0!==c.fb(k)&&(g.Ca(k,h),b.Da(k))});for(const [h,k,l]of b.dd()){const n=c.zc(h,e,k);void 0!==n&&(Jd(d,h,f,k),n===l&&Jd(a.C,h,f,k))}}
454
- class Ld{constructor(a,b,c){this.F=a;this.C=b;this.source=c;this.db=olympe.dc.Na()}Y(){return this.F.Y()}bf(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.N()?c.se()||Fd(this.C,b,f.getState().bj):c.N()?(Nd(this,f,c,a),Fd(a,b,c.getState().bj)):Od(this,f,c,a))}return a}};olympe.dc.db.O={Ea:'dc.db.Logger',va:'dc.db.DatabaseManager',Nj:'dc.db.Database',ib:'dc.db.Driver',pt:'dc.db.Graph',to:'dc.db.DataProcessor',xo:'dc.db.DebugProcessor',sA:'dc.db.PermissionProcessor',Ki:'dc.db.GraphMonitor'};olympe.dc.db.Config={Vo:'db.garbageCollector',Ki:'db.monitor',wo:'db.debug'};
455
- olympe.T.config(function(a){E(a,olympe.dc.db.Config.Vo,olympe.dc.db.Ci.C.Uq);E(a,olympe.dc.db.Config.Ki,!1);E(a,olympe.dc.db.Config.wo,!1);C(a,olympe.dc.db.O.Ea,[olympe.pa.O.va],b=>b.Nc('dc.db'));C(a,olympe.dc.db.O.Nj,[olympe.dc.db.O.Ea,new olympe.T.fa(olympe.dc.Config.yo),new olympe.T.fa(olympe.dc.db.Config.Vo),new olympe.T.fa(olympe.dc.Config.$g),new olympe.T.fa(olympe.dc.db.Config.wo)],(b,c,d,e,f)=>{d=e?olympe.dc.db.Ci.C.Fl:d;c=(new Map).set('defaultSource',c).set('garbageCollector',d).set('debug',
456
- f);return new olympe.dc.db.Database(b,c)});C(a,olympe.dc.db.O.ib,[olympe.dc.db.O.va],b=>b.view);C(a,olympe.dc.db.O.Ki,[olympe.dc.db.O.va],b=>b.Cx);B(a,olympe.dc.db.O.xo,olympe.dc.db.Ub.Do,olympe.dc.O.Ea);C(a,olympe.dc.db.O.to,[olympe.dc.db.O.Ea,olympe.dc.db.O.Nj,olympe.T.O.dg,new olympe.T.fa(olympe.dc.Config.eg)],(b,c,d,e)=>{b=new olympe.dc.db.Ub.vr(b,c);e&&(b=new olympe.dc.pm(ma(d,olympe.dc.db.O.xo),b));return b});B(a,olympe.dc.db.O.va,olympe.dc.db.Zs,olympe.dc.db.O.Ea,olympe.dc.db.O.Nj,olympe.dc.O.me,
457
- olympe.dc.db.O.to,new olympe.T.fa(olympe.dc.db.Config.Ki))},'olympe.dc.db');olympe.T.run([olympe.dc.db.O.Nj,olympe.dc.db.O.Ki],(a,b)=>{olympe.hj().db=a;olympe.hj().dbMonitor=b},'DC.DB debug service injection');olympe.dc.db.Ub={};olympe.dc.db.Ub.vr=class{constructor(a,b){this.L=a;this.Ha=b;this.buffer=[]}process(a,b,c){this.Ha.Da();b.Mc(this);this.Ha.ra();c(null,b)}F(a,b){this.Ha.create(a,b)}pc(a,b,c){this.Ha.update(a,b,c)}Jc(a,b=olympe.dc.Rb.NONE){for(const c of this.Ha.Z(a,b))this.Ha.Jc(c)}Ra(a,b,c){this.Ha.link(a,b,c)}ec(a,b,c){this.Ha.unlink(a,b,c)}};olympe.dc.db.Ub.vr.la=[olympe.dc.rg,olympe.dc.Writable];function Pd(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)d+=(d?', "':'"')+e+'":',f?f instanceof olympe.dc.Hc||f instanceof olympe.dc.CloudObject?d+='new olympe.dc.Reference("'+f.R()+'")':f instanceof olympe.D.Color?d+='new olympe.df.Color("'+f.Of()+','+f.If()+','+f.Df()+','+f.Cf()+'")':f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString')?d+=JSON.stringify(f.toString()):'object'===typeof f&&(d+=Pd(a,f,(c||0)+1)):d+=JSON.stringify(f);return'{'+
447
+ this.F:this.Ka)return(b=c.get(b))&&b.get(d)}U(b,c,d){const e=(c=c===olympe.dc.za.ORIGIN?this.F:this.Ka)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}se(){return this.G.id===a.C.Yl}N(){return this.G.id===a.C.Fc}fc(){let b=this.C?this.C.size:0;this.Ka&&this.Ka.forEach(c=>{b+=c.size});return b}Y(){return null!==this.C}rd(){return this.C||new Map}fb(b){if(this.C)return this.C.get(b)}ub(b,c=(d,e)=>[d,e]){return function*(d){if(d=d&&d.get(b.R()))for(const [e,f]of d)yield c(e,f)}(b.Oa()===olympe.dc.za.ORIGIN?
448
+ this.F:this.Ka)}ic(b){const c=b.Oa()===olympe.dc.za.ORIGIN?this.F:this.Ka;return(b=c&&c.get(b.R()))&&0!==b.size?Array.from(b.keys())[0]:null}nh(){return this.ic(olympe.dc.CloudObject.modelRel)}dd(b=(c,d,e)=>[c,d,e]){return this.aa(this.Ka,b)}ab(b=(c,d,e)=>[c,d,e]){return this.aa(this.F,b)}Sa(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.za.ORIGIN,d=olympe.dc.za.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>b(h,c,k,l))}(this.aa.bind(this),this.Ka,this.F)}Pa(b,c,
449
+ d,e){if(this.G.id!==a.C.Fc||!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)}}*aa(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.kg.C={Yl:0,Ak:1,Fc:2};function Pc(a,b,c,d,e,f=olympe.dc.Ha.rb){const g=olympe.dc.db.Instance.C.jq,h=olympe.dc.db.Instance.C.lr,k=c.Z();if(a.F.has(k))throw Error(`You try to execute the patch ${k} a second times whereas the first execution has not been validated yet.`);const l=new Pd(c,Qd(a,c),f);a.C.push(k);a.F.set(k,l);a.Ia.Da();a.Ia.Ab(d,g);a.Ia.Ab(e,h);Qc(a,c,f);const n=Array.from(c.de()).filter(p=>p.se()).map(p=>p.tag());a.Ia.Xc(n);a.Ia.ra();0<n.length&&b.vc(()=>{a.Ia.Da();a.Ia.Ld(n);a.Ia.ra()})}
450
+ function Qc(a,b,c){a.G.process(c,b,d=>{d||a.L.debug('CommitController: Rebase of patch',b.Z(),'done')})}function Rc(a,b,c){return a.C.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>e?e.$e(d):d,b)}
451
+ function Qd(a,b){const c=a.Ia,d=olympe.dc.db.Database.ec.Nh,e=olympe.dc.db.Database.ec.bc,f=olympe.dc.db.Database.ec.ORIGIN,g=olympe.dc.db.Database.ec.DESTINATION,h=olympe.dc.$b.VERSION,k=olympe.dc.$b.Jd,l=new olympe.dc.db.xc('rev-'+b.Z());a.L.debug('Generate the reverse graphLayer of',b.Z());b.C.forEach((n,p)=>{if(n.se()){l.Jc(p,olympe.dc.Sb.NONE);for(const [t,u]of n.dd())l.hc(t,p,u)}else{var q=c.get(p);if(void 0!==q)if(n.N()){n=n.getState().$i;for(const t of c.Y(p,n)){p=c.get(t);const u=(new Map).set(h,
452
+ q.version()).set(k,q.source());p.forEach((v,w)=>{const y=w[0],B=w.substr(1);y===d?u.set(B,v):y===e?u.set(w,v):y===f?v.forEach((E,T)=>{l.Ra(B,T,t,0)}):y===g&&v.forEach((E,T)=>{l.Ra(B,t,T,0)})});l.F(t,u,0)}}else{const t=(new Map).set(h,q.version());for(const u of n.rd().keys()){var r=u[0]===e;const v=r?u.substr(1):u;r=r?q.ra(v,!0):q.fb(v,!0);t.set(u,void 0===r?null:r)}1<t.size&&l.qc(p,t,!0,0);for(const [u,v,w]of n.dd())w?l.hc(u,p,v):l.Ra(u,p,v)}}});return l}
453
+ olympe.dc.db.Ks=class{constructor(a,b,c){this.L=a;this.Ia=b;this.G=c;this.C=[];this.F=new Map}$e(a,b){Qc(this,Rc(this,a,this.C.length),b)}push(a){const b=this.C.indexOf(a);if(-1<b){const c=this.F.get(a);this.C.splice(b,1);Rc(this,c.F,b);this.F.delete(a)}}};function Rd(a,b,c,d){const e=olympe.dc.za.DESTINATION;c=c.tag();const f=a.C.Jf(c);b.rd().forEach((g,h)=>{f.Ca(h,g);b.Da(h)});for(const [g,h,k,l]of b.Sa()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Ra(g,n,p);Nd(d,g,n,p)}}
454
+ function Sd(a,b,c,d){const e=olympe.dc.za.DESTINATION,f=c.tag(),g=a.C.Jf(f);b.rd().forEach((h,k)=>{void 0!==c.fb(k)&&(g.Ca(k,h),b.Da(k))});for(const [h,k,l]of b.dd()){const n=c.zc(h,e,k);void 0!==n&&(Nd(d,h,f,k),n===l&&Nd(a.C,h,f,k))}}
455
+ class Pd{constructor(a,b,c){this.F=a;this.C=b;this.source=c;this.db=olympe.dc.Na()}Z(){return this.F.Z()}$e(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.N()?c.se()||Jd(this.C,b,f.getState().$i):c.N()?(Rd(this,f,c,a),Jd(a,b,c.getState().$i)):Sd(this,f,c,a))}return a}};olympe.dc.db.O={Ea:'dc.db.Logger',va:'dc.db.DatabaseManager',Kj:'dc.db.Database',ib:'dc.db.Driver',mt:'dc.db.Graph',no:'dc.db.DataProcessor',ro:'dc.db.DebugProcessor',vA:'dc.db.PermissionProcessor',Ji:'dc.db.GraphMonitor'};olympe.dc.db.Config={Po:'db.garbageCollector',Ji:'db.monitor',qo:'db.debug'};
456
+ olympe.T.config(function(a){D(a,olympe.dc.db.Config.Po,olympe.dc.db.Bi.C.Pq);D(a,olympe.dc.db.Config.Ji,!1);D(a,olympe.dc.db.Config.qo,!1);C(a,olympe.dc.db.O.Ea,[olympe.pa.O.va],b=>b.Nc('dc.db'));C(a,olympe.dc.db.O.Kj,[olympe.dc.db.O.Ea,new olympe.T.fa(olympe.dc.Config.so),new olympe.T.fa(olympe.dc.db.Config.Po),new olympe.T.fa(olympe.dc.Config.Yg),new olympe.T.fa(olympe.dc.db.Config.qo)],(b,c,d,e,f)=>{d=e?olympe.dc.db.Bi.C.Bl:d;c=(new Map).set('defaultSource',c).set('garbageCollector',d).set('debug',
457
+ f);return new olympe.dc.db.Database(b,c)});C(a,olympe.dc.db.O.ib,[olympe.dc.db.O.va],b=>b.view);C(a,olympe.dc.db.O.Ji,[olympe.dc.db.O.va],b=>b.Fx);A(a,olympe.dc.db.O.ro,olympe.dc.db.Ub.xo,olympe.dc.O.Ea);C(a,olympe.dc.db.O.no,[olympe.dc.db.O.Ea,olympe.dc.db.O.Kj,olympe.T.O.bg,new olympe.T.fa(olympe.dc.Config.cg)],(b,c,d,e)=>{b=new olympe.dc.db.Ub.qr(b,c);e&&(b=new olympe.dc.km(ma(d,olympe.dc.db.O.ro),b));return b});A(a,olympe.dc.db.O.va,olympe.dc.db.Vs,olympe.dc.db.O.Ea,olympe.dc.db.O.Kj,olympe.dc.O.me,
458
+ olympe.dc.db.O.no,new olympe.T.fa(olympe.dc.db.Config.Ji))},'olympe.dc.db');olympe.T.run([olympe.dc.db.O.Kj,olympe.dc.db.O.Ji],(a,b)=>{olympe.fj().db=a;olympe.fj().dbMonitor=b},'DC.DB debug service injection');olympe.dc.db.Ub={};olympe.dc.db.Ub.qr=class{constructor(a,b){this.L=a;this.Ia=b;this.buffer=[]}process(a,b,c){this.Ia.Da();b.Mc(this);this.Ia.ra();c(null,b)}F(a,b){this.Ia.create(a,b)}qc(a,b,c){this.Ia.update(a,b,c)}Jc(a,b=olympe.dc.Sb.NONE){for(const c of this.Ia.Y(a,b))this.Ia.Jc(c)}Ra(a,b,c){this.Ia.link(a,b,c)}hc(a,b,c){this.Ia.unlink(a,b,c)}};olympe.dc.db.Ub.qr.la=[olympe.dc.pg,olympe.dc.Writable];function Td(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)d+=(d?', "':'"')+e+'":',f?f instanceof olympe.dc.Hc||f instanceof olympe.dc.CloudObject?d+='new olympe.dc.Reference("'+f.R()+'")':f instanceof olympe.D.Color?d+='new olympe.df.Color("'+f.Of()+','+f.If()+','+f.Df()+','+f.Cf()+'")':f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString')?d+=JSON.stringify(f.toString()):'object'===typeof f&&(d+=Td(a,f,(c||0)+1)):d+=JSON.stringify(f);return'{'+
458
459
  (d?d:'')+'}'}
459
- olympe.dc.db.Ub.Do=class{constructor(a){this.L=a;this.output=''}process(a,b,c){this.output='Patch #'+b.Y()+' (source: '+a+')';b.Mc(this);this.L.info(this.output);this.output='';c(null,b)}log(a,b){this.output+='\ndb.'+a+';'+(b?' // '+b:'')}F(a,b){this.log('createInstance("'+a+'", '+Pd(this,b)+')')}pc(a,b){this.log('updateInstance("'+a+'", '+Pd(this,b)+')')}Jc(a,b){var c=olympe.dc.Na();const d=c.model(a);c=d?c.name(d)+' #'+d:'';this.log('deleteInstance("'+a+'", rule: '+b+')',c)}Ra(a,b,c){this.log('createRelation("'+
460
- a+'", "'+b+'", "'+c+'")',a===olympe.dc.ic.Tc?'Model':'')}ec(a,b,c){this.log('deleteRelation("'+a+'", "'+b+'", "'+c+'")',a===olympe.dc.ic.Tc?'Model':'')}};olympe.dc.db.Ub.Do.la=[olympe.dc.Writable,olympe.dc.rg];olympe.dc.transaction={};olympe.dc.ti=class a{constructor(b,c){this.id=b||olympe.W.lc();this.F=new olympe.D.Wb('BurstTransaction#'+this.id,c);this.cc=Qd(this);this.Z=!1;this.F.onDestroy(()=>this.V());this.Da=new Set;this.G=new Map;this.N=new Set;this.C=null;this.bb=olympe.T.getParameter(olympe.dc.transaction.Config.Zn)||30;this.ra=[]}static C(b,c){return`${b},${c}`}Xb(b){for(const c of this.ra)c(b);this.stop()}ab(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.ka(this.N);0<b.size&&Rd(this,b,!1);this.N.clear()}ka(b){const c=
461
- 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}aa(b,c,d){this.Sa(b,c,d);this.cc(b,c,d);null===this.C&&(this.C=setTimeout(this.ab.bind(this),this.bb))}Sa(b,c,d){b=a.C(b,c);this.G.set(b,d);this.N.add(b)}Ab(b,c){return this.G.get(a.C(b,c))}push(b,c){const d=olympe.dc.xa(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.xa(f),this.Ab(d,e)!==g&&this.aa(d,e,g.valueOf())});this.Da.add(b)}complete(){return new Promise((b,
462
- c)=>{this.V((d,e)=>{for(const f of this.Da)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.xa(b),f=olympe.dc.xa(c);void 0===e||void 0===f?olympe.dc.hi().Xa().error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.Dn([d],g=>{this.Z=!0;g instanceof olympe.dc.Hc?olympe.dc.hi().Xa().error('Cannot send complex property values in burst transactions'):this.aa(e,f,g.valueOf())})}),this.F.vc(this.V.bind(this)))}stop(){this.F.destroy();this.ra.length=
463
- 0}Y(){return this.id}uh(){return!1}V(b){if(this.Z){this.Z=!1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.N.clear();const c=this.ka(new Set(this.G.keys()));Rd(this,c,!0,b)}else b&&b(!0,null)}toString(){return'Burst transaction #'+this.id}};olympe.dc.ti.prototype.complete=olympe.dc.ti.prototype.complete;olympe.dc.ti.prototype.push=olympe.dc.ti.prototype.push;olympe.dc.iq=class{C(){}toString(){}};olympe.dc.transaction.pg=class{constructor(a){this.id=a||olympe.W.ej();this.ua=[];this.size=0}Y(){return this.id}G(){return this.size}concat(a){this.ua.push(...a.ua)}Mc(a){const b=olympe.dc.transaction.pg.C,c=this.ua.length;let d=0;for(;d<c;)switch(this.ua[d]){case b.lo:a.F(this.ua[d+1],this.ua[d+2],this.ua[d+3]);d+=4;break;case b.gr:a.pc(this.ua[d+1],this.ua[d+2],this.ua[d+3],this.ua[d+4]);d+=5;break;case b.zo:a.Jc(this.ua[d+1],this.ua[d+2],this.ua[d+3]);d+=4;break;case b.mo:a.Ra(this.ua[d+1],this.ua[d+
464
- 2],this.ua[d+3],this.ua[d+4]);d+=5;break;case b.Ao:a.ec(this.ua[d+1],this.ua[d+2],this.ua[d+3],this.ua[d+4]);d+=5;break;default:throw Error('Invalid Patch operations "'+this.ua[d]+'"');}}F(a,b,c){this.ua.push(olympe.dc.transaction.pg.C.lo,a,b,c);this.size++}pc(a,b,c,d){this.ua.push(olympe.dc.transaction.pg.C.gr,a,b,c,d);this.size++}Jc(a,b=olympe.dc.Rb.NONE,c){this.ua.push(olympe.dc.transaction.pg.C.zo,a,b,c);this.size++}Ra(a,b,c,d){if('string'!==typeof a)throw Error('Relation should be created using a tag as string (most likely a relation object is given here instead)');
465
- this.ua.push(olympe.dc.transaction.pg.C.mo,a,b,c,d);this.size++}ec(a,b,c,d){this.ua.push(olympe.dc.transaction.pg.C.Ao,a,b,c,d);this.size++}};olympe.dc.transaction.pg.C={lo:1,gr:2,zo:3,mo:4,Ao:5};olympe.dc.transaction.pg.la=[olympe.dc.Writable,olympe.dc.om];function Sd(a,b){return a.V.get(b)||a.db.source(b)||olympe.dc.Ja.mc}function Td(a,b){return a.N.has(b)?a.N.get(b):a.db.Vf(b)}function Ud(a,b,c,d){var e=d&&d.get(olympe.dc.$b.VERSION);a.versions.set(b,Number(e)||1);d&&a.V.set(b,d.get(olympe.dc.$b.Jd));e=Sd(a,b);a.N.set(b,c&&a.F);a.Bc(e,c,f=>{f.F(b,d,0)})}
466
- olympe.dc.transaction.wu=class{constructor(a,b){this.id=b||olympe.W.lc();this.db=a;this.C=new Map;this.G=new olympe.dc.db.xc(b);this.versions=new Map;this.V=new Map;this.Z={};this.N=new Map;this.F=!0}Rf(){return 0===this.G.C.size}persist(a){this.F=a}pc(a,b,c=!1){var d=b&&b.get(olympe.dc.$b.VERSION);this.versions.set(a,Number(d)||1);d=Sd(this,a);if(!d)throw Error('Attempt to update an instance which has an unknown source.');this.Bc(d,Td(this,a),e=>{e.pc(a,b,c,0)})}Jc(a,b){const c=Sd(this,a),d=Td(this,
467
- a);this.Bc(c,d,e=>{e.Jc(a,b)})}Ra(a,b,c){const d=Sd(this,b),e=Sd(this,c);let f=Td(this,b)&&Td(this,c);f&&d!==e&&a!==olympe.dc.ic.Tc&&(olympe.pa.Xa('dc').warn(`Try to create a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);this.Bc(d,f,g=>{g.Ra(a,b,c,0)})}ec(a,b,c){const d=Sd(this,b),e=Sd(this,c);let f=Td(this,b)&&Td(this,c);f&&d!==e&&a!==olympe.dc.ic.Tc&&(olympe.pa.Xa('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),
468
- f=!1);this.Bc(d,f,g=>{g.ec(a,b,c,0)})}Bc(a,b,c){c(this.G);b&&this.F&&(b=this.C.get(a),b||(b=new olympe.dc.db.xc(this.id),this.C.set(a,b)),c(b))}};function Vd(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.$b.Jd)if(e===olympe.dc.Ja.rb)d[g]=olympe.dc.Na().Y();else{if(e===olympe.dc.Ja.Vc)continue}else g.startsWith(olympe.dc.$b.VERSION)?(g=g.substr(1),e=null===e?1:e):g.startsWith(olympe.dc.Ug.mc)&&(g='fd'+g.substr(1));e=a.aa(e);c&&e instanceof Object&&8===e.c?a.Z.set(g,e):d[g]=e}return d}
469
- function Wd(a){if(0===a.Z.size)return null;const b=Object.create(null);a.Z.forEach((c,d)=>{b[d]=c});a.Z.clear();return b}
470
- class Xd{constructor(){this.Z=new Map}aa(a){return a instanceof olympe.D.Wa||a instanceof olympe.D.qa||a instanceof olympe.D.ea?a.valueOf():a instanceof Date||a instanceof olympe.D.jb?(a=a instanceof olympe.D.jb?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.Of().valueOf(),g:a.If().valueOf(),b:a.Df().valueOf(),a:a.Cf().valueOf()}:a&&'function'===
471
- typeof a.R?{c:8,t:a.R()}:a}}function Yd(a){a.Hg=[];a.Ue=[];a.$f=[];a.Ig=[];a.yg=[]}function Zd(a){const b={};0<a.yg.length&&(b.yg=a.yg);0<a.Ue.length&&(b.Ue=a.Ue);0<a.Hg.length&&(b.Hg=a.Hg);0<a.$f.length&&(b.$f=a.$f);0<a.Ig.length&&(b.Ig=a.Ig);Yd(a);return b}function $d(a){const b=[...a.yg,...a.Ue,...a.Hg,...a.$f,...a.Ig];Yd(a);return b}
472
- olympe.dc.transaction.wd=class{constructor(a=!1){this.Hg=[];this.Ue=[];this.$f=[];this.Ig=[];this.yg=[];this.G=a;this.C=olympe.D?new Xd:new class extends Xd{aa(b){return b&&'function'===typeof b.R?{c:8,t:b.R()}:b}}}flush(){return JSON.stringify($d(this))}F(a,b,c=-1){this.Hg.push({o:1,t:a,p:Vd(this.C,b||null,this.G),i:c});this.G&&(b=Wd(this.C))&&this.$f.push({o:2,t:a,p:b,i:c})}pc(a,b,c,d=-1){this.$f.push({o:2,t:a,p:Vd(this.C,b||null,!1),i:d})}Jc(a,b,c=-1){this.Ue.push({o:3,t:a,f:b,i:c})}Ra(a,b,c,d=
473
- -1){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`);this.Ig.push({o:4,m:a,l:b,r:c,i:d})}ec(a,b,c,d=-1){if(!a)throw Error('Cannot delete relation of undefined type');if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');this.yg.push({o:5,m:a,
474
- l:b,r:c,i:d})}};olympe.dc.transaction.wd.la=[olympe.dc.Writable];olympe.dc.transaction.Sh=class{constructor(a){this.id=a||olympe.W.lc();this.C=new Map;this.Ka=new Map}Y(){return this.id}F(a,b){this.C.has(a)&&console.warn('Try to add twice the same instance in the graph');const c=new olympe.dc.transaction.Sh.Instance(a);if(b)for(const [d,e]of b)c.Ca(d,e);this.C.set(a,c)}pc(){throw Error('UpdateInstance should never be called on a SubGraph since it represents the result of a GraphDef Query');}Jc(){throw Error('DeleteInstance should never be called on a SubGraph since it represents the result of a GraphDef Query');
475
- }Ra(a,b,c){a=new olympe.dc.transaction.Sh.Relation(b,c,a);this.Ka.set(a.toString(),a)}ec(a,b,c){a=new olympe.dc.transaction.Sh.Relation(b,c,a);this.Ka.delete(a.F+'.'+a.G+'.'+a.C)}G(){return this.Ka.size+this.C.size}ee(){return this.C}Mc(a){const b=new Map;this.C.forEach((c,d)=>{const e=new Map;ae(c,(f,g)=>{if(g instanceof olympe.dc.Hc){const h=b.get(d)||new Map;h.set(f,g);b.set(d,h)}else e.set(f,g)});a.F(d,e)});b.forEach((c,d)=>{a.pc(d,c)});this.Ka.forEach(c=>{a.Ra(c.C,c.F,c.G)})}};
476
- function ae(a,b){a.C.forEach((c,d)=>{b(d,b)})}olympe.dc.transaction.Sh.Instance=class{constructor(a){this.tag=a;this.C=new Map}R(){return this.tag}Ca(a,b){this.C.set(a,b);return this}deleteProperty(a){this.C.delete(a);return this}};olympe.dc.transaction.Sh.Relation=class{constructor(a,b,c){this.F=a;this.G=b;this.C=olympe.dc.xa(c)}toString(){return this.F+'.'+this.G+'.'+this.C}};olympe.dc.transaction.Sh.la=[olympe.dc.Writable,olympe.dc.om];function be(a,b){b&&a.ua.push(b);return b}function ce(a){return(b,c)=>a.forEach(d=>d&&d(b,c))}
477
- olympe.dc.Transaction=class{constructor(a){this.id=a||olympe.W.lc();this.ua=[];this.G=!0;this.F=[]}Y(){return this.id}persist(a){this.G=a;return this}C(a){a.persist(this.G);const b=this.ua;for(let c=0,d=b.length;c<d;c++)b[c].C(a)}create(a,b){return be(this,new olympe.dc.transaction.ua.Xd(a,b))}uj(a,b=!0){const c=olympe.dc.xa(a);var d=this.ua.find(g=>g instanceof olympe.dc.transaction.ua.Xd&&g.R()===c);if(d)return d.persist(b);d=olympe.dc.Na();const e=d.model(a);if(null===e)throw Error('Try to persist a instance that does not exist: '+
478
- a);if(d.Vf(a))return null;const f=d.source(a)||olympe.dc.Ja.mc;a=this.create(e,a).persist(b).mi(f);for(const [g,h,k]of Ad(d,a))g!==olympe.dc.ic.Tc&&d.Vf(k)&&this.Ra(g,h===olympe.dc.za.DESTINATION?a:k,h===olympe.dc.za.DESTINATION?k:a);return a}delete(a,b=olympe.dc.Rb.Fc){be(this,new olympe.dc.transaction.ua.Qj(a,b))}update(a,b,c){return be(this,new olympe.dc.transaction.ua.Ti(a,b,c))}Ra(a,b,c){be(this,new olympe.dc.transaction.ua.so(a,b,c))}ec(a,b,c,d){be(this,new olympe.dc.transaction.ua.at(a,b,c,
479
- d))}Vm(a,b,c,d){be(this,new olympe.dc.transaction.ua.$s(a,b,c,d))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,f);d.setProperty(olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Ug.mc+d.R(),e);this.Ra(olympe.dc.CloudObject.propertyRel,a,d);this.Ra(olympe.dm.Property.typeRel,d,b);this.Ra(olympe.dc.CloudObject.containsRel,a,d);return d}jh(a,b,c='',{Yi:d=olympe.dm.Relation.F.fm,tj:e=olympe.dm.Relation.N,Mr:f=olympe.dm.Relation.C.Bq,Kr:g=olympe.dm.Relation.C.tl,
480
- wj:h=olympe.dm.Relation.C.rp}={},k=olympe.W.lc()){k=this.create(olympe.dm.Relation,k);k.setProperty(olympe.dc.CloudObject.nameProp,c||'');k.setProperty(olympe.dm.Relation.Nm,d);k.setProperty(olympe.dm.Relation.Cn,e);k.setProperty(olympe.dm.Relation.Xm,f);k.setProperty(olympe.dm.Relation.Wm,g);k.setProperty(olympe.dm.Relation.hl,h);k.setProperty(olympe.dm.Relation.hl,h);this.Ra(olympe.dc.CloudObject.G,a,k);this.Ra(olympe.dm.Relation.destinationModelRel,k,b);this.Ra(olympe.dc.CloudObject.containsRel,
481
- a,k);return k}uh(){return!1}Lm(a){this.F.push(olympe.D.Ia().Cb(a))}hb(a,b){a=ce([...this.F,a]);de(this,a,b)}Ym(a){a=ce([...this.F,a]);ee(olympe.dc.hi(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Transaction.la=[olympe.dc.iq];function Qd(a){var b=olympe.dc.hi();const c=a.Y();b.N.set(c,a);a.F.onDestroy(()=>{b.N.delete(c)});return(d,e,f)=>{const g=new olympe.dc.db.xc(c);e=(new Map).set(olympe.dc.$b.VERSION,b.db.version(d)+1).set(e,f);g.pc(d,e,!1,0);olympe.dc.Ad().bf(g,olympe.dc.Ja.rb)}}
482
- function Rd(a,b,c,d){var e=olympe.dc.hi();const f=olympe.dc.$b.VERSION,g=olympe.dc.ga.ja.Ah,h=olympe.dc.ga.ja.ul,k=a.Y(),l=a.uh(),n=new Map;for(const q of b.keys()){var p=e.db.source(q);if(p===olympe.dc.Ja.rb)continue;let r=n.get(p);r||(r=new olympe.dc.db.xc(k),n.set(p,r));p=b.get(q);p.set(f,e.db.version(q)+1);r.pc(q,p,!1,0)}for(const [q,r]of n)b=xc(new olympe.dc.ga(c?h:g,{Bc:r,uh:l},[q]),a.F),c&&d&&M(b,t=>{t?d(!1,t.message):d(!0,null)}),e.G.send(b)}
483
- function de(a,b,c){var d=olympe.dc.hi();if(c&&b){const e=a.Y();d.F.set(e,b);ee(d,a,(f,g)=>{f||(d.F.delete(e),b(f,g))},!1)}else ee(d,a,b,!1)}
484
- function fe(a){const b=olympe.dc.ga.ja.Tj;a.G.C(olympe.dc.ga.ja.Jj,(c,d)=>{c=d.id;var e=d.rollback;d=d.error;const f=a.N.get(c);void 0!==f&&(a.N.delete(c),f.Xb(d));olympe.dc.Ad().bf(e,olympe.dc.Ja.rb);a.L.warn(`Fast update (id=${c}) has been refused and is rolled back. Error: ${d}`)});a.G.C(b,(c,d)=>{c=d.finalize;var e=d.error;(d=(d=a.C.get(d.id))&&d.pop())&&d(c,e)})}
485
- function ee(a,b,c,d=!1){const e=olympe.D.Ia(),f=c?e.Cb(c):void 0;c=olympe.dc.Ad();const g=b.Y(),h=new olympe.dc.transaction.wu(a.db,g);b.C(h);if(h.Rf())f&&f(!0,null);else{a.C.set(g,[]);const k=[],l=[];for(const p of h.versions.keys())Td(h,p)?k.push(p):l.push(p);const n=Kc(c,e,h.G,k,l);ge(a,h,(p,q,r)=>{q?(he(a,g,k,h.C.size),ie(a,h,d,b.uh(),(t,u)=>{!t&&a.C.has(g)&&(a.C.get(g).forEach(v=>v(olympe.dc.transaction.ug.C.ik,u)),je(a,g));n(t);p&&p(t);f&&f(t,u)})):(a.L.error(r),n(!1),f&&f(!1,r))})}}
486
- function ge(a,b,c){const d=[];for(const p of b.versions.keys())a.db.th(p,olympe.dm.File)&&Td(b,p)&&d.push(p);if(0===d.length)c(null,!0,null);else{var e=olympe.dm.File.urlProp.R(),f=olympe.dm.File.C.R(),g=olympe.dm.File.modificationDateProp.R(),h=Array.from(b.C.values()),k=[],l=new olympe.async.qg(olympe.D.oh()),n=olympe.W.di();d.forEach(p=>{l.add((q,r)=>{const t=a.db.fb(p,e,!0),u=a.db.fb(p,olympe.dm.File.mimeTypeProp)||'application/data';t.startsWith('blob:')?n.F(t,v=>{n.Z(t);null===v?q():tc(a.Z,
487
- p,v,u,w=>{const y=h.reduce((A,D)=>A||D.Jf(p),null);null!==y&&(y.Ca(e,w).Ca(f,!0),k.push([p,w]));q()},w=>{r(w)})}):(2048<t.length&&a.L.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:',p),q())})});Wb(l,(p,q)=>{let r=null;if(p){const t=new olympe.dc.db.xc;k.forEach(([u,v])=>{const w=new Map;w.set(e,v).set(f,!0).set(g,olympe.D.jb.now());t.pc(u,w,!0,0)});r=Kc(olympe.dc.Ad(),olympe.D.oh(),t,[],[])}c(r,p,q)});l.start()}}
488
- function he(a,b,c,d){const e=olympe.D.oh(),f=new olympe.async.qg(e);0<a.timeout&&Vb(f,a.timeout);const g=a.C.get(b);for(let h=0;h<d;h++)f.add((k,l,n)=>{g.push(e.Cb((p,q)=>{n.set('final',p);q?l(q):k()}))});Wb(f,(h,k,l)=>{h||a.L.warn(`An error occurred while processing the notification of transaction (${b}): ${k}.`);l.get('final')!==olympe.dc.transaction.ug.C.Xp&&olympe.dc.Ad().persist(c);je(a,b)});f.start()}
489
- function ie(a,b,c,d,e){b=b.C;if(0===b.size)e(!0,null);else{var f=c?olympe.dc.ga.ja.Bk:olympe.dc.ga.ja.eh;c=(h,k,l,n)=>{h=M(new olympe.dc.ga(f,{Bc:h,uh:d},[k]),p=>{p instanceof Error?n(p.message):l()});a.G.send(h)};var g=new olympe.async.qg(olympe.D.oh());for(const [h,k]of b)g.add(c.bind(null,k,h));Wb(g,e);g.start()}}function je(a,b){a.C.delete(b);if(0===a.C.size){for(var c of a.V)c();a.V=[]}a.F.has(b)&&(c=a.F.get(b),a.F.delete(b),c(!0,null))}
490
- function ke(a,b){0<a.C.size?a.V.push(olympe.D.Ia().Cb(b)):b()}olympe.dc.transaction.ug=class{constructor(a,b,c,d,e){this.L=a;this.db=b;this.G=c;this.Z=d;this.timeout=e;this.N=new Map;this.C=new Map;this.V=[];this.F=new Map;fe(this)}Xa(){return this.L}};olympe.dc.transaction.ug.C={ik:0,Wp:1,Xp:2};olympe.dc.transaction.O={Ea:'dc.transaction.Logger',va:'dc.transaction.Manager'};olympe.dc.transaction.Config={TIMEOUT:'dc.transaction.timeout',Zn:'dc.transaction.burstInterval'};
491
- olympe.T.config(function(a){E(a,olympe.dc.transaction.Config.TIMEOUT,6E4);E(a,olympe.dc.transaction.Config.Zn,30);C(a,olympe.dc.transaction.O.Ea,[olympe.pa.O.va],b=>b.Nc('dc'));B(a,olympe.dc.transaction.O.va,olympe.dc.transaction.ug,olympe.dc.transaction.O.Ea,olympe.dc.O.wi,olympe.dc.O.me,olympe.dc.O.zi,new olympe.T.fa(olympe.dc.transaction.Config.TIMEOUT))},'olympe.dc.transaction');olympe.dc.transaction.ua={};function W(a){return olympe.dc.xa(a)}function le(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Ya(e));return c}olympe.dc.transaction.ua.Pg=class{C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Ya(a){a=olympe.D.Ya(a);return void 0===a||null===a?null:olympe.D.bs(a)?a.valueOf():a}};olympe.dc.transaction.ua.Pg.la=[olympe.dc.iq];olympe.dc.transaction.ua.Xd=class extends olympe.dc.transaction.ua.Pg{constructor(a,b){super();this.tag=void 0!==b?b:olympe.W.lc();this.model=a;this.F=new Map;this.G=!0;this.F.set(olympe.dc.$b.VERSION,1)}R(){return W(this.tag)}Tb(){return W(this.model)}persist(a){this.G=a;return this}mi(a){this.F.set(olympe.dc.$b.Jd,a);return this}ux(){this.F.set(olympe.dc.$b.Jd,olympe.dc.Ja.rb)}setProperty(a,b){this.F.set(olympe.dc.xa(a),b);return this}il(a){this.setProperty(olympe.dc.CloudObject.nameProp.R(),a);
492
- return this}C(a){const b=olympe.dc.Na(),c=this.Tb(),d=this.R();if(void 0===c)throw Error('OperationError: Cannot create instance, model tag is undefined');var e=olympe.dc.$b.Jd;if(!this.F.has(e)){var f=b.source(c);this.F.set(e,null!==f?f:olympe.dc.Ja.mc)}if(b.Gb(d)&&!b.Vf(d)&&this.G){e=new Map([...b.rd(d,!0),...le(this,this.F)]);for(const g of e.values())g instanceof olympe.dc.Hc&&!Td(a,g.R())&&(f=new olympe.dc.Transaction,f.uj(g.R()),f.C(a));Ud(a,d,this.G,e);a.Ra(olympe.dc.CloudObject.modelRel.R(),
493
- d,c);for(const [g,h,k]of Ad(b,d))Td(a,k)&&(h===olympe.dc.za.ORIGIN?a.Ra(g,k,d):a.Ra(g,d,k))}else b.Gb(d)||(Ud(a,d,this.G,le(this,this.F)),a.Ra(olympe.dc.CloudObject.modelRel.R(),d,c))}toString(){return`CreateInstance(${this.Tb()}, ${this.R()})`}};olympe.dc.transaction.ua.Xd.prototype.setProperty=olympe.dc.transaction.ua.Xd.prototype.setProperty;olympe.dc.transaction.ua.Xd.prototype.localSource=olympe.dc.transaction.ua.Xd.prototype.ux;olympe.dc.transaction.ua.Xd.prototype.persist=olympe.dc.transaction.ua.Xd.prototype.persist;
494
- olympe.dc.transaction.ua.Xd.prototype.getModelTag=olympe.dc.transaction.ua.Xd.prototype.Tb;olympe.dc.transaction.ua.Xd.prototype.getTag=olympe.dc.transaction.ua.Xd.prototype.R;olympe.dc.transaction.ua.Xd.la=[olympe.dc.ze];olympe.dc.transaction.ua.so=class extends olympe.dc.transaction.ua.Pg{constructor(a,b,c){super();this.type=a.Oa?a:new olympe.dc.X.Qb(W(a));this.F=b;this.G=c}Oa(){return this.Ya(this.type).Oa()}C(a){const b=W(this.type);if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.ic.Tc)throw Error('OperationError: Cannot create the instance -> model relation');const c=W(this.F);if(''===c)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
495
- const d=W(this.G);if(''===d)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.Oa()===olympe.dc.za.DESTINATION?a.Ra(b,c,d):a.Ra(b,d,c)}toString(){return`CreateRelation('${this.Oa()}${W(this.type)}, ${W(this.F)}, ${W(this.G)})`}};olympe.dc.transaction.ua.dz=class extends olympe.dc.transaction.ua.Pg{constructor(a,b=olympe.dc.Rb.Fc){super();this.model=a;this.F=b}Tb(){return W(this.model)}C(a){const b=this.Tb();if(void 0===b)throw Error('OperationError: Cannot delete instances of model, model is undefined');const c=olympe.dc.Na();for(const d of c.ee(b))d!==b&&(new olympe.dc.transaction.ua.Qj(d,this.F)).C(a)}toString(){return`DeleteAllInstances(${this.Tb()}, ${this.F})`}};olympe.dc.transaction.ua.$s=class extends olympe.dc.transaction.ua.Pg{constructor(a,b,c,d){super();this.F=a.Oa?a:new olympe.dc.X.Qb(W(a));this.G=b;this.N=c||!1;this.V=d instanceof Array?d.map(e=>W(e)):null}Oa(){return this.Ya(this.F).Oa()}C(a){const b=W(this.F);if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.ic.Tc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=W(this.G);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');
496
- var d=olympe.dc.Na();const e=this.Oa(),f=this.V;d=d.ub(c,this.F);for(const g of d)e===olympe.dc.za.DESTINATION?a.ec(b,c,g):a.ec(b,g,c),null!==f&&0<=f.indexOf(g)||this.N&&(new olympe.dc.transaction.ua.Qj(g,olympe.dc.Rb.Fc)).C(a)}toString(){return`DeleteAllRelations(${this.Oa()}${W(this.F)}, ${W(this.G)}, ${this.N})`}};olympe.dc.transaction.ua.Qj=class extends olympe.dc.transaction.ua.Pg{constructor(a,b=olympe.dc.Rb.Fc){super();this.tag=a;this.F=b}R(){return W(this.tag)}C(a){const b=olympe.dc.Na(),c=this.R();if(void 0===c)throw Error('OperationError: Cannot delete instance, tag is undefined');const d=b.model(c);0<=b.version(c)&&d&&a.Jc(c,this.F)}toString(){return'DeleteInstance('+this.R()+', '+this.F+')'}};olympe.dc.transaction.ua.at=class extends olympe.dc.transaction.ua.so{constructor(a,b,c,d=!1){super(a,b,c);this.N=d}C(a){const b=W(this.type);if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.ic.Tc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=W(this.F);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=W(this.G);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
497
- this.Oa()===olympe.dc.za.DESTINATION?a.ec(b,c,d):a.ec(b,d,c);this.N&&(new olympe.dc.transaction.ua.Qj(d,olympe.dc.Rb.Fc)).C(a)}toString(){return'DeleteRelation('+this.Oa()+W(this.type)+', '+W(this.F)+', '+W(this.G)+', '+this.N+')'}};olympe.dc.transaction.ua.Ti=class extends olympe.dc.transaction.ua.Pg{constructor(a,b,c){super();this.tag=a;this.F=new Map;this.F.set(olympe.dc.$b.VERSION,-1);void 0!==b&&this.setProperty(b,c)}R(){return W(this.tag)}setProperty(a,b){this.F.set(W(a),b);return this}C(a){const b=this.R();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');const c=olympe.dc.Na();var d=c.version(b),e=a.versions.get(b);e=void 0!==e?e:d;if(null===e)throw Error('OperationError: Instance #'+
498
- b+' not found so it cannot be updated');d=le(this,this.F);0>=d.get(olympe.dc.$b.VERSION)&&d.set(olympe.dc.$b.VERSION,e+1);for(const [f,g]of d)e=c.fb(b,f),e instanceof olympe.dc.Hc&&(e=e.R(),a.Z[e]=!0),g instanceof olympe.dc.Hc&&!Td(a,g.R())&&(e=new olympe.dc.Transaction,e.uj(g.R()),e.C(a));a.pc(b,d)}toString(){return'UpdateInstance('+this.R()+', '+le(this,this.F)+')'}};olympe.dc.transaction.ua.Ti.prototype.setProperty=olympe.dc.transaction.ua.Ti.prototype.setProperty;
499
- olympe.dc.transaction.ua.Ti.prototype.getTag=olympe.dc.transaction.ua.Ti.prototype.R;olympe.dc.da={};olympe.dc.ze=class{R(){}};olympe.dc.ze.prototype.getTag=olympe.dc.ze.prototype.R;olympe.dc.Tz=olympe.dc.ze;olympe.dc.da.km={ASC:'ASC',DESC:'DESC'};function me(a){switch(a.pr){case 1:const c=a.v;switch(a.t){case 1:var b=c;break;case 2:b=new Date(c);break;case 3:b=olympe.dc.CloudObject.get(c);break;case 4:b=new olympe.D.Color(c.r,c.g,c.b,c.a)}return new olympe.dc.da.U.Gc(a.p,b,olympe.dc.Na());case 2:return new olympe.dc.da.U.Sc(a.p,a.s,olympe.dc.Na(),a.c);case 3:return new olympe.dc.da.U.Gh(a.p,a.b,a.l,a.s);case 4:return new olympe.dc.da.U.kd(me(a.v));case 5:return new olympe.dc.da.U.xd(a.p,new RegExp(a.r),olympe.dc.Na(),a.c);case 6:b=new olympe.dc.da.U.De(a.d);
500
- for(const [d,e,f]of a.r)a=new olympe.dc.query.Relation(d,e,f),f?b.Pk(a):b.sb(a);return b;case 7:return new olympe.dc.da.U.be(...a.p.map(d=>me(d)));case 8:return new olympe.dc.da.U.Vd(...a.p.map(d=>me(d)));default:return null}}
501
- olympe.dc.da.$a=class{observe(){}hb(){}clear(){}ia(){}toString(){}static qb(a,b){return new olympe.dc.da.U.Gc(a,b,olympe.dc.Na())}static contains(a,b,c=!1){return new olympe.dc.da.U.Sc(a,b,olympe.dc.Na(),c)}static js(a,b,c=!0){return new olympe.dc.da.U.xd(a,b,olympe.dc.Na(),c)}static Wk(a,b,c=!0){return new olympe.dc.da.U.Gh(a,b,!1,c)}static zj(a,b,c=!0){return new olympe.dc.da.U.Gh(a,b,!0,c)}static and(...a){return new olympe.dc.da.U.Vd(...a)}static or(...a){return new olympe.dc.da.U.be(...a)}static not(a){return new olympe.dc.da.U.kd(a)}};
502
- olympe.dc.da.$a.not=olympe.dc.da.$a.not;olympe.dc.da.$a.or=olympe.dc.da.$a.or;olympe.dc.da.$a.and=olympe.dc.da.$a.and;olympe.dc.da.$a.smallerThan=olympe.dc.da.$a.zj;olympe.dc.da.$a.greaterThan=olympe.dc.da.$a.Wk;olympe.dc.da.$a.regex=olympe.dc.da.$a.js;olympe.dc.da.$a.contains=olympe.dc.da.$a.contains;olympe.dc.da.$a.equals=olympe.dc.da.$a.qb;function ne(a,b){return new olympe.dc.gb(a.G,a.source,b,a.F,{max:a.max,offset:a.offset})}function oe(a){return a.C.filter(b=>b instanceof olympe.dc.da.Kb.jg||b instanceof olympe.dc.da.Kb.kg).length}function pe(a){const b=a.C.findIndex(c=>c instanceof olympe.dc.da.Kb.Rh);a=0===a.F.size?a.Xi():a;if(0<=b&&!a.F.has(b))throw Error('AndReturn was not called for the current level before sortBy operator');return a}
503
- function qe(a,b){const c=olympe.dc.Ed.SUBSCRIBE,d=olympe.dc.Ed.Mi,e=new olympe.dc.jf(a.G,b?c:d);for(const f of a.C)f instanceof olympe.dc.da.Kb.jg?e.sb(f.Qd()):f instanceof olympe.dc.da.Kb.kg?e.sb(f.Qd(),!0):f instanceof olympe.dc.da.Kb.rc&&(a=f.C,a instanceof olympe.dc.da.U.De&&(a=a.dd(),a.forEach(g=>e.sb(g)),re(e,a.length)));return e}function se(a){return new olympe.dc.gb(a.r,a.s,a.qp.map(b=>te(b)),new Set(a.lv),{max:a.lp.m,offset:a.lp.o})}
504
- olympe.dc.gb=class{constructor(a,b=olympe.dc.Ja.mc,c=[],d=new Set,e={max:-1,offset:0}){this.db=olympe.dc.Na();this.G=olympe.dc.xa(a);this.source=b;this.C=c;this.F=d;this.max=-1===e.max?-1:e.max;this.offset=e.offset;this.id=null}static from(a){return new olympe.dc.gb(a)}static Yk(a,b){return(new olympe.dc.gb(a,b)).sb(olympe.dc.CloudObject.instancesRel)}sb(a){const b=Array.from(this.C);b.push(new olympe.dc.da.Kb.jg(this.db,a));return ne(this,b)}bw(a,b=!1){const c=Array.from(this.C);c.push(new olympe.dc.da.Kb.kg(this.db,
505
- a,b));return ne(this,c)}Xi(){this.F.add(oe(this));return new olympe.dc.gb(this.G,this.source,this.C,this.F,{max:this.max,offset:this.offset})}filter(a){const b=Array.from(this.C);b.push(new olympe.dc.da.Kb.rc(a));return ne(this,b)}Zi(){return this}limit(a,b=0){return new olympe.dc.gb(this.G,this.source,this.C,this.F,{max:a,offset:b})}ll(a,b){const c=Array.from(this.C);c.push(new olympe.dc.da.Kb.Rh(this.db,a,b));return ne(this,c)}hb(a){return ue(olympe.dc.Lf(),pe(this),'function'===typeof a.Ec?a.Ec():
506
- a)}observe(a){return ve(olympe.dc.Lf(),pe(this),'function'===typeof a.Ec?a.Ec():a)}bd(){var a=pe(this);return olympe.dc.Lf().V.bd(a)}Y(){null===this.id&&(this.id=olympe.W.mb(this.G+this.C.reduce((a,b)=>a+b.toString(),'')+Array.from(this.F).toString()+this.offset+this.max));return this.id}ia(){return{r:this.G,qp:this.C.map(a=>a.ia()),lv:Array.from(this.F),s:this.source,lp:{m:this.max,o:this.offset}}}};olympe.dc.gb.prototype.executeFromCache=olympe.dc.gb.prototype.bd;
507
- olympe.dc.gb.prototype.observe=olympe.dc.gb.prototype.observe;olympe.dc.gb.prototype.execute=olympe.dc.gb.prototype.hb;olympe.dc.gb.prototype.sortBy=olympe.dc.gb.prototype.ll;olympe.dc.gb.prototype.limit=olympe.dc.gb.prototype.limit;olympe.dc.gb.prototype.cast=olympe.dc.gb.prototype.Zi;olympe.dc.gb.prototype.filter=olympe.dc.gb.prototype.filter;olympe.dc.gb.prototype.andReturn=olympe.dc.gb.prototype.Xi;olympe.dc.gb.prototype.followRecursively=olympe.dc.gb.prototype.bw;
508
- olympe.dc.gb.prototype.follow=olympe.dc.gb.prototype.sb;olympe.dc.gb.instancesOf=olympe.dc.gb.Yk;olympe.dc.gb.from=olympe.dc.gb.from;function te(a){const b=olympe.dc.Na();switch(a.t){case 1:return(a=me(a.p))?new olympe.dc.da.Kb.rc(a):null;case 2:return new olympe.dc.da.Kb.jg(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!1));case 3:var c=a.s;return new olympe.dc.da.Kb.kg(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!0),c);case 4:return c=a.o,new olympe.dc.da.Kb.Rh(b,new olympe.dc.ta.Property(a.p),c);default:return null}}olympe.dc.da.nk=class{ia(){}F(){}hb(){}observe(){}toString(){}};function we(a){return a.G.map(b=>a.F.get(a.C[b]))}function xe(a){return a.N.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function ye(a){a=Array.from(a.F.values()).flat();return new Set(a.map(b=>b.R()))}function ze(a){return new Set(a.N.flatMap(b=>b.split('.')))}
509
- function Ae(a,b){var c=olympe.dc.Na();if(c.Gb(a)){b.F(a,c.rd(a,!0),0);b.Ra(olympe.dc.ic.Tc,a,c.model(a),0);for(const [d,e,f]of Ad(c,a))(c=b.Jf(f))&&c.se()&&(e===olympe.dc.za.DESTINATION?b.Ra(d,a,f,0):b.Ra(d,f,a,0))}else olympe.pa.Xa('Query Result').error(`Fail to serialize instance with tag ${a} not present in local DBView`)}
510
- function Be(a,b,c=olympe.dc.Ja.Vc){b&&b((new olympe.dc.W.Li(c)).C(a.p||[]));const d=olympe.dc.Na();let e=!1;b=a.k.map(f=>{const g=f.split('.').map(h=>d.Gb(h)?olympe.dc.CloudObject.get(h):(olympe.pa.Xa('QueryResult').error(`CloudObject with tag ${h} not present but required for deserialization`),e=!0,null));return[f,1===g.length?g[0]:g]});return e?null:olympe.dc.Va.create(b,a.a,a.r)}
511
- olympe.dc.Va=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.N=[];this.hash=''}static empty(){return new olympe.dc.Va}[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()}ff(){return this.C.map(a=>this.F.get(a))}size(){return this.C.length}has(a){return this.F.has(a)||this.ff().includes(a)}indexOf(a){return null===
512
- a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.ff().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}Oc(){return this.re(0)}re(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){const b=this.ff();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.ff();a.pop();return a}shift(){if(0<this.C.length){const a=this.ff();a.shift();return a}return[]}filter(a){return this.ff().filter(a)}find(a){return(a=this.ff().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>
513
- a(this.F.get(b),c))}map(a){return this.ff().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Va.create(b,Array.from(this.G),Array.from(this.N))}reduce(a,b){return this.ff().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.N.concat(...a.map(d=>d.N));return olympe.dc.Va.create(b,c,a)}static from(a,b){const c=olympe.dc.Na();var d=Ce(b);if(b.Ld){const {kb:k,
514
- order:l,Ld:n,Gv:p}=b.Ld,q=Array.from(b.F).sort().indexOf(p),r=l===olympe.dc.da.km.ASC?1:-1;d.sort((t,u)=>{u=u[q];t=c.fb(t[q],k);u=c.fb(u,k);return null===t?-r:null===u?r:r*n(t,u)})}else d.sort((k,l)=>k.reduce((n,p,q)=>n||p.localeCompare(l[q]),0));0<b.offset&&(d=d.slice(b.offset));-1<b.max&&(d=d.slice(0,b.max));b=olympe.W.mb(d.flat().join(''));if(b===a.hash)return a;d=d.map(k=>[k.join('.'),1===k.length?olympe.dc.CloudObject.get(k[0]):k.map(l=>olympe.dc.CloudObject.get(l))]);const e=new Set(d.map(k=>
515
- k[0])),f=new Set(a.keys()),g=[],h=[];d.forEach(([k],l)=>{!f.has(k)&&g.push(l)});f.forEach(k=>{!e.has(k)&&h.push(k)});return olympe.dc.Va.create(d,g,h,b)}static create(a,b,c,d){const e=new olympe.dc.Va;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.W.mb(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.N=c||[];return e}ia(){const a=new olympe.dc.db.xc;var b=new Set(this.G.flatMap(c=>this.C[c].split('.')));for(const c of b)Ae(c,a);b=new olympe.dc.transaction.wd;a.Mc(b);return{k:this.C,p:$d(b),a:this.G,r:this.N}}};
460
+ olympe.dc.db.Ub.xo=class{constructor(a){this.L=a;this.output=''}process(a,b,c){this.output='Patch #'+b.Z()+' (source: '+a+')';b.Mc(this);this.L.info(this.output);this.output='';c(null,b)}log(a,b){this.output+='\ndb.'+a+';'+(b?' // '+b:'')}F(a,b){this.log('createInstance("'+a+'", '+Td(this,b)+')')}qc(a,b){this.log('updateInstance("'+a+'", '+Td(this,b)+')')}Jc(a,b){var c=olympe.dc.Na();const d=c.model(a);c=d?c.name(d)+' #'+d:'';this.log('deleteInstance("'+a+'", rule: '+b+')',c)}Ra(a,b,c){this.log('createRelation("'+
461
+ a+'", "'+b+'", "'+c+'")',a===olympe.dc.kc.Tc?'Model':'')}hc(a,b,c){this.log('deleteRelation("'+a+'", "'+b+'", "'+c+'")',a===olympe.dc.kc.Tc?'Model':'')}};olympe.dc.db.Ub.xo.la=[olympe.dc.Writable,olympe.dc.pg];olympe.dc.transaction={};olympe.dc.si=class a{constructor(b,c){this.id=b||olympe.W.nc();this.F=new olympe.D.Wb('BurstTransaction#'+this.id,c);this.fc=Ud(this);this.Y=!1;this.F.onDestroy(()=>this.U());this.Da=new Set;this.G=new Map;this.N=new Set;this.C=null;this.bb=olympe.T.getParameter(olympe.dc.transaction.Config.Tn)||30;this.ra=[]}static C(b,c){return`${b},${c}`}Xb(b){for(const c of this.ra)c(b);this.stop()}ab(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.ka(this.N);0<b.size&&Vd(this,b,!1);this.N.clear()}ka(b){const c=
462
+ 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}aa(b,c,d){this.Sa(b,c,d);this.fc(b,c,d);null===this.C&&(this.C=setTimeout(this.ab.bind(this),this.bb))}Sa(b,c,d){b=a.C(b,c);this.G.set(b,d);this.N.add(b)}Ab(b,c){return this.G.get(a.C(b,c))}push(b,c){const d=olympe.dc.xa(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.xa(f),this.Ab(d,e)!==g&&this.aa(d,e,g.valueOf())});this.Da.add(b)}complete(){return new Promise((b,
463
+ c)=>{this.U((d,e)=>{for(const f of this.Da)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.xa(b),f=olympe.dc.xa(c);void 0===e||void 0===f?olympe.dc.gi().Xa().error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.xn([d],g=>{this.Y=!0;g instanceof olympe.dc.Hc?olympe.dc.gi().Xa().error('Cannot send complex property values in burst transactions'):this.aa(e,f,g.valueOf())})}),this.F.vc(this.U.bind(this)))}stop(){this.F.destroy();this.ra.length=
464
+ 0}Z(){return this.id}sh(){return!1}U(b){if(this.Y){this.Y=!1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.N.clear();const c=this.ka(new Set(this.G.keys()));Vd(this,c,!0,b)}else b&&b(!0,null)}toString(){return'Burst transaction #'+this.id}};olympe.dc.si.prototype.complete=olympe.dc.si.prototype.complete;olympe.dc.si.prototype.push=olympe.dc.si.prototype.push;olympe.dc.bq=class{C(){}toString(){}};olympe.dc.transaction.ng=class{constructor(a){this.id=a||olympe.W.cj();this.ua=[];this.size=0}Z(){return this.id}G(){return this.size}concat(a){this.ua.push(...a.ua)}Mc(a){const b=olympe.dc.transaction.ng.C,c=this.ua.length;let d=0;for(;d<c;)switch(this.ua[d]){case b.eo:a.F(this.ua[d+1],this.ua[d+2],this.ua[d+3]);d+=4;break;case b.br:a.qc(this.ua[d+1],this.ua[d+2],this.ua[d+3],this.ua[d+4]);d+=5;break;case b.to:a.Jc(this.ua[d+1],this.ua[d+2],this.ua[d+3]);d+=4;break;case b.fo:a.Ra(this.ua[d+1],this.ua[d+
465
+ 2],this.ua[d+3],this.ua[d+4]);d+=5;break;case b.uo:a.hc(this.ua[d+1],this.ua[d+2],this.ua[d+3],this.ua[d+4]);d+=5;break;default:throw Error('Invalid Patch operations "'+this.ua[d]+'"');}}F(a,b,c){this.ua.push(olympe.dc.transaction.ng.C.eo,a,b,c);this.size++}qc(a,b,c,d){this.ua.push(olympe.dc.transaction.ng.C.br,a,b,c,d);this.size++}Jc(a,b=olympe.dc.Sb.NONE,c){this.ua.push(olympe.dc.transaction.ng.C.to,a,b,c);this.size++}Ra(a,b,c,d){if('string'!==typeof a)throw Error('Relation should be created using a tag as string (most likely a relation object is given here instead)');
466
+ this.ua.push(olympe.dc.transaction.ng.C.fo,a,b,c,d);this.size++}hc(a,b,c,d){this.ua.push(olympe.dc.transaction.ng.C.uo,a,b,c,d);this.size++}};olympe.dc.transaction.ng.C={eo:1,br:2,to:3,fo:4,uo:5};olympe.dc.transaction.ng.la=[olympe.dc.Writable,olympe.dc.jm];function Wd(a,b){return a.U.get(b)||a.db.source(b)||olympe.dc.Ha.bc}function Xd(a,b){return a.N.has(b)?a.N.get(b):a.db.Vf(b)}function Yd(a,b,c,d){var e=d&&d.get(olympe.dc.$b.VERSION);a.versions.set(b,Number(e)||1);d&&a.U.set(b,d.get(olympe.dc.$b.Jd));e=Wd(a,b);a.N.set(b,c&&a.F);a.Bc(e,c,f=>{f.F(b,d,0)})}
467
+ olympe.dc.transaction.tu=class{constructor(a,b){this.id=b||olympe.W.nc();this.db=a;this.C=new Map;this.G=new olympe.dc.db.xc(b);this.versions=new Map;this.U=new Map;this.Y={};this.N=new Map;this.F=!0}Rf(){return 0===this.G.C.size}persist(a){this.F=a}qc(a,b,c=!1){var d=b&&b.get(olympe.dc.$b.VERSION);this.versions.set(a,Number(d)||1);d=Wd(this,a);if(!d)throw Error('Attempt to update an instance which has an unknown source.');this.Bc(d,Xd(this,a),e=>{e.qc(a,b,c,0)})}Jc(a,b){const c=Wd(this,a),d=Xd(this,
468
+ a);this.Bc(c,d,e=>{e.Jc(a,b)})}Ra(a,b,c){const d=Wd(this,b),e=Wd(this,c);let f=Xd(this,b)&&Xd(this,c);f&&d!==e&&a!==olympe.dc.kc.Tc&&(olympe.pa.Xa('dc').warn(`Try to create a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);this.Bc(d,f,g=>{g.Ra(a,b,c,0)})}hc(a,b,c){const d=Wd(this,b),e=Wd(this,c);let f=Xd(this,b)&&Xd(this,c);f&&d!==e&&a!==olympe.dc.kc.Tc&&(olympe.pa.Xa('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),
469
+ f=!1);this.Bc(d,f,g=>{g.hc(a,b,c,0)})}Bc(a,b,c){c(this.G);b&&this.F&&(b=this.C.get(a),b||(b=new olympe.dc.db.xc(this.id),this.C.set(a,b)),c(b))}};function Zd(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.$b.Jd)if(e===olympe.dc.Ha.rb)d[g]=olympe.dc.Na().Z();else{if(e===olympe.dc.Ha.Vc)continue}else g.startsWith(olympe.dc.$b.VERSION)?(g=g.substr(1),e=null===e?1:e):g.startsWith(olympe.dc.Sg.bc)&&(g='fd'+g.substr(1));e=a.aa(e);c&&e instanceof Object&&8===e.c?a.Y.set(g,e):d[g]=e}return d}
470
+ function $d(a){if(0===a.Y.size)return null;const b=Object.create(null);a.Y.forEach((c,d)=>{b[d]=c});a.Y.clear();return b}
471
+ class ae{constructor(){this.Y=new Map}aa(a){return a instanceof olympe.D.Wa||a instanceof olympe.D.qa||a instanceof olympe.D.ea?a.valueOf():a instanceof Date||a instanceof olympe.D.jb?(a=a instanceof olympe.D.jb?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.Of().valueOf(),g:a.If().valueOf(),b:a.Df().valueOf(),a:a.Cf().valueOf()}:a&&'function'===
472
+ typeof a.R?{c:8,t:a.R()}:a}}function be(a){a.Fg=[];a.Te=[];a.Yf=[];a.Gg=[];a.wg=[]}function ce(a){const b={};0<a.wg.length&&(b.wg=a.wg);0<a.Te.length&&(b.Te=a.Te);0<a.Fg.length&&(b.Fg=a.Fg);0<a.Yf.length&&(b.Yf=a.Yf);0<a.Gg.length&&(b.Gg=a.Gg);be(a);return b}function de(a){const b=[...a.wg,...a.Te,...a.Fg,...a.Yf,...a.Gg];be(a);return b}
473
+ olympe.dc.transaction.wd=class{constructor(a=!1){this.Fg=[];this.Te=[];this.Yf=[];this.Gg=[];this.wg=[];this.G=a;this.C=olympe.D?new ae:new class extends ae{aa(b){return b&&'function'===typeof b.R?{c:8,t:b.R()}:b}}}flush(){return JSON.stringify(de(this))}F(a,b,c=-1){this.Fg.push({o:1,t:a,p:Zd(this.C,b||null,this.G),i:c});this.G&&(b=$d(this.C))&&this.Yf.push({o:2,t:a,p:b,i:c})}qc(a,b,c,d=-1){this.Yf.push({o:2,t:a,p:Zd(this.C,b||null,!1),i:d})}Jc(a,b,c=-1){this.Te.push({o:3,t:a,f:b,i:c})}Ra(a,b,c,d=
474
+ -1){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`);this.Gg.push({o:4,m:a,l:b,r:c,i:d})}hc(a,b,c,d=-1){if(!a)throw Error('Cannot delete relation of undefined type');if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');this.wg.push({o:5,m:a,
475
+ l:b,r:c,i:d})}};olympe.dc.transaction.wd.la=[olympe.dc.Writable];olympe.dc.transaction.Rh=class{constructor(a){this.id=a||olympe.W.nc();this.C=new Map;this.Ka=new Map}Z(){return this.id}F(a,b){this.C.has(a)&&console.warn('Try to add twice the same instance in the graph');const c=new olympe.dc.transaction.Rh.Instance(a);if(b)for(const [d,e]of b)c.Ca(d,e);this.C.set(a,c)}qc(){throw Error('UpdateInstance should never be called on a SubGraph since it represents the result of a GraphDef Query');}Jc(){throw Error('DeleteInstance should never be called on a SubGraph since it represents the result of a GraphDef Query');
476
+ }Ra(a,b,c){a=new olympe.dc.transaction.Rh.Relation(b,c,a);this.Ka.set(a.toString(),a)}hc(a,b,c){a=new olympe.dc.transaction.Rh.Relation(b,c,a);this.Ka.delete(a.F+'.'+a.G+'.'+a.C)}G(){return this.Ka.size+this.C.size}de(){return this.C}Mc(a){const b=new Map;this.C.forEach((c,d)=>{const e=new Map;ee(c,(f,g)=>{if(g instanceof olympe.dc.Hc){const h=b.get(d)||new Map;h.set(f,g);b.set(d,h)}else e.set(f,g)});a.F(d,e)});b.forEach((c,d)=>{a.qc(d,c)});this.Ka.forEach(c=>{a.Ra(c.C,c.F,c.G)})}};
477
+ function ee(a,b){a.C.forEach((c,d)=>{b(d,b)})}olympe.dc.transaction.Rh.Instance=class{constructor(a){this.tag=a;this.C=new Map}R(){return this.tag}Ca(a,b){this.C.set(a,b);return this}deleteProperty(a){this.C.delete(a);return this}};olympe.dc.transaction.Rh.Relation=class{constructor(a,b,c){this.F=a;this.G=b;this.C=olympe.dc.xa(c)}toString(){return this.F+'.'+this.G+'.'+this.C}};olympe.dc.transaction.Rh.la=[olympe.dc.Writable,olympe.dc.jm];function fe(a,b){b&&a.ua.push(b);return b}function ge(a){return(b,c)=>a.forEach(d=>d&&d(b,c))}
478
+ olympe.dc.Transaction=class{constructor(a){this.id=a||olympe.W.nc();this.ua=[];this.G=!0;this.F=[]}Z(){return this.id}persist(a){this.G=a;return this}C(a){a.persist(this.G);const b=this.ua;for(let c=0,d=b.length;c<d;c++)b[c].C(a)}create(a,b){return fe(this,new olympe.dc.transaction.ua.Wd(a,b))}sj(a,b=!0){const c=olympe.dc.xa(a);var d=this.ua.find(g=>g instanceof olympe.dc.transaction.ua.Wd&&g.R()===c);if(d)return d.persist(b);d=olympe.dc.Na();const e=d.model(a);if(null===e)throw Error('Try to persist a instance that does not exist: '+
479
+ a);if(d.Vf(a))return null;const f=d.source(a)||olympe.dc.Ha.bc;a=this.create(e,a).persist(b).li(f);for(const [g,h,k]of Ed(d,a))g!==olympe.dc.kc.Tc&&d.Vf(k)&&this.Ra(g,h===olympe.dc.za.DESTINATION?a:k,h===olympe.dc.za.DESTINATION?k:a);return a}delete(a,b=olympe.dc.Sb.Fc){fe(this,new olympe.dc.transaction.ua.Nj(a,b))}update(a,b,c){return fe(this,new olympe.dc.transaction.ua.Si(a,b,c))}Ra(a,b,c){fe(this,new olympe.dc.transaction.ua.mo(a,b,c))}hc(a,b,c,d){fe(this,new olympe.dc.transaction.ua.Xs(a,b,c,
480
+ d))}Qm(a,b,c,d){fe(this,new olympe.dc.transaction.ua.Ws(a,b,c,d))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,f);d.setProperty(olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Sg.bc+d.R(),e);this.Ra(olympe.dc.CloudObject.propertyRel,a,d);this.Ra(olympe.dm.Property.typeRel,d,b);this.Ra(olympe.dc.CloudObject.containsRel,a,d);return d}hh(a,b,c='',{Xi:d=olympe.dm.Relation.F.$l,rj:e=olympe.dm.Relation.N,Hr:f=olympe.dm.Relation.C.wq,Fr:g=olympe.dm.Relation.C.pl,
481
+ uj:h=olympe.dm.Relation.C.jp}={},k=olympe.W.nc()){k=this.create(olympe.dm.Relation,k);k.setProperty(olympe.dc.CloudObject.nameProp,c||'');k.setProperty(olympe.dm.Relation.Im,d);k.setProperty(olympe.dm.Relation.wn,e);k.setProperty(olympe.dm.Relation.Sm,f);k.setProperty(olympe.dm.Relation.Rm,g);k.setProperty(olympe.dm.Relation.dl,h);k.setProperty(olympe.dm.Relation.dl,h);this.Ra(olympe.dc.CloudObject.G,a,k);this.Ra(olympe.dm.Relation.destinationModelRel,k,b);this.Ra(olympe.dc.CloudObject.containsRel,
482
+ a,k);return k}sh(){return!1}Gm(a){this.F.push(olympe.D.Ja().Cb(a))}hb(a,b){a=ge([...this.F,a]);he(this,a,b)}Tm(a){a=ge([...this.F,a]);ie(olympe.dc.gi(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Transaction.la=[olympe.dc.bq];function Ud(a){var b=olympe.dc.gi();const c=a.Z();b.N.set(c,a);a.F.onDestroy(()=>{b.N.delete(c)});return(d,e,f)=>{const g=new olympe.dc.db.xc(c);e=(new Map).set(olympe.dc.$b.VERSION,b.db.version(d)+1).set(e,f);g.qc(d,e,!1,0);olympe.dc.Ad().$e(g,olympe.dc.Ha.rb)}}
483
+ function Vd(a,b,c,d){var e=olympe.dc.gi();const f=olympe.dc.$b.VERSION,g=olympe.dc.ga.ja.yh,h=olympe.dc.ga.ja.ql,k=a.Z(),l=a.sh(),n=new Map;for(const q of b.keys()){var p=e.db.source(q);if(p===olympe.dc.Ha.rb)continue;let r=n.get(p);r||(r=new olympe.dc.db.xc(k),n.set(p,r));p=b.get(q);p.set(f,e.db.version(q)+1);r.qc(q,p,!1,0)}for(const [q,r]of n)b=Bc(new olympe.dc.ga(c?h:g,{Bc:r,sh:l},[q]),a.F),c&&d&&M(b,t=>{t?d(!1,t.message):d(!0,null)}),e.G.send(b)}
484
+ function he(a,b,c){var d=olympe.dc.gi();if(c&&b){const e=a.Z();d.F.set(e,b);ie(d,a,(f,g)=>{f||(d.F.delete(e),b(f,g))},!1)}else ie(d,a,b,!1)}
485
+ function je(a){const b=olympe.dc.ga.ja.Qj;a.G.C(olympe.dc.ga.ja.Gj,(c,d)=>{c=d.id;var e=d.rollback;d=d.error;const f=a.N.get(c);void 0!==f&&(a.N.delete(c),f.Xb(d));olympe.dc.Ad().$e(e,olympe.dc.Ha.rb);a.L.warn(`Fast update (id=${c}) has been refused and is rolled back. Error: ${d}`)});a.G.C(b,(c,d)=>{c=d.finalize;var e=d.error;(d=(d=a.C.get(d.id))&&d.pop())&&d(c,e)})}
486
+ function ie(a,b,c,d=!1){const e=olympe.D.Ja(),f=c?e.Cb(c):void 0;c=olympe.dc.Ad();const g=b.Z(),h=new olympe.dc.transaction.tu(a.db,g);b.C(h);if(h.Rf())f&&f(!0,null);else{a.C.set(g,[]);const k=[],l=[];for(const p of h.versions.keys())Xd(h,p)?k.push(p):l.push(p);const n=Oc(c,e,h.G,k,l);ke(a,h,(p,q,r)=>{q?(le(a,g,k,h.C.size),me(a,h,d,b.sh(),(t,u)=>{!t&&a.C.has(g)&&(a.C.get(g).forEach(v=>v(olympe.dc.transaction.sg.C.ek,u)),ne(a,g));n(t);p&&p(t);f&&f(t,u)})):(a.L.error(r),n(!1),f&&f(!1,r))})}}
487
+ function ke(a,b,c){const d=[];for(const p of b.versions.keys())a.db.rh(p,olympe.dm.File)&&Xd(b,p)&&d.push(p);if(0===d.length)c(null,!0,null);else{var e=olympe.dm.File.urlProp.R(),f=olympe.dm.File.C.R(),g=olympe.dm.File.modificationDateProp.R(),h=Array.from(b.C.values()),k=[],l=new olympe.async.og(olympe.D.mh()),n=olympe.W.ci();d.forEach(p=>{l.add((q,r)=>{const t=a.db.fb(p,e,!0),u=a.db.fb(p,olympe.dm.File.mimeTypeProp)||'application/data';t.startsWith('blob:')?n.F(t,v=>{n.Y(t);null===v?q():xc(a.Y,
488
+ p,v,u,w=>{const y=h.reduce((B,E)=>B||E.Jf(p),null);null!==y&&(y.Ca(e,w).Ca(f,!0),k.push([p,w]));q()},w=>{r(w)})}):(2048<t.length&&a.L.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:',p),q())})});$b(l,(p,q)=>{let r=null;if(p){const t=new olympe.dc.db.xc;k.forEach(([u,v])=>{const w=new Map;w.set(e,v).set(f,!0).set(g,olympe.D.jb.now());t.qc(u,w,!0,0)});r=Oc(olympe.dc.Ad(),olympe.D.mh(),t,[],[])}c(r,p,q)});l.start()}}
489
+ function le(a,b,c,d){const e=olympe.D.mh(),f=new olympe.async.og(e);0<a.timeout&&Zb(f,a.timeout);const g=a.C.get(b);for(let h=0;h<d;h++)f.add((k,l,n)=>{g.push(e.Cb((p,q)=>{n.set('final',p);q?l(q):k()}))});$b(f,(h,k,l)=>{h||a.L.warn(`An error occurred while processing the notification of transaction (${b}): ${k}.`);l.get('final')!==olympe.dc.transaction.sg.C.Rp&&olympe.dc.Ad().persist(c);ne(a,b)});f.start()}
490
+ function me(a,b,c,d,e){b=b.C;if(0===b.size)e(!0,null);else{var f=c?olympe.dc.ga.ja.xk:olympe.dc.ga.ja.bh;c=(h,k,l,n)=>{h=M(new olympe.dc.ga(f,{Bc:h,sh:d},[k]),p=>{p instanceof Error?n(p.message):l()});a.G.send(h)};var g=new olympe.async.og(olympe.D.mh());for(const [h,k]of b)g.add(c.bind(null,k,h));$b(g,e);g.start()}}function ne(a,b){a.C.delete(b);if(0===a.C.size){for(var c of a.U)c();a.U=[]}a.F.has(b)&&(c=a.F.get(b),a.F.delete(b),c(!0,null))}
491
+ function oe(a,b){0<a.C.size?a.U.push(olympe.D.Ja().Cb(b)):b()}olympe.dc.transaction.sg=class{constructor(a,b,c,d,e){this.L=a;this.db=b;this.G=c;this.Y=d;this.timeout=e;this.N=new Map;this.C=new Map;this.U=[];this.F=new Map;je(this)}Xa(){return this.L}};olympe.dc.transaction.sg.C={ek:0,Qp:1,Rp:2};olympe.dc.transaction.O={Ea:'dc.transaction.Logger',va:'dc.transaction.Manager'};olympe.dc.transaction.Config={TIMEOUT:'dc.transaction.timeout',Tn:'dc.transaction.burstInterval'};
492
+ olympe.T.config(function(a){D(a,olympe.dc.transaction.Config.TIMEOUT,6E4);D(a,olympe.dc.transaction.Config.Tn,30);C(a,olympe.dc.transaction.O.Ea,[olympe.pa.O.va],b=>b.Nc('dc'));A(a,olympe.dc.transaction.O.va,olympe.dc.transaction.sg,olympe.dc.transaction.O.Ea,olympe.dc.O.vi,olympe.dc.O.me,olympe.dc.O.yi,new olympe.T.fa(olympe.dc.transaction.Config.TIMEOUT))},'olympe.dc.transaction');olympe.dc.transaction.ua={};function W(a){return olympe.dc.xa(a)}function pe(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Ya(e));return c}olympe.dc.transaction.ua.Ng=class{C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Ya(a){a=olympe.D.Ya(a);return void 0===a||null===a?null:olympe.D.Wr(a)?a.valueOf():a}};olympe.dc.transaction.ua.Ng.la=[olympe.dc.bq];olympe.dc.transaction.ua.Wd=class extends olympe.dc.transaction.ua.Ng{constructor(a,b){super();this.tag=void 0!==b?b:olympe.W.nc();this.model=a;this.F=new Map;this.G=!0;this.F.set(olympe.dc.$b.VERSION,1)}R(){return W(this.tag)}Rb(){return W(this.model)}persist(a){this.G=a;return this}li(a){this.F.set(olympe.dc.$b.Jd,a);return this}wx(){this.F.set(olympe.dc.$b.Jd,olympe.dc.Ha.rb)}setProperty(a,b){this.F.set(olympe.dc.xa(a),b);return this}el(a){this.setProperty(olympe.dc.CloudObject.nameProp.R(),a);
493
+ return this}C(a){const b=olympe.dc.Na(),c=this.Rb(),d=this.R();if(void 0===c)throw Error('OperationError: Cannot create instance, model tag is undefined');var e=olympe.dc.$b.Jd;if(!this.F.has(e)){var f=b.source(c);this.F.set(e,null!==f?f:olympe.dc.Ha.bc)}if(b.Gb(d)&&!b.Vf(d)&&this.G){e=new Map([...b.rd(d,!0),...pe(this,this.F)]);for(const g of e.values())g instanceof olympe.dc.Hc&&!Xd(a,g.R())&&(f=new olympe.dc.Transaction,f.sj(g.R()),f.C(a));Yd(a,d,this.G,e);a.Ra(olympe.dc.CloudObject.modelRel.R(),
494
+ d,c);for(const [g,h,k]of Ed(b,d))Xd(a,k)&&(h===olympe.dc.za.ORIGIN?a.Ra(g,k,d):a.Ra(g,d,k))}else b.Gb(d)||(Yd(a,d,this.G,pe(this,this.F)),a.Ra(olympe.dc.CloudObject.modelRel.R(),d,c))}toString(){return`CreateInstance(${this.Rb()}, ${this.R()})`}};olympe.dc.transaction.ua.Wd.prototype.setProperty=olympe.dc.transaction.ua.Wd.prototype.setProperty;olympe.dc.transaction.ua.Wd.prototype.localSource=olympe.dc.transaction.ua.Wd.prototype.wx;olympe.dc.transaction.ua.Wd.prototype.persist=olympe.dc.transaction.ua.Wd.prototype.persist;
495
+ olympe.dc.transaction.ua.Wd.prototype.getModelTag=olympe.dc.transaction.ua.Wd.prototype.Rb;olympe.dc.transaction.ua.Wd.prototype.getTag=olympe.dc.transaction.ua.Wd.prototype.R;olympe.dc.transaction.ua.Wd.la=[olympe.dc.ze];olympe.dc.transaction.ua.mo=class extends olympe.dc.transaction.ua.Ng{constructor(a,b,c){super();this.type=a.Oa?a:new olympe.dc.X.Qb(W(a));this.F=b;this.G=c}Oa(){return this.Ya(this.type).Oa()}C(a){const b=W(this.type);if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.kc.Tc)throw Error('OperationError: Cannot create the instance -> model relation');const c=W(this.F);if(''===c)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
496
+ const d=W(this.G);if(''===d)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.Oa()===olympe.dc.za.DESTINATION?a.Ra(b,c,d):a.Ra(b,d,c)}toString(){return`CreateRelation('${this.Oa()}${W(this.type)}, ${W(this.F)}, ${W(this.G)})`}};olympe.dc.transaction.ua.hz=class extends olympe.dc.transaction.ua.Ng{constructor(a,b=olympe.dc.Sb.Fc){super();this.model=a;this.F=b}Rb(){return W(this.model)}C(a){const b=this.Rb();if(void 0===b)throw Error('OperationError: Cannot delete instances of model, model is undefined');const c=olympe.dc.Na();for(const d of c.de(b))d!==b&&(new olympe.dc.transaction.ua.Nj(d,this.F)).C(a)}toString(){return`DeleteAllInstances(${this.Rb()}, ${this.F})`}};olympe.dc.transaction.ua.Ws=class extends olympe.dc.transaction.ua.Ng{constructor(a,b,c,d){super();this.F=a.Oa?a:new olympe.dc.X.Qb(W(a));this.G=b;this.N=c||!1;this.U=d instanceof Array?d.map(e=>W(e)):null}Oa(){return this.Ya(this.F).Oa()}C(a){const b=W(this.F);if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.kc.Tc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=W(this.G);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');
497
+ var d=olympe.dc.Na();const e=this.Oa(),f=this.U;d=d.ub(c,this.F);for(const g of d)e===olympe.dc.za.DESTINATION?a.hc(b,c,g):a.hc(b,g,c),null!==f&&0<=f.indexOf(g)||this.N&&(new olympe.dc.transaction.ua.Nj(g,olympe.dc.Sb.Fc)).C(a)}toString(){return`DeleteAllRelations(${this.Oa()}${W(this.F)}, ${W(this.G)}, ${this.N})`}};olympe.dc.transaction.ua.Nj=class extends olympe.dc.transaction.ua.Ng{constructor(a,b=olympe.dc.Sb.Fc){super();this.tag=a;this.F=b}R(){return W(this.tag)}C(a){const b=olympe.dc.Na(),c=this.R();if(void 0===c)throw Error('OperationError: Cannot delete instance, tag is undefined');const d=b.model(c);0<=b.version(c)&&d&&a.Jc(c,this.F)}toString(){return'DeleteInstance('+this.R()+', '+this.F+')'}};olympe.dc.transaction.ua.Xs=class extends olympe.dc.transaction.ua.mo{constructor(a,b,c,d=!1){super(a,b,c);this.N=d}C(a){const b=W(this.type);if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.kc.Tc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=W(this.F);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=W(this.G);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
498
+ this.Oa()===olympe.dc.za.DESTINATION?a.hc(b,c,d):a.hc(b,d,c);this.N&&(new olympe.dc.transaction.ua.Nj(d,olympe.dc.Sb.Fc)).C(a)}toString(){return'DeleteRelation('+this.Oa()+W(this.type)+', '+W(this.F)+', '+W(this.G)+', '+this.N+')'}};olympe.dc.transaction.ua.Si=class extends olympe.dc.transaction.ua.Ng{constructor(a,b,c){super();this.tag=a;this.F=new Map;this.F.set(olympe.dc.$b.VERSION,-1);void 0!==b&&this.setProperty(b,c)}R(){return W(this.tag)}setProperty(a,b){this.F.set(W(a),b);return this}C(a){const b=this.R();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');const c=olympe.dc.Na();var d=c.version(b),e=a.versions.get(b);e=void 0!==e?e:d;if(null===e)throw Error('OperationError: Instance #'+
499
+ b+' not found so it cannot be updated');d=pe(this,this.F);0>=d.get(olympe.dc.$b.VERSION)&&d.set(olympe.dc.$b.VERSION,e+1);for(const [f,g]of d)e=c.fb(b,f),e instanceof olympe.dc.Hc&&(e=e.R(),a.Y[e]=!0),g instanceof olympe.dc.Hc&&!Xd(a,g.R())&&(e=new olympe.dc.Transaction,e.sj(g.R()),e.C(a));a.qc(b,d)}toString(){return'UpdateInstance('+this.R()+', '+pe(this,this.F)+')'}};olympe.dc.transaction.ua.Si.prototype.setProperty=olympe.dc.transaction.ua.Si.prototype.setProperty;
500
+ olympe.dc.transaction.ua.Si.prototype.getTag=olympe.dc.transaction.ua.Si.prototype.R;olympe.dc.da={};olympe.dc.ze=class{R(){}};olympe.dc.ze.prototype.getTag=olympe.dc.ze.prototype.R;olympe.dc.Wz=olympe.dc.ze;olympe.dc.da.fm={ASC:'ASC',DESC:'DESC'};function qe(a){switch(a.pr){case 1:const c=a.v;switch(a.t){case 1:var b=c;break;case 2:b=new Date(c);break;case 3:b=olympe.dc.CloudObject.get(c);break;case 4:b=new olympe.D.Color(c.r,c.g,c.b,c.a)}return new olympe.dc.da.V.Gc(a.p,b,olympe.dc.Na());case 2:return new olympe.dc.da.V.Sc(a.p,a.s,olympe.dc.Na(),a.c);case 3:return new olympe.dc.da.V.Eh(a.p,a.b,a.l,a.s);case 4:return new olympe.dc.da.V.kd(qe(a.v));case 5:return new olympe.dc.da.V.xd(a.p,new RegExp(a.r),olympe.dc.Na(),a.c);case 6:b=new olympe.dc.da.V.De(a.d);
501
+ for(const [d,e,f]of a.r)a=new olympe.dc.query.Relation(d,e,f),f?b.Lk(a):b.sb(a);return b;case 7:return new olympe.dc.da.V.ae(...a.p.map(d=>qe(d)));case 8:return new olympe.dc.da.V.Ud(...a.p.map(d=>qe(d)));default:return null}}
502
+ olympe.dc.da.$a=class{observe(){}hb(){}clear(){}ia(){}toString(){}static qb(a,b){return new olympe.dc.da.V.Gc(a,b,olympe.dc.Na())}static contains(a,b,c=!1){return new olympe.dc.da.V.Sc(a,b,olympe.dc.Na(),c)}static cs(a,b,c=!0){return new olympe.dc.da.V.xd(a,b,olympe.dc.Na(),c)}static Sk(a,b,c=!0){return new olympe.dc.da.V.Eh(a,b,!1,c)}static xj(a,b,c=!0){return new olympe.dc.da.V.Eh(a,b,!0,c)}static and(...a){return new olympe.dc.da.V.Ud(...a)}static or(...a){return new olympe.dc.da.V.ae(...a)}static not(a){return new olympe.dc.da.V.kd(a)}};
503
+ olympe.dc.da.$a.not=olympe.dc.da.$a.not;olympe.dc.da.$a.or=olympe.dc.da.$a.or;olympe.dc.da.$a.and=olympe.dc.da.$a.and;olympe.dc.da.$a.smallerThan=olympe.dc.da.$a.xj;olympe.dc.da.$a.greaterThan=olympe.dc.da.$a.Sk;olympe.dc.da.$a.regex=olympe.dc.da.$a.cs;olympe.dc.da.$a.contains=olympe.dc.da.$a.contains;olympe.dc.da.$a.equals=olympe.dc.da.$a.qb;function re(a,b){return new olympe.dc.gb(a.G,a.source,b,a.F,{max:a.max,offset:a.offset})}function se(a){return a.C.filter(b=>b instanceof olympe.dc.da.Kb.hg||b instanceof olympe.dc.da.Kb.ig).length}function te(a){const b=a.C.findIndex(c=>c instanceof olympe.dc.da.Kb.Qh);a=0===a.F.size?a.Wi():a;if(0<=b&&!a.F.has(b))throw Error('AndReturn was not called for the current level before sortBy operator');return a}
504
+ function ue(a,b){const c=olympe.dc.Ed.SUBSCRIBE,d=olympe.dc.Ed.Li,e=new olympe.dc.gf(a.G,b?c:d);for(const f of a.C)f instanceof olympe.dc.da.Kb.hg?e.sb(f.Qd()):f instanceof olympe.dc.da.Kb.ig?e.sb(f.Qd(),!0):f instanceof olympe.dc.da.Kb.rc&&(a=f.C,a instanceof olympe.dc.da.V.De&&(a=a.dd(),a.forEach(g=>e.sb(g)),ve(e,a.length)));return e}function we(a){return new olympe.dc.gb(a.r,a.s,a.qp.map(b=>xe(b)),new Set(a.lv),{max:a.lp.m,offset:a.lp.o})}
505
+ olympe.dc.gb=class{constructor(a,b=null,c=[],d=new Set,e={max:-1,offset:0}){this.db=olympe.dc.Na();this.G=olympe.dc.xa(a);this.source=b;this.C=c;this.F=d;this.max=-1===e.max?-1:e.max;this.offset=e.offset;this.id=null}static from(a,b){return new olympe.dc.gb(a,b)}static Uk(a,b=olympe.dc.Ha.bc){return(new olympe.dc.gb(a,b)).sb(olympe.dc.CloudObject.instancesRel)}sb(a){const b=Array.from(this.C);b.push(new olympe.dc.da.Kb.hg(this.db,a));return re(this,b)}Zv(a,b=!1){const c=Array.from(this.C);c.push(new olympe.dc.da.Kb.ig(this.db,
506
+ a,b));return re(this,c)}Wi(){this.F.add(se(this));return new olympe.dc.gb(this.G,this.source,this.C,this.F,{max:this.max,offset:this.offset})}filter(a){const b=Array.from(this.C);b.push(new olympe.dc.da.Kb.rc(a));return re(this,b)}Yi(){return this}limit(a,b=0){return new olympe.dc.gb(this.G,this.source,this.C,this.F,{max:a,offset:b})}hl(a,b){const c=Array.from(this.C);c.push(new olympe.dc.da.Kb.Qh(this.db,a,b));return re(this,c)}hb(a){return ye(olympe.dc.Lf(),te(this),'function'===typeof a.Ec?a.Ec():
507
+ a)}observe(a){return ze(olympe.dc.Lf(),te(this),'function'===typeof a.Ec?a.Ec():a)}bd(){var a=te(this);return olympe.dc.Lf().U.bd(a)}Z(){null===this.id&&(this.id=olympe.W.mb(this.G+this.C.reduce((a,b)=>a+b.toString(),'')+Array.from(this.F).toString()+this.offset+this.max));return this.id}ia(){return{r:this.G,qp:this.C.map(a=>a.ia()),lv:Array.from(this.F),s:this.source,lp:{m:this.max,o:this.offset}}}};olympe.dc.gb.prototype.executeFromCache=olympe.dc.gb.prototype.bd;
508
+ olympe.dc.gb.prototype.observe=olympe.dc.gb.prototype.observe;olympe.dc.gb.prototype.execute=olympe.dc.gb.prototype.hb;olympe.dc.gb.prototype.sortBy=olympe.dc.gb.prototype.hl;olympe.dc.gb.prototype.limit=olympe.dc.gb.prototype.limit;olympe.dc.gb.prototype.cast=olympe.dc.gb.prototype.Yi;olympe.dc.gb.prototype.filter=olympe.dc.gb.prototype.filter;olympe.dc.gb.prototype.andReturn=olympe.dc.gb.prototype.Wi;olympe.dc.gb.prototype.followRecursively=olympe.dc.gb.prototype.Zv;
509
+ olympe.dc.gb.prototype.follow=olympe.dc.gb.prototype.sb;olympe.dc.gb.instancesOf=olympe.dc.gb.Uk;olympe.dc.gb.from=olympe.dc.gb.from;function xe(a){const b=olympe.dc.Na();switch(a.t){case 1:return(a=qe(a.p))?new olympe.dc.da.Kb.rc(a):null;case 2:return new olympe.dc.da.Kb.hg(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!1));case 3:var c=a.s;return new olympe.dc.da.Kb.ig(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!0),c);case 4:return c=a.o,new olympe.dc.da.Kb.Qh(b,new olympe.dc.ta.Property(a.p),c);default:return null}}olympe.dc.da.jk=class{ia(){}F(){}hb(){}observe(){}toString(){}};function Ae(a){return a.G.map(b=>a.F.get(a.C[b]))}function Be(a){return a.N.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function Ce(a){a=Array.from(a.F.values()).flat();return new Set(a.map(b=>b.R()))}function De(a){return new Set(a.N.flatMap(b=>b.split('.')))}
510
+ function Ee(a,b){var c=olympe.dc.Na();if(c.Gb(a)){b.F(a,c.rd(a,!0),0);b.Ra(olympe.dc.kc.Tc,a,c.model(a),0);for(const [d,e,f]of Ed(c,a))(c=b.Jf(f))&&c.se()&&(e===olympe.dc.za.DESTINATION?b.Ra(d,a,f,0):b.Ra(d,f,a,0))}else olympe.pa.Xa('Query Result').error(`Fail to serialize instance with tag ${a} not present in local DBView`)}
511
+ function Fe(a,b,c=olympe.dc.Ha.Vc){b&&b((new olympe.dc.W.Ki(c)).C(a.p||[]));const d=olympe.dc.Na();let e=!1;b=a.k.map(f=>{const g=f.split('.').map(h=>d.Gb(h)?olympe.dc.CloudObject.get(h):(olympe.pa.Xa('QueryResult').error(`CloudObject with tag ${h} not present but required for deserialization`),e=!0,null));return[f,1===g.length?g[0]:g]});return e?null:olympe.dc.Va.create(b,a.a,a.r)}
512
+ olympe.dc.Va=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.N=[];this.hash=''}static empty(){return new olympe.dc.Va}[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()}df(){return this.C.map(a=>this.F.get(a))}size(){return this.C.length}has(a){return this.F.has(a)||this.df().includes(a)}indexOf(a){return null===
513
+ a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.df().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}Oc(){return this.re(0)}re(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){const b=this.df();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.df();a.pop();return a}shift(){if(0<this.C.length){const a=this.df();a.shift();return a}return[]}filter(a){return this.df().filter(a)}find(a){return(a=this.df().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>
514
+ a(this.F.get(b),c))}map(a){return this.df().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Va.create(b,Array.from(this.G),Array.from(this.N))}reduce(a,b){return this.df().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.N.concat(...a.map(d=>d.N));return olympe.dc.Va.create(b,c,a)}static from(a,b){const c=olympe.dc.Na();var d=Ge(b);if(b.Md){const {kb:k,
515
+ order:l,Md:n,Dv:p}=b.Md,q=Array.from(b.F).sort().indexOf(p),r=l===olympe.dc.da.fm.ASC?1:-1;d.sort((t,u)=>{u=u[q];t=c.fb(t[q],k);u=c.fb(u,k);return null===t?-r:null===u?r:r*n(t,u)})}else d.sort((k,l)=>k.reduce((n,p,q)=>n||p.localeCompare(l[q]),0));0<b.offset&&(d=d.slice(b.offset));-1<b.max&&(d=d.slice(0,b.max));b=olympe.W.mb(d.flat().join(''));if(b===a.hash)return a;d=d.map(k=>[k.join('.'),1===k.length?olympe.dc.CloudObject.get(k[0]):k.map(l=>olympe.dc.CloudObject.get(l))]);const e=new Set(d.map(k=>
516
+ k[0])),f=new Set(a.keys()),g=[],h=[];d.forEach(([k],l)=>{!f.has(k)&&g.push(l)});f.forEach(k=>{!e.has(k)&&h.push(k)});return olympe.dc.Va.create(d,g,h,b)}static create(a,b,c,d){const e=new olympe.dc.Va;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.W.mb(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.N=c||[];return e}ia(){const a=new olympe.dc.db.xc;var b=new Set(this.G.flatMap(c=>this.C[c].split('.')));for(const c of b)Ee(c,a);b=new olympe.dc.transaction.wd;a.Mc(b);return{k:this.C,p:de(b),a:this.G,r:this.N}}};
516
517
  olympe.dc.Va.prototype.concat=olympe.dc.Va.prototype.concat;olympe.dc.Va.prototype.reduce=olympe.dc.Va.prototype.reduce;olympe.dc.Va.prototype.sort=olympe.dc.Va.prototype.sort;olympe.dc.Va.prototype.map=olympe.dc.Va.prototype.map;olympe.dc.Va.prototype.forEach=olympe.dc.Va.prototype.forEach;olympe.dc.Va.prototype.find=olympe.dc.Va.prototype.find;olympe.dc.Va.prototype.filter=olympe.dc.Va.prototype.filter;olympe.dc.Va.prototype.shift=olympe.dc.Va.prototype.shift;olympe.dc.Va.prototype.pop=olympe.dc.Va.prototype.pop;
517
- olympe.dc.Va.prototype.push=olympe.dc.Va.prototype.push;olympe.dc.Va.prototype.getAt=olympe.dc.Va.prototype.re;olympe.dc.Va.prototype.getFirst=olympe.dc.Va.prototype.Oc;olympe.dc.Va.prototype.get=olympe.dc.Va.prototype.get;olympe.dc.Va.prototype.indexOf=olympe.dc.Va.prototype.indexOf;olympe.dc.Va.prototype.has=olympe.dc.Va.prototype.has;olympe.dc.Va.prototype.size=olympe.dc.Va.prototype.size;olympe.dc.Va.prototype.toArray=olympe.dc.Va.prototype.ff;olympe.dc.Va.prototype.keys=olympe.dc.Va.prototype.keys;
518
- olympe.dc.Va.prototype.values=olympe.dc.Va.prototype.values;olympe.dc.Va.prototype.entries=olympe.dc.Va.prototype.entries;olympe.dc.Va.empty=olympe.dc.Va.empty;function Ce(a){var b=new Set(X(a,a.Cg()-1).keys());a.C.push((new Map).set('sink',b));b=[];for(const c of De(a,'sink',a.Cg()-1,''))b.push(c.slice(0,-1).split(';'));a.C.pop();return b}function Ee(a,b,c,d,e){a.Ld={Ld:b,Gv:c,order:d,kb:e}}function Fe(a,b){a.G=b}function Ge(a){a.G?a.N||(a.N=!0,a.G()):olympe.pa.Xa('dc').error('Trying to notify update for partial result but callback has not been previously set')}function X(a,b){return b>=a.Cg()?new Map:a.C[b]}
519
- function De(a,b,c,d){if(0===c)return a.F.has(c)?(b=Array.from(X(a,0).keys())[0],(new Set).add(`${b};${d}`)):(new Set).add(d);const e=He(a,b,c),f=a.F.has(c)?`${b};${d}`:d;return e.reduce((g,h)=>{for(const k of De(a,h,c-1,f))g.add(k);return g},new Set)}function He(a,b,c){return 0===c?null:(a=X(a,c))&&a.has(b)?Array.from(a.get(b)):null}function Ie(a,b,c,d){X(a,c+1).forEach((e,f)=>{e.has(d)&&a.remove(f,c+1,b)});X(a,c).delete(d);Ge(a)}
520
- olympe.dc.da.rq=class{constructor(a){this.C=Array.from({length:oe(a)+1},()=>new Map);this.F=new Set(Array.from(a.F));this.Ld=null;this.N=!1;this.G=null;this.max=a.max;this.offset=a.offset}Cg(){return this.C.length}insert(a,b,c){var d=X(this,b);if(0<b&&(null===c||!X(this,b-1).has(c)))return olympe.pa.Xa('dc').error('Try to insert result entry linked to a non existing parent'),null;if(d.has(a)&&null!==c)return a=d.get(a),d=a.size,a.add(c),a.size>d&&Ge(this),!1;if(b>=this.Cg())return olympe.pa.Xa('dc').error('Try to insert result entry to a higher level than possible'),
521
- null;b=new Set;null!==c&&b.add(c);d.set(a,b);Ge(this);return!0}remove(a,b,c){var d=X(this,b);if(!d.has(a))return!0;if(0<b&&(null===c||!X(this,b-1).has(c)))return olympe.pa.Xa('dc').error('Try to remove result entry linked to a non existing parent'),null;d=d.get(a);c&&d.delete(c);if(1>d.size)return Ge(this),Ie(this,a,b,a),!0;Ge(this);return!1}};olympe.dc.ld=class{constructor(a){this.query=a}static from(a){return new olympe.dc.ld(olympe.dc.gb.from(a))}sb(a){return new olympe.dc.ld(this.query.sb(a))}Zi(){return this}hb(a){return this.query.hb(a).then(b=>{const c=b.size();return 1<c?(olympe.pa.Xa('dc').warn('a follow() on a QuerySingle has '+c+' results (0 or 1 expected) -> returns null'),null):b.Oc()||null})}bd(){const a=this.query.bd(),b=a.size();return 1<b?(olympe.pa.Xa('dc').warn('a follow() on a QuerySingle has '+b+' results (0 or 1 expected) -> returns null'),
522
- null):a.Oc()||null}};olympe.dc.ld.prototype.executeFromCache=olympe.dc.ld.prototype.bd;olympe.dc.ld.prototype.execute=olympe.dc.ld.prototype.hb;olympe.dc.ld.prototype.cast=olympe.dc.ld.prototype.Zi;olympe.dc.ld.prototype.follow=olympe.dc.ld.prototype.sb;olympe.dc.da.U={};olympe.dc.da.U.Vd=class{constructor(...a){this.U=a}hb(a){return this.U.reduce((b,c)=>b&&c.hb(a),!0)}observe(a,b,c){const d=this.U.map(()=>!1),e=this.U.map(()=>null),f=(g,h)=>{d[h]=g;g=d.every(k=>k);e[h]!==g&&(e[h]=g,c(g))};this.U.forEach((g,h)=>{g.observe(a,olympe.W.mb('AND-'+b+a+h),k=>f(k,h))})}ia(){return{pr:8,p:this.U.map(a=>a.ia())}}toString(){return'And-'+this.U.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.U.forEach((c,d)=>{c.clear(a,olympe.W.mb('AND-'+b+a+d))})}};
523
- olympe.dc.da.U.Vd.C=8;olympe.dc.da.U.Vd.la=[olympe.dc.da.$a];olympe.dc.da.U.Sc=class{constructor(a,b,c,d=!1){this.kb=olympe.dc.xa(a);this.substring=b;this.db=c;this.C=d}fb(){return this.kb}hb(a){return this.apply(this.db.fb(a,this.kb))}observe(a,b,c){xd(this.db,a,this.kb,d=>{c(this.apply(d))},olympe.W.mb(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.kb+'-'+this.substring+'-'+this.C}clear(a,b){this.db.F(a,this.kb,olympe.W.mb(b+
524
- a+this.toString()))}ia(){return{pr:2,p:this.kb,s:this.substring,c:this.C}}};olympe.dc.da.U.Sc.C=2;olympe.dc.da.U.Sc.la=[olympe.dc.da.$a];olympe.dc.da.U.Gc=class{constructor(a,b,c){this.kb=olympe.dc.xa(a);this.C=b;this.db=c}hb(a){return this.apply(this.db.fb(a,this.kb))}observe(a,b,c){xd(this.db,a,this.kb,d=>{c(this.apply(d))},olympe.W.mb(b+a+this.toString()))}clear(a,b){this.db.F(a,this.kb,olympe.W.mb(b+a+this.toString()))}apply(a){return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.qb(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.qb(this.C):!1:a===
525
- this.C}toString(){return'Equals-'+this.kb+'-'+this.C.toString()}fb(){return this.kb}ia(){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.R();break;case this.C instanceof olympe.D.Color:a=4,b={r:this.C.Of().valueOf(),g:this.C.If().valueOf(),b:this.C.Df().valueOf(),a:this.C.Cf().valueOf()}}return{pr:1,p:this.kb,t:a,v:b}}};olympe.dc.da.U.Gc.C=1;olympe.dc.da.U.Gc.la=[olympe.dc.da.$a];function Je(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 Ke(a,b){return'number'===typeof a.C?a.C:a.db.fb(b,a.C)}function Le(a,b,c){return olympe.W.mb(c+b+a.C+a.kb)}
526
- olympe.dc.da.U.Gh=class{constructor(a,b,c=!0,d=!0){this.db=olympe.dc.Na();this.kb=olympe.dc.xa(a);this.C='number'===typeof b?b:olympe.dc.xa(b);this.F=c;this.G=d}fb(){return this.kb}hb(a){return Je(this,this.db.fb(a,this.kb),Ke(this,a))}observe(a,b,c){'string'===typeof this.C&&xd(this.db,a,this.C,d=>{const e=this.db.fb(a,this.kb);null!==e&&c(Je(this,e,d))},Le(this,a,b));xd(this.db,a,this.kb,d=>{const e=Ke(this,a);c(null!==e?Je(this,d,e):!0)},Le(this,a,b))}clear(a,b){this.db.F(a,this.kb,Le(this,a,b));
527
- 'string'===typeof this.C&&this.db.F(a,this.C,Le(this,a,b))}ia(){return{pr:3,p:this.kb,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.kb+'-'+this.G+'-'+this.C}};olympe.dc.da.U.Gh.C=3;olympe.dc.da.U.Gh.la=[olympe.dc.da.$a];olympe.dc.da.U.kd=class{constructor(a){this.C=a}hb(a){return!this.C.hb(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.W.mb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}ia(){return{pr:4,v:this.C.ia()}}toString(){return`NOT-${this.C.toString()}`}clear(a,b){this.C.clear(a,olympe.W.mb('NOT'+b+a))}};olympe.dc.da.U.kd.C=4;olympe.dc.da.U.kd.la=[olympe.dc.da.$a];olympe.dc.da.U.be=class{constructor(...a){this.U=a}hb(a){return this.U.reduce((b,c)=>b||c.hb(a),!1)}observe(a,b,c){const d=this.U.map(()=>!1),e=this.U.map(()=>null),f=(g,h)=>{d[h]=g;g=d.some(k=>k);e[h]!==g&&(e[h]=g,c(g))};this.U.forEach((g,h)=>{g.observe(a,olympe.W.mb('OR-'+b+a+h),k=>f(k,h))})}ia(){return{pr:7,p:this.U.map(a=>a.ia())}}toString(){return'And-'+this.U.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.U.forEach((c,d)=>{c.clear(a,olympe.W.mb('OR-'+b+a+d))})}};
528
- olympe.dc.da.U.be.C=7;olympe.dc.da.U.be.la=[olympe.dc.da.$a];olympe.dc.da.U.xd=class{constructor(a,b,c,d=!0){this.kb=olympe.dc.xa(a);this.C=RegExp('');try{this.C=new RegExp(b)}catch(e){if(!(e instanceof SyntaxError))throw e;}this.db=c;this.F=d}fb(){return this.kb}hb(a){return this.apply(this.db.fb(a,this.kb))}observe(a,b,c){xd(this.db,a,this.kb,d=>{c(this.apply(d))},olympe.W.mb(b+a+this.toString()))}apply(a){return'string'===typeof a?this.F?this.C.test(a):this.C.test(a.toLowerCase()):!1}toString(){return'Regex'+this.kb+'-'+this.C.toString()+'-'+this.F}ia(){return{pr:5,
529
- p:this.kb,r:this.C.source,c:this.F}}clear(a,b){this.db.F(a,this.kb,olympe.W.mb(b+a+this.toString()))}};olympe.dc.da.U.xd.C=5;olympe.dc.da.U.xd.la=[olympe.dc.da.$a];olympe.dc.da.U.De=class{constructor(a){this.db=olympe.dc.Na();this.Ka=[];this.recursive=[];this.destination=a?olympe.dc.xa(a):null}dd(){return Array.from(this.Ka)}clear(a,b){0<this.Ka.length&&this.db.C(a,this.Ka[0],olympe.W.mb(b+0+a))}sb(a){this.Ka.push(a);this.recursive.push(!1);return this}Pk(a){this.Ka.push(a);this.recursive.push(!0);return this}hb(a){if(1>this.Ka.length)return olympe.pa.Xa('dc').error('RelatedTo executed with less than 1 relation'),!1;let b=[];const c=this.destination||'',d=(e,
518
+ olympe.dc.Va.prototype.push=olympe.dc.Va.prototype.push;olympe.dc.Va.prototype.getAt=olympe.dc.Va.prototype.re;olympe.dc.Va.prototype.getFirst=olympe.dc.Va.prototype.Oc;olympe.dc.Va.prototype.get=olympe.dc.Va.prototype.get;olympe.dc.Va.prototype.indexOf=olympe.dc.Va.prototype.indexOf;olympe.dc.Va.prototype.has=olympe.dc.Va.prototype.has;olympe.dc.Va.prototype.size=olympe.dc.Va.prototype.size;olympe.dc.Va.prototype.toArray=olympe.dc.Va.prototype.df;olympe.dc.Va.prototype.keys=olympe.dc.Va.prototype.keys;
519
+ olympe.dc.Va.prototype.values=olympe.dc.Va.prototype.values;olympe.dc.Va.prototype.entries=olympe.dc.Va.prototype.entries;olympe.dc.Va.empty=olympe.dc.Va.empty;function Ge(a){var b=new Set(X(a,a.Ag()-1).keys());a.C.push((new Map).set('sink',b));b=[];for(const c of He(a,'sink',a.Ag()-1,''))b.push(c.slice(0,-1).split(';'));a.C.pop();return b}function Ie(a,b,c,d,e){a.Md={Md:b,Dv:c,order:d,kb:e}}function Je(a,b){a.G=b}function Ke(a){a.G?a.N||(a.N=!0,a.G()):olympe.pa.Xa('dc').error('Trying to notify update for partial result but callback has not been previously set')}function X(a,b){return b>=a.Ag()?new Map:a.C[b]}
520
+ function He(a,b,c,d){if(0===c)return a.F.has(c)?(b=Array.from(X(a,0).keys())[0],(new Set).add(`${b};${d}`)):(new Set).add(d);const e=Le(a,b,c),f=a.F.has(c)?`${b};${d}`:d;return e.reduce((g,h)=>{for(const k of He(a,h,c-1,f))g.add(k);return g},new Set)}function Le(a,b,c){return 0===c?null:(a=X(a,c))&&a.has(b)?Array.from(a.get(b)):null}function Me(a,b,c,d){X(a,c+1).forEach((e,f)=>{e.has(d)&&a.remove(f,c+1,b)});X(a,c).delete(d);Ke(a)}
521
+ olympe.dc.da.lq=class{constructor(a){this.C=Array.from({length:se(a)+1},()=>new Map);this.F=new Set(Array.from(a.F));this.Md=null;this.N=!1;this.G=null;this.max=a.max;this.offset=a.offset}Ag(){return this.C.length}insert(a,b,c){var d=X(this,b);if(0<b&&(null===c||!X(this,b-1).has(c)))return olympe.pa.Xa('dc').error('Try to insert result entry linked to a non existing parent'),null;if(d.has(a)&&null!==c)return a=d.get(a),d=a.size,a.add(c),a.size>d&&Ke(this),!1;if(b>=this.Ag())return olympe.pa.Xa('dc').error('Try to insert result entry to a higher level than possible'),
522
+ null;b=new Set;null!==c&&b.add(c);d.set(a,b);Ke(this);return!0}remove(a,b,c){var d=X(this,b);if(!d.has(a))return!0;if(0<b&&(null===c||!X(this,b-1).has(c)))return olympe.pa.Xa('dc').error('Try to remove result entry linked to a non existing parent'),null;d=d.get(a);c&&d.delete(c);if(1>d.size)return Ke(this),Me(this,a,b,a),!0;Ke(this);return!1}};olympe.dc.ld=class{constructor(a){this.query=a}static from(a){return new olympe.dc.ld(olympe.dc.gb.from(a))}sb(a){return new olympe.dc.ld(this.query.sb(a))}Yi(){return this}hb(a){return this.query.hb(a).then(b=>{const c=b.size();return 1<c?(olympe.pa.Xa('dc').warn('a follow() on a QuerySingle has '+c+' results (0 or 1 expected) -> returns null'),null):b.Oc()||null})}bd(){const a=this.query.bd(),b=a.size();return 1<b?(olympe.pa.Xa('dc').warn('a follow() on a QuerySingle has '+b+' results (0 or 1 expected) -> returns null'),
523
+ null):a.Oc()||null}};olympe.dc.ld.prototype.executeFromCache=olympe.dc.ld.prototype.bd;olympe.dc.ld.prototype.execute=olympe.dc.ld.prototype.hb;olympe.dc.ld.prototype.cast=olympe.dc.ld.prototype.Yi;olympe.dc.ld.prototype.follow=olympe.dc.ld.prototype.sb;olympe.dc.da.V={};olympe.dc.da.V.Ud=class{constructor(...a){this.V=a}hb(a){return this.V.reduce((b,c)=>b&&c.hb(a),!0)}observe(a,b,c){const d=this.V.map(()=>!1),e=this.V.map(()=>null),f=(g,h)=>{d[h]=g;g=d.every(k=>k);e[h]!==g&&(e[h]=g,c(g))};this.V.forEach((g,h)=>{g.observe(a,olympe.W.mb('AND-'+b+a+h),k=>f(k,h))})}ia(){return{pr:8,p:this.V.map(a=>a.ia())}}toString(){return'And-'+this.V.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.V.forEach((c,d)=>{c.clear(a,olympe.W.mb('AND-'+b+a+d))})}};
524
+ olympe.dc.da.V.Ud.C=8;olympe.dc.da.V.Ud.la=[olympe.dc.da.$a];olympe.dc.da.V.Sc=class{constructor(a,b,c,d=!1){this.kb=olympe.dc.xa(a);this.substring=b;this.db=c;this.C=d}fb(){return this.kb}hb(a){return this.apply(this.db.fb(a,this.kb))}observe(a,b,c){Bd(this.db,a,this.kb,d=>{c(this.apply(d))},olympe.W.mb(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.kb+'-'+this.substring+'-'+this.C}clear(a,b){this.db.F(a,this.kb,olympe.W.mb(b+
525
+ a+this.toString()))}ia(){return{pr:2,p:this.kb,s:this.substring,c:this.C}}};olympe.dc.da.V.Sc.C=2;olympe.dc.da.V.Sc.la=[olympe.dc.da.$a];olympe.dc.da.V.Gc=class{constructor(a,b,c){this.kb=olympe.dc.xa(a);this.C=b;this.db=c}hb(a){return this.apply(this.db.fb(a,this.kb))}observe(a,b,c){Bd(this.db,a,this.kb,d=>{c(this.apply(d))},olympe.W.mb(b+a+this.toString()))}clear(a,b){this.db.F(a,this.kb,olympe.W.mb(b+a+this.toString()))}apply(a){return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.qb(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.qb(this.C):!1:a===
526
+ this.C}toString(){return'Equals-'+this.kb+'-'+this.C.toString()}fb(){return this.kb}ia(){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.R();break;case this.C instanceof olympe.D.Color:a=4,b={r:this.C.Of().valueOf(),g:this.C.If().valueOf(),b:this.C.Df().valueOf(),a:this.C.Cf().valueOf()}}return{pr:1,p:this.kb,t:a,v:b}}};olympe.dc.da.V.Gc.C=1;olympe.dc.da.V.Gc.la=[olympe.dc.da.$a];function Ne(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 Oe(a,b){return'number'===typeof a.C?a.C:a.db.fb(b,a.C)}function Pe(a,b,c){return olympe.W.mb(c+b+a.C+a.kb)}
527
+ olympe.dc.da.V.Eh=class{constructor(a,b,c=!0,d=!0){this.db=olympe.dc.Na();this.kb=olympe.dc.xa(a);this.C='number'===typeof b?b:olympe.dc.xa(b);this.F=c;this.G=d}fb(){return this.kb}hb(a){return Ne(this,this.db.fb(a,this.kb),Oe(this,a))}observe(a,b,c){'string'===typeof this.C&&Bd(this.db,a,this.C,d=>{const e=this.db.fb(a,this.kb);null!==e&&c(Ne(this,e,d))},Pe(this,a,b));Bd(this.db,a,this.kb,d=>{const e=Oe(this,a);c(null!==e?Ne(this,d,e):!0)},Pe(this,a,b))}clear(a,b){this.db.F(a,this.kb,Pe(this,a,b));
528
+ 'string'===typeof this.C&&this.db.F(a,this.C,Pe(this,a,b))}ia(){return{pr:3,p:this.kb,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.kb+'-'+this.G+'-'+this.C}};olympe.dc.da.V.Eh.C=3;olympe.dc.da.V.Eh.la=[olympe.dc.da.$a];olympe.dc.da.V.kd=class{constructor(a){this.C=a}hb(a){return!this.C.hb(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.W.mb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}ia(){return{pr:4,v:this.C.ia()}}toString(){return`NOT-${this.C.toString()}`}clear(a,b){this.C.clear(a,olympe.W.mb('NOT'+b+a))}};olympe.dc.da.V.kd.C=4;olympe.dc.da.V.kd.la=[olympe.dc.da.$a];olympe.dc.da.V.ae=class{constructor(...a){this.V=a}hb(a){return this.V.reduce((b,c)=>b||c.hb(a),!1)}observe(a,b,c){const d=this.V.map(()=>!1),e=this.V.map(()=>null),f=(g,h)=>{d[h]=g;g=d.some(k=>k);e[h]!==g&&(e[h]=g,c(g))};this.V.forEach((g,h)=>{g.observe(a,olympe.W.mb('OR-'+b+a+h),k=>f(k,h))})}ia(){return{pr:7,p:this.V.map(a=>a.ia())}}toString(){return'And-'+this.V.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.V.forEach((c,d)=>{c.clear(a,olympe.W.mb('OR-'+b+a+d))})}};
529
+ olympe.dc.da.V.ae.C=7;olympe.dc.da.V.ae.la=[olympe.dc.da.$a];olympe.dc.da.V.xd=class{constructor(a,b,c,d=!0){this.kb=olympe.dc.xa(a);this.C=RegExp('');try{this.C=new RegExp(b)}catch(e){if(!(e instanceof SyntaxError))throw e;}this.db=c;this.F=d}fb(){return this.kb}hb(a){return this.apply(this.db.fb(a,this.kb))}observe(a,b,c){Bd(this.db,a,this.kb,d=>{c(this.apply(d))},olympe.W.mb(b+a+this.toString()))}apply(a){return'string'===typeof a?this.F?this.C.test(a):this.C.test(a.toLowerCase()):!1}toString(){return'Regex'+this.kb+'-'+this.C.toString()+'-'+this.F}ia(){return{pr:5,
530
+ p:this.kb,r:this.C.source,c:this.F}}clear(a,b){this.db.F(a,this.kb,olympe.W.mb(b+a+this.toString()))}};olympe.dc.da.V.xd.C=5;olympe.dc.da.V.xd.la=[olympe.dc.da.$a];olympe.dc.da.V.De=class{constructor(a){this.db=olympe.dc.Na();this.Ka=[];this.recursive=[];this.destination=a?olympe.dc.xa(a):null}dd(){return Array.from(this.Ka)}clear(a,b){0<this.Ka.length&&this.db.C(a,this.Ka[0],olympe.W.mb(b+0+a))}sb(a){this.Ka.push(a);this.recursive.push(!1);return this}Lk(a){this.Ka.push(a);this.recursive.push(!0);return this}hb(a){if(1>this.Ka.length)return olympe.pa.Xa('dc').error('RelatedTo executed with less than 1 relation'),!1;let b=[];const c=this.destination||'',d=(e,
530
531
  f,g,h)=>e?f?this.db.Nf(g,h,c):this.db.Nf(g,h):this.db.ub(g,h);for(let e=0;e<this.Ka.length;++e){const f=this.Ka[e],g=this.recursive[e],h=e===this.Ka.length-1;if(0===e)b=d(g,h,a,f);else if(b=b.flatMap(k=>d(g,h,k,f)),0===b.length)return!1}return c?b.includes(c):0<b.length}observe(a,b,c){const d=this.Ka.length;let e=0;const f=new Set,g=(k,l)=>{this.destination&&this.destination!==l||(e+=k?1:-1,1<e||c(0<e))},h=(k,l,n,p)=>{const q=this.Ka[k],r=this.recursive[k-1]?this.Ka[k-1]:null;l=olympe.W.mb(l+k+p);
531
- const t=olympe.W.mb(l+'rec');k===d?g(n,p):n?f.has(p)||(f.add(p),V(this.db,p,q,h.bind(this,k+1,l),l),r&&V(this.db,p,r,h.bind(this,k,t),t)):(f.delete(p),this.db.C(p,q,l),r&&this.db.C(p,r,t))};h(0,b,!0,a);0===e&&c(!1)}ia(){return{pr:6,r:this.Ka.map((a,b)=>[a.R(),a.Oa(),this.recursive[b]]),d:this.destination}}toString(){const a=this.Ka.reduce((b,c,d)=>b+c.R()+this.recursive[d],'');return`RelatedTo-${this.destination}-${a}`}};olympe.dc.da.U.De.prototype.followRecursive=olympe.dc.da.U.De.prototype.Pk;
532
- olympe.dc.da.U.De.prototype.follow=olympe.dc.da.U.De.prototype.sb;olympe.dc.da.U.De.C=6;olympe.dc.da.U.De.la=[olympe.dc.da.$a];olympe.dc.da.Kb={};olympe.dc.da.Kb.rc=class{constructor(a){this.C=a}F(a){return a}hb(a,b){for(const c of X(a,b).keys())this.C.hb(c)||(0===b?a.remove(c,b,null):He(a,c,b).forEach(d=>{a.remove(c,b,d)}))}observe(a,b,c){let d=!1;return(e,f,g,h)=>{const k=olympe.W.mb(h+f+this.toString());e?this.C.observe(f,k,l=>{d||(l?a.insert(f,b,g):a.remove(f,b,g),c(l,f,g,k))}):(d=!0,this.C.clear(f,k),d=!1,c(!1,f,g,k))}}ia(){return{t:1,p:this.C.ia()}}toString(){return'filterQueryPart-'+this.C.toString()}};olympe.dc.da.Kb.rc.C=1;
533
- olympe.dc.da.Kb.rc.la=[olympe.dc.da.nk];olympe.dc.da.Kb.jg=class{constructor(a,b){this.db=a;this.C=b}Qd(){return this.C}F(a){return a+1}hb(a,b){for(const c of X(a,b).keys())this.db.ub(c,this.C).forEach(d=>{a.insert(d,b+1,c)})}observe(a,b,c){return(d,e,f,g)=>{const h=olympe.W.mb(g+e+this.toString());d?V(this.db,e,this.C,(k,l)=>{(k?a.insert(l,b+1,e):a.remove(l,b+1,e))&&c(k,l,e,h)},h):this.db.C(e,this.C,h)}}ia(){return{t:2,r:{t:this.C.R(),d:this.C.Oa()}}}toString(){return'followQueryPart-'+this.C.Oa()+this.C.R()}};olympe.dc.da.Kb.jg.C=2;
534
- olympe.dc.da.Kb.jg.la=[olympe.dc.da.nk];olympe.dc.da.Kb.kg=class{constructor(a,b,c=!1){this.db=a;this.C=b;this.G=c}Qd(){return this.C}F(a){return a+1}hb(a,b){for(const c of X(a,b).keys())this.G&&a.insert(c,b+1,c),this.db.Nf(c,this.C).forEach(d=>{a.insert(d,b+1,c)})}observe(a,b,c){const d=(g,h,k,l)=>olympe.W.mb(g+h+k+l+this.toString()),e=new Set,f=(g,h,k,l,n)=>{h=d(h,g,n,k);(this.G||0<k)&&(l?a.insert(n,b+1,g):a.remove(n,b+1,g))&&c(l,n,g,h);l?e.has(n)||(e.add(n),V(this.db,n,this.C,f.bind(this,g,h,k+1),h)):(e.delete(n),this.db.C(n,this.C,
535
- h))};return(g,h,k,l)=>f(h,l,0,g,h)}ia(){return{t:3,s:this.G,r:{t:this.C.R(),d:this.C.Oa()}}}toString(){return'followRecursivelyQueryPart-'+this.C.Oa()+this.C.R()}};olympe.dc.da.Kb.kg.C=3;olympe.dc.da.Kb.kg.la=[olympe.dc.da.nk];function Me(a){a=a.db.fc(a.kb,olympe.dm.Property.typeRel);const b=olympe.dc.xa;if(a===b(olympe.dm.String))return Ne((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return Ne((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return Ne((c,d)=>c.getTime()-d.getTime());olympe.pa.Xa('dc').warn(`No comparator found for type with tag ${a}`);return Ne(()=>-1)}function Ne(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
536
- olympe.dc.da.Kb.Rh=class{constructor(a,b,c){this.db=a;this.kb=b;this.order=c}F(a){return a}hb(a,b){Ee(a,Me(this),b,this.order,this.kb)}observe(a,b,c){Ee(a,Me(this),b,this.order,this.kb);return(d,e,f,g)=>{g=olympe.W.mb(g+this.toString());d?xd(this.db,e,this.kb,()=>{Ge(a)},g):this.db.F(e,this.kb,g);c(d,e,f,g)}}ia(){return{t:4,p:this.kb.R(),o:this.order}}toString(){return'sortByQueryPart-'+this.order+this.kb.R()}fb(){return this.kb}};olympe.dc.da.Kb.Rh.C=4;olympe.dc.da.Kb.Rh.la=[olympe.dc.da.nk];olympe.dc.query={};function Oe(a,b,c,d){let e=a.C.get(b);void 0===e&&(e=new Set,a.C.set(b,e));a=olympe.W.lc();e.add(a);d.set(a,c)}function Pe(a,b,c){Oe(a,b,c,a.F)}function Qe(a,b,c){if(a.C.has(b)){for(const d of a.C.get(b))c.delete(d);a.C.delete(b)}}function Re(a,b,c,d,e){if(a.C.has(b)){if(!a.N.has(b)){a.N.add(b);for(const f of a.C.get(b))e=d.get(f),d.delete(f),c instanceof olympe.dc.query.aj.Yj?e(Error(c.aa()),c):'string'===typeof c?e(Error(c),null):e(null,c);a.C.delete(b);a.N.delete(b)}}else a.L.warn(e)}
537
- function Se(a,b,c){Re(a,b,c,a.F,`Graph result of graphdef ${b} has no associated handler in the datacloud`)}function Te(a,b,c){Oe(a,b,c,a.G)}olympe.dc.query.Ns=class{constructor(a){this.L=a;this.C=new Map;this.F=new Map;this.G=new Map;this.N=new Set}};olympe.dc.Ne=class{ma(){}N(){}G(){}V(){}ia(){}toString(){}};olympe.dc.Ed={SUBSCRIBE:0,Mi:1,qm:2,WA:0,GET:1};olympe.dc.Ed.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Ed))if(c===a)return b;return null};function re(a,b=1){a.validate(olympe.dc.Rb.NONE,'back');let c=a.Z;for(let d=0;d<b&&null!==c;d++)c=a.F.get(c.F)||null;a.Z=c}function Ue(a){return'not_defined'===a.C?olympe.dc.Rb.NONE:a.C}function Ve(a,b){a.validate(b,'activateFollowRules');return a}function We(a){return'not_defined'!==a.C&&a.C!==olympe.dc.Rb.NONE}
538
- function Xe(a){if(We(a))throw Error('An implicit GraphDef has no blocks');return a.F.values()}
539
- function Ye(a,b,c){c=new olympe.dc.query.Relation(b.R(),b.Oa(),c||b instanceof olympe.dc.X.Dc);b=[];var d;for(var e of Ze(a)){if(d=a.F.get(e)){var f=new olympe.dc.query.Xj(c,d.id);d.children.has(f.Y())?d=d.children.get(f.Y()):(d.children.set(f.Y(),f),d=f)}else{d=a;var g=c;const h=olympe.W.mb(d.G);f=olympe.W.mb(h+g.toString());g=d.F.get(f)||new olympe.dc.query.Xj(g,h);d.V.set(f,g);d=g}f=d.Y();a.F.set(f,d);b.push(f)}e=b[0];a.ra.set(e,b);return a.F.get(e)}
540
- function $e(a,b){if(We(a))a.aa.push(b);else throw Error('You cannot add a "skip predicate" to an explicit graphdef. Please activate a follow rule first.');return a}function af(a,b){a.ka=b;return a}function bf(a){const b=new olympe.dc.jf(a.G,a.N);b.C=a.C;for(const [c,d]of a.V)b.V.set(c,d);for(const [c,d]of a.F)b.F.set(c,d);b.ka=a.ka;b.aa=[...a.aa];return b}function cf(a,b){return We(a)?new olympe.dc.query.Sl(bf(a),b||olympe.D.Ia()):new olympe.dc.query.Wj(bf(a),b||olympe.D.Ia())}
541
- function Ze(a){let b=a.Z;const c=[];for(;b&&b.Qd().recursive;)c.push(b.Y()),b=a.F.get(b.F)||null;c.push(b&&b.Y()||olympe.W.mb(a.G));const d=[];c.slice(0,5).forEach(e=>{d.push(...a.ra.get(e))});return d}
542
- olympe.dc.jf=class{constructor(a,b=olympe.dc.Ed.SUBSCRIBE){if(void 0===a||null===a)throw Error('Cannot create GraphDef with undefined or null baseTag');this.G=olympe.dc.xa(a);this.N=b;this.C='not_defined';this.aa=[];this.Z=null;this.V=new Map;this.F=new Map;this.ka=null;this.ra=(new Map).set(olympe.W.mb(this.G),[olympe.W.mb(this.G)])}static Jc(a,b){olympe.dc.jf.Ue([a],b)}static Ue(a,b){const c=new olympe.dc.Transaction;a.forEach(d=>c.delete(d,olympe.dc.Rb.Fc));c.hb(b)}toJSON(){const a=Object.create(null),
543
- b=c=>{const d=Object.create(null),e=c.Qd();d.t=e.R();d.d=e.Oa();d.r=e.recursive;d.c=c.lh().map(b);return d};a.t=this.G;a.o=this.N;a.f=Ue(this);a.b=Array.from(this.V.keys()).map(c=>b(this.F.get(c)));return JSON.stringify(a)}static kc(a){a='string'===typeof a?JSON.parse(a):a;const b=Ve(new olympe.dc.jf(a.t,a.o),a.f),c=d=>{const e=new olympe.dc.ta.Relation(d.t,d.d);b.sb(e,d.r);for(const f of d.c)c(f);re(b)};for(const d of a.b)c(d);return b}Y(){const a=olympe.W.mb,b=d=>d.Y()+d.lh().map(e=>b(e)).sort().join(''),
544
- c=Array.from(this.V,([,d])=>b(d)).sort().join('');return a(`${this.N}-${this.G}${c}-${Ue(this)}`)}add(a,b=!1){this.validate(olympe.dc.Rb.NONE,'add');Ye(this,a,b);return this}sb(a,b=!1){this.validate(olympe.dc.Rb.NONE,'follow');this.Z=Ye(this,a,b);return this}hb(a=b=>b){'not_defined'===this.C&&(this.C=olympe.dc.Rb.NONE);const b=olympe.dc.Lf();a=olympe.D.Ia().Cb(a);switch(this.N){case olympe.dc.Ed.SUBSCRIBE:case olympe.dc.Ed.Mi:const c=df(b,this,a);olympe.D.Ia().vc(()=>{ef(olympe.dc.Lf(),c.Y())});break;
545
- case olympe.dc.Ed.qm:ff(b,this,a);break;default:throw Error('Wrong graph operation');}}validate(a,b){if('not_defined'!==this.C&&this.C!==a)throw Error(this.C!==olympe.dc.Rb.NONE?`Method ${b} can't be called on an implicit Graphdef`:`Method ${b} can't be called on an explicit Graphdef`);this.C=a}};function gf(a,b){a.data.Mc(b.data);a.C.forEach((c,d)=>{if(b.C.has(d))d=b.C.get(d),d.add.push(...c.add),d.remove.push(...c.remove);else{var e=c.remove;const f=new hf(d);f.add=c.add;f.remove=e;b.C.set(d,f)}})}function jf(a,b){a.C.forEach((c,d)=>b(d,c.add,c.remove))}olympe.dc.query.rt=class{constructor(a,b){this.id=a;this.C=new Map;this.data=b}Y(){return this.id}};class hf{constructor(a){this.id=a;this.add=[];this.remove=[]}Y(){return this.id}};function kf(a){return(a=a.C)&&olympe.dc.Na().source(a)||olympe.dc.Ja.Vc}function lf(a){return Array.from(a.Da,b=>a.F.get(b))}function mf(a){if(!a.N){for(const b of a.V.values())b();a.V.clear();a.N=!0}}
546
- olympe.dc.query.Wj=class{constructor(a,b){this.sh=a;this.C=a.G;this.id=a.Y();this.aa=new olympe.D.Wb(`GraphSubscription ${this.id}`,b);this.L=olympe.pa.Xa('dc.query');this.Da=[];this.F=new Map;this.N=!1;this.V=new Map;b=olympe.W.mb(this.C);if(!We(a))for(const c of Xe(a))this.F.set(c.Y(),c),c.F===b&&this.Da.push(c.Y())}Y(){return this.id}Ke(a,b){b=b||olympe.W.lc();this.N?a():this.V.set(b,olympe.D.Ia().Cb(a));return b}rj(a){return this.V.delete(a)}onDestroy(a){this.aa.onDestroy(a)}release(){this.aa.destroy()}Z(){return function*(a,
547
- b){yield a;for(const c of b)yield*c.ee()}(this.C,this.F.values())}ka(a){const b=olympe.W.mb(this.C);nf(a,(c,d)=>{if(b!==c)if(c=this.F.get(c),void 0===c)this.L.error('Try to apply a block result that does not exists in the original query');else for(const e of d)c.C.add(e)})}ra(a){let b=[],c=[];const d=olympe.W.mb(this.C);jf(a,(e,f,g)=>{const h=d===e,k=this.F.get(e);h||void 0!==k?h?(b.push(...f),c.push(...g)):(b=b.concat(f.filter(l=>{k.C.has(l)?l=!1:(k.C.add(l),l=!0);return l})),c=c.concat(g.filter(l=>
548
- k.C.delete(l)))):this.L.error(`A notification contains a block ${e} which is not present in the current graph query ${this.id}`)});Pc(olympe.dc.Ad(),b,c)}Ir(a){const b=a.C,c=[],d=this.C;d===b&&c.push(olympe.W.mb(d));this.F.forEach((k,l)=>{k.C.has(b)&&c.push(l)});const e=olympe.W.mb,f=this.F,g=(k,l)=>{const n=l.Qd(),p=[e(k+n),e(k+new olympe.dc.query.Relation(n.tag,n.direction,!0))].filter(q=>f.has(q));return 0<p.length?l.lh().reduce((q,r)=>q&&g(p[0],r),!0):!1},h=lf(a);return void 0!==c.find(k=>{for(const l of h)if(!g(k,
549
- l))return!1;return!0})}};olympe.dc.query.Xj=class{constructor(a,b){this.G=a;this.children=new Map;this.C=new Set;this.F=b;this.id=olympe.W.mb(b+a.toString());this.apply=!0}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "parentId": '+JSON.stringify(this.F)+', "apply": '+JSON.stringify(this.apply)+', ';a+='"relation": '+this.G.toJSON();if(0<this.children.size){a+=', "children": [';for(const b of this.children.values())a+=b.toJSON()+', ';a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=']'}if(0<this.C.size){a+=', "instances": [';
550
- for(const b of this.C)a+=JSON.stringify(b)+', ';a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=']'}return a+'}'}static kc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=olympe.dc.query.Relation.kc(b.relation);a=new olympe.dc.query.Xj(a,b.parentId);a.id=b.id;a.apply=b.apply;if(b.instances)for(const c of b.instances)a.C.add(c);if(b.children)for(const c of b.children)b=olympe.dc.query.Xj.kc(c),a.children.set(b.id,b);return a}Y(){return this.id}Qd(){return this.G}lh(){return Array.from(this.children.values())}ee(){return this.C.values()}toString(){return this.F+
551
- this.G.toString()}};function nf(a,b){a.C.forEach((c,d)=>b(d,c))}
552
- olympe.dc.query.Di=class{constructor(a,b,c,d){this.id=a;this.source=b;this.destination=c;this.C=new Map;this.Bc=d}toJSON(){let a=`{ "id": "${this.id}", "source": "${this.source}", "destination": "${this.destination}"`;a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=', "blocks": {';for(const [b,c]of this.C)a+=`"${b}": ${JSON.stringify(Array.from(c))}, `;a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=`}, "patch": ${this.Bc.toJSON()}`;return a+'}'}static kc(a){let b;'string'===typeof a?b=JSON.parse(a):
553
- b=a;a=olympe.dc.db.xc.kc(b.patch);a=new olympe.dc.query.Di(b.id,b.source,b.destination,a);for(const [c,d]of Object.entries(b.blocks))a.C.set(c,new Set(d));return a}Y(){return this.id}};const of=olympe.dc.ic.Tc,pf=olympe.dc.ic.yi,qf=olympe.dc.za.ORIGIN,rf=olympe.dc.za.DESTINATION;function sf(a,b,c){const d=a.sh.aa;return c.filter(e=>d.reduce((f,g)=>f&&!g(b,e.Qd()),!0))}
554
- olympe.dc.query.Sl=class extends olympe.dc.query.Wj{constructor(a,b){super(a,b);this.G=(new Set).add(a.G)}Z(){return this.G.values()}ka(a){a=a.Bc;for(const b of a.ee())b.N()?this.G.delete(b.tag()):b.se()&&this.G.add(b.tag())}ra(a){let b=[],c=[];jf(a,(d,e,f)=>{b=b.concat(e.filter(g=>{if(this.G.has(g)&&this.C!==g)return!1;this.G.add(g);return!0}));c=c.concat(f.filter(g=>this.G.delete(g)))});Pc(olympe.dc.Ad(),b,c)}Ir(a){var b=a.C,c=Array.from(a.F.values()),d=sf(this,b,c);if(d.length===c.length&&!this.G.has(b))return!1;
555
- b=olympe.dm.Relation.C.Ck;c=olympe.dm.Relation.C.rk;const e=olympe.dc.Na();for(const h of d){var f=h.Qd(),g=f.R();d=f.Oa();if(d!==rf||g!==of&&g!==pf){if(!e.Gb(f))return this.L.info('ImplicitGraphQuery: checking coverage of graphPath',a.Y(),'failed at the relation',g,'which is not in local DB'),!1;f=zd(e,f,Ue(this.sh));g=0===h.lh().length;if(!(f&(d===qf?g?12:c:g?3:b)))return!1}}return!0}};function tf(a){let b=null;for(a=[...a.X];null===b&&0<a.length;)b=a.pop().Yb();return b}function uf(a,b){a.Z()||(a=`Calling "${b}" on subscription with id ${a.Y()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback.',olympe.pa.Xa('dc').warn(a))}
556
- function vf(a,b){const c=new olympe.D.Wb('listDef toObservable',a.nc().Hh());return new rxjs.Observable(d=>{c.run(()=>{olympe.D.wc([b],e=>{d.next(e.valueOf())})});c.onDestroy(()=>{d.complete()});return c.destroy.bind(c)})}
557
- olympe.dc.Aa=class{constructor(a,b,c){void 0===a||null===a?olympe.pa.Xa('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.Fa([a],olympe.dc.xa,String),this.X=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||tf(this),this.C=null)}Qc(){return olympe.dc.Qc()}hb(){if(null===this.C){const a=olympe.dc.Lf();this.C=wf(a,this);null!==this.valueType&&this.C.Gd(this.valueType);olympe.D.Ia().vc(()=>{xf(a,this.C.Y());this.C=
558
- null})}return this}nc(){null===this.C&&this.hb();return this.C}Gd(a){this.valueType=a;null!==this.C&&this.C.Gd(this.valueType)}Yb(){return null!==this.C?this.C.Yb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Od(){return this.F}Vl(){return this.X}Ke(a,b){return this.nc().Ke(a,b)}rj(a){this.nc().rj(a)}Jt(){return this.nc().Qf()}It(){return this.nc().Z()}get(a){return this.nc().get(a)}fi(){return this.nc().fi()}mh(a){const b=this.nc();uf(b,'getCurrent');return b.mh(a)}has(a){return this.nc().has(a)}Fg(a){const b=
559
- this.nc();uf(b,'hasCurrent');return b.Fg(a)}re(a){return this.nc().re(a)}Ox(a){return vf(this,this.re(a))}Xe(a){const b=this.nc();uf(b,'getCurrentAt');return b.Xe(a)}Ye(a){return this.nc().Ye(a)}Ef(a){const b=this.nc();uf(b,'getCurrentKeyAt');return b.Ef(a)}fe(a){return this.nc().fe(a)}Sx(a){return vf(this,this.fe(a))}Ff(a){const b=this.nc();uf(b,'getCurrentRank');return b.Ff(a)}Oc(){return this.nc().Oc()}Px(){return vf(this,this.Oc())}Gf(){return this.nc().Gf()}mf(){return this.nc().mf()}Tx(){return vf(this,
560
- this.mf())}Bg(){const a=this.nc();uf(a,'getCurrentSize');return a.Bg()}forEach(a,b){this.nc().forEach(a,b)}de(a){const b=this.nc();uf(b,'forEachCurrentValue');return b.de(a)}cj(a,b,c,d){a=new olympe.dc.X.$d(a,b);(new olympe.dc.Aa(this.F,[...this.X,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.X];for(const c of b){if(void 0===
561
- c)throw Error('ListDef.transform(): Trying to set an undefined transformer');if(c instanceof olympe.dc.ta.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.getTransform)break;a.push(c)}b=new olympe.dc.Aa(this.F,a);b.Gd(tf(b)||this.valueType||Object);return b}nl(a){return this.transform(new olympe.dc.X.uf(a))}filter(a){return this.transform(new olympe.dc.X.rc(a))}xg(){const a=new olympe.dc.fk(this.F,null===this.valueType?
562
- void 0:this.valueType);let b=this.X;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.X;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.Ya(this.F)+a+')'}Ht(){return this.nc().Vg()}hd(){return olympe.D.Fa([this.mf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.Xe(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.Bb(b+']')},olympe.D.Wa)}};olympe.dc.Aa.prototype.filter=olympe.dc.Aa.prototype.filter;olympe.dc.Aa.prototype.union=olympe.dc.Aa.prototype.nl;
563
- olympe.dc.Aa.prototype.transform=olympe.dc.Aa.prototype.transform;olympe.dc.Aa.prototype.forEachCurrentValue=olympe.dc.Aa.prototype.de;olympe.dc.Aa.prototype.forEach=olympe.dc.Aa.prototype.forEach;olympe.dc.Aa.prototype.getCurrentSize=olympe.dc.Aa.prototype.Bg;olympe.dc.Aa.prototype.observeSize=olympe.dc.Aa.prototype.Tx;olympe.dc.Aa.prototype.observeFirst=olympe.dc.Aa.prototype.Px;olympe.dc.Aa.prototype.getCurrentRank=olympe.dc.Aa.prototype.Ff;olympe.dc.Aa.prototype.observeRank=olympe.dc.Aa.prototype.Sx;
564
- olympe.dc.Aa.prototype.getCurrentAt=olympe.dc.Aa.prototype.Xe;olympe.dc.Aa.prototype.observeAt=olympe.dc.Aa.prototype.Ox;olympe.dc.Aa.prototype.offReady=olympe.dc.Aa.prototype.rj;olympe.dc.Aa.prototype.onReady=olympe.dc.Aa.prototype.Ke;olympe.dc.Aa.prototype.getBaseTag=olympe.dc.Aa.prototype.Od;olympe.dc.Aa.la=[olympe.D.nd];m=olympe.dc.Aa.prototype;m.Qc.K=olympe.D.J.C;m.hb.K=olympe.D.J.N();m.nc.K=new olympe.D.J(()=>olympe.dc.query.Subscription,[]);m.Gd.K=new olympe.D.J(()=>{},[]);
565
- m.Od.K=new olympe.D.J(()=>String,[]);m.Vl.K=new olympe.D.J(()=>Array,[]);m.Ke.K=new olympe.D.J(()=>String,[]);m.rj.K=new olympe.D.J(()=>{},[]);m.Jt.K=olympe.D.J.V;m.It.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.fi.K=new olympe.D.J(()=>Array,[]);m.mh.K=olympe.D.J.C;m.has.K=olympe.D.J.V;m.Fg.K=olympe.D.J.C;m.re.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.Xe.K=olympe.D.J.C;m.Ye.K=new olympe.D.J(()=>String,[]);m.Ef.K=olympe.D.J.C;m.fe.K=olympe.D.J.G;
566
- m.Ff.K=olympe.D.J.C;m.Oc.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.Gf.K=new olympe.D.J(()=>String,[]);m.mf.K=olympe.D.J.G;m.Bg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.de.K=olympe.D.J.C;m.cj.K=new olympe.D.J(()=>{},[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.nl.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.filter.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.xg.K=new olympe.D.J(()=>olympe.dc.fk,[]);m.toString.K=olympe.D.J.C;m.Ht.K=olympe.D.J.C;m.hd.K=olympe.D.J.F;const yf={Cy:'append',Il:'filter_not',Qo:'filter_and',Ro:'filter_or'};function zf(a,b){a=Af(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.na.Un(a,b)).F}
567
- olympe.dc.fk=class{constructor(a,b){this.C=Af(a);this.L=olympe.dc.Lf().Xa();this.valueType=void 0===b?olympe.dc.CloudObject:b;this.X=[];this.ua=[]}nf(){return new olympe.dc.Aa(this.C,this.X,this.valueType)}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Bf('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.ta.Property)throw new Bf('transform','Properties cannot be used as transformer, unlike relations '+d);if(!d||'function'!==typeof d.getTransform)throw new Bf('transform',
568
- 'one of the argument is not a Transformer '+d);const e=d.Yb();null!==e&&(this.valueType=e);this.X.push(d)}return this}nl(a){this.X.push(new olympe.dc.X.uf(a));return this}Ay(a){this.X.push(new olympe.dc.X.uf(Af(a)));return this}Lt(a){this.valueType=a;return this}sb(a){this.X.push(a);this.valueType=a.Yb()||olympe.dc.CloudObject;return this}dw(a){for(const b of a)this.X.push(b),this.valueType=b.Yb()||olympe.dc.CloudObject;return this}Pk(a,b,c){a=new olympe.dc.X.Dc(a,a.Oa(),b,c);this.X.push(a);this.valueType=
569
- a.Yb()||olympe.dc.CloudObject;return this}aw(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.R());void 0===c&&(c=e.Oa())}a=new olympe.dc.X.Be(b,c);this.X.push(a);this.valueType=a.Yb()||olympe.dc.CloudObject;return this}Kt(){this.sb(olympe.dc.CloudObject.instancesRel);return this}We(a){var b=this.ua.pop();b===yf.Il&&(a=new olympe.dc.U.kd(a),b=this.ua.pop());switch(b){case yf.Qo:b=this.X.pop().C;b instanceof olympe.dc.U.Vd?(b=b.U,b.push(a),a=new olympe.dc.U.Vd(...b)):a=new olympe.dc.U.Vd(b,
570
- a);b=this.ua.pop();break;case yf.Ro:b=this.X.pop().C,b instanceof olympe.dc.U.be?(b=b.U,b.push(a),a=new olympe.dc.U.be(...b)):a=new olympe.dc.U.be(b,a),b=this.ua.pop()}b===yf.Il&&(a=new olympe.dc.U.kd(a),this.ua.pop());this.X.push(new olympe.dc.X.rc(a));return this}Wv(a,b,c){return this.We(new olympe.dc.U.Gc(zf(a,c),new olympe.dc.na.Dd(b)))}contains(a,b,c=!1,d){return this.We(new olympe.dc.U.Sc(zf(a,d),new olympe.dc.na.Dd(b),c))}th(a){if(!(a instanceof Array))throw new Bf('instanceOf','Provided argument "models" must be an array.');
571
- const b=[];for(let c=0;c<a.length;c++)b.push(Af(a[c]));return this.We(new olympe.dc.U.lf(b))}Xk(a){return this.We(new olympe.dc.U.Gc(new olympe.dc.na.sf,new olympe.dc.na.Dd(Af(a))))}Xv(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.not().Xk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().not().Xk(a[b])}return this}lj(a,b){if(!(a instanceof Array))throw new Bf('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];
572
- a.forEach(e=>{c.push(e);d.push(e.Oa())});return this.We(new olympe.dc.U.kf(c,d,b))}Wk(a,b,c){a=zf(a,c);return this.We(new olympe.dc.U.ye(a,new olympe.dc.na.Dd(b)))}zj(a,b,c){a=zf(a,c);return this.We(new olympe.dc.U.Fe(a,new olympe.dc.na.Dd(b)))}Ax(a,b,c,d){a=zf(a,d);return this.We(new olympe.dc.U.xd(a,b,c))}filter(a){const b=new class extends olympe.dc.U.Og{C(c,d){return a(olympe.dc.CloudObject.get(d))}};return this.We(b)}not(){this.ua.push(yf.Il);return this}and(){this.X[this.X.length-1]instanceof
573
- olympe.dc.X.rc&&this.ua.push(yf.Qo);return this}or(){this.X[this.X.length-1]instanceof olympe.dc.X.rc&&this.ua.push(yf.Ro);return this}ll(a,b,c){a=Af(a);let d=null;switch(olympe.dc.Na().fc(a,olympe.dm.Property.typeRel)){case olympe.dm.String.P.R():d=new olympe.dc.Db.String(new olympe.dc.na.oe(a,c));break;case olympe.dm.Number.P.R():d=new olympe.dc.Db.Number(new olympe.dc.na.ke(a,c));break;case olympe.dm.DateTime.P.R():d=new olympe.dc.Db.DateTime(new olympe.dc.na.je(a,c))}c=d;null!==c&&this.X.push(new olympe.dc.X.Kd(c,
574
- b));return this}sort(a,b,c){const d=new class extends olympe.dc.Db.Og{N(e,f){return a(olympe.dc.CloudObject.get(f))}G(e,f){return b(e,f).valueOf()}};this.X.push(new olympe.dc.X.Kd(d,c));return this}Sv(){this.X.push(new olympe.dc.X.xe);return this}limit(a,b){this.X.push(new olympe.dc.X.$d(a,b));return this}};class Bf extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
575
- function Af(a){return'string'===typeof a||a instanceof olympe.D.Wa?a:'function'===typeof a?olympe.dc.Ba.Tb(a):olympe.D.lb(a)?a.Hk===olympe.D.Wa?a:olympe.D.Fa([a],b=>olympe.D.Bb(olympe.dc.xa(b)),olympe.D.Wa):a.R()}m=olympe.dc.fk.prototype;m.nf.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.transform.K=olympe.D.J.N();m.nl.K=olympe.D.J.N();m.Ay.K=olympe.D.J.N();m.Lt.K=olympe.D.J.N();m.sb.K=olympe.D.J.N();m.dw.K=olympe.D.J.N();m.Pk.K=olympe.D.J.N();m.aw.K=olympe.D.J.N();m.Kt.K=olympe.D.J.N();m.We.K=olympe.D.J.N();
576
- m.Wv.K=olympe.D.J.N();m.contains.K=olympe.D.J.N();m.th.K=olympe.D.J.N();m.Xk.K=olympe.D.J.N();m.Xv.K=olympe.D.J.N();m.lj.K=olympe.D.J.N();m.Wk.K=olympe.D.J.N();m.zj.K=olympe.D.J.N();m.Ax.K=olympe.D.J.N();m.filter.K=olympe.D.J.N();m.not.K=olympe.D.J.N();m.and.K=olympe.D.J.N();m.or.K=olympe.D.J.N();m.ll.K=olympe.D.J.N();m.sort.K=olympe.D.J.N();m.Sv.K=olympe.D.J.N();m.limit.K=olympe.D.J.N();olympe.dc.query.Mp=class{constructor(a){this.id=a;this.C=[];this.data=new olympe.dc.db.xc}F(a){this.C.push(olympe.dc.xa(a))}Y(){return this.id}getData(){return this.data}};function Cf(a){return olympe.D.lb(a)?'Node#'+a.Ma.Y():String(a)}function Df(a,b){return olympe.D.lb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
577
- olympe.dc.query.uu=class{constructor(){this.uid=0;this.values=null}add(a){let b;b=olympe.D.lb(a)?'n'+a.Ma.Y():'p'+ ++this.uid;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.$a=class{ma(){}C(){}F(){}ia(){}toString(){}};function ue(a,b,c){return c.run(()=>a.V.hb(b,c))}function ve(a,b,c){return c.run(()=>Ef(a.V,b,c))}
578
- function df(a,b,c){var d=olympe.dc.Ja.rb;const e=b.Y();let f=Ff(a.ta,e),g=olympe.dc.Ja.rb;null===f&&(f=cf(b,a.G),a.N||(g=kf(f)));Gf(a.ta,f,d,g);c&&Pe(a.F,e,c);b=olympe.dc.ga.ja.Bi;const h=olympe.dc.ga.ja.Ai,k=l=>{if(null!==l){a.L.error(`graph subscription "${e}" failed to subscribe ${l}`);Hf(a.ta,e,d);var n=a.F;Qe(n,e,n.F);c(l,null)}};g===olympe.dc.Ja.rb?(a.L.debug('QueryManager: [ID:',e,'] GraphQuery processed locally'),a.Z.process(d,f,k)):(b=M(new olympe.dc.ga(f.sh.N===olympe.dc.Ed.Mi?h:b,f,[g]),
579
- k),a.L.debug('QueryManager: [ID:',e,'] sending GraphQuery to',g),a.C.send(b));return f}function ef(a,b){var c=olympe.dc.Ja.rb;const d=olympe.dc.Ja.rb;if(c===d){const e=Ff(a.ta,b).sh.N,f=If(a.ta,b);Hf(a.ta,b,c)&&f!==d&&e===olympe.dc.Ed.SUBSCRIBE&&(c=M(new olympe.dc.ga(olympe.dc.ga.ja.$o,String(b),[f]),g=>{g&&a.L.error(`Unsubscription of graphdef ${b} failed: ${g.message}`)}),a.C.send(c))}else Hf(a.ta,b,c)}
580
- function ff(a,b,c){var d=olympe.dc.Ja.rb;b=cf(b,a.G);const e=b.Y();var f=a.F.C.has(e);c&&Pe(a.F,e,c);if(!f){f=h=>{if(h){var k=a.F;Qe(k,e,k.F);c(h,null)}};var g=kf(b);g===olympe.dc.Ja.rb?a.Z.process(d,b,f):(d=M(new olympe.dc.ga(olympe.dc.ga.ja.Ai,b,[g]),f),a.C.send(d))}}
581
- function wf(a,b){var c=olympe.dc.Ja.rb;const d=b.Od();var e=new olympe.dc.query.uu;let f;f=d;olympe.D.lb(f)&&(f=e.add(d));b=(b=b.Vl())?Array.isArray(b)?b:[b]:null;const g=olympe.dc.query.Subscription.G(f,b,e);e=Jf(a.ta,g);null===e&&(a.L.debug('QueryMGR: new',a.N?'local':'remote','subscription "',g,'": #',`${f},`,b),e=new olympe.dc.query.Subscription(g,d,b,a.G),a.N||e.qe());a.Sa.process(c,e,h=>{h&&(Kf(a.ta,g,c||olympe.dc.Ja.rb),a.L.error(`subscription "${g}" failed to subscribe ${h}`))});return e}
582
- function xf(a,b){var c=olympe.dc.Ja.rb;if(c===olympe.dc.Ja.rb){const d=If(a.ta,b);a.L.debug('QueryMGR: [ID:',b,'] - Unregistered');Kf(a.ta,b,c)&&d!==olympe.dc.Ja.rb&&(c=M(new olympe.dc.ga(olympe.dc.ga.ja.Ru,String(b),[d]),e=>{e&&a.L.error(`Unsubscription of listdef ${b} failed, ${e.message}`)}),a.C.send(c))}else Kf(a.ta,b,c)}
583
- function Lf(a){const b=olympe.dc.ga.ja.ap,c=olympe.dc.ga.ja.Cl,d=olympe.dc.ga.ja.Fp;a.C.C(olympe.dc.ga.ja.Ll,(e,f)=>{Mf(a,f,e)});a.C.C(b,(e,f)=>{Nf(a,f,e)});a.C.C(c,(e,f)=>{a.aa.bf(f,e)});a.C.C(d,(e,f)=>{Of(a,f,e)});a.C.ra((e,f)=>{Pf(a,f,e)})}function Qf(a,b){a.L.log('Received subscribeToAll command');b=b?olympe.D.Ia().Cb(b):void 0;const c=new olympe.dc.ga(olympe.dc.ga.ja.Sg,null,[olympe.dc.Ja.Vc]);b&&M(c,b);a.C.send(c)}
584
- function Mf(a,b,c=olympe.dc.Ja.rb){b.destination!==olympe.dc.Ja.rb?a.L.error(`Graphdefs registered from peers is not supported yet ! (id: ${b.Y()})`):a.ra.process(c,b,d=>{d&&a.L.error(`An error occurred during the process of a graphdef result ${b.Y()}: ${d.message}`)})}
585
- function Nf(a,b,c=olympe.dc.Ja.rb){const d=Rf(a.ta,b.Y());0!==d.length&&(1<d.length||d[0]!==olympe.dc.Ja.rb?a.L.error(`Notification received for graphdefs subscription registered from peers. Not supported yet ! (id: ${b.Y()})`):a.ka.process(c,b,e=>{e&&a.L.error(`An error occurred during the process of a graphNotification ${b.Y()}`)}))}
586
- function Of(a,b,c=olympe.dc.Ja.rb){const d=Sf(a.ta,b.Y());1<d.length||d[0]!==olympe.dc.Ja.rb?a.L.error(`Listdefs registered from peers is not supported yet ! (id: ${b.Y()})`):a.Da.process(c,b,e=>{e&&a.L.error(`An error occurred during the process of a listNotification ${b.Y()}`)})}
587
- function Pf(a,b,c){a.L.debug('Source event',b,'received for source',c);if(b===olympe.dc.xk.cq){const d=(e,f)=>{f&&a.L.error(`Error after trying to resubscribe to ${e}: ${f}`)};Tf(a.ta,c).forEach(e=>{Pe(a.F,e.Y(),d.bind(a,e.Y()));a.L.debug(`resubscribing graph subscription ${e.Y()} to destination : ${c}`);e=M(new olympe.dc.ga(olympe.dc.ga.ja.Bi,e,[c]),d.bind(a,e.Y()));a.C.send(e)});Uf(a.ta,c).forEach(e=>{a.L.debug(`resubscribing list subscription ${e.Y()} to destination : ${c}`);e=M(new olympe.dc.ga(olympe.dc.ga.ja.Pu,
588
- e,[c]),d.bind(a,e.Y()));a.C.send(e)})}}olympe.dc.query.Au=class{constructor(a,b,c,d,e,f,g,h){this.L=a;this.N=b;this.C=c;this.aa=d;this.ta=e;this.F=f;this.G=new olympe.D.Wb('Query Manager context');this.Sa=g[0];this.Z=g[1];this.ra=g[2];this.ka=g[3];this.Da=g[4];this.V=h;Lf(this)}Xa(){return this.L}};olympe.dc.query.Relation=class extends olympe.dc.ta.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.R())+', ';a+='"direction": '+JSON.stringify(this.Oa())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static kc(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){return new olympe.dc.query.Relation(a.R(),a.Oa(),a instanceof olympe.dc.X.Dc)}Pc(){const a=
589
- olympe.dc.za.DESTINATION,b=olympe.dc.za.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.Subscription=class a extends olympe.D.Fj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Wb('context subscription '+b,e));this.id=b;this.Pf=c;this.X=d||null;this.G=this.V.run(()=>olympe.D.ge(olympe.dc.query.Subscription.C.INIT));this.He=!1;this.ka=this.Ve=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].ia(d);else e+='|null';e=olympe.W.mb(e)}catch(f){e=olympe.W.lc()}return e}Y(){return this.id}Od(){return this.Pf}Dg(){return this.X}qe(){const b=
590
- olympe.dc.Na(),c=olympe.D.Ya(this.Od());return c?b.Vf(c)?b.source(c)||olympe.dc.Ja.Vc:olympe.dc.Ja.rb:olympe.dc.Ja.Vc}wh(){const b=this.G.Ma.Ib;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.Rq}ji(){if(this.G.Ma.yb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.Ve;this.Ve=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);pb(this.G,olympe.D.ge(olympe.dc.query.Subscription.C.Rq))}Qf(){return olympe.D.Fa([this.G],()=>{},olympe.D.qa)}Z(){const b=
591
- this.G.Ma.Ib;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.yq}Ke(b,c){this.Z()?b(this):(null===this.ka&&(this.ka=new Map),void 0===c&&(c=olympe.W.lc()),this.ka.set(c,olympe.D.Ia().Cb(b)));return c||''}rj(b){null!==this.ka&&b&&this.ka.delete(b)}ce(){const b=olympe.dc.query.Subscription.C.yq;if(!this.G.Ma.yb()&&olympe.D.Ya(this.G)!==b&&(this.yf(),pb(this.G,b),null!==this.ka)){for(const c of this.ka.values())c(this);this.ka=null}}onDestroy(b){this.V.onDestroy(b)}release(){this.V.destroy()}cc(b){if(!this.G.Ma.yb()){for(let c=
592
- 0,d=b.length;c<d;c++)this.Hm(b[c],c);if(this.Z())this.yf();else{this.He=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.ce()}}}Nd(b){const c=this.F;for(let d in c)Object.prototype.hasOwnProperty.call(c,d)&&b(c[d],d)}zc(b,c){if(!this.G.Ma.yb()&&(this.Jk(b,olympe.dc.CloudObject.get(c)),b=this.Z(),this.He&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,
593
- d)){b=!1;break}b&&this.ce()}}Xc(b){this.G.Ma.yb()||(this.Gm(b),this.Ui(b,!this.Z()))}Vg(){return this.Z()?super.Vg():'Subscription is not ready!'}Wf(){const b=olympe.D.Ya(this.Od());return olympe.dc.query.Subscription.F(b,this.Dg())}static F(b,c){var d=new olympe.dc.jf(b,olympe.dc.Ed.SUBSCRIBE);if(null===c)return[d];b=[];b.push(d);for(let e=0,f=c.length;e<f;e++){const g=c[e];if(g instanceof olympe.dc.X.Qb||g instanceof olympe.dc.X.Dc)b.forEach(h=>{const k=olympe.dc.query.Relation.from(g);h.sb(k,k.recursive)});
594
- else if(g instanceof olympe.dc.X.uf)d=a.F(olympe.D.Ya(g.Od()),g.Dg()),b.push(...d);else if(g instanceof olympe.dc.X.rc||g instanceof olympe.dc.X.Kd){const h=g.F();b.forEach(k=>{for(const l of h){for(const n of l)k.sb(n,n.recursive);re(k,l.length)}})}}return b}};olympe.dc.query.Subscription.C={INIT:0,Rq:1,yq:2};olympe.dc.query.Subscription.prototype.Vg.K=olympe.D.J.C;function Jf(a,b){return a.F.has(b)?a.F.get(b).F():null}function Kf(a,b,c){return Vf(a,a.F,b,c)}function If(a,b){for(const [c,d]of a.N)if(d.has(b))return c;return null}function Ff(a,b){return a.C.has(b)?a.C.get(b).F():null}function Gf(a,b,c,d){const e=b.Y();let f=a.C.get(e);void 0===f&&(f=new olympe.dc.query.ta.qt(b,a.Z,a),a.C.set(e,f));f.N(c);Wf(a,e,d)}function Hf(a,b,c){return Vf(a,a.C,b,c)}function Rf(a,b){return(a=a.C.get(b))?Array.from(a.C.keys()):[]}
595
- function Sf(a,b){return(a=a.F.get(b))?Array.from(a.C.keys()):[]}function Tf(a,b){const c=new Set;(a.N.get(b)||new Set).forEach(d=>{(d=a.C.get(d))&&c.add(d.F())});return c}function Uf(a,b){const c=new Set;(a.N.get(b)||new Set).forEach(d=>{(d=a.F.get(d))&&c.add(d.F())});return c}function Xf(a,b,c){a=a.F.get(b);if(void 0===a)throw Error(`Check if the subscription ${b} has been processed, but it has never been registered`);b=a.G.get(c);a.G.set(c,!0);return b||!1}
596
- function Wf(a,b,c){let d=a.N.get(c);d?d.add(b):(d=(new Set).add(b),a.N.set(c,d))}function Yf(a,b,c){var d=olympe.dc.Ja.rb;const e=b.Y();let f=a.F.get(e);void 0===f&&(f=new olympe.dc.query.ta.cu(b,a.Z),a.F.set(e,f));f.N(c);Wf(a,e,d)}function Vf(a,b,c,d){if(!b.has(c))return!1;const e=b.get(c);var f=e.C.get(d)-1;0===f?(e.C.delete(d),e.G.delete(d),f=0===e.C.size):(e.C.set(d,f),f=!1);return f?((d=If(a,c))&&a.N.get(d).delete(c),e.F().release(),b.delete(c),!0):0===e.C.get(d)}
597
- function Zf(a,b){const c=b.Y();let d=a.G.get(c);d||(d=new olympe.dc.query.ta.Bu(b),a.G.set(c,d));d.counter++;return d}function $f(a,b){(a=a.G.get(b))&&a.update()}function ag(a,b,c){const d=a.C.get(b);d?c instanceof olympe.dc.query.Subscription?bg(d,c):cg(d,c):a.L.error(`Try to set the subscription ${c.Y()} as covered by a graphquery that is not registered (${b}).`)}
598
- olympe.dc.query.Wu=class{constructor(a,b){this.L=a;this.C=new Map;this.F=new Map;this.G=new Map;this.V=new Set;this.N=new Map;this.Z=b}};olympe.dc.Wc=class{ma(){}Yb(){}getTransform(){}ia(){}toString(){}};olympe.dc.tq=class{F(){}};olympe.dc.wf=class{ma(){}getValue(){}C(){}ia(){}toString(){}};olympe.dc.query.O={Ea:'olympe.dc.query.Logger',va:'olympe.dc.query.QueryManager'};olympe.dc.query.Mb={Se:'olympe.dc.query.SubscriptionRegistry',Kj:'olympe.dc.query.CallbackRegistry',cp:'olympe.dc.query.GraphProcessor',bp:'olympe.dc.query.GraphNotificationProcessor',ep:'olympe.dc.query.GraphResultProcessor',Gp:'olympe.dc.query.ListProcessor',ek:'olympe.dc.query.ListNotificationProcessor',vq:'olympe.dc.query.QueryProcessor',yl:'olympe.dc.query.CoverageProcessor'};olympe.dc.query.Config={Sq:'subscription.debug'};
599
- olympe.T.config(function(a){E(a,olympe.dc.query.Config.Sq,!1);C(a,olympe.dc.query.O.Ea,[olympe.pa.O.va],b=>b.Nc('dc.query'));B(a,olympe.dc.query.Mb.Se,olympe.dc.query.Wu,olympe.dc.query.O.Ea,new olympe.T.fa(olympe.dc.query.Config.Sq));B(a,olympe.dc.query.Mb.Kj,olympe.dc.query.Ns,olympe.dc.query.O.Ea);B(a,olympe.dc.query.Mb.Gp,olympe.dc.query.Ub.Op,olympe.dc.query.O.Ea,olympe.dc.O.wi,olympe.dc.query.Mb.Se,olympe.dc.query.Mb.yl,olympe.dc.transaction.O.va,new olympe.T.fa(olympe.dc.Config.$g));B(a,olympe.dc.query.Mb.cp,
600
- olympe.dc.query.Ub.jp,olympe.dc.query.O.Ea,olympe.dc.query.Mb.Se,new olympe.T.fa(olympe.dc.Config.$g));B(a,olympe.dc.query.Mb.ep,olympe.dc.query.Ub.kp,olympe.dc.query.O.Ea,olympe.dc.query.Mb.Se,olympe.dc.query.Mb.Kj);B(a,olympe.dc.query.Mb.bp,olympe.dc.query.Ub.ip,olympe.dc.query.O.Ea,olympe.dc.query.Mb.Se);B(a,olympe.dc.query.Mb.ek,olympe.dc.query.Ub.Np,olympe.dc.query.O.Ea,olympe.dc.O.wi,olympe.dc.query.Mb.Se);B(a,olympe.dc.query.Mb.vq,olympe.dc.query.Ub.Cu,olympe.dc.query.O.Ea,olympe.dc.query.Mb.Se,
601
- olympe.dc.query.Mb.yl,olympe.dc.query.Mb.Kj,olympe.dc.O.me,olympe.dc.db.O.va);B(a,olympe.dc.query.Mb.yl,olympe.dc.query.Ub.Qs,olympe.dc.query.O.Ea,olympe.dc.query.Mb.Se,olympe.dc.transaction.O.va);C(a,olympe.dc.query.O.va,[olympe.dc.query.O.Ea,new olympe.T.fa(olympe.dc.Config.$g),olympe.dc.O.me,olympe.dc.db.O.va,olympe.dc.query.Mb.Se,olympe.dc.query.Mb.Kj,olympe.dc.query.Mb.Gp,olympe.dc.query.Mb.cp,olympe.dc.query.Mb.ep,olympe.dc.query.Mb.bp,olympe.dc.query.Mb.ek,olympe.dc.query.Mb.vq],(b,c,d,e,f,
602
- g,h,k,l,n,p,q)=>new olympe.dc.query.Au(b,c,d,e,f,g,[h,k,l,n,p],q))});olympe.T.run([olympe.dc.query.Mb.Se],a=>{olympe.hj().subscriptions=a});olympe.dc.query.ta={};function dg(){const a=Error.stackTraceLimit;Error.stackTraceLimit=16;let b=Error().stack||'';b=b.split('\n').map(d=>d.trim());var c='Error'===b[0]?2:1;b=b.slice(c,Error.stackTraceLimit+c).reverse();c=[];for(const d of b)if(c.push(' '+d),d.includes('at ListDef.')||d.includes('at GraphDef.'))break;Error.stackTraceLimit=a;3<c.length&&(c=c.slice(c.length-3));return c.join('\n')||b.join('\n')}
603
- olympe.dc.query.ta.ar=class{constructor(a,b){this.C=new Map;this.G=new Map;this.V=a;this.ka=b}F(){}N(a){var b=this.C.get(a);this.C.set(a,void 0!==b?b+1:1);b=this.G.get(a);this.G.set(a,void 0!==b?b:!1)}};function bg(a,b){const c=b.Y();a.Z.set(c,b);olympe.D.Ia().onDestroy(()=>{a.Z.delete(c)})}function cg(a,b){const c=b.Y();a.aa.set(c,b);olympe.D.Ia().onDestroy(()=>{a.aa.delete(c)})}olympe.dc.query.ta.qt=class extends olympe.dc.query.ta.ar{constructor(a,b,c){super(a,b);this.ta=c;this.Z=new Map;this.aa=new Map;b&&dg()}F(){return this.V}};olympe.dc.query.ta.cu=class extends olympe.dc.query.ta.ar{constructor(a,b){super(a,b);this.Z=new Map}F(){return this.V}N(a){super.N(a);if(this.ka){const b='md_'+olympe.W.lc();this.Z.set(b,dg());olympe.D.Ia().onDestroy(()=>{this.Z.delete(b)})}}};olympe.dc.query.ta.Bu=class{constructor(a){this.query=a;this.F=olympe.dc.Ad();this.id=a.Y();this.C=olympe.D.Kc(olympe.dc.Va);this.G=null;this.counter=0}update(){const a=olympe.D.Ya(this.C)||olympe.dc.Va.empty(),b=olympe.dc.Va.from(a,this.G);this.G.N=!1;b!==a&&(Pc(this.F,null,ze(b)),this.C.update(b))}destroy(){const a=olympe.D.Ya(this.C)||olympe.dc.Va.empty();Pc(this.F,null,ye(a))}};olympe.dc.query.Ub={};function eg(a,b,c,d,e){a.L.debug('CoverageProcessor: [ID:',d,'] - checking coverage of remote query over',b.length,'paths.');const f=new olympe.async.qg(olympe.D.Ia()),g=k=>{f.add((l,n)=>{k.hb(p=>{p?n(`The query ${d} is not covered by an existing graphdef, `+`and the specific graphdef id ${k.Y()} has encountered an error: ${p}`):l()});ag(a.ta,k.Y(),c)})},h=Array.from(Tf(a.ta,olympe.dc.Ja.Vc));b.forEach(k=>{const l=cf(k);let n=!1;for(let p=0,q=h.length;p<q;p++){const r=h[p];if(r.Ir(l)){g(r.sh,!1);
604
- n=!0;break}}n?a.L.debug('CoverageProcessor: [ID:',d,'] - graphPath',k,' is covered'):g(k,!0)});Wb(f,(k,l)=>e(l));f.start()}function fg(a,b,c){const d=[b.Od()],e=g=>g instanceof olympe.dc.X.uf,f=(b.Dg()||[]).filter(e);for(const g of f)d.push(g.Od()),f.push(...(g.Dg()||[]).filter(e));ke(a.C,()=>{olympe.D.wc(d,()=>{const g=b.Wf();eg(a,g,b,b.Y(),c)})})}function gg(a,b,c,d){const e=b.Y(),f=[qe(b,c)];ke(a.C,()=>eg(a,f,b,e,d))}olympe.dc.query.Ub.Qs=class{constructor(a,b,c){this.L=a;this.ta=b;this.C=c}};olympe.dc.query.Ub.ip=class{constructor(a,b){this.L=a;this.ta=b}process(a,b,c){const d=b.Y();this.ta.C.has(d)?(Ff(this.ta,d).ra(b),olympe.dc.Ad().bf(b.data,a),c(null,b)):c(Error(`Received a notification for the graphdef ${d} which does not exist.`),b)}};olympe.dc.query.Ub.ip.la=[olympe.dc.rg];olympe.dc.query.Ub.jp=class{constructor(a,b,c){this.L=a;this.ta=b;this.C=c}process(a,b,c){var d=b.Y();if(a===olympe.dc.Ja.rb||this.ta.C.has(d)){if(c(null,b),a=Ff(this.ta,d),this.C||a&&a.N)a=olympe.dc.Ja.rb,d=new olympe.dc.query.Di(d,a,a,new olympe.dc.db.xc),Mf(olympe.dc.Lf(),d)}else c(Error('The local Graph Engine is not implemented yet. It should handle Graphdefs addressed to instances owned by this local OVM'),b)}};olympe.dc.query.Ub.jp.la=[olympe.dc.rg];olympe.dc.query.Ub.kp=class{constructor(a,b,c){this.L=a;this.C=b;this.F=c}process(a,b,c){const d=b.Y();if(this.C.C.has(d)){const f=Ff(this.C,d);if(b instanceof olympe.dc.query.aj.Yj)Hf(this.C,d,a);else if(!f.N){f.ka(b);const g=olympe.dc.Ad();Pc(g,f.Z());g.bf(b.Bc,b.destination);f.onDestroy(()=>{Pc(g,null,f.Z())});mf(f)}}let e;b instanceof olympe.dc.query.aj.Yj&&(e=`graph subscription "${d}" failed to create the initial result: ${b.aa()}`,this.L.error(e));Se(this.F,b.Y(),b);c(e?Error(e):null,b)}};
605
- olympe.dc.query.Ub.kp.la=[olympe.dc.rg];const hg=[],ig=new Map;function jg(a,b,c,d){uc(a.db,d,e=>{e?b.Fg(c)?a.L.warn('Adding the same index twice (should never happen) for sub #'+b.Y()+', index #'+c+', tag #'+d):b.zc(c,d):kg(a,b,c,d)},c)}function kg(a,b,c,d){vc(a.db,d,c,!0);b.Xc(c);hg.length=0;b.Nd(function(e,f){hg[e]=f});c=a=0;for(d=hg.length;a<d;a++)'string'===typeof hg[a]&&(hg[c++]=hg[a]);hg.length=c;b.cc(hg)}
606
- olympe.dc.query.Ub.Np=class{constructor(a,b,c){this.L=a;this.db=b;this.ta=c}process(a,b,c){const d=b.Y();a=b.C;const e=Jf(this.ta,d);if(null===e)c(Error(`Received list notification for undefined subscription "${d}"`),b);else{hg.length=a.length;e.Nd((f,g)=>{if(f=e.mh(g)){f=f.R();var h=ig.get(f);void 0===h?ig.set(f,g):'string'===typeof h?ig.set(f,[h,g]):h.push(g)}else this.L.warn('Subscription #'+d+' has a rank for index #'+g+' but no instance. This is caused by receiving a new list notification before receiving all instances of the previous list notification.')});
607
- for(let f=0,g=a.length;f<g;f++){const h=a[f];let k=ig.get(h);void 0===k?(k=olympe.W.lc(),jg(this,e,k,h)):'string'===typeof k?ig.delete(h):(k=k.pop(),0===k.length&&ig.delete(h));hg[f]=k}for(const [f,g]of ig){if('string'===typeof g)kg(this,e,g,f);else for(let h=0,k=g.length;h<k;h++)kg(this,e,g[h],f);ig.delete(f)}e.cc(hg);c(null,b)}}};olympe.dc.query.Ub.Np.la=[olympe.dc.rg];function lg(a,b,c,d){const e=c.Y();a.L.debug('ListProcessor: [ID:',e,'] - processing with source ',b);Yf(a.ta,c,b);if(Xf(a.ta,e,olympe.dc.Ja.rb))a.L.debug('ListProcessor: [ID:',e,'] - id already processed');else{a.L.debug('ListProcessor: [ID:',e,'] - NOT processed yet.');const f=c.qe();a.F||f===olympe.dc.Ja.rb?(a.L.debug('QueryMGR: [ID:',e,'] - Local subscription, no need for coverage check, booting subscription '),mg(a,c)):c.Hh().run(()=>{fg(a.C,c,g=>{g?a.L.error(g):mg(a,c)})})}b===olympe.dc.Ja.rb||
608
- Xf(a.ta,e,b)||a.notify(b,c);d(null,c)}
609
- function mg(a,b){if(b.Z())a.L.debug('ListProcessor: [ID:',b.Y(),'] - Subscription already booted, ignoring');else{a.L.debug('ListProcessor: [ID:',b.Y(),'] - Booting subscription');var c=new olympe.dc.oc.$q(a.db,a.L),d=ng(a,b,c),e=b.Y();b.Hh().run(()=>{olympe.D.wc([b.Od()],f=>{const g=olympe.dc.xa(f);a.L.debug('ListProcessor: [ID:',b.Y(),'] - Booting with baseTag',g);b.wh()||b.ji();uc(a.db,g,h=>d(h,g),e);olympe.D.Ia().vc(()=>vc(a.db,g,e));a.db.Gb(g.valueOf())||og(c);b.Z()||(og(c),b.cc([]))})})}}
610
- function ng(a,b,c){const d=new olympe.dc.oc.Ij;let e=!1;const f=b.Hh(),g=b.Dg(),h=[];h[g?g.length:0]=f.Cb((k,l,n,p)=>{f.gd()||f.yb()||(k?b.Fg(n)?a.L.warn('Adding the same index twice (should never happen) for sub #',b.Y(),', index #',n,', tag #',l):(a.L.debug('ListProcessor: [ID:',b.Y(),'] - Adding Instance',l,'to the subscription'),b.zc(n,l)):(a.L.debug('ListProcessor: [ID:',b.Y(),'] - Removing Instance',l,'from the subscription'),b.Xc(n)),e||(pg(c,()=>{p.vg();og(c)}),p.Qc().Lg(b.cc.bind(b)),e=!0),
611
- qg(c,n))});if(null!==g){const k=olympe.dc.Qc();for(let l=g.length-1;0<=l;l--)h[l]=f.Cb(g[l].getTransform(k,c,h[l+1]))}return(k,l)=>{const n=b.Y();c.register(n,null);const p=d.C(k,l,n,null);if(null!==p)h[0](k,l,n,rg(p,k,l,n))}}
612
- olympe.dc.query.Ub.Op=class{constructor(a,b,c,d,e,f){this.L=a;this.db=b;this.ta=c;this.C=d;this.F=f}process(a,b,c){lg(this,a,b,c)}notify(a,b){const c=b.Y();this.L.debug(`Register notification of list subscription ${c} for destination ${a}`);const d=()=>{const f=new olympe.dc.query.Mp(c);b.de(g=>f.F(g));Of(olympe.dc.Lf(),f)};let e=!1;b.forEach(()=>{e&&d()});b.Ke(()=>{e=!0;d()})}};olympe.dc.query.Ub.Op.la=[olympe.dc.rg];function Ef(a,b,c){const d=b.Y(),e=b.source,f=a.ta.G.has(d),g=Zf(a.ta,b);return new rxjs.Observable(h=>{c.run(()=>{olympe.D.wc([g.C.Eb()],h.next.bind(h))});const k=()=>{l&&c.Bn(l);{var n=a.ta;const q=n.G.get(d);var p;if(p=q)p=q,0<p.counter?p.counter--:olympe.pa.Xa('dc').warn('Try to decrement counter of query metadata below 0. Investigate...'),p=0===p.counter;p&&(q.destroy(),n.G.delete(d),n.V.delete(d))}},l=c.vc(k);if(!f)if(e===olympe.dc.Ja.Vc)gg(a.N,b,!0,n=>{n?(h.error(n),k()):sg(a,d,b,g,c)});else if(e===
613
- olympe.dc.Ja.rb)sg(a,d,b,g,c);else{const n=M(xc(new olympe.dc.ga(olympe.dc.ga.ja.tm,b,[e]),c),p=>{p&&(h.error(p.message),k())});a.G.send(n)}return k})}
614
- function tg(a){const b=olympe.dc.ga.ja.sm,c=(d,e)=>Be(d,f=>{Pc(a.F,Array.from(f.ee()).filter(g=>g.se()).map(g=>g.tag()));a.F.bf(f,e)},e);a.G.C(olympe.dc.ga.ja.QUERY_RESULT,(d,{i:e,r:f,s:g})=>{d=c(f,g);null===d?(d=a.C,Re(d,e,`Error while deserialization of QueryResult for query ${e}`,d.G,`Query result of query ${e} has no associated handler in the datacloud`)):(f=a.C,Re(f,e,d,f.G,`Query result of query ${e} has no associated handler in the datacloud`))});a.G.C(b,(d,{i:e,r:f,s:g})=>{if(d=c(f,g))if(e=
615
- a.ta.G.get(e))f=olympe.D.Ya(e.C),f&&f.hash===d.hash||(Pc(e.F,null,ze(d)),e.C.update(d))});Oc(a.F,()=>{var d=a.ta;for(const e of d.V)$f(d,e);d.V.clear()})}
616
- function sg(a,b,c,d,e){const f=new olympe.dc.da.rq(c);Fe(f,()=>{var p=a.ta;p.G.has(b)&&p.V.add(b)});d.G=f;let g=(p,q)=>{p?a.L.debug(`New result tuple for query ${b}, ${q}`):a.L.debug(`Removed result tuple for query ${b}, ${q}`)};d=c.C;const h=d.reduce((p,q)=>{p.push(q.F(p[p.length-1]));return p},[0]);for(let p=d.length-1;0<=p;p--)g=d[p].observe(f,h[p],g);const k=a.F.view,l=c.G,n=uc(k,l,(p,q)=>{p?f.insert(q,0,null):f.remove(q,0,null);g(p,q,null,b)});e.vc(()=>vc(k,l,n));$f(a.ta,b)}
617
- olympe.dc.query.Ub.Cu=class{constructor(a,b,c,d,e,f){this.L=a;this.ta=b;this.N=c;this.C=d;this.G=e;this.F=f;tg(this)}hb(a,b){return new Promise((c,d)=>{var e=a.source;if(e===olympe.dc.Ja.Vc)gg(this.N,a,!1,f=>{f?d(f):c(this.bd(a))});else if(e===olympe.dc.Ja.rb)c(this.bd(a));else{const f=a.Y(),g=this.C.C.has(f),h=l=>{var n=this.C;Qe(n,f,n.G);d(l||`The execution of the query ${f} has been interrupted`)},k=b.vc(h);Te(this.C,f,(l,n)=>{b.Bn(k);l?d(l.message):(b.vc(()=>{Pc(this.F,null,ye(n))}),c(n))});g||
618
- (e=M(xc(new olympe.dc.ga(olympe.dc.ga.ja.rm,a,[e]),b),l=>l&&h(l.message)),this.G.send(e))}})}bd(a){const b=new olympe.dc.da.rq(a);Fe(b,()=>{});b.insert(a.G,0,null);let c=0;for(const d of a.C)d.hb(b,c),c=d.F(c);return olympe.dc.Va.from(olympe.dc.Va.empty(),b)}};olympe.dc.query.aj={};olympe.dc.query.aj.Yj=class extends olympe.dc.query.Di{constructor(a,b,c,d){super(a,b,c,new olympe.dc.db.xc);this.error=d}aa(){return this.error}};olympe.dc.oc={};function rg(a,b,c,d){b?a.V[d]=c:delete a.V[d];null===a.F&&(a.F=new olympe.dc.oc.Pj(a.C,a));return a.F}function ug(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function vg(a,b){a=a.V;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.oc.Pj=class{constructor(a,b){this.C=a;this.parent=b||null;this.aa=b?b.aa+1:0;this.V=Object.create(null);this.F=null}Qc(){return this.C}vg(){this.C.V()?this.C.G():this.C.aa(this.aa-1)}};olympe.dc.oc.sa=class{constructor(){}C(){}V(){}aa(){}G(){}Lg(){}};olympe.dc.oc.Ij=class{constructor(){this.Z=this.N=this.index=this.F=null}V(){return null!==this.F}aa(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.N;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.oc.Pj(this),this.index=c,this.N=b):this.N=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.Z){const a=
619
- [];null!==this.N&&(0<=this.F?vg(ug(this.N,this.F),a):a.push(this.index));this.Z(a)}}Lg(a){this.Z=a}};olympe.dc.oc.Ij.la=[olympe.dc.oc.sa];function wg(a,b){olympe.D.Uf(a.value)?(a.node=olympe.D.fl(a.value,b),Wa(a.node)||b()):b()}function xg(a,b){if(olympe.D.Uf(a.value)){const c=olympe.D.Ia(),d=a.N;olympe.D.wc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>wg(a,b)),olympe.D.Ia().destroy())})}}
620
- class yg extends olympe.dc.oc.Pj{constructor(a,b,c){super(a);this.index=b;this.value=c;this.N=this.Ya();this.position=this.node=null;this.Z=!1;this.G=null}Ya(){const a=olympe.D.Ya(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}yb(){return null===this.value}}
621
- function zg(a,b){if(!b.yb()){var c=a.F;const d=a.Da,e=b.Ya();let f=0,g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].N,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].N,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.N=b.Ya();c!==b.position&&(a.insert(b,c),b.Z&&a.G())}}function Ag(a){const b=a.Da;a.F.sort((c,d)=>b(c.Ya(),d.Ya()))}
622
- olympe.dc.oc.Zq=class{constructor(a){this.Da=a;this.N=null;this.F=[];this.Z=[];this.ka=null;this.ra=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new yg(this,c,d),this.ra.set(b,f),this.V()?wg(f,()=>zg(this,f)):(f.position=e.length,e.push(f));else{f=this.ra.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ra.delete(b);null!==f.position&&(this.V()?this.remove(f):delete e[f.position]);f.destroy()}return f}V(){return null!==this.N}aa(a){if(null!==this.N)throw Error('Manager already activated (depth='+
623
- this.N+')');this.N=a;Ag(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;xg(d,()=>zg(this,d))}this.G()}G(){if(null===this.N)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.Z.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.Z){var b=e,c=this.N;b.Z=!0;b.G=ug(b,c)}0>this.N?this.Z.push(e.index):e.G&&vg(e.G,this.Z)}this.ka&&this.ka(this.Z)}Lg(a){this.ka=a}insert(a,b){const c=this.F;var d=c.length;let e=a.position;null===
624
- e&&(e=d);if(b<e)for(d=e;d>b;d--)c[d]=c[d-1],c[d].position=d;else for(d=e;d<b;d++)c[d]=c[d+1],c[d].position=d;c[b]=a;c[b].position=b}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.oc.Zq.la=[olympe.dc.oc.sa];class Bg extends olympe.dc.oc.Pj{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.ka=this.Z=this.N=!1;this.G=null}}
625
- function Cg(a,b,c,d,e){const f=Object.create(null),g=a.order,h=a.N;let k,l,n;a.ra=!0;l=0;for(n=g.length;l<n;l++)f[g[l]]=null;g.length=0;l=c;for(n=Math.min(b.length,d);l<n;l++)k=b[l],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.N||(c.N=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.N&&(c.N=!1,e(!1,c.tag,c.index,c)),c.Z&&(c.G=null,delete h[k]),delete f[k]);a.ra=!1;null!==a.F&&a.G()}
626
- olympe.dc.oc.am=class{constructor(){this.N={};this.order=[];this.F=null;this.ra=!1;this.Z=[];this.ka=null}V(){return null!==this.F}aa(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.ra){var a=this.order,b=a.length,c=this.N,d;for(d=this.Z.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.Z.push(e.index);else{if(!e.ka){var f=e,g=this.F;f.ka=!0;
627
- f.G=ug(f,g)}null!==e.G&&vg(e.G,this.Z)}}this.ka&&this.ka(this.Z)}}Lg(a){this.ka=a}C(a,b,c){let d=this.N[c];a?void 0===d?(d=new Bg(this,c,b),this.N[c]=d):(d.tag=b,d.Z=!1):void 0!==d&&(d.Z=!0);return d}};olympe.dc.oc.am.la=[olympe.dc.oc.sa];function og(a){if(!a.F){for(let b in a.G)Dg(a.G[b]);a.F=!0}a.N=null;a.V=null}function pg(a,b,c){a.G[c||'root'].N=b}function qg(a,b,c){a.G[c||'root'].vg(b)}function Eg(a,b,c,d){const e=a.V,f=b+d+c;let g=e[f];void 0===g&&(g=Dd(a.db,b,c,d),e[f]=g);return g}function Fg(a,b){a.F||a.C.vg(b)}function Gg(a,b,c,d,e){if(!a.F){let f=Eg(a,c,d,e||olympe.dc.za.DESTINATION);e||(f+=Eg(a,c,d,olympe.dc.za.ORIGIN));0===f&&Fg(a,b)}}
628
- function Hg(a,b){const c=a.G[b];void 0!==c?(a.L&&a.L.debug('Set current block to',b,null!==c.parent?'parent = '+c.parent.Y():''),a.C=c):a.L&&a.L.error('Try to set a block that does not exists:',b)}function Ig(a){const b=String(++a.Z),c=a.C;a.G[b]=new Jg(b,c);Kg(c,b);c.F||(c.F=()=>Hg(a,c.Y()));return b}function Lg(a,b){const c=a.C;a.C.F=()=>{Hg(a,c.Y());b()}}function Mg(a,b){Dg(b?a.G[b]:a.C)}
629
- olympe.dc.oc.$q=class{constructor(a,b){this.db=a;this.L=b||null;this.N=Object.create(null);this.V=Object.create(null);this.F=!1;this.Z=0;this.C=new Jg('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=Eg(this,c,d,e),d=this.N[b]||0,this.N[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function Kg(a,b){null===a.children&&(a.children=Object.create(null));a.children[b]=!1}function Dg(a){a.G=!0;null!==a.parent&&a.parent.notify(a.id)}
630
- class Jg{constructor(a,b){this.id=a;this.parent=b||null;this.C=this.N=this.F=this.children=null;this.G=!1}Y(){return this.id}vg(a){const b=this.N;if(this.G||this.C===a||null===a)b&&b(),!b&&Dg(this)}notify(a){const b=this.F,c=this.children;if(this.G)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.na={};olympe.dc.na.sf=class{ma(){return O(olympe.dc.na.sf)}C(){return[]}getValue(a,b){return b}ia(){return'{"c":"'+this.ma()+'","a":[]}'}toString(){return'Tag()'}};N('olympe.dc.valuedefs.Tag',olympe.dc.na.sf);olympe.dc.na.sf.la=[olympe.dc.wf];olympe.dc.na.Dd=class{constructor(a){this.value=a}ma(){return O(olympe.dc.na.Dd)}C(){return[]}getValue(){return this.value}ia(a){a=Df(a,this.value);return`{"c":"${this.ma()}","a":[${a}]}`}toString(){return`Constant(${Cf(this.value)})`}};N('olympe.dc.valuedefs.Constant',olympe.dc.na.Dd);olympe.dc.na.Dd.la=[olympe.dc.wf];function Ng(a,b,c,d){const e=olympe.dc.Na(),f=new olympe.dc.oc.Ij,g=new olympe.dc.oc.$q(e);let h=!1;const k=Object.create(null),l=r=>{if(0<r.length)for(const t in k)r[0]===t&&d(k[t])};let n=(r,t,u,v)=>{const w=olympe.D.Ia();w.gd()||w.yb()||(h||(pg(g,()=>{v.vg();og(g)}),v.Qc().Lg(l),h=!0),r?k[u]=t:delete k[u],qg(g,u))};const p=olympe.D.Ia();if(null!==c)for(let r=c.length-1;0<=r;r--)n=c[r].getTransform(a,g,p.Cb(n));n=p.Cb(n);const q=olympe.W.lc();uc(e,b,(r,t)=>{g.register(q,null);const u=f.C(r,b,q,
631
- null);n(r,t,q,rg(u,r,b,q))},q);p.onDestroy(()=>{vc(e,b,q)});e.Gb(b)||og(g)}function Og(a,b,c){const d=c.node,e=olympe.dc.Na(),f=a.G(),g=xd(e,b,a.af,d.Cb(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>e.F(b,a.af,g))}
632
- olympe.dc.na.Lc=class{constructor(a,b,c){this.af=a&&a.R?a.R():a;this.X=b&&b.filter(d=>d instanceof olympe.dc.X.Qb||d instanceof olympe.dc.X.Dc)||null;this.F=c||null;this.defaultValue=null}ma(){}Yb(){}G(){}C(){return(this.X||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}df(a){this.defaultValue=a;return this}Dg(){return this.X}Od(){return this.F}getValue(a,b){const c=olympe.D.Kc(this.Yb()||Object,'AbstractProperty valueType');null!==this.defaultValue&&qb(c,this.defaultValue);b=this.F||
633
- b;null!==this.X?Ng(a,b,this.X,d=>{Og(this,d,c)}):Og(this,b,c);return c.Eb()}ia(a){const b=Df(a,this.af),c=Df(a,this.F);let d='null';this.X&&(d=this.X.map(function(e){return e.ia(a)}).join(','));return`{"c":"${this.ma()}","a":["${b}",${d},${c}]}`}toString(){const a=Cf(this.af),b=this.F?','+Cf(this.F):'';let c='';this.X&&(c=','+this.X.join(','));return this.ma().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.na.Lc.la=[olympe.dc.wf];olympe.dc.na.ke=class extends olympe.dc.na.Lc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.ke)}G(){return olympe.dc.W.Sb.Qm}Yb(){return olympe.D.ea}};N('olympe.dc.valuedefs.NumberProperty',olympe.dc.na.ke);olympe.dc.na.oe=class extends olympe.dc.na.Lc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.oe)}G(){return olympe.dc.W.Sb.Rm}Yb(){return olympe.D.Wa}};N('olympe.dc.valuedefs.StringProperty',olympe.dc.na.oe);olympe.dc.na.ue=class extends olympe.dc.na.Lc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.ue)}G(){return olympe.dc.W.Sb.Om}Yb(){return olympe.D.qa}};N('olympe.dc.valuedefs.BooleanProperty',olympe.dc.na.ue);olympe.dc.na.je=class extends olympe.dc.na.Lc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.je)}G(){return olympe.dc.W.Sb.Pm}Yb(){return olympe.D.jb}};N('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.na.je);olympe.dc.na.Un=class{constructor(a,b){if(olympe.D.Uf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.R();var d=olympe.dc.Na();const e=d.fc(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.Nf(e,olympe.dc.CloudObject.extendRel,olympe.dm.qf);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.P.R():d=new olympe.dc.na.oe(c,b);break;case olympe.dm.Number.P.R():d=new olympe.dc.na.ke(c,
634
- b);break;case olympe.dm.Boolean.P.R():d=new olympe.dc.na.ue(c,b);break;case olympe.dm.DateTime.P.R():d=new olympe.dc.na.je(c,b)}this.F=d}ma(){return this.F.ma()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ia(a){return this.F.ia(a)}toString(){return this.F.toString()}};olympe.dc.na.Un.la=[olympe.dc.wf];olympe.dc.Db={};olympe.dc.Db.Number=class{constructor(a){this.C=a}ma(){return O(olympe.dc.Db.Number)}V(){return this.C.C()}N(a,b){return this.C.getValue(a,b)}G(a,b){return a!==b?a>b?1:-1:0}ia(a){return`{"c":"${this.ma()}",a:[${this.C.ia(a)}]}`}toString(){return`Number(${this.C.toString()})`}};N('olympe.dc.comparators.Number',olympe.dc.Db.Number);olympe.dc.Db.Number.la=[olympe.dc.Ne];olympe.dc.Db.String=class{constructor(a){this.C=a}ma(){return O(olympe.dc.Db.String)}V(){return this.C.C()}N(a,b){return olympe.D.Fa([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Wa)}G(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ia(a){return`{"c":"${this.ma()}",a:[${this.C.ia(a)}]}`}toString(){return`String(${this.C.toString()})`}};N('olympe.dc.comparators.String',olympe.dc.Db.String);olympe.dc.Db.String.la=[olympe.dc.Ne];olympe.dc.Db.DateTime=class{constructor(a){this.C=a}ma(){return O(olympe.dc.Db.DateTime)}V(){return this.C.C()}N(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}ia(a){return'{"c":"'+this.ma()+'",a:['+this.C.ia(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};N('olympe.dc.comparators.DateTime',olympe.dc.Db.DateTime);olympe.dc.Db.DateTime.la=[olympe.dc.Ne];let Pg=0;olympe.dc.Db.Og=class{constructor(){this.id=Pg++}ma(){return'CustomLocalComparator#'+Pg}V(){return[]}N(){throw Error('GetComparedValue function was not implemented.');}G(){throw Error('Compare function was not implemented.');}ia(){return`{"c":"${this.ma()}"}`}toString(){return this.ma()+'()'}};olympe.dc.Db.Og.la=[olympe.dc.Ne];olympe.dc.U={};olympe.dc.U.kd=class{constructor(a){this.G=a}ma(){return O(olympe.dc.U.kd)}F(){return this.G.F()}C(a,b){return olympe.D.fl(this.G.C(a,b),c=>!c.valueOf())}ia(a){return`{"c":"${this.ma()}","a":[${this.G.ia(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};N('olympe.dc.predicates.Not',olympe.dc.U.kd);olympe.dc.U.kd.la=[olympe.dc.$a];olympe.dc.U.Vd=class{constructor(a){this.U=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.U=this.U.concat(arguments[c]):this.U.push(arguments[c])}ma(){return O(olympe.dc.U.Vd)}F(){return this.U.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return olympe.D.ef(this.U.map(c=>c.C(a,b)),function(){for(let c=arguments.length,d=0;d<c;d++)if(!arguments[d].valueOf())return!1;return!0})}ia(a){const b=this.U.map(c=>c.ia(a));return'{"c":"'+this.ma()+'","a":['+b.join(',')+']}'}toString(){return'And('+
635
- this.U.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.And',olympe.dc.U.Vd);olympe.dc.U.Vd.la=[olympe.dc.$a];olympe.dc.U.be=class{constructor(a){this.U=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.U=this.U.concat(arguments[c]):this.U.push(arguments[c])}ma(){return O(olympe.dc.U.be)}F(){return this.U.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return olympe.D.ef(this.U.map(c=>c.C(a,b)),function(){for(let c=arguments.length,d=0;d<c;d++)if(arguments[d].valueOf())return!0;return!1})}ia(a){const b=this.U.map(c=>c.ia(a));return'{"c":"'+this.ma()+'","a":['+b.join(',')+']}'}toString(){return'Or('+
636
- this.U.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.Or',olympe.dc.U.be);olympe.dc.U.be.la=[olympe.dc.$a];olympe.dc.U.pl=class{constructor(a,b){this.G=a;this.N=b}ma(){}F(){return[this.G.C(),this.N.C()]}C(a,b){return olympe.D.Fa([this.G.getValue(a,b),this.N.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return this.V('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d))},Boolean)}V(){}ia(a){return'{"c":"'+this.ma()+'","a":['+this.G.ia(a)+','+this.N.ia(a)+']}'}toString(){return this.ma().replace(/^.+\./,'')+'('+this.G.toString()+','+this.N.toString()+')'}};olympe.dc.U.pl.la=[olympe.dc.$a];olympe.dc.U.Gc=class{constructor(a,b){this.G=a;this.N=b}ma(){return O(olympe.dc.U.Gc)}F(){return[this.G.C(),this.N.C()]}C(a,b){return olympe.D.Fa([this.G.getValue(a,b),this.N.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Td?c.Td(d):'object'===typeof d&&void 0!==d.Td?d.Td(c):olympe.D.Ac(c.valueOf()===d.valueOf()),olympe.D.qa,'Test equal predicate')}ia(a){return'{"c":"'+this.ma()+'","a":['+this.G.ia(a)+','+this.N.ia(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.N.toString()+
637
- ')'}};N('olympe.dc.predicates.Equals',olympe.dc.U.Gc);olympe.dc.U.Gc.la=[olympe.dc.$a];olympe.dc.U.ct=class extends olympe.dc.U.Gc{constructor(a,b){super(a,new olympe.dc.na.Dd(b))}};olympe.dc.U.ct.la=[olympe.dc.$a];olympe.dc.U.ye=class extends olympe.dc.U.pl{constructor(a,b){super(a,b)}ma(){return O(olympe.dc.U.ye)}V(a,b){return a>b}};N('olympe.dc.predicates.Greater',olympe.dc.U.ye);olympe.dc.U.Fe=class extends olympe.dc.U.pl{constructor(a,b){super(a,b)}ma(){return O(olympe.dc.U.Fe)}V(a,b){return a<b}};N('olympe.dc.predicates.Smaller',olympe.dc.U.Fe);olympe.dc.U.Sc=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}ma(){return O(olympe.dc.U.Sc)}F(){return[this.source.C(),this.value.C()]}getValue(){return this.value}C(a,b){return olympe.D.Fa([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.Ac(c.includes(d))},olympe.D.qa)}ia(a){const b=this.source.ia(a),c=this.value.ia(a);a=Df(a,this.G);return'{"c":"'+this.ma()+'","a":['+
638
- b+','+c+','+a+']}'}toString(){const a=Cf(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};N('olympe.dc.predicates.Contains',olympe.dc.U.Sc);olympe.dc.U.Sc.la=[olympe.dc.$a];olympe.dc.U.xd=class{constructor(a,b,c){this.source=a;this.N=b;this.G=void 0===c?!0:c}ma(){return O(olympe.dc.U.xd)}F(){return[this.source.C()]}C(a,b){return olympe.D.ef([this.source.getValue(a,b),this.N,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return(new RegExp(d)).test(c)})}ia(a){const b=this.source.ia(a),c=Df(a,this.N);a=Df(a,this.G);return'{"c":"'+this.ma()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Cf(this.G);return'Regex('+this.source.toString()+
639
- ','+this.N+','+a+')'}};N('olympe.dc.predicates.Regex',olympe.dc.U.xd);olympe.dc.U.xd.la=[olympe.dc.$a];olympe.dc.U.lf=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.xa(b))}):this.G.add(olympe.dc.xa(a))}ma(){return O(olympe.dc.U.lf)}F(){return[]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Na();let e=[];const f=()=>{e.forEach(h=>{d.C(h.tag,h.C,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.xa(olympe.dc.CloudObject))K(c,this.G.has(k)),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);this.G.has(k)?
640
- (K(c,!0),f()):(h=new Qg(k,olympe.dc.CloudObject.extendRel),e.push(h),V(d,h.tag,h.C,g,h.id))}};a=new Qg(b,olympe.dc.CloudObject.modelRel);e.push(a);V(d,a.tag,a.C,g,a.id);c.onDestroy(f);Wa(c)||K(c,!1);return c}ia(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class Qg{constructor(a,b){this.tag=a;this.C=b;this.id=olympe.W.Ag()}}N('olympe.dc.predicates.InstanceOf',olympe.dc.U.lf);olympe.dc.U.lf.la=[olympe.dc.$a];function Rg(a){return a.Ka.map(b=>b.R())}function Sg(a){return a.Ka.map(b=>b.Oa())}
641
- olympe.dc.U.kf=class{constructor(a,b,c){this.Ka=[];this.G=c instanceof Array?c:void 0!==c?[olympe.dc.xa(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.X.Dc?this.Ka.push(new Tg(c.R(),c.Oa(),c.F,c.C)):this.Ka.push(new Tg(olympe.dc.xa(c),b[d],1,1))}ma(){return O(olympe.dc.U.kf)}F(){return[this.Ka.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.W.lc(),e=olympe.dc.Na();let f=0;a=(h,k)=>{0!==this.G.length&&!this.G.includes(k)||
642
- c.yb()||(f+=h?1:-1,K(c,0<f))};const g=this.Ka;for(let h=g.length-1;0<=h;h--)a=Ug(g[h],e,a,d+h);uc(e,b,a,d);olympe.D.Ia().onDestroy(()=>{vc(e,b,d)});c.df(!1);return c}ia(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(this.Ka.map(a=>a.ia()))+(0!==this.G.length?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.G.length?'#'+this.G.toString()+', ':'')+this.Ka.map(a=>a.ia())+')'}};N('olympe.dc.predicates.HasRelated',olympe.dc.U.kf);
643
- function Ug(a,b,c,d){const e=Object.create(null);d+=olympe.W.Ag();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var l=d+k;g?e[h]||(e[h]=!0,V(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.C(h,a,l))}};return(g,h)=>f(g,h,0)}class Tg extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ia(){return`${this.R()}, ${this.Oa()}, ${this.F}, ${this.C}`}}olympe.dc.U.kf.la=[olympe.dc.$a];olympe.dc.U.wl=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return olympe.D.ef([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return(Number(c)&Number(d.valueOf()))===Number(c)})}ma(){return O(olympe.dc.U.wl)}F(){return[this.value.C()]}ia(a){const b=olympe.D.lb(this.G)?this.G.Ma.Ib.valueOf():this.G.valueOf();return'{"c":"'+this.ma()+'","a":['+b+','+this.value.ia(a)+']}'}toString(){const a=olympe.D.lb(this.G)?this.G.Ma.Ib.valueOf():this.G.valueOf();return this.ma().replace(/^.+\./,'')+
644
- '('+a.toString()+','+this.value.toString()+')'}};N('olympe.dc.predicates.BitMask',olympe.dc.U.wl);olympe.dc.U.wl.la=[olympe.dc.$a];let Vg=0;olympe.dc.U.Og=class{constructor(){this.id=Vg++}ma(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ia(){return`{"c":"${this.ma()}"}`}toString(){return this.ma()+'()'}};olympe.dc.U.Og.la=[olympe.dc.$a];olympe.dc.U.Pl=class{constructor(a,b,c){this.Ka=[];this.G=void 0!==c?c.map(olympe.dc.xa):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.X.Dc?this.Ka.push(new Wg(c.R(),c.Oa(),c.F,c.C)):this.Ka.push(new Wg(olympe.dc.xa(c),b[d],1,1))}ma(){return O(olympe.dc.U.Pl)}F(){return[this.Ka.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Na(),e=olympe.W.Ag();a=(h,k,l)=>{k&&(null===this.G||this.G.includes(l))&&h(1)};const f=this.Ka;
645
- for(let h=f.length-1;0<=h;h--)a=f[h].getTransform(d,a,e+h);let g=0;uc(d,b,a.bind(null,h=>{c.gd()||c.yb()||(g+=h,K(c,0<g))}),e);olympe.D.Ia().onDestroy(()=>vc(d,b,e));c.df(!1);return c}ia(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(this.Ka.map(a=>a.ia()))+(null!==this.G?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.G?'#['+this.G.toString()+'], ':'')+this.Ka.map(a=>a.ia())+')'}};N('olympe.dc.predicates.HasRelatedTree',olympe.dc.U.Pl);
646
- class Wg extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.N=new Map;this.G=new Map}getTransform(a,b,c){const d=this.G,e=this.N,f=new Set,g=(k,l,n)=>{e.has(l)?e.get(l).set(c+n,k):e.set(l,(new Map).set(c+n,k))},h=(k,l,n,p,q)=>{const r=olympe.W.Ag();if(p){const t=n+q,u=v=>{const w=e.get(q);if(f.has(t))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${n} and ${q}`);void 0!==w&&
647
- null!==w&&(f.add(t),d.set(q,(d.get(q)||0)+v),Array.from(w.values()).forEach(y=>y(v)));f.delete(t)};g(k,q,n);d.has(q)?k(d.get(q)):(l>=this.F&&b(v=>{d.set(q,(d.get(q)||0)+v);k(v)},p,q),(0>this.C||l<=this.C)&&q!==n&&V(a,q,this,h.bind(this,u,l+1,q),r))}else k(-d.get(q)),e.get(q).delete(c+n),0===e.get(q).size&&(d.delete(q),e.delete(q),a.C(q,this,r))};return(k,l,n)=>h(k,0,'origin',l,n)}ia(){return`${this.R()}, ${this.Oa()}, ${this.F}, ${this.C}`}}olympe.dc.U.Pl.la=[olympe.dc.$a];olympe.dc.X={};olympe.dc.X.sk={ht:1,ut:-1,wp:0};olympe.dc.X.aB={Dy:!0,az:!1};olympe.dc.X.Qb=class extends olympe.dc.ta.Relation{constructor(a,b){super(a,b||olympe.dc.za.DESTINATION)}Yb(){return Ic(this)}ma(){return O(olympe.dc.X.Qb)}Pc(){return new olympe.dc.X.Qb(this.tag,this.direction===olympe.dc.za.DESTINATION?olympe.dc.za.ORIGIN:olympe.dc.za.DESTINATION)}getTransform(a,b,c){const d=olympe.dc.Na(),e=this.R(),f=this.Oa();return(g,h,k,l)=>{Gg(b,k,h,e,f);g?V(d,h,this,(n,p)=>{const q=olympe.W.mb(k+f+e+p,20),r=rg(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.C(h,this,k)}}ia(){return'{"c":"'+
648
- this.ma()+'","a":["'+this.R()+'","'+this.Oa()+'"]}'}toString(){return'Related('+this.Oa()+this.R()+')'}};N('olympe.dc.transformers.Related',olympe.dc.X.Qb);olympe.dc.X.Qb.la=[olympe.dc.Wc];olympe.dc.X.Dc=class extends olympe.dc.ta.Relation{constructor(a,b=olympe.dc.za.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.C=d}Yb(){return Ic(this)}ma(){return O(olympe.dc.X.Dc)}getTransform(a,b,c){const d=olympe.dc.Na(),e=Object.create(null),f=olympe.dc.za.ORIGIN,g=olympe.dc.za.DESTINATION,h=this.R(),k=this.Oa(),l=(p,q,r)=>{if(!(0<=this.C&&p>=this.C)){var t=d.ub(r,this);p+=1;for(let u=0,v=t.length;u<v;u++){if(void 0!==e[t[u]]||r===t[u])continue;const w=olympe.W.mb(q+k+(h+'_'+p)+t[u],20);b.register(w,
649
- q,r,h,k||g);null===k&&b.register(w,q,r,h,f)}}},n=(p,q,r,t,u,v)=>{u&&!b.F&&l(p,t,v);p>=this.F?c(u,v,t,rg(r,u,v,t)):Gg(b,t,v,h,k);0<=this.C&&p>=this.C||(u?e[v]||(e[v]=!0,V(d,v,this,(w,y)=>{const A=p+1,D=olympe.W.mb(t+k+(h+'_'+A)+y,20);n(A,v,r,D,w,y)},t)):(d.C(v,this,t),delete e[v]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ia(){return'{"c":"'+this.ma()+'","a":["'+this.R()+'","'+this.Oa()+'",'+this.F+','+this.C+']}'}toString(){return'RecursiveRelated('+this.Oa()+this.R()+'['+this.F+'..'+this.C+'])'}};
650
- N('olympe.dc.transformers.RecursiveRelated',olympe.dc.X.Dc);olympe.dc.X.Dc.la=[olympe.dc.Wc];function Xg(a){return a.Ka.map(b=>b.R())}
651
- olympe.dc.X.Be=class{constructor(a,b){this.direction=b||olympe.dc.za.DESTINATION;this.Ka=a.map(c=>new olympe.dc.ta.Relation(c,this.direction))}Yb(){return olympe.dc.CloudObject}ma(){return O(olympe.dc.X.Be)}Oa(){return this.direction}getTransform(a,b,c){const d=olympe.dc.Na(),e=(f,g,h,k)=>V(d,f,k,(l,n)=>{var p=k.Oa();var q=k.R();p=olympe.W.mb(g+p+q+n,20);q=rg(h,l,n,p);l&&b.register(p,g,f,k.R(),k.Oa());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.Ka.forEach(l=>{Gg(b,h,g,l.R(),l.Oa());e(g,h,k,l)}):this.Ka.forEach(l=>
652
- {d.C(g,l,h)})}}ia(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(Xg(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Oa()+'['+Xg(this).join(',')+'])'}};N('olympe.dc.transformers.MultiRelated',olympe.dc.X.Be);olympe.dc.X.Be.la=[olympe.dc.Wc];olympe.dc.X.Jl=class{constructor(a,b,c,d){this.C=new olympe.dc.ta.Relation(olympe.dc.xa(a),c||olympe.dc.za.DESTINATION);this.F=new olympe.dc.ta.Relation(olympe.dc.xa(b),d||olympe.dc.za.DESTINATION)}Yb(){return Ic(this.C)}ma(){return O(olympe.dc.X.Jl)}getTransform(a,b,c){const d=olympe.dc.Na(),e={},f=this.C.R(),g=this.C.Oa(),h=this.F.R(),k=this.F.Oa();let l=null,n=null;const p=(r,t,u,v,w,y)=>{if(w){if(w=()=>{const A=olympe.W.mb(u+g+(f+'_'+r)+y,20),D=rg(t,!0,y,A);l=r;n=()=>{c(!1,y,A,rg(t,!1,y,A))};
653
- b.register(A,u,v,f,g);c(!0,y,A,D)},w.Zr=r,e[v]=w,null===l||r<l)n&&n(),w()}else if(l===r){n();e[v]=!0;w=Infinity;let A=null;for(let D=Object.keys(e),T=D.length,I=0;I<T;I++){let aa=e[D[I]];aa.Zr<w&&(w=aa.Zr,A=aa)}A&&A()}},q=(r,t,u,v,w)=>{v?e[w]||(e[w]=!0,Gg(b,u,w,f,g),Gg(b,u,w,h,k),V(d,w,this.C,p.bind(this,r,t,u,w),u+'_val'),V(d,w,this.F,q.bind(this,r+1,t,u),u+'_follow')):(d.C(w,this.F,u+'_follow'),d.C(w,this.C,u+'_val'),delete e[w])};return(r,t,u,v)=>q(0,v,u,r,t)}ia(){return'{"c":"'+this.ma()+'","a":["'+
654
- this.C.toString()+'","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.C.toString()+', '+this.F.toString()+')'}};N('olympe.dc.transformers.FirstRelated',olympe.dc.X.Jl);olympe.dc.X.Jl.la=[olympe.dc.Wc];olympe.dc.X.xe=class{Yb(){return null}ma(){return O(olympe.dc.X.xe)}getTransform(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,rg(h,!0,f,f))):(d[f]++,Fg(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,rg(h,!1,f,f)))}}ia(){return'{"c":"'+this.ma()+'"}'}toString(){return'Distinct()'}};N('olympe.dc.transformers.Distinct',olympe.dc.X.xe);olympe.dc.X.xe.la=[olympe.dc.Wc];olympe.dc.X.Kd=class{constructor(a,b){this.Ld=a;this.C=void 0===b?!0:!!b}Yb(){return null}ma(){return O(olympe.dc.X.Kd)}F(){return[this.Ld.V()]}getTransform(a,b,c){const d=new olympe.dc.oc.Zq(this.C?this.Ld.G.bind(this.Ld):(e,f)=>this.Ld.G(f,e));return(e,f,g)=>{var h=e?this.Ld.N(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ia(a){return'{"c":"'+this.ma()+'","a":['+this.Ld.ia(a)+','+JSON.stringify(this.C)+']}'}toString(){return'Sort('+this.Ld.toString()+','+JSON.stringify(this.C)+')'}};
655
- N('olympe.dc.transformers.Sort',olympe.dc.X.Kd);olympe.dc.X.Kd.la=[olympe.dc.Wc,olympe.dc.tq];olympe.dc.X.rc=class{constructor(a){this.C=a}Yb(){return null}ma(){return O(olympe.dc.X.rc)}F(){return this.C.F()}getTransform(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&Fg(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,rg(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;f?(f=this.C.C(a,g),olympe.D.lb(f)&&(f=f.Ma),olympe.D.Tf(f)?(b.F||void 0!==olympe.D.Ya(f)||Fg(b,h),e[l]=f,olympe.D.wc([f],n=>{d(g,h,k,n)},'filterResultHandler')):d(g,h,k,f)):(void 0!==e[l]&&(e[l].destroy(),delete e[l]),d(g,h,k,!1),delete e[h])}}ia(a){return'{"c":"'+
656
- this.ma()+'","a":['+this.C.ia(a)+']}'}toString(){return'Filter('+this.C.toString()+')'}};N('olympe.dc.transformers.Filter',olympe.dc.X.rc);olympe.dc.X.rc.la=[olympe.dc.Wc,olympe.dc.tq];olympe.dc.X.$d=class{constructor(a,b){this.start=a;this.C=b}Yb(){return null}ma(){return O(olympe.dc.X.$d)}getTransform(a,b,c){const d=new olympe.dc.oc.am;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]);Cg(d,e,f,n,c)}};olympe.D.ie([this.start,this.C],(n,p)=>{f=n.valueOf();g=p.valueOf();k()});Lg(b,k);const l=Ig(b);Hg(b,l);return(n,p,q,r)=>{h||(r.Qc().Lg(t=>{e=t;Mg(b,l)}),pg(b,()=>r.vg(),l),h=!0);d.C(n,p,q,null);qg(b,q,l)}}ia(a){return'{"c":"'+
657
- this.ma()+'","a":['+Df(a,this.start)+','+Df(a,this.C)+']}'}toString(){return`Limit(${olympe.D.Ya(this.start)},${olympe.D.Ya(this.C)})`}};N('olympe.dc.transformers.Limit',olympe.dc.X.$d);olympe.dc.X.$d.la=[olympe.dc.Wc];function Yg(a,b,c,d,e,f){function g(p,q){if(l)for(var r=l.length-1;0<=r;r--)f=l[r].getTransform(b,e,n.Cb(f));f=n.Cb(f);e.register(h,null);r=d.C(p,q,c,null);f(p,q,h,rg(r,p,q,h))}const h=olympe.W.lc(),k=olympe.dc.Na(),l=a.X,n=olympe.D.Ia();olympe.D.wc([a.C],p=>{Zg(k,p,g,h);void 0===k.model(p)&&og(e)})}function Zg(a,b,c,d){const e=b&&b.valueOf();e&&(uc(a,e,c,d),olympe.D.Ia().vc(()=>vc(a,e,d)))}
658
- olympe.dc.X.uf=class{constructor(a,b){this.X=this.C=null;a instanceof olympe.dc.Aa?(this.C=a.Od(),this.X=a.Vl()):(this.C=a,b&&(this.X=b))}Yb(){return null}ma(){return O(olympe.dc.X.uf)||''}Dg(){return this.X}Od(){return this.C}getTransform(a,b,c){const d=new olympe.dc.oc.am,e=new olympe.dc.oc.Ij;let f=[],g=[],h=!1,k=!1;const l=Ig(b),n=Ig(b);Lg(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):Mg(b);Cg(d,p,0,p.length,c)});Hg(b,n);Yg(this,a,this.C,e,b,(p,q,r,t)=>{const u=olympe.D.Ia();
659
- u.gd()||u.yb()||(k||(t.Qc().Lg(v=>{g=v;Mg(b,n)}),pg(b,()=>t.vg(),n),k=!0),d.C(p,q,r),qg(b,r,n))});Hg(b,l);return(p,q,r,t)=>{h||(t.Qc().Lg(u=>{f=u;Mg(b,l)}),pg(b,()=>t.vg(),l),h=!0);d.C(p,q,r,l);qg(b,r,l)}}ia(a){const b=this.X?'['+this.X.map(c=>c.ia(a)).join(',')+']':'null';return'{"c":"'+this.ma()+'","a":['+Df(a,this.C)+','+b+']}'}toString(){const a=olympe.D.lb(this.C)?'N:'+this.C.Ma.Y():this.C.valueOf(),b=this.X?','+this.X.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
660
- N('olympe.dc.transformers.Union',olympe.dc.X.uf);olympe.dc.X.uf.la=[olympe.dc.Wc];olympe.dc.Mg={};function $g(a,b){let c=Ac.get(b)||null,d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Bf(b);if(null===b)break;c=Ac.get(b)||null}return c||null}olympe.dc.Mg.SyncManager=class{constructor(a,b,c){this.L=a;this.db=b;this.C=c}};olympe.dc.Mg.O={Ea:'dc.syncs.Logger',va:'dc.syncs.SyncManager'};olympe.T.config(function(a){C(a,olympe.dc.Mg.O.Ea,[olympe.pa.O.va],b=>b.Nc('dc'));B(a,olympe.dc.Mg.O.va,olympe.dc.Mg.SyncManager,olympe.dc.Mg.O.Ea,olympe.dc.O.wi,olympe.T.O.dg)});olympe.dc.W={};olympe.dc.W.LC=function(a){a=olympe.dc.xa(a);const b=olympe.D.Kc(olympe.D.Wa,'getInstanceName'),c=olympe.dc.Na(),d=xd(c,a,olympe.dc.CloudObject.nameProp,b.update.bind(b));olympe.D.Ia().vc(c.F.bind(c,a,olympe.dc.CloudObject.nameProp,d));return b.Eb()};olympe.dc.W.OC=function(a){return olympe.D.Fa([a],b=>olympe.D.Xx(olympe.dc.Na().nj(b)),olympe.D.qa)};olympe.dc.W.PC=function(a){return(a=olympe.D.Ya(a))?olympe.dc.Na().nj(a):!1};olympe.dc.W.Li=class a{constructor(b=olympe.dc.Ja.Vc){this.G=b}C(b){const c=new olympe.dc.db.xc;this.F(b,c);return c}V(b,c,d){const e=new olympe.dc.db.xc(b),f=new olympe.dc.query.Di(b,this.G,c,e);this.F(d,e,(g,h)=>{h=h||[];const k=f.C.get(g)||new Set;for(const l of h)k.add(l);f.C.set(g,k)});return f}N(b,c){const d=new olympe.dc.db.xc(b),e=new olympe.dc.query.rt(b,d);this.F(c,d,(f,g,h)=>{h=h||[];const k=new hf(f);k.add=g||[];k.remove=h;e.C.set(f,k)});return e}F(b,c,d){const e=olympe.dc.$b.Jd;for(const f of b)switch(b=
661
- f.i?f.i:-1,f.o){case 1:const g=a.C(f.p||{});g.has(e)||g.set(e,this.G);c.F(f.t,g,b);break;case 2:c.pc(f.t,a.C(f.p),!0,b);break;case 3:c.Jc(f.t,f.f,b);break;case 4:c.Ra(f.m,f.l,f.r,b);break;case 5:c.ec(f.m,f.l,f.r,b);break;case 6:d&&d(f.i,f.a,f.d);break;default:throw Error('Undefined patch operation: '+f.o);}}static C(b){const c=new Map;for(const [d,e]of Object.entries(b)){b=d;if(b===olympe.dc.$b.Jd||b===olympe.dc.$b.VERSION){c.set(b,e);continue}else if('v'===d){c.set(olympe.dc.$b.VERSION,e);continue}let f=
662
- typeof e;b.startsWith('fd')&&(b=olympe.dc.Ug.mc+b.substr(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;case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&
663
- 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.Hc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};olympe.dc.W.Sb={};olympe.dc.W.Sb.Rm=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.Bb(a):a instanceof olympe.D.Wa?a:null;olympe.dc.W.Sb.Om=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Ac(a):a instanceof olympe.D.qa?a:null;olympe.dc.W.Sb.Qm=a=>'number'===typeof a||a instanceof Number?olympe.D.ya(a):'string'===typeof a||a instanceof String?olympe.D.ya(Number.parseFloat(a.valueOf())):a instanceof olympe.D.ea?a:null;
664
- olympe.dc.W.Sb.Pm=function(a){return'number'===typeof a||a instanceof Number?sb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.jb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.jb(a):a instanceof olympe.D.jb?a:null};olympe.dc.W.Sb.Er=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?wb(a.valueOf()):null};olympe.dc.W.Sb.Fr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.Hc?olympe.dc.CloudObject.get(a.tag):null;
665
- olympe.dc.W.Sb.ih=a=>a instanceof olympe.dc.Hc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.W.Sb.vC=a=>{switch(typeof a){case 'boolean':return olympe.D.Ac(a);case 'number':return olympe.D.ya(a);case 'string':return olympe.D.Bb(a);case 'object':if(a instanceof Date)return olympe.D.Mx(a)}return a};
666
- olympe.dc.W.Sb.IC=a=>{switch(a){case olympe.D.qa:return olympe.dc.W.Sb.Om;case olympe.D.Wa:return olympe.dc.W.Sb.Rm;case olympe.D.ea:return olympe.dc.W.Sb.Qm;case olympe.D.jb:return olympe.dc.W.Sb.Pm;case olympe.D.Color:return olympe.dc.W.Sb.Er;case olympe.dc.CloudObject:return olympe.dc.W.Sb.Fr;default:return olympe.dc.W.Sb.ih}};olympe.dc.O={va:'dc.Manager',pt:'dc.Graph',wi:'dc.DBView',Ea:'dc.Logger',$u:'dc.TransactionLogger',zi:'dc.FileServiceManager',me:'dc.Router'};olympe.dc.Config={eg:'dc.debug',$g:'dc.subscribeAll',yo:'dc.defaultSource',Oo:'dc.fileCache',Ho:'dc.errorOnAbstractInstantiation'};
667
- olympe.T.config(function(a){E(a,olympe.dc.Config.eg,!1);E(a,olympe.dc.Config.$g,!1);E(a,olympe.dc.Config.yo,olympe.dc.Ja.Vc);E(a,olympe.dc.Config.Oo,!0);E(a,olympe.dc.Config.Ho,!0);C(a,olympe.dc.O.Ea,[olympe.pa.O.va],b=>b.Nc('dc'));sa(a,olympe.dc.O.$u,olympe.dc.transaction.O.Ea);sa(a,olympe.dc.O.wi,olympe.dc.db.O.ib);B(a,olympe.dc.O.zi,olympe.dc.lt,olympe.dc.O.Ea,olympe.net.O.va,olympe.dc.O.me,olympe.W.O.zh,new olympe.T.fa(olympe.dc.Config.Oo));ta(a,olympe.dc.O.me);B(a,olympe.dc.O.va,olympe.dc.sa,
668
- olympe.dc.O.Ea,olympe.dc.db.O.va,olympe.dc.query.O.va,olympe.dc.transaction.O.va,olympe.dc.Mg.O.va,olympe.dc.O.zi)},'olympe.dc');olympe.T.run([olympe.dc.db.O.va,olympe.dc.query.O.va,olympe.dc.transaction.O.va,olympe.dc.Mg.O.va,olympe.dc.O.va,olympe.dc.O.zi],(a,b,c,d,e,f)=>{olympe.dc.Ad=()=>a;olympe.dc.Lf=()=>b;olympe.dc.hi=()=>c;olympe.dc.Xr=()=>d;olympe.dc.Qc=()=>e;olympe.dc.zw=()=>f},'DC singleton getter initialization');olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.Na();this.model=null}static get(a){{var b=olympe.dc.Xr();a=olympe.dc.xa(a);const c=$g(b,b.db.model(a));null===c?(b.L.error(`Instantiation of a CloudObject (tag = '${a}') that does not exist (or incompletely exists) in the local database.\n
532
+ const t=olympe.W.mb(l+'rec');k===d?g(n,p):n?f.has(p)||(f.add(p),V(this.db,p,q,h.bind(this,k+1,l),l),r&&V(this.db,p,r,h.bind(this,k,t),t)):(f.delete(p),this.db.C(p,q,l),r&&this.db.C(p,r,t))};h(0,b,!0,a);0===e&&c(!1)}ia(){return{pr:6,r:this.Ka.map((a,b)=>[a.R(),a.Oa(),this.recursive[b]]),d:this.destination}}toString(){const a=this.Ka.reduce((b,c,d)=>b+c.R()+this.recursive[d],'');return`RelatedTo-${this.destination}-${a}`}};olympe.dc.da.V.De.prototype.followRecursive=olympe.dc.da.V.De.prototype.Lk;
533
+ olympe.dc.da.V.De.prototype.follow=olympe.dc.da.V.De.prototype.sb;olympe.dc.da.V.De.C=6;olympe.dc.da.V.De.la=[olympe.dc.da.$a];olympe.dc.da.Kb={};olympe.dc.da.Kb.rc=class{constructor(a){this.C=a}F(a){return a}hb(a,b){for(const c of X(a,b).keys())this.C.hb(c)||(0===b?a.remove(c,b,null):Le(a,c,b).forEach(d=>{a.remove(c,b,d)}))}observe(a,b,c){let d=!1;return(e,f,g,h)=>{const k=olympe.W.mb(h+f+this.toString());e?this.C.observe(f,k,l=>{d||(l?a.insert(f,b,g):a.remove(f,b,g),c(l,f,g,k))}):(d=!0,this.C.clear(f,k),d=!1,c(!1,f,g,k))}}ia(){return{t:1,p:this.C.ia()}}toString(){return'filterQueryPart-'+this.C.toString()}};olympe.dc.da.Kb.rc.C=1;
534
+ olympe.dc.da.Kb.rc.la=[olympe.dc.da.jk];olympe.dc.da.Kb.hg=class{constructor(a,b){this.db=a;this.C=b}Qd(){return this.C}F(a){return a+1}hb(a,b){for(const c of X(a,b).keys())this.db.ub(c,this.C).forEach(d=>{a.insert(d,b+1,c)})}observe(a,b,c){return(d,e,f,g)=>{const h=olympe.W.mb(g+e+this.toString());d?V(this.db,e,this.C,(k,l)=>{(k?a.insert(l,b+1,e):a.remove(l,b+1,e))&&c(k,l,e,h)},h):this.db.C(e,this.C,h)}}ia(){return{t:2,r:{t:this.C.R(),d:this.C.Oa()}}}toString(){return'followQueryPart-'+this.C.Oa()+this.C.R()}};olympe.dc.da.Kb.hg.C=2;
535
+ olympe.dc.da.Kb.hg.la=[olympe.dc.da.jk];olympe.dc.da.Kb.ig=class{constructor(a,b,c=!1){this.db=a;this.C=b;this.G=c}Qd(){return this.C}F(a){return a+1}hb(a,b){for(const c of X(a,b).keys())this.G&&a.insert(c,b+1,c),this.db.Nf(c,this.C).forEach(d=>{a.insert(d,b+1,c)})}observe(a,b,c){const d=(g,h,k,l)=>olympe.W.mb(g+h+k+l+this.toString()),e=new Set,f=(g,h,k,l,n)=>{h=d(h,g,n,k);(this.G||0<k)&&(l?a.insert(n,b+1,g):a.remove(n,b+1,g))&&c(l,n,g,h);l?e.has(n)||(e.add(n),V(this.db,n,this.C,f.bind(this,g,h,k+1),h)):(e.delete(n),this.db.C(n,this.C,
536
+ h))};return(g,h,k,l)=>f(h,l,0,g,h)}ia(){return{t:3,s:this.G,r:{t:this.C.R(),d:this.C.Oa()}}}toString(){return'followRecursivelyQueryPart-'+this.C.Oa()+this.C.R()}};olympe.dc.da.Kb.ig.C=3;olympe.dc.da.Kb.ig.la=[olympe.dc.da.jk];function Qe(a){a=a.db.ic(a.kb,olympe.dm.Property.typeRel);const b=olympe.dc.xa;if(a===b(olympe.dm.String))return Re((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return Re((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return Re((c,d)=>c.getTime()-d.getTime());olympe.pa.Xa('dc').warn(`No comparator found for type with tag ${a}`);return Re(()=>-1)}function Re(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
537
+ olympe.dc.da.Kb.Qh=class{constructor(a,b,c){this.db=a;this.kb=b;this.order=c}F(a){return a}hb(a,b){Ie(a,Qe(this),b,this.order,this.kb)}observe(a,b,c){Ie(a,Qe(this),b,this.order,this.kb);return(d,e,f,g)=>{g=olympe.W.mb(g+this.toString());d?Bd(this.db,e,this.kb,()=>{Ke(a)},g):this.db.F(e,this.kb,g);c(d,e,f,g)}}ia(){return{t:4,p:this.kb.R(),o:this.order}}toString(){return'sortByQueryPart-'+this.order+this.kb.R()}fb(){return this.kb}};olympe.dc.da.Kb.Qh.C=4;olympe.dc.da.Kb.Qh.la=[olympe.dc.da.jk];olympe.dc.query={};function Se(a,b,c,d){let e=a.C.get(b);void 0===e&&(e=new Set,a.C.set(b,e));a=olympe.W.nc();e.add(a);d.set(a,c)}function Te(a,b,c){Se(a,b,c,a.F)}function Ue(a,b,c){if(a.C.has(b)){for(const d of a.C.get(b))c.delete(d);a.C.delete(b)}}function Ve(a,b,c,d,e){if(a.C.has(b)){if(!a.N.has(b)){a.N.add(b);for(const f of a.C.get(b))e=d.get(f),d.delete(f),c instanceof olympe.dc.query.errors.Vj?e(Error(c.aa()),c):'string'===typeof c?e(Error(c),null):e(null,c);a.C.delete(b);a.N.delete(b)}}else a.L.warn(e)}
538
+ function We(a,b,c){Ve(a,b,c,a.F,`Graph result of graphdef ${b} has no associated handler in the datacloud`)}function Xe(a,b,c){Se(a,b,c,a.G)}olympe.dc.query.Js=class{constructor(a){this.L=a;this.C=new Map;this.F=new Map;this.G=new Map;this.N=new Set}};olympe.dc.Ne=class{ma(){}N(){}G(){}U(){}ia(){}toString(){}};olympe.dc.Ed={SUBSCRIBE:0,Li:1,lm:2,ZA:0,GET:1};olympe.dc.Ed.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Ed))if(c===a)return b;return null};function ve(a,b=1){a.validate(olympe.dc.Sb.NONE,'back');let c=a.Y;for(let d=0;d<b&&null!==c;d++)c=a.F.get(c.F)||null;a.Y=c}function Ye(a){return'not_defined'===a.C?olympe.dc.Sb.NONE:a.C}function Ze(a,b){a.validate(b,'activateFollowRules');return a}function $e(a){return'not_defined'!==a.C&&a.C!==olympe.dc.Sb.NONE}
539
+ function af(a){if($e(a))throw Error('An implicit GraphDef has no blocks');return a.F.values()}
540
+ function bf(a,b,c){c=new olympe.dc.query.Relation(b.R(),b.Oa(),c||b instanceof olympe.dc.X.Dc);b=[];var d;for(var e of cf(a)){if(d=a.F.get(e)){var f=new olympe.dc.query.Uj(c,d.id);d.children.has(f.Z())?d=d.children.get(f.Z()):(d.children.set(f.Z(),f),d=f)}else{d=a;var g=c;const h=olympe.W.mb(d.G);f=olympe.W.mb(h+g.toString());g=d.F.get(f)||new olympe.dc.query.Uj(g,h);d.U.set(f,g);d=g}f=d.Z();a.F.set(f,d);b.push(f)}e=b[0];a.ra.set(e,b);return a.F.get(e)}
541
+ function df(a,b){if($e(a))a.aa.push(b);else throw Error('You cannot add a "skip predicate" to an explicit graphdef. Please activate a follow rule first.');return a}function ef(a,b){a.ka=b;return a}function ff(a){const b=new olympe.dc.gf(a.G,a.N);b.C=a.C;for(const [c,d]of a.U)b.U.set(c,d);for(const [c,d]of a.F)b.F.set(c,d);b.ka=a.ka;b.aa=[...a.aa];return b}function gf(a,b){return $e(a)?new olympe.dc.query.Ol(ff(a),b||olympe.D.Ja()):new olympe.dc.query.Tj(ff(a),b||olympe.D.Ja())}
542
+ function cf(a){let b=a.Y;const c=[];for(;b&&b.Qd().recursive;)c.push(b.Z()),b=a.F.get(b.F)||null;c.push(b&&b.Z()||olympe.W.mb(a.G));const d=[];c.slice(0,5).forEach(e=>{d.push(...a.ra.get(e))});return d}
543
+ olympe.dc.gf=class{constructor(a,b=olympe.dc.Ed.SUBSCRIBE){if(void 0===a||null===a)throw Error('Cannot create GraphDef with undefined or null baseTag');this.G=olympe.dc.xa(a);this.N=b;this.C='not_defined';this.aa=[];this.Y=null;this.U=new Map;this.F=new Map;this.ka=null;this.ra=(new Map).set(olympe.W.mb(this.G),[olympe.W.mb(this.G)])}static Jc(a,b){olympe.dc.gf.Te([a],b)}static Te(a,b){const c=new olympe.dc.Transaction;a.forEach(d=>c.delete(d,olympe.dc.Sb.Fc));c.hb(b)}toJSON(){const a=Object.create(null),
544
+ b=c=>{const d=Object.create(null),e=c.Qd();d.t=e.R();d.d=e.Oa();d.r=e.recursive;d.c=c.jh().map(b);return d};a.t=this.G;a.o=this.N;a.f=Ye(this);a.b=Array.from(this.U.keys()).map(c=>b(this.F.get(c)));return JSON.stringify(a)}static mc(a){a='string'===typeof a?JSON.parse(a):a;const b=Ze(new olympe.dc.gf(a.t,a.o),a.f),c=d=>{const e=new olympe.dc.ta.Relation(d.t,d.d);b.sb(e,d.r);for(const f of d.c)c(f);ve(b)};for(const d of a.b)c(d);return b}Z(){const a=olympe.W.mb,b=d=>d.Z()+d.jh().map(e=>b(e)).sort().join(''),
545
+ c=Array.from(this.U,([,d])=>b(d)).sort().join('');return a(`${this.N}-${this.G}${c}-${Ye(this)}`)}add(a,b=!1){this.validate(olympe.dc.Sb.NONE,'add');bf(this,a,b);return this}sb(a,b=!1){this.validate(olympe.dc.Sb.NONE,'follow');this.Y=bf(this,a,b);return this}hb(a=b=>b){'not_defined'===this.C&&(this.C=olympe.dc.Sb.NONE);const b=olympe.dc.Lf();a=olympe.D.Ja().Cb(a);switch(this.N){case olympe.dc.Ed.SUBSCRIBE:case olympe.dc.Ed.Li:const c=hf(b,this,a);olympe.D.Ja().vc(()=>{jf(olympe.dc.Lf(),c.Z())});break;
546
+ case olympe.dc.Ed.lm:kf(b,this,a);break;default:throw Error('Wrong graph operation');}}validate(a,b){if('not_defined'!==this.C&&this.C!==a)throw Error(this.C!==olympe.dc.Sb.NONE?`Method ${b} can't be called on an implicit Graphdef`:`Method ${b} can't be called on an explicit Graphdef`);this.C=a}};function lf(a,b){a.data.Mc(b.data);a.C.forEach((c,d)=>{if(b.C.has(d))d=b.C.get(d),d.add.push(...c.add),d.remove.push(...c.remove);else{var e=c.remove;const f=new mf(d);f.add=c.add;f.remove=e;b.C.set(d,f)}})}function nf(a,b){a.C.forEach((c,d)=>b(d,c.add,c.remove))}olympe.dc.query.ot=class{constructor(a,b){this.id=a;this.C=new Map;this.data=b}Z(){return this.id}};class mf{constructor(a){this.id=a;this.add=[];this.remove=[]}Z(){return this.id}};function of(a){return(a=a.C)&&olympe.dc.Na().source(a)||olympe.dc.Ha.Vc}function pf(a){return Array.from(a.Da,b=>a.F.get(b))}function qf(a){if(!a.N){for(const b of a.U.values())b();a.U.clear();a.N=!0}}
547
+ olympe.dc.query.Tj=class{constructor(a,b){this.qh=a;this.C=a.G;this.id=a.Z();this.aa=new olympe.D.Wb(`GraphSubscription ${this.id}`,b);this.L=olympe.pa.Xa('dc.query');this.Da=[];this.F=new Map;this.N=!1;this.U=new Map;b=olympe.W.mb(this.C);if(!$e(a))for(const c of af(a))this.F.set(c.Z(),c),c.F===b&&this.Da.push(c.Z())}Z(){return this.id}Ke(a,b){b=b||olympe.W.nc();this.N?a():this.U.set(b,olympe.D.Ja().Cb(a));return b}pj(a){return this.U.delete(a)}onDestroy(a){this.aa.onDestroy(a)}release(){this.aa.destroy()}Y(){return function*(a,
548
+ b){yield a;for(const c of b)yield*c.de()}(this.C,this.F.values())}ka(a){const b=olympe.W.mb(this.C);rf(a,(c,d)=>{if(b!==c)if(c=this.F.get(c),void 0===c)this.L.error('Try to apply a block result that does not exists in the original query');else for(const e of d)c.C.add(e)})}ra(a){let b=[],c=[];const d=olympe.W.mb(this.C);nf(a,(e,f,g)=>{const h=d===e,k=this.F.get(e);h||void 0!==k?h?(b.push(...f),c.push(...g)):(b=b.concat(f.filter(l=>{k.C.has(l)?l=!1:(k.C.add(l),l=!0);return l})),c=c.concat(g.filter(l=>
549
+ k.C.delete(l)))):this.L.error(`A notification contains a block ${e} which is not present in the current graph query ${this.id}`)});Tc(olympe.dc.Ad(),b,c)}Dr(a){const b=a.C,c=[],d=this.C;d===b&&c.push(olympe.W.mb(d));this.F.forEach((k,l)=>{k.C.has(b)&&c.push(l)});const e=olympe.W.mb,f=this.F,g=(k,l)=>{const n=l.Qd(),p=[e(k+n),e(k+new olympe.dc.query.Relation(n.tag,n.direction,!0))].filter(q=>f.has(q));return 0<p.length?l.jh().reduce((q,r)=>q&&g(p[0],r),!0):!1},h=pf(a);return void 0!==c.find(k=>{for(const l of h)if(!g(k,
550
+ l))return!1;return!0})}};olympe.dc.query.Uj=class{constructor(a,b){this.G=a;this.children=new Map;this.C=new Set;this.F=b;this.id=olympe.W.mb(b+a.toString());this.apply=!0}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "parentId": '+JSON.stringify(this.F)+', "apply": '+JSON.stringify(this.apply)+', ';a+='"relation": '+this.G.toJSON();if(0<this.children.size){a+=', "children": [';for(const b of this.children.values())a+=b.toJSON()+', ';a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=']'}if(0<this.C.size){a+=', "instances": [';
551
+ for(const b of this.C)a+=JSON.stringify(b)+', ';a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=']'}return a+'}'}static mc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=olympe.dc.query.Relation.mc(b.relation);a=new olympe.dc.query.Uj(a,b.parentId);a.id=b.id;a.apply=b.apply;if(b.instances)for(const c of b.instances)a.C.add(c);if(b.children)for(const c of b.children)b=olympe.dc.query.Uj.mc(c),a.children.set(b.id,b);return a}Z(){return this.id}Qd(){return this.G}jh(){return Array.from(this.children.values())}de(){return this.C.values()}toString(){return this.F+
552
+ this.G.toString()}};function rf(a,b){a.C.forEach((c,d)=>b(d,c))}
553
+ olympe.dc.query.Ci=class{constructor(a,b,c,d){this.id=a;this.source=b;this.destination=c;this.C=new Map;this.Bc=d}toJSON(){let a=`{ "id": "${this.id}", "source": "${this.source}", "destination": "${this.destination}"`;a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=', "blocks": {';for(const [b,c]of this.C)a+=`"${b}": ${JSON.stringify(Array.from(c))}, `;a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=`}, "patch": ${this.Bc.toJSON()}`;return a+'}'}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):
554
+ b=a;a=olympe.dc.db.xc.mc(b.patch);a=new olympe.dc.query.Ci(b.id,b.source,b.destination,a);for(const [c,d]of Object.entries(b.blocks))a.C.set(c,new Set(d));return a}Z(){return this.id}};const sf=olympe.dc.kc.Tc,tf=olympe.dc.kc.xi,uf=olympe.dc.za.ORIGIN,vf=olympe.dc.za.DESTINATION;function wf(a,b,c){const d=a.qh.aa;return c.filter(e=>d.reduce((f,g)=>f&&!g(b,e.Qd()),!0))}
555
+ olympe.dc.query.Ol=class extends olympe.dc.query.Tj{constructor(a,b){super(a,b);this.G=(new Set).add(a.G)}Y(){return this.G.values()}ka(a){a=a.Bc;for(const b of a.de())b.N()?this.G.delete(b.tag()):b.se()&&this.G.add(b.tag())}ra(a){let b=[],c=[];nf(a,(d,e,f)=>{b=b.concat(e.filter(g=>{if(this.G.has(g)&&this.C!==g)return!1;this.G.add(g);return!0}));c=c.concat(f.filter(g=>this.G.delete(g)))});Tc(olympe.dc.Ad(),b,c)}Dr(a){var b=a.C,c=Array.from(a.F.values()),d=wf(this,b,c);if(d.length===c.length&&!this.G.has(b))return!1;
556
+ b=olympe.dm.Relation.C.yk;c=olympe.dm.Relation.C.mk;const e=olympe.dc.Na();for(const h of d){var f=h.Qd(),g=f.R();d=f.Oa();if(d!==vf||g!==sf&&g!==tf){if(!e.Gb(f))return this.L.info('ImplicitGraphQuery: checking coverage of graphPath',a.Z(),'failed at the relation',g,'which is not in local DB'),!1;f=Dd(e,f,Ye(this.qh));g=0===h.jh().length;if(!(f&(d===uf?g?12:c:g?3:b)))return!1}}return!0}};function xf(a){let b=null;for(a=[...a.X];null===b&&0<a.length;)b=a.pop().Yb();return b}function yf(a,b){a.Y()||(a=`Calling "${b}" on subscription with id ${a.Z()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback.',olympe.pa.Xa('dc').warn(a))}
557
+ function zf(a,b){const c=new olympe.D.Wb('listDef toObservable',a.oc().Fh());return new rxjs.Observable(d=>{c.run(()=>{olympe.D.wc([b],e=>{d.next(e.valueOf())})});c.onDestroy(()=>{d.complete()});return c.destroy.bind(c)})}
558
+ olympe.dc.Aa=class{constructor(a,b,c){void 0===a||null===a?olympe.pa.Xa('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.Fa([a],olympe.dc.xa,String),this.X=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||xf(this),this.C=null)}Qc(){return olympe.dc.Qc()}hb(){if(null===this.C){const a=olympe.dc.Lf();this.C=Af(a,this);null!==this.valueType&&this.C.Gd(this.valueType);olympe.D.Ja().vc(()=>{Bf(a,this.C.Z());this.C=
559
+ null})}return this}oc(){null===this.C&&this.hb();return this.C}Gd(a){this.valueType=a;null!==this.C&&this.C.Gd(this.valueType)}Yb(){return null!==this.C?this.C.Yb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Od(){return this.F}Rl(){return this.X}Ke(a,b){return this.oc().Ke(a,b)}pj(a){this.oc().pj(a)}Gt(){return this.oc().Bf()}Ft(){return this.oc().Y()}get(a){return this.oc().get(a)}ei(){return this.oc().ei()}kh(a){const b=this.oc();yf(b,'getCurrent');return b.kh(a)}has(a){return this.oc().has(a)}Dg(a){const b=
560
+ this.oc();yf(b,'hasCurrent');return b.Dg(a)}re(a){return this.oc().re(a)}Rx(a){return zf(this,this.re(a))}Ve(a){const b=this.oc();yf(b,'getCurrentAt');return b.Ve(a)}We(a){return this.oc().We(a)}Ef(a){const b=this.oc();yf(b,'getCurrentKeyAt');return b.Ef(a)}ee(a){return this.oc().ee(a)}Vx(a){return zf(this,this.ee(a))}Ff(a){const b=this.oc();yf(b,'getCurrentRank');return b.Ff(a)}Oc(){return this.oc().Oc()}Sx(){return zf(this,this.Oc())}Gf(){return this.oc().Gf()}kf(){return this.oc().kf()}Wx(){return zf(this,
561
+ this.kf())}zg(){const a=this.oc();yf(a,'getCurrentSize');return a.zg()}forEach(a,b){this.oc().forEach(a,b)}ce(a){const b=this.oc();yf(b,'forEachCurrentValue');return b.ce(a)}aj(a,b,c,d){a=new olympe.dc.X.Zd(a,b);(new olympe.dc.Aa(this.F,[...this.X,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.X];for(const c of b){if(void 0===
562
+ c)throw Error('ListDef.transform(): Trying to set an undefined transformer');if(c instanceof olympe.dc.ta.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.getTransform)break;a.push(c)}b=new olympe.dc.Aa(this.F,a);b.Gd(xf(b)||this.valueType||Object);return b}jl(a){return this.transform(new olympe.dc.X.sf(a))}filter(a){return this.transform(new olympe.dc.X.rc(a))}vg(){const a=new olympe.dc.ck(this.F,null===this.valueType?
563
+ void 0:this.valueType);let b=this.X;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.X;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.Ya(this.F)+a+')'}Et(){return this.oc().Tg()}hd(){return olympe.D.Fa([this.kf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.Ve(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.Bb(b+']')},olympe.D.Wa)}};olympe.dc.Aa.prototype.filter=olympe.dc.Aa.prototype.filter;olympe.dc.Aa.prototype.union=olympe.dc.Aa.prototype.jl;
564
+ olympe.dc.Aa.prototype.transform=olympe.dc.Aa.prototype.transform;olympe.dc.Aa.prototype.forEachCurrentValue=olympe.dc.Aa.prototype.ce;olympe.dc.Aa.prototype.forEach=olympe.dc.Aa.prototype.forEach;olympe.dc.Aa.prototype.getCurrentSize=olympe.dc.Aa.prototype.zg;olympe.dc.Aa.prototype.observeSize=olympe.dc.Aa.prototype.Wx;olympe.dc.Aa.prototype.observeFirst=olympe.dc.Aa.prototype.Sx;olympe.dc.Aa.prototype.getCurrentRank=olympe.dc.Aa.prototype.Ff;olympe.dc.Aa.prototype.observeRank=olympe.dc.Aa.prototype.Vx;
565
+ olympe.dc.Aa.prototype.getCurrentAt=olympe.dc.Aa.prototype.Ve;olympe.dc.Aa.prototype.observeAt=olympe.dc.Aa.prototype.Rx;olympe.dc.Aa.prototype.offReady=olympe.dc.Aa.prototype.pj;olympe.dc.Aa.prototype.onReady=olympe.dc.Aa.prototype.Ke;olympe.dc.Aa.prototype.getBaseTag=olympe.dc.Aa.prototype.Od;olympe.dc.Aa.la=[olympe.D.nd];m=olympe.dc.Aa.prototype;m.Qc.K=olympe.D.J.C;m.hb.K=olympe.D.J.N();m.oc.K=new olympe.D.J(()=>olympe.dc.query.Subscription,[]);m.Gd.K=new olympe.D.J(()=>{},[]);
566
+ m.Od.K=new olympe.D.J(()=>String,[]);m.Rl.K=new olympe.D.J(()=>Array,[]);m.Ke.K=new olympe.D.J(()=>String,[]);m.pj.K=new olympe.D.J(()=>{},[]);m.Gt.K=olympe.D.J.U;m.Ft.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.ei.K=new olympe.D.J(()=>Array,[]);m.kh.K=olympe.D.J.C;m.has.K=olympe.D.J.U;m.Dg.K=olympe.D.J.C;m.re.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.Ve.K=olympe.D.J.C;m.We.K=new olympe.D.J(()=>String,[]);m.Ef.K=olympe.D.J.C;m.ee.K=olympe.D.J.G;
567
+ m.Ff.K=olympe.D.J.C;m.Oc.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.Gf.K=new olympe.D.J(()=>String,[]);m.kf.K=olympe.D.J.G;m.zg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.ce.K=olympe.D.J.C;m.aj.K=new olympe.D.J(()=>{},[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.jl.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.filter.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.vg.K=new olympe.D.J(()=>olympe.dc.ck,[]);m.toString.K=olympe.D.J.C;m.Et.K=olympe.D.J.C;m.hd.K=olympe.D.J.F;const Cf={Hy:'append',El:'filter_not',Ko:'filter_and',Lo:'filter_or'};function Df(a,b){a=Ef(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.na.On(a,b)).F}
568
+ olympe.dc.ck=class{constructor(a,b){this.C=Ef(a);this.L=olympe.dc.Lf().Xa();this.valueType=void 0===b?olympe.dc.CloudObject:b;this.X=[];this.ua=[]}lf(){return new olympe.dc.Aa(this.C,this.X,this.valueType)}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Ff('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.ta.Property)throw new Ff('transform','Properties cannot be used as transformer, unlike relations '+d);if(!d||'function'!==typeof d.getTransform)throw new Ff('transform',
569
+ 'one of the argument is not a Transformer '+d);const e=d.Yb();null!==e&&(this.valueType=e);this.X.push(d)}return this}jl(a){this.X.push(new olympe.dc.X.sf(a));return this}Fy(a){this.X.push(new olympe.dc.X.sf(Ef(a)));return this}It(a){this.valueType=a;return this}sb(a){this.X.push(a);this.valueType=a.Yb()||olympe.dc.CloudObject;return this}aw(a){for(const b of a)this.X.push(b),this.valueType=b.Yb()||olympe.dc.CloudObject;return this}Lk(a,b,c){a=new olympe.dc.X.Dc(a,a.Oa(),b,c);this.X.push(a);this.valueType=
570
+ a.Yb()||olympe.dc.CloudObject;return this}Yv(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.R());void 0===c&&(c=e.Oa())}a=new olympe.dc.X.Be(b,c);this.X.push(a);this.valueType=a.Yb()||olympe.dc.CloudObject;return this}Ht(){this.sb(olympe.dc.CloudObject.instancesRel);return this}Ue(a){var b=this.ua.pop();b===Cf.El&&(a=new olympe.dc.V.kd(a),b=this.ua.pop());switch(b){case Cf.Ko:b=this.X.pop().C;b instanceof olympe.dc.V.Ud?(b=b.V,b.push(a),a=new olympe.dc.V.Ud(...b)):a=new olympe.dc.V.Ud(b,
571
+ a);b=this.ua.pop();break;case Cf.Lo:b=this.X.pop().C,b instanceof olympe.dc.V.ae?(b=b.V,b.push(a),a=new olympe.dc.V.ae(...b)):a=new olympe.dc.V.ae(b,a),b=this.ua.pop()}b===Cf.El&&(a=new olympe.dc.V.kd(a),this.ua.pop());this.X.push(new olympe.dc.X.rc(a));return this}Tv(a,b,c){return this.Ue(new olympe.dc.V.Gc(Df(a,c),new olympe.dc.na.Dd(b)))}contains(a,b,c=!1,d){return this.Ue(new olympe.dc.V.Sc(Df(a,d),new olympe.dc.na.Dd(b),c))}rh(a){if(!(a instanceof Array))throw new Ff('instanceOf','Provided argument "models" must be an array.');
572
+ const b=[];for(let c=0;c<a.length;c++)b.push(Ef(a[c]));return this.Ue(new olympe.dc.V.jf(b))}Tk(a){return this.Ue(new olympe.dc.V.Gc(new olympe.dc.na.qf,new olympe.dc.na.Dd(Ef(a))))}Uv(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.not().Tk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().not().Tk(a[b])}return this}jj(a,b){if(!(a instanceof Array))throw new Ff('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];
573
+ a.forEach(e=>{c.push(e);d.push(e.Oa())});return this.Ue(new olympe.dc.V.hf(c,d,b))}Sk(a,b,c){a=Df(a,c);return this.Ue(new olympe.dc.V.ye(a,new olympe.dc.na.Dd(b)))}xj(a,b,c){a=Df(a,c);return this.Ue(new olympe.dc.V.Fe(a,new olympe.dc.na.Dd(b)))}Dx(a,b,c,d){a=Df(a,d);return this.Ue(new olympe.dc.V.xd(a,b,c))}filter(a){const b=new class extends olympe.dc.V.Mg{C(c,d){return a(olympe.dc.CloudObject.get(d))}};return this.Ue(b)}not(){this.ua.push(Cf.El);return this}and(){this.X[this.X.length-1]instanceof
574
+ olympe.dc.X.rc&&this.ua.push(Cf.Ko);return this}or(){this.X[this.X.length-1]instanceof olympe.dc.X.rc&&this.ua.push(Cf.Lo);return this}hl(a,b,c){a=Ef(a);let d=null;switch(olympe.dc.Na().ic(a,olympe.dm.Property.typeRel)){case olympe.dm.String.P.R():d=new olympe.dc.Db.String(new olympe.dc.na.oe(a,c));break;case olympe.dm.Number.P.R():d=new olympe.dc.Db.Number(new olympe.dc.na.ke(a,c));break;case olympe.dm.DateTime.P.R():d=new olympe.dc.Db.DateTime(new olympe.dc.na.ie(a,c))}c=d;null!==c&&this.X.push(new olympe.dc.X.Kd(c,
575
+ b));return this}sort(a,b,c){const d=new class extends olympe.dc.Db.Mg{N(e,f){return a(olympe.dc.CloudObject.get(f))}G(e,f){return b(e,f).valueOf()}};this.X.push(new olympe.dc.X.Kd(d,c));return this}Pv(){this.X.push(new olympe.dc.X.xe);return this}limit(a,b){this.X.push(new olympe.dc.X.Zd(a,b));return this}};class Ff extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
576
+ function Ef(a){return'string'===typeof a||a instanceof olympe.D.Wa?a:'function'===typeof a?olympe.dc.Ba.Rb(a):olympe.D.lb(a)?a.Dk===olympe.D.Wa?a:olympe.D.Fa([a],b=>olympe.D.Bb(olympe.dc.xa(b)),olympe.D.Wa):a.R()}m=olympe.dc.ck.prototype;m.lf.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.transform.K=olympe.D.J.N();m.jl.K=olympe.D.J.N();m.Fy.K=olympe.D.J.N();m.It.K=olympe.D.J.N();m.sb.K=olympe.D.J.N();m.aw.K=olympe.D.J.N();m.Lk.K=olympe.D.J.N();m.Yv.K=olympe.D.J.N();m.Ht.K=olympe.D.J.N();m.Ue.K=olympe.D.J.N();
577
+ m.Tv.K=olympe.D.J.N();m.contains.K=olympe.D.J.N();m.rh.K=olympe.D.J.N();m.Tk.K=olympe.D.J.N();m.Uv.K=olympe.D.J.N();m.jj.K=olympe.D.J.N();m.Sk.K=olympe.D.J.N();m.xj.K=olympe.D.J.N();m.Dx.K=olympe.D.J.N();m.filter.K=olympe.D.J.N();m.not.K=olympe.D.J.N();m.and.K=olympe.D.J.N();m.or.K=olympe.D.J.N();m.hl.K=olympe.D.J.N();m.sort.K=olympe.D.J.N();m.Pv.K=olympe.D.J.N();m.limit.K=olympe.D.J.N();olympe.dc.query.Gp=class{constructor(a){this.id=a;this.C=[];this.data=new olympe.dc.db.xc}F(a){this.C.push(olympe.dc.xa(a))}Z(){return this.id}getData(){return this.data}};function Gf(a){return olympe.D.lb(a)?'Node#'+a.Ma.Z():String(a)}function Hf(a,b){return olympe.D.lb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
578
+ olympe.dc.query.ru=class{constructor(){this.uid=0;this.values=null}add(a){let b;b=olympe.D.lb(a)?'n'+a.Ma.Z():'p'+ ++this.uid;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.$a=class{ma(){}C(){}F(){}ia(){}toString(){}};function ye(a,b,c){return c.run(()=>a.U.hb(b,c))}function ze(a,b,c){return c.run(()=>If(a.U,b,c))}
579
+ function hf(a,b,c){var d=olympe.dc.Ha.rb;const e=b.Z();let f=Jf(a.ta,e),g=olympe.dc.Ha.rb;null===f&&(f=gf(b,a.G),a.N||(g=of(f)));Kf(a.ta,f,d,g);c&&Te(a.F,e,c);b=olympe.dc.ga.ja.Ai;const h=olympe.dc.ga.ja.zi,k=l=>{if(null!==l){a.L.error(`graph subscription "${e}" failed to subscribe ${l}`);Lf(a.ta,e,d);var n=a.F;Ue(n,e,n.F);c(l,null)}};g===olympe.dc.Ha.rb?(a.L.debug('QueryManager: [ID:',e,'] GraphQuery processed locally'),a.Y.process(d,f,k)):(b=M(new olympe.dc.ga(f.qh.N===olympe.dc.Ed.Li?h:b,f,[g]),
580
+ k),a.L.debug('QueryManager: [ID:',e,'] sending GraphQuery to',g),a.C.send(b));return f}function jf(a,b){var c=olympe.dc.Ha.rb;const d=olympe.dc.Ha.rb;if(c===d){const e=Jf(a.ta,b).qh.N,f=Mf(a.ta,b);Lf(a.ta,b,c)&&f!==d&&e===olympe.dc.Ed.SUBSCRIBE&&(c=M(new olympe.dc.ga(olympe.dc.ga.ja.Uo,String(b),[f]),g=>{g&&a.L.error(`Unsubscription of graphdef ${b} failed: ${g.message}`)}),a.C.send(c))}else Lf(a.ta,b,c)}
581
+ function kf(a,b,c){var d=olympe.dc.Ha.rb;b=gf(b,a.G);const e=b.Z();var f=a.F.C.has(e);c&&Te(a.F,e,c);if(!f){f=h=>{if(h){var k=a.F;Ue(k,e,k.F);c(h,null)}};var g=of(b);g===olympe.dc.Ha.rb?a.Y.process(d,b,f):(d=M(new olympe.dc.ga(olympe.dc.ga.ja.zi,b,[g]),f),a.C.send(d))}}
582
+ function Af(a,b){var c=olympe.dc.Ha.rb;const d=b.Od();var e=new olympe.dc.query.ru;let f;f=d;olympe.D.lb(f)&&(f=e.add(d));b=(b=b.Rl())?Array.isArray(b)?b:[b]:null;const g=olympe.dc.query.Subscription.G(f,b,e);e=Nf(a.ta,g);null===e&&(a.L.debug('QueryMGR: new',a.N?'local':'remote','subscription "',g,'": #',`${f},`,b),e=new olympe.dc.query.Subscription(g,d,b,a.G),a.N||e.qe());a.Sa.process(c,e,h=>{h&&(Of(a.ta,g,c||olympe.dc.Ha.rb),a.L.error(`subscription "${g}" failed to subscribe ${h}`))});return e}
583
+ function Bf(a,b){var c=olympe.dc.Ha.rb;if(c===olympe.dc.Ha.rb){const d=Mf(a.ta,b);a.L.debug('QueryMGR: [ID:',b,'] - Unregistered');Of(a.ta,b,c)&&d!==olympe.dc.Ha.rb&&(c=M(new olympe.dc.ga(olympe.dc.ga.ja.Ou,String(b),[d]),e=>{e&&a.L.error(`Unsubscription of listdef ${b} failed, ${e.message}`)}),a.C.send(c))}else Of(a.ta,b,c)}
584
+ function Pf(a){const b=olympe.dc.ga.ja.Vo,c=olympe.dc.ga.ja.yl,d=olympe.dc.ga.ja.zp;a.C.C(olympe.dc.ga.ja.Hl,(e,f)=>{Qf(a,f,e)});a.C.C(b,(e,f)=>{Rf(a,f,e)});a.C.C(c,(e,f)=>{a.aa.$e(f,e)});a.C.C(d,(e,f)=>{Sf(a,f,e)});a.C.ra((e,f)=>{Tf(a,f,e)})}function Uf(a,b){a.L.log('Received subscribeToAll command');b=b?olympe.D.Ja().Cb(b):void 0;const c=new olympe.dc.ga(olympe.dc.ga.ja.Qg,null,[olympe.dc.Ha.Vc]);b&&M(c,b);a.C.send(c)}
585
+ function Qf(a,b,c=olympe.dc.Ha.rb){b.destination!==olympe.dc.Ha.rb?a.L.error(`Graphdefs registered from peers is not supported yet ! (id: ${b.Z()})`):a.ra.process(c,b,d=>{d&&a.L.error(`An error occurred during the process of a graphdef result ${b.Z()}: ${d.message}`)})}
586
+ function Rf(a,b,c=olympe.dc.Ha.rb){const d=Vf(a.ta,b.Z());0!==d.length&&(1<d.length||d[0]!==olympe.dc.Ha.rb?a.L.error(`Notification received for graphdefs subscription registered from peers. Not supported yet ! (id: ${b.Z()})`):a.ka.process(c,b,e=>{e&&a.L.error(`An error occurred during the process of a graphNotification ${b.Z()}`)}))}
587
+ function Sf(a,b,c=olympe.dc.Ha.rb){const d=Wf(a.ta,b.Z());1<d.length||d[0]!==olympe.dc.Ha.rb?a.L.error(`Listdefs registered from peers is not supported yet ! (id: ${b.Z()})`):a.Da.process(c,b,e=>{e&&a.L.error(`An error occurred during the process of a listNotification ${b.Z()}`)})}
588
+ function Tf(a,b,c){a.L.debug('Source event',b,'received for source',c);if(b===olympe.dc.tk.Xp){const d=(e,f)=>{f&&a.L.error(`Error after trying to resubscribe to ${e}: ${f}`)};Xf(a.ta,c).forEach(e=>{Te(a.F,e.Z(),d.bind(a,e.Z()));a.L.debug(`resubscribing graph subscription ${e.Z()} to destination : ${c}`);e=M(new olympe.dc.ga(olympe.dc.ga.ja.Ai,e,[c]),d.bind(a,e.Z()));a.C.send(e)});Yf(a.ta,c).forEach(e=>{a.L.debug(`resubscribing list subscription ${e.Z()} to destination : ${c}`);e=M(new olympe.dc.ga(olympe.dc.ga.ja.Mu,
589
+ e,[c]),d.bind(a,e.Z()));a.C.send(e)})}}olympe.dc.query.xu=class{constructor(a,b,c,d,e,f,g,h){this.L=a;this.N=b;this.C=c;this.aa=d;this.ta=e;this.F=f;this.G=new olympe.D.Wb('Query Manager context');this.Sa=g[0];this.Y=g[1];this.ra=g[2];this.ka=g[3];this.Da=g[4];this.U=h;Pf(this)}Xa(){return this.L}};olympe.dc.query.Relation=class extends olympe.dc.ta.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.R())+', ';a+='"direction": '+JSON.stringify(this.Oa())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static mc(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){return new olympe.dc.query.Relation(a.R(),a.Oa(),a instanceof olympe.dc.X.Dc)}Pc(){const a=
590
+ olympe.dc.za.DESTINATION,b=olympe.dc.za.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.Subscription=class a extends olympe.D.Cj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Wb('context subscription '+b,e));this.id=b;this.Af=c;this.X=d||null;this.G=this.U.run(()=>olympe.D.fe(olympe.dc.query.Subscription.C.INIT));this.He=!1;this.ka=this.Se=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].ia(d);else e+='|null';e=olympe.W.mb(e)}catch(f){e=olympe.W.nc()}return e}Z(){return this.id}Od(){return this.Af}Bg(){return this.X}qe(){const b=
591
+ olympe.dc.Na(),c=olympe.D.Ya(this.Od());return c?b.Vf(c)?b.source(c)||olympe.dc.Ha.Vc:olympe.dc.Ha.rb:olympe.dc.Ha.Vc}th(){const b=this.G.Ma.Ib;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.Mq}ii(){if(this.G.Ma.yb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.Se;this.Se=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);pb(this.G,olympe.D.fe(olympe.dc.query.Subscription.C.Mq))}Bf(){return olympe.D.Fa([this.G],()=>{},olympe.D.qa)}Y(){const b=
592
+ this.G.Ma.Ib;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.sq}Ke(b,c){this.Y()?b(this):(null===this.ka&&(this.ka=new Map),void 0===c&&(c=olympe.W.nc()),this.ka.set(c,olympe.D.Ja().Cb(b)));return c||''}pj(b){null!==this.ka&&b&&this.ka.delete(b)}be(){const b=olympe.dc.query.Subscription.C.sq;if(!this.G.Ma.yb()&&olympe.D.Ya(this.G)!==b&&(this.wf(),pb(this.G,b),null!==this.ka)){for(const c of this.ka.values())c(this);this.ka=null}}onDestroy(b){this.U.onDestroy(b)}release(){this.U.destroy()}fc(b){if(!this.G.Ma.yb()){for(let c=
593
+ 0,d=b.length;c<d;c++)this.Cm(b[c],c);if(this.Y())this.wf();else{this.He=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.be()}}}Ld(b){const c=this.F;for(let d in c)Object.prototype.hasOwnProperty.call(c,d)&&b(c[d],d)}zc(b,c){if(!this.G.Ma.yb()&&(this.Fk(b,olympe.dc.CloudObject.get(c)),b=this.Y(),this.He&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,
594
+ d)){b=!1;break}b&&this.be()}}Xc(b){this.G.Ma.yb()||(this.Bm(b),this.Ti(b,!this.Y()))}Tg(){return this.Y()?super.Tg():'Subscription is not ready!'}Pf(){const b=olympe.D.Ya(this.Od());return olympe.dc.query.Subscription.F(b,this.Bg())}static F(b,c){var d=new olympe.dc.gf(b,olympe.dc.Ed.SUBSCRIBE);if(null===c)return[d];b=[];b.push(d);for(let e=0,f=c.length;e<f;e++){const g=c[e];if(g instanceof olympe.dc.X.Qb||g instanceof olympe.dc.X.Dc)b.forEach(h=>{const k=olympe.dc.query.Relation.from(g);h.sb(k,k.recursive)});
595
+ else if(g instanceof olympe.dc.X.sf)d=a.F(olympe.D.Ya(g.Od()),g.Bg()),b.push(...d);else if(g instanceof olympe.dc.X.rc||g instanceof olympe.dc.X.Kd){const h=g.F();b.forEach(k=>{for(const l of h){for(const n of l)k.sb(n,n.recursive);ve(k,l.length)}})}}return b}};olympe.dc.query.Subscription.C={INIT:0,Mq:1,sq:2};olympe.dc.query.Subscription.prototype.Tg.K=olympe.D.J.C;function Nf(a,b){return a.F.has(b)?a.F.get(b).F():null}function Of(a,b,c){return Zf(a,a.F,b,c)}function Mf(a,b){for(const [c,d]of a.N)if(d.has(b))return c;return null}function Jf(a,b){return a.C.has(b)?a.C.get(b).F():null}function Kf(a,b,c,d){const e=b.Z();let f=a.C.get(e);void 0===f&&(f=new olympe.dc.query.ta.nt(b,a.Y,a),a.C.set(e,f));f.N(c);$f(a,e,d)}function Lf(a,b,c){return Zf(a,a.C,b,c)}function Vf(a,b){return(a=a.C.get(b))?Array.from(a.C.keys()):[]}
596
+ function Wf(a,b){return(a=a.F.get(b))?Array.from(a.C.keys()):[]}function Xf(a,b){const c=new Set;(a.N.get(b)||new Set).forEach(d=>{(d=a.C.get(d))&&c.add(d.F())});return c}function Yf(a,b){const c=new Set;(a.N.get(b)||new Set).forEach(d=>{(d=a.F.get(d))&&c.add(d.F())});return c}function ag(a,b,c){a=a.F.get(b);if(void 0===a)throw Error(`Check if the subscription ${b} has been processed, but it has never been registered`);b=a.G.get(c);a.G.set(c,!0);return b||!1}
597
+ function $f(a,b,c){let d=a.N.get(c);d?d.add(b):(d=(new Set).add(b),a.N.set(c,d))}function bg(a,b,c){var d=olympe.dc.Ha.rb;const e=b.Z();let f=a.F.get(e);void 0===f&&(f=new olympe.dc.query.ta.$t(b,a.Y),a.F.set(e,f));f.N(c);$f(a,e,d)}function Zf(a,b,c,d){if(!b.has(c))return!1;const e=b.get(c);var f=e.C.get(d)-1;0===f?(e.C.delete(d),e.G.delete(d),f=0===e.C.size):(e.C.set(d,f),f=!1);return f?((d=Mf(a,c))&&a.N.get(d).delete(c),e.F().release(),b.delete(c),!0):0===e.C.get(d)}
598
+ function cg(a,b){const c=b.Z();let d=a.G.get(c);d||(d=new olympe.dc.query.ta.yu(b),a.G.set(c,d));d.counter++;return d}function dg(a,b){(a=a.G.get(b))&&a.update()}function eg(a,b,c){const d=a.C.get(b);d?c instanceof olympe.dc.query.Subscription?fg(d,c):gg(d,c):a.L.error(`Try to set the subscription ${c.Z()} as covered by a graphquery that is not registered (${b}).`)}
599
+ olympe.dc.query.Tu=class{constructor(a,b){this.L=a;this.C=new Map;this.F=new Map;this.G=new Map;this.U=new Set;this.N=new Map;this.Y=b}};olympe.dc.Wc=class{ma(){}Yb(){}getTransform(){}ia(){}toString(){}};olympe.dc.nq=class{F(){}};olympe.dc.uf=class{ma(){}getValue(){}C(){}ia(){}toString(){}};olympe.dc.query.O={Ea:'olympe.dc.query.Logger',va:'olympe.dc.query.QueryManager'};olympe.dc.query.Mb={Qe:'olympe.dc.query.SubscriptionRegistry',Hj:'olympe.dc.query.CallbackRegistry',Xo:'olympe.dc.query.GraphProcessor',Wo:'olympe.dc.query.GraphNotificationProcessor',Yo:'olympe.dc.query.GraphResultProcessor',Ap:'olympe.dc.query.ListProcessor',bk:'olympe.dc.query.ListNotificationProcessor',pq:'olympe.dc.query.QueryProcessor',ul:'olympe.dc.query.CoverageProcessor'};olympe.dc.query.Config={Nq:'subscription.debug'};
600
+ olympe.T.config(function(a){D(a,olympe.dc.query.Config.Nq,!1);C(a,olympe.dc.query.O.Ea,[olympe.pa.O.va],b=>b.Nc('dc.query'));A(a,olympe.dc.query.Mb.Qe,olympe.dc.query.Tu,olympe.dc.query.O.Ea,new olympe.T.fa(olympe.dc.query.Config.Nq));A(a,olympe.dc.query.Mb.Hj,olympe.dc.query.Js,olympe.dc.query.O.Ea);A(a,olympe.dc.query.Mb.Ap,olympe.dc.query.Ub.Ip,olympe.dc.query.O.Ea,olympe.dc.O.vi,olympe.dc.query.Mb.Qe,olympe.dc.query.Mb.ul,olympe.dc.transaction.O.va,new olympe.T.fa(olympe.dc.Config.Yg));A(a,olympe.dc.query.Mb.Xo,
601
+ olympe.dc.query.Ub.cp,olympe.dc.query.O.Ea,olympe.dc.query.Mb.Qe,new olympe.T.fa(olympe.dc.Config.Yg));A(a,olympe.dc.query.Mb.Yo,olympe.dc.query.Ub.ep,olympe.dc.query.O.Ea,olympe.dc.query.Mb.Qe,olympe.dc.query.Mb.Hj);A(a,olympe.dc.query.Mb.Wo,olympe.dc.query.Ub.bp,olympe.dc.query.O.Ea,olympe.dc.query.Mb.Qe);A(a,olympe.dc.query.Mb.bk,olympe.dc.query.Ub.Hp,olympe.dc.query.O.Ea,olympe.dc.O.vi,olympe.dc.query.Mb.Qe);A(a,olympe.dc.query.Mb.pq,olympe.dc.query.Ub.zu,olympe.dc.query.O.Ea,olympe.dc.query.Mb.Qe,
602
+ olympe.dc.query.Mb.ul,olympe.dc.query.Mb.Hj,olympe.dc.O.me,olympe.dc.db.O.va);A(a,olympe.dc.query.Mb.ul,olympe.dc.query.Ub.Ms,olympe.dc.query.O.Ea,olympe.dc.query.Mb.Qe,olympe.dc.transaction.O.va);C(a,olympe.dc.query.O.va,[olympe.dc.query.O.Ea,new olympe.T.fa(olympe.dc.Config.Yg),olympe.dc.O.me,olympe.dc.db.O.va,olympe.dc.query.Mb.Qe,olympe.dc.query.Mb.Hj,olympe.dc.query.Mb.Ap,olympe.dc.query.Mb.Xo,olympe.dc.query.Mb.Yo,olympe.dc.query.Mb.Wo,olympe.dc.query.Mb.bk,olympe.dc.query.Mb.pq],(b,c,d,e,f,
603
+ g,h,k,l,n,p,q)=>new olympe.dc.query.xu(b,c,d,e,f,g,[h,k,l,n,p],q))});olympe.T.run([olympe.dc.query.Mb.Qe],a=>{olympe.fj().subscriptions=a});olympe.dc.query.ta={};function hg(){const a=Error.stackTraceLimit;Error.stackTraceLimit=16;let b=Error().stack||'';b=b.split('\n').map(d=>d.trim());var c='Error'===b[0]?2:1;b=b.slice(c,Error.stackTraceLimit+c).reverse();c=[];for(const d of b)if(c.push(' '+d),d.includes('at ListDef.')||d.includes('at GraphDef.'))break;Error.stackTraceLimit=a;3<c.length&&(c=c.slice(c.length-3));return c.join('\n')||b.join('\n')}
604
+ olympe.dc.query.ta.Wq=class{constructor(a,b){this.C=new Map;this.G=new Map;this.U=a;this.ka=b}F(){}N(a){var b=this.C.get(a);this.C.set(a,void 0!==b?b+1:1);b=this.G.get(a);this.G.set(a,void 0!==b?b:!1)}};function fg(a,b){const c=b.Z();a.Y.set(c,b);olympe.D.Ja().onDestroy(()=>{a.Y.delete(c)})}function gg(a,b){const c=b.Z();a.aa.set(c,b);olympe.D.Ja().onDestroy(()=>{a.aa.delete(c)})}olympe.dc.query.ta.nt=class extends olympe.dc.query.ta.Wq{constructor(a,b,c){super(a,b);this.ta=c;this.Y=new Map;this.aa=new Map;b&&hg()}F(){return this.U}};olympe.dc.query.ta.$t=class extends olympe.dc.query.ta.Wq{constructor(a,b){super(a,b);this.Y=new Map}F(){return this.U}N(a){super.N(a);if(this.ka){const b='md_'+olympe.W.nc();this.Y.set(b,hg());olympe.D.Ja().onDestroy(()=>{this.Y.delete(b)})}}};olympe.dc.query.ta.yu=class{constructor(a){this.query=a;this.F=olympe.dc.Ad();this.id=a.Z();this.C=olympe.D.Kc(olympe.dc.Va);this.G=null;this.counter=0}update(){const a=olympe.D.Ya(this.C)||olympe.dc.Va.empty(),b=olympe.dc.Va.from(a,this.G);this.G.N=!1;b!==a&&(Tc(this.F,null,De(b)),this.C.update(b))}destroy(){const a=olympe.D.Ya(this.C)||olympe.dc.Va.empty();Tc(this.F,null,Ce(a))}};olympe.dc.query.Ub={};function ig(a,b,c,d,e){a.L.debug('CoverageProcessor: [ID:',d,'] - checking coverage of remote query over',b.length,'paths.');const f=new olympe.async.og(olympe.D.Ja()),g=k=>{f.add((l,n)=>{k.hb(p=>{p?n(`The query ${d} is not covered by an existing graphdef, `+`and the specific graphdef id ${k.Z()} has encountered an error: ${p}`):l()});eg(a.ta,k.Z(),c)})},h=Array.from(Xf(a.ta,olympe.dc.Ha.Vc));b.forEach(k=>{const l=gf(k);let n=!1;for(let p=0,q=h.length;p<q;p++){const r=h[p];if(r.Dr(l)){g(r.qh,!1);
605
+ n=!0;break}}n?a.L.debug('CoverageProcessor: [ID:',d,'] - graphPath',k,' is covered'):g(k,!0)});$b(f,(k,l)=>e(l));f.start()}function jg(a,b,c){const d=[b.Od()],e=g=>g instanceof olympe.dc.X.sf,f=(b.Bg()||[]).filter(e);for(const g of f)d.push(g.Od()),f.push(...(g.Bg()||[]).filter(e));oe(a.C,()=>{olympe.D.wc(d,()=>{const g=b.Pf();ig(a,g,b,b.Z(),c)})})}function kg(a,b,c,d){const e=b.Z(),f=[ue(b,c)];oe(a.C,()=>ig(a,f,b,e,d))}olympe.dc.query.Ub.Ms=class{constructor(a,b,c){this.L=a;this.ta=b;this.C=c}};olympe.dc.query.Ub.bp=class{constructor(a,b){this.L=a;this.ta=b}process(a,b,c){const d=b.Z();this.ta.C.has(d)?(Jf(this.ta,d).ra(b),olympe.dc.Ad().$e(b.data,a),c(null,b)):c(Error(`Received a notification for the graphdef ${d} which does not exist.`),b)}};olympe.dc.query.Ub.bp.la=[olympe.dc.pg];olympe.dc.query.Ub.cp=class{constructor(a,b,c){this.L=a;this.ta=b;this.C=c}process(a,b,c){var d=b.Z();if(a===olympe.dc.Ha.rb||this.ta.C.has(d)){if(c(null,b),a=Jf(this.ta,d),this.C||a&&a.N)a=olympe.dc.Ha.rb,d=new olympe.dc.query.Ci(d,a,a,new olympe.dc.db.xc),Qf(olympe.dc.Lf(),d)}else c(Error('The local Graph Engine is not implemented yet. It should handle Graphdefs addressed to instances owned by this local OVM'),b)}};olympe.dc.query.Ub.cp.la=[olympe.dc.pg];olympe.dc.query.Ub.ep=class{constructor(a,b,c){this.L=a;this.C=b;this.F=c}process(a,b,c){const d=b.Z();if(this.C.C.has(d)){const f=Jf(this.C,d);if(b instanceof olympe.dc.query.errors.Vj)Lf(this.C,d,a);else if(!f.N){f.ka(b);const g=olympe.dc.Ad();Tc(g,f.Y());g.$e(b.Bc,b.destination);f.onDestroy(()=>{Tc(g,null,f.Y())});qf(f)}}let e;b instanceof olympe.dc.query.errors.Vj&&(e=`graph subscription "${d}" failed to create the initial result: ${b.aa()}`,this.L.error(e));We(this.F,b.Z(),b);c(e?Error(e):null,
606
+ b)}};olympe.dc.query.Ub.ep.la=[olympe.dc.pg];const lg=[],mg=new Map;function ng(a,b,c,d){yc(a.db,d,e=>{e?b.Dg(c)?a.L.warn('Adding the same index twice (should never happen) for sub #'+b.Z()+', index #'+c+', tag #'+d):b.zc(c,d):og(a,b,c,d)},c)}function og(a,b,c,d){zc(a.db,d,c,!0);b.Xc(c);lg.length=0;b.Ld(function(e,f){lg[e]=f});c=a=0;for(d=lg.length;a<d;a++)'string'===typeof lg[a]&&(lg[c++]=lg[a]);lg.length=c;b.fc(lg)}
607
+ olympe.dc.query.Ub.Hp=class{constructor(a,b,c){this.L=a;this.db=b;this.ta=c}process(a,b,c){const d=b.Z();a=b.C;const e=Nf(this.ta,d);if(null===e)c(Error(`Received list notification for undefined subscription "${d}"`),b);else{lg.length=a.length;e.Ld((f,g)=>{if(f=e.kh(g)){f=f.R();var h=mg.get(f);void 0===h?mg.set(f,g):'string'===typeof h?mg.set(f,[h,g]):h.push(g)}else this.L.warn('Subscription #'+d+' has a rank for index #'+g+' but no instance. This is caused by receiving a new list notification before receiving all instances of the previous list notification.')});
608
+ for(let f=0,g=a.length;f<g;f++){const h=a[f];let k=mg.get(h);void 0===k?(k=olympe.W.nc(),ng(this,e,k,h)):'string'===typeof k?mg.delete(h):(k=k.pop(),0===k.length&&mg.delete(h));lg[f]=k}for(const [f,g]of mg){if('string'===typeof g)og(this,e,g,f);else for(let h=0,k=g.length;h<k;h++)og(this,e,g[h],f);mg.delete(f)}e.fc(lg);c(null,b)}}};olympe.dc.query.Ub.Hp.la=[olympe.dc.pg];function pg(a,b,c,d){const e=c.Z();a.L.debug('ListProcessor: [ID:',e,'] - processing with source ',b);bg(a.ta,c,b);if(ag(a.ta,e,olympe.dc.Ha.rb))a.L.debug('ListProcessor: [ID:',e,'] - id already processed');else{a.L.debug('ListProcessor: [ID:',e,'] - NOT processed yet.');const f=c.qe();a.F||f===olympe.dc.Ha.rb?(a.L.debug('QueryMGR: [ID:',e,'] - Local subscription, no need for coverage check, booting subscription '),qg(a,c)):c.Fh().run(()=>{jg(a.C,c,g=>{g?a.L.error(g):qg(a,c)})})}b===olympe.dc.Ha.rb||
609
+ ag(a.ta,e,b)||a.notify(b,c);d(null,c)}
610
+ function qg(a,b){if(b.Y())a.L.debug('ListProcessor: [ID:',b.Z(),'] - Subscription already booted, ignoring');else{a.L.debug('ListProcessor: [ID:',b.Z(),'] - Booting subscription');var c=new olympe.dc.pc.Vq(a.db,a.L),d=rg(a,b,c),e=b.Z();b.Fh().run(()=>{olympe.D.wc([b.Od()],f=>{const g=olympe.dc.xa(f);a.L.debug('ListProcessor: [ID:',b.Z(),'] - Booting with baseTag',g);b.th()||b.ii();yc(a.db,g,h=>d(h,g),e);olympe.D.Ja().vc(()=>zc(a.db,g,e));a.db.Gb(g.valueOf())||sg(c);b.Y()||(sg(c),b.fc([]))})})}}
611
+ function rg(a,b,c){const d=new olympe.dc.pc.Fj;let e=!1;const f=b.Fh(),g=b.Bg(),h=[];h[g?g.length:0]=f.Cb((k,l,n,p)=>{f.gd()||f.yb()||(k?b.Dg(n)?a.L.warn('Adding the same index twice (should never happen) for sub #',b.Z(),', index #',n,', tag #',l):(a.L.debug('ListProcessor: [ID:',b.Z(),'] - Adding Instance',l,'to the subscription'),b.zc(n,l)):(a.L.debug('ListProcessor: [ID:',b.Z(),'] - Removing Instance',l,'from the subscription'),b.Xc(n)),e||(tg(c,()=>{p.tg();sg(c)}),p.Qc().Jg(b.fc.bind(b)),e=!0),
612
+ ug(c,n))});if(null!==g){const k=olympe.dc.Qc();for(let l=g.length-1;0<=l;l--)h[l]=f.Cb(g[l].getTransform(k,c,h[l+1]))}return(k,l)=>{const n=b.Z();c.register(n,null);const p=d.C(k,l,n,null);if(null!==p)h[0](k,l,n,vg(p,k,l,n))}}
613
+ olympe.dc.query.Ub.Ip=class{constructor(a,b,c,d,e,f){this.L=a;this.db=b;this.ta=c;this.C=d;this.F=f}process(a,b,c){pg(this,a,b,c)}notify(a,b){const c=b.Z();this.L.debug(`Register notification of list subscription ${c} for destination ${a}`);const d=()=>{const f=new olympe.dc.query.Gp(c);b.ce(g=>f.F(g));Sf(olympe.dc.Lf(),f)};let e=!1;b.forEach(()=>{e&&d()});b.Ke(()=>{e=!0;d()})}};olympe.dc.query.Ub.Ip.la=[olympe.dc.pg];function If(a,b,c){const d=b.Z(),e=b.source||b.db.source(b.G)||olympe.dc.Ha.bc,f=a.ta.G.has(d),g=cg(a.ta,b);return new rxjs.Observable(h=>{c.run(()=>{olympe.D.wc([g.C.Eb()],h.next.bind(h))});const k=()=>{l&&c.vn(l);{var n=a.ta;const q=n.G.get(d);var p;if(p=q)p=q,0<p.counter?p.counter--:olympe.pa.Xa('dc').warn('Try to decrement counter of query metadata below 0. Investigate...'),p=0===p.counter;p&&(q.destroy(),n.G.delete(d),n.U.delete(d))}},l=c.vc(k);if(!f)if(e===olympe.dc.Ha.Vc)kg(a.N,b,!0,n=>{n?
614
+ (h.error(n),k()):wg(a,d,b,g,c)});else if(e===olympe.dc.Ha.rb)wg(a,d,b,g,c);else{const n=M(Bc(new olympe.dc.ga(olympe.dc.ga.ja.om,b,[e]),c),p=>{p&&(h.error(p.message),k())});a.G.send(n)}return k})}
615
+ function xg(a){const b=olympe.dc.ga.ja.nm,c=(d,e)=>Fe(d,f=>{Tc(a.F,Array.from(f.de()).filter(g=>g.se()).map(g=>g.tag()));a.F.$e(f,e)},e);a.G.C(olympe.dc.ga.ja.QUERY_RESULT,(d,{i:e,r:f,s:g})=>{d=c(f,g);null===d?(d=a.C,Ve(d,e,`Error while deserialization of QueryResult for query ${e}`,d.G,`Query result of query ${e} has no associated handler in the datacloud`)):(f=a.C,Ve(f,e,d,f.G,`Query result of query ${e} has no associated handler in the datacloud`))});a.G.C(b,(d,{i:e,r:f,s:g})=>{if(d=c(f,g))if(e=
616
+ a.ta.G.get(e))f=olympe.D.Ya(e.C),f&&f.hash===d.hash||(Tc(e.F,null,De(d)),e.C.update(d))});Sc(a.F,()=>{var d=a.ta;for(const e of d.U)dg(d,e);d.U.clear()})}
617
+ function wg(a,b,c,d,e){const f=new olympe.dc.da.lq(c);Je(f,()=>{var p=a.ta;p.G.has(b)&&p.U.add(b)});d.G=f;let g=(p,q)=>{p?a.L.debug(`New result tuple for query ${b}, ${q}`):a.L.debug(`Removed result tuple for query ${b}, ${q}`)};d=c.C;const h=d.reduce((p,q)=>{p.push(q.F(p[p.length-1]));return p},[0]);for(let p=d.length-1;0<=p;p--)g=d[p].observe(f,h[p],g);const k=a.F.view,l=c.G,n=yc(k,l,(p,q)=>{p?f.insert(q,0,null):f.remove(q,0,null);g(p,q,null,b)});e.vc(()=>zc(k,l,n));dg(a.ta,b)}
618
+ olympe.dc.query.Ub.zu=class{constructor(a,b,c,d,e,f){this.L=a;this.ta=b;this.N=c;this.C=d;this.G=e;this.F=f;xg(this)}hb(a,b){return new Promise((c,d)=>{var e=a.source||a.db.source(a.G)||olympe.dc.Ha.bc;if(e===olympe.dc.Ha.Vc)kg(this.N,a,!1,f=>{f?d(f):c(this.bd(a))});else if(e===olympe.dc.Ha.rb)c(this.bd(a));else{const f=a.Z(),g=this.C.C.has(f),h=l=>{var n=this.C;Ue(n,f,n.G);d(l||`The execution of the query ${f} has been interrupted`)},k=b.vc(h);Xe(this.C,f,(l,n)=>{b.vn(k);l?d(l.message):(b.vc(()=>
619
+ {Tc(this.F,null,Ce(n))}),c(n))});g||(e=M(Bc(new olympe.dc.ga(olympe.dc.ga.ja.mm,a,[e]),b),l=>l&&h(l.message)),this.G.send(e))}})}bd(a){const b=new olympe.dc.da.lq(a);Je(b,()=>{});b.insert(a.G,0,null);let c=0;for(const d of a.C)d.hb(b,c),c=d.F(c);return olympe.dc.Va.from(olympe.dc.Va.empty(),b)}};olympe.dc.query.errors={};olympe.dc.query.errors.Vj=class extends olympe.dc.query.Ci{constructor(a,b,c,d){super(a,b,c,new olympe.dc.db.xc);this.error=d}aa(){return this.error}};olympe.dc.pc={};function vg(a,b,c,d){b?a.U[d]=c:delete a.U[d];null===a.F&&(a.F=new olympe.dc.pc.Mj(a.C,a));return a.F}function yg(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function zg(a,b){a=a.U;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.pc.Mj=class{constructor(a,b){this.C=a;this.parent=b||null;this.aa=b?b.aa+1:0;this.U=Object.create(null);this.F=null}Qc(){return this.C}tg(){this.C.U()?this.C.G():this.C.aa(this.aa-1)}};olympe.dc.pc.sa=class{constructor(){}C(){}U(){}aa(){}G(){}Jg(){}};olympe.dc.pc.Fj=class{constructor(){this.Y=this.N=this.index=this.F=null}U(){return null!==this.F}aa(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.N;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.pc.Mj(this),this.index=c,this.N=b):this.N=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.Y){const a=
620
+ [];null!==this.N&&(0<=this.F?zg(yg(this.N,this.F),a):a.push(this.index));this.Y(a)}}Jg(a){this.Y=a}};olympe.dc.pc.Fj.la=[olympe.dc.pc.sa];function Ag(a,b){olympe.D.Uf(a.value)?(a.node=olympe.D.bl(a.value,b),Wa(a.node)||b()):b()}function Bg(a,b){if(olympe.D.Uf(a.value)){const c=olympe.D.Ja(),d=a.N;olympe.D.wc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>Ag(a,b)),olympe.D.Ja().destroy())})}}
621
+ class Cg extends olympe.dc.pc.Mj{constructor(a,b,c){super(a);this.index=b;this.value=c;this.N=this.Ya();this.position=this.node=null;this.Y=!1;this.G=null}Ya(){const a=olympe.D.Ya(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}yb(){return null===this.value}}
622
+ function Dg(a,b){if(!b.yb()){var c=a.F;const d=a.Da,e=b.Ya();let f=0,g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].N,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].N,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.N=b.Ya();c!==b.position&&(a.insert(b,c),b.Y&&a.G())}}function Eg(a){const b=a.Da;a.F.sort((c,d)=>b(c.Ya(),d.Ya()))}
623
+ olympe.dc.pc.Uq=class{constructor(a){this.Da=a;this.N=null;this.F=[];this.Y=[];this.ka=null;this.ra=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new Cg(this,c,d),this.ra.set(b,f),this.U()?Ag(f,()=>Dg(this,f)):(f.position=e.length,e.push(f));else{f=this.ra.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ra.delete(b);null!==f.position&&(this.U()?this.remove(f):delete e[f.position]);f.destroy()}return f}U(){return null!==this.N}aa(a){if(null!==this.N)throw Error('Manager already activated (depth='+
624
+ this.N+')');this.N=a;Eg(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;Bg(d,()=>Dg(this,d))}this.G()}G(){if(null===this.N)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.Y.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.Y){var b=e,c=this.N;b.Y=!0;b.G=yg(b,c)}0>this.N?this.Y.push(e.index):e.G&&zg(e.G,this.Y)}this.ka&&this.ka(this.Y)}Jg(a){this.ka=a}insert(a,b){const c=this.F;var d=c.length;let e=a.position;null===
625
+ e&&(e=d);if(b<e)for(d=e;d>b;d--)c[d]=c[d-1],c[d].position=d;else for(d=e;d<b;d++)c[d]=c[d+1],c[d].position=d;c[b]=a;c[b].position=b}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.pc.Uq.la=[olympe.dc.pc.sa];class Fg extends olympe.dc.pc.Mj{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.ka=this.Y=this.N=!1;this.G=null}}
626
+ function Gg(a,b,c,d,e){const f=Object.create(null),g=a.order,h=a.N;let k,l,n;a.ra=!0;l=0;for(n=g.length;l<n;l++)f[g[l]]=null;g.length=0;l=c;for(n=Math.min(b.length,d);l<n;l++)k=b[l],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.N||(c.N=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.N&&(c.N=!1,e(!1,c.tag,c.index,c)),c.Y&&(c.G=null,delete h[k]),delete f[k]);a.ra=!1;null!==a.F&&a.G()}
627
+ olympe.dc.pc.Xl=class{constructor(){this.N={};this.order=[];this.F=null;this.ra=!1;this.Y=[];this.ka=null}U(){return null!==this.F}aa(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.ra){var a=this.order,b=a.length,c=this.N,d;for(d=this.Y.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.Y.push(e.index);else{if(!e.ka){var f=e,g=this.F;f.ka=!0;
628
+ f.G=yg(f,g)}null!==e.G&&zg(e.G,this.Y)}}this.ka&&this.ka(this.Y)}}Jg(a){this.ka=a}C(a,b,c){let d=this.N[c];a?void 0===d?(d=new Fg(this,c,b),this.N[c]=d):(d.tag=b,d.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.pc.Xl.la=[olympe.dc.pc.sa];function sg(a){if(!a.F){for(let b in a.G)Hg(a.G[b]);a.F=!0}a.N=null;a.U=null}function tg(a,b,c){a.G[c||'root'].N=b}function ug(a,b,c){a.G[c||'root'].tg(b)}function Ig(a,b,c,d){const e=a.U,f=b+d+c;let g=e[f];void 0===g&&(g=Hd(a.db,b,c,d),e[f]=g);return g}function Jg(a,b){a.F||a.C.tg(b)}function Kg(a,b,c,d,e){if(!a.F){let f=Ig(a,c,d,e||olympe.dc.za.DESTINATION);e||(f+=Ig(a,c,d,olympe.dc.za.ORIGIN));0===f&&Jg(a,b)}}
629
+ function Lg(a,b){const c=a.G[b];void 0!==c?(a.L&&a.L.debug('Set current block to',b,null!==c.parent?'parent = '+c.parent.Z():''),a.C=c):a.L&&a.L.error('Try to set a block that does not exists:',b)}function Mg(a){const b=String(++a.Y),c=a.C;a.G[b]=new Ng(b,c);Og(c,b);c.F||(c.F=()=>Lg(a,c.Z()));return b}function Pg(a,b){const c=a.C;a.C.F=()=>{Lg(a,c.Z());b()}}function Qg(a,b){Hg(b?a.G[b]:a.C)}
630
+ olympe.dc.pc.Vq=class{constructor(a,b){this.db=a;this.L=b||null;this.N=Object.create(null);this.U=Object.create(null);this.F=!1;this.Y=0;this.C=new Ng('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=Ig(this,c,d,e),d=this.N[b]||0,this.N[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function Og(a,b){null===a.children&&(a.children=Object.create(null));a.children[b]=!1}function Hg(a){a.G=!0;null!==a.parent&&a.parent.notify(a.id)}
631
+ class Ng{constructor(a,b){this.id=a;this.parent=b||null;this.C=this.N=this.F=this.children=null;this.G=!1}Z(){return this.id}tg(a){const b=this.N;if(this.G||this.C===a||null===a)b&&b(),!b&&Hg(this)}notify(a){const b=this.F,c=this.children;if(this.G)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.na={};olympe.dc.na.qf=class{ma(){return O(olympe.dc.na.qf)}C(){return[]}getValue(a,b){return b}ia(){return'{"c":"'+this.ma()+'","a":[]}'}toString(){return'Tag()'}};N('olympe.dc.valuedefs.Tag',olympe.dc.na.qf);olympe.dc.na.qf.la=[olympe.dc.uf];olympe.dc.na.Dd=class{constructor(a){this.value=a}ma(){return O(olympe.dc.na.Dd)}C(){return[]}getValue(){return this.value}ia(a){a=Hf(a,this.value);return`{"c":"${this.ma()}","a":[${a}]}`}toString(){return`Constant(${Gf(this.value)})`}};N('olympe.dc.valuedefs.Constant',olympe.dc.na.Dd);olympe.dc.na.Dd.la=[olympe.dc.uf];function Rg(a,b,c,d){const e=olympe.dc.Na(),f=new olympe.dc.pc.Fj,g=new olympe.dc.pc.Vq(e);let h=!1;const k=Object.create(null),l=r=>{if(0<r.length)for(const t in k)r[0]===t&&d(k[t])};let n=(r,t,u,v)=>{const w=olympe.D.Ja();w.gd()||w.yb()||(h||(tg(g,()=>{v.tg();sg(g)}),v.Qc().Jg(l),h=!0),r?k[u]=t:delete k[u],ug(g,u))};const p=olympe.D.Ja();if(null!==c)for(let r=c.length-1;0<=r;r--)n=c[r].getTransform(a,g,p.Cb(n));n=p.Cb(n);const q=olympe.W.nc();yc(e,b,(r,t)=>{g.register(q,null);const u=f.C(r,b,q,
632
+ null);n(r,t,q,vg(u,r,b,q))},q);p.onDestroy(()=>{zc(e,b,q)});e.Gb(b)||sg(g)}function Sg(a,b,c){const d=c.node,e=olympe.dc.Na(),f=a.G(),g=Bd(e,b,a.Ze,d.Cb(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>e.F(b,a.Ze,g))}
633
+ olympe.dc.na.Lc=class{constructor(a,b,c){this.Ze=a&&a.R?a.R():a;this.X=b&&b.filter(d=>d instanceof olympe.dc.X.Qb||d instanceof olympe.dc.X.Dc)||null;this.F=c||null;this.defaultValue=null}ma(){}Yb(){}G(){}C(){return(this.X||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}bf(a){this.defaultValue=a;return this}Bg(){return this.X}Od(){return this.F}getValue(a,b){const c=olympe.D.Kc(this.Yb()||Object,'AbstractProperty valueType');null!==this.defaultValue&&qb(c,this.defaultValue);b=this.F||
634
+ b;null!==this.X?Rg(a,b,this.X,d=>{Sg(this,d,c)}):Sg(this,b,c);return c.Eb()}ia(a){const b=Hf(a,this.Ze),c=Hf(a,this.F);let d='null';this.X&&(d=this.X.map(function(e){return e.ia(a)}).join(','));return`{"c":"${this.ma()}","a":["${b}",${d},${c}]}`}toString(){const a=Gf(this.Ze),b=this.F?','+Gf(this.F):'';let c='';this.X&&(c=','+this.X.join(','));return this.ma().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.na.Lc.la=[olympe.dc.uf];olympe.dc.na.ke=class extends olympe.dc.na.Lc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.ke)}G(){return olympe.dc.W.Tb.Lm}Yb(){return olympe.D.ea}};N('olympe.dc.valuedefs.NumberProperty',olympe.dc.na.ke);olympe.dc.na.oe=class extends olympe.dc.na.Lc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.oe)}G(){return olympe.dc.W.Tb.Mm}Yb(){return olympe.D.Wa}};N('olympe.dc.valuedefs.StringProperty',olympe.dc.na.oe);olympe.dc.na.ue=class extends olympe.dc.na.Lc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.ue)}G(){return olympe.dc.W.Tb.Jm}Yb(){return olympe.D.qa}};N('olympe.dc.valuedefs.BooleanProperty',olympe.dc.na.ue);olympe.dc.na.ie=class extends olympe.dc.na.Lc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.ie)}G(){return olympe.dc.W.Tb.Km}Yb(){return olympe.D.jb}};N('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.na.ie);olympe.dc.na.On=class{constructor(a,b){if(olympe.D.Uf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.R();var d=olympe.dc.Na();const e=d.ic(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.Nf(e,olympe.dc.CloudObject.extendRel,olympe.dm.nf);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.P.R():d=new olympe.dc.na.oe(c,b);break;case olympe.dm.Number.P.R():d=new olympe.dc.na.ke(c,
635
+ b);break;case olympe.dm.Boolean.P.R():d=new olympe.dc.na.ue(c,b);break;case olympe.dm.DateTime.P.R():d=new olympe.dc.na.ie(c,b)}this.F=d}ma(){return this.F.ma()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ia(a){return this.F.ia(a)}toString(){return this.F.toString()}};olympe.dc.na.On.la=[olympe.dc.uf];olympe.dc.Db={};olympe.dc.Db.Number=class{constructor(a){this.C=a}ma(){return O(olympe.dc.Db.Number)}U(){return this.C.C()}N(a,b){return this.C.getValue(a,b)}G(a,b){return a!==b?a>b?1:-1:0}ia(a){return`{"c":"${this.ma()}",a:[${this.C.ia(a)}]}`}toString(){return`Number(${this.C.toString()})`}};N('olympe.dc.comparators.Number',olympe.dc.Db.Number);olympe.dc.Db.Number.la=[olympe.dc.Ne];olympe.dc.Db.String=class{constructor(a){this.C=a}ma(){return O(olympe.dc.Db.String)}U(){return this.C.C()}N(a,b){return olympe.D.Fa([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Wa)}G(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ia(a){return`{"c":"${this.ma()}",a:[${this.C.ia(a)}]}`}toString(){return`String(${this.C.toString()})`}};N('olympe.dc.comparators.String',olympe.dc.Db.String);olympe.dc.Db.String.la=[olympe.dc.Ne];olympe.dc.Db.DateTime=class{constructor(a){this.C=a}ma(){return O(olympe.dc.Db.DateTime)}U(){return this.C.C()}N(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}ia(a){return'{"c":"'+this.ma()+'",a:['+this.C.ia(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};N('olympe.dc.comparators.DateTime',olympe.dc.Db.DateTime);olympe.dc.Db.DateTime.la=[olympe.dc.Ne];let Tg=0;olympe.dc.Db.Mg=class{constructor(){this.id=Tg++}ma(){return'CustomLocalComparator#'+Tg}U(){return[]}N(){throw Error('GetComparedValue function was not implemented.');}G(){throw Error('Compare function was not implemented.');}ia(){return`{"c":"${this.ma()}"}`}toString(){return this.ma()+'()'}};olympe.dc.Db.Mg.la=[olympe.dc.Ne];olympe.dc.V={};olympe.dc.V.kd=class{constructor(a){this.G=a}ma(){return O(olympe.dc.V.kd)}F(){return this.G.F()}C(a,b){return olympe.D.bl(this.G.C(a,b),c=>!c.valueOf())}ia(a){return`{"c":"${this.ma()}","a":[${this.G.ia(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};N('olympe.dc.predicates.Not',olympe.dc.V.kd);olympe.dc.V.kd.la=[olympe.dc.$a];olympe.dc.V.Ud=class{constructor(a){this.V=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.V=this.V.concat(arguments[c]):this.V.push(arguments[c])}ma(){return O(olympe.dc.V.Ud)}F(){return this.V.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return olympe.D.cf(this.V.map(c=>c.C(a,b)),function(){for(let c=arguments.length,d=0;d<c;d++)if(!arguments[d].valueOf())return!1;return!0})}ia(a){const b=this.V.map(c=>c.ia(a));return'{"c":"'+this.ma()+'","a":['+b.join(',')+']}'}toString(){return'And('+
636
+ this.V.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.And',olympe.dc.V.Ud);olympe.dc.V.Ud.la=[olympe.dc.$a];olympe.dc.V.ae=class{constructor(a){this.V=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.V=this.V.concat(arguments[c]):this.V.push(arguments[c])}ma(){return O(olympe.dc.V.ae)}F(){return this.V.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return olympe.D.cf(this.V.map(c=>c.C(a,b)),function(){for(let c=arguments.length,d=0;d<c;d++)if(arguments[d].valueOf())return!0;return!1})}ia(a){const b=this.V.map(c=>c.ia(a));return'{"c":"'+this.ma()+'","a":['+b.join(',')+']}'}toString(){return'Or('+
637
+ this.V.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.Or',olympe.dc.V.ae);olympe.dc.V.ae.la=[olympe.dc.$a];olympe.dc.V.ll=class{constructor(a,b){this.G=a;this.N=b}ma(){}F(){return[this.G.C(),this.N.C()]}C(a,b){return olympe.D.Fa([this.G.getValue(a,b),this.N.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return this.U('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d))},Boolean)}U(){}ia(a){return'{"c":"'+this.ma()+'","a":['+this.G.ia(a)+','+this.N.ia(a)+']}'}toString(){return this.ma().replace(/^.+\./,'')+'('+this.G.toString()+','+this.N.toString()+')'}};olympe.dc.V.ll.la=[olympe.dc.$a];olympe.dc.V.Gc=class{constructor(a,b){this.G=a;this.N=b}ma(){return O(olympe.dc.V.Gc)}F(){return[this.G.C(),this.N.C()]}C(a,b){return olympe.D.Fa([this.G.getValue(a,b),this.N.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Td?c.Td(d):'object'===typeof d&&void 0!==d.Td?d.Td(c):olympe.D.Ac(c.valueOf()===d.valueOf()),olympe.D.qa,'Test equal predicate')}ia(a){return'{"c":"'+this.ma()+'","a":['+this.G.ia(a)+','+this.N.ia(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.N.toString()+
638
+ ')'}};N('olympe.dc.predicates.Equals',olympe.dc.V.Gc);olympe.dc.V.Gc.la=[olympe.dc.$a];olympe.dc.V.$s=class extends olympe.dc.V.Gc{constructor(a,b){super(a,new olympe.dc.na.Dd(b))}};olympe.dc.V.$s.la=[olympe.dc.$a];olympe.dc.V.ye=class extends olympe.dc.V.ll{constructor(a,b){super(a,b)}ma(){return O(olympe.dc.V.ye)}U(a,b){return a>b}};N('olympe.dc.predicates.Greater',olympe.dc.V.ye);olympe.dc.V.Fe=class extends olympe.dc.V.ll{constructor(a,b){super(a,b)}ma(){return O(olympe.dc.V.Fe)}U(a,b){return a<b}};N('olympe.dc.predicates.Smaller',olympe.dc.V.Fe);olympe.dc.V.Sc=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}ma(){return O(olympe.dc.V.Sc)}F(){return[this.source.C(),this.value.C()]}getValue(){return this.value}C(a,b){return olympe.D.Fa([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.Ac(c.includes(d))},olympe.D.qa)}ia(a){const b=this.source.ia(a),c=this.value.ia(a);a=Hf(a,this.G);return'{"c":"'+this.ma()+'","a":['+
639
+ b+','+c+','+a+']}'}toString(){const a=Gf(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};N('olympe.dc.predicates.Contains',olympe.dc.V.Sc);olympe.dc.V.Sc.la=[olympe.dc.$a];olympe.dc.V.xd=class{constructor(a,b,c){this.source=a;this.N=b;this.G=void 0===c?!0:c}ma(){return O(olympe.dc.V.xd)}F(){return[this.source.C()]}C(a,b){return olympe.D.cf([this.source.getValue(a,b),this.N,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return(new RegExp(d)).test(c)})}ia(a){const b=this.source.ia(a),c=Hf(a,this.N);a=Hf(a,this.G);return'{"c":"'+this.ma()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Gf(this.G);return'Regex('+this.source.toString()+
640
+ ','+this.N+','+a+')'}};N('olympe.dc.predicates.Regex',olympe.dc.V.xd);olympe.dc.V.xd.la=[olympe.dc.$a];olympe.dc.V.jf=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.xa(b))}):this.G.add(olympe.dc.xa(a))}ma(){return O(olympe.dc.V.jf)}F(){return[]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Na();let e=[];const f=()=>{e.forEach(h=>{d.C(h.tag,h.C,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.xa(olympe.dc.CloudObject))K(c,this.G.has(k)),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);this.G.has(k)?
641
+ (K(c,!0),f()):(h=new Ug(k,olympe.dc.CloudObject.extendRel),e.push(h),V(d,h.tag,h.C,g,h.id))}};a=new Ug(b,olympe.dc.CloudObject.modelRel);e.push(a);V(d,a.tag,a.C,g,a.id);c.onDestroy(f);Wa(c)||K(c,!1);return c}ia(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class Ug{constructor(a,b){this.tag=a;this.C=b;this.id=olympe.W.yg()}}N('olympe.dc.predicates.InstanceOf',olympe.dc.V.jf);olympe.dc.V.jf.la=[olympe.dc.$a];function Vg(a){return a.Ka.map(b=>b.R())}function Wg(a){return a.Ka.map(b=>b.Oa())}
642
+ olympe.dc.V.hf=class{constructor(a,b,c){this.Ka=[];this.G=c instanceof Array?c:void 0!==c?[olympe.dc.xa(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.X.Dc?this.Ka.push(new Xg(c.R(),c.Oa(),c.F,c.C)):this.Ka.push(new Xg(olympe.dc.xa(c),b[d],1,1))}ma(){return O(olympe.dc.V.hf)}F(){return[this.Ka.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.W.nc(),e=olympe.dc.Na();let f=0;a=(h,k)=>{0!==this.G.length&&!this.G.includes(k)||
643
+ c.yb()||(f+=h?1:-1,K(c,0<f))};const g=this.Ka;for(let h=g.length-1;0<=h;h--)a=Yg(g[h],e,a,d+h);yc(e,b,a,d);olympe.D.Ja().onDestroy(()=>{zc(e,b,d)});c.bf(!1);return c}ia(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(this.Ka.map(a=>a.ia()))+(0!==this.G.length?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.G.length?'#'+this.G.toString()+', ':'')+this.Ka.map(a=>a.ia())+')'}};N('olympe.dc.predicates.HasRelated',olympe.dc.V.hf);
644
+ function Yg(a,b,c,d){const e=Object.create(null);d+=olympe.W.yg();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var l=d+k;g?e[h]||(e[h]=!0,V(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.C(h,a,l))}};return(g,h)=>f(g,h,0)}class Xg extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ia(){return`${this.R()}, ${this.Oa()}, ${this.F}, ${this.C}`}}olympe.dc.V.hf.la=[olympe.dc.$a];olympe.dc.V.sl=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return olympe.D.cf([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return(Number(c)&Number(d.valueOf()))===Number(c)})}ma(){return O(olympe.dc.V.sl)}F(){return[this.value.C()]}ia(a){const b=olympe.D.lb(this.G)?this.G.Ma.Ib.valueOf():this.G.valueOf();return'{"c":"'+this.ma()+'","a":['+b+','+this.value.ia(a)+']}'}toString(){const a=olympe.D.lb(this.G)?this.G.Ma.Ib.valueOf():this.G.valueOf();return this.ma().replace(/^.+\./,'')+
645
+ '('+a.toString()+','+this.value.toString()+')'}};N('olympe.dc.predicates.BitMask',olympe.dc.V.sl);olympe.dc.V.sl.la=[olympe.dc.$a];let Zg=0;olympe.dc.V.Mg=class{constructor(){this.id=Zg++}ma(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ia(){return`{"c":"${this.ma()}"}`}toString(){return this.ma()+'()'}};olympe.dc.V.Mg.la=[olympe.dc.$a];olympe.dc.V.Ll=class{constructor(a,b,c){this.Ka=[];this.G=void 0!==c?c.map(olympe.dc.xa):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.X.Dc?this.Ka.push(new $g(c.R(),c.Oa(),c.F,c.C)):this.Ka.push(new $g(olympe.dc.xa(c),b[d],1,1))}ma(){return O(olympe.dc.V.Ll)}F(){return[this.Ka.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Na(),e=olympe.W.yg();a=(h,k,l)=>{k&&(null===this.G||this.G.includes(l))&&h(1)};const f=this.Ka;
646
+ for(let h=f.length-1;0<=h;h--)a=f[h].getTransform(d,a,e+h);let g=0;yc(d,b,a.bind(null,h=>{c.gd()||c.yb()||(g+=h,K(c,0<g))}),e);olympe.D.Ja().onDestroy(()=>zc(d,b,e));c.bf(!1);return c}ia(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(this.Ka.map(a=>a.ia()))+(null!==this.G?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.G?'#['+this.G.toString()+'], ':'')+this.Ka.map(a=>a.ia())+')'}};N('olympe.dc.predicates.HasRelatedTree',olympe.dc.V.Ll);
647
+ class $g extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.N=new Map;this.G=new Map}getTransform(a,b,c){const d=this.G,e=this.N,f=new Set,g=(k,l,n)=>{e.has(l)?e.get(l).set(c+n,k):e.set(l,(new Map).set(c+n,k))},h=(k,l,n,p,q)=>{const r=olympe.W.yg();if(p){const t=n+q,u=v=>{const w=e.get(q);if(f.has(t))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${n} and ${q}`);void 0!==w&&
648
+ null!==w&&(f.add(t),d.set(q,(d.get(q)||0)+v),Array.from(w.values()).forEach(y=>y(v)));f.delete(t)};g(k,q,n);d.has(q)?k(d.get(q)):(l>=this.F&&b(v=>{d.set(q,(d.get(q)||0)+v);k(v)},p,q),(0>this.C||l<=this.C)&&q!==n&&V(a,q,this,h.bind(this,u,l+1,q),r))}else k(-d.get(q)),e.get(q).delete(c+n),0===e.get(q).size&&(d.delete(q),e.delete(q),a.C(q,this,r))};return(k,l,n)=>h(k,0,'origin',l,n)}ia(){return`${this.R()}, ${this.Oa()}, ${this.F}, ${this.C}`}}olympe.dc.V.Ll.la=[olympe.dc.$a];olympe.dc.X={};olympe.dc.X.nk={et:1,rt:-1,pp:0};olympe.dc.X.dB={Iy:!0,ez:!1};olympe.dc.X.Qb=class extends olympe.dc.ta.Relation{constructor(a,b){super(a,b||olympe.dc.za.DESTINATION)}Yb(){return Mc(this)}ma(){return O(olympe.dc.X.Qb)}Pc(){return new olympe.dc.X.Qb(this.tag,this.direction===olympe.dc.za.DESTINATION?olympe.dc.za.ORIGIN:olympe.dc.za.DESTINATION)}getTransform(a,b,c){const d=olympe.dc.Na(),e=this.R(),f=this.Oa();return(g,h,k,l)=>{Kg(b,k,h,e,f);g?V(d,h,this,(n,p)=>{const q=olympe.W.mb(k+f+e+p,20),r=vg(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.C(h,this,k)}}ia(){return'{"c":"'+
649
+ this.ma()+'","a":["'+this.R()+'","'+this.Oa()+'"]}'}toString(){return'Related('+this.Oa()+this.R()+')'}};N('olympe.dc.transformers.Related',olympe.dc.X.Qb);olympe.dc.X.Qb.la=[olympe.dc.Wc];olympe.dc.X.Dc=class extends olympe.dc.ta.Relation{constructor(a,b=olympe.dc.za.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.C=d}Yb(){return Mc(this)}ma(){return O(olympe.dc.X.Dc)}getTransform(a,b,c){const d=olympe.dc.Na(),e=Object.create(null),f=olympe.dc.za.ORIGIN,g=olympe.dc.za.DESTINATION,h=this.R(),k=this.Oa(),l=(p,q,r)=>{if(!(0<=this.C&&p>=this.C)){var t=d.ub(r,this);p+=1;for(let u=0,v=t.length;u<v;u++){if(void 0!==e[t[u]]||r===t[u])continue;const w=olympe.W.mb(q+k+(h+'_'+p)+t[u],20);b.register(w,
650
+ q,r,h,k||g);null===k&&b.register(w,q,r,h,f)}}},n=(p,q,r,t,u,v)=>{u&&!b.F&&l(p,t,v);p>=this.F?c(u,v,t,vg(r,u,v,t)):Kg(b,t,v,h,k);0<=this.C&&p>=this.C||(u?e[v]||(e[v]=!0,V(d,v,this,(w,y)=>{const B=p+1,E=olympe.W.mb(t+k+(h+'_'+B)+y,20);n(B,v,r,E,w,y)},t)):(d.C(v,this,t),delete e[v]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ia(){return'{"c":"'+this.ma()+'","a":["'+this.R()+'","'+this.Oa()+'",'+this.F+','+this.C+']}'}toString(){return'RecursiveRelated('+this.Oa()+this.R()+'['+this.F+'..'+this.C+'])'}};
651
+ N('olympe.dc.transformers.RecursiveRelated',olympe.dc.X.Dc);olympe.dc.X.Dc.la=[olympe.dc.Wc];function ah(a){return a.Ka.map(b=>b.R())}
652
+ olympe.dc.X.Be=class{constructor(a,b){this.direction=b||olympe.dc.za.DESTINATION;this.Ka=a.map(c=>new olympe.dc.ta.Relation(c,this.direction))}Yb(){return olympe.dc.CloudObject}ma(){return O(olympe.dc.X.Be)}Oa(){return this.direction}getTransform(a,b,c){const d=olympe.dc.Na(),e=(f,g,h,k)=>V(d,f,k,(l,n)=>{var p=k.Oa();var q=k.R();p=olympe.W.mb(g+p+q+n,20);q=vg(h,l,n,p);l&&b.register(p,g,f,k.R(),k.Oa());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.Ka.forEach(l=>{Kg(b,h,g,l.R(),l.Oa());e(g,h,k,l)}):this.Ka.forEach(l=>
653
+ {d.C(g,l,h)})}}ia(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(ah(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Oa()+'['+ah(this).join(',')+'])'}};N('olympe.dc.transformers.MultiRelated',olympe.dc.X.Be);olympe.dc.X.Be.la=[olympe.dc.Wc];olympe.dc.X.Fl=class{constructor(a,b,c,d){this.C=new olympe.dc.ta.Relation(olympe.dc.xa(a),c||olympe.dc.za.DESTINATION);this.F=new olympe.dc.ta.Relation(olympe.dc.xa(b),d||olympe.dc.za.DESTINATION)}Yb(){return Mc(this.C)}ma(){return O(olympe.dc.X.Fl)}getTransform(a,b,c){const d=olympe.dc.Na(),e={},f=this.C.R(),g=this.C.Oa(),h=this.F.R(),k=this.F.Oa();let l=null,n=null;const p=(r,t,u,v,w,y)=>{if(w){if(w=()=>{const B=olympe.W.mb(u+g+(f+'_'+r)+y,20),E=vg(t,!0,y,B);l=r;n=()=>{c(!1,y,B,vg(t,!1,y,B))};
654
+ b.register(B,u,v,f,g);c(!0,y,B,E)},w.Ur=r,e[v]=w,null===l||r<l)n&&n(),w()}else if(l===r){n();e[v]=!0;w=Infinity;let B=null;for(let E=Object.keys(e),T=E.length,I=0;I<T;I++){let aa=e[E[I]];aa.Ur<w&&(w=aa.Ur,B=aa)}B&&B()}},q=(r,t,u,v,w)=>{v?e[w]||(e[w]=!0,Kg(b,u,w,f,g),Kg(b,u,w,h,k),V(d,w,this.C,p.bind(this,r,t,u,w),u+'_val'),V(d,w,this.F,q.bind(this,r+1,t,u),u+'_follow')):(d.C(w,this.F,u+'_follow'),d.C(w,this.C,u+'_val'),delete e[w])};return(r,t,u,v)=>q(0,v,u,r,t)}ia(){return'{"c":"'+this.ma()+'","a":["'+
655
+ this.C.toString()+'","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.C.toString()+', '+this.F.toString()+')'}};N('olympe.dc.transformers.FirstRelated',olympe.dc.X.Fl);olympe.dc.X.Fl.la=[olympe.dc.Wc];olympe.dc.X.xe=class{Yb(){return null}ma(){return O(olympe.dc.X.xe)}getTransform(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,vg(h,!0,f,f))):(d[f]++,Jg(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,vg(h,!1,f,f)))}}ia(){return'{"c":"'+this.ma()+'"}'}toString(){return'Distinct()'}};N('olympe.dc.transformers.Distinct',olympe.dc.X.xe);olympe.dc.X.xe.la=[olympe.dc.Wc];olympe.dc.X.Kd=class{constructor(a,b){this.Md=a;this.C=void 0===b?!0:!!b}Yb(){return null}ma(){return O(olympe.dc.X.Kd)}F(){return[this.Md.U()]}getTransform(a,b,c){const d=new olympe.dc.pc.Uq(this.C?this.Md.G.bind(this.Md):(e,f)=>this.Md.G(f,e));return(e,f,g)=>{var h=e?this.Md.N(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ia(a){return'{"c":"'+this.ma()+'","a":['+this.Md.ia(a)+','+JSON.stringify(this.C)+']}'}toString(){return'Sort('+this.Md.toString()+','+JSON.stringify(this.C)+')'}};
656
+ N('olympe.dc.transformers.Sort',olympe.dc.X.Kd);olympe.dc.X.Kd.la=[olympe.dc.Wc,olympe.dc.nq];olympe.dc.X.rc=class{constructor(a){this.C=a}Yb(){return null}ma(){return O(olympe.dc.X.rc)}F(){return this.C.F()}getTransform(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&Jg(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,vg(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;f?(f=this.C.C(a,g),olympe.D.lb(f)&&(f=f.Ma),olympe.D.Tf(f)?(b.F||void 0!==olympe.D.Ya(f)||Jg(b,h),e[l]=f,olympe.D.wc([f],n=>{d(g,h,k,n)},'filterResultHandler')):d(g,h,k,f)):(void 0!==e[l]&&(e[l].destroy(),delete e[l]),d(g,h,k,!1),delete e[h])}}ia(a){return'{"c":"'+
657
+ this.ma()+'","a":['+this.C.ia(a)+']}'}toString(){return'Filter('+this.C.toString()+')'}};N('olympe.dc.transformers.Filter',olympe.dc.X.rc);olympe.dc.X.rc.la=[olympe.dc.Wc,olympe.dc.nq];olympe.dc.X.Zd=class{constructor(a,b){this.start=a;this.C=b}Yb(){return null}ma(){return O(olympe.dc.X.Zd)}getTransform(a,b,c){const d=new olympe.dc.pc.Xl;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]);Gg(d,e,f,n,c)}};olympe.D.he([this.start,this.C],(n,p)=>{f=n.valueOf();g=p.valueOf();k()});Pg(b,k);const l=Mg(b);Lg(b,l);return(n,p,q,r)=>{h||(r.Qc().Jg(t=>{e=t;Qg(b,l)}),tg(b,()=>r.tg(),l),h=!0);d.C(n,p,q,null);ug(b,q,l)}}ia(a){return'{"c":"'+
658
+ this.ma()+'","a":['+Hf(a,this.start)+','+Hf(a,this.C)+']}'}toString(){return`Limit(${olympe.D.Ya(this.start)},${olympe.D.Ya(this.C)})`}};N('olympe.dc.transformers.Limit',olympe.dc.X.Zd);olympe.dc.X.Zd.la=[olympe.dc.Wc];function bh(a,b,c,d,e,f){function g(p,q){if(l)for(var r=l.length-1;0<=r;r--)f=l[r].getTransform(b,e,n.Cb(f));f=n.Cb(f);e.register(h,null);r=d.C(p,q,c,null);f(p,q,h,vg(r,p,q,h))}const h=olympe.W.nc(),k=olympe.dc.Na(),l=a.X,n=olympe.D.Ja();olympe.D.wc([a.C],p=>{ch(k,p,g,h);void 0===k.model(p)&&sg(e)})}function ch(a,b,c,d){const e=b&&b.valueOf();e&&(yc(a,e,c,d),olympe.D.Ja().vc(()=>zc(a,e,d)))}
659
+ olympe.dc.X.sf=class{constructor(a,b){this.X=this.C=null;a instanceof olympe.dc.Aa?(this.C=a.Od(),this.X=a.Rl()):(this.C=a,b&&(this.X=b))}Yb(){return null}ma(){return O(olympe.dc.X.sf)||''}Bg(){return this.X}Od(){return this.C}getTransform(a,b,c){const d=new olympe.dc.pc.Xl,e=new olympe.dc.pc.Fj;let f=[],g=[],h=!1,k=!1;const l=Mg(b),n=Mg(b);Pg(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):Qg(b);Gg(d,p,0,p.length,c)});Lg(b,n);bh(this,a,this.C,e,b,(p,q,r,t)=>{const u=olympe.D.Ja();
660
+ u.gd()||u.yb()||(k||(t.Qc().Jg(v=>{g=v;Qg(b,n)}),tg(b,()=>t.tg(),n),k=!0),d.C(p,q,r),ug(b,r,n))});Lg(b,l);return(p,q,r,t)=>{h||(t.Qc().Jg(u=>{f=u;Qg(b,l)}),tg(b,()=>t.tg(),l),h=!0);d.C(p,q,r,l);ug(b,r,l)}}ia(a){const b=this.X?'['+this.X.map(c=>c.ia(a)).join(',')+']':'null';return'{"c":"'+this.ma()+'","a":['+Hf(a,this.C)+','+b+']}'}toString(){const a=olympe.D.lb(this.C)?'N:'+this.C.Ma.Z():this.C.valueOf(),b=this.X?','+this.X.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
661
+ N('olympe.dc.transformers.Union',olympe.dc.X.sf);olympe.dc.X.sf.la=[olympe.dc.Wc];olympe.dc.Kg={};function dh(a,b){let c=Ec.get(b)||null,d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.zf(b);if(null===b)break;c=Ec.get(b)||null}return c||null}olympe.dc.Kg.SyncManager=class{constructor(a,b,c){this.L=a;this.db=b;this.C=c}};olympe.dc.Kg.O={Ea:'dc.syncs.Logger',va:'dc.syncs.SyncManager'};olympe.T.config(function(a){C(a,olympe.dc.Kg.O.Ea,[olympe.pa.O.va],b=>b.Nc('dc'));A(a,olympe.dc.Kg.O.va,olympe.dc.Kg.SyncManager,olympe.dc.Kg.O.Ea,olympe.dc.O.vi,olympe.T.O.bg)});olympe.dc.W={};olympe.dc.W.OC=function(a){a=olympe.dc.xa(a);const b=olympe.D.Kc(olympe.D.Wa,'getInstanceName'),c=olympe.dc.Na(),d=Bd(c,a,olympe.dc.CloudObject.nameProp,b.update.bind(b));olympe.D.Ja().vc(c.F.bind(c,a,olympe.dc.CloudObject.nameProp,d));return b.Eb()};olympe.dc.W.RC=function(a){return olympe.D.Fa([a],b=>olympe.D.$x(olympe.dc.Na().lj(b)),olympe.D.qa)};olympe.dc.W.SC=function(a){return(a=olympe.D.Ya(a))?olympe.dc.Na().lj(a):!1};olympe.dc.W.Ki=class a{constructor(b=olympe.dc.Ha.Vc){this.G=b}C(b){const c=new olympe.dc.db.xc;this.F(b,c);return c}U(b,c,d){const e=new olympe.dc.db.xc(b),f=new olympe.dc.query.Ci(b,this.G,c,e);this.F(d,e,(g,h)=>{h=h||[];const k=f.C.get(g)||new Set;for(const l of h)k.add(l);f.C.set(g,k)});return f}N(b,c){const d=new olympe.dc.db.xc(b),e=new olympe.dc.query.ot(b,d);this.F(c,d,(f,g,h)=>{h=h||[];const k=new mf(f);k.add=g||[];k.remove=h;e.C.set(f,k)});return e}F(b,c,d){const e=olympe.dc.$b.Jd;for(const f of b)switch(b=
662
+ f.i?f.i:-1,f.o){case 1:const g=a.C(f.p||{});g.has(e)||g.set(e,this.G);c.F(f.t,g,b);break;case 2:c.qc(f.t,a.C(f.p),!0,b);break;case 3:c.Jc(f.t,f.f,b);break;case 4:c.Ra(f.m,f.l,f.r,b);break;case 5:c.hc(f.m,f.l,f.r,b);break;case 6:d&&d(f.i,f.a,f.d);break;default:throw Error('Undefined patch operation: '+f.o);}}static C(b){const c=new Map;for(const [d,e]of Object.entries(b)){b=d;if(b===olympe.dc.$b.Jd||b===olympe.dc.$b.VERSION){c.set(b,e);continue}else if('v'===d){c.set(olympe.dc.$b.VERSION,e);continue}let f=
663
+ typeof e;b.startsWith('fd')&&(b=olympe.dc.Sg.bc+b.substr(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;case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&
664
+ 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.Hc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};olympe.dc.W.Tb={};olympe.dc.W.Tb.Mm=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.Bb(a):a instanceof olympe.D.Wa?a:null;olympe.dc.W.Tb.Jm=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Ac(a):a instanceof olympe.D.qa?a:null;olympe.dc.W.Tb.Lm=a=>'number'===typeof a||a instanceof Number?olympe.D.ya(a):'string'===typeof a||a instanceof String?olympe.D.ya(Number.parseFloat(a.valueOf())):a instanceof olympe.D.ea?a:null;
665
+ olympe.dc.W.Tb.Km=function(a){return'number'===typeof a||a instanceof Number?sb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.jb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.jb(a):a instanceof olympe.D.jb?a:null};olympe.dc.W.Tb.zr=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?wb(a.valueOf()):null};olympe.dc.W.Tb.Ar=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.Hc?olympe.dc.CloudObject.get(a.tag):null;
666
+ olympe.dc.W.Tb.gh=a=>a instanceof olympe.dc.Hc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.W.Tb.yC=a=>{switch(typeof a){case 'boolean':return olympe.D.Ac(a);case 'number':return olympe.D.ya(a);case 'string':return olympe.D.Bb(a);case 'object':if(a instanceof Date)return olympe.D.Px(a)}return a};
667
+ olympe.dc.W.Tb.LC=a=>{switch(a){case olympe.D.qa:return olympe.dc.W.Tb.Jm;case olympe.D.Wa:return olympe.dc.W.Tb.Mm;case olympe.D.ea:return olympe.dc.W.Tb.Lm;case olympe.D.jb:return olympe.dc.W.Tb.Km;case olympe.D.Color:return olympe.dc.W.Tb.zr;case olympe.dc.CloudObject:return olympe.dc.W.Tb.Ar;default:return olympe.dc.W.Tb.gh}};olympe.dc.O={va:'dc.Manager',mt:'dc.Graph',vi:'dc.DBView',Ea:'dc.Logger',Xu:'dc.TransactionLogger',yi:'dc.FileServiceManager',me:'dc.Router'};olympe.dc.Config={cg:'dc.debug',Yg:'dc.subscribeAll',so:'dc.defaultSource',Io:'dc.fileCache',Bo:'dc.errorOnAbstractInstantiation'};
668
+ olympe.T.config(function(a){D(a,olympe.dc.Config.cg,!1);D(a,olympe.dc.Config.Yg,!1);D(a,olympe.dc.Config.so,olympe.dc.Ha.Vc);D(a,olympe.dc.Config.Io,!0);D(a,olympe.dc.Config.Bo,!0);C(a,olympe.dc.O.Ea,[olympe.pa.O.va],b=>b.Nc('dc'));sa(a,olympe.dc.O.Xu,olympe.dc.transaction.O.Ea);sa(a,olympe.dc.O.vi,olympe.dc.db.O.ib);A(a,olympe.dc.O.yi,olympe.dc.it,olympe.dc.O.Ea,olympe.net.O.va,olympe.dc.O.me,olympe.W.O.xh,new olympe.T.fa(olympe.dc.Config.Io));ta(a,olympe.dc.O.me);A(a,olympe.dc.O.va,olympe.dc.sa,
669
+ olympe.dc.O.Ea,olympe.dc.db.O.va,olympe.dc.query.O.va,olympe.dc.transaction.O.va,olympe.dc.Kg.O.va,olympe.dc.O.yi)},'olympe.dc');olympe.T.run([olympe.dc.db.O.va,olympe.dc.query.O.va,olympe.dc.transaction.O.va,olympe.dc.Kg.O.va,olympe.dc.O.va,olympe.dc.O.yi],(a,b,c,d,e,f)=>{olympe.dc.Ad=()=>a;olympe.dc.Lf=()=>b;olympe.dc.gi=()=>c;olympe.dc.Sr=()=>d;olympe.dc.Qc=()=>e;olympe.dc.ww=()=>f},'DC singleton getter initialization');olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.Na();this.model=null}static get(a){{var b=olympe.dc.Sr();a=olympe.dc.xa(a);const c=dh(b,b.db.model(a));null===c?(b.L.error(`Instantiation of a CloudObject (tag = '${a}') that does not exist (or incompletely exists) in the local database.\n
669
670
  This could lead to unwanted behaviour and must be fixed.
670
- For more information, activate the database debug mode or call "dbMonitor.debug(${a})" from this console.`),b=new olympe.dc.CloudObject(void 0,a)):b=c.instantiate(a,b.C)}return b}static Nv(a,b,c=olympe.dc.Ja.mc){if('undefined'===typeof olympe.sc)throw Error('Method CloudObject.createWith should only be used at runtime, when sc package exists');const d=new olympe.sc.Transaction(!1);a=d.create(b||this,a,c);d.hb().catch(e=>olympe.pa.Xa('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${e}`));
671
- return this.get(a)}static xv(){return this.get(this)}static Yk(a){return olympe.dc.gb.Yk(a)}static rd(){return olympe.dc.Na().ub(this,olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.ta.Property(a))}static dd(){const a=olympe.dc.Na();return a.ub(this,olympe.dc.CloudObject.G).map(b=>new olympe.dc.ta.Relation(b)).concat(a.ub(this,olympe.dc.CloudObject.V).map(b=>new olympe.dc.ta.Relation(b,olympe.dc.za.ORIGIN)))}static Jf(a){return olympe.dc.CloudObject.get(a)}static Ew(a){var b=$g(olympe.dc.Xr(),
672
- olympe.dc.xa(a));b=b&&b.C;return new olympe.dc.Aa(olympe.dc.xa(a),olympe.dc.CloudObject.instancesRel,b)}R(){return this.tag}name(){return this.db.name(this)}ma(){return this.Fb(olympe.dc.CloudObject.nameProp)}ph(){this.model||(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.gb.from(this)}Vf(){return this.db.Vf(this)}jx(){return this.db.version(this)}Mt(){return this.db.source(this)}Rr(){return olympe.D.Fa([this.ma()],a=>olympe.D.Bb(a),olympe.D.Wa,
673
- 'getDisplayName',olympe.D.Bb('('+this.toString()+')'))}Tb(){return this.model?this.model.R():this.db.model(this)}observe(a,b){const c='function'===typeof a.Ec?a.Ec():a;return new rxjs.Observable(d=>{const e=xd(this.db,this.tag,b,f=>{null===f||void 0===f?d.next(null):d.next(f)});c.vc(()=>{d.complete();this.db.F(this.tag,b,e)});return()=>this.db.F(this.tag,b,e)})}Rx(a){return this.observe(olympe.D.Ia(),a)}get(a){return this.db.fb(this.tag,a,!0)}fb(a){return this.get(a)}sb(a){return olympe.dc.gb.from(this).sb(a)}cw(a){return olympe.dc.ld.from(this).sb(a)}nw(){return this.cd(olympe.dc.CloudObject.cc,
674
- olympe.dc.CloudObject)}dn(){return this.ub(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Mf(a,b,c){const d=olympe.D.Kc(c,'Sync valueType'),e=xd(this.db,this.tag,a,olympe.D.Ia().Cb(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.node.onDestroy(()=>this.db.F(this.tag,a,e));return d.node}Fb(a){return L(this.Mf(a,olympe.dc.W.Sb.Rm,olympe.D.Wa))}Ie(a){return L(this.Mf(a,olympe.dc.W.Sb.Qm,olympe.D.ea))}qh(a){return L(this.Mf(a,olympe.dc.W.Sb.Om,olympe.D.qa))}kj(a){return L(this.Mf(a,
675
- olympe.dc.W.Sb.Pm,olympe.D.jb))}Wr(){return L(this.Mf(olympe.dm.Color.valueProp,olympe.dc.W.Sb.Er,olympe.D.Color))}Uw(a){return L(this.Mf(a,olympe.dc.W.Sb.Fr,olympe.dc.CloudObject))}ub(a,b){a=a instanceof olympe.dc.X.Qb?a:new olympe.dc.X.Qb(a.R(),a.Oa());return new olympe.dc.Aa(this.R(),a,b)}cd(a,b){return this.ub(a,b).Oc()}Nr(a,b){const c=this.db,d=olympe.W.lc(),e=olympe.D.Ia(),f=new Map;V(c,this.tag,a,(g,h)=>{g?(g=new olympe.D.Wb(`forEachRelated: (${this.tag})-[:${a.R()}]-(${h})`,e),f.set(h,g),
676
- g.run(b,olympe.dc.CloudObject.get(h))):f.has(h)&&(f.get(h).destroy(),f.delete(h))},d);e.vc(()=>{c.C(this.tag,a,d)})}wy(){return new olympe.dc.Aa(this.R(),[],Gc(this.R()))}transform(...a){return(new olympe.dc.Aa(this.R(),[],this.constructor)).transform(...a)}hd(){return this.Rr()}toString(){if(!this.db.Gb(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.Gb(this.tag))return{CloudObject:'Unknown tag'};
677
- 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})`}}qb(a){return a instanceof olympe.dc.CloudObject?this.R()===a.R():!1}Td(a){return olympe.D.Fa([a],b=>olympe.D.Ac(this.qb(b)),olympe.D.qa)}Pv(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Transaction,c=!0;const d=olympe.dc.za.ORIGIN;for(const [e,f,g]of Ad(b,this))f===d?a.ec(e,g,this):e!==olympe.dc.CloudObject.modelRel.R()&&a.ec(e,this,g);a.delete(this,
678
- olympe.dc.Rb.NONE);c&&a.hb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.qb;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.cw;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.sb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.fb;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Rx;
679
- olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.Tb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Vf;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.ph;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;
680
- olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.R;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Ew;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Jf;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.dd;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.rd;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Yk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.xv;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Nv;
681
- olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.P=olympe.dc.Ba.C('ff021000000000000001',olympe.dc.CloudObject);olympe.dc.CloudObject.ji=olympe.dc.CloudObject.P.Ca(olympe.dc.$b.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.P.Ca('ff023000000000000011');z('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.Z=olympe.dc.CloudObject.P.Ca('ff023000000000000012');olympe.dc.CloudObject.G=olympe.dc.CloudObject.P.Pa('ff02200000000000000a');
682
- olympe.dc.CloudObject.V=olympe.dc.CloudObject.P.Pa('ff02200000000000000b',olympe.dc.za.ORIGIN);olympe.dc.CloudObject.Pf=olympe.dc.CloudObject.P.Pa('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.Ve=olympe.dc.CloudObject.P.Pa('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.P.Pa('ff02200000000000000c');z('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.P.Pa('ff02200000000000000d',olympe.dc.za.ORIGIN);
683
- olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.P.Pa(olympe.dc.ic.Tc);z('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=P(olympe.dc.CloudObject.P,olympe.dc.CloudObject.modelRel);z('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.P.Pa(olympe.dc.ic.yi);z('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);
684
- olympe.dc.CloudObject.extendedByRel=P(olympe.dc.CloudObject.P,olympe.dc.CloudObject.extendRel);z('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.P.Pa(olympe.dc.ic.ko);z('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.cc=P(olympe.dc.CloudObject.P,olympe.dc.CloudObject.containsRel);olympe.dc.bB=olympe.dc.CloudObject;olympe.dc.CloudObject.la=[olympe.dc.ze];m=olympe.dc.CloudObject.prototype;
685
- m.R.K=new olympe.D.J(()=>String,[]);m.name.K=new olympe.D.J(()=>String,[]);m.ma.K=olympe.D.J.F;m.ph.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.jx.K=new olympe.D.J(()=>Number,[]);m.Mt.K=new olympe.D.J(()=>String,[]);m.Rr.K=olympe.D.J.F;m.Tb.K=new olympe.D.J(()=>String,[]);m.nw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.dn.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.Mf.K=new olympe.D.J(()=>olympe.D.Node,[]);m.Fb.K=olympe.D.J.F;m.Ie.K=olympe.D.J.G;m.qh.K=olympe.D.J.V;
686
- m.kj.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Wr.K=new olympe.D.J(()=>olympe.D.Color,[]);m.Uw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.ub.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.cd.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Nr.K=new olympe.D.J(()=>{},[]);m.wy.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.hd.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.qb.K=olympe.D.J.C;m.Td.K=olympe.D.J.V;m.Pv.K=new olympe.D.J(()=>{},[]);olympe.dc.gk=class{constructor(a){this.instance=a}R(){return this.instance.R()}mj(){return nb(this.instance.qh(olympe.dc.CloudObject.Z))}xw(){return this.instance.cd(olympe.dc.CloudObject.extendRel,olympe.dc.CloudObject)}gn(){return this.instance.transform(new olympe.dc.X.Dc(olympe.dc.CloudObject.extendRel.R(),olympe.dc.za.DESTINATION,olympe.dc.X.sk.ht))}kn(){return this.instance.transform(new olympe.dc.X.Dc(olympe.dc.CloudObject.extendRel.R(),olympe.dc.za.DESTINATION,olympe.dc.X.sk.wp))}rd(){return this.kn().transform(olympe.dc.CloudObject.propertyRel,
687
- new olympe.dc.X.xe)}Nw(){return this.instance.transform(olympe.dc.CloudObject.propertyRel)}dd(){return this.kn().transform(olympe.dc.CloudObject.G,new olympe.dc.X.xe)}Ow(){return this.instance.transform(olympe.dc.CloudObject.G)}static from(a){return olympe.D.Fa([a],b=>{const c=b.R(),d=olympe.dc.Na();if(!d.nj(c))throw Error(`Instance "${d.name(c)}" (tag=${c}) is not a model.`);return new olympe.dc.gk(b)},olympe.dc.gk,'transformToModelInfo')}static mj(){return nb((void 0).qh(olympe.dc.CloudObject.Z))}};
688
- olympe.dc.gk.la=[olympe.dc.ze];m=olympe.dc.gk.prototype;m.xw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.gn.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.kn.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.rd.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.Nw.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.dd.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.Ow.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dc.iA=class{};olympe.dc.ba={};olympe.dc.ba.Ap=class{constructor(a){this.L=a}};olympe.dc.ba.Ap.od={Si:0,AA:1,BA:3,kA:4};olympe.dc.ba.$j=class{};function Y(a){if(a.Z)throw Error('Cannot modify definition after definition is written');}
689
- olympe.dc.ba.Zb=class{constructor(a,b){a=this.C=a;if(a.C)throw b=a.C.ma(),a=a.C.R(),Error('Cannot work on a new definition without calling done on the previous one or popping it. '+`Make sure done() method has been called on previous definition ${b} (${a})`);if(void 0===this)throw Error('Current def cannot be set to undefined.');a.C=this;this.tag=b;this.F=new Map;this.aa=olympe.dc.CloudObject.P.R();this.Da=new Map;this.ra=new Map;this.Z=this.ka=!1;this.V=null}Gn(a){Y(this);this.aa=a;return this}Tb(){return this.aa}xj(a){Y(this);
690
- this.V=a;return this}ky(){this.ka=!0;return this}jy(a){Y(this);const b=new Map;if('string'===typeof a){const c=olympe.dc.CloudObject.nameProp.R();b.set(c,a||'')}else Object.keys(a).forEach(c=>{b.set(c,a[c])});this.F=b;return this}li(a){Y(this);Object.keys(a).forEach(b=>{this.F.set(b,a[b])});return this}setProperty(a,b){Y(this);this.F.set(a,b);return this}il(a){Y(this);const b=olympe.dc.CloudObject.nameProp.R();this.F.set(b,a);return this}Ar(a,b){Y(this);if(!a)throw Error('Cannot relate an object to another without a relation tag');
691
- if(a===olympe.dc.CloudObject.containsRel.R())throw Error('Container must be defined using dedicated helpers setContainedIn');b&&this.Da.set(a+'.'+b,[a,b]);return this}Km(a,b){Y(this);if(!a)throw Error('Cannot relate an object to another without a relation tag');if(a===olympe.dc.CloudObject.containsRel.R())throw Error('Container must be defined using dedicated helper setContainedIn');b&&this.ra.set(a+'.'+b,[a,b]);return this}done(){if(this.Z)return this;const a=ah(this.C,this.ka);a.F(this.tag,this.F,
692
- -1);bh(this.C,this);a.Ra(olympe.dc.ic.Tc,this.tag,this.aa,-1);this.V&&a.Ra(olympe.dc.ic.ko,this.V,this.tag,-1);this.G(-1);this.Da.forEach(b=>{a.Ra(b[0],this.tag,b[1],-1)});this.ra.forEach(b=>{a.Ra(b[0],b[1],this.tag,-1)});this.Z=!0;this.C.C=void 0;return this}G(){}R(){return this.tag}ma(){return this.F.get('ff023000000000000011')}};olympe.dc.ba.Zb.prototype.getName=olympe.dc.ba.Zb.prototype.ma;olympe.dc.ba.Zb.prototype.getTag=olympe.dc.ba.Zb.prototype.R;olympe.dc.ba.Zb.prototype.done=olympe.dc.ba.Zb.prototype.done;
693
- olympe.dc.ba.Zb.prototype.addRelationFrom=olympe.dc.ba.Zb.prototype.Km;olympe.dc.ba.Zb.prototype.addRelationTo=olympe.dc.ba.Zb.prototype.Ar;olympe.dc.ba.Zb.prototype.setName=olympe.dc.ba.Zb.prototype.il;olympe.dc.ba.Zb.prototype.setProperty=olympe.dc.ba.Zb.prototype.setProperty;olympe.dc.ba.Zb.prototype.setProperties=olympe.dc.ba.Zb.prototype.li;olympe.dc.ba.Zb.prototype.setNameOrProperties=olympe.dc.ba.Zb.prototype.jy;olympe.dc.ba.Zb.prototype.setOptional=olympe.dc.ba.Zb.prototype.ky;
694
- olympe.dc.ba.Zb.prototype.setContainedIn=olympe.dc.ba.Zb.prototype.xj;olympe.dc.ba.Zb.prototype.setModelTag=olympe.dc.ba.Zb.prototype.Gn;olympe.dc.ba.Zc=class extends olympe.dc.ba.Zb{constructor(a,b){super(a,b);this.Sa=this.C.OBJECT;this.ab=new Map;this.bb=new Map}ps(a){Y(this);this.Sa=a;return this}extends(a){return this.ps(a)}Vi(){Y(this);this.setProperty(olympe.dc.CloudObject.Z.R(),!0);return this}defineProperty(a,b,c,d){Y(this);this.ab.set(a,new olympe.dc.ba.Zc.Property(a,b,c,d));void 0!==d&&super.setProperty(olympe.dc.Ug.mc+a,d);return this}jh(a,b,c,d,e,{Yi:f=0,tj:g=olympe.dm.Relation.N,wj:h=0,kl:k=d,Nk:l=olympe.dm.Rc.NONE}={}){Y(this);
695
- b=new olympe.dc.ba.Zc.Relation(a,this.R(),b,c||'',d,e,h,k,f,g,l);this.bb.set(a,b);return this}G(a){super.G(a);ah(this.C).Ra(olympe.dc.CloudObject.extendRel.R(),this.tag,this.Sa,a);this.ab.forEach(b=>{const c={[olympe.dc.CloudObject.nameProp.R()]:b.name||''},d=olympe.dc.xa(olympe.dm.Property),e=olympe.dc.CloudObject.propertyRel.R(),f=b.tag;this.C.push();this.C.yh(f,d).li(c).done();this.C.pop();b=b.type;ah(this.C).Ra(e,this.R(),f,a);ah(this.C).Ra(olympe.dm.Property.typeRel.R(),f,b,a)});this.bb.forEach(b=>
696
- {this.C.jh(b.C,b.G,b.F,b.name,b.Mr,b.Kr,{wj:b.wj,kl:b.kl,Yi:b.Yi,tj:b.tj,Nk:b.Nk},a)})}};olympe.dc.ba.Zc.prototype.defineRelation=olympe.dc.ba.Zc.prototype.jh;olympe.dc.ba.Zc.prototype.defineProperty=olympe.dc.ba.Zc.prototype.defineProperty;olympe.dc.ba.Zc.prototype['abstract']=olympe.dc.ba.Zc.prototype.Vi;olympe.dc.ba.Zc.prototype['extends']=olympe.dc.ba.Zc.prototype.extends;olympe.dc.ba.Zc.prototype.setParentTag=olympe.dc.ba.Zc.prototype.ps;
697
- olympe.dc.ba.Zc.Property=class{constructor(a,b,c,d){this.tag=a;this.type=b;this.name=c||'';this.defaultValue=d}};olympe.dc.ba.Zc.Relation=class{constructor(a,b,c,d,e,f,g,h,k,l,n){this.C=a;this.G=b;this.F=c;this.name=d;this.Mr=e;this.Kr=f;this.wj=g;this.kl=h;this.Yi=k;this.tj=l;this.Nk=n}};function ah(a,b){return b?a.Z:a.F}function bh(a,b){0<a.N.length&&(b.V||a.F.Ra(olympe.dc.CloudObject.containsRel.R(),a.N[a.N.length-1].R(),b.R(),-1))}
698
- olympe.dc.ba.Qa=class{constructor(a){if(a&&void 0===a.log)throw Error('Argument of OSaveFileBuilder is not a logger - might be a source, adapt implementing classes');this.F=new olympe.dc.transaction.wd(!0);this.Z=new olympe.dc.transaction.wd(!0);this.L=a||null;this.Da=!1;this.G=null;this.ra=new Map;this.aa=null;this.ka=Object.create(null);this.C=void 0;this.N=[];this.V=!0;this.js=/eval \(eval at process .*<anonymous>:(\d+):(\d+)\)/m;this.DEFAULT=olympe.dc.Ug.mc;this.OBJECT=olympe.dc.CloudObject.P.R();
699
- this.PROPERTY=olympe.dm.Property.P.R();this.RELATION=olympe.dm.Relation.P.R();this.STRING=olympe.dm.String.P.R();this.BOOLEAN=olympe.dm.Boolean.P.R();this.NUMBER=olympe.dm.Number.P.R();this.DATETIME=olympe.dm.DateTime.P.R();this.COLOR=olympe.dm.Color.P.R();this.FILE=olympe.dm.File.P.R();this.ROLE=olympe.dm.$c.P.R();this.USER=olympe.dm.User.P.R();this.ONE_ONE=olympe.dm.Relation.F.mu;this.ONE_MANY=olympe.dm.Relation.F.fm;this.MANY_ONE=olympe.dm.Relation.F.eu;this.MANY_MANY=olympe.dm.Relation.F.$l;this.NONE=
700
- olympe.dm.Rc.NONE;this.DESTINATION_READ=olympe.dm.Rc.Us;this.DESTINATION_CREATE=olympe.dm.Rc.Bo;this.DESTINATION_WRITE=olympe.dm.Rc.Vs;this.DESTINATION_DELETE=olympe.dm.Rc.Rs;this.DESTINATION_LINK=olympe.dm.Rc.Ts;this.DESTINATION_FULL=olympe.dm.Rc.Ss;this.ORIGIN_READ=olympe.dm.Rc.qu;this.ORIGIN_CREATE=olympe.dm.Rc.nu;this.ORIGIN_WRITE=olympe.dm.Rc.ru;this.ORIGIN_DELETE=olympe.dm.Rc.ou;this.ORIGIN_LINK=olympe.dm.Rc.hq;this.ORIGIN_FULL=olympe.dm.Rc.pu;this.FULL=olympe.dm.Rc.jt;this.DUMP_IGNORE=olympe.dm.Relation.C.rp;
701
- this.DUMP_REF=olympe.dm.Relation.C.Bq;this.DUMP_REVERSE_REF=olympe.dm.Relation.C.Ju;this.DUMP_UNILATERAL=olympe.dm.Relation.C.Ck;this.DUMP_REVERSE_UNILATERAL=olympe.dm.Relation.C.rk;this.DUMP_EVERYTHING=olympe.dm.Relation.C.Io;this.DUMP_DEFAULT=olympe.dm.Relation.C.mc;this.DUMP_REV_DEFAULT=olympe.dm.Relation.C.Iu;this.DELETE_REF=this.DUMP_BOTH_REF=olympe.dm.Relation.C.tl;this.DELETE_REF_AND_DESTINATION=olympe.dm.Relation.C.Fu;this.DELETE_REF_AND_ORIGIN=olympe.dm.Relation.C.Gu;this.DELETE_EVERYTHING=
702
- olympe.dm.Relation.C.Io;this.OLYMPE_AUTHENTICATED_USERS=olympe.dm.$c.F}push(){this.N.push(this.C);this.C=void 0}pop(){if(this.C)throw Error('Cannot unstack definition: current definition not closed');this.C=this.N.pop()}$v(){const a=new Map,b=olympe.dc.ba.Tu.C(this.aa,this.F,this.Z);for(const [c,d]of b.entries())a.set(c,d.Aj());return a}Xw(){return this.aa}iy(a){this.V=a}log(...a){this.V&&this.L&&this.L.log(...a)}xn(...a){this.V&&this.L&&this.L.debug(...a)}vx(...a){this.V&&this.L&&this.L.warn(...a)}bl(...a){this.V&&
703
- this.L&&this.L.error(...a)}zv(a){if(a&&20===a.length&&!this.Da){if(this.ka[a])throw Error('Tag '+a+' is used to define more than one keyword');return this.ka[a]=a}this.G=null===this.G?olympe.W.ej():olympe.W.Vw(this.G);this.log('Generating new tag to replace '+a+'. New tag is: '+this.G);return this.G}ln(a){const b=this.ra.get(a)||1,c=olympe.W.ln(a,b);this.ra.set(a,b+1);return c}oy(a){this.Da=a}Rv(){}my(a){this.aa=a}yh(a,b){return(new olympe.dc.ba.Zb(this,a)).Gn(b)}Jx(a,b){return(new olympe.dc.ba.Zc(this,
704
- a)).il(b)}Ix(a,b){return(new olympe.dc.ba.Zc(this,a)).il(b).Vi()}Kx(a){return new olympe.dc.ba.vf(this,a)}dl(a,b,c){this.F.Ra(a,b,c,-1)}defineProperty(a,b,c,d,e){this.xn('Defining property ',d,' on model ',a);d={[olympe.dc.CloudObject.nameProp.R()]:d||''};void 0!==e&&this.pc(a,{[olympe.dc.Ug.mc+c]:e});this.C?(this.push(),this.yh(c,olympe.dm.Property.P.R()).li(d).done(),this.pop()):this.yh(c,olympe.dm.Property.P.R()).li(d).xj(a).done();this.dl(olympe.dc.CloudObject.propertyRel.R(),a,c);this.dl(olympe.dm.Property.typeRel.R(),
705
- c,b)}jh(a,b,c,d,e,f,{Yi:g=olympe.dm.Relation.F.fm,tj:h=olympe.dm.Relation.N,wj:k=0,kl:l=e,Nk:n=olympe.dm.Rc.NONE}={},p=-1){if(void 0===e||null===e)throw Error('Cannot define a relation without defining the dump follow rules (must be set to db.DUMP_<something> and cannot be undefined or null)');if(void 0===f||null===f)throw Error('Cannot define a relation without defining the delete follow rules (must be set to db.DELETE_<something> and cannot be undefined or null)');const q=olympe.dm.Relation;d={[olympe.dc.CloudObject.nameProp.R()]:d||
706
- '',[q.Nm.R()]:g,[q.Cn.R()]:h,[q.Xm.R()]:e,[q.Wm.R()]:f,[q.hl.R()]:k,[q.qs.R()]:l,[q.Av.R()]:n};this.C?(this.push(),this.yh(a,q.P.R()).li(d).done(),this.pop()):this.yh(a,q.P.R()).li(d).xj(b).done();this.F.Ra(q.originModelRel.R(),b,a,p);this.F.Ra(q.destinationModelRel.R(),a,c,p)}tx(a,b){this.F.Ra(olympe.dm.$c.C.R(),a,b,-1)}pc(a,b,c=!1){this.xn('Updating instance ',a);delete b[olympe.dc.$b.Jd];delete b[olympe.dc.$b.VERSION];const d=new Map;Object.keys(b).forEach(e=>{d.set(e,b[e])});this.F.pc(a,d,c,-1)}assign(a,
707
- b,c){this.dl(b,a,c)}yv(a,b,c){this.Z.Ra(b,a,c,-1)}Mv(a){return new olympe.dc.Hc(a)}Hv(a,b,c,d){const e={c:7};e.r=a;e.g=b;e.b=c;e.a=d;return e}Iv({year:a=1970,month:b=1,day:c=1,hour:d=1,minute:e=0,second:f=0,RC:g=0,cD:h=0}={}){const k={c:4};k.y=a;k.M=b;k.d=c;k.h=d;k.m=e;k.s=f;k.S=g;k.z=h;return k}ew(a){a=new Date(Date.parse(a));const b={c:4};b.y=a.getFullYear();b.M=a.getMonth()+1;b.d=a.getDate();b.h=a.getHours();b.m=a.getMinutes();b.s=a.getSeconds();b.S=a.getMilliseconds();b.z=-a.getTimezoneOffset();
708
- return b}Jv(a){a='number'===typeof a?new Date(a):a;const b={c:4};b.h=a.getHours();b.m=a.getMinutes();b.s=a.getSeconds();b.S=a.getMilliseconds();b.z=a.getTimezoneOffset();b.y=a.getFullYear();b.M=a.getMonth()+1;b.d=a.getDate();return b}dj(a,b,c){return olympe.auth.Hb.Ee.dj(a,c)}Pr(a,b){return olympe.auth.Hb.Ee.dj(a,b)}ec(){throw Error('DeleteRelation method on OSaveFile is deprecated');}Jc(){throw Error('DeleteInstance method on OSaveFile is deprecated');}};
709
- olympe.dc.ba.Qa.prototype.deleteInstance=olympe.dc.ba.Qa.prototype.Jc;olympe.dc.ba.Qa.prototype.deleteRelation=olympe.dc.ba.Qa.prototype.ec;olympe.dc.ba.Qa.prototype.generateAuthenticationData=olympe.dc.ba.Qa.prototype.Pr;olympe.dc.ba.Qa.prototype.generateAuthData=olympe.dc.ba.Qa.prototype.dj;olympe.dc.ba.Qa.prototype.createDateTimeLegacy=olympe.dc.ba.Qa.prototype.Jv;olympe.dc.ba.Qa.prototype.fromISODate=olympe.dc.ba.Qa.prototype.ew;olympe.dc.ba.Qa.prototype.createDateTime=olympe.dc.ba.Qa.prototype.Iv;
710
- olympe.dc.ba.Qa.prototype.createColor=olympe.dc.ba.Qa.prototype.Hv;olympe.dc.ba.Qa.prototype.createReference=olympe.dc.ba.Qa.prototype.Mv;olympe.dc.ba.Qa.prototype.assignOptional=olympe.dc.ba.Qa.prototype.yv;olympe.dc.ba.Qa.prototype.assign=olympe.dc.ba.Qa.prototype.assign;olympe.dc.ba.Qa.prototype.updateInstance=olympe.dc.ba.Qa.prototype.pc;olympe.dc.ba.Qa.prototype.linkRoleToUser=olympe.dc.ba.Qa.prototype.tx;olympe.dc.ba.Qa.prototype.defineRelation=olympe.dc.ba.Qa.prototype.jh;
711
- olympe.dc.ba.Qa.prototype.defineProperty=olympe.dc.ba.Qa.prototype.defineProperty;olympe.dc.ba.Qa.prototype.newRelation=olympe.dc.ba.Qa.prototype.dl;olympe.dc.ba.Qa.prototype.newUser=olympe.dc.ba.Qa.prototype.Kx;olympe.dc.ba.Qa.prototype.newAbstractModel=olympe.dc.ba.Qa.prototype.Ix;olympe.dc.ba.Qa.prototype.newModel=olympe.dc.ba.Qa.prototype.Jx;olympe.dc.ba.Qa.prototype.newInstance=olympe.dc.ba.Qa.prototype.yh;olympe.dc.ba.Qa.prototype.setRootInstanceTag=olympe.dc.ba.Qa.prototype.my;
712
- olympe.dc.ba.Qa.prototype.disableChecks=olympe.dc.ba.Qa.prototype.Rv;olympe.dc.ba.Qa.prototype.setUseNewTags=olympe.dc.ba.Qa.prototype.oy;olympe.dc.ba.Qa.prototype.assignTag=olympe.dc.ba.Qa.prototype.zv;olympe.dc.ba.Qa.prototype.logError=olympe.dc.ba.Qa.prototype.bl;olympe.dc.ba.Qa.prototype.logWarn=olympe.dc.ba.Qa.prototype.vx;olympe.dc.ba.Qa.prototype.logDebug=olympe.dc.ba.Qa.prototype.xn;olympe.dc.ba.Qa.prototype.log=olympe.dc.ba.Qa.prototype.log;olympe.dc.ba.Qa.prototype.setLoggingEnabled=olympe.dc.ba.Qa.prototype.iy;
713
- olympe.dc.ba.Qa.prototype.getRootInstanceTag=olympe.dc.ba.Qa.prototype.Xw;olympe.dc.ba.Qa.prototype.flushContents=olympe.dc.ba.Qa.prototype.$v;olympe.dc.ba.tg=class extends olympe.dc.ba.Zc{constructor(a,b,c){super(a,b);this.N=this.description=null;this.setProperty(olympe.dm.BrickMetadata.ab.R(),olympe.dm.BrickMetadata.Ab.tu);null!==c&&this.Br(c)}Br(a){this.xj(a);this.Km(olympe.dm.Pb.C.R(),a);return this}hy(a){this.F.set(olympe.dm.we.Sa.R(),a);return this}fy(a){Y(this);this.description=a;return this}ny(a){Y(this);this.N=a;return this}G(a){super.G(a);if(null!==this.description||null!==this.N)this.C.push(),a=this.C.yh(this.C.ln(this.tag),olympe.sc.Cc.P.R()),
714
- this.description&&a.setProperty(olympe.sc.Cc.C.R(),this.description),this.N&&a.setProperty(olympe.sc.Cc.N.R(),this.N),a.xj(this.tag).Ar(olympe.sc.Cc.F.R(),this.tag).done(),this.C.pop()}};olympe.dc.ba.tg.prototype.setSummary=olympe.dc.ba.tg.prototype.ny;olympe.dc.ba.tg.prototype.setDescription=olympe.dc.ba.tg.prototype.fy;olympe.dc.ba.tg.prototype.setIcon=olympe.dc.ba.tg.prototype.hy;olympe.dc.ba.tg.prototype.addToFolder=olympe.dc.ba.tg.prototype.Br;olympe.dc.ba.Tu=class a{constructor(b,c,d){this.F=b;this.ua=c||[];this.C=d||[]}static C(b,c,d){if(c instanceof olympe.dc.transaction.wd&&d instanceof olympe.dc.transaction.wd){c=Zd(c);var e=Zd(d)}else e=new olympe.dc.transaction.wd(!0),c.Mc(e),c=Zd(e),d.Mc(e),e=Zd(e);d=new Map;var f=new a(b,c.yg,e.yg);f.Rf()||d.set('delRel',f);f=new a(b,c.Ue,e.Ue);f.Rf()||d.set('detInst',f);f=new a(b,c.Hg,e.Hg);f.Rf()||d.set('newInst',f);f=new a(b,c.$f,e.$f);f.Rf()||d.set('updateInst',f);b=new a(b,c.Ig,e.Ig);b.Rf()||
715
- d.set('newRel',b);return d}Rf(){return 0===this.ua.length+this.C.length}static zn(b){const c=Object.create(null),d=[],e=[];b.forEach(f=>{0===Object.keys(c).length&&(c.rootTag=f.rootTag);d.push(...(f.operations||[]));e.push(...(f.optionalOperations||[]))});0!==d.length&&(c.operations=d);0!==e.length&&(c.optionalOperations=e);return c}Aj(){const b=(d,e)=>{var f=d.o,g=e.o;return f!==g?f<g?-1:1:1===f||2===f||3===f?(f=d.t,g=e.t,f===g?(d=Object.keys(d.p)[0],e=Object.keys(e.p)[0],void 0!==d?d.localeCompare(e):
716
- 1):f.localeCompare(g)):4===f||5===f?(f=d.l,g=e.l,f===g?(f=d.m,g=e.m,f===g?d.r.localeCompare(e.r):f.localeCompare(g)):f.localeCompare(g)):JSON.stringify(f).localeCompare(JSON.stringify(g))},c=Object.create(null);this.ua.sort(b);this.C.sort(b);c.rootTag=this.F;c.operations=this.ua;c.optionalOperations=this.C;return c}};olympe.dc.ba.vf=class extends olympe.dc.ba.Zb{constructor(a,b){super(a,b);this.password=this.N=null;this.Gn(olympe.dc.xa(olympe.dm.User))}py(a){Y(this);this.N=a;return this}Hn(a){Y(this);this.password=a;return this}gy(){return this}Bv(a){Y(this);this.Km(olympe.dm.User.C.R(),a);return this}G(a){super.G(a);if(null==this.N||''===this.N)throw Error('A username must be set when calling new User');if(null==this.password||''===this.password)throw Error('A password must be set when calling new User');const b=
717
- this.C.Pr(this.N,this.password),c=new Map;c.set(olympe.dm.User.loginProp.R(),b.login);c.set(olympe.dm.User.saltProp.R(),b.salt);c.set(olympe.dm.User.verifierProp.R(),b.verifier);ah(this.C).pc(this.R(),c,!1,a)}};olympe.dc.ba.vf.prototype.awardRole=olympe.dc.ba.vf.prototype.Bv;olympe.dc.ba.vf.prototype.setDomain=olympe.dc.ba.vf.prototype.gy;olympe.dc.ba.vf.prototype.setPassword=olympe.dc.ba.vf.prototype.Hn;olympe.dc.ba.vf.prototype.setUsername=olympe.dc.ba.vf.prototype.py;olympe.dc.ba.O={At:'dc.io.IOService',Fh:'dc.io.IOUrlsProvider'};olympe.T.config(function(a){ta(a,olympe.dc.ba.O.Fh);C(a,olympe.dc.ba.O.At,[olympe.pa.O.va,olympe.net.O.va,olympe.auth.O.va,olympe.dc.ba.O.Fh],b=>new olympe.dc.ba.Ap(b.Nc('dc.io')))},'olympe.dc.io');olympe.dc.ba.QC=function(a,b,c=!1){if(a.startsWith('@')||a.startsWith('v'))return!1;a.startsWith(olympe.dc.Ug.mc)&&(a=a.substring(1));const d=olympe.dc.Na();return b?c?Cd(d,a,b):Cd(d,a,d.model(b)):d.Gb(a)};olympe.dm={};olympe.dm.Rc={NONE:0,Us:1,Bo:2,Vs:4,Rs:8,Ts:16,Ss:31,qu:32,nu:64,ru:128,ou:256,hq:512,pu:992,jt:1023};olympe.dm.$c=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}ma(){return this.Fb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Wa.EMPTY}F(){return olympe.D.qa.C}};olympe.dm.$c.P=olympe.dc.Ba.C('ff021000000000000002',olympe.dm.$c);olympe.dm.$c.ka=olympe.dm.$c.P.Ca('ff023000000000000035');olympe.dm.$c.C=olympe.dm.$c.P.Pa('ff022000000000000005');olympe.dm.$c.F=Fc('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.$c.aa=Fc('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
718
- olympe.dm.$c.N=Fc('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.$c.prototype.ma.K=olympe.D.J.F;olympe.dm.$c.prototype.C.K=olympe.D.J.F;olympe.dm.$c.prototype.F.K=olympe.D.J.V;olympe.dm.User=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Aw(){return this.hn()}ma(){return this.hn()}hn(){return this.Fb(olympe.dm.User.loginProp)}Ot(){return this.Fb(olympe.dm.User.F)}Nt(){return olympe.D.Wa.EMPTY}Zw(){return this.Fb(olympe.dm.User.saltProp)}ix(){return this.Fb(olympe.dm.User.verifierProp)}Ww(){return this.ub(olympe.dm.User.C,olympe.dm.$c)}};olympe.dm.User.P=olympe.dc.Ba.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.P.Ca('ff023000000000000001');
671
+ For more information, activate the database debug mode or call "dbMonitor.debug(${a})" from this console.`),b=new olympe.dc.CloudObject(void 0,a)):b=c.instantiate(a,b.C)}return b}static Kv(a,b,c=olympe.dc.Ha.bc){if('undefined'===typeof olympe.sc)throw Error('Method CloudObject.createWith should only be used at runtime, when sc package exists');const d=new olympe.sc.Transaction(!1);a=d.create(b||this,a,c);d.hb().catch(e=>olympe.pa.Xa('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${e}`));
672
+ return this.get(a)}static uv(){return this.get(this)}static Uk(a){return olympe.dc.gb.Uk(a)}static rd(){return olympe.dc.Na().ub(this,olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.ta.Property(a))}static dd(){const a=olympe.dc.Na();return a.ub(this,olympe.dc.CloudObject.G).map(b=>new olympe.dc.ta.Relation(b)).concat(a.ub(this,olympe.dc.CloudObject.U).map(b=>new olympe.dc.ta.Relation(b,olympe.dc.za.ORIGIN)))}static Jf(a){return olympe.dc.CloudObject.get(a)}static Bw(a){var b=dh(olympe.dc.Sr(),
673
+ olympe.dc.xa(a));b=b&&b.C;return new olympe.dc.Aa(olympe.dc.xa(a),olympe.dc.CloudObject.instancesRel,b)}R(){return this.tag}name(){return this.db.name(this)}ma(){return this.Fb(olympe.dc.CloudObject.nameProp)}nh(){this.model||(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.gb.from(this)}Vf(){return this.db.Vf(this)}jx(){return this.db.version(this)}Jt(){return this.db.source(this)}Lr(){return olympe.D.Fa([this.ma()],a=>olympe.D.Bb(a),olympe.D.Wa,
674
+ 'getDisplayName',olympe.D.Bb('('+this.toString()+')'))}Rb(){return this.model?this.model.R():this.db.model(this)}observe(a,b){const c='function'===typeof a.Ec?a.Ec():a;return new rxjs.Observable(d=>{const e=Bd(this.db,this.tag,b,f=>{null===f||void 0===f?d.next(null):d.next(f)});c.vc(()=>{d.complete();this.db.F(this.tag,b,e)});return()=>this.db.F(this.tag,b,e)})}Ux(a){return this.observe(olympe.D.Ja(),a)}get(a){return this.db.fb(this.tag,a,!0)}fb(a){return this.get(a)}sb(a){return olympe.dc.gb.from(this).sb(a)}$v(a){return olympe.dc.ld.from(this).sb(a)}kw(){return this.cd(olympe.dc.CloudObject.fc,
675
+ olympe.dc.CloudObject)}Zm(){return this.ub(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Mf(a,b,c){const d=olympe.D.Kc(c,'Sync valueType'),e=Bd(this.db,this.tag,a,olympe.D.Ja().Cb(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.node.onDestroy(()=>this.db.F(this.tag,a,e));return d.node}Fb(a){return L(this.Mf(a,olympe.dc.W.Tb.Mm,olympe.D.Wa))}Ie(a){return L(this.Mf(a,olympe.dc.W.Tb.Lm,olympe.D.ea))}oh(a){return L(this.Mf(a,olympe.dc.W.Tb.Jm,olympe.D.qa))}ij(a){return L(this.Mf(a,
676
+ olympe.dc.W.Tb.Km,olympe.D.jb))}Rr(){return L(this.Mf(olympe.dm.Color.valueProp,olympe.dc.W.Tb.zr,olympe.D.Color))}Rw(a){return L(this.Mf(a,olympe.dc.W.Tb.Ar,olympe.dc.CloudObject))}ub(a,b){a=a instanceof olympe.dc.X.Qb?a:new olympe.dc.X.Qb(a.R(),a.Oa());return new olympe.dc.Aa(this.R(),a,b)}cd(a,b){return this.ub(a,b).Oc()}Ir(a,b){const c=this.db,d=olympe.W.nc(),e=olympe.D.Ja(),f=new Map;V(c,this.tag,a,(g,h)=>{g?(g=new olympe.D.Wb(`forEachRelated: (${this.tag})-[:${a.R()}]-(${h})`,e),f.set(h,g),
677
+ g.run(b,olympe.dc.CloudObject.get(h))):f.has(h)&&(f.get(h).destroy(),f.delete(h))},d);e.vc(()=>{c.C(this.tag,a,d)})}By(){return new olympe.dc.Aa(this.R(),[],Kc(this.R()))}transform(...a){return(new olympe.dc.Aa(this.R(),[],this.constructor)).transform(...a)}hd(){return this.Lr()}toString(){if(!this.db.Gb(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.Gb(this.tag))return{CloudObject:'Unknown tag'};
678
+ 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})`}}qb(a){return a instanceof olympe.dc.CloudObject?this.R()===a.R():!1}Td(a){return olympe.D.Fa([a],b=>olympe.D.Ac(this.qb(b)),olympe.D.qa)}Mv(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Transaction,c=!0;const d=olympe.dc.za.ORIGIN;for(const [e,f,g]of Ed(b,this))f===d?a.hc(e,g,this):e!==olympe.dc.CloudObject.modelRel.R()&&a.hc(e,this,g);a.delete(this,
679
+ olympe.dc.Sb.NONE);c&&a.hb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.qb;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.$v;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.sb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.fb;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Ux;
680
+ olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.Rb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Vf;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.nh;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;
681
+ olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.R;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Bw;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Jf;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.dd;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.rd;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Uk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.uv;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Kv;
682
+ olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.P=olympe.dc.Ba.C('ff021000000000000001',olympe.dc.CloudObject);olympe.dc.CloudObject.ii=olympe.dc.CloudObject.P.Ca(olympe.dc.$b.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.P.Ca('ff023000000000000011');z('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.Y=olympe.dc.CloudObject.P.Ca('ff023000000000000012');olympe.dc.CloudObject.G=olympe.dc.CloudObject.P.Pa('ff02200000000000000a');
683
+ olympe.dc.CloudObject.U=olympe.dc.CloudObject.P.Pa('ff02200000000000000b',olympe.dc.za.ORIGIN);olympe.dc.CloudObject.Af=olympe.dc.CloudObject.P.Pa('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.Se=olympe.dc.CloudObject.P.Pa('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.P.Pa('ff02200000000000000c');z('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.P.Pa('ff02200000000000000d',olympe.dc.za.ORIGIN);
684
+ olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.P.Pa(olympe.dc.kc.Tc);z('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=P(olympe.dc.CloudObject.P,olympe.dc.CloudObject.modelRel);z('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.P.Pa(olympe.dc.kc.xi);z('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);
685
+ olympe.dc.CloudObject.extendedByRel=P(olympe.dc.CloudObject.P,olympe.dc.CloudObject.extendRel);z('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.P.Pa(olympe.dc.kc.co);z('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.fc=P(olympe.dc.CloudObject.P,olympe.dc.CloudObject.containsRel);olympe.dc.eB=olympe.dc.CloudObject;olympe.dc.CloudObject.la=[olympe.dc.ze];m=olympe.dc.CloudObject.prototype;
686
+ m.R.K=new olympe.D.J(()=>String,[]);m.name.K=new olympe.D.J(()=>String,[]);m.ma.K=olympe.D.J.F;m.nh.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.jx.K=new olympe.D.J(()=>Number,[]);m.Jt.K=new olympe.D.J(()=>String,[]);m.Lr.K=olympe.D.J.F;m.Rb.K=new olympe.D.J(()=>String,[]);m.kw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Zm.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.Mf.K=new olympe.D.J(()=>olympe.D.Node,[]);m.Fb.K=olympe.D.J.F;m.Ie.K=olympe.D.J.G;m.oh.K=olympe.D.J.U;
687
+ m.ij.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Rr.K=new olympe.D.J(()=>olympe.D.Color,[]);m.Rw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.ub.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.cd.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Ir.K=new olympe.D.J(()=>{},[]);m.By.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.hd.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.qb.K=olympe.D.J.C;m.Td.K=olympe.D.J.U;m.Mv.K=new olympe.D.J(()=>{},[]);olympe.dc.dk=class{constructor(a){this.instance=a}R(){return this.instance.R()}kj(){return nb(this.instance.oh(olympe.dc.CloudObject.Y))}uw(){return this.instance.cd(olympe.dc.CloudObject.extendRel,olympe.dc.CloudObject)}bn(){return this.instance.transform(new olympe.dc.X.Dc(olympe.dc.CloudObject.extendRel.R(),olympe.dc.za.DESTINATION,olympe.dc.X.nk.et))}en(){return this.instance.transform(new olympe.dc.X.Dc(olympe.dc.CloudObject.extendRel.R(),olympe.dc.za.DESTINATION,olympe.dc.X.nk.pp))}rd(){return this.en().transform(olympe.dc.CloudObject.propertyRel,
688
+ new olympe.dc.X.xe)}Kw(){return this.instance.transform(olympe.dc.CloudObject.propertyRel)}dd(){return this.en().transform(olympe.dc.CloudObject.G,new olympe.dc.X.xe)}Lw(){return this.instance.transform(olympe.dc.CloudObject.G)}static from(a){return olympe.D.Fa([a],b=>{const c=b.R(),d=olympe.dc.Na();if(!d.lj(c))throw Error(`Instance "${d.name(c)}" (tag=${c}) is not a model.`);return new olympe.dc.dk(b)},olympe.dc.dk,'transformToModelInfo')}static kj(){return nb((void 0).oh(olympe.dc.CloudObject.Y))}};
689
+ olympe.dc.dk.la=[olympe.dc.ze];m=olympe.dc.dk.prototype;m.uw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.bn.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.en.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.rd.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.Kw.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.dd.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.Lw.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dc.lA=class{};olympe.dc.ba={};olympe.dc.ba.up=class{constructor(a){this.L=a}};olympe.dc.ba.up.od={Ri:0,DA:1,EA:3,nA:4};olympe.dc.ba.Xj=class{};function Y(a){if(a.Y)throw Error('Cannot modify definition after definition is written');}
690
+ olympe.dc.ba.Zb=class{constructor(a,b){a=this.C=a;if(a.C)throw b=a.C.ma(),a=a.C.R(),Error('Cannot work on a new definition without calling done on the previous one or popping it. '+`Make sure done() method has been called on previous definition ${b} (${a})`);if(void 0===this)throw Error('Current def cannot be set to undefined.');a.C=this;this.tag=b;this.F=new Map;this.aa=olympe.dc.CloudObject.P.R();this.Da=new Map;this.ra=new Map;this.Y=this.ka=!1;this.U=null}An(a){Y(this);this.aa=a;return this}Rb(){return this.aa}vj(a){Y(this);
691
+ this.U=a;return this}oy(){this.ka=!0;return this}ny(a){Y(this);const b=new Map;if('string'===typeof a){const c=olympe.dc.CloudObject.nameProp.R();b.set(c,a||'')}else Object.keys(a).forEach(c=>{b.set(c,a[c])});this.F=b;return this}ki(a){Y(this);Object.keys(a).forEach(b=>{this.F.set(b,a[b])});return this}setProperty(a,b){Y(this);this.F.set(a,b);return this}el(a){Y(this);const b=olympe.dc.CloudObject.nameProp.R();this.F.set(b,a);return this}vr(a,b){Y(this);if(!a)throw Error('Cannot relate an object to another without a relation tag');
692
+ if(a===olympe.dc.CloudObject.containsRel.R())throw Error('Container must be defined using dedicated helpers setContainedIn');b&&this.Da.set(a+'.'+b,[a,b]);return this}Fm(a,b){Y(this);if(!a)throw Error('Cannot relate an object to another without a relation tag');if(a===olympe.dc.CloudObject.containsRel.R())throw Error('Container must be defined using dedicated helper setContainedIn');b&&this.ra.set(a+'.'+b,[a,b]);return this}done(){if(this.Y)return this;const a=eh(this.C,this.ka);a.F(this.tag,this.F,
693
+ -1);fh(this.C,this);a.Ra(olympe.dc.kc.Tc,this.tag,this.aa,-1);this.U&&a.Ra(olympe.dc.kc.co,this.U,this.tag,-1);this.G(-1);this.Da.forEach(b=>{a.Ra(b[0],this.tag,b[1],-1)});this.ra.forEach(b=>{a.Ra(b[0],b[1],this.tag,-1)});this.Y=!0;this.C.C=void 0;return this}G(){}R(){return this.tag}ma(){return this.F.get('ff023000000000000011')}};olympe.dc.ba.Zb.prototype.getName=olympe.dc.ba.Zb.prototype.ma;olympe.dc.ba.Zb.prototype.getTag=olympe.dc.ba.Zb.prototype.R;olympe.dc.ba.Zb.prototype.done=olympe.dc.ba.Zb.prototype.done;
694
+ olympe.dc.ba.Zb.prototype.addRelationFrom=olympe.dc.ba.Zb.prototype.Fm;olympe.dc.ba.Zb.prototype.addRelationTo=olympe.dc.ba.Zb.prototype.vr;olympe.dc.ba.Zb.prototype.setName=olympe.dc.ba.Zb.prototype.el;olympe.dc.ba.Zb.prototype.setProperty=olympe.dc.ba.Zb.prototype.setProperty;olympe.dc.ba.Zb.prototype.setProperties=olympe.dc.ba.Zb.prototype.ki;olympe.dc.ba.Zb.prototype.setNameOrProperties=olympe.dc.ba.Zb.prototype.ny;olympe.dc.ba.Zb.prototype.setOptional=olympe.dc.ba.Zb.prototype.oy;
695
+ olympe.dc.ba.Zb.prototype.setContainedIn=olympe.dc.ba.Zb.prototype.vj;olympe.dc.ba.Zb.prototype.setModelTag=olympe.dc.ba.Zb.prototype.An;olympe.dc.ba.Zc=class extends olympe.dc.ba.Zb{constructor(a,b){super(a,b);this.Sa=this.C.OBJECT;this.ab=new Map;this.bb=new Map}js(a){Y(this);this.Sa=a;return this}extends(a){return this.js(a)}Ui(){Y(this);this.setProperty(olympe.dc.CloudObject.Y.R(),!0);return this}defineProperty(a,b,c,d){Y(this);this.ab.set(a,new olympe.dc.ba.Zc.Property(a,b,c,d));void 0!==d&&super.setProperty(olympe.dc.Sg.bc+a,d);return this}hh(a,b,c,d,e,{Xi:f=0,rj:g=olympe.dm.Relation.N,uj:h=0,gl:k=d,Jk:l=olympe.dm.Rc.NONE}={}){Y(this);
696
+ b=new olympe.dc.ba.Zc.Relation(a,this.R(),b,c||'',d,e,h,k,f,g,l);this.bb.set(a,b);return this}G(a){super.G(a);eh(this.C).Ra(olympe.dc.CloudObject.extendRel.R(),this.tag,this.Sa,a);this.ab.forEach(b=>{const c={[olympe.dc.CloudObject.nameProp.R()]:b.name||''},d=olympe.dc.xa(olympe.dm.Property),e=olympe.dc.CloudObject.propertyRel.R(),f=b.tag;this.C.push();this.C.wh(f,d).ki(c).done();this.C.pop();b=b.type;eh(this.C).Ra(e,this.R(),f,a);eh(this.C).Ra(olympe.dm.Property.typeRel.R(),f,b,a)});this.bb.forEach(b=>
697
+ {this.C.hh(b.C,b.G,b.F,b.name,b.Hr,b.Fr,{uj:b.uj,gl:b.gl,Xi:b.Xi,rj:b.rj,Jk:b.Jk},a)})}};olympe.dc.ba.Zc.prototype.defineRelation=olympe.dc.ba.Zc.prototype.hh;olympe.dc.ba.Zc.prototype.defineProperty=olympe.dc.ba.Zc.prototype.defineProperty;olympe.dc.ba.Zc.prototype['abstract']=olympe.dc.ba.Zc.prototype.Ui;olympe.dc.ba.Zc.prototype['extends']=olympe.dc.ba.Zc.prototype.extends;olympe.dc.ba.Zc.prototype.setParentTag=olympe.dc.ba.Zc.prototype.js;
698
+ olympe.dc.ba.Zc.Property=class{constructor(a,b,c,d){this.tag=a;this.type=b;this.name=c||'';this.defaultValue=d}};olympe.dc.ba.Zc.Relation=class{constructor(a,b,c,d,e,f,g,h,k,l,n){this.C=a;this.G=b;this.F=c;this.name=d;this.Hr=e;this.Fr=f;this.uj=g;this.gl=h;this.Xi=k;this.rj=l;this.Jk=n}};function eh(a,b){return b?a.Y:a.F}function fh(a,b){0<a.N.length&&(b.U||a.F.Ra(olympe.dc.CloudObject.containsRel.R(),a.N[a.N.length-1].R(),b.R(),-1))}
699
+ olympe.dc.ba.Qa=class{constructor(a){if(a&&void 0===a.log)throw Error('Argument of OSaveFileBuilder is not a logger - might be a source, adapt implementing classes');this.F=new olympe.dc.transaction.wd(!0);this.Y=new olympe.dc.transaction.wd(!0);this.L=a||null;this.Da=!1;this.G=null;this.ra=new Map;this.aa=null;this.ka=Object.create(null);this.C=void 0;this.N=[];this.U=!0;this.cs=/eval \(eval at process .*<anonymous>:(\d+):(\d+)\)/m;this.DEFAULT=olympe.dc.Sg.bc;this.OBJECT=olympe.dc.CloudObject.P.R();
700
+ this.PROPERTY=olympe.dm.Property.P.R();this.RELATION=olympe.dm.Relation.P.R();this.STRING=olympe.dm.String.P.R();this.BOOLEAN=olympe.dm.Boolean.P.R();this.NUMBER=olympe.dm.Number.P.R();this.DATETIME=olympe.dm.DateTime.P.R();this.COLOR=olympe.dm.Color.P.R();this.FILE=olympe.dm.File.P.R();this.ROLE=olympe.dm.$c.P.R();this.USER=olympe.dm.User.P.R();this.ONE_ONE=olympe.dm.Relation.F.ju;this.ONE_MANY=olympe.dm.Relation.F.$l;this.MANY_ONE=olympe.dm.Relation.F.bu;this.MANY_MANY=olympe.dm.Relation.F.Wl;this.NONE=
701
+ olympe.dm.Rc.NONE;this.DESTINATION_READ=olympe.dm.Rc.Qs;this.DESTINATION_CREATE=olympe.dm.Rc.vo;this.DESTINATION_WRITE=olympe.dm.Rc.Rs;this.DESTINATION_DELETE=olympe.dm.Rc.Ns;this.DESTINATION_LINK=olympe.dm.Rc.Ps;this.DESTINATION_FULL=olympe.dm.Rc.Os;this.ORIGIN_READ=olympe.dm.Rc.nu;this.ORIGIN_CREATE=olympe.dm.Rc.ku;this.ORIGIN_WRITE=olympe.dm.Rc.ou;this.ORIGIN_DELETE=olympe.dm.Rc.lu;this.ORIGIN_LINK=olympe.dm.Rc.aq;this.ORIGIN_FULL=olympe.dm.Rc.mu;this.FULL=olympe.dm.Rc.gt;this.DUMP_IGNORE=olympe.dm.Relation.C.jp;
702
+ this.DUMP_REF=olympe.dm.Relation.C.wq;this.DUMP_REVERSE_REF=olympe.dm.Relation.C.Gu;this.DUMP_UNILATERAL=olympe.dm.Relation.C.yk;this.DUMP_REVERSE_UNILATERAL=olympe.dm.Relation.C.mk;this.DUMP_EVERYTHING=olympe.dm.Relation.C.Co;this.DUMP_DEFAULT=olympe.dm.Relation.C.bc;this.DUMP_REV_DEFAULT=olympe.dm.Relation.C.Fu;this.DELETE_REF=this.DUMP_BOTH_REF=olympe.dm.Relation.C.pl;this.DELETE_REF_AND_DESTINATION=olympe.dm.Relation.C.Cu;this.DELETE_REF_AND_ORIGIN=olympe.dm.Relation.C.Du;this.DELETE_EVERYTHING=
703
+ olympe.dm.Relation.C.Co;this.OLYMPE_AUTHENTICATED_USERS=olympe.dm.$c.F}push(){this.N.push(this.C);this.C=void 0}pop(){if(this.C)throw Error('Cannot unstack definition: current definition not closed');this.C=this.N.pop()}Xv(){const a=new Map,b=olympe.dc.ba.Qu.C(this.aa,this.F,this.Y);for(const [c,d]of b.entries())a.set(c,d.G());return a}Uw(){return this.aa}my(a){this.U=a}log(...a){this.U&&this.L&&this.L.log(...a)}rn(...a){this.U&&this.L&&this.L.debug(...a)}xx(...a){this.U&&this.L&&this.L.warn(...a)}Yk(...a){this.U&&
704
+ this.L&&this.L.error(...a)}wv(a){if(a&&20===a.length&&!this.Da){if(this.ka[a])throw Error('Tag '+a+' is used to define more than one keyword');return this.ka[a]=a}this.G=null===this.G?olympe.W.cj():olympe.W.Sw(this.G);this.log('Generating new tag to replace '+a+'. New tag is: '+this.G);return this.G}fn(a){const b=this.ra.get(a)||1,c=olympe.W.fn(a,b);this.ra.set(a,b+1);return c}ty(a){this.Da=a}Ov(){}qy(a){this.aa=a}wh(a,b){return(new olympe.dc.ba.Zb(this,a)).An(b)}Mx(a,b){return(new olympe.dc.ba.Zc(this,
705
+ a)).el(b)}Lx(a,b){return(new olympe.dc.ba.Zc(this,a)).el(b).Ui()}Nx(a){return new olympe.dc.ba.tf(this,a)}$k(a,b,c){this.F.Ra(a,b,c,-1)}defineProperty(a,b,c,d,e){this.rn('Defining property ',d,' on model ',a);d={[olympe.dc.CloudObject.nameProp.R()]:d||''};void 0!==e&&this.qc(a,{[olympe.dc.Sg.bc+c]:e});this.C?(this.push(),this.wh(c,olympe.dm.Property.P.R()).ki(d).done(),this.pop()):this.wh(c,olympe.dm.Property.P.R()).ki(d).vj(a).done();this.$k(olympe.dc.CloudObject.propertyRel.R(),a,c);this.$k(olympe.dm.Property.typeRel.R(),
706
+ c,b)}hh(a,b,c,d,e,f,{Xi:g=olympe.dm.Relation.F.$l,rj:h=olympe.dm.Relation.N,uj:k=0,gl:l=e,Jk:n=olympe.dm.Rc.NONE}={},p=-1){if(void 0===e||null===e)throw Error('Cannot define a relation without defining the dump follow rules (must be set to db.DUMP_<something> and cannot be undefined or null)');if(void 0===f||null===f)throw Error('Cannot define a relation without defining the delete follow rules (must be set to db.DELETE_<something> and cannot be undefined or null)');const q=olympe.dm.Relation;d={[olympe.dc.CloudObject.nameProp.R()]:d||
707
+ '',[q.Im.R()]:g,[q.wn.R()]:h,[q.Sm.R()]:e,[q.Rm.R()]:f,[q.dl.R()]:k,[q.ks.R()]:l,[q.xv.R()]:n};this.C?(this.push(),this.wh(a,q.P.R()).ki(d).done(),this.pop()):this.wh(a,q.P.R()).ki(d).vj(b).done();this.F.Ra(q.originModelRel.R(),b,a,p);this.F.Ra(q.destinationModelRel.R(),a,c,p)}vx(a,b){this.F.Ra(olympe.dm.$c.C.R(),a,b,-1)}qc(a,b,c=!1){this.rn('Updating instance ',a);delete b[olympe.dc.$b.Jd];delete b[olympe.dc.$b.VERSION];const d=new Map;Object.keys(b).forEach(e=>{d.set(e,b[e])});this.F.qc(a,d,c,-1)}assign(a,
708
+ b,c){this.$k(b,a,c)}vv(a,b,c){this.Y.Ra(b,a,c,-1)}Jv(a){return new olympe.dc.Hc(a)}Ev(a,b,c,d){const e={c:7};e.r=a;e.g=b;e.b=c;e.a=d;return e}Fv({year:a=1970,month:b=1,day:c=1,hour:d=1,minute:e=0,second:f=0,UC:g=0,fD:h=0}={}){const k={c:4};k.y=a;k.M=b;k.d=c;k.h=d;k.m=e;k.s=f;k.S=g;k.z=h;return k}bw(a){a=new Date(Date.parse(a));const b={c:4};b.y=a.getFullYear();b.M=a.getMonth()+1;b.d=a.getDate();b.h=a.getHours();b.m=a.getMinutes();b.s=a.getSeconds();b.S=a.getMilliseconds();b.z=-a.getTimezoneOffset();
709
+ return b}Gv(a){a='number'===typeof a?new Date(a):a;const b={c:4};b.h=a.getHours();b.m=a.getMinutes();b.s=a.getSeconds();b.S=a.getMilliseconds();b.z=a.getTimezoneOffset();b.y=a.getFullYear();b.M=a.getMonth()+1;b.d=a.getDate();return b}bj(a,b,c){return olympe.auth.Hb.Ee.bj(a,c)}Jr(a,b){return olympe.auth.Hb.Ee.bj(a,b)}hc(){throw Error('DeleteRelation method on OSaveFile is deprecated');}Jc(){throw Error('DeleteInstance method on OSaveFile is deprecated');}};
710
+ olympe.dc.ba.Qa.prototype.deleteInstance=olympe.dc.ba.Qa.prototype.Jc;olympe.dc.ba.Qa.prototype.deleteRelation=olympe.dc.ba.Qa.prototype.hc;olympe.dc.ba.Qa.prototype.generateAuthenticationData=olympe.dc.ba.Qa.prototype.Jr;olympe.dc.ba.Qa.prototype.generateAuthData=olympe.dc.ba.Qa.prototype.bj;olympe.dc.ba.Qa.prototype.createDateTimeLegacy=olympe.dc.ba.Qa.prototype.Gv;olympe.dc.ba.Qa.prototype.fromISODate=olympe.dc.ba.Qa.prototype.bw;olympe.dc.ba.Qa.prototype.createDateTime=olympe.dc.ba.Qa.prototype.Fv;
711
+ olympe.dc.ba.Qa.prototype.createColor=olympe.dc.ba.Qa.prototype.Ev;olympe.dc.ba.Qa.prototype.createReference=olympe.dc.ba.Qa.prototype.Jv;olympe.dc.ba.Qa.prototype.assignOptional=olympe.dc.ba.Qa.prototype.vv;olympe.dc.ba.Qa.prototype.assign=olympe.dc.ba.Qa.prototype.assign;olympe.dc.ba.Qa.prototype.updateInstance=olympe.dc.ba.Qa.prototype.qc;olympe.dc.ba.Qa.prototype.linkRoleToUser=olympe.dc.ba.Qa.prototype.vx;olympe.dc.ba.Qa.prototype.defineRelation=olympe.dc.ba.Qa.prototype.hh;
712
+ olympe.dc.ba.Qa.prototype.defineProperty=olympe.dc.ba.Qa.prototype.defineProperty;olympe.dc.ba.Qa.prototype.newRelation=olympe.dc.ba.Qa.prototype.$k;olympe.dc.ba.Qa.prototype.newUser=olympe.dc.ba.Qa.prototype.Nx;olympe.dc.ba.Qa.prototype.newAbstractModel=olympe.dc.ba.Qa.prototype.Lx;olympe.dc.ba.Qa.prototype.newModel=olympe.dc.ba.Qa.prototype.Mx;olympe.dc.ba.Qa.prototype.newInstance=olympe.dc.ba.Qa.prototype.wh;olympe.dc.ba.Qa.prototype.setRootInstanceTag=olympe.dc.ba.Qa.prototype.qy;
713
+ olympe.dc.ba.Qa.prototype.disableChecks=olympe.dc.ba.Qa.prototype.Ov;olympe.dc.ba.Qa.prototype.setUseNewTags=olympe.dc.ba.Qa.prototype.ty;olympe.dc.ba.Qa.prototype.assignTag=olympe.dc.ba.Qa.prototype.wv;olympe.dc.ba.Qa.prototype.logError=olympe.dc.ba.Qa.prototype.Yk;olympe.dc.ba.Qa.prototype.logWarn=olympe.dc.ba.Qa.prototype.xx;olympe.dc.ba.Qa.prototype.logDebug=olympe.dc.ba.Qa.prototype.rn;olympe.dc.ba.Qa.prototype.log=olympe.dc.ba.Qa.prototype.log;olympe.dc.ba.Qa.prototype.setLoggingEnabled=olympe.dc.ba.Qa.prototype.my;
714
+ olympe.dc.ba.Qa.prototype.getRootInstanceTag=olympe.dc.ba.Qa.prototype.Uw;olympe.dc.ba.Qa.prototype.flushContents=olympe.dc.ba.Qa.prototype.Xv;olympe.dc.ba.rg=class extends olympe.dc.ba.Zc{constructor(a,b,c){super(a,b);this.N=this.description=null;this.setProperty(olympe.dm.BrickMetadata.ab.R(),olympe.dm.BrickMetadata.Ab.qu);null!==c&&this.wr(c)}wr(a){this.vj(a);this.Fm(olympe.dm.Pb.C.R(),a);return this}ly(a){this.F.set(olympe.dm.we.Sa.R(),a);return this}jy(a){Y(this);this.description=a;return this}sy(a){Y(this);this.N=a;return this}G(a){super.G(a);if(null!==this.description||null!==this.N)this.C.push(),a=this.C.wh(this.C.fn(this.tag),olympe.sc.Cc.P.R()),
715
+ this.description&&a.setProperty(olympe.sc.Cc.C.R(),this.description),this.N&&a.setProperty(olympe.sc.Cc.N.R(),this.N),a.vj(this.tag).vr(olympe.sc.Cc.F.R(),this.tag).done(),this.C.pop()}};olympe.dc.ba.rg.prototype.setSummary=olympe.dc.ba.rg.prototype.sy;olympe.dc.ba.rg.prototype.setDescription=olympe.dc.ba.rg.prototype.jy;olympe.dc.ba.rg.prototype.setIcon=olympe.dc.ba.rg.prototype.ly;olympe.dc.ba.rg.prototype.addToFolder=olympe.dc.ba.rg.prototype.wr;olympe.dc.ba.Qu=class a{constructor(b,c,d){this.F=b;this.ua=c||[];this.C=d||[]}static C(b,c,d){if(c instanceof olympe.dc.transaction.wd&&d instanceof olympe.dc.transaction.wd){c=ce(c);var e=ce(d)}else e=new olympe.dc.transaction.wd(!0),c.Mc(e),c=ce(e),d.Mc(e),e=ce(e);d=new Map;var f=new a(b,c.wg,e.wg);f.Rf()||d.set('delRel',f);f=new a(b,c.Te,e.Te);f.Rf()||d.set('detInst',f);f=new a(b,c.Fg,e.Fg);f.Rf()||d.set('newInst',f);f=new a(b,c.Yf,e.Yf);f.Rf()||d.set('updateInst',f);b=new a(b,c.Gg,e.Gg);b.Rf()||
716
+ d.set('newRel',b);return d}Rf(){return 0===this.ua.length+this.C.length}static tn(b){const c=Object.create(null),d=[],e=[];b.forEach(f=>{0===Object.keys(c).length&&(c.rootTag=f.rootTag);d.push(...(f.operations||[]));e.push(...(f.optionalOperations||[]))});0!==d.length&&(c.operations=d);0!==e.length&&(c.optionalOperations=e);return c}G(){const b=(d,e)=>{var f=d.o,g=e.o;return f!==g?f<g?-1:1:1===f||2===f||3===f?(f=d.t,g=e.t,f===g?(d=Object.keys(d.p)[0],e=Object.keys(e.p)[0],void 0!==d?d.localeCompare(e):
717
+ 1):f.localeCompare(g)):4===f||5===f?(f=d.l,g=e.l,f===g?(f=d.m,g=e.m,f===g?d.r.localeCompare(e.r):f.localeCompare(g)):f.localeCompare(g)):JSON.stringify(f).localeCompare(JSON.stringify(g))},c=Object.create(null);this.ua.sort(b);this.C.sort(b);c.rootTag=this.F;c.operations=this.ua;c.optionalOperations=this.C;return c}};olympe.dc.ba.tf=class extends olympe.dc.ba.Zb{constructor(a,b){super(a,b);this.password=this.N=null;this.An(olympe.dc.xa(olympe.dm.User))}uy(a){Y(this);this.N=a;return this}Bn(a){Y(this);this.password=a;return this}ky(){return this}yv(a){Y(this);this.Fm(olympe.dm.User.C.R(),a);return this}G(a){super.G(a);if(null==this.N||''===this.N)throw Error('A username must be set when calling new User');if(null==this.password||''===this.password)throw Error('A password must be set when calling new User');const b=
718
+ this.C.Jr(this.N,this.password),c=new Map;c.set(olympe.dm.User.loginProp.R(),b.login);c.set(olympe.dm.User.saltProp.R(),b.salt);c.set(olympe.dm.User.verifierProp.R(),b.verifier);eh(this.C).qc(this.R(),c,!1,a)}};olympe.dc.ba.tf.prototype.awardRole=olympe.dc.ba.tf.prototype.yv;olympe.dc.ba.tf.prototype.setDomain=olympe.dc.ba.tf.prototype.ky;olympe.dc.ba.tf.prototype.setPassword=olympe.dc.ba.tf.prototype.Bn;olympe.dc.ba.tf.prototype.setUsername=olympe.dc.ba.tf.prototype.uy;olympe.dc.ba.O={xt:'dc.io.IOService',Dh:'dc.io.IOUrlsProvider'};olympe.T.config(function(a){ta(a,olympe.dc.ba.O.Dh);C(a,olympe.dc.ba.O.xt,[olympe.pa.O.va,olympe.net.O.va,olympe.auth.O.va,olympe.dc.ba.O.Dh],b=>new olympe.dc.ba.up(b.Nc('dc.io')))},'olympe.dc.io');olympe.dc.ba.TC=function(a,b,c=!1){if(a.startsWith('@')||a.startsWith('v'))return!1;a.startsWith(olympe.dc.Sg.bc)&&(a=a.substring(1));const d=olympe.dc.Na();return b?c?Gd(d,a,b):Gd(d,a,d.model(b)):d.Gb(a)};olympe.dm={};olympe.dm.Rc={NONE:0,Qs:1,vo:2,Rs:4,Ns:8,Ps:16,Os:31,nu:32,ku:64,ou:128,lu:256,aq:512,mu:992,gt:1023};olympe.dm.$c=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}ma(){return this.Fb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Wa.EMPTY}F(){return olympe.D.qa.C}};olympe.dm.$c.P=olympe.dc.Ba.C('ff021000000000000002',olympe.dm.$c);olympe.dm.$c.ka=olympe.dm.$c.P.Ca('ff023000000000000035');olympe.dm.$c.C=olympe.dm.$c.P.Pa('ff022000000000000005');olympe.dm.$c.F=Jc('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.$c.aa=Jc('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
719
+ olympe.dm.$c.N=Jc('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.$c.prototype.ma.K=olympe.D.J.F;olympe.dm.$c.prototype.C.K=olympe.D.J.F;olympe.dm.$c.prototype.F.K=olympe.D.J.U;olympe.dm.User=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}xw(){return this.cn()}ma(){return this.cn()}cn(){return this.Fb(olympe.dm.User.loginProp)}Lt(){return this.Fb(olympe.dm.User.F)}Kt(){return olympe.D.Wa.EMPTY}Ww(){return this.Fb(olympe.dm.User.saltProp)}ix(){return this.Fb(olympe.dm.User.verifierProp)}Tw(){return this.ub(olympe.dm.User.C,olympe.dm.$c)}};olympe.dm.User.P=olympe.dc.Ba.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.P.Ca('ff023000000000000001');
719
720
  z('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.F=olympe.dm.User.P.Ca('ff023000000000000002');olympe.dm.User.saltProp=olympe.dm.User.P.Ca('ff023000000000000004');z('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.P.Ca('ff023000000000000005');z('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.aa=olympe.dm.User.P.Ca('ff023000000000000020');olympe.dm.User.SAMLnameIdProp=olympe.dm.User.P.Ca('ff023000000000000036');
720
- z('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.C=P(olympe.dm.User.P,olympe.dm.$c.C);olympe.dm.User.ka=olympe.dm.User.P.Pa('ff022000000000000002');olympe.dm.User.N=Fc('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.Aw.K=olympe.D.J.F;m.ma.K=olympe.D.J.F;m.hn.K=olympe.D.J.F;m.Ot.K=olympe.D.J.F;m.Nt.K=olympe.D.J.F;m.Zw.K=olympe.D.J.F;m.ix.K=olympe.D.J.F;m.Ww.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.we=class extends olympe.dc.CloudObject{ka(){return this.dn()}Ab(){return this.Fb(olympe.dm.we.Sa)}};olympe.dm.we.P=olympe.dc.Ba.C('01621fb84e3300000000',olympe.dm.we);olympe.dm.we.Sa=olympe.dm.we.P.Ca('01609de3f292e3c2c6ff');olympe.dm.we.prototype.ka.K=new olympe.D.J(()=>olympe.D.nd,[]);olympe.dm.we.prototype.Ab.K=olympe.D.J.F;olympe.dm.BrickMetadata=class extends olympe.dm.we{Xb(){return this.Fb(olympe.dm.BrickMetadata.ab)}Rd(){return this.Fb(olympe.dm.BrickMetadata.bb)}C(){return null}};olympe.dm.BrickMetadata.P=Jc(olympe.dc.Ba.C('01621fb84e3500000000',olympe.dm.BrickMetadata));olympe.dm.BrickMetadata.ab=olympe.dm.BrickMetadata.P.Ca('01621fb84e320000f001');olympe.dm.BrickMetadata.bb=olympe.dm.BrickMetadata.P.Ca('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Wf=olympe.dm.BrickMetadata.P.Pa('0161ae97622bb21f335b');
721
- olympe.dm.BrickMetadata.Ab={tA:'private',tu:'public'};olympe.dm.BrickMetadata.ce=Fc('01703376c4a81c0e9d95','BRICK_STATUS');olympe.dm.BrickMetadata.od={iz:'experimental',EA:'stable',$y:'deprecated'};olympe.dm.BrickMetadata.prototype.Xb.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.Rd.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.C.K=new olympe.D.J(()=>String,[]);olympe.dm.Pb=class extends olympe.dm.BrickMetadata{V(){return new olympe.dc.Aa(this.R(),[new olympe.dc.X.Dc(olympe.dm.Pb.F.R(),olympe.dc.za.DESTINATION,olympe.dc.X.sk.wp,olympe.dc.X.sk.ut),olympe.dm.Pb.C])}C(){return null}F(){return this.ub(olympe.dm.Pb.F,olympe.dm.Pb)}Z(){return this.ub(olympe.dm.Pb.C)}};olympe.dm.Pb.P=olympe.dc.Ba.C('01612df1db9749227626',olympe.dm.Pb);olympe.dm.Pb.F=olympe.dm.Pb.P.Pa('016a697ef00ce7554691');olympe.dm.Pb.Xb=P(olympe.dm.Pb.P,olympe.dm.Pb.F);olympe.dm.Pb.C=olympe.dm.Pb.P.Pa('016a697ef00ce7554692');
722
- P(olympe.dc.CloudObject.P,olympe.dm.Pb.C);olympe.dm.Pb.prototype.V.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.Pb.prototype.F.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.Pb.prototype.Z.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.md=class extends olympe.dm.Pb{F(){return this.R()===olympe.dm.md.Da?this.ub(olympe.dm.md.aa,olympe.dm.Pb):this.ub(olympe.dm.md.ka,olympe.dm.Pb)}};olympe.dm.md.P=olympe.dc.Ba.C('ff021000000000000020',olympe.dm.md);olympe.dm.md.ka=olympe.dm.md.P.Pa('017e9c34cf48bd6965c1');olympe.dm.md.aa=olympe.dm.md.P.Pa('017e9c2e013e06bfffd9');olympe.dm.md.Da=Fc('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.md.Nd=Fc('10000000000000000001','OLYMPE_FOLDER');
723
- olympe.dm.md.prototype.F.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{yw(){return this.Fb(olympe.dm.Module.ka)}Kw(){return this.Ie(olympe.dm.Module.ra)}Pt(){return this.Fb(olympe.dm.Module.F)}Pw(){return this.Fb(olympe.dm.Module.Da)}lw(){return this.Fb(olympe.dm.Module.N)}Lw(){return this.ub(olympe.dm.Module.aa,olympe.dm.Module)}$w(){return this.ub(olympe.dm.Module.C,olympe.dm.Fd)}};olympe.dm.Module.P=olympe.dc.Ba.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.ka=olympe.dm.Module.P.Ca('ff023000000000000042');
721
+ z('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.C=P(olympe.dm.User.P,olympe.dm.$c.C);olympe.dm.User.ka=olympe.dm.User.P.Pa('ff022000000000000002');olympe.dm.User.N=Jc('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.xw.K=olympe.D.J.F;m.ma.K=olympe.D.J.F;m.cn.K=olympe.D.J.F;m.Lt.K=olympe.D.J.F;m.Kt.K=olympe.D.J.F;m.Ww.K=olympe.D.J.F;m.ix.K=olympe.D.J.F;m.Tw.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.we=class extends olympe.dc.CloudObject{ka(){return this.Zm()}Ab(){return this.Fb(olympe.dm.we.Sa)}};olympe.dm.we.P=olympe.dc.Ba.C('01621fb84e3300000000',olympe.dm.we);olympe.dm.we.Sa=olympe.dm.we.P.Ca('01609de3f292e3c2c6ff');olympe.dm.we.prototype.ka.K=new olympe.D.J(()=>olympe.D.nd,[]);olympe.dm.we.prototype.Ab.K=olympe.D.J.F;olympe.dm.BrickMetadata=class extends olympe.dm.we{Xb(){return this.Fb(olympe.dm.BrickMetadata.ab)}Rd(){return this.Fb(olympe.dm.BrickMetadata.bb)}C(){return null}};olympe.dm.BrickMetadata.P=Nc(olympe.dc.Ba.C('01621fb84e3500000000',olympe.dm.BrickMetadata));olympe.dm.BrickMetadata.ab=olympe.dm.BrickMetadata.P.Ca('01621fb84e320000f001');olympe.dm.BrickMetadata.bb=olympe.dm.BrickMetadata.P.Ca('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Pf=olympe.dm.BrickMetadata.P.Pa('0161ae97622bb21f335b');
722
+ olympe.dm.BrickMetadata.Ab={wA:'private',qu:'public'};olympe.dm.BrickMetadata.be=Jc('01703376c4a81c0e9d95','BRICK_STATUS');olympe.dm.BrickMetadata.od={lz:'experimental',HA:'stable',dz:'deprecated'};olympe.dm.BrickMetadata.prototype.Xb.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.Rd.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.C.K=new olympe.D.J(()=>String,[]);olympe.dm.Pb=class extends olympe.dm.BrickMetadata{U(){return new olympe.dc.Aa(this.R(),[new olympe.dc.X.Dc(olympe.dm.Pb.F.R(),olympe.dc.za.DESTINATION,olympe.dc.X.nk.pp,olympe.dc.X.nk.rt),olympe.dm.Pb.C])}C(){return null}F(){return this.ub(olympe.dm.Pb.F,olympe.dm.Pb)}Y(){return this.ub(olympe.dm.Pb.C)}};olympe.dm.Pb.P=olympe.dc.Ba.C('01612df1db9749227626',olympe.dm.Pb);olympe.dm.Pb.F=olympe.dm.Pb.P.Pa('016a697ef00ce7554691');olympe.dm.Pb.Xb=P(olympe.dm.Pb.P,olympe.dm.Pb.F);olympe.dm.Pb.C=olympe.dm.Pb.P.Pa('016a697ef00ce7554692');
723
+ P(olympe.dc.CloudObject.P,olympe.dm.Pb.C);olympe.dm.Pb.prototype.U.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.Pb.prototype.F.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.Pb.prototype.Y.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.md=class extends olympe.dm.Pb{F(){return this.R()===olympe.dm.md.Da?this.ub(olympe.dm.md.aa,olympe.dm.Pb):this.ub(olympe.dm.md.ka,olympe.dm.Pb)}};olympe.dm.md.P=olympe.dc.Ba.C('ff021000000000000020',olympe.dm.md);olympe.dm.md.ka=olympe.dm.md.P.Pa('017e9c34cf48bd6965c1');olympe.dm.md.aa=olympe.dm.md.P.Pa('017e9c2e013e06bfffd9');olympe.dm.md.Da=Jc('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.md.Ld=Jc('10000000000000000001','OLYMPE_FOLDER');
724
+ olympe.dm.md.prototype.F.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{vw(){return this.Fb(olympe.dm.Module.ka)}Hw(){return this.Ie(olympe.dm.Module.ra)}Mt(){return this.Fb(olympe.dm.Module.F)}Mw(){return this.Fb(olympe.dm.Module.Da)}iw(){return this.Fb(olympe.dm.Module.N)}Iw(){return this.ub(olympe.dm.Module.aa,olympe.dm.Module)}Xw(){return this.ub(olympe.dm.Module.C,olympe.dm.Fd)}};olympe.dm.Module.P=olympe.dc.Ba.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.ka=olympe.dm.Module.P.Ca('ff023000000000000042');
724
725
  olympe.dm.Module.ra=olympe.dm.Module.P.Ca('ff023000000000000043');olympe.dm.Module.F=olympe.dm.Module.P.Ca('ff023000000000000044');olympe.dm.Module.Da=olympe.dm.Module.P.Ca('ff023000000000000045');olympe.dm.Module.N=olympe.dm.Module.P.Ca('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.P.Ca('ff023000000000000049');olympe.dm.Module.C=olympe.dm.Module.P.Pa('ff022000000000000013');olympe.dm.Module.aa=olympe.dm.Module.P.Pa('ff022000000000000014');
725
- olympe.dm.Module.Sa=Fc('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.yw.K=olympe.D.J.F;m.Kw.K=olympe.D.J.G;m.Pt.K=olympe.D.J.F;m.Pw.K=olympe.D.J.F;m.lw.K=olympe.D.J.F;m.Lw.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.$w.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.File=class extends olympe.dc.CloudObject{constructor(a,b,c,d,e){super(a,b);this.F=c;this.G=d;this.C=e}jn(){return this.Fb(olympe.dm.File.mimeTypeProp)}Sk(a,b){const c=olympe.D.Ia().Cb(a),d=b&&olympe.D.Ia().Cb(b);(a=this.db.fb(this,olympe.dm.File.urlProp,!0))&&a.startsWith('blob:')?this.C.F(a,e=>{this.C.G(e,c)},d):wc(this.F,this,e=>{this.C.G(e,c)},e=>{d&&d(e)})}cn(a,b){this.Sk(c=>{a(Ea(c))},b)}Tk(a,b){const c=olympe.D.Ia().Cb(a);b=b&&olympe.D.Ia().Cb(b);const d=this.db.fb(this,olympe.dm.File.C),
726
- e=this.db.fb(this,olympe.dm.File.urlProp),f=g=>{const h=this.db.fb(this,olympe.dm.File.mimeTypeProp);this.C.G(g,k=>{c(`data:${h};base64,${this.C.C(k)}`)})};d&&d.valueOf()?wc(this.F,this,f.bind(this),b):e&&e.startsWith('blob:')?this.C.F(e,f.bind(this),b):a(e)}rename(a,b){const c=b&&olympe.D.Ia().Cb(b);olympe.D.hs([a],d=>{const e=new olympe.dc.Transaction;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.nameProp,d);e.hb(f=>{c&&c(f)})})}ey(){this.G.N(this.db.fb(this,olympe.dm.File.mimeTypeProp))}Ul(){return this.Fb(olympe.dm.File.urlProp)}Cp(){return this.Fb(olympe.dm.File.nameProp)}ow(){return this.kj(olympe.dm.File.creationDateProp)}Jw(){return this.kj(olympe.dm.File.modificationDateProp)}$r(){return this.qh(olympe.dm.File.C)}static Kv(a,
727
- b,c,d,e,f){d=d||'application/data';c=olympe.W.di().N(new Blob([c],{type:d}));return olympe.dm.File.Jr(a,b,c,d,e,f)}static Jr(a,b,c,d,e,f){const g=olympe.D.jb.now();b=(new Map).set(olympe.dm.File.nameProp,b||'file').set(olympe.dm.File.urlProp,c).set(olympe.dm.File.creationDateProp,g).set(olympe.dm.File.modificationDateProp,g).set(olympe.dm.File.mimeTypeProp,d||'application/data').set(olympe.dm.File.C,!1);return a.create(olympe.dm.File,b,e||olympe.dc.Ja.mc,f)}};olympe.dm.File.createFromURL=olympe.dm.File.Jr;
728
- olympe.dm.File.createFromContent=olympe.dm.File.Kv;olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.ey;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Tk;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.cn;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Sk;olympe.dm.File.P=olympe.dc.Ba.C('ff021000000000000030',olympe.dm.File,olympe.dc.O.zi,olympe.net.O.va,olympe.W.O.zh);olympe.dm.File.nameProp=olympe.dm.File.P.Ca('ff023000000000000050');
726
+ olympe.dm.Module.Sa=Jc('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.vw.K=olympe.D.J.F;m.Hw.K=olympe.D.J.G;m.Mt.K=olympe.D.J.F;m.Mw.K=olympe.D.J.F;m.iw.K=olympe.D.J.F;m.Iw.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.Xw.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.File=class extends olympe.dc.CloudObject{constructor(a,b,c,d,e){super(a,b);this.F=c;this.G=d;this.C=e}dn(){return this.Fb(olympe.dm.File.mimeTypeProp)}Ok(a,b){const c=olympe.D.Ja().Cb(a),d=b&&olympe.D.Ja().Cb(b);(a=this.db.fb(this,olympe.dm.File.urlProp,!0))&&a.startsWith('blob:')?this.C.F(a,e=>{this.C.G(e,c)},d):Ac(this.F,this,e=>{this.C.G(e,c)},e=>{d&&d(e)})}Ym(a,b){this.Ok(c=>{a(Ea(c))},b)}Pk(a,b){const c=olympe.D.Ja().Cb(a);b=b&&olympe.D.Ja().Cb(b);const d=this.db.fb(this,olympe.dm.File.C),
727
+ e=this.db.fb(this,olympe.dm.File.urlProp),f=g=>{const h=this.db.fb(this,olympe.dm.File.mimeTypeProp);this.C.G(g,k=>{c(`data:${h};base64,${this.C.C(k)}`)})};d&&d.valueOf()?Ac(this.F,this,f.bind(this),b):e&&e.startsWith('blob:')?this.C.F(e,f.bind(this),b):a(e)}rename(a,b){const c=b&&olympe.D.Ja().Cb(b);olympe.D.bs([a],d=>{const e=new olympe.dc.Transaction;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.nameProp,d);e.hb(f=>{c&&c(f)})})}iy(){this.G.N(this.db.fb(this,olympe.dm.File.mimeTypeProp))}Ql(){return this.Fb(olympe.dm.File.urlProp)}wp(){return this.Fb(olympe.dm.File.nameProp)}lw(){return this.ij(olympe.dm.File.creationDateProp)}Gw(){return this.ij(olympe.dm.File.modificationDateProp)}Vr(){return this.oh(olympe.dm.File.C)}static Hv(a,
728
+ b,c,d,e,f){d=d||'application/data';c=olympe.W.ci().N(new Blob([c],{type:d}));return olympe.dm.File.Er(a,b,c,d,e,f)}static Er(a,b,c,d,e,f){const g=olympe.D.jb.now();b=(new Map).set(olympe.dm.File.nameProp,b||'file').set(olympe.dm.File.urlProp,c).set(olympe.dm.File.creationDateProp,g).set(olympe.dm.File.modificationDateProp,g).set(olympe.dm.File.mimeTypeProp,d||'application/data').set(olympe.dm.File.C,!1);return a.create(olympe.dm.File,b,e||olympe.dc.Ha.bc,f)}};olympe.dm.File.createFromURL=olympe.dm.File.Er;
729
+ olympe.dm.File.createFromContent=olympe.dm.File.Hv;olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.iy;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Pk;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Ym;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Ok;olympe.dm.File.P=olympe.dc.Ba.C('ff021000000000000030',olympe.dm.File,olympe.dc.O.yi,olympe.net.O.va,olympe.W.O.xh);olympe.dm.File.nameProp=olympe.dm.File.P.Ca('ff023000000000000050');
729
730
  z('olympe.dm.File.nameProp',olympe.dm.File.nameProp);olympe.dm.File.creationDateProp=olympe.dm.File.P.Ca('ff023000000000000051');z('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.P.Ca('ff023000000000000055');z('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.P.Ca('ff023000000000000052');z('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);
730
- olympe.dm.File.urlProp=olympe.dm.File.P.Ca('ff023000000000000053');z('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.P.Ca('ff023000000000000054');olympe.dm.File.la=[olympe.D.File];m=olympe.dm.File.prototype;m.jn.K=olympe.D.J.F;m.Sk.K=new olympe.D.J(()=>{},[]);m.cn.K=new olympe.D.J(()=>{},[]);m.Tk.K=new olympe.D.J(()=>{},[]);m.rename.K=olympe.D.J.C;m.Ul.K=olympe.D.J.F;m.Cp.K=olympe.D.J.F;m.ow.K=new olympe.D.J(()=>olympe.D.jb,[]);
731
- m.Jw.K=new olympe.D.J(()=>olympe.D.jb,[]);m.$r.K=olympe.D.J.V;olympe.dm.Fd=class extends olympe.dc.CloudObject{C(){return this.Fb(olympe.dm.Fd.F)}G(){return this.Ie(olympe.dm.Fd.N)}F(){return this.ub(olympe.dm.Fd.C,olympe.dm.Module)}};olympe.dm.Fd.P=olympe.dc.Ba.C('ff021000000000000041',olympe.dm.Fd);olympe.dm.Fd.F=olympe.dm.Fd.P.Ca('ff023000000000000047');olympe.dm.Fd.N=olympe.dm.Fd.P.Ca('ff023000000000000048');olympe.dm.Fd.C=olympe.dm.Module.C.Pc();olympe.dm.Fd.prototype.C.K=olympe.D.J.F;olympe.dm.Fd.prototype.G.K=olympe.D.J.G;
732
- olympe.dm.Fd.prototype.F.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.Nb=class extends olympe.dm.md{F(){return this.ub(olympe.dm.Pb.F,olympe.dm.Pb)}N(){return this.Fb(olympe.dm.Nb.ra)}aa(){return this.Fb(olympe.dm.Nb.Xc)}G(){return this.ub(olympe.dm.Nb.N,olympe.dm.Nb)}};olympe.dm.Nb.P=olympe.dc.Ba.C('0163d9594700fcf61e54',olympe.dm.Nb);olympe.dm.Nb.ra=olympe.dm.Nb.P.Ca('017869c7d2833c9492c1');olympe.dm.Nb.Xc=olympe.dm.Nb.P.Ca('017869c80bb9929c76d0');olympe.dm.Nb.N=olympe.dm.Nb.P.Pa('ff02200000000000002b');olympe.dm.Nb.Qf=P(olympe.dm.Nb.P,olympe.dm.Nb.N);
733
- olympe.dm.Nb.zc=olympe.dm.Nb.P.Pa('ff02200000000000002a');olympe.dm.Nb.He=olympe.dm.Nb.P.Pa('017e9c412e2b944bd590');olympe.dm.Nb.wh=olympe.dm.Nb.P.Pa('017e9c416872a89d3415');olympe.dm.Nb.Xf=olympe.dm.Nb.P.Pa('017ebf8fe5c506662098');P(olympe.dc.CloudObject.P,olympe.dm.Nb.zc);olympe.dm.Nb.qe=Fc('100000000000000000dd','PRIMORDIAL');olympe.dm.Nb.prototype.F.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.Nb.prototype.N.K=olympe.D.J.F;olympe.dm.Nb.prototype.aa.K=olympe.D.J.F;
734
- olympe.dm.Nb.prototype.G.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{F(){return this.cd(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}C(){return this.cd(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}hd(){return this.F().ma().Hr(this.ma())}};olympe.dm.Property.P=olympe.dc.Ba.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=P(olympe.dm.Property.P,olympe.dc.CloudObject.propertyRel);z('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);
735
- olympe.dm.Property.typeRel=P(olympe.dm.Property.P,olympe.dc.CloudObject.typeRel);z('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.F.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Gw(){return olympe.D.Wa.EMPTY}jw(){return this.Ie(olympe.dm.Relation.Nm)}Qw(){return this.Ie(olympe.dm.Relation.Cn)}Qr(){return this.ub(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Oc()}Vr(){return this.ub(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Oc()}hd(){return this.Vr().ma().concat(['-',this.ma(),'->',this.Qr().ma()])}};olympe.dm.Relation.P=olympe.dc.Ba.C('ff021000000000000006',olympe.dm.Relation);
736
- olympe.dm.Relation.Cn=olympe.dm.Relation.P.Ca('ff023000000000000030');olympe.dm.Relation.Nm=olympe.dm.Relation.P.Ca('ff023000000000000034');olympe.dm.Relation.Xm=olympe.dm.Relation.P.Ca('ff023000000000000037');olympe.dm.Relation.Wm=olympe.dm.Relation.P.Ca('ff023000000000000137');olympe.dm.Relation.hl=olympe.dm.Relation.P.Ca('ff023000000000000237');olympe.dm.Relation.qs=olympe.dm.Relation.P.Ca('ff023000000000000337');olympe.dm.Relation.Av=olympe.dm.Relation.P.Ca('ff023000000000000031');
737
- olympe.dm.Relation.originModelRel=P(olympe.dm.Relation.P,olympe.dc.CloudObject.G);z('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=P(olympe.dm.Relation.P,olympe.dc.CloudObject.V);z('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dc.Rb={NONE:null,cz:olympe.dm.Relation.Xm.R(),Fc:olympe.dm.Relation.Wm.R(),rf:olympe.dm.Relation.hl.R(),DA:olympe.dm.Relation.qs.R()};
738
- olympe.dc.Rb.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Rb))if(c===a)return b;return null};olympe.dm.Relation.C={rp:0,tl:5,Bq:1,Ju:4,Ck:2,rk:8,Io:10,Fu:6,Gu:9,mc:6,Iu:9};olympe.dm.Relation.F={mu:3,fm:4,eu:5,$l:6};olympe.dm.Relation.N=olympe.dm.Rc.hq+olympe.dm.Rc.Bo;m=olympe.dm.Relation.prototype;m.Gw.K=olympe.D.J.F;m.jw.K=olympe.D.J.G;m.Qw.K=olympe.D.J.G;m.Qr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Vr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.qf=class extends olympe.dc.CloudObject{getValue(){}};olympe.dm.qf.P=olympe.dc.Ba.C('ff021000000000000019',olympe.dm.qf);olympe.dm.String=class extends olympe.dm.qf{getValue(){return this.Fb(olympe.dm.String.valueProp)}toString(){return this.get(olympe.dm.String.valueProp)}};olympe.dm.String.P=olympe.dc.Ba.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.P.Ca('ff023000000000000026');z('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.D.J.F;olympe.dm.String.prototype.toString.K=olympe.D.J.C;olympe.dm.Boolean=class extends olympe.dm.qf{getValue(){return this.qh(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.P=olympe.dc.Ba.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.P.Ca('ff023000000000000027');z('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.D.J.V;olympe.dm.Color=class extends olympe.dm.qf{getValue(){return this.Wr()}};olympe.dm.Color.P=olympe.dc.Ba.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.P.Ca('ff023000000000000032');z('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.D.J(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.qf{getValue(){return this.kj(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.P=olympe.dc.Ba.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.P.Ca('ff023000000000000029');z('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.D.J(()=>olympe.D.jb,[]);olympe.dm.Enum=class extends olympe.dm.String{ma(){return olympe.D.Fa([super.ma(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Wa)}fe(){return this.Ie(olympe.dm.Enum.rankProp)}static create(a,b,c,d,e){const f=olympe.dc.Na();e=void 0!==e?e:f.Gb(b)&&f.ee(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;
739
- olympe.dm.Enum.P=olympe.dc.Ba.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.P.Ca('017a7690c915975ea995');olympe.dm.Enum.prototype.fe.K=olympe.D.J.G;olympe.dm.ig=class extends olympe.dm.BrickMetadata{hx(){return this.sb(olympe.dc.CloudObject.instancesRel).ll(olympe.dm.Enum.rankProp,olympe.dc.da.km.ASC).bd()}static create(a,b){b=a.create(olympe.dm.ig,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Ra(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.ig.create=olympe.dm.ig.create;olympe.dm.ig.prototype.getValues=olympe.dm.ig.prototype.hx;olympe.dm.ig.P=olympe.dc.Ba.C('017a768f966fc08ebb98',olympe.dm.ig);olympe.dm.Number=class extends olympe.dm.qf{getValue(){return this.Ie(olympe.dm.Number.valueProp)}};olympe.dm.Number.P=olympe.dc.Ba.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.P.Ca('ff023000000000000028');z('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.D.J.G;olympe.Za={};olympe.Za.bh=class{constructor(a){this.L=a;this.Z=new olympe.D.Wb(`${this.Y()} source context`);this.V=this.C=null}Y(){}N(){}close(){this.V&&this.V(this.Y(),olympe.dc.xk.yt);this.Z.destroy()}};function ch(a){olympe.D.wc([lc(a.ra)],b=>{if(b.valueOf()){const c=a.G.keys();dh(a,d=>{if(d)a.L.error('An error occurred while auto synchronising:\n'+d.message);else if(a.L.debug('Auto synchronise transactions successfully'),a.aa)for(const e of c)ac(a.F,f=>{a.L.error(`Could not clear transactions for ${e}: ${f}.`)})})}})}
740
- function eh(a){let b;olympe.D.wc([lc(a.ra)],c=>{c.valueOf()?(a.aa=!1,b&&(Kb(b),b=null)):(a.aa=!0,b=Jb(()=>{if(a.ka){a.ka=!1;for(const d of a.G.keys())Zb(a.F,d,a.G.get(d),()=>{},e=>{a.L.error(`Could persist transaction for ${d}: ${e}`)})}},5E3))})}
741
- function dh(a,b){const c=olympe.async.wk.create(),d=c.G;c.add((e,f)=>{a.F.storage.N(f)});c.add((e,f,g)=>{const h=olympe.dc.Ja.rb,k=g.get('files'),l=new olympe.async.qg(d);a.G.forEach((n,p)=>{if(p!==h){const q=a.Da.V(p);null!==q?(l.add(a.Sa.bind(a,n,q,k)),a.F.storage.C(void 0)):f(`The source: ${p} is not reachable.`)}});Wb(l,(n,p)=>{n?e():f(p||void 0)});l.start()});Wb(c,(e,f)=>{b(e?null:Error(f));e&&(a.ka=!1,a.G.clear())});c.start()}
742
- function fh(a,b){const c=new olympe.async.wk(olympe.D.Ia());c.add((d,e)=>{$b(a.F,f=>null===f?d():e(f))});c.add(d=>{const e=olympe.dc.Ad();a.G.forEach((f,g)=>{const h=Array.from(f.ee()).map(k=>k.tag());Kc(e,olympe.D.Ia(),f,h,[],g)(!0)});d()});Wb(c,(d,e)=>{b(e?Error(e):null)});c.start()}
743
- olympe.Za.Ii=class extends olympe.Za.bh{constructor(a,b,c,d,e){super(a);this.G=new Map;this.ra=c;this.F=d;this.Da=b;this.ka=this.aa=!1;e.get('syncTimeout');e.get('autoSync')&&ch(this);e.get('autoPersist')&&eh(this)}Sa(a,b,c,d,e){const f=olympe.dc.ga.ja.Bk,g=olympe.dc.ga.ja.Cl,h=new olympe.dc.db.xc,k=new olympe.async.qg(olympe.D.Ia()),l=(n,p,q)=>{const r=n.tag(),t=n.fb(olympe.dm.File.mimeTypeProp.R());cc(this.F,u=>{tc(olympe.dc.zw(),r,u,t,v=>{n.Ca(olympe.dm.File.urlProp.R(),v);const w=new Map;w.set(olympe.dm.File.urlProp.R(),
744
- v);h.pc(r,w);this.F.storage.C(q)})})};for(const n of c)(c=a.Jf(n))&&c.se()&&k.add(l.bind(this,c));Wb(k,(n,p)=>{n?(n=M(new olympe.dc.ga(f,a,[b.Y()]),q=>{q?e(q.message):(this.C(b.Y(),g,h),q=Array.from(a.ee()).map(r=>r.tag()),olympe.dc.Ad().persist(q),d())}),b.N(n)):e(`Transaction synchronisation failed! ${p?p:''}`)});k.start()}Y(){return olympe.dc.Ja.rb}N(a){var b=olympe.dc.ga.ja.eh,c=olympe.dc.ga.ja.Ah;const d=olympe.dc.ga.ja.Bi,e=olympe.dc.ga.ja.Ai,f=olympe.dc.ga.ja.Sg,g=olympe.dc.ga.ja.Ll,h=olympe.dc.ga.ja.Th,
745
- k=olympe.dc.ga.ja.xi,l=olympe.dc.ga.ja.Bh;var n=olympe.dc.ga.ja.Tj;const p=a.type;switch(p){case f:a.validate(null);this.F.storage.F(void 0);fh(this,v=>{null!==v&&this.L.error(`Could not load transactions: ${v.message}`)});break;case b:case c:const q=a.content;a.C.forEach(v=>{let w=this.G.get(v);void 0===w&&(w=new olympe.dc.db.xc,this.G.set(v,w));q.Mc(w);this.aa&&(this.ka=!0)});a.validate(null);a=olympe.dc.transaction.ug.C.Xp;this.C(olympe.dc.Ja.rb,n,{id:q.Y(),finalize:a});break;case e:case d:const r=
746
- a.C[0],t=a.content;a.validate(null);Yb(this.F,t.Y(),v=>{this.L.warn('No graphresult for subscription : '+t.Y(),v,'\n',t.sh.toJSON());this.L.warn();this.C(r,g,new olympe.dc.query.Di(t.Y(),r,olympe.dc.Ja.rb,new olympe.dc.db.xc))});break;case h:case l:case k:n=a.content;b=n.file;const u=n.$e;c=n.te;p===h?bc(this.F,b,n.content,n.mimeType,u,c):p===l?cc(this.F,v=>{u(v)}):this.F.storage.C(c);a.validate(null)}}};olympe.Za.Ii.C='context';const gh=olympe.dc.ga.ja.rm,hh=olympe.dc.ga.ja.tm,ih=olympe.dc.ga.ja.QUERY_RESULT,jh=olympe.dc.ga.ja.sm,kh=olympe.dc.ga.ja.eh,lh=olympe.dc.ga.ja.Bk,mh=olympe.dc.ga.ja.Tj,nh=olympe.dc.ga.ja.Ah,oh=olympe.dc.ga.ja.Jj,ph=olympe.dc.ga.ja.ul,qh=olympe.dc.ga.ja.Th,rh=olympe.dc.ga.ja.Bh,sh=olympe.dc.ga.ja.xi,th=olympe.dc.ga.ja.og;
747
- function uh(a,b,c,d,e){const f=c.Y();c={t:gh,q:c.ia()};olympe.H.wa.nb.zb.get(b,c).then(g=>{g.t===ih?(d(null),a.C(b,e||ih,{i:f,r:g.r,s:b})):d(Error(g.e))}).catch(g=>d(Error(g)))}function vh(a,b,c,d,e){const f=c.Y();uh(a,b,c,g=>{if(g)e(g);else{wh(a,b,f);g={t:hh,q:c.ia()};var h=olympe.H.wa.nb.zb.observe(b,d,g).subscribe(k=>{const l=k.t;l===jh?(e(null),a.C(b,l,{i:f,r:k.r,s:b})):e(Error(k.e))});d.vc(()=>h.unsubscribe())}},jh)}
748
- function xh(a,b,c,d){const e=c.Bc;c=new olympe.dc.transaction.wd;e.Mc(c);c={t:kh,i:e.Y(),p:$d(c)};olympe.H.wa.nb.zb.send(b,c).then(()=>{d(null);a.C(b,mh,{id:e.Y(),finalize:olympe.dc.transaction.ug.C.Wp})}).catch(f=>d(Error(f)))}function yh(a,b,c,d,e){var f=c.Bc;c=f.Y();const g=new olympe.dc.transaction.wd;f.Mc(g);f={t:nh,i:c,p:$d(g)};olympe.H.wa.nb.zb.publish(b,f).then(()=>e(null)).catch(h=>e(Error(h)));zh(a,c,b,d)}
749
- function wh(a,b,c){const d=()=>{const f=setInterval(()=>{0===a.F.size?clearInterval(f):a.F.forEach((g,h)=>{olympe.H.wa.nb.zb.send(h,{t:th,s:Array.from(g)}).catch(k=>a.L.warn(`Error occurred while keeping alive subscription list: ${k}`))})},a.aa)},e=a.F.get(b)||new Set;e.add(c);a.F.set(b,e);1===a.F.size&&d()}
750
- function zh(a,b,c,d){const e=new olympe.H.wa.nb.zb(b,d);e.listen().subscribe(f=>{f=f.body();if(f.t===oh){a.L.error(`Burst Transaction ${b} failed. Local rollback is not supported yet. Refresh the application`);const g=new olympe.dc.db.xc;a.C(c,oh,{id:b,rollback:g,error:f.r})}});d.vc(()=>e.stop())}
751
- olympe.Za.xu=class extends olympe.Za.bh{constructor(a,b,c){super(a);this.F=new Map;this.G=b;this.aa=c}Y(){return olympe.dc.Ja.lq}N(a){const b=a.C[0],c=a.type,d=a.validate.bind(a),e=a.content;a=a.F;switch(c){case gh:uh(this,b,e,d);break;case hh:vh(this,b,e,a,d);break;case kh:case lh:xh(this,b,e,d);break;case nh:yh(this,b,e,a,d);break;case ph:e.t=c;olympe.H.wa.nb.zb.publish(b,e).then(d).catch(f=>d(Error(f)));break;case qh:case rh:case sh:olympe.H.wa.nb.zb.get(b,{t:c,f:e.file}).then(f=>{this.G.ka(e.file,
752
- b,f);c===qh?this.G.Z(e.file,e.content,e.mimeType,e.$e,e.te):c===rh?this.G.V(e.file,e.url,e.mimeType,e.$e,e.te):this.G.N(e.file,e.$e,e.te)}).catch(e.te);break;default:this.L.info(`Messages of type ${c} is not supported by the source ${this.Y()}`)}}};olympe.Za.Buffer=class{constructor(){this.counter=0;this.Jb=new Map}buffer(a){const b=this.counter++;this.Jb.set(b,a);return this.clear.bind(this,b)}clear(a){this.Jb.delete(a)}};olympe.Za.sg=class a{constructor(b,c,d){this.L=b;this.Z=c;this.ka=new olympe.Za.Buffer(this);this.N=new Map;this.G=this.Xb(d);new olympe.D.Wb('Data Router context');this.F=new Map;this.aa=new Map;this.ab()}ab(){this.L.info('Initializing DR layer');olympe.D.nn(lc(this.Z),()=>{this.L.info('Router: ONLINE')},()=>{this.L.log('Router: OFFLINE (no auth layer not online)');for(const b of this.ka.Jb.values())this.Da(b)});this.L.log('DONE initializing DR layer (waiting for AUTH layer session to be established)')}send(b){M(b,
753
- this.ka.buffer(b));this.Da(b)}C(b,c){const d=olympe.W.lc();let e=this.F.get(b);void 0===e&&(e=new Map,this.F.set(b,e));e.set(d,c)}ra(b){this.aa.set(olympe.W.Ag(),b)}Ab(b,c,d){this.F.has(c)&&this.F.get(c).forEach(e=>{e(b,d)})}cc(b,c){this.N.set(b,c);c.C=this.Ab.bind(this);c.V=this.Sa.bind(this)}V(b){return this.N.get(b)||this.N.get(olympe.dc.Ja.lq)}Sa(b,c){this.aa.forEach(d=>{d(b,c)})}Da(b){this.L.debug('Processing message',b.toString());this.bb(b).forEach(c=>{(c=this.V(c))&&c.N(b)})}bb(b){var c=olympe.dc.ga.ja.Sg,
754
- d=olympe.dc.ga.ja.Ai,e=olympe.dc.ga.ja.Bi,f=olympe.dc.ga.ja.eh,g=olympe.dc.ga.ja.Ah;const h=olympe.dc.ga.ja.Th,k=olympe.dc.ga.ja.xi,l=olympe.dc.ga.ja.Bh;switch(b.type){case c:d=this.G.get(a.C.Sg)||[];break;case d:case e:d=this.G.get(a.C.qm)||[];break;case f:case g:d=this.G.get(a.C.TRANSACTION)||[];break;case h:case l:case k:d=this.G.get(a.C.gt)||[];break;default:d=[]}c=b.content;e=olympe.auth.sa.C.Ng;f=olympe.auth.sa.C.Eh;g=kc(this.Z);e=!(g===e||g===f);for(var n of d)if(d=n,f=c&&c.Y&&c.Y(),g=d.get('type'),
755
- g===a.F.em&&e||g===a.F.op&&d.get('id')===f||g===a.F.mc)return n=n.get('destinations'),this.L.debug('Message',b.toString(),'is redirect to',n),n;this.L.debug('Message',b.toString(),'not redirect');return b.C}Xb(b){const c=Object.values(olympe.Za.sg.C),d=Object.values(olympe.Za.sg.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 l=k.type;if(d.includes(l)){var n=k.destinations;n instanceof Array?(n=(new Map).set('type',
756
- l).set('destinations',n),h.push(n),l===a.F.op&&n.set('id',k.id)):this.L.error('Routing rule',f,l,'is not valid. Destinations must be stored in an array')}else this.L.error('Routing rule',f,l,'is not valid. Valid rules are',d.toString())})}else this.L.error('Routing rule',f,'is not valid. Rules must be ordered in an array');else this.L.error('Routing rule',f,'is not valid. Valid messages are',c.toString())});return e}};olympe.Za.sg.C={Sg:'getContext',qm:'query',TRANSACTION:'transaction',gt:'file'};
757
- olympe.Za.sg.F={mc:'default',em:'offline',op:'id'};olympe.Za.sg.la=[olympe.dc.sg];olympe.Za.Uj=class{ka(){}Z(){}V(){}N(){}};olympe.Za.O={va:'dr.Manager',Ea:'dr.Logger',me:'dr.sources.Router',Ip:'dr.sources.Local',xm:'dr.sources.Server',nq:'dr.sources.Peer',Rg:'dr.sources.FileSource'};olympe.Za.Config={Zl:'dr.keepAliveTimeout',Sn:'dr.autoSync',Rn:'dr.autoPersist',Vq:'dr.syncTimeout',Hq:'dr.routing'};
758
- olympe.T.config(function(a){E(a,olympe.Za.Config.Hq,{});E(a,olympe.Za.Config.Zl,3E5);E(a,olympe.Za.Config.Sn,!1);E(a,olympe.Za.Config.Rn,!1);E(a,olympe.Za.Config.Vq,3E4);C(a,olympe.Za.O.Ea,[olympe.pa.O.va],b=>b.Nc('dr'));C(a,olympe.Za.O.Ip,[olympe.Za.O.Ea,olympe.Za.O.me,olympe.auth.O.va,olympe.hc.O.vo,new olympe.T.fa(olympe.Za.Config.Sn),new olympe.T.fa(olympe.Za.Config.Rn),new olympe.T.fa(olympe.Za.Config.Vq)],(b,c,d,e,f,g,h)=>{f=(new Map).set('autoSync',f).set('autoPersist',g).set('syncTimeout',
759
- h);return new olympe.Za.Ii(b,c,d,e,f)});ta(a,olympe.Za.O.xm);B(a,olympe.Za.O.nq,olympe.Za.xu,olympe.Za.O.Ea,olympe.Za.O.Rg,new olympe.T.fa(olympe.Za.Config.Zl));ta(a,olympe.Za.O.Rg);B(a,olympe.Za.O.me,olympe.Za.sg,olympe.Za.O.Ea,olympe.auth.O.va,new olympe.T.fa(olympe.Za.Config.Hq));sa(a,olympe.dc.O.me,olympe.Za.O.me);C(a,olympe.dc.query.Mb.ek,[olympe.dc.query.Mb.ek],b=>new olympe.dc.pm(b))},'olympe.dr');
760
- olympe.T.run([olympe.Za.O.me,olympe.Za.O.Ip,olympe.Za.O.xm,olympe.Za.O.nq],(a,...b)=>{b.forEach(c=>a.cc(c.Y(),c))});olympe.H={};olympe.H.Uc={vi:1,eg:2,qc:3,pf:4,Ty:5,Ei:6,qA:7};olympe.H.ja={Ei:1,fv:2,ft:3,og:5};olympe.H.sa=class{bb(){}connect(){}disconnect(){}Qf(){}Wf(){}Z(){}zc(){}Xb(){}Da(){}qe(){}};olympe.H.sa.C={INIT:'initialize',CONNECTING:'connecting',hg:'disconnected',ui:'connected',Yg:'reconnecting',qc:'error'};olympe.H.sa.G={Lh:1,mt:-1,zt:-2,Yu:-3};function Ah(a,b){const c=a.G.get(b)||a.Sa;a.G.delete(b);return`${c}/${b}`}
761
- olympe.H.Uj=class{constructor(a,b,c,d,e){this.L=a;this.F=b;this.ra=c;this.Sa=d;this.ab=e;this.C=new Map;this.G=new Map;this.aa=new Map;this.Da=new olympe.D.Wb('File manager context')}ka(a,b,c){b&&this.G.set(a,`${this.ab}/${b}`);c&&this.aa.set(a,c)}Z(a,b,c,d,e){const f=Ob(Ah(this,a),olympe.net.eb.ae.mk,b,olympe.net.eb.ResponseType.sl);Pb(f,{[olympe.net.eb.Headers.si]:this.ed(a),[olympe.net.eb.Headers.Lj]:c||'application/octet-stream'});this.F.C(f,g=>{g=g.Rd();g===olympe.net.eb.od.Lh||g===olympe.net.eb.od.zl?
762
- (g=new URL(f.C()),d(g.pathname)):e&&(g=`Failed to create file ${a}. Response code ${g}`,this.L.error(g),e(g))})}V(a,b,c,d,e){const f=olympe.D.Ia();d={$e:f.Cb(d),te:e&&f.Cb(e)};if(this.C.has(a))this.C.get(a).push(d);else{this.C.set(a,[d]);if(null===b){var g=Ob(Ah(this,a));Pb(g,{[olympe.net.eb.Headers.si]:this.ed(a)})}else g=Ob(b);g.F=olympe.net.eb.ResponseType.sl;Pb(g,{[olympe.net.eb.Headers.Lj]:c||'application/octet-stream'});this.Da.run(()=>{this.F.C(g,h=>{const k=h.Rd(),l=this.C.get(a);if(200<=
763
- k&&300>k){const n=h.getData();l&&l.forEach(p=>{if(f.yb()){const q=f.Uk(),r=f.Y();this.L.warn(`Context ${q} ${r} is being destroyed while file tag ${a} is being downloaded`)}p.$e(n)})}else{const n=`Failed to download file ${a}. Response code ${k}`;l&&l.forEach(p=>{p.te&&p.te(n)})}this.C.delete(a)})})}}N(a,b,c){const d=Ob(Ah(this,a),olympe.net.eb.ae.Fc);Pb(d,{[olympe.net.eb.Headers.si]:this.ed(a)});this.F.C(d,e=>{e=e.Rd();200<=e&&300>e?b():(e=`Failed to delete file ${a}. Response code ${e}`,this.L.error(e),
764
- c&&c(e))})}ed(a){const b=this.aa.get(a);b&&this.aa.delete(a);return b||olympe.D.Ya(nc(this.ra))}};olympe.H.Uj.la=[olympe.Za.Uj];const Bh=olympe.dc.ga.ja.Sg,Ch=olympe.dc.ga.ja.eh,Dh=olympe.dc.ga.ja.Bk,Eh=olympe.dc.ga.ja.Ah,Fh=olympe.dc.ga.ja.Ai,Gh=olympe.dc.ga.ja.Bi,Hh=olympe.dc.ga.ja.$o,Ih=olympe.dc.ga.ja.ap,Jh=olympe.dc.ga.ja.Ll,Kh=olympe.dc.ga.ja.xi,Lh=olympe.dc.ga.ja.Bh,Mh=olympe.dc.ga.ja.Th,Nh=olympe.dc.ga.ja.Tj,Oh=olympe.dc.ga.ja.ev,Ph=olympe.dc.ga.ja.Eu,Qh=olympe.dc.ga.ja.nt,Rh=olympe.dc.ga.ja.ul,Sh=olympe.dc.ga.ja.Js;
765
- function Th(a){a.G.Da(olympe.H.Uc.vi,a.ab.bind(a));olympe.D.wc([lc(a.ra)],b=>{b=b.valueOf()?olympe.dc.xk.cq:olympe.dc.xk.em;a.V&&a.V(a.Y(),b)},'Server source is online')}function Uh(a,b,c){const d=b.Bc;b=new olympe.dc.transaction.wd(!0);d.Mc(b);Vh(a,a.Ab,Ch,!0,$d(b),e=>{c&&c(e);a.C(a.Y(),Nh,{id:d.Y(),finalize:olympe.dc.transaction.ug.C.Wp})})}
766
- function Wh(a,b,c,d){const e=c.Y();a.L.log('Graphdef (ID ',e,') sent: ',c);const f=c instanceof olympe.dc.query.Sl?a.bb:a.Da,g=(new olympe.H.$.Wj).ia(c);c=new olympe.async.qg(a.Z);b===Gh&&c.add((k,l)=>{a.F.set(e,{notification:null,Vx:a.Z.Cb(n=>n?l(n):k())});Xh(a,b,g,n=>n&&l(n.message))});const h=olympe.D.Ia();c.add((k,l)=>{h.run(()=>{Vh(a,f,Fh,!1,g,a.Z.Cb(n=>n?l(n.message):k()))})});Wb(c,(k,l)=>{const n=a.F.get(e);k&&n&&n.notification?a.C(a.Y(),Ih,n.notification):!k&&n&&Yh(a,Hh,e,p=>p&&a.L.warn(p));
767
- a.F.delete(e);d(l?Error(l):null)});c.start()}function Yh(a,b,c,d){a.L.log('Unsubscribe to: ',c);Xh(a,b,{i:c},d)}function Xh(a,b,c,d){b={c:b};Object.assign(b,c);a.G.Z(olympe.H.Uc.vi,b,d&&(e=>{d(e)}))}function Vh(a,b,c,d,e,f){if(a.G.bb()){const g=olympe.H.Uc.vi;!d&&e&&Object.assign(e,{c});c=olympe.D.Ya(nc(a.ra)).valueOf();a.G.zc(b,g,c,d,e,f)}else a.L.error('Server is disconnected, data request of type',c,'on url',b,'is canceled.'),f(Error('Server is disconnected'))}
768
- olympe.H.bh=class extends olympe.Za.bh{constructor(a,b,c,d,e){super(a);this.G=b;this.ra=c;new olympe.H.$.gb;this.aa=new olympe.dc.W.Li(this.Y());this.ka=d;if(4!==e.length)throw Error('Some HTTP end points to the orchestrator are not specified ! Please check DI of olympe.communication module; wants 4 urls but got: '+e.length);this.Sa=e[0];this.bb=e[1];this.Da=e[2];this.Ab=e[3];this.F=new Map;Th(this)}Y(){return olympe.dc.Ja.Vc}N(a){var b=a.type;const c=a.validate.bind(a);a=a.content;switch(b){case Bh:Vh(this,
769
- this.Sa,olympe.dc.ga.ja.Sg,!1,null,c);break;case Eh:b=new olympe.dc.transaction.wd;var d=a.Bc;a=a.uh;d.Mc(b);Xh(this,Eh,{i:d.Y(),r:a,p:$d(b)});c(null);break;case Rh:b=new olympe.dc.transaction.wd;a=a.Bc;a.Mc(b);Xh(this,Rh,{i:a.Y(),p:$d(b)},c);break;case Ch:b=new olympe.dc.transaction.wd;d=a.Bc;a=a.uh;d.Mc(b);Xh(this,olympe.dc.ga.ja.eh,{i:d.Y(),r:a,p:$d(b)},c);break;case Dh:Uh(this,a,c);break;case Fh:case Gh:Wh(this,b,a,c);break;case Hh:Yh(this,b,a,c);break;case Oh:Xh(this,Oh,{},c);break;case Ph:Xh(this,
770
- Ph,{},c);break;case Qh:Xh(this,Qh,{},c);break;case Sh:Xh(this,Sh,{},c);break;case Lh:this.ka.V(a.file,a.url,a.mimeType,a.$e,a.te);break;case Kh:this.ka.N(a.file,a.$e,a.te);break;case Mh:this.ka.Z(a.file,a.content,a.mimeType,a.$e,a.te);break;default:this.L.info(`Message of type ${b} not supported yet`)}}ab(a){var b=olympe.dc.ga.ja.Cl,c=olympe.dc.ga.ja.Jj;const d=olympe.dc.ga.ja.ik,e=olympe.dc.ga.ja.Qu,f=olympe.dc.ga.ja.Fp;var g=olympe.dc.ga.ja.ot;const h=a.c;h===b?(a=this.aa.C(a.p),this.C(this.Y(),
771
- b,a)):h===c?(g=a.error.reason,b=this.aa.C(a.p),this.C(this.Y(),c,{id:a.i,rollback:b,error:g})):h===Jh?(g=olympe.dc.Ja.rb,c=olympe.dc.Ja.Vc,b=a.i,0<a.s?g=new olympe.dc.query.aj.Yj(b,c,g,a.info.error.reason):(g=this.aa.V(b,g,a.p),this.L.debug('< Graphdef Result (ID ',g.Y(),'):',a.p),this.L.log('< Graphdef Result (ID ',g.Y(),') with',g.Bc.G(),'operations')),this.C(this.Y(),Jh,g)):h===Ih?(g=a.i,a=this.aa.N(g,a.p),this.F.has(g)?(g=this.F.get(g),g.notification?gf(a,g.notification):g.notification=a):this.C(this.Y(),
772
- Ih,a)):h===f?(g=new olympe.dc.query.Mp(a.i),a.l.forEach(g.F.bind(g)),this.C(this.Y(),f,g)):h===d?(g=olympe.dc.transaction.ug.C.ik,c=0<a.s?a.info.error.reason:null,this.C(this.Y(),Nh,{id:a.i,finalize:g,error:c})):h===e?(g=this.F.get(a.i))&&g.Vx(0<a.s?a.info.error.reason:null):h===g&&(c=a.ids,b=a.undo_stack_size,a=a.redo_stack_size,this.C(this.Y(),g,{NC:c,dD:b,ZC:a}))}};olympe.H.bh.F={Wz:1,XA:2};olympe.H.bh.C={100:'Insufficient Rights',200:'Constraints',300:'IOException',400:'Unexpected',500:'Non Existing Subscription'};olympe.H.$j=class{constructor(){}};olympe.H.$j.la=[olympe.dc.ba.$j];olympe.H.wa={};function Zh(a,b,c){Tb(a.C,b,d=>{d=new olympe.H.wa.Jb.Request(d.dest,d.src,d.auth,d.seq,d.type,d.content);return c(d)})}function $h(a,b,c){a.N.set(b,c)}function ai(a,b){return new Promise((c,d)=>{Ub(a.C,b,e=>e?d(e):c())})}function bi(a,b){return new Promise((c,d)=>{a.V.rh(b.ed(),(e,f)=>e?d(e):c(f))})}
773
- olympe.H.wa.sa=class{constructor(a,b,c,d){this.L=a;this.V=c;a=new olympe.W.er(d.get('messageTimeout'));a.C=this.Z.bind(this);this.N=a;a=d.get('url');d=d.get('connectionOptions');this.C=new olympe.net.hk(a,d);this.G=1;this.F=olympe.W.lc()}connect(){return new Promise(a=>{Sb(this.C)?a():this.C.connect(()=>{Tb(this.C,this.F,b=>{b=new olympe.H.wa.Jb.Response(b.dest,b.src,b.seq,b.type,b.content);const c=this.N.get(b.G);c&&(this.N.delete(b.G),c(b))});a()})})}disconnect(){return new Promise(a=>this.C.end(!1,
774
- ()=>a()))}Le(a,b,c){return new Promise((d,e)=>{const f=a.source,g=new olympe.H.wa.Jb.Response(f,this.F,a.G,b,c);this.C.publish(f,g.ia(),void 0,h=>h?e(h):d())})}request(a,b,c){return new Promise((d,e)=>{const f=this.G;this.G++;var g=olympe.D.Ya(nc(this.V));g=new olympe.H.wa.Jb.Request(a,this.F,g,f,b,c);this.C.publish(a,g.ia(),void 0,h=>h?e(h):d(f))})}notify(a,b,c){return new Promise((d,e)=>{var f=this.G;this.G++;f=new olympe.H.wa.Jb.Response(b,a,f,olympe.H.wa.Jb.Response.ja.Am,c);this.C.publish(b,
775
- f.ia(),void 0,g=>g?e(g):d())})}Z(a,b){b(new olympe.H.wa.Jb.Response(this.F,this.F,a,olympe.H.wa.Jb.Response.ja.qc,{reason:'Timeout'}))}};olympe.H.wa.Jb={};olympe.H.wa.Jb.Request=class{constructor(a,b,c,d,e,f){this.G=d;this.destination=a;this.source=b;this.N=c;this.C=e;this.F=f||null}ed(){return this.N}ia(){return{dest:this.destination,src:this.source,seq:this.G,auth:this.N,type:this.C,content:this.F}}toString(){return JSON.stringify(this)}};olympe.H.wa.Jb.Request.ja={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3};olympe.H.wa.Jb.Response=class{constructor(a,b,c,d,e){this.G=c;this.destination=a;this.source=b;this.F=d;this.C=e||null}ia(){return{dest:this.destination,src:this.source,seq:this.G,type:this.F,content:this.C}}toString(){return JSON.stringify(this)}};olympe.H.wa.Jb.Response.ja={Am:0,Mn:1,br:2,qc:3};olympe.H.wa.nb={};const ci=olympe.H.wa.Jb.Response.ja.Mn,di=olympe.H.wa.Jb.Response.ja.qc,ei=olympe.H.wa.Jb.Response.ja.Am,fi=olympe.H.wa.Jb.Response.ja.br,gi=olympe.H.wa.Jb.Request.ja.SEND,hi=olympe.H.wa.Jb.Request.ja.GET,ii=olympe.H.wa.Jb.Request.ja.PUBLISH,ji=olympe.H.wa.Jb.Request.ja.SUBSCRIBE;
776
- olympe.H.wa.nb.zb=class{constructor(a,b){this.C=olympe.H.wa.Qc();this.F=a;this.G=new olympe.D.Wb(`Service ${a}`,'function'===typeof b.Ec?b.Ec():b);this.L=olympe.pa.Xa(`Service ${this.F}`)}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();ai(this.C,this.F).catch(c=>this.L.error('Failed to unsubscribe from '+this.F+', error: '+c))};this.G.onDestroy(b);this.C.connect().then(()=>{Zh(this.C,this.F,c=>a.next(new olympe.H.wa.nb.ga(c,this.C)))}).catch(c=>this.L.error('Failed to connect to the bus: '+
777
- c));return b})}stop(){this.G.destroy()}static publish(a,b){const c=olympe.H.wa.Qc();return c.connect().then(()=>c.request(a,ii,b)).then(()=>Promise.resolve())}static send(a,b){return new Promise((c,d)=>{const e=olympe.H.wa.Qc();e.connect().then(()=>e.request(a,gi,b)).then(f=>{$h(e,f,g=>{switch(g.F){case ci:c();break;case di:d(g.C.reason);break;default:d('Unsupported response type for a SEND request')}})}).catch(f=>d(f))})}static get(a,b){return new Promise((c,d)=>{const e=olympe.H.wa.Qc();e.connect().then(()=>
778
- e.request(a,hi,b)).then(f=>{$h(e,f,g=>{switch(g.F){case ei:(g=g.C)?c(g):d('No payload after request to service: '+a);break;case di:d(g.C.reason);break;default:d('Unsupported response type for a GET request')}})}).catch(f=>d(f))})}static observe(a,b,c){const d='function'===typeof b.Ec?b.Ec():b;return new rxjs.Observable(e=>{const f=olympe.H.wa.Qc();let g=null;const h=()=>{e.complete();g&&ai(f,g).catch(k=>olympe.pa.Xa('Service '+a).error('Failed to unsubscribe from a topic '+k))};d.vc(h);f.connect().then(()=>
779
- f.request(a,ji,c)).then(k=>{$h(f,k,l=>{switch(l.F){case fi:g=l.C.topic;Zh(f,g,n=>{n.C===ii?e.next(n.F):(e.error('Unsupported notification message. It should be a publish'),h())});break;case di:e.error(l.C.reason);break;default:e.error('Unsupported response type for a SUBSCRIBE request')}})}).catch(k=>e.error(k));return h})}};olympe.H.wa.nb.zb.observe=olympe.H.wa.nb.zb.observe;olympe.H.wa.nb.zb.get=olympe.H.wa.nb.zb.get;olympe.H.wa.nb.zb.send=olympe.H.wa.nb.zb.send;olympe.H.wa.nb.zb.publish=olympe.H.wa.nb.zb.publish;
780
- olympe.H.wa.nb.zb.prototype.stop=olympe.H.wa.nb.zb.prototype.stop;olympe.H.wa.nb.zb.prototype.listen=olympe.H.wa.nb.zb.prototype.listen;const ki=olympe.H.wa.Jb.Response.ja.Mn,li=olympe.H.wa.Jb.Response.ja.qc,mi=olympe.H.wa.Jb.Response.ja.Am,ni=olympe.H.wa.Jb.Response.ja.br,oi=olympe.H.wa.Jb.Request.ja.SEND,pi=olympe.H.wa.Jb.Request.ja.GET,qi=olympe.H.wa.Jb.Request.ja.SUBSCRIBE;
781
- olympe.H.wa.nb.ga=class{constructor(a,b){this.request=a;this.C=b}Cj(){return bi(this.C,this.request)}source(){return this.request.source}body(){return this.request.F}Lk(){return this.request.C===oi?this.C.Le(this.request,ki,void 0):Promise.reject('Should only call `ack` on SEND requests')}Le(a){return this.request.C===pi?this.C.Le(this.request,mi,a):Promise.reject('Should only call `reply` on GET requests')}es(a){return this.request.C===qi?this.C.Le(this.request,ni,{topic:a}):Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests')}zg(a){return this.C.Le(this.request,
782
- li,{reason:a.message})}};olympe.H.wa.nb.ga.prototype.fail=olympe.H.wa.nb.ga.prototype.zg;olympe.H.wa.nb.ga.prototype.notifyOn=olympe.H.wa.nb.ga.prototype.es;olympe.H.wa.nb.ga.prototype.reply=olympe.H.wa.nb.ga.prototype.Le;olympe.H.wa.nb.ga.prototype.ack=olympe.H.wa.nb.ga.prototype.Lk;olympe.H.wa.nb.ga.prototype.body=olympe.H.wa.nb.ga.prototype.body;olympe.H.wa.nb.ga.prototype.source=olympe.H.wa.nb.ga.prototype.source;olympe.H.wa.nb.ga.prototype.userTag=olympe.H.wa.nb.ga.prototype.Cj;olympe.H.oa={};function ri(a,b,c,d){c.c=b;a.C.Z(olympe.H.Uc.pf,c,d)}
783
- olympe.H.oa.Ta=class{constructor(a,b,c,d,e,f,g,h,k){this.L=a;this.C=b;this.F=h;this.ab=c;this.G=g;this.storage=k;const l=this.storage.C('AUTH');l&&(l.get('redirectTo',n=>{n&&(l.remove('redirectTo'),l.close(),this.F.redirect(n,null,olympe.auth.tk.C.GET))}),l.close())}V(a){this.C.Qf(a)}N(a){this.C.Wf(a)}Sa(a){this.C.qe(olympe.H.Uc.pf,'logoutHandler');this.C.Da(olympe.H.Uc.pf,b=>{const c=b.c;c===olympe.H.oa.Ta.C.Zt?(this.C.Xb(),a(olympe.auth.sa.F.Dj,b)):c===olympe.H.oa.Ta.C.Ku&&a(olympe.auth.sa.F.pp,
784
- b)},'logoutHandler')}Z(a,b){ri(this,olympe.H.oa.Ta.C.pf,{token:a.Kf()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.oa.Ta.C.qc:b(Error('Invalid token'));break;case olympe.H.oa.Ta.C.Si:c=null;var e=d.payload;if(e){d=e.userName;const f=e.userTag,g=e.rndCook,h=e.payload,k=e.protocol;'SAML'===k?(e=e.samlToken,c=new olympe.auth.Jq(d,f,g,h),c.C=e):'openid'===k&&(c=new olympe.auth.jm(d,f,g,h))}b(null,c);break;default:b(Error('Unknown response from server'))}})}ra(a,b){ri(this,olympe.H.oa.Ta.C.tt,
785
- {I:a.Sd()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.oa.Ta.C.qc:b(Error(`Username '${a.Sd()}' invalid, or password does not match`));break;case olympe.H.oa.Ta.C.Su:c=d.payload;b(null,c.S,c.B);break;default:b(Error('Unknown response from server'))}})}Da(a,b){ri(this,olympe.H.oa.Ta.C.ys,{A:a.get('a'),M:a.get('m1'),I:a.Sd()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.oa.Ta.C.qc:this.L.debug('Login failed, invalid username or password');b(Error('Invalid username or password'));
786
- break;case olympe.H.oa.Ta.C.Si:c=d.payload;this.L.debug('Login successful, creating token');d=c.payload?JSON.parse(c.payload):void 0;b(null,new olympe.auth.tf(c.userName,c.userTag,c.rndCook,d));break;default:b(Error(`Unknown response from server (type ${d.c})`))}})}ka(a){ri(this,olympe.H.oa.Ta.C.Re,{},(b,c)=>{null!==b?a(b):c.url&&c.request?a(null,c.url,c.request.replace(/\s/g,''),c.id):a(Error('Missing parameters from server response'))})}aa(a){const b=olympe.D.Ya(olympe.auth.Qc().C.Eb())||null;if(b instanceof
787
- olympe.auth.jm){const c=e=>{const f=Object.create(null);f.url=e;f.olympe_token=b.Kf();f.access_token=b.bk().access_token||null;this.F.redirect(`${this.G}/logout`,f)};a=this.F.C();const d=new URL(a);if(0!==d.hash.length||0!==d.search.length){const e=this.storage.C('AUTH');d.hash='';d.search='';e&&e.set('redirectTo',a,()=>{e.close();c(d.toString())})}else c(a)}else this.C.Z(olympe.H.Uc.pf,{c:olympe.H.oa.Ta.C.$t},a)}ki(a){this.C.Z(olympe.H.Uc.pf,{c:olympe.H.oa.Ta.C.og},a)}rh(a,b,c){this.C.zc(this.ab+
788
- '/'+a,olympe.H.Uc.pf,b,!1,null,(d,e)=>{c(d,e)})}Ur(){return this.G}};olympe.H.oa.Ta.C={pf:1,$t:2,qc:3,og:5,Si:6,tt:10,Su:11,ys:12,Re:13,Ku:14,Zt:20};olympe.H.oa.Ta.la=[olympe.auth.Uu,olympe.auth.Hb.oa.Ji,olympe.auth.Hb.oa.Ee,olympe.auth.Hb.oa.Re];olympe.H.$={};olympe.H.$.Wc=function(){};olympe.H.$.Wc.prototype.ia=function(){};olympe.H.$.Ne=function(){};olympe.H.$.Ne.prototype.ia=function(){};olympe.H.$.$a=function(){};olympe.H.$.$a.prototype.ia=function(){};olympe.H.$.wf=function(){};olympe.H.$.wf.prototype.ia=function(){};olympe.H.$.gb=function(){this.X={};this.Db={};this.U={};this.na=Object.create(null);var a=new olympe.H.$.X.Qb;this.X[O(olympe.dc.X.Qb)]=a;a=new olympe.H.$.X.Be;this.X[O(olympe.dc.X.Be)]=a;a=new olympe.H.$.X.Dc;this.X[O(olympe.dc.X.Dc)]=a;this.X[O(olympe.dc.X.Kd)]=new olympe.H.$.X.Kd;this.X[O(olympe.dc.X.rc)]=new olympe.H.$.X.rc;this.X[O(olympe.dc.X.$d)]=new olympe.H.$.X.$d;this.X[O(olympe.dc.X.xe)]=new olympe.H.$.X.xe;a=new olympe.H.$.Db.Number;this.Db[O(olympe.dc.Db.Number)]=a;a=new olympe.H.$.Db.String;
789
- this.Db[O(olympe.dc.Db.String)]=a;a=new olympe.H.$.U.Gc;this.U[O(olympe.dc.U.Gc)]=a;this.U[O(olympe.dc.U.ye)]=new olympe.H.$.U.ye;this.U[O(olympe.dc.U.Fe)]=new olympe.H.$.U.Fe;a=new olympe.H.$.U.Sc;this.U[O(olympe.dc.U.Sc)]=a;a=new olympe.H.$.U.xd;this.U[O(olympe.dc.U.xd)]=a;this.U[O(olympe.dc.U.kd)]=new olympe.H.$.U.kd;a=new olympe.H.$.U.kf;this.U[O(olympe.dc.U.kf)]=a;a=new olympe.H.$.U.lf;this.U[O(olympe.dc.U.lf)]=a;this.na[O(olympe.dc.na.Dd)]=new olympe.H.$.na.Dd;a=new olympe.H.$.na.ke;this.na[O(olympe.dc.na.ke)]=
790
- a;a=new olympe.H.$.na.oe;this.na[O(olympe.dc.na.oe)]=a;a=new olympe.H.$.na.ue;this.na[O(olympe.dc.na.ue)]=a;a=new olympe.H.$.na.je;this.na[O(olympe.dc.na.je)]=a;this.na[O(olympe.dc.na.sf)]=new olympe.H.$.na.sf};olympe.H.$.gb.prototype.constructor=olympe.H.$.gb;function si(a,b,c){var d=b.ma(),e=a.U[d];if(void 0===e)throw Error('No predicate registered for predicate: '+d);return e.ia(b,c,a)}
791
- function ti(a,b,c){var d=b.ma(),e=a.na[d];if(void 0===e)throw Error('No valueDef registered for valueDef: '+d);return e.ia(b,c,a)}
792
- function ui(a,b){return a&&a.xf?'"$'+b.add(a)+'"':a instanceof olympe.D.qa||a instanceof olympe.D.ea?String(a):a instanceof olympe.D.Wa?'"'+a+'"':a instanceof olympe.D.jb?(a=a.ss(),String(`{"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.Of().valueOf()+',"g":'+a.If().valueOf()+',"b":'+a.Df().valueOf()+',"a":'+a.Cf().valueOf()+
793
- '}':a instanceof olympe.dc.Hc?'{"c":8,"t":"'+a.R()+'"}':JSON.stringify(a)};olympe.H.$.Wj=class{ia(a){const b=Object.create(null);b.i=a.Y();b.b=[a.C];b.m=!0;b.v=!0;b.f=a instanceof olympe.dc.query.Sl?Ue(a.sh):olympe.dc.Rb.NONE;b.q=lf(a).map(this.C.bind(this));return b}C(a){const b=a.Qd(),c=b.Oa()===olympe.dc.za.ORIGIN?olympe.H.$.X.Qb.C.Hi:olympe.H.$.X.Qb.C.Pi,d=Object.create(null);d.t=b.R();d.d=c;d.v=a.apply;d.r=b.recursive;d.q=a.lh().map(this.C.bind(this));return d}};olympe.H.$.X={};olympe.H.$.X.xe=class{ia(){return'{"y":15}'}};olympe.H.$.X.xe.la=[olympe.H.$.Wc];olympe.H.$.X.rc=function(){};olympe.H.$.X.rc.prototype.constructor=olympe.H.$.X.rc;olympe.H.$.X.rc.prototype.ia=function(a,b,c){return'{"y":21,"p":'+si(c,a.C,b)+'}'};olympe.H.$.X.rc.la=[olympe.H.$.Wc];olympe.H.$.X.Be=function(){};olympe.H.$.X.Be.prototype.constructor=olympe.H.$.X.Be;olympe.H.$.X.Be.prototype.ia=function(a){var b=null!==a.Oa()?a.Oa()===olympe.dc.za.ORIGIN?olympe.H.$.X.Qb.C.Hi:olympe.H.$.X.Qb.C.Pi:olympe.H.$.X.Qb.C.Yn;return'{"y":12,"t":'+JSON.stringify(Xg(a))+',"d":'+b+'}'};olympe.H.$.X.Be.la=[olympe.H.$.Wc];olympe.H.$.X.Dc=function(){};olympe.H.$.X.Dc.prototype.constructor=olympe.H.$.X.Dc;olympe.H.$.X.Dc.prototype.ia=function(a){const b=null!==a.Oa()?a.Oa()===olympe.dc.za.ORIGIN?olympe.H.$.X.Qb.C.Hi:olympe.H.$.X.Qb.C.Pi:olympe.H.$.X.Qb.C.Yn;return'{"y":11,"t":"'+a.R()+'","d":'+b+',"s":'+a.F+',"e":'+a.C+'}'};olympe.H.$.X.Dc.la=[olympe.H.$.Wc];olympe.H.$.X.Qb=function(){};olympe.H.$.X.Qb.C={Yn:0,Hi:1,Pi:2};olympe.H.$.X.Qb.prototype.constructor=olympe.H.$.X.Qb;olympe.H.$.X.Qb.prototype.ia=function(a){const b=a.Oa()===olympe.dc.za.ORIGIN?olympe.H.$.X.Qb.C.Hi:olympe.H.$.X.Qb.C.Pi;return'{"y":10,"t":"'+a.R()+'","d":'+b+'}'};olympe.H.$.X.Qb.la=[olympe.H.$.Wc];olympe.H.$.X.Kd=function(){};olympe.H.$.X.Kd.prototype.constructor=olympe.H.$.X.Kd;olympe.H.$.X.Kd.prototype.ia=function(a,b,c){var d=a.Ld;const e=d.ma();var f=c.Db[e];if(void 0===f)throw Error('No comparator registered for comparator: '+e);return'{"y":20,"o":'+f.ia(d,b,c)+(a.C?'':',"a":false')+'}'};olympe.H.$.X.Kd.la=[olympe.H.$.Wc];olympe.H.$.X.$d=function(){};olympe.H.$.X.$d.prototype.constructor=olympe.H.$.X.$d;olympe.H.$.X.$d.prototype.ia=function(a,b){var c=a.start;c=c&&c.xf?'"$'+b.add(c)+'"':JSON.stringify(c);a=(a=a.C)&&a.xf?'"$'+b.add(a)+'"':JSON.stringify(a);return'{"y":22,"s":'+c+',"n":'+a+'}'};olympe.H.$.X.$d.la=[olympe.H.$.Wc];olympe.H.$.Db={};olympe.H.$.Db.Number=class{constructor(){}ia(a,b,c){return`{"y":11,"v":${ti(c,a.C,b)}}`}};olympe.H.$.Db.Number.la=[olympe.H.$.Ne];olympe.H.$.Db.String=class{constructor(){}ia(a,b,c){return`{"y":10,"v":${ti(c,a.C,b)}}`}};olympe.H.$.Db.String.la=[olympe.H.$.Ne];olympe.H.$.U={};olympe.H.$.U.Sc=function(){};olympe.H.$.U.Sc.prototype.constructor=olympe.H.$.U.Sc;olympe.H.$.U.Sc.prototype.ia=function(a,b,c){const d=ti(c,a.source,b);c=ti(c,a.getValue(),b);a=ui(a.G,b);return'{"y":20,"s":'+d+',"v":'+c+',"a":'+a+'}'};olympe.H.$.U.Sc.la=[olympe.H.$.$a];olympe.H.$.U.Gc=function(){};olympe.H.$.U.Gc.prototype.constructor=olympe.H.$.U.Gc;olympe.H.$.U.Gc.prototype.ia=function(a,b,c){const d=ti(c,a.G,b);a=ti(c,a.N,b);return'{"y":10,"l":'+d+',"r":'+a+'}'};olympe.H.$.U.Gc.la=[olympe.H.$.$a];olympe.H.$.U.ye=function(){};olympe.H.$.U.ye.prototype.constructor=olympe.H.$.U.ye;olympe.H.$.U.ye.prototype.ia=function(a,b,c){const d=ti(c,a.G,b);a=ti(c,a.N,b);return'{"y":11,"l":'+d+',"r":'+a+'}'};olympe.H.$.U.ye.la=[olympe.H.$.$a];olympe.H.$.U.kf=class{ia(a){const b=Rg(a).map(d=>'"'+d+'"'),c=Sg(a).map(d=>d===olympe.dc.za.DESTINATION?'2':'1');a=a.G;return'{"y":81,"r":['+b.toString()+'],"d":['+c.toString()+']'+(0!==a.length?',"t":"'+a.toString()+'"':'')+'}'}};olympe.H.$.U.kf.la=[olympe.H.$.$a];olympe.H.$.U.lf=class{ia(a){return'{"y":80,"m":['+Array.from(a.G).map(b=>'"'+b+'"').toString()+']}'}};olympe.H.$.U.lf.la=[olympe.H.$.$a];olympe.H.$.U.kd=class{ia(a,b,c){return'{"y":30,"p":'+si(c,a.G,b)+'}'}};olympe.H.$.U.kd.la=[olympe.H.$.$a];olympe.H.$.U.xd=class{ia(a,b,c){c=ti(c,a.source,b);const d=a.N;a=ui(a.G,b);return'{"y":23,"s":'+c+',"r":"'+d+'","a":'+a+'}'}};olympe.H.$.U.xd.la=[olympe.H.$.$a];olympe.H.$.U.Fe=function(){};olympe.H.$.U.Fe.prototype.constructor=olympe.H.$.U.Fe;olympe.H.$.U.Fe.prototype.ia=function(a,b,c){var d=ti(c,a.G,b);a=ti(c,a.N,b);return'{"y":12,"l":'+d+',"r":'+a+'}'};olympe.H.$.U.Fe.la=[olympe.H.$.$a];olympe.H.$.na={};olympe.H.$.na.Lc=function(){};olympe.H.$.na.Lc.prototype.constructor=olympe.H.$.na.Lc;olympe.H.$.na.Lc.prototype.C=function(){};
794
- olympe.H.$.na.Lc.prototype.ia=function(a,b,c){var d=ui(a.af,b),e=a.Od();e=e?',"b":'+ui(e,b):'';if(a=a.Dg()){var f='[';for(let n=0,p=a.length;n<p;n++){var g=0===n?'':',';var h=c;var k=a[n],l=b;const q=k.ma(),r=h.X[q];if(void 0===r)throw Error('No serializer registered for transformer: '+q);h=r.ia(k,l,h);f+=g+h}b=',"q":'+(f+']')}else b='';return'{"y":'+this.C()+',"t":'+d+e+b+'}'};olympe.H.$.na.Lc.la=[olympe.H.$.wf];olympe.H.$.na.ue=function(){olympe.H.$.na.Lc.call(this)};olympe.H.$.na.ue.prototype=Object.create(olympe.H.$.na.Lc.prototype);olympe.H.$.na.ue.prototype.constructor=olympe.H.$.na.ue;olympe.H.$.na.ue.prototype.C=function(){return 13};olympe.H.$.na.Dd=class{ia(a,b){return'{"y":10,"v":'+ui(a.value,b)+'}'}};olympe.H.$.na.Dd.la=[olympe.H.$.wf];olympe.H.$.na.je=function(){olympe.H.$.na.Lc.call(this)};olympe.H.$.na.je.prototype=Object.create(olympe.H.$.na.Lc.prototype);olympe.H.$.na.je.prototype.constructor=olympe.H.$.na.je;olympe.H.$.na.je.prototype.C=function(){return 14};olympe.H.$.na.ke=function(){olympe.H.$.na.Lc.call(this)};olympe.H.$.na.ke.prototype=Object.create(olympe.H.$.na.Lc.prototype);olympe.H.$.na.ke.prototype.constructor=olympe.H.$.na.ke;olympe.H.$.na.ke.prototype.C=function(){return 11};olympe.H.$.na.oe=function(){olympe.H.$.na.Lc.call(this)};olympe.H.$.na.oe.prototype=Object.create(olympe.H.$.na.Lc.prototype);olympe.H.$.na.oe.prototype.constructor=olympe.H.$.na.oe;olympe.H.$.na.oe.prototype.C=function(){return 12};olympe.H.$.na.sf=class{ia(){return'{"y":19}'}};olympe.H.$.na.sf.la=[olympe.H.$.wf];olympe.H.sd={};function vi(a,b){a.L.info('Initializing SERVER layer');if(a.L.G()){const c=['Server layer parameters:'];b.forEach((d,e)=>{c.push(e+'="'+d+'"')});a.L.debug(c.join('\n\t'))}a.Da(olympe.H.Uc.qc,c=>{switch(c.c){case olympe.H.ja.fv:a.L.error('Unknown message sent to the server:',olympe.H.sa.F[c.s]);break;case olympe.H.ja.ft:a.L.error('Fatal error, the last message is probably too big according to the websocket config.'),a.F.forEach((d,e)=>{null!==d.Fn&&wi(a,e,c.i)})}});b.get('autoConnect')&&(a.L.debug('Connecting automatically'),
795
- a.connect());olympe.D.nn(a.V.Eb(),()=>{a.Xf.forEach(c=>c());Jb(a.ji.bind(a),a.Yx);Jb(a.Ve.bind(a),a.He)},()=>{a.aa=null;a.Pf.forEach(c=>c(a.G[2]));a.Ve()});a.L.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}
796
- function xi(a,b){if(a.C!==b)switch(a.L.debug('State change '+a.C+' --\x3e '+b),a.C=b,b){case olympe.H.sa.C.CONNECTING:break;case olympe.H.sa.C.ui:a.V.update(olympe.D.qa.F);break;case olympe.H.sa.C.Yg:a.G[0]=0;a.G[1]=0;a.connect();break;case olympe.H.sa.C.qc:a.L.error('Connection to server',a.ra.C(),'aborted due to error');a.V.update(olympe.D.qa.C);break;case olympe.H.sa.C.hg:a.V.update(olympe.D.qa.C);a.Ab&&(a.L.info('Disconnected, will try to auto reconnect in',a.cc,'ms'),Ib(()=>{a.connect()},a.cc));
731
+ olympe.dm.File.urlProp=olympe.dm.File.P.Ca('ff023000000000000053');z('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.P.Ca('ff023000000000000054');olympe.dm.File.la=[olympe.D.File];m=olympe.dm.File.prototype;m.dn.K=olympe.D.J.F;m.Ok.K=new olympe.D.J(()=>{},[]);m.Ym.K=new olympe.D.J(()=>{},[]);m.Pk.K=new olympe.D.J(()=>{},[]);m.rename.K=olympe.D.J.C;m.Ql.K=olympe.D.J.F;m.wp.K=olympe.D.J.F;m.lw.K=new olympe.D.J(()=>olympe.D.jb,[]);
732
+ m.Gw.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Vr.K=olympe.D.J.U;olympe.dm.Fd=class extends olympe.dc.CloudObject{C(){return this.Fb(olympe.dm.Fd.F)}G(){return this.Ie(olympe.dm.Fd.N)}F(){return this.ub(olympe.dm.Fd.C,olympe.dm.Module)}};olympe.dm.Fd.P=olympe.dc.Ba.C('ff021000000000000041',olympe.dm.Fd);olympe.dm.Fd.F=olympe.dm.Fd.P.Ca('ff023000000000000047');olympe.dm.Fd.N=olympe.dm.Fd.P.Ca('ff023000000000000048');olympe.dm.Fd.C=olympe.dm.Module.C.Pc();olympe.dm.Fd.prototype.C.K=olympe.D.J.F;olympe.dm.Fd.prototype.G.K=olympe.D.J.G;
733
+ olympe.dm.Fd.prototype.F.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.Nb=class extends olympe.dm.md{F(){return this.ub(olympe.dm.Pb.F,olympe.dm.Pb)}N(){return this.Fb(olympe.dm.Nb.ra)}aa(){return this.Fb(olympe.dm.Nb.Xc)}G(){return this.ub(olympe.dm.Nb.N,olympe.dm.Nb)}};olympe.dm.Nb.P=olympe.dc.Ba.C('0163d9594700fcf61e54',olympe.dm.Nb);olympe.dm.Nb.ra=olympe.dm.Nb.P.Ca('017869c7d2833c9492c1');olympe.dm.Nb.Xc=olympe.dm.Nb.P.Ca('017869c80bb9929c76d0');olympe.dm.Nb.N=olympe.dm.Nb.P.Pa('ff02200000000000002b');olympe.dm.Nb.Bf=P(olympe.dm.Nb.P,olympe.dm.Nb.N);
734
+ olympe.dm.Nb.zc=olympe.dm.Nb.P.Pa('ff02200000000000002a');olympe.dm.Nb.He=olympe.dm.Nb.P.Pa('017e9c412e2b944bd590');olympe.dm.Nb.th=olympe.dm.Nb.P.Pa('017e9c416872a89d3415');olympe.dm.Nb.Qf=olympe.dm.Nb.P.Pa('017ebf8fe5c506662098');P(olympe.dc.CloudObject.P,olympe.dm.Nb.zc);olympe.dm.Nb.qe=Jc('100000000000000000dd','PRIMORDIAL');olympe.dm.Nb.prototype.F.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.Nb.prototype.N.K=olympe.D.J.F;olympe.dm.Nb.prototype.aa.K=olympe.D.J.F;
735
+ olympe.dm.Nb.prototype.G.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{F(){return this.cd(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}C(){return this.cd(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}hd(){return this.F().ma().Cr(this.ma())}};olympe.dm.Property.P=olympe.dc.Ba.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=P(olympe.dm.Property.P,olympe.dc.CloudObject.propertyRel);z('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);
736
+ olympe.dm.Property.typeRel=P(olympe.dm.Property.P,olympe.dc.CloudObject.typeRel);z('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.F.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Dw(){return olympe.D.Wa.EMPTY}gw(){return this.Ie(olympe.dm.Relation.Im)}Nw(){return this.Ie(olympe.dm.Relation.wn)}Kr(){return this.ub(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Oc()}Qr(){return this.ub(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Oc()}hd(){return this.Qr().ma().concat(['-',this.ma(),'->',this.Kr().ma()])}};olympe.dm.Relation.P=olympe.dc.Ba.C('ff021000000000000006',olympe.dm.Relation);
737
+ olympe.dm.Relation.wn=olympe.dm.Relation.P.Ca('ff023000000000000030');olympe.dm.Relation.Im=olympe.dm.Relation.P.Ca('ff023000000000000034');olympe.dm.Relation.Sm=olympe.dm.Relation.P.Ca('ff023000000000000037');olympe.dm.Relation.Rm=olympe.dm.Relation.P.Ca('ff023000000000000137');olympe.dm.Relation.dl=olympe.dm.Relation.P.Ca('ff023000000000000237');olympe.dm.Relation.ks=olympe.dm.Relation.P.Ca('ff023000000000000337');olympe.dm.Relation.xv=olympe.dm.Relation.P.Ca('ff023000000000000031');
738
+ olympe.dm.Relation.originModelRel=P(olympe.dm.Relation.P,olympe.dc.CloudObject.G);z('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=P(olympe.dm.Relation.P,olympe.dc.CloudObject.U);z('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dc.Sb={NONE:null,gz:olympe.dm.Relation.Sm.R(),Fc:olympe.dm.Relation.Rm.R(),pf:olympe.dm.Relation.dl.R(),GA:olympe.dm.Relation.ks.R()};
739
+ olympe.dc.Sb.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Sb))if(c===a)return b;return null};olympe.dm.Relation.C={jp:0,pl:5,wq:1,Gu:4,yk:2,mk:8,Co:10,Cu:6,Du:9,bc:6,Fu:9};olympe.dm.Relation.F={ju:3,$l:4,bu:5,Wl:6};olympe.dm.Relation.N=olympe.dm.Rc.aq+olympe.dm.Rc.vo;m=olympe.dm.Relation.prototype;m.Dw.K=olympe.D.J.F;m.gw.K=olympe.D.J.G;m.Nw.K=olympe.D.J.G;m.Kr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Qr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.nf=class extends olympe.dc.CloudObject{getValue(){}};olympe.dm.nf.P=olympe.dc.Ba.C('ff021000000000000019',olympe.dm.nf);olympe.dm.String=class extends olympe.dm.nf{getValue(){return this.Fb(olympe.dm.String.valueProp)}toString(){return this.get(olympe.dm.String.valueProp)}};olympe.dm.String.P=olympe.dc.Ba.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.P.Ca('ff023000000000000026');z('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.D.J.F;olympe.dm.String.prototype.toString.K=olympe.D.J.C;olympe.dm.Boolean=class extends olympe.dm.nf{getValue(){return this.oh(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.P=olympe.dc.Ba.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.P.Ca('ff023000000000000027');z('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.D.J.U;olympe.dm.Color=class extends olympe.dm.nf{getValue(){return this.Rr()}};olympe.dm.Color.P=olympe.dc.Ba.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.P.Ca('ff023000000000000032');z('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.D.J(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.nf{getValue(){return this.ij(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.P=olympe.dc.Ba.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.P.Ca('ff023000000000000029');z('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.D.J(()=>olympe.D.jb,[]);olympe.dm.Enum=class extends olympe.dm.String{ma(){return olympe.D.Fa([super.ma(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Wa)}ee(){return this.Ie(olympe.dm.Enum.rankProp)}static create(a,b,c,d,e){const f=olympe.dc.Na();e=void 0!==e?e:f.Gb(b)&&f.de(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;
740
+ olympe.dm.Enum.P=olympe.dc.Ba.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.P.Ca('017a7690c915975ea995');olympe.dm.Enum.prototype.ee.K=olympe.D.J.G;olympe.dm.gg=class extends olympe.dm.BrickMetadata{hx(){return this.sb(olympe.dc.CloudObject.instancesRel).hl(olympe.dm.Enum.rankProp,olympe.dc.da.fm.ASC).bd()}static create(a,b){b=a.create(olympe.dm.gg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Ra(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.gg.create=olympe.dm.gg.create;olympe.dm.gg.prototype.getValues=olympe.dm.gg.prototype.hx;olympe.dm.gg.P=olympe.dc.Ba.C('017a768f966fc08ebb98',olympe.dm.gg);olympe.dm.Number=class extends olympe.dm.nf{getValue(){return this.Ie(olympe.dm.Number.valueProp)}};olympe.dm.Number.P=olympe.dc.Ba.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.P.Ca('ff023000000000000028');z('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.D.J.G;olympe.Za={};olympe.Za.$g=class{constructor(a){this.L=a;this.Y=new olympe.D.Wb(`${this.Z()} source context`);this.U=this.C=null}Z(){}N(){}close(){this.U&&this.U(this.Z(),olympe.dc.tk.vt);this.Y.destroy()}};function gh(a){olympe.D.wc([pc(a.ra)],b=>{if(b.valueOf()){const c=a.G.keys();hh(a,d=>{if(d)a.L.error('An error occurred while auto synchronising:\n'+d.message);else if(a.L.debug('Auto synchronise transactions successfully'),a.aa)for(const e of c)ec(a.F,f=>{a.L.error(`Could not clear transactions for ${e}: ${f}.`)})})}})}
741
+ function ih(a){let b;olympe.D.wc([pc(a.ra)],c=>{c.valueOf()?(a.aa=!1,b&&(Kb(b),b=null)):(a.aa=!0,b=Jb(()=>{if(a.ka){a.ka=!1;for(const d of a.G.keys())cc(a.F,d,a.G.get(d),()=>{},e=>{a.L.error(`Could persist transaction for ${d}: ${e}`)})}},5E3))})}
742
+ function hh(a,b){const c=olympe.async.sk.create(),d=c.G;c.add((e,f)=>{a.F.storage.N(f)});c.add((e,f,g)=>{const h=olympe.dc.Ha.rb,k=g.get('files'),l=new olympe.async.og(d);a.G.forEach((n,p)=>{if(p!==h){const q=a.Da.U(p);null!==q?(l.add(a.Sa.bind(a,n,q,k)),a.F.storage.C()):f(`The source: ${p} is not reachable.`)}});$b(l,(n,p)=>{n?e():f(p||void 0)});l.start()});$b(c,(e,f)=>{b(e?null:Error(f));e&&(a.ka=!1,a.G.clear())});c.start()}
743
+ function jh(a,b){const c=new olympe.async.sk(olympe.D.Ja());c.add((d,e)=>{dc(a.F,f=>null===f?d():e(f))});c.add(d=>{const e=olympe.dc.Ad();a.G.forEach((f,g)=>{const h=Array.from(f.de()).map(k=>k.tag());Oc(e,olympe.D.Ja(),f,h,[],g)(!0)});d()});$b(c,(d,e)=>{b(e?Error(e):null)});c.start()}
744
+ olympe.Za.Hi=class extends olympe.Za.$g{constructor(a,b,c,d,e){super(a);this.G=new Map;this.ra=c;this.F=d;this.Da=b;this.ka=this.aa=!1;e.get('syncTimeout');e.get('autoSync')&&gh(this);e.get('autoPersist')&&ih(this)}Sa(a,b,c,d,e){const f=olympe.dc.ga.ja.xk,g=olympe.dc.ga.ja.yl,h=new olympe.dc.db.xc,k=new olympe.async.og(olympe.D.Ja()),l=(n,p,q)=>{const r=n.tag(),t=n.fb(olympe.dm.File.mimeTypeProp.R());gc(this.F,u=>{xc(olympe.dc.ww(),r,u,t,v=>{n.Ca(olympe.dm.File.urlProp.R(),v);const w=new Map;w.set(olympe.dm.File.urlProp.R(),
745
+ v);h.qc(r,w);this.F.storage.C(q)})})};for(const n of c)(c=a.Jf(n))&&c.se()&&k.add(l.bind(this,c));$b(k,(n,p)=>{n?(n=M(new olympe.dc.ga(f,a,[b.Z()]),q=>{q?e(q.message):(this.C(b.Z(),g,h),q=Array.from(a.de()).map(r=>r.tag()),olympe.dc.Ad().persist(q),d())}),b.N(n)):e(`Transaction synchronisation failed! ${p?p:''}`)});k.start()}Z(){return olympe.dc.Ha.rb}N(a){var b=olympe.dc.ga.ja.bh,c=olympe.dc.ga.ja.yh;const d=olympe.dc.ga.ja.Ai,e=olympe.dc.ga.ja.zi,f=olympe.dc.ga.ja.Qg,g=olympe.dc.ga.ja.Hl,h=olympe.dc.ga.ja.Sh,
746
+ k=olympe.dc.ga.ja.wi,l=olympe.dc.ga.ja.zh;var n=olympe.dc.ga.ja.Qj;const p=a.type;switch(p){case f:a.validate(null);this.F.storage.F();jh(this,v=>{null!==v&&this.L.error(`Could not load transactions: ${v.message}`)});break;case b:case c:const q=a.content;a.C.forEach(v=>{let w=this.G.get(v);void 0===w&&(w=new olympe.dc.db.xc,this.G.set(v,w));q.Mc(w);this.aa&&(this.ka=!0)});a.validate(null);a=olympe.dc.transaction.sg.C.Rp;this.C(olympe.dc.Ha.rb,n,{id:q.Z(),finalize:a});break;case e:case d:const r=a.C[0],
747
+ t=a.content;a.validate(null);bc(this.F,t.Z(),v=>{this.L.warn('No graphresult for subscription : '+t.Z(),v,'\n',t.qh.toJSON());this.L.warn();this.C(r,g,new olympe.dc.query.Ci(t.Z(),r,olympe.dc.Ha.rb,new olympe.dc.db.xc))});break;case h:case l:case k:n=a.content;b=n.file;const u=n.Ye;c=n.te;p===h?fc(this.F,b,n.content,n.mimeType,u,c):p===l?gc(this.F,v=>{u(v)}):this.F.storage.C(c);a.validate(null)}}};olympe.Za.Hi.C='context';const kh=olympe.dc.ga.ja.mm,lh=olympe.dc.ga.ja.om,mh=olympe.dc.ga.ja.QUERY_RESULT,nh=olympe.dc.ga.ja.nm,oh=olympe.dc.ga.ja.bh,ph=olympe.dc.ga.ja.xk,qh=olympe.dc.ga.ja.Qj,rh=olympe.dc.ga.ja.yh,sh=olympe.dc.ga.ja.Gj,th=olympe.dc.ga.ja.ql,uh=olympe.dc.ga.ja.Sh,vh=olympe.dc.ga.ja.zh,wh=olympe.dc.ga.ja.wi,xh=olympe.dc.ga.ja.mg;
748
+ function yh(a,b,c,d,e){const f=c.Z();c={t:kh,q:c.ia()};olympe.H.wa.nb.zb.get(b,c).then(g=>{g.t===mh?(d(null),a.C(b,e||mh,{i:f,r:g.r,s:b})):d(Error(g.e))}).catch(g=>d(Error(g)))}function zh(a,b,c,d,e){const f=c.Z();yh(a,b,c,g=>{if(g)e(g);else{Ah(a,b,f);g={t:lh,q:c.ia()};var h=olympe.H.wa.nb.zb.observe(b,d,g).subscribe(k=>{const l=k.t;l===nh?(e(null),a.C(b,l,{i:f,r:k.r,s:b})):e(Error(k.e))});d.vc(()=>h.unsubscribe())}},nh)}
749
+ function Bh(a,b,c,d){const e=c.Bc;c=new olympe.dc.transaction.wd;e.Mc(c);c={t:oh,i:e.Z(),p:de(c)};olympe.H.wa.nb.zb.send(b,c).then(()=>{d(null);a.C(b,qh,{id:e.Z(),finalize:olympe.dc.transaction.sg.C.Qp})}).catch(f=>d(Error(f)))}function Ch(a,b,c,d,e){var f=c.Bc;c=f.Z();const g=new olympe.dc.transaction.wd;f.Mc(g);f={t:rh,i:c,p:de(g)};olympe.H.wa.nb.zb.publish(b,f).then(()=>e(null)).catch(h=>e(Error(h)));Dh(a,c,b,d)}
750
+ function Ah(a,b,c){const d=()=>{const f=setInterval(()=>{0===a.F.size?clearInterval(f):a.F.forEach((g,h)=>{olympe.H.wa.nb.zb.send(h,{t:xh,s:Array.from(g)}).catch(k=>a.L.warn(`Error occurred while keeping alive subscription list: ${k}`))})},a.aa)},e=a.F.get(b)||new Set;e.add(c);a.F.set(b,e);1===a.F.size&&d()}
751
+ function Dh(a,b,c,d){const e=new olympe.H.wa.nb.zb(b,d);e.listen().subscribe(f=>{f=f.body();if(f.t===sh){a.L.error(`Burst Transaction ${b} failed. Local rollback is not supported yet. Refresh the application`);const g=new olympe.dc.db.xc;a.C(c,sh,{id:b,rollback:g,error:f.r})}});d.vc(()=>e.stop())}
752
+ olympe.Za.uu=class extends olympe.Za.$g{constructor(a,b,c){super(a);this.F=new Map;this.G=b;this.aa=c}Z(){return olympe.dc.Ha.fq}N(a){const b=a.C[0],c=a.type,d=a.validate.bind(a),e=a.content;a=a.F;switch(c){case kh:yh(this,b,e,d);break;case lh:zh(this,b,e,a,d);break;case oh:case ph:Bh(this,b,e,d);break;case rh:Ch(this,b,e,a,d);break;case th:e.t=c;olympe.H.wa.nb.zb.publish(b,e).then(d).catch(f=>d(Error(f)));break;case uh:case vh:case wh:olympe.H.wa.nb.zb.get(b,{t:c,f:e.file}).then(f=>{this.G.ka(e.file,
753
+ b,f);c===uh?this.G.Y(e.file,e.content,e.mimeType,e.Ye,e.te):c===vh?this.G.U(e.file,e.url,e.mimeType,e.Ye,e.te):this.G.N(e.file,e.Ye,e.te)}).catch(e.te);break;default:this.L.info(`Messages of type ${c} is not supported by the source ${this.Z()}`)}}};olympe.Za.Buffer=class{constructor(){this.counter=0;this.Jb=new Map}buffer(a){const b=this.counter++;this.Jb.set(b,a);return this.clear.bind(this,b)}clear(a){this.Jb.delete(a)}};olympe.Za.qg=class a{constructor(b,c,d){this.L=b;this.Y=c;this.ka=new olympe.Za.Buffer(this);this.N=new Map;this.G=this.Xb(d);new olympe.D.Wb('Data Router context');this.F=new Map;this.aa=new Map;this.ab()}ab(){this.L.info('Initializing DR layer');olympe.D.hn(pc(this.Y),()=>{this.L.info('Router: ONLINE')},()=>{this.L.log('Router: OFFLINE (no auth layer not online)');for(const b of this.ka.Jb.values())this.Da(b)});this.L.log('DONE initializing DR layer (waiting for AUTH layer session to be established)')}send(b){M(b,
754
+ this.ka.buffer(b));this.Da(b)}C(b,c){const d=olympe.W.nc();let e=this.F.get(b);void 0===e&&(e=new Map,this.F.set(b,e));e.set(d,c)}ra(b){this.aa.set(olympe.W.yg(),b)}Ab(b,c,d){this.F.has(c)&&this.F.get(c).forEach(e=>{e(b,d)})}fc(b,c){this.N.set(b,c);c.C=this.Ab.bind(this);c.U=this.Sa.bind(this)}U(b){return this.N.get(b)||this.N.get(olympe.dc.Ha.fq)}Sa(b,c){this.aa.forEach(d=>{d(b,c)})}Da(b){this.L.debug('Processing message',b.toString());this.bb(b).forEach(c=>{(c=this.U(c))&&c.N(b)})}bb(b){var c=olympe.dc.ga.ja.Qg,
755
+ d=olympe.dc.ga.ja.zi,e=olympe.dc.ga.ja.Ai,f=olympe.dc.ga.ja.bh,g=olympe.dc.ga.ja.yh;const h=olympe.dc.ga.ja.Sh,k=olympe.dc.ga.ja.wi,l=olympe.dc.ga.ja.zh;switch(b.type){case c:d=this.G.get(a.C.Qg)||[];break;case d:case e:d=this.G.get(a.C.lm)||[];break;case f:case g:d=this.G.get(a.C.TRANSACTION)||[];break;case h:case l:case k:d=this.G.get(a.C.dt)||[];break;default:d=[]}c=b.content;e=olympe.auth.sa.C.Lg;f=olympe.auth.sa.C.Ch;g=oc(this.Y);e=!(g===e||g===f);for(var n of d)if(d=n,f=c&&c.Z&&c.Z(),g=d.get('type'),
756
+ g===a.F.Jh&&e||g===a.F.hp&&d.get('id')===f||g===a.F.bc)return n=n.get('destinations'),this.L.debug('Message',b.toString(),'is redirect to',n),n;this.L.debug('Message',b.toString(),'not redirect');return b.C}Xb(b){const c=Object.values(olympe.Za.qg.C),d=Object.values(olympe.Za.qg.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 l=k.type;if(d.includes(l)){var n=k.destinations;n instanceof Array?(n=(new Map).set('type',
757
+ l).set('destinations',n),h.push(n),l===a.F.hp&&n.set('id',k.id)):this.L.error('Routing rule',f,l,'is not valid. Destinations must be stored in an array')}else this.L.error('Routing rule',f,l,'is not valid. Valid rules are',d.toString())})}else this.L.error('Routing rule',f,'is not valid. Rules must be ordered in an array');else this.L.error('Routing rule',f,'is not valid. Valid messages are',c.toString())});return e}};olympe.Za.qg.C={Qg:'getContext',lm:'query',TRANSACTION:'transaction',dt:'file'};
758
+ olympe.Za.qg.F={bc:'default',Jh:'offline',hp:'id'};olympe.Za.qg.la=[olympe.dc.qg];olympe.Za.Rj=class{ka(){}Y(){}U(){}N(){}};olympe.Za.O={va:'dr.Manager',Ea:'dr.Logger',me:'dr.sources.Router',Cp:'dr.sources.Local',sm:'dr.sources.Server',hq:'dr.sources.Peer',Pg:'dr.sources.FileSource'};olympe.Za.Config={Vl:'dr.keepAliveTimeout',Mn:'dr.autoSync',Ln:'dr.autoPersist',Qq:'dr.syncTimeout',Cq:'dr.routing'};
759
+ olympe.T.config(function(a){D(a,olympe.Za.Config.Cq,{});D(a,olympe.Za.Config.Vl,3E5);D(a,olympe.Za.Config.Mn,!1);D(a,olympe.Za.Config.Ln,!1);D(a,olympe.Za.Config.Qq,3E4);C(a,olympe.Za.O.Ea,[olympe.pa.O.va],b=>b.Nc('dr'));C(a,olympe.Za.O.Cp,[olympe.Za.O.Ea,olympe.Za.O.me,olympe.auth.O.va,olympe.jc.O.po,new olympe.T.fa(olympe.Za.Config.Mn),new olympe.T.fa(olympe.Za.Config.Ln),new olympe.T.fa(olympe.Za.Config.Qq)],(b,c,d,e,f,g,h)=>{f=(new Map).set('autoSync',f).set('autoPersist',g).set('syncTimeout',
760
+ h);return new olympe.Za.Hi(b,c,d,e,f)});ta(a,olympe.Za.O.sm);A(a,olympe.Za.O.hq,olympe.Za.uu,olympe.Za.O.Ea,olympe.Za.O.Pg,new olympe.T.fa(olympe.Za.Config.Vl));ta(a,olympe.Za.O.Pg);A(a,olympe.Za.O.me,olympe.Za.qg,olympe.Za.O.Ea,olympe.auth.O.va,new olympe.T.fa(olympe.Za.Config.Cq));sa(a,olympe.dc.O.me,olympe.Za.O.me);C(a,olympe.dc.query.Mb.bk,[olympe.dc.query.Mb.bk],b=>new olympe.dc.km(b))},'olympe.dr');
761
+ olympe.T.run([olympe.Za.O.me,olympe.Za.O.Cp,olympe.Za.O.sm,olympe.Za.O.hq],(a,...b)=>{b.forEach(c=>a.fc(c.Z(),c))});olympe.H={};olympe.H.Uc={ui:1,cg:2,cc:3,mf:4,Xy:5,Di:6,tA:7};olympe.H.ja={Di:1,bv:2,ct:3,mg:5};olympe.H.sa=class{bb(){}connect(){}disconnect(){}Se(){}Pf(){}Y(){}zc(){}Xb(){}Da(){}qe(){}};olympe.H.sa.C={INIT:'initialize',CONNECTING:'connecting',fg:'disconnected',ti:'connected',Wg:'reconnecting',cc:'error'};olympe.H.sa.G={Kh:1,jt:-1,wt:-2,Vu:-3};function Eh(a,b){const c=a.G.get(b)||a.Sa;a.G.delete(b);return`${c}/${b}`}
762
+ olympe.H.Rj=class{constructor(a,b,c,d,e){this.L=a;this.F=b;this.ra=c;this.Sa=d;this.ab=e;this.C=new Map;this.G=new Map;this.aa=new Map;this.Da=new olympe.D.Wb('File manager context')}ka(a,b,c){b&&this.G.set(a,`${this.ab}/${b}`);c&&this.aa.set(a,c)}Y(a,b,c,d,e){const f=Ob(Eh(this,a),olympe.net.eb.$d.ik,b,olympe.net.eb.ResponseType.ol);Pb(f,{[olympe.net.eb.Headers.ri]:this.ed(a),[olympe.net.eb.Headers.Ij]:c||'application/octet-stream'});this.F.C(f,g=>{g=g.Rd();g===olympe.net.eb.od.Kh||g===olympe.net.eb.od.vl?
763
+ (g=new URL(f.C()),d(g.pathname)):e&&(g=`Failed to create file ${a}. Response code ${g}`,this.L.error(g),e(g))})}U(a,b,c,d,e){const f=olympe.D.Ja();d={Ye:f.Cb(d),te:e&&f.Cb(e)};if(this.C.has(a))this.C.get(a).push(d);else{this.C.set(a,[d]);if(null===b){var g=Ob(Eh(this,a));Pb(g,{[olympe.net.eb.Headers.ri]:this.ed(a)})}else g=Ob(b);g.F=olympe.net.eb.ResponseType.ol;Pb(g,{[olympe.net.eb.Headers.Ij]:c||'application/octet-stream'});this.Da.run(()=>{this.F.C(g,h=>{const k=h.Rd(),l=this.C.get(a);if(200<=
764
+ k&&300>k){const n=h.getData();l&&l.forEach(p=>{if(f.yb()){const q=f.Qk(),r=f.Z();this.L.warn(`Context ${q} ${r} is being destroyed while file tag ${a} is being downloaded`)}p.Ye(n)})}else{const n=`Failed to download file ${a}. Response code ${k}`;l&&l.forEach(p=>{p.te&&p.te(n)})}this.C.delete(a)})})}}N(a,b,c){const d=Ob(Eh(this,a),olympe.net.eb.$d.Fc);Pb(d,{[olympe.net.eb.Headers.ri]:this.ed(a)});this.F.C(d,e=>{e=e.Rd();200<=e&&300>e?b():(e=`Failed to delete file ${a}. Response code ${e}`,this.L.error(e),
765
+ c&&c(e))})}ed(a){const b=this.aa.get(a);b&&this.aa.delete(a);return b||olympe.D.Ya(rc(this.ra))}};olympe.H.Rj.la=[olympe.Za.Rj];const Fh=olympe.dc.ga.ja.Qg,Gh=olympe.dc.ga.ja.bh,Hh=olympe.dc.ga.ja.xk,Ih=olympe.dc.ga.ja.yh,Jh=olympe.dc.ga.ja.zi,Kh=olympe.dc.ga.ja.Ai,Lh=olympe.dc.ga.ja.Uo,Mh=olympe.dc.ga.ja.Vo,Nh=olympe.dc.ga.ja.Hl,Oh=olympe.dc.ga.ja.wi,Ph=olympe.dc.ga.ja.zh,Qh=olympe.dc.ga.ja.Sh,Rh=olympe.dc.ga.ja.Qj,Sh=olympe.dc.ga.ja.av,Th=olympe.dc.ga.ja.Bu,Uh=olympe.dc.ga.ja.kt,Vh=olympe.dc.ga.ja.ql,Wh=olympe.dc.ga.ja.Es;
766
+ function Xh(a){a.G.Da(olympe.H.Uc.ui,a.ab.bind(a));olympe.D.wc([pc(a.ra)],b=>{b=b.valueOf()?olympe.dc.tk.Xp:olympe.dc.tk.Jh;a.U&&a.U(a.Z(),b)},'Server source is online')}function Yh(a,b,c){const d=b.Bc;b=new olympe.dc.transaction.wd(!0);d.Mc(b);Zh(a,a.Ab,Gh,!0,de(b),e=>{c&&c(e);a.C(a.Z(),Rh,{id:d.Z(),finalize:olympe.dc.transaction.sg.C.Qp})})}
767
+ function $h(a,b,c,d){const e=c.Z();a.L.log('Graphdef (ID ',e,') sent: ',c);const f=c instanceof olympe.dc.query.Ol?a.bb:a.Da,g=(new olympe.H.$.Tj).ia(c);c=new olympe.async.og(a.Y);b===Kh&&c.add((k,l)=>{a.F.set(e,{notification:null,Yx:a.Y.Cb(n=>n?l(n):k())});ai(a,b,g,n=>n&&l(n.message))});const h=olympe.D.Ja();c.add((k,l)=>{h.run(()=>{Zh(a,f,Jh,!1,g,a.Y.Cb(n=>n?l(n.message):k()))})});$b(c,(k,l)=>{const n=a.F.get(e);k&&n&&n.notification?a.C(a.Z(),Mh,n.notification):!k&&n&&bi(a,Lh,e,p=>p&&a.L.warn(p));
768
+ a.F.delete(e);d(l?Error(l):null)});c.start()}function bi(a,b,c,d){a.L.log('Unsubscribe to: ',c);ai(a,b,{i:c},d)}function ai(a,b,c,d){b={c:b};Object.assign(b,c);a.G.Y(olympe.H.Uc.ui,b,d&&(e=>{d(e)}))}function Zh(a,b,c,d,e,f){if(a.G.bb()){const g=olympe.H.Uc.ui;!d&&e&&Object.assign(e,{c});c=olympe.D.Ya(rc(a.ra)).valueOf();a.G.zc(b,g,c,d,e,f)}else a.L.error('Server is disconnected, data request of type',c,'on url',b,'is canceled.'),f(Error('Server is disconnected'))}
769
+ olympe.H.$g=class extends olympe.Za.$g{constructor(a,b,c,d,e){super(a);this.G=b;this.ra=c;new olympe.H.$.gb;this.aa=new olympe.dc.W.Ki(this.Z());this.ka=d;if(4!==e.length)throw Error('Some HTTP end points to the orchestrator are not specified ! Please check DI of olympe.communication module; wants 4 urls but got: '+e.length);this.Sa=e[0];this.bb=e[1];this.Da=e[2];this.Ab=e[3];this.F=new Map;Xh(this)}Z(){return olympe.dc.Ha.Vc}N(a){var b=a.type;const c=a.validate.bind(a);a=a.content;switch(b){case Fh:Zh(this,
770
+ this.Sa,olympe.dc.ga.ja.Qg,!1,null,c);break;case Ih:b=new olympe.dc.transaction.wd;var d=a.Bc;a=a.sh;d.Mc(b);ai(this,Ih,{i:d.Z(),r:a,p:de(b)});c(null);break;case Vh:b=new olympe.dc.transaction.wd;a=a.Bc;a.Mc(b);ai(this,Vh,{i:a.Z(),p:de(b)},c);break;case Gh:b=new olympe.dc.transaction.wd;d=a.Bc;a=a.sh;d.Mc(b);ai(this,olympe.dc.ga.ja.bh,{i:d.Z(),r:a,p:de(b)},c);break;case Hh:Yh(this,a,c);break;case Jh:case Kh:$h(this,b,a,c);break;case Lh:bi(this,b,a,c);break;case Sh:ai(this,Sh,{},c);break;case Th:ai(this,
771
+ Th,{},c);break;case Uh:ai(this,Uh,{},c);break;case Wh:ai(this,Wh,{},c);break;case Ph:this.ka.U(a.file,a.url,a.mimeType,a.Ye,a.te);break;case Oh:this.ka.N(a.file,a.Ye,a.te);break;case Qh:this.ka.Y(a.file,a.content,a.mimeType,a.Ye,a.te);break;default:this.L.info(`Message of type ${b} not supported yet`)}}ab(a){var b=olympe.dc.ga.ja.yl,c=olympe.dc.ga.ja.Gj;const d=olympe.dc.ga.ja.ek,e=olympe.dc.ga.ja.Nu,f=olympe.dc.ga.ja.zp;var g=olympe.dc.ga.ja.lt;const h=a.c;h===b?(a=this.aa.C(a.p),this.C(this.Z(),
772
+ b,a)):h===c?(g=a.error.reason,b=this.aa.C(a.p),this.C(this.Z(),c,{id:a.i,rollback:b,error:g})):h===Nh?(g=olympe.dc.Ha.rb,c=olympe.dc.Ha.Vc,b=a.i,0<a.s?g=new olympe.dc.query.errors.Vj(b,c,g,a.info.error.reason):(g=this.aa.U(b,g,a.p),this.L.debug('< Graphdef Result (ID ',g.Z(),'):',a.p),this.L.log('< Graphdef Result (ID ',g.Z(),') with',g.Bc.G(),'operations')),this.C(this.Z(),Nh,g)):h===Mh?(g=a.i,a=this.aa.N(g,a.p),this.F.has(g)?(g=this.F.get(g),g.notification?lf(a,g.notification):g.notification=a):
773
+ this.C(this.Z(),Mh,a)):h===f?(g=new olympe.dc.query.Gp(a.i),a.l.forEach(g.F.bind(g)),this.C(this.Z(),f,g)):h===d?(g=olympe.dc.transaction.sg.C.ek,c=0<a.s?a.info.error.reason:null,this.C(this.Z(),Rh,{id:a.i,finalize:g,error:c})):h===e?(g=this.F.get(a.i))&&g.Yx(0<a.s?a.info.error.reason:null):h===g&&(c=a.ids,b=a.undo_stack_size,a=a.redo_stack_size,this.C(this.Z(),g,{QC:c,gD:b,bD:a}))}};olympe.H.$g.F={Zz:1,$A:2};
774
+ olympe.H.$g.C={100:'Insufficient Rights',200:'Constraints',300:'IOException',400:'Unexpected',500:'Non Existing Subscription'};olympe.H.Xj=class{constructor(){}};olympe.H.Xj.la=[olympe.dc.ba.Xj];olympe.H.wa={};function ci(a,b,c){a.L.debug(`Bus: Subscribe to ${b}`);Tb(a.C,b,d=>{d=new olympe.H.wa.Jb.Request(d.dest,d.src,d.auth,d.seq,d.type,d.content);a.L.debug('Bus: Received',d);c(d)})}function di(a,b,c){a.Y.set(b,c)}function ei(a,b){return new Promise((c,d)=>{Ub(a.C,b,e=>e?d(e):c())})}function fi(a,b){return new Promise((c,d)=>{a.aa.ph(b.ed(),(e,f)=>e?d(e):c(f))})}
775
+ olympe.H.wa.sa=class{constructor(a,b,c,d){this.L=a;this.aa=c;a=new olympe.W.$q(d.get('messageTimeout'));a.C=this.ka.bind(this);this.Y=a;a=d.get('url');d=d.get('connectionOptions');this.C=new olympe.net.je(a,d);this.U=1;this.G=olympe.W.nc();this.F=!1;this.N=[]}connect(){return new Promise(a=>{Sb(this.C)||this.F?a():this.C.connect(()=>{this.L.debug('Connection to bus established. Listening to',this.G);Yb(this.C,b=>{this.L.error('Failed to connect/re-connect to the bus:',b)});Tb(this.C,this.G,b=>{b=
776
+ new olympe.H.wa.Jb.Response(b.dest,b.src,b.seq,b.type,b.content);this.L.debug('Bus received message:',b);const c=this.Y.get(b.G);c&&(this.Y.delete(b.G),c(b))});Xb(this.C,()=>{this.F=!0});Wb(this.C,()=>{this.F=!0});Vb(this.C,()=>{if(this.F){this.F=!1;this.L.debug(`Reconnected to bus: Sending ${this.N.length} pending messages.`);for(const b of this.N)this.C.publish(b.N(),b.ia());this.N=[]}});a()})})}disconnect(){return new Promise(a=>this.C.end(!1,()=>a()))}publish(a){this.L.debug('Publishing on bus',
777
+ a);return this.F?(this.L.debug('Disconnected, storing message in queue'),this.N.push(a),Promise.resolve()):new Promise((b,c)=>{this.C.publish(a.N(),a.ia(),void 0,d=>d?c(d):b())})}Le(a,b,c){a=new olympe.H.wa.Jb.Response(a.source,this.G,a.G,b,c);return this.publish(a)}request(a,b,c){const d=this.U;this.U++;const e=olympe.D.Ya(rc(this.aa));a=new olympe.H.wa.Jb.Request(a,this.G,e,d,b,c);return this.publish(a).then(()=>d)}notify(a,b,c){const d=this.U;this.U++;a=new olympe.H.wa.Jb.Response(b,a,d,olympe.H.wa.Jb.Response.ja.vm,
778
+ c);return this.publish(a)}ka(a,b){b(new olympe.H.wa.Jb.Response(this.G,this.G,a,olympe.H.wa.Jb.Response.ja.cc,{reason:'Timeout'}))}};olympe.H.wa.Jb={};olympe.H.wa.Jb.Request=class{constructor(a,b,c,d,e,f){this.G=d;this.destination=a;this.source=b;this.U=c;this.C=e;this.F=f||null}N(){return this.destination}ed(){return this.U}ia(){return{dest:this.destination,src:this.source,seq:this.G,auth:this.U,type:this.C,content:this.F}}toString(){return JSON.stringify(this)}};olympe.H.wa.Jb.Request.ja={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3};olympe.H.wa.Jb.Response=class{constructor(a,b,c,d,e){this.G=c;this.destination=a;this.source=b;this.F=d;this.C=e||null}N(){return this.destination}ia(){return{dest:this.destination,src:this.source,seq:this.G,type:this.F,content:this.C}}toString(){return JSON.stringify(this)}};olympe.H.wa.Jb.Response.ja={vm:0,Gn:1,Xq:2,cc:3};olympe.H.wa.nb={};const gi=olympe.H.wa.Jb.Response.ja.Gn,hi=olympe.H.wa.Jb.Response.ja.cc,ii=olympe.H.wa.Jb.Response.ja.vm,ji=olympe.H.wa.Jb.Response.ja.Xq,ki=olympe.H.wa.Jb.Request.ja.SEND,li=olympe.H.wa.Jb.Request.ja.GET,mi=olympe.H.wa.Jb.Request.ja.PUBLISH,ni=olympe.H.wa.Jb.Request.ja.SUBSCRIBE;
779
+ olympe.H.wa.nb.zb=class{constructor(a,b){this.C=olympe.H.wa.Qc();this.F=a;this.G=new olympe.D.Wb(`Service ${a}`,'function'===typeof b.Ec?b.Ec():b);this.L=olympe.pa.Xa(`Service ${this.F}`)}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();ei(this.C,this.F).catch(c=>this.L.error('Failed to unsubscribe from '+this.F+', error: '+c))};this.G.onDestroy(b);this.C.connect().then(()=>{ci(this.C,this.F,c=>a.next(new olympe.H.wa.nb.ga(c,this.C)))}).catch(c=>this.L.error('Failed to connect to the bus: '+
780
+ c));return b})}stop(){this.G.destroy()}static publish(a,b){const c=olympe.H.wa.Qc();return c.connect().then(()=>c.request(a,mi,b)).then(()=>Promise.resolve())}static send(a,b){return new Promise((c,d)=>{const e=olympe.H.wa.Qc();e.connect().then(()=>e.request(a,ki,b)).then(f=>{di(e,f,g=>{switch(g.F){case gi:c();break;case hi:d(g.C.reason);break;default:d('Unsupported response type for a SEND request')}})}).catch(f=>d(f))})}static get(a,b){return new Promise((c,d)=>{const e=olympe.H.wa.Qc();e.connect().then(()=>
781
+ e.request(a,li,b)).then(f=>{di(e,f,g=>{switch(g.F){case ii:(g=g.C)?c(g):d('No payload after request to service: '+a);break;case hi:d(g.C.reason);break;default:d('Unsupported response type for a GET request')}})}).catch(f=>d(f))})}static observe(a,b,c){const d='function'===typeof b.Ec?b.Ec():b;return new rxjs.Observable(e=>{const f=olympe.H.wa.Qc();let g=null;const h=()=>{e.complete();g&&ei(f,g).catch(k=>olympe.pa.Xa('Service '+a).error('Failed to unsubscribe from a topic '+k))};d.vc(h);f.connect().then(()=>
782
+ f.request(a,ni,c)).then(k=>{di(f,k,l=>{switch(l.F){case ji:g=l.C.topic;ci(f,g,n=>{n.C===mi?e.next(n.F):(e.error('Unsupported notification message. It should be a publish'),h())});break;case hi:e.error(l.C.reason);break;default:e.error('Unsupported response type for a SUBSCRIBE request')}})}).catch(k=>e.error(k));return h})}};olympe.H.wa.nb.zb.observe=olympe.H.wa.nb.zb.observe;olympe.H.wa.nb.zb.get=olympe.H.wa.nb.zb.get;olympe.H.wa.nb.zb.send=olympe.H.wa.nb.zb.send;olympe.H.wa.nb.zb.publish=olympe.H.wa.nb.zb.publish;
783
+ olympe.H.wa.nb.zb.prototype.stop=olympe.H.wa.nb.zb.prototype.stop;olympe.H.wa.nb.zb.prototype.listen=olympe.H.wa.nb.zb.prototype.listen;const oi=olympe.H.wa.Jb.Response.ja.Gn,pi=olympe.H.wa.Jb.Response.ja.cc,qi=olympe.H.wa.Jb.Response.ja.vm,ri=olympe.H.wa.Jb.Response.ja.Xq,si=olympe.H.wa.Jb.Request.ja.SEND,ti=olympe.H.wa.Jb.Request.ja.GET,ui=olympe.H.wa.Jb.Request.ja.SUBSCRIBE;
784
+ olympe.H.wa.nb.ga=class{constructor(a,b){this.request=a;this.C=b}zj(){return fi(this.C,this.request)}source(){return this.request.source}body(){return this.request.F}Hk(){return this.request.C===si?this.C.Le(this.request,oi,void 0):Promise.reject('Should only call `ack` on SEND requests')}Le(a){return this.request.C===ti?this.C.Le(this.request,qi,a):Promise.reject('Should only call `reply` on GET requests')}Zr(a){return this.request.C===ui?this.C.Le(this.request,ri,{topic:a}):Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests')}xg(a){return this.C.Le(this.request,
785
+ pi,{reason:a.message})}};olympe.H.wa.nb.ga.prototype.fail=olympe.H.wa.nb.ga.prototype.xg;olympe.H.wa.nb.ga.prototype.notifyOn=olympe.H.wa.nb.ga.prototype.Zr;olympe.H.wa.nb.ga.prototype.reply=olympe.H.wa.nb.ga.prototype.Le;olympe.H.wa.nb.ga.prototype.ack=olympe.H.wa.nb.ga.prototype.Hk;olympe.H.wa.nb.ga.prototype.body=olympe.H.wa.nb.ga.prototype.body;olympe.H.wa.nb.ga.prototype.source=olympe.H.wa.nb.ga.prototype.source;olympe.H.wa.nb.ga.prototype.userTag=olympe.H.wa.nb.ga.prototype.zj;olympe.H.oa={};function vi(a,b,c,d){c.c=b;a.C.Y(olympe.H.Uc.mf,c,d)}
786
+ olympe.H.oa.Ta=class{constructor(a,b,c,d,e,f,g,h,k){this.L=a;this.C=b;this.F=h;this.ab=c;this.G=g;this.storage=k;const l=this.storage.C('AUTH');l&&(l.get('redirectTo',n=>{n&&(l.remove('redirectTo'),l.close(),this.F.redirect(n,null,olympe.auth.pk.C.GET))}),l.close())}U(a){this.C.Se(a)}N(a){this.C.Pf(a)}Sa(a){this.C.qe(olympe.H.Uc.mf,'logoutHandler');this.C.Da(olympe.H.Uc.mf,b=>{const c=b.c;c===olympe.H.oa.Ta.C.Wt?(this.C.Xb(),a(olympe.auth.sa.F.Aj,b)):c===olympe.H.oa.Ta.C.Hu&&a(olympe.auth.sa.F.ip,
787
+ b)},'logoutHandler')}Y(a,b){vi(this,olympe.H.oa.Ta.C.mf,{token:a.Kf()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.oa.Ta.C.cc:b(Error('Invalid token'));break;case olympe.H.oa.Ta.C.Ri:c=null;var e=d.payload;if(e){d=e.userName;const f=e.userTag,g=e.rndCook,h=e.payload,k=e.protocol;'SAML'===k?(e=e.samlToken,c=new olympe.auth.Eq(d,f,g,h),c.C=e):'openid'===k&&(c=new olympe.auth.em(d,f,g,h))}b(null,c);break;default:b(Error('Unknown response from server'))}})}ra(a,b){vi(this,olympe.H.oa.Ta.C.qt,
788
+ {I:a.Sd()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.oa.Ta.C.cc:b(Error(`Username '${a.Sd()}' invalid, or password does not match`));break;case olympe.H.oa.Ta.C.Pu:c=d.payload;b(null,c.S,c.B);break;default:b(Error('Unknown response from server'))}})}Da(a,b){vi(this,olympe.H.oa.Ta.C.ts,{A:a.get('a'),M:a.get('m1'),I:a.Sd()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.oa.Ta.C.cc:this.L.debug('Login failed, invalid username or password');b(Error('Invalid username or password'));
789
+ break;case olympe.H.oa.Ta.C.Ri:c=d.payload;this.L.debug('Login successful, creating token');d=c.payload?JSON.parse(c.payload):void 0;b(null,new olympe.auth.rf(c.userName,c.userTag,c.rndCook,d));break;default:b(Error(`Unknown response from server (type ${d.c})`))}})}ka(a){vi(this,olympe.H.oa.Ta.C.Pe,{},(b,c)=>{null!==b?a(b):c.url&&c.request?a(null,c.url,c.request.replace(/\s/g,''),c.id):a(Error('Missing parameters from server response'))})}aa(a){const b=olympe.D.Ya(olympe.auth.Qc().C.Eb())||null;if(b instanceof
790
+ olympe.auth.em){const c=e=>{const f=Object.create(null);f.url=e;f.olympe_token=b.Kf();f.access_token=b.Zj().access_token||null;this.F.redirect(`${this.G}/logout`,f)};a=this.F.C();const d=new URL(a);if(0!==d.hash.length||0!==d.search.length){const e=this.storage.C('AUTH');d.hash='';d.search='';e&&e.set('redirectTo',a,()=>{e.close();c(d.toString())})}else c(a)}else this.C.Y(olympe.H.Uc.mf,{c:olympe.H.oa.Ta.C.Xt},a)}ji(a){this.C.Y(olympe.H.Uc.mf,{c:olympe.H.oa.Ta.C.mg},a)}ph(a,b,c){this.C.zc(this.ab+
791
+ '/'+a,olympe.H.Uc.mf,b,!1,null,(d,e)=>{c(d,e)})}Pr(){return this.G}};olympe.H.oa.Ta.C={mf:1,Xt:2,cc:3,mg:5,Ri:6,qt:10,Pu:11,ts:12,Pe:13,Hu:14,Wt:20};olympe.H.oa.Ta.la=[olympe.auth.Ru,olympe.auth.Hb.oa.Ii,olympe.auth.Hb.oa.Ee,olympe.auth.Hb.oa.Pe];olympe.H.$={};olympe.H.$.Wc=function(){};olympe.H.$.Wc.prototype.ia=function(){};olympe.H.$.Ne=function(){};olympe.H.$.Ne.prototype.ia=function(){};olympe.H.$.$a=function(){};olympe.H.$.$a.prototype.ia=function(){};olympe.H.$.uf=function(){};olympe.H.$.uf.prototype.ia=function(){};olympe.H.$.gb=function(){this.X={};this.Db={};this.V={};this.na=Object.create(null);var a=new olympe.H.$.X.Qb;this.X[O(olympe.dc.X.Qb)]=a;a=new olympe.H.$.X.Be;this.X[O(olympe.dc.X.Be)]=a;a=new olympe.H.$.X.Dc;this.X[O(olympe.dc.X.Dc)]=a;this.X[O(olympe.dc.X.Kd)]=new olympe.H.$.X.Kd;this.X[O(olympe.dc.X.rc)]=new olympe.H.$.X.rc;this.X[O(olympe.dc.X.Zd)]=new olympe.H.$.X.Zd;this.X[O(olympe.dc.X.xe)]=new olympe.H.$.X.xe;a=new olympe.H.$.Db.Number;this.Db[O(olympe.dc.Db.Number)]=a;a=new olympe.H.$.Db.String;
792
+ this.Db[O(olympe.dc.Db.String)]=a;a=new olympe.H.$.V.Gc;this.V[O(olympe.dc.V.Gc)]=a;this.V[O(olympe.dc.V.ye)]=new olympe.H.$.V.ye;this.V[O(olympe.dc.V.Fe)]=new olympe.H.$.V.Fe;a=new olympe.H.$.V.Sc;this.V[O(olympe.dc.V.Sc)]=a;a=new olympe.H.$.V.xd;this.V[O(olympe.dc.V.xd)]=a;this.V[O(olympe.dc.V.kd)]=new olympe.H.$.V.kd;a=new olympe.H.$.V.hf;this.V[O(olympe.dc.V.hf)]=a;a=new olympe.H.$.V.jf;this.V[O(olympe.dc.V.jf)]=a;this.na[O(olympe.dc.na.Dd)]=new olympe.H.$.na.Dd;a=new olympe.H.$.na.ke;this.na[O(olympe.dc.na.ke)]=
793
+ a;a=new olympe.H.$.na.oe;this.na[O(olympe.dc.na.oe)]=a;a=new olympe.H.$.na.ue;this.na[O(olympe.dc.na.ue)]=a;a=new olympe.H.$.na.ie;this.na[O(olympe.dc.na.ie)]=a;this.na[O(olympe.dc.na.qf)]=new olympe.H.$.na.qf};olympe.H.$.gb.prototype.constructor=olympe.H.$.gb;function wi(a,b,c){var d=b.ma(),e=a.V[d];if(void 0===e)throw Error('No predicate registered for predicate: '+d);return e.ia(b,c,a)}
794
+ function xi(a,b,c){var d=b.ma(),e=a.na[d];if(void 0===e)throw Error('No valueDef registered for valueDef: '+d);return e.ia(b,c,a)}
795
+ function yi(a,b){return a&&a.vf?'"$'+b.add(a)+'"':a instanceof olympe.D.qa||a instanceof olympe.D.ea?String(a):a instanceof olympe.D.Wa?'"'+a+'"':a instanceof olympe.D.jb?(a=a.ms(),String(`{"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.Of().valueOf()+',"g":'+a.If().valueOf()+',"b":'+a.Df().valueOf()+',"a":'+a.Cf().valueOf()+
796
+ '}':a instanceof olympe.dc.Hc?'{"c":8,"t":"'+a.R()+'"}':JSON.stringify(a)};olympe.H.$.Tj=class{ia(a){const b=Object.create(null);b.i=a.Z();b.b=[a.C];b.m=!0;b.v=!0;b.f=a instanceof olympe.dc.query.Ol?Ye(a.qh):olympe.dc.Sb.NONE;b.q=pf(a).map(this.C.bind(this));return b}C(a){const b=a.Qd(),c=b.Oa()===olympe.dc.za.ORIGIN?olympe.H.$.X.Qb.C.Gi:olympe.H.$.X.Qb.C.Oi,d=Object.create(null);d.t=b.R();d.d=c;d.v=a.apply;d.r=b.recursive;d.q=a.jh().map(this.C.bind(this));return d}};olympe.H.$.X={};olympe.H.$.X.xe=class{ia(){return'{"y":15}'}};olympe.H.$.X.xe.la=[olympe.H.$.Wc];olympe.H.$.X.rc=function(){};olympe.H.$.X.rc.prototype.constructor=olympe.H.$.X.rc;olympe.H.$.X.rc.prototype.ia=function(a,b,c){return'{"y":21,"p":'+wi(c,a.C,b)+'}'};olympe.H.$.X.rc.la=[olympe.H.$.Wc];olympe.H.$.X.Be=function(){};olympe.H.$.X.Be.prototype.constructor=olympe.H.$.X.Be;olympe.H.$.X.Be.prototype.ia=function(a){var b=null!==a.Oa()?a.Oa()===olympe.dc.za.ORIGIN?olympe.H.$.X.Qb.C.Gi:olympe.H.$.X.Qb.C.Oi:olympe.H.$.X.Qb.C.Sn;return'{"y":12,"t":'+JSON.stringify(ah(a))+',"d":'+b+'}'};olympe.H.$.X.Be.la=[olympe.H.$.Wc];olympe.H.$.X.Dc=function(){};olympe.H.$.X.Dc.prototype.constructor=olympe.H.$.X.Dc;olympe.H.$.X.Dc.prototype.ia=function(a){const b=null!==a.Oa()?a.Oa()===olympe.dc.za.ORIGIN?olympe.H.$.X.Qb.C.Gi:olympe.H.$.X.Qb.C.Oi:olympe.H.$.X.Qb.C.Sn;return'{"y":11,"t":"'+a.R()+'","d":'+b+',"s":'+a.F+',"e":'+a.C+'}'};olympe.H.$.X.Dc.la=[olympe.H.$.Wc];olympe.H.$.X.Qb=function(){};olympe.H.$.X.Qb.C={Sn:0,Gi:1,Oi:2};olympe.H.$.X.Qb.prototype.constructor=olympe.H.$.X.Qb;olympe.H.$.X.Qb.prototype.ia=function(a){const b=a.Oa()===olympe.dc.za.ORIGIN?olympe.H.$.X.Qb.C.Gi:olympe.H.$.X.Qb.C.Oi;return'{"y":10,"t":"'+a.R()+'","d":'+b+'}'};olympe.H.$.X.Qb.la=[olympe.H.$.Wc];olympe.H.$.X.Kd=function(){};olympe.H.$.X.Kd.prototype.constructor=olympe.H.$.X.Kd;olympe.H.$.X.Kd.prototype.ia=function(a,b,c){var d=a.Md;const e=d.ma();var f=c.Db[e];if(void 0===f)throw Error('No comparator registered for comparator: '+e);return'{"y":20,"o":'+f.ia(d,b,c)+(a.C?'':',"a":false')+'}'};olympe.H.$.X.Kd.la=[olympe.H.$.Wc];olympe.H.$.X.Zd=function(){};olympe.H.$.X.Zd.prototype.constructor=olympe.H.$.X.Zd;olympe.H.$.X.Zd.prototype.ia=function(a,b){var c=a.start;c=c&&c.vf?'"$'+b.add(c)+'"':JSON.stringify(c);a=(a=a.C)&&a.vf?'"$'+b.add(a)+'"':JSON.stringify(a);return'{"y":22,"s":'+c+',"n":'+a+'}'};olympe.H.$.X.Zd.la=[olympe.H.$.Wc];olympe.H.$.Db={};olympe.H.$.Db.Number=class{constructor(){}ia(a,b,c){return`{"y":11,"v":${xi(c,a.C,b)}}`}};olympe.H.$.Db.Number.la=[olympe.H.$.Ne];olympe.H.$.Db.String=class{constructor(){}ia(a,b,c){return`{"y":10,"v":${xi(c,a.C,b)}}`}};olympe.H.$.Db.String.la=[olympe.H.$.Ne];olympe.H.$.V={};olympe.H.$.V.Sc=function(){};olympe.H.$.V.Sc.prototype.constructor=olympe.H.$.V.Sc;olympe.H.$.V.Sc.prototype.ia=function(a,b,c){const d=xi(c,a.source,b);c=xi(c,a.getValue(),b);a=yi(a.G,b);return'{"y":20,"s":'+d+',"v":'+c+',"a":'+a+'}'};olympe.H.$.V.Sc.la=[olympe.H.$.$a];olympe.H.$.V.Gc=function(){};olympe.H.$.V.Gc.prototype.constructor=olympe.H.$.V.Gc;olympe.H.$.V.Gc.prototype.ia=function(a,b,c){const d=xi(c,a.G,b);a=xi(c,a.N,b);return'{"y":10,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.Gc.la=[olympe.H.$.$a];olympe.H.$.V.ye=function(){};olympe.H.$.V.ye.prototype.constructor=olympe.H.$.V.ye;olympe.H.$.V.ye.prototype.ia=function(a,b,c){const d=xi(c,a.G,b);a=xi(c,a.N,b);return'{"y":11,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.ye.la=[olympe.H.$.$a];olympe.H.$.V.hf=class{ia(a){const b=Vg(a).map(d=>'"'+d+'"'),c=Wg(a).map(d=>d===olympe.dc.za.DESTINATION?'2':'1');a=a.G;return'{"y":81,"r":['+b.toString()+'],"d":['+c.toString()+']'+(0!==a.length?',"t":"'+a.toString()+'"':'')+'}'}};olympe.H.$.V.hf.la=[olympe.H.$.$a];olympe.H.$.V.jf=class{ia(a){return'{"y":80,"m":['+Array.from(a.G).map(b=>'"'+b+'"').toString()+']}'}};olympe.H.$.V.jf.la=[olympe.H.$.$a];olympe.H.$.V.kd=class{ia(a,b,c){return'{"y":30,"p":'+wi(c,a.G,b)+'}'}};olympe.H.$.V.kd.la=[olympe.H.$.$a];olympe.H.$.V.xd=class{ia(a,b,c){c=xi(c,a.source,b);const d=a.N;a=yi(a.G,b);return'{"y":23,"s":'+c+',"r":"'+d+'","a":'+a+'}'}};olympe.H.$.V.xd.la=[olympe.H.$.$a];olympe.H.$.V.Fe=function(){};olympe.H.$.V.Fe.prototype.constructor=olympe.H.$.V.Fe;olympe.H.$.V.Fe.prototype.ia=function(a,b,c){var d=xi(c,a.G,b);a=xi(c,a.N,b);return'{"y":12,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.Fe.la=[olympe.H.$.$a];olympe.H.$.na={};olympe.H.$.na.Lc=function(){};olympe.H.$.na.Lc.prototype.constructor=olympe.H.$.na.Lc;olympe.H.$.na.Lc.prototype.C=function(){};
797
+ olympe.H.$.na.Lc.prototype.ia=function(a,b,c){var d=yi(a.Ze,b),e=a.Od();e=e?',"b":'+yi(e,b):'';if(a=a.Bg()){var f='[';for(let n=0,p=a.length;n<p;n++){var g=0===n?'':',';var h=c;var k=a[n],l=b;const q=k.ma(),r=h.X[q];if(void 0===r)throw Error('No serializer registered for transformer: '+q);h=r.ia(k,l,h);f+=g+h}b=',"q":'+(f+']')}else b='';return'{"y":'+this.C()+',"t":'+d+e+b+'}'};olympe.H.$.na.Lc.la=[olympe.H.$.uf];olympe.H.$.na.ue=function(){olympe.H.$.na.Lc.call(this)};olympe.H.$.na.ue.prototype=Object.create(olympe.H.$.na.Lc.prototype);olympe.H.$.na.ue.prototype.constructor=olympe.H.$.na.ue;olympe.H.$.na.ue.prototype.C=function(){return 13};olympe.H.$.na.Dd=class{ia(a,b){return'{"y":10,"v":'+yi(a.value,b)+'}'}};olympe.H.$.na.Dd.la=[olympe.H.$.uf];olympe.H.$.na.ie=function(){olympe.H.$.na.Lc.call(this)};olympe.H.$.na.ie.prototype=Object.create(olympe.H.$.na.Lc.prototype);olympe.H.$.na.ie.prototype.constructor=olympe.H.$.na.ie;olympe.H.$.na.ie.prototype.C=function(){return 14};olympe.H.$.na.ke=function(){olympe.H.$.na.Lc.call(this)};olympe.H.$.na.ke.prototype=Object.create(olympe.H.$.na.Lc.prototype);olympe.H.$.na.ke.prototype.constructor=olympe.H.$.na.ke;olympe.H.$.na.ke.prototype.C=function(){return 11};olympe.H.$.na.oe=function(){olympe.H.$.na.Lc.call(this)};olympe.H.$.na.oe.prototype=Object.create(olympe.H.$.na.Lc.prototype);olympe.H.$.na.oe.prototype.constructor=olympe.H.$.na.oe;olympe.H.$.na.oe.prototype.C=function(){return 12};olympe.H.$.na.qf=class{ia(){return'{"y":19}'}};olympe.H.$.na.qf.la=[olympe.H.$.uf];olympe.H.sd={};function zi(a,b){a.L.info('Initializing SERVER layer');if(a.L.G()){const c=['Server layer parameters:'];b.forEach((d,e)=>{c.push(e+'="'+d+'"')});a.L.debug(c.join('\n\t'))}a.Da(olympe.H.Uc.cc,c=>{switch(c.c){case olympe.H.ja.bv:a.L.error('Unknown message sent to the server:',olympe.H.sa.F[c.s]);break;case olympe.H.ja.ct:a.L.error('Fatal error, the last message is probably too big according to the websocket config.'),a.C.forEach((d,e)=>{null!==d.zn&&Ai(a,e,c.i)})}});b.get('autoConnect')&&(a.L.debug('Connecting automatically'),
798
+ a.connect());olympe.D.hn(a.U.Eb(),()=>{a.Qf.forEach(c=>c());Jb(a.ii.bind(a),a.Ix);Jb(a.He.bind(a),a.Af)},()=>{a.aa=null;a.Bf.forEach(c=>c(a.G[2]));a.He()});a.L.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}
799
+ function Bi(a,b){if(a.F!==b)switch(a.L.debug('State change '+a.F+' --\x3e '+b),a.F=b,b){case olympe.H.sa.C.CONNECTING:break;case olympe.H.sa.C.ti:a.U.update(olympe.D.qa.F);break;case olympe.H.sa.C.Wg:a.G[0]=0;a.G[1]=0;a.connect();break;case olympe.H.sa.C.cc:a.L.error('Connection to server',a.ra.C(),'aborted due to error');a.U.update(olympe.D.qa.C);break;case olympe.H.sa.C.fg:a.U.update(olympe.D.qa.C);a.Ab&&(a.L.info('Disconnected, will try to auto reconnect in',a.fc,'ms'),Ib(()=>{a.connect()},a.fc));
797
800
  break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}
798
- function yi(a,b){const c=olympe.H.sa.N.Si,d=olympe.H.sa.N.iu;return e=>{if(null!==e&&void 0!==e){var f=null,g=e.s;if(g===d)a.L.debug(`Try to unsubscribe multiple times. This could be because you logged out before unsubscribe. ${e.info.error.reason}`);else if(void 0!==g&&g!==c){f=void 0!==olympe.H.sa.F[g]?`Status code = ${g} [${olympe.H.sa.F[g]}]`:`Status code = ${g}`;g=e.info;if(void 0!==g&&void 0!==g.error){var h=g.error.reason;'string'===typeof h&&0<h.length&&(f+=`\nReason:\n${g.error.reason}`);
799
- h=g.error.detailedReason;'string'===typeof h&&0<h.length&&(f+=`\nDetails:\n${g.error.detailedReason}`)}f=Error('Rejected by orchestrator:\n'+f)}b(f,e)}}}function zi(a,b,c){var d=c.message;a.L.G()&&a.L.debug('>',Ai(d));(d=a.N.send(JSON.stringify(d)))?null===c.Yh?a.F.delete(b):c.Fn=Date.now():xi(a,olympe.H.sa.C.Yg);return d}
800
- function Ai(a){var b=JSON.parse(JSON.stringify(a));a=olympe.W.Sr;const c=b.messageFamily,d=a(olympe.H.Uc,c),e=b.payload;b='';switch(c){case olympe.H.Uc.vi:b=a(olympe.dc.ga.ja,e.c);break;case olympe.H.Uc.qc:b=a(olympe.H.ja,e.c);break;case olympe.H.Uc.pf:b=a(olympe.H.oa.Ta.C,e.c);break;case olympe.H.Uc.Ei:2===e.c&&(b=a(olympe.H.sa.G,e.status))}a=`${d} message`;b&&0<b.length&&(a+=` with payload "${b}"`);return a}
801
- function wi(a,b,c){if(a.F.has(b)){const {Yh:d}=a.F.get(b);a.F.delete(b);d&&d({s:23,info:c})}}function Bi(a,b){a.L.error(b);xi(a,olympe.H.sa.C.qc)}function Ci(a,b,c){a.L.info('Connected to',a.ra.C(),' | ',b?'server version:'+b:'',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.F).sort(([d],[e])=>d-e);for(const [d,e]of b)if(!zi(a,d,e))return;xi(a,olympe.H.sa.C.ui)}
802
- olympe.H.sd.sa=class{constructor(a,b,c,d){this.L=a;this.ce=b;this.ra=c;this.N=null;this.config=d;this.cc=this.config.get('reconnectionDelay');this.Yx=this.config.get('pingInterval');this.by=this.cc/2;this.Ab=d.get('autoConnect');this.cy=d.get('retryHttpOverload');this.He=d.get('messageTimeout');this.ka=Ka(d.get('clientVersion'));this.ab=Ka(d.get('serverVersion'));this.C=olympe.H.sa.C.INIT;this.Xc=d.get('getContextMode');this.wh=1;this.aa=null;this.G=[0,0,0];this.Sa=new Map;this.V=olympe.D.Kc(olympe.D.qa,
803
- 'Server is online');this.Xf=new Map;this.Pf=new Map;this.F=new Map;this.Nx=new Map;vi(this,d)}bb(){return this.C===olympe.H.sa.C.ui}connect(){const a=olympe.H.sa.C.CONNECTING,b=olympe.H.sa.C.ui,c=olympe.H.sa.C.hg,d=olympe.H.sa.C.Yg,e=olympe.H.sa.C.qc;null!==this.N&&(this.N.V(null),this.N.close());this.Ab=!0;this.L.log(`Asking NET layer for a connection to ${Lb(this.ra)}:${this.ra.port}...`);this.N=this.ce.aa(this.ra);this.N.ka(this.Xb.bind(this));this.N.aa(this.Nd.bind(this));this.N.V(()=>{this.N=
804
- null;this.C===b?xi(this,d):this.C!==e&&xi(this,c)});this.C!==d&&xi(this,a)}disconnect(){const a=olympe.H.sa.C.CONNECTING;if(this.C===olympe.H.sa.C.ui||this.C===a)this.Ab=!1,xi(this,olympe.H.sa.C.hg)}Qf(a){const b=olympe.W.lc();this.Xf.set(b,a);olympe.D.Ya(this.V)===olympe.D.qa.F&&a()}Wf(a){var b;void 0===b&&(b=olympe.W.lc());this.Pf.set(b,a);olympe.D.Ya(this.V)===olympe.D.qa.C&&a(this.G[1])}Xb(){this.L.debug('Websocket connected, sending handshake. Client version:',La(this.ka),'subscribeEverything:',
805
- this.Xc?'NO':'YES');this.Z(olympe.H.Uc.Ei,{c:olympe.H.ja.Ei,cv:La(this.ka),m:this.Xc?0:1,s:this.aa},this.Fx.bind(this))}Z(a,b,c){const d=this.wh;this.wh++;b={message:{seqId:d,messageFamily:a,payload:b},Yh:c?yi(this,c):null,Fn:null};this.F.set(d,b);c=[olympe.H.sa.C.CONNECTING,olympe.H.sa.C.Yg];(this.bb()||a===olympe.H.Uc.Ei&&c.includes(this.C))&&zi(this,d,b)}zc(a,b,c,d,e,f){c&&''!==c||this.L.warn('Trying to send an http request with an invalid authorizationToken');const g=Ob(a);if(e){g.method=olympe.net.eb.ae.mm;
806
- e=d?e:{messageFamily:b,seqId:1,payload:e};const k=JSON.stringify(e);g.body=k;Pb(g,{'Content-Type':'application/json'});this.L.log('HTTP POST >',Ai(e))}else this.L.log('HTTP GET call to',a);g.F=olympe.net.eb.ResponseType.zk;Pb(g,{Authorization:c});const h=()=>{this.ce.C(g,k=>{switch(k.Rd()){case olympe.net.eb.od.Lh:case olympe.net.eb.od.zl:case olympe.net.eb.od.Dj:k=k.getData();if(b!==olympe.H.Uc.vi||d){f&&f(null,k);break}k=this.Nd(k);f&&f(k);k&&this.L.error(k.message);break;case olympe.net.eb.od.Mu:Ib(h,
807
- this.cy);break;case olympe.net.eb.od.Gs:this.L.debug(`HTTP request canceled (${a}).`);f&&f(null);break;default:k=Error(`Server is currently not available, http status: ${k.Rd()}`),f&&f(k)}})};h()}Da(a,b,c){void 0===c&&(c=olympe.W.lc());let d=this.Sa.get(a);void 0===d&&(d=new Map,this.Sa.set(a,d));d.set(c,b)}qe(a,b){a=this.Sa.get(a);void 0!==a&&a.delete(b)}Fx(a,b){if(a)Bi(this,'Error in receiving handshake response: '+a.message);else{this.L.debug('Handshake response received');var c=olympe.H.sa.G;
808
- a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.zt:Bi(this,`Framework version (${La(this.ka)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);return;case c.Yu:Bi(this,`Framework version (${La(this.ka)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.mt:Bi(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.ab.qb(olympe.W.Vh.C))this.L.warn('Handshake successful but received server version',
809
- a,'is invalid. Cannot check against it');else try{var e=Ka(a);if(e.zj(this.ab)){Bi(this,`Framework v${La(this.ka)} is expecting Orchestrator to be at least in v${La(this.ab)}`);return}this.L.log('Handshake successful. Orchestrator version: ',e,'required:',La(this.ab))}catch(f){Bi(this,f);return}e=olympe.H.sa.C.hg;if(this.C===olympe.H.sa.C.Yg&&null!==this.aa&&this.aa!==b.sessionId)this.L.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),xi(this,
810
- e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.Nx.set(f,g);this.aa=b.sessionId||null;Ci(this,a,d)}}}ji(){this.G[0]-this.G[1]>this.by?(this.L.debug('Ping did not get answer, try to reconnect'),xi(this,olympe.H.sa.C.Yg)):(this.L.debug('Sending Ping'),this.G[0]=Date.now(),this.N.send('ping')||(this.L.debug('Impossible to send ping, try to reconnect'),xi(this,olympe.H.sa.C.Yg)))}Nd(a){this.G[2]=Date.now();if(a.startsWith('pong'))return this.G[1]=this.G[2],null;try{var b=JSON.parse(a)}catch(d){return this.L.error('Unable to parse response from server: '+
811
- d.toString()),Error('Unable to parse response from server')}this.L.G()&&this.L.debug('<',Ai(b));a=b.seqId;const c=b.messageFamily;b=b.payload;if(this.F.has(a)){const {Yh:d}=this.F.get(a);this.F.delete(a);d&&d(b)}a=this.Sa.get(c);if(void 0!==a)for(const d of a.values())d(b);return null}Ve(){const a=Date.now();for(const [b,{Fn:c}]of this.F)null!==c&&a-c>this.He&&(this.L.warn(`No response was received from the server for the seqId = ${b}`),wi(this,b,{error:{reason:'Message timeout: never receive acknowledge'}}))}};
812
- olympe.H.sa.N={Si:0,iu:18,Xz:23};
801
+ function Ci(a,b){const c=olympe.H.sa.N.Ri,d=olympe.H.sa.N.fu;return e=>{if(null!==e&&void 0!==e){var f=null,g=e.s;if(g===d)a.L.debug(`Try to unsubscribe multiple times. This could be because you logged out before unsubscribe. ${e.info.error.reason}`);else if(void 0!==g&&g!==c){f=void 0!==olympe.H.sa.F[g]?`Status code = ${g} [${olympe.H.sa.F[g]}]`:`Status code = ${g}`;g=e.info;if(void 0!==g&&void 0!==g.error){var h=g.error.reason;'string'===typeof h&&0<h.length&&(f+=`\nReason:\n${g.error.reason}`);
802
+ h=g.error.detailedReason;'string'===typeof h&&0<h.length&&(f+=`\nDetails:\n${g.error.detailedReason}`)}f=Error('Rejected by orchestrator:\n'+f)}b(f,e)}}}function Di(a,b,c){var d=c.message;a.L.G()&&a.L.debug('>',Ei(d));(d=a.N.send(JSON.stringify(d)))?null===c.Xh?a.C.delete(b):c.zn=Date.now():Bi(a,olympe.H.sa.C.Wg);return d}
803
+ function Ei(a){var b=JSON.parse(JSON.stringify(a));a=olympe.W.Mr;const c=b.messageFamily,d=a(olympe.H.Uc,c),e=b.payload;b='';switch(c){case olympe.H.Uc.ui:b=a(olympe.dc.ga.ja,e.c);break;case olympe.H.Uc.cc:b=a(olympe.H.ja,e.c);break;case olympe.H.Uc.mf:b=a(olympe.H.oa.Ta.C,e.c);break;case olympe.H.Uc.Di:2===e.c&&(b=a(olympe.H.sa.G,e.status))}a=`${d} message`;b&&0<b.length&&(a+=` with payload "${b}"`);return a}
804
+ function Ai(a,b,c){if(a.C.has(b)){const {Xh:d}=a.C.get(b);a.C.delete(b);d&&d({s:23,info:c})}}function Fi(a,b){a.L.error(b);Bi(a,olympe.H.sa.C.cc)}function Gi(a,b,c){a.L.info('Connected to',a.ra.C(),' | ',b?'server version:'+b:'',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.C).sort(([d],[e])=>d-e);for(const [d,e]of b)if(!Di(a,d,e))return;Bi(a,olympe.H.sa.C.ti)}
805
+ olympe.H.sd.sa=class{constructor(a,b,c,d){this.L=a;this.be=b;this.ra=c;this.N=null;this.config=d;this.fc=this.config.get('reconnectionDelay');this.Ix=this.config.get('pingInterval');this.Qx=this.fc/2;this.Ab=d.get('autoConnect');this.ay=d.get('retryHttpOverload');this.Af=d.get('messageTimeout');this.ka=Ka(d.get('clientVersion'));this.ab=Ka(d.get('serverVersion'));this.F=olympe.H.sa.C.INIT;this.Xc=d.get('getContextMode');this.th=1;this.aa=null;this.G=[0,0,0];this.Sa=new Map;this.U=olympe.D.Kc(olympe.D.qa,
806
+ 'Server is online');this.Qf=new Map;this.Bf=new Map;this.C=new Map;this.Cx=new Map;zi(this,d)}bb(){return this.F===olympe.H.sa.C.ti}connect(){const a=olympe.H.sa.C.CONNECTING,b=olympe.H.sa.C.ti,c=olympe.H.sa.C.fg,d=olympe.H.sa.C.Wg,e=olympe.H.sa.C.cc;null!==this.N&&(this.N.U(null),this.N.close());this.Ab=!0;this.L.log(`Asking NET layer for a connection to ${Lb(this.ra)}:${this.ra.port}...`);this.N=this.be.aa(this.ra);this.N.ka(this.Xb.bind(this));this.N.aa(this.Ld.bind(this));this.N.U(()=>{this.N=
807
+ null;this.F===b?Bi(this,d):this.F!==e&&Bi(this,c)});this.F!==d&&Bi(this,a)}disconnect(){const a=olympe.H.sa.C.CONNECTING;if(this.F===olympe.H.sa.C.ti||this.F===a)this.Ab=!1,Bi(this,olympe.H.sa.C.fg)}Se(a){const b=olympe.W.nc();this.Qf.set(b,a);olympe.D.Ya(this.U)===olympe.D.qa.F&&a()}Pf(a){var b;void 0===b&&(b=olympe.W.nc());this.Bf.set(b,a);olympe.D.Ya(this.U)===olympe.D.qa.C&&a(this.G[1])}Xb(){this.L.debug('Websocket connected, sending handshake. Client version:',La(this.ka),'subscribeEverything:',
808
+ this.Xc?'NO':'YES');this.Y(olympe.H.Uc.Di,{c:olympe.H.ja.Di,cv:La(this.ka),m:this.Xc?0:1,s:this.aa},this.ux.bind(this))}Y(a,b,c){const d=this.th;this.th++;b={message:{seqId:d,messageFamily:a,payload:b},Xh:c?Ci(this,c):null,zn:null};this.C.set(d,b);c=[olympe.H.sa.C.CONNECTING,olympe.H.sa.C.Wg];(this.bb()||a===olympe.H.Uc.Di&&c.includes(this.F))&&Di(this,d,b)}zc(a,b,c,d,e,f){c&&''!==c||this.L.warn('Trying to send an http request with an invalid authorizationToken');const g=Ob(a);if(e){g.method=olympe.net.eb.$d.hm;
809
+ e=d?e:{messageFamily:b,seqId:1,payload:e};const k=JSON.stringify(e);g.body=k;Pb(g,{'Content-Type':'application/json'});this.L.log('HTTP POST >',Ei(e))}else this.L.log('HTTP GET call to',a);g.F=olympe.net.eb.ResponseType.vk;Pb(g,{Authorization:c});const h=()=>{this.be.C(g,k=>{switch(k.Rd()){case olympe.net.eb.od.Kh:case olympe.net.eb.od.vl:case olympe.net.eb.od.Aj:k=k.getData();if(b!==olympe.H.Uc.ui||d){f&&f(null,k);break}k=this.Ld(k);f&&f(k);k&&this.L.error(k.message);break;case olympe.net.eb.od.Ju:Ib(h,
810
+ this.ay);break;case olympe.net.eb.od.Bs:this.L.debug(`HTTP request canceled (${a}).`);f&&f(null);break;default:k=Error(`Server is currently not available, http status: ${k.Rd()}`),f&&f(k)}})};h()}Da(a,b,c){void 0===c&&(c=olympe.W.nc());let d=this.Sa.get(a);void 0===d&&(d=new Map,this.Sa.set(a,d));d.set(c,b)}qe(a,b){a=this.Sa.get(a);void 0!==a&&a.delete(b)}ux(a,b){if(a)Fi(this,'Error in receiving handshake response: '+a.message);else{this.L.debug('Handshake response received');var c=olympe.H.sa.G;
811
+ a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.wt:Fi(this,`Framework version (${La(this.ka)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);return;case c.Vu:Fi(this,`Framework version (${La(this.ka)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.jt:Fi(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.ab.qb(olympe.W.Uh.C))this.L.warn('Handshake successful but received server version',
812
+ a,'is invalid. Cannot check against it');else try{var e=Ka(a);if(e.xj(this.ab)){Fi(this,`Framework v${La(this.ka)} is expecting Orchestrator to be at least in v${La(this.ab)}`);return}this.L.log('Handshake successful. Orchestrator version: ',e,'required:',La(this.ab))}catch(f){Fi(this,f);return}e=olympe.H.sa.C.fg;if(this.F===olympe.H.sa.C.Wg&&null!==this.aa&&this.aa!==b.sessionId)this.L.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),Bi(this,
813
+ e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.Cx.set(f,g);this.aa=b.sessionId||null;Gi(this,a,d)}}}ii(){this.G[0]-this.G[1]>this.Qx?(this.L.debug('Ping did not get answer, try to reconnect'),Bi(this,olympe.H.sa.C.Wg)):(this.L.trace('Sending Ping'),this.G[0]=Date.now(),this.N.send('ping')||(this.L.debug('Impossible to send ping, try to reconnect'),Bi(this,olympe.H.sa.C.Wg)))}Ld(a){this.G[2]=Date.now();if(a.startsWith('pong'))return this.G[1]=this.G[2],null;try{var b=JSON.parse(a)}catch(d){return this.L.error('Unable to parse response from server: '+
814
+ d.toString()),Error('Unable to parse response from server')}this.L.G()&&this.L.debug('<',Ei(b));a=b.seqId;const c=b.messageFamily;b=b.payload;if(this.C.has(a)){const {Xh:d}=this.C.get(a);this.C.delete(a);d&&d(b)}a=this.Sa.get(c);if(void 0!==a)for(const d of a.values())d(b);return null}He(){const a=Date.now();for(const [b,{zn:c}]of this.C)null!==c&&a-c>this.Af&&(this.L.warn(`No response was received from the server for the seqId = ${b}`),Ai(this,b,{error:{reason:'Message timeout: never receive acknowledge'}}))}};
815
+ olympe.H.sa.N={Ri:0,fu:18,$z:23};
813
816
  olympe.H.sa.F={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',18:'Try to unsubscribe multiple times',
814
- 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.H.sd.sa.la=[olympe.H.sa];olympe.H.O={va:'server.Manager',ao:'server.bus.Manager',Ea:'server.Logger',Jd:'server.Source',Rg:'server.FileSource',vp:'server.ImportFileSvcHttpRequest',Xn:'server.BackupSvcHttpRequest',gq:'server.OpenIDSvcHttpRequest',Xo:'server.GetContextSvcPathRequest',sp:'server.ImplicitGDSvcPathRequest',Jo:'server.ExplicitGDSvcPathRequest',dr:'server.TransactionOverHttpPathRequest',qr:'server.UserTokenRequest',mr:'server.UserTagRequest',kr:'server.UserRolesRequest',Gq:'server.RoleMembersRequest',Fh:'server.IOUrlsProvider',
815
- Po:'server.fileSvcUrl',mq:'communication.peerFileSvcUrl'};olympe.H.td={oi:'server.connectors.Auth',CA:'server.connectors.Signaling'};
816
- olympe.H.Config={vd:'server.host',Id:'server.port',yd:'server.ssl',On:'server.autoConnect',zq:'server.reconnectionDelay',qq:'server.pingInterval',Cm:'server.messageTimeout',Eq:'server.retryHttpOnOverload',jo:'server.clientVersion',Mq:'server.serverVersion',$n:'bus.host',bo:'bus.path',co:'bus.port',eo:'bus.vhost',og:'bus.keepalive',Hu:'bus.reschedulePings',Ks:'bus.clientId',Is:'bus.clean',Du:'bus.reconnectPeriod',Ms:'bus.connectTimeout',ir:'bus.username',kq:'bus.password',zu:'bus.queueQoSZero'};
817
- olympe.H.ob={Cd:'server.basePath',ur:'server.wsPath',No:'server.filePath',up:'server.importFilePath',Wn:'server.backupSvcPath',fq:'server.openIDSvcPath',Wo:'server.GetContextSvcPath',tp:'server.ImplicitGraphdefSvcPath',Ko:'server.ExplicitGraphdefSvcPath',cr:'server.TransactionOverHttpPath',nr:'server.userTokenSvcPath',lr:'server.userTagPath',jr:'server.userRolesPath',Fq:'server.roleMembersPath',lm:'communication.peerFileSvcPath'};
818
- olympe.T.config(function(a){var b='object'===typeof window&&window.location&&window.location.hostname||'localhost';const c='localhost'===b;E(a,olympe.H.Config.vd,b);E(a,olympe.H.Config.Id,c?8080:443);E(a,olympe.H.Config.yd,'localhost'!==b);E(a,olympe.H.ob.Cd,'OlympeServer');E(a,olympe.H.ob.ur,'websocket');E(a,olympe.H.ob.No,'rest/filesvc');E(a,olympe.H.ob.up,'rest/importsvc');E(a,olympe.H.ob.Wn,'rest/backupsvc');E(a,olympe.H.ob.fq,'rest/openid');E(a,olympe.H.ob.Wo,'rest/initialData');E(a,olympe.H.ob.tp,
819
- 'rest/querysvc/graphDefImplicit');E(a,olympe.H.ob.Ko,'rest/querysvc/graphDefExplicit');E(a,olympe.H.ob.cr,'rest/transaction');E(a,olympe.H.ob.nr,'rest/token');E(a,olympe.H.ob.lr,'rest/authorization/getUserTag');E(a,olympe.H.ob.jr,'rest/authorization/getUserRoles');E(a,olympe.H.ob.Fq,'rest/authorization/roleMembers');E(a,olympe.H.Config.On,!0);E(a,olympe.H.Config.zq,5E3);E(a,olympe.H.Config.qq,5E3);E(a,olympe.H.Config.Cm,15E3);E(a,olympe.H.Config.Eq,5E3);E(a,olympe.H.Config.Mq,'6.3.0');E(a,olympe.H.Config.$n,
820
- '');E(a,olympe.H.Config.bo,c?'':'/mqtt');E(a,olympe.H.Config.co,c?15675:443);E(a,olympe.H.Config.eo,c?'/':'');E(a,olympe.H.Config.ir,'guest');E(a,olympe.H.Config.kq,'guest');E(a,olympe.H.Config.og,30);E(a,olympe.H.ob.lm,'nodes/files');b=a.getParameter(olympe.Gg.Config.To);if(void 0!==b)ua(a,b);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');C(a,olympe.H.O.Ea,[olympe.pa.O.va],d=>d.Nc('communication'));C(a,'server.WebSocketRequest',[new olympe.T.fa(olympe.H.Config.vd),
821
- new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.ur)],(d,e,f,g,h)=>new olympe.net.Gk(d,e,(g+'/'+h).replace(/\/+/g,'/').replace(/\/$/,''),f));b=(d,e,f,g,h)=>(new olympe.net.Zj(d,e,`${g}${h?'/'+h:''}`.replace(/\/+/g,'/').replace(/\/$/,''),f)).C();C(a,olympe.H.O.vp,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.up)],
822
- b);C(a,olympe.H.O.Xn,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Wn)],b);C(a,olympe.H.O.gq,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.fq)],b);C(a,olympe.H.O.Xo,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),
823
- new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Wo)],b);C(a,olympe.H.O.sp,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.tp)],b);C(a,olympe.H.O.Jo,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Ko)],b);C(a,olympe.H.O.dr,[new olympe.T.fa(olympe.H.Config.vd),
824
- new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.cr)],b);C(a,olympe.H.O.qr,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.nr)],b);C(a,olympe.H.O.mr,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.lr)],
825
- b);C(a,olympe.H.O.kr,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.jr)],b);C(a,olympe.H.O.Gq,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Fq)],b);C(a,olympe.H.O.Po,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),
826
- new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.No)],b);C(a,olympe.H.O.mq,[new olympe.T.fa(olympe.net.Config.Nl),new olympe.T.fa(olympe.net.Config.Ol),new olympe.T.fa(olympe.net.Config.mp),new olympe.T.fa(olympe.H.ob.lm)],b);C(a,'server.ManagerConfig',[new olympe.T.fa(olympe.H.Config.On),new olympe.T.fa(olympe.H.Config.zq),new olympe.T.fa(olympe.H.Config.qq),new olympe.T.fa(olympe.H.Config.Cm),new olympe.T.fa(olympe.H.Config.jo),new olympe.T.fa(olympe.H.Config.Mq),new olympe.T.fa(olympe.dc.Config.$g),
827
- new olympe.T.fa(olympe.H.Config.Eq)],(...d)=>{const e='autoConnect reconnectionDelay pingInterval messageTimeout clientVersion serverVersion getContextMode retryHttpOverload'.split(' '),f=new Map;d.forEach((g,h)=>f.set(e[h],g));return f});C(a,'server.bus.ManagerConfig',[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.$n),new olympe.T.fa(olympe.H.Config.bo),new olympe.T.fa(olympe.H.Config.co),new olympe.T.fa(olympe.H.Config.eo),new olympe.T.fa(olympe.H.Config.ir),new olympe.T.fa(olympe.H.Config.yd),
828
- new olympe.T.fa(olympe.H.Config.og),new olympe.T.fa(olympe.H.Config.Hu),new olympe.T.fa(olympe.H.Config.Ks),new olympe.T.fa(olympe.H.Config.Is),new olympe.T.fa(olympe.H.Config.Du),new olympe.T.fa(olympe.H.Config.Ms),new olympe.T.fa(olympe.H.Config.kq),new olympe.T.fa(olympe.H.Config.zu),new olympe.T.fa(olympe.H.Config.Cm)],(d,e,f,g,h,k,l,...n)=>{e=`${l?'wss://':'ws://'}${e||d}:${g}${f}/ws`;const p='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout password queueQoSZero messageTimeout'.split(' ');
829
- n=n.reduce((q,r,t)=>{q[p[t]]=r;return q},{});n.username=`${h||d.split('.')[0]}:${k}`;d=new Map;d.set('url',e);d.set('connectionOptions',n);return d});B(a,olympe.H.O.va,olympe.H.sd.sa,olympe.H.O.Ea,olympe.net.O.va,'server.WebSocketRequest','server.ManagerConfig');B(a,olympe.H.td.oi,olympe.H.oa.Ta,olympe.H.O.Ea,olympe.H.O.va,olympe.H.O.qr,olympe.H.O.mr,olympe.H.O.kr,olympe.H.O.Gq,olympe.H.O.gq,olympe.auth.O.pk,olympe.hc.O.dk);B(a,olympe.H.O.ao,olympe.H.wa.sa,olympe.H.O.Ea,olympe.net.O.va,olympe.auth.O.va,
830
- 'server.bus.ManagerConfig');sa(a,olympe.auth.td.va,olympe.H.td.oi);sa(a,olympe.auth.td.Jp,olympe.H.td.oi);sa(a,olympe.auth.td.Ee,olympe.H.td.oi);sa(a,olympe.auth.td.Re,olympe.H.td.oi);B(a,olympe.H.O.Rg,olympe.H.Uj,olympe.H.O.Ea,olympe.net.O.va,olympe.auth.O.va,olympe.H.O.Po,olympe.H.O.mq);sa(a,olympe.Za.O.Rg,olympe.H.O.Rg);C(a,olympe.H.O.Jd,[olympe.pa.O.va,olympe.H.O.va,olympe.auth.O.va,olympe.Za.O.Rg,olympe.H.O.Xo,olympe.H.O.sp,olympe.H.O.Jo,olympe.H.O.dr],(d,e,f,g,h,k,l,n)=>new olympe.H.bh(d.Nc('server.source'),
831
- e,f,g,[h,k,l,n]));B(a,olympe.H.O.Fh,olympe.H.$j,olympe.H.O.vp,olympe.H.O.Xn);sa(a,olympe.dc.ba.O.Fh,olympe.H.O.Fh);sa(a,olympe.Za.O.xm,olympe.H.O.Jd)},'olympe.communication');olympe.T.run([olympe.H.O.ao],a=>{olympe.H.wa.Qc=()=>a});olympe.sc={};olympe.sc.O={Ea:'sc.Logger',vm:'sc.RootContext'};olympe.sc.Config={gf:'sc.app',eg:'sc.debug',Ws:'sc.disableTheme',PRODUCTION:'sc.production',eq:'sc.onstartTimeout',Dq:'sc.remoteActionTimeout',bq:'sc.offlineStart',fu:'google.apikey'};
832
- olympe.T.config(a=>{E(a,olympe.sc.Config.gf,'');E(a,olympe.sc.Config.bq,!1);E(a,olympe.sc.Config.eg,!1);E(a,olympe.sc.Config.Ws,!1);E(a,olympe.sc.Config.PRODUCTION,!1);E(a,olympe.sc.Config.eq,2E4);E(a,olympe.sc.Config.fu,'AIzaSyD0rTnF3Tq-ZjgdaqyvC8Jg-RSgpZM2jBU');E(a,olympe.sc.Config.Dq,1E4);C(a,olympe.sc.O.Ea,[olympe.pa.O.va],b=>b.Nc('sc'));C(a,olympe.sc.O.vm,[new olympe.T.fa(olympe.sc.Config.PRODUCTION),new olympe.T.fa(olympe.sc.Config.eq)],b=>{const c=new olympe.sc.Ua('root','root',null);olympe.sc.ls=
833
- c;c.set(olympe.sc.Ua.lg.PRODUCTION,b);return c})},'olympe.sc');olympe.T.run([olympe.sc.O.vm],a=>{olympe.hj().ctx=a});olympe.sc.rn=()=>null!==olympe.dc.Na().fc(void 0,olympe.sc.Runnable.F.Pc());olympe.sc.xC=(a,b,c,d)=>{c=a.create(olympe.sc.Cc).setProperty(olympe.sc.Cc.C,c||null).setProperty(olympe.sc.Cc.N,d||null);a.Ra(olympe.sc.Cc.F,c,b);a.Ra(olympe.dc.CloudObject.containsRel,b,c);return c.R()};olympe.sc.ih=a=>{a=olympe.dc.W.Sb.ih(a);return a instanceof olympe.sc.Ce?a.C():a};olympe.sc.MC=a=>{a=olympe.dc.CloudObject.get(a.tag);return a instanceof olympe.sc.Ce?a.C():a};
834
- olympe.sc.JC=function(a){const b=olympe.dm.Pb.C.Pc(),c=olympe.dc.CloudObject.containsRel.Pc();var d=olympe.dc.xa(a);if(void 0===d)return[];a=olympe.dc.Na();var e=a.model(d);const f=[],g=[];let h=[];if(a.Sf(e,olympe.dm.Pb))h.push(d);else{for(e=[];null===a.fc(d,b);){e.push(d);const k=a.fc(d,c);if(null===k)return olympe.pa.Xa('sc').warn(`Object ${d} has no container`),[];k===a.fc(d,olympe.dc.CloudObject.instancesRel)?(f.push(d),d=a.fc(k,c)):d=k;if(e.includes(d))throw Error(`Instance ${d} (${a.name(d)}) is part of a cyclic contain pattern`);
835
- }g.push(d);h.push(a.fc(g[0],b))}h=h.concat(a.Nf(h[0],olympe.dm.Pb.Xb));h=h.concat(a.Nf(h[h.length-1],olympe.dm.md.ka.Pc()));h=h.concat(a.Nf(h[h.length-1],olympe.dm.md.aa.Pc()));return[...f,...g,...h].reverse()};olympe.sc.KC=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.ak:a.startsWith('video/')?olympe.sc.Bm:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.ud:olympe.dm.File};let Di=0,Ei=0;function Fi(a,b){if(a.children)for(const c of a.children.values())b(c)}function Gi(a,b){if(a.pe&&a.pe.has(b)){var c=a.pe.get(b);--c[0];0===c[0]&&(a.pe.delete(b),0===a.pe.size&&(a.pe=null),Pc(olympe.dc.Ad(),null,c[1]))}}function Hi(a,b){a.children&&a.children.delete(b.Y())}function Ii(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.Mm&&c.oj()&&(a=Ii(c.children,b)))return a;return null}
836
- function Ji(a,b){b=olympe.dc.xa(b);return a.vh&&(a.vh.get('O#'+b)||a.vh.get('IO#'+b))||b}function Ki(a,b,c,d){const e='$'+b;a.bi.add(b);c.map(f=>'@'+f+'.'+b).forEach(f=>{(f=a.qd&&a.qd.get(f))&&f.forEach(g=>{g(d)})});Fi(a,f=>{!f.Sm&&f.bi.has(b)||f.data.has(e)||Ki(f,b,c,d)});a.bi.delete(b)}function Li(a,b){b=olympe.dc.xa(b);return a.vh&&(a.vh.get('I#'+b)||a.vh.get('IO#'+b))||b}
837
- function Mi(a,b,c){a.bi.add(b);const d=a.qd&&a.qd.get('&'+b);if(d)for(const e of d.values())e(c);Fi(a,e=>{e.bi.has(b)||Mi(e,b,c)});a.bi.delete(b)}
838
- olympe.sc.Ua=class{constructor(a,b,c=olympe.sc.ls){++Ei;this.id=a;this.hh=new Set;this.parent=c;this.zd=b||null;this.tc=new olympe.D.Wb('SC Context');this.data=new Map;this.pe=this.children=this.qd=null;this.Tm=new Map;this.uid=Ei;this.Dr=null;this.Mm=!1;this.bi=new Set;this.Sm=!1;this.L=olympe.pa.Xa('sc');this.vh=null;this.tc.vc(()=>{Fi(this,d=>d.destroy())});this.tc.onDestroy(()=>{this.pe&&this.pe.forEach(([d],e)=>{for(let f=0;f<d;f++)Gi(this,e)});c&&Hi(this.parent,this);this.hh.clear();this.parent=
839
- null;null!==this.get(olympe.sc.Ua.lg.TRANSACTION)&&this.L.warn(`The context ${this.id} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`)})}Y(){return this.id}mn(){return this.uid}getParent(){return this.parent}Rk(){return this.Dr}Ec(){return this.tc}wn(a){this.Dr=olympe.dc.xa(a);this.Mm=a.Pd().rn();a.aa().forEach(b=>{this.hh.add(b)});this.vh=a.Z()}Kk(){this.Sm=!0;Fi(this,a=>{a.Kk()})}ml(){this.Sm=!1;Fi(this,a=>{a.ml()})}set(a,b){if(this.tc.gd()||
840
- this.tc.yb())return this;a=Ji(this,a);const c='$'+a;var d=this.data.get(c);d&&d.valueOf&&(d=d.valueOf());if(void 0===b||null===b)void 0!==d&&(this.data.delete(c),Ki(this,a,['*',this.id,...this.hh],null));else{var e;(e=void 0===d)||(e=!('function'===typeof b.qb?b.qb(d):b.valueOf()===d.valueOf()));e&&(this.data.set(c,b),Ki(this,a,['*',this.id,...this.hh],b))}return this}ni(a){return this.set(a,Date.now())}remove(a){this.tc.yb()||this.tc.gd()||(a=Ji(this,a),this.data.delete('$'+a)&&Ki(this,a,['*',this.id,
841
- ...this.hh],null))}Eb(a,b,c=!1){const d=olympe.dc.xa(a),e=olympe.D.Kc(b||Object,`Get context value flow source of ${d}`);e.node.onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.id:void 0));return e.Eb()}get(a,b=!1){a=this.Ya(a,b);return void 0!==a?a:null}has(a,b=!1){a='$'+Li(this,a);let c=this.data.has(a),d=this.parent;if(b)for(;!c&&d;)c=d.data.has(a),d=d.parent;return c}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{if(this.yb())return d.error('Context is already destroyed'),()=>
842
- {};const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.id,!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Li(this,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.Jg(a.unsubscribe.bind(a));return this}gl(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.$h(`Runner ${olympe.D.Ya(a.ma(),'')}`);a.run(b);return b}Ln(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,b,c))}jl(a){this.set(olympe.sc.Ua.lg.dg,
843
- a);return this}Ya(a,b=!0){a='$'+Li(this,a);let c=this.data.get(a),d=this.parent;if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.parent;return c}on(a,b,c,d=!0){if(this.tc.yb()||this.tc.gd())return()=>{};const e=Li(this,a),f=c?olympe.dc.xa(c):'*';a=this.Te('@'+f+'.'+e,b);c=c?(c=this.gi(f))?c.Ya(e,!1):void 0:this.Ya(e);void 0!==c&&b(c);d&&olympe.D.Ia().onDestroy(a);return a}$h(a){const b='_'+olympe.W.lc();null===this.children&&(this.children=new Map);const c=this.tc.run(()=>new olympe.sc.Ua(b,a,
844
- this));this.children.set(b,c);return c}Vk(a,b){a=olympe.dc.xa(a);null===this.children&&(this.children=new Map);let c=this.children.get(a);if(!c){c=new olympe.sc.Ua(a,b,this);this.children.set(a,c);for(b=c.parent;b&&b.Mm&&b.oj();)b=b.parent;b&&Mi(b,a,c)}return c}sj(a,b){const c=this.gi(a);if(c)return b(c),()=>{};const d=this.Te('&'+a,e=>{d&&d();b(e)});return d}gi(a){if(a===this.id||this.hh.has(a)||!a)return this;let b=this.parent;for(;b;){if(a===b.id||b.hh.has(a))return b;const c=Ii(b.children,a);
845
- if(c)return c;b=b.parent}return null}oj(){return!this.id.startsWith('_')}Mk(a,b){this.pe||(this.pe=new Map);const c=this.pe.get(a);c?c[0]+=1:(this.pe.set(a,[1,b]),Pc(olympe.dc.Ad(),b))}destroy(){this.tc.gd()||this.tc.yb()||this.tc.destroy()}Jg(a,b){return this.tc.yb()?b||'noId':(b=b||String(++Di),this.Tm.set(b,a),b)}el(a){this.Tm.delete(a)}onDestroy(a){return this.yb()?(a(),'noId'):this.tc.onDestroy(a)}Je(a){this.yb()||this.tc.Je(a)}clear(){this.tc.gd()||this.tc.yb()||(this.Tm.forEach(a=>a()),this.tc.Af())}Te(a,
846
- b){this.qd||(this.qd=new Map);let c=this.qd.get(a);void 0===c&&(c=new Map,this.qd.set(a,c));++Di;const d=Di;c.set(d,b);return()=>{const e=this.qd.get(a);e&&(e.delete(d),0===e.size&&this.qd.delete(a))}}yb(){return this.tc.yb()}tn(){const a=this.Ya(olympe.sc.Ua.lg.EDITION);return a?a:!1}$k(){const a=this.Ya(olympe.sc.Ua.lg.PRODUCTION);return a?a:!1}};olympe.sc.Ua.prototype.clear=olympe.sc.Ua.prototype.clear;olympe.sc.Ua.prototype.offDestroy=olympe.sc.Ua.prototype.Je;
847
- olympe.sc.Ua.prototype.onDestroy=olympe.sc.Ua.prototype.onDestroy;olympe.sc.Ua.prototype.offClear=olympe.sc.Ua.prototype.el;olympe.sc.Ua.prototype.onClear=olympe.sc.Ua.prototype.Jg;olympe.sc.Ua.prototype.destroy=olympe.sc.Ua.prototype.destroy;olympe.sc.Ua.prototype.getOtherContext=olympe.sc.Ua.prototype.gi;olympe.sc.Ua.prototype.onContext=olympe.sc.Ua.prototype.sj;olympe.sc.Ua.prototype.createChild=olympe.sc.Ua.prototype.$h;olympe.sc.Ua.prototype.setParentElement=olympe.sc.Ua.prototype.jl;
848
- olympe.sc.Ua.prototype.waitFor=olympe.sc.Ua.prototype.Ln;olympe.sc.Ua.prototype.runner=olympe.sc.Ua.prototype.gl;olympe.sc.Ua.prototype.repeat=olympe.sc.Ua.prototype.repeat;olympe.sc.Ua.prototype.observe=olympe.sc.Ua.prototype.observe;olympe.sc.Ua.prototype.has=olympe.sc.Ua.prototype.has;olympe.sc.Ua.prototype.get=olympe.sc.Ua.prototype.get;olympe.sc.Ua.prototype.remove=olympe.sc.Ua.prototype.remove;olympe.sc.Ua.prototype.trigger=olympe.sc.Ua.prototype.ni;olympe.sc.Ua.prototype.set=olympe.sc.Ua.prototype.set;
849
- olympe.sc.Ua.prototype.getParent=olympe.sc.Ua.prototype.getParent;olympe.sc.Ua.bc={xt:'I#',su:'O#',Vz:'IO#'};olympe.sc.Ua.lg={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',dg:'__htmlContainer',bz:'__dockableElement'};olympe.sc.Metadata=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}};olympe.sc.Metadata.P=olympe.dc.Ba.C('0161ae936c62f9fcd131',olympe.sc.Metadata);olympe.sc.Cc=class extends olympe.dc.CloudObject{F(){return this.Fb(olympe.sc.Cc.N)}C(){return this.Fb(olympe.sc.Cc.C)}};olympe.sc.Cc.P=olympe.dc.Ba.C('01703376c4a81c0e9d90',olympe.sc.Cc);olympe.sc.Cc.N=olympe.sc.Cc.P.Ca('01703376c4a81c0e9d91');olympe.sc.Cc.C=olympe.sc.Cc.P.Ca('01703376c4a81c0e9d92');olympe.sc.Cc.F=olympe.sc.Cc.P.Pa('01703376c4a81c0e9d93');P(olympe.dc.CloudObject.P,olympe.sc.Cc.F);olympe.sc.Cc.prototype.F.K=olympe.D.J.F;olympe.sc.Cc.prototype.C.K=olympe.D.J.F;olympe.sc.W={};function Ni(a,b){const c=Math.random().toString(36).substr(2)+Math.random().toString(36).substr(2);a.C.set(c,b);return c}
850
- olympe.sc.W.kt=class{constructor(a,b,c){const d=olympe.net.eb.ae.GET,e=olympe.net.eb.ae.Fc,f=olympe.net.eb.ae.mk,g=olympe.net.eb.ae.gm,h=olympe.net.eb.Headers.Lj,k=olympe.net.eb.Headers.si;this.L=a;this.G=b.aa([d,e,f,g],[h,k]);this.N=c;this.C=new olympe.W.er(3E4);this.F=new olympe.D.Wb('FileService context')}start(a){var b=olympe.net.eb.ae.GET;const c=olympe.net.eb.ae.Fc,d=olympe.net.eb.ae.mk,e=olympe.net.eb.ae.gm,f=olympe.net.eb.od.Lh,g=olympe.net.eb.od.it,h=olympe.net.eb.od.Lq,k=olympe.net.eb.Headers.si,
851
- l=olympe.net.eb.Headers.zs,n=`fileServer_${a}`;a=`/${this.N}/${a}/:${'fileTag'}`.replace(/\/+/g,'/').replace(/\/$/,'');this.L.debug(`Started file service with path : ${a}`);b=this.G.N(n,a,[b,c,d,e],(p,q)=>{if(p.method===e)return Promise.resolve(new olympe.net.Tg('',f,'',{[l]:'*'}));const r=p.ij()[k],t=this.C.get(r);if(!t)return Promise.resolve(new olympe.net.Tg('Invalid token',g,'Access denied'));this.C.delete(r);return t(p.ij(),q.get('fileTag'),p.body).catch(u=>Promise.resolve(new olympe.net.Tg(`Internal server error: ${u}`,
852
- h,'Internal server error')))});this.F.onDestroy(()=>{this.G.Z(n).catch(p=>this.L.error(`An error occurred while stopping the file service: ${p}`))});return b}stop(){this.F.destroy()}};olympe.sc.Ze={};olympe.sc.Ze.fh={Sy:null,Lu:'screenflow',dv:'ui-design',Nq:'software-intelligence',Bl:'data-management'};olympe.sc.ne=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Ze.fh.Nq}F(){return this.ub(olympe.sc.ne.C,olympe.sc.logic.Ni)}G(){return this.ub(olympe.sc.ne.F,olympe.sc.logic.Ph)}};olympe.sc.ne.P=olympe.dc.Ba.C('011100000000000adef0',olympe.sc.ne);olympe.sc.ne.C=olympe.sc.ne.P.Pa('016ac4f59a2917fdef01');olympe.sc.ne.F=olympe.sc.ne.P.Pa('016ac4f59a2917fdef02');olympe.sc.ne.prototype.F.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.sc.ne.prototype.G.K=new olympe.D.J(()=>olympe.dc.Aa,[]);function Oi(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function Pi(a,b){const c=[];for(const d of b)b=a.db.fb(d,olympe.sc.logic.Ic.C,!0),c[b]=d;return c}
853
- olympe.sc.pb=class extends olympe.dm.BrickMetadata{Qt(a,b,c,d,e=!0){e||olympe.pa.Xa('sc').error('parameter own= false ignored, investigate');return olympe.D.df(L(this.Mf(a,olympe.dc.W.Sb.ih,c)),d)}Yw(){return this.ub(olympe.sc.pb.aa,olympe.sc.Runnable)}mw(){return this.ub(olympe.sc.pb.ka,olympe.sc.Runnable)}vn(){return this.db.fb(this,olympe.sc.pb.Xb)}rn(){return null!==this.db.fc(this.tag,olympe.sc.Runnable.F.Pc())}Wl(){return this.ub(olympe.sc.pb.F,olympe.sc.logic.Lb)}ck(){return this.ub(olympe.sc.pb.N,
817
+ 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.H.sd.sa.la=[olympe.H.sa];olympe.H.O={va:'server.Manager',Vn:'server.bus.Manager',Ea:'server.Logger',Jd:'server.Source',Pg:'server.FileSource',op:'server.ImportFileSvcHttpRequest',Rn:'server.BackupSvcHttpRequest',$p:'server.OpenIDSvcHttpRequest',Ro:'server.GetContextSvcPathRequest',kp:'server.ImplicitGDSvcPathRequest',Do:'server.ExplicitGDSvcPathRequest',Zq:'server.TransactionOverHttpPathRequest',jr:'server.UserTokenRequest',hr:'server.UserTagRequest',fr:'server.UserRolesRequest',Bq:'server.RoleMembersRequest',Dh:'server.IOUrlsProvider',
818
+ Jo:'server.fileSvcUrl',gq:'communication.peerFileSvcUrl'};olympe.H.td={ni:'server.connectors.Auth',FA:'server.connectors.Signaling'};
819
+ olympe.H.Config={vd:'server.host',Id:'server.port',yd:'server.ssl',In:'server.autoConnect',uq:'server.reconnectionDelay',kq:'server.pingInterval',xm:'server.messageTimeout',zq:'server.retryHttpOnOverload',bo:'server.clientVersion',Hq:'server.serverVersion',Un:'bus.host',Wn:'bus.path',Xn:'bus.port',Yn:'bus.vhost',mg:'bus.keepalive',Eu:'bus.reschedulePings',Fs:'bus.clientId',Ds:'bus.clean',Au:'bus.reconnectPeriod',Is:'bus.connectTimeout',dr:'bus.username',eq:'bus.password',wu:'bus.queueQoSZero'};
820
+ olympe.H.ob={Cd:'server.basePath',nr:'server.wsPath',Ho:'server.filePath',np:'server.importFilePath',Qn:'server.backupSvcPath',Zp:'server.openIDSvcPath',Qo:'server.GetContextSvcPath',mp:'server.ImplicitGraphdefSvcPath',Eo:'server.ExplicitGraphdefSvcPath',Yq:'server.TransactionOverHttpPath',ir:'server.userTokenSvcPath',gr:'server.userTagPath',er:'server.userRolesPath',Aq:'server.roleMembersPath',gm:'communication.peerFileSvcPath'};
821
+ olympe.T.config(function(a){var b='object'===typeof window&&window.location&&window.location.hostname||'localhost';const c='localhost'===b;D(a,olympe.H.Config.vd,b);D(a,olympe.H.Config.Id,c?8080:443);D(a,olympe.H.Config.yd,'localhost'!==b);D(a,olympe.H.ob.Cd,'OlympeServer');D(a,olympe.H.ob.nr,'websocket');D(a,olympe.H.ob.Ho,'rest/filesvc');D(a,olympe.H.ob.np,'rest/importsvc');D(a,olympe.H.ob.Qn,'rest/backupsvc');D(a,olympe.H.ob.Zp,'rest/openid');D(a,olympe.H.ob.Qo,'rest/initialData');D(a,olympe.H.ob.mp,
822
+ 'rest/querysvc/graphDefImplicit');D(a,olympe.H.ob.Eo,'rest/querysvc/graphDefExplicit');D(a,olympe.H.ob.Yq,'rest/transaction');D(a,olympe.H.ob.ir,'rest/token');D(a,olympe.H.ob.gr,'rest/authorization/getUserTag');D(a,olympe.H.ob.er,'rest/authorization/getUserRoles');D(a,olympe.H.ob.Aq,'rest/authorization/roleMembers');D(a,olympe.H.Config.In,!0);D(a,olympe.H.Config.uq,5E3);D(a,olympe.H.Config.kq,5E3);D(a,olympe.H.Config.xm,15E3);D(a,olympe.H.Config.zq,5E3);D(a,olympe.H.Config.Hq,'6.3.0');D(a,olympe.H.Config.Un,
823
+ '');D(a,olympe.H.Config.Wn,c?'':'/mqtt');D(a,olympe.H.Config.Xn,c?15675:443);D(a,olympe.H.Config.Yn,c?'/':'');D(a,olympe.H.Config.dr,'guest');D(a,olympe.H.Config.eq,'guest');D(a,olympe.H.Config.mg,30);D(a,olympe.H.ob.gm,'nodes/files');b=a.getParameter(olympe.Eg.Config.No);if(void 0!==b)ua(a,b);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');C(a,olympe.H.O.Ea,[olympe.pa.O.va],d=>d.Nc('communication'));C(a,'server.WebSocketRequest',[new olympe.T.fa(olympe.H.Config.vd),
824
+ new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.nr)],(d,e,f,g,h)=>new olympe.net.Ck(d,e,(g+'/'+h).replace(/\/+/g,'/').replace(/\/$/,''),f));b=(d,e,f,g,h)=>(new olympe.net.Wj(d,e,`${g}${h?'/'+h:''}`.replace(/\/+/g,'/').replace(/\/$/,''),f)).C();C(a,olympe.H.O.op,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.np)],
825
+ b);C(a,olympe.H.O.Rn,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Qn)],b);C(a,olympe.H.O.$p,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Zp)],b);C(a,olympe.H.O.Ro,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),
826
+ new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Qo)],b);C(a,olympe.H.O.kp,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.mp)],b);C(a,olympe.H.O.Do,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Eo)],b);C(a,olympe.H.O.Zq,[new olympe.T.fa(olympe.H.Config.vd),
827
+ new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Yq)],b);C(a,olympe.H.O.jr,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.ir)],b);C(a,olympe.H.O.hr,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.gr)],
828
+ b);C(a,olympe.H.O.fr,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.er)],b);C(a,olympe.H.O.Bq,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Aq)],b);C(a,olympe.H.O.Jo,[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.yd),
829
+ new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Ho)],b);C(a,olympe.H.O.gq,[new olympe.T.fa(olympe.net.Config.Jl),new olympe.T.fa(olympe.net.Config.Kl),new olympe.T.fa(olympe.net.Config.fp),new olympe.T.fa(olympe.H.ob.gm)],b);C(a,'server.ManagerConfig',[new olympe.T.fa(olympe.H.Config.In),new olympe.T.fa(olympe.H.Config.uq),new olympe.T.fa(olympe.H.Config.kq),new olympe.T.fa(olympe.H.Config.xm),new olympe.T.fa(olympe.H.Config.bo),new olympe.T.fa(olympe.H.Config.Hq),new olympe.T.fa(olympe.dc.Config.Yg),
830
+ new olympe.T.fa(olympe.H.Config.zq)],(...d)=>{const e='autoConnect reconnectionDelay pingInterval messageTimeout clientVersion serverVersion getContextMode retryHttpOverload'.split(' '),f=new Map;d.forEach((g,h)=>f.set(e[h],g));return f});C(a,'server.bus.ManagerConfig',[new olympe.T.fa(olympe.H.Config.vd),new olympe.T.fa(olympe.H.Config.Un),new olympe.T.fa(olympe.H.Config.Wn),new olympe.T.fa(olympe.H.Config.Xn),new olympe.T.fa(olympe.H.Config.Yn),new olympe.T.fa(olympe.H.Config.dr),new olympe.T.fa(olympe.H.Config.yd),
831
+ new olympe.T.fa(olympe.H.Config.mg),new olympe.T.fa(olympe.H.Config.Eu),new olympe.T.fa(olympe.H.Config.Fs),new olympe.T.fa(olympe.H.Config.Ds),new olympe.T.fa(olympe.H.Config.Au),new olympe.T.fa(olympe.H.Config.Is),new olympe.T.fa(olympe.H.Config.eq),new olympe.T.fa(olympe.H.Config.wu),new olympe.T.fa(olympe.H.Config.xm)],(d,e,f,g,h,k,l,...n)=>{e=`${l?'wss://':'ws://'}${e||d}:${g}${f}/ws`;const p='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout password queueQoSZero messageTimeout'.split(' ');
832
+ n=n.reduce((q,r,t)=>{q[p[t]]=r;return q},{});n.username=`${h||d.split('.')[0]}:${k}`;d=new Map;d.set('url',e);d.set('connectionOptions',n);return d});A(a,olympe.H.O.va,olympe.H.sd.sa,olympe.H.O.Ea,olympe.net.O.va,'server.WebSocketRequest','server.ManagerConfig');A(a,olympe.H.td.ni,olympe.H.oa.Ta,olympe.H.O.Ea,olympe.H.O.va,olympe.H.O.jr,olympe.H.O.hr,olympe.H.O.fr,olympe.H.O.Bq,olympe.H.O.$p,olympe.auth.O.kk,olympe.jc.O.ak);A(a,olympe.H.O.Vn,olympe.H.wa.sa,olympe.H.O.Ea,olympe.net.O.va,olympe.auth.O.va,
833
+ 'server.bus.ManagerConfig');sa(a,olympe.auth.td.va,olympe.H.td.ni);sa(a,olympe.auth.td.Dp,olympe.H.td.ni);sa(a,olympe.auth.td.Ee,olympe.H.td.ni);sa(a,olympe.auth.td.Pe,olympe.H.td.ni);A(a,olympe.H.O.Pg,olympe.H.Rj,olympe.H.O.Ea,olympe.net.O.va,olympe.auth.O.va,olympe.H.O.Jo,olympe.H.O.gq);sa(a,olympe.Za.O.Pg,olympe.H.O.Pg);C(a,olympe.H.O.Jd,[olympe.pa.O.va,olympe.H.O.va,olympe.auth.O.va,olympe.Za.O.Pg,olympe.H.O.Ro,olympe.H.O.kp,olympe.H.O.Do,olympe.H.O.Zq],(d,e,f,g,h,k,l,n)=>new olympe.H.$g(d.Nc('server.source'),
834
+ e,f,g,[h,k,l,n]));A(a,olympe.H.O.Dh,olympe.H.Xj,olympe.H.O.op,olympe.H.O.Rn);sa(a,olympe.dc.ba.O.Dh,olympe.H.O.Dh);sa(a,olympe.Za.O.sm,olympe.H.O.Jd)},'olympe.communication');olympe.T.run([olympe.H.O.Vn],a=>{olympe.H.wa.Qc=()=>a});olympe.sc={};olympe.sc.O={Ea:'sc.Logger',qm:'sc.RootContext'};olympe.sc.Config={ef:'sc.app',cg:'sc.debug',Ss:'sc.disableTheme',PRODUCTION:'sc.production',Yp:'sc.onstartTimeout',yq:'sc.remoteActionTimeout',Wp:'sc.offlineStart',cu:'google.apikey'};
835
+ olympe.T.config(a=>{D(a,olympe.sc.Config.ef,'');D(a,olympe.sc.Config.Wp,!1);D(a,olympe.sc.Config.cg,!1);D(a,olympe.sc.Config.Ss,!1);D(a,olympe.sc.Config.PRODUCTION,!1);D(a,olympe.sc.Config.Yp,2E4);D(a,olympe.sc.Config.cu,'AIzaSyD0rTnF3Tq-ZjgdaqyvC8Jg-RSgpZM2jBU');D(a,olympe.sc.Config.yq,1E4);C(a,olympe.sc.O.Ea,[olympe.pa.O.va],b=>b.Nc('sc'));C(a,olympe.sc.O.qm,[new olympe.T.fa(olympe.sc.Config.PRODUCTION),new olympe.T.fa(olympe.sc.Config.Yp)],b=>{const c=new olympe.sc.Ua('root','root',null);olympe.sc.es=
836
+ c;c.set(olympe.sc.Ua.jg.PRODUCTION,b);return c})},'olympe.sc');olympe.T.run([olympe.sc.O.qm],a=>{olympe.fj().ctx=a});olympe.sc.kn=()=>null!==olympe.dc.Na().ic(void 0,olympe.sc.Runnable.F.Pc());olympe.sc.AC=(a,b,c,d)=>{c=a.create(olympe.sc.Cc).setProperty(olympe.sc.Cc.C,c||null).setProperty(olympe.sc.Cc.N,d||null);a.Ra(olympe.sc.Cc.F,c,b);a.Ra(olympe.dc.CloudObject.containsRel,b,c);return c.R()};olympe.sc.gh=a=>{a=olympe.dc.W.Tb.gh(a);return a instanceof olympe.sc.Ce?a.C():a};olympe.sc.PC=a=>{a=olympe.dc.CloudObject.get(a.tag);return a instanceof olympe.sc.Ce?a.C():a};
837
+ olympe.sc.MC=function(a){const b=olympe.dm.Pb.C.Pc(),c=olympe.dc.CloudObject.containsRel.Pc();var d=olympe.dc.xa(a);if(void 0===d)return[];a=olympe.dc.Na();var e=a.model(d);const f=[],g=[];let h=[];if(a.Sf(e,olympe.dm.Pb))h.push(d);else{for(e=[];null===a.ic(d,b);){e.push(d);const k=a.ic(d,c);if(null===k)return olympe.pa.Xa('sc').warn(`Object ${d} has no container`),[];k===a.ic(d,olympe.dc.CloudObject.instancesRel)?(f.push(d),d=a.ic(k,c)):d=k;if(e.includes(d))throw Error(`Instance ${d} (${a.name(d)}) is part of a cyclic contain pattern`);
838
+ }g.push(d);h.push(a.ic(g[0],b))}h=h.concat(a.Nf(h[0],olympe.dm.Pb.Xb));h=h.concat(a.Nf(h[h.length-1],olympe.dm.md.ka.Pc()));h=h.concat(a.Nf(h[h.length-1],olympe.dm.md.aa.Pc()));return[...f,...g,...h].reverse()};olympe.sc.NC=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Yj:a.startsWith('video/')?olympe.sc.wm:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.ud:olympe.dm.File};let Hi=0,Ii=0;function Ji(a,b){if(a.children)for(const c of a.children.values())b(c)}function Ki(a,b){if(a.pe&&a.pe.has(b)){var c=a.pe.get(b);--c[0];0===c[0]&&(a.pe.delete(b),0===a.pe.size&&(a.pe=null),Tc(olympe.dc.Ad(),null,c[1]))}}function Li(a,b){a.children&&a.children.delete(b.Z())}function Mi(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.Hm&&c.mj()&&(a=Mi(c.children,b)))return a;return null}
839
+ function Ni(a,b){b=olympe.dc.xa(b);return a.uh&&(a.uh.get('O#'+b)||a.uh.get('IO#'+b))||b}function Oi(a,b,c,d){const e='$'+b;a.ai.add(b);c.map(f=>'@'+f+'.'+b).forEach(f=>{(f=a.qd&&a.qd.get(f))&&f.forEach(g=>{g(d)})});Ji(a,f=>{!f.Nm&&f.ai.has(b)||f.data.has(e)||Oi(f,b,c,d)});a.ai.delete(b)}function Pi(a,b){b=olympe.dc.xa(b);return a.uh&&(a.uh.get('I#'+b)||a.uh.get('IO#'+b))||b}
840
+ function Qi(a,b,c){a.ai.add(b);const d=a.qd&&a.qd.get('&'+b);if(d)for(const e of d.values())e(c);Ji(a,e=>{e.ai.has(b)||Qi(e,b,c)});a.ai.delete(b)}
841
+ olympe.sc.Ua=class{constructor(a,b,c=olympe.sc.es){++Ii;this.id=a;this.fh=new Set;this.parent=c;this.zd=b||null;this.tc=new olympe.D.Wb('SC Context');this.data=new Map;this.pe=this.children=this.qd=null;this.Om=new Map;this.uid=Ii;this.yr=null;this.Hm=!1;this.ai=new Set;this.Nm=!1;this.L=olympe.pa.Xa('sc');this.uh=null;this.tc.vc(()=>{Ji(this,d=>d.destroy())});this.tc.onDestroy(()=>{this.pe&&this.pe.forEach(([d],e)=>{for(let f=0;f<d;f++)Ki(this,e)});c&&Li(this.parent,this);this.fh.clear();this.parent=
842
+ null;null!==this.get(olympe.sc.Ua.jg.TRANSACTION)&&this.L.warn(`The context ${this.id} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`)})}Z(){return this.id}gn(){return this.uid}getParent(){return this.parent}Nk(){return this.yr}Ec(){return this.tc}qn(a){this.yr=olympe.dc.xa(a);this.Hm=a.Pd().kn();a.aa().forEach(b=>{this.fh.add(b)});this.uh=a.Y()}Gk(){this.Nm=!0;Ji(this,a=>{a.Gk()})}il(){this.Nm=!1;Ji(this,a=>{a.il()})}set(a,b){if(this.tc.gd()||
843
+ this.tc.yb())return this;a=Ni(this,a);const c='$'+a;var d=this.data.get(c);d&&d.valueOf&&(d=d.valueOf());if(void 0===b||null===b)void 0!==d&&(this.data.delete(c),Oi(this,a,['*',this.id,...this.fh],null));else{var e;(e=void 0===d)||(e=!('function'===typeof b.qb?b.qb(d):b.valueOf()===d.valueOf()));e&&(this.data.set(c,b),Oi(this,a,['*',this.id,...this.fh],b))}return this}mi(a){return this.set(a,Date.now())}remove(a){this.tc.yb()||this.tc.gd()||(a=Ni(this,a),this.data.delete('$'+a)&&Oi(this,a,['*',this.id,
844
+ ...this.fh],null))}Eb(a,b,c=!1){const d=olympe.dc.xa(a),e=olympe.D.Kc(b||Object,`Get context value flow source of ${d}`);e.node.onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.id:void 0));return e.Eb()}get(a,b=!1){a=this.Ya(a,b);return void 0!==a?a:null}has(a,b=!1){a='$'+Pi(this,a);let c=this.data.has(a),d=this.parent;if(b)for(;!c&&d;)c=d.data.has(a),d=d.parent;return c}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{if(this.yb())return d.error('Context is already destroyed'),()=>
845
+ {};const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.id,!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Pi(this,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.Hg(a.unsubscribe.bind(a));return this}cl(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Zh(`Runner ${olympe.D.Ya(a.ma(),'')}`);a.run(b);return b}Fn(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,b,c))}fl(a){this.set(olympe.sc.Ua.jg.bg,
846
+ a);return this}Ya(a,b=!0){a='$'+Pi(this,a);let c=this.data.get(a),d=this.parent;if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.parent;return c}on(a,b,c,d=!0){if(this.tc.yb()||this.tc.gd())return()=>{};const e=Pi(this,a),f=c?olympe.dc.xa(c):'*';a=this.Re('@'+f+'.'+e,b);c=c?(c=this.fi(f))?c.Ya(e,!1):void 0:this.Ya(e);void 0!==c&&b(c);d&&olympe.D.Ja().onDestroy(a);return a}Zh(a){const b='_'+olympe.W.nc();null===this.children&&(this.children=new Map);const c=this.tc.run(()=>new olympe.sc.Ua(b,a,
847
+ this));this.children.set(b,c);return c}Rk(a,b){a=olympe.dc.xa(a);null===this.children&&(this.children=new Map);let c=this.children.get(a);if(!c){c=new olympe.sc.Ua(a,b,this);this.children.set(a,c);for(b=c.parent;b&&b.Hm&&b.mj();)b=b.parent;b&&Qi(b,a,c)}return c}qj(a,b){const c=this.fi(a);if(c)return b(c),()=>{};const d=this.Re('&'+a,e=>{d&&d();b(e)});return d}fi(a){if(a===this.id||this.fh.has(a)||!a)return this;let b=this.parent;for(;b;){if(a===b.id||b.fh.has(a))return b;const c=Mi(b.children,a);
848
+ if(c)return c;b=b.parent}return null}mj(){return!this.id.startsWith('_')}Ik(a,b){this.pe||(this.pe=new Map);const c=this.pe.get(a);c?c[0]+=1:(this.pe.set(a,[1,b]),Tc(olympe.dc.Ad(),b))}destroy(){this.tc.gd()||this.tc.yb()||this.tc.destroy()}Hg(a,b){return this.tc.yb()?b||'noId':(b=b||String(++Hi),this.Om.set(b,a),b)}al(a){this.Om.delete(a)}onDestroy(a){return this.yb()?(a(),'noId'):this.tc.onDestroy(a)}Je(a){this.yb()||this.tc.Je(a)}clear(){this.tc.gd()||this.tc.yb()||(this.Om.forEach(a=>a()),this.tc.yf())}Re(a,
849
+ b){this.qd||(this.qd=new Map);let c=this.qd.get(a);void 0===c&&(c=new Map,this.qd.set(a,c));++Hi;const d=Hi;c.set(d,b);return()=>{const e=this.qd.get(a);e&&(e.delete(d),0===e.size&&this.qd.delete(a))}}yb(){return this.tc.yb()}mn(){const a=this.Ya(olympe.sc.Ua.jg.EDITION);return a?a:!1}Wk(){const a=this.Ya(olympe.sc.Ua.jg.PRODUCTION);return a?a:!1}};olympe.sc.Ua.prototype.clear=olympe.sc.Ua.prototype.clear;olympe.sc.Ua.prototype.offDestroy=olympe.sc.Ua.prototype.Je;
850
+ olympe.sc.Ua.prototype.onDestroy=olympe.sc.Ua.prototype.onDestroy;olympe.sc.Ua.prototype.offClear=olympe.sc.Ua.prototype.al;olympe.sc.Ua.prototype.onClear=olympe.sc.Ua.prototype.Hg;olympe.sc.Ua.prototype.destroy=olympe.sc.Ua.prototype.destroy;olympe.sc.Ua.prototype.getOtherContext=olympe.sc.Ua.prototype.fi;olympe.sc.Ua.prototype.onContext=olympe.sc.Ua.prototype.qj;olympe.sc.Ua.prototype.createChild=olympe.sc.Ua.prototype.Zh;olympe.sc.Ua.prototype.setParentElement=olympe.sc.Ua.prototype.fl;
851
+ olympe.sc.Ua.prototype.waitFor=olympe.sc.Ua.prototype.Fn;olympe.sc.Ua.prototype.runner=olympe.sc.Ua.prototype.cl;olympe.sc.Ua.prototype.repeat=olympe.sc.Ua.prototype.repeat;olympe.sc.Ua.prototype.observe=olympe.sc.Ua.prototype.observe;olympe.sc.Ua.prototype.has=olympe.sc.Ua.prototype.has;olympe.sc.Ua.prototype.get=olympe.sc.Ua.prototype.get;olympe.sc.Ua.prototype.remove=olympe.sc.Ua.prototype.remove;olympe.sc.Ua.prototype.trigger=olympe.sc.Ua.prototype.mi;olympe.sc.Ua.prototype.set=olympe.sc.Ua.prototype.set;
852
+ olympe.sc.Ua.prototype.getParent=olympe.sc.Ua.prototype.getParent;olympe.sc.Ua.ec={ut:'I#',pu:'O#',Yz:'IO#'};olympe.sc.Ua.jg={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',bg:'__htmlContainer',fz:'__dockableElement'};olympe.sc.Metadata=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}};olympe.sc.Metadata.P=olympe.dc.Ba.C('0161ae936c62f9fcd131',olympe.sc.Metadata);olympe.sc.Cc=class extends olympe.dc.CloudObject{F(){return this.Fb(olympe.sc.Cc.N)}C(){return this.Fb(olympe.sc.Cc.C)}};olympe.sc.Cc.P=olympe.dc.Ba.C('01703376c4a81c0e9d90',olympe.sc.Cc);olympe.sc.Cc.N=olympe.sc.Cc.P.Ca('01703376c4a81c0e9d91');olympe.sc.Cc.C=olympe.sc.Cc.P.Ca('01703376c4a81c0e9d92');olympe.sc.Cc.F=olympe.sc.Cc.P.Pa('01703376c4a81c0e9d93');P(olympe.dc.CloudObject.P,olympe.sc.Cc.F);olympe.sc.Cc.prototype.F.K=olympe.D.J.F;olympe.sc.Cc.prototype.C.K=olympe.D.J.F;olympe.sc.W={};function Ri(a,b){const c=Math.random().toString(36).substr(2)+Math.random().toString(36).substr(2);a.C.set(c,b);return c}
853
+ olympe.sc.W.ht=class{constructor(a,b,c){const d=olympe.net.eb.$d.GET,e=olympe.net.eb.$d.Fc,f=olympe.net.eb.$d.ik,g=olympe.net.eb.$d.am,h=olympe.net.eb.Headers.Ij,k=olympe.net.eb.Headers.ri;this.L=a;this.G=b.aa([d,e,f,g],[h,k]);this.N=c;this.C=new olympe.W.$q(3E4);this.F=new olympe.D.Wb('FileService context')}start(a){var b=olympe.net.eb.$d.GET;const c=olympe.net.eb.$d.Fc,d=olympe.net.eb.$d.ik,e=olympe.net.eb.$d.am,f=olympe.net.eb.od.Kh,g=olympe.net.eb.od.ft,h=olympe.net.eb.od.Gq,k=olympe.net.eb.Headers.ri,
854
+ l=olympe.net.eb.Headers.us,n=`fileServer_${a}`;a=`/${this.N}/${a}/:${'fileTag'}`.replace(/\/+/g,'/').replace(/\/$/,'');this.L.debug(`Started file service with path : ${a}`);b=this.G.N(n,a,[b,c,d,e],(p,q)=>{if(p.method===e)return Promise.resolve(new olympe.net.Rg('',f,'',{[l]:'*'}));const r=p.gj()[k],t=this.C.get(r);if(!t)return Promise.resolve(new olympe.net.Rg('Invalid token',g,'Access denied'));this.C.delete(r);return t(p.gj(),q.get('fileTag'),p.body).catch(u=>Promise.resolve(new olympe.net.Rg(`Internal server error: ${u}`,
855
+ h,'Internal server error')))});this.F.onDestroy(()=>{this.G.Y(n).catch(p=>this.L.error(`An error occurred while stopping the file service: ${p}`))});return b}stop(){this.F.destroy()}};olympe.sc.Xe={};olympe.sc.Xe.dh={Wy:null,Iu:'screenflow',$u:'ui-design',Iq:'software-intelligence',xl:'data-management'};olympe.sc.ne=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Xe.dh.Iq}F(){return this.ub(olympe.sc.ne.C,olympe.sc.logic.Mi)}G(){return this.ub(olympe.sc.ne.F,olympe.sc.logic.Oh)}};olympe.sc.ne.P=olympe.dc.Ba.C('011100000000000adef0',olympe.sc.ne);olympe.sc.ne.C=olympe.sc.ne.P.Pa('016ac4f59a2917fdef01');olympe.sc.ne.F=olympe.sc.ne.P.Pa('016ac4f59a2917fdef02');olympe.sc.ne.prototype.F.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.sc.ne.prototype.G.K=new olympe.D.J(()=>olympe.dc.Aa,[]);function Si(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function Ti(a,b){const c=[];for(const d of b)b=a.db.fb(d,olympe.sc.logic.Ic.C,!0),c[b]=d;return c}
856
+ olympe.sc.pb=class extends olympe.dm.BrickMetadata{Nt(a,b,c,d,e=!0){e||olympe.pa.Xa('sc').error('parameter own= false ignored, investigate');return olympe.D.bf(L(this.Mf(a,olympe.dc.W.Tb.gh,c)),d)}Vw(){return this.ub(olympe.sc.pb.aa,olympe.sc.Runnable)}jw(){return this.ub(olympe.sc.pb.ka,olympe.sc.Runnable)}pn(){return this.db.fb(this,olympe.sc.pb.Xb)}kn(){return null!==this.db.ic(this.tag,olympe.sc.Runnable.F.Pc())}Sl(){return this.ub(olympe.sc.pb.F,olympe.sc.logic.Lb)}$j(){return this.ub(olympe.sc.pb.N,
854
857
  olympe.sc.logic.Vb)}};olympe.sc.pb.P=olympe.dc.Ba.C('0112000000000000def0',olympe.sc.pb);olympe.sc.pb.Xb=olympe.sc.pb.P.Ca('01692aa71f3108454479');olympe.sc.pb.zc=olympe.sc.pb.P.Ca('0166446c1f128ebc903a');olympe.sc.pb.aa=olympe.sc.pb.P.Pa('01692a4af82e8984742c');olympe.sc.pb.ka=olympe.sc.pb.P.Pa('01692a4af82e8984742d');olympe.sc.pb.Da=olympe.sc.pb.P.Pa('01692a4af82e8984742e');olympe.sc.pb.F=olympe.sc.pb.P.Pa('01621fb84e320000f00a');olympe.sc.pb.N=olympe.sc.pb.P.Pa('01621fb84e320000f00b');
855
- olympe.sc.pb.He=olympe.sc.pb.P.Pa('0171838bcfed0000e00e');olympe.sc.pb.qe=olympe.sc.pb.P.Pa('0171838bcfed0000a00a');m=olympe.sc.pb.prototype;m.Qt.K=olympe.D.J.C;m.Yw.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.mw.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.vn.K=olympe.D.J.C;m.rn.K=olympe.D.J.C;m.Wl.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.ck.K=new olympe.D.J(()=>olympe.dc.Aa,[]);function Qi(a){const b=new olympe.dc.Transaction,c=b.create(a).persist(!1).R();b.hb();olympe.D.Ia().onDestroy(()=>{const d=new olympe.dc.Transaction;d.delete(c);d.hb()});return olympe.dc.CloudObject.get(c)}function Ri(a,b){b.wn(a);Oi(a.Pd(),b);const c=a.N(),d=Si(b,c),e=[];c.forEach((f,g)=>{f===a.Da?e[0]=g:f===a.ra&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(Ti(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])})}
856
- function Ui(a,b){var c=a.Tb();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.F(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>b.yb()||(b.clear(),null===h)?!1:(b.Ec().run(a.update.bind(a,new olympe.sc.cb(b),Array.isArray(h)?h:[h],g)),!0))).subscribe(rxjs.Subscriber.create(h=>h?a.L.debug(e):a.L.debug(f),a.ab.bind(a,b),()=>a.L.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
857
- function Vi(a,b,c,d){const e=d.Ec(),f=V(a.db,b,c,e.Cb((g,h)=>{const k=d.Vk(h);g?olympe.dc.CloudObject.get(h).run(k):k.destroy()}));e.vc(a.db.C.bind(a.db,b,c,f,!0))}function Si(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)}})}
858
- function Ti(a,b,c){const d=olympe.D.Ia(),e=yd(a.db,a.tag,d.Cb((f,g,h)=>{const k=h?c:b;null!==k&&(h&&b&&b(f,null),null===g||void 0===g?k(f,null):k(f,olympe.sc.ih(g)))}));d.onDestroy(()=>{var f=a.db;const g=U(f,a.tag);null!==g&&(g.V(td,e),f.Ha.getState()===ud.cg&&f.Ha.aa(e))})}
859
- olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.L=c}run(a){const b=()=>{Ri(this,a);this.init(a);this.Pd().vn()?Ui(this,a):a.Ec().run(this.update.bind(this,new olympe.sc.cb(a),[],[]));a.ni(olympe.sc.pb.zc);a.Jg(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a))},c=a.getParent();c?c.Ec().run(b):b()}Pd(){return this.ph()}init(a){this.onInit(a)}update(a,b,c){const d=this.Pd();if(d.vn())this.onUpdate(a,b,c);else this.L.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.mn()}`),
860
- Vi(this,d,olympe.sc.pb.aa,a),this.Sa()&&Vi(this,d,olympe.sc.pb.Da,a)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}F(){return[]}onInit(){}onUpdate(){this.L.error(`Brick ${this.db.name(this.Tb())} (${this.Tb()}) is flagged as hardcoded, but method update() has not been overridden.`)}onDestroy(){}getInputs(){var a=this.Pd();return Pi(a,a.db.ub(a.tag,olympe.sc.pb.F))}getOutputs(){var a=this.Pd();return Pi(a,a.db.ub(a.tag,olympe.sc.pb.N))}aa(){return[]}Z(){return new Map}Sa(){return!1}G(a,
861
- b,c,d){a=b.Eb(a,c,!0);void 0!==d&&olympe.D.df(a,d);return a}cc(a,b,c,d,e){olympe.D.Dn([d],f=>{b.set(a,olympe.D.bs(f)?f.valueOf():f)});return this.G(a,b,c,e)}N(){return[this.Da,this.ra]}Da(a,b){Ti(this,b,null)}ra(a,b){Ti(this,null,b)}zc(a,b){const c=this.db,d=olympe.sc.logic.wb.N.Pc(),e=olympe.sc.logic.wb.F,f=olympe.sc.logic.wb.C;this.Nr(d,g=>{var h=g.R();if(h=c.fc(h,e)||c.fc(h,f))g=Wi(g,a,b.bind(null,h)),olympe.D.Ia().onDestroy(g)})}ab(a,b){const c=this.Tb();let d=this.db.name(c);try{const e=[a.Rk()];
862
- let f=a.getParent();for(;null!==f&&f!==olympe.sc.ls;)e.unshift(f.Rk()),f=f.getParent();d=e.map(g=>{if(null!==g){const h=this.db.model(g);return this.db.name(g)||h&&this.db.name(h)||g}return'?'}).join(' > ')}catch(e){this.L.warn(`Impossible to retrieve the stack for brick ${this.db.name(c)}.`)}this.L.error(`An error occurred in brick ${d} (${c}): ${b}\n${b.stack}`)}};olympe.sc.Runnable.P=Jc(olympe.dc.Ba.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.N=olympe.sc.Runnable.P.Pa('01692a4af82e8984742b');
863
- olympe.sc.Runnable.F=olympe.sc.Runnable.P.Pa('01756a18d4921c103111');olympe.sc.Runnable.V=P(olympe.sc.Runnable.P,olympe.sc.pb.aa);olympe.sc.Runnable.Z=P(olympe.sc.Runnable.P,olympe.sc.pb.ka);olympe.sc.Runnable.aa=P(olympe.sc.Runnable.P,olympe.sc.pb.Da);P(olympe.sc.pb.P,olympe.sc.Runnable.N);P(olympe.sc.pb.P,olympe.sc.Runnable.F);olympe.sc.Runnable.prototype.Pd.K=new olympe.D.J(()=>olympe.sc.pb,[]);olympe.sc.Runnable.prototype.G.K=new olympe.D.J(()=>Object,[]);olympe.sc.Runnable.prototype.cc.K=olympe.D.J.C;function Xi(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Ce)return(a=a.F())?a.valueOf():null;if('function'===typeof a.R)return a.R()}return null}olympe.sc.Ce=class extends olympe.dc.CloudObject{F(){return this.db.ub(this,olympe.sc.Ce.C)[0]}C(){return olympe.dc.CloudObject.get(Xi(this))}toString(){const a=Xi(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Ce.P=olympe.dc.Ba.C('0163c9ae01f2d6e9ca49',olympe.sc.Ce);olympe.sc.Ce.C=olympe.sc.Ce.P.Pa('0169b5a8a33144fb0b49');
864
- P(olympe.dc.CloudObject.P,olympe.sc.Ce.C);olympe.sc.Ce.prototype.F.K=new olympe.D.J(()=>String,[]);olympe.sc.Ce.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.Co=class extends olympe.dm.Pb{C(){return olympe.sc.Ze.fh.Bl}};olympe.sc.Co.P=olympe.dc.Ba.C('0163a68ce44f3d1fa84c',olympe.sc.Co);olympe.sc.xl=class extends olympe.dm.BrickMetadata{};olympe.sc.xl.P=olympe.dc.Ba.C('016324fde11a836f76c2',olympe.sc.xl);let Yi=null;
865
- function Zi(a,b){Yi=a;(new olympe.dc.jf(a,olympe.dc.Ed.Mi)).sb(olympe.sc.La.Me.C).sb(olympe.sc.jd.F.Pc()).hb((c,d)=>{if(c)olympe.pa.Xa('sc').error('Error while loading business container:',c.message),b(olympe.sc.jd.C.qc);else{c=null;for(const [e,f]of d.Bc.dd())e===olympe.sc.jd.F.R()&&(c=f);null!==c?$e(Ve(new olympe.dc.jf(c),olympe.dc.Rb.rf),(e,f)=>{const g=olympe.dc.ic.Tc,h=olympe.dc.ic.yi,k=f.R();f=f.Oa();return olympe.dc.Na().th(e,olympe.sc.xl)&&f===olympe.dc.za.ORIGIN&&(k===g||k===h)}).hb(()=>
866
- b(olympe.sc.jd.C.Hp)):(olympe.pa.Xa('sc').error('No container found for the application',a),b(olympe.sc.jd.C.cm))}})}olympe.sc.jd=class extends olympe.dc.CloudObject{};olympe.sc.jd.C={Hp:0,cm:1,qc:2};olympe.sc.jd.P=olympe.dc.Ba.C('017b3aa8fae1e3d044dc',olympe.sc.jd);olympe.sc.jd.F=olympe.sc.jd.P.Pa('017b3aa8fd1659291b92');olympe.sc.jd.N=olympe.sc.jd.P.Pa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.P=olympe.dc.Ba.C('01631aacd5c1f9d61c5d',olympe.sc.Map);olympe.sc.Wg=class extends olympe.sc.Map{};olympe.sc.Wg.P=olympe.dc.Ba.C('01631aacd8276ea98490',olympe.sc.Wg);olympe.sc.ak=class extends olympe.dm.File{N(){const a=olympe.D.Kc(olympe.D.Wa);this.Tk(b=>{a.update(olympe.D.Bb(b))});return a.Eb()}};olympe.sc.ak.P=Ec('01644b6297305d62fca2',olympe.sc.ak);olympe.sc.ak.prototype.N.K=olympe.D.J.F;olympe.sc.ud=class extends olympe.dm.File{N(){return this.Fb(olympe.sc.ud.F)}V(){return this.Fb(olympe.sc.ud.N)}Z(){return this.Ie(olympe.sc.ud.aa)}};olympe.sc.ud.P=Ec('01647e113043c637b541',olympe.sc.ud);olympe.sc.ud.F=olympe.sc.ud.P.Ca('01647e35ecd24ef0b88d');olympe.sc.ud.N=olympe.sc.ud.P.Ca('01647e677f5d1cfbdf42');olympe.sc.ud.aa=olympe.sc.ud.P.Ca('01647e6780999bf8bd25');olympe.sc.ud.prototype.N.K=olympe.D.J.F;olympe.sc.ud.prototype.V.K=olympe.D.J.F;olympe.sc.ud.prototype.Z.K=olympe.D.J.G;olympe.sc.Bm=class extends olympe.dm.File{};olympe.sc.Bm.P=Ec('0164643c432146a71d5c',olympe.sc.Bm);olympe.sc.tr=class extends olympe.dc.CloudObject{};olympe.sc.tr.P=olympe.dc.Ba.C('016421bb3797e22d1c4e',olympe.sc.tr);olympe.sc.logic={};olympe.sc.logic.hp=(a,b)=>a===b?0:a>b?1:-1;
867
- olympe.sc.logic.Zz=(a,b,c,d,e,f,g)=>{const h=b.R();b=olympe.D.Ya(b.C().R());let k,l;if(b===olympe.dc.xa(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.Fb(h).toLowerCase();else if(b===olympe.dc.xa(olympe.dm.Number))k=c.valueOf(),l=p=>p.Ie(h);else if(b===olympe.dc.xa(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.D.Fa([p.kj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.Na().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
868
- return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.hp(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.hp(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.xg().filter(p=>olympe.D.Fa([l(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Ac(d.valueOf()?1===q:0<=q)},olympe.D.qa,'FilterList ListDefBuilder Filter TransformFlows')).nf())};
869
- olympe.sc.logic.uC=(a,b)=>{if(a instanceof olympe.D.ea)return a;if(a instanceof olympe.D.Wa)return a.ts();if(a instanceof olympe.D.qa)return a.Tr();if('string'===typeof a||'number'===typeof a)return olympe.D.ya(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.ea.Up};olympe.sc.logic.ta={};olympe.sc.logic.ta.Uo=class{constructor(a,b,c){this.P=olympe.dc.Ba.C(a,b,...c)}R(){return this.P.R()}};olympe.sc.logic.ta.Uo.la=[olympe.dc.ze];const $i=Object.create(null),aj=new Map;function bj(a){if(void 0===$i[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Gc(a)}function cj(a,b,c=olympe.sc.logic.Function){if(aj.has(a))throw c=bj(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.Ba.C(a,b,...[]);aj.set(a,{P:d,GC:b,tC:c});return d}
870
- olympe.sc.logic.Ba=class{constructor(){}static C(a,b,...c){if($i[a])throw c=bj(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.ta.Uo(a,b,[olympe.sc.O.Ea].concat(c));return $i[a]=b}};olympe.sc.logic.Yy=class{};olympe.sc.logic.Mj=class extends olympe.dc.CloudObject{};olympe.sc.logic.Mj.P=olympe.dc.Ba.C('01621fb84e320000cf00',olympe.sc.logic.Mj);olympe.sc.logic.Error=class{constructor(a,b){this.code=a;this.ds=b}static create(a,b){return new olympe.sc.logic.Error(b,a)}Iw(){return this.ds}kw(){return this.code}};z('olympe.sc.logic.Error',olympe.sc.logic.Error);olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.kw;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Iw;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;
871
- olympe.sc.logic.Rj=class extends olympe.sc.logic.Mj{static create(a,b){return new olympe.sc.logic.Error(b,a)}};olympe.sc.logic.Rj.P=olympe.dc.Ba.C('016eeb5ede9f3094d8f0',olympe.sc.logic.Rj);olympe.sc.logic.le=class extends olympe.dc.CloudObject{C(){return this.cd(olympe.sc.logic.le.C,olympe.dc.CloudObject)}};olympe.sc.logic.le.P=olympe.dc.Ba.C('016ac4f59ee8ea2081ba',olympe.sc.logic.le);olympe.sc.logic.le.N=olympe.sc.logic.le.P.Ca('017bc044aeacce7ffc8f');olympe.sc.logic.le.C=olympe.sc.logic.le.P.Pa('016ac4f5a0091c4790e2');P(olympe.dc.CloudObject.P,olympe.sc.logic.le.C);olympe.sc.logic.le.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ni=class extends olympe.sc.logic.le{};olympe.sc.logic.Ni.P=olympe.dc.Ba.C('016ac4f59c592b862457',olympe.sc.logic.Ni);olympe.sc.logic.Ni.F=olympe.sc.ne.C.Pc();olympe.sc.logic.Ph=class extends olympe.sc.logic.le{};olympe.sc.logic.Ph.P=olympe.dc.Ba.C('016ac4f59dd99f5df3e1',olympe.sc.logic.Ph);olympe.sc.logic.Ph.F=P(olympe.sc.logic.Ph.P,olympe.sc.ne.F);olympe.sc.logic.Oe=class extends olympe.sc.pb{C(){return olympe.sc.Ze.fh.Nq}ka(){return this.dn().xg().th([olympe.sc.logic.Function]).and().not().th([olympe.sc.logic.Wd,olympe.sc.logic.Zd]).nf()}Bw(){return this.Wl().xg().lj([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Ni.F]).nf()}Cw(){return this.ck().xg().lj([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Ph.F]).nf()}Hf(a){const b=this.db.an(this,[olympe.sc.pb.F],c=>this.db.model(c)===olympe.dc.xa(a));return b?olympe.dc.CloudObject.get(b):null}nh(a){const b=
872
- this.db.an(this,[olympe.sc.pb.N],c=>this.db.model(c)===olympe.dc.xa(a));return b?olympe.dc.CloudObject.get(b):null}fx(){return this.Wl().xg().lj([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Lb).nf()}gx(){return this.ck().xg().lj([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Vb).nf()}};cj('01621fb84e320000f000',olympe.sc.logic.Oe,olympe.sc.logic.Function);m=olympe.sc.logic.Oe.prototype;m.Bw.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.Cw.K=new olympe.D.J(()=>olympe.dc.Aa,[]);
873
- m.Hf.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);m.nh.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);m.fx.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.gx.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.sc.logic.bg=class extends olympe.sc.logic.Oe{F(){return this.Hf('016ac63229782039429f')}G(){return this.nh('016ac6322acf67eebfe7')}N(){return this.ck().xg().sb(olympe.sc.logic.Ic.typeRel).Xk(olympe.sc.logic.Rj).nf().mf().sn(olympe.D.ea.ZERO)}};olympe.sc.logic.bg.C='016ac63229782039429f';olympe.sc.logic.bg.ra='016ac6322acf67eebfe7';olympe.sc.logic.bg.P=cj('01621fb84e320000a000',olympe.sc.logic.bg,olympe.sc.logic.Action);
874
- olympe.sc.logic.bg.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.logic.bg.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);olympe.sc.logic.bg.prototype.N.K=olympe.D.J.V;olympe.sc.logic.qo=class extends olympe.sc.logic.Oe{};olympe.sc.logic.qo.P=cj('01621fb84e320000f011',olympe.sc.logic.qo);olympe.sc.logic.po=class extends olympe.sc.logic.bg{};olympe.sc.logic.po.P=cj('01621fb84e320000f012',olympe.sc.logic.po);olympe.sc.logic.Function=class extends olympe.sc.Runnable{N(){return[this.zc]}Z(){const a=olympe.sc.Ua.bc.xt,b=olympe.sc.Ua.bc.su,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}F(a){return this.getOutputs().map(b=>this.db.al(b,olympe.sc.logic.Ic.typeRel,olympe.sc.logic.Mj)?a.ni.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=>
858
+ olympe.sc.pb.He=olympe.sc.pb.P.Pa('0171838bcfed0000e00e');olympe.sc.pb.qe=olympe.sc.pb.P.Pa('0171838bcfed0000a00a');m=olympe.sc.pb.prototype;m.Nt.K=olympe.D.J.C;m.Vw.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.jw.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.pn.K=olympe.D.J.C;m.kn.K=olympe.D.J.C;m.Sl.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.$j.K=new olympe.D.J(()=>olympe.dc.Aa,[]);function Ui(a){const b=new olympe.dc.Transaction,c=b.create(a).persist(!1).R();b.hb();olympe.D.Ja().onDestroy(()=>{const d=new olympe.dc.Transaction;d.delete(c);d.hb()});return olympe.dc.CloudObject.get(c)}function Vi(a,b){b.qn(a);Si(a.Pd(),b);const c=a.N(),d=Wi(b,c),e=[];c.forEach((f,g)=>{f===a.Da?e[0]=g:f===a.ra&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(Xi(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])})}
859
+ function Yi(a,b){var c=a.Rb();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.F(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>b.yb()||(b.clear(),null===h)?!1:(b.Ec().run(a.update.bind(a,new olympe.sc.cb(b),Array.isArray(h)?h:[h],g)),!0))).subscribe(rxjs.Subscriber.create(h=>h?a.L.debug(e):a.L.debug(f),a.ab.bind(a,b),()=>a.L.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
860
+ function Zi(a,b,c,d){const e=d.Ec(),f=V(a.db,b,c,e.Cb((g,h)=>{const k=d.Rk(h);g?olympe.dc.CloudObject.get(h).run(k):k.destroy()}));e.vc(a.db.C.bind(a.db,b,c,f,!0))}function Wi(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)}})}
861
+ function Xi(a,b,c){const d=olympe.D.Ja(),e=Cd(a.db,a.tag,d.Cb((f,g,h)=>{const k=h?c:b;null!==k&&(h&&b&&b(f,null),null===g||void 0===g?k(f,null):k(f,olympe.sc.gh(g)))}));d.onDestroy(()=>{var f=a.db;const g=U(f,a.tag);null!==g&&(g.U(xd,e),f.Ia.getState()===yd.ag&&f.Ia.aa(e))})}
862
+ olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.L=c}run(a){const b=()=>{Vi(this,a);this.init(a);this.Pd().pn()?Yi(this,a):a.Ec().run(this.update.bind(this,new olympe.sc.cb(a),[],[]));a.mi(olympe.sc.pb.zc);a.Hg(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a))},c=a.getParent();c?c.Ec().run(b):b()}Pd(){return this.nh()}init(a){this.onInit(a)}update(a,b,c){const d=this.Pd();if(d.pn())this.onUpdate(a,b,c);else this.L.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.gn()}`),
863
+ Zi(this,d,olympe.sc.pb.aa,a),this.Sa()&&Zi(this,d,olympe.sc.pb.Da,a)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}F(){return[]}onInit(){}onUpdate(){this.L.error(`Brick ${this.db.name(this.Rb())} (${this.Rb()}) is flagged as hardcoded, but method update() has not been overridden.`)}onDestroy(){}getInputs(){var a=this.Pd();return Ti(a,a.db.ub(a.tag,olympe.sc.pb.F))}getOutputs(){var a=this.Pd();return Ti(a,a.db.ub(a.tag,olympe.sc.pb.N))}aa(){return[]}Y(){return new Map}Sa(){return!1}G(a,
864
+ b,c,d){a=b.Eb(a,c,!0);void 0!==d&&olympe.D.bf(a,d);return a}fc(a,b,c,d,e){olympe.D.xn([d],f=>{b.set(a,olympe.D.Wr(f)?f.valueOf():f)});return this.G(a,b,c,e)}N(){return[this.Da,this.ra]}Da(a,b){Xi(this,b,null)}ra(a,b){Xi(this,null,b)}zc(a,b){const c=this.db,d=olympe.sc.logic.wb.N.Pc(),e=olympe.sc.logic.wb.F,f=olympe.sc.logic.wb.C;this.Ir(d,g=>{var h=g.R();if(h=c.ic(h,e)||c.ic(h,f))g=$i(g,a,b.bind(null,h)),olympe.D.Ja().onDestroy(g)})}ab(a,b){const c=this.Rb();let d=this.db.name(c);try{const e=[a.Nk()];
865
+ let f=a.getParent();for(;null!==f&&f!==olympe.sc.es;)e.unshift(f.Nk()),f=f.getParent();d=e.map(g=>{if(null!==g){const h=this.db.model(g);return this.db.name(g)||h&&this.db.name(h)||g}return'?'}).join(' > ')}catch(e){this.L.warn(`Impossible to retrieve the stack for brick ${this.db.name(c)}.`)}this.L.error(`An error occurred in brick ${d} (${c}): ${b}\n${b.stack}`)}};olympe.sc.Runnable.P=Nc(olympe.dc.Ba.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.N=olympe.sc.Runnable.P.Pa('01692a4af82e8984742b');
866
+ olympe.sc.Runnable.F=olympe.sc.Runnable.P.Pa('01756a18d4921c103111');olympe.sc.Runnable.U=P(olympe.sc.Runnable.P,olympe.sc.pb.aa);olympe.sc.Runnable.Y=P(olympe.sc.Runnable.P,olympe.sc.pb.ka);olympe.sc.Runnable.aa=P(olympe.sc.Runnable.P,olympe.sc.pb.Da);P(olympe.sc.pb.P,olympe.sc.Runnable.N);P(olympe.sc.pb.P,olympe.sc.Runnable.F);olympe.sc.Runnable.prototype.Pd.K=new olympe.D.J(()=>olympe.sc.pb,[]);olympe.sc.Runnable.prototype.G.K=new olympe.D.J(()=>Object,[]);olympe.sc.Runnable.prototype.fc.K=olympe.D.J.C;function aj(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Ce)return(a=a.F())?a.valueOf():null;if('function'===typeof a.R)return a.R()}return null}olympe.sc.Ce=class extends olympe.dc.CloudObject{F(){return this.db.ub(this,olympe.sc.Ce.C)[0]}C(){return olympe.dc.CloudObject.get(aj(this))}toString(){const a=aj(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Ce.P=olympe.dc.Ba.C('0163c9ae01f2d6e9ca49',olympe.sc.Ce);olympe.sc.Ce.C=olympe.sc.Ce.P.Pa('0169b5a8a33144fb0b49');
867
+ P(olympe.dc.CloudObject.P,olympe.sc.Ce.C);olympe.sc.Ce.prototype.F.K=new olympe.D.J(()=>String,[]);olympe.sc.Ce.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.wo=class extends olympe.dm.Pb{C(){return olympe.sc.Xe.dh.xl}};olympe.sc.wo.P=olympe.dc.Ba.C('0163a68ce44f3d1fa84c',olympe.sc.wo);olympe.sc.tl=class extends olympe.dm.BrickMetadata{};olympe.sc.tl.P=olympe.dc.Ba.C('016324fde11a836f76c2',olympe.sc.tl);let bj=null;
868
+ function cj(a,b){bj=a;(new olympe.dc.gf(a,olympe.dc.Ed.Li)).sb(olympe.sc.La.Me.C).sb(olympe.sc.jd.F.Pc()).hb((c,d)=>{if(c)olympe.pa.Xa('sc').error('Error while loading business container:',c.message),b(olympe.sc.jd.C.cc);else{c=null;for(const [e,f]of d.Bc.dd())e===olympe.sc.jd.F.R()&&(c=f);null!==c?df(Ze(new olympe.dc.gf(c),olympe.dc.Sb.pf),(e,f)=>{const g=olympe.dc.kc.Tc,h=olympe.dc.kc.xi,k=f.R();f=f.Oa();return olympe.dc.Na().rh(e,olympe.sc.tl)&&f===olympe.dc.za.ORIGIN&&(k===g||k===h)}).hb(()=>
869
+ b(olympe.sc.jd.C.Bp)):(olympe.pa.Xa('sc').error('No container found for the application',a),b(olympe.sc.jd.C.Zl))}})}olympe.sc.jd=class extends olympe.dc.CloudObject{};olympe.sc.jd.C={Bp:0,Zl:1,cc:2};olympe.sc.jd.P=olympe.dc.Ba.C('017b3aa8fae1e3d044dc',olympe.sc.jd);olympe.sc.jd.F=olympe.sc.jd.P.Pa('017b3aa8fd1659291b92');olympe.sc.jd.N=olympe.sc.jd.P.Pa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.P=olympe.dc.Ba.C('01631aacd5c1f9d61c5d',olympe.sc.Map);olympe.sc.Ug=class extends olympe.sc.Map{};olympe.sc.Ug.P=olympe.dc.Ba.C('01631aacd8276ea98490',olympe.sc.Ug);olympe.sc.Yj=class extends olympe.dm.File{N(){const a=olympe.D.Kc(olympe.D.Wa);this.Pk(b=>{a.update(olympe.D.Bb(b))});return a.Eb()}};olympe.sc.Yj.P=Ic('01644b6297305d62fca2',olympe.sc.Yj);olympe.sc.Yj.prototype.N.K=olympe.D.J.F;olympe.sc.ud=class extends olympe.dm.File{N(){return this.Fb(olympe.sc.ud.F)}U(){return this.Fb(olympe.sc.ud.N)}Y(){return this.Ie(olympe.sc.ud.aa)}};olympe.sc.ud.P=Ic('01647e113043c637b541',olympe.sc.ud);olympe.sc.ud.F=olympe.sc.ud.P.Ca('01647e35ecd24ef0b88d');olympe.sc.ud.N=olympe.sc.ud.P.Ca('01647e677f5d1cfbdf42');olympe.sc.ud.aa=olympe.sc.ud.P.Ca('01647e6780999bf8bd25');olympe.sc.ud.prototype.N.K=olympe.D.J.F;olympe.sc.ud.prototype.U.K=olympe.D.J.F;olympe.sc.ud.prototype.Y.K=olympe.D.J.G;olympe.sc.wm=class extends olympe.dm.File{};olympe.sc.wm.P=Ic('0164643c432146a71d5c',olympe.sc.wm);olympe.sc.mr=class extends olympe.dc.CloudObject{};olympe.sc.mr.P=olympe.dc.Ba.C('016421bb3797e22d1c4e',olympe.sc.mr);olympe.sc.logic={};olympe.sc.logic.ap=(a,b)=>a===b?0:a>b?1:-1;
870
+ olympe.sc.logic.bA=(a,b,c,d,e,f,g)=>{const h=b.R();b=olympe.D.Ya(b.C().R());let k,l;if(b===olympe.dc.xa(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.Fb(h).toLowerCase();else if(b===olympe.dc.xa(olympe.dm.Number))k=c.valueOf(),l=p=>p.Ie(h);else if(b===olympe.dc.xa(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.D.Fa([p.ij(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.Na().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
871
+ return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.ap(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.ap(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.vg().filter(p=>olympe.D.Fa([l(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Ac(d.valueOf()?1===q:0<=q)},olympe.D.qa,'FilterList ListDefBuilder Filter TransformFlows')).lf())};
872
+ olympe.sc.logic.xC=(a,b)=>{if(a instanceof olympe.D.ea)return a;if(a instanceof olympe.D.Wa)return a.ns();if(a instanceof olympe.D.qa)return a.Nr();if('string'===typeof a||'number'===typeof a)return olympe.D.ya(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.ea.Op};olympe.sc.logic.ta={};olympe.sc.logic.ta.Oo=class{constructor(a,b,c){this.P=olympe.dc.Ba.C(a,b,...c)}R(){return this.P.R()}};olympe.sc.logic.ta.Oo.la=[olympe.dc.ze];const dj=Object.create(null),ej=new Map;function fj(a){if(void 0===dj[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Kc(a)}function gj(a,b,c=olympe.sc.logic.Function){if(ej.has(a))throw c=fj(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.Ba.C(a,b,...[]);ej.set(a,{P:d,JC:b,wC:c});return d}
873
+ olympe.sc.logic.Ba=class{constructor(){}static C(a,b,...c){if(dj[a])throw c=fj(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.ta.Oo(a,b,[olympe.sc.O.Ea].concat(c));return dj[a]=b}};olympe.sc.logic.bz=class{};olympe.sc.logic.Jj=class extends olympe.dc.CloudObject{};olympe.sc.logic.Jj.P=olympe.dc.Ba.C('01621fb84e320000cf00',olympe.sc.logic.Jj);olympe.sc.logic.Error=class{constructor(a,b){this.code=a;this.Yr=b}static create(a,b){return new olympe.sc.logic.Error(b,a)}Fw(){return this.Yr}hw(){return this.code}};z('olympe.sc.logic.Error',olympe.sc.logic.Error);olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.hw;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Fw;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;
874
+ olympe.sc.logic.Oj=class extends olympe.sc.logic.Jj{static create(a,b){return new olympe.sc.logic.Error(b,a)}};olympe.sc.logic.Oj.P=olympe.dc.Ba.C('016eeb5ede9f3094d8f0',olympe.sc.logic.Oj);olympe.sc.logic.le=class extends olympe.dc.CloudObject{C(){return this.cd(olympe.sc.logic.le.C,olympe.dc.CloudObject)}};olympe.sc.logic.le.P=olympe.dc.Ba.C('016ac4f59ee8ea2081ba',olympe.sc.logic.le);olympe.sc.logic.le.N=olympe.sc.logic.le.P.Ca('017bc044aeacce7ffc8f');olympe.sc.logic.le.C=olympe.sc.logic.le.P.Pa('016ac4f5a0091c4790e2');P(olympe.dc.CloudObject.P,olympe.sc.logic.le.C);olympe.sc.logic.le.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Mi=class extends olympe.sc.logic.le{};olympe.sc.logic.Mi.P=olympe.dc.Ba.C('016ac4f59c592b862457',olympe.sc.logic.Mi);olympe.sc.logic.Mi.F=olympe.sc.ne.C.Pc();olympe.sc.logic.Oh=class extends olympe.sc.logic.le{};olympe.sc.logic.Oh.P=olympe.dc.Ba.C('016ac4f59dd99f5df3e1',olympe.sc.logic.Oh);olympe.sc.logic.Oh.F=P(olympe.sc.logic.Oh.P,olympe.sc.ne.F);olympe.sc.logic.Oe=class extends olympe.sc.pb{C(){return olympe.sc.Xe.dh.Iq}ka(){return this.Zm().vg().rh([olympe.sc.logic.Function]).and().not().rh([olympe.sc.logic.Vd,olympe.sc.logic.Yd]).lf()}yw(){return this.Sl().vg().jj([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Mi.F]).lf()}zw(){return this.$j().vg().jj([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Oh.F]).lf()}Hf(a){const b=this.db.Wm(this,[olympe.sc.pb.F],c=>this.db.model(c)===olympe.dc.xa(a));return b?olympe.dc.CloudObject.get(b):null}lh(a){const b=
875
+ this.db.Wm(this,[olympe.sc.pb.N],c=>this.db.model(c)===olympe.dc.xa(a));return b?olympe.dc.CloudObject.get(b):null}ex(){return this.Sl().vg().jj([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Lb).lf()}gx(){return this.$j().vg().jj([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Vb).lf()}};gj('01621fb84e320000f000',olympe.sc.logic.Oe,olympe.sc.logic.Function);m=olympe.sc.logic.Oe.prototype;m.yw.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.zw.K=new olympe.D.J(()=>olympe.dc.Aa,[]);
876
+ m.Hf.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);m.lh.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);m.ex.K=new olympe.D.J(()=>olympe.dc.Aa,[]);m.gx.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.sc.logic.$f=class extends olympe.sc.logic.Oe{F(){return this.Hf('016ac63229782039429f')}G(){return this.lh('016ac6322acf67eebfe7')}N(){return this.$j().vg().sb(olympe.sc.logic.Ic.typeRel).Tk(olympe.sc.logic.Oj).lf().kf().ln(olympe.D.ea.ZERO)}};olympe.sc.logic.$f.C='016ac63229782039429f';olympe.sc.logic.$f.ra='016ac6322acf67eebfe7';olympe.sc.logic.$f.P=gj('01621fb84e320000a000',olympe.sc.logic.$f,olympe.sc.logic.Action);
877
+ olympe.sc.logic.$f.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.logic.$f.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);olympe.sc.logic.$f.prototype.N.K=olympe.D.J.U;olympe.sc.logic.ko=class extends olympe.sc.logic.Oe{};olympe.sc.logic.ko.P=gj('01621fb84e320000f011',olympe.sc.logic.ko);olympe.sc.logic.jo=class extends olympe.sc.logic.$f{};olympe.sc.logic.jo.P=gj('01621fb84e320000f012',olympe.sc.logic.jo);olympe.sc.logic.Function=class extends olympe.sc.Runnable{N(){return[this.zc]}Y(){const a=olympe.sc.Ua.ec.ut,b=olympe.sc.Ua.ec.pu,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}F(a){return this.getOutputs().map(b=>this.db.Xk(b,olympe.sc.logic.Ic.typeRel,olympe.sc.logic.Jj)?a.mi.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=>
875
878
  c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.P=olympe.dc.Ba.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.O.Ea);olympe.sc.logic.Ic=class extends olympe.dc.CloudObject{C(){return this.cd(olympe.sc.logic.Ic.typeRel,olympe.dc.CloudObject)}F(){return this.Ie(olympe.sc.logic.Ic.C)}};olympe.sc.logic.Ic.P=olympe.dc.Ba.C('0168a431d25001540000',olympe.sc.logic.Ic);olympe.sc.logic.Ic.C=olympe.sc.logic.Ic.P.Ca('01740c5d4ae4b520dd01');olympe.sc.logic.Ic.typeRel=olympe.sc.logic.Ic.P.Pa('0168a431d3b9b7438424');P(olympe.dc.CloudObject.P,olympe.sc.logic.Ic.typeRel);
876
879
  olympe.sc.logic.Ic.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ic.prototype.F.K=olympe.D.J.G;olympe.sc.logic.Lb=class extends olympe.sc.logic.Ic{};olympe.sc.logic.Lb.P=olympe.dc.Ba.C('0168a431d25001540001',olympe.sc.logic.Lb);olympe.sc.logic.Lb.ra=olympe.sc.logic.Ic.P.Ca('01740c5d4ae4b520dd02');olympe.sc.logic.Lb.ka=P(olympe.sc.logic.Lb.P,olympe.sc.pb.F);olympe.sc.logic.Lb.F=olympe.sc.logic.Lb.P.Pa('0168a431d91f2578000b',olympe.dc.za.ORIGIN);olympe.sc.logic.Lb.N=olympe.sc.logic.Lb.P.Pa('01621fb84e32000000a1',olympe.dc.za.ORIGIN);
877
- olympe.sc.logic.Lb.aa=olympe.sc.logic.Lb.P.Pa('01621fb84e32000000d1',olympe.dc.za.ORIGIN);olympe.sc.logic.Vb=class extends olympe.sc.logic.Ic{};olympe.sc.logic.Vb.P=olympe.dc.Ba.C('0168a431d25001540002',olympe.sc.logic.Vb);olympe.sc.logic.Vb.ka=P(olympe.sc.logic.Vb.P,olympe.sc.pb.N);olympe.sc.logic.Vb.F=olympe.sc.logic.Vb.P.Pa('0168a431d91f25780003',olympe.dc.za.ORIGIN);olympe.sc.logic.Vb.aa=olympe.sc.logic.Vb.P.Pa('01621fb84e32000000a2',olympe.dc.za.ORIGIN);olympe.sc.logic.Vb.N=olympe.sc.logic.Vb.P.Pa('01621fb84e32000000d2',olympe.dc.za.ORIGIN);olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.Pd().F().R();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.P=olympe.dc.Ba.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.O.Ea);olympe.sc.logic.Wd=class extends olympe.sc.logic.Function{run(a){Ri(this,a);const b=a.getParent(),c=this.db.fc(this,olympe.sc.logic.Wd.C),d=this.db.fc(this,olympe.sc.logic.Wd.G);a.on(c,e=>b.set(d,e),this.tag)}V(){return this.cd(olympe.sc.logic.Wd.C,olympe.sc.logic.Lb)}bb(){return this.cd(olympe.sc.logic.Wd.G,olympe.sc.logic.Vb)}};olympe.sc.logic.Wd.P=olympe.dc.Ba.C('01621fb84e32000000a0',olympe.sc.logic.Wd,olympe.sc.O.Ea);olympe.sc.logic.Wd.C=P(olympe.sc.logic.Wd.P,olympe.sc.logic.Lb.N);
878
- olympe.sc.logic.Wd.G=P(olympe.sc.logic.Wd.P,olympe.sc.logic.Vb.aa);olympe.sc.logic.Wd.prototype.V.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.logic.Wd.prototype.bb.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);olympe.sc.logic.Zd=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.fc(this,olympe.sc.logic.Zd.G),d=this.db.fc(this,olympe.sc.logic.Zd.C);b.on(c,e=>a.set(d,e),b.Y())}bb(){return this.cd(olympe.sc.logic.Zd.G,olympe.sc.logic.Lb)}V(){return this.cd(olympe.sc.logic.Zd.C,olympe.sc.logic.Vb)}};olympe.sc.logic.Zd.P=olympe.dc.Ba.C('01621fb84e32000000d0',olympe.sc.logic.Zd,olympe.sc.O.Ea);olympe.sc.logic.Zd.G=P(olympe.sc.logic.Zd.P,olympe.sc.logic.Lb.aa);
879
- olympe.sc.logic.Zd.C=P(olympe.sc.logic.Zd.P,olympe.sc.logic.Vb.N);olympe.sc.logic.Zd.prototype.bb.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.logic.Zd.prototype.V.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);function Wi(a,b,c){const d=a.db.fc(a,olympe.sc.logic.wb.ra)||a.db.fc(a,olympe.sc.logic.wb.aa),e=a.db.fc(a,olympe.sc.logic.wb.ka),f=a.db.Sf((()=>{let k=null,l=a.db.fc(a,olympe.sc.logic.wb.F);l?k=a.db.fc(l,olympe.dm.Property.typeRel):(l=a.db.fc(a,olympe.sc.logic.wb.C))&&(k=a.db.fc(l,olympe.sc.logic.Ic.typeRel));return k||olympe.dc.CloudObject.P.R()})(),olympe.dm.qf)?new olympe.D.Wb('Pipe Context'):null,g=a.F.bind(a,b,c,f);if(null!==d&&null!==e){let k;const l=b.sj(e,n=>{k&&k();k=n.on(d,g,e)});return()=>
880
- {g(null);l();k&&k()}}const h=xd(a.db,a,olympe.sc.logic.wb.valueProp,g);return()=>{g(null);a.db.F(a,olympe.sc.logic.wb.valueProp,h)}}
881
- olympe.sc.logic.wb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.L=c;this.C=`detachObject${this.tag}`}F(a,b,c,d){null!==c&&c.Af();const e=a.get(this.C);e&&(e(),a.remove(this.C));const f=olympe.sc.ih(d);if(f instanceof olympe.dc.CloudObject){if(d=f.R(),this.Mk(a,d,[d]),null!==c&&'function'===typeof f.getValue){c.run(()=>{olympe.D.wc([f.getValue()],g=>{b(g.valueOf())})});return}}else f instanceof olympe.dc.Va&&this.Mk(a,`qr-${f.hash}`,ye(f));b(f)}Mk(a,b,c){const d=a.getParent();
882
- d.Mk(b,c);a.set(this.C,()=>Gi(d,b))}getValue(a){return this.Mf(olympe.sc.logic.wb.valueProp,a||olympe.dc.W.Sb.ih,Object)}Rt(){const a=this.transform(olympe.sc.logic.wb.C,olympe.sc.logic.Ic.typeRel);a.Gd(olympe.dc.CloudObject);return a.Oc()}dx(){return this.cd(olympe.sc.logic.wb.ka,olympe.dc.CloudObject)}bx(){return this.cd(olympe.sc.logic.wb.ra,olympe.sc.logic.Vb)}cx(){return this.cd(olympe.sc.logic.wb.aa,olympe.dm.Property)}tw(){return this.cd(olympe.sc.logic.wb.N,olympe.dc.CloudObject)}rw(){return this.cd(olympe.sc.logic.wb.C,
883
- olympe.sc.logic.Lb)}sw(){return this.cd(olympe.sc.logic.wb.F,olympe.dm.Property)}};olympe.sc.logic.wb.P=olympe.dc.Ba.C('0168a431d91f25780000',olympe.sc.logic.wb,olympe.sc.O.Ea);olympe.sc.logic.wb.valueProp=olympe.sc.logic.wb.P.Ca('0168a431d91f25780001');olympe.sc.logic.wb.ka=olympe.sc.logic.wb.P.Pa('0168a431d91f25780002');olympe.sc.logic.wb.ra=P(olympe.sc.logic.wb.P,olympe.sc.logic.Vb.F);olympe.sc.logic.wb.aa=olympe.sc.logic.wb.P.Pa('0168a431d91f25780004');olympe.sc.logic.wb.N=olympe.sc.logic.wb.P.Pa('0168a431d91f2578000a');
884
- olympe.sc.logic.wb.C=P(olympe.sc.logic.wb.P,olympe.sc.logic.Lb.F);olympe.sc.logic.wb.F=olympe.sc.logic.wb.P.Pa('0168a431d91f2578000c');P(olympe.dc.CloudObject.P,olympe.sc.logic.wb.ka);P(olympe.dm.Property.P,olympe.sc.logic.wb.aa);P(olympe.dc.CloudObject.P,olympe.sc.logic.wb.N);P(olympe.dm.Property.P,olympe.sc.logic.wb.F);m=olympe.sc.logic.wb.prototype;m.Rt.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.dx.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
885
- m.bx.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);m.cx.K=new olympe.D.J(()=>olympe.dm.Property,[]);m.tw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.rw.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);m.sw.K=new olympe.D.J(()=>olympe.dm.Property,[]);olympe.sc.logic.Yd=class extends olympe.sc.logic.Function{};olympe.sc.logic.Yd.P=olympe.dc.Ba.C('017dc8c114aa61a0e27f',olympe.sc.logic.Yd);olympe.sc.logic.Yd.C=olympe.sc.logic.Yd.P.Pa('017dc8d6d8ef9135f08a');olympe.sc.logic.Yd.G=olympe.sc.logic.Yd.P.Pa('017dc8d6d8ef9135f08b');P(olympe.dm.Nb.P,olympe.sc.logic.Yd.G);function dj(a,b){const c=a.Pd(),d=c.Xl().R(),e=c.Yl().R(),f=c.fn().R();b.on(d,g=>{g&&(g=new Map(a.getInputs().map(h=>[h,b.get(h)])),g=olympe.sc.logic.uk.ia(g),olympe.H.wa.nb.zb.get(a.Tb(),g).then(h=>{h=ej(h,a.V.bind(a,b));for(const [k,l]of h)k!==e&&k!==f&&b.set(k,l);b.set(e,h.get(e));b.set(f,h.get(f))}).catch(h=>{b.set(f,olympe.sc.logic.Rj.create(h.toString(),1))}))},b.Y())}
886
- function fj(a,b,c,d,e,f){const g=n=>{if(null!==n){e.cancel();k&&k();l&&l();try{const p=new Map(a.getOutputs().map(r=>[r,b.get(r)])),q=olympe.sc.logic.uk.ia(p);f.Le(q).finally(()=>b.destroy())}catch(p){n=Error(`Error while serializing the response from remote action ${a.Tb()}: ${p.message}`),f.zg(n).finally(()=>b.destroy())}}},h=b.Y(),k=b.on(c,g,h),l=b.on(d,g,h)}
887
- olympe.sc.logic.Qh=class extends olympe.sc.logic.Function{constructor(a,b,c,d,e){super(a,b,c);this.bb=d;this.timeout=e}run(a){a.tn()||(this.db.fb(this,olympe.sc.logic.Qh.C)?this.Xc(a):(Ri(this,a),dj(this,a)))}Xc(a){const b=this.Tb(),c=this.Pd(),d=c.Yr().R(),e=c.Xl().R(),f=c.Yl().R(),g=c.fn().R();(new olympe.H.wa.nb.zb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.$h('remote call'),l=ej(h.body(),this.V.bind(this,k)),n=Ib(()=>{h.zg(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
888
- k.destroy()},this.timeout);fj(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.Cj().then(p=>{var q=k.get(d);null!==q&&olympe.dc.xa(q)!==p&&(q=this.Tb(),this.L.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,l.get(e))})},h=>{const k=this.Tb();this.L.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}V(a,b){const c=Array.from(b.ee()).map(d=>d.tag());
889
- Kc(this.bb,a.Ec(),b,[],c)}};olympe.sc.logic.Qh.P=olympe.dc.Ba.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Qh,olympe.sc.O.Ea,olympe.dc.db.O.va,new olympe.T.fa(olympe.sc.Config.Dq));olympe.sc.logic.Qh.C=olympe.sc.logic.Qh.P.Ca('017a7b0c62a02a89444f');function ej(a,b){var c=(new olympe.dc.W.Li(olympe.dc.Ja.Vc)).C(a.p||[]);b&&b(c);c=new Map;for(const [d,e]of Object.entries(a.v||{}))c.set(d,gj(olympe.sc.logic.uk,e,b));return c}function hj(a){a.Bc=new olympe.dc.db.xc;a.values=Object.create(null)}
890
- function gj(a,b,c){if(null===b||void 0===b)return null;switch(b.t){case 1:return new Date(b.d);case 2:return olympe.D.Color.create(b.r,b.g,b.b,b.a);case 3:return olympe.sc.logic.Error.create(b.m,b.c);case 4:return olympe.dc.CloudObject.get(b.v);case 5:return se(b.v);case 6:return Be(b.v,c);case 7:return new Map(Object.entries(b.m).map(([d,e])=>[d,gj(a,e,c)]));default:return Array.isArray(b)?b.map(d=>gj(a,d,c)):'object'===typeof b?Object.entries(b).reduce((d,[e,f])=>{d[e]=gj(a,f,c);return d},{}):b}}
891
- function ij(a,b){var c=a.db;a=a.Bc;if(c.Gb(b)){a.F(b,c.rd(b,!0),0);a.Ra(olympe.dc.ic.Tc,b,c.model(b),0);for(const [d,e,f]of Ad(c,b))(c=a.Jf(f))&&c.se()&&(e===olympe.dc.za.DESTINATION?a.Ra(d,b,f,0):a.Ra(d,f,b,0))}else olympe.pa.Xa('Remote Action').error(`Try to serialize an instance ${b} that does not exist in the local datacloud.`)}
892
- olympe.sc.logic.uk=class{constructor(){this.db=olympe.dc.Na();hj(this)}static ia(a){const b=new olympe.sc.logic.uk;a.forEach((c,d)=>{null!==c&&void 0!==c&&(b.values[d]=b.C(c))});return b.flush()}flush(){const a=Object.create(null),b=new olympe.dc.transaction.wd;this.Bc.Mc(b);a.p=$d(b);a.v=this.values;hj(this);return a}C(a){switch(!0){case a instanceof olympe.D.jb: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,
893
- r:a.Of().valueOf(),g:a.If().valueOf(),b:a.Df().valueOf(),a:a.Cf().valueOf()};case a instanceof olympe.sc.logic.Error:return{t:3,c:a.code,m:a.ds};case a&&'function'===typeof a.R:return a=a.R(),ij(this,a),{t:4,v:a};case a instanceof olympe.dc.gb:return{t:5,v:a.ia()};case a instanceof olympe.dc.Va:return{t:6,v:a.ia()};case Array.isArray(a):return a.map(this.C.bind(this));case a instanceof Map:const b=Object.create(null);for(const [c,d]of a)'string'===typeof c&&(b[c]=this.C(d));return{t:7,m:b};case null===
894
- a:case void 0===a:return null;case 'object'===typeof a:return Object.entries(a).reduce((c,[d,e])=>{c[d]=this.C(e);return c},{});default:return a}}};olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Rl=class{constructor(a){this.db=olympe.dc.Na();this.typeRel=a}};olympe.sc.logic.controllers.Rl.C={Zy:-1,Uz:1};olympe.sc.logic.controllers.xA=class extends olympe.sc.logic.controllers.Rl{constructor(){super(olympe.sc.logic.le.C)}};olympe.sc.logic.controllers.zA=class extends olympe.sc.logic.controllers.Rl{constructor(){super(olympe.sc.logic.Ic.typeRel)}};olympe.sc.logic.Qk={};olympe.sc.logic.Qk.Vu=class extends olympe.sc.logic.Function{update(a,[b,c],[d]){const e=olympe.dc.xa(b);e?af(Ve(new olympe.dc.jf(e),olympe.dc.Rb.rf),c).hb(()=>{d(olympe.dc.CloudObject.get(e))}):this.L.warn('Cannot subscribe to an instance with no tag: '+e)}};olympe.sc.logic.Ba.C('0174bf4b7e006e4b788a',olympe.sc.logic.Qk.Vu);olympe.sc.logic.actions={};olympe.sc.logic.Qk.bu=class extends olympe.sc.logic.Function{run(a){Ri(this,a);const [b,c,d]=this.F(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.L.warn('No list to iter upon'),this.L.info(a.Y())):f<e?(b(g.Xe(f)),f++,c((new Date).getTime())):(h.ml(),d((new Date).getTime()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.Bg();f=0;h.Kk();k();break;case 2:k();break;default:this.L.error('Unhandled input')}},this.tag))}};
895
- olympe.sc.logic.Ba.C('0171889b060b6cd54300',olympe.sc.logic.Qk.bu);olympe.sc.logic.ac={};olympe.sc.logic.ac.uo=class extends olympe.sc.logic.Oe{F(){return this.Hf('017dc92292107fb98b21')}};cj('017dc8d6c8fd8c8bd2f0',olympe.sc.logic.ac.uo);olympe.sc.logic.ac.uo.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.logic.ac.Tl=class extends olympe.sc.logic.Oe{F(){return this.Hf('016ac63808535703691c')}};olympe.sc.logic.ac.Tl.P=cj('0169b6876a03f139d50a',olympe.sc.logic.ac.Tl);olympe.sc.logic.ac.Tl.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.logic.ac.hm=class extends olympe.sc.logic.Oe{F(){return this.Hf('016ac63809a9a8e6db96')}G(){return this.nh('016ac6380ab003363b3e')}};cj('01646ad602f933b8caaf',olympe.sc.logic.ac.hm);olympe.sc.logic.ac.hm.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.logic.ac.hm.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);olympe.sc.logic.ac.lk=class extends olympe.sc.logic.Oe{F(){return this.Hf('016ac6380bd98f1d91a0')}N(){return this.nh('016ac63c589ae38ca3ae')}G(){return this.nh('016ac63c5a377fceabaa')}};cj('0168ec42fc01747a98b6',olympe.sc.logic.ac.lk);olympe.sc.logic.ac.lk.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.logic.ac.lk.prototype.N.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);olympe.sc.logic.ac.lk.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);olympe.sc.logic.ac.Zg=class extends olympe.sc.logic.Oe{Xl(){return this.Hf('017a7b07b09e3b22c8b4')}Yr(){return this.Hf('017a7b07ba05807a74b0')}Yl(){return this.nh('017a7b0818c12388d731')}fn(){return this.nh('017a7b085146d5e69aec')}St(){return olympe.D.qa.F}};olympe.sc.logic.ac.Zg.ra='017a7b07b09e3b22c8b4';olympe.sc.logic.ac.Zg.Nd='017a7b07ba05807a74b0';olympe.sc.logic.ac.Zg.Xc='017a7b0818c12388d731';olympe.sc.logic.ac.Zg.C='017a7b085146d5e69aec';
896
- olympe.sc.logic.ac.Zg.P=cj('017a7b07a948e30508fa',olympe.sc.logic.ac.Zg,olympe.sc.logic.Qh);m=olympe.sc.logic.ac.Zg.prototype;m.Xl.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);m.Yr.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);m.Yl.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);m.fn.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);m.St.K=olympe.D.J.V;olympe.sc.logic.ac.Xq=class extends olympe.sc.logic.Oe{F(){return this.Hf('016ac63c5b3ed0562740')}};cj('016a9766c230916ea5ec',olympe.sc.logic.ac.Xq);olympe.sc.logic.ac.Xq.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.query={};olympe.sc.query.Vn=class extends olympe.sc.Wg{};olympe.sc.query.Vn.P=olympe.dc.Ba.C('01631aacd8276ea98491',olympe.sc.query.Vn);olympe.sc.query.jq=class extends olympe.dm.Enum{};olympe.sc.query.jq.P=olympe.dc.Ba.C('01631aacd8276ea98495',olympe.sc.query.jq);olympe.sc.query.uq=class extends olympe.dm.Enum{};olympe.sc.query.uq.P=olympe.dc.Ba.C('01631aacd8276ea98494',olympe.sc.query.uq);olympe.sc.query.wq=class extends olympe.sc.Wg{};olympe.sc.query.wq.P=olympe.dc.Ba.C('01631aacd8276ea98492',olympe.sc.query.wq);olympe.sc.query.xq=class extends olympe.dc.CloudObject{};olympe.sc.query.xq.P=olympe.dc.Ba.C('01631aacd8276ea98493',olympe.sc.query.xq);olympe.sc.La={};olympe.sc.La.Me=class extends olympe.sc.pb{C(){return olympe.sc.Ze.fh.Lu}};olympe.sc.La.Me.P=Jc(olympe.dc.Ba.C('01120300000000adef00',olympe.sc.La.Me));olympe.sc.La.Me.C=olympe.sc.La.Me.P.Pa('0171bc1f15da96dfdb89');P(olympe.dm.md.P,olympe.sc.La.Me.C);olympe.sc.La.Gj=class extends olympe.sc.Runnable{aa(){return[this.Tb()]}V(){return olympe.dc.ld.from(this.Tb()).sb(olympe.sc.La.Me.C).bd()}};olympe.sc.La.Gj.P=Jc(olympe.dc.Ba.C('0113030000000aca1100',olympe.sc.La.Gj));olympe.sc.La.Gj.prototype.V.K=new olympe.D.J(()=>olympe.dm.Nb,[]);olympe.sc.La.tb=class extends olympe.dc.CloudObject{Ut(){return this.qh(olympe.sc.La.tb.F)}Gx(){return this.qh(olympe.sc.La.tb.Ab)}Rd(){return this.Ie(olympe.sc.La.tb.C)}vw(){return this.Fb(olympe.sc.La.tb.ka)}Tw(){return this.Fb(olympe.sc.La.tb.bb)}Sw(){return this.Fb(olympe.sc.La.tb.Sa)}bn(){this.Fb(olympe.sc.La.tb.ab)}Hw(){return this.Fb(olympe.sc.La.tb.ra)}iw(){return this.Fb(olympe.sc.La.tb.N)}Rw(){return this.Fb(olympe.sc.La.tb.Da)}Tt(){return this.Fb(olympe.sc.La.tb.aa)}};
880
+ olympe.sc.logic.Lb.aa=olympe.sc.logic.Lb.P.Pa('01621fb84e32000000d1',olympe.dc.za.ORIGIN);olympe.sc.logic.Vb=class extends olympe.sc.logic.Ic{};olympe.sc.logic.Vb.P=olympe.dc.Ba.C('0168a431d25001540002',olympe.sc.logic.Vb);olympe.sc.logic.Vb.ka=P(olympe.sc.logic.Vb.P,olympe.sc.pb.N);olympe.sc.logic.Vb.F=olympe.sc.logic.Vb.P.Pa('0168a431d91f25780003',olympe.dc.za.ORIGIN);olympe.sc.logic.Vb.aa=olympe.sc.logic.Vb.P.Pa('01621fb84e32000000a2',olympe.dc.za.ORIGIN);olympe.sc.logic.Vb.N=olympe.sc.logic.Vb.P.Pa('01621fb84e32000000d2',olympe.dc.za.ORIGIN);olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.Pd().F().R();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.P=olympe.dc.Ba.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.O.Ea);olympe.sc.logic.Vd=class extends olympe.sc.logic.Function{run(a){Vi(this,a);const b=a.getParent(),c=this.db.ic(this,olympe.sc.logic.Vd.C),d=this.db.ic(this,olympe.sc.logic.Vd.G);a.on(c,e=>b.set(d,e),this.tag)}U(){return this.cd(olympe.sc.logic.Vd.C,olympe.sc.logic.Lb)}bb(){return this.cd(olympe.sc.logic.Vd.G,olympe.sc.logic.Vb)}};olympe.sc.logic.Vd.P=olympe.dc.Ba.C('01621fb84e32000000a0',olympe.sc.logic.Vd,olympe.sc.O.Ea);olympe.sc.logic.Vd.C=P(olympe.sc.logic.Vd.P,olympe.sc.logic.Lb.N);
881
+ olympe.sc.logic.Vd.G=P(olympe.sc.logic.Vd.P,olympe.sc.logic.Vb.aa);olympe.sc.logic.Vd.prototype.U.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.logic.Vd.prototype.bb.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);olympe.sc.logic.Yd=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.ic(this,olympe.sc.logic.Yd.G),d=this.db.ic(this,olympe.sc.logic.Yd.C);b.on(c,e=>a.set(d,e),b.Z())}bb(){return this.cd(olympe.sc.logic.Yd.G,olympe.sc.logic.Lb)}U(){return this.cd(olympe.sc.logic.Yd.C,olympe.sc.logic.Vb)}};olympe.sc.logic.Yd.P=olympe.dc.Ba.C('01621fb84e32000000d0',olympe.sc.logic.Yd,olympe.sc.O.Ea);olympe.sc.logic.Yd.G=P(olympe.sc.logic.Yd.P,olympe.sc.logic.Lb.aa);
882
+ olympe.sc.logic.Yd.C=P(olympe.sc.logic.Yd.P,olympe.sc.logic.Vb.N);olympe.sc.logic.Yd.prototype.bb.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.logic.Yd.prototype.U.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);function $i(a,b,c){const d=a.db.ic(a,olympe.sc.logic.wb.ra)||a.db.ic(a,olympe.sc.logic.wb.aa),e=a.db.ic(a,olympe.sc.logic.wb.ka),f=a.db.Sf((()=>{let k=null,l=a.db.ic(a,olympe.sc.logic.wb.F);l?k=a.db.ic(l,olympe.dm.Property.typeRel):(l=a.db.ic(a,olympe.sc.logic.wb.C))&&(k=a.db.ic(l,olympe.sc.logic.Ic.typeRel));return k||olympe.dc.CloudObject.P.R()})(),olympe.dm.nf)?new olympe.D.Wb('Pipe Context'):null,g=a.F.bind(a,b,c,f);if(null!==d&&null!==e){let k;const l=b.qj(e,n=>{k&&k();k=n.on(d,g,e)});return()=>
883
+ {g(null);l();k&&k()}}const h=Bd(a.db,a,olympe.sc.logic.wb.valueProp,g);return()=>{g(null);a.db.F(a,olympe.sc.logic.wb.valueProp,h)}}
884
+ olympe.sc.logic.wb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.L=c;this.C=`detachObject${this.tag}`}F(a,b,c,d){null!==c&&c.yf();const e=a.get(this.C);e&&(e(),a.remove(this.C));const f=olympe.sc.gh(d);if(f instanceof olympe.dc.CloudObject){if(d=f.R(),this.Ik(a,d,[d]),null!==c&&'function'===typeof f.getValue){c.run(()=>{olympe.D.wc([f.getValue()],g=>{b(g.valueOf())})});return}}else f instanceof olympe.dc.Va&&this.Ik(a,`qr-${f.hash}`,Ce(f));b(f)}Ik(a,b,c){const d=a.getParent();
885
+ d.Ik(b,c);a.set(this.C,()=>Ki(d,b))}getValue(a){return this.Mf(olympe.sc.logic.wb.valueProp,a||olympe.dc.W.Tb.gh,Object)}Ot(){const a=this.transform(olympe.sc.logic.wb.C,olympe.sc.logic.Ic.typeRel);a.Gd(olympe.dc.CloudObject);return a.Oc()}ax(){return this.cd(olympe.sc.logic.wb.ka,olympe.dc.CloudObject)}Zw(){return this.cd(olympe.sc.logic.wb.ra,olympe.sc.logic.Vb)}$w(){return this.cd(olympe.sc.logic.wb.aa,olympe.dm.Property)}qw(){return this.cd(olympe.sc.logic.wb.N,olympe.dc.CloudObject)}ow(){return this.cd(olympe.sc.logic.wb.C,
886
+ olympe.sc.logic.Lb)}pw(){return this.cd(olympe.sc.logic.wb.F,olympe.dm.Property)}};olympe.sc.logic.wb.P=olympe.dc.Ba.C('0168a431d91f25780000',olympe.sc.logic.wb,olympe.sc.O.Ea);olympe.sc.logic.wb.valueProp=olympe.sc.logic.wb.P.Ca('0168a431d91f25780001');olympe.sc.logic.wb.ka=olympe.sc.logic.wb.P.Pa('0168a431d91f25780002');olympe.sc.logic.wb.ra=P(olympe.sc.logic.wb.P,olympe.sc.logic.Vb.F);olympe.sc.logic.wb.aa=olympe.sc.logic.wb.P.Pa('0168a431d91f25780004');olympe.sc.logic.wb.N=olympe.sc.logic.wb.P.Pa('0168a431d91f2578000a');
887
+ olympe.sc.logic.wb.C=P(olympe.sc.logic.wb.P,olympe.sc.logic.Lb.F);olympe.sc.logic.wb.F=olympe.sc.logic.wb.P.Pa('0168a431d91f2578000c');P(olympe.dc.CloudObject.P,olympe.sc.logic.wb.ka);P(olympe.dm.Property.P,olympe.sc.logic.wb.aa);P(olympe.dc.CloudObject.P,olympe.sc.logic.wb.N);P(olympe.dm.Property.P,olympe.sc.logic.wb.F);m=olympe.sc.logic.wb.prototype;m.Ot.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.ax.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
888
+ m.Zw.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);m.$w.K=new olympe.D.J(()=>olympe.dm.Property,[]);m.qw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.ow.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);m.pw.K=new olympe.D.J(()=>olympe.dm.Property,[]);olympe.sc.logic.Xd=class extends olympe.sc.logic.Function{};olympe.sc.logic.Xd.P=olympe.dc.Ba.C('017dc8c114aa61a0e27f',olympe.sc.logic.Xd);olympe.sc.logic.Xd.C=olympe.sc.logic.Xd.P.Pa('017dc8d6d8ef9135f08a');olympe.sc.logic.Xd.G=olympe.sc.logic.Xd.P.Pa('017dc8d6d8ef9135f08b');P(olympe.dm.Nb.P,olympe.sc.logic.Xd.G);function hj(a,b){const c=a.Pd(),d=c.Tl().R(),e=c.Ul().R(),f=c.an().R();b.on(d,g=>{g&&(g=new Map(a.getInputs().map(h=>[h,b.get(h)])),g=olympe.sc.logic.qk.ia(g),olympe.H.wa.nb.zb.get(a.Rb(),g).then(h=>{h=ij(h,a.U.bind(a,b));for(const [k,l]of h)k!==e&&k!==f&&b.set(k,l);b.set(e,h.get(e));b.set(f,h.get(f))}).catch(h=>{b.set(f,olympe.sc.logic.Oj.create(h.toString(),1))}))},b.Z())}
889
+ function jj(a,b,c,d,e,f){const g=n=>{if(null!==n){e.cancel();k&&k();l&&l();try{const p=new Map(a.getOutputs().map(r=>[r,b.get(r)])),q=olympe.sc.logic.qk.ia(p);f.Le(q).finally(()=>b.destroy())}catch(p){n=Error(`Error while serializing the response from remote action ${a.Rb()}: ${p.message}`),f.xg(n).finally(()=>b.destroy())}}},h=b.Z(),k=b.on(c,g,h),l=b.on(d,g,h)}
890
+ olympe.sc.logic.Ph=class extends olympe.sc.logic.Function{constructor(a,b,c,d,e){super(a,b,c);this.bb=d;this.timeout=e}run(a){a.mn()||(this.db.fb(this,olympe.sc.logic.Ph.C)?this.Xc(a):(Vi(this,a),hj(this,a)))}Xc(a){const b=this.Rb(),c=this.Pd(),d=c.Tr().R(),e=c.Tl().R(),f=c.Ul().R(),g=c.an().R();(new olympe.H.wa.nb.zb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Zh('remote call'),l=ij(h.body(),this.U.bind(this,k)),n=Ib(()=>{h.xg(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
891
+ k.destroy()},this.timeout);jj(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.zj().then(p=>{var q=k.get(d);null!==q&&olympe.dc.xa(q)!==p&&(q=this.Rb(),this.L.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,l.get(e))})},h=>{const k=this.Rb();this.L.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}U(a,b){const c=Array.from(b.de()).map(d=>d.tag());
892
+ Oc(this.bb,a.Ec(),b,[],c)}};olympe.sc.logic.Ph.P=olympe.dc.Ba.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Ph,olympe.sc.O.Ea,olympe.dc.db.O.va,new olympe.T.fa(olympe.sc.Config.yq));olympe.sc.logic.Ph.C=olympe.sc.logic.Ph.P.Ca('017a7b0c62a02a89444f');function ij(a,b){var c=(new olympe.dc.W.Ki(olympe.dc.Ha.Vc)).C(a.p||[]);b&&b(c);c=new Map;for(const [d,e]of Object.entries(a.v||{}))c.set(d,kj(olympe.sc.logic.qk,e,b));return c}function lj(a){a.Bc=new olympe.dc.db.xc;a.values=Object.create(null)}
893
+ function kj(a,b,c){if(null===b||void 0===b)return null;switch(b.t){case 1:return new Date(b.d);case 2:return olympe.D.Color.create(b.r,b.g,b.b,b.a);case 3:return olympe.sc.logic.Error.create(b.m,b.c);case 4:return olympe.dc.CloudObject.get(b.v);case 5:return we(b.v);case 6:return Fe(b.v,c);case 7:return new Map(Object.entries(b.m).map(([d,e])=>[d,kj(a,e,c)]));default:return Array.isArray(b)?b.map(d=>kj(a,d,c)):'object'===typeof b?Object.entries(b).reduce((d,[e,f])=>{d[e]=kj(a,f,c);return d},{}):b}}
894
+ function mj(a,b){var c=a.db;a=a.Bc;if(c.Gb(b)){a.F(b,c.rd(b,!0),0);a.Ra(olympe.dc.kc.Tc,b,c.model(b),0);for(const [d,e,f]of Ed(c,b))(c=a.Jf(f))&&c.se()&&(e===olympe.dc.za.DESTINATION?a.Ra(d,b,f,0):a.Ra(d,f,b,0))}else olympe.pa.Xa('Remote Action').error(`Try to serialize an instance ${b} that does not exist in the local datacloud.`)}
895
+ olympe.sc.logic.qk=class{constructor(){this.db=olympe.dc.Na();lj(this)}static ia(a){const b=new olympe.sc.logic.qk;a.forEach((c,d)=>{null!==c&&void 0!==c&&(b.values[d]=b.C(c))});return b.flush()}flush(){const a=Object.create(null),b=new olympe.dc.transaction.wd;this.Bc.Mc(b);a.p=de(b);a.v=this.values;lj(this);return a}C(a){switch(!0){case a instanceof olympe.D.jb: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,
896
+ r:a.Of().valueOf(),g:a.If().valueOf(),b:a.Df().valueOf(),a:a.Cf().valueOf()};case a instanceof olympe.sc.logic.Error:return{t:3,c:a.code,m:a.Yr};case a&&'function'===typeof a.R:return a=a.R(),mj(this,a),{t:4,v:a};case a instanceof olympe.dc.gb:return{t:5,v:a.ia()};case a instanceof olympe.dc.Va:return{t:6,v:a.ia()};case Array.isArray(a):return a.map(this.C.bind(this));case a instanceof Map:const b=Object.create(null);for(const [c,d]of a)'string'===typeof c&&(b[c]=this.C(d));return{t:7,m:b};case null===
897
+ a:case void 0===a:return null;case 'object'===typeof a:return Object.entries(a).reduce((c,[d,e])=>{c[d]=this.C(e);return c},{});default:return a}}};olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Nl=class{constructor(a){this.db=olympe.dc.Na();this.typeRel=a}};olympe.sc.logic.controllers.Nl.C={cz:-1,Xz:1};olympe.sc.logic.controllers.AA=class extends olympe.sc.logic.controllers.Nl{constructor(){super(olympe.sc.logic.le.C)}};olympe.sc.logic.controllers.CA=class extends olympe.sc.logic.controllers.Nl{constructor(){super(olympe.sc.logic.Ic.typeRel)}};olympe.sc.logic.Mk={};olympe.sc.logic.Mk.Su=class extends olympe.sc.logic.Function{update(a,[b,c],[d]){const e=olympe.dc.xa(b);e?ef(Ze(new olympe.dc.gf(e),olympe.dc.Sb.pf),c).hb(()=>{d(olympe.dc.CloudObject.get(e))}):this.L.warn('Cannot subscribe to an instance with no tag: '+e)}};olympe.sc.logic.Ba.C('0174bf4b7e006e4b788a',olympe.sc.logic.Mk.Su);olympe.sc.logic.actions={};olympe.sc.logic.Mk.Zt=class extends olympe.sc.logic.Function{run(a){Vi(this,a);const [b,c,d]=this.F(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.L.warn('No list to iter upon'),this.L.info(a.Z())):f<e?(b(g.Ve(f)),f++,c((new Date).getTime())):(h.il(),d((new Date).getTime()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.zg();f=0;h.Gk();k();break;case 2:k();break;default:this.L.error('Unhandled input')}},this.tag))}};
898
+ olympe.sc.logic.Ba.C('0171889b060b6cd54300',olympe.sc.logic.Mk.Zt);olympe.sc.logic.ac={};olympe.sc.logic.ac.oo=class extends olympe.sc.logic.Oe{F(){return this.Hf('017dc92292107fb98b21')}};gj('017dc8d6c8fd8c8bd2f0',olympe.sc.logic.ac.oo);olympe.sc.logic.ac.oo.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.logic.ac.Pl=class extends olympe.sc.logic.Oe{F(){return this.Hf('016ac63808535703691c')}};olympe.sc.logic.ac.Pl.P=gj('0169b6876a03f139d50a',olympe.sc.logic.ac.Pl);olympe.sc.logic.ac.Pl.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.logic.ac.bm=class extends olympe.sc.logic.Oe{F(){return this.Hf('016ac63809a9a8e6db96')}G(){return this.lh('016ac6380ab003363b3e')}};gj('01646ad602f933b8caaf',olympe.sc.logic.ac.bm);olympe.sc.logic.ac.bm.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.logic.ac.bm.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);olympe.sc.logic.ac.hk=class extends olympe.sc.logic.Oe{F(){return this.Hf('016ac6380bd98f1d91a0')}N(){return this.lh('016ac63c589ae38ca3ae')}G(){return this.lh('016ac63c5a377fceabaa')}};gj('0168ec42fc01747a98b6',olympe.sc.logic.ac.hk);olympe.sc.logic.ac.hk.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.logic.ac.hk.prototype.N.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);olympe.sc.logic.ac.hk.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);olympe.sc.logic.ac.Xg=class extends olympe.sc.logic.Oe{Tl(){return this.Hf('017a7b07b09e3b22c8b4')}Tr(){return this.Hf('017a7b07ba05807a74b0')}Ul(){return this.lh('017a7b0818c12388d731')}an(){return this.lh('017a7b085146d5e69aec')}Pt(){return olympe.D.qa.F}};olympe.sc.logic.ac.Xg.ra='017a7b07b09e3b22c8b4';olympe.sc.logic.ac.Xg.Ld='017a7b07ba05807a74b0';olympe.sc.logic.ac.Xg.Xc='017a7b0818c12388d731';olympe.sc.logic.ac.Xg.C='017a7b085146d5e69aec';
899
+ olympe.sc.logic.ac.Xg.P=gj('017a7b07a948e30508fa',olympe.sc.logic.ac.Xg,olympe.sc.logic.Ph);m=olympe.sc.logic.ac.Xg.prototype;m.Tl.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);m.Tr.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);m.Ul.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);m.an.K=new olympe.D.J(()=>olympe.sc.logic.Vb,[]);m.Pt.K=olympe.D.J.U;olympe.sc.logic.ac.Sq=class extends olympe.sc.logic.Oe{F(){return this.Hf('016ac63c5b3ed0562740')}};gj('016a9766c230916ea5ec',olympe.sc.logic.ac.Sq);olympe.sc.logic.ac.Sq.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Lb,[]);olympe.sc.query={};olympe.sc.query.Pn=class extends olympe.sc.Ug{};olympe.sc.query.Pn.P=olympe.dc.Ba.C('01631aacd8276ea98491',olympe.sc.query.Pn);olympe.sc.query.cq=class extends olympe.dm.Enum{};olympe.sc.query.cq.P=olympe.dc.Ba.C('01631aacd8276ea98495',olympe.sc.query.cq);olympe.sc.query.oq=class extends olympe.dm.Enum{};olympe.sc.query.oq.P=olympe.dc.Ba.C('01631aacd8276ea98494',olympe.sc.query.oq);olympe.sc.query.qq=class extends olympe.sc.Ug{};olympe.sc.query.qq.P=olympe.dc.Ba.C('01631aacd8276ea98492',olympe.sc.query.qq);olympe.sc.query.rq=class extends olympe.dc.CloudObject{};olympe.sc.query.rq.P=olympe.dc.Ba.C('01631aacd8276ea98493',olympe.sc.query.rq);olympe.sc.La={};olympe.sc.La.Me=class extends olympe.sc.pb{C(){return olympe.sc.Xe.dh.Iu}};olympe.sc.La.Me.P=Nc(olympe.dc.Ba.C('01120300000000adef00',olympe.sc.La.Me));olympe.sc.La.Me.C=olympe.sc.La.Me.P.Pa('0171bc1f15da96dfdb89');P(olympe.dm.md.P,olympe.sc.La.Me.C);olympe.sc.La.Dj=class extends olympe.sc.Runnable{aa(){return[this.Rb()]}U(){return olympe.dc.ld.from(this.Rb()).sb(olympe.sc.La.Me.C).bd()}};olympe.sc.La.Dj.P=Nc(olympe.dc.Ba.C('0113030000000aca1100',olympe.sc.La.Dj));olympe.sc.La.Dj.prototype.U.K=new olympe.D.J(()=>olympe.dm.Nb,[]);olympe.sc.La.tb=class extends olympe.dc.CloudObject{Rt(){return this.oh(olympe.sc.La.tb.F)}Jx(){return this.oh(olympe.sc.La.tb.Ab)}Rd(){return this.Ie(olympe.sc.La.tb.C)}sw(){return this.Fb(olympe.sc.La.tb.ka)}Qw(){return this.Fb(olympe.sc.La.tb.bb)}Pw(){return this.Fb(olympe.sc.La.tb.Sa)}Xm(){this.Fb(olympe.sc.La.tb.ab)}Ew(){return this.Fb(olympe.sc.La.tb.ra)}fw(){return this.Fb(olympe.sc.La.tb.N)}Ow(){return this.Fb(olympe.sc.La.tb.Da)}Qt(){return this.Fb(olympe.sc.La.tb.aa)}};
897
900
  olympe.sc.La.tb.P=olympe.dc.Ba.C('011203300000000adef5',olympe.sc.La.tb);olympe.sc.La.tb.F=olympe.sc.La.tb.P.Ca('011203300000000adef6');olympe.sc.La.tb.Ab=olympe.sc.La.tb.P.Ca('011203300000000adef7');olympe.sc.La.tb.C=olympe.sc.La.tb.P.Ca('011203300000000adef8');olympe.sc.La.tb.ka=olympe.sc.La.tb.P.Ca('011203300000000adef9');olympe.sc.La.tb.bb=olympe.sc.La.tb.P.Ca('011203300000000adefa');olympe.sc.La.tb.Sa=olympe.sc.La.tb.P.Ca('011203300000000adefb');olympe.sc.La.tb.N=olympe.sc.La.tb.P.Ca('011203300000000adefc');
898
- olympe.sc.La.tb.ab=olympe.sc.La.tb.P.Ca('011203300000000adefd');olympe.sc.La.tb.ra=olympe.sc.La.tb.P.Ca('011203300000000adefe');olympe.sc.La.tb.Da=olympe.sc.La.tb.P.Ca('011203300000000adeff');olympe.sc.La.tb.aa=olympe.sc.La.tb.P.Ca('011203300000000adee0');olympe.sc.La.tb.Xb={INIT:0,Py:1,Qi:2,ym:3,vk:4,VA:5,qc:9};m=olympe.sc.La.tb.prototype;m.Ut.K=olympe.D.J.V;m.Gx.K=olympe.D.J.V;m.Rd.K=olympe.D.J.G;m.vw.K=olympe.D.J.F;m.Tw.K=olympe.D.J.F;m.Sw.K=olympe.D.J.F;m.bn.K=olympe.D.J.F;m.Hw.K=olympe.D.J.F;
899
- m.iw.K=olympe.D.J.F;m.Rw.K=olympe.D.J.F;m.Tt.K=olympe.D.J.F;olympe.sc.La.np=class extends olympe.sc.La.Gj{Sa(){return!0}};olympe.sc.La.np.P=olympe.dc.Ba.C('0113032000000aca1102',olympe.sc.La.np,olympe.sc.O.Ea);olympe.sc.La.ah=class extends olympe.sc.La.Me{F(){return(new olympe.dc.fk(this.R(),olympe.sc.La.tb)).sb(olympe.sc.La.ah.ra).nf().Oc()}};olympe.sc.La.ah.P=olympe.dc.Ba.C('011203300000000adef3',olympe.sc.La.ah);olympe.sc.La.ah.ra=olympe.sc.La.ah.P.Pa('011203300000000adef4');P(olympe.sc.La.tb.P,olympe.sc.La.ah.ra);olympe.sc.La.ah.prototype.F.K=new olympe.D.J(()=>olympe.sc.La.tb,[]);olympe.sc.dh=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.dh.P=olympe.dc.Ba.C('011203300000000adf00',olympe.sc.dh);olympe.sc.dh.F=olympe.sc.dh.P.Ca('011203300000000adf01');olympe.sc.dh.C=olympe.sc.dh.P.Ca('011203300000000adf02');olympe.sc.dh.N='011203300000000adf0f';olympe.sc.Xy=class{};olympe.sc.cb=class{constructor(a){this.vb=a}Y(){return this.vb.Y()}mn(){return this.vb.mn()}getParent(){return this.vb.getParent()}Rk(){return this.vb.Rk()}Ec(){return this.vb.Ec()}wn(a){this.vb.wn(a)}Kk(){this.vb.Kk()}ml(){this.vb.ml()}set(a,b){this.vb.set(a,b);return this}ni(a){this.vb.ni(a);return this}remove(a){this.vb.remove(a)}Eb(a,b,c=!1){return this.vb.Eb(a,b,c)}get(a,b=!1){return this.vb.get(a,b)}has(a,b=!1){return this.vb.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=
900
- this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.Y(),!1);this.Jg(()=>{f();d.complete()});return f})}repeat(a,b){this.vb.repeat(a,b);return this}gl(a){return this.vb.gl(a)}Ln(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,b,c))}jl(a){this.vb.jl(a);return this}Ya(a,b=!0){return this.vb.Ya(a,b)}on(a,b,c,d=!0){return this.vb.on(a,b,c,d)}$h(a){return this.vb.$h(a)}Vk(a,b){return this.vb.Vk(a,b)}sj(a,b){return this.vb.sj(a,b)}gi(a){return this.vb.gi(a)}oj(){return this.vb.oj()}Jg(a,
901
- b){return this.vb.Jg(a,b)}el(a){this.vb.el(a)}onDestroy(a){return this.vb.onDestroy(a)}Je(a){this.vb.Je(a)}destroy(){this.vb.destroy()}clear(){this.vb.clear()}yb(){return this.vb.yb()}tn(){return this.vb.tn()}$k(){return this.vb.$k()}fb(a){if('function'!==typeof this.vb.getProperty)throw Error('Trying to call deprecated method $.getProperty() in a non-UI brick');return this.vb.getProperty(a)}ww(a){if('function'!==typeof this.vb.getEvent)throw Error('Trying to call deprecated method $.getEvent() in a non-UI brick');
902
- return this.vb.getEvent(a)}Qx(...a){if('function'!==typeof this.vb.observeMany)throw Error('Trying to call deprecated method $.observeMany() in a non-UI brick');return this.vb.observeMany(a)}};olympe.sc.cb.prototype.observeMany=olympe.sc.cb.prototype.Qx;olympe.sc.cb.prototype.getEvent=olympe.sc.cb.prototype.ww;olympe.sc.cb.prototype.getProperty=olympe.sc.cb.prototype.fb;olympe.sc.cb.prototype.clear=olympe.sc.cb.prototype.clear;olympe.sc.cb.prototype.destroy=olympe.sc.cb.prototype.destroy;
903
- olympe.sc.cb.prototype.offDestroy=olympe.sc.cb.prototype.Je;olympe.sc.cb.prototype.onDestroy=olympe.sc.cb.prototype.onDestroy;olympe.sc.cb.prototype.offClear=olympe.sc.cb.prototype.el;olympe.sc.cb.prototype.onClear=olympe.sc.cb.prototype.Jg;olympe.sc.cb.prototype.getOtherContext=olympe.sc.cb.prototype.gi;olympe.sc.cb.prototype.onContext=olympe.sc.cb.prototype.sj;olympe.sc.cb.prototype.createChild=olympe.sc.cb.prototype.$h;olympe.sc.cb.prototype.setParentElement=olympe.sc.cb.prototype.jl;
904
- olympe.sc.cb.prototype.waitFor=olympe.sc.cb.prototype.Ln;olympe.sc.cb.prototype.runner=olympe.sc.cb.prototype.gl;olympe.sc.cb.prototype.repeat=olympe.sc.cb.prototype.repeat;olympe.sc.cb.prototype.observe=olympe.sc.cb.prototype.observe;olympe.sc.cb.prototype.has=olympe.sc.cb.prototype.has;olympe.sc.cb.prototype.get=olympe.sc.cb.prototype.get;olympe.sc.cb.prototype.remove=olympe.sc.cb.prototype.remove;olympe.sc.cb.prototype.trigger=olympe.sc.cb.prototype.ni;olympe.sc.cb.prototype.set=olympe.sc.cb.prototype.set;
905
- olympe.sc.cb.prototype.getParent=olympe.sc.cb.prototype.getParent;olympe.sc.Oj=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Ze.fh.Bl}};olympe.sc.Oj.P=olympe.dc.Ba.C('01645fe6873aeea59e64',olympe.sc.Oj);olympe.sc.Oj.C=olympe.sc.Oj.P.Pa('017ed8ac775f48d4d589');olympe.sc.ve=class extends olympe.sc.Runnable{bb(){return this.ub(olympe.sc.ve.G,olympe.sc.Runnable)}V(){return this.ub(olympe.sc.ve.C,olympe.dm.Property)}};olympe.sc.ve.P=Jc(olympe.dc.Ba.C('016c2d996d9ca27fa9d8',olympe.sc.ve));olympe.sc.ve.G=olympe.sc.ve.P.Pa('016c3cb7742ec9309e0b');olympe.sc.ve.C=olympe.sc.ve.P.Pa('016c42d3454636f90533');olympe.sc.ve.prototype.bb.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.sc.ve.prototype.V.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.sc.Lo=class extends olympe.dm.Pb{C(){return olympe.sc.Ze.fh.Bl}};olympe.sc.Lo.P=olympe.dc.Ba.C('017a7a9ff057958e5678',olympe.sc.Lo);olympe.sc.Sp=class extends olympe.dm.Pb{C(){return olympe.sc.Ze.fh.dv}};olympe.sc.Sp.P=olympe.dc.Ba.C('01644b6d4543b344b857',olympe.sc.Sp);olympe.sc.Tp=class extends olympe.dc.CloudObject{};olympe.sc.Tp.P=olympe.dc.Ba.C('0162f672366be5ca7a86',olympe.sc.Tp);olympe.sc.Yq=class extends olympe.sc.ve{};olympe.sc.Yq.P=olympe.dc.Ba.C('016d3f37610ae4fc3962',olympe.sc.Yq);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.P=olympe.dc.Ba.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Transaction=class{constructor(a=!0){this.C=(new olympe.dc.Transaction).persist(a);this.F=new Map;this.source=olympe.dc.Ja.mc}static from(a){const b=olympe.sc.Ua.lg.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Transaction}static process(a,b){return a.has(olympe.sc.Ua.lg.TRANSACTION,!0)?Promise.resolve(!1):b.hb().then(()=>!0)}Y(){return this.C.Y()}create(a,b=new Map,c=this.source,d){d=this.C.create(a,d).mi(c);this.F.set(d.R(),olympe.dc.xa(a));for(const [e,f]of b)d.setProperty(e,
906
- f);c===olympe.dc.Ja.Vc&&(b=olympe.dc.Na(),b=null!==Yi?b.jj(Yi,[olympe.sc.La.Me.C,olympe.sc.jd.F.Pc()])[0]||null:null,null!==b?this.Ra(olympe.sc.jd.N,b,d):olympe.pa.Xa('sc').warn('No business container for new instance of',olympe.dc.xa(a)));return d.R()}update(a,b,c){this.C.update(a,b,c);return this}Dx(a,b){a=this.C.update(a);for(const [c,d]of b)a.setProperty(c,d);return this}delete(a){this.C.delete(a);return this}Ra(a,b,c){this.C.Ra(a,b,c);return this}ec(a,b,c){this.C.ec(a,b,c);return this}Vm(a,b){this.C.Vm(a,
907
- b);return this}persist(a=!0){this.C.persist(a);return this}uj(a,b=!0){this.C.uj(a,b);return this}mi(a){this.source=a;return this}model(a){return this.F.get(olympe.dc.xa(a))||olympe.dc.Na().model(a)}zn(a){be(this.C,a.C);return this}Lm(a){this.C.Lm(a);return this}hb(){return new Promise((a,b)=>{this.C.hb((c,d)=>{c?a():b(d)})})}Ym(){return new Promise((a,b)=>{this.C.Ym((c,d)=>{c?a():b(d)})})}};olympe.sc.Transaction.prototype.executeAsLarge=olympe.sc.Transaction.prototype.Ym;
908
- olympe.sc.Transaction.prototype.execute=olympe.sc.Transaction.prototype.hb;olympe.sc.Transaction.prototype.afterExecution=olympe.sc.Transaction.prototype.Lm;olympe.sc.Transaction.prototype.merge=olympe.sc.Transaction.prototype.zn;olympe.sc.Transaction.prototype.model=olympe.sc.Transaction.prototype.model;olympe.sc.Transaction.prototype.setSource=olympe.sc.Transaction.prototype.mi;olympe.sc.Transaction.prototype.persistInstance=olympe.sc.Transaction.prototype.uj;
909
- olympe.sc.Transaction.prototype.persist=olympe.sc.Transaction.prototype.persist;olympe.sc.Transaction.prototype.deleteAllRelations=olympe.sc.Transaction.prototype.Vm;olympe.sc.Transaction.prototype.deleteRelation=olympe.sc.Transaction.prototype.ec;olympe.sc.Transaction.prototype.createRelation=olympe.sc.Transaction.prototype.Ra;olympe.sc.Transaction.prototype['delete']=olympe.sc.Transaction.prototype.delete;olympe.sc.Transaction.prototype.multiUpdate=olympe.sc.Transaction.prototype.Dx;
910
- olympe.sc.Transaction.prototype.update=olympe.sc.Transaction.prototype.update;olympe.sc.Transaction.prototype.create=olympe.sc.Transaction.prototype.create;olympe.sc.Transaction.prototype.getId=olympe.sc.Transaction.prototype.Y;olympe.sc.Transaction.process=olympe.sc.Transaction.process;olympe.sc.Transaction.from=olympe.sc.Transaction.from;olympe.sc.Ze.BrickMetadata=olympe.dm.BrickMetadata;olympe.sc.Ze.we=olympe.dm.we;olympe.ha.node.oa={};const Z={client:'client',hostname:'host',port:'port',user:'user',password:'password',Ha:'database',schema:'schema',gs:'pollingFrequency',Ev:'burstTransactionInterval'},jj=olympe.dc.ga.ja.rm,kj=olympe.dc.ga.ja.tm,lj=olympe.dc.ga.ja.QUERY_RESULT,mj=olympe.dc.ga.ja.sm,nj=olympe.dc.ga.ja.og,oj=olympe.dc.ga.ja.Th,pj=olympe.dc.ga.ja.Bh,qj=olympe.dc.ga.ja.xi,rj=olympe.dc.ga.ja.Ah,sj=olympe.dc.ga.ja.eh,tj=olympe.dc.ga.ja.Jj,uj=olympe.dc.ga.ja.yu;
911
- function vj(a,b,c,d,e){const f=new olympe.H.wa.nb.zb(a.tag,b),g=new olympe.sc.W.kt(a.L,a.Nd,a.bb);g.start(a.tag).catch(h=>a.L.error(`Error occurred while starting the file service of SQLConnector ${e}: ${h}`));f.listen().subscribe(h=>{var k=h.body();a.L.debug(`Serving a new message : ${k.t}`);switch(k.t){case jj:var l=c.queryBuilder().withSchema(d);k=se(k.q);a.V(b,l,k,(t,u)=>{(u?h.zg(Error(u)):h.Le({t:lj,r:t})).then()});break;case kj:k=se(k.q);wj(a,b,()=>c.queryBuilder().withSchema(d),k,h);break;
912
- case uj:xj(b,k.i,h.source());h.Lk().then();break;case sj:k=(new olympe.dc.W.Li(a.Tb())).C(k.p);yj(a,b,c,d,k,t=>(t?h.zg(Error(t)):h.Lk()).then());break;case rj:l=k.i;k=(new olympe.dc.W.Li(a.Tb())).C(k.p);zj(a,b,l,k,c,d);break;case nj:const n=b.get('_subscription_cache');k=k.s.reduce((t,u)=>{n.has(u)?n.get(u).Ge(h.source()):t.push(u);return t},[]);(0<k.length?h.zg(Error(`These subscriptions was not kept alive: ${k}`)):h.Lk()).then();break;case oj:const p=k.f;a.L.debug(`Uploading a file: ${p}`);k=Ni(g,
913
- (t,u,v)=>{a.L.debug(`Received a file service upload request for file : ${u}`);return p!==u?Promise.reject('The file sent is not the same as the one initially requested'):v instanceof Uint8Array||'string'===typeof v?Aj(a,b,c,d,p,v).then(()=>new olympe.net.Tg('',olympe.net.eb.od.zl)):Promise.reject(`Try to upload content for file ${p} but body is not a Uint8Array or a string`)});h.Le(k).then();break;case pj:const q=k.f;a.L.debug(`Serving a file: ${q}`);k=Ni(g,(t,u)=>{a.L.debug(`File service received a download request for file : ${u}`);
914
- return q!==u?Promise.reject('The file to download is not the same as the one initially requested'):Bj(b,c.queryBuilder().withSchema(d),q).then(v=>{a.L.debug('File service download request, content is:',v);return new olympe.net.Tg(v,olympe.net.eb.od.Lh)})});h.Le(k).then();break;case qj:const r=k.f;a.L.debug(`Deleting a file: ${r}`);k=Ni(g,(t,u)=>r!==u?Promise.reject('The file to download is not the same as the one initially requested'):Promise.resolve(new olympe.net.Tg('',olympe.net.eb.od.Lh)));h.Le(k).then();
915
- break;default:h.zg(Error(`Unsupported message type: ${k.t}`)).then()}})}function wj(a,b,c,d,e){const f=d.Y(),g=`sub${f}`;e.es(g).then(()=>{const h=b.get('_subscription_cache');let k=h.get(f);k||(k=new Cj(f,d,c,b.get('_polling_frequency'),a.V.bind(a,b),a.Xc.bind(a,g,f),()=>h.delete(f)),h.set(f,k));k.Ge(e.source())}).catch(h=>e.zg(Error(h)).then())}function xj(a,b,c){(a=a.get('_subscription_cache').get(b))&&a.detach(c)}
916
- function yj(a,b,c,d,e,f){b=b.get('_data_model_observer');a=new olympe.ha.node.oa.Ga.Qq(a.L,b);e.Mc(a);Dj(a,c,d).then(()=>f(null)).catch(g=>f(g))}function zj(a,b,c,d,e,f){const g=`_burst.${c}`,h=b.get(g);null===h?(b.set(g,d),setTimeout(()=>{const k=b.get(g);b.remove(g);yj(a,b,e,f,k,l=>{l&&olympe.H.wa.nb.zb.publish(c,{t:tj,r:l})})},b.get('_burst_interval'))):d.Mc(h)}
917
- function Aj(a,b,c,d,e,f){const g=olympe.ha.node.oa.Ga.Yc.Sj,h=new olympe.dc.db.xc;h.F(e,(new Map).set(g,f),0);h.Ra(olympe.dc.ic.Tc,e,olympe.dc.xa(olympe.dm.File));return new Promise((k,l)=>{yj(a,b,c,d,h,n=>n?l(n):k())})}
918
- function Bj(a,b,c){return x(function*(){var d=olympe.ha.node.oa.Ga.Yc.Sj,e=olympe.ha.node.oa.Ga.Yc.Nh;const f=yield Ej(a.get('_data_model_observer').Ud,olympe.dc.xa(olympe.dm.File));if((e=(yield b.from(f).select(d).where(e,c))[0])&&e[d])return d=e[d],d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength);throw Error(`File ${c} not found in the database`);}())}
919
- olympe.ha.node.oa.Pq=class extends olympe.sc.logic.Yd{constructor(a,b,c,d){super(a,b,c);this.Nd=d;this.bb=olympe.T.getParameter(olympe.H.ob.lm)}update(a,b){var [c]=b,d=l=>olympe.T.getParameter(`${'dbconnector'}.${c}.${l}`);const e=l=>olympe.T.getParameter(`${'dbconnector'}.${l}`);a.set('_burst_interval',d(Z.Ev)||5E3);a.set('_polling_frequency',d(Z.gs)||e(Z.gs)||6E5);const f=d(Z.client)||e(Z.client)||'pg',g=d(Z.hostname)||e(Z.hostname)||'',h=d(Z.Ha)||e(Z.Ha);b=d(Z.schema)||e(Z.schema)||c;const k=knex({client:f,
920
- connection:{host:g,port:d(Z.port)||e(Z.port),user:d(Z.user)||e(Z.user),password:d(Z.password)||e(Z.password),database:h}});this.L.info(`SQLConnector ${c} started with host ${g}, database ${h} on schema ${b}`);this.ce=olympe.pa.Xa('sql');a.Jg(()=>k.destroy().then());d=new olympe.ha.node.oa.Ga.Ys(k,b,this);a.set('_data_model_observer',d);a.set('_subscription_cache',new Map);vj(this,a,k,b,c)}V(a,b,c,d){a=a.get('_data_model_observer');const e=a.Ud,f=new olympe.ha.node.oa.Ga.vu(c,e);Fj(a).then(()=>Gj(f)).then(g=>
921
- {if(0===g.length)return[[],g];const h=Hj(new olympe.ha.node.oa.Ga.Oq(f,b,g));this.ce.debug(`Sending a sql query with the following text: ${h.toString()}`);return h.then(k=>[k,g])}).then(g=>{var [h,k]=g;return Ij(c.Y(),h,k,e)}).then(g=>d(g,null)).catch(g=>d({},g))}Xc(a,b,c){olympe.H.wa.nb.zb.publish(a,{t:mj,i:b,r:c}).then().catch(d=>this.L.error('Error occurred while publishing query result update: '+d))}};
922
- olympe.ha.node.oa.Pq.P=olympe.dc.Ba.C('017dc8db8074471acb7a',olympe.ha.node.oa.Pq,olympe.sc.O.Ea,olympe.net.O.Dm);
923
- class Cj{constructor(a,b,c,d,e,f,g){this.id=a;this.query=b;a=new olympe.W.fr(olympe.T.getParameter(olympe.Za.Config.Zl)+6E4);a.C=g;this.C=a;this.start(c,e,f,d)}Ge(a){if(this.C.has(a)){var b=this.C;b.values.has(a)&&b.values.set(a,Date.now())}else this.C.add(a)}detach(a){this.C.delete(a)||olympe.pa.Xa('Subscription Cache').warn(`Try to unsubscribe to the subscription ${this.id} which is not registered.`)}start(a,b,c,d){let e=null,f=new Set;const g=()=>{0<this.C.values.size&&(b(a(),this.query,(h,k)=>
924
- {if(k)olympe.pa.Xa('Subscription Cache').error(`Error occurred while updating subscription cache update: ${k}`);else if(k=olympe.W.mb(JSON.stringify(h)),k!==e){e=k;k=h.k;const l=[];k.forEach((n,p)=>{f.has(n)?f.delete(n):l.push(p)});h.a=l;h.r=Array.from(f);f=new Set(k);c(h)}}),setTimeout(g,d))};setTimeout(g,d)}};olympe.ha.node.oa.Ga={};olympe.ha.node.oa.Ga.yc={EQUAL:'equal',Tq:'substring',So:'filter',Dp:'<=',Ep:'<',fp:'>=',gp:'>',ag:'and',Mh:'or',Xg:'not',Cq:'regex'};olympe.ha.node.oa.Ga.Yc={Nh:'tagOlympe',kk:'tagOlympeOrig',El:'tagOlympeDest',Sj:'fileContent'};const Jj=olympe.ha.node.oa.Ga.Yc.kk,Kj=olympe.ha.node.oa.Ga.Yc.El,Lj=olympe.ha.node.oa.Ga.Yc.Nh,Mj=olympe.ha.node.oa.Ga.Yc.Sj;function Fj(a){return new Promise(b=>{0<a.C?a.N.add(()=>b()):b()})}
925
- function Nj(a){Oj(a,olympe.dc.xa(olympe.dm.File));const b=new Map;a.F.sb(olympe.sc.logic.Yd.C).observe(a.G).subscribe(c=>{we(c).forEach(d=>{const e=d.R();Pj(a,()=>{var g=Qj;const h=[{name:Lj,af:Lj,Zk:!1}];e===olympe.dc.xa(olympe.dm.File)&&h.push({name:Mj,af:Mj,Zk:!1});return g(a,e,e,h)},`Create Table for ${e}`);const f=new olympe.D.Wb('Business model context',a.G);b.set(e,f);f.run(()=>Rj(a,f,e))});xe(c).forEach(d=>{b.get(d).destroy();Pj(a,()=>Sj(a,d),`Delete Table for ${d}`)})})}
926
- function Tj(a){a.C++;1===a.C&&a.L.debug('Data model observer is busy')}function Uj(a){a.C--;if(0===a.C){a.L.debug('Data model observer is free');for(const b of a.N)b();a.N.clear()}}function Oj(a,b){if(!a.db.al(a.F,olympe.sc.logic.Yd.C,b)){Tj(a);const c=new olympe.dc.Transaction;c.Ra(olympe.sc.logic.Yd.C,a.F,b);c.hb((d,e)=>{d||a.L.error(`Error while linking the business model ${b} to the SQLConnector: ${e}`);Uj(a)},!0)}}function Vj(a){return a.client.schema.withSchema(a.schema)}
927
- function Pj(a,b,c){if(!a.G.gd()&&!a.G.yb()){a.L.debug(`Push operation:${c}`);Tj(a);var d=a.V,e=()=>{d.shift();Uj(a);if(0<d.length)d[0]()},f=()=>{b().then(()=>{a.L.debug(`Operation ${c} succeed`);e()}).catch(g=>{a.L.error(`Error for operation ${c}: ${g}`);e()})};d.push(f);1===d.length&&f()}}
928
- function Qj(a,b,c,d){return x(function*(){if(yield Vj(a).hasTable(b))return a.L.debug(`Table ${c} already exist`),Promise.resolve().then(()=>{var e=a.Ud;e.C.set(c,b);e.G.set(b,c)});a.L.debug('Create table for : '+c);return Vj(a).createTable(b,e=>{d.forEach(f=>{var {name:g,af:h,Gr:k,rs:l,Zk:n}=f;Wj(a,e,g,h,n,l,k)})}).then(()=>{var e=a.Ud;e.C.set(c,b);e.G.set(b,c)})}())}
929
- function Rj(a,b,c){b.onDestroy(()=>{Pj(a,()=>Promise.all(Array.from(a.Ka.get(c)).map(d=>Sj(a,d))).then(()=>{a.Ka.delete(c)}),`Destroy relation tables of business model ${c}: relations: ${a.Ka.get(c)}`)});Xj(a,c,b);a.Ka.set(c,new Set);olympe.dc.gb.from(c).sb(olympe.dc.CloudObject.G).Xi().sb(olympe.dm.Relation.destinationModelRel).Xi().filter((new olympe.dc.da.U.De(a.F)).sb(olympe.sc.logic.Yd.C.Pc())).observe(b).subscribe(d=>{0<we(d).length&&(a.L.debug('Handle new relations : '+we(d)),Pj(a,()=>Promise.all(we(d).map(e=>
930
- {var [f,g]=e;a.Ka.get(c).add(f.R());a.Ka.get(g.R()).add(f.R());e=f.R();var h=Qj,k=g.R();return h(a,e,e,[{name:Jj,af:Jj,rs:c,Gr:Lj,Zk:!0},{name:Kj,af:Kj,rs:k,Gr:Lj,Zk:!0}])})).then(),`Add relation tables for business model ${c}: ${we(d)}`));0<xe(d).length&&(a.L.debug('Handle relations to remove : '+xe(d)),Pj(a,()=>Promise.all(xe(d).map(e=>{var [f,g]=e;a.Ka.get(c).delete(f);a.Ka.get(g).delete(f);return Sj(a,f)})).then(),`Delete relation tables for business model ${c}: ${xe(d)}`))})}
931
- function Sj(a,b){return x(function*(){try{var c=yield Ej(a.Ud,b)}catch(d){a.L.warn(`Try to delete a table not registered: ${d}`);return}if(yield Vj(a).hasTable(c)){Vj(a).dropTable(c);c=a.Ud;const d=c.C.get(b);c.G.delete(d)||c.C.delete(b)}}())}
932
- function Xj(a,b,c){a.L.debug('Observe properties for '+b);olympe.dc.gb.from(b).sb(olympe.dc.CloudObject.propertyRel).observe(c).subscribe(d=>{a.L.debug('New properties for '+b+' '+we(d));Pj(a,()=>Yj(a,b,we(d).map(e=>e.R()),xe(d)),`Update columns of ${b}: added: ${we(d)}, removed: ${xe(d)}`)})}
933
- function Yj(a,b,c,d){return x(function*(){const e=yield Ej(a.Ud,b),f=yield Promise.all(c.map(k=>Promise.resolve(k))),g=yield Promise.all(d.map(k=>Promise.resolve(k))),h=yield a.client.queryBuilder().withSchema(a.schema).table(e).columnInfo();return Vj(a).table(e,k=>{const l=new Set(Object.keys(h));f.forEach((n,p)=>{!l.has(n)&&Wj(a,k,n,c[p])});g.forEach(n=>{l.has(n)&&k.dropColumn(n)})})}())}
934
- function Wj(a,b,c,d,e,f,g){e=void 0===e?!1:e;f=void 0===f?'':f;g=void 0===g?'':g;if(c===Lj)b.string(c,21).primary();else if(c===Jj||c===Kj){if(e)b.string(c).notNullable().references(g).inTable(f).onDelete('CASCADE')}else c===Mj?b.binary(c):d&&(a=a.db,d=olympe.dc.ld.from(d).sb(olympe.dm.Property.typeRel).bd(),a.Sf(d,olympe.dm.String)?b.string(c,1E3):a.Sf(d,olympe.dm.Number)?b.double(c):a.Sf(d,olympe.dm.Boolean)?b.boolean(c):a.Sf(d,olympe.dm.DateTime)?b.string(c):a.Sf(d,olympe.dm.Color)&&b.string(c,
935
- 50))}olympe.ha.node.oa.Ga.Ys=class{constructor(a,b,c){this.L=olympe.pa.Xa('sql');this.client=a;this.schema=b;this.F=c;this.Ud=new olympe.ha.node.oa.Ga.bv;this.G=new olympe.D.Wb(`Data Model Observer of ${c.R()}`);this.V=[];this.C=0;this.Ka=new Map;this.N=new Set;this.db=olympe.dc.Na();Nj(this)}};const Zj=olympe.ha.node.oa.Ga.yc.EQUAL,ak=olympe.ha.node.oa.Ga.yc.ag,bk=olympe.ha.node.oa.Ga.yc.Mh,ck=olympe.ha.node.oa.Ga.yc.Xg,dk=olympe.ha.node.oa.Ga.yc.So,ek=olympe.ha.node.oa.Ga.yc.fp,fk=olympe.ha.node.oa.Ga.yc.gp,gk=olympe.ha.node.oa.Ga.yc.Dp,hk=olympe.ha.node.oa.Ga.yc.Ep,ik=olympe.ha.node.oa.Ga.yc.Cq,jk=olympe.ha.node.oa.Ga.yc.Tq,kk=olympe.ha.node.oa.Ga.Yc.Nh;
936
- function Gj(a){return x(function*(){var b=a.query.G;let c=b;var d=[];const e=a.query.C;let f=olympe.dc.Na().nj(b);!f&&e[0]instanceof olympe.dc.da.Kb.jg&&(f=e[0].Qd().qb(olympe.dc.CloudObject.instancesRel));if(f){try{var g=yield Ej(a.Qe,b)}catch(l){return[]}f=!0;e.shift()}else{try{var h=yield a.Qe.Tb(b,'')}catch(l){return[]}c=h;g=yield Promise.resolve([['tagOlympe',b]]);1<g.length?d.push(['',ak,g.map(l=>{var [n,p]=l;return[n,Zj,lk(p)]})]):d.push([g[0][0],Zj,lk(g[0][1])]);g=yield Ej(a.Qe,h)}h=mk(a,
937
- g);b=Array.from(a.query.F);b=b.includes(0)||b.includes(1)&&f;var k=[];if(b){const l=a.query.Y(),n=nk(a.Qe,l,c,kk);k=olympe.dc.gb.from(c).sb(olympe.dc.CloudObject.propertyRel).bd().map(q=>q.R());const p=yield Promise.all(k.map(q=>Promise.resolve(q)));k=k.map(q=>nk(a.Qe,l,c,q)).map((q,r)=>[q,p[r]]);k.unshift([n,kk])}a.C.limit=a.query.max;a.C.offset=a.query.offset;a.Pe.push({Kg:b,recursive:!1,filters:d,kh:'',ci:'',Zh:k,gh:h,name:g});d=0;for(const l of e)d=yield ok(a,l,d,f);return a.Pe}())}
938
- function mk(a,b){a.G++;return`alias-${b.charAt(0)}${a.G}`}function ok(a,b,c,d){let e=c;switch(!0){case b instanceof olympe.dc.da.Kb.jg:case b instanceof olympe.dc.da.Kb.kg:e+=1;a=pk(a,b,e,d);break;case b instanceof olympe.dc.da.Kb.rc:a=qk(a,b);break;case b instanceof olympe.dc.da.Kb.Rh:a=rk(a,b);break;default:a=Promise.reject(`Query part ${b.toString()} could not be parsed`)}return a.then(()=>e)}
939
- function pk(a,b,c,d){const e=b.Qd().R(),f=b.Qd().Oa()===olympe.dc.za.ORIGIN?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel;let g=b instanceof olympe.dc.da.Kb.kg;const h=olympe.dm.Relation.F.$l,k=olympe.dc.ld.from(e).sb(f).bd();c=d?c+1:c;const l=Array.from(a.query.F).includes(c),[n,p]=['',''];return Ej(a.Qe,k.R()).then(q=>x(function*(){const r=mk(a,q),t=[];let u=Promise.resolve();h===olympe.dm.Relation.F.$l&&(u=Ej(a.Qe,e).then(v=>{const w=mk(a,v),[y,A]=sk(b.Qd().Oa());a.Pe.push({Kg:!1,
940
- gh:w,name:v,Zh:[],kh:y,ci:A,filters:[],recursive:g});g=!1}));return u.then(()=>x(function*(){let v=[];var w=Promise.resolve([]);let y=[];if(l){const A=a.query.Y(),D=nk(a.Qe,A,k.R(),kk);w=olympe.dc.gb.from(k.R()).sb(olympe.dc.CloudObject.propertyRel).Xi().bd().map(I=>I.R());v=w.map(I=>nk(a.Qe,A,k.R(),I));w=Promise.all(w.map(I=>Promise.resolve(I)));y.push([nk(a.Qe,A,k.R(),kk),kk]);const T=yield w;y=v.map((I,aa)=>[I,T[aa]]);y.unshift([D,kk])}a.Pe.push({Kg:l,gh:r,name:q,Zh:y,kh:n,ci:p,filters:t,recursive:g})}()))}()))}
941
- function qk(a,b){return a.F(b.C).then(c=>{a.Pe[a.Pe.length-1].filters.push(c)})}function rk(a,b){a.C.order=b.order;a.C.aliasSorting=a.Pe[a.Pe.length].gh;return Promise.resolve(b.fb().R()).then(c=>{a.C.columnSorting=c})}function sk(a){const b=olympe.ha.node.oa.Ga.Yc.kk,c=olympe.ha.node.oa.Ga.Yc.El;return a===olympe.dc.za.ORIGIN?[c,b]:[b,c]}
942
- olympe.ha.node.oa.Ga.vu=class{constructor(a,b){this.query=a;this.G=0;this.Qe=b;this.Pe=[];this.C={}}F(a){switch(!0){case a instanceof olympe.dc.da.U.Gc:const c=a.C;return Promise.resolve(a.fb()).then(h=>[h,Zj,lk(c)]);case a instanceof olympe.dc.da.U.Sc:const d=a.substring;return Promise.resolve(a.fb()).then(h=>[h,jk,d]);case a instanceof olympe.dc.da.U.xd:var b=a.C.source;return/^\^?([-_%\u0153\u0152\u00e6\u00c6\u00e5\u00c5\u00f8\u00d8&/\u00df\u00a1\u00bf=\u00e0\u00c0\u00e2\u00c2\u00e4\u00c4\u00e1\u00c1\u00e9\u00c9\u00e8\u00c8\u00ea\u00ca\u00eb\u00cb\u00ec\u00cc\u00ee\u00ce\u00ef\u00cf\u00f2\u00d2\u00f4\u00d4\u00f6\u00d6\u00f9\u00d9\u00fb\u00db\u00fc\u00dc\u00e7\u00c7\u2019\u00f1\u00e3\u00f5\u00c3\u00d5\u00d1]|\w|\s|\d|\\'|\\"|\.\+\?|\.\*|\.\+|\\\/|\\\\|\\\^|\\\$|\\\.|\\\?|\\\*|\\\+|\\\(|\\\)|\\\||\\\[|\\\]|\\\{|\\\})*\$*?$/.test(b)?
943
- Promise.resolve(a.fb()).then(h=>[h,ik,a.C]):Promise.reject(`Query not supported for regex : ${b}`);case a instanceof olympe.dc.da.U.kd:return this.F(a.C).then(h=>['',ck,h]);case a instanceof olympe.dc.da.U.De:const e=a.destination,f=Array.from(a.recursive);if(f.reduce((h,k)=>h||k,!1))return Promise.reject('Recursive relation in RelatedTo predicate is not supported');b=a.dd().map((h,k)=>Promise.resolve(h.R()).then(l=>{const [n,p]=sk(h.Oa());let q=[];e&&k===a.dd().length-1&&(q=[[p,Zj,lk(e)]]);return{name:l,
944
- recursive:f[k],Zh:[],kh:n,ci:p,filters:q,gh:mk(this,l),Kg:!1}}),this);let g;g=e?Promise.resolve([['tagOlympe',e]]):Promise.resolve([]);return Promise.all(b).then(h=>{var k=this.Pe[this.Pe.length-1];k={name:k.name,recursive:!1,Zh:[[kk,kk]],kh:'',ci:'',filters:[],gh:mk(this,k.name),Kg:!0};h.unshift(k);return g.then(l=>['',dk,{target:l,Ka:h}])});case a instanceof olympe.dc.da.U.Gh:return Promise.resolve(a.fb()).then(h=>('number'===typeof a.C?Promise.resolve(a.C):Promise.resolve(a.C.R())).then(k=>{var l=
945
- a.G;return Promise.resolve([h,a.F?l?hk:gk:l?fk:ek,k])}));case a instanceof olympe.dc.da.U.Vd:return b=Array.from(a.U).flatMap(this.F.bind(this)),Promise.all(b).then(h=>['',ak,h]);case a instanceof olympe.dc.da.U.be:return b=Array.from(a.U).flatMap(this.F.bind(this)),Promise.all(b).then(h=>['',bk,h]);default:return Promise.reject('Failed to parse predicate')}}};function Ij(a,b,c,d){const e=[],f=new olympe.dc.transaction.wd;let g,h,k,l;const n=null==(g=c[0])?void 0:null==(h=g.filters)?void 0:null==(k=h[0])?void 0:null==(l=k[2])?void 0:l.v;return tk(c,d).then(p=>{for(const r of b){const [t,u,v]=uk(a,r,p,d,c,n);for(const w of v){const [y,A,D]=w;f.Ra(y,A,D)}var q=Array.from(t.keys()).map(w=>w).join('.');e.push(q);for(const w of t.entries()){const [y,A]=w;q=u.get(y);d.N.set(y,q);f.F(y,new Map(A),0);f.Ra(olympe.dc.CloudObject.modelRel.R(),y,q,0)}}d.F.delete(a);
946
- return{k:e,p:$d(f)}})}function tk(a,b){const c=[],d=[],e=[],f=[];for(let g=1;g<a.length-1;g+=2)(a[g-1].Kg||1===g)&&a[g+1].Kg&&(d.push(b.ph(a[g-1].name)),e.push(b.ph(a[g+1].name)),c.push(Promise.resolve(b.G.get(a[g].name))),f.push(a[g].kh===olympe.ha.node.oa.Ga.Yc.kk?olympe.dc.za.DESTINATION:olympe.dc.za.ORIGIN));return Promise.all([Promise.all(c),Promise.all(d),Promise.all(e)]).then(g=>{var [h,k,l]=g;return h.map((n,p)=>[n,k[p],l[p],f[p]])})}
947
- function uk(a,b,c,d,e,f){const g=olympe.ha.node.oa.Ga.Yc.Nh;let h=0;let k='',l='',n=0;const p=new Map,q=new Map,r=[];for(const u of Object.entries(b)){const [v,w]=u;b=w;var t=v.split(';');if(t[1]===g){h=parseInt(t[0],10);t=vk(d,a,h);if(n<c.length){const y=c[n][3],A=c[n][0];if(k===c[n][1]&&t===c[n][2])r.push(y===olympe.dc.za.DESTINATION?[A,l,b]:[A,b,l]),n++;else{let D;!k&&t===(null==(D=e[2])?void 0:D.name)&&f&&(r.push(y===olympe.dc.za.DESTINATION?[A,f,b]:[A,b,f]),n++)}}p.set(b,[]);q.set(b,t);d.N.set(b,
948
- t);k=t;l=b}else h===parseInt(t[0],10)&&(t=t[1],p.get(l).push([t,b]))}return[p,q,r]}olympe.ha.node.oa.Ga.yA=class{};function Hj(a){const b=a.C,{offset:c,limit:d,wC:e,order:f,rC:g}=a.V.C;-1<d&&b.limit(d);0<c&&b.offset(c);e&&f&&b.orderBy(`${g}.${e}`,f.toLowerCase());for(const [h,{Kg:k,gh:l,name:n,filters:p,recursive:q,Zh:r,kh:t,ci:u}]of a.Z.entries())wk(a,b,k,l,n,p,q,0===h,t,u,r);return b}
949
- function wk(a,b,c,d,e,f,g,h,k,l,n){if(c){if(!n||1>n.length)throw Error('Trying to return an element without providing mappings in SQLBuilder:BuildNodes');c=n.map(([p,q])=>b.client.raw('??.?? as ??',[d,q,p])).join(',');b.select(b.client.raw(c))}0<f.length&&xk(a,b,d,f,olympe.ha.node.oa.Ga.pd.NONE);h?(b.from(b.client.raw('?? as ??',[e,d])),a.G=d,a.F=l):(g&&(f=`cte${a.N++}`,yk(a,b,f,d,e)),e=b.client.raw('?? as ??',[e,d]),b.join(e,p=>{var q=a.G,r=a.F;p.on(''===r?`${q}.tagOlympe`:`${q}.${r}`,''===k?`${d}.tagOlympe`:
901
+ olympe.sc.La.tb.ab=olympe.sc.La.tb.P.Ca('011203300000000adefd');olympe.sc.La.tb.ra=olympe.sc.La.tb.P.Ca('011203300000000adefe');olympe.sc.La.tb.Da=olympe.sc.La.tb.P.Ca('011203300000000adeff');olympe.sc.La.tb.aa=olympe.sc.La.tb.P.Ca('011203300000000adee0');olympe.sc.La.tb.Xb={INIT:0,Uy:1,Pi:2,tm:3,rk:4,YA:5,cc:9};m=olympe.sc.La.tb.prototype;m.Rt.K=olympe.D.J.U;m.Jx.K=olympe.D.J.U;m.Rd.K=olympe.D.J.G;m.sw.K=olympe.D.J.F;m.Qw.K=olympe.D.J.F;m.Pw.K=olympe.D.J.F;m.Xm.K=olympe.D.J.F;m.Ew.K=olympe.D.J.F;
902
+ m.fw.K=olympe.D.J.F;m.Ow.K=olympe.D.J.F;m.Qt.K=olympe.D.J.F;olympe.sc.La.gp=class extends olympe.sc.La.Dj{Sa(){return!0}};olympe.sc.La.gp.P=olympe.dc.Ba.C('0113032000000aca1102',olympe.sc.La.gp,olympe.sc.O.Ea);olympe.sc.La.Zg=class extends olympe.sc.La.Me{F(){return(new olympe.dc.ck(this.R(),olympe.sc.La.tb)).sb(olympe.sc.La.Zg.ra).lf().Oc()}};olympe.sc.La.Zg.P=olympe.dc.Ba.C('011203300000000adef3',olympe.sc.La.Zg);olympe.sc.La.Zg.ra=olympe.sc.La.Zg.P.Pa('011203300000000adef4');P(olympe.sc.La.tb.P,olympe.sc.La.Zg.ra);olympe.sc.La.Zg.prototype.F.K=new olympe.D.J(()=>olympe.sc.La.tb,[]);olympe.sc.ah=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.ah.P=olympe.dc.Ba.C('011203300000000adf00',olympe.sc.ah);olympe.sc.ah.F=olympe.sc.ah.P.Ca('011203300000000adf01');olympe.sc.ah.C=olympe.sc.ah.P.Ca('011203300000000adf02');olympe.sc.ah.N='011203300000000adf0f';olympe.sc.az=class{};olympe.sc.cb=class{constructor(a){this.vb=a}Z(){return this.vb.Z()}gn(){return this.vb.gn()}getParent(){return this.vb.getParent()}Nk(){return this.vb.Nk()}Ec(){return this.vb.Ec()}qn(a){this.vb.qn(a)}Gk(){this.vb.Gk()}il(){this.vb.il()}set(a,b){this.vb.set(a,b);return this}mi(a){this.vb.mi(a);return this}remove(a){this.vb.remove(a)}Eb(a,b,c=!1){return this.vb.Eb(a,b,c)}get(a,b=!1){return this.vb.get(a,b)}has(a,b=!1){return this.vb.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=
903
+ this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.Z(),!1);this.Hg(()=>{f();d.complete()});return f})}repeat(a,b){this.vb.repeat(a,b);return this}cl(a){return this.vb.cl(a)}Fn(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,b,c))}fl(a){this.vb.fl(a);return this}Ya(a,b=!0){return this.vb.Ya(a,b)}on(a,b,c,d=!0){return this.vb.on(a,b,c,d)}Zh(a){return this.vb.Zh(a)}Rk(a,b){return this.vb.Rk(a,b)}qj(a,b){return this.vb.qj(a,b)}fi(a){return this.vb.fi(a)}mj(){return this.vb.mj()}Hg(a,
904
+ b){return this.vb.Hg(a,b)}al(a){this.vb.al(a)}onDestroy(a){return this.vb.onDestroy(a)}Je(a){this.vb.Je(a)}destroy(){this.vb.destroy()}clear(){this.vb.clear()}yb(){return this.vb.yb()}mn(){return this.vb.mn()}Wk(){return this.vb.Wk()}fb(a){if('function'!==typeof this.vb.getProperty)throw Error('Trying to call deprecated method $.getProperty() in a non-UI brick');return this.vb.getProperty(a)}tw(a){if('function'!==typeof this.vb.getEvent)throw Error('Trying to call deprecated method $.getEvent() in a non-UI brick');
905
+ return this.vb.getEvent(a)}Tx(...a){if('function'!==typeof this.vb.observeMany)throw Error('Trying to call deprecated method $.observeMany() in a non-UI brick');return this.vb.observeMany(a)}};olympe.sc.cb.prototype.observeMany=olympe.sc.cb.prototype.Tx;olympe.sc.cb.prototype.getEvent=olympe.sc.cb.prototype.tw;olympe.sc.cb.prototype.getProperty=olympe.sc.cb.prototype.fb;olympe.sc.cb.prototype.clear=olympe.sc.cb.prototype.clear;olympe.sc.cb.prototype.destroy=olympe.sc.cb.prototype.destroy;
906
+ olympe.sc.cb.prototype.offDestroy=olympe.sc.cb.prototype.Je;olympe.sc.cb.prototype.onDestroy=olympe.sc.cb.prototype.onDestroy;olympe.sc.cb.prototype.offClear=olympe.sc.cb.prototype.al;olympe.sc.cb.prototype.onClear=olympe.sc.cb.prototype.Hg;olympe.sc.cb.prototype.getOtherContext=olympe.sc.cb.prototype.fi;olympe.sc.cb.prototype.onContext=olympe.sc.cb.prototype.qj;olympe.sc.cb.prototype.createChild=olympe.sc.cb.prototype.Zh;olympe.sc.cb.prototype.setParentElement=olympe.sc.cb.prototype.fl;
907
+ olympe.sc.cb.prototype.waitFor=olympe.sc.cb.prototype.Fn;olympe.sc.cb.prototype.runner=olympe.sc.cb.prototype.cl;olympe.sc.cb.prototype.repeat=olympe.sc.cb.prototype.repeat;olympe.sc.cb.prototype.observe=olympe.sc.cb.prototype.observe;olympe.sc.cb.prototype.has=olympe.sc.cb.prototype.has;olympe.sc.cb.prototype.get=olympe.sc.cb.prototype.get;olympe.sc.cb.prototype.remove=olympe.sc.cb.prototype.remove;olympe.sc.cb.prototype.trigger=olympe.sc.cb.prototype.mi;olympe.sc.cb.prototype.set=olympe.sc.cb.prototype.set;
908
+ olympe.sc.cb.prototype.getParent=olympe.sc.cb.prototype.getParent;olympe.sc.Lj=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Xe.dh.xl}};olympe.sc.Lj.P=olympe.dc.Ba.C('01645fe6873aeea59e64',olympe.sc.Lj);olympe.sc.Lj.C=olympe.sc.Lj.P.Pa('017ed8ac775f48d4d589');olympe.sc.ve=class extends olympe.sc.Runnable{bb(){return this.ub(olympe.sc.ve.G,olympe.sc.Runnable)}U(){return this.ub(olympe.sc.ve.C,olympe.dm.Property)}};olympe.sc.ve.P=Nc(olympe.dc.Ba.C('016c2d996d9ca27fa9d8',olympe.sc.ve));olympe.sc.ve.G=olympe.sc.ve.P.Pa('016c3cb7742ec9309e0b');olympe.sc.ve.C=olympe.sc.ve.P.Pa('016c42d3454636f90533');olympe.sc.ve.prototype.bb.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.sc.ve.prototype.U.K=new olympe.D.J(()=>olympe.dc.Aa,[]);olympe.sc.Fo=class extends olympe.dm.Pb{C(){return olympe.sc.Xe.dh.xl}};olympe.sc.Fo.P=olympe.dc.Ba.C('017a7a9ff057958e5678',olympe.sc.Fo);olympe.sc.Mp=class extends olympe.dm.Pb{C(){return olympe.sc.Xe.dh.$u}};olympe.sc.Mp.P=olympe.dc.Ba.C('01644b6d4543b344b857',olympe.sc.Mp);olympe.sc.Np=class extends olympe.dc.CloudObject{};olympe.sc.Np.P=olympe.dc.Ba.C('0162f672366be5ca7a86',olympe.sc.Np);olympe.sc.Tq=class extends olympe.sc.ve{};olympe.sc.Tq.P=olympe.dc.Ba.C('016d3f37610ae4fc3962',olympe.sc.Tq);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.P=olympe.dc.Ba.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Transaction=class{constructor(a=!0){this.C=(new olympe.dc.Transaction).persist(a);this.F=new Map;this.source=olympe.dc.Ha.bc}static from(a){const b=olympe.sc.Ua.jg.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Transaction}static process(a,b){return a.has(olympe.sc.Ua.jg.TRANSACTION,!0)?Promise.resolve(!1):b.hb().then(()=>!0)}Z(){return this.C.Z()}create(a,b=new Map,c=this.source,d){d=this.C.create(a,d).li(c);this.F.set(d.R(),olympe.dc.xa(a));for(const [e,f]of b)d.setProperty(e,
909
+ f);c===olympe.dc.Ha.Vc&&(b=olympe.dc.Na(),b=null!==bj?b.hj(bj,[olympe.sc.La.Me.C,olympe.sc.jd.F.Pc()])[0]||null:null,null!==b?this.Ra(olympe.sc.jd.N,b,d):olympe.pa.Xa('sc').warn('No business container for new instance of',olympe.dc.xa(a)));return d.R()}update(a,b,c){this.C.update(a,b,c);return this}Gx(a,b){a=this.C.update(a);for(const [c,d]of b)a.setProperty(c,d);return this}delete(a){this.C.delete(a);return this}Ra(a,b,c){this.C.Ra(a,b,c);return this}hc(a,b,c){this.C.hc(a,b,c);return this}Qm(a,b){this.C.Qm(a,
910
+ b);return this}persist(a=!0){this.C.persist(a);return this}sj(a,b=!0){this.C.sj(a,b);return this}li(a){this.source=a;return this}model(a){return this.F.get(olympe.dc.xa(a))||olympe.dc.Na().model(a)}tn(a){fe(this.C,a.C);return this}Gm(a){this.C.Gm(a);return this}hb(){return new Promise((a,b)=>{this.C.hb((c,d)=>{c?a():b(d)})})}Tm(){return new Promise((a,b)=>{this.C.Tm((c,d)=>{c?a():b(d)})})}};olympe.sc.Transaction.prototype.executeAsLarge=olympe.sc.Transaction.prototype.Tm;
911
+ olympe.sc.Transaction.prototype.execute=olympe.sc.Transaction.prototype.hb;olympe.sc.Transaction.prototype.afterExecution=olympe.sc.Transaction.prototype.Gm;olympe.sc.Transaction.prototype.merge=olympe.sc.Transaction.prototype.tn;olympe.sc.Transaction.prototype.model=olympe.sc.Transaction.prototype.model;olympe.sc.Transaction.prototype.setSource=olympe.sc.Transaction.prototype.li;olympe.sc.Transaction.prototype.persistInstance=olympe.sc.Transaction.prototype.sj;
912
+ olympe.sc.Transaction.prototype.persist=olympe.sc.Transaction.prototype.persist;olympe.sc.Transaction.prototype.deleteAllRelations=olympe.sc.Transaction.prototype.Qm;olympe.sc.Transaction.prototype.deleteRelation=olympe.sc.Transaction.prototype.hc;olympe.sc.Transaction.prototype.createRelation=olympe.sc.Transaction.prototype.Ra;olympe.sc.Transaction.prototype['delete']=olympe.sc.Transaction.prototype.delete;olympe.sc.Transaction.prototype.multiUpdate=olympe.sc.Transaction.prototype.Gx;
913
+ olympe.sc.Transaction.prototype.update=olympe.sc.Transaction.prototype.update;olympe.sc.Transaction.prototype.create=olympe.sc.Transaction.prototype.create;olympe.sc.Transaction.prototype.getId=olympe.sc.Transaction.prototype.Z;olympe.sc.Transaction.process=olympe.sc.Transaction.process;olympe.sc.Transaction.from=olympe.sc.Transaction.from;olympe.sc.Xe.BrickMetadata=olympe.dm.BrickMetadata;olympe.sc.Xe.we=olympe.dm.we;olympe.ha.node.oa={};const Z={client:'client',hostname:'host',port:'port',user:'user',password:'password',Ia:'database',schema:'schema',$r:'pollingFrequency',Bv:'burstTransactionInterval'},nj=olympe.dc.ga.ja.mm,oj=olympe.dc.ga.ja.om,pj=olympe.dc.ga.ja.QUERY_RESULT,qj=olympe.dc.ga.ja.nm,rj=olympe.dc.ga.ja.mg,sj=olympe.dc.ga.ja.Sh,tj=olympe.dc.ga.ja.zh,uj=olympe.dc.ga.ja.wi,vj=olympe.dc.ga.ja.yh,wj=olympe.dc.ga.ja.bh,xj=olympe.dc.ga.ja.Gj,yj=olympe.dc.ga.ja.vu;
914
+ function zj(a,b,c,d,e){const f=new olympe.H.wa.nb.zb(a.tag,b),g=new olympe.sc.W.ht(a.L,a.Ld,a.bb);g.start(a.tag).catch(h=>a.L.error(`Error occurred while starting the file service of SQLConnector ${e}: ${h}`));f.listen().subscribe(h=>{var k=h.body();a.L.debug(`Serving a new message : ${k.t}`);switch(k.t){case nj:var l=c.queryBuilder().withSchema(d);k=we(k.q);a.U(b,l,k,(t,u)=>{(u?h.xg(Error(u)):h.Le({t:pj,r:t})).then()});break;case oj:k=we(k.q);Aj(a,b,()=>c.queryBuilder().withSchema(d),k,h);break;
915
+ case yj:Bj(b,k.i,h.source());h.Hk().then();break;case wj:k=(new olympe.dc.W.Ki(a.Rb())).C(k.p);Cj(a,b,c,d,k,t=>(t?h.xg(Error(t)):h.Hk()).then());break;case vj:l=k.i;k=(new olympe.dc.W.Ki(a.Rb())).C(k.p);Dj(a,b,l,k,c,d);break;case rj:const n=b.get('_subscription_cache');k=k.s.reduce((t,u)=>{n.has(u)?n.get(u).Ge(h.source()):t.push(u);return t},[]);(0<k.length?h.xg(Error(`These subscriptions was not kept alive: ${k}`)):h.Hk()).then();break;case sj:const p=k.f;a.L.debug(`Uploading a file: ${p}`);k=Ri(g,
916
+ (t,u,v)=>{a.L.debug(`Received a file service upload request for file : ${u}`);return p!==u?Promise.reject('The file sent is not the same as the one initially requested'):v instanceof Uint8Array||'string'===typeof v?Ej(a,b,c,d,p,v).then(()=>new olympe.net.Rg('',olympe.net.eb.od.vl)):Promise.reject(`Try to upload content for file ${p} but body is not a Uint8Array or a string`)});h.Le(k).then();break;case tj:const q=k.f;a.L.debug(`Serving a file: ${q}`);k=Ri(g,(t,u)=>{a.L.debug(`File service received a download request for file : ${u}`);
917
+ return q!==u?Promise.reject('The file to download is not the same as the one initially requested'):Fj(b,c.queryBuilder().withSchema(d),q).then(v=>{a.L.debug('File service download request, content is:',v);return new olympe.net.Rg(v,olympe.net.eb.od.Kh)})});h.Le(k).then();break;case uj:const r=k.f;a.L.debug(`Deleting a file: ${r}`);k=Ri(g,(t,u)=>r!==u?Promise.reject('The file to download is not the same as the one initially requested'):Promise.resolve(new olympe.net.Rg('',olympe.net.eb.od.Kh)));h.Le(k).then();
918
+ break;default:h.xg(Error(`Unsupported message type: ${k.t}`)).then()}})}function Aj(a,b,c,d,e){const f=d.Z(),g=`sub${f}`;e.Zr(g).then(()=>{const h=b.get('_subscription_cache');let k=h.get(f);k||(k=new Gj(f,d,c,b.get('_polling_frequency'),a.U.bind(a,b),a.Xc.bind(a,g,f),()=>h.delete(f)),h.set(f,k));k.Ge(e.source())}).catch(h=>e.xg(Error(h)).then())}function Bj(a,b,c){(a=a.get('_subscription_cache').get(b))&&a.detach(c)}
919
+ function Cj(a,b,c,d,e,f){b=b.get('_data_model_observer');a=new olympe.ha.node.oa.Ga.Lq(a.L,b);e.Mc(a);Hj(a,c,d).then(()=>f(null)).catch(g=>f(g))}function Dj(a,b,c,d,e,f){const g=`_burst.${c}`,h=b.get(g);null===h?(b.set(g,d),setTimeout(()=>{const k=b.get(g);b.remove(g);Cj(a,b,e,f,k,l=>{l&&olympe.H.wa.nb.zb.publish(c,{t:xj,r:l})})},b.get('_burst_interval'))):d.Mc(h)}
920
+ function Ej(a,b,c,d,e,f){const g=olympe.ha.node.oa.Ga.Yc.Pj,h=new olympe.dc.db.xc;h.F(e,(new Map).set(g,f),0);h.Ra(olympe.dc.kc.Tc,e,olympe.dc.xa(olympe.dm.File));return new Promise((k,l)=>{Cj(a,b,c,d,h,n=>n?l(n):k())})}
921
+ function Fj(a,b,c){return x(function*(){var d=olympe.ha.node.oa.Ga.Yc.Pj,e=olympe.ha.node.oa.Ga.Yc.Mh;const f=yield Ij(a.get('_data_model_observer').C,olympe.dc.xa(olympe.dm.File));if((e=(yield b.from(f).select(d).where(e,c))[0])&&e[d])return d=e[d],d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength);throw Error(`File ${c} not found in the database`);}())}
922
+ olympe.ha.node.oa.Kq=class extends olympe.sc.logic.Xd{constructor(a,b,c,d){super(a,b,c);this.Ld=d;this.bb=olympe.T.getParameter(olympe.H.ob.gm)}update(a,[b]){var c=l=>olympe.T.getParameter(`${'dbconnector'}.${b}.${l}`);const d=l=>olympe.T.getParameter(`${'dbconnector'}.${l}`);a.set('_burst_interval',c(Z.Bv)||5E3);a.set('_polling_frequency',c(Z.$r)||d(Z.$r)||6E5);const e=c(Z.client)||d(Z.client)||'pg',f=c(Z.hostname)||d(Z.hostname)||'',g=c(Z.Ia)||d(Z.Ia),h=c(Z.schema)||d(Z.schema)||b,k=knex({client:e,
923
+ connection:{host:f,port:c(Z.port)||d(Z.port),user:c(Z.user)||d(Z.user),password:c(Z.password)||d(Z.password),database:g}});this.L.info(`SQLConnector ${b} started with host ${f}, database ${g} on schema ${h}`);this.be=olympe.pa.Xa('sql');a.Hg(()=>k.destroy().then());c=new olympe.ha.node.oa.Ga.Us(k,h,this);a.set('_data_model_observer',c);a.set('_subscription_cache',new Map);zj(this,a,k,h,b)}U(a,b,c,d){a=a.get('_data_model_observer');const e=a.C,f=new olympe.ha.node.oa.Ga.su(c,e);Jj(a).then(()=>Kj(f)).then(g=>
924
+ {if(0===g.length)return[[],g];const h=Lj(new olympe.ha.node.oa.Ga.Jq(f,b,g));this.be.debug(`Sending a sql query with the following text: ${h.toString()}`);return h.then(k=>[k,g])}).then(([g,h])=>Mj(c.Z(),g,h,e)).then(g=>d(g,null)).catch(g=>d({},g))}Xc(a,b,c){olympe.H.wa.nb.zb.publish(a,{t:qj,i:b,r:c}).then().catch(d=>this.L.error('Error occurred while publishing query result update: '+d))}};olympe.ha.node.oa.Kq.P=olympe.dc.Ba.C('017dc8db8074471acb7a',olympe.ha.node.oa.Kq,olympe.sc.O.Ea,olympe.net.O.ym);
925
+ class Gj{constructor(a,b,c,d,e,f,g){this.id=a;this.query=b;a=new olympe.W.ar(olympe.T.getParameter(olympe.Za.Config.Vl)+6E4);a.C=g;this.C=a;this.start(c,e,f,d)}Ge(a){if(this.C.has(a)){var b=this.C;b.values.has(a)&&b.values.set(a,Date.now())}else this.C.add(a)}detach(a){this.C.delete(a)||olympe.pa.Xa('Subscription Cache').warn(`Try to unsubscribe to the subscription ${this.id} which is not registered.`)}start(a,b,c,d){let e=null,f=new Set;const g=()=>{0<this.C.values.size&&(b(a(),this.query,(h,k)=>
926
+ {if(k)olympe.pa.Xa('Subscription Cache').error(`Error occurred while updating subscription cache update: ${k}`);else if(k=olympe.W.mb(JSON.stringify(h)),k!==e){e=k;k=h.k;const l=[];k.forEach((n,p)=>{f.has(n)?f.delete(n):l.push(p)});h.a=l;h.r=Array.from(f);f=new Set(k);c(h)}}),setTimeout(g,d))};setTimeout(g,d)}};olympe.ha.node.oa.Ga={};olympe.ha.node.oa.Ga.yc={EQUAL:'equal',Oq:'substring',Mo:'filter',xp:'<=',yp:'<',Zo:'>=',$o:'>',Zf:'and',Lh:'or',Vg:'not',xq:'regex'};olympe.ha.node.oa.Ga.Yc={Mh:'tagOlympe',gk:'tagOlympeOrig',Al:'tagOlympeDest',Pj:'fileContent'};const Nj=olympe.ha.node.oa.Ga.Yc.gk,Oj=olympe.ha.node.oa.Ga.Yc.Al,Pj=olympe.ha.node.oa.Ga.Yc.Mh,Qj=olympe.ha.node.oa.Ga.Yc.Pj;function Jj(a){return new Promise(b=>{0<a.F?a.U.add(()=>b()):b()})}
927
+ function Rj(a){Sj(a,olympe.dc.xa(olympe.dm.File));const b=new Map;a.G.sb(olympe.sc.logic.Xd.C).observe(a.N).subscribe(c=>{Ae(c).forEach(d=>{const e=d.R();Tj(a,()=>{var g=Uj;const h=[{name:Pj,Ze:Pj,Vk:!1}];e===olympe.dc.xa(olympe.dm.File)&&h.push({name:Qj,Ze:Qj,Vk:!1});return g(a,e,e,h)},`Create Table for ${e}`);const f=new olympe.D.Wb('Business model context',a.N);b.set(e,f);f.run(()=>Vj(a,f,e))});Be(c).forEach(d=>{b.get(d).destroy();Tj(a,()=>Wj(a,d),`Delete Table for ${d}`)})})}
928
+ function Xj(a){a.F++;1===a.F&&a.L.debug('Data model observer is busy')}function Yj(a){a.F--;if(0===a.F){a.L.debug('Data model observer is free');for(const b of a.U)b();a.U.clear()}}function Sj(a,b){if(!a.db.Xk(a.G,olympe.sc.logic.Xd.C,b)){Xj(a);const c=new olympe.dc.Transaction;c.Ra(olympe.sc.logic.Xd.C,a.G,b);c.hb((d,e)=>{d||a.L.error(`Error while linking the business model ${b} to the SQLConnector: ${e}`);Yj(a)},!0)}}function Zj(a){return a.client.schema.withSchema(a.schema)}
929
+ function Tj(a,b,c){if(!a.N.gd()&&!a.N.yb()){a.L.debug(`Push operation:${c}`);Xj(a);var d=a.Y,e=()=>{d.shift();Yj(a);if(0<d.length)d[0]()},f=()=>{b().then(()=>{a.L.debug(`Operation ${c} succeed`);e()}).catch(g=>{a.L.error(`Error for operation ${c}: ${g}`);e()})};d.push(f);1===d.length&&f()}}
930
+ function Uj(a,b,c,d){return x(function*(){if(yield Zj(a).hasTable(b))return a.L.debug(`Table ${c} already exist`),Promise.resolve().then(()=>{var e=a.C;e.C.set(c,b);e.G.set(b,c)});a.L.debug('Create table for : '+c);return Zj(a).createTable(b,e=>{d.forEach(({name:f,Ze:g,Br:h,ls:k,Vk:l})=>{ak(a,e,f,g,l,k,h)})}).then(()=>{var e=a.C;e.C.set(c,b);e.G.set(b,c)})}())}
931
+ function Vj(a,b,c){b.onDestroy(()=>{Tj(a,()=>Promise.all(Array.from(a.Ka.get(c)).map(d=>Wj(a,d))).then(()=>{a.Ka.delete(c)}),`Destroy relation tables of business model ${c}: relations: ${a.Ka.get(c)}`)});bk(a,c,b);a.Ka.set(c,new Set);olympe.dc.gb.from(c).sb(olympe.dc.CloudObject.G).Wi().sb(olympe.dm.Relation.destinationModelRel).Wi().filter((new olympe.dc.da.V.De(a.G)).sb(olympe.sc.logic.Xd.C.Pc())).observe(b).subscribe(d=>{0<Ae(d).length&&(a.L.debug('Handle new relations : '+Ae(d)),Tj(a,()=>Promise.all(Ae(d).map(([e,
932
+ f])=>{a.Ka.get(c).add(e.R());a.Ka.get(f.R()).add(e.R());e=e.R();var g=Uj;f=f.R();return g(a,e,e,[{name:Nj,Ze:Nj,ls:c,Br:Pj,Vk:!0},{name:Oj,Ze:Oj,ls:f,Br:Pj,Vk:!0}])})).then(),`Add relation tables for business model ${c}: ${Ae(d)}`));0<Be(d).length&&(a.L.debug('Handle relations to remove : '+Be(d)),Tj(a,()=>Promise.all(Be(d).map(([e,f])=>{a.Ka.get(c).delete(e);a.Ka.get(f).delete(e);return Wj(a,e)})).then(),`Delete relation tables for business model ${c}: ${Be(d)}`))})}
933
+ function Wj(a,b){return x(function*(){try{var c=yield Ij(a.C,b)}catch(d){a.L.warn(`Try to delete a table not registered: ${d}`);return}if(yield Zj(a).hasTable(c)){Zj(a).dropTable(c);c=a.C;const d=c.C.get(b);c.G.delete(d)||c.C.delete(b)}}())}
934
+ function bk(a,b,c){a.L.debug('Observe properties for '+b);olympe.dc.gb.from(b).sb(olympe.dc.CloudObject.propertyRel).observe(c).subscribe(d=>{a.L.debug('New properties for '+b+' '+Ae(d));Tj(a,()=>ck(a,b,Ae(d).map(e=>e.R()),Be(d)),`Update columns of ${b}: added: ${Ae(d)}, removed: ${Be(d)}`)})}
935
+ function ck(a,b,c,d){return x(function*(){const e=yield Ij(a.C,b),f=yield Promise.all(c.map(k=>Promise.resolve(k))),g=yield Promise.all(d.map(k=>Promise.resolve(k))),h=yield a.client.queryBuilder().withSchema(a.schema).table(e).columnInfo();return Zj(a).table(e,k=>{const l=new Set(Object.keys(h));f.forEach((n,p)=>{!l.has(n)&&ak(a,k,n,c[p])});g.forEach(n=>{l.has(n)&&k.dropColumn(n)})})}())}
936
+ function ak(a,b,c,d,e=!1,f='',g=''){if(c===Pj)b.string(c,21).primary();else if(c===Nj||c===Oj){if(e)b.string(c).notNullable().references(g).inTable(f).onDelete('CASCADE')}else c===Qj?b.binary(c):d&&(a=a.db,d=olympe.dc.ld.from(d).sb(olympe.dm.Property.typeRel).bd(),a.Sf(d,olympe.dm.String)?b.string(c,1E3):a.Sf(d,olympe.dm.Number)?b.double(c):a.Sf(d,olympe.dm.Boolean)?b.boolean(c):a.Sf(d,olympe.dm.DateTime)?b.string(c):a.Sf(d,olympe.dm.Color)&&b.string(c,50))}
937
+ olympe.ha.node.oa.Ga.Us=class{constructor(a,b,c){this.L=olympe.pa.Xa('sql');this.client=a;this.schema=b;this.G=c;this.C=new olympe.ha.node.oa.Ga.Zu;this.N=new olympe.D.Wb(`Data Model Observer of ${c.R()}`);this.Y=[];this.F=0;this.Ka=new Map;this.U=new Set;this.db=olympe.dc.Na();Rj(this)}};const dk=olympe.ha.node.oa.Ga.yc.EQUAL,ek=olympe.ha.node.oa.Ga.yc.Zf,fk=olympe.ha.node.oa.Ga.yc.Lh,gk=olympe.ha.node.oa.Ga.yc.Vg,hk=olympe.ha.node.oa.Ga.yc.Mo,ik=olympe.ha.node.oa.Ga.yc.Zo,jk=olympe.ha.node.oa.Ga.yc.$o,kk=olympe.ha.node.oa.Ga.yc.xp,lk=olympe.ha.node.oa.Ga.yc.yp,mk=olympe.ha.node.oa.Ga.yc.xq,nk=olympe.ha.node.oa.Ga.yc.Oq,ok=olympe.ha.node.oa.Ga.Yc.Mh;
938
+ function Kj(a){return x(function*(){var b=a.query.G;let c=b;var d=[];const e=a.query.C;let f=olympe.dc.Na().lj(b);!f&&e[0]instanceof olympe.dc.da.Kb.hg&&(f=e[0].Qd().qb(olympe.dc.CloudObject.instancesRel));if(f){try{var g=yield Ij(a.F,b)}catch(l){return[]}f=!0;e.shift()}else{try{var h=yield a.F.Rb(b,'')}catch(l){return[]}c=h;g=yield Promise.resolve([['tagOlympe',b]]);1<g.length?d.push(['',ek,g.map(([l,n])=>[l,dk,pk(n)])]):d.push([g[0][0],dk,pk(g[0][1])]);g=yield Ij(a.F,h)}h=qk(a,g);b=Array.from(a.query.F);
939
+ b=b.includes(0)||b.includes(1)&&f;var k=[];if(b){const l=a.query.Z(),n=rk(a.F,l,c,ok);k=olympe.dc.gb.from(c).sb(olympe.dc.CloudObject.propertyRel).bd().map(q=>q.R());const p=yield Promise.all(k.map(q=>Promise.resolve(q)));k=k.map(q=>rk(a.F,l,c,q)).map((q,r)=>[q,p[r]]);k.unshift([n,ok])}a.G.limit=a.query.max;a.G.offset=a.query.offset;a.C.push({Ig:b,recursive:!1,filters:d,ih:'',bi:'',Yh:k,eh:h,name:g});d=0;for(const l of e)d=yield sk(a,l,d,f);return a.C}())}
940
+ function qk(a,b){a.U++;return`alias-${b.charAt(0)}${a.U}`}function sk(a,b,c,d){let e=c;switch(!0){case b instanceof olympe.dc.da.Kb.hg:case b instanceof olympe.dc.da.Kb.ig:e+=1;a=tk(a,b,e,d);break;case b instanceof olympe.dc.da.Kb.rc:a=uk(a,b);break;case b instanceof olympe.dc.da.Kb.Qh:a=vk(a,b);break;default:a=Promise.reject(`Query part ${b.toString()} could not be parsed`)}return a.then(()=>e)}
941
+ function tk(a,b,c,d){const e=b.Qd().R(),f=b.Qd().Oa()===olympe.dc.za.ORIGIN?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel;let g=b instanceof olympe.dc.da.Kb.ig;const h=olympe.dm.Relation.F.Wl,k=olympe.dc.ld.from(e).sb(f).bd();c=d?c+1:c;const l=Array.from(a.query.F).includes(c),[n,p]=['',''];return Ij(a.F,k.R()).then(q=>x(function*(){const r=qk(a,q),t=[];let u=Promise.resolve();h===olympe.dm.Relation.F.Wl&&(u=Ij(a.F,e).then(v=>{const w=qk(a,v),[y,B]=wk(b.Qd().Oa());a.C.push({Ig:!1,
942
+ eh:w,name:v,Yh:[],ih:y,bi:B,filters:[],recursive:g});g=!1}));return u.then(()=>x(function*(){let v=[];var w=Promise.resolve([]);let y=[];if(l){const B=a.query.Z(),E=rk(a.F,B,k.R(),ok);w=olympe.dc.gb.from(k.R()).sb(olympe.dc.CloudObject.propertyRel).Wi().bd().map(I=>I.R());v=w.map(I=>rk(a.F,B,k.R(),I));w=Promise.all(w.map(I=>Promise.resolve(I)));y.push([rk(a.F,B,k.R(),ok),ok]);const T=yield w;y=v.map((I,aa)=>[I,T[aa]]);y.unshift([E,ok])}a.C.push({Ig:l,eh:r,name:q,Yh:y,ih:n,bi:p,filters:t,recursive:g})}()))}()))}
943
+ function uk(a,b){return a.N(b.C).then(c=>{a.C[a.C.length-1].filters.push(c)})}function vk(a,b){a.G.order=b.order;a.G.aliasSorting=a.C[a.C.length].eh;return Promise.resolve(b.fb().R()).then(c=>{a.G.columnSorting=c})}function wk(a){const b=olympe.ha.node.oa.Ga.Yc.gk,c=olympe.ha.node.oa.Ga.Yc.Al;return a===olympe.dc.za.ORIGIN?[c,b]:[b,c]}
944
+ olympe.ha.node.oa.Ga.su=class{constructor(a,b){this.query=a;this.U=0;this.F=b;this.C=[];this.G={}}N(a){switch(!0){case a instanceof olympe.dc.da.V.Gc:const c=a.C;return Promise.resolve(a.fb()).then(h=>[h,dk,pk(c)]);case a instanceof olympe.dc.da.V.Sc:const d=a.substring;return Promise.resolve(a.fb()).then(h=>[h,nk,d]);case a instanceof olympe.dc.da.V.xd:var b=a.C.source;return/^\^?([-_%\u0153\u0152\u00e6\u00c6\u00e5\u00c5\u00f8\u00d8&/\u00df\u00a1\u00bf=\u00e0\u00c0\u00e2\u00c2\u00e4\u00c4\u00e1\u00c1\u00e9\u00c9\u00e8\u00c8\u00ea\u00ca\u00eb\u00cb\u00ec\u00cc\u00ee\u00ce\u00ef\u00cf\u00f2\u00d2\u00f4\u00d4\u00f6\u00d6\u00f9\u00d9\u00fb\u00db\u00fc\u00dc\u00e7\u00c7\u2019\u00f1\u00e3\u00f5\u00c3\u00d5\u00d1]|\w|\s|\d|\\'|\\"|\.\+\?|\.\*|\.\+|\\\/|\\\\|\\\^|\\\$|\\\.|\\\?|\\\*|\\\+|\\\(|\\\)|\\\||\\\[|\\\]|\\\{|\\\})*\$*?$/.test(b)?
945
+ Promise.resolve(a.fb()).then(h=>[h,mk,a.C]):Promise.reject(`Query not supported for regex : ${b}`);case a instanceof olympe.dc.da.V.kd:return this.N(a.C).then(h=>['',gk,h]);case a instanceof olympe.dc.da.V.De:const e=a.destination,f=Array.from(a.recursive);if(f.reduce((h,k)=>h||k,!1))return Promise.reject('Recursive relation in RelatedTo predicate is not supported');b=a.dd().map((h,k)=>Promise.resolve(h.R()).then(l=>{const [n,p]=wk(h.Oa());let q=[];e&&k===a.dd().length-1&&(q=[[p,dk,pk(e)]]);return{name:l,
946
+ recursive:f[k],Yh:[],ih:n,bi:p,filters:q,eh:qk(this,l),Ig:!1}}),this);let g;g=e?Promise.resolve([['tagOlympe',e]]):Promise.resolve([]);return Promise.all(b).then(h=>{var k=this.C[this.C.length-1];k={name:k.name,recursive:!1,Yh:[[ok,ok]],ih:'',bi:'',filters:[],eh:qk(this,k.name),Ig:!0};h.unshift(k);return g.then(l=>['',hk,{target:l,Ka:h}])});case a instanceof olympe.dc.da.V.Eh:return Promise.resolve(a.fb()).then(h=>('number'===typeof a.C?Promise.resolve(a.C):Promise.resolve(a.C.R())).then(k=>{var l=
947
+ a.G;return Promise.resolve([h,a.F?l?lk:kk:l?jk:ik,k])}));case a instanceof olympe.dc.da.V.Ud:return b=Array.from(a.V).flatMap(this.N.bind(this)),Promise.all(b).then(h=>['',ek,h]);case a instanceof olympe.dc.da.V.ae:return b=Array.from(a.V).flatMap(this.N.bind(this)),Promise.all(b).then(h=>['',fk,h]);default:return Promise.reject('Failed to parse predicate')}}};function Mj(a,b,c,d){const e=[],f=new olympe.dc.transaction.wd;let g,h,k,l;const n=null==(g=c[0])?void 0:null==(h=g.filters)?void 0:null==(k=h[0])?void 0:null==(l=k[2])?void 0:l.v;return xk(c,d).then(p=>{for(const r of b){const [t,u,v]=yk(a,r,p,d,c,n);for(const [w,y,B]of v)f.Ra(w,y,B);var q=Array.from(t.keys()).map(w=>w).join('.');e.push(q);for(const [w,y]of t.entries())q=u.get(w),d.N.set(w,q),f.F(w,new Map(y),0),f.Ra(olympe.dc.CloudObject.modelRel.R(),w,q,0)}d.F.delete(a);return{k:e,p:de(f)}})}
948
+ function xk(a,b){const c=[],d=[],e=[],f=[];for(let g=1;g<a.length-1;g+=2)(a[g-1].Ig||1===g)&&a[g+1].Ig&&(d.push(b.nh(a[g-1].name)),e.push(b.nh(a[g+1].name)),c.push(Promise.resolve(b.G.get(a[g].name))),f.push(a[g].ih===olympe.ha.node.oa.Ga.Yc.gk?olympe.dc.za.DESTINATION:olympe.dc.za.ORIGIN));return Promise.all([Promise.all(c),Promise.all(d),Promise.all(e)]).then(([g,h,k])=>g.map((l,n)=>[l,h[n],k[n],f[n]]))}
949
+ function yk(a,b,c,d,e,f){const g=olympe.ha.node.oa.Ga.Yc.Mh;let h=0;let k='',l='',n=0;const p=new Map,q=new Map,r=[];for(const [u,v]of Object.entries(b)){b=v;var t=u.split(';');if(t[1]===g){h=parseInt(t[0],10);t=zk(d,a,h);if(n<c.length){const w=c[n][3],y=c[n][0];if(k===c[n][1]&&t===c[n][2])r.push(w===olympe.dc.za.DESTINATION?[y,l,b]:[y,b,l]),n++;else{let B;!k&&t===(null==(B=e[2])?void 0:B.name)&&f&&(r.push(w===olympe.dc.za.DESTINATION?[y,f,b]:[y,b,f]),n++)}}p.set(b,[]);q.set(b,t);d.N.set(b,t);k=t;
950
+ l=b}else h===parseInt(t[0],10)&&(t=t[1],p.get(l).push([t,b]))}return[p,q,r]}olympe.ha.node.oa.Ga.BA=class{};function Lj(a){const b=a.C,{offset:c,limit:d,zC:e,order:f,uC:g}=a.U.G;-1<d&&b.limit(d);0<c&&b.offset(c);e&&f&&b.orderBy(`${g}.${e}`,f.toLowerCase());for(const [h,{Ig:k,eh:l,name:n,filters:p,recursive:q,Yh:r,ih:t,bi:u}]of a.Y.entries())Ak(a,b,k,l,n,p,q,0===h,t,u,r);return b}
951
+ function Ak(a,b,c,d,e,f,g,h,k,l,n){if(c){if(!n||1>n.length)throw Error('Trying to return an element without providing mappings in SQLBuilder:BuildNodes');c=n.map(([p,q])=>b.client.raw('??.?? as ??',[d,q,p])).join(',');b.select(b.client.raw(c))}0<f.length&&Bk(a,b,d,f,olympe.ha.node.oa.Ga.pd.NONE);h?(b.from(b.client.raw('?? as ??',[e,d])),a.G=d,a.F=l):(g&&(f=`cte${a.N++}`,Ck(a,b,f,d,e)),e=b.client.raw('?? as ??',[e,d]),b.join(e,p=>{var q=a.G,r=a.F;p.on(''===r?`${q}.tagOlympe`:`${q}.${r}`,''===k?`${d}.tagOlympe`:
950
952
  `${d}.${k}`);a.G=d;a.F=l}))}
951
- function xk(a,b,c,d,e){const f=olympe.ha.node.oa.Ga.yc.EQUAL,g=olympe.ha.node.oa.Ga.yc.ag,h=olympe.ha.node.oa.Ga.yc.Mh,k=olympe.ha.node.oa.Ga.yc.Xg,l=olympe.ha.node.oa.Ga.yc.So,n=olympe.ha.node.oa.Ga.yc.fp,p=olympe.ha.node.oa.Ga.yc.gp,q=olympe.ha.node.oa.Ga.yc.Dp,r=olympe.ha.node.oa.Ga.yc.Ep,t=olympe.ha.node.oa.Ga.yc.Cq,u=olympe.ha.node.oa.Ga.yc.Tq;if(1<d.length)zk(b,olympe.ha.node.oa.Ga.pd.ag,Ak(a,d,olympe.ha.node.oa.Ga.pd.ag,c));else{var [v,w,y]=d[0];d=`${c}.${v}`;switch(w){case f:Bk(b,e,d,'=',
952
- y.v,!1);break;case u:a=Ck('.*',b.client.dialect);Bk(b,e,d,'LIKE',`${a}${y}${a}`,!1);break;case l:const A=y.relations,D=`cte${a.N++}`,T=new olympe.ha.node.oa.Ga.Oq(a.V,a.C,A),I=olympe.ha.node.oa.Ga.Yc.Nh;a.C.with(D,aa=>{for(const [Pk,{Kg:Qk,gh:Rk,name:Sk,filters:Tk,recursive:Uk,Zh:Vk,kh:Wk,ci:Xk}]of A.entries())wk(T,aa,Qk,Rk,Sk,Tk,Uk,0===Pk,Wk,Xk,Vk);return aa});a.C.whereIn(b.client.raw('??.??',[c,I]),function(aa){aa.select(b.client.raw('??.??',[D,I])).from(D)});break;case q:Bk(b,e,d,'<=',y,'string'===
953
- typeof y);break;case r:Bk(b,e,d,'<',y,'string'===typeof y);break;case n:Bk(b,e,d,'>=',y,'string'===typeof y);break;case p:Bk(b,e,d,'>',y,'string'===typeof y);break;case g:zk(b,e,Ak(a,y,olympe.ha.node.oa.Ga.pd.ag,c));break;case h:zk(b,e,Ak(a,y,olympe.ha.node.oa.Ga.pd.Mh,c));break;case k:zk(b,olympe.ha.node.oa.Ga.pd.Xg,Ak(a,[y],olympe.ha.node.oa.Ga.pd.Xg,c));break;case t:e=Dk(y,b.client.dialect),b.whereRaw('?? LIKE ?',[d,e])}}}
954
- function yk(a,b,c,d,e){var f=['tagOlympe'];const g=Ek(f,d),h=Ek(f,c),k=g.map((l,n)=>[l,h[n]]);b.withRecursive(c,g,l=>{l.select(g).from({[d]:e}).eD(n=>n.select(g).from({[d]:e}).join(c,()=>{a.on(Object.fromEntries(k))}))})}function Ek(a,b){return a.map(c=>`${b}.${c}`)}
955
- function zk(a,b,c){switch(b){case olympe.ha.node.oa.Ga.pd.NONE:a.where(c);break;case olympe.ha.node.oa.Ga.pd.ag:a.andWhere(c);break;case olympe.ha.node.oa.Ga.pd.Mh:a.orWhere(c);break;case olympe.ha.node.oa.Ga.pd.Xg:a.whereNot(c);break;default:olympe.pa.Xa('storage').error(`Where operand ${b} not recognized`)}}function Ak(a,b,c,d){return e=>{for(let f=0;f<b.length;++f)xk(a,e,d,[b[f]],0===f?olympe.ha.node.oa.Ga.pd.NONE:c)}}
956
- function Bk(a,b,c,d,e,f){e=f?a.client.raw(e):e;switch(b){case olympe.ha.node.oa.Ga.pd.NONE:a.where(c,d,e);break;case olympe.ha.node.oa.Ga.pd.ag:a.andWhere(c,d,e);break;case olympe.ha.node.oa.Ga.pd.Mh:a.orWhere(c,d,e);break;case olympe.ha.node.oa.Ga.pd.Xg:a.whereNot(c,d,e);break;default:olympe.pa.Xa('storage').error(`Where operand ${b} not recognized`)}}function Ck(a,b){const c={'.+?':'_','.*':'%','.+':'_%'},d={'.+?':'?','.*':'*','.+':'?*'};return'mssql'===b?d[a]:c[a]}
957
- function Dk(a,b){let c='',d='',e='';const f=/^([-\u0153\u0152\u00e6\u00c6\u00e5\u00c5\u00f8\u00d8&/\u00df\u00a1\u00bf=\u00e0\u00c0\u00e2\u00c2\u00e4\u00c4\u00e1\u00c1\u00e9\u00c9\u00e8\u00c8\u00ea\u00ca\u00eb\u00cb\u00ec\u00cc\u00ee\u00ce\u00ef\u00cf\u00f2\u00d2\u00f4\u00d4\u00f6\u00d6\u00f9\u00d9\u00fb\u00db\u00fc\u00dc\u00e7\u00c7\u2019\u00f1\u00e3\u00f5\u00c3\u00d5\u00d1]|\w|\s|\d|\\\\)/,g=/^[%_'"]/,h=/^(\\\^|\\\/|\\\$|\\\.|\\\?|\\\*|\\\+|\\\(|\\\)|\\\[|\\\]|\\\{|\\\}])/,k=/^(\.\+\?|\.\*|\.\+)/;
958
- a=a.source;a.startsWith('^')?a=a.substring(1,a.length):c='%';for(a.endsWith('$')?a=a.substring(0,a.length-1):e='%';''!==a;){{var l=a;var n=b,p=k,q=h,r=f;const v=g.exec(l);if(v)l=[`\\${v[0]}`,v[0].length];else if(p=p.exec(l))l=[Ck(p[0],n),p[0].length];else if(q=q.exec(l))l=q[0],l='mssql'!==n||'['!==l[1]&&']'!==l[1]?[l.substring(1,l.length),l.length]:[l,q[0].length];else if(n=r.exec(l))l=[n[0],n[0].length];else throw Error(`Could find a match for character ${l.charAt(0)}`);}const [t,u]=l;d+=t;a=a.substring(u,
959
- a.length)}return c+d+e}olympe.ha.node.oa.Ga.Oq=class{constructor(a,b,c){this.V=a;this.C=b;this.G=this.F='';this.N=0;this.Z=c}};olympe.ha.node.oa.Ga.pd={ag:'&',Mh:'|',Xg:'!',NONE:''};const Fk=olympe.ha.node.oa.Ga.Yc.kk,Gk=olympe.ha.node.oa.Ga.Yc.El,Hk=olympe.ha.node.oa.Ga.Yc.Nh,Ik=olympe.ha.node.oa.Ga.Yc.Sj,Jk=olympe.dc.$b.VERSION,Kk=olympe.dc.$b.Jd;function Dj(a,b,c){return x(function*(){yield Fj(a.C);yield b.transaction(d=>x(function*(){const e=()=>d.withSchema(c);for(const f of a.ua)yield f(e);a.L.debug(`Transaction after execute operations before commit : ${d.toString()}`);a.ua.length=0;a.qn.clear()}()))}())}
960
- olympe.ha.node.oa.Ga.Qq=class{constructor(a,b){this.L=a;this.C=b;this.Ud=b.Ud;this.qn=new Map;this.ua=[]}Aj(a,b,c){a=void 0===c||c?{[Hk]:a}:{};for(const d of b){const [e,f]=d;b=lk(f);a[e]=b.v}return a}F(a,b){b.delete(Kk);b.delete(Jk);this.qn.set(a,b||new Map)}pc(a,b){this.ua.push(c=>{const d=this;return x(function*(){b.delete(Jk);const e=yield Ej(d.Ud,a);yield c().table(e).where(Hk,a).update(d.Aj(a,b,!1))}())})}Jc(a){this.ua.push(b=>{const c=this;return x(function*(){var d=yield c.Ud.Tb(a,'');d=yield Ej(c.Ud,
961
- d);var e=olympe.dc.gb.from(d).sb(olympe.dc.CloudObject.G).bd();for(var f of e.keys())e=yield Promise.resolve(f),yield b().table(e).where(Fk,a).del();f=olympe.dc.gb.from(d).sb(olympe.dc.CloudObject.V).bd();for(const g of f.keys())f=yield Promise.resolve(g),yield b().table(f).where(Gk,a).del();yield b().table(d).where(Hk,a).del()}())})}Ra(a,b,c){a===olympe.dc.ic.Tc?(Oj(this.C,c),this.ua.push(d=>{const e=this;return x(function*(){const f=e.qn.get(b),g=yield Ej(e.Ud,c);c!==olympe.dc.xa(olympe.dm.File)||
962
- f.has(Ik)?(e.Ud.N.set(b,c),yield d().table(g).insert(e.Aj(b,f,!0))):yield d().table(g).where(Hk,b).update(e.Aj(b,f,!1))}())})):this.ua.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d().table(e).insert({[Fk]:b,[Gk]:c})}()))}ec(a,b,c){this.ua.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d().table(e).where({[Fk]:b,[Gk]:c}).del()}()))}};olympe.ha.node.oa.Ga.Qq.la=[olympe.dc.Writable];function Ej(a,b){return(a=a.C.get(b))?Promise.resolve(a):Promise.reject(`No table were found for model ${a}`)}function nk(a,b,c,d){let e=a.F.get(b);e||(e=new Map,a.F.set(b,e));a=e.get(c);a||(a=e.size+1,e.set(c,a));return`${a};${d}`}function vk(a,b,c){a=a.F.get(b)||new Map;return(a=Array.from(a).find(([,d])=>d===c))&&a[0]||null}
963
- olympe.ha.node.oa.Ga.bv=class{constructor(){this.N=new Map;this.F=new Map;this.C=new Map;this.G=new Map}static R(a,b,c){return c?b[0][1]:''}ph(a){return Promise.resolve(a)}fb(a){return Promise.resolve(a)}Tb(a){return(a=this.N.get(a))?Promise.resolve(a):Promise.reject('GET MODEL TAG OF INSTANCE NOT IMPLEMENTED')}};function lk(a){let b=1,c=a;switch(!0){case a instanceof Date:b=2;c=a.toJSON();break;case a instanceof olympe.D.Color:b=3,c=a`${a.Of().valueOf()}.${a.If().valueOf()}.${a.Df().valueOf()}.${a.Cf().valueOf()}`}return{t:b,v:c}}olympe.ha.node.oa.Ga.oC=class{};olympe.ha.node.host={};olympe.ha.node.host.Hd=function(a,b){this.uid=a;this.L=b};olympe.ha.node.host.Hd.prototype.constructor=olympe.ha.node.host.Hd;olympe.ha.node.host.Hd.prototype.destroy=function(){};olympe.ha.node.host.Hd.prototype.destroy=olympe.ha.node.host.Hd.prototype.destroy;olympe.ha.node.host.Hd.prototype.Xa=function(){return this.L};olympe.ha.node.host.Hd.la=[olympe.host.da.Hd];olympe.ha.node.host.$p=class{constructor(a){this.L=a}pj(){return!1}bl(){this.L.error('No history manager implemented in Node')}C(){this.bl();return Hb()}F(){this.bl()}};olympe.ha.node.host.$p.la=[olympe.host.Fi];olympe.ha.node.host.ad=class{constructor(){this.C={};this.N={}}destroy(){}V(a){clearTimeout(this.C[a]);delete this.C[a]}aa(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}Z(a,b,c){this.N[b]=setInterval(c,a)}F(a){clearInterval(this.N[a]);delete this.N[a]}};olympe.host.Zp.register(olympe.host.da.Yp.rr,olympe.ha.node.host.ad);olympe.ha.node.host.ad.la=[olympe.host.da.ad];olympe.ha.node.host.yk=class{constructor(a){this.L=a}};olympe.ha.node.host.yk.la=[olympe.host.yk];olympe.T.config(function(a){ra(a,olympe.host.O.Ml,olympe.ha.node.host.$p,olympe.host.O.Ea);ra(a,olympe.host.O.Wq,olympe.ha.node.host.yk,olympe.host.O.Ea)},'olympe.native.node.host');olympe.net.sd={};olympe.net.sd.Ql=class{constructor(a){this.L=a;this.C=new Map}G(){}F(){}};olympe.net.sd.WebSocket=class{constructor(a,b){this.L=b;this.id=a;this.C=null;this.buffer=[];this.F=this.G=this.N=null}Y(){return this.id}open(a){const b=`#${this.id}`,c=this.Z(a);c.binaryType='arraybuffer';c.onopen=()=>{this.L.info('Websocket OPENED');this.N?(this.L.debug('Notifying upper layer for WebSocket',b),this.N()):this.L.warn('Nothing to notify for WebSocket',b);this.L.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));this.buffer.length=
953
+ function Bk(a,b,c,d,e){const f=olympe.ha.node.oa.Ga.yc.EQUAL,g=olympe.ha.node.oa.Ga.yc.Zf,h=olympe.ha.node.oa.Ga.yc.Lh,k=olympe.ha.node.oa.Ga.yc.Vg,l=olympe.ha.node.oa.Ga.yc.Mo,n=olympe.ha.node.oa.Ga.yc.Zo,p=olympe.ha.node.oa.Ga.yc.$o,q=olympe.ha.node.oa.Ga.yc.xp,r=olympe.ha.node.oa.Ga.yc.yp,t=olympe.ha.node.oa.Ga.yc.xq,u=olympe.ha.node.oa.Ga.yc.Oq;if(1<d.length)Dk(b,olympe.ha.node.oa.Ga.pd.Zf,Ek(a,d,olympe.ha.node.oa.Ga.pd.Zf,c));else{var [v,w,y]=d[0];d=`${c}.${v}`;switch(w){case f:Fk(b,e,d,'=',
954
+ y.v,!1);break;case u:a=Gk('.*',b.client.dialect);Fk(b,e,d,'LIKE',`${a}${y}${a}`,!1);break;case l:const B=y.relations,E=`cte${a.N++}`,T=new olympe.ha.node.oa.Ga.Jq(a.U,a.C,B),I=olympe.ha.node.oa.Ga.Yc.Mh;a.C.with(E,aa=>{for(const [Tk,{Ig:Uk,eh:Vk,name:Wk,filters:Xk,recursive:Yk,Yh:Zk,ih:$k,bi:al}]of B.entries())Ak(T,aa,Uk,Vk,Wk,Xk,Yk,0===Tk,$k,al,Zk);return aa});a.C.whereIn(b.client.raw('??.??',[c,I]),function(aa){aa.select(b.client.raw('??.??',[E,I])).from(E)});break;case q:Fk(b,e,d,'<=',y,'string'===
955
+ typeof y);break;case r:Fk(b,e,d,'<',y,'string'===typeof y);break;case n:Fk(b,e,d,'>=',y,'string'===typeof y);break;case p:Fk(b,e,d,'>',y,'string'===typeof y);break;case g:Dk(b,e,Ek(a,y,olympe.ha.node.oa.Ga.pd.Zf,c));break;case h:Dk(b,e,Ek(a,y,olympe.ha.node.oa.Ga.pd.Lh,c));break;case k:Dk(b,olympe.ha.node.oa.Ga.pd.Vg,Ek(a,[y],olympe.ha.node.oa.Ga.pd.Vg,c));break;case t:e=Hk(y,b.client.dialect),b.whereRaw('?? LIKE ?',[d,e])}}}
956
+ function Ck(a,b,c,d,e){var f=['tagOlympe'];const g=Ik(f,d),h=Ik(f,c),k=g.map((l,n)=>[l,h[n]]);b.withRecursive(c,g,l=>{l.select(g).from({[d]:e}).hD(n=>n.select(g).from({[d]:e}).join(c,()=>{a.on(Object.fromEntries(k))}))})}function Ik(a,b){return a.map(c=>`${b}.${c}`)}
957
+ function Dk(a,b,c){switch(b){case olympe.ha.node.oa.Ga.pd.NONE:a.where(c);break;case olympe.ha.node.oa.Ga.pd.Zf:a.andWhere(c);break;case olympe.ha.node.oa.Ga.pd.Lh:a.orWhere(c);break;case olympe.ha.node.oa.Ga.pd.Vg:a.whereNot(c);break;default:olympe.pa.Xa('storage').error(`Where operand ${b} not recognized`)}}function Ek(a,b,c,d){return e=>{for(let f=0;f<b.length;++f)Bk(a,e,d,[b[f]],0===f?olympe.ha.node.oa.Ga.pd.NONE:c)}}
958
+ function Fk(a,b,c,d,e,f){e=f?a.client.raw(e):e;switch(b){case olympe.ha.node.oa.Ga.pd.NONE:a.where(c,d,e);break;case olympe.ha.node.oa.Ga.pd.Zf:a.andWhere(c,d,e);break;case olympe.ha.node.oa.Ga.pd.Lh:a.orWhere(c,d,e);break;case olympe.ha.node.oa.Ga.pd.Vg:a.whereNot(c,d,e);break;default:olympe.pa.Xa('storage').error(`Where operand ${b} not recognized`)}}function Gk(a,b){const c={'.+?':'_','.*':'%','.+':'_%'},d={'.+?':'?','.*':'*','.+':'?*'};return'mssql'===b?d[a]:c[a]}
959
+ function Hk(a,b){let c='',d='',e='';const f=/^([-\u0153\u0152\u00e6\u00c6\u00e5\u00c5\u00f8\u00d8&/\u00df\u00a1\u00bf=\u00e0\u00c0\u00e2\u00c2\u00e4\u00c4\u00e1\u00c1\u00e9\u00c9\u00e8\u00c8\u00ea\u00ca\u00eb\u00cb\u00ec\u00cc\u00ee\u00ce\u00ef\u00cf\u00f2\u00d2\u00f4\u00d4\u00f6\u00d6\u00f9\u00d9\u00fb\u00db\u00fc\u00dc\u00e7\u00c7\u2019\u00f1\u00e3\u00f5\u00c3\u00d5\u00d1]|\w|\s|\d|\\\\)/,g=/^[%_'"]/,h=/^(\\\^|\\\/|\\\$|\\\.|\\\?|\\\*|\\\+|\\\(|\\\)|\\\[|\\\]|\\\{|\\\}])/,k=/^(\.\+\?|\.\*|\.\+)/;
960
+ a=a.source;a.startsWith('^')?a=a.substring(1,a.length):c='%';for(a.endsWith('$')?a=a.substring(0,a.length-1):e='%';''!==a;){{var l=a;var n=b,p=k,q=h,r=f;const v=g.exec(l);if(v)l=[`\\${v[0]}`,v[0].length];else if(p=p.exec(l))l=[Gk(p[0],n),p[0].length];else if(q=q.exec(l))l=q[0],l='mssql'!==n||'['!==l[1]&&']'!==l[1]?[l.substring(1,l.length),l.length]:[l,q[0].length];else if(n=r.exec(l))l=[n[0],n[0].length];else throw Error(`Could find a match for character ${l.charAt(0)}`);}const [t,u]=l;d+=t;a=a.substring(u,
961
+ a.length)}return c+d+e}olympe.ha.node.oa.Ga.Jq=class{constructor(a,b,c){this.U=a;this.C=b;this.G=this.F='';this.N=0;this.Y=c}};olympe.ha.node.oa.Ga.pd={Zf:'&',Lh:'|',Vg:'!',NONE:''};const Jk=olympe.ha.node.oa.Ga.Yc.gk,Kk=olympe.ha.node.oa.Ga.Yc.Al,Lk=olympe.ha.node.oa.Ga.Yc.Mh,Mk=olympe.ha.node.oa.Ga.Yc.Pj,Nk=olympe.dc.$b.VERSION,Ok=olympe.dc.$b.Jd;function Hj(a,b,c){return x(function*(){yield Jj(a.U);yield b.transaction(d=>x(function*(){const e=()=>d.withSchema(c);for(const f of a.ua)yield f(e);a.L.debug(`Transaction after execute operations before commit : ${d.toString()}`);a.ua.length=0;a.N.clear()}()))}())}
962
+ olympe.ha.node.oa.Ga.Lq=class{constructor(a,b){this.L=a;this.U=b;this.C=b.C;this.N=new Map;this.ua=[]}G(a,b,c=!0){a=c?{[Lk]:a}:{};for(const [d,e]of b)b=pk(e),a[d]=b.v;return a}F(a,b){b.delete(Ok);b.delete(Nk);this.N.set(a,b||new Map)}qc(a,b){this.ua.push(c=>{const d=this;return x(function*(){b.delete(Nk);var e=yield d.C.Rb(a,'');e=yield Ij(d.C,e);yield c().table(e).where(Lk,a).update(d.G(a,b,!1))}())})}Jc(a){this.ua.push(b=>{const c=this;return x(function*(){var d=yield c.C.Rb(a,'');d=yield Ij(c.C,
963
+ d);var e=olympe.dc.gb.from(d).sb(olympe.dc.CloudObject.G).bd();for(var f of e.keys())e=yield Promise.resolve(f),yield b().table(e).where(Jk,a).del();f=olympe.dc.gb.from(d).sb(olympe.dc.CloudObject.U).bd();for(const g of f.keys())f=yield Promise.resolve(g),yield b().table(f).where(Kk,a).del();yield b().table(d).where(Lk,a).del()}())})}Ra(a,b,c){a===olympe.dc.kc.Tc?(Sj(this.U,c),this.ua.push(d=>{const e=this;return x(function*(){const f=e.N.get(b),g=yield Ij(e.C,c);c!==olympe.dc.xa(olympe.dm.File)||
964
+ f.has(Mk)?(e.C.N.set(b,c),yield d().table(g).insert(e.G(b,f,!0))):yield d().table(g).where(Lk,b).update(e.G(b,f,!1))}())})):this.ua.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d().table(e).insert({[Jk]:b,[Kk]:c})}()))}hc(a,b,c){this.ua.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d().table(e).where({[Jk]:b,[Kk]:c}).del()}()))}};olympe.ha.node.oa.Ga.Lq.la=[olympe.dc.Writable];function Ij(a,b){return(a=a.C.get(b))?Promise.resolve(a):Promise.reject(`No table were found for model ${a}`)}function rk(a,b,c,d){let e=a.F.get(b);e||(e=new Map,a.F.set(b,e));a=e.get(c);a||(a=e.size+1,e.set(c,a));return`${a};${d}`}function zk(a,b,c){a=a.F.get(b)||new Map;return(a=Array.from(a).find(([,d])=>d===c))&&a[0]||null}
965
+ olympe.ha.node.oa.Ga.Zu=class{constructor(){this.N=new Map;this.F=new Map;this.C=new Map;this.G=new Map}static R(a,b,c){return c?b[0][1]:''}nh(a){return Promise.resolve(a)}fb(a){return Promise.resolve(a)}Rb(a){return(a=this.N.get(a))?Promise.resolve(a):Promise.reject('GET MODEL TAG OF INSTANCE NOT IMPLEMENTED')}};function pk(a){let b=1,c=a;switch(!0){case a instanceof Date:b=2;c=a.toJSON();break;case a instanceof olympe.D.Color:b=3,c=a`${a.Of().valueOf()}.${a.If().valueOf()}.${a.Df().valueOf()}.${a.Cf().valueOf()}`}return{t:b,v:c}}olympe.ha.node.oa.Ga.rC=class{};olympe.ha.node.host={};olympe.ha.node.host.Hd=function(a,b){this.uid=a;this.L=b};olympe.ha.node.host.Hd.prototype.constructor=olympe.ha.node.host.Hd;olympe.ha.node.host.Hd.prototype.destroy=function(){};olympe.ha.node.host.Hd.prototype.destroy=olympe.ha.node.host.Hd.prototype.destroy;olympe.ha.node.host.Hd.prototype.Xa=function(){return this.L};olympe.ha.node.host.Hd.la=[olympe.host.da.Hd];olympe.ha.node.host.Up=class{constructor(a){this.L=a}nj(){return!1}Yk(){this.L.error('No history manager implemented in Node')}C(){this.Yk();return Hb()}F(){this.Yk()}};olympe.ha.node.host.Up.la=[olympe.host.Ei];olympe.ha.node.host.ad=class{constructor(){this.C={};this.N={}}destroy(){}U(a){clearTimeout(this.C[a]);delete this.C[a]}aa(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}Y(a,b,c){this.N[b]=setInterval(c,a)}F(a){clearInterval(this.N[a]);delete this.N[a]}};olympe.host.Tp.register(olympe.host.da.Sp.kr,olympe.ha.node.host.ad);olympe.ha.node.host.ad.la=[olympe.host.da.ad];olympe.ha.node.host.uk=class{constructor(a){this.L=a}};olympe.ha.node.host.uk.la=[olympe.host.uk];olympe.T.config(function(a){ra(a,olympe.host.O.Il,olympe.ha.node.host.Up,olympe.host.O.Ea);ra(a,olympe.host.O.Rq,olympe.ha.node.host.uk,olympe.host.O.Ea)},'olympe.native.node.host');olympe.net.sd={};olympe.net.sd.Ml=class{constructor(a){this.L=a;this.C=new Map}G(){}F(){}};olympe.net.sd.WebSocket=class{constructor(a,b){this.L=b;this.id=a;this.C=null;this.buffer=[];this.F=this.G=this.N=null}Z(){return this.id}open(a){const b=`#${this.id}`,c=this.Y(a);c.binaryType='arraybuffer';c.onopen=()=>{this.L.info('Websocket OPENED');this.N?(this.L.debug('Notifying upper layer for WebSocket',b),this.N()):this.L.warn('Nothing to notify for WebSocket',b);this.L.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));this.buffer.length=
964
966
  0};c.onmessage=d=>{d='string'===typeof d.data?String(d.data):Ea(d.data);this.L.debug(b,'<',d);this.F&&this.F(d)};c.onclose=()=>{this.L.debug(`WebSocket ${b} CLOSED`);this.G&&this.G()};c.onerror=()=>{this.L.debug(`WebSocket ${b} ERROR`)};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.L.debug(b,'>',a);this.C.send(a);break;case c.CONNECTING:this.L.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);break;default:return this.L.debug(b,
965
- '- Closed','>',a),!1}}else this.L.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.L.debug(`Force closing native websocket ${`#${this.id}`}`);this.C.close(1E3);return}}this.L.debug('Try to force close native websocket, but not open nor connecting')}ka(a){this.N=a||null}aa(a){this.F=a||null}V(a){this.G=a||null}Z(){}};olympe.net.sd.WebSocket.la=[olympe.net.WebSocket];olympe.ha.node.net={};olympe.ha.node.net.ku=class extends olympe.net.sa{constructor(a,b){super(a,b);this.Z=new olympe.ha.node.net.Ql(a)}V(){return'NodeJS'}aa(a){var b=this.G++;a=a.C();this.L.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.ha.node.net.lu(b,this.L);b.open(a);return b}C(a,b){this.L.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.G++;b=Rb(this,c,b);this.Z.G(c,{u:a.C(),s:Nb(a),h:Lb(a),p:a.port,z:Mb(a),q:Qb(a),m:a.method,v:a.ij(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,b:a.body,r:a.F},b)}N(){this.L.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.Z}};const Lk=require('fs'),Mk=require('http'),Nk=require('https');
966
- olympe.ha.node.net.Ql=class extends olympe.net.sd.Ql{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,l=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,v=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f};g&&(b.headers=g);g=(w,y,A)=>new Promise((D,T)=>{Lk.readFile(w,(I,aa)=>{I?T(I):(A[y]=aa,D(A))})});p=w=>{const y=D=>{D.setEncoding(v===olympe.net.eb.ResponseType.zk?'utf-8':'binary');let T='';D.on('data',I=>{T+=I});D.on('end',()=>{if(v!==olympe.net.eb.ResponseType.zk){var I=
967
- (new Uint8Array(Buffer.from(T,'binary'))).buffer;I=v===olympe.net.eb.ResponseType.sl?new Blob([I]):I}else I=T;c(this.F(D.statusCode,D.statusMessage,I,D.headers))})},A=d?new Nk.request(w,y):new Mk.request(w,y);this.C.set(a,()=>{A.destroy()});A.on('error',D=>{c(this.F(0,'Conection refused','Error connecting to '+u+' with method '+f+', code = '+D.code+', message = '+D.message,''))});!e||'POST'!==f&&'PUT'!==f?A.end():(e instanceof Blob?e.arrayBuffer():Promise.resolve(e)).then(D=>{A.write(D instanceof
968
- ArrayBuffer?Buffer.from(D):D);A.end()})};d&&(h||k||l)?h&&k&&l?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,l,'ca')).then(p).catch(w=>{this.L.log('Error loading self signed files:',w)})):this.L.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.L.debug('Received HTTP response',a,c);return new olympe.net.Tg(c,a,b,d)}};olympe.ha.node.net.lu=class extends olympe.net.sd.WebSocket{Z(a){return new (require('ws'))(a)}};olympe.ha.node.net.Config={OB:'native.html.net.useWorkers'};olympe.T.config(function(a){ra(a,olympe.net.O.va,olympe.ha.node.net.ku,olympe.net.O.Ea,olympe.host.O.va)},'olympe.native.node.net');olympe.ha.node.net.http={};const Ok=require('fastify'),Yk=require('fastify-cors'),Zk={Qi:0,ym:1,vk:2};
969
- function $k(a,b){a.F.route({url:b.path,method:b.methods,handler:(c,d)=>{a.L.debug('< HTTP:',c);var e=c.body,f='';e instanceof Buffer?(f=new Uint8Array(e.length),e.copy(f)):'string'===typeof e&&(f=e);const [g,h]=c.hostname.split(':');e=new olympe.net.Zj(g,parseInt(h,10),c.url,'https'===c.protocol,c.method,f);for(const [k,l]of Object.entries(c.headers))e.headers[k]=l;b.mx(e,new Map(Object.entries(c.params))).then(k=>{const l=k.getData();a.L.debug('> HTTP: reply with body:',l instanceof ArrayBuffer?
970
- 'binary':l);d.code(k.Rd()).headers(k.ij()).send(l instanceof ArrayBuffer?Buffer.from(l):l)}).catch(k=>{a.L.debug('> HTTP: reply with internal server error:',k);d.code(olympe.net.eb.od.Lq).header(olympe.net.eb.Headers.Lj,'text/plain').send({error:`Internal server error: ${k}`})})}})}
971
- olympe.ha.node.net.http.Fk=class extends olympe.net.Fk{constructor(a,b,c){super(a);this.F=this.createServer();this.host=b;this.port=c;this.G=new Map;this.V=null;this.C=Zk.Qi;this.Ke=new Set}aa(a,b){this.V={origin:'*',methods:a,allowedHeaders:b};return this}N(a,b,c,d){this.G.set(a,{path:b,methods:c,mx:d});switch(this.C){case Zk.Qi:return this.start();case Zk.vk:return this.stop(),this.start();case Zk.ym:return new Promise((e,f)=>{this.Ke.add(g=>g?f(g):e())});default:return Promise.reject('Webservice in unknown state')}}Z(a){this.G.delete(a);
972
- this.stop();return 0===this.G.size?Promise.resolve():this.start()}stop(){this.C===Zk.vk&&(this.F.close(),this.C=Zk.Qi,this.F=this.createServer())}start(){return this.C===Zk.Qi?new Promise((a,b)=>{this.F.register(Yk,this.V);for(const c of this.G.values())$k(this,c);this.C=Zk.ym;this.F.listen(this.port,'0.0.0.0',(c,d)=>{this.C=Zk.vk;this.Ke.forEach(e=>e(c));this.Ke.clear();c?(this.stop(),b(c)):(this.L.debug('Web server listening on '+d),a())})}):Promise.reject('Try to start a webservice already started')}createServer(){const a=
973
- Ok({logger:!0});a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,d)=>{d(null,c)});return a}};olympe.T.config(function(a){B(a,olympe.net.O.Dm,olympe.ha.node.net.http.Fk,olympe.net.O.Ea,new olympe.T.fa(olympe.net.Config.Nl),new olympe.T.fa(olympe.net.Config.Ol))},'olympe.native.node.net.http');olympe.ha.node.W={};const al=new Map;olympe.ha.node.W.vl=class extends olympe.W.vl{V(a){return(new Uint8Array(Buffer.from(a,'base64'))).buffer}C(a){return Buffer.from(a).toString('base64')}G(a,b){a.arrayBuffer().then(olympe.D.Ia().Cb(b))}N(a){var b=()=>Math.random().toString(16).slice(-4);b=`blob://${`${b()}${b()}-${b()}-${b()}-${b()}-${b()}${b()}${b()}`}`;al.set(b,a);return b}F(a,b,c){al.has(a)?b(al.get(a)):c&&c('No object has been found for that url. Maybe the URL has already been revoked')}Z(a){al.delete(a)}};olympe.T.config(function(a){ra(a,olympe.W.O.zh,olympe.ha.node.W.vl)},'olympe.native.node.utils');olympe.ha.node.auth={};olympe.ha.node.auth.aq=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.ha.node.auth.aq.la=[olympe.auth.tk];olympe.T.config(a=>{B(a,olympe.auth.O.pk,olympe.ha.node.auth.aq)},'olympe.native.node.auth');olympe.ha.node.hc={};olympe.ha.node.hc.Qp=class{constructor(a){this.F={};this.L=a}C(a){void 0===this.F[a]&&(this.F[a]=new olympe.ha.node.hc.Rp(a,this.L));return this.F[a].open()}};olympe.ha.node.hc.Qp.la=[olympe.hc.Vt];olympe.ha.node.hc.Rp=class{constructor(a,b){this.name=a;this.L=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();
974
- b&&b(!0)}clear(){this.C||this.open();this.db.setState({})}};olympe.ha.node.hc.Rp.la=[olympe.hc.Wt];olympe.T.config(function(a){B(a,olympe.hc.O.dk,olympe.ha.node.hc.Qp,olympe.hc.O.Ea)},'olympe.native.node.localstorage');olympe.ha.node.storage={};olympe.ha.node.storage.Storage=class{constructor(a){this.L=a}F(a){a&&a('Not Implemented.')}V(a){a&&a('Not Implemented.')}write(a,b,c,d,e){e&&e('Not Implemented.')}G(a){a&&a('Not Implemented.')}N(a){a&&a('Not Implemented.')}C(a){a&&a('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.ha.node.storage.Storage.la=[olympe.hc.Storage];olympe.T.config(function(a){ra(a,olympe.hc.O.Ri,olympe.ha.node.storage.Storage,olympe.host.O.Ea)},'olympe.native.html.storage');olympe.Gg={};olympe.Gg.Config={VERSION:'version.version',Es:'version.branch',cg:'version.commit',Xu:'version.tag',To:'version.olympe-framework',Fs:'version.build'};olympe.T.config(function(a){E(a,olympe.Gg.Config.VERSION,'');E(a,olympe.Gg.Config.Es,'');E(a,olympe.Gg.Config.cg,'');E(a,olympe.Gg.Config.Xu,'');E(a,olympe.Gg.Config.To,'');E(a,olympe.Gg.Config.Fs,'')},'olympe.main');const bl=require('fs');let wa,va;function cl(a,b){bl.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
975
- function dl(){if(void 0!==wa&&void 0!==va){0===Object.keys(va).length&&console.warn('No configuration found. Check presence of oConfig.json');0===Object.keys(wa).length&&console.warn('No version found. Check presence of version.json');var a=Object.create(null),b=process.argv;for(var c=2;c<b.length;c++){var d=/^true|false$/i,e=/^\d+(\.\d+)?$/;let f;const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(b[c]);f=g[3];void 0===f?f=!0:d.test(f)?f='true'===f.toLowerCase():e.test(f)&&(f=parseFloat(f));a[g[1]]=f}a=new olympe.T.Ps(a);
976
- d=a.Xa();d.debug('Registering configurations...');d.C++;for(let f=0,g=ka.length;f<g;f++)b=a,c=ka[f],qa(b.L,'Registering configure callback '+(c.C?'for module '+c.C:'')),b.F.push(c.F);oa(d);d.debug('done registering');a=a.compile();c=a.Xa();c.debug('Running run callbacks of container...');for(let f=0,g=la.length;f<g;f++)c.C++,d=la[f],b=a,e=na(b,d.fj()),b.L.debug('Calling run callback '+(d.C?'for module '+d.C:'')),d.F.apply(null,e),oa(c);c.debug('done calling run callbacks. DI process completed!')}}
977
- olympe.W.bn('oConfig.json',cl,function(a){va=a;dl()});cl('version.json',function(a){wa=a;dl()});olympe.uc={};olympe.uc.Bs=class{run(){}};olympe.uc.sa=class{constructor(a,b){this.C=a;this.L=b;this.F=null;this.G='';this.L.info('HC Manager will execute application registered as:',this.C)}vj(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.L.log('Application',c,'designated to be launched'):this.L.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.L.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.L.info('Running application:',this.G),
978
- this.F.run()):this.L.error('No app registered under name: '+this.C)}};olympe.uc.vj=function(a,b,c){const d=a.Xa();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.uc.Config.gf+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.Pd(olympe.uc.O.va).config([b],function(e,f){f.vj(e,c,b)},'olympe.hc.registerApp')};olympe.uc.O={va:'hc.Manager',Ea:'hc.Logger'};olympe.uc.Config={gf:'hc.app',Kl:'hc.globalToken'};olympe.T.config(function(a){E(a,olympe.uc.Config.gf,'default');E(a,olympe.uc.Config.Kl,!1);C(a,olympe.uc.O.Ea,[olympe.pa.O.va],b=>b.Nc('hc'));C(a,olympe.auth.O.Ej,[new olympe.T.fa(olympe.uc.Config.gf),new olympe.T.fa(olympe.uc.Config.Kl)],(b,c)=>new olympe.auth.ql(c?'':b));B(a,olympe.uc.O.va,olympe.uc.sa,new olympe.T.fa(olympe.uc.Config.gf),olympe.uc.O.Ea)},'olympe.hc');
979
- olympe.T.run([olympe.uc.O.va],a=>a.run(),'olympe.hc');olympe.sc.Zf={};function el(a){a.L.info('Starting application '+a.C);let b=!1;const c=olympe.dc.Na();if(0<a.C.length){const d=uc(c,a.C,(e,f)=>{if(e){const g=Qi(f);g.run?(a.L.debug('application retrieved: running'),(new olympe.D.Wb('Application execution context',a.F.Ec())).run(()=>{b=!0;g.run(a.F.Vk(g.R()))})):a.L.error('application retrieved: not an Application with a run() method')}else fl(a)});olympe.D.Ia().onDestroy(()=>{vc(c,a.C,d)});Ib(()=>{b||a.L.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
967
+ '- Closed','>',a),!1}}else this.L.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.L.debug(`Force closing native websocket ${`#${this.id}`}`);this.C.close(1E3);return}}this.L.debug('Try to force close native websocket, but not open nor connecting')}ka(a){this.N=a||null}aa(a){this.F=a||null}U(a){this.G=a||null}Y(){}};olympe.net.sd.WebSocket.la=[olympe.net.WebSocket];olympe.ha.node.net={};olympe.ha.node.net.hu=class extends olympe.net.sa{constructor(a,b){super(a,b);this.Y=new olympe.ha.node.net.Ml(a)}U(){return'NodeJS'}aa(a){var b=this.G++;a=a.C();this.L.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.ha.node.net.iu(b,this.L);b.open(a);return b}C(a,b){this.L.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.G++;b=Rb(this,c,b);this.Y.G(c,{u:a.C(),s:Nb(a),h:Lb(a),p:a.port,z:Mb(a),q:Qb(a),m:a.method,v:a.gj(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,b:a.body,r:a.F},b)}N(){this.L.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.Y}};const Pk=require('fs'),Qk=require('http'),Rk=require('https');
968
+ olympe.ha.node.net.Ml=class extends olympe.net.sd.Ml{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,l=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,v=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f};g&&(b.headers=g);g=(w,y,B)=>new Promise((E,T)=>{Pk.readFile(w,(I,aa)=>{I?T(I):(B[y]=aa,E(B))})});p=w=>{const y=E=>{E.setEncoding(v===olympe.net.eb.ResponseType.vk?'utf-8':'binary');let T='';E.on('data',I=>{T+=I});E.on('end',()=>{if(v!==olympe.net.eb.ResponseType.vk){var I=
969
+ (new Uint8Array(Buffer.from(T,'binary'))).buffer;I=v===olympe.net.eb.ResponseType.ol?new Blob([I]):I}else I=T;c(this.F(E.statusCode,E.statusMessage,I,E.headers))})},B=d?new Rk.request(w,y):new Qk.request(w,y);this.C.set(a,()=>{B.destroy()});B.on('error',E=>{c(this.F(0,'Conection refused','Error connecting to '+u+' with method '+f+', code = '+E.code+', message = '+E.message,''))});!e||'POST'!==f&&'PUT'!==f?B.end():(e instanceof Blob?e.arrayBuffer():Promise.resolve(e)).then(E=>{B.write(E instanceof
970
+ ArrayBuffer?Buffer.from(E):E);B.end()})};d&&(h||k||l)?h&&k&&l?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,l,'ca')).then(p).catch(w=>{this.L.log('Error loading self signed files:',w)})):this.L.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.L.debug('Received HTTP response',a,c);return new olympe.net.Rg(c,a,b,d)}};olympe.ha.node.net.iu=class extends olympe.net.sd.WebSocket{Y(a){return new (require('ws'))(a)}};olympe.ha.node.net.Config={RB:'native.html.net.useWorkers'};olympe.T.config(function(a){ra(a,olympe.net.O.va,olympe.ha.node.net.hu,olympe.net.O.Ea,olympe.host.O.va)},'olympe.native.node.net');olympe.ha.node.net.http={};const Sk=require('fastify'),bl=require('fastify-cors'),cl={Pi:0,tm:1,rk:2};
971
+ function dl(a,b){a.F.route({url:b.path,method:b.methods,handler:(c,d)=>{a.L.debug('< HTTP:',c);var e=c.body,f='';e instanceof Buffer?(f=new Uint8Array(e.length),e.copy(f)):'string'===typeof e&&(f=e);const [g,h]=c.hostname.split(':');e=new olympe.net.Wj(g,parseInt(h,10),c.url,'https'===c.protocol,c.method,f);for(const [k,l]of Object.entries(c.headers))e.headers[k]=l;b.mx(e,new Map(Object.entries(c.params))).then(k=>{const l=k.getData();a.L.debug('> HTTP: reply with body:',l instanceof ArrayBuffer?
972
+ 'binary':l);d.code(k.Rd()).headers(k.gj()).send(l instanceof ArrayBuffer?Buffer.from(l):l)}).catch(k=>{a.L.debug('> HTTP: reply with internal server error:',k);d.code(olympe.net.eb.od.Gq).header(olympe.net.eb.Headers.Ij,'text/plain').send({error:`Internal server error: ${k}`})})}})}
973
+ olympe.ha.node.net.http.Bk=class extends olympe.net.Bk{constructor(a,b,c){super(a);this.F=this.createServer();this.host=b;this.port=c;this.G=new Map;this.U=null;this.C=cl.Pi;this.Ke=new Set}aa(a,b){this.U={origin:'*',methods:a,allowedHeaders:b};return this}N(a,b,c,d){this.G.set(a,{path:b,methods:c,mx:d});switch(this.C){case cl.Pi:return this.start();case cl.rk:return this.stop(),this.start();case cl.tm:return new Promise((e,f)=>{this.Ke.add(g=>g?f(g):e())});default:return Promise.reject('Webservice in unknown state')}}Y(a){this.G.delete(a);
974
+ this.stop();return 0===this.G.size?Promise.resolve():this.start()}stop(){this.C===cl.rk&&(this.F.close(),this.C=cl.Pi,this.F=this.createServer())}start(){return this.C===cl.Pi?new Promise((a,b)=>{this.F.register(bl,this.U);for(const c of this.G.values())dl(this,c);this.C=cl.tm;this.F.listen(this.port,'0.0.0.0',(c,d)=>{this.C=cl.rk;this.Ke.forEach(e=>e(c));this.Ke.clear();c?(this.stop(),b(c)):(this.L.debug('Web server listening on '+d),a())})}):Promise.reject('Try to start a webservice already started')}createServer(){const a=
975
+ Sk({logger:!0});a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,d)=>{d(null,c)});return a}};olympe.T.config(function(a){A(a,olympe.net.O.ym,olympe.ha.node.net.http.Bk,olympe.net.O.Ea,new olympe.T.fa(olympe.net.Config.Jl),new olympe.T.fa(olympe.net.Config.Kl))},'olympe.native.node.net.http');olympe.ha.node.W={};const el=new Map;olympe.ha.node.W.rl=class extends olympe.W.rl{U(a){return(new Uint8Array(Buffer.from(a,'base64'))).buffer}C(a){return Buffer.from(a).toString('base64')}G(a,b){a.arrayBuffer().then(olympe.D.Ja().Cb(b))}N(a){var b=()=>Math.random().toString(16).slice(-4);b=`blob://${`${b()}${b()}-${b()}-${b()}-${b()}-${b()}${b()}${b()}`}`;el.set(b,a);return b}F(a,b,c){el.has(a)?b(el.get(a)):c&&c('No object has been found for that url. Maybe the URL has already been revoked')}Y(a){el.delete(a)}};olympe.T.config(function(a){ra(a,olympe.W.O.xh,olympe.ha.node.W.rl)},'olympe.native.node.utils');olympe.ha.node.auth={};olympe.ha.node.auth.Vp=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.ha.node.auth.Vp.la=[olympe.auth.pk];olympe.T.config(a=>{A(a,olympe.auth.O.kk,olympe.ha.node.auth.Vp)},'olympe.native.node.auth');olympe.ha.node.jc={};olympe.ha.node.jc.Kp=class{constructor(a){this.F={};this.L=a}C(a){void 0===this.F[a]&&(this.F[a]=new olympe.ha.node.jc.Lp(a,this.L));return this.F[a].open()}};olympe.ha.node.jc.Kp.la=[olympe.jc.St];olympe.ha.node.jc.Lp=class{constructor(a,b){this.name=a;this.L=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();
976
+ b&&b(!0)}clear(){this.C||this.open();this.db.setState({})}};olympe.ha.node.jc.Lp.la=[olympe.jc.Tt];olympe.T.config(function(a){A(a,olympe.jc.O.ak,olympe.ha.node.jc.Kp,olympe.jc.O.Ea)},'olympe.native.node.localstorage');olympe.ha.node.storage={};olympe.ha.node.storage.Storage=class{constructor(a){this.L=a}F(a){a&&a('Not Implemented.')}U(a){a&&a('Not Implemented.')}write(a,b,c,d,e){e&&e('Not Implemented.')}G(a){a&&a('Not Implemented.')}N(a){a&&a('Not Implemented.')}C(a){a&&a('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.ha.node.storage.Storage.la=[olympe.jc.Storage];olympe.T.config(function(a){ra(a,olympe.jc.O.Qi,olympe.ha.node.storage.Storage,olympe.host.O.Ea)},'olympe.native.html.storage');olympe.Eg={};olympe.Eg.Config={VERSION:'version.version',zs:'version.branch',ag:'version.commit',Uu:'version.tag',No:'version.olympe-framework',As:'version.build'};olympe.T.config(function(a){D(a,olympe.Eg.Config.VERSION,'');D(a,olympe.Eg.Config.zs,'');D(a,olympe.Eg.Config.ag,'');D(a,olympe.Eg.Config.Uu,'');D(a,olympe.Eg.Config.No,'');D(a,olympe.Eg.Config.As,'')},'olympe.main');const fl=require('fs');let wa,va;function gl(a,b){fl.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
977
+ function hl(){if(void 0!==wa&&void 0!==va){0===Object.keys(va).length&&console.warn('No configuration found. Check presence of oConfig.json');0===Object.keys(wa).length&&console.warn('No version found. Check presence of version.json');var a=Object.create(null),b=process.argv;for(var c=2;c<b.length;c++){var d=/^true|false$/i,e=/^\d+(\.\d+)?$/;let f;const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(b[c]);f=g[3];void 0===f?f=!0:d.test(f)?f='true'===f.toLowerCase():e.test(f)&&(f=parseFloat(f));a[g[1]]=f}a=new olympe.T.Ls(a);
978
+ d=a.Xa();d.debug('Registering configurations...');d.C++;for(let f=0,g=ka.length;f<g;f++)b=a,c=ka[f],qa(b.L,'Registering configure callback '+(c.C?'for module '+c.C:'')),b.F.push(c.F);oa(d);d.debug('done registering');a=a.compile();c=a.Xa();c.debug('Running run callbacks of container...');for(let f=0,g=la.length;f<g;f++)c.C++,d=la[f],b=a,e=na(b,d.dj()),b.L.debug('Calling run callback '+(d.C?'for module '+d.C:'')),d.F.apply(null,e),oa(c);c.debug('done calling run callbacks. DI process completed!')}}
979
+ olympe.W.Xm('oConfig.json',gl,function(a){va=a;hl()});gl('version.json',function(a){wa=a;hl()});olympe.uc={};olympe.uc.ws=class{run(){}};olympe.uc.sa=class{constructor(a,b){this.C=a;this.L=b;this.F=null;this.G='';this.L.info('HC Manager will execute application registered as:',this.C)}tj(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.L.log('Application',c,'designated to be launched'):this.L.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.L.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.L.info('Running application:',this.G),
980
+ this.F.run()):this.L.error('No app registered under name: '+this.C)}};olympe.uc.tj=function(a,b,c){const d=a.Xa();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.uc.Config.ef+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.Pd(olympe.uc.O.va).config([b],function(e,f){f.tj(e,c,b)},'olympe.hc.registerApp')};olympe.uc.O={va:'hc.Manager',Ea:'hc.Logger'};olympe.uc.Config={ef:'hc.app',Gl:'hc.globalToken'};olympe.T.config(function(a){D(a,olympe.uc.Config.ef,'default');D(a,olympe.uc.Config.Gl,!1);C(a,olympe.uc.O.Ea,[olympe.pa.O.va],b=>b.Nc('hc'));C(a,olympe.auth.O.Bj,[new olympe.T.fa(olympe.uc.Config.ef),new olympe.T.fa(olympe.uc.Config.Gl)],(b,c)=>new olympe.auth.ml(c?'':b));A(a,olympe.uc.O.va,olympe.uc.sa,new olympe.T.fa(olympe.uc.Config.ef),olympe.uc.O.Ea)},'olympe.hc');
981
+ olympe.T.run([olympe.uc.O.va],a=>a.run(),'olympe.hc');olympe.sc.Xf={};function il(a){a.L.info('Starting application '+a.C);let b=!1;const c=olympe.dc.Na();if(0<a.C.length){const d=yc(c,a.C,(e,f)=>{if(e){const g=Ui(f);g.run?(a.L.debug('application retrieved: running'),(new olympe.D.Wb('Application execution context',a.F.Ec())).run(()=>{b=!0;g.run(a.F.Rk(g.R()))})):a.L.error('application retrieved: not an Application with a run() method')}else jl(a)});olympe.D.Ja().onDestroy(()=>{zc(c,a.C,d)});Ib(()=>{b||a.L.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
980
982
  1E4)}}
981
- function gl(a,b){if(a.N)a.L.debug('Sending getContext request'),Qf(a.V,d=>{d?a.L.error('failed to synchronise (authenticated) with server: '+d.message):(a.L.debug('synchronisation request successful'),Yi=a.C,b())});else{var c=olympe.dc.Ed.SUBSCRIBE;const d=olympe.dc.Ed.Mi,e=a.F.$k()?d:c;a.L.debug((a.F.$k()?'PULLING':'SUBSCRIBING')+' application '+a.C);const f=olympe.D.Ia();c=new olympe.async.wk(f);c.add((g,h)=>{Ve(new olympe.dc.jf(a.C,e),olympe.dc.Rb.rf).hb(k=>{var l=olympe.dc.Ja;var n=(n=olympe.dc.ld.from(a.C).sb(olympe.sc.La.Me.C).sb(olympe.sc.logic.Yd.G.Pc()).bd())&&n.R()||
982
- olympe.dc.Ja.Vc;l.mc=n;k?h(k.message):g()})});c.add(g=>{olympe.D.wc([a.G.Eg()],h=>{(new olympe.dc.Aa(h)).Ke(f.Cb(g))})});c.add((g,h)=>{const k=olympe.sc.jd.C.Hp,l=olympe.sc.jd.C.cm;Zi(a.C,n=>{switch(n){case k:case l:g();break;default:h('Error while loading the business container')}})});Wb(c,(g,h)=>{if(h)throw Error(h);b()});c.start()}}function fl(a){a.L.debug('Stop the application');a.F.Ec().Af()}
983
- olympe.sc.Zf.wm=class{constructor(a,b,c,d,e,f,g){this.G=a;this.V=b;this.L=c;this.F=d;this.C=e;this.N=f;this.Z=g||!1}run(){const a=olympe.auth.sa.C.Ng,b=olympe.auth.sa.C.hg,c=olympe.auth.sa.C.Eh,d=olympe.auth.sa.C.pi;this.L.debug('runtime starting for app #'+this.C);let e=!1;const f=()=>{e||(el(this),e=!0)};olympe.D.wc([this.G.getState()],g=>{switch(g){case a:case c:this.L.debug('Server session opened, calling once connected callback');gl(this,f);break;case b:this.L.debug('Disconnected, working offline.');
984
- this.Z&&!e&&gl(this,f);break;case d:this.L.debug('waiting for authentication');break;default:this.L.debug('No server session available, waiting for connection'),e=!1,fl(this)}},'Runtime initial auth state listener')}};olympe.sc.Zf.wm.C='app_instance';olympe.sc.Zf.wm.la=[olympe.uc.Bs];olympe.sc.Zf.Hj={rf:'sc.runtime.Main'};
985
- olympe.T.config(function(a){C(a,olympe.auth.O.Ej,[new olympe.T.fa(olympe.uc.Config.gf),new olympe.T.fa(olympe.sc.Config.gf),new olympe.T.fa(olympe.uc.Config.Kl)],(b,c,d)=>new olympe.auth.ql(d?'':b+(c?'-'+c:'')));B(a,olympe.sc.Zf.Hj.rf,olympe.sc.Zf.wm,olympe.auth.O.va,olympe.dc.query.O.va,olympe.sc.O.Ea,olympe.sc.O.vm,new olympe.T.fa(olympe.sc.Config.gf),new olympe.T.fa(olympe.dc.Config.$g),new olympe.T.fa(olympe.sc.Config.bq));olympe.uc.vj(a,olympe.sc.Zf.Hj.rf,'sc.runtime');olympe.uc.vj(a,olympe.sc.Zf.Hj.rf,
986
- 'sc.headless');olympe.uc.vj(a,olympe.sc.Zf.Hj.rf)},'olympe.sc.runtime');olympe.public={};function hl(a,b){const c=new olympe.auth.Request;for(const [d,e]of a)c.set(d,e);return new Promise(d=>{fc(olympe.public.Ta.get(),c,b,()=>{d()})})}
987
- olympe.public.Ta=class{static gw(a,b){return olympe.auth.Hb.Ee.dj(a,b)}static getState(){return kc(olympe.public.Ta.get())}static pw(){return olympe.D.Ya(olympe.public.Ta.get().Eg())}static Ux(a){const b=new olympe.D.Wb('Observe user tag','function'===typeof a.Ec?a.Ec():a);return new rxjs.Observable(c=>{b.run(()=>olympe.D.wc([olympe.public.Ta.get().Eg()],d=>{c.next(d);olympe.D.Ia().onDestroy(()=>c.complete())}));return()=>b.destroy()})}static ed(){return olympe.D.Ya(nc(olympe.public.Ta.get()))}static Dw(){return olympe.D.Ya(olympe.public.Ta.get().ei())||
988
- void 0}static ki(){olympe.public.Ta.get().ki()}static rh(a){return new Promise((b,c)=>{olympe.public.Ta.get().rh(a,d=>d?c(d):b())})}static yx(a,b){return hl((new Map).set('username',a).set('password',b),'srp')}static xx(){return hl(new Map,'saml')}static zx(a,b){return hl((new Map).set('username',a).set('nonce',b),'localToken')}static wx(){return hl(new Map,'openID')}static yn(){return new Promise(a=>{mc(()=>{olympe.public.Ta.get().ra.delete('logoutCallback');a()});olympe.public.Ta.get().yn()})}static get(){return olympe.auth.Qc()}};
989
- olympe.public.Ta.logout=olympe.public.Ta.yn;olympe.public.Ta.loginOpenID=olympe.public.Ta.wx;olympe.public.Ta.loginToken=olympe.public.Ta.zx;olympe.public.Ta.loginSAML=olympe.public.Ta.xx;olympe.public.Ta.loginSRP=olympe.public.Ta.yx;olympe.public.Ta.getUserFromToken=olympe.public.Ta.rh;olympe.public.Ta.sendKeepAlive=olympe.public.Ta.ki;olympe.public.Ta.getIDPToken=olympe.public.Ta.Dw;olympe.public.Ta.getToken=olympe.public.Ta.ed;olympe.public.Ta.observeUser=olympe.public.Ta.Ux;
990
- olympe.public.Ta.getCurrentUser=olympe.public.Ta.pw;olympe.public.Ta.getState=olympe.public.Ta.getState;olympe.public.Ta.generateSRPData=olympe.public.Ta.gw;olympe.public.$a=class{static create(a){return new class extends olympe.dc.U.Og{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.Kc(olympe.D.qa),e=b.subscribe(f=>d.update(olympe.D.Ac(f)));olympe.D.Ia().vc(()=>e.unsubscribe());return d.Eb()}}}};
991
- olympe.public.Ne=class{static create(a){return new class extends olympe.dc.Db.Og{N(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.Kc(olympe.D.ea),e=b.subscribe(f=>d.update(olympe.D.ya(f)));olympe.D.Ia().vc(()=>e.unsubscribe());return d.Eb()}}}};'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.ta.Relation,Direction:olympe.dc.za,generateTag:olympe.W.ej,tagToString:olympe.dc.xa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.jh,defineInverseRelation:olympe.dc.Ov,BrickContext:olympe.sc.Ua,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.Ua.lg,registerBrick:olympe.sc.logic.Ba.C,FunctionBrick:olympe.sc.logic.Function,
992
- Context:olympe.sc.Ua,Entry:olympe.dc.ta.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.dm.File,User:olympe.dm.User,Enum:olympe.dm.ig,EnumValue:olympe.dm.Enum,Transaction:olympe.sc.Transaction,BurstTransaction:olympe.dc.ti,QueryResult:olympe.dc.Va,Query:olympe.dc.gb,QuerySingle:olympe.dc.ld,Predicate:olympe.dc.da.$a,
993
- RelatedTo:olympe.dc.da.U.De,Order:olympe.dc.da.km,Config:class{static getParameter(a){return olympe.T.getParameter(a)}},Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequest:olympe.H.wa.nb.ga,Service:olympe.H.wa.nb.zb,RequestType:olympe.H.wa.Jb.Request.ja,Auth:olympe.public.Ta,AuthState:{INIT:olympe.auth.sa.C.INIT,DISCONNECTED:olympe.auth.sa.C.hg,GUEST:olympe.auth.sa.C.Eh,AUTHENTICATING:olympe.auth.sa.C.pi,ERROR:olympe.auth.sa.C.qc,AUTHENTICATED:olympe.auth.sa.C.Ng},Sync:olympe.dc.CloudObject,
994
- BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.ib{static get(){return olympe.dc.Na()}},ListDef:olympe.dc.Aa,instanceToTag:olympe.dc.xa,registerSync:olympe.dc.Ba.C,getUniqueTag:olympe.W.ej,onDestroy:a=>olympe.D.Ia().onDestroy(a),offDestroy:a=>
995
- olympe.D.Ia().Je(a),FollowRules:olympe.dc.Rb,transformers:{Related:olympe.dc.X.Qb,RecursiveRelated:olympe.dc.X.Dc,Distinct:olympe.dc.X.xe,Filter:olympe.dc.X.rc,Limit:olympe.dc.X.$d,Sort:olympe.dc.X.Kd,Union:olympe.dc.X.uf},ListDefPredicate:olympe.public.$a,predicates:{And:olympe.dc.U.Vd,Or:olympe.dc.U.be,Not:olympe.dc.U.kd,Equals:olympe.dc.U.Gc,Contains:olympe.dc.U.Sc,Greater:olympe.dc.U.ye,Smaller:olympe.dc.U.Fe,HasRelated:olympe.dc.U.kf,InstanceOf:olympe.dc.U.lf,Regex:olympe.dc.U.xd},Comparator:olympe.public.Ne,
996
- comparators:{Number:olympe.dc.Db.Number,String:olympe.dc.Db.String,DateTime:olympe.dc.Db.DateTime},valuedefs:{BooleanProperty:olympe.dc.na.ue,StringProperty:olympe.dc.na.oe,NumberProperty:olympe.dc.na.ke,DateTimeProperty:olympe.dc.na.je,Constant:olympe.dc.na.Dd,Tag:olympe.dc.na.sf}});
983
+ function kl(a,b){if(a.N)a.L.debug('Sending getContext request'),Uf(a.U,d=>{d?a.L.error('failed to synchronise (authenticated) with server: '+d.message):(a.L.debug('synchronisation request successful'),bj=a.C,b())});else{var c=olympe.dc.Ed.SUBSCRIBE;const d=olympe.dc.Ed.Li,e=a.F.Wk()?d:c;a.L.debug((a.F.Wk()?'PULLING':'SUBSCRIBING')+' application '+a.C);const f=olympe.D.Ja();c=new olympe.async.sk(f);c.add((g,h)=>{Ze(new olympe.dc.gf(a.C,e),olympe.dc.Sb.pf).hb(k=>{var l=olympe.dc.Ha;var n=(n=olympe.dc.ld.from(a.C).sb(olympe.sc.La.Me.C).sb(olympe.sc.logic.Xd.G.Pc()).bd())&&n.R()||
984
+ olympe.dc.Ha.Vc;l.bc=n;k?h(k.message):g()})});c.add(g=>{olympe.D.wc([a.G.Cg()],h=>{(new olympe.dc.Aa(h)).Ke(f.Cb(g))})});c.add((g,h)=>{const k=olympe.sc.jd.C.Bp,l=olympe.sc.jd.C.Zl;cj(a.C,n=>{switch(n){case k:case l:g();break;default:h('Error while loading the business container')}})});$b(c,(g,h)=>{if(h)throw Error(h);b()});c.start()}}function jl(a){a.L.debug('Stop the application');a.F.Ec().yf()}
985
+ olympe.sc.Xf.rm=class{constructor(a,b,c,d,e,f,g){this.G=a;this.U=b;this.L=c;this.F=d;this.C=e;this.N=f;this.Y=g||!1}run(){const a=olympe.auth.sa.C.Lg,b=olympe.auth.sa.C.fg,c=olympe.auth.sa.C.Ch,d=olympe.auth.sa.C.oi;this.L.debug('runtime starting for app #'+this.C);let e=!1;const f=()=>{e||(il(this),e=!0)};olympe.D.wc([this.G.getState()],g=>{switch(g){case a:case c:this.L.debug('Server session opened, calling once connected callback');kl(this,f);break;case b:this.L.debug('Disconnected, working offline.');
986
+ this.Y&&!e&&kl(this,f);break;case d:this.L.debug('waiting for authentication');break;default:this.L.debug('No server session available, waiting for connection'),e=!1,jl(this)}},'Runtime initial auth state listener')}};olympe.sc.Xf.rm.C='app_instance';olympe.sc.Xf.rm.la=[olympe.uc.ws];olympe.sc.Xf.Ej={pf:'sc.runtime.Main'};
987
+ olympe.T.config(function(a){C(a,olympe.auth.O.Bj,[new olympe.T.fa(olympe.uc.Config.ef),new olympe.T.fa(olympe.sc.Config.ef),new olympe.T.fa(olympe.uc.Config.Gl)],(b,c,d)=>new olympe.auth.ml(d?'':b+(c?'-'+c:'')));A(a,olympe.sc.Xf.Ej.pf,olympe.sc.Xf.rm,olympe.auth.O.va,olympe.dc.query.O.va,olympe.sc.O.Ea,olympe.sc.O.qm,new olympe.T.fa(olympe.sc.Config.ef),new olympe.T.fa(olympe.dc.Config.Yg),new olympe.T.fa(olympe.sc.Config.Wp));olympe.uc.tj(a,olympe.sc.Xf.Ej.pf,'sc.runtime');olympe.uc.tj(a,olympe.sc.Xf.Ej.pf,
988
+ 'sc.headless');olympe.uc.tj(a,olympe.sc.Xf.Ej.pf)},'olympe.sc.runtime');olympe.public={};function ll(a,b){const c=new olympe.auth.Request;for(const [d,e]of a)c.set(d,e);return new Promise(d=>{jc(olympe.public.Ta.get(),c,b,()=>{d()})})}
989
+ olympe.public.Ta=class{static dw(a,b){return olympe.auth.Hb.Ee.bj(a,b)}static getState(){return oc(olympe.public.Ta.get())}static mw(){return olympe.D.Ya(olympe.public.Ta.get().Cg())}static Xx(a){const b=new olympe.D.Wb('Observe user tag','function'===typeof a.Ec?a.Ec():a);return new rxjs.Observable(c=>{b.run(()=>olympe.D.wc([olympe.public.Ta.get().Cg()],d=>{c.next(d);olympe.D.Ja().onDestroy(()=>c.complete())}));return()=>b.destroy()})}static ed(){return olympe.D.Ya(rc(olympe.public.Ta.get()))}static Aw(){return olympe.D.Ya(olympe.public.Ta.get().di())||
990
+ void 0}static ji(){olympe.public.Ta.get().ji()}static ph(a){return new Promise((b,c)=>{olympe.public.Ta.get().ph(a,d=>d?c(d):b())})}static Ax(a,b){return ll((new Map).set('username',a).set('password',b),'srp')}static zx(){return ll(new Map,'saml')}static Bx(a,b){return ll((new Map).set('username',a).set('nonce',b),'localToken')}static yx(){return ll(new Map,'openID')}static sn(){return new Promise(a=>{qc(()=>{olympe.public.Ta.get().ra.delete('logoutCallback');a()});olympe.public.Ta.get().sn()})}static get(){return olympe.auth.Qc()}};
991
+ olympe.public.Ta.logout=olympe.public.Ta.sn;olympe.public.Ta.loginOpenID=olympe.public.Ta.yx;olympe.public.Ta.loginToken=olympe.public.Ta.Bx;olympe.public.Ta.loginSAML=olympe.public.Ta.zx;olympe.public.Ta.loginSRP=olympe.public.Ta.Ax;olympe.public.Ta.getUserFromToken=olympe.public.Ta.ph;olympe.public.Ta.sendKeepAlive=olympe.public.Ta.ji;olympe.public.Ta.getIDPToken=olympe.public.Ta.Aw;olympe.public.Ta.getToken=olympe.public.Ta.ed;olympe.public.Ta.observeUser=olympe.public.Ta.Xx;
992
+ olympe.public.Ta.getCurrentUser=olympe.public.Ta.mw;olympe.public.Ta.getState=olympe.public.Ta.getState;olympe.public.Ta.generateSRPData=olympe.public.Ta.dw;olympe.public.$a=class{static create(a){return new class extends olympe.dc.V.Mg{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.Kc(olympe.D.qa),e=b.subscribe(f=>d.update(olympe.D.Ac(f)));olympe.D.Ja().vc(()=>e.unsubscribe());return d.Eb()}}}};
993
+ olympe.public.Ne=class{static create(a){return new class extends olympe.dc.Db.Mg{N(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.Kc(olympe.D.ea),e=b.subscribe(f=>d.update(olympe.D.ya(f)));olympe.D.Ja().vc(()=>e.unsubscribe());return d.Eb()}}}};'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.ta.Relation,Direction:olympe.dc.za,generateTag:olympe.W.cj,tagToString:olympe.dc.xa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.hh,defineInverseRelation:olympe.dc.Lv,BrickContext:olympe.sc.Ua,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.Ua.jg,registerBrick:olympe.sc.logic.Ba.C,FunctionBrick:olympe.sc.logic.Function,
994
+ Context:olympe.sc.Ua,Entry:olympe.dc.ta.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.dm.File,User:olympe.dm.User,Enum:olympe.dm.gg,EnumValue:olympe.dm.Enum,Transaction:olympe.sc.Transaction,BurstTransaction:olympe.dc.si,QueryResult:olympe.dc.Va,Query:olympe.dc.gb,QuerySingle:olympe.dc.ld,Predicate:olympe.dc.da.$a,
995
+ RelatedTo:olympe.dc.da.V.De,Order:olympe.dc.da.fm,Config:class{static getParameter(a){return olympe.T.getParameter(a)}},Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequest:olympe.H.wa.nb.ga,Service:olympe.H.wa.nb.zb,RequestType:olympe.H.wa.Jb.Request.ja,Auth:olympe.public.Ta,AuthState:{INIT:olympe.auth.sa.C.INIT,DISCONNECTED:olympe.auth.sa.C.fg,GUEST:olympe.auth.sa.C.Ch,AUTHENTICATING:olympe.auth.sa.C.oi,ERROR:olympe.auth.sa.C.cc,AUTHENTICATED:olympe.auth.sa.C.Lg},Sync:olympe.dc.CloudObject,
996
+ BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.ib{static get(){return olympe.dc.Na()}},ListDef:olympe.dc.Aa,instanceToTag:olympe.dc.xa,registerSync:olympe.dc.Ba.C,getUniqueTag:olympe.W.cj,onDestroy:a=>olympe.D.Ja().onDestroy(a),offDestroy:a=>
997
+ olympe.D.Ja().Je(a),FollowRules:olympe.dc.Sb,transformers:{Related:olympe.dc.X.Qb,RecursiveRelated:olympe.dc.X.Dc,Distinct:olympe.dc.X.xe,Filter:olympe.dc.X.rc,Limit:olympe.dc.X.Zd,Sort:olympe.dc.X.Kd,Union:olympe.dc.X.sf},ListDefPredicate:olympe.public.$a,predicates:{And:olympe.dc.V.Ud,Or:olympe.dc.V.ae,Not:olympe.dc.V.kd,Equals:olympe.dc.V.Gc,Contains:olympe.dc.V.Sc,Greater:olympe.dc.V.ye,Smaller:olympe.dc.V.Fe,HasRelated:olympe.dc.V.hf,InstanceOf:olympe.dc.V.jf,Regex:olympe.dc.V.xd},Comparator:olympe.public.Ne,
998
+ comparators:{Number:olympe.dc.Db.Number,String:olympe.dc.Db.String,DateTime:olympe.dc.Db.DateTime},valuedefs:{BooleanProperty:olympe.dc.na.ue,StringProperty:olympe.dc.na.oe,NumberProperty:olympe.dc.na.ke,DateTimeProperty:olympe.dc.na.ie,Constant:olympe.dc.na.Dd,Tag:olympe.dc.na.qf}});
997
999
 
998
1000
 
999
1001
  }.bind(this))();